/* Test Review. Layout: one centred reading column (max 760px), a quiet sticky header, cards only for things you act on.
   Palette: a deep green ink on a warm paper white; amber for flags and warnings, red and green only for right and wrong. */
:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --sunk: #eef0eb;
  --line: #dcdfd7;
  --fg: #1b1f1d;
  --muted: #5d6661;
  --accent: #1f5c4f;
  --accent-fg: #ffffff;
  --accent-soft: #e3efea;
  --good: #1d7a45;
  --good-soft: #e2f3e8;
  --bad: #b3362b;
  --bad-soft: #fbe7e4;
  --warn: #9a6200;
  --warn-soft: #fbf0d9;
  --code-bg: #eef0eb;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 2px 8px rgba(20, 30, 25, .05);
  --display: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 10px;
}
/* Dark: the device's setting unless the person chose Light; or their explicit Dark (Settings > Look; Playbook 04 rule 105). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a; --surface: #1c2024; --sunk: #181b1e; --line: #2e3439; --fg: #e8ebe9; --muted: #9aa4a0;
    --accent: #6cc3a8; --accent-fg: #0f1a16; --accent-soft: #1d302b;
    --good: #5fcf8a; --good-soft: #17301f; --bad: #f08a7e; --bad-soft: #3a1d1a; --warn: #f0b955; --warn-soft: #362a14;
    --code-bg: #111416; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #14171a; --surface: #1c2024; --sunk: #181b1e; --line: #2e3439; --fg: #e8ebe9; --muted: #9aa4a0;
    --accent: #6cc3a8; --accent-fg: #0f1a16; --accent-soft: #1d302b;
    --good: #5fcf8a; --good-soft: #17301f; --bad: #f08a7e; --bad-soft: #3a1d1a; --warn: #f0b955; --warn-soft: #362a14;
    --code-bg: #111416; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }   /* a double tap never zooms; a pinch always can (Playbook 04 rule 285) */
/* Larger text enlarges the whole page by zoom so proportions hold (Playbook 04 rule 102; kit base.css). */
html[data-text="large"] body { zoom: 1.15; }
html[data-text="large"] .sheet { max-height: calc(88dvh / 1.15); }
/* No link menu on a long press in the Home Screen app (Playbook 04 rule 275). */
a, button, .li, .action { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
/* The kit's Tools button, menus and nudges in the app's own colours. (:not(...) matches always: it outranks tools.css's own dark
   rule, which is (0,2,0) too, because app.css loads last.) */
:root:not([data-no-such]) { --tk-bg: var(--bg); --tk-fg: var(--fg); --tk-muted: var(--muted); --tk-surface: var(--surface); --tk-surface-2: var(--sunk); --tk-line: var(--line);
  --tk-accent: var(--accent); --tk-accent-fg: var(--accent-fg); --tk-accent-soft: var(--accent-soft); --tk-danger: var(--bad); --tk-ok: var(--good); --tk-warn: var(--warn);
  --tk-sans: var(--text); --surface-2: var(--sunk); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--text); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }   /* no border-radius here: it squared the round Tools button */
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

