/* Station Ready — a working tool, not a marketing site.
   Tokens on :root, overridden under [data-theme="dark"]. The theme is
   stamped by a script before first paint, so there is no OS media query.

   Identity v2 (22 Sep 2026): an EARL sub-brand. Navy and coral are EARL's
   own; navy is used as structure (the rail, the countdown band) rather than
   as a marketing ground, and coral is held back to one use per screen.
   Petrol and battenburg yellow are retired. See station-ready/design/UI-SPEC.md. */

:root {
  --ground: #F3F5FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFE;
  --ink: #18222E;
  --ink-2: #39414F;
  --muted: #686C7A;
  --faint: #9AA0AE;

  --navy: #2D2D5C;
  --navy-deep: #20203F;
  --navy-lift: #39396F;
  --on-navy: #FFFFFF;

  /* --primary and --accent both resolve to the action blue: one actionable
     colour, so a button, a selected segment and a link never disagree.
     --signal (coral) is separate and is never used for an ordinary control. */
  --primary: #0A72A8;
  --primary-ink: #FFFFFF;
  --primary-deep: #075A85;
  --accent: #0A72A8;
  --accent-ink: #FFFFFF;
  --signal: #FF5F50;

  --hair: #E2E6F0;
  --hair-soft: #EDF0F7;

  --good: #1F8A5F;
  --warn: #C07A12;
  --crit: #C8453A;
  --good-bg: #EAF5EF;
  --warn-bg: #FBF0DC;
  --crit-bg: #FCEBE9;

  --focus: #0A72A8;
  --shadow: 0 1px 2px rgba(24, 35, 46, .05);
  --shadow-lift: 0 1px 2px rgba(24, 35, 46, .05), 0 8px 24px -16px rgba(24, 35, 46, .30);

  --f-head: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --rail: 236px;
  --topbar: 58px;
  --tabbar: 60px;
  --gutter: 16px;
  --radius: 9px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  --ico-person: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='8.5' r='3.7'/><path d='M5 20c.7-3.6 3.5-5.5 7-5.5s6.3 1.9 7 5.5'/></svg>");

  color-scheme: light;
  box-sizing: border-box;
}

:root[data-theme="dark"] {
  --ground: #0B1017;
  --surface: #151C26;
  --surface-2: #1B2430;
  --ink: #E9EDF4;
  --ink-2: #C2C9D6;
  --muted: #98A1B2;
  --faint: #6E7788;

  --navy: #262650;
  --navy-deep: #1B1B3A;
  --navy-lift: #33336A;
  --on-navy: #FFFFFF;

  --primary: #4FA9D6;
  --primary-ink: #08121A;
  --primary-deep: #6FBCE3;
  --accent: #4FA9D6;
  --accent-ink: #08121A;
  --signal: #FF7A6B;

  --hair: #28313F;
  --hair-soft: #212936;

  --good: #4FBE8C;
  --warn: #DFA94A;
  --crit: #E8756A;
  --good-bg: #14302A;
  --warn-bg: #322718;
  --crit-bg: #331E1C;

  --focus: #4FA9D6;
  --shadow: none;
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, .45);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: inherit; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--ground); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 600; letter-spacing: -.005em; line-height: 1.15; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 .75em; }
a { color: var(--primary); }
button { font: inherit; color: inherit; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--f-head); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  margin: 0 0 6px;
}
.muted { color: var(--muted); }
.small { font-size: 14px; }
.vis-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; border-radius: var(--radius); }
.skip:focus { left: 8px; }

/* ---- shell ---------------------------------------------------------------- */
.shell { min-height: 100vh; display: grid; grid-template-rows: var(--topbar) 1fr; grid-template-columns: 1fr; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter); padding-top: env(safe-area-inset-top, 0);
  background: var(--surface); border-bottom: 1px solid var(--hair);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 22px; height: 22px; border-radius: 5px; background: var(--primary); position: relative; flex: 0 0 auto; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; width: 6px; height: 6px; background: var(--accent); }
.brand-mark::before { left: 4px; top: 4px; }
.brand-mark::after { right: 4px; bottom: 4px; }
.brand-name { font-family: var(--f-head); font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-countdown { font-size: 13px; color: var(--muted); }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--hair);
  background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }
:root[data-theme="light"] .ico-sun { display: none; }
:root[data-theme="light"] .ico-moon { display: block; }

.rail { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--hair);
}
.tabbar a, .rail a {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-family: var(--f-head); font-weight: 600; letter-spacing: .04em;
}
.tabbar a[aria-current="page"], .rail a[aria-current="page"] { color: var(--primary); }
.nav-ico { font-size: 18px; line-height: 1; }
.main { padding: 20px var(--gutter) calc(var(--tabbar) + 32px); max-width: 960px; width: 100%; margin: 0 auto; }

@media (min-width: 720px) {
  .shell { grid-template-columns: var(--rail) 1fr; grid-template-rows: var(--topbar) 1fr; }
  .topbar { grid-column: 1 / -1; }
  .rail {
    display: flex; flex-direction: column; gap: 2px; padding: 16px 10px;
    border-right: 1px solid var(--hair); background: var(--surface);
    position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); align-self: start;
  }
  .rail a { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 9px 12px; border-radius: var(--radius); font-size: 14px; letter-spacing: .02em; }
  .rail a:hover { background: var(--ground); color: var(--ink); }
  .rail a[aria-current="page"] { background: var(--ground); color: var(--primary); box-shadow: inset 3px 0 0 var(--accent); }
  .rail .nav-ico { width: 20px; text-align: center; font-size: 16px; }
  .rail-foot { margin-top: auto; padding: 10px 12px 0; }
  .rail-foot a { padding: 0; font-family: var(--f-body); font-weight: 400; font-size: 13px; letter-spacing: 0; }
  .rail-disclaimer { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin: 10px 0 0; }
  .tabbar { display: none; }
  .main { padding: 28px 28px 48px; }
}

