/* Groundwork shell and screens. Loaded after vendor/cruxms-design (tokens, typography, components.scoped) and styles.css.
   Tokens only: no hex and no :root in this file, except the ONE accent rule below. Every rule is scoped under the
   [data-cruxms] attribute that shell.js puts on <body>, the way components.scoped.css expects. */

/* --- Groundwork module accent: SANDBOX until Mark confirms the indigo (plan 2026-10-17). On his yes, --gw / --gw-pale move to
   the shared CRUXMS repo (tokens.css + module-accent-map.md) and this rule is deleted. Used only for the product mark,
   the page-header line and the selected-tab underline; never the only signal (always with a label). --- */
[data-cruxms] { --gw: #131386; --gw-pale: #E8E8F7; --sc: var(--gw); --sc-pale: var(--gw-pale); }

/* The CRUXMS faces (typography.css loads them; tokens.css still points --font-* at Inter until the typeface step is
   taken - Mark took it 2026-10-17: Archivo + IBM Plex Sans + IBM Plex Mono, Google Fonts link as shipped). */
[data-cruxms] { --font-head: var(--font-head-target); --font-body: var(--font-body-target); --font-mono: var(--font-mono-target); }
[data-cruxms] input, [data-cruxms] button, [data-cruxms] select, [data-cruxms] textarea { font-family: var(--font-body); }

/* ---------- layout ---------- */
.gw-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: var(--topbar-h) minmax(0, 1fr); min-height: 100vh; }
.gw-skip { position: absolute; left: -999px; top: 0; }
.gw-skip:focus { left: var(--sp-4); top: var(--sp-2); background: var(--surface); padding: var(--sp-2) var(--sp-3); z-index: 80; border-radius: var(--r-sm); }
.gw-top { grid-column: 1 / -1; grid-row: 1; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-4); background: var(--surface); border-bottom: 1px solid var(--border); }
.gw-brand { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; flex: 1; }
.gw-brand-mark { display: inline-flex; flex: none; }
.gw-school { font: 700 15px/1.2 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.gw-product { font-size: 12px; font-weight: 600; color: var(--text-faint); background: var(--surface-sunk); padding: 2px 8px; border-radius: var(--r-full); white-space: nowrap; }
.gw-user { display: flex; align-items: center; gap: var(--sp-3); font-size: 14px; flex: none; }
.gw-chip { display: flex; align-items: center; gap: var(--sp-2); }
.gw-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-sunk); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.gw-signout { min-height: 44px; }
.gw-menu-btn { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; background: none; border: 1px solid var(--border-2); border-radius: var(--r-md); color: var(--text); cursor: pointer; flex: none; }
.gw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gw-ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.gw-side { grid-column: 1; grid-row: 2; align-self: stretch; background: var(--surface); border-right: 1px solid var(--border); }
/* The nav runs the full height of the page (white all the way down, however tall the page); only its list sticks under the topbar. */
.gw-side-inner { position: sticky; top: var(--topbar-h); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: var(--sp-4) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-4); }
.gw-group-title { font: 600 13px/1.4 var(--font-body); color: var(--text-faint); margin: 0 var(--sp-2) var(--sp-1); letter-spacing: 0; }
.gw-item { display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-3); min-height: 44px; border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: 15px; cursor: pointer; }
a.gw-item:hover { background: var(--surface-sunk); }
.gw-item[aria-current="page"] { background: var(--primary-pale); color: var(--primary-d); font-weight: 600; }
.gw-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-soon { color: var(--text-muted); cursor: default; }
.gw-soon-tag { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-faint); background: var(--surface-sunk); border-radius: var(--r-full); padding: 1px 8px; }
.gw-count { margin-left: auto; min-width: 22px; text-align: center; font-size: 12px; font-weight: 700; line-height: 20px; color: var(--primary-d); background: var(--primary-pale); border-radius: var(--r-full); padding: 0 7px; }
.gw-scrim { display: none; }
.gw-nomenu .gw-side { display: none; }
.gw-nomenu .gw-main { grid-column: 1 / -1; }
.gw-tabs { display: none; }

.gw-main { grid-column: 2; grid-row: 2; min-width: 0; padding: var(--sp-6) var(--sp-8) var(--sp-8); display: flex; flex-direction: column; }
.gw-main .app { max-width: 960px; width: 100%; margin: 0 auto; padding: 0; flex: 1 0 auto; }
.gw-shell[data-density="compact"] .gw-main .app { max-width: 1120px; }
.gw-foot { margin-top: var(--sp-8); padding-top: var(--sp-4); font-size: 13px; color: var(--text-muted); text-align: center; }
.gw-main:focus { outline: none; }

/* ---------- the kiwi ---------- */
.gw-kiwi { color: var(--gw); flex: none; }
.gw-kiwi .k-bg { fill: var(--gw-pale); }
.gw-kiwi .k-fig, .gw-kiwi .k-fig * { fill: currentColor; stroke: currentColor; }
.gw-kiwi .k-fig path { fill: none; }
.gw-kiwi .k-eye { fill: var(--surface); }
.gw-kiwi.gw-mark { color: var(--surface); }
.gw-kiwi.gw-mark .k-bg { fill: var(--gw); }
.gw-kiwi.gw-mark .k-eye { fill: var(--gw); }
.gw-kiwi .k-head { transform-box: view-box; transform-origin: 19px 30px; }
.gw-kiwi.thinking .k-head { transform: rotate(-14deg); }
.gw-kiwi.resting .k-head { transform: rotate(10deg); }
.gw-kiwi.resting .k-eye { transform-box: fill-box; transform-origin: center; transform: scaleY(0.2); }
.gw-kiwi.welcome .k-head { transform: rotate(-6deg); }
.gw-kiwi.help .k-head { transform: rotate(-4deg); }
/* pointing: mirrored so the beak faces the way the Next button is (to the right), head a little forward */
.gw-kiwi.pointing { transform: scaleX(-1); }
.gw-kiwi.pointing .k-head { transform: rotate(-5deg); }
@media (prefers-reduced-motion: no-preference) {
  .gw-kiwi .k-head { transition: transform 0.25s ease; }
  /* The slow blink is the only idle motion, and only where nothing is being answered (Today, setup). */
  .gw-kiwi.idle .k-eye { transform-box: fill-box; transform-origin: center; animation: gw-blink 6s infinite; }
  @keyframes gw-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
}
.gw-kiwi-inline { display: inline-flex; flex: none; vertical-align: middle; }
.gw-kiwi-inline .gw-kiwi { display: block; }
.gw-kiwi-note { display: flex; gap: var(--sp-4); align-items: flex-start; background: var(--surface-sunk); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-6); margin: 0 0 var(--sp-4); }
.gw-kiwi-text { min-width: 0; }
.gw-kiwi-text p { margin: 0 0 var(--sp-2); }
.gw-kiwi-title { font-weight: 600; }
.gw-kiwi-text .btn-row { margin-top: var(--sp-3); }

