/* CertStreak component styles (the Combo look). Every colour, radius and shadow comes
   from brand.css. Order: base, type, layout, components, page shells, screens. */

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--font-body); }
img, svg { max-width: 100%; }
a { color: var(--violet); font-weight: 700; text-underline-offset: 3px; }
/* Inside hover-capable devices only: on a phone the tapped spot keeps :hover, and a link
   button drawn there next (the player's Next) would take this colour on its own fill. */
@media (hover: hover) { a:hover { color: var(--violet-deep); } }
h1, h2, h3, h4, p, ul, ol, figure, fieldset { margin: 0; }
ul, ol { padding-left: 1.2em; }
fieldset { border: 0; padding: 0; min-width: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--lilac); padding: 1px 6px; border-radius: 6px; }
pre { background: var(--lilac); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); padding: 14px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 4px; }
/* On violet and ink surfaces a violet ring vanishes (1:1 and 2.9:1): lemon keeps 4.6:1 and better. */
:is(.footer:not(.footer--app), .section--violet, .panel--violet, .card--violet, .auth__aside, .side, .adminbar) :focus-visible { outline-color: var(--lemon); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-pill); z-index: 50; }
.skip:focus { left: 8px; color: var(--paper); }
[hidden] { display: none !important; }

/* ── Type ─────────────────────────────────────────────────────────────── */
.t-numeral { font: 800 clamp(72px, 12vw, 120px)/0.8 var(--font-display); letter-spacing: -0.04em; }
.t-display { font: 800 clamp(36px, 5.2vw, 60px)/1 var(--font-display); letter-spacing: -0.03em; text-wrap: balance; }
.t-title { font: 800 clamp(30px, 3.6vw, 40px)/1.05 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.t-heading { font: 800 clamp(26px, 3vw, 32px)/1.1 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.t-sub { font: 700 26px/1.1 var(--font-display); }
.t-value { font: 800 28px/1.05 var(--font-display); }
.t-lead { font-size: 19px; color: var(--ink-soft); max-width: 62ch; }
.t-label { font-size: 17px; font-weight: 700; line-height: 1.3; }
.t-small { font-size: 15px; line-height: 1.45; }
.t-caption { font-size: 14px; font-weight: 700; line-height: 1.4; }
.t-fine { font-size: 13px; font-weight: 500; }
.muted { color: var(--ink-muted); }
.center { text-align: center; }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 14px; }
.prose h2 { font: 800 26px/1.15 var(--font-display); margin-top: 36px; }
.prose h3 { font-size: 19px; margin-top: 24px; }
.prose table { width: 100%; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: var(--border-rule) solid var(--line); vertical-align: top; }
.rich > * + * { margin-top: 12px; }
.rich table { font-size: 15px; border-collapse: collapse; }
/* A wide table scrolls sideways in its own box. Shadows at the scrolling edge show there is
   more; the paper-coloured covers scroll with the content and hide each shadow at its end. */
.table-scroll {
  --scroll-bg: var(--surface, var(--paper));
  --scroll-shade: color-mix(in srgb, var(--ink) 40%, transparent);
  max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain;
  background:
    linear-gradient(to right, var(--scroll-bg) 30%, transparent) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--scroll-bg) 30%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shade), transparent) left center / 18px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shade), transparent) right center / 18px 100% no-repeat scroll,
    var(--scroll-bg);
}
.explain .table-scroll { --scroll-bg: var(--lilac); }
.explain--right .table-scroll { --scroll-bg: var(--mint); }
.rich th, .rich td { text-align: left; padding: 6px 12px; border: var(--border-rule) solid var(--line); }
.rich th { background: var(--lilac); }

/* ── Layout ───────────────────────────────────────────────────────────── */
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: var(--space-6); }
.wrap--narrow { max-width: 820px; }
.page { padding-block: var(--space-10) var(--space-18); display: flex; flex-direction: column; gap: var(--space-8); }
/* A page's sections never grow wider than the page, whatever is inside them (a select is as wide as its longest option). */
.page > * { min-width: 0; max-width: 100%; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-8); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.row--between { justify-content: space-between; }
/* A row of fields lines up by its tops: a field with help text under it is taller than one without,
   and centring would float the shorter inputs down. :where() keeps this weaker than .row--end. */
.row:where(:has(> .field)) { align-items: flex-start; }
.row--end { align-items: flex-end; }
.row--tight { gap: var(--space-2); }
/* An icon that leads a line of text: it stays beside the first words when the text wraps. */
.row--icon-text { flex-wrap: nowrap; align-items: flex-start; }
.row--icon-text > svg { flex: none; margin-top: 1px; }
.grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.split { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: stretch; }
.split > .split__main { flex: 1.6 1 520px; min-width: 0; }
.split > .split__side { flex: 1 1 320px; min-width: 0; }
.grow { flex: 1 1 0; min-width: 0; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-6); }
.section { padding-block: var(--space-18); }
.section--lilac { background: var(--lilac); border-block: var(--border-outline) solid var(--ink); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink .muted, .section--ink .t-lead { color: var(--on-ink-muted); }
.section--ink a { color: var(--lemon); }
.section--violet { background: var(--violet); color: var(--paper); border-block: var(--border-outline) solid var(--ink); }
.section--violet .t-lead { color: var(--paper); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 28px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); font: 700 18px/1.2 var(--font-body); text-decoration: none; cursor: pointer; text-align: center; }
@media (hover: hover) { .btn:hover { color: var(--ink); background: var(--lilac); } }
.btn--primary { background: var(--violet); color: var(--paper); box-shadow: var(--shadow-md); }
@media (hover: hover) { .btn--primary:hover { background: var(--violet-deep); color: var(--paper); } }
.btn--lemon { background: var(--lemon); box-shadow: var(--shadow-md); }
.btn--lemon:hover { background: var(--lemon); }
.btn--dark { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .btn--dark:hover { background: var(--ink-soft); color: var(--paper); } }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 16px; }
.btn--sm.btn--primary, .btn--sm.btn--lemon { box-shadow: var(--shadow-sm); }
.btn--block { width: 100%; }
.btn--primary:active, .btn--lemon:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--violet); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: var(--violet-deep); }
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform 0.08s, box-shadow 0.08s, background-color 0.12s; }
}

/* ── Chips, stickers, pills ───────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.chip--streak { background: var(--flame); min-height: 40px; padding: 0 14px; font-size: 17px; }
.chip--streak:hover { color: var(--ink); }
.chip--mint { background: var(--mint); }
.chip--lemon { background: var(--lemon); }
.chip--lilac { background: var(--lilac); }
.chip--dash { border-style: dashed; }
/* As on the answer map: looked at is dashed, not answered is dotted, a wrong answer has a solid outline. They differ in shape, not only words. */
.chip--dot { border-style: dotted; }
.chip--ink { background: var(--ink); color: var(--paper); }
.sticker { display: inline-block; background: var(--lemon); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); padding: 6px 14px; font-weight: 700; transform: rotate(-2deg); }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill); color: var(--ink); text-decoration: none; font-weight: 700; }
@media (hover: hover) { .pill:hover { background: var(--lilac); color: var(--ink); } }
.pill--on, .pill--on:hover { background: var(--ink); color: var(--paper); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--lilac); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); font-weight: 700; color: var(--ink); text-decoration: none; }
.avatar--on { background: var(--ink); color: var(--paper); }
.flame path, .flame use { fill: var(--flame); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.flame--lemon path, .flame--lemon use { fill: var(--lemon); }
.icon { flex: none; }

/* ── Cards and panels ─────────────────────────────────────────────────── */
.card { background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 28px; min-width: 0; }
.card--flat { box-shadow: none; }
.card--lemon { background: var(--lemon); }
.card--mint { background: var(--mint); }
.card--lilac { background: var(--lilac); }
.card--violet { background: var(--violet); color: var(--paper); }
.card--violet a:not(.btn) { color: var(--lemon); }
.card--ink { background: var(--ink); color: var(--paper); }
.card--ink .muted { color: var(--on-ink-muted); }
.panel { background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-2xl); padding: var(--space-8); min-width: 0; }
.panel--hero { box-shadow: var(--shadow-lg); }
.panel--lilac { background: var(--lilac); }
.panel--violet { background: var(--violet); color: var(--paper); }
.panel--lemon { background: var(--lemon); }
.panel--mint { background: var(--mint); }
@media (max-width: 560px) { .panel { padding: var(--space-6); } .card { padding: 20px; } }

.flash { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); padding: 12px 18px; font-weight: 700; }
.flash--ok { background: var(--mint); }
.flash--warn { background: var(--lemon); }
.flash--info { background: var(--lilac); }

/* ── Streak ───────────────────────────────────────────────────────────── */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day__label { font-size: 14px; font-weight: 500; }
.day__label--today { font-weight: 700; color: var(--violet); }
.tile { width: 100%; aspect-ratio: 1.3; display: flex; align-items: center; justify-content: center; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); }
.tile--done { background: var(--flame); box-shadow: var(--shadow-sm); }
.tile--today.tile--done { box-shadow: 5px 5px 0 var(--violet); transform: rotate(-3deg) scale(1.06); }
.tile--open { border-color: var(--violet); }
.tile--todo { border-style: dashed; }
.tile--missed { border-style: dashed; border-color: var(--unseen); }
.tile--frozen { background: var(--lilac); color: var(--violet); }
.streak-num { color: var(--flame); -webkit-text-stroke: 2px var(--ink); }
.panel--violet .streak-num { -webkit-text-stroke: 2px var(--ink); }
/* On lilac the bright flame is 2.4:1; a deeper flame keeps the streak's colour at 3.5:1 (large text). */
:is(.panel--lilac, .card--lilac, .section--lilac) .streak-num { color: #d85008; }
@media (prefers-reduced-motion: no-preference) {
  .tile--today.tile--done { animation: pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) 1; }
  @keyframes pop { from { transform: rotate(0) scale(0.7); } to { transform: rotate(-3deg) scale(1.06); } }
}

/* ── Progress ─────────────────────────────────────────────────────────── */
.bar { position: relative; height: 28px; background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); overflow: hidden; }
.bar--slim { height: 18px; }
.bar__fill { height: 100%; border-right: var(--border-outline) solid var(--ink); }
.bar__fill[style*="width:0%"] { border-right: 0; }
.bar__fill--flame { background: var(--flame); }
.bar__fill--violet { background: var(--violet); }
.bar__fill--lemon { background: var(--lemon); }
.bar__fill--mint { background: var(--mint); }
/* The target line is ink dashes on paper with a paper edge: one of the two always stands out (3:1 or
   more) against any fill or track, day or night, without changing the fills' colours. */
.bar__target { position: absolute; top: 0; bottom: 0; border-left: var(--border-outline) dashed var(--ink); background: var(--paper); box-shadow: 0 0 0 1px var(--paper); }
.tiles { display: grid; gap: 5px; }
.tiles__t { height: 28px; border: var(--border-outline) dashed var(--ink); border-radius: var(--radius-sm); }
.tiles__t--done { background: var(--violet); border-style: solid; }
.scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; font: 800 24px var(--font-display); }
.scores > div { border: var(--border-outline) dashed var(--ink); border-radius: var(--radius-md); padding: 4px 0; }
.scores > .is-met { background: var(--mint); border-style: solid; }
.scores > .is-empty { color: var(--ink-muted); border-color: var(--unseen); }

/* ── Forms ────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .field__label { font-weight: 700; font-size: 15px; }
.input, .select, .textarea { width: 100%; min-height: 52px; padding: 0 14px; background: var(--paper); color: var(--ink); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); }
.textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
/* An input sharing a row with buttons: grows to fill it (a search box, a short note). */
.input--inline { width: auto; flex: 1 1 240px; min-height: 40px; }
.input--search { width: auto; flex: 1 1 300px; max-width: 440px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--shadow-violet); }
/* Locked fields (the signed-in learner's own address, a link to copy): shaded, with a dashed
   edge, so they do not read as a box to type in. Text keeps ink-soft on lilac, about 10:1. */
.input:is([readonly], :disabled), .textarea:is([readonly], :disabled), .select:disabled { background: var(--lilac); color: var(--ink-soft); border-style: dashed; cursor: default; }
.field__help { font-size: 15px; color: var(--ink-muted); }
.field__error { font-size: 15px; font-weight: 700; }
.form { display: flex; flex-direction: column; gap: var(--space-4); max-width: 440px; }
/* The one-line sign-in: address and button share a row and a single outline. */
.oneline { display: flex; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); background: var(--paper); box-shadow: var(--shadow-md); overflow: hidden; }
.oneline:focus-within { box-shadow: var(--shadow-violet); border-color: var(--violet); }
.oneline input { flex: 1 1 auto; min-width: 0; min-height: 56px; border: 0; background: none; padding: 0 8px 0 22px; outline: none; }
.oneline button { flex: none; border: 0; border-left: var(--border-outline) solid var(--ink); background: var(--violet); color: var(--paper); font-weight: 700; padding: 0 24px; cursor: pointer; }
@media (hover: hover) { .oneline button:hover { background: var(--violet-deep); } }
.oneline--code input { font: 800 28px var(--font-display); letter-spacing: 0.3em; text-align: center; padding: 0 12px; }
/* The code field's intrinsic width (20 characters at 28px) used to push the sign-in column wider
   than a phone: the field starts from nothing and takes what the "Sign in" button leaves. */
.oneline--code input { width: 0; }
@media (max-width: 360px) { .oneline--code input { letter-spacing: 0.2em; } .oneline--code button { padding: 0 18px; } }
.or { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; color: var(--ink-muted); }
.or::before, .or::after { content: ""; flex: 1; border-top: var(--border-outline) dashed var(--line); }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--violet); flex: none; }
.option { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); cursor: pointer; background: var(--paper); }
.option:has(input:checked) { background: var(--lilac); box-shadow: var(--shadow-violet); }
.option input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--violet); flex: none; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.tablebox { position: relative; overflow-x: auto; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); }
.table { width: 100%; min-width: 560px; font-size: 15px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 14px; padding: 12px 16px; border-bottom: var(--border-outline) solid var(--ink); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: var(--border-rule) solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-on td { background: var(--lemon-wash); }
.table a { font-weight: 700; }
.num { text-align: right !important; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; }
.kv > * { padding: 12px 0; border-bottom: var(--border-rule) solid var(--line); }
.kv > *:nth-last-child(-n+2) { border-bottom: 0; }
.kv > dd { margin: 0; text-align: right; font-weight: 700; }
.kv3 { display: grid; grid-template-columns: 1fr auto auto; gap: 0 16px; align-items: center; }
.kv3 > * { padding: 12px 0; border-bottom: var(--border-rule) solid var(--line); }
.kv3 > *:nth-last-child(-n+3) { border-bottom: 0; }

/* ── Shell: header and footer ─────────────────────────────────────────── */
.top { border-bottom: var(--border-outline) solid var(--ink); background: var(--paper); }
.top__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 14px; }
.top__nav { display: flex; flex-wrap: wrap; gap: 4px; }
.top__end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 800 24px var(--font-display); letter-spacing: -0.02em; }
.wordmark:hover { color: var(--ink); }
@media (max-width: 720px) {
  .top__nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .top__nav .pill { white-space: nowrap; padding: 0 14px; }
}
.footer { background: var(--ink); color: var(--paper); padding-block: var(--space-10) var(--space-6); margin-top: 0; }
.footer .wordmark { color: var(--paper); }
.footer a { color: var(--paper); font-weight: 500; }
.footer__grid { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.footer__nav { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.footer__note { font-size: 14px; color: var(--on-ink-muted); max-width: 38ch; }
.footer__base { margin-top: var(--space-8); font-size: 13px; color: var(--on-ink-muted); }
.footer--app { background: var(--paper); color: var(--ink-muted); border-top: var(--border-outline) solid var(--ink); padding-block: var(--space-4); }
.footer--app a { color: var(--ink-muted); }
.footer--app .footer__base { margin-top: 0; color: var(--ink-muted); }

/* ── Marketing screens ────────────────────────────────────────────────── */
.hero { padding-block: var(--space-18); }
.hero__grid { display: flex; flex-wrap: wrap; gap: var(--space-10); align-items: center; }
.hero__copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.hero__art { flex: 1 1 420px; min-width: 0; }
/* The home page's hero holds a whole question, taller than the copy: both start at the top. */
.hero__grid--top { align-items: flex-start; }
.hero__terms--after { display: none; }
@media (max-width: 947px) { .hero__copy .hero__terms { display: none; } .hero__terms--after { display: block; } }
.section--try .tabs { margin-bottom: calc(-1 * var(--space-2, 8px)); }
/* The film in the hero: framed like a card, sized before it loads (16:9) so nothing jumps. */
.hero__video { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hero__video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--ink); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.hero__art--video { flex-basis: 520px; }
/* The question's own row, straight under the hero. */
.section--try { padding-top: 0; }
.steps { counter-reset: step; display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); list-style: none; padding: 0; }
.steps > li { counter-increment: step; }
.steps > li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 14px; background: var(--lemon); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); font: 800 20px var(--font-display); }
.price { font: 800 clamp(64px, 9vw, 96px)/0.9 var(--font-display); letter-spacing: -0.04em; }
.ticks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks li::before { content: ""; flex: none; width: 24px; height: 24px; margin-top: 1px; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317131F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center/16px no-repeat; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); }
/* A line about something missing (no diagnostic yet) is a note, not a benefit: a neutral "i", not a green tick. */
.ticks li.is-note::before { background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317131F' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 11v6M12 7.5v.01'/%3E%3C/svg%3E") center/16px no-repeat; }
.faq details { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); padding: 0 20px; background: var(--paper); }
.faq details + details { margin-top: 12px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style-position: outside; }
.faq details[open] { background: var(--lilac); }
.faq details > p { padding-bottom: 18px; max-width: 68ch; }
.examcard { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--ink); }
@media (hover: hover) { .examcard:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); } }
.examcard__code { font: 800 44px/1 var(--font-display); letter-spacing: -0.03em; }

