/* The entry's arcade lettering carries into classroom controls. Science prose
   and data stay in the reading face; held playtest routes are not selected. */
/* The bundled original face has a joined fi ligature. Explicit feature values
   also win when a short action requests common/discretionary ligatures.
   Descendant rules keep later font shorthands from restoring the joined form. */
:is(body.auth-shell, body.bio-page, body.teacher-shell),
:is(body.auth-shell, body.bio-page, body.teacher-shell) * {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0;
}
/* Signed home: every available task and the existing character trail stay in
   one viewport. These rules win over the older four-card landing layout. */
body.bio-student-home .bio-home-actions { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
body.bio-student-home .bio-home-action { min-height:80px; padding:8px 10px; gap:10px; }
body.bio-student-home .bio-home-action :is(img,.bio-home-action-icon,.bio-home-game-tile) { width:44px; height:44px; flex:none; }
body.bio-student-home .bio-home-action strong { font:700 17px/1.15 "Brainpower Pixel",var(--sans); }
body.bio-student-home .bio-home-action small { font-size:12px; line-height:1.25; }
body.bio-student-home .bio-home-action[href="cell-cloze.html"] { background:#e2f5bb; border-left-color:#75a52e; }
body.bio-student-home .bio-home-action[data-home-classwork] { background:#d6e5ff; border-left-color:#3968bd; }
body.bio-student-home .character-reward { min-height:84px; grid-template-columns:80px minmax(0,1fr); }
body.bio-student-home .character-reward-art canvas { width:74px; height:74px; }
body.bio-student-home .character-reward-link strong { font:700 19px/1.15 "Brainpower Pixel",var(--sans); }
@media(max-width:700px) and (min-height:521px) {
  body.bio-student-home .bio-home-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  body.bio-student-home .bio-home-action { padding:8px; gap:7px; }
  body.bio-student-home .bio-home-action strong { font-size:16px; }
  body.bio-student-home .bio-home-action :is(img,.bio-home-action-icon,.bio-home-game-tile) { width:32px; height:32px; }
  body.bio-student-home .bio-home-action small { font-size:11px; }
}
@media(max-height:520px) {
  body.bio-student-home .bio-home-my-prep { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); gap:6px 10px; }
  body.bio-student-home .bio-home-actions { grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:minmax(0,1fr); gap:6px; }
  body.bio-student-home .bio-home-action { min-height:50px; padding:5px; gap:5px; }
  body.bio-student-home .bio-home-action strong { font-size:14px; }
  body.bio-student-home .bio-home-action small { font-size:10px; }
  body.bio-student-home .bio-home-action :is(img,.bio-home-action-icon,.bio-home-game-tile) { width:28px; height:28px; }
  body.bio-student-home .character-reward { min-height:70px; grid-template-columns:64px minmax(0,1fr); }
  body.bio-student-home .character-reward-art canvas { width:62px; height:62px; }
  body.bio-student-home .character-reward-link strong { font-size:17px; }
}
body.teacher-shell {
  --signature-shadow: #09234b;
  --signature-light: #ffffffb8;
  --signature-shade: #06182045;
}
body.teacher-shell:has(> main[data-page="teacher"]) { height:100dvh; display:grid; grid-template-rows:auto minmax(0,1fr); }
body.teacher-shell:has(> main[data-page="teacher"]) > .teacher-brand { height:50px; min-height:50px; }
body.teacher-shell:has(> main[data-page="teacher"]) > .teacher-page { height:auto; }
body.teacher-shell:has(> main[data-page="teacher"]):has(#student-progress[data-dashboard-view="concepts"]) { height:auto; min-height:100dvh; grid-template-rows:auto auto; }
body.teacher-shell.developer-shell {
  --teacher-deep: #124575;
  --teacher-soft: #effaff;
  --teacher-accent: #83d7ff;
  --teacher-accent-text: #134578;
  --signature-shadow: #12518a;
}
body.teacher-shell :is(.teacher-heading, .teacher-workspace, .class-choice,
  .launch-panel, .approval-panel, .name-review-panel, .dashboard-stats > div,
  .student-card, .report-columns section, .writing-response, .wizard-lesson,
  .species-form, .species-card, .game-review-card, .pointer-preview, .tool-empty,
  .heatmap-section, .concept-chart-section, .developer-heading, .developer-panel,
  .developer-stats > div, .developer-preview, .developer-empty, .developer-concept,
  .developer-cloud-emblem, .developer-note-form textarea, .developer-note-form select) {
  border-radius: 0;
}
body.teacher-shell :is(.teacher-heading, .teacher-workspace, .launch-panel,
  .approval-panel, .name-review-panel, .wizard-lesson, .species-form,
  .species-card, .game-review-card, .developer-heading, .developer-panel) {
  box-shadow: inset 2px 2px 0 var(--signature-light),
    inset -2px -2px 0 var(--signature-shade), 3px 4px 0 var(--signature-shadow);
}
body.teacher-shell :is(.launch-panel, .wizard-lesson, .species-form,
  .game-review-card, .developer-panel) {
  background-image: repeating-linear-gradient(90deg,
    color-mix(in srgb, var(--teacher-accent) 75%, transparent) 0 4px,
    transparent 4px 8px, color-mix(in srgb, var(--teacher-deep) 40%, transparent) 8px 12px,
    transparent 12px 16px);
  background-size: 16px 4px;
  background-repeat: repeat-x;
}
body.teacher-shell :is(.teacher-heading h1, .developer-heading h1) {
  font: 700 clamp(25px, 2.5vw, 32px)/1.05 "Brainpower Pixel", "Arial Black", var(--sans);
  letter-spacing: .015em;
}
body.teacher-shell :is(.teacher-heading h1, .teacher-heading .eyebrow) {
  color: #fff;
}
body.teacher-shell .teacher-heading h1 { text-shadow: 2px 2px 0 var(--signature-shadow); }
body.teacher-shell :is(.dashboard-section-title h2, .tool-heading h2,
  .wizard-heading h2, .wizard-lesson h3, .species-card h3, .game-review-card h3,
  .upcoming-games h2, .developer-panel-heading h2, .developer-empty h3,
  .teacher-class-dialog h2, .tool-empty h3) {
  font-family: "Brainpower Pixel", "Arial Black", var(--sans);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.15;
}
body.teacher-shell :is(.teacher-tabs > button, .developer-tabs > button,
  .button, .developer-button) {
  min-height: 44px;
  padding: 7px 11px;
  border: 2px solid var(--teacher-deep);
  border-top-color: color-mix(in srgb, var(--teacher-soft) 80%, white);
  border-left-color: color-mix(in srgb, var(--teacher-soft) 80%, white);
  border-radius: 0;
  box-shadow: inset 1px 1px 0 var(--signature-light),
    inset -2px -2px 0 var(--signature-shade), 2px 3px 0 var(--signature-shadow);
  font: 600 18px/1.15 "Brainpower Pixel", "Arial Black", var(--sans);
  letter-spacing: .025em;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end), background-color 90ms linear;
}
body.teacher-shell .teacher-tabs { min-height: 44px; padding-top: 0; }
body.teacher-shell .teacher-tabs > button { padding-block: 7px; }
body.teacher-shell #teacher-tools > .teacher-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: 6px;
}
body.teacher-shell .teacher-brand .button { padding: 4px 10px; font-size: 16px; }
body.teacher-shell .teacher-heading .button { min-height: 44px; font-size: 17px; }
body.teacher-shell .teacher-class-details .button { min-height: 44px; font-size: 17px; }
body.teacher-shell .launch-actions .button { min-height: 44px; }
body.teacher-shell :is(.teacher-tabs > button, .developer-tabs > button)[aria-selected="true"] {
  border-top-color: var(--teacher-accent);
  border-left-color: var(--teacher-accent);
  color: #fff;
  text-shadow: 1px 1px 0 var(--signature-shadow);
}
body.teacher-shell :is(.button, .developer-button).primary {
  color: #fff;
  text-shadow: 1px 1px 0 var(--signature-shadow);
}
body.teacher-shell :is(.button, .developer-button):not(:disabled):hover,
body.teacher-shell :is(.teacher-tabs > button, .developer-tabs > button):hover {
  transform: translate(-1px, -1px);
  box-shadow: inset 1px 1px 0 var(--signature-light),
    inset -2px -2px 0 var(--signature-shade), 3px 4px 0 var(--signature-shadow);
}
body.teacher-shell :is(.button, .developer-button):not(:disabled):active,
body.teacher-shell :is(.teacher-tabs > button, .developer-tabs > button):active {
  transform: translate(1px, 2px);
  box-shadow: inset 1px 1px 0 var(--signature-light), 1px 1px 0 var(--signature-shadow);
}
body.teacher-shell :is(.button, .developer-button):disabled { transform: none; }
body.teacher-shell :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--teacher-accent);
  outline-offset: 3px;
}
body.teacher-shell .class-choice {
  border-width: 2px;
  border-top-color: #ffffffcf;
  border-left-color: #ffffffcf;
  box-shadow: inset -2px -2px 0 var(--signature-shade), 2px 3px 0 var(--signature-shadow);
}
body.teacher-shell .class-choice > span {
  font-family: "Brainpower Pixel", "Arial Black", var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .015em;
  line-height: 1.15;
}
body.teacher-shell .class-choice.active { border-top-color: var(--teacher-accent); border-left-color: var(--teacher-accent); }
body.teacher-shell :is(.dashboard-controls select, .species-form input,
  .species-form textarea, .wizard-lesson input, .wizard-lesson textarea,
  .wizard-lesson select, .game-review-card textarea, .game-review-card select) {
  min-height: 44px;
  border-radius: 0;
  border-width: 2px;
  box-shadow: inset 2px 2px 0 #12385d18;
  font-size: 16px;
}
body.teacher-shell :is(.dashboard-stats strong, .developer-stats strong) {
  font-family: Arial, "Helvetica Neue", system-ui, sans-serif;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: normal;
  text-shadow: none;
  -webkit-text-stroke: 0;
}
body.teacher-shell .dashboard-stats > .teacher-score-heat :is(span, small, strong) {
  color: var(--score-color);
}
body.teacher-shell .species-form .check-label { min-height: 44px; font-size: 14px; }
body.teacher-shell .species-form input[type="checkbox"] {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  min-height: 0;
  margin: 0 5px 0 0;
  padding: 0;
  border: 2px solid var(--teacher-deep);
  background: #fff;
  box-shadow: inset 2px 2px 0 #12385d18, 2px 2px 0 var(--signature-shadow);
}
body.teacher-shell .species-form input[type="checkbox"]:checked {
  background-color: var(--teacher-deep);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' shape-rendering='crispEdges'%3E%3Cpath fill='white' d='M2 8h3v3h3v3H5v-3H2zM8 8h3V5h3V2h3v3h-3v3h-3v3H8z'/%3E%3C/svg%3E");
  background-size: 18px 18px;
}
/* Clear glyph outlines now open C/e at every weight. Keep the roomy account
   label and no shadow, rather than relying only on the earlier thin weight. */