/* ---------- page header, cards, buttons, inputs ---------- */
.gw-ph { border-top: 3px solid var(--gw); padding-top: var(--sp-3); margin-bottom: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); }
.gw-ph h1 { margin: 0; }
.gw-ph p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.gw-shell[data-density="compact"] h1 { font-size: var(--fs-h1); }
.gw-shell h1:focus { outline: none; }
[data-cruxms] .card { border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--sp-5); margin-bottom: var(--sp-4); }
.gw-shell[data-density="compact"] .card { padding: var(--sp-4); border-radius: var(--r-md); }
[data-cruxms] .btn { font-family: var(--font-body); font-size: 1rem; font-weight: 600; min-height: 48px; padding: 10px var(--sp-6); border-radius: var(--r-full); border: 2px solid var(--primary); background: var(--primary); color: var(--surface); justify-content: center; gap: var(--sp-2); box-shadow: none; }
[data-cruxms] .btn:hover { background: var(--primary-d); border-color: var(--primary-d); transform: none; box-shadow: none; }
[data-cruxms] .btn.secondary, [data-cruxms] .btn.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-2); }
[data-cruxms] .btn.secondary:hover, [data-cruxms] .btn.btn-secondary:hover { background: var(--surface-sunk); border-color: var(--border-2); }
[data-cruxms] .btn.danger { background: var(--surface); color: var(--danger); border: 1px solid var(--danger); }
[data-cruxms] .btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[data-cruxms] .btn:disabled { opacity: 1; background: var(--surface-sunk); border-color: var(--border-2); color: var(--text-muted); cursor: not-allowed; }
.gw-shell[data-density="compact"] .btn { min-height: 44px; font-size: 0.95rem; padding: 6px var(--sp-4); }
.gw-shell[data-density="compact"] .btn-sm, .gw-shell[data-density="compact"] .row-actions button, .gw-shell[data-density="compact"] .class-tab { min-height: 44px; }
[data-cruxms] input:not([type]), [data-cruxms] input[type="text"], [data-cruxms] input[type="email"], [data-cruxms] input[type="search"], [data-cruxms] select { border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-family: var(--font-body); }
[data-cruxms] input[type="text"], [data-cruxms] input[type="email"] { min-height: 48px; padding: 0 var(--sp-3); }
/* Review 19 Nov 2026, finding 4 (Batch B): one look for every search box (the Curriculum page, the topic pickers, the reviewer page) and for the file chooser button. */
[data-cruxms] input[type="search"] { min-height: 44px; padding: 0 var(--sp-3); font-size: 1rem; }
[data-cruxms] input[type="file"]::file-selector-button { font: 600 .95rem var(--font-body); min-height: 44px; margin-right: var(--sp-3); padding: 0 var(--sp-4); border: 1px solid var(--border-2); border-radius: var(--r-full); background: var(--surface); color: var(--text); cursor: pointer; }
[data-cruxms] input[type="file"]::file-selector-button:hover { background: var(--surface-sunk); }
.gw-field input[type="search"] { width: 100%; max-width: 460px; }
.pill-select { font: inherit; min-height: 44px; padding: 0 var(--sp-3); } /* the select boxes on Your own questions: the page's own text size, not the browser's smaller one */
[data-cruxms] input:focus-visible, [data-cruxms] select:focus-visible, [data-cruxms] summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--text-faint); } /* faint (5.5:1 on white) so it also holds on the tinted feedback and note panels */

/* statuses (CRUXMS semantic pairs, always with their words) */
.gw-pill { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: var(--r-full); white-space: nowrap; }
.gw-pill.ok { background: var(--success-pale); color: var(--success); }
.gw-pill.learn { background: var(--primary-pale); color: var(--primary-d); }
.gw-pill.warn { background: var(--warning-pale); color: var(--warning); }
.gw-pill.none { background: var(--surface-sunk); color: var(--text-faint); }
/* Right now (11 Nov 2026): one line per student, topic and counts under the name */
.gw-now-detail { display: block; font-size: 14px; margin-top: 2px; }
.gw-now-list .gw-row { flex-wrap: wrap; justify-content: flex-end; }
.gw-bar { height: 8px; border-radius: var(--r-full); background: var(--surface-sunk); overflow: hidden; }
.gw-bar > i { display: block; height: 100%; background: var(--primary); border-radius: var(--r-full); }

/* ---------- student: Today, Practice, Lessons, My progress ---------- */
.gw-shell[data-role="student"] .gw-main { padding-top: var(--sp-6); }
.gw-today-hi { font-size: var(--fs-display); }
.gw-next { padding: var(--sp-8); box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.gw-next .gw-label { font: 500 var(--fs-label)/1.4 var(--font-mono); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-faint); }
.gw-next-title { font: 800 28px/1.2 var(--font-head); color: var(--ink); margin: 0; }
.gw-next p { margin: 0; }
.gw-soonbox { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.gw-soonbox h2 { margin: 0; font-size: 1.1rem; }
.gw-switches { display: grid; gap: 0; }
.gw-switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.gw-switch-row:last-child { border-bottom: 0; }
.gw-lesson-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }

.gw-main .navbar { margin: 0 0 var(--sp-4); gap: var(--sp-2); }
.gw-main .navbar-home, .gw-main .navbar-topics { border-radius: var(--r-full); }
.gw-main .crumb-link { color: var(--primary-d); }
.strand-card, .topic-row-main, .topic-action { border-color: var(--border-2); border-radius: var(--r-md); }
.strand-card:hover, .topic-row-main:hover, .topic-action:hover { border-color: var(--primary); }

/* the practice screen (guideline 7): question large and centred, Check primary, hints secondary, nothing animates */
.app-header { margin-bottom: var(--sp-4); }
.header-label { font: 500 var(--fs-label)/1.4 var(--font-mono); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-faint); }
.card:has(> .problem-display) { max-width: 760px; margin-left: auto; margin-right: auto; padding: var(--sp-8); }
.card > .problem-display { font-size: 1.75rem; line-height: 1.4; font-weight: 600; text-align: center; max-width: 65ch; margin: 0 auto var(--sp-4); }
.card:has(> .problem-display) .teacher-toggle { display: block; margin: 0 auto var(--sp-6); border-color: var(--border-2); background: var(--surface); color: var(--primary-d); }
.card:has(> .problem-display) .answer-input-row, .card:has(> .problem-display) .answer-example, .card:has(> .problem-display) .answer-preview { max-width: 420px; margin-left: auto; margin-right: auto; }
.card:has(> .problem-display) .keypad-row { justify-content: center; }
.card:has(> .problem-display) .keypad-hint { text-align: center; }
.card:has(> .problem-display) > .btn-row { justify-content: center; }
.card:has(> .problem-display) > .btn-row .btn { min-width: 160px; }
.card:has(> .problem-display) .link-btn { display: block; margin: 0 auto; }
.feedback { border-radius: var(--r-md); }
.feedback.correct { background: var(--success-pale); border: 1px solid var(--success); }
.feedback.incorrect { background: var(--info-pale); border: 1px solid var(--info); }
.feedback.incorrect-minor { background: var(--warning-pale); border: 1px solid var(--warning); }
.mistake-tag { color: var(--warning); }
.steps { background: var(--surface-sunk); border: 0; border-radius: var(--r-md); }
.ai-note { background: var(--surface); border: 1px solid var(--border-2); border-style: solid; }
.context-toggle { border-color: var(--border-2); color: var(--primary-d); }
.badge.due, .badge.mastered { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--surface); }

/* ---------- staff ---------- */
.gw-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: var(--sp-4); }
.gw-row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.gw-split { display: flex; justify-content: space-between; gap: var(--sp-4); align-items: flex-start; flex-wrap: wrap; }
.gw-tw { overflow-x: auto; }
.gw-list { list-style: none; margin: 0; padding: 0; }
.gw-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.gw-list li:last-child { border-bottom: 0; }
.gw-check { list-style: none; margin: 0; padding: 0; }
.gw-check li { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-2) 0; }
.gw-tick { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.gw-tick.done { background: var(--success-pale); color: var(--success); }
.gw-tick.todo { background: var(--surface-sunk); color: var(--text-faint); }
/* a finished checklist folds to one line; opened, it reads as the list did */
.gw-done-fold > .gw-check { margin-top: var(--sp-2); }
.gw-done-fold > summary { color: var(--text); } /* a summary line, not a link: ink, not link blue */
/* the one short line under a tile's label that says exactly who is counted */
.stat-tile-note { margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
/* Staff summary tiles on the dial look (Batch C, finding 9): the number on the left, the words in ordinary sentence case beside it, the same card as a class dial. The shared tile in vendor/ is not edited. */
.gw-main .gw-home-tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.gw-main .gw-home-tiles .stat-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--sp-3); align-items: center; text-align: left; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.gw-main .gw-home-tiles .stat-tile-value { grid-row: 1 / span 3; font: 800 28px/1 var(--font-head, var(--font-body)); min-width: 2ch; text-align: center; }
.gw-main .gw-home-tiles .stat-tile-label { margin: 0; font: 700 15px/1.25 var(--font-body); text-transform: none; letter-spacing: 0; color: var(--ink); }
.gw-main .gw-home-tiles .stat-tile-note { grid-column: 2; margin: 1px 0 0; font-size: 13px; line-height: 1.35; }
.gw-main .gw-home-tiles a.stat-tile:hover { background: var(--sc-pale, var(--primary-pale)); border-color: var(--sc, var(--primary)); transform: none; }
.gw-main .gw-home-tiles a.stat-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 520px) { .gw-main .gw-home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); } .gw-main .gw-home-tiles .stat-tile { grid-template-columns: minmax(0, 1fr); padding: var(--sp-3); } .gw-main .gw-home-tiles .stat-tile-value { grid-row: auto; text-align: left; } .gw-main .gw-home-tiles .stat-tile-note { grid-column: 1; } }
.class-tabs { gap: var(--sp-1); border-bottom: 1px solid var(--border); margin: 0 0 var(--sp-4); }
[data-cruxms] .btn.class-tab { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--text-muted); padding: 0 var(--sp-3); font-weight: 600; }
[data-cruxms] .btn.class-tab:hover { background: var(--surface-sunk); color: var(--ink); }
[data-cruxms] .btn.class-tab.active { background: none; color: var(--ink); border-bottom-color: var(--gw); }
.student-card, .rung-chip { border-color: var(--border); }
.status-pill { background: var(--surface-sunk); color: var(--text-faint); }
.status-pill.active { background: var(--success-pale); color: var(--success); }
.stat .n { color: var(--ink); }
.pill-select { background-color: var(--surface); border: 1px solid var(--border-2); color: var(--text); }
.gw-main table th { font-family: var(--font-body); font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text-faint); }