.wrap { max-width: 760px; margin: 0 auto; padding-block: 20px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 30; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--fg); display: flex; align-items: center; gap: 8px; min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; }
.crumb { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.env-pill { font: 500 .75rem var(--mono); color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 2px 8px; }
.avatar-btn { margin-left: auto; border: 0; background: none; padding: 6px; border-radius: 99px; cursor: pointer; display: flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.avatar { width: 32px; height: 32px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
  font: 600 .85rem var(--display); object-fit: cover; }
.menu { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: 52px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 40; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 8px; color: var(--fg);
  background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--sunk); text-decoration: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px;
  border: 1px solid transparent; background: var(--accent); color: var(--accent-fg); font: 600 1rem var(--text); cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { background: var(--sunk); }
.btn.quiet { background: transparent; color: var(--accent); padding: 0 10px; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.wide { width: 100%; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .95rem; min-height: 44px; align-self: flex-start; }   /* a 44px tap (Playbook 04 rule 200) */

/* cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .actions { grid-template-columns: 1fr; } }
.action { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; color: var(--fg); cursor: pointer; text-align: left; font: inherit; width: 100%; }
.action:hover:not(:disabled) { border-color: var(--accent); text-decoration: none; }
.action:disabled { opacity: .55; cursor: default; }
.action .ic { width: 40px; height: 40px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.action .ic .icon { width: 22px; height: 22px; }
.action.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.action.primary .ic { background: rgba(255, 255, 255, .16); color: var(--accent-fg); }
.action.primary .muted { color: inherit; opacity: .85; }
.action h3 { margin-bottom: 2px; }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.list > * { padding: 14px 16px; border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; }
a.li { display: flex; align-items: center; gap: 12px; color: var(--fg); }
a.li:hover { background: var(--sunk); text-decoration: none; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; }
.eyebrow { font: 500 .8rem var(--mono); color: var(--muted); letter-spacing: .02em; }

/* mastery bars */
.bar { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar.lo > span { background: var(--bad); }
.bar.mid > span { background: var(--warn); }
.topic-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 90px 48px; gap: 12px; align-items: center; }
.topic-row .num { font: 500 .85rem var(--mono); color: var(--muted); }
.topic-row .pct { font: 500 .9rem var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .topic-row { grid-template-columns: 36px minmax(0, 1fr) 48px; } .topic-row .bar { grid-column: 2 / 4; grid-row: 2; } }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat b { display: block; font: 600 1.5rem var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--muted); }

/* quiz */
.qhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.timer { font: 500 1rem var(--mono); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.timer.low { color: var(--bad); }
.progress { height: 4px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.qtext { font-size: 1.1rem; line-height: 1.5; }
.evidence { font: .85rem/1.5 var(--mono); background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  white-space: pre; overflow-x: auto; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 14px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; line-height: 1.45; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice .letter { flex: none; width: 28px; height: 28px; border-radius: 99px; border: 1.5px solid var(--line); display: grid; place-items: center;
  font: 600 .85rem var(--display); color: var(--muted); }
.choice.picked { border-color: var(--accent); background: var(--accent-soft); }
.choice.picked .letter { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.choice.right { border-color: var(--good); background: var(--good-soft); }
.choice.right .letter { background: var(--good); border-color: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.choice:disabled { cursor: default; }
.explain { border-left: 3px solid var(--accent); background: var(--sunk); padding: 12px 14px; border-radius: 0 8px 8px 0; }
.verdict { font: 600 1rem var(--display); display: flex; align-items: center; gap: 8px; }
.verdict.ok { color: var(--good); } .verdict.no { color: var(--bad); }
.qnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.qnav button { height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 500 .9rem var(--mono); cursor: pointer; position: relative; }
.qnav button.done { background: var(--accent-soft); border-color: var(--accent); }
.qnav button.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.qnav button.flag::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 99px; background: var(--warn); }
.qnav button.ok { background: var(--good-soft); border-color: var(--good); }
.qnav button.no { background: var(--bad-soft); border-color: var(--bad); }
.qfoot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.flag-btn.on { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }

/* results */
.score-big { font: 700 3rem/1 var(--display); font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: .85rem; font-weight: 500; }
.pill.ok { color: var(--good); background: var(--good-soft); } .pill.no { color: var(--bad); background: var(--bad-soft); }
.pill.skip { color: var(--warn); background: var(--warn-soft); } .pill.neutral { color: var(--muted); background: var(--sunk); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--fg); font: inherit; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.review-item { display: flex; flex-direction: column; gap: 10px; }
.ans-line { display: flex; gap: 8px; align-items: flex-start; }

/* notes */
.notes ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.terms { display: grid; grid-template-columns: minmax(140px, 32%) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.terms > div { padding: 10px 14px; border-top: 1px solid var(--line); }
.terms > div:nth-child(-n+2) { border-top: 0; }
.terms .t { font-weight: 600; background: var(--sunk); }
@media (max-width: 520px) { .terms { grid-template-columns: 1fr; } .terms > div:nth-child(2) { border-top: 0; } .terms > div:nth-child(2n+1) { border-top: 1px solid var(--line); } .terms > div:first-child { border-top: 0; } .terms .t { padding-bottom: 4px; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* forms */
textarea, input[type="text"], select { width: 100%; font: 16px/1.5 var(--text); color: var(--fg); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; }
textarea { min-height: 160px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select, [contenteditable="true"] { font-size: max(16px, 1em); }
}
label.check { display: flex; gap: 10px; align-items: center; padding: 10px 0; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.prompt-text { display: flex; flex-direction: column; gap: 12px; }
.prompt-text pre { font: .82rem/1.5 var(--mono); background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; margin: 0; }
.rubric-row { display: flex; gap: 12px; align-items: flex-start; }
.mark { flex: none; width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; }
.mark.ok { background: var(--good-soft); color: var(--good); } .mark.no { background: var(--bad-soft); color: var(--bad); }
details.fold { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
details.fold summary { padding: 14px 16px; cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary .icon { transition: transform .15s; }
details.fold[open] summary .icon { transform: rotate(90deg); }
details.fold > div { padding: 0 16px 16px; white-space: pre-wrap; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 99px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } .progress > span { transition: none; } }

/* sign-in */
.hero { padding-block: 32px 8px; display: flex; flex-direction: column; gap: 16px; }
.hero h1 { font-size: 2.3rem; }
.gbtn { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.gbtn:hover { background: var(--sunk); filter: none; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .how { grid-template-columns: 1fr; } }

/* table (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
th { border-top: 0; color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--sunk); }

/* toast, confirm sheet */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: var(--fg); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.sheet-back { position: fixed; inset: 0; background: rgba(10, 15, 12, .45); z-index: 70; display: grid; place-items: center; padding: 16px; }
.sheet { background: var(--surface); border-radius: 14px; padding: 20px; width: 100%; max-width: 420px; box-shadow: var(--shadow); position: relative; }
.sheet .x { position: absolute; top: 10px; right: 10px; border: 0; background: none; color: var(--muted); padding: 8px; cursor: pointer; border-radius: 8px; }
@media (max-width: 560px) { .sheet-back { place-items: end stretch; padding: 0; } .sheet { max-width: none; border-radius: 16px 16px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); } }

/* phones: the header stays on one line */
.brand { white-space: nowrap; }
@media (max-width: 480px) {
  .crumb { display: none; }
  .prompt-text pre, .evidence { font-size: .75rem; }
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.9rem; }
}

/* Settings, Admin tabs, waiting answers (4 Dec 2026) */
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-fg); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; color: var(--muted); font-weight: 500;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }   /* three signals: colour, weight, bar */
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--warn); color: var(--bg); font-size: .75rem; font-weight: 700; }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.warn-text { color: var(--warn); }
.ic-wait { flex: none; width: 40px; height: 40px; border-radius: 99px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.pre { white-space: pre-wrap; }
.wait-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.push-box:empty { display: none; }
.np-head { font-family: var(--display); font-size: 1.25rem; font-weight: 600; margin: 0 0 8px; }
/* Room at the end of every page for the round Tools button, so it never covers the last thing on it (Playbook 04 rule 136). */
.wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* Every tap target 44px on phones (render check, 4 Dec 2026: the look switches were 40px, small buttons 36px). */
.seg button { min-height: 44px; }
@media (pointer: coarse), (max-width: 640px) { .btn.small { min-height: 44px; } }

/* ---- Desktop (owner, 4 Dec 2026: "This will also be used as a desktop page so make sure it is formatted in a way that that is
   easy"). Phones keep the single column; from 1000px wide, screens that work side by side use a wider page. ---- */
.quiz-side, .chip-title { display: none; }
kbd { font: 500 .8rem var(--mono); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.keys { display: none; }
.units, .notes-grid, .frq-grid { display: flex; flex-direction: column; gap: 16px; }
@media (hover: hover) and (pointer: fine) { .keys { display: block; } }
@media (min-width: 1000px) {
  .wrap.wide { max-width: 1120px; }
  .top-in { max-width: 1120px; }
  /* Dashboard: three action tiles a row, the two units side by side */
  .wide .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wide .units { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  /* Tests and drills: the question on the left, progress and the question grid always in view on the right */
  .quiz-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
  .quiz-side { display: flex; position: sticky; top: 76px; }
  .quiz-main .qnav-fold, .quiz-main .qhead .timer { display: none; }
  .quiz-main { max-width: 720px; }
  /* FRQ: the scenario stays on the left while you write on the right */
  .frq-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; }
  .frq-prompt { position: sticky; top: 76px; max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
  .frq-answer textarea { min-height: 180px; }
  /* Notes: the topics as a list down the side */
  .notes-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; }
  .notes-grid > .chips { flex-direction: column; flex-wrap: nowrap; gap: 2px; position: sticky; top: 76px; }
  .notes-grid > .chips .chip { border: 0; border-radius: 8px; background: none; padding: 9px 12px; font-family: var(--mono); }
  .notes-grid > .chips .chip-title { display: inline; font-family: var(--text); }
  .notes-grid > .chips .chip:hover { background: var(--sunk); }
  .notes-grid > .chips .chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--fg); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
  .notes-body { max-width: 720px; }
}
/* A graded or waiting answer reads as one column, even on the wide page. */
.reading { width: 100%; max-width: 820px; margin: 0 auto; }
.chip:hover, .tabs a:hover, .action:hover, .li:hover { text-decoration: none; }
@media (pointer: coarse), (max-width: 640px) { .chip { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; } }