body.auth-shell .auth-mode-choice #create-account-choice {
  font-weight: 400;
  font-size: 24px;
  letter-spacing: .035em;
  padding-inline: 15px;
  text-shadow: none;
}
/* Short actions use arcade type. Explanations and long answer options keep
   their reading face, so the style does not make science harder to read. */
body.bio-page :is(.btn, .bio-expand, .cell-language-toggle,
  .cell-read-pages button, .cell-next button, .bio-source-nav button,
  .bio-classwork-tabs button, .bio-ask-tabs button, .bio-question-pager button,
  .bio-saved-question button, .bio-question-compose button,
  .report-fit-tabs button, .writing-fit-tabs button, .writing-fit-footer button) {
  font-family: "Brainpower Pixel", "Arial Black", var(--sans);
  font-weight: 600;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.15;
  letter-spacing: .025em;
  min-height: 44px;
  border-radius: 0;
}
body.bio-page :is(.cell-hero h1, .cell-step > h2, .bio-classwork-heading h1,
  .report-fit-head h1, .writing-fit-copy > h2, .bio-home-my-prep > h2) {
  font-family: "Brainpower Pixel", "Arial Black", var(--sans);
  font-weight: 600;
  letter-spacing: .015em;
}
body.bio-page :is(.report-fit-head, .report-fit-summary, .report-fit-picker,
  .report-fit-key, .report-fit-footer, .report-fit-grid .bio-concept,
  .writing-fit-picker, .writing-banner, .writing-fit-copy, .writing-fit-footer,
  .writing-fit-picker select, .report-fit-picker select, .sheet) { border-radius: 0; }