/* ---- layout primitives ---------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card h2, .card h3 { margin-bottom: 8px; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { border-color: var(--primary); }
.section { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
hr { border: 0; border-top: 1px solid var(--hair); margin: 16px 0; }

/* ---- stats -------------------------------------------------------------------- */
.stat { padding: 14px 16px; }
.stat .eyebrow { margin-bottom: 2px; }
.stat-value { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 28px; line-height: 1.1; font-weight: 500; }
.stat-value small { font-size: 14px; color: var(--muted); font-family: var(--f-body); margin-left: 4px; }
.stat-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ---- domain bars --------------------------------------------------------------- */
.dom { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.dom:last-child { border-bottom: 0; }
.dom-name { font-weight: 600; font-size: 15px; }
.dom-bar { grid-column: 1 / -1; height: 6px; background: var(--hair); border-radius: 3px; overflow: hidden; }
.dom-bar i { display: block; height: 100%; background: var(--primary); }
.dom-score { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }

/* ---- pills / chips ------------------------------------------------------------- */
.pill {
  display: inline-block; font-family: var(--f-head); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  padding: 2px 8px; border-radius: 3px; border: 1px solid var(--hair); color: var(--muted); white-space: nowrap; line-height: 1.5;
}
.pill.strong { color: var(--good); background: var(--good-bg); border-color: transparent; }
.pill.competent { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: transparent; }
.pill.needs-work { color: var(--crit); background: var(--crit-bg); border-color: transparent; }
.pill.untested { color: var(--muted); }
.pill.timed-out { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.chip { display: inline-block; font-size: 12.5px; padding: 1px 7px; border-radius: 3px; background: var(--ground); border: 1px solid var(--hair); color: var(--muted); white-space: nowrap; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---- buttons -------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--f-head); font-weight: 600; font-size: 15px; letter-spacing: .03em;
  padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--primary);
  background: var(--primary); color: var(--primary-ink); cursor: pointer; text-decoration: none; min-height: 42px;
}
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); filter: none; }
.btn.danger { background: transparent; color: var(--crit); border-color: var(--crit); }
.btn.sm { padding: 6px 12px; font-size: 13.5px; min-height: 34px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---- forms ---------------------------------------------------------------------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 9px 11px; width: 100%; max-width: 420px;
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
/* A form's own inline complaint: the status colour, never the accent. */
.small.crit { color: var(--crit); margin: 0 0 10px; }
.seg { display: inline-flex; border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; }
.seg button { padding: 8px 14px; border: 0; background: transparent; cursor: pointer; font-family: var(--f-head); font-weight: 600; font-size: 14px; letter-spacing: .03em; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--hair); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.check { display: flex; align-items: center; gap: 10px; padding: 9px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---- options (station + SBA) ----------------------------------------------------- */
.scene { font-size: 17px; line-height: 1.55; }
.options { display: grid; gap: 8px; margin-top: 14px; }
.opt {
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; text-align: left;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--hair); background: var(--surface); cursor: pointer;
  font-size: 15.5px; line-height: 1.45;
}
.opt:hover:not(:disabled) { border-color: var(--primary); }
.opt:disabled { cursor: default; }
.opt .key { font-family: var(--f-mono); font-size: 13px; color: var(--muted); border: 1px solid var(--hair); border-radius: 3px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.opt.chosen { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.opt.q2 { border-color: var(--good); background: var(--good-bg); }
.opt.q1 { border-color: var(--warn); background: var(--warn-bg); }
.opt.q0 { border-color: var(--crit); background: var(--crit-bg); }
.opt.q2 .key { color: var(--good); border-color: var(--good); }
.opt.q1 .key { color: var(--warn); border-color: var(--warn); }
.opt.q0 .key { color: var(--crit); border-color: var(--crit); }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); border-left: 3px solid var(--hair); background: var(--surface); border-top: 1px solid var(--hair); border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.feedback.q2 { border-left-color: var(--good); }
.feedback.q1 { border-left-color: var(--warn); }
.feedback.q0 { border-left-color: var(--crit); }
.feedback .eyebrow { margin-bottom: 4px; }

/* Flag this: low emphasis, muted ink, never the accent. */
.flag { margin-top: 10px; font-size: 13px; }
.flag-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; margin: 0 -6px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.flag-btn:hover { color: var(--ink); border-color: var(--hair); }
.flag-icon { flex: none; }
.flag-done { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.flag-chooser { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--ground); }
.flag-reasons { display: flex; gap: 6px; flex-wrap: wrap; }
.flag-reason { padding: 3px 10px; border: 1px solid var(--hair); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.flag-reason:hover { color: var(--ink); border-color: var(--muted); }
.flag-reason[aria-pressed="true"] { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: var(--primary); }
.flag-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.flag-row .flag-note { flex: 1 1 180px; min-width: 0; font-size: 14px; padding: 6px 8px; }
.flag-row .flag-note[aria-invalid="true"] { border-color: var(--crit); }
.flag-mark { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.list .flag { margin-top: 4px; }

/* "Where this comes from": sources under an explanation or a debrief. Quiet
   by design — it sits below the answer and never competes with it. */
.refs { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--ground); }
.refs > .eyebrow { margin: 0 0 8px; }
.refs-collapsed { padding: 0; }
.refs-collapsed > summary { padding: 7px 12px; cursor: pointer; color: var(--muted); list-style: none; }
.refs-collapsed > summary::-webkit-details-marker { display: none; }
.refs-collapsed > summary .eyebrow { color: inherit; }
.refs-collapsed > summary::before { content: "▸"; display: inline-block; margin-right: 6px; font-size: 11px; }
.refs-collapsed[open] > summary::before { content: "▾"; }
.refs-collapsed[open] > summary { border-bottom: 1px solid var(--hair); }
.refs-collapsed > *:not(summary) { padding: 0 12px; }
.refs-collapsed > .ref-list { padding-top: 10px; }
.ref-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.ref { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.ref-glyph { flex: none; margin-top: 3px; color: var(--muted); }
.ref-body { min-width: 0; }
.ref-body a { color: var(--ink); text-decoration-color: var(--hair); text-underline-offset: 2px; }
.ref-body a:hover { text-decoration-color: currentColor; }
/* Line 1: title, then the page reference in mono. Line 2: where in it. */
.ref-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ref-pages { flex: none; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ref-detail { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.ref-detail .mono { font-size: 12.5px; white-space: nowrap; }
.ref-section { color: inherit; }
.ref-org { display: inline; font-size: 10.5px; margin: 0; vertical-align: baseline; }
.ref-dot { margin: 0 5px; }
/* Several places in the same book sit under one title line. */
.ref-places { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ref-places > li { display: flex; }
.ref-meta { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--hair); }
.ref-meta > .mono { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ref-meta .flag { margin-top: 0; }
.refs-collapsed .ref-meta { padding-bottom: 10px; }
.q2-text { color: var(--good); } .q1-text { color: var(--warn); } .q0-text { color: var(--crit); }

/* ---- timer / play chrome ---------------------------------------------------------- */
.playbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 14px; border-bottom: 1px solid var(--hair); margin-bottom: 18px; flex-wrap: wrap; }
.timer { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 500; padding: 2px 10px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); }
.timer.low { background: var(--crit); color: #fff; }
.timer.idle { background: var(--hair); color: var(--muted); }
.progress { height: 6px; background: var(--hair); border-radius: 3px; overflow: hidden; flex: 1 1 120px; }
.progress i { display: block; height: 100%; background: var(--primary); transition: width .3s ease; }
.kbd-hint { font-size: 12.5px; color: var(--muted); }
kbd { font-family: var(--f-mono); font-size: 11.5px; border: 1px solid var(--hair); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; }

/* ---- tables / lists ------------------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-family: var(--f-head); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--hair); }
.table td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.list li:last-child { border-bottom: 0; }
.tick { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--hair); align-items: center; justify-content: center; font-size: 12px; flex: 0 0 auto; color: transparent; }
.tick.done { background: var(--good); border-color: var(--good); color: #fff; }

.station-card { display: grid; gap: 6px; }
.station-card .title { font-family: var(--f-head); font-weight: 600; font-size: 19px; }
.station-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select { width: auto; padding: 7px 10px; font-size: 14px; }

.notice { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--hair); border-left: 3px solid var(--warn); background: var(--surface); font-size: 14px; }
.notice.crit { border-left-color: var(--crit); }
.notice.info { border-left-color: var(--primary); }
.preview-banner { background: var(--accent); color: var(--accent-ink); padding: 8px var(--gutter); font-size: 13.5px; text-align: center; font-family: var(--f-head); font-weight: 600; letter-spacing: .03em; }
.preview-banner button { background: none; border: 1px solid currentColor; border-radius: 3px; padding: 1px 8px; margin-left: 10px; cursor: pointer; font-family: inherit; font-weight: 600; }

.badge-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.badge { padding: 14px; opacity: .55; }
.badge.earned { opacity: 1; border-color: var(--primary); }
.badge .mark { width: 36px; height: 36px; border-radius: 50%; background: var(--hair); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; font-family: var(--f-head); font-weight: 600; color: var(--muted); }
.badge.earned .mark { background: var(--accent); color: var(--accent-ink); }
.badge .name { font-family: var(--f-head); font-weight: 600; font-size: 16px; }
.badge .how { font-size: 13px; color: var(--muted); }
.badge .when { font-size: 12px; color: var(--muted); font-family: var(--f-mono); margin-top: 4px; }

.score-big { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 48px; font-weight: 500; line-height: 1; }
.score-big small { font-size: 18px; color: var(--muted); font-family: var(--f-body); }
.path { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--f-mono); font-size: 13px; }
.path .step { padding: 2px 8px; border-radius: 3px; border: 1px solid var(--hair); }
.path .step.q2 { border-color: var(--good); color: var(--good); }
.path .step.q1 { border-color: var(--warn); color: var(--warn); }
.path .step.q0 { border-color: var(--crit); color: var(--crit); }
.path .arrow { color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 78px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); align-items: baseline; }
.timeline li:last-child { border-bottom: 0; }
.timeline .date { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.timeline .past { opacity: .55; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px); transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: var(--radius); font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 4px 16px rgba(0,0,0,.25); }
@media (min-width: 720px) { .toast { bottom: 24px; } }

/* ---- certificate ------------------------------------------------------------------- */
/* A sheet of paper in either theme: its own fixed palette, a double rule frame,
   a serif display face for the title and name, and A4 landscape when printed.
   No RCSEd or FPHC marks, ever; the only mark is Station Ready's own. */
.cert {
  --c-paper: #FFFEFA; --c-ink: #1B2030; --c-muted: #5E6272; --c-navy: #2D2D5C; --c-gold: #A8874E;
  --f-cert: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  max-width: 940px; margin: 0 auto; padding: 14px;
  background: var(--c-paper); color: var(--c-ink);
  border: 1px solid var(--hair); box-shadow: var(--shadow-lift);
  color-scheme: light;
}
.cert-frame {
  position: relative; text-align: center;
  border: 3px solid var(--c-navy); outline: 1px solid var(--c-gold); outline-offset: -9px;
  padding: 44px 56px 26px;
  background:
    radial-gradient(circle at 0 0, var(--c-gold) 0 3.5px, transparent 4px) 14px 14px / 12px 12px no-repeat,
    radial-gradient(circle at 100% 0, var(--c-gold) 0 3.5px, transparent 4px) calc(100% - 14px) 14px / 12px 12px no-repeat,
    radial-gradient(circle at 0 100%, var(--c-gold) 0 3.5px, transparent 4px) 14px calc(100% - 14px) / 12px 12px no-repeat,
    radial-gradient(circle at 100% 100%, var(--c-gold) 0 3.5px, transparent 4px) calc(100% - 14px) calc(100% - 14px) / 12px 12px no-repeat;
}
.cert-head { margin-bottom: 22px; }
.cert-brand {
  display: inline-flex; align-items: center; gap: 8px; color: var(--c-navy);
  font-family: var(--f-head); font-weight: 700; font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
}
.cert-title {
  font-family: var(--f-cert); font-weight: 600; font-size: clamp(40px, 8vw, 64px); line-height: 1;
  letter-spacing: .04em; color: var(--c-navy); margin: 18px 0 6px;
}
.cert-sub {
  font-family: var(--f-cert); font-style: italic; font-size: clamp(18px, 3.4vw, 23px); color: var(--c-muted); margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.cert-sub::before, .cert-sub::after { content: ""; flex: 0 1 70px; height: 1px; background: var(--c-gold); }
.cert-lead { font-family: var(--f-cert); font-style: italic; font-size: 18px; color: var(--c-muted); margin: 18px 0 4px; }
.cert-name {
  font-family: var(--f-cert); font-weight: 600; font-size: clamp(28px, 5.5vw, 42px); line-height: 1.15; margin: 0 auto;
  display: inline-block; min-width: min(420px, 100%); padding: 0 16px 4px; border-bottom: 1px solid var(--c-gold);
  overflow-wrap: anywhere;
}
.cert-reg { font-family: var(--f-mono); font-size: 13px; color: var(--c-muted); margin: 6px 0 0; }
.cert-activity { font-family: var(--f-cert); font-weight: 600; font-size: clamp(20px, 3.6vw, 26px); line-height: 1.25; margin: 0 auto; max-width: 640px; }
.cert-kind { font-size: 14px; color: var(--c-muted); margin: 4px 0 0; }
.cert-note { color: var(--c-muted); font-size: .85em; }
.cert dt { font-family: var(--f-head); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--c-gold); }
.cert dd { margin: 0; }
.cert-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 28px auto 0; max-width: 640px; }
.cert-facts > div { padding: 4px 12px; }
.cert-facts > div + div { border-left: 1px solid color-mix(in srgb, var(--c-gold) 55%, transparent); }
.cert-facts dd { font-size: 17px; font-weight: 500; margin-top: 4px; }
.cert-more { margin: 22px auto 0; max-width: 640px; }
.cert-more dd { font-size: 14.5px; margin: 4px 0 12px; }
.cert-more dd.mono { font-size: 12px; color: var(--c-muted); overflow-wrap: anywhere; }
.cert-sign { display: flex; justify-content: space-between; gap: 32px; margin: 26px 0 0; text-align: center; }
.cert-sign > div { flex: 1 1 0; min-width: 0; }
.cert-line { display: block; font-size: 13.5px; line-height: 20px; padding-bottom: 6px; border-bottom: 1px solid var(--c-ink); overflow-wrap: anywhere; }
.cert-line.mono { font-size: 12px; }
.cert-cap { display: block; margin-top: 5px; font-family: var(--f-head); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--c-muted); }
.cert-foot { margin: 24px auto 0; max-width: 680px; font-size: 11.5px; color: var(--c-muted); line-height: 1.45; }
@media (max-width: 599px) {
  .cert { padding: 8px; }
  .cert-frame { padding: 30px 18px 20px; outline-offset: -7px; }
  .cert-facts { grid-template-columns: 1fr; }
  .cert-facts > div + div { border-left: 0; border-top: 1px solid color-mix(in srgb, var(--c-gold) 55%, transparent); padding-top: 10px; margin-top: 6px; }
  .cert-sign { flex-direction: column; gap: 18px; }
}
@page { size: A4 landscape; margin: 10mm; }
@media print {
  .topbar, .rail, .tabbar, .toast, .no-print, .preview-banner { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .cert { border: 0; box-shadow: none; padding: 0; max-width: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; break-inside: avoid; }
  .main { padding: 0 !important; margin: 0 !important; }
  .cert-frame { height: 188mm; padding: 9mm 18mm 6mm; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
  .cert-head { margin-bottom: 10px; }
  .cert-title { font-size: 52px; margin: 12px 0 4px; }
  .cert-lead { margin: 10px 0 2px; font-size: 16px; }
  .cert-name { font-size: 36px; }
  .cert-facts { margin-top: 16px; }
  .cert-more { margin-top: 12px; }
  .cert-more dd { margin-bottom: 6px; }
  .cert-sign { margin-top: auto; padding-top: 10px; }
  .cert-foot { margin-top: 12px; }
  a { color: inherit; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------- account */
/* Low emphasis by design: signing in is optional and must never compete with
   the timer or the accent colour. */

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .85rem;
  text-decoration: none;
}
.account-btn:hover { color: var(--ink); border-color: var(--muted); }
.account-btn[data-state="pending"] { border-style: dashed; }
.account-btn[data-state="offline"],
.account-btn[data-state="signed-out"] { border-color: var(--warn); color: var(--warn); }

.account-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0 -4px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
  font-family: var(--f-head);
  font-size: .8rem;
  line-height: 1;
}

.providers { display: grid; gap: 10px; max-width: 360px; }

.provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.provider-btn:hover { border-color: var(--muted); }
.provider-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.provider-mark { display: inline-flex; align-items: center; }
/* Apple's mark is a solid glyph, so it takes the ink colour of the theme. */
.provider-btn.apple .provider-mark { color: var(--ink); }

.sync { display: inline-block; margin: 6px 0 0; }
.sync.good { color: var(--good); }
.sync.warn { color: var(--warn); }
.sync.crit { color: var(--crit); }

@media (max-width: 520px) {
  .account-word { display: none; }
  .account-btn { padding: 0 8px; }
}

/* ---- admin (owner only) --------------------------------------------------------- */
/* The rail group is hidden unless /api/me said this account is the owner's. */
.rail-admin { border-top: 1px solid var(--hair); margin-top: 8px; padding-top: 8px; }
.rail-label { font-family: var(--f-head); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 2px 14px; }

.admin-flag { display: grid; gap: 8px; }
.admin-flag .admin-note { margin: 0; font-size: 15.5px; }
.admin-flag .admin-text { margin: 0; font-size: 14px; color: var(--muted); border-left: 2px solid var(--hair); padding-left: 10px; }
.admin-flag[data-state="ignored"] { opacity: .72; }

.pill.new { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: transparent; }
.pill.review { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.removal { color: var(--crit); background: var(--crit-bg); border-color: transparent; }
.pill.ignored { color: var(--muted); }
.pill.active { color: var(--good); background: var(--good-bg); border-color: transparent; }
.pill.quiet { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: transparent; }
.pill.dormant { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.none { color: var(--muted); }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.admin-users td { vertical-align: top; }
.admin-detail-body { padding: 4px 0 10px; }
.admin-detail-body .table { margin-top: 4px; }

/* The flagged row opened in full, under its feedback card. */
.admin-context { border-top: 1px solid var(--hair); padding-top: 10px; }
.admin-context .eyebrow { margin: 12px 0 2px; }
.ctx-stem { font-size: 16px; margin: 6px 0 10px; }
.ctx-body { font-size: 14.5px; margin: 0; }
.ctx-options { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.ctx-opt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--hair); border-radius: var(--radius); font-size: 14.5px; }
.ctx-opt.correct { border-color: var(--good); background: var(--good-bg); }
.ctx-letter { color: var(--muted); }
.ctx-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; }
.ctx-nav .small { flex: 1 1 auto; }
.ctx-opt .btn.sm { align-self: start; }

/* ==========================================================================
   v2 — identity, hierarchy and information design.
   Appended after the original rules so equal-specificity selectors win.
   Spec: station-ready/design/UI-SPEC.md
   ========================================================================== */

/* ---- type scale ----------------------------------------------------------- */
body { font-size: 15px; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.022em; }
h2 { font-size: 23px; font-weight: 700; letter-spacing: -.018em; }
h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.eyebrow {
  font-family: var(--f-head); font-weight: 700; font-size: 11px;
  letter-spacing: .14em; color: var(--faint);
}
.small { font-size: 13.5px; }
.scene { font-size: 20px; font-weight: 500; line-height: 1.42; letter-spacing: -.008em; max-width: 46em; }
a { color: var(--primary); }
kbd { border-radius: var(--radius-sm); padding: 1px 6px; color: var(--muted); background: var(--surface); }

/* ---- shell: the rail is structure, so it carries the navy ----------------- */
.topbar { height: var(--topbar); border-bottom: 1px solid var(--hair); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(150deg, #FF7A6B, var(--signal));
  box-shadow: 0 2px 8px rgba(255, 95, 80, .30);
}
.brand-mark::before, .brand-mark::after { content: none; }
.brand-mark { display: flex; align-items: center; justify-content: center; }
.brand-mark svg { display: block; width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.012em; }
/* The line under the name is a domain, so it keeps its lower case. */
.brand-domain { font-size: 11.5px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--muted); }
.topbar-countdown {
  font-size: 12.5px; font-weight: 700; font-family: var(--f-head);
  background: var(--crit-bg); color: var(--crit);
  border-radius: 999px; padding: 5px 12px;
}
.topbar-countdown .mono { font-weight: 600; }
.icon-btn { border-radius: var(--radius); }

@media (min-width: 720px) {
  .rail {
    background: var(--navy); border-right: 0; padding: 14px 12px 18px;
    gap: 2px;
  }
  .rail a {
    flex-direction: row; justify-content: flex-start; align-items: center;
    color: rgba(255, 255, 255, .72); font-family: var(--f-body);
    font-weight: 500; font-size: 14.5px; letter-spacing: 0;
    padding: 9px 12px; border-radius: 8px; gap: 11px;
  }
  .rail a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
  .rail a[aria-current="page"] {
    background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none;
  }
  .rail a svg { opacity: .75; }
  .rail a[aria-current="page"] svg, .rail a:hover svg { opacity: 1; }
  .rail .nav-ico { width: 17px; height: 17px; font-size: 0; display: inline-flex; }
  .rail-foot { padding: 14px 12px 0; }
  .rail-foot a { color: rgba(255, 255, 255, .72); font-size: 13px; font-weight: 500; }
  .rail-foot a:hover { color: #fff; background: transparent; }
  .rail-disclaimer { color: rgba(255, 255, 255, .42); }
  .rail-admin { border-top-color: rgba(255, 255, 255, .12); }
  .rail-label { color: rgba(255, 255, 255, .45); }
  .main { padding: 26px 32px 48px; max-width: 1320px; }
}
@media (min-width: 1100px) { .main { padding-inline: 32px; } }

/* Mobile tab bar: icons are SVG now, so the glyph box needs real dimensions. */
.tabbar .nav-ico { width: 20px; height: 20px; font-size: 0; display: inline-flex; align-items: center; justify-content: center; }
.tabbar a { font-family: var(--f-body); font-weight: 600; font-size: 10.5px; letter-spacing: .01em; }
.tabbar a[aria-current="page"] { color: var(--primary); }

/* ---- surface hierarchy ----------------------------------------------------
   Exactly one element per screen is lifted. Everything else is a hairline
   card on the ground. ------------------------------------------------------ */
.card { border-radius: var(--radius-lg); border-color: var(--hair); box-shadow: none; padding: 16px 20px; }
.card + .card { margin-top: 14px; }
.grid { gap: 14px; }
.section { margin-top: 18px; }
.page-head { margin-bottom: 18px; }
.page-head p { font-size: 14.5px; }

/* ---- buttons ---------------------------------------------------------------- */
.btn {
  font-family: var(--f-body); font-weight: 700; letter-spacing: 0; font-size: 14.5px;
  border-radius: var(--radius); padding: 11px 20px; min-height: 44px;
  border-color: transparent; box-shadow: 0 1px 2px rgba(10, 114, 168, .32);
}
.btn:hover { filter: none; background: var(--primary-deep); }
.btn.ghost {
  font-weight: 600; border-color: var(--hair); background: var(--surface);
  color: var(--ink); box-shadow: none;
}
.btn.ghost:hover { background: var(--surface); border-color: var(--muted); color: var(--ink); }
.btn.danger { box-shadow: none; border-color: var(--crit); }
.btn.sm { padding: 7px 13px; font-size: 13.5px; min-height: 36px; }
.seg { border-radius: var(--radius); }
.seg button { font-family: var(--f-body); font-weight: 600; letter-spacing: 0; }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
input[type="text"], input[type="email"], input[type="number"], select, textarea { border-radius: var(--radius); }

/* ---- pills and chips ---------------------------------------------------------- */
.pill {
  font-family: var(--f-head); font-weight: 700; font-size: 11px;
  letter-spacing: .07em; border-radius: var(--radius-sm); padding: 3px 8px;
}
.pill.competent { color: var(--warn); background: var(--warn-bg); }
.pill.untested { color: var(--faint); border-color: transparent; background: transparent; padding-left: 0; padding-right: 0; }
.chip {
  font-size: 11.5px; font-weight: 600; padding: 3.5px 9px;
  border-radius: var(--radius-sm); background: var(--hair-soft);
  border-color: transparent; color: var(--ink-2);
}

/* ---- the countdown band (dashboard) --------------------------------------------
   The one lifted element on the dashboard. It replaces four flat stat cards
   and two of the three places the countdown used to appear above the fold. */
.band {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: linear-gradient(115deg, var(--navy-deep), var(--navy) 62%, var(--navy-lift));
  color: var(--on-navy); padding: 22px 26px 20px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 34px; align-items: center;
}
.band::after {
  content: ""; position: absolute; right: -70px; top: -90px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 95, 80, .30), transparent 68%);
}
.band > * { position: relative; z-index: 1; }
.band .eyebrow { color: rgba(255, 255, 255, .55); }
.band-n {
  font-family: var(--f-mono); font-variant-numeric: tabular-nums;
  font-size: 54px; font-weight: 600; line-height: 1; letter-spacing: -.03em; margin-top: 7px;
}
.band-n small { font-family: var(--f-body); font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .62); margin-left: 7px; }
.band-sub { font-size: 13px; color: rgba(255, 255, 255, .62); margin-top: 7px; }

.band-track { padding: 14px 0 4px; }
.band-line { position: relative; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.band-line i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--signal); }
.band-ticks { position: relative; height: 46px; margin-top: -3px; }
.band-tick { position: absolute; transform: translateX(-50%); text-align: center; }
.band-tick i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--navy-deep); border: 2px solid rgba(255, 255, 255, .55); margin: 0 auto; }
.band-tick.now i { background: var(--signal); border-color: #fff; width: 11px; height: 11px; margin-top: -1px; }
.band-tick.exam i { background: #fff; border-color: #fff; }
.band-tick.past i { opacity: .45; }
.band-tick b { display: block; font-size: 11px; font-weight: 600; margin-top: 9px; white-space: nowrap; color: rgba(255, 255, 255, .9); }
.band-tick em { display: block; font-style: normal; font-family: var(--f-mono); font-size: 10.5px; color: rgba(255, 255, 255, .5); }

.band-stats { display: flex; gap: 26px; padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, .16); }
.band-stat .n { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 27px; font-weight: 600; line-height: 1.1; margin-top: 6px; }
.band-stat .n u { text-decoration: none; font-size: 14px; color: rgba(255, 255, 255, .55); }
.band-stat .sub { font-size: 11.5px; color: rgba(255, 255, 255, .55); margin-top: 3px; }

@media (max-width: 1099px) {
  .band { grid-template-columns: auto auto; gap: 24px; }
  .band-track { display: none; }
}
@media (max-width: 620px) {
  .band { grid-template-columns: 1fr; gap: 18px; padding: 18px 18px 16px; }
  .band-stats { padding-left: 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .16); padding-top: 14px; }
  .band-n { font-size: 44px; }
}

/* ---- "Start here" — the recommended station ------------------------------------ */
.nextcard { position: relative; overflow: hidden; padding-left: 22px; }
.nextcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--signal); }
.nextcard .eyebrow.signal { color: var(--signal); }
.nextcard h2 { margin: 6px 0 0; }
.nextcard .why { font-size: 13.5px; color: var(--muted); margin: 11px 0 0; }
.nextcard .why b { color: var(--ink); font-weight: 600; }
.meta-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 10px; }
.chip.time { background: #E9F2F8; color: #0A6390; font-family: var(--f-mono); font-weight: 600; }
:root[data-theme="dark"] .chip.time { background: rgba(79, 169, 214, .16); color: var(--primary); }
.chip.hard { background: var(--crit-bg); color: var(--crit); }
.chip.moderate { background: var(--warn-bg); color: var(--warn); }
.chip.easy { background: var(--good-bg); color: var(--good); }

/* ---- domain performance chart ---------------------------------------------------
   Thresholds at 60 and 80 are drawn, so "Competent" is a position on a scale
   rather than a word. An untested row recedes; it does not shout. */
.domrow {
  display: grid; grid-template-columns: 172px 1fr 46px 92px;
  gap: 0 14px; align-items: center; padding: 9px 0;
}
.domrow + .domrow { border-top: 1px solid var(--hair-soft); }
.domrow .name { font-size: 13.5px; font-weight: 500; }
.domrow .track { position: relative; height: 9px; border-radius: 5px; background: var(--hair-soft); }
.domrow .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.domrow .track.none { background: repeating-linear-gradient(90deg, var(--hair) 0 5px, transparent 5px 10px); }
.domrow .thr { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--hair); }
:root[data-theme="dark"] .domrow .thr { background: #3A4553; }
.domrow .val { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; text-align: right; }
.domrow .val.none { color: var(--faint); font-weight: 400; }
.domrow .stat-word { font-family: var(--f-head); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; text-align: right; }
.domrow .stat-word.strong { color: var(--good); }
.domrow .stat-word.competent { color: var(--warn); }
.domrow .stat-word.needs-work { color: var(--crit); }
.domrow .stat-word.untested { color: var(--faint); }
.dom-axis { display: grid; grid-template-columns: 172px 1fr 46px 92px; gap: 0 14px; margin-top: 8px; }
.dom-axis .scale { position: relative; height: 14px; }
.dom-axis .scale span { position: absolute; transform: translateX(-50%); top: 0; font-family: var(--f-mono); font-size: 10.5px; color: var(--faint); }
.dom-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--hair-soft); }
.dom-note b { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) {
  .domrow { grid-template-columns: 1fr 44px 88px; gap: 4px 10px; }
  .domrow .track { grid-column: 1 / -1; order: 3; }
  .dom-axis { display: none; }
}