/* ---------- centred card pages (sign in, staff sign in, link not active) ---------- */
.gw-card-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-4); padding: var(--sp-6) var(--sp-4); }
.gw-card-wrap .card { width: 100%; max-width: 480px; padding: var(--sp-8); margin: 0; }
.gw-card-brand { display: flex; align-items: center; gap: var(--sp-3); font: 800 22px/1.2 var(--font-head); color: var(--ink); }
.gw-foot-card { margin: 0; padding: 0; }
.gw-card-wrap form { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-3); }
.gw-card-wrap label { font-weight: 600; font-size: 14px; }
[data-cruxms] .gw-card-wrap a.btn { text-decoration: none; }
.gw-card-wrap p.muted a { display: inline-block; padding: 12px 0; min-height: 44px; box-sizing: border-box; }

/* ---------- phone ---------- */
@media (max-width: 820px) {
  .gw-shell { grid-template-columns: minmax(0, 1fr); }
  .gw-top { padding: 0 var(--sp-3); gap: var(--sp-2); }
  .gw-main { grid-column: 1; padding: var(--sp-4) var(--sp-4) var(--sp-6); }
  .gw-product, .gw-chip-name { display: none; }
  .gw-menu-btn { display: inline-flex; }
  .gw-side { position: fixed; top: 0; bottom: 0; left: 0; height: auto; width: min(86vw, 300px); z-index: 60; transform: translateX(-102%); visibility: hidden; box-shadow: var(--shadow-3); overflow-y: auto; }
  .gw-side-inner { position: static; max-height: none; overflow: visible; padding-top: var(--sp-6); }
  .gw-open .gw-side { transform: none; visibility: visible; }
  .gw-open .gw-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: color-mix(in srgb, var(--ink) 40%, transparent); }
  .gw-shell[data-role="student"] .gw-side { display: none; }
  .gw-shell[data-role="student"] .gw-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: var(--sp-1) var(--sp-2) calc(var(--sp-1) + env(safe-area-inset-bottom, 0px)); }
  .gw-shell[data-role="student"] .gw-tabs .gw-item { flex: 1; min-width: 0; flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 4px; min-height: 56px; justify-content: center; text-align: center; }
  .gw-shell[data-role="student"] .gw-main { padding-bottom: 96px; }
  /* the floating calculator (mounted on <body>) sits above the student tab bar */
  body:has(.gw-shell[data-role="student"]) .calc-toggle { bottom: 80px; }
  body:has(.gw-shell[data-role="student"]) .calc-panel { bottom: 156px; }
  .gw-main .navbar { justify-content: space-between; }
  .gw-main .navbar-here { order: 3; flex: 1 1 100%; }
  .gw-main .navbar-topics { margin-left: 0; }
  .gw-next { padding: var(--sp-4); }
  .gw-next-title { font-size: 24px; }
  .gw-today-hi { font-size: var(--fs-h1); }
  .card > .problem-display { font-size: 1.4rem; }
  .card:has(> .problem-display) { padding: var(--sp-4); }
  .gw-kiwi-note { padding: var(--sp-4); }
  .gw-ph h1 { font-size: var(--fs-h1); }
}
@media (prefers-reduced-motion: reduce) {
  [data-cruxms] * { transition: none !important; animation: none !important; }
}

/* The (hidden) glossary tooltip is appended to <body> and positioned by script; with no top/left of its own it sat just below the
   whole shell and added a ~20px strip of page background under the white menu. Parked at the corner until it is placed. */
[data-cruxms] .glossary-popover { top: 0; left: 0; }

/* ---------- Maths and Science: two large subject buttons, the open one shows its strands underneath ----------
   Told apart by name, icon, count and layout, never by a new colour: indigo is only the page-header line and the open
   button's top rule. */
.gw-subjects { display: flex; flex-direction: column; gap: var(--sp-3); }
.gw-subject-h { margin: 0; font: inherit; }
.gw-subject-btn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ic name chev" "ic count chev"; column-gap: var(--sp-4); align-items: center; width: 100%; min-height: 72px; padding: var(--sp-3) var(--sp-5); text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); cursor: pointer; font-family: var(--font-body); }
.gw-subject-btn:hover { background: var(--surface-sunk); }
.gw-subject-btn[aria-expanded="true"] { border-top: 3px solid var(--gw); }
.gw-subject-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-subject-ic { grid-area: ic; display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--r-md); background: var(--surface-sunk); }
.gw-subject-ic .gw-ic { width: 26px; height: 26px; }
.gw-subject-name { grid-area: name; font: 800 1.25rem/1.2 var(--font-head); color: var(--ink); }
.gw-subject-count { grid-area: count; color: var(--text-faint); font-size: 0.9rem; }
.gw-subject-chev { grid-area: chev; width: 10px; height: 10px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform 0.15s ease; }
.gw-subject-btn[aria-expanded="true"] .gw-subject-chev { transform: rotate(-135deg); }
.gw-subject-panel { padding-top: var(--sp-3); }
.gw-subject-panel[hidden] { display: none; }
/* My progress: the goal card is its own labelled region ("About you"), set well clear of the subject buttons above it. */
.gw-about { margin-top: var(--sp-8); }
.gw-about-h { margin: 0 0 var(--sp-1); }
.gw-about-sub { margin: var(--sp-3) 0 var(--sp-2); font: 700 1rem/1.3 var(--font-body); color: var(--ink); }
.gw-waiting-h { display: flex; align-items: center; gap: var(--sp-3); }

/* ---------- collapsible strands (native details/summary) ---------- */
.gw-strand { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); margin: 0 0 var(--sp-3); }
.gw-strand > summary { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: var(--sp-2) var(--sp-4); cursor: pointer; list-style: none; border-radius: var(--r-lg); }
.gw-strand > summary::-webkit-details-marker { display: none; }
.gw-strand > summary::before { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(-45deg); transition: transform 0.15s ease; }
.gw-strand[open] > summary::before { transform: rotate(45deg); }
.gw-strand > summary:hover { background: var(--surface-sunk); }
.gw-strand > summary h3 { margin: 0; font: 600 1rem/1.3 var(--font-body); color: var(--text); }
.gw-strand > summary h3 b { font-weight: 700; color: var(--ink); }
.gw-strand > summary .gw-strand-count { color: var(--text-faint); }
.gw-strand-body { padding: 0 var(--sp-4) var(--sp-4); }
.gw-strand-body > .topic-list, .gw-strand-body > .ladder { margin-top: 0; }
.gw-strand .ladder-group-header { display: none; }