body.bio-page :is(.report-fit-head, .report-fit-summary, .report-fit-footer,
  .writing-fit-picker, .writing-fit-footer) {
  box-shadow: inset 2px 2px 0 #ffffffb8, inset -2px -2px 0 #06182025, 2px 3px 0 var(--pixel-shadow);
}
/* Keep the arcade labels and artwork. Counts use open counters so 8 does not
   collapse into a filled square at classroom distance. */
body.teacher-shell :is(.student-score, .class-choice small,
  .dashboard-stat-action small, .roster-metric-link, .developer-concept strong),
body.bio-page :is(.cell-step-head, .cell-clock strong, .cell-read-pages > span,
  .cell-read-next:disabled, .clock, .timer, #reset-countdown, #reset-leaves,
  .bio-graph-clock, .match-clock, .bio-streak, .bio-summary-tile strong,
  .bio-concept-score, .report-fit-summary h2, .score-line strong) {
  font-family: Arial, "Helvetica Neue", system-ui, sans-serif;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: normal;
  text-shadow: none;
  -webkit-text-stroke: 0;
}
body.bio-page .cell-step-head {
  font-size: .875rem;
  line-height: 1.2;
}
@media (max-width: 560px) {
  body.teacher-shell:has(> main[data-page="teacher"]) > .teacher-brand { height:auto; min-height:53px; }
  body.teacher-shell:not([data-course]) > .teacher-brand { height:auto; min-height:50px; flex-wrap:wrap; gap:6px; padding:3px 8px; }
  body.teacher-shell:not([data-course]) > .teacher-brand .brainpower-wordmark { width:clamp(110px,32vw,145px); }
  body.teacher-shell:not([data-course]) > .teacher-brand #chinese-student-mode { flex:0 0 124px; margin-left:auto; min-height:44px; padding:4px 6px; font-size:13px; line-height:1.2; text-align:center; }
  body.teacher-shell .teacher-heading { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
  body.teacher-shell .teacher-heading > * { min-width:0; }
  body.teacher-shell .teacher-heading .page-actions { display:flex; flex-direction:row; flex-wrap:wrap; justify-content:flex-end; width:100%; max-width:none; gap:5px; }
  body.teacher-shell .teacher-heading .button { font-size: 14px; padding-inline: 7px; }
  body.teacher-shell .teacher-tabs > button { font-size: 15px; padding-inline: 4px; }
  body.teacher-shell .class-choice > span { font-size: 14px; }
  body.auth-shell .auth-mode-choice #create-account-choice { font-size: 22px; padding-inline: 8px; }
}
@media (max-height: 500px) {
  body.bio-page :is(.btn, .bio-expand, .cell-language-toggle,
    .cell-read-pages button, .cell-next button, .bio-source-nav button) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  body.teacher-shell :is(.button, .developer-button, .teacher-tabs > button, .developer-tabs > button),
  body.bio-page :is(.btn, .bio-expand, .cell-language-toggle, .cell-read-pages button,
    .cell-next button, .bio-source-nav button, .bio-classwork-tabs button,
    .bio-ask-tabs button, .bio-question-pager button, .bio-saved-question button,
    .bio-question-compose button) { transition: none; }
}
@media print {
  body.teacher-shell :is(.teacher-heading, .teacher-workspace, .class-choice,
    .launch-panel, .approval-panel, .wizard-lesson, .species-form, .game-review-card),
  body.bio-page :is(.report-fit-head, .report-fit-summary, .report-fit-footer,
    .writing-fit-picker, .writing-fit-footer) { background-image: none; box-shadow: none; }
}

/* Concept view uses content-sized grid rows, including a class with no accounts.
   These late rules prevent the viewport's spare height stretching its header,
   tab buttons or class choices. Other teacher and pupil views are unchanged. */
body.teacher-shell:has(> main[data-page="teacher"]):has(#student-progress[data-dashboard-view="concepts"]) { align-content:start;align-items:start;grid-auto-rows:max-content; }
body.teacher-shell:has(#student-progress[data-dashboard-view="concepts"]) > .teacher-page { align-content:start;align-items:start;grid-template-rows:max-content max-content auto; }
body.teacher-shell:has(#student-progress[data-dashboard-view="concepts"]) .teacher-heading { align-self:start;min-height:54px;height:auto;padding:6px 10px;gap:10px; }
body.teacher-shell:has(#student-progress[data-dashboard-view="concepts"]) .teacher-heading h1 { font-size:24px;line-height:1.05;margin:0; }
body.teacher-shell:has(#student-progress[data-dashboard-view="concepts"]) .teacher-heading .eyebrow { margin:0 0 2px;font-size:9px; }
body.teacher-shell:has(#student-progress[data-dashboard-view="concepts"]) .teacher-page > .teacher-tabs { align-self:start;align-items:start;min-height:44px;height:auto; }
body.teacher-shell:has(#student-progress[data-dashboard-view="concepts"]) .teacher-page > .teacher-tabs > button { align-self:start;min-height:44px;height:44px;padding:6px 10px;font-size:16px; }
body.teacher-shell #student-progress[data-dashboard-view="concepts"] { align-content:start;align-items:start;grid-template-rows:max-content auto; }
body.teacher-shell #student-progress[data-dashboard-view="concepts"] .class-picker { align-content:start;align-items:start;grid-auto-rows:max-content; }
body.teacher-shell #student-progress[data-dashboard-view="concepts"] .class-choice { align-self:start;min-height:44px;height:auto;padding:4px 7px; }
body.teacher-shell #student-progress[data-dashboard-view="concepts"] .class-choice small { font-size:10px;line-height:1.15; }
@media(max-width:560px) {
  body.teacher-shell:has(#student-progress[data-dashboard-view="concepts"]) .teacher-heading h1 { font-size:22px; }
  body.teacher-shell:has(#student-progress[data-dashboard-view="concepts"]) .teacher-page > .teacher-tabs > button { padding-inline:4px;font-size:14px; }
}
