/* Classroom view and downloadable worksheet layout. */
#presentCount { display:block; min-height:48px; padding:.6rem 1rem; margin:.5rem 0; font:inherit; border:1px solid #879ab6; border-radius:8px; background:#fff; color:#0c1d40; }
.classroom-finish { display:grid; grid-template-columns:1.3fr 1fr; align-items:center; gap:3vw; padding:2vw; }
.classroom-finish h2 { font-size:clamp(2rem,4vw,4.5rem); line-height:1.15; margin:1rem 0; }
.classroom-finish p { font-size:clamp(1.2rem,2vw,2rem); }
.classroom-scan { text-align:center; }
.classroom-scan svg { display:block; width:min(36vw,380px); margin:auto; }
.classroom-scan a { display:block; font-size:clamp(1.1rem,2vw,2rem); font-weight:700; overflow-wrap:anywhere; }
.classroom-scan p { font-size:1rem; max-width:40ch; margin:1rem auto; }
.classroom-finish>.btn { justify-self:start; }
@media(max-width:720px) { .classroom-finish { grid-template-columns:1fr; } .classroom-scan svg {width:min(70vw,300px)} }
.teacher-main { max-width:1160px; }
.teacher-actions { display:grid; grid-template-columns:1fr 1.35fr; gap:1.2rem; margin:1.5rem 0 2.5rem; }
.teacher-action-card { padding:1.6rem; border:1px solid #c8d5e9; border-radius:16px; background:#f0f5ff; }
.teacher-action-card h2 { margin:.5rem 0; font-size:1.55rem; }
.teacher-action-card p { max-width:52ch; }
.teacher-action-card .result__actions { margin-top:1rem; }
.teacher-pdf-settings { display:flex; align-items:center; flex-wrap:wrap; gap:.7rem; }
.teacher-topic-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.4rem; max-height:320px; overflow:auto; margin:1rem 0; }
.teacher-topic-choice { display:flex; align-items:flex-start; gap:.6rem; padding:.6rem; border:1px solid #c8d5e9; border-radius:8px; font-size:.9rem; }
.teacher-topic-choice input { width:22px; height:22px; flex-shrink:0; }
#teacherCustom { margin:1rem 0; } #teacherTopicFields { border:1px solid #c8d5e9; border-radius:10px; padding:1rem; margin-top:1rem; }
#teacherTopicSearch { width:100%; font-size:16px; padding:.6rem; } .teacher-replace { margin-left:1rem; }
.teacher-pdf-settings select { min-height:44px; padding:.5rem .8rem; border:1px solid #aab6c8; border-radius:8px; background:white; font:inherit; font-size:16px; }
.teacher-share { padding:1rem 0; margin-bottom:1.5rem; border-block:1px solid #ccd3df; }
.teacher-share summary { cursor:pointer; padding:.7rem 0; font-weight:600; }
.teacher-share .result__actions { margin:1rem 0; }
.teacher-question-body { min-width:0; }
.teacher-display { position:fixed; inset:0; width:100%; max-width:none; height:100dvh; max-height:none; margin:0; padding:0; border:0; background:#fff; color:#0c1d40; overflow:auto; }
.teacher-display::backdrop { background:#0c1d40; }
.teacher-display-chrome { position:sticky; top:0; z-index:2; background:white; padding-bottom:.5rem; }
.teacher-display-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.8rem; padding:1rem 2rem; background:#eef3fb; border-bottom:1px solid #cad5e6; }
.teacher-display-bar h2 { font:700 1.3rem var(--font-sans); margin:0 0 .3rem; }
.teacher-display-bar p { margin:0; font-size:.95rem; }
.teacher-display-tools { display:flex; flex-wrap:wrap; gap:.5rem; }
.teacher-display-nav { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; padding:1rem 2rem; }
.teacher-display-nav nav { display:flex; gap:.4rem; flex-wrap:wrap; }
.teacher-display-nav .teacher-number { min-width:44px; min-height:44px; padding:.5rem; }
.teacher-number[aria-current=true] { background:#0c1d40; color:#fff; border-color:#0c1d40; }
.teacher-display #displayReveal { margin-left:auto; }
.teacher-display #displayStatus { padding:0 2rem; margin:0; }
.teacher-display-body { max-width:1760px; margin:auto; padding:.8rem 3vw 1.2rem; outline-offset:-4px; }
.teacher-display .teacher-question { box-shadow:none; border:0; padding:0; margin:0; }
.teacher-display .teacher-question h3 { display:none; font:700 clamp(1.4rem,2.4vw,2rem) var(--font-sans); margin-bottom:.5rem; }
.teacher-display .teacher-question .tool-note { font-size:1rem; }
.teacher-display .q-text { font-size:clamp(1.35rem,1.9vw,2rem); line-height:1.6; margin:1rem 0; }
.teacher-display .q-text p { margin-bottom:1rem; }
.teacher-display .teacher-diagram { display:flex; align-items:flex-start; justify-content:center; margin:0; min-width:0; }
.teacher-display .teacher-diagram svg { width:100%; max-height:65vh; height:auto; }
.teacher-display-answer { max-width:1500px; margin:0 auto 2rem; padding:0 3vw; font-size:clamp(1.2rem,1.8vw,1.7rem); scroll-margin-top:230px; }
.teacher-display-answer .teacher-answer-body { line-height:1.6; }
.teacher-display-answer .teacher-answer-body ol { font-size:inherit; }
.teacher-display-answer h4 { font-size:1.2rem; margin-bottom:.7rem; }
.teacher-display-answer li { margin-bottom:.65rem; }
.teacher-display-answer .teacher-diagram { max-width:850px; margin:1.2rem auto; }
.teacher-display-body.is-overview { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2rem; }
.teacher-display .is-overview .teacher-question { padding:1.2rem; border:1px solid #c8d5e9; border-radius:12px; }
.teacher-display .is-overview .teacher-question h3 { display:block; }
.teacher-display .is-overview .q-text { font-size:1.15rem; }
.teacher-display .is-overview .teacher-diagram svg { max-height:300px; }
.teacher-display .is-overview .teacher-question-body { display:block; }
.teacher-display .is-overview .teacher-question .btn { margin-top:1rem; }
@media(min-width:1100px) {
  .teacher-display .teacher-question-body.has-diagram { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); align-items:start; gap:3vw; }
  .teacher-display .is-overview .teacher-question-body { display:block; }
}
@media(max-width:720px) {
  .teacher-topic-list { grid-template-columns:1fr; }
  .teacher-display-chrome { position:static; }
  .teacher-display-answer { scroll-margin-top:1rem; }
  .teacher-actions { grid-template-columns:1fr; }
  .teacher-action-card { padding:1.2rem; }
  .teacher-display-bar,.teacher-display-nav { padding:1rem; }
  .teacher-display #displayStatus { padding:0 1rem; }
  .teacher-display-nav nav { order:-1; width:100%; justify-content:center; }
  .teacher-display #displayReveal { margin-left:0; }
  .teacher-display-body.is-overview { grid-template-columns:1fr; }
}
/* A separate, inert staging area is captured for PDFs; never capture open answers from the page. */
.teacher-pdf-stage { position:fixed; top:0; left:-10000px; width:680px; pointer-events:none; }
.teacher-pdf-block { width:680px; box-sizing:border-box; padding:4px 8px; background:white; color:#111; font-family:Arial, sans-serif; font-size:18px; line-height:1.55; }
.teacher-pdf-block .q-text { font-size:18px; line-height:1.55; margin:0; }
.teacher-pdf-block p { margin:0 0 12px; }
.teacher-pdf-block p:last-child { margin-bottom:0; }
.teacher-pdf-block .q-scroll { overflow:visible; max-height:none; }
.teacher-pdf-block table { min-width:0 !important; max-width:100%; font-size:16px; }
.teacher-pdf-block td,.teacher-pdf-block th { padding:7px 10px; }
.teacher-pdf-block .teacher-diagram { display:flex; flex-direction:column; align-items:center; overflow:visible; margin:8px 0; }
.teacher-pdf-block .teacher-diagram p { font-size:16px; font-weight:700; margin-top:8px; }
.teacher-pdf-block svg { width:100%; height:auto; max-height:390px; }
.teacher-pdf-block .teacher-answer-body { border:0; padding:0; margin:0; background:white; font-size:18px; overflow:visible; }
.teacher-pdf-block ol { padding-left:28px; margin:0; }
.teacher-pdf-block li { margin-bottom:10px; padding-left:3px; }
.teacher-pdf-block h4 { font:700 18px Arial,sans-serif; margin:6px 0 12px; }
.teacher-pdf-block .solution__final { margin:10px 0; font-weight:700; }
.teacher-pdf-stage.is-compact .teacher-pdf-block,.teacher-pdf-stage.is-compact .q-text { font-size:16px; line-height:1.4; }
.teacher-pdf-stage.is-compact p { margin-bottom:8px; }
.teacher-pdf-stage.is-compact li { margin-bottom:6px; }
.teacher-pdf-stage.is-compact td,.teacher-pdf-stage.is-compact th { padding:5px 8px; }
.teacher-print-solutions { display:none; }
@media print {
  .teacher-actions,.teacher-display,.teacher-pdf-stage { display:none !important; }
  .teacher-question-body { display:block !important; }
  .teacher-page.print-answers .teacher-answer,.teacher-page.print-answers .print-answer-label { display:none !important; }
  .teacher-page.print-answers .teacher-working { display:block !important; }
  .teacher-page.print-answers .teacher-print-solutions { display:block; break-before:page; page-break-before:always; }
  .teacher-print-solutions .teacher-solution { break-inside:avoid; }
  .teacher-page.print-compact .teacher-working { height:16mm !important; }
  .teacher-page.print-compact .tool-card { padding:2mm 0; margin-bottom:2mm; }
  .teacher-page.print-compact .q-text { font-size:10pt; line-height:1.4; }
}
.teacher-display .proof-visual{max-width:900px;margin:2rem auto}
.teacher-display .proof-visual svg{width:100%}
.teacher-display.is-working .teacher-display-body {max-height:26vh;overflow:auto;border-bottom:1px solid #c8d5e9}
.teacher-display.is-working .teacher-display-body .teacher-diagram {display:none}
.teacher-display.is-working .teacher-question-body.has-diagram{display:block}
.teacher-display.is-working .proof-visual .diagram-viewer-trigger{display:none}
.teacher-display.is-working .teacher-display-answer {margin-top:1rem}
.teacher-display.is-working .proof-visual {margin:.5rem auto}
.teacher-display.is-working .proof-visual svg,.teacher-display.is-working .teacher-answer-body>.teacher-diagram svg {max-height:34vh}
@media(min-width:1100px){
 .teacher-display.is-working[open]{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);grid-template-rows:auto minmax(0,1fr);overflow:hidden}
 .teacher-display.is-working .teacher-display-chrome{grid-column:1/-1}
 .teacher-display.is-working .teacher-display-body{width:100%;max-height:none;height:100%;overflow:auto;padding:1rem 1.5rem;margin:0;border-right:1px solid #c8d5e9;border-bottom:0}
 .teacher-display.is-working .teacher-display-body .q-text{font-size:clamp(1.2rem,1.6vw,1.5rem);line-height:1.5}
 .teacher-display.is-working .teacher-display-answer{width:100%;height:100%;overflow:auto;padding:1rem;margin:0}
 .teacher-display.is-working .proof-visual svg{max-height:39vh}
 .teacher-display.is-working .proof-visual .diagram-viewer-trigger{display:none}
 .teacher-display.is-working .proof-visual figcaption{font-size:1.1rem;line-height:1.4}
}
.teacher-display .proof-visual figcaption{font-size:clamp(18px,1.6vw,24px)}
.teacher-pdf-block .proof-visual .diagram-viewer-trigger{display:none}