/* ---------- Settings (school admin) ---------- */
.gw-setting { display: flex; align-items: flex-start; gap: var(--sp-4); justify-content: space-between; flex-wrap: wrap; }
.gw-setting-text { flex: 1 1 280px; min-width: 0; }
.gw-setting-text h2 { margin: 0 0 var(--sp-1); font-size: 1.1rem; }
.gw-setting-text p { margin: 0 0 var(--sp-2); }
.gw-switch { display: inline-flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: 0 var(--sp-2); background: none; border: 0; cursor: pointer; font: 600 15px/1.2 var(--font-body); color: var(--text); border-radius: var(--r-md); }
.gw-switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-switch-track { position: relative; flex: none; width: 48px; height: 28px; border-radius: var(--r-full); background: var(--surface-sunk); border: 2px solid var(--text-muted); }
.gw-switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-muted); transition: transform 0.15s ease; }
.gw-switch[aria-checked="true"] .gw-switch-track { background: var(--primary); border-color: var(--primary); }
.gw-switch[aria-checked="true"] .gw-switch-track::after { background: var(--surface); transform: translateX(20px); }
.gw-switch:disabled { cursor: progress; }
.gw-readonly { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); margin: 0; }
.gw-readonly dt { color: var(--text-faint); }
.gw-readonly dd { margin: 0; font-weight: 600; }

/* ---------- lesson: the kiwi points at the next step ---------- */
.gw-lesson-point { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); margin: var(--sp-2) 0 0; color: var(--text-muted); }

/* the kiwi's face on the hint button: the button's own words stay, the picture is only its look */
.teacher-toggle .gw-kiwi-inline { margin-right: var(--sp-2); }
.gw-thinking-row { display: flex; align-items: center; gap: var(--sp-3); }
.gw-thinking-row p { margin: 0; }
.gw-busy { display: inline-flex; align-items: center; gap: var(--sp-2); }

/* An element with the hidden attribute stays hidden even where a component rule gives it a display. */
[data-cruxms] [hidden] { display: none !important; }
/* no menu at all while a learner is in the first-use setup (the bottom tab bar too) */
.gw-shell.gw-nomenu[data-role] .gw-tabs { display: none; }
.gw-shell.gw-nomenu[data-role="student"] .gw-main { padding-bottom: var(--sp-6); }

/* ---------- stage 5: Set work, Progress, Help (teacher) and Set by your teacher (student) ---------- */
.class-tab-actions { flex-wrap: wrap; }
.gw-shell a.btn { text-decoration: none; }
.gw-split h2, .gw-split h3 { margin: 0; }
.gw-main h3 { margin: var(--sp-4) 0 var(--sp-2); font: 700 1rem/1.3 var(--font-body); color: var(--ink); }
.gw-status { margin: 0 0 var(--sp-3); min-height: 1.5em; font-size: 14px; }
.gw-status:focus { outline: none; }
.card > .gw-status:empty { min-height: 0; margin: 0; } /* a status line inside a card takes no room until it has words (Home: Asked for help) */
.gw-form-msg { margin: 0 0 var(--sp-3); color: var(--danger); font-weight: 600; font-size: 14px; }
.gw-form-msg:empty { display: none; }
.gw-form-msg:focus { outline: none; }
.gw-field { display: flex; flex-direction: column; gap: var(--sp-1); margin: 0 0 var(--sp-4); }
.gw-field label, .gw-fieldset legend { font-weight: 600; font-size: 14px; color: var(--ink); }
.gw-field select, .gw-field input[type="date"], .gw-field textarea { border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; min-height: 44px; padding: 0 var(--sp-3); max-width: 320px; }
.gw-field textarea { padding: var(--sp-2) var(--sp-3); max-width: 560px; width: 100%; resize: vertical; }
.gw-field select:focus-visible, .gw-field input:focus-visible, .gw-field textarea:focus-visible, .gw-pick input:focus-visible, .gw-pick summary:focus-visible, .gw-more summary:focus-visible, .gw-check-inline input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-fieldset { border: 0; padding: 0; margin: 0 0 var(--sp-3); min-width: 0; }
.gw-fieldset legend { padding: 0; margin-bottom: var(--sp-2); }
.gw-pick { border: 1px solid var(--border); border-radius: var(--r-md); margin: 0 0 var(--sp-2); background: var(--surface); }
.gw-pick > summary, .gw-more > summary { display: flex; align-items: center; gap: var(--sp-1); min-height: 44px; padding: 0 var(--sp-3); cursor: pointer; border-radius: var(--r-md); }
.gw-more > summary { font-weight: 600; color: var(--primary-d); padding-left: 0; }
.gw-pick > summary:hover { background: var(--surface-sunk); }
.gw-pick-list { list-style: none; margin: 0; padding: 0 var(--sp-3) var(--sp-2); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 0 var(--sp-4); }
.gw-pick-list label { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; cursor: pointer; }
.gw-pick-list input[type="checkbox"], .gw-check-inline input { width: 24px; height: 24px; flex: none; accent-color: var(--primary); }
/* Sets "Give it to" (stage 9): one choice per row, a 44px target, the class menu indented under "One class". */
.gw-radio { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-3); }
.gw-radio input[type="radio"] { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--primary); }
.gw-radio label { cursor: pointer; }
.gw-radio-sub { padding: 0 var(--sp-3) var(--sp-2) calc(var(--sp-3) + 20px + var(--sp-2)); }
.gw-check-inline { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; font-size: 14px; cursor: pointer; }
.gw-assign-note { margin: var(--sp-2) 0; color: var(--text); }
.gw-more { margin-top: var(--sp-3); }
.gw-main table th.num { text-align: right; }

/* student: Set by your teacher on Today. Rows reuse the topic-list rows, so targets are already 44px or more. */
.gw-setwork-class { margin: var(--sp-4) 0 var(--sp-1); font: 700 1rem/1.3 var(--font-body); color: var(--ink); }
.gw-setwork-class:first-of-type { margin-top: 0; }
.gw-setwork-due { margin: 0 0 var(--sp-2); }
.gw-setwork .topic-list { margin-top: var(--sp-2); }
.gw-ask { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; margin-top: var(--sp-3); }
.gw-ask-note { margin: 0; }
.gw-ask-msg { margin: 0; }
.gw-ask-msg:focus { outline: none; }
.gw-ask-msg .gw-kiwi-note { margin: var(--sp-2) 0 0; }
.gw-ask-err { color: var(--text); font-weight: 600; }
[data-cruxms] table.dtable th.gw-rowhead { font-family: var(--font-body); font-size: inherit; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600; padding: var(--row-pad, 11px) 14px; border-bottom: 1px solid var(--border); }
.gw-main a:not([class]) { color: var(--primary-d); }