/* ── Auth ─────────────────────────────────────────────────────────────── */
.auth__grid { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth__aside { flex: 1 1 380px; background: var(--violet); color: var(--paper); border-right: var(--border-outline) solid var(--ink); padding: var(--space-10); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-10); }
.auth__aside .wordmark { color: var(--paper); }
.auth__note { font-size: 14px; }
.auth__main { min-width: 0; flex: 1.2 1 440px; padding: var(--space-10) var(--space-6); display: flex; align-items: center; justify-content: center; }
.auth__box { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: var(--space-6); }
.social { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
@media (max-width: 820px) { .auth__aside { border-right: 0; border-bottom: var(--border-outline) solid var(--ink); padding: var(--space-6); gap: var(--space-6); } .auth__aside .auth__note { display: none; } }

/* ── Exam player: the calm screen. No tilt, no flame, no stickers. ────── */
body.exam { background: var(--paper); }
.exambar { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: var(--border-outline) solid var(--ink); }
.exambar__title { font-weight: 700; }
.clock { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); font: 800 22px var(--font-display); font-variant-numeric: tabular-nums; }
.clock--low { background: var(--lemon); }
.exam__main { padding-block: var(--space-8) var(--space-18); display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: flex-start; }
.exam__q { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.exam__side { flex: 1 1 280px; min-width: 0; position: sticky; top: 84px; }
.qprompt { font-size: 19px; }
.qhint { font-size: 15px; font-weight: 700; color: var(--ink-muted); }
.answers { display: flex; flex-direction: column; gap: var(--space-4); }
.answer { position: relative; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 18px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); cursor: pointer; }
.answer input { position: absolute; opacity: 0; }
.answer__key { flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); background: var(--paper); font: 800 17px var(--font-display); }
.answer--box .answer__key { border-radius: var(--radius-sm); }
.answer:has(input:checked) { background: var(--lilac); box-shadow: var(--shadow-violet); font-weight: 700; }
.answer:has(input:checked) .answer__key { background: var(--violet); color: var(--paper); }
.answer:has(input:focus-visible) { outline: 3px solid var(--violet); outline-offset: 2px; }
.answer:has(input:disabled) { cursor: default; }
.answer--right { background: var(--mint); }
.answer--wrong { border-style: dashed; }
.answer__tag { margin-left: auto; flex: none; font-size: 14px; font-weight: 700; white-space: nowrap; }
.answer__body { min-width: 0; }
.matrix { width: 100%; }
.matrix th, .matrix td { padding: 12px 10px; border-bottom: var(--border-rule) solid var(--line); text-align: center; vertical-align: middle; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix thead th { font-size: 15px; border-bottom: var(--border-outline) solid var(--ink); }
.matrix input { width: 24px; height: 24px; accent-color: var(--violet); }
.matrix td.is-right { background: var(--mint); }
.rowlist { display: flex; flex-direction: column; gap: 12px; list-style: none; padding: 0; }
.rowitem { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); }
.rowitem > .grow { flex: 1 1 240px; }
.rowitem .select { width: auto; min-width: 220px; max-width: 100%; min-height: 48px; flex: 1 1 220px; }
.rowitem--right { background: var(--mint); }
.rowitem--wrong { border-style: dashed; }
.order { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.order__col { border: var(--border-outline) dashed var(--ink); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 140px; }
.order__col--answer { border-style: solid; background: var(--lilac); }
.order__item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); background: var(--paper); }
.order__item .grow { font-size: 16px; }
.order__n { flex: none; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--violet); color: var(--paper); border-radius: var(--radius-pill); font-weight: 700; font-size: 14px; }
.iconbtn { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); background: var(--paper); cursor: pointer; padding: 0; }
@media (hover: hover) { .iconbtn:hover { background: var(--lemon); } }
.iconbtn[disabled] { opacity: 0.35; cursor: default; }
.cloze { font-size: 19px; line-height: 2.4; }
.cloze .select { display: inline-block; width: auto; min-height: 44px; max-width: 100%; vertical-align: middle; margin: 0 4px; }
.cloze .is-right { background: var(--mint); }
.cloze .is-wrong { border-style: dashed; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.qgrid a { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: var(--border-outline) dashed var(--unseen); border-radius: var(--radius-sm); color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.qgrid a.is-answered { background: var(--ink); color: var(--paper); border: var(--border-outline) solid var(--ink); }
.qgrid a.is-flagged { background: var(--lemon); color: var(--ink); border: var(--border-outline) solid var(--ink); }
.qgrid a.is-current { border: 3px solid var(--violet); }
.qgrid a.is-right { background: var(--mint); border: var(--border-outline) solid var(--ink); }
.qgrid a.is-wrong { background: var(--paper); border: var(--border-outline) dashed var(--ink); }
/* Answered and not right: solid like every answered state (the dashed one is "looked at"). */
.qgrid a.is-wrong.is-given { border-style: solid; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 13px; }
.legend span { display: flex; gap: 8px; align-items: center; }
.legend i { width: 16px; height: 16px; border-radius: 4px; border: var(--border-outline) dashed var(--unseen); }
.legend .l-answered { background: var(--ink); border: var(--border-outline) solid var(--ink); }
.legend .l-flagged { background: var(--lemon); border: var(--border-outline) solid var(--ink); }
.legend .l-current { border: 3px solid var(--violet); }
.explain { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); padding: 20px; background: var(--lilac); }
.explain--right { background: var(--mint); }
.verdict { font: 800 24px var(--font-display); }
.scratch { width: 100%; min-height: 120px; }
dialog { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-2xl); box-shadow: var(--shadow-lg); padding: var(--space-8); max-width: min(520px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(23, 19, 31, 0.6); }

/* ── Results ──────────────────────────────────────────────────────────── */
.score { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; }
.score__num { color: var(--violet); -webkit-text-stroke: 2px var(--ink); }
.domrow { display: grid; grid-template-columns: minmax(160px, 1.2fr) 2fr 60px; gap: 8px 16px; align-items: center; padding: 12px 0; border-bottom: var(--border-rule) solid var(--line); }
.domrow:last-child { border-bottom: 0; }
@media (max-width: 640px) { .domrow { grid-template-columns: 1fr 60px; } .domrow .bar { grid-column: 1 / -1; order: 3; } }
.review { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-xl); padding: 24px; display: flex; flex-direction: column; gap: var(--space-4); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Admin: the same outlines at lower volume ─────────────────────────── */
body.admin { font-size: 15px; }
.admin__grid { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 0 0 240px; background: var(--ink); color: var(--paper); padding: var(--space-6) var(--space-4); display: flex; flex-direction: column; gap: 2px; }
.side .wordmark { color: var(--paper); padding: 0 12px; }
.side__sub { font-size: 13px; color: var(--on-ink-muted); padding: 0 12px 12px; }
.side__sub--end { margin-top: auto; }
.side__find { padding: 0 4px 10px; }
.side__find .input { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.side__group { margin: 14px 0 2px; padding: 0 12px; font-size: 12.5px; font-weight: 700; color: var(--on-ink-muted); }
.side__link { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-md); color: var(--paper); text-decoration: none; font-weight: 500; }
@media (hover: hover) { .side__link:hover { background: var(--ink-soft); color: var(--paper); } }
.side__link--on, .side__link--on:hover { background: var(--lemon); color: var(--ink); font-weight: 700; }
.side__count { background: var(--flame); color: var(--ink); border-radius: var(--radius-pill); padding: 0 8px; font-size: 13px; font-weight: 700; }
.admin__main { flex: 999 1 640px; min-width: 0; padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-6); }
/* Phones and narrow tablets: the sidebar becomes one short bar with the page's name and a
   "Menu" that opens the same grouped list, so the page starts near the top. */
.adminbar { display: none; }
@media (max-width: 820px) {
  .side { display: none; }
  .adminbar { display: block; position: relative; background: var(--ink); color: var(--paper); padding: 10px var(--space-4); }
  .adminbar .wordmark { color: var(--paper); font-size: 20px; flex: none; }
  .adminbar__row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding-right: 168px; }
  .adminbar__here { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-ink-muted); font-weight: 600; border-left: 1px solid var(--ink-soft); padding-left: 12px; }
  .adminbar__toggle { position: absolute; top: 10px; right: var(--space-4); min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 2px solid var(--paper); border-radius: var(--radius-pill); font-weight: 700; cursor: pointer; list-style: none; }
  .adminbar__toggle::-webkit-details-marker { display: none; }
  .adminbar__menu[open] .adminbar__toggle { background: var(--lemon); color: var(--ink); border-color: var(--lemon); }
  .adminbar__list { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 6px; }
  .adminbar__list .side__find { padding: 0 0 6px; }
  .adminbar__list .side__group { padding: 0 12px; }
  .adminbar__list .side__sub { margin-top: 12px; padding-bottom: 0; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); overflow: hidden; background: var(--paper); }
.stats > div { padding: 16px 20px; border-right: var(--border-rule) solid var(--line); border-bottom: var(--border-rule) solid var(--line); }
.stats strong { display: block; font: 800 28px var(--font-display); }

/* The player's progress line: a thin flat rule under the bar, not a pill. */
.exambar > .bar { height: 8px; border: 0; border-top: var(--border-outline) solid var(--ink); border-radius: 0; }
.exambar > .bar .bar__fill { border-right: var(--border-outline) solid var(--ink); }
/* A wrong pick is marked by its dashed outline and tag, not by the selected-state fill. */
.answer.answer--wrong:has(input:checked) { background: var(--paper); box-shadow: none; }
.answer.answer--right:has(input:checked) { background: var(--mint); box-shadow: none; }
@media print { .top, .footer, .btn, .skip { display: none !important; } .panel, .card { box-shadow: none !important; } }
.domrow--action { grid-template-columns: minmax(160px, 1.2fr) 2fr auto; }
@media (max-width: 640px) { .domrow--action { grid-template-columns: 1fr auto; } }

/* Phones */
.top__nav { scrollbar-width: none; }
.top__nav::-webkit-scrollbar { display: none; }
@media (max-width: 560px) {
  .week { gap: 6px; }
  .tile { aspect-ratio: 1; border-radius: var(--radius-md); }
  .tile svg { width: 62%; height: auto; }
  .tile--today.tile--done { box-shadow: 3px 3px 0 var(--violet); }
  .score { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .hero { padding-block: var(--space-10); }
  .section { padding-block: 48px; }
  .btn { min-height: 52px; padding: 0 22px; }
  .exam__side { position: static; }
  .wrap { padding-inline: var(--space-4); }
  .admin__main { padding: var(--space-4); }
}

/* Ordering: the text keeps the row; the three controls sit under it. */
.order { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.order__col--answer .order__item { flex-wrap: wrap; }
.order__col--answer .order__item .grow { flex: 1 1 calc(100% - 44px); }
.order__col--answer .order__item .iconbtn { width: 36px; height: 36px; }
.order__col--answer .order__item .order__n + .grow + .iconbtn { margin-left: 38px; }

/* Phone player: one compact sticky row so the question keeps the screen. */
@media (max-width: 560px) {
  .exambar .chip { font-size: 13px; padding: 4px 10px; }
  .exambar .clock { font-size: 18px; padding: 4px 10px; }
  .exambar .btn--sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
  .qprompt { font-size: 17px; }
}
.exambar .btn { white-space: nowrap; }

/* Sign-in providers: each button wears its provider's own colours inside our outline. */
.social__btn { gap: 10px; justify-content: flex-start; padding-left: 16px; box-shadow: var(--shadow-sm); }
.social__btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.social__btn--google, .social__btn--microsoft { background: #ffffff; color: #1f1f1f; }
.social__btn--google:hover, .social__btn--microsoft:hover { background: #f2f2f2; color: #1f1f1f; }
.social__btn--github { background: #24292f; color: #ffffff; }
.social__btn--github:hover { background: #32383f; color: #ffffff; }
.social__btn--linkedin { background: #0a66c2; color: #ffffff; }
.social__btn--linkedin:hover { background: #004182; color: #ffffff; }

/* ════════════════════════════════════════════════════════════════════════
   Player, second pass: a calmer, faster exam screen with thinking tools.
   ════════════════════════════════════════════════════════════════════════ */
:root { --q-scale: 1; }
/* .hide-sm only hides (on phones, below); it must not set a display of its own, or a button or chip wearing it stops being a flex box and loses its height and centring. */
.exambar__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px 16px; padding-block: 10px; }
.exambar__left { justify-content: flex-start; }
.exambar__mid { justify-content: center; }
.exambar__right { justify-content: flex-end; flex-wrap: nowrap; }
.exambar__line { height: 6px; background: var(--lilac); border-top: var(--border-outline) solid var(--ink); }
.exambar__fill { height: 100%; background: var(--violet); border-right: var(--border-outline) solid var(--ink); transition: width 0.35s cubic-bezier(0.3, 1.3, 0.5, 1); }
.exambar__fill[style*="width:0%"] { border-right: 0; }
button.clock { background: var(--paper); cursor: pointer; color: var(--ink); }
@media (hover: hover) { button.clock:hover { background: var(--lilac); } }
.clock--low { background: var(--lemon) !important; }

.qcard { background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-2xl); padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-6); }
.qcard:focus { outline: none; }
.qprompt { font-size: calc(19px * var(--q-scale)); line-height: 1.55; }
.answer { font-size: calc(17px * var(--q-scale)); transition: transform 0.08s, box-shadow 0.08s, background-color 0.12s; }
@media (hover: hover) { .answer:not(:has(input:disabled)):hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); } }
.answer:has(input:checked):not(.answer--right):not(.answer--wrong) { transform: none; }
.cloze, .matrix, .rowitem, .order__item .grow { font-size: calc(17px * var(--q-scale)); }
.answer__body { flex: 1 1 auto; }
.answer__out { flex: none; margin-left: auto; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: var(--radius-pill); color: var(--unseen); cursor: pointer; padding: 0; }
.answer__out[aria-pressed="true"] { color: var(--ink); background: var(--lemon); }
@media (hover: hover) { .answer__out:hover { color: var(--ink); background: var(--lemon); } }
/* Crossed-out text stays readable (4.5:1): the strike and the dashed outline carry the state. */
.answer--out .answer__body { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-muted); }
.answer--out { border-style: dashed; border-color: var(--unseen); }
.answer--out .answer__key { border-color: var(--unseen); color: var(--ink-muted); }
.answer__tag + .answer__out { margin-left: 8px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.actions__hint { flex: 1 1 auto; }
.btn--quiet { box-shadow: none; }
.btn.is-on, .btn--quiet.is-on { background: var(--lemon); }
.chipbtn { cursor: pointer; font-family: inherit; min-height: 44px; }
@media (hover: hover) { button.chipbtn:hover, label.chipbtn:hover { background: var(--lilac); } }
.guess:has(input:checked) { background: var(--lemon); }
.guess:has(input:focus-visible) { outline: 3px solid var(--violet); outline-offset: 2px; }
.verdict { display: flex; align-items: center; gap: 10px; }
.verdict__mark { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); background: var(--paper); }
.verdict__mark--ok { background: var(--violet); color: var(--paper); }
.legend .l-right { background: var(--mint); border: var(--border-outline) solid var(--ink); }
.legend .l-wrong { border: var(--border-outline) dashed var(--ink); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--flame); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 12px 18px; font-weight: 500; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; align-items: center; }
.keys dd { margin: 0; }
kbd { display: inline-block; font: 700 14px var(--font-body); background: var(--lilac); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-sm); padding: 2px 8px; box-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
.clamp { max-height: 7.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
/* A clamped preview is a teaser, not a scroll area: its code blocks and tables must not scroll on their own. */
.clamp pre, .clamp .table-scroll { overflow: hidden; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; width: 10px; height: 14px; border: 1.5px solid var(--ink); border-radius: 2px; }

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.16s; }
  main#main.is-leaving { opacity: 0.55; transition: opacity 0.12s; }
  /* The card moves, not its parent: a transform on the parent would make the phone action
     bar (fixed to the screen bottom) position itself against the form instead of the screen. */
  .exam__q > .qcard { animation: q-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1) backwards; }
  @keyframes q-in { from { transform: translateY(8px); } to { transform: none; } }
  .answer:has(input:checked) .answer__key { animation: key-pop 0.22s cubic-bezier(0.3, 1.8, 0.5, 1); }
  @keyframes key-pop { from { transform: scale(0.7); } to { transform: scale(1); } }
  .explain { animation: explain-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
  @keyframes explain-in { from { transform: translateY(10px) scale(0.99); } to { transform: none; } }
  .verdict__mark--ok { animation: key-pop 0.35s cubic-bezier(0.3, 1.9, 0.5, 1) 0.1s both; }
  .toast { animation: toast-in 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
  @keyframes toast-in { from { transform: translateY(-14px) rotate(-2deg) scale(0.9); } to { transform: none; } }
  .confetti i { animation: confetti 1.2s cubic-bezier(0.1, 0.7, 0.3, 1) forwards; }
  @keyframes confetti { to { transform: translate(var(--dx), calc(var(--dy) + 180px)) rotate(var(--rot)); opacity: 0; } }
  .nudge { animation: nudge 0.25s; }
  @keyframes nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
  .order__item.is-new { animation: key-pop 0.2s cubic-bezier(0.3, 1.6, 0.5, 1); }
  .hero__art .tile--done { animation: pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
  .hero__art .day:nth-child(1) .tile { animation-delay: 0.15s; }
  .hero__art .day:nth-child(2) .tile { animation-delay: 0.3s; }
  .hero__art .day:nth-child(3) .tile { animation-delay: 0.45s; }
  .hero__art .day:nth-child(4) .tile { animation-delay: 0.7s; }
  .sticker { animation: sticker-in 0.5s cubic-bezier(0.3, 1.7, 0.5, 1) both; }
  @keyframes sticker-in { from { transform: rotate(-12deg) scale(0.6); } to { transform: rotate(-2deg) scale(1); } }
  .card, .examcard { transition: transform 0.12s, box-shadow 0.12s; }
}

@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .exambar__row { grid-template-columns: auto 1fr auto; padding-block: 6px; }
  .exambar__left .exambar__title { display: none; }
  .exambar__mid { justify-content: flex-start; }
  .exambar__row > .row:first-child { display: flex; }
  .exambar__row > .row { width: auto; }
  .qcard { padding: var(--space-4); border-radius: var(--radius-xl); gap: var(--space-4); }
  .exam__main { padding-bottom: 120px; }
  /* The actions ride at the bottom of the screen: the thumb never has to hunt for "next". */
  .actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--paper); border-top: var(--border-outline) solid var(--ink); padding: 10px var(--space-4) calc(10px + env(safe-area-inset-bottom, 0px)); flex-wrap: nowrap; }
  .actions .btn { min-height: 48px; padding: 0 16px; font-size: 16px; }
  .actions .btn--primary { flex: 1 1 auto; }
  .actions__hint { display: none; }
  .actions .guess span { font-size: 14px; }
}
.social { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.social__btn span { white-space: nowrap; }

/* Results: the score ring. */
/* The track is paper between two ink rules, like a bar: the violet arc sits on paper with a paper gap
   to each rule, so it reads against what touches it (violet on ink was 2.85:1). The arc spans
   r 44.5 to 51.5 of the 110 box; the rules are 2px, set in so the gaps either side are equal. */
.ring { position: relative; width: 180px; height: 180px; flex: none; }
.ring::before, .ring::after { content: ""; position: absolute; box-sizing: border-box; border: var(--border-outline) solid var(--ink); border-radius: 50%; pointer-events: none; }
.ring::before { inset: 0; }
.ring::after { inset: calc(100% * 14 / 110 - var(--border-outline)); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: var(--paper); stroke: var(--paper); stroke-width: 14; }
.ring__value { fill: none; stroke: var(--violet); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 301.6; stroke-dashoffset: var(--ring-to); }
/* A missed pass keeps the violet arc (ink would vanish on the ink track, flame is the streak's): the lemon panel and the headline say it. */
.ring__value--low { stroke: var(--violet); }
.ring__num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 56px/1 var(--font-display); letter-spacing: -0.04em; }
.ring__pct { font-size: 24px; margin-left: 2px; }
@media (prefers-reduced-motion: no-preference) {
  /* Data marks animate only on a page that is really being watched (html.anim, set by
     theme.js). Anywhere else they simply show their value. */
  html.anim .ring__value { animation: ring 1s cubic-bezier(0.3, 0.9, 0.3, 1) 0.15s both; }
  @keyframes ring { from { stroke-dashoffset: 301.6; } to { stroke-dashoffset: var(--ring-to); } }
}
@media (max-width: 560px) { .ring { width: 140px; height: 140px; } .ring__num { font-size: 44px; } }

