/* Focused question-taking workspace. Shared by assessments, practice, and events. */
body.test-focus{height:100dvh;min-height:0;overflow:hidden;display:flex;flex-direction:column;background:var(--zumi-page,#faf7ff);color:var(--zumi-ink,#332849)}
body.test-focus>header,body.test-focus>.zumi-role-nav,body.test-focus>nav.zumi-role-nav,body.test-focus>.learner-switch-toast,body.test-focus>footer.site-footer{display:none!important}
body.test-focus>main{width:100%;max-width:none;min-height:0;flex:1;display:flex;overflow:hidden;margin:0;padding:0}
body.test-focus .practice-buddy{display:none!important}
.tw-workspace{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;height:100dvh;width:100%;overflow:hidden}
.tw-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:9px clamp(12px,2vw,32px);min-height:59px;flex:none;background:var(--zumi-surface,#fff);border-bottom:1px solid var(--zumi-border,#e8dff2)}
.tw-heading,.tw-status{display:flex;align-items:center;gap:16px;min-width:0}
.tw-wordmark{font-size:23px;font-weight:900;letter-spacing:-1.1px;color:var(--zumi-accent,#8055cb);white-space:nowrap}
.tw-divider{height:28px;width:1px;background:var(--zumi-border,#e8dff2)}
.tw-title{display:flex;flex-direction:column;gap:2px;color:var(--zumi-ink,#332849);font-size:14px;font-weight:850;line-height:1.25}
.tw-title small{color:var(--zumi-muted,#84798f);font-size:11px;font-weight:650}
.tw-status{flex:none;justify-content:flex-end;color:var(--zumi-muted,#716781);font-size:13px}
.tw-count{white-space:nowrap;font-variant-numeric:tabular-nums}
.tw-count strong{color:var(--zumi-ink,#332849)}
.tw-progress{height:5px;width:100%;background:var(--zumi-border,#e8dff2);overflow:hidden;flex:none}
.tw-progress>span{display:block;height:100%;background:var(--zumi-accent,#7956cf);border-radius:0 6px 6px 0}
.tw-timer{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--zumi-border,#e8dff2);border-radius:11px;padding:8px 12px;background:var(--zumi-accent-soft,#f1e9ff);color:var(--zumi-on-accent-soft,#6845a6);font-weight:850;font-variant-numeric:tabular-nums;white-space:nowrap}
.tw-timer:before{content:"◷";font-size:16px}
.tw-timer.event-question-timer-low{background:#fff0e8;color:#a64027;border-color:#ffd1ba}
.tw-layout{display:grid;grid-template-columns:minmax(0,1fr) 72px;gap:10px;flex:1;min-height:0;overflow:hidden;padding:clamp(8px,1.25vh,14px) clamp(10px,2vw,32px)}
.tw-workspace[data-active-tool="calculator"] .tw-layout,.tw-workspace[data-active-tool="scratchpad"] .tw-layout{grid-template-columns:minmax(0,1fr) clamp(280px,28vw,355px)}
/* Reserve the question's width: expanding the scratchpad never overlays answers. */
.tw-workspace[data-active-tool="scratchpad"] .tw-layout{grid-template-columns:minmax(0,1fr) minmax(0,var(--tw-scratch-width,440px))}
.tw-workspace[data-active-tool="scratchpad"] .tw-tools{position:relative;overflow:visible}
body.test-focus .tw-question-card{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;max-height:100%;overflow:hidden;padding:clamp(12px,2vh,24px) clamp(13px,2.2vw,30px);background:var(--zumi-surface,#fff);border:1px solid var(--zumi-border,#e8dff2);border-radius:24px;box-shadow:0 7px 32px #46336509}
.tw-question-card .meta{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;color:var(--zumi-muted,#716781);font-size:12px}
.tw-question-card .meta span:first-child{display:inline-flex;align-items:center;padding:7px 12px;border-radius:999px;background:var(--zumi-accent-soft,#f2ebff);color:var(--zumi-on-accent-soft,#6544a4);font-weight:750}
.tw-question-card .meta a{color:var(--zumi-accent,#7956cf)}
.tw-question-card .tw-question-content{width:100%;max-width:1050px;margin:0 auto;flex:1;min-height:0;height:100%;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden}
/* Size the answer shelf to its actual content and pin it to the bottom.
   Question length and diagram size never reposition the answers. */
.tw-prompt-region{min-width:0;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;padding:0 6px 12px 0}
.tw-answer-region{min-width:0;min-height:0;height:auto;display:flex;flex-direction:column;padding-top:10px;border-top:1px solid var(--zumi-border,#e8dff2)}
.tw-answer-title{flex:none;margin:0 0 9px;color:var(--zumi-muted,#716781);font-size:12px;font-weight:800}
.tw-answer-region form{display:flex;flex:0 1 auto;min-height:0;flex-direction:column}
.tw-answer-region .actions{flex:none;margin-top:auto}
.tw-answer-region .tw-choices-many{grid-template-columns:repeat(2,minmax(0,1fr))}
.tw-answer-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(7px,1vw,18px);min-width:0}
.tw-answer-group{min-width:0;padding:0;margin:0;border:0}
.tw-answer-group legend{padding:0 0 7px;color:var(--zumi-ink,#332849);font-size:12px;font-weight:850}
.tw-answer-group .choices{grid-template-columns:minmax(0,1fr)}
.tw-answer-group .choice{min-height:36px;padding:6px 9px}
.tw-prompt-part{margin:12px 0 8px;padding-top:10px;border-top:1px solid var(--zumi-border,#e8dff2)}
.tw-answer-error{color:#a84529;margin:0 0 7px;font-size:12px;font-weight:700}
.tw-answer-region--interactive [role="status"]{margin:0;overflow-y:auto}
.tw-answer-region--interactive .actions{margin-top:auto}
.tw-question-card h1{margin:clamp(10px,1.8vh,20px) 0 clamp(10px,1.7vh,18px);color:var(--zumi-ink,#332849);font-size:clamp(20px,2.15vw,30px);letter-spacing:-.025em;font-weight:800;line-height:1.3;overflow-wrap:anywhere}
.tw-question-card h2{margin:10px 0 8px;color:var(--zumi-ink,#332849);font-size:clamp(16px,1.9vw,20px);line-height:1.3}
.tw-question-card .choices{display:grid;gap:clamp(5px,.9vh,9px);max-width:950px}
.tw-question-card .choice{display:flex;align-items:center;gap:10px;min-height:clamp(40px,5.5vh,54px);padding:7px 12px;border:1.5px solid var(--zumi-border,#e9e3f3);background:var(--zumi-surface,#fff);border-radius:15px;color:var(--zumi-ink,#332849);font-size:clamp(14px,1.25vw,16px);line-height:1.32;transition:border-color .15s,background .15s;cursor:pointer;overflow-wrap:anywhere}
.tw-question-card .choice:hover{border-color:var(--zumi-accent,#8660c9)}
.tw-question-card .choice:has(input:checked){background:var(--zumi-selection,#f6f0ff);border-color:var(--zumi-accent,#8056cc)}
.tw-question-card .choice input{width:18px;height:18px;flex:none;accent-color:var(--zumi-accent,#7956cf)}
.tw-question-card .choice .letter{display:grid;place-items:center;min-width:27px;height:27px;flex:none;border:1px solid var(--zumi-border,#e8dff2);border-radius:9px;color:var(--zumi-accent,#8056cc);font-size:13px;font-weight:850;background:var(--zumi-surface-soft,#f8f4ff)}
.tw-question-card .actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin-top:auto;padding-top:clamp(9px,1.7vh,17px)}
.tw-question-card .tw-answer-region form{display:flex;flex:0 1 auto;min-height:0;flex-direction:column}
.tw-question-card .actions .primary,.tw-question-card .actions .secondary{min-height:42px;padding:9px 18px;border-radius:13px;font-weight:800;font-size:14px}
.tw-question-card [data-question-visual]{max-width:100%;overflow-x:auto}
.tw-question-card [data-question-visual] :is(canvas,svg,img){max-width:100%}
.tw-question-card .eyebrow{font-size:10px;letter-spacing:.12em}
.tw-question-card [role="alert"]{color:#a84529}
.tw-question-card :is(a,button,input,textarea):focus-visible,.tw-prompt-region:focus-visible,.tw-tools :is(summary,button,textarea):focus-visible{outline:3px solid var(--zumi-focus,#a78be6);outline-offset:3px}
.tw-tools{position:static;align-self:stretch;display:flex;flex-direction:column;gap:7px;min-width:0;min-height:0;overflow:hidden;z-index:1}
.tw-tool{position:relative;min-width:0}
.tw-scratch-resize{display:none;position:absolute;z-index:4;top:50%;left:-15px;transform:translateY(-50%);width:20px;height:92px;align-items:center;justify-content:center;border:1px solid var(--zumi-border,#e8dff2);border-radius:12px;background:var(--zumi-surface,#fff);box-shadow:0 3px 10px #46336520;color:var(--zumi-muted,#746583);font-size:23px;cursor:ew-resize;touch-action:none;user-select:none}
.tw-scratch-resize:hover,.tw-scratch-resize:focus-visible{border-color:var(--zumi-accent,#7956cf);color:var(--zumi-accent,#7956cf);outline-offset:2px}
.tw-workspace[data-active-tool="scratchpad"] .tw-scratch-resize{display:flex}
.tw-tool[open]{display:flex;flex:1;flex-direction:column;min-height:0}
.tw-tool>summary{list-style:none;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;min-height:65px;padding:7px 4px;border:1px solid var(--zumi-border,#e8dff2);border-radius:17px;background:var(--zumi-surface,#fff);color:var(--zumi-muted,#75648b);cursor:pointer;box-shadow:0 5px 18px #46336509;user-select:none}
.tw-tool>summary::-webkit-details-marker{display:none}
.tw-tool[open]>summary{flex-direction:row;gap:9px;min-height:43px;flex:none;padding:8px}
.tw-tool>summary:hover,.tw-tool[open]>summary{color:var(--zumi-accent,#7956cf);border-color:var(--zumi-accent,#7956cf);background:var(--zumi-accent-soft,#f5efff)}
.tw-tool-icon{font-size:26px;line-height:1}
.tw-tool-caption{font-size:10px;font-weight:800;letter-spacing:-.02em}
.tw-tool-panel{position:static;right:auto;top:auto;width:100%;flex:1;min-height:0;padding:clamp(10px,1.4vw,15px);background:var(--zumi-surface,#fff);border:1px solid var(--zumi-border,#e7ddf4);border-radius:16px;box-shadow:none;color:var(--zumi-ink,#332849);max-height:none;overflow-y:auto;overscroll-behavior:contain}
.tw-tool-panel-head{display:flex;flex-direction:column;gap:4px;margin-bottom:13px}
.tw-tool-panel-head strong{font-size:17px}
.tw-tool-panel-head span{font-size:11px;color:var(--zumi-muted,#7b7089)}
.tw-scratch-head{flex-direction:row;align-items:flex-start;justify-content:space-between;gap:6px}
.tw-scratch-head>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.tw-scratch-expand{border:1px solid var(--zumi-border,#e8dff2);border-radius:10px;padding:7px 9px;background:var(--zumi-accent-soft,#f3ecff);color:var(--zumi-on-accent-soft,#6b47ab);font-size:11px;font-weight:800;white-space:nowrap;cursor:pointer}
.tw-scratch-expand:hover,.tw-scratch-expand:focus-visible{border-color:var(--zumi-accent,#7956cf)}
.tw-scratch-expand:disabled{opacity:.6;cursor:not-allowed}
.tw-calculator-display{display:flex;justify-content:flex-end;align-items:center;min-height:48px;padding:9px 12px;border-radius:12px;background:var(--zumi-surface-soft,#f5f0fb);font-size:clamp(19px,2vw,27px);font-weight:800;font-variant-numeric:tabular-nums;text-align:right;overflow-wrap:anywhere;word-break:break-all}
.tw-calculator-keys{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:10px}
.tw-calculator-keys button{min-height:clamp(36px,5.5vh,44px);border:1px solid var(--zumi-border,#e8dff2);border-radius:10px;background:var(--zumi-surface-soft,#faf7ff);color:var(--zumi-ink,#34294e);font:inherit;font-size:17px;font-weight:750;cursor:pointer}
.tw-calculator-keys button:hover{background:var(--zumi-selection,#ede3ff)}
.tw-calculator-keys .tw-key-accent{color:var(--zumi-accent-text,#fff);background:var(--zumi-accent,#7956cf);border-color:var(--zumi-accent,#7956cf)}
.tw-calculator-keys .tw-key-accent:hover{background:var(--zumi-accent-hover,#6842b7)}
.tw-draw-tools{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin:0 0 9px}
.tw-draw-tools button{border:1px solid var(--zumi-border,#e8dff2);border-radius:9px;background:var(--zumi-surface-soft,#faf7ff);color:var(--zumi-ink,#332849);padding:7px 9px;font-size:11px;font-weight:750;cursor:pointer}
.tw-draw-tools button[aria-pressed="true"]{background:var(--zumi-accent-soft,#f3ecff);color:var(--zumi-on-accent-soft,#6b47ab);border-color:var(--zumi-accent,#7956cf)}
.tw-draw-tools button:last-child{margin-left:auto}
.tw-draw-canvas{display:block;width:100%;height:clamp(110px,20dvh,178px);aspect-ratio:auto;margin-bottom:9px;border:1px solid var(--zumi-border,#e8dff2);border-radius:12px;background-color:#fff;background-image:linear-gradient(#f1eaf9 1px,transparent 1px),linear-gradient(90deg,#f1eaf9 1px,transparent 1px);background-size:21px 21px;touch-action:none;cursor:crosshair}
/* The bitmap's 10:7 ratio is preserved while drawing area grows with sidebar width.
   If it exceeds screen height, only the tool's internal panel scrolls. */
.tw-workspace[data-active-tool="scratchpad"] .tw-draw-canvas{width:100%;height:auto;aspect-ratio:10 / 7;max-height:none}
.tw-workspace[data-active-tool="scratchpad"] .tw-tool-panel{scrollbar-gutter:stable}
.tw-scratch-label{display:block;font-size:11px;font-weight:800;color:var(--zumi-muted,#7b7089);margin:0 0 7px}
.tw-tool-panel textarea{width:100%;height:clamp(76px,13dvh,132px);min-height:76px;max-height:none;padding:10px;resize:none;border-radius:12px;border:1px solid var(--zumi-field-border,#ddd3ea);background:var(--zumi-field,#fff);color:var(--zumi-ink,#332849);font:inherit;font-size:14px;line-height:1.65}
.tw-scratch-actions{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-top:8px}
.tw-scratch-actions span{font-size:10px;color:var(--zumi-muted,#8b7c96)}
.tw-scratch-actions button{border:0;background:var(--zumi-accent-soft,#f3ecff);color:var(--zumi-on-accent-soft,#6b47ab);border-radius:9px;padding:9px 11px;font-size:11px;font-weight:800;cursor:pointer}
.tw-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px clamp(12px,2vw,32px) 8px;flex:none;color:var(--zumi-muted,#847992);font-size:11px;border-top:1px solid var(--zumi-border,#e8dff2);background:var(--zumi-surface,#fff)}
.tw-footer-tip{white-space:nowrap}
.tw-event-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding-top:9px;margin-top:10px;border-top:1px solid var(--zumi-border,#e8dff2)}
.tw-event-actions p{margin:0;color:var(--zumi-muted,#85778f);font-size:12px;line-height:1.5}
.tw-event-actions form{display:block;flex:none}
.tw-event-actions .event-question-finish{font-size:12px;min-height:40px}
/* Keep the entire set of ordinary four choices and the next action visible at standard
   laptop heights. Long diagrams / accessible zoom can still scroll inside the question. */
/* Compact answer grids are only needed when vertical space is limited. */
@media(max-height:730px) and (min-width:760px){
  .tw-answer-region:not(:has(.tw-answer-groups)) .choices{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-height:625px){
  .tw-question-card .choice{min-height:36px;padding:5px 9px}
  .tw-answer-region .choices{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tw-answer-group .choices{grid-template-columns:minmax(0,1fr)}
  .tw-answer-region .actions{padding-top:6px}
}
@media(max-width:720px){
  .tw-header{padding:8px 12px;min-height:56px;gap:8px}
  .tw-heading,.tw-status{gap:7px}
  .tw-title{font-size:11px}
  .tw-title small{font-size:10px}
  .tw-wordmark{font-size:18px}
  .tw-divider{height:22px}
  .tw-status{font-size:11px}
  /* No floating modal: tools open within the available viewport below the question. */
  .tw-layout,.tw-workspace[data-active-tool="calculator"] .tw-layout,.tw-workspace[data-active-tool="scratchpad"] .tw-layout{
    grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:6px;padding:8px 9px
  }
  body.test-focus .tw-question-card{padding:clamp(10px,2.4vw,18px);border-radius:15px}
  .tw-question-card h1{font-size:clamp(18px,4.5vw,24px);margin:9px 0 11px;line-height:1.28}
  .tw-question-card .choice{gap:8px;min-height:40px;padding:6px 9px;font-size:14px}
  .tw-question-card .choice .letter{min-width:25px;height:25px}
  .tw-question-card .actions{padding-top:9px}
  .tw-answer-region{padding-top:7px}
  .tw-answer-title{font-size:11px;margin-bottom:6px}
  .tw-answer-groups{gap:6px}
  .tw-answer-group .choice{padding:4px 6px;gap:5px;font-size:12px;min-height:34px}
  .tw-answer-group .choice .letter{min-width:22px;height:22px;font-size:11px}
  /* An open tool changes available question height, not the answer shelf allocation. */
  .tw-workspace[data-active-tool="calculator"] .tw-tools,
  .tw-workspace[data-active-tool="scratchpad"] .tw-tools{max-height:clamp(110px,21dvh,170px)}
  .tw-workspace[data-active-tool="calculator"] .tw-tool[open],
  .tw-workspace[data-active-tool="scratchpad"] .tw-tool[open]{max-height:clamp(100px,20dvh,165px)}
  .tw-tools{display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;align-content:start;align-self:end;gap:6px;max-height:45dvh;overflow-y:auto}
  .tw-workspace[data-active-tool="scratchpad"] .tw-tools{position:static;overflow-y:auto}
  .tw-scratch-resize,.tw-workspace[data-active-tool="scratchpad"] .tw-scratch-resize{display:none}
  .tw-scratch-expand{display:none}
  .tw-tool:not([open]){order:1;flex:1 1 0}
  .tw-tool[open]{order:2;flex:1 1 100%;max-height:38dvh;min-height:0}
  .tw-tool>summary{min-height:41px;flex-direction:row;gap:6px;padding:6px;box-shadow:none}
  .tw-tool-icon{font-size:19px}
  .tw-tool-caption{font-size:11px}
  .tw-tool[open]>summary{min-height:36px}
  .tw-tool-panel{padding:9px;border-radius:12px}
  .tw-calculator-keys{gap:5px;margin-top:5px}
  .tw-calculator-keys button{min-height:32px}
  .tw-draw-canvas{height:104px}
  .tw-workspace[data-active-tool="scratchpad"] .tw-draw-canvas{height:auto;min-height:150px;max-height:none}
  .tw-tool-panel textarea{height:75px}
  .tw-footer{padding:5px 10px;font-size:10px}
}
@media(max-width:430px){
  .tw-title{max-width:125px;overflow:hidden;text-overflow:ellipsis}
  .tw-status{gap:4px;flex-direction:column;align-items:flex-end}
  .tw-timer{font-size:11px;padding:4px 8px}
  .tw-question-card .meta{align-items:flex-start}
  .tw-question-card .actions .primary{flex:1;text-align:center}
  .tw-footer-tip{display:none}
}
/* At large browser zoom or unusually short screens, don't clip essential content. */
@media(max-height:500px){
  body.test-focus{height:auto;min-height:100dvh;overflow-y:auto}
  body.test-focus>main{overflow:visible}
  .tw-workspace{height:auto;min-height:100dvh;overflow:visible}
  .tw-layout{overflow:visible}
  body.test-focus .tw-question-card{overflow:visible;height:auto;max-height:none}
  .tw-question-card .tw-question-content{height:auto;min-height:500px;grid-template-rows:minmax(180px,1fr) auto;overflow:visible}
  .tw-prompt-region{overflow-y:auto}
  .tw-tools{overflow:visible;max-height:none}
  .tw-tool[open]{max-height:none}
}
@media(prefers-reduced-motion:reduce){.tw-question-card .choice{transition:none}}