/* ---------- stage 6a: Import a class list (teacher, school admin) ---------- */
.gw-import-scroll { overflow-x: auto; margin: 0 0 var(--sp-3); }
.gw-tw:focus-visible, .gw-import-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-import-example { width: auto; min-width: 100%; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.gw-import-example caption { text-align: left; font-size: 13px; color: var(--text-muted); padding: 0 0 var(--sp-1); caption-side: top; }
.gw-import-example th, .gw-import-example td { white-space: nowrap; }
.gw-import-example thead th { background: var(--surface-sunk); }
.gw-import-dl { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; margin: 0 0 var(--sp-3); }
.gw-import-notes, .gw-import-summary { margin: 0 0 var(--sp-3); padding-left: var(--sp-6); }
.gw-import-notes li, .gw-import-summary li { margin-bottom: var(--sp-2); line-height: 1.5; }
.gw-import-attn { list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.gw-import-attn li { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: baseline; padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); background: var(--warning-pale); border-radius: var(--r-md); color: var(--text); }
.gw-import-reason { flex-basis: 100%; }
.gw-field input[type="file"] { font: inherit; min-height: 44px; padding: var(--sp-2) 0; max-width: 100%; }
.gw-field input[type="file"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-import-warn { list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.gw-import-warn li { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: baseline; padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); background: var(--surface-sunk); border-left: 4px solid var(--warning); border-radius: var(--r-md); color: var(--text); }

/* ---- Guides: How it works (students), How to (staff), About Groundwork (public). Tokens only. ---- */
.gw-guide { display: flex; flex-direction: column; gap: var(--sp-4); }
.gw-guide-sec h2 { margin-top: 0; }
.gw-guide-sec h3 { margin: var(--sp-4) 0 var(--sp-1); font-size: 1rem; }
.gw-guide-sec h3:first-of-type { margin-top: 0; }
.gw-guide-sec p, .gw-guide-sec li { max-width: 65ch; line-height: 1.6; }
.gw-guide-sec ul, .gw-guide-sec ol { padding-left: var(--sp-6); margin: var(--sp-2) 0; }
.gw-guide-sec li + li { margin-top: var(--sp-1); }
.gw-guide-note { background: var(--surface-sunk); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); color: var(--text); }
.gw-aboutpage { margin: 0; background: var(--bg); }
.gw-aboutpage-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-6); background: var(--surface); border-bottom: 1px solid var(--border); }
.gw-aboutpage-brand { display: flex; align-items: center; gap: var(--sp-2); }
.gw-aboutpage-main { max-width: 860px; margin: 0 auto; padding: var(--sp-8) var(--sp-4); }
.gw-aboutpage-main .gw-ph p { font-size: 1.125rem; color: var(--text); max-width: 60ch; }
.gw-aboutpage .gw-foot { text-align: center; padding: var(--sp-6) var(--sp-4); }
.gw-aboutpage figure { margin: var(--sp-4) 0 0; }
.gw-aboutpage figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.gw-aboutpage figcaption { margin-top: var(--sp-2); color: var(--text-muted); font-size: 0.875rem; }
.gw-whatsnew-cta { margin: var(--sp-6) 0 0; }
.gw-whatsnew-cta .btn { min-height: 44px; }
@media (max-width: 640px) { .gw-aboutpage-top { padding: var(--sp-2) var(--sp-4); } .gw-aboutpage-main { padding: var(--sp-6) var(--sp-4); } }

/* ---------- classes redesign (2026-10-18): class and student header, tabs, dialogs, row menu, toasts, People ---------- */
.gw-head-row { align-items: flex-start; margin-bottom: var(--sp-4); } /* space below the header when its actions wrap under the title on a phone */
.gw-head-row > .gw-ph { flex: 1 1 240px; }
/* the way back above a class's or student's title: quiet text, links in the action colour, each link still a 44px tap target */
.gw-crumbs { font-size: 13px; color: var(--text-muted); margin-bottom: var(--sp-1); }
.gw-crumbs a { color: var(--primary-d); text-decoration: underline; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--sp-1); }
.gw-crumbs a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.gw-ph h1 .badge { margin-left: var(--sp-2); }
.gw-tabbar { margin: 0 0 var(--sp-4); padding: 0; overflow-x: auto; }
.gw-tabbar .page-tab { min-height: 44px; padding: 0 var(--sp-1); font-size: 15px; white-space: nowrap; }
.gw-tabbar .page-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--r-sm); }
.gw-pane:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-pane > h2:first-child { margin-top: 0; }
.gw-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; justify-content: space-between; margin: 0 0 var(--sp-3); }
.gw-toolbar .gw-field { margin: 0; flex: 1 1 240px; max-width: 360px; }
.gw-tablecard { padding: 0; }
.gw-main table.dtable td.gw-actions { text-align: right; width: 1%; white-space: nowrap; }
.gw-actions-row .row-actions { display: flex; gap: var(--sp-2); flex-wrap: nowrap; }
@media (max-width: 820px) { .gw-actions-row .row-actions { flex-wrap: wrap; } }
/* the add-a-person form under a school's staff list (platform Schools) */
.gw-addform { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end; margin-top: var(--sp-4); }
.gw-addform .gw-field { margin: 0; max-width: 100%; min-width: 0; }
.gw-addform .gw-field input, .gw-addform .gw-field select { max-width: 100%; box-sizing: border-box; }
.gw-main table.dtable tr.gw-off th, .gw-main table.dtable tr.gw-off td { color: var(--text-muted); }
.gw-namecell { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.gw-main table.dtable a:not([class]) { font-weight: 600; }
.gw-empty { text-align: center; }
.gw-empty .btn-row { justify-content: center; }
.gw-focus { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-3); background: var(--surface); }
.gw-focus p { margin: 0 0 var(--sp-1); }
.gw-example { padding-top: var(--sp-2); }
.gw-example p { margin: 0 0 var(--sp-2); }
.gw-example-q { font-weight: 600; font-size: 1.05rem; }
.gw-example ol { margin: 0 0 var(--sp-2); padding-left: var(--sp-6); color: var(--text-muted); }

/* dialogs (CRUXMS .modal-scrim and .modal, with a taller limit, a body, and an action row) */
.gw-modal-scrim { padding: var(--sp-4); overflow-y: auto; }
.gw-modal { max-width: 520px; max-height: calc(100vh - var(--sp-8)); overflow-y: auto; }
.gw-modal .modal-title { margin: 0 0 var(--sp-3); font-size: 1.25rem; }
.gw-modal-body > * + * { margin-top: var(--sp-3); }
.gw-modal-body p { margin: 0; }
.gw-modal-note { margin: var(--sp-2) 0 0; }
.gw-modal-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-4); }
.gw-modal-section + .gw-modal-section { border-top: 1px solid var(--border); margin-top: var(--sp-4); padding-top: var(--sp-4); }
.gw-modal-section h3 { margin-top: 0; }
.gw-link-input { width: 100%; font-family: var(--font-mono); font-size: 14px; }
.gw-classlink { margin: 0 0 var(--sp-4); }
.gw-classlink .btn-row { margin-bottom: var(--sp-2); }
.gw-classlink .gw-link-input { margin: var(--sp-2) 0; }
/* Headings that sit at the right level for a screen reader (no skipped level: h1 > h2 > h3) and keep the look they had at the old level. */
[data-cruxms] .gw-subhead { margin: var(--sp-4) 0 var(--sp-2); font: 700 1rem/1.3 var(--font-body); color: var(--ink); }
[data-cruxms] .gw-empty .gw-empty-title { margin: 1.33em 0 6px; font-family: var(--font-head); font-size: .95rem; font-weight: 700; line-height: 1.6; color: var(--ink); letter-spacing: normal; }
[data-cruxms] .gw-bigbtn.btn { min-height: 56px; font-size: 1.1rem; width: 100%; max-width: 360px; }
.gw-modal .gw-form-msg { margin: var(--sp-2) 0 0; }

/* the "More" menu on a row (fixed, so a scrolling table cannot clip it) */
.gw-menu { position: fixed; z-index: 110; min-width: 220px; max-width: min(92vw, 320px); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: var(--sp-1); display: grid; }
.gw-menu-item { display: block; width: 100%; text-align: left; min-height: 44px; padding: 0 var(--sp-3); background: none; border: 0; border-radius: var(--r-sm); font: 500 15px/1.3 var(--font-body); color: var(--text); cursor: pointer; }
.gw-menu-item:hover, .gw-menu-item:focus-visible { background: var(--surface-sunk); }
.gw-menu-item:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.gw-menu-item.danger { color: var(--danger); }

.gw-copy-wrap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.gw-copied { font-size: 15px; color: var(--text-muted); }
.gw-toasts { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 120; display: grid; gap: var(--sp-2); max-width: min(92vw, 340px); }
.gw-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
@media (max-width: 820px) {
  .gw-toasts { left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); max-width: none; }
  .gw-main table.dtable td.gw-actions { white-space: normal; }
}
.gw-tabbar .tab-count { color: var(--ink); }
/* screen-reader-only text inside a scrolling table (the Actions column heading) must be positioned against the table's own scroll box, or it sticks out of the page */
.gw-tw { position: relative; }
@media (max-width: 820px) {
  /* a table with a stack class (the school admin's Staff list) becomes one block per row: name, email, role, status, and the More button beside them, so nothing is off screen */
  .gw-main table.dtable.gw-stack, .gw-main table.dtable.gw-stack tbody { display: block; width: 100%; }
  .gw-main table.dtable.gw-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .gw-main table.dtable.gw-stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-1) var(--sp-3); align-items: center; padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
  .gw-main table.dtable.gw-stack th, .gw-main table.dtable.gw-stack td { display: block; padding: 0; border: 0; grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
  .gw-main table.dtable.gw-stack td.gw-actions, .gw-main table.dtable.gw-stack td.gw-stack-end { grid-column: 2; grid-row: 1 / span 4; width: auto; align-self: center; }
  .gw-main table.dtable.gw-stack td.gw-actions.gw-actions-row { grid-column: 1; grid-row: auto; margin-top: var(--sp-1); text-align: left; } /* the Switch off and Remove buttons sit on one row under the person's details (platform Schools) */
}
@media (max-width: 820px) {
  /* the More button stays in view while the rest of a wide table scrolls */
  .gw-tablecard table.dtable th:last-child, .gw-tablecard table.dtable td:last-child { position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 8px -8px var(--border-2); }
  .gw-tablecard table.dtable.gw-stack th:last-child, .gw-tablecard table.dtable.gw-stack td:last-child { position: static; background: none; box-shadow: none; } /* a stacked table does not scroll, so its last cell needs no sticky edge */
}
.gw-modal .btn { min-height: 44px; }