/* Dashboard, second pass: today's plan, mastery, trend, activity, badges. */
.plan { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.plan__step { display: flex; gap: 12px; align-items: flex-start; }
.plan__mark { flex: none; width: 28px; height: 28px; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; border: var(--border-outline) dashed var(--paper); border-radius: var(--radius-pill); }
.plan__step.is-done .plan__mark { background: var(--lemon); color: var(--ink); border: var(--border-outline) solid var(--ink); }
.plan__step.is-done strong { text-decoration: line-through; text-decoration-thickness: 2px; }
.plan__step .btn { margin-top: 4px; }
/* Quiet text on violet (the "Next up" step that has nothing yet): lilac reads 5.4:1 on the day
   violet and, re-pointed at night, 5.0:1 on the night violet. Paper cards inside keep their own muted ink. */
:is(.panel--violet, .card--violet, .section--violet) .muted { color: var(--lilac); }
:is(.panel--violet, .card--violet, .section--violet) :is(.card, .panel, .btn, .chip, .sticker, .notice, .toast) .muted { color: var(--ink-muted); }
.spark { width: 100%; height: auto; overflow: visible; }
.spark__line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.spark__dot { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.spark__dot--met { fill: var(--mint); }
.spark__pass { stroke: var(--unseen); stroke-width: 2; stroke-dasharray: 2 6; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.heat__d { aspect-ratio: 1; border: 1.5px dashed var(--line); border-radius: 5px; }
.heat__d--on { background: var(--flame); border: 1.5px solid var(--ink); }
.heat__d--frozen { background: var(--lilac); border: 1.5px solid var(--ink); }
.heat__d--today { border: 2px solid var(--violet); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: var(--border-outline) dashed var(--unseen); border-radius: var(--radius-lg); color: var(--ink-muted); }
.badge.is-earned { background: var(--lemon); border: var(--border-outline) solid var(--ink); box-shadow: var(--shadow-sm); color: var(--ink); transform: rotate(-1deg); }
.badge.is-earned:nth-child(even) { background: var(--mint); transform: rotate(1deg); }
@media (prefers-reduced-motion: no-preference) {
  html.anim .spark__line { stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.1s ease-out 0.2s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  html.anim .bar__fill { animation: grow 0.7s cubic-bezier(0.3, 1, 0.4, 1) both; transform-origin: left; }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .badge.is-earned:hover { transform: rotate(0) translate(-1px, -1px); }
}
.pill .t-fine { margin-left: 6px; opacity: 0.75; }

/* Highlighter and the side-by-side scenario layout. */
::highlight(cs-mark) { background-color: #ffd84a; color: #17131f; }
.iconbtn.is-on { background: var(--lemon); }
.qprompt.is-marking { cursor: text; }
.explain .rich ul { padding-left: 1.15em; }
.explain .rich li + li { margin-top: 8px; }
.qcard__answers { min-width: 0; }
@media (min-width: 1180px) {
  body.exam .wrap { max-width: 1360px; }
  .qcard--split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "head head" "scenario scenario" "prompt answers"; column-gap: var(--space-8); align-items: start; }
  .qcard--split .qcard__head { grid-area: head; }
  .qcard--split .scenario { grid-area: scenario; }
  .qcard--split .qprompt { grid-area: prompt; max-height: calc(100vh - 290px); overflow-y: auto; padding-right: 12px; border-right: var(--border-outline) dashed var(--line); }
  .qcard--split .qcard__answers { grid-area: answers; }
}

/* Landing page feature cards: each carries a small, real piece of the product. */
.feature__demo { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--lilac); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); min-height: 124px; justify-content: center; font-size: 15px; }
.feature__demo--row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
.feature__demo .answer { font-size: 15px; cursor: default; }
.feature__arrow { display: inline-flex; color: var(--ink-muted); }
.section--lilac .feature__demo { background: var(--paper); }
@media (prefers-reduced-motion: no-preference) {
  .feature:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
}

/* Phone exam bar: four things only, none clipped. */
@media (max-width: 720px) {
  .exambar__row { gap: 6px; }
  .exambar__right { gap: 6px; }
  .exambar .iconbtn { width: 36px; height: 36px; }
  .exambar .chip { padding: 4px 9px; }
  .exambar .clock { padding: 4px 9px; font-size: 17px; }
  .exambar .clock .icon { display: none; }
  .exambar .btn--sm { padding: 0 10px; min-height: 36px; }
}

/* Night mode, for the exam screen only: the same tokens, re-pointed. Late-night study
   without a white page. Everything in the player is drawn from tokens, so this is all it takes. */
html.night {
  --paper: #1b1726; --ink: #f3effc; --ink-soft: #d9d3e6; --ink-muted: #b9b2c9; --on-ink-muted: #4a4458;
  --lilac: #2a2340; --lemon: #ffd84a; --lemon-wash: #3a3320; --mint: #1f4a37; --on-mint: #eafff3; --line: #3d3654; --unseen: #7d7691;
  --violet: #9b82ff; --violet-deep: #b9a8ff; --on-violet: #120f1a;
  --shadow-sm: 3px 3px 0 #000; --shadow-md: 4px 4px 0 #000; --shadow-lg: 8px 8px 0 #000; --shadow-violet: 4px 4px 0 #9b82ff;
  color-scheme: dark;
}
html.night body { background: #120f1a; }
html.night .exambar, html.night .top { background: #1b1726; }
/* Light islands: anything filled with lemon or flame keeps the daytime ink, and so does
   everything inside it. Re-pointing the tokens here means no per-component colour fixes. */
html.night :is(.btn--lemon, .chip--streak, .chip--lemon, .sticker, .card--lemon, .panel--lemon, .flash--warn, .tile--done, .tiles__t--done,
  .clock--low, .qgrid a.is-flagged, .iconbtn.is-on, .btn.is-on, .guess:has(input:checked), .toast, .plan__mark, .badge.is-earned,
  .coach, .netstate, .toast--float, .queue--due, .answer__out[aria-pressed="true"], .steps > li::before, .side__count, .notice, .confirm__box) {
  --paper: #ffffff; --ink: #17131f; --ink-soft: #3b3547; --ink-muted: #4a4458; --lilac: #efeaff; --mint: #b8f2d0; --on-mint: #17131f;
  --lemon-wash: #fff6cf; --line: #c9c3d6; --violet: #5b2eff; --violet-deep: #3d17c9; --on-violet: #ffffff; --unseen: #8a8496;
  color: #17131f; border-color: #17131f;
}
/* Hover exists only with a mouse: on touch screens a tapped button would otherwise keep its hover look. */
@media (hover: hover) { html.night :is(.iconbtn:hover, .answer__out:hover) {
  --paper: #ffffff; --ink: #17131f; --ink-soft: #3b3547; --ink-muted: #4a4458; --lilac: #efeaff; --mint: #b8f2d0; --on-mint: #17131f;
  --lemon-wash: #fff6cf; --line: #c9c3d6; --violet: #5b2eff; --violet-deep: #3d17c9; --on-violet: #ffffff; --unseen: #8a8496;
  color: #17131f; border-color: #17131f;
} }
html.night .btn--primary, html.night .answer:has(input:checked) .answer__key, html.night .order__n, html.night .verdict__mark--ok, html.night .bubble--me { color: var(--on-violet); }
html.night .qgrid a.is-answered { background: #f3effc; color: #17131f; }
html.night :is(.answer--right, .explain--right, .rowitem--right, .chip--mint, .card--mint, .panel--mint) { color: var(--on-mint); }
html.night dialog { background: #1b1726; color: var(--ink); }
html.night code, html.night pre { background: #2a2340; }
/* The page behind a wide table: at night the body is darker than the paper panels, so the
   scroll covers take the colour of whatever they actually sit on (`.table-scroll` reads --surface). */
html.night { --surface: #120f1a; }
html.night :is(.card, .panel, .qcard, dialog, .bubble) { --surface: var(--paper); }
/* A light island's own focus ring is drawn outside it, on the dark page: keep the night violet there. */
html.night :is(.btn--lemon, .chip--streak, .chip--lemon, .sticker, .tile--done, .qgrid a.is-flagged, .iconbtn.is-on, .btn.is-on,
  .answer__out[aria-pressed="true"], .iconbtn:hover, .answer__out:hover, .toast, .badge.is-earned, .plan__mark):focus-visible,
html.night .guess:has(input:checked):has(input:focus-visible) { outline-color: #9b82ff; }
.scoreline { flex: 1 1 280px; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.scoreline__bar { position: relative; height: 28px; background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); overflow: hidden; }
.scoreline__fill { height: 100%; background: var(--violet); border-right: var(--border-outline) solid var(--ink); }
.scoreline__mark { position: absolute; top: 0; bottom: 0; border-left: var(--border-outline) dashed var(--ink); background: var(--paper); box-shadow: 0 0 0 1px var(--paper); }
.order__item[draggable="true"] { cursor: grab; }
.order__item.is-dragging { opacity: 0.45; }
.order__col--answer.is-over { background: var(--mint); }
.order__item.drop-before { box-shadow: 0 -4px 0 var(--violet); }
.grid > .examcard:only-child { max-width: 440px; }
.skills { border-bottom: var(--border-rule) solid var(--line); padding: 4px 0 12px; }
.skills summary { cursor: pointer; color: var(--ink-muted); font-weight: 700; }
.skills__list { list-style: none; padding: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.skills__list li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.skills__list form { flex: none; }

/* First-run tips in the player, and the folding marked paper. */
.coach { background: var(--lemon); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; color: #17131f; }
.coach .linkbtn { color: #17131f; }
.coach__list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.coach__list li { display: flex; gap: 10px; align-items: flex-start; }
.review--fold > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; cursor: pointer; list-style: none; }
.review--fold > summary::-webkit-details-marker { display: none; }
.review--fold > summary::before { content: ""; flex: none; width: 10px; height: 10px; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(-45deg); transition: transform 0.15s; }
.review--fold[open] > summary::before { transform: rotate(45deg); }
.review__n { font-weight: 700; white-space: nowrap; }
.review__teaser { flex: 1 1 240px; min-width: 0; color: var(--ink-muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review--fold[open] .review__teaser { visibility: hidden; }
.review__chips { margin-left: auto; }
.review--fold:not([open]) { padding-block: 14px; }
@media (hover: hover) { .review--fold:not([open]):hover { background: var(--lilac); } }
.review--fold { display: block; }
.review--fold[open] > * + * { margin-top: 16px; }

/* Connection notice and floating heads-up in the player. */
.netstate { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; max-width: min(560px, calc(100vw - 32px)); background: var(--lemon); color: #17131f; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 10px 16px; font-weight: 500; font-size: 15px; text-align: center; }
.netstate--ok { background: var(--mint); }
.toast--float { position: fixed; top: 76px; left: 50%; translate: -50% 0; z-index: 60; background: var(--lemon); color: #17131f; }
@media (max-width: 720px) { .netstate { bottom: 88px; } }

/* Phones: the tips shrink to one line of help, and answers use the full width. */
@media (max-width: 720px) {
  .coach { padding: 10px 14px; gap: 6px; }
  .coach__list li:nth-child(n+2) { display: none; }
  .coach__list { font-size: 14px; }
  .qcard { padding: 20px 16px; }
  .answer { gap: 10px; padding: 10px 12px; }
  .answer__key { width: 30px; height: 30px; font-size: 15px; }
}
.tryone { box-shadow: var(--shadow-md); }
.review .answer__out { display: none; }
.savestate { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.savestate[hidden] { display: none; }
.savestate svg { width: 14px; height: 14px; }
html.night .savestate { color: #d8d3e3; }

/* Custom mock builder: its choices as tick-box pills. */
.builder__set { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.builder__set legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; }
.builder__opts { display: flex; flex-wrap: wrap; gap: 8px; }
.builder__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 20px; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; inset: 0; }
.pick span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; border: var(--border-outline) dashed var(--ink); border-radius: var(--radius-pill); background: var(--paper); font-weight: 500; font-size: 15px; transition: background-color 0.12s, transform 0.08s; }
.pick input:checked + span { border-style: solid; background: var(--lilac); font-weight: 700; box-shadow: 2px 2px 0 var(--ink); }
.pick input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 2px; }
@media (hover: hover) { .pick:not(:has(input:disabled)):hover span { transform: translate(-1px, -1px); } }

/* Custom mock builder: the exam outline and the study material, as groups that open to their items. */
.scope { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.scope > li { border-bottom: var(--border-rule) solid var(--line); }
.scope > li:last-child { border-bottom: 0; }
.scope__group { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; }
.scope .check { cursor: pointer; font-size: 15px; padding: 7px 0; }
.scope__more { flex: none; min-height: 44px; font-size: 14px; white-space: nowrap; }
.scope__more::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.scope__more[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
.scope__more:disabled { color: var(--ink-muted); text-decoration: none; cursor: default; }
.scope__items { list-style: none; margin: 0; padding: 0 0 12px 34px; display: flex; flex-direction: column; }
.builder__count { flex: 1 1 260px; margin: 0; font-weight: 700; }
/* A choice that can't work with the others: dimmed, flat, and not for pressing. */
.pick:has(input:disabled) { cursor: not-allowed; }
.pick input:disabled + span { opacity: 0.45; border-color: var(--ink-muted); color: var(--ink-muted); box-shadow: none; }
.scope .check.is-empty { cursor: not-allowed; color: var(--ink-muted); opacity: 0.55; }
.scope .check.is-empty input { cursor: not-allowed; }
/* The last setup, offered back; and the box for what the builder changed by itself (no gap while it is empty). */
.builder__last { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border: var(--border-rule) dashed var(--ink-muted); border-radius: var(--radius-lg); }
.builder__said:empty { margin-bottom: calc(-1 * var(--space-4)); }

/* Admin overview: the queue, the funnel and day-by-day bars. */
.stats--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .stats--3 { grid-template-columns: repeat(2, 1fr); } }
.queue { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.queue__n { font: 800 44px/1 var(--font-display); }
.queue--due { background: var(--lemon); box-shadow: var(--shadow-md); }
@media (hover: hover) { .queue:hover { transform: translate(-1px, -1px); } }
.funnel { display: flex; flex-direction: column; gap: 12px; }
.funnel__row { display: grid; grid-template-columns: 1fr 44px; gap: 4px 12px; align-items: center; }
.funnel__row > span:first-child { font-weight: 500; }
.funnel__row .bar { grid-column: 1; }
.funnel__row strong { grid-column: 2; grid-row: 1 / span 2; font: 800 22px var(--font-display); text-align: right; }
.funnel__row .t-small { grid-column: 1 / -1; min-height: 0; }
.daybars { display: flex; align-items: flex-end; gap: 3px; height: 64px; padding: 4px 0; border-bottom: var(--border-outline) solid var(--ink); }
.daybars__bar { flex: 1 1 0; min-width: 3px; background: var(--violet); border-radius: 3px 3px 0 0; }
.daybars__bar.is-empty { background: var(--line); }

/* Paper copies: the marked paper and saved questions print cleanly as study notes. */
@media print {
  .top, .footer, .exambar, .btn, .chipbtn, .linkbtn, form[action="/saved/remove"], .tabs, .confetti, nav { display: none !important; }
  body { background: #fff; }
  .review, .card, .panel { box-shadow: none !important; break-inside: avoid; }
  .review--fold > :not(summary) { display: block; }
  details.review--fold:not([open]) > summary ~ * { display: block; }
  .clamp { max-height: none; -webkit-mask-image: none; mask-image: none; }
  a { text-decoration: none; color: inherit; }
}

/* Ask the tutor. */
.tutor { display: flex; flex-direction: column; gap: var(--space-6); max-width: 820px; }
.tutor-link { text-decoration: none; }
.bubble { max-width: 88%; padding: 12px 16px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); }
.bubble--me { align-self: flex-end; background: var(--violet); color: var(--paper); border-bottom-right-radius: 4px; font-weight: 500; }
.bubble--tutor { align-self: flex-start; background: var(--paper); box-shadow: var(--shadow-sm); border-bottom-left-radius: 4px; }
form[data-busy].is-busy { opacity: 0.7; pointer-events: none; }

/* Phone fixes found by measuring: nothing may push a card wider than the screen. */
.review .grid > *, .review .stack, .review form { min-width: 0; }
.review .textarea, .review .select { max-width: 100%; }
.linkbtn { padding-block: 6px; }
/* Night mint for bars: dark enough that the light dashed target line still shows where it crosses
   the fill (3.4:1 against the line, 4.6:1 against the track); #3fbf85 left the line at 2.1:1. */
html.night .bar__fill--mint, html.night .daybars__bar { background: #2b9364; }
.review--hit { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; font-weight: 400; }
@media (hover: hover) { .review--hit:hover { background: var(--lilac); color: inherit; } }
.cohort { display: inline-block; min-width: 52px; padding: 2px 8px; border-radius: var(--radius-sm); text-align: center; font-weight: 700; }
.cohort--0 { background: var(--paper); }
.cohort--1 { background: #e3dcff; }
.cohort--2 { background: #c5b7ff; }
.cohort--3 { background: #9b82ff; }
.cohort--4 { background: var(--violet); color: #fff; }
.report { max-width: 900px; }
@media print { .report .panel, .report .stats, .report .tablebox { border-width: 1px; } html.night { color-scheme: light; } }
@media print {
  /* Paper is always light, whatever the screen was set to. */
  html.night { --paper: #ffffff; --ink: #17131f; --ink-soft: #3b3547; --ink-muted: #4a4458; --lilac: #efeaff; --mint: #b8f2d0; --on-mint: #17131f; --lemon-wash: #fff6cf; --line: #c9c3d6; --violet: #5b2eff; --violet-deep: #3d17c9; --on-violet: #ffffff; }
  html.night body { background: #ffffff; }
}

/* The study plan: one row per week. */
.planweeks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.planweek { display: grid; grid-template-columns: 190px 1fr; gap: 8px 24px; padding: 18px 22px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); }
.planweek--now { background: var(--lilac); box-shadow: var(--shadow-md); }
.planweek__when { display: flex; flex-direction: column; gap: 2px; }
.planweek__when strong { font: 800 20px var(--font-display); }
@media (max-width: 640px) { .planweek { grid-template-columns: 1fr; } }
@media print { .planweek { break-inside: avoid; box-shadow: none; } }
.footer__more { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-bottom: 10px; font-weight: 500; }
.footer__more a { font-weight: 500; }
@media print { .footer__more, [data-print] { display: none !important; } }

/* Phone action bar: one row, always. The left group never wraps, and labels stay on one line. */
@media (max-width: 720px) {
  .actions > .row { flex-wrap: nowrap; gap: 8px; flex: 0 0 auto; }
  .actions .btn { padding: 0 14px; white-space: nowrap; }
  .actions .btn--quiet { padding: 0 12px; min-width: 48px; justify-content: center; }
  .actions .guess { white-space: nowrap; }
  .actions .guess span { padding-inline: 10px; }
  .actions .btn--primary { min-width: 0; }
  .actions .btn--primary svg { flex: none; }
}
@media (max-width: 380px) { .actions .btn--primary svg { display: none; } .actions .guess span { font-size: 13px; padding-inline: 8px; } }
.show-sm { display: none; }
@media (max-width: 720px) { .show-sm { display: inline; } }

/* On phones the four app tabs share the row evenly, so none is cut off at the edge. */
@media (max-width: 480px) {
  body.app .top__nav { justify-content: space-between; gap: 2px; }
  body.app .top__nav .pill { padding: 0 11px; font-size: 15.5px; flex: 0 1 auto; }
}
/* Night mode: a chosen pill must be unmistakable, not just a shade darker. */
html.night .pick input:checked + span { background: var(--violet); color: var(--on-violet); border-color: var(--violet); box-shadow: none; }
.netstate a { color: inherit; }

/* The smallest phones (320 px): long chips wrap instead of pushing the page wide, and the app tabs tighten. */
@media (max-width: 380px) {
  .chip { white-space: normal; height: auto; min-height: 32px; padding-block: 4px; text-align: left; max-width: 100%; }
  body.app .top__nav .pill { padding: 0 7px; font-size: 14.5px; min-height: 40px; }
  .t-display { overflow-wrap: anywhere; }
}
/* Long resource names (NetworkWatcher_westeurope, storage URLs) wrap instead of spilling out of a narrow card. */
.rich, .answer__body, .qprompt, .explain, .bubble, .review__teaser { overflow-wrap: anywhere; }
.walk { max-width: 900px; }
.walk .review--fold > summary { cursor: default; }
.exam__side { scroll-margin-top: 84px; }
.exambar [data-progress] { min-height: 40px; }
/* The report form is only a target for fields elsewhere on the page; it must not take a slot in the layout. */
#reportform { display: none; }
@media (max-width: 900px) { .exam__side { flex-basis: 100%; } }

/* Checkout: heading and reassurance on the left, the order on the right. On a phone the
   order and its pay button come straight after the heading, and the reassurance follows. */
.orderpage { display: grid; gap: var(--space-6) var(--space-8); grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); grid-template-areas: "head main" "more main"; align-items: start; }
.orderpage__head { grid-area: head; }
.orderpage__more { grid-area: more; }
.orderpage__main { grid-area: main; min-width: 0; }
@media (max-width: 860px) { .orderpage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "main" "more"; } }
/* Phones: the pay button sits above the fold of a 375x812 screen and clear of Safari's floating
   toolbar, so the order reads tighter and the page ends with room for the home indicator. */
@media (max-width: 720px) {
  .section:has(> .orderpage) { padding-top: var(--space-4); padding-bottom: calc(var(--space-10) + env(safe-area-inset-bottom, 0px)); }
  .orderpage { row-gap: var(--space-4); }
  .orderpage__head { gap: var(--space-2); }
  .orderpage__head .t-lead { font-size: 16px; }
  .orderpage__main .panel { padding: var(--space-4) 20px 20px; }
  .orderpage__main .panel.stack { gap: var(--space-3); }
  .orderpage .kv > * { padding: 8px 0; }
  html:has(.orderpage) { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
/* In a label-and-value list the label keeps at least half the row; a long value (an email address) wraps. */
.kv { grid-template-columns: minmax(50%, 1fr) minmax(0, auto); }
.kv > dd { min-width: 0; overflow-wrap: break-word; }
/* Phones: the wordmark and the one main action share the first row; sign-in moves into the links row. */
.top__signin-nav, .top__narrow { display: none; }
@media (max-width: 520px) {
  .top__row { flex-wrap: wrap; }
  .top__end { flex-wrap: nowrap; margin-left: auto; }
  .top__signin { display: none; }
  .top__signin-nav { display: inline-flex; margin-left: auto; }
  .top__wide { display: none; }
  body:not(.app) .top__nav { gap: 0; }
  body:not(.app) .top__nav .pill { padding: 0 10px; }
  .top__narrow { display: inline; }
  .top__end .btn--sm { padding-inline: 16px; white-space: nowrap; }
}
@media (max-width: 380px) { body:not(.app) .top__nav .pill { padding: 0 8px; } }
/* A link to share: on phones the address takes the full row, the buttons sit under it. */
@media (max-width: 560px) { .sharerow > .input { flex: 1 1 100%; } }
/* iPhone Safari: a select ignores min-height, and a date field grows past its container unless its native look is off. */
.select { height: 52px; }
.rowitem .select { height: 48px; }
.cloze .select { height: 44px; }
input[type="date"].input, input[type="time"].input { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 52px; line-height: 48px; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; }
/* Hints about keys are for keyboards; hints about taps are for touch screens. */
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) { .keys-only { display: none; } .touch-only { display: inline; } }
/* Phones read the question a size smaller, still scaled by the learner's text-size choice. */
@media (max-width: 720px) { .qprompt { font-size: calc(17px * var(--q-scale)); } }
/* A blank leaves room on its line for the full stop or comma that follows it. */
.cloze .select { max-width: calc(100% - 24px); }
/* Phones: the email field gets the whole row, with its button underneath, so an address is never clipped. */
@media (max-width: 520px) {
  .oneline--stack { flex-direction: column; border-radius: var(--radius-xl); }
  .oneline--stack input { width: 100%; flex: none; padding: 0 20px; }
  .oneline--stack button { border-left: 0; border-top: var(--border-outline) solid var(--ink); min-height: 54px; width: 100%; }
}
/* Buy buttons span the card on phones. */
@media (max-width: 560px) { .btn--block-sm { width: 100%; } }
/* A short table that should fit a phone instead of scrolling sideways. */
.table--fit { min-width: 0; }
.table--fit th { white-space: normal; }
@media (max-width: 520px) { .table--fit th, .table--fit td { padding: 10px 12px; } }
/* Narrow phones (375px and under): the signed-in top bar keeps the logo, night switch, streak and avatar on one row. */
@media (max-width: 390px) {
  body.app .wordmark { font-size: 21px; gap: 6px; }
  body.app .top__row { column-gap: 8px; }
  body.app .top__end { gap: 6px; flex-wrap: nowrap; }
}
/* Where an answer comes from: the official page behind the explanation. */
.source { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border: var(--border-rule) dashed var(--ink); border-radius: var(--radius-md); background: var(--paper); font-size: 15px; }
.source__tag { flex: none; font: 800 13px var(--font-body); padding: 3px 10px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); background: var(--lemon); color: #17131f; }
.source__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.source__list a { font-weight: 700; overflow-wrap: anywhere; }
.source__site { display: block; font-size: 13px; color: var(--ink-muted); }
.explain__why { font: 800 17px var(--font-display); margin: 14px 0 0; }
.reveal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; font-size: 15px; color: var(--ink-muted); }
/* ── Admin: question studio ───────────────────────────────────────────── */
.studio { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-8); align-items: start; }
@media (max-width: 1100px) { .studio { grid-template-columns: minmax(0, 1fr); } }
.textarea.code, .codeblock { font: 13.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.textarea.code { padding: 14px; min-height: 220px; white-space: pre; overflow: auto; resize: vertical; }
.codeblock { margin: 8px 0 0; padding: 14px; background: var(--lilac); border: var(--border-rule) solid var(--line); border-radius: var(--radius-md); overflow-x: auto; white-space: pre; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { padding: 10px 14px; border: var(--border-rule) solid var(--line); border-radius: var(--radius-md); background: var(--paper); font-size: 15px; }
.checklist li.is-bad { border: var(--border-outline) solid var(--ink); background: var(--lemon-wash); }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px 20px; }
.picks .check { font-size: 15px; }
.admin .field > label { display: flex; flex-direction: column; gap: 6px; }
.admin .field input[type="file"] { padding: 12px 14px; height: auto; }
/* A case study's scenario: a panel above the question that folds away. */
.scenario { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--lilac); }
.scenario > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.scenario > summary::-webkit-details-marker { display: none; }
.scenario__tag { font: 800 13px var(--font-body); padding: 3px 10px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); background: var(--lemon); color: #17131f; }
.scenario__hint { margin-left: auto; font-size: 14px; color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; }
.scenario[open] .scenario__hint::after { content: ": hide"; }
.scenario:not([open]) .scenario__hint::after { content: ": show"; }
.scenario__body { padding: 4px 16px 16px; max-height: 46vh; overflow-y: auto; font-size: 16px; border-top: var(--border-rule) dashed var(--ink); }
@media (max-width: 720px) { .scenario__body { max-height: 38vh; font-size: 15.5px; } }
/* Sample test: a row of five marks, right or wrong. */
.hero .tiles, .section .tiles { grid-auto-flow: column; grid-auto-columns: 28px; }
.tiles__t--miss { background: var(--lemon); border-style: solid; }
/* Coverage: the bank's share of an exam as a bar, with a mark at the outline's share. */
.cover { position: relative; height: 12px; min-width: 160px; border: var(--border-rule) solid var(--ink); border-radius: var(--radius-pill); background: var(--paper); overflow: visible; }
.cover__fill { height: 100%; border-radius: var(--radius-pill); background: var(--violet); }
/* Low coverage is hatched ink, not flame (flame is the streak's only); the figure beside it says how low. */
.cover__fill--low { background: repeating-linear-gradient(135deg, var(--ink) 0 3px, var(--paper) 3px 6px); }
.cover__mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--ink); border-radius: 2px; }

/* The owner's one-line notice above the header. */
.notice { background: var(--lemon); color: var(--ink); border-bottom: var(--border-outline) solid var(--ink); font-weight: 500; }
.notice[hidden] { display: none; }
.notice__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.notice p { margin: 0; font-size: 15px; }
.notice a { color: var(--ink); font-weight: 700; }
.notice__close { background: none; border: 0; padding: 6px 4px; min-height: 32px; font: inherit; font-size: 14px; text-decoration: underline; color: var(--ink); cursor: pointer; flex: none; }
@media print { .notice { display: none !important; } }

/* The revision sheet: one fact per line, each with its source. */
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.facts > li { padding: 14px 18px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); background: var(--paper); line-height: 1.55; max-width: 78ch; }
.facts > li.facts__missed { border-style: dashed; }
.facts .source { margin-top: 8px; }
.facts__ask { margin: 0 0 6px; font-size: 14px; color: var(--ink-muted); }
.facts__fold > summary { cursor: pointer; font-weight: 500; }
.facts__back { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
@media print { .facts > li { border-width: 1px; break-inside: avoid; padding: 8px 12px; } }

/* Small utilities, so that one-property tweaks use a named class and a token rather than an inline style.
   They replace inline styles, so they keep an inline style's weight. */
.u-nowrap { white-space: nowrap !important; }
.u-wrap { overflow-wrap: anywhere !important; }
.u-pre { white-space: pre-wrap; overflow-wrap: anywhere !important; }
.u-self-start { align-self: flex-start !important; }
.u-items-center { align-items: center !important; }
.u-min-0 { min-width: 0 !important; }
.u-right { text-align: right !important; }
.u-mt-1 { margin-top: 6px !important; }
.u-mt-2 { margin-top: var(--space-2, 8px) !important; }
.u-mt-3 { margin-top: var(--space-3, 12px) !important; }
.u-medium { font-weight: 500 !important; }
.u-regular { font-weight: 400 !important; }
.u-m-0 { margin: 0 !important; }
.u-measure { max-width: 70ch !important; }
.u-narrow { max-width: 640px !important; }
/* A table cell holding prose or an id: wraps anywhere instead of widening the table. */
.u-cell-text { max-width: 440px !important; overflow-wrap: anywhere !important; }
/* The utilities above set margin: 0; a top margin given with it still wins. */
.u-m-0.u-mt-1 { margin-top: 6px !important; }
.u-m-0.u-mt-2 { margin-top: var(--space-2, 8px) !important; }
.u-m-0.u-mt-3 { margin-top: var(--space-3, 12px) !important; }
/* "On this page" contents: a row of chips above a long page, one gap above the content. */
.toc { margin-bottom: var(--space-6); }
/* A section a contents link or another page jumps to (e.g. /account#your-reports). The learner
   header is not sticky at any width, so this is only breathing room above the heading. */
.anchor { scroll-margin-top: var(--space-4); }
/* A message scrolled to after a save: lands clear of the phone tab bar (66 px tall). */
.anchor--end { scroll-margin-bottom: 96px; }
/* A field that takes the free width of a .row beside a button, down to 160 px. */
.field--grow { flex: 1 1 160px; }
/* A whole card that is a link: no underline on its text. */
.card--link { text-decoration: none; }
/* A list without bullets or indents (layout comes from .stack etc.). */
.list-plain { list-style: none; margin: 0; padding: 0; }
/* A bulleted list inside a card: no outer margin, a small indent. */
.list-bullets { margin: 0; padding-left: 20px; }
/* One entry of a stacked record list, a thin rule under each. */
.ruled { border-bottom: var(--border-rule) solid var(--line); padding-bottom: var(--space-3); }
/* A fieldset used only to group radios: no frame of its own. */
.fieldset-plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset-plain > legend { padding: 0; margin-bottom: 6px; }

/* Confirmation fold (ui::confirm): a money, account or destructive action in two steps.
   The opener is a button or a link; opening shows what will happen and the "Yes". */
.confirm { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); min-width: 0; }
/* Closed, the dialog is only its button. Chrome still lays out the hidden content slot as a flex item,
   so the gap above would add 8 px under every "Delete…" and "Refund…" button and knock it off the row. */
.confirm:not([open]) { gap: 0; }
.confirm > summary { list-style: none; width: max-content; max-width: 100%; cursor: pointer; }
.confirm > summary::-webkit-details-marker { display: none; }
.confirm[open] > summary.btn:not(.btn--primary) { background: var(--lemon); }
.confirm__box { display: flex; flex-direction: column; gap: var(--space-2); max-width: 64ch; padding: var(--space-3) 14px; background: var(--lemon); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-xl); }
.confirm__box > p { margin: 0; }
/* Inside a row of actions an open fold takes its own line, so the box is never squeezed. */
.row > .confirm[open] { flex-basis: 100%; }

/* ── Rich question kinds (2026-11-13): hot areas, drag tiles, the neutral console ── */
.hotspot { position: relative; display: block; width: fit-content; max-width: 100%; align-self: flex-start; margin: 0; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); overflow: hidden; background: var(--paper); }
.hotspot img { display: block; width: 100%; max-width: 100%; height: auto; }
.hotspot__layer { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: manipulation; }
.hotspot__area { fill: transparent; stroke: transparent; stroke-width: 0.006; }
.hotspot__area.is-picked { fill: rgba(91, 46, 255, 0.18); stroke: var(--violet); }
.hotspot__area.is-right { fill: rgba(184, 242, 208, 0.45); stroke: #17131f; stroke-dasharray: none; }
.hotspot__area.is-wrong { fill: rgba(255, 216, 74, 0.35); stroke: #17131f; stroke-dasharray: 0.012 0.008; }
.hotspot__mark { fill: var(--violet); stroke: var(--paper); stroke-width: 0.004; }
.dnd { display: grid; gap: 14px; }
.dnd__pool { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border: var(--border-outline) dashed var(--line); border-radius: var(--radius-md); min-height: 56px; }
.dnd__tile { padding: 8px 12px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); background: var(--paper); font-weight: 500; cursor: grab; touch-action: none; user-select: none; text-align: left; }
.dnd__tile.is-held { background: var(--lemon); color: #17131f; box-shadow: var(--shadow-sm); }
.dnd__tile.is-dragging { opacity: 0.4; }
.dnd__ghost { position: fixed; z-index: 70; pointer-events: none; background: var(--lemon); color: #17131f; box-shadow: var(--shadow-sm); }
.dnd__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.dnd__slot { min-height: 48px; padding: 8px 12px; border: var(--border-outline) dashed var(--ink); border-radius: var(--radius-md); background: var(--paper); text-align: left; color: var(--ink-muted); }
.dnd__slot.is-filled { border-style: solid; color: var(--ink); font-weight: 500; }
.dnd__slot.is-target { background: var(--lilac); }
.dnd__slot.rowitem--right { background: var(--mint); }
@media (max-width: 560px) { .dnd__row { grid-template-columns: 1fr; } }
.console { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); overflow: hidden; background: var(--paper); }
.console__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: #17131f; color: #ffffff; font-weight: 700; }
.console__body { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); }
.console__nav { border-right: var(--border-outline) solid var(--ink); display: flex; flex-direction: column; }
.console__res { padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: var(--ink); }
.console__res.is-on { background: var(--lilac); font-weight: 700; }
.console__res small { display: block; color: var(--ink-muted); font-weight: 400; }
.console__main { padding: 14px; display: grid; gap: 12px; align-content: start; }
.console__log { font-size: 13px; color: var(--ink-muted); }
@media (max-width: 640px) { .console__body { grid-template-columns: 1fr; } .console__nav { border-right: 0; border-bottom: var(--border-outline) solid var(--ink); flex-direction: row; overflow-x: auto; } .console__res { border-bottom: 0; border-right: 1px solid var(--line); white-space: nowrap; } }
html.night :is(.hotspot, .dnd__tile, .dnd__slot, .console) { background: #1b1726; }
/* A task in the portal clone: the clone keeps its own size (1430x757) and is scaled to fit. */
.portalsim { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); overflow: hidden; background: #ffffff; }
.portalsim__view { position: relative; overflow: hidden; }
.portalsim__frame { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #ffffff; }
.portalsim__frame.is-locked { pointer-events: none; }
.portalsim__tools { display: inline-flex; gap: 8px; }
.portalsim.is-full { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; border: 0; border-radius: 0; }
.portalsim.is-full .portalsim__view { flex: 1; }
tr.is-right td { background: var(--mint); }

/* ── UX review fixes (2026-11-13) ─────────────────────────────────────────── */

/* The question's instruction and its domain and difficulty, on one quiet line. */
.qmeta { margin: 0; line-height: 1.4; }
.qmeta .qhint { color: var(--ink); }
.qmeta__tags { font-size: 13px; font-weight: 600; color: var(--ink-muted); white-space: nowrap; }

/* After Check: the verdict sits in the action bar, where the learner is looking. */
.verdict-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); font-weight: 800; color: var(--ink); text-decoration: none; white-space: nowrap; }
.verdict-pill--ok { background: var(--mint); color: var(--on-mint); }
.verdict-pill--partly { background: var(--lemon); color: #17131f; }
.verdict-pill--miss { background: var(--paper); border-style: dashed; }
.verdict-pill__why { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.verdict__mark--partly { background: var(--lemon); color: #17131f; }
/* On a phone the verdict shrinks to fit beside the button: the label truncates, "See why" goes. */
@media (max-width: 720px) {
  .verdict-pill { flex: 0 1 auto; min-width: 0; overflow: hidden; }
  .verdict-pill > span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
  .verdict-pill__why { display: none; }
  .actions .verdict-pill + .actions__hint + .btn--primary, .actions .btn--primary { flex: 1 0 auto; }
}

/* Partly right in the question grid and its legend. */
.qgrid a.is-partly { background: var(--lemon); color: #17131f; border: var(--border-outline) solid var(--ink); }
.legend .l-partly { background: var(--lemon); border: var(--border-outline) solid var(--ink); }
.legend .l-blank { background: var(--paper); border: var(--border-outline) solid var(--ink); }
.legend--inline { display: flex; flex-wrap: wrap; gap: 8px 16px; }

/* A wrong pick says so in words, not only with a dashed edge. */
.answer--wrong .answer__tag { text-decoration: underline wavy; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Yes/no matrix: the whole cell is the touch target; the user's pick reads clearly. */
.matrix__cell { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 48px; min-height: 48px; cursor: pointer; }
.matrix__col { display: none; font-weight: 700; }
.matrix input:disabled { opacity: 1; }
.matrix td.is-wrong { background: var(--lemon-wash); outline: var(--border-outline) dashed var(--ink); outline-offset: -4px; }
.matrix__q { font-weight: 400; }
@media (max-width: 720px) {
  /* Each statement becomes a full-width block with labelled Yes and No buttons under it. */
  .tablebox--matrix { border: 0; background: none; overflow: visible; }
  .tablebox--matrix .matrix, .tablebox--matrix .matrix tbody { display: block; }
  .tablebox--matrix .matrix thead { display: none; }
  .tablebox--matrix .matrix tr { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 8px; padding: 14px; margin-bottom: 12px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); }
  .tablebox--matrix .matrix tr > th { grid-column: 1 / -1; padding: 0 0 4px; border: 0; }
  .tablebox--matrix .matrix tr > td { padding: 0; border: 0; text-align: center; border-radius: var(--radius-md, 12px); }
  .tablebox--matrix .matrix__cell { display: flex; width: 100%; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md, 12px); }
  .tablebox--matrix .matrix__col { display: inline; }
  .tablebox--matrix td.is-right .matrix__cell, .tablebox--matrix td.is-wrong .matrix__cell { border-width: 3px; }
}

/* Hotspot: the result's picture keeps the labels under it readable, with a legend. */
.hotspot__area.is-right { fill: rgba(184, 242, 208, 0.18); stroke: #17131f; stroke-width: 0.008; }
.hotspot__area.is-wrong { fill: rgba(255, 216, 74, 0.18); stroke-width: 0.008; }
.hotspot__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; }
.hotspot__legend span { display: inline-flex; align-items: center; gap: 8px; }
.hotspot__legend i { width: 22px; height: 14px; border: 2px solid var(--ink); border-radius: 3px; }
.hotspot__legend .hl-right { background: var(--mint); }
.hotspot__legend .hl-wrong { border-style: dashed; background: var(--lemon-wash); }

/* The tips: smaller on a phone, so the question still starts on the first screen. */
@media (max-width: 720px) {
  .coach { font-size: 14px; }
  .coach__list { gap: 4px; }
}

/* The finish screen's two buttons always fit side by side on a phone. */
@media (max-width: 720px) {
  .exam__main .actions > .btn--quiet { flex: 0 0 auto; }
  .exam__main .actions .btn { white-space: nowrap; }
}

/* Results history: one card per attempt, the score and its action always in view. */
.attempts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.attempt { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); color: var(--ink); text-decoration: none; }
.attempt .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attempt__score { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.attempt__go { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { a.attempt:hover { box-shadow: var(--shadow-sm); } }

/* Navigation: four sections; a section's pages as a second row; a tab bar on phones. */
.subnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav .pill { white-space: nowrap; }
/* "More this way": a small "›" at the row's right edge while it overflows to the right (app.js
   sets .is-scrollable). It sits outside the scroller, so the edge fade doesn't wash it out. */
.subnav-box { position: relative; }
.subnav__more { display: none; position: absolute; top: 0; bottom: 12px; right: 6px; align-items: center; font-size: 22px; font-weight: 800; line-height: 1; color: var(--ink); pointer-events: none; }
.subnav.is-scrollable + .subnav__more { display: flex; }
/* The strip scrolls sideways on a phone: its edge fades so the cut-off pill reads as "more this way".
   The fade is wide (72px) so it reaches past the cut word into the gap before it: a narrow one only
   greyed the stub ("We") and looked like a clipped label. Every browser gets the static right-edge
   fade; where scroll-driven animations exist it follows the scroll instead: none at the start on
   the left, none at the end on the right. */
@property --subnav-l { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --subnav-r { syntax: "<length>"; inherits: false; initial-value: 72px; }
@keyframes subnav-fade { from { --subnav-l: 0px; --subnav-r: 72px; } 4% { --subnav-l: 72px; } 96% { --subnav-r: 72px; } to { --subnav-l: 72px; --subnav-r: 0px; } }
@media (max-width: 720px) {
  .subnav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent); }
  @supports (animation-timeline: scroll()) {
    .subnav {
      -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--subnav-l), #000 calc(100% - var(--subnav-r)), transparent);
      mask-image: linear-gradient(to right, transparent, #000 var(--subnav-l), #000 calc(100% - var(--subnav-r)), transparent);
      animation: subnav-fade linear both; animation-timeline: scroll(self inline);
    }
  }
}
.pill--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.tabbar { display: none; }
.footer__more .linkbtn { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
@media (max-width: 720px) {
  body.app { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  body.app .top__nav { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--paper); border-top: var(--border-outline) solid var(--ink); padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px)); }
  .tabbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 14px; color: var(--ink-muted); font-size: 12px; font-weight: 700; text-decoration: none; }
  .tabbar__item .icon { width: 22px; height: 22px; }
  .tabbar__item.is-on { color: var(--ink); background: var(--lilac); }
}
@media print { .tabbar, .subnav { display: none !important; } }


/* Practice: the rest of the modes fold away under one heading. */
.more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "Show"; font: 700 14px/1 var(--font-body, inherit); text-decoration: underline; text-underline-offset: 3px; }
.more[open] > summary::after { content: "Hide"; }

/* Revision sheet: one domain at a time. */
.facts__group { border-top: var(--border-rule) solid var(--line); padding-top: 12px; }
.facts__group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.facts__group > summary::-webkit-details-marker { display: none; }
.facts__group > summary::after { content: "Show"; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.facts__group[open] > summary::after { content: "Hide"; }
.facts__group > summary h2 { margin: 0; }

/* A chip holding a sentence wraps instead of running off a phone screen. */
.chip--wrap { white-space: normal; height: auto; min-height: 32px; padding-block: 4px; max-width: 100%; }

/* Tables on a phone: each row becomes a card, each value labelled with its column. */
@media (max-width: 720px) {
  .tablebox--stack { border: 0; background: none; overflow: visible; }
  .table--stack, .table--stack tbody { display: block; min-width: 0; width: 100%; }
  .table--stack thead { display: none; }
  .table--stack tr { display: grid; gap: 6px; padding: 12px 14px; margin-bottom: 10px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); }
  .table--stack td { display: block; padding: 0; border: 0; text-align: left; }
  .table--stack td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 13px; font-weight: 700; color: var(--ink-muted); }
  .table--stack td, .table--stack td.num { text-align: left !important; }
}

/* Tables inside a question keep whole words; a wide one scrolls sideways in its own box. */
.rich th, .rich td { min-width: 7em; word-break: normal; overflow-wrap: normal; hyphens: manual; }

/* On a phone an answer's verdict label goes on its own line under the answer, so the
   answer text keeps the full width. */
@media (max-width: 720px) {
  .answer:has(.answer__tag) { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "key body" ". tag"; column-gap: 10px; row-gap: 4px; align-items: center; }
  .answer:has(.answer__tag) > .answer__key { grid-area: key; }
  .answer:has(.answer__tag) > .answer__body { grid-area: body; }
  .answer:has(.answer__tag) > .answer__tag { grid-area: tag; margin-left: 0; white-space: normal; }
}

/* Without JavaScript the learner app never loads: hide its "Loading…" line (the noscript note says why). */
@media (scripting: none) { .app-loading { display: none; } }

/* CountUp: the counting number on screen, the real one for print and screen readers. */
.countup__final { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media print { .countup { display: none; } .countup__final { position: static; width: auto; height: auto; overflow: visible; clip-path: none; } }

/* ── The pass, offered inside the app and on the pricing page ─────────── */
.offer { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; justify-content: space-between; }
.offer > .grow { flex: 1 1 320px; }
.offer__buy { flex: 0 1 260px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.offer__price { display: flex; align-items: flex-end; gap: 10px; }
.offer__price strong { font: 800 48px/0.95 var(--font-display); letter-spacing: -0.03em; }
.offer__price span { padding-bottom: 4px; white-space: nowrap; }
.offer a:not(.btn) { color: inherit; }
@media (max-width: 560px) { .offer__buy { flex-basis: 100%; } }
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-4); }
.proof__item { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); }
.proof__item strong { font: 800 30px/1 var(--font-display); letter-spacing: -0.02em; }
.codefold > summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.codefold[open] > summary { margin-bottom: 10px; }

/* ── Home, third pass (2026-11-14): one grid, one card style, nothing tilted ──
   Every section sits on the same twelve columns, so gutters line up from row to row;
   every card has the same padding, so text starts on the same line down the page. */
.dash { --dash-pad: 28px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-6); align-items: stretch; }
.dash > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 960px) {
  .dash > .dash__main { grid-column: span 7; }
  .dash > .dash__side { grid-column: span 5; }
}
.dash .panel { padding: var(--dash-pad); }
.dash .panel--hero { box-shadow: var(--shadow-md); }
.dash .offer .t-heading { font-size: 26px; }
.dash__head { display: flex; flex-direction: column; gap: 4px; }
.dash__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; font-size: 15px; font-weight: 700; color: var(--ink-muted); }
.dash__switch, .dash__more { display: inline-flex; align-items: center; min-height: 32px; font-size: 15px; white-space: nowrap; }
.dash__title { font: 800 clamp(26px, 3.4vw, 40px)/1.1 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.dash__cardhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; min-height: 36px; }
.dash__h { font: 800 22px/1.2 var(--font-display); letter-spacing: -0.01em; }
.dash__h--lg { font-size: 26px; }
.dash__kicker { font-size: 15px; font-weight: 700; line-height: 1.3; }
.dash__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; padding-top: 14px; border-top: var(--border-rule) solid var(--line); font-size: 15px; }
.dash [id] { scroll-margin-top: 16px; }

/* The numbers at a glance: one outlined strip, four equal cells. */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-2xl); overflow: hidden; }
.kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 18px var(--dash-pad); border-left: var(--border-rule) solid var(--line); color: var(--ink); font-weight: 400; text-decoration: none; }
.kpi:first-child { border-left: 0; }
.kpi__label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.kpi__value { display: flex; align-items: center; gap: 8px; font: 800 30px/1.15 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi__note { font-size: 13px; line-height: 1.35; color: var(--ink-muted); }
.kpi__note:empty { display: none; }
a.kpi .kpi__note { text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { a.kpi:hover { background: var(--lilac); color: var(--ink); } }
a.kpi:focus-visible { outline-offset: -3px; border-radius: 0; }
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: var(--border-rule) solid var(--line); }
}

/* The week beside the next action: this week's tiles, today's count, then the long view. */
.dash .tile--today.tile--done { transform: none; animation: none; box-shadow: var(--shadow-sm); outline: 2px solid var(--violet); outline-offset: 2px; }
.weekcard__hist { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 14px; border-top: var(--border-rule) solid var(--line); }
.weekcard .heat__d { aspect-ratio: 1.3; background: var(--paper); }
.weekcard .heat__d--on { background: var(--flame); }
.weekcard .heat__d--frozen { background: var(--lilac); }

/* Readiness: each column is a label and value, a mark of one height, and a note; the
   rows are shared (subgrid), so marks and notes line up across the columns. */
.ready { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-6) var(--space-8); }
.ready__item { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 8px; min-width: 0; }
.ready__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ready__head h3 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.ready__value { font: 800 24px/1 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ready .bar, .ready .tiles__t { height: 28px; }
.ready .scores { font: 700 15px/1 var(--font-body); }
.ready .scores > div { height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.ready__note { font-size: 14px; line-height: 1.45; color: var(--ink-muted); }
.dash .ready__note, .dash .day__label { font-size: 13px; }

/* A list of measures: name, bar, percent and action in fixed columns, so the bars start
   and end together and the percents and buttons sit in straight lines. */
.meters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.meter { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 3.2em auto; gap: 6px 16px; align-items: center; padding: 12px 0; border-top: var(--border-rule) solid var(--line); }
.meter:first-child { border-top: 0; padding-top: 0; }
.meter:last-child { padding-bottom: 0; }
.meter__name { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 17px; line-height: 1.3; }
.meter__pct { text-align: right; font-variant-numeric: tabular-nums; }
.meter .bar { height: 16px; }
.meter .btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.meters--stack .meter { grid-template-columns: minmax(0, 1fr) auto; }
.meters--stack .meter .bar { grid-column: 1 / -1; grid-row: 2; }
@media (max-width: 640px) {
  .meter { grid-template-columns: minmax(0, 1fr) auto auto; }
  .meter .bar, .meter__none { grid-column: 1 / -1; grid-row: 2; }
}

/* Mock trend: the chart, three figures, and what the two lines mean. */
.mockcard .spark { margin-block: auto; }
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding-top: 14px; border-top: var(--border-rule) solid var(--line); }
.minis > div { display: flex; flex-direction: column; gap: 2px; }
.minis dt { font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.minis dd { margin: 0; font: 800 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.keyline { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; color: var(--ink-muted); }
.keyline li { display: inline-flex; align-items: center; gap: 8px; }
.keyline i { width: 22px; border-top: 2px dashed var(--violet); }
.keyline .keyline__pass { border-top: 2px dotted var(--unseen); }
/* Day mode: the 70% pass line and its key, a third of the way from the unseen grey to muted ink
   (4.9:1 on paper; the plain grey is 3.6:1). Night keeps the grey, already light enough on its dark panel. */
html:not(.night) :is(.spark__pass, .keyline .keyline__pass) { --pass-line: color-mix(in srgb, var(--unseen), var(--ink-muted) 35%); stroke: var(--pass-line); border-top-color: var(--pass-line); }

/* Badges: a straight grid. Earned is filled, not yet is dashed. */
.dash .badges { grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); }
.dash .badge.is-earned, .dash .badge.is-earned:nth-child(even) { background: var(--mint); transform: none; box-shadow: none; }

@media (max-width: 560px) {
  .dash { --dash-pad: 20px; gap: var(--space-4); }
  .kpi { padding-block: 14px; }
  .kpi__value { font-size: 24px; }
  .dash__h--lg { font-size: 22px; }
  .dash .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) { .dash { --dash-pad: 16px; } .kpi__value { font-size: 21px; } }

/* ── Exam Focus (2026-11-20): Home with a target exam ────────────────────────
   The same twelve-column `.dash` and cards as Home. The verdict leads; what's missing sits
   beside today's list; the guarantee card counts its 14 days in tiles. On a phone it is one
   column, the most time-critical card first (spec 6.2). */
.focus__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.focus__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; max-width: 100%; }
.focus__controls form { min-width: 0; max-width: 100%; }
.focus__controls .select { height: 44px; min-height: 44px; width: auto; max-width: 100%; padding: 0 12px; font-size: 15px; }
.focus__controls .linkbtn { font-size: 15px; min-height: 32px; }
.focus__verdict { margin-top: 4px; }
.focus__date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.focus__date label { font-size: 19px; color: var(--ink-soft); }
.focus__date input[type="date"].input { width: auto; flex: 0 1 200px; height: 44px; line-height: 40px; }
.focus__start { margin-top: 8px; }
.dash__eyebrow form { display: inline-flex; }

/* What's missing: the meter grid, with what each row needs on a line of its own under it. */
.missing .meter__name strong { font-weight: 700; }
.missing__do { grid-column: 1 / -1; color: var(--ink-soft); max-width: 68ch; }
.missing__all { align-self: flex-start; }

/* The guarantee's countdown: 14 day tiles, filled for each day still in force. */
.countdown .tiles { gap: 4px; }
.countdown .tiles__t { height: 24px; border-radius: 6px; }
.guarcard > p { max-width: 68ch; }

/* The skill map: one fold per domain; each row as on what's missing, with its status chip. */
.skillmap__domain { border-top: var(--border-rule) solid var(--line); padding-top: 14px; }
.skillmap__domain > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 44px; cursor: pointer; list-style: none; }
.skillmap__domain > summary::-webkit-details-marker { display: none; }
.skillmap__domain > summary::before { content: ""; flex: none; width: 10px; height: 10px; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(-45deg); transition: transform 0.15s; }
.skillmap__domain[open] > summary::before { transform: rotate(45deg); }
.skillmap__domain[open] > summary { margin-bottom: 12px; }
.skillmap__title { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 17px; }
.skillmap .meter .chip { justify-self: end; font-size: 13px; padding: 4px 10px; }
.skillmap__more { align-self: flex-start; }
/* The study plan's review list: one block per module, most marks at stake first. */
.studyrev__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.studyrev__group { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: var(--border-rule) solid var(--line); min-width: 0; }
.studyrev__group:first-child { border-top: 0; padding-top: 0; }
.studyrev__head { display: flex; gap: 14px; align-items: flex-start; }
.studyrev__n { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: var(--border-outline) solid var(--ink); border-radius: 50%; font: 800 17px var(--font-display); }
.studyrev__title { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
@media print { .studyrev__group { break-inside: avoid; } }
@media (hover: hover) { .skillmap__domain > summary:hover .skillmap__title { color: var(--violet-deep); } }

/* How readiness works: folded by default. */
.focus__how > summary { display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none; }
.focus__how > summary::-webkit-details-marker { display: none; }
.focus__how > summary::before { content: ""; flex: none; width: 10px; height: 10px; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(-45deg); transition: transform 0.15s; }
.focus__how[open] > summary::before { transform: rotate(45deg); }
.focus__how[open] > summary { margin-bottom: 16px; }
.focus__rules { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; max-width: 68ch; }

/* The trend's key: each kind of set by its mark's shape. */
.keyline__mark { width: 14px; height: 14px; overflow: visible; }
.keyline .keyline__mark .spark__dot { stroke-width: 2; }

@media (max-width: 720px) {
  /* One column, in the phone order of spec 6.2; flashes and the check-in stay on top. */
  .focus__head { order: 1; }
  .focus__guar--urgent { order: 2; }
  .focus__missing { order: 3; }
  .focus__next { order: 4; }
  .focus__kpis { order: 5; }
  .focus__guar { order: 6; }
  .focus__guar.focus__guar--urgent { order: 2; }
  .focus__trend { order: 7; }
  .focus__recent { order: 8; }
  .focus__map { order: 9; }
  .focus__how { order: 10; }
  .focus__controls, .focus__controls form:first-child, .focus__controls .select { width: 100%; }
  .focus__date input[type="date"].input { flex: 1 1 100%; width: 100%; }
  .focus__date .btn, .focus__start > *, .focus__start .btn, .guarcard .btn, .missing__all { width: 100%; }
  .focus__start > form { flex: 1 1 100%; }
  .missing__all { align-self: stretch; }
}

/* The way into the back office, for the people who have one. */
.chip--admin { min-height: 40px; }

/* Admin overview: cells stretch to fill their last row, so no grid ends in a blank corner. */
.stats--fill { display: flex; flex-wrap: wrap; }
.stats--fill > div { flex: 1 1 220px; }
.queues { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.queues .card { padding: 20px; }

/* Reduced motion: the few transitions that sit outside the no-preference blocks. */
@media (prefers-reduced-motion: reduce) {
  .exambar__fill, .answer, .pick span, .review--fold > summary::before { transition: none; }
}
/* Small-text toggles stay easy to tap: 24px at least, more on touch screens (WCAG 2.5.8). */
:is(.exam__q, .review) details > summary, summary.t-small, details.t-small > summary { min-height: 24px; padding-block: 2px; cursor: pointer; }
@media (pointer: coarse) { :is(.exam__q, .review) details > summary, summary.t-small, details.t-small > summary { padding-block: 10px; } }
/* Focus not hidden (WCAG 2.4.11): a control reached with Tab scrolls clear of the sticky exam
   bar and of the bars fixed to the bottom of a phone screen. */
html:has(.exambar) { scroll-padding-top: 72px; }
@media (max-width: 720px) {
  html:has(.exam__q .actions) { scroll-padding-bottom: 96px; }
  html:has(.tabbar) { scroll-padding-bottom: 88px; }
}
/* A panel laid out as a wrapping row: its growing text block keeps a readable width and the
   actions wrap under it on a phone, instead of the text squeezing to a word per line. */
.panel.row > .grow { flex-basis: 260px; }
/* ── Public header on phones ──────────────────────────────────────────────
   720px and under: one row with the wordmark, the one main action and a "Menu" (a <details>,
   no script) that drops the links down over the page. Wider screens keep the inline links and
   never show the menu. Scoped to .top--public so the learner app's header is untouched. */
.top__menu { display: none; }
@media (max-width: 720px) {
  .top--public { position: relative; z-index: 20; }
  .top--public .top__row { flex-wrap: nowrap; gap: 8px; padding-block: 10px; }
  .top--public .top__nav, .top--public .top__signin { display: none; }
  .top--public .top__end { margin-left: auto; flex-wrap: nowrap; }
  .top--public .top__end .btn--sm { padding-inline: 14px; white-space: nowrap; }
  .top__menu { display: block; flex: none; }
  .top__toggle { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); font-weight: 700; cursor: pointer; white-space: nowrap; }
  .top__toggle::-webkit-details-marker { display: none; }
  .top__menu[open] .top__toggle { background: var(--lemon); }
  .top__menulist { position: absolute; left: 0; right: 0; top: 100%; margin-top: var(--border-outline); display: flex; flex-direction: column; gap: 2px; padding: 8px var(--space-4) 16px; background: var(--paper); border-bottom: var(--border-outline) solid var(--ink); }
  .top__menulist .pill { min-height: 48px; padding: 0 16px; }
  .top__menulist .pill[aria-current="page"] { background: var(--lilac); }
}
/* Phones up to 480px: the wordmark never shrinks under the main action, and "Menu" is its
   hamburger icon alone (the word stays as its accessible name), so the wordmark, "Start free" or
   "Dashboard" and the menu fit on one row down to 320px. Measured: Safari's text runs wider. */
.wordmark .logo { flex: none; }
.top--public .wordmark { flex: none; }
.top--public .top__end { min-width: 0; }
.top--signed-in .wordmark { margin-right: 4px; }
@media (max-width: 480px) {
  .top--public .top__toggle { min-width: 44px; padding: 0; justify-content: center; }
  .top--public .top__toggle .icon { display: inline-block; }
  .top--public .top__toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 390px) {
  .top--public .wordmark { font-size: 21px; gap: 6px; }
  .top--signed-in .wordmark { font-size: 20px; }
  .top--public .top__end .btn--sm { padding-inline: 12px; font-size: 15px; }
}
@media (max-width: 360px) {
  .top--public .top__row { gap: 6px; }
  .top--public .wordmark { font-size: 19px; }
  .top--signed-in .wordmark { margin-right: 2px; }
  .top--public .top__end .btn--sm { padding-inline: 10px; }
}
@media (max-width: 340px) { .top--public .wordmark { font-size: 18px; } }

/* Admin health: one line per area on the overview. The state is a word and a shape, not a colour alone. */
.health { list-style: none; margin: 0; padding: 0; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); overflow: hidden; }
.health__row { display: grid; grid-template-columns: 7.5em minmax(10em, 1.2fr) 5.5em minmax(0, 2fr) auto; align-items: center; gap: 4px 16px; padding: 10px 16px; border-bottom: var(--border-rule) solid var(--line); }
.health__row:last-child { border-bottom: 0; }
.health__row--problem { background: var(--lemon-wash); }
.health__state { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 2px 10px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); font-size: 14px; font-weight: 700; white-space: nowrap; }
.health__icon { font-weight: 800; width: 1em; text-align: center; }
.health__state--ok { background: var(--mint); }
.health__state--watch { background: var(--lemon); }
.health__state--problem { background: var(--ink); color: var(--paper); }
.health__state--open { border-style: dashed; }
.health__area { font-weight: 700; }
.health__n { font: 800 20px var(--font-display); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.health__note { overflow-wrap: anywhere; }
.health__go { justify-self: end; white-space: nowrap; font-weight: 700; min-height: 24px; display: inline-flex; align-items: center; }
html.night .health__state--ok { color: var(--on-mint); }
html.night .health__state--watch { color: #17131f; border-color: #17131f; }
@media (max-width: 720px) {
  .health__row { grid-template-columns: auto minmax(0, 1fr) auto; padding: 12px 14px; }
  .health__note { grid-column: 1 / 3; }
  .health__go { grid-column: 3; min-height: 44px; }
}

/* Admin users: on a phone the table keeps email and last seen; the name and plan ride under the email. */
@media (max-width: 720px) { .table--users td:first-child { width: 68%; overflow-wrap: anywhere; } }

/* A reason under an answer reads as plain text even when the answer is picked (bold). */
.answer__body .t-small { font-weight: 400; }

/* Rich kinds a11y: on a touch screen the ordering controls are full 44px targets. */
@media (pointer: coarse) { .order .iconbtn, .order__col--answer .order__item .iconbtn { width: 44px; height: 44px; } }

/* Cross-out target on touch: a full 44px button that takes its extra room from the answer's padding, so text wraps as before. */
@media (pointer: coarse) { .answer__out { width: 44px; height: 44px; margin-right: -8px; margin-block: -4px; } }

/* Flagged and answered: the lemon flag keeps its fill and gains an ink corner, so a flagged
   question already answered differs from one still open. Grid cells and the legend swatch. */
.qgrid a.is-flagged.is-given, .legend .l-flagged.l-given { position: relative; overflow: hidden; }
.qgrid a.is-flagged.is-given::after, .legend .l-flagged.l-given::after { content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 12px 12px 0; border-color: transparent var(--ink) transparent transparent; }
.legend .l-flagged.l-given::after { border-width: 0 7px 7px 0; }
html.night .qgrid a.is-flagged.is-given::after, html.night .legend .l-flagged.l-given::after { border-right-color: #17131f; }

/* Error pages: 404, 500 and the offline page, under the bare page's wordmark header. */
.bare { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.bare__body { flex: 1 0 auto; outline: none; }
.bare__body .center-page { min-height: auto; }
.bare__foot { padding-block: var(--space-6); }
.bare__foot p { max-width: 62ch; }
.errpage { display: flex; justify-content: center; padding-block: clamp(32px, 9vh, 96px); }
.errpage__card { width: 100%; max-width: 560px; }
/* Admin tables that stack on a phone: numbers two to a row under a full-width first cell. */
@media (max-width: 720px) {
  .table--pairs tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
  .table--pairs td:first-child { grid-column: 1 / -1; }
  .table--stack tr.is-on { background: var(--lemon-wash); }
  .table--stack tr.is-on td { background: none; }
}

/* Search: the matched words in a snippet. Lemon is a light island, so its ink stays dark at night. */
mark.hit { background: var(--lemon); color: #17131F; border-radius: var(--radius-sm); padding: 0 2px; }

/* Exam bar: the clock keeps one line, "Time hidden" included, so the bar never grows. */
.clock { white-space: nowrap; }
/* After Check the explanation scrolls in clear of the sticky exam bar (72 px, 56 px on a phone).
   The page already keeps 72 px clear (scroll-padding-top), and the scroll happens on the explanation's
   first frame, while its entrance (explain-in) still holds it about 12 px low: this margin makes up
   the difference, so it comes to rest 8 px under the bar on both widths, with or without motion. */
.explain { scroll-margin-top: 8px; }
@media (max-width: 720px) { .explain { scroll-margin-top: -8px; } }
@media (prefers-reduced-motion: no-preference) {
  .explain { scroll-margin-top: 20px; }
  @media (max-width: 720px) { .explain { scroll-margin-top: 8px; } }
}
/* Headings and regions the app moves focus to (tabindex -1) get a lighter ring than a control
   reached by Tab: same violet (4.5:1 and better day and night), thinner, a little further out. */
:where([tabindex="-1"]):focus-visible { outline-width: 2px; outline-offset: 4px; }
/* A small chip for a note beside quieter text ("You missed this on 16 Oct"): 13 px, regular weight. */
.chip--sm { font-size: 13px; font-weight: 400; gap: 4px; padding: 2px 10px; min-height: 24px; }
.chip--wrap.chip--sm { min-height: 24px; padding-block: 2px; }
/* "How others answered": a bar per lettered option, under the sentence that says it in words. */
.others__bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-width: 360px; }
.others__row { display: grid; grid-template-columns: 1.5em 1fr 3.2em; align-items: center; gap: 8px; font-size: 13px; }
.others__key { font-weight: 700; text-align: center; }
.others__pct { text-align: right; font-variant-numeric: tabular-nums; }
.others__track { height: 10px; background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); overflow: hidden; }
.others__fill { display: block; height: 100%; width: var(--share, 0%); background: var(--ink-muted); }
.others__row--right .others__fill { background: var(--violet); }
.others__row--right .others__key, .others__row--right .others__pct { font-weight: 800; }

/* iPhone Safari zooms into any field under 16 px; inside 15 px text (.t-small) a field would inherit 15. */
.input, .select, .textarea { font-size: max(16px, 1em); }
/* With the on-screen keyboard open, the fixed tab bar would ride up over the form: hide it while typing. */
@media (pointer: coarse) {
  body:has(:is(input:not([type=checkbox], [type=radio], [type=range], [type=button], [type=submit]), textarea, select):focus) .tabbar { display: none; }
}
/* Sources on a phone: the "Source" tag sits above the links, which get the full width. */
@media (max-width: 560px) {
  .source { flex-direction: column; gap: 8px; }
}
/* Offline page: "What still works" starts a new part, clear of the "Try again" button and its shadow. */
.errpage__card > .row + h2 { margin-top: var(--space-4); }

/* A text column that sits beside its button on wide screens and above it on phones. */
.grow-wrap { flex: 1 1 340px; min-width: 0; }

/* Admin overview folds: long tables and the areas that are fine stay shut until asked for. */
.fold > summary { gap: 12px; }
.fold > summary h2 { margin: 0; }
.fold[open] > summary { margin-bottom: var(--space-4); }
.fold--ok > summary { padding: 8px 16px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); min-height: 44px; }
.fold--ok[open] > summary { margin-bottom: var(--space-2); }

/* ── Design pass: results, practice, player ───────────────────────────── */
/* Practice menu cards: the button sits at the foot of each card, at its own width, so a row of cards lines up. */
.grid--actions > .card > :last-child { margin-top: auto; }
.grid--actions > .card > a.btn:last-child { align-self: flex-start; }
/* Answer map: "not answered" is dotted grey, "looked at" dashed ink: they differ in shape, not only colour. */
.qgrid a.is-unseen { border-style: dotted; }
.legend .l-unseen { border-style: dotted; }
/* One column wherever the legend is narrow (the exam sidebar, a phone); more where there's room. */
.legend { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); }
/* Ordering, after the answer is shown: an unanswered "Your order" stays its own size and plain. */
.order__col--answer.order__col--empty { align-self: start; min-height: 0; background: var(--paper); border-style: dashed; }

/* ── Night mode: late components ─────────────────────────────────────────── */
/* The light target dashes sit on violet bars: the night violet (#9b82ff) is only 2.6:1 against them,
   so bars take a deeper violet (4.0:1 against the dashes, 3.9:1 against the dark track); the ring's arc
   matches it (3.9:1 against its dark paper track). Light islands keep the day pair. */
html.night .bar__fill--violet:not(:is(.panel--lemon, .card--lemon) *) { background: #7a5cf0; }
html.night .ring__value:not(:is(.panel--lemon, .card--lemon) *) { stroke: #7a5cf0; }

/* ── Late polish: player bar, result guarantee card ───────────────────────── */
/* The verdict pill hides once the explanation is on screen but keeps its slot: "Next" stays put. */
.verdict-pill.is-away { visibility: hidden; }
/* Guarantee progress: beside the score on wide screens, after the hero on a phone. */
.result__guarantee--after { display: none; }
@media (max-width: 600px) {
  .result__guarantee--in { display: none; }
  .result__guarantee--after { display: block; }
  .result__guarantee--after > .card { min-width: 0 !important; }
}

/* ── Learner app, before its screen draws ─────────────────────────────────── */
/* An app page keeps at least a screen's height, so the footer starts below the fold and does not
   jump up and back down while the app loads (Lighthouse: CLS 0.115 on every app page, all of it
   the footer). 72px is the shortest app bar; a taller one only pushes the footer further down. */
main.page:has(> #app) { min-height: calc(100svh - 72px); }
/* While "Loading…" is all the app has drawn (the server's line, then the app's own), the page shows
   its shape: a heading and a card outline with two lines of text. Plain CSS, so the server's and
   the app's loading states look the same and nothing flickers when the app takes over. */
main.page > #app > [role="status"]:only-child::before { content: ""; display: block; width: min(60%, 320px); height: 40px; margin-bottom: var(--space-4); border-radius: var(--radius-md); background: var(--lilac); }
main.page > #app > [role="status"]:only-child::after {
  content: ""; display: block; height: 200px; margin-top: var(--space-8);
  border: var(--border-outline) solid var(--line); border-radius: var(--radius-xl);
  background: linear-gradient(var(--lilac), var(--lilac)) 28px 32px / min(50%, 260px) 22px no-repeat,
              linear-gradient(var(--lilac), var(--lilac)) 28px 72px / min(75%, 420px) 14px no-repeat;
}

/* The post-exam check-in at the top of Home (app/src/features/guarantee/CheckinCard.tsx): four
   one-tap answers, two to a row on a phone. It slides in once so it reads as a question, not
   as part of the page; reduced motion shows it still. */
.checkin__opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 10px; }
.checkin__opts .btn { width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .checkin { animation: checkin-in 0.4s ease-out both; }
  @keyframes checkin-in { from { opacity: 0; transform: translateY(10px); } }
}

/* Cookie consent (assets/consent.js): the question, the quiet notice, and the settings panel. Bottom of the
   screen, never covering the whole page. Every colour is a token, so night mode needs nothing extra. */
.consent { position: fixed; inset: auto 12px 12px 12px; z-index: 60; display: flex; justify-content: center; pointer-events: none; }
.consent__inner { pointer-events: auto; width: 100%; max-width: 720px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--paper); color: var(--ink); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 18px 20px; }
.consent__title { margin: 0 0 6px; font: 700 19px/1.25 var(--font-display); }
.consent__text { margin: 0 0 14px; font-size: 15px; color: var(--ink-soft); }
.consent__text a { color: var(--violet-deep); font-weight: 700; text-underline-offset: 3px; }
.consent__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.consent__actions .btn { min-width: 150px; }
/* The notice and the privacy-signal note do not block anything: one compact row, text first. */
.consent--ask .consent__inner, .consent--notice .consent__inner, .consent--gpc .consent__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; }
.consent--ask .consent__text, .consent--notice .consent__text, .consent--gpc .consent__text { flex: 1 1 320px; margin: 0; font-size: 14px; }
.consent--ask .consent__actions, .consent--notice .consent__actions, .consent--gpc .consent__actions { flex: 0 0 auto; }
.consent--ask .consent__actions .btn, .consent--notice .consent__actions .btn, .consent--gpc .consent__actions .btn { min-width: 96px; }
/* One notice, then a separate question about recordings. */
.consent--mixed .consent__inner { padding: 14px 18px; }
.consent--mixed .consent__text { font-size: 14px; }
.consent--mixed .consent__text--second { margin-top: 14px; padding-top: 14px; border-top: var(--border-rule) solid var(--line); }
.consent--mixed .consent__actions--second { margin-top: 0; }
/* The settings panel: one switch per tool, then the three buttons. */
.consent--panel .consent__inner { max-width: 560px; }
.consent--panel .consent__text { margin-bottom: 12px; }
.consent__switches { display: grid; gap: 0; margin: 0 0 14px; border-block: var(--border-rule) solid var(--line); }
.consent__switch { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 2px; align-items: center; padding: 12px 0; cursor: pointer; }
.consent__switch + .consent__switch { border-top: var(--border-rule) solid var(--line); }
.consent__switch-label { grid-column: 1; grid-row: 1; font-weight: 700; font-size: 15px; line-height: 1.3; }
.consent__switch-desc { grid-column: 1; grid-row: 2; font-size: 14px; line-height: 1.4; color: var(--ink-muted); }
.consent__switch input { grid-column: 2; grid-row: 1 / span 2; justify-self: end; appearance: none; -webkit-appearance: none; position: relative; width: 48px; height: 28px; margin: 0; flex: none; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); background: var(--paper); cursor: pointer; transition: background-color 0.15s; }
.consent__switch input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform 0.15s; }
.consent__switch input:checked { background: var(--violet); }
.consent__switch input:checked::before { transform: translateX(20px); background: var(--on-violet, #fff); }
.consent__switch input:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .consent__switch input, .consent__switch input::before { transition: none; } }
/* Locked under Global Privacy Control: both stay off and nothing looks clickable. */
.consent__switch:has(input:disabled) { cursor: not-allowed; }
.consent__switch input:disabled { cursor: not-allowed; opacity: 0.5; }
.consent__switch:has(input:disabled) .consent__switch-label, .consent__switch:has(input:disabled) .consent__switch-desc { color: var(--ink-muted); }
.consent__gpc { margin: 0 0 14px; padding: 10px 12px; border: var(--border-rule) solid var(--ink); border-radius: var(--radius-md); background: var(--lilac); font-size: 14px; line-height: 1.4; color: var(--ink); }
.consent--panel .consent__actions { justify-content: space-between; }
.consent--panel .consent__actions .btn { min-width: 0; flex: 1 1 auto; }
.consent .btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 520px) {
  .consent__actions .btn { flex: 1 1 100%; }
  /* The quiet variants must not cover the page's main action on a phone: tight box, small type, the
     buttons side by side on one row (still 44px tall). The panel keeps stacked buttons. */
  .consent--ask, .consent--notice, .consent--gpc, .consent--mixed { inset: auto 8px 8px 8px; }
  .consent--ask .consent__inner, .consent--notice .consent__inner, .consent--gpc .consent__inner { gap: 6px; padding: 6px 12px 8px; }
  .consent--ask .consent__text, .consent--notice .consent__text, .consent--gpc .consent__text, .consent--mixed .consent__text { flex: 1 1 100%; font-size: 12.5px; line-height: 1.3; }
  .consent--mixed .consent__inner { padding: 8px 12px; }
  .consent--mixed .consent__text { margin-bottom: 8px; }
  .consent--mixed .consent__text--second { margin-top: 8px; padding-top: 8px; }
  .consent--ask .consent__actions, .consent--notice .consent__actions, .consent--gpc .consent__actions, .consent--mixed .consent__actions { flex: 1 1 100%; flex-wrap: nowrap; gap: 8px; }
  .consent--ask .consent__actions .btn, .consent--notice .consent__actions .btn, .consent--gpc .consent__actions .btn, .consent--mixed .consent__actions .btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 10px; font-size: 15px; }
}
/* The small footers that carry the "Cookie settings" link on the pages that have no site footer. */
.exam__foot { padding-block: var(--space-4) var(--space-8); color: var(--ink-muted); }
.exam__foot a, .auth__foot a, .bare__foot p:last-child a { color: var(--ink-muted); }
.auth__main { flex-direction: column; }
.auth__foot { width: 100%; max-width: 460px; margin: var(--space-8) 0 0; text-align: center; color: var(--ink-muted); }
.bare__foot p + p { margin-top: var(--space-2); }
.side__cookie { padding-top: 2px; }
.side__cookie a { display: flex; align-items: center; padding: 10px 12px; border-radius: var(--radius-md); color: var(--paper); text-decoration: none; font-weight: 500; }
@media (hover: hover) { .side__cookie a:hover { background: var(--ink-soft); color: var(--paper); } }

/* ── Case study in the player ──
   The scenario stays on screen for each of its questions: pinned under the exam bar on a
   narrow screen (the learner can fold it away), beside the question on a wide one. */
.casepanel { flex: 1 1 100%; min-width: 0; display: flex; flex-direction: column; position: sticky; top: 72px; z-index: 5; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--lilac); }
.casepanel__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; }
.casepanel__title { font-size: 16px; }
.casepanel__count { font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.casepanel__toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 12px; font: 700 14px var(--font-body); color: var(--ink); background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); cursor: pointer; }
.casepanel__lock { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 14px; font-size: 14px; font-weight: 600; border-bottom: var(--border-rule) dashed var(--ink); }
.casepanel__lock .icon { flex: 0 0 auto; margin-top: 2px; }
.casepanel__inner { display: flex; flex-direction: column; min-height: 0; border-top: var(--border-rule) dashed var(--ink); }
.casepanel__tabs { display: flex; gap: 6px; padding: 10px 14px 0; overflow-x: auto; }
.casepanel__tab { flex: 0 0 auto; min-height: 36px; padding: 4px 12px; font: 700 14px var(--font-body); color: var(--ink); background: transparent; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); cursor: pointer; white-space: nowrap; }
.casepanel__tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.casepanel__body { padding: 12px 14px 14px; max-height: 36vh; overflow-y: auto; overscroll-behavior: contain; font-size: 16px; }
.casepanel__body:focus-visible { outline: 3px solid var(--violet); outline-offset: -3px; }
.casepanel__body .rich > :first-child { margin-top: 0; }
/* A phone shows the scenario and the question on one small screen: the panel keeps to the
   top third or so, and "Hide" folds it down to its title. */