/* ---- week panel ------------------------------------------------------------------ */
.week { display: flex; gap: 18px; align-items: center; }
.ring { position: relative; width: 78px; height: 78px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; }
.wlines { flex: 1; min-width: 0; }
.wrow { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; padding: 5px 0; }
.wrow + .wrow { border-top: 1px solid var(--hair-soft); }
.wrow b { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.wrow b u { text-decoration: none; color: var(--faint); font-weight: 400; }

/* ---- recent activity -------------------------------------------------------------- */
.actrow { display: grid; grid-template-columns: 28px 1fr auto; gap: 11px; align-items: center; padding: 9px 0; }
.actrow + .actrow { border-top: 1px solid var(--hair-soft); }
.actrow .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--hair-soft); color: var(--navy); }
:root[data-theme="dark"] .actrow .ic { color: var(--ink-2); }
.actrow .ic.sba { background: #E9F2F8; color: var(--primary); }
:root[data-theme="dark"] .actrow .ic.sba { background: rgba(79, 169, 214, .16); }
.actrow .t { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.3; text-decoration: none; color: var(--ink); }
.actrow .t:hover { color: var(--primary); }
.actrow .s { display: block; font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.actrow .v { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; }
.actrow .v.strong { color: var(--good); }
.actrow .v.competent { color: var(--warn); }
.actrow .v.needs-work { color: var(--crit); }

/* ---- exam bar (drill and station play) ---------------------------------------------
   Replaces the floating yellow chip. The clock is the most legible object on
   the screen and it changes colour as time runs out; one pip per question
   means you can see how the paper is going at question 14 of 20. */
.playbar {
  display: block; padding: 11px 0 0; margin-bottom: 18px;
  border-bottom: 1px solid var(--hair);
}
.playbar-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.timer {
  font-family: var(--f-mono); font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 600; letter-spacing: -.01em;
  background: transparent; color: var(--ink); padding: 0; border-radius: 0;
}
.timer.warn { color: var(--warn); }
.timer.low { background: transparent; color: var(--signal); }
.timer.idle { background: transparent; color: var(--faint); }
.timer-label { font-family: var(--f-head); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.mode-chip {
  font-family: var(--f-head); font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; background: #E9F2F8; color: #0A6390;
  border-radius: var(--radius-sm); padding: 4px 10px;
}
:root[data-theme="dark"] .mode-chip { background: rgba(79, 169, 214, .16); color: var(--primary); }
.qcount { margin-left: auto; font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.qcount b { color: var(--ink); font-weight: 600; }
.pips { display: flex; gap: 3px; padding: 12px 0 10px; }
.pip { flex: 1; height: 4px; border-radius: 2px; background: var(--hair); min-width: 2px; }
.pip.q2 { background: var(--good); }
.pip.q1 { background: var(--warn); }
.pip.q0 { background: var(--crit); }
.pip.answered { background: var(--primary); }
.pip.now { background: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 28%, transparent); }
/* A station's decision count is not known up front (the tree branches), so
   its pips are fixed-width steps that accumulate rather than a bar that
   fills. One red pip stretched across the screen read as an alarm. */
.pips-steps { gap: 4px; }
.pips-steps .pip { flex: 0 0 30px; }
@media (max-width: 620px) {
  .mode-chip, .qcount { display: none; }
  .playbar-row { gap: 10px; }
}

/* ---- options -------------------------------------------------------------------- */
.opt {
  grid-template-columns: 34px 1fr 22px; gap: 14px; align-items: center;
  border-width: 1.5px; border-radius: 11px; padding: 14px 16px; font-size: 15.5px;
}
.opt .key {
  width: 29px; height: 29px; border-radius: 8px; border: 0;
  background: var(--hair-soft); color: var(--ink-2);
  font-size: 13.5px; font-weight: 600;
}
.opt.q2 .key { background: var(--good); color: #fff; }
.opt.q1 .key { background: var(--warn); color: #fff; }
.opt.q0 .key { background: var(--crit); color: #fff; }
.opt .verdict-ic { display: inline-flex; align-items: center; justify-content: center; opacity: 0; }
.opt.q2 .verdict-ic { opacity: 1; color: var(--good); }
.opt.q1 .verdict-ic { opacity: 1; color: var(--warn); }
.opt.q0 .verdict-ic { opacity: 1; color: var(--crit); }
/* Once an answer is revealed, the options that were neither chosen nor correct
   step back so the pair that matters reads at a glance. */
.options:has(.q2) .opt:not(.q2):not(.q1):not(.q0) { opacity: .62; }
.opt:hover:not(:disabled) { border-color: var(--primary); }

/* ---- verdict panel ---------------------------------------------------------------- */
.feedback {
  position: relative; border-radius: var(--radius-lg); border: 1px solid var(--hair);
  border-left-width: 1px; padding: 16px 18px 16px 52px; margin-top: 20px;
}
.feedback::before {
  content: ""; position: absolute; left: 18px; top: 17px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--muted);
  background-repeat: no-repeat; background-position: center; background-size: 13px;
}
.feedback.q2 { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 34%, transparent); }
.feedback.q1 { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 34%, transparent); }
.feedback.q0 { background: var(--crit-bg); border-color: color-mix(in srgb, var(--crit) 34%, transparent); }
.feedback.q2::before {
  background-color: var(--good);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7'/></svg>");
}
.feedback.q1::before {
  background-color: var(--warn);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'><path d='M12 6v8M12 18h.01'/></svg>");
}
.feedback.q0::before {
  background-color: var(--crit);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'><path d='M7 7l10 10M17 7L7 17'/></svg>");
}
.feedback .eyebrow { margin-bottom: 5px; font-size: 12px; letter-spacing: .04em; }
.feedback p:not(.eyebrow) { font-size: 15px; line-height: 1.55; }
.q2-text { color: var(--good); } .q1-text { color: var(--warn); } .q0-text { color: var(--crit); }

/* ---- "Where this comes from" -------------------------------------------------------
   Every word the authoring side wrote is kept. Only the rendering changes:
   an icon tile per source type, the page reference as a chip, linked titles
   that look like links, and the metadata on its own quiet footer. */
.refs {
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--radius-lg); padding: 13px 18px 6px; margin-top: 16px;
}
.refs > .eyebrow { color: var(--muted); margin-bottom: 4px; }
.refs-collapsed { padding: 0; }
.refs-collapsed > summary { padding: 9px 16px; }
.refs-collapsed > *:not(summary) { padding: 0 16px; }
.ref-list { gap: 0; }
.ref { gap: 12px; padding: 10px 0; align-items: flex-start; }
.ref + .ref { border-top: 1px solid var(--hair-soft); }
.ref-glyph {
  flex: none; width: 26px; height: 26px; padding: 6px; margin-top: 0;
  border-radius: 7px; background: var(--hair-soft); color: var(--navy);
  box-sizing: border-box;
}
:root[data-theme="dark"] .ref-glyph { color: var(--ink-2); }
.ref-head { font-size: 14.5px; font-weight: 600; line-height: 1.35; gap: 0; }
.ref-body a { color: var(--primary); text-decoration: none; }
.ref-body a:hover { text-decoration: underline; }
.ref-pages {
  font-family: var(--f-mono); font-size: 12.5px; font-weight: 500;
  color: #fff; background: var(--navy); border-radius: 5px;
  padding: 1.5px 6px; margin-left: 8px;
}
:root[data-theme="dark"] .ref-pages { background: #3A4A5E; color: var(--ink); }
.ref-detail { font-size: 13px; color: var(--muted); margin-top: 3px; }
.ref-org { font-size: 10.5px; letter-spacing: .1em; color: var(--faint); }
.ref-places { gap: 3px; margin-top: 4px; }
.ref-meta {
  margin: 8px -18px 0; padding: 11px 18px; border-top: 1px solid var(--hair);
  background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.ref-meta > .mono { font-size: 11.5px; color: var(--faint); }
.refs-collapsed .ref-meta { margin-inline: 0; border-radius: 0; }
.flag-btn { border-color: var(--hair); padding: 6px 11px; margin: 0; border-radius: var(--radius-sm); font-size: 12.5px; }
.flag-btn:hover { border-color: var(--muted); }

/* ---- station play: the scene stays on screen -------------------------------------- */
.scene-brief {
  background: var(--surface-2); border: 1px solid var(--hair);
  border-radius: var(--radius-lg); padding: 13px 16px; margin-bottom: 16px;
  font-size: 14px; color: var(--ink-2); line-height: 1.5;
}
.scene-brief .eyebrow { margin-bottom: 4px; }

/* ---- lists, badges, misc ------------------------------------------------------------ */
.list li { border-bottom-color: var(--hair-soft); }
.table th, .table td { border-bottom-color: var(--hair-soft); }
.station-card .title { font-family: var(--f-body); font-weight: 700; font-size: 18px; letter-spacing: -.012em; }
.card-link { border-radius: var(--radius-lg); }
.card-link:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.badge { border-radius: var(--radius-lg); }
.badge.earned { border-color: var(--hair); }
.badge .mark { background: var(--hair-soft); color: var(--faint); }
.badge.earned .mark { background: var(--primary); color: var(--primary-ink); }
.badge .name { font-family: var(--f-body); font-weight: 700; letter-spacing: -.01em; }
.notice { border-radius: var(--radius-lg); }
.toast { border-radius: var(--radius); }
.preview-banner {
  background: var(--warn-bg); color: var(--warn);
  font-family: var(--f-body); font-weight: 600; letter-spacing: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}
.skip { border-radius: var(--radius-sm); background: var(--primary); color: var(--primary-ink); }
.filters select { border-radius: var(--radius); }
.score-big { font-weight: 600; letter-spacing: -.03em; }

/* Stat cards keep working wherever they are still used, but they go 2×2 on a
   phone rather than four full-width blocks down the page. */
.stat-value { font-weight: 600; letter-spacing: -.02em; }
@media (max-width: 899px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 380px) { .grid-4 { grid-template-columns: 1fr; } }

/* Dashboard two-column split: the content area is wide, so use it. */
@media (min-width: 1100px) {
  .dash-cols { display: grid; grid-template-columns: 1.62fr 1fr; gap: 18px; align-items: start; }
  .dash-cols > .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  .dash-cols .card { margin-top: 0; }
}
@media (max-width: 1099px) {
  .dash-cols { display: flex; flex-direction: column; gap: 14px; }
  .dash-cols > .col { display: flex; flex-direction: column; gap: 14px; }
}

/* The header at phone width -------------------------------------------------
   The account control loses its label under 520px and was rendering as an
   empty bordered box; auth.js owns that button's contents, so the glyph is
   supplied here as a mask that follows currentColor. The countdown pill is
   dropped on a phone — the band on the dashboard carries the same figure,
   larger, and the header has no room for it. */
.brand-name { white-space: nowrap; }
@media (max-width: 560px) {
  .topbar-countdown { display: none; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-mark svg { width: 17px; height: 17px; }
  .brand-name { font-size: 16px; }
}
@media (max-width: 520px) {
  .account-btn { min-width: 34px; justify-content: center; }
  .account-btn:not(:has(.account-initial))::before {
    content: ""; width: 17px; height: 17px; flex: none;
    background-color: currentColor;
    -webkit-mask: var(--ico-person) center / 17px no-repeat;
    mask: var(--ico-person) center / 17px no-repeat;
  }
}