/* Count tables on a Set work card (Topic / Not started / Practising / Locked in): the headers wrap and the number columns are narrow, so all four columns fit a 390 px phone without sideways scroll. */
.gw-main table.dtable.gw-counts th, .gw-main table.dtable.gw-counts td { padding: var(--sp-2) var(--sp-2); }
.gw-main table.dtable.gw-counts thead th { white-space: normal; font-size: 13px; line-height: 1.25; vertical-align: bottom; }
.gw-main table.dtable.gw-counts tbody th { white-space: normal; overflow-wrap: anywhere; }
.gw-main table.dtable.gw-counts .num { width: 4.25rem; text-align: right; }
/* The one quiet line on Home when only the optional third step is left. */
.gw-next-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); }
.gw-next-line p { margin: 0; }
/* Plain links inside tables and the Help steps are 44 px tall to tap; the look of the rows does not change. */
.gw-main table.dtable a:not(.btn), .gw-guide-sec li a { display: inline-flex; align-items: center; min-height: 44px; }

/* Next test (Today card, next-test coaching) */
.gw-nexttest h2 { margin: 0 0 var(--sp-1); }
.gw-nexttest h2:focus { outline: none; }
.gw-nexttest-pace { margin: 0 0 var(--sp-2); font-weight: 600; color: var(--ink); }
.gw-nexttest-note { margin: 0 0 var(--sp-2); white-space: pre-line; }
.gw-nexttest .topic-list { margin: var(--sp-2) 0 var(--sp-3); }
.gw-nexttest .topic-row-main.gw-test-next { border-color: var(--primary); }
.gw-nexttest-others { list-style: none; margin: var(--sp-2) 0 var(--sp-3); padding: 0; display: grid; gap: var(--sp-2); }
.gw-nexttest-others li { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; }
.gw-nexttest-sure { margin: var(--sp-2) 0 0; }
.gw-nexttest-sure p { margin: 0 0 var(--sp-2); font-weight: 600; }