@media (max-width: 720px) {
  .casepanel__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 8px 12px; gap: 0 10px; }
  .casepanel__head .scenario__tag { display: none; }
  .casepanel__title, .casepanel__count { grid-column: 1; }
  .casepanel__toggle { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .casepanel__lock { padding: 6px 12px; font-size: 13px; }
  .casepanel__body { max-height: 26vh; padding: 10px 12px 12px; font-size: 15.5px; }
}
@media (min-width: 1100px) {
  .exam__main--case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
  .exam__main--case .casepanel { top: 84px; max-height: calc(100vh - 108px); }
  .exam__main--case .casepanel__inner, .exam__main--case .casepanel__inner[hidden] { display: flex !important; flex: 1 1 auto; }
  .exam__main--case .casepanel__body { max-height: none; flex: 1 1 auto; }
  .exam__main--case .casepanel__toggle { display: none; }
  .exam__main--case .exam__side { grid-column: 1 / -1; position: static; }
}
/* Leaving a case question without an answer: asked once, in the action bar. */
.actions__ask { font-size: 15px; }
/* The grid: case questions carry a violet foot; a closed one and one not open yet are not links. */
.qgrid span { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: var(--border-outline) dotted var(--unseen); border-radius: var(--radius-sm); color: var(--unseen); font-size: 13px; font-weight: 700; cursor: not-allowed; }
.qgrid .in-case, .legend .l-case { box-shadow: inset 0 -4px 0 var(--violet); }
.qgrid span.is-closed, .legend .l-closed { border: var(--border-outline) solid var(--unseen); background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--unseen) 35%, transparent) 5px 7px); }
.qgrid span.is-closed.is-answered { color: var(--ink); }
.legend .l-case { border: var(--border-outline) solid var(--ink); }

