:root {
  /* Groundwork's own colour names, now ALIASES of the CRUXMS tokens (vendor/cruxms-design/tokens.css is the one home for
     colour). Names that tokens.css already defines (--bg, --text, --border, --muted, --card-bg, --radius) are not
     redefined here. Nothing in this block is a value; every line is a var() reference. */
  --accent: var(--primary);
  --accent-contrast: var(--surface);
  --locked: var(--border-2);
  --mastered: var(--success);
  --due: var(--warning);
  --wrong: var(--danger);
  --focus: var(--primary);
  --selected-bg: var(--primary-pale);
  --muted: var(--text-faint); /* the darker grey: it also has to hold on tinted panels (4.5:1) */
}

/* Deliberately light-only: these products are pinned to a light theme regardless of the viewer's
   system/browser dark-mode setting (Mark's standing preference for everything shipped off these
   VPS products). The former `@media (prefers-color-scheme: dark)` override was removed here rather
   than fought page-by-page, since the student app and the parent view both share this one
   stylesheet. teacher.html carries the same light values in its own <style> for the same reason. */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  .card,
  .btn,
  .badge {
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  }

  .context-drawer {
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }

  .context-drawer.open {
    transition: transform 0.2s ease, visibility 0s;
  }

  .context-backdrop {
    transition: opacity 0.2s ease;
  }
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
}

h2 {
  font-size: 1.25rem;
  margin: 0 0 12px;
}

p {
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
}

.btn.secondary {
  background: transparent;
  color: var(--accent);
}