/* ===== Teacher brief card and Overview grid (stage 2 of the teacher brief). Tokens only: nothing here is a new colour. ===== */
/* Class dials (Mark, 6 Nov): one row of four above the brief, two by two on a phone. One accent (--sc), no red or green, no target marks. */
/* Class dials (class page redesign, 15 Nov 2026): about half the old height, the gauge beside the words. A dial with nothing to show is one plain sentence (.dial-none). */
.dials { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
.dials > li { min-width: 0; display: flex; }
.dial { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); transition: background .15s, border-color .15s; font-family: var(--font-body); }
.dial.dial-none { grid-template-columns: minmax(0, 1fr); }
.dial:hover { background: var(--sc-pale); border-color: var(--sc); --text-muted: var(--text-faint); } /* muted text is 4.12:1 on the pale hover fill; faint is 4.51:1 */
.dial:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--sc); }
.dl-gw { position: relative; display: block; width: 76px; }
.dl-g { display: block; width: 76px; height: 42px; }
.dl-track, .dl-fill { fill: none; stroke-width: 10; stroke-linecap: round; }
.dl-track { stroke: var(--surface-sunk); }
.dl-fill { stroke: var(--sc); }
.dl-val { position: absolute; left: 0; right: 0; bottom: -4px; text-align: center; font: 800 19px/1 var(--font-head, var(--font-body)); color: var(--ink); }
.dl-unit { font: 600 11px var(--font-body); color: var(--text-muted); }
.dl-val-sm { display: none; font: 800 20px/1.1 var(--font-head, var(--font-body)); color: var(--ink); }
.dl-val-sm .dl-unit { font-size: 13px; }
.dl-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dl-label { font: 700 15px/1.25 var(--font-body); color: var(--ink); }
.dl-sub { font-size: 13px; line-height: 1.35; color: var(--text-muted); }
.dl-link { font-size: 13px; font-weight: 600; color: var(--primary-d, var(--primary)); text-decoration: underline; }
.dl-chg { display: inline-flex; align-items: flex-start; text-align: left; gap: 4px; font-size: 13px; line-height: 1.35; color: var(--text-muted); }
.dl-ar { margin-top: 3px; width: 12px; height: 12px; fill: none; stroke: var(--sc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (max-width: 1180px) { .dials { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .dials { gap: var(--sp-2); } .dial { grid-template-columns: minmax(0, 1fr); padding: var(--sp-3); } .dl-gw { display: none; } .dl-val-sm { display: block; } }
/* Student dials on Today (Mark, 7 Nov): three tiles in one row at every width, one number each. No gauge (a gauge is a whole to fill, which reads as a target). One accent (--sc) on the arrow
   only; a drop is drawn exactly like a rise, never red. A tile with nothing to do is a plain box (.is-static), not a button. Tokens only. */
.sdials { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.sdials > li { min-width: 0; display: flex; }
.sdial { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: var(--sp-4); min-height: 44px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); font-family: var(--font-body); }
button.sdial { cursor: pointer; transition: background .15s, border-color .15s; }
button.sdial:hover { background: var(--sc-pale, var(--primary-pale)); border-color: var(--sc, var(--primary)); }
button.sdial:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sd-label { order: -1; font: 600 14px/1.3 var(--font-body); color: var(--text-muted); }
.sd-val { font: 800 2rem/1.1 var(--font-head, var(--font-body)); color: var(--ink); margin-top: 2px; }
.sd-val small { font: 600 1rem var(--font-body); color: var(--text-muted); }
.sd-empty { font: 700 1.15rem/1.25 var(--font-head, var(--font-body)); color: var(--ink); margin: 4px 0 2px; }
.sd-sub { font-size: 13px; color: var(--text-muted); }
.sd-chg { display: inline-flex; align-items: flex-start; gap: 4px; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.sd-chg svg { margin-top: 3px; width: 12px; height: 12px; fill: none; stroke: var(--sc, var(--primary)); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sd-go { margin-top: auto; padding-top: var(--sp-2); font: 600 14px/1.3 var(--font-body); color: var(--primary-d, var(--primary)); }
.sd-go::after { content: " \203A"; }
.sdial.is-static .sd-sub { margin-top: var(--sp-1); }
.sd-next { margin: 0 0 var(--sp-5); font-size: 1.05rem; line-height: 1.45; color: var(--ink); }
@media (max-width: 820px) {
  .sdials { gap: var(--sp-2); }
  .sdial { padding: var(--sp-3) 10px; }
  .sd-label { font-size: 12.5px; }
  .sd-val { font-size: 1.6rem; }
  .sd-val small { font-size: .85rem; }
  .sd-empty { font-size: 1rem; }
  .sd-sub, .sd-chg, .sd-go { font-size: 12px; }
  .sd-next { font-size: 1rem; margin-bottom: var(--sp-4); }
}
.bf { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); margin: 0 0 var(--sp-4); overflow: hidden; }
.bf-head { padding: var(--sp-4) var(--sp-5) var(--sp-3); border-bottom: 1px solid var(--border); background: var(--sc-pale); }
.bf-head h2 { margin: 0; font-size: 1.15rem; color: var(--ink); }
.bf-head p { margin: 2px 0 0; font-size: 14px; color: var(--text-faint); } /* 4.5:1 on the pale indigo band (--text-muted is 4.1:1 there) */
.bf-list { list-style: none; margin: 0; padding: 0; }
.bf-row { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-4); align-items: center; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); }
.bf-row:first-child { border-top: 0; }
.bf-label { font: 600 13px/1.3 var(--font-body); color: var(--sc); }
.bf-text { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--text); }
.bf-text b { font-weight: 600; color: var(--ink); }
.bf-text .bf-sub { display: block; font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.bf-row .btn { white-space: nowrap; min-height: 44px; padding: 8px var(--sp-5); font-size: .95rem; }
.bf-quiet { padding: var(--sp-3) var(--sp-5); margin: 0; }
.bf-row.bf-quiet { grid-template-columns: minmax(0, 1fr); }
.ov-head { margin: var(--sp-2) 0 var(--sp-3); }
.ov-head h2 { margin: 0 0 4px; font-size: 1.15rem; }
.ov-head p { margin: 0; font-size: 14px; color: var(--text-muted); }
.ov-legend { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
/* Test readiness (11 Nov 2026): one open-and-close box per upcoming test, above the whole-class grid */
.ov-tests { margin: 0 0 var(--sp-4); }
.ov-test { margin: 0 0 var(--sp-3); }
.ov-test > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); min-height: 44px; }
.ov-test .ov-name .gw-pill { margin-left: var(--sp-2); }
.ov-test .ov-table { width: auto; min-width: 0; }
.ov-legend li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px var(--sp-2); font-size: 14px; line-height: 1.35; align-items: start; }
.ov-legend .st-ic { margin-top: 1px; }
.ov-legend b { font-weight: 600; color: var(--ink); display: block; }
.ov-legend span.d { color: var(--text-muted); font-size: 13px; }
.st-ic { width: 20px; height: 20px; display: block; flex: none; }
.ov .lk { color: var(--success); } .ov .pr { color: var(--primary); } .ov .st { color: var(--danger); } .ov .ns { color: var(--neutral-text); }
.ov-hint { display: none; font-size: 13px; color: var(--text-muted); margin: 0 0 var(--sp-2); }
.ov-box { overflow: auto; max-width: 100%; max-height: 80vh; border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); -webkit-overflow-scrolling: touch; }
.ov-box:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
table.ov-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 14px; }
.ov-table th, .ov-table td { padding: 0; border-bottom: 1px solid var(--border); text-align: center; }
.ov-table thead th { background: var(--surface); position: sticky; top: 0; z-index: 2; }
.ov-table thead tr:nth-child(2) th { top: 34px; }
.ov-table th.ov-corner { text-align: left; padding: 8px 12px; vertical-align: bottom; left: 0; z-index: 4; min-width: 104px; font: 600 13px var(--font-body); color: var(--text-faint); border-right: 1px solid var(--border-2); }
.ov-table th.ov-strand { padding: 8px 6px 6px; font: 700 13px/1.3 var(--font-body); color: var(--ink); border-bottom: 1px solid var(--border-2); background: var(--surface-sunk); border-left: 1px solid var(--border-2); height: 34px; box-sizing: border-box; }
.ov-tag { display: block; font-weight: 500; font-size: 12px; color: var(--sc); }
.ov-table th.ov-topic { padding: 8px 6px; font: 600 12.5px/1.25 var(--font-body); color: var(--text); vertical-align: bottom; width: 96px; min-width: 96px; max-width: 96px; white-space: normal; overflow-wrap: break-word; hyphens: auto; }
.ov-first { border-left: 1px solid var(--border-2); }
.ov-table th.ov-name { text-align: left; padding: 0 12px; height: 40px; font: 600 14px var(--font-body); color: var(--text); background: var(--surface); position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--border-2); white-space: nowrap; }
.ov-name a { color: var(--primary-d); text-decoration: none; display: inline-flex; align-items: center; min-height: 40px; }
.ov-name a:hover { text-decoration: underline; }
.ov-cell { height: 40px; }
.ov-cell .st-ic { margin: 0 auto; }
.ov-cell.st { background: var(--danger-pale); }
.ov-cell.lk { background: color-mix(in srgb, var(--success-pale) 55%, white); }
.ov-table tbody tr:hover th.ov-name, .ov-table tbody tr:hover td { background-color: var(--surface-sunk); }
.ov-table tfoot th, .ov-table tfoot td { background: var(--surface-sunk); height: 40px; border-bottom: 0; border-top: 1px solid var(--border-2); }
.ov-table tfoot th.ov-name { background: var(--surface-sunk); }
.ov-sum { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; padding: 0 6px; }
.ov-sum b { font-family: var(--font-mono); color: var(--ink); font-weight: 600; font-size: 14px; }
/* Levels view (Kristin calibration step 7): the level is always said in words; the tint is a second cue, one hue stepping darker with each band */
.lv-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); font-size: 14px; }
.lv-legend li { display: inline-flex; align-items: center; gap: var(--sp-2); }
.lv-key { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border-2); flex: none; }
.lv-b0 { background: color-mix(in srgb, var(--primary) 8%, white); }
.lv-b1 { background: color-mix(in srgb, var(--primary) 18%, white); }
.lv-b2 { background: color-mix(in srgb, var(--primary) 30%, white); }
.lv-b3 { background: color-mix(in srgb, var(--primary) 44%, white); }
.ov-table th.lv-head { width: 112px; min-width: 112px; max-width: 112px; }
.lv-up { color: var(--text-muted); }
td.lv-cell { height: 52px; min-width: 112px; padding: 4px 6px; text-align: center; vertical-align: middle; }
td.lv-cell.lv-none { background: transparent; color: var(--text-muted); }
.lv-band { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.25; color: var(--ink); }
.lv-none .lv-band { font-weight: 500; color: var(--text-muted); }
.lv-sub { display: block; font-size: 12px; line-height: 1.25; color: var(--text-muted); }
.tab-note { margin: var(--sp-3) 0 0; font-size: 13px; color: var(--text-muted); }
@media (max-width: 820px) {
  .bf-head { padding: var(--sp-3) var(--sp-4); }
  .bf-row { grid-template-columns: minmax(0, 1fr); padding: var(--sp-3) var(--sp-4); gap: 4px; }
  .bf-row .btn { width: 100%; margin-top: var(--sp-2); white-space: normal; text-align: center; justify-content: center; }
  .bf-quiet { padding: var(--sp-3) var(--sp-4); }
  .ov-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-hint { display: block; }
  .ov-box { max-height: 75vh; }
}
@media (max-width: 480px) { .ov-legend { grid-template-columns: minmax(0, 1fr); } }
.ov, .gw-pane { min-width: 0; max-width: 100%; }
.ov-box { position: relative; }
@media (max-width: 480px) { .gw-tabbar .page-tab { margin-right: var(--sp-3); font-size: 14px; } .gw-tabbar .tab-count { display: none; } }
.ov-table th.ov-strand { text-align: left; }
.ov-strand-name { position: sticky; left: 120px; display: inline-block; padding: 0 var(--sp-3); }