/* Provider badges (src/shared/provider.rs) and a provider whose exams are not open yet. */
.provider-badge { flex: none; display: block; }
.examcard--soon { border-style: dashed; box-shadow: none; background: var(--lilac); }

/* ── Admin: the email editor (/admin/emails/{key}) ────────────────────────
   The form and its preview side by side on a wide screen; the body editor (Tiptap, started
   by app/src/admin/email-editor.ts) with its toolbar; and the chips that stand for
   `{{variables}}`. Without the script the plain `.mailedit__raw` box is the editor. */
.mailpage { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 1200px) { .mailpage { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } .mailpreview { position: sticky; top: var(--space-4); } }
.mailedit { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); background: var(--paper); }
.mailedit:focus-within { border-color: var(--violet); box-shadow: var(--shadow-violet); }
.mailedit__bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-bottom: var(--border-rule) solid var(--line); background: var(--lilac); border-radius: 10px 10px 0 0; }
.mailedit__tool { min-width: 44px; min-height: 44px; padding: 0 12px; background: var(--paper); color: var(--ink); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-sm); font-size: 15px; font-weight: 700; cursor: pointer; }
.mailedit__tool[aria-pressed="true"] { background: var(--lemon); }
.mailedit__tool:disabled { opacity: 0.5; cursor: not-allowed; }
.mailedit__gap { width: 6px; }
.mailedit__link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; border-bottom: var(--border-rule) solid var(--line); }
.mailedit__link label { font-size: 15px; font-weight: 700; }
.mailedit__link .input { flex: 1 1 240px; width: auto; min-height: 44px; }
/* The text itself, set roughly as the email sets it. */
.mailedit__text { min-height: 260px; padding: 14px 16px; outline: none; position: relative; white-space: pre-wrap; white-space: break-spaces; overflow-wrap: break-word; font-variant-ligatures: none; font-size: 16px; line-height: 1.5; border-radius: 0 0 10px 10px; }
.mailedit__text > * + * { margin-top: 12px; }
.mailedit__text h2 { font: 800 20px/1.2 var(--font-display); }
.mailedit__text p.note { font-size: 14px; color: var(--ink-muted); }
.mailedit__text li > p + p { margin-top: 6px; }
.mailedit__text a { cursor: text; }
.mailedit__raw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; min-height: 260px; }
/* A variable: one piece, never editable inside. Ready-made pieces (the button, the
   receipt's lines) are drawn dashed and fill their line. */
