/* Shared classroom surfaces. Course styles own content, not viewport caps or scaling. */
:root {
  --classroom-gutter: 8px;
  --classroom-text: 18px;
  --classroom-secondary: 16px;
  --classroom-heading: 36px;
  --classroom-subheading: 26px;
  --classroom-count: 48px;
  --classroom-count-label: 22px;
}
@media (min-width: 700px) { :root { --classroom-gutter: 16px; } }
@media (min-width: 1200px) {
  :root { --classroom-gutter: clamp(24px, 1.875vw, 36px); }
}
.classroom-shell {
  width: calc(100% - 2 * var(--classroom-gutter));
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
}
.topbar-inner.classroom-topbar-inner { width: 100%; max-width: none; }
.classroom-canvas {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: var(--classroom-gutter);
}
html.classroom-embedded[data-classroom-role="teacher"] .classroom-canvas {
  padding-inline: 0;
}
html[data-classroom-role="shell"] .app.classroom-viewport {
  width: 100%; max-width: none; margin: 0; padding: 0;
}
html[data-classroom-role="shell"] #stage-concept { height: 100dvh; }
html[data-classroom-role="shell"] #stage-concept iframe { border-radius: 0; }
/* Preserve the course controller's hidden state; only active frames occupy space. */
.classroom-shell > iframe:not([hidden]) { display: block; width: 100%; max-width: none; }
/* Teacher documents share the outer page's scroll; records grow with content. */
html[data-classroom-role="teacher"] .screen :is(.inspect-list, .trace-list) { max-height: none; overflow: visible; }
html.classroom-embedded[data-classroom-role="teacher"] .result-toggle {
  top: calc(var(--classroom-visible-top, 0px) + .42 * var(--classroom-visible-height, 100vh));
}
html.classroom-embedded[data-classroom-role="teacher"] dialog[open] {
  top: calc(var(--classroom-visible-top, 0px) + 16px);
  bottom: auto; margin-block: 0;
  max-height: calc(var(--classroom-visible-height, 100vh) - 32px);
}
html[data-classroom-role="teacher"],
html[data-classroom-role="student"][data-classroom-typeset] { font-size: var(--classroom-text); }
html[data-classroom-role="teacher"] .screen .submission-total { align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
html[data-classroom-role="teacher"] .screen .submission-total b { font-size: var(--classroom-count); }
html[data-classroom-role="teacher"] .screen .submission-total span { font-size: var(--classroom-count-label); font-weight: 700; line-height: 1.4; color: var(--text); }

/* Classroom display sizes: enlarge the type itself, never shrink a whole page. */
@media (min-width: 1200px) and (min-height: 650px) {
  :root {
    --classroom-text: clamp(24px, 1.5vw, 36px);
    --classroom-secondary: clamp(22px, 1.3vw, 32px);
    --classroom-heading: clamp(40px, 2.5vw, 64px);
    --classroom-subheading: clamp(32px, 1.8vw, 44px);
    --classroom-count: clamp(56px, 3.2vw, 80px);
    --classroom-count-label: clamp(28px, 1.8vw, 40px);
  }
  html[data-classroom-role="teacher"] .screen { font-size: var(--classroom-text); }
  html[data-classroom-role="teacher"] .screen .teacher-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 27%);
  }
  html[data-classroom-role="teacher"] .screen .heat-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  }
  html[data-classroom-role="teacher"] .screen .heat-title h3 { font-size: var(--classroom-heading); }
  html[data-classroom-role="teacher"] .screen :is(.screen-logo, .group-top, .submission-card p, .legend-row, .answer-head p, .bubble-q, .question-card b, .path-section p, .result-question-stats, .result-bar-row, .question-distribution, .record) {
    font-size: var(--classroom-text); line-height: 1.55;
  }
  html[data-classroom-role="teacher"] .screen :is(.group-caption, .identity-card small, .identity-actions button, .status-pill, .live-pill, .submission-card small, .legend h5, .inspector-muted, .inspect-list li, .question-card small, .question-card button, .submission-switch button, .bubble-meta, .bubble-item small, .q-chip) {
    font-size: var(--classroom-secondary); line-height: 1.5;
  }
  html[data-classroom-role="teacher"] .screen :is(.submission-card h4, .evidence-wall-head h3, .answer-head h3, .inspector-head h3) {
    font-size: var(--classroom-subheading);
  }
  html[data-classroom-role="teacher"] .screen .progress-orb { width: 88px; height: 88px; }
  html[data-classroom-role="teacher"] .screen .progress-orb::after { font-size: var(--classroom-secondary); }
  /* data-classroom-region="settings" keeps its existing component typography.
     It shares the full-width shell, but has no classroom font-size minimum. */
  html[data-classroom-role="student"][data-classroom-typeset] :is(.condition, .paper-note, .eyebrow, .plot figcaption, .experiment-controls > output, .sample-values, #task-progress, .phase-tabs button, .slide-tools button, .pager button) {
    font-size: max(.85rem, 22px);
  }
  html[data-classroom-role="student"][data-classroom-typeset] .graph text { font-size: 24px; }
}

/* Near-view student typography: teachers retain the classroom variables above. */
:root{--student-text:18px;--student-heading:26px;--student-action:16px}
@media(min-width:1200px) and (min-height:650px){:root{--student-text:20px;--student-heading:28px;--student-action:18px}}