/* ---- Class page (redesign, 15 Nov 2026; mock-up mockups/class-page-2026-11-15). Tokens only. ---- */
.gw-cp-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-5); }
.gw-cp-tab { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 64px; min-width: 0; padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); font-family: var(--font-body); }
.gw-cp-tab:hover { border-color: var(--border-2); }
.gw-cp-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gw-cp-tab[aria-selected="true"] { border-color: var(--ink); box-shadow: inset 0 -4px 0 var(--sc), var(--shadow-1); }
.gw-cp-tab-name { font: 700 17px/1.25 var(--font-body); color: var(--ink); display: flex; align-items: center; gap: var(--sp-2); }
.gw-cp-tab-say { font-size: 14px; line-height: 1.35; color: var(--text-muted); min-height: 1.35em; overflow-wrap: anywhere; }
.gw-cp-tab-say.warn { color: var(--warning); font-weight: 600; }
.gw-cp-tab-say.live { color: var(--success); font-weight: 600; }
.gw-cp-dot { display: none; width: 10px; height: 10px; border-radius: 50%; background: var(--success); flex: none; }
.gw-cp-tab.is-live .gw-cp-dot { display: inline-block; }
.gw-cp-sec { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin: var(--sp-5) 0 var(--sp-2); }
.gw-cp-sec h2 { margin: 0; font-size: 1.25rem; color: var(--ink); }
.gw-cp-tools { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin: 0 0 var(--sp-3); }
.gw-cp-sp { flex: 1 1 auto; }
.gw-cp-seg { display: inline-flex; max-width: 100%; border: 1px solid var(--border-2); border-radius: var(--r-full); overflow: hidden; background: var(--surface); }
.gw-cp-seg button { all: unset; box-sizing: border-box; cursor: pointer; min-height: 44px; padding: 0 var(--sp-4); font: 600 14px/1 var(--font-body); color: var(--ink); display: inline-flex; align-items: center; }
.gw-cp-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.gw-cp-seg button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
@media (max-width: 520px) {
  .gw-cp-seg { display: flex; max-width: 100%; }
  .gw-cp-seg button { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; justify-content: center; text-align: center; padding: 6px var(--sp-3); line-height: 1.2; }
}
.gw-cp-note { margin: 0 0 var(--sp-3); font-size: 14px; color: var(--text-muted); display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.gw-cp-link { all: unset; cursor: pointer; color: var(--primary-d, var(--primary)); font-weight: 600; text-decoration: underline; min-height: 44px; display: inline-flex; align-items: center; }
.gw-cp-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.gw-cp-state { display: flex; align-items: flex-start; gap: var(--sp-2); }
.gw-cp-state .st-ic { margin-top: 2px; }
.gw-cp-state b { font-weight: 600; color: var(--ink); }
.gw-cp-state small { display: block; font-size: 13px; color: var(--text-muted); }
.gw-cp-state.lk { color: var(--success); } .gw-cp-state.pr { color: var(--primary); } .gw-cp-state.st { color: var(--danger); } .gw-cp-state.ns { color: var(--neutral-text); } .gw-cp-state.hp { color: var(--warning); }
.gw-cp-days { display: inline-flex; align-items: center; gap: var(--sp-2); white-space: nowrap; }
.gw-cp-days i { display: inline-flex; gap: 2px; }
.gw-cp-days i span { width: 8px; height: 14px; border-radius: 2px; background: var(--surface-sunk); border: 1px solid var(--border); }
.gw-cp-days i span.on { background: var(--sc); border-color: var(--sc); }
.gw-cp-ph { display: none; }
/* "How <child> is doing" week rows (plan PLAN-HOW-THEY-ARE-DOING-2026-11-22): one row per week on the parent page, My progress and the teacher's brief. Drawn by weeks.js. */
.gw-weeks { list-style: none; margin: var(--sp-2) 0 0; padding: 0; }
.gw-weeks li { display: grid; grid-template-columns: 5.5rem auto 7.5rem minmax(0, 1fr); align-items: center; gap: var(--sp-1) var(--sp-3); padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--ink); }
.gw-weeks li:first-child { border-top: 0; }
.gw-weeks .wk { color: var(--text-faint); font-weight: 600; }
.gw-weeks .rt { display: flex; align-items: center; gap: 2px var(--sp-2); min-width: 0; white-space: nowrap; }
.gw-weeks .rt .gw-bar { flex: 0 0 72px; }
.gw-weeks .rt .gw-bar > i { background: var(--sc, var(--primary)); }
.gw-weeks .few { color: var(--text-faint); white-space: normal; }
.bf-lessons { margin: var(--sp-1) 0 0; font-size: 14px; color: var(--ink); }
.gw-stu-weeks h2 { margin-bottom: var(--sp-1); }
.gw-weeks-key { margin: var(--sp-2) 0 0; font-size: 13px; color: var(--text-faint); }
@media (max-width: 560px) {
  .gw-weeks li { grid-template-columns: 4.5rem auto minmax(0, 1fr); gap: var(--sp-1) var(--sp-2); }
  .gw-weeks .wk { white-space: nowrap; }
  .gw-weeks li > :nth-child(2) { grid-column: 2 / 4; }
  .gw-weeks .q { grid-column: 2; }
  .gw-weeks .rt { grid-column: 3; }
  .gw-weeks .rt .gw-bar { flex: 0 0 44px; }
}
@media (max-width: 359px) {
  .gw-weeks li { grid-template-columns: minmax(0, 1fr); }
  .gw-weeks li > * { grid-column: 1; }
  .gw-weeks .rt, .gw-weeks .gw-cp-days { flex-wrap: wrap; white-space: normal; }
}
.ov-intro { margin: 0 0 var(--sp-3); font-size: 14px; color: var(--text-muted); }
.gw-cp-two { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-5); align-items: start; }
.gw-cp-two > * { min-width: 0; }
.gw-cp-two .gw-quiz { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: var(--sp-5); }
.gw-cp-two .gw-quiz > h2 { margin: 0 0 var(--sp-2); font-size: 1.25rem; }
.gw-cp-two .gw-quiz .card { box-shadow: none; }
.gw-cp-two .gw-quiz-start { border: 0; padding: 0; margin: 0 0 var(--sp-4); }
.gw-cp-two .gw-quiz-start h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gw-quiz-pick { display: grid; gap: var(--sp-1); margin-top: var(--sp-3); }
.gw-quiz-pick label { font: 600 14px/1.3 var(--font-body); margin-top: var(--sp-2); }
.gw-quiz-pick select { min-height: 44px; }
.gw-quiz-pick .btn { margin-top: var(--sp-3); justify-content: center; }
@media (max-width: 1180px) { .gw-cp-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .gw-cp-tabs { gap: var(--sp-2); }
  .gw-cp-tab { padding: var(--sp-2) var(--sp-3); }
  .gw-cp-tab-name { font-size: 15px; }
  .gw-cp-tab-say { font-size: 12px; }
  .gw-main table.dtable.gw-stack td.num { text-align: left; }
  .gw-main table.dtable.gw-stack td.num .gw-cp-ph { font-family: var(--font-body); }
  .gw-main .card:not(.gw-tablecard) > .gw-tw table.dtable.gw-stack tbody tr:first-child { padding-top: 0; }
  .gw-cp-ph { display: inline; color: var(--text-muted); }
  .gw-cp-two .gw-quiz { padding: var(--sp-4); }
}

/* Touch targets (guide section 14: at least 44px high): links that sit in a line of text or a list are as tall as a button on a phone.
   A link in running text gets the class gw-tap. Review 19 Nov 2026, finding 7. */
@media (max-width: 820px) {
  .gw-tap, .gw-now-list li > span > a, .gw-out-also a, .ov-table th.ov-name a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .ov-table th.ov-name { height: 44px; }
}

/* Text at 200% on a phone (a window about 195px wide): nothing may scroll the page sideways and no text is clipped (design review, 19 Nov 2026). */
@media (max-width: 300px) {
  .gw-top { padding: 0 var(--sp-2); gap: var(--sp-1); }
  .gw-user { gap: var(--sp-1); }
}
.gw-switch-row { flex-wrap: wrap; }
.gw-switch-row > span { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.gw-switch-row .context-toggle { white-space: normal; max-width: 100%; text-align: left; }
@media (max-width: 300px) { .gw-pill { white-space: normal; } }
/* Stacked rows at 200% text on a phone: a label never breaks before its colon, a status badge never breaks inside the word, and the More button drops under the details so it does not take a column of its own (Opus review of Batch B, SHOULD 2) */
@media (max-width: 300px) {
  .gw-main table.dtable.gw-stack td .gw-cp-ph { white-space: nowrap; }
  .gw-main table.dtable.gw-stack td .badge, .gw-main table.dtable.gw-stack td .gw-pill { overflow-wrap: normal; word-break: keep-all; white-space: nowrap; }
  .gw-main table.dtable.gw-stack tr { grid-template-columns: minmax(0, 1fr); }
  .gw-main table.dtable.gw-stack td.gw-actions, .gw-main table.dtable.gw-stack td.gw-stack-end { grid-column: 1; grid-row: auto; justify-self: start; }
}
.gw-tap, .gw-guide-sec a { max-width: 100%; overflow-wrap: anywhere; }