.mailvar { display: inline-block; padding: 0 8px; margin: 0 1px; background: var(--lemon-wash); color: var(--ink); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-pill); font: 700 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; vertical-align: baseline; }
.mailvar--block { display: block; margin: 0; padding: 8px 12px; background: var(--lilac); border-style: dashed; border-radius: var(--radius-sm); }
.mailedit__text .ProseMirror-selectednode { outline: 3px solid var(--violet); outline-offset: 1px; }
.mailvar--btn { cursor: pointer; min-height: 32px; line-height: 1.2; }
.mailvar--btn[data-block] { background: var(--lilac); border-style: dashed; }
.mailvars__list { list-style: none; padding: 0; display: grid; gap: 8px; margin-top: 8px; }
.mailvars__list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.mailvars__code { white-space: nowrap; }
.mailpreview { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.mailpreview__frame { width: 100%; height: 720px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--lilac); }

/* The payment page (/checkout/pay): the box the payment provider's form is drawn in. The form
   brings its own light colours and knows nothing of night mode, so at night it sits on a light
   island, like the other light islands above, instead of dark text on a dark panel. */
.payform { min-width: 0; }
/* mada is accepted but not advertised (the owner's decision, 2026-11-19: the site sells worldwide,
   and the mark means nothing to most buyers). The form shows a network's mark beside the card
   number; this hides mada's, before a number is typed and when a mada card is recognised.
   The form's own stylesheet styles images under its `div#mysr`, so the id is needed to outrank it. */