.btn.danger {
  background: transparent;
  color: var(--wrong);
  border-color: var(--wrong);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

input[type="text"] {
  width: 100%;
  min-height: 48px;
  font-size: 1.15rem;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
}

.ladder {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rung {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  min-height: 48px;
}

/* The top line of a task row: dot, title, and a badge or the "Practise" button. */
.rung-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* My progress: a row is a button that opens its topic. Reset the button look; the whole row reacts to hover. */
button.rung-open {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  min-height: 44px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.rung-clickable { cursor: pointer; }
.rung-clickable:hover { border-color: var(--accent); }
button.rung-open:focus-visible { outline: 3px solid var(--focus, var(--accent)); outline-offset: 2px; border-radius: 6px; }

/* Worksheet link-out rows stay a single horizontal line (no progress bar under them). */
.rung-linkout {
  flex-direction: row;
  align-items: center;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.dot.locked {
  background: var(--locked);
}

.dot.learning {
  background: var(--primary);
}

.dot.mastered {
  background: var(--mastered);
}

.rung-title {
  flex: 1;
}

/* Per-task progress bar, sitting under the task's top line and indented past the status dot so
   it lines up with the title. Blue while working toward mastery, green ('.done') once locked in. */
.rung-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 26px;
}

.rung-progress-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.rung-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.rung-progress-fill.done {
  background: var(--mastered);
}

@media (prefers-reduced-motion: no-preference) {
  .rung-progress-fill {
    transition: width 0.3s ease;
  }
}

.rung-progress-label {
  font-size: 0.75rem;
  white-space: nowrap;
}

/* An untouched task shows a quiet note here instead of an empty bar (which reads as failure). */
.rung-progress-note {
  padding-left: 26px;
  font-size: 0.75rem;
  font-style: italic;
}

/* The per-task "Practise" action - a small outline pill, clearly a control (distinct from the
   dotted-underline glossary terms and the plain accent text links elsewhere). */
.practise-btn {
  flex: 0 0 auto;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 5px 14px;
  min-height: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
}

/* Children tap this on a phone: the full 44px target. */
.open-topic-btn {
  min-height: 44px;
  padding: 6px 18px;
  font-size: 0.9rem;
}

.practise-btn:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.due {
  background: var(--due);
  color: var(--surface);
}

.review-btn {
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.review-btn:hover {
  filter: brightness(1.08);
}

.badge.mastered {
  background: var(--mastered);
  color: var(--surface);
}

.streak {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.streak .count {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.problem-display {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* A tappable maths word inside the question text - looks like a dotted-underline term, not a
   button, so it reads as "this word has a definition" rather than an interactive control. */
.glossary-term {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

/* Same idea, applied to a label drawn inside a diagram's SVG - the number/word ON the picture
   becomes tappable too, so "8 cm" can explain that it's the leg, not just repeat the value. */
.diagram-label {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.glossary-popover {
  position: absolute;
  max-width: 260px;
  background: var(--text);
  color: var(--card-bg);
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 60;
  pointer-events: none;
}

.glossary-popover.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.steps {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.steps ol {
  margin: 0;
  padding-left: 20px;
}

.steps li {
  margin-bottom: 6px;
}

/* Explicit "N." chip + text, replacing the browser's native list marker - keeps a real gap so a
   step starting with a digit (e.g. "23 + 5 = 28") never reads at a glance like a decimal. */
.steps-heading {
  margin: 0 0 6px;
  font-weight: 600;
}

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.step-num {
  flex-shrink: 0;
  min-width: 1.4em;
  font-weight: 700;
  color: var(--accent);
}

.step-text {
  flex: 1;
}

.feedback {
  border-radius: 10px;
  padding: 14px;
  margin-top: 16px;
}

.feedback.correct {
  background: color-mix(in srgb, var(--mastered) 18%, transparent);
  border: 1px solid var(--mastered);
}

.feedback.incorrect {
  background: color-mix(in srgb, var(--wrong) 15%, transparent);
  border: 1px solid var(--wrong);
}

/* An answer that was not marked (it did not send, or the question was reset): no right or wrong colour, plain grey. */
.feedback.not-marked {
  background: var(--surface-2, #f3f4f6);
  border: 1px solid var(--border);
}

/* A near-miss (sign or power/index slip) reads as "close, fix this detail" rather than
   "wrong" - amber instead of red, reusing the same tone already used for due-for-review. */
.feedback.incorrect-minor {
  background: color-mix(in srgb, var(--due) 15%, transparent);
  border: 1px solid var(--due);
}

.mistake-tag {
  color: var(--due);
  font-weight: 600;
  margin: 4px 0 10px;
}

.ai-note {
  background: var(--card-bg);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 0.95rem;
}

.progress-note {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 8px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 8px 0;
  text-decoration: underline;
  min-height: 44px;
}

.app-header {
  margin-bottom: 20px;
}

.app-header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.header-label {
  font-weight: 700;
  font-size: 1rem;
}

.header-streak {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-header-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.mini-ladder {
  display: flex;
  flex-wrap: wrap; /* a strand of 20 or 30 topics wraps onto more lines instead of making the whole page scroll sideways on a phone (12 Nov 2026) */
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.mini-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  flex: 0 0 auto;
}

.mini-dot.locked {
  background: var(--locked);
}

.mini-dot.learning {
  background: var(--primary);
}

.mini-dot.mastered {
  background: var(--mastered);
}

.mini-dot.due {
  border-color: var(--due);
}

.mini-dot.current {
  border-color: var(--text);
}

.review-stop {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.review-stop p {
  margin: 0 0 8px;
}

.header-home-link {
  min-height: auto;
  padding: 4px 0;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.mini-ladder-expand {
  flex: 1;
}

.mini-ladder-expand summary {
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.mini-ladder-expand summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.mini-ladder-expand summary .mini-ladder {
  margin-left: 6px;
}

.mini-ladder-expand[open] .ladder {
  margin-top: 12px;
}

.context-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
}

.context-toggle:hover {
  border-color: var(--accent);
}

/* A touch more visual weight than the other info pills (My goal, What's happening) - this one's
   an active offer of help on the exact problem on screen, not a passive reference link. */
.teacher-toggle {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  margin: 12px 0 16px;
  display: block;
}

/* Voice controls in the "Ask the teacher" drawer - same pill shape as the other context toggles,
   plus a distinct "listening" state so it's obvious the mic actually picked up the tap. */
.mic-toggle {
  display: block;
  margin: 12px 0 0;
}

.mic-toggle.mic-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

/* Read-aloud + a dedicated Stop, side by side (see makeTtsControl) - the Stop is always present
   so an auto-playing rung can be silenced with one obvious tap. */
.tts-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 8px 0 0;
}

.tts-toggle,
.tts-stop {
  margin: 0;
  padding-top: 0;
}

.tts-stop {
  color: var(--muted); /* quieter than the accent-coloured play control - it's the secondary action */
}

/* A slim settings strip, not a full card - keeps a preference toggle (spaced review) looking
   like a preference rather than competing with the Continue/pick-a-subject actions below it. */
.settings-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 4px 14px;
}

.settings-row-note {
  font-size: 0.82rem;
}

.context-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 35%, transparent);
  opacity: 0;
  pointer-events: none;
  z-index: 40;
}

.context-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.context-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(340px, 88vw);
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  transform: translateX(100%);
  visibility: hidden; /* closed: out of the Tab order and no shadow leaking onto the page edge */
  z-index: 41;
  padding: 28px 20px 20px;
  overflow-y: auto;
}

.context-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.context-drawer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.context-drawer-close:focus-visible,
.context-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.context-drawer-body h2 {
  margin-top: 0;
}

.context-drawer-body p {
  color: var(--text);
}

/* The goal card is the visible motivational anchor on Home - a calm left-accent bar marks it as
   the "why", distinct from the plain ladder/action cards, without shouting like a reward banner. */
.goal-card {
  border-left: 4px solid var(--accent);
}

.goal-card p {
  color: var(--text);
  margin: 10px 0 0;
}

.goal-card p:first-of-type {
  font-size: 1.05rem;
}

/* --- Strands (subjects) -------------------------------------------------- */

.strand-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.strand-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  min-height: 64px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.strand-card:hover {
  border-color: var(--accent);
}

.strand-card-title {
  font-weight: 700;
}

.strand-card-progress {
  font-size: 0.85rem;
}

.ladder-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Each strand is a native <details> - the header is its <summary>, which comes with a default
   disclosure marker we replace with our own chevron so it matches the rest of the UI. */
.ladder-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 0;
  cursor: pointer;
  list-style: none;
}

.ladder-group-header::-webkit-details-marker {
  display: none;
}

.ladder-group-header h3 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ladder-group-header h3::before {
  content: '▸';
  display: inline-block;
  font-size: 0.7em;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.ladder-group[open] > .ladder-group-header h3::before {
  transform: rotate(90deg);
}

.dot.linkout {
  background: transparent;
  border: 2px solid var(--muted);
}

.rung-linkout {
  cursor: pointer;
}

.rung-linkout:hover {
  border-color: var(--accent);
}

.badge.resource {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--muted);
}

/* --- Mastery-progress bar ("one more and it's locked") ------------------- */

.mastery-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 100%;
}

.mastery-progress-track {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.mastery-progress-fill {
  height: 100%;
  background: var(--mastered);
  border-radius: 999px;
}

@media (prefers-reduced-motion: no-preference) {
  .mastery-progress-fill {
    transition: width 0.3s ease;
  }
}

.mastery-progress-label {
  font-size: 0.8rem;
  white-space: nowrap;
}

/* --- Diagrams ------------------------------------------------------------- */

.diagram-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.diagram-wrap svg {
  max-width: 100%;
}

/* --- Numeric answer entry: unit label, keypad, example, live preview ----- */

.answer-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.answer-input-row input[type='text'] {
  flex: 1 1 auto;
}

.unit-label {
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  padding: 0 4px;
}

.keypad-hint {
  font-size: 0.8rem;
  margin-top: 4px;
}

.keypad-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.keypad-key {
  min-width: 44px;
  min-height: 44px;
  font-size: 1.05rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.keypad-key:hover {
  border-color: var(--accent);
}

.answer-example {
  font-size: 0.85rem;
  margin: 10px 0 0;
}

.answer-preview {
  font-size: 0.9rem;
  min-height: 1.2em;
  color: var(--accent);
  margin: 4px 0 0;
}

/* --- Feedback: correct tick + a slightly bigger moment for mastery ------- */

.feedback-headline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
}

.correct-tick {
  color: var(--mastered);
  display: inline-flex;
}

/* A mastered answer is marked by its words ("Rung mastered"), with no pulse or other motion (guideline 7). */
.feedback.mastered-flash {
  border-width: 2px;
}

/* --- Interactive plotting grid (graphGrid.js) ------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.graph-tool { margin: 0.5rem 0 0.25rem; }
.graph-tool-hint { margin: 0 0 0.4rem; font-size: 0.85rem; }
.graph-tool .graph-grid-wrap { display: block; }
.graph-tool .link-btn { display: inline-block; margin-top: 0.4rem; }
.graph-grid-wrap { max-width: 100%; }
.graph-grid {
  max-width: 100%; height: auto; touch-action: manipulation;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg);
}
.graph-grid:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.graph-grid .gg-gridline { stroke: var(--border); stroke-width: 1; }
.graph-grid .gg-axis { stroke: var(--muted); stroke-width: 1.5; }
.graph-grid .gg-ticklabel { fill: var(--muted); font-size: 10px; text-anchor: middle; }
.graph-grid .gg-ticklabel-y { text-anchor: end; }
.graph-grid .gg-axislabel { fill: var(--muted); font-size: 11px; font-style: italic; text-anchor: middle; }
.graph-grid .gg-given { stroke: var(--muted); stroke-width: 2.5; opacity: 0.75; }
.graph-grid .gg-userline { stroke: var(--accent); stroke-width: 2.5; }
.graph-grid .gg-point { fill: var(--accent); stroke: var(--card-bg); stroke-width: 1.5; }
.graph-grid .gg-cursor { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 2; opacity: 0.8; }
/* given "marker" points that are part of the question (e.g. the two points in a gradient task) */
.graph-grid .gg-marker { fill: var(--text); stroke: var(--card-bg); stroke-width: 1.5; }
.graph-grid .gg-marker-label { fill: var(--text); font-size: 11px; font-weight: 600; }

/* --- Drawing answers (drawWidgets.js): place points on a grid, drag the two handles of a line. All colour from the tokens above. --- */
.draw-wrap { margin: 0.5rem 0; max-width: 560px; }
.draw-svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); }
.draw-svg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.draw-handle { pointer-events: none; }
.draw-stage { position: relative; }
.draw-hit { position: absolute; width: 12.2%; aspect-ratio: 1; min-width: 44px; transform: translate(-50%, -50%); border-radius: 50%; touch-action: none; cursor: grab; outline: none; user-select: none; -webkit-user-select: none; }
.draw-hit:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
.draw-svg .draw-minor { stroke: var(--border); stroke-width: 0.6; opacity: 0.7; }
.draw-svg .draw-major { stroke: var(--border); stroke-width: 1.2; }
.draw-svg .draw-axis { stroke: var(--muted); stroke-width: 1.6; }
.draw-svg .draw-tick { fill: var(--muted); font-size: 10.5px; text-anchor: middle; }
.draw-svg .draw-tick-y { text-anchor: end; }
.draw-svg .draw-title.draw-title-y { text-anchor: start; }
.draw-svg .draw-title { fill: var(--text); font-size: 11.5px; font-weight: 600; text-anchor: middle; }
/* the given shape of a geometry question (drawWidgets.js outline): neutral, never tappable, under the student's points */
.draw-svg .draw-shape { fill: var(--muted); fill-opacity: 0.16; stroke: var(--muted); stroke-width: 1.8; stroke-linejoin: round; }
.draw-svg .draw-shape-line { stroke: var(--muted); stroke-width: 1.8; stroke-dasharray: 6 4; fill: none; }
.draw-svg .draw-shape-dot { fill: var(--muted); }
.draw-svg .draw-shape-label { fill: var(--text); font-size: 12px; font-weight: 700; text-anchor: middle; }
.draw-svg .draw-fixed, .draw-svg .draw-data { stroke: var(--text); stroke-width: 2.2; fill: none; stroke-linecap: round; }
.draw-svg .draw-point { stroke: var(--accent); stroke-width: 2.6; fill: none; stroke-linecap: round; }
.draw-svg .draw-point-ring { fill: var(--accent); fill-opacity: 0.14; stroke: var(--accent); stroke-width: 1; }
.draw-svg .draw-preview { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 2; opacity: 0.7; }
.draw-svg .draw-cursor { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 2; }
.draw-svg .draw-line { stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; }
.draw-svg .draw-handle-dot { fill: var(--accent); stroke: var(--card-bg); stroke-width: 2; }
.draw-svg .draw-handle-on { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 2; }
.draw-svg .draw-handle-label { fill: var(--accent-contrast); font-size: 10.5px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.draw-status { margin: 0.4rem 0 0; font-weight: 600; }
.draw-readout { margin: 0.25rem 0 0; font-size: 0.9rem; min-height: 1.3em; }
.draw-wrap .link-btn { display: inline-block; margin-top: 0.3rem; min-height: 44px; }
.draw-svg .draw-bar { fill: var(--accent); fill-opacity: 0.45; stroke: var(--accent); stroke-width: 1.6; }
.draw-svg .draw-bar-on { fill-opacity: 0.7; stroke-width: 2.6; }
.draw-svg .draw-bar-hit { cursor: pointer; }
.draw-svg .draw-tick-on { fill: var(--text); font-weight: 700; }
.bars-row { gap: 0.4rem; flex-wrap: wrap; }
.bars-btn { min-height: 44px; }
.trial-run { margin: 0.5rem 0 0.8rem; padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); max-width: 560px; }
.trial-title { margin: 0 0 0.4rem; font-weight: 700; }
.trial-row { display: grid; grid-template-columns: minmax(3.2rem, 7rem) 1fr 2.6rem; gap: 0.5rem; align-items: center; margin: 0.2rem 0; }
.trial-track { display: block; height: 0.9rem; border-radius: 4px; background: var(--border); overflow: hidden; }
.trial-fill { display: block; height: 100%; background: var(--accent); transition: width 0.35s ease; }
.trial-count { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.trial-status { margin: 0.4rem 0 0; font-weight: 600; }
.trial-strip { margin: 0.2rem 0 0.4rem; font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }
.trial-btn { min-height: 44px; }
.trial-reset { min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .trial-fill { transition: none; } }
.draw-controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 0.5rem; }
.draw-segs { display: flex; gap: 0.5rem; }
.draw-seg { min-height: 44px; }
.draw-seg[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.draw-pad { display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 48px); gap: 4px; grid-template-areas: ". up ." "left down right"; }
.draw-pad .draw-up { grid-area: up; } .draw-pad .draw-left { grid-area: left; } .draw-pad .draw-down { grid-area: down; } .draw-pad .draw-right { grid-area: right; }
.draw-step { min-width: 48px; min-height: 48px; padding: 0; font-size: 1.2rem; }

/* --- Subjects (Maths / Science): a quiet heading above each subject's strands, shown only when a
   learner has more than one subject. --- */
.subject-heading {
  margin: 1rem 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.subject-heading:first-child {
  margin-top: 0;
}

/* --- Science answer widgets: choice / order / match / Punnett grid --- */
.choice-options {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.choice-option {
  text-align: left;
  font: inherit;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}
.choice-option:hover {
  border-color: var(--accent);
}
.choice-option[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--selected-bg);
  font-weight: 600;
}
.choice-option:disabled {
  cursor: default;
  opacity: 0.75;
}

.order-list {
  margin: 0.75rem 0;
  padding-left: 1.6rem;
  display: grid;
  gap: 0.4rem;
}
.order-item {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}
.order-item > * {
  vertical-align: middle;
}
.order-text {
  display: inline-block;
  width: calc(100% - 6.5rem);
}
.order-buttons {
  display: inline-flex;
  gap: 0.35rem;
  float: right;
}
.order-move {
  font: inherit;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.order-move:disabled {
  opacity: 0.35;
  cursor: default;
}

.match-list {
  display: grid;
  gap: 0.6rem;
  margin: 0.75rem 0;
}
.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
}
.match-row select {
  font: inherit;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
}
@media (max-width: 520px) {
  .match-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
}

.punnett-wrap {
  margin: 0.75rem 0;
  overflow-x: auto;
}
.punnett {
  border-collapse: collapse;
}
.punnett th {
  font-size: 1.15rem;
  padding: 0.4rem 0.7rem;
  color: var(--accent);
}
.punnett td {
  padding: 0.25rem;
  border: 2px solid var(--border);
}
.punnett-input {
  font: inherit;
  font-size: 1.15rem;
  width: 4.2rem;
  min-height: 2.75rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* --- List answer (statistics): one box per value, wraps, 44px+ targets, works at 375px with 15 boxes --- */
.list-wrap {
  margin: 0.75rem 0;
}
.list-widget {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.6rem 0.6rem;
}
.list-widget.list-labelled {
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
}
.list-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.list-caption {
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.list-field {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.list-input {
  font: inherit;
  font-size: 1.15rem;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0 0.4rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.list-unit {
  padding: 0;
  font-size: 0.85rem;
}
.list-minus {
  margin-top: 0.6rem;
  min-height: 44px;
}
.list-input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.codon-chart {
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.95rem;
}
.codon-chart th,
.codon-chart td {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  text-align: left;
}
.codon-chart th {
  color: var(--text);
}
.codon-chart td:first-child {
  color: var(--muted);
  font-family: monospace;
}

.choice-option:focus-visible,
.order-move:focus-visible,
.match-row select:focus-visible,
.punnett-input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ======================================================================================
   LEARN IT / TRY IT / SHOW IT  +  FLOATING CALCULATOR  (public/lesson.js, test.js, calculator.js)
   Existing variables only. Light theme only. Motion is wrapped in no-preference queries.
   ====================================================================================== */

.lesson-nudge {
  margin: 6px 0 0;
  font-size: 0.82rem;
}

/* --- Lesson viewer --- */
.lesson-topbar,
.test-leave-confirm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
}
.test-leave-confirm[hidden] {
  display: none;
}
.lesson-card {
  padding: 22px;
}
.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.lesson-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--selected-bg);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.lesson-badge-pack-extra {
  border-color: var(--due);
  color: var(--text);
  background: var(--card-bg);
}
.lesson-title {
  margin: 0 0 10px;
}
.lesson-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 14px 0 4px;
  padding: 4px;
}
.lesson-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
}
.lesson-dot.done {
  background: var(--accent);
}
.lesson-dot.current {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px var(--accent);
}
.lesson-step-label {
  margin: 8px 0 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}
.lesson-curriculum-note {
  font-size: 0.9rem;
}
.lesson-objectives,
.lesson-summary {
  background: var(--selected-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 8px 0 18px;
}
.lesson-objectives h2,
.lesson-summary h2 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.lesson-objectives ul,
.lesson-summary ul {
  margin: 0;
  padding-left: 1.25rem;
}
.lesson-objectives li,
.lesson-summary li {
  margin-bottom: 4px;
}
.lesson-step-title {
  margin-top: 6px;
  font-size: 1.3rem;
}
.lesson-step-title:focus {
  outline: none;
}
.lesson-block {
  margin: 14px 0;
}
.lesson-block-label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.lesson-text p:last-child,
.lesson-callout-body p:last-child {
  margin-bottom: 0;
}
.lesson-text img,
.lesson-text svg {
  max-width: 100%;
}

/* Callouts: a coloured left edge, never colour alone (each carries its own label). */
.lesson-callout {
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: 10px;
  padding: 10px 16px;
  background: var(--selected-bg);
}
.lesson-callout-label {
  margin: 0 0 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.lesson-callout-tip {
  border-left-color: var(--mastered);
  background: var(--bg);
}
.lesson-callout-tip .lesson-callout-label {
  color: var(--text);
}
.lesson-callout-warning {
  border-left-color: var(--due);
  background: var(--bg);
}
.lesson-callout-warning .lesson-callout-label {
  color: var(--text);
}
.lesson-callout-key {
  border-left-color: var(--accent);
  background: var(--selected-bg);
}
.lesson-callout-key .lesson-callout-body {
  font-weight: 600;
}

.lesson-figure {
  margin: 0;
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.lesson-svg svg {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  max-height: 480px;
  margin: 0 auto;
}
.lesson-caption {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.lesson-keyterms {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
}
.lesson-keyterms dt {
  font-weight: 700;
  color: var(--accent);
}
.lesson-keyterms dd {
  margin: 0;
}
@media (max-width: 520px) {
  .lesson-keyterms {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .lesson-keyterms dd {
    margin-bottom: 10px;
  }
}

.lesson-compare-wrap {
  overflow-x: auto;
}
.lesson-compare-wrap:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.lesson-compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.lesson-compare th,
.lesson-compare td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.lesson-compare thead th {
  background: var(--selected-bg);
  color: var(--text);
}
.lesson-compare tbody th {
  background: var(--bg);
  font-weight: 700;
}

.lesson-flip-intro {
  margin-bottom: 8px;
}
.lesson-flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.lesson-flip {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 96px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.lesson-flip:hover {
  border-color: var(--accent);
}
.lesson-flip.flipped {
  background: var(--selected-bg);
  border-color: var(--accent);
}
.lesson-flip [hidden] {
  display: none;
}
.lesson-flip-front,
.lesson-flip-back {
  font-weight: 600;
}
.lesson-flip-hint {
  font-size: 0.75rem;
  color: var(--muted);
}
.lesson-flip:focus-visible,
.lesson-worked-btn:focus-visible,
.lesson-nav-btn:focus-visible,
.test-jump-btn:focus-visible,
.test-review-link:focus-visible,
.lesson-worked-answer:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.lesson-worked {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--bg);
}
.lesson-worked-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.lesson-worked-steps {
  margin: 0 0 8px;
  padding-left: 1.4rem;
}
.lesson-worked-steps li {
  margin-bottom: 8px;
}
.lesson-worked-answer.shown {
  background: var(--selected-bg);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 4px;
}
.lesson-worked-answer.shown p:last-child {
  margin-bottom: 0;
}

.lesson-check {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--card-bg);
}
.lesson-check-q {
  font-weight: 600;
  margin-bottom: 4px;
}
.lesson-check-options.done .choice-option[aria-pressed='true'] {
  border-color: var(--mastered);
  opacity: 1;
}
.lesson-check-hint {
  margin: 0;
  font-size: 0.85rem;
}
.lesson-check-feedback:empty {
  display: none;
}
.lesson-check-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 6px solid var(--border);
  background: var(--bg);
}
.lesson-check-feedback.right {
  border-left-color: var(--mastered);
}
.lesson-check-feedback.retry {
  border-left-color: var(--due);
}
.lesson-check-status {
  margin: 0 0 4px;
  font-weight: 700;
}
.lesson-check-note p:last-child {
  margin-bottom: 0;
}

.lesson-nav,
.test-nav {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.btn.lesson-nav-btn {
  flex: 1 1 0;
  min-height: 56px;
  font-size: 1.1rem;
}
/* One card per page (Mark, 2026-10-20): the Next button names the next task, so it takes most of the row and may wrap on a phone. */
.btn.lesson-next-btn {
  flex: 3 1 0;
  white-space: normal;
  line-height: 1.25;
  padding-top: 8px;
  padding-bottom: 8px;
}
.lesson-kicker {
  margin: 0 0 4px;
  font-size: 0.85rem;
  font-weight: 600;
}
.lesson-ref {
  margin: 4px 0 14px;
  padding: 10px 12px 2px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}
.lesson-ref .lesson-block {
  margin: 8px 0;
}
/* On a phone the "To look at" box and the figure inside it were two bordered boxes in a padded card, so a 360-wide picture drew at 73% and its
   size-10 text at about 7px. Here the figure sits in the dashed band alone, a little into the card padding. */
@media (max-width: 520px) {
  .lesson-ref {
    margin: 4px -14px 14px;
    padding: 8px 0 2px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .lesson-ref .lesson-figure {
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  /* The same for a figure that sits directly in the lesson card: it runs a little into the card padding, with no side borders, so a
     360-wide picture draws at about 95% of its size instead of 81% (its size-11 text near 10px instead of 9px). */
  .lesson-card > .lesson-block > .lesson-figure {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 0;
    padding-right: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .lesson-card > .lesson-block > .lesson-figure .lesson-caption {
    padding-left: 14px;
    padding-right: 14px;
  }
}
.lesson-progress {
  height: 6px;
  margin: 12px 0 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.lesson-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
  .lesson-progress-fill {
    transition: none;
  }
}
/* Scoped to the lesson / test screens: a global .btn:disabled would change maths screens too. */
.lesson-card .btn:disabled,
.test-card .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.lesson-gate-note {
  margin: 8px 0 0;
  min-height: 1.5em;
  font-size: 0.9rem;
}
.lesson-finish-row {
  margin-top: 18px;
}
.lesson-finish-note {
  font-size: 0.85rem;
  margin-top: 10px;
}

/* --- Practice test (public/practice-test.js): the end screen's count per topic. Tokens only. --- */
.gw-practice-topics {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.gw-practice-topics li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.gw-practice-count {
  font-weight: 700;
  white-space: nowrap;
}
/* The reflection: a plain label per topic. The label is always words (never colour alone); Missed and Not reached stay neutral, not red (RULES 8). */
.gw-practice-topics li.gw-practice-topic { flex-wrap: wrap; align-items: center; }
.gw-practice-title { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.gw-practice-grade { flex: 0 0 auto; font-size: 0.85rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-sunk, var(--bg)); color: var(--text); }
.gw-grade-got-it .gw-practice-grade { background: var(--success-pale); border-color: var(--success); color: var(--success-deep); }
.gw-grade-partly .gw-practice-grade { background: var(--warning-pale); border-color: var(--warning); color: var(--text); }
.gw-practice-h { margin: 18px 0 6px; font-size: 1.1rem; }
.gw-practice-weak { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.gw-practice-weak .btn { width: 100%; text-align: left; }
/* While a practice paper is open the helper is hidden everywhere: its button and its menu link (the server refuses it as well). */
body[data-practice-open] .gw-item[data-menu-id="student.helper"] { display: none; }
.gw-practice-note:empty {
  display: none;
}

/* --- Show it test --- */
.test-card .test-progress {
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--muted);
}
.test-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.test-jump-btn {
  min-width: 44px;
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
}
.test-jump-btn.answered {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--selected-bg);
}
.test-jump-btn.current {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}
.test-skip-note {
  margin: 10px 0 0;
  font-size: 0.85rem;
}
.test-review-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.test-review-link {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 14px;
  align-items: baseline;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}
.test-review-link:hover {
  border-color: var(--accent);
}
.test-review-n {
  font-weight: 700;
}
.test-review-state.answered {
  color: var(--mastered);
  font-weight: 600;
}
.test-review-state.open {
  color: var(--muted);
}
.test-review-snippet {
  grid-column: 1 / -1;
  font-size: 0.85rem;
}
.test-score {
  margin: 4px 0 6px;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
}
.test-summary {
  font-size: 1.1rem;
  font-weight: 600;
}
.test-result-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 6px solid var(--border);
  border-radius: 12px;
  padding: 4px 18px;
  margin-bottom: 10px;
}
.test-result-item.correct {
  border-left-color: var(--mastered);
}
.test-result-item.incorrect {
  border-left-color: var(--due);
}
.test-result-item summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  min-height: 44px;
  padding: 8px 0;
  cursor: pointer;
}
.test-result-item summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.test-result-n {
  font-weight: 700;
}
.test-result-status.correct {
  color: var(--mastered);
  font-weight: 600;
}
.test-result-status.incorrect {
  color: var(--text);
  font-weight: 600;
}
.test-result-status.unanswered {
  color: var(--muted);
}
.test-result-body {
  padding-bottom: 10px;
}
.test-result-actions {
  margin-top: 16px;
}

/* --- Floating calculator (mounted once on <body>, outside #app) --- */
body.has-calc .app {
  padding-bottom: 120px; /* room so the round button never covers the last button on a screen */
}
.calc-root {
  position: fixed;
  z-index: 42; /* above the side drawer (41), below the glossary popover (60) */
  inset: 0;
  pointer-events: none; /* the container is just a coordinate space; only its children take clicks */
}
/* Hidden on placement, Home, Practice home, My progress, the Guide and Show it for skills that opt out
   (calculator.js setCalculatorVisible) - it keeps its state meanwhile. */
.calc-root.calc-hidden {
  display: none;
}
/* The full-height side drawer owns the bottom-right corner while it is open. */
body:has(.context-drawer.open) .calc-toggle {
  display: none;
}
.calc-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  font: inherit;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 3px solid var(--card-bg);
  box-shadow: var(--shadow-2);
  cursor: pointer;
  pointer-events: auto;
}
.calc-toggle-text {
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  margin-top: -1px;
}
.calc-toggle.open {
  background: var(--card-bg);
  color: var(--accent);
  border-color: var(--accent);
}
.calc-toggle:focus-visible,
.calc-close:focus-visible,
.calc-key:focus-visible,
.calc-head:focus-visible,
.calc-display:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.calc-panel {
  position: fixed;
  right: 16px;
  bottom: 92px;
  width: 308px;
  max-width: calc(100vw - 16px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  padding: 0 12px 12px;
  pointer-events: auto;
  color: var(--text);
  overflow-y: auto; /* only a very short screen scrolls the panel; the header (with the close X) stays pinned */
  max-height: calc(100vh - 108px);
}
.calc-panel > .calc-head {
  position: sticky;
  top: 0;
  z-index: 1;
}
.calc-display-wrap {
  position: relative;
}
.calc-deg {
  position: absolute;
  left: 10px;
  top: 7px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  pointer-events: none;
}
.calc-panel[hidden] {
  display: none;
}
.calc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 -12px 8px;
  padding: 8px 8px 8px 14px;
  min-height: 48px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--selected-bg);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.calc-head.dragging {
  cursor: grabbing;
}
.calc-title {
  font-weight: 700;
  font-size: 0.95rem;
}
.calc-close {
  width: 44px;
  height: 44px;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.calc-close:hover {
  background: var(--card-bg);
}
body .calc-panel input.calc-display { /* beats [data-cruxms] input[type=text] */
  width: 100%;
  min-height: 48px;
  font-size: 1.2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 8px 12px 8px 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
}
.calc-result {
  display: block;
  min-height: 2.1rem;
  padding: 2px 6px 0;
  text-align: right;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.calc-result.calc-error {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}
.calc-keys {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.calc-key {
  min-height: 46px;
  padding: 0;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.calc-key:hover {
  border-color: var(--accent);
}
.calc-key:active {
  background: var(--selected-bg);
}
.calc-key-wide3 {
  grid-column: span 3;
}
.calc-key-wide2 {
  grid-column: span 2;
}
.calc-key-fn {
  font-size: 0.85rem;
  color: var(--accent);
}
.calc-key-op {
  background: var(--selected-bg);
  color: var(--accent);
}
.calc-key-ctl {
  font-size: 0.85rem;
}
.calc-key-eq {
  grid-column: 5;
  grid-row: span 2;
  color: var(--accent-contrast);
  background: var(--accent);
  border-color: var(--accent);
  font-size: 1.4rem;
}
.calc-key-zero {
  grid-column: span 2;
}
@media (prefers-reduced-motion: no-preference) {
  .calc-toggle,
  .lesson-flip,
  .test-jump-btn {
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }
}
@media (max-width: 420px) {
  .calc-panel {
    width: calc(100vw - 16px);
    right: 8px;
    /* at the top, under the header, so the answer box and Next stay in view below it */
    top: 56px;
    bottom: auto;
    /* every key row fits on a 390x844 and a 375x667 phone; the header (with the close X) never scrolls away */
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    padding: 0 8px 8px;
  }
  /* shell.css lifts the panel above the tab bar (bottom: 156px); on a phone it hangs from the top instead */
  html body:has(.gw-shell[data-role="student"]) .calc-panel {
    bottom: auto;
  }
  /* the Calc button would sit on top of the keypad's = key on a short phone: while the panel is open the X closes it */
  .calc-toggle.open {
    display: none;
  }
  .calc-head {
    margin: 0 -8px 4px;
    min-height: 44px;
    padding-top: 2px;
    padding-bottom: 2px;
  }
  body .calc-panel input.calc-display { /* beats [data-cruxms] input[type=text] */
    display: block; /* no inline-baseline gap under the input */
    min-height: 40px;
    font-size: 1.1rem;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .calc-result {
    min-height: 1.4rem;
    line-height: 1.3;
    font-size: 1.1rem;
    padding: 0 6px;
  }
  .calc-keys {
    gap: 4px;
    margin-top: 4px;
    grid-auto-rows: 44px; /* 8 rows x 44px + gaps: fits a 375x667 phone without scrolling */
  }
  .calc-key {
    min-height: 44px;
  }
}

/* ---- lesson activities: label / sort / spot / predict ---- */
.lesson-activity {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--card-bg);
}
.lesson-label-rows {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.lesson-label-row,
.lesson-label-chip,
.lesson-sort-item,
.lesson-sort-bucket-btn,
.lesson-spot-step {
  font: inherit;
  color: var(--text);
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 44px;
  text-align: left;
  cursor: pointer;
}
.lesson-label-row {
  width: 100%;
}
.lesson-label-row.active,
.lesson-sort-item.selected {
  border-color: var(--accent);
  background: var(--selected-bg);
}
.lesson-label-row.locked,
.lesson-sort-item.locked {
  border-color: var(--mastered);
  cursor: default;
  opacity: 1;
}
.lesson-label-bank,
.lesson-sort-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.lesson-sort-tray:empty {
  display: none;
}
.lesson-label-chip.used {
  opacity: 0.45;
}
.lesson-sort-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.lesson-sort-bucket {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 8px;
  background: var(--bg);
}
.lesson-sort-bucket-btn {
  width: 100%;
  font-weight: 700;
  text-align: center;
}
.lesson-sort-bucket-btn:not(:disabled) {
  border-color: var(--accent);
}
.lesson-sort-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.lesson-spot-steps {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lesson-spot-step {
  width: 100%;
}
.lesson-spot-step.tried {
  opacity: 0.6;
}
.lesson-spot-step.wrong-step {
  border-color: var(--wrong);
  opacity: 1;
}
.lesson-build-lines {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lesson-build-line {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg);
  border-left: 4px solid var(--border);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.lesson-build-line.new {
  border-left-color: var(--mastered);
}
.lesson-build-round {
  margin-top: 8px;
}
.choice-option.tried {
  opacity: 0.6;
}
@media (max-width: 520px) {
  .lesson-activity .lesson-predict-reveal.shown {
    margin-inline: -13px;
    padding: 8px 5px;
  }
  .lesson-predict-reveal .lesson-figure {
    padding: 4px;
    border: 0;
    background: none;
  }
}
.lesson-predict-reveal:empty {
  display: none;
}
.lesson-predict-reveal.shown {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 6px solid var(--accent);
  background: var(--bg);
}
.lesson-label-row:focus-visible,
.lesson-label-chip:focus-visible,
.lesson-sort-item:focus-visible,
.lesson-sort-bucket-btn:focus-visible,
.lesson-spot-step:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---- Navigation: the home-base bar, subject and topic screens (nav.js) ------------------------------ */
.navbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.navbar-home,
.navbar-topics {
  min-height: 44px;
  padding: 6px 18px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: var(--card-bg);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.navbar-topics { margin-left: auto; border-color: var(--border); }
.navbar-home:hover,
.navbar-topics:hover { background: var(--selected-bg); }
.navbar-here { flex: 1 1 220px; min-width: 0; }
.crumbs { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; }
.crumbs li:not(:last-child)::after { content: "›"; color: var(--muted); padding: 0 8px; } /* the separator ends the line before it, so a wrapped line never starts with a lone › */
.crumb-link { background: none; border: 0; padding: 10px 2px; min-height: 44px; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.crumb-current { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.navbar button:focus-visible,
.crumb-link:focus-visible,
.topic-row-main:focus-visible,
.topic-action:focus-visible,
.home-settings summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.topic-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.topic-row { display: flex; gap: 8px; align-items: stretch; }
.topic-row-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.topic-row-main.static { cursor: default; }
button.topic-row-main:hover { border-color: var(--accent); }
.topic-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.topic-row-title { font-weight: 600; }
.topic-row-state { font-size: 0.88rem; }
.topic-row-go { color: var(--muted); font-size: 1.5rem; line-height: 1; }
.topic-row .review-btn { align-self: center; min-height: 44px; }

.topic-actions { display: grid; gap: 12px; margin: 16px 0 8px; }
.topic-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  min-height: 72px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.topic-action.primary { border-color: var(--accent); background: var(--selected-bg); }
.topic-action:hover:not(:disabled) { border-color: var(--accent); }
.topic-action:disabled { opacity: 0.65; cursor: default; }
.topic-action-title { font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.topic-action-state { font-weight: 600; }

.home-settings summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.home-settings .goal-card { margin-top: 8px; }
.test-leave-confirm { border-color: var(--due); }

.btn[hidden] { display: none; }

/* ---- hotspot / change / cycle / picture lesson blocks ---- */
.lesson-hotspot-stage { position: relative; max-width: 560px; margin: 10px auto; }
.lesson-hotspot-stage .lesson-svg svg { display: block; width: 100%; height: auto; }
.lesson-pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--accent);
}
.lesson-pin::before {
  content: ''; position: absolute; inset: 9px; border-radius: 50%;
  border: 3px solid var(--accent); background: var(--card-bg); z-index: -1;
}
.lesson-pin { z-index: 1; isolation: isolate; }
.lesson-pin.seen { color: var(--surface); }
.lesson-pin.seen::before { background: var(--mastered); border-color: var(--mastered); }
.lesson-pin:focus-visible, .lesson-stop:focus-visible, .lesson-cycle-node:focus-visible, .lesson-slider:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.lesson-hotspot-panel:empty { display: none; }
.lesson-hotspot-panel, .lesson-cycle-panel, .lesson-change-out {
  border-left: 4px solid var(--accent); background: var(--selected-bg);
  border-radius: 8px; padding: 10px 14px; margin: 10px 0;
}
.lesson-hotspot-name { font-weight: 700; margin: 0 0 4px; }
.lesson-slider { width: 100%; min-height: 44px; margin: 8px 0 0; accent-color: var(--accent); }
.lesson-stop-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.lesson-stop {
  font: inherit; color: var(--text); background: var(--card-bg);
  border: 2px solid var(--border); border-radius: 10px; padding: 8px 12px; min-height: 44px; cursor: pointer;
}
.lesson-stop.seen { border-color: var(--mastered); }
.lesson-stop.active { border-color: var(--accent); background: var(--selected-bg); font-weight: 700; }
.lesson-change-setting { margin: 0 0 6px; }
.lesson-meter { height: 18px; border-radius: 9px; background: var(--border); overflow: hidden; margin: 6px 0 2px; }
.lesson-meter-fill { height: 100%; background: var(--accent); transition: width 0.25s; }
.lesson-meter-text { margin: 0 0 8px; font-weight: 700; }
.lesson-cycle-ring { position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 10px auto; border-radius: 50%; border: 2px dashed var(--border); }
.lesson-cycle-ring .lesson-cycle-node { position: absolute; transform: translate(-50%, -50%); width: 30%; min-width: 0; hyphens: auto; }
@media (max-width: 400px) { .lesson-cycle-ring .lesson-cycle-node { width: 34%; padding: 4px 2px; font-size: 0.78rem; } }
.lesson-cycle-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.lesson-cycle-node {
  font: inherit; color: var(--text); background: var(--card-bg); border: 2px solid var(--border);
  border-radius: 12px; padding: 6px 8px; min-height: 44px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.15;
}
.lesson-cycle-num { font-weight: 700; color: var(--accent); }
.lesson-cycle-title { font-size: 0.85em; }
.lesson-cycle-node.seen { border-color: var(--mastered); }
.lesson-cycle-node.active { border-color: var(--accent); background: var(--selected-bg); }
.lesson-picture { margin: 12px 0; }
.lesson-photo { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .lesson-meter-fill { transition: none; } }

/* Teacher "Practice items" screen (stage 8) */
.gwi-warn { border-left: 4px solid var(--warning); background: var(--warning-pale); }
.gwi-item { margin-top: 12px; }
.gwi-item ol { margin: 4px 0 8px; padding-left: 22px; }
.gwi-form label { display: block; margin: 14px 0 4px; font-weight: 600; }
.gwi-form textarea { display: block; width: 100%; box-sizing: border-box; }
.gwi-form .btn-row { margin-top: 12px; }
.gwi-form select { min-height: 44px; padding: 0 12px; border-radius: 8px; max-width: 100%; } /* the class and topic menus: a real touch target (they were 22px tall) */

/* --- Box plot answer (boxplotWidget.js): five handles on a number line. Colours are tokens only. --- */
.boxplot-wrap {
  margin: 0.75rem auto;
  max-width: 34rem;
}
.boxplot-svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.bp-grid { stroke: var(--border); stroke-width: 0.6; }
.bp-grid-major { stroke: var(--muted); stroke-width: 1; opacity: 0.6; }
.bp-axis { stroke: var(--text); stroke-width: 1.5; }
.bp-tick { fill: var(--text); font-size: 11px; paint-order: stroke; stroke: var(--card-bg); stroke-width: 3px; }
.bp-label { fill: var(--text); font-size: 11px; }
.bp-ref-name { fill: var(--muted); font-size: 11px; }
.bp-ref { stroke: var(--muted); stroke-width: 2; fill: none; }
.bp-ref-med { stroke-width: 3; }
.bp-ref-box { fill: var(--card-bg); stroke: var(--muted); stroke-width: 2; opacity: 0.9; }
.bp-whisker { stroke: var(--accent); stroke-width: 2.5; }
.bp-box { fill: var(--selected-bg); stroke: var(--accent); stroke-width: 2.5; }
.bp-med { stroke: var(--accent); stroke-width: 4; }
.bp-guide { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: 0.55; }
.bp-knob { cursor: grab; outline: none; }
.bp-hit { fill: transparent; }
.bp-dot { fill: var(--muted); stroke: var(--card-bg); stroke-width: 2; }
.bp-touched .bp-dot { fill: var(--accent); }
.bp-dot-text { fill: var(--accent-contrast); font-size: 11px; font-weight: 700; pointer-events: none; }
.bp-selected .bp-dot { stroke: var(--text); stroke-width: 3; }
.bp-knob:focus-visible .bp-dot { stroke: var(--focus); stroke-width: 4; }
.bp-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.bp-chip {
  font: inherit;
  min-height: 2.75rem;
  padding: 0.3rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}
.bp-chip-name { font-size: 0.8rem; color: var(--muted); }
.bp-chip-val { font-size: 1.05rem; font-weight: 700; }
.bp-chip-on { border-color: var(--accent); background: var(--selected-bg); box-shadow: 0 0 0 2px var(--accent); }
.bp-chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.bp-steprow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.bp-step { min-height: 44px; min-width: 5.5rem; }
.bp-status { margin: 0; text-align: center; font-size: 0.95rem; }
.bp-disabled .bp-knob { cursor: default; }

/* Watch it: a short step-by-step animation inside Learn it (public/watch.js). Calm: nothing moves until Play is pressed, and with "reduce motion" on it is a still
   step-through. Colours are the app's own variables. */
.gw-watch { margin: 0; padding: 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; }
.gw-watch .lesson-block-label { margin: 0 0 8px; }
.gw-watch-stage { background: radial-gradient(120% 90% at 50% 0%, var(--card-bg), var(--bg) 75%); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.gw-watch-stage svg { display: block; width: 100%; height: auto; max-height: 420px; margin: 0 auto; }
.gw-watch-scenes { display: flex; gap: 4px; margin: 8px 2px 0; }
.gw-watch-scene { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.gw-watch-scene-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }
.gw-watch-caption { margin: 8px 2px 8px; min-height: 3.2em; font-size: 1rem; line-height: 1.45; }
.gw-watch-recap { margin: 0 0 10px; padding: 10px 12px; border-left: 4px solid var(--mastered); border-radius: 8px; background: var(--selected-bg); }
.gw-watch-recap[hidden] { display: none; }
.gw-watch-recap p { margin: 0; }
.gw-watch-recap-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.gw-watch-recap-text { font-size: 1rem; line-height: 1.45; }
.gw-watch-controls, .gw-watch-steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gw-watch-controls[hidden], .gw-watch-steps[hidden] { display: none; }
.gw-watch-controls .btn, .gw-watch-steps .btn { min-height: 44px; min-width: 88px; }
.gw-watch-controls .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.gw-watch-slider { flex: 1 1 140px; min-width: 120px; min-height: 44px; accent-color: var(--accent); }
.gw-watch-time, .gw-watch-step { font-size: 0.9rem; min-width: 5.5em; }
.gw-watch-predict { margin: 8px 0 10px; padding: 12px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; background: var(--selected-bg); }
.gw-watch-predict[hidden] { display: none; }
.gw-watch-predict p { margin: 0; }
.gw-watch-predict-label { font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.gw-watch-predict-prompt { font-size: 1.05rem; line-height: 1.4; font-weight: 600; margin: 2px 0 10px; }
.gw-watch-predict-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.gw-watch-predict-choices .btn { min-height: 44px; flex: 1 1 180px; text-align: left; }
.gw-watch-alt-predict { margin: 4px 0 6px; padding-left: 10px; border-left: 3px solid var(--border); }
.gw-watch-alt-predict p { margin: 0 0 2px; }
.gw-watch-alt-predict ul { margin: 0; padding-left: 1.2em; }
.gw-watch-alt { margin-top: 10px; font-size: 0.95rem; }
.gw-watch-alt summary { cursor: pointer; min-height: 44px; box-sizing: border-box; padding: 10px 0; font-weight: 600; }
.gw-watch-alt ol { margin: 6px 0 0; padding-left: 1.3em; }
.gw-watch button:focus-visible, .gw-watch input:focus-visible, .gw-watch summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 480px) { .gw-watch { padding: 10px; } .gw-watch-controls .btn { flex: 1 1 40%; } }

/* Interactive models inside Learn it (public/model.js). The student moves things and the picture, the numbers and the words change at once. Same calm
   look as Watch it: a white panel, the app's own colour variables, green only for the key result, blue for the one thing to look at. Every control is at
   least 44 px to tap. A swipe anywhere except on a drag handle still scrolls the page. */
.gw-model { margin: 0; padding: 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; }
.gw-model-title { margin: 0 0 8px; font-weight: 700; font-size: 1.05rem; }
.gw-model-stage { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.gw-model-stage[hidden], .gw-model-wordsbox[hidden], .gw-model-takeaway[hidden] { display: none; }
.gw-model-stage svg { display: block; width: 100%; height: auto; max-height: 520px; margin: 0 auto; }
.gw-model-handle { outline: none; touch-action: none; cursor: grab; }
.gw-model-hit { fill: transparent; touch-action: none; }
.gw-model-focus-ring { fill: none; stroke: var(--focus); stroke-width: 3; opacity: 0; }
.gw-model-handle:focus-visible .gw-model-focus-ring { opacity: 1; }
.gw-model-readouts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; padding: 8px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 1px 3px rgba(14, 27, 38, 0.14); }
.gw-model-readout { flex: 1 1 110px; min-width: 100px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); }
.gw-model-readout.key { border-color: var(--mastered); }
.gw-model-readout.key .gw-model-readout-value { color: var(--mastered); }
.gw-model-readout-label { display: block; font-size: 0.8rem; color: var(--muted); }
.gw-model-readout-value { display: block; font-size: 1.15rem; line-height: 1.3; }
.gw-model-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 14px; margin: 8px 0; }
.gw-model-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 44px; }
.gw-model-label { flex: 1 1 100%; font-size: 0.95rem; font-weight: 600; }
.gw-model-slider { flex: 1 1 140px; min-width: 120px; min-height: 44px; accent-color: var(--accent); }
.gw-model-value { min-width: 4.5em; text-align: center; font-weight: 700; }
.gw-model-step { min-height: 44px; min-width: 44px; padding: 0 12px; font-size: 1.2rem; }
.gw-model-toggle { min-height: 44px; }
.gw-model-toggle[aria-checked="true"] { background: var(--selected-bg); border-color: var(--accent); }
.gw-model-tasks-label, .gw-model-takeaway-label { margin: 10px 0 4px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.gw-model-task-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.gw-model-task { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.gw-model-tick { flex: 0 0 4.2em; font-size: 0.85rem; color: var(--muted); }
.gw-model-task.done .gw-model-tick { color: var(--mastered); font-weight: 700; }
.gw-model-task-words { flex: 1 1 180px; }
.gw-model-show { min-height: 44px; min-width: 88px; }
.gw-model-takeaway { margin: 10px 0; padding: 10px 12px; border-left: 4px solid var(--mastered); border-radius: 8px; background: var(--selected-bg); }
.gw-model-takeaway p { margin: 0; }
.gw-model-words { margin-top: 8px; min-height: 44px; }
.gw-model-wordsbox { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--selected-bg); }
.gw-model-wordsbox p { margin: 0 0 6px; }
.gw-model button:focus-visible, .gw-model input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 480px) { .gw-model { padding: 10px; } .gw-model-controls { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .gw-model-value { min-width: 3em; } }

/* ---- The helper on every page (public/helper.js) ------------------------------------------------------------------------------------------
   A kiwi button above the calculator button, and a conversation panel: a side panel on a wide screen (the page stays visible beside it), full screen
   on a phone. Tokens only. Never shown in a Show it test (data-gw-screen="test") and not before setup is finished (helper.js enable()). */
.gw-helper-fab {
  position: fixed; right: 16px; bottom: 92px; z-index: 40; display: none; align-items: center; gap: 6px; min-height: 48px; padding: 6px 14px 6px 8px;
  font: inherit; font-weight: 600; color: var(--accent-contrast); background: var(--accent); border: 3px solid var(--card-bg); border-radius: 999px; box-shadow: var(--shadow-2); cursor: pointer;
}
body[data-helper="on"] .gw-helper-fab { display: inline-flex; }
body[data-gw-screen="test"] .gw-helper-fab, body[data-gw-screen="practice-test"] .gw-helper-fab, body[data-practice-open] .gw-helper-fab, body[data-helper-open] .gw-helper-fab { display: none; }
.gw-helper-fab .gw-kiwi-inline { display: inline-flex; background: var(--card-bg); border-radius: 50%; }
.gw-helper-fab:focus-visible, .gw-helper-close:focus-visible, .gw-helper-chip:focus-visible, .gw-helper-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-helper {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(380px, 100vw); display: none; flex-direction: column; background: var(--card-bg);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-3);
}
.gw-helper.open { display: flex; }
.gw-helper-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.gw-helper-title { margin: 0; font-size: 1.1rem; }
.gw-helper-close { min-width: 44px; min-height: 44px; font: inherit; font-size: 1.5rem; line-height: 1; color: var(--text); background: transparent; border: 0; border-radius: var(--radius); cursor: pointer; }
.gw-helper-log { flex: 1 1 auto; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.gw-helper-msg { max-width: 92%; padding: 8px 12px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); }
.gw-helper-msg p { margin: 0 0 6px; } .gw-helper-msg p:last-child { margin-bottom: 0; }
.gw-helper-msg.student { align-self: flex-end; background: var(--selected-bg); border-color: transparent; }
.gw-helper-msg.note, .gw-helper-msg.thinking { color: var(--muted); }
.gw-helper-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gw-helper-action { min-height: 44px; }
.gw-helper-worked { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.gw-helper-worked-h { font-weight: 600; }
.gw-helper-worked .steps-list { margin: 6px 0 6px 1.2em; padding: 0; }
.gw-helper-worked .diagram-wrap svg { max-width: 100%; height: auto; }
.gw-helper-answer { font-weight: 600; }
.gw-helper-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; max-height: 32vh; overflow-y: auto; border-top: 1px solid var(--border); }
.gw-helper-chip { min-height: 44px; padding: 6px 12px; font: inherit; font-size: 0.9rem; color: var(--text); background: var(--card-bg); border: 1px solid var(--border-2); border-radius: 999px; cursor: pointer; }
.gw-helper-chip:disabled, .gw-helper-send:disabled { opacity: 0.55; cursor: default; }
.gw-helper-form { display: flex; gap: 8px; padding: 8px 16px; align-items: flex-end; }
.gw-helper-input { flex: 1 1 auto; font: inherit; padding: 8px; border: 1px solid var(--border-2); border-radius: var(--radius); resize: none; background: var(--card-bg); color: var(--text); }
.gw-helper-send { min-height: 44px; }
.gw-helper-note { margin: 0; padding: 0 16px 12px; font-size: 0.8rem; }
/* Wide screens: the page keeps its place beside the panel, so the question stays visible while the helper talks. */
@media (min-width: 1100px) { body[data-helper-open] .gw-main { padding-right: 396px; } body[data-helper-open] .calc-toggle { right: 396px; } }
@media (max-width: 700px) { .gw-helper { width: 100vw; } .gw-helper-fab { bottom: 88px; } body.has-calc .gw-helper-fab { bottom: 156px; } } /* 12 Nov 2026: on a phone the kiwi button sat on top of the Calc button (80px up) on every question screen; it goes above it */
@media (prefers-reduced-motion: no-preference) { .gw-helper-fab, .gw-helper-chip { transition: background-color 0.15s ease, border-color 0.15s ease; } }

/* Student sign-out confirm (whole-app review 12 Nov 2026) */
.gw-dialog { max-width: min(28rem, calc(100vw - 32px)); border: 1px solid var(--border); margin: auto; }
.gw-dialog::backdrop { background: rgb(0 0 0 / 0.4); }

/* "Your next 3 topics" at the end of an Already know this? check (screens.js buildNextThree) and the small lesson link under a second wrong answer in a row (app.js lessonOfferFor) */
.gw-next3 { margin-top: 20px; }
.gw-next3-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gw-next3-list .btn { width: 100%; text-align: left; }
.lesson-offer { margin: 8px 0 0; font-size: 0.95em; }
/* The same-name sentence at the foot of the class brief card sits inside the card's padding like the rows above it (the card clips its edges) */
.bf .gw-name-hint { margin: 0; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); }
@media (max-width: 640px) { .bf .gw-name-hint { padding: var(--sp-3) var(--sp-4); } }

/* The course version row on My progress (migration 019): two choices, or one plain sentence when the student's class follows one. */
.gw-course-row { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.gw-course-h { margin: 0 0 var(--sp-1); font: 600 16px/1.4 var(--font-body, inherit); }
.gw-course-row p { margin: 0 0 var(--sp-2); }

/* The home version: linked adults on My progress, and family notices on Today (screens.js fillFamilyCard, app.js addFamilyNotices). */
.gw-family-list { margin: 0 0 12px; padding-left: 1.25rem; display: grid; gap: 10px; }
.gw-family-list .btn-row { margin-top: 8px; }
.gw-family-msg:empty { display: none; }
.gw-family-view ul { padding-left: 1.25rem; display: grid; gap: 4px; }
.gw-family-notice { border-left: 4px solid var(--gw, var(--accent)); }

/* The home version, phase E: topics from the test sheet on Add a test date (test-sheet.js). Reuses the form's .gw-pick groups and .gw-field. */
.gw-sheet .gw-sheet-body { padding: 4px 12px 12px; }
.gw-sheet .gw-field input[type="file"] { min-height: 44px; max-width: 100%; }
.gw-sheet-privacy { margin: 0 0 12px; font-size: 14px; }
.gw-sheet-result:empty { display: none; }
.gw-sheet-result { margin-top: 12px; }
.gw-sheet-found { font-weight: 600; }
.gw-sheet-lines { margin: 8px 0 0; padding-left: 1.25rem; display: grid; gap: 4px; overflow-wrap: anywhere; }
.gw-sheet-said { font-weight: 600; }
.gw-sheet-care { border-left: 4px solid var(--danger, #b42318); padding: 8px 12px; background: var(--surface-sunk, #f6f6f6); }
.gw-sheet-care p { margin: 0; }

/* The home version, phase F: "How did it go?" after the student's own test (after-test.js). Reuses .gw-pick, .gw-radio, .gw-field and the sheet's photo styles. */
.gw-after-form .gw-after-mark { max-width: 8rem; }
.gw-after-form > .gw-fieldset { margin-top: var(--sp-3, 16px); }
.gw-after-again { flex-wrap: wrap; }

/* Child panel (what linked adults see): strands sit a little in from their subject (RULES 62). */
.gw-fam-subjectline > .gw-fam-strandline { margin-left: var(--sp-3); }

/* RULES 62 (teacher pass): the folded Set new work line on a class page, and topic names in the class counts tables that keep whole words on a phone. */
.gw-work-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 44px; }
.gw-work-fold > summary::-webkit-details-marker { display: none; }
.gw-work-fold > summary h2 { margin: 0; color: var(--primary-d, var(--primary)); }
.gw-work-fold > summary h2::before { content: '+ '; }
.gw-work-fold > summary h2::before { content: '+ ' / ''; } /* read as decoration only, where the browser allows it */
.gw-work-fold[open] > summary h2::before { content: '\2212 '; }
.gw-work-fold[open] > summary h2::before { content: '\2212 ' / ''; }
.gw-work-fold > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-main table.dtable.gw-counts tbody th.gw-rowhead { overflow-wrap: break-word; word-break: normal; hyphens: none; }
@media (max-width: 480px) { .gw-main table.dtable.gw-counts th, .gw-main table.dtable.gw-counts td { padding-left: 6px; padding-right: 6px; } .gw-main table.dtable.gw-counts thead th { font-size: 11px; letter-spacing: 0; } .gw-main table.dtable.gw-counts .num { width: auto; } }
/* Set work page: the page status line and the topic-search count take no room until they have words. */
.gw-main #work-status:empty, .gw-main .gw-field > .gw-status:empty { min-height: 0; margin: 0; }

/* Students tab on a phone: a student who has never answered shows only their name and Not started yet (RULES 62). */
@media (max-width: 820px) { .gw-main table.dtable.gw-stack td.gw-cp-nil { display: none; } }

/* ===== Home version: pictures and the child's graphic screens (19 Nov 2026, Mark: fewer words, more picture). Used by the family pages and the child's Home screens.
   Every class here starts gw-ico, gw-ring or gw-hm-, and only the home look's markup uses them (nav.js isHomeLook), so school screens are never touched.
   Colours are CRUXMS tokens. Green (--success) means locked in, as everywhere in Groundwork; blue (--primary) is the one action colour. ===== */
.gw-ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gw-ico.sm { width: 20px; height: 20px; }
.gw-ico.lg { width: 32px; height: 32px; }
.gw-ico.xl { width: 56px; height: 56px; stroke-width: 1.5; }
.gw-ring { position: relative; width: 72px; height: 72px; flex: none; }
.gw-ring.small { width: 52px; height: 52px; }
.gw-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gw-ring circle { fill: none; stroke-width: 7; }
.gw-ring .track { stroke: var(--border); }
.gw-ring .arc { stroke: var(--success); stroke-linecap: round; }
.gw-ring.neutral .arc { stroke: var(--ink); } /* a score is not "locked in": no green (design guide, status) */
.gw-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 800 1.2rem/1 var(--font-head, var(--font-body)); color: var(--ink); }
.gw-ring.small b { font-size: 1rem; }

/* Big choice buttons: "How did it go?" (three faces) and the practice paper's time pills. The real radio stays in the page (hidden but focusable), so the keyboard,
   screen readers and the form code work as before; the label around it is the button. */
.gw-hm-faces { border: 0; padding: 0; margin: 0 0 var(--sp-4); min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.gw-hm-faces > legend { grid-column: 1 / -1; padding: 0; margin-bottom: var(--sp-1); font-weight: 700; color: var(--ink); }
.gw-hm-face { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 112px; padding: var(--sp-3); text-align: center; border: 2px solid var(--border-2); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); cursor: pointer; font: 700 16px/1.25 var(--font-body); color: var(--ink); overflow-wrap: break-word; min-width: 0; }
.gw-hm-face .gw-ico { width: 40px; height: 40px; color: var(--text-faint); }
.gw-hm-face:hover { border-color: var(--ink); }
.gw-hm-face input, .gw-hm-chip input, .gw-hm-pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.gw-hm-face:has(input:checked) { border-color: var(--primary); background: var(--primary-pale); box-shadow: inset 0 -4px 0 var(--primary), var(--shadow-1); }
.gw-hm-face:has(input:checked) .gw-ico { color: var(--primary-d); }
.gw-hm-face:has(input:focus-visible), .gw-hm-chip:has(input:focus-visible), .gw-hm-pill:has(input:focus-visible), .gw-hm-photo:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-hm-pills { border: 0; padding: 0; margin: 0 0 var(--sp-4); min-width: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.gw-hm-pills > legend { flex: 1 0 100%; padding: 0; margin-bottom: var(--sp-1); font-weight: 700; color: var(--ink); }
.gw-hm-pill { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 56px; min-width: 96px; padding: 0 var(--sp-5); border: 2px solid var(--border-2); border-radius: var(--r-full); background: var(--surface); cursor: pointer; font: 700 16px/1.2 var(--font-body); color: var(--ink); text-align: center; box-shadow: var(--shadow-1); flex: 1 1 auto; }
.gw-hm-pill:hover { border-color: var(--ink); }
.gw-hm-pill:has(input:checked) { border-color: var(--primary); background: var(--primary-pale); box-shadow: inset 0 -4px 0 var(--primary), var(--shadow-1); }
.gw-hm-pill:has(input:checked)::before, .gw-hm-chip:has(input:checked)::before { content: ""; width: 6px; height: 11px; border: solid var(--primary-d); border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -3px 2px 0 0; flex: none; }
/* Topic chips: a topic list as chips. The checkbox stays in the page. */
.gw-hm-chips { list-style: none; margin: 0; padding: var(--sp-2) var(--sp-3) var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.gw-hm-chips > li { min-width: 0; max-width: 100%; }
.gw-hm-chip { position: relative; display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 44px; max-width: 100%; padding: var(--sp-1) var(--sp-4); border: 2px solid var(--border-2); border-radius: var(--r-full); background: var(--surface); cursor: pointer; font: 600 15px/1.25 var(--font-body); color: var(--ink); overflow-wrap: break-word; }
.gw-hm-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-pale); }
.gw-hm-chip:has(input:disabled) { opacity: .55; cursor: default; }
/* The same chosen and focus looks without :has() (home-icons.js adds is-on and is-focus where :has() is not known). Each is its own rule so an old browser still reads it. */
.gw-hm-face.is-on { border-color: var(--primary); background: var(--primary-pale); box-shadow: inset 0 -4px 0 var(--primary), var(--shadow-1); }
.gw-hm-face.is-on .gw-ico { color: var(--primary-d); }
.gw-hm-pill.is-on { border-color: var(--primary); background: var(--primary-pale); box-shadow: inset 0 -4px 0 var(--primary), var(--shadow-1); }
.gw-hm-chip.is-on { border-color: var(--primary); background: var(--primary-pale); }
.gw-hm-face.is-focus, .gw-hm-pill.is-focus, .gw-hm-chip.is-focus, .gw-hm-photo.is-focus { outline: 3px solid var(--focus); outline-offset: 2px; }
/* One big camera tile for a photo: the label opens the real file input. */
.gw-hm-photo { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 160px; padding: var(--sp-5); border: 2px dashed var(--border-2); border-radius: var(--r-lg); background: var(--surface-sunk); cursor: pointer; text-align: center; color: var(--ink); font: 700 17px/1.3 var(--font-body); }
.gw-hm-photo:hover { border-color: var(--primary); background: var(--primary-pale); }
.gw-hm-photo input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.gw-hm-photo .gw-ico { color: var(--primary-d); }
.gw-hm-way > summary { min-height: 64px; gap: var(--sp-3); font: 700 17px/1.3 var(--font-body); }
.gw-hm-way > summary .gw-ico { color: var(--primary-d); }
.gw-hm-done { display: flex; justify-content: center; margin: 0 0 var(--sp-3); }
.gw-hm-done .gw-ico { color: var(--success); }
.gw-hm-way > summary b { font-weight: 700; }
.gw-hm-photo.ready { border-style: solid; border-color: var(--success); background: var(--success-pale, var(--surface-sunk)); }
/* A short line with a picture at its start (a notice, the next thing, a time-up line). */
.gw-hm-line { display: flex; align-items: flex-start; gap: var(--sp-3); }
.gw-hm-line > .gw-ico { margin-top: 1px; color: var(--sc, var(--primary)); }
.gw-hm-line > div { min-width: 0; flex: 1 1 auto; }
.gw-hm-line p { margin: 0; }
.gw-hm-more { margin: var(--sp-1) 0 0; }
.gw-hm-more > summary { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--primary-d); border-radius: var(--r-md); }
.gw-hm-more > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-hm-more > :not(summary) { font-size: 14px; color: var(--text-faint); margin: 0 0 var(--sp-2); }
.gw-hm-more > p.gw-sheet-privacy, .gw-hm-more > ul { color: var(--text-faint); }
/* Practice paper in the home look: the clock line, the time-up box, the score ring and the topic rows. */
.gw-hm-clock { display: flex; align-items: center; gap: var(--sp-2); }
.gw-hm-timeup:not(:empty) { border: 1px solid var(--border-2); border-radius: var(--r-lg); background: var(--surface-sunk); padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-3); }
.gw-hm-timeup .btn-row { margin-top: var(--sp-2); }
.gw-hm-score { display: flex; align-items: center; gap: var(--sp-4); margin: 0 0 var(--sp-3); }
.gw-hm-score .gw-ring { width: 88px; height: 88px; }
.gw-hm-score .gw-ring b { font-size: 1.5rem; }
.gw-hm-score .test-score { margin: 0; }
.gw-hm-topics li.gw-practice-topic { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.gw-hm-topics .gw-bar { flex: 0 0 72px; }
.gw-hm-topics .gw-bar > i { background: var(--ink); }
/* My progress, Adults who can see your progress (home look): one row per adult with a picture. */
.gw-hm-adults { list-style: none; padding-left: 0 !important; }
.gw-hm-adults > li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-3); border: 1px solid var(--border-2); border-radius: var(--r-lg); }
.gw-hm-adults > li > span { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.gw-hm-adults > li > .gw-ico { color: var(--sc, var(--primary)); }
.gw-hm-adults > li > .gw-hm-cansee { flex: 1 1 100%; margin: 0; font-size: 14px; }
.gw-hm-adults > li > .btn-row { flex: 1 1 100%; margin-top: 0; }
.gw-hm-photo { appearance: none; font-family: var(--font-body); width: 100%; box-sizing: border-box; margin: 0 0 var(--sp-3); }
.gw-hm-photo .gw-hm-say { font: 700 17px/1.3 var(--font-body); }
@media (max-width: 420px) {
  .gw-hm-faces { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .gw-hm-face { flex-direction: row; justify-content: flex-start; min-height: 64px; padding: 0 var(--sp-4); text-align: left; gap: var(--sp-3); }
  .gw-hm-face .gw-ico { width: 32px; height: 32px; }
}
@media (max-width: 300px) {
  .gw-hm-pill { min-width: 0; padding: 0 var(--sp-4); }
  .gw-hm-photo { padding: var(--sp-3); }
  .gw-hm-chip { padding: var(--sp-1) var(--sp-3); }
  .gw-hm-chips { padding-left: 0; padding-right: 0; }
  .gw-hm-face, .gw-hm-face .gw-ico { min-width: 0; }
  .gw-hm-face { flex-direction: column; justify-content: center; padding: var(--sp-2); min-height: 88px; text-align: center; gap: var(--sp-1); }
  .gw-hm-face .gw-ico { width: 32px; height: 32px; }
  .gw-hm-line { gap: var(--sp-2); }
}

/* ===== Batch E (19 Nov 2026): student lesson, practice and practice-test screens in the newer look. LOOK ONLY: no word, button, order or meaning changes.
   Approved pictures: docs/groundwork-design-review/batch-e/. Every colour is a CRUXMS token. Each rule starts with .gw-shell[data-role="student"] so it beats the older rules above
   and the vendored shell/shell.css, which loads after this file. ===== */

/* E1. Student bar (.navbar): one quiet row with a hairline under it; the three heavy outlined pills are now two quiet buttons and the trail */
.gw-shell[data-role="student"] .gw-main .navbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-5); padding: 0 0 var(--sp-3); border-bottom: 1px solid var(--border); }
.gw-shell[data-role="student"] .gw-main .navbar-home, .gw-shell[data-role="student"] .gw-main .navbar-topics { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-4); border: 1px solid var(--border-2); border-radius: var(--r-full); background: var(--surface); color: var(--ink); font: 600 15px/1 var(--font-body); }
.gw-shell[data-role="student"] .gw-main .navbar-home:hover, .gw-shell[data-role="student"] .gw-main .navbar-topics:hover { background: var(--surface-sunk); }
.gw-shell[data-role="student"] .gw-main .navbar-home:focus-visible, .gw-shell[data-role="student"] .gw-main .navbar-topics:focus-visible, .gw-shell[data-role="student"] .gw-main .crumb-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-shell[data-role="student"] .gw-main .navbar-topics { margin-left: auto; }
.gw-shell[data-role="student"] .gw-main .navbar-here { flex: 1 1 260px; min-width: 0; }
.gw-shell[data-role="student"] .gw-main .crumbs { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; font-size: 14px; color: var(--text-muted); }
.gw-shell[data-role="student"] .gw-main .crumbs li { display: inline-flex; align-items: center; }
.gw-shell[data-role="student"] .gw-main .crumbs li:not(:last-child)::after { content: "\203A"; color: var(--text-muted); padding: 0 var(--sp-1); }
.gw-shell[data-role="student"] .gw-main .crumb-link { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--sp-1); color: var(--primary-d); font: 500 14px/1 var(--font-body); text-decoration: underline; }
.gw-shell[data-role="student"] .gw-main .crumb-current { font-weight: 600; color: var(--ink); white-space: normal; }
.gw-shell[data-role="student"] .gw-main .navbar-home .gw-ic { width: 18px; height: 18px; }

/* E2. Page header: the lesson's kicker and heading sit under the same 3px line as .gw-ph; the practice header (.app-header) keeps its live parts under that line */
.gw-shell[data-role="student"] .lesson-page > .lesson-kicker, .gw-shell[data-role="student"] .lesson-page > .lesson-meta { border-top: 3px solid var(--gw); padding-top: var(--sp-3); }
.gw-shell[data-role="student"] .lesson-page .lesson-kicker { margin: 0 0 var(--sp-1); font: 500 14px/1.4 var(--font-body); color: var(--text-muted); }
.gw-shell[data-role="student"] .lesson-page .lesson-title, .gw-shell[data-role="student"] .lesson-page .lesson-step-title { margin: 0; font-size: 28px; line-height: 1.2; word-spacing: 0.1em; }
.gw-shell[data-role="student"] .app-header { border-top: 3px solid var(--gw); padding-top: var(--sp-3); margin: 0 0 var(--sp-4); }
.gw-shell[data-role="student"] .app-header-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.gw-shell[data-role="student"] .header-label { margin: 0; }
.gw-shell[data-role="student"] .header-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.gw-shell[data-role="student"] .header-actions .context-toggle { min-height: 44px; padding: 0 var(--sp-4); font: 600 15px/1 var(--font-body); border: 1px solid var(--border-2); border-radius: var(--r-full); background: var(--surface); color: var(--ink); }
.gw-shell[data-role="student"] .header-actions .context-toggle { height: auto; max-width: 100%; padding-top: var(--sp-2); padding-bottom: var(--sp-2); white-space: normal; text-align: center; line-height: 1.25; }
.gw-shell[data-role="student"] .header-actions .context-toggle:hover, .gw-shell[data-role="student"] .card:has(> .problem-display) .teacher-toggle:hover { background: var(--surface-sunk); }
.gw-shell[data-role="student"] .card:has(> .problem-display) .teacher-toggle { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); width: fit-content; max-width: 100%; height: auto; white-space: normal; text-align: center; min-height: 48px; padding: var(--sp-2) var(--sp-5); font: 600 16px/1 var(--font-body); border: 1px solid var(--border-2); border-radius: var(--r-full); background: var(--surface); color: var(--primary-d); margin: 0 auto var(--sp-5); }
.gw-shell[data-role="student"] .header-actions .btn { min-height: 44px; padding: 0 var(--sp-4); font-size: 15px; }

/* E3. Progress, same meaning as before: topic dots (green with a tick = locked in, blue = learning, hollow = not started, ring = here, amber ring = due), the green bar, the lesson bar */
.gw-shell[data-role="student"] .mini-ladder { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.gw-shell[data-role="student"] .mini-dot { flex: 0 0 auto; position: relative; width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; display: grid; place-items: center; }
.gw-shell[data-role="student"] .mini-dot.locked { background: var(--surface); border-color: var(--border-2); }
.gw-shell[data-role="student"] .mini-dot.learning { background: var(--primary); border-color: var(--primary); }
.gw-shell[data-role="student"] .mini-dot.mastered { background: var(--success); border-color: var(--success); }
.gw-shell[data-role="student"] .mini-dot.mastered::after { content: ""; position: absolute; left: 4px; top: 2px; width: 4px; height: 8px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg); box-sizing: content-box; }
.gw-shell[data-role="student"] .mini-dot.due { border-color: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.gw-shell[data-role="student"] .mini-dot.current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.gw-shell[data-role="student"] .mastery-progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); }
.gw-shell[data-role="student"] .mastery-progress-track { flex: 1 1 120px; height: 8px; border-radius: var(--r-full); background: var(--surface-sunk); border: 0; overflow: hidden; }
.gw-shell[data-role="student"] .mastery-progress-fill { height: 100%; border-radius: var(--r-full); background: var(--success); }
.gw-shell[data-role="student"] .mastery-progress-label { font-size: 14px; color: var(--text-faint); }
.gw-shell[data-role="student"] .lesson-progress-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); margin: var(--sp-3) 0 var(--sp-4); }
.gw-shell[data-role="student"] .lesson-progress { flex: 1 1 120px; height: 8px; margin: 0; border-radius: var(--r-full); background: var(--surface-sunk); overflow: hidden; }
.gw-shell[data-role="student"] .lesson-progress-fill { height: 100%; border-radius: var(--r-full); background: var(--primary); }
.gw-shell[data-role="student"] .lesson-step-label { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
/* practice test: a calm position strip under "Question N of M"; it says the same as the words, never right or wrong */
.gw-shell[data-role="student"] .gw-track { list-style: none; display: flex; gap: 6px; margin: 0 0 var(--sp-4); padding: 0; }
.gw-shell[data-role="student"] .gw-track li { flex: 1 1 0; height: 10px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: var(--surface); }
.gw-shell[data-role="student"] .gw-track li.done { background: var(--primary); border-color: var(--primary); }
.gw-shell[data-role="student"] .gw-track li.here { background: var(--primary-pale); border: 2px solid var(--primary); }

/* the three screens of this batch are 760px wide, as in the approved pictures (the other student screens keep their width) */
body[data-cruxms][data-gw-screen="lesson"] .gw-main .app, body[data-cruxms][data-gw-screen="practice"] .gw-main .app, body[data-cruxms][data-gw-screen="practice-test"] .gw-main .app { max-width: 760px; }

/* E4. Lesson blocks sit in white cards (the lesson page itself is only a frame) */
.gw-shell[data-role="student"] .card.lesson-card.lesson-page { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; margin-bottom: 0; }
.gw-shell[data-role="student"] .lesson-page .lesson-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--sp-5); margin: 0 0 var(--sp-4); }
.gw-shell[data-role="student"] .lesson-page .lesson-check, .gw-shell[data-role="student"] .lesson-page .lesson-activity { border: 0; border-radius: 0; padding: 0; background: none; }
.gw-shell[data-role="student"] .lesson-page .lesson-block-label { margin: 0 0 var(--sp-3); letter-spacing: 0; text-transform: none; font: 600 13px/1.4 var(--font-body); color: var(--text-faint); }
.gw-shell[data-role="student"] .lesson-page .lesson-block .lesson-figure { padding: 0; background: none; border: 0; border-radius: 0; }
.gw-shell[data-role="student"] .lesson-page h2, .gw-shell[data-role="student"] .lesson-page h3 { word-spacing: 0.1em; }
.gw-shell[data-role="student"] .lesson-text p { margin: 0 0 var(--sp-3); font-size: 17px; line-height: 1.6; max-width: 65ch; }
.gw-shell[data-role="student"] .lesson-text p:last-child { margin-bottom: 0; }
.gw-shell[data-role="student"] .lesson-callout-key { margin: var(--sp-4) 0 var(--sp-3); padding: var(--sp-4); background: var(--surface-sunk); border: 0; border-radius: var(--r-md); text-align: center; }
.gw-shell[data-role="student"] .lesson-callout-key .lesson-callout-label { margin: 0 0 var(--sp-1); font: 600 13px/1.4 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--text-faint); }
.gw-shell[data-role="student"] .lesson-callout-key .lesson-callout-body .eq { font: 800 30px/1.3 var(--font-head); color: var(--ink); letter-spacing: -0.01em; word-spacing: 0.12em; }
.gw-shell[data-role="student"] .lesson-callout-key .lesson-callout-body .eq sup { font-size: 0.6em; }
.gw-shell[data-role="student"] .lesson-callout-key .lesson-callout-body p { margin: var(--sp-2) 0 0; font-size: 15px; }

/* E5. "Watch it" (.gw-watch): quiet stage, scene bar, caption, Play / Replay / slider / time */
.gw-shell[data-role="student"] .gw-watch { margin: 0; padding: 0; background: none; border: 0; }
.gw-shell[data-role="student"] .gw-watch-stage { background: var(--surface-sunk); border: 0; border-radius: var(--r-md); padding: var(--sp-3); }
.gw-shell[data-role="student"] .gw-watch-scenes { display: flex; gap: 4px; margin: var(--sp-3) 0 0; }
.gw-shell[data-role="student"] .gw-watch-scene { flex: 1 1 0; height: 6px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: var(--surface); overflow: hidden; }
.gw-shell[data-role="student"] .gw-watch-scene-fill { border-radius: var(--r-full); background: var(--primary); }
.gw-shell[data-role="student"] .gw-watch-stage svg { max-width: 400px; }
.gw-shell[data-role="student"] .gw-watch-caption { margin: var(--sp-3) 0; font-size: 16px; line-height: 1.5; }
.gw-shell[data-role="student"] .gw-watch-controls { gap: var(--sp-3); }
.gw-shell[data-role="student"] .gw-watch-slider { accent-color: var(--primary); }
.gw-shell[data-role="student"] .gw-watch-time { font-size: 14px; color: var(--text-faint); }

/* E6. Check yourself: lettered full-width rows, one selected state. The letter is drawn here (hidden from screen readers), so the words of each choice are unchanged. */
.gw-shell[data-role="student"] .lesson-sort-buckets { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.gw-shell[data-role="student"] .lesson-check-q { margin: 0 0 var(--sp-4); font: 600 19px/1.45 var(--font-body); color: var(--ink); max-width: 65ch; }
.gw-shell[data-role="student"] .choice-options { display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-4); counter-reset: gw-opt; }
.gw-shell[data-role="student"] .choice-option { --gw-pad: var(--sp-4); box-sizing: border-box; position: relative; cursor: pointer; display: block; width: 100%; min-height: 56px; margin: 0; padding: var(--sp-4) var(--gw-pad) var(--sp-4) calc(var(--gw-pad) + 32px + var(--sp-3)); border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); font: 400 17px/1.4 var(--font-body); color: var(--text); text-align: left; overflow-wrap: anywhere; }
.gw-shell[data-role="student"] .choice-option sup, .gw-shell[data-role="student"] .choice-option sub { line-height: 0; }
.gw-shell[data-role="student"] .choice-option:not(:disabled):hover { border-color: var(--primary); background: var(--primary-pale); }
.gw-shell[data-role="student"] .choice-option::before { counter-increment: gw-opt; content: counter(gw-opt, upper-alpha); content: counter(gw-opt, upper-alpha) / ""; position: absolute; left: var(--gw-pad); top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-2); display: grid; place-items: center; font: 600 14px/1 var(--font-body); color: var(--ink); background: var(--surface); }
.gw-shell[data-role="student"] .choice-option[aria-pressed="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-pale); font-weight: 600; }
.gw-shell[data-role="student"] .choice-option[aria-pressed="true"]::before { background: var(--primary); border-color: var(--primary); color: var(--surface); }
.gw-shell[data-role="student"] .lesson-check-options.done .choice-option[aria-pressed="true"] { border-color: var(--mastered); box-shadow: inset 0 0 0 1px var(--mastered); background: var(--success-pale); opacity: 1; }
.gw-shell[data-role="student"] .lesson-check-options.done .choice-option[aria-pressed="true"]::before { background: var(--mastered); border-color: var(--mastered); }
.gw-shell[data-role="student"] .lesson-gate-note { margin: var(--sp-3) 0 0; font-size: 14px; color: var(--text-muted); }
.gw-shell[data-role="student"] .lesson-nav { margin: var(--sp-4) 0 0; }

/* E7. Practice and practice-test question card */
.gw-shell[data-role="student"] .card:has(> .problem-display) { padding: var(--sp-8); }
.gw-shell[data-role="student"] .problem-display { word-spacing: 0.1em; font: 800 30px/1.3 var(--font-head); color: var(--ink); text-align: center; margin: var(--sp-2) auto var(--sp-4); letter-spacing: -0.01em; }
.gw-shell[data-role="student"] .card > .problem-display { font: 800 30px/1.3 var(--font-head); text-align: center; max-width: none; margin: var(--sp-2) auto var(--sp-4); }
.gw-shell[data-role="student"] .problem-display.plain, .gw-shell[data-role="student"] .card > .problem-display.plain { font: 600 22px/1.45 var(--font-body); word-spacing: normal; letter-spacing: 0; }
.gw-shell[data-role="student"] .teacher-toggle { margin: 0 auto var(--sp-5); gap: var(--sp-2); }
.gw-shell[data-role="student"] .steps { margin: 0 0 var(--sp-5); padding: var(--sp-4); background: var(--surface-sunk); border: 0; border-radius: var(--r-md); }
.gw-shell[data-role="student"] .steps-heading { margin: 0 0 var(--sp-3); font: 700 15px/1.4 var(--font-body); color: var(--ink); }
.gw-shell[data-role="student"] .steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.gw-shell[data-role="student"] .steps-list li { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: 17px; line-height: 1.5; }
.gw-shell[data-role="student"] .step-num { flex: none; min-width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-pale); color: var(--primary-d); font: 700 14px/1 var(--font-body); }
.gw-shell[data-role="student"] .steps-list .step-text { flex: 1; padding-top: 2px; }
.gw-shell[data-role="student"] .answer-input-row { display: flex; align-items: center; gap: var(--sp-3); max-width: 420px; margin: var(--sp-4) auto 0; } /* room under the "Show me the method" link */
.gw-shell[data-role="student"] .answer-input-row input[type='text'] { flex: 1 1 auto; width: auto; min-width: 0; min-height: 56px; padding: 0 var(--sp-4); font: 500 22px/1 var(--font-body); border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); color: var(--ink); }
.gw-shell[data-role="student"] .answer-input-row input[type='text']:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--primary); }
.gw-shell[data-role="student"] .answer-input-row input[type='text']:disabled { background: var(--surface-sunk); color: var(--ink); }
.gw-shell[data-role="student"] .unit-label { font-weight: 600; color: var(--text-muted); font-size: 18px; }
.gw-shell[data-role="student"] .answer-input-row input[type='text']::placeholder { font-size: 16px; }
.gw-shell[data-role="student"] .answer-input-row input[type='text'] { text-overflow: ellipsis; }
@media (max-width: 480px) { .gw-shell[data-role="student"] .answer-input-row input[type='text'] { padding: 0 var(--sp-3); } .gw-shell[data-role="student"] .answer-input-row input[type='text']::placeholder { font-size: 14px; } } /* the longest hint (Type a number to 3 significant figures.) fits a 390 window whole */
.gw-shell[data-role="student"] .lesson-page > .lesson-ref { margin: 0 0 var(--sp-4); padding: var(--sp-5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.gw-shell[data-role="student"] .lesson-ref .lesson-block { background: none; border: 0; box-shadow: none; padding: 0; margin: var(--sp-2) 0 0; }
.gw-shell[data-role="student"] .answer-example { max-width: 420px; margin: var(--sp-2) auto 0; font-size: 14px; color: var(--text-faint); text-align: center; }
.gw-shell[data-role="student"] .keypad-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; margin: var(--sp-4) 0 0; }
.gw-shell[data-role="student"] .keypad-key { box-sizing: border-box; cursor: pointer; min-width: 48px; min-height: 48px; display: grid; place-items: center; padding: 0; font: 500 18px/1 var(--font-body); border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); color: var(--ink); }
.gw-shell[data-role="student"] .keypad-key:hover { border-color: var(--primary); background: var(--primary-pale); }
.gw-shell[data-role="student"] .keypad-hint { max-width: 460px; margin: var(--sp-2) auto 0; font-size: 14px; color: var(--text-faint); text-align: center; }
.gw-shell[data-role="student"] .answer-preview { min-height: 1.4em; margin: var(--sp-3) 0 0; font-size: 15px; color: var(--primary-d); text-align: center; }
.gw-shell[data-role="student"] .card:has(> .problem-display) > .btn-row { justify-content: center; margin-top: var(--sp-4); }
.gw-shell[data-role="student"] .test-card .test-progress { margin: 0 0 var(--sp-2); font: 700 18px/1.3 var(--font-body); color: var(--ink); }
.gw-shell[data-role="student"] .test-card .started { margin: 0 0 var(--sp-3); font-size: 14px; color: var(--text-faint); }
.gw-shell[data-role="student"] .diagram-wrap { display: flex; justify-content: center; margin: 0 0 var(--sp-4); padding: var(--sp-3); background: var(--surface-sunk); border-radius: var(--r-md); }
.gw-shell[data-role="student"] .diagram-wrap svg { width: 100%; max-width: 380px; height: auto; }
.gw-shell[data-role="student"] .test-nav { margin-top: var(--sp-4); }

/* E8. Feedback after a wrong answer: the information panel, never red */
.gw-shell[data-role="student"] .feedback { border-radius: var(--r-lg); padding: var(--sp-6); margin: 0 auto var(--sp-4); max-width: 760px; }
.gw-shell[data-role="student"] .feedback.incorrect { background: var(--info-pale); border: 1px solid var(--info); }
.gw-shell[data-role="student"] .feedback-headline { margin: 0 0 var(--sp-2); font: 800 22px/1.3 var(--font-head); color: var(--ink); word-spacing: 0.1em; letter-spacing: -0.005em; }
.gw-shell[data-role="student"] .feedback .ai-sent-note { margin: 0 0 var(--sp-4); font-size: 14px; color: var(--text-faint); }
.gw-shell[data-role="student"] .feedback .steps { background: var(--surface); margin-bottom: var(--sp-3); }
.gw-shell[data-role="student"] .link-btn { box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--sp-1); background: none; border: 0; color: var(--primary-d); font: 500 15px/1 var(--font-body); text-decoration: underline; }
.gw-shell[data-role="student"] .link-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.gw-shell[data-role="student"] .feedback .btn-row { margin-top: var(--sp-2); }
.gw-shell[data-role="student"] .feedback > .steps-list { background: var(--surface); padding: var(--sp-4); border-radius: var(--r-md); margin: 0 0 var(--sp-3); }
.gw-shell[data-role="student"] .feedback .btn-row + .link-btn { display: flex; margin-top: var(--sp-1); }


/* E9. Floating buttons and the class-quiz chip: same places as before, white with a border so each page keeps one blue button */
body[data-gw-screen] .gw-helper-fab { color: var(--ink); background: var(--surface); border: 1px solid var(--border-2); }
body[data-gw-screen] .calc-toggle:not(.open) { color: var(--ink); background: var(--surface); border: 1px solid var(--border-2); }
body[data-gw-screen] .gwq-banner .gwq-join { min-height: 44px; padding: 0 var(--sp-5); background: var(--surface); border: 0; color: var(--ink); font: 600 15px var(--font-body); }

@media (max-width: 820px) {
  .gw-shell[data-role="student"] .gw-main .navbar { margin-bottom: var(--sp-3); }
  .gw-shell[data-role="student"] .gw-main .navbar-here { order: 3; flex: 1 1 100%; }
  .gw-shell[data-role="student"] .lesson-page .lesson-title, .gw-shell[data-role="student"] .lesson-page .lesson-step-title { font-size: 24px; }
  .gw-shell[data-role="student"] .lesson-text p { font-size: 16px; }
  .gw-shell[data-role="student"] .lesson-callout-key .lesson-callout-body .eq { font-size: 24px; }
  .gw-shell[data-role="student"] .lesson-check-q { font-size: 18px; }
  .gw-shell[data-role="student"] .choice-option { --gw-pad: var(--sp-3); font-size: 16px; }
  .gw-shell[data-role="student"] .lesson-nav { flex-direction: column; }
  .gw-shell[data-role="student"] .btn.lesson-nav-btn { flex: 0 0 auto; min-width: 0; width: 100%; }
  .gw-shell[data-role="student"] .lesson-page .lesson-block { padding: var(--sp-4); }
  .gw-shell[data-role="student"] .lesson-card > .lesson-block > .lesson-figure { margin-left: 0; margin-right: 0; }
  .gw-shell[data-role="student"] .lesson-card > .lesson-block > .lesson-figure .lesson-caption { padding-left: 0; padding-right: 0; }
  .gw-shell[data-role="student"] .lesson-page > .lesson-ref { margin: 0 0 var(--sp-4); padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-lg); }

  .gw-shell[data-role="student"] .card:has(> .problem-display) { padding: var(--sp-4); }
  .gw-shell[data-role="student"] .problem-display, .gw-shell[data-role="student"] .card > .problem-display { font-size: 24px; }
  .gw-shell[data-role="student"] .problem-display.plain, .gw-shell[data-role="student"] .card > .problem-display.plain { font-size: 19px; }
  .gw-shell[data-role="student"] .feedback { padding: var(--sp-4); }
  .gw-shell[data-role="student"] .feedback-headline { font-size: 20px; }
  .gw-shell[data-role="student"] .card:has(> .problem-display) > .btn-row .btn, .gw-shell[data-role="student"] .feedback .btn-row .btn { flex: 1 1 100%; }
  .gw-shell[data-role="student"] .answer-input-row { max-width: none; }
  .gw-shell[data-role="student"] .keypad-key { min-width: 44px; min-height: 44px; }
  .gw-shell[data-role="student"] .keypad-row { gap: 6px; }
  .gw-shell[data-role="student"] .header-actions .btn { padding: 0 var(--sp-3); flex: 1 1 auto; }
  .gw-shell[data-role="student"] .gw-track { gap: 4px; }
}

/* How you are doing, on My progress (plan PLAN-HOW-THEY-ARE-DOING-2026-11-22): one card above the strands; the week rows are .gw-weeks (shell.css). */
.gw-shell[data-role="student"] .gw-how { margin-bottom: var(--sp-4); }
.gw-shell[data-role="student"] .gw-how h2 { margin: 0 0 var(--sp-1); }
.gw-shell[data-role="student"] .gw-how h3 { margin: var(--sp-4) 0 var(--sp-1); font-size: 15px; }
.gw-shell[data-role="student"] .gw-how ul:not(.gw-weeks) { margin: 0; padding-left: 1.1rem; }
.gw-shell[data-role="student"] .gw-how-lead { margin: 0; }
.gw-shell[data-role="student"] .gw-how-next { margin: var(--sp-4) 0 var(--sp-2); }