.payform div#mysr img[alt="MADA"] { display: none; }
html.night .payform { color-scheme: light; background: #ffffff; color: #17131f; border-radius: var(--radius-lg); padding: var(--space-4); }

/* The admin's log viewer (/admin/logs): compact lines, the level by a coloured edge as well as
   by its word, long values wrapping instead of pushing the page sideways. */
.logtable td { vertical-align: top; }
.logrow--error > td:first-child { box-shadow: inset 4px 0 0 var(--flame, #ff6a1a); }
.logrow--warn > td:first-child { box-shadow: inset 4px 0 0 var(--lemon); }
.logrow--debug { color: var(--ink-muted); }
.logrow--new { background: var(--lemon-wash, #fff6cf); }
.logmsg { overflow-wrap: anywhere; }
.logjson { white-space: pre-wrap; overflow-wrap: anywhere; padding: var(--space-4); border: var(--border-rule) solid var(--line); border-radius: var(--radius-md); font-size: 13px; max-height: 70vh; overflow: auto; }
.logkv > dd { text-align: left; }
.logkv { grid-template-columns: minmax(90px, auto) minmax(0, 1fr); }

/* The notice for AI agents (shared/agent_notice.rs): out of sight and out of the reading order, still in the page text. */
.ai-notice { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Guides (features/marketing/guides.rs): one question per page, written in content/guides/. */
.gindex { margin-top: var(--space-8); }
.gcard { display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none; }
.gcard:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.gcard__title { font: 800 22px/1.15 var(--font-display); letter-spacing: -0.01em; }
.gcard__text { color: var(--ink-soft); font-size: 16px; flex: 1; }
.guide__wrap { max-width: 860px; }
.guide__head .t-display { font-size: clamp(32px, 4.6vw, 52px); }
.ganswer { margin-top: var(--space-6); background: var(--lemon); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 20px 24px; }
.ganswer__label { font: 800 14px/1 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; }
.ganswer__text { margin-top: 8px; font-size: 20px; line-height: 1.4; font-weight: 500; }
.gmeta { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 16px; color: var(--ink-soft); }
.gtoc { margin-top: var(--space-8); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); padding: 16px 20px; background: var(--lilac); }
.gtoc ol { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.gtoc a { font-weight: 600; }
.gtoc a[aria-current="true"] { background: var(--lemon); text-decoration: none; }
.guide__body { max-width: none; margin-top: var(--space-8); font-size: 18px; line-height: 1.6; }
.guide__body > p, .guide__body > ul, .guide__body > ol:not(.gsteps):not(.gsources), .gstep__body > p, .gstep__body > ul, .gcall__body > p { max-width: 68ch; }
.guide__body h2 { scroll-margin-top: 24px; }
.guide__body table { display: block; overflow-x: auto; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md); }
.guide__body th { background: var(--lilac); font-weight: 700; }
.guide__body tr:last-child td { border-bottom: 0; }
.guide__body code { background: var(--lilac); border-radius: 6px; padding: 1px 6px; font-size: 0.92em; }
.gsteps { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: flex; flex-direction: column; gap: var(--space-6); }
.gstep { border: var(--border-outline) solid var(--ink); border-radius: var(--radius-xl); background: var(--paper); box-shadow: var(--shadow-md); padding: 20px 24px; scroll-margin-top: 24px; }
.gstep__head { display: flex; align-items: center; gap: 14px; }
.gstep__n { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--violet); color: var(--paper); border: var(--border-outline) solid var(--ink); font: 800 20px/1 var(--font-display); }
.gstep__title { flex: 1; margin: 0; font: 800 21px/1.2 var(--font-display); }
.gstep__done { flex: none; display: none; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; font-weight: 700; cursor: pointer; }
.js-guide .gstep__done { display: inline-flex; }
.gstep__done input { width: 22px; height: 22px; accent-color: var(--violet); }
.gstep__body { margin-top: 12px; }
.gstep__body > * + * { margin-top: 12px; }
.gstep.is-done { background: var(--mint); box-shadow: none; }
.gstep.is-done .gstep__n { background: var(--ink); }
.gcall { margin-top: var(--space-6); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); padding: 16px 20px; }
.gcall__label { font: 800 14px/1 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; }
.gcall__body { margin-top: 8px; }
.gcall__body > * + * { margin-top: 10px; }
.gcall--warn { background: var(--lemon-wash); border-left-width: 10px; border-left-color: var(--flame); }
.gcall--cost { background: var(--lemon); border-left-width: 10px; }
.gcall--note { background: var(--lilac); }
.gcall--open { background: var(--paper); border-style: dashed; }
.gfacts { margin: var(--space-6) 0 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.gfacts__item { display: flex; flex-direction: column; gap: 4px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); padding: 16px 18px; background: var(--paper); box-shadow: var(--shadow-sm); }
.gfacts__value { order: -1; margin: 0; font: 800 clamp(26px, 3.4vw, 34px)/1 var(--font-display); color: var(--violet-deep); }
.gfacts__label { font-weight: 700; font-size: 16px; }
.gfacts__note { margin: 0; font-size: 14px; color: var(--ink-muted); }
.gfig { margin: var(--space-6) 0 0; }
.gfig__frame { display: block; width: 100%; padding: 0; background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; cursor: zoom-in; }
.gfig__frame img { display: block; width: 100%; height: auto; }
.gfig__cap { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; font-size: 15px; color: var(--ink-soft); }
.gfig__src { font-size: 13px; color: var(--ink-muted); }
.gmore { margin-top: var(--space-6); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); padding: 0 20px; }
.gmore > summary { cursor: pointer; font-weight: 700; padding: 14px 0; min-height: 44px; }
.gmore__body { padding-bottom: 16px; }
.gmore__body > * + * { margin-top: 12px; }
.gsources { margin-top: var(--space-4); padding-left: 22px; font-size: 16px; display: flex; flex-direction: column; gap: 6px; }
.guide__foot { margin-top: var(--space-18); display: flex; flex-direction: column; gap: var(--space-8); }
.gtry { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.gzoom { max-width: min(96vw, 1500px); max-height: 94vh; padding: 12px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); }
.gzoom::backdrop { background: rgb(23 19 31 / 0.8); }
.gzoom img { display: block; max-width: 100%; max-height: calc(94vh - 80px); margin-top: 10px; }
@media (max-width: 560px) { .gstep { padding: 16px; } .gstep__head { flex-wrap: wrap; } .gstep__done { margin-left: 58px; } .guide__body { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .gcard:hover { transform: none; } }
@media print { .gtoc, .gtry, .grelated, .gstep__done, .gzoom { display: none !important; } .gstep, .ganswer, .gfacts__item, .gfig__frame { box-shadow: none !important; } .gmore > .gmore__body { display: block; } }

/* ── The public header, grown (shared/ui.rs): it stays at the top and shrinks once the page scrolls; "Exams" is a
   menu with a finder; one pill remembers the visitor's exam; phones get the four main places at the bottom. ── */
.top--public { position: sticky; top: 0; z-index: 30; }
.top--public.is-stuck .top__row { padding-block: 6px; }
.top--public.is-stuck .wordmark { transform: scale(0.9); transform-origin: left center; }
@media (min-width: 721px) {
  .top--public.is-stuck .top__nav > :not(.navx):not(.pill--exam), .top--public.is-stuck .top__signin { display: none; }
}
.top--public .top__nav { align-items: center; }
.top--public .top__nav .pill { padding-inline: 13px; }
@media (min-width: 1100px) { .top--public .top__row, .top--public .top__nav, .top--public .top__end { flex-wrap: nowrap; } .top--public .top__nav .pill, .top--public .top__end .pill, .top--public .top__end .btn { white-space: nowrap; } }
.pill--exam { background: var(--lemon); border: var(--border-outline) solid var(--ink); min-height: 40px; padding: 0 14px; }
.pill--exam[hidden] { display: none; }
.pill--exam:hover { background: var(--lemon); color: var(--ink); }
.navx { position: relative; }
.navx > summary { list-style: none; cursor: pointer; gap: 6px; user-select: none; }
.navx > summary::-webkit-details-marker { display: none; }
.navx > summary .icon { width: 16px; height: 16px; }
.navx[open] > summary { background: var(--lilac); }
.navx[open] > summary .icon { transform: rotate(180deg); }
.navx__panel { position: absolute; left: 0; top: calc(100% + 10px); z-index: 40; width: min(720px, calc(100vw - 2 * var(--space-6))); max-height: min(70vh, 640px); overflow: auto;
  background: var(--paper); border: var(--border-outline) solid var(--ink); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.navx__find { display: flex; gap: 8px; }
.navx__find .input { flex: 1; min-width: 0; }
.navx__groups { display: grid; gap: 14px 20px; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.navx__group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.navx__group[hidden] { display: none; }
.navx__area { font: 800 13px/1 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); padding: 4px 8px 6px; }
.navx__exam { display: flex; flex-direction: column; gap: 1px; padding: 7px 8px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; min-height: 44px; justify-content: center; }
.navx__exam[hidden] { display: none; }
.navx__exam:hover, .navx__exam:focus-visible { background: var(--lilac); color: var(--ink); }
.navx__exam b { font-weight: 800; font-size: 15px; }
.navx__exam span { font-size: 13px; color: var(--ink-muted); line-height: 1.25; }
.navx__all { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.navx__all .icon { width: 16px; height: 16px; }
.tabbar--public .tabbar__item span { white-space: nowrap; }
@media (max-width: 720px) {
  .top--public { position: sticky; }
  body.public { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  /* The cookie banner sits above the bottom bar, not on it. */
  body.public .consent { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .tabbar--public { display: none !important; } .top--public { position: static; } }

/* Free exam: the referral card in the corner of a result (app/src/features/results/components/Nudge.tsx).
   It never covers the page: small, out of the reading column on wide screens, above the tab bar on a phone. */
.nudge { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(320px, calc(100vw - 32px)); padding: 14px 16px; display: grid; gap: 8px; }
.nudge__close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; padding: 6px; color: inherit; }
.nudge strong { padding-right: 28px; }
@media (max-width: 720px) { .nudge { bottom: 84px; } }
@media (prefers-reduced-motion: no-preference) { .nudge { animation: nudge-in 0.25s ease-out both; } @keyframes nudge-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } } }
@media print { .nudge { display: none; } }

/* Public pages: after "Check my answer" the page jumps to the verdict. The public header stays
   at the top (74 px on a phone), so the verdict stops clear of it instead of underneath. */
body:has(.top--public) #verdict { scroll-margin-top: 96px; }
/* Free practice: the message and link a share button leaves on the page. */
.share-out textarea { width: 100%; font: inherit; font-size: var(--text-sm, 0.9rem); padding: 10px 12px; border: var(--border-outline) solid var(--ink); border-radius: var(--radius-md, 12px); background: var(--paper); color: var(--ink); resize: none; }

/* The dashboard's exam date: closed until the learner asks for it. */
.focus__when summary { cursor: pointer; color: var(--violet); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
.focus__when[open] summary { margin-bottom: 8px; }
/* Phones: the offer line gives way while the cookie notice is asking, and on a page where a
   question is being answered, so the first screen is not three bars deep. */
@media (max-width: 720px) {
  body:has(.consent--ask) .notice--fact, body:has(form.review) .notice--fact { display: none; }
}
