/* BridgePharmacist — design system (tokens consolidated 2026-10-14, docs/UI-SCREEN-INVENTORY-2026-10-14.md)
   Identity: ink navy, warm canvas, restrained gold. A small coordinated accent set (teal, plum, sky) with tinted
   backgrounds tells related sections apart; it is decorative only. Status colours are separate and always come with
   words: ok (green) · attention (amber — an ordinary deduction or something to practise) · serious (red — a confirmed
   safety issue or a destructive action, nothing else) · system (slate — technical, pending, not settled, withheld). */
:root {
  /* identity */
  --ink: #102A43; --ink-2: #243B53; --ink-soft: #334E68; --muted: #52708A; --faint: #9FB3C8;
  --canvas: #FAF9F6; --card: #FFFFFF; --line: #E8E3DA; --line-soft: #F0ECE4;
  --navy: #1B3A56; --navy-deep: #0F2740;
  --gold: #B7791F; --gold-deep: #975E12; --gold-soft: #F6EBD8; --gold-line: #EAD9B8;
  /* decorative accents + tints (section identity, never status) */
  --teal: #2C6E73; --teal-soft: #E3F0F0; --teal-line: #C5DEDF;
  --plum: #6B4C7A; --plum-soft: #F1EAF4; --plum-line: #DCCDE3;
  --sky: #2F5D8A; --sky-soft: #E6EEF7; --sky-line: #C9D9EA;
  --sand-soft: #FBF7EF;
  /* status — always paired with text */
  --ok: #2E6A4F; --ok-soft: #E6F2EB; --ok-line: #BFDCCB;
  --attn: #7A4E06; --attn-soft: #FBF1DE; --attn-line: #EBD3A4;
  --serious: #A12C2C; --serious-soft: #FBEAEA; --serious-line: #EBC1C1;
  --system: #4A5568; --system-soft: #EEF1F5; --system-line: #D3DAE3;
  /* legacy names (older rules and inline styles) map onto the status set */
  --good: var(--ok); --good-soft: var(--ok-soft); --bad: var(--serious); --bad-soft: var(--serious-soft); --warn: var(--attn);
  /* spacing, type, shape */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --fs-xs: .75rem; --fs-sm: .85rem; --fs-md: 1rem; --fs-lg: 1.15rem; --fs-xl: 1.35rem; --fs-2xl: 1.7rem;
  --r: 14px; --r-sm: 10px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(16,42,67,.05), 0 4px 14px rgba(16,42,67,.06);
  --shadow-lift: 0 2px 6px rgba(16,42,67,.08), 0 10px 28px rgba(16,42,67,.10);
  --focus: 0 0 0 3px rgba(151,94,18,.45);
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: var(--sans); background: var(--canvas); color: var(--ink); line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
  background-image: radial-gradient(1200px 400px at 50% -200px, #FFFDF9 0%, var(--canvas) 70%);
}

/* ---- header: deep navy, gold hairline ---- */
header.app {
  background: linear-gradient(180deg, var(--navy-deep), #0B1F31);
  color: #fff; padding: calc(14px + env(safe-area-inset-top)) 18px 13px;
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  border-bottom: 2px solid var(--gold);
}
header.app h1 { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; letter-spacing: .01em; flex: 1; text-align: center; }
header.app .sub { font-family: var(--sans); font-size: .70rem; opacity: .72; display: block; font-weight: 400; letter-spacing: .06em; margin-top: 1px; }
main { max-width: 780px; margin: 0 auto; padding: 18px 16px 88px; }

/* ---- filters: pinned while the station list scrolls ---- */
.filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
  position: sticky; top: 62px; z-index: 15;
  background: linear-gradient(180deg, var(--canvas) 82%, rgba(250,249,246,0));
  padding: 8px 0 12px;
}
.group-head {
  font-family: var(--serif); font-size: 1.02rem; font-weight: 600; color: var(--ink-2);
  margin: 20px 2px 10px; padding-bottom: 6px; border-bottom: 2px solid var(--gold);
  display: flex; justify-content: space-between; align-items: baseline;
}
.group-head .n { font-family: var(--sans); font-size: .72rem; color: var(--muted); font-weight: 600; }
.filters select, .filters input[type=search] {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-size: .87rem;
  background: var(--card); color: var(--ink); flex: 1; min-width: 132px; box-shadow: var(--shadow);
  appearance: none; -webkit-appearance: none; font-family: var(--sans);
}
.filters input[type=search]:focus, .filters select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.count-note { font-size: .78rem; color: var(--muted); margin: 6px 2px 12px; letter-spacing: .02em; }
.rowbtns { display: flex; gap: 10px; margin-bottom: 16px; }

/* ---- buttons: gold = commit, navy = navigate, ghost = quiet ---- */
.btn {
  border: 0; border-radius: 11px; padding: 12px 18px; font-size: .92rem; font-weight: 600;
  background: var(--navy); color: #fff; cursor: pointer; font-family: var(--sans);
  box-shadow: var(--shadow); transition: transform .06s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--card); color: var(--navy-deep); border: 1px solid var(--line); }
.btn.big { width: 100%; padding: 15px; font-size: 1rem; border-radius: 12px; }
.btn.gold { background: linear-gradient(180deg, #9E6416, #8A5510); box-shadow: var(--shadow-lift); }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .45; }

/* ---- case cards ---- */
.case-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.case-card:hover { box-shadow: var(--shadow-lift); border-color: var(--faint); }
.case-card h3 { font-family: var(--serif); font-size: 1.0rem; font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: .66rem; padding: 3px 9px; border-radius: 99px; background: var(--line-soft);
  color: var(--ink-soft); text-transform: capitalize; letter-spacing: .03em; font-weight: 500;
}
.tag.d1 { background: var(--teal-soft); color: var(--teal); }
.tag.d2 { background: var(--sky-soft); color: var(--sky); }
.tag.d3 { background: var(--plum-soft); color: var(--plum); }
.tag.done { background: var(--navy); color: #fff; }

/* ---- station stage ---- */
.stage {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.stage h2 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.door { font-size: .95rem; white-space: pre-wrap; color: var(--ink-2); }
.kicker {
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep);
  font-weight: 700; margin-bottom: 8px;
}
.timer {
  font-variant-numeric: tabular-nums; font-family: var(--serif); font-size: 3.2rem; font-weight: 600;
  text-align: center; padding: 10px 0 2px; color: var(--ink); letter-spacing: .01em;
}
.timer.warn { color: var(--attn); } .timer.over { color: var(--attn); text-decoration: underline; text-decoration-thickness: 2px; }
.timer-label { text-align: center; font-size: .76rem; color: var(--muted); margin-bottom: 12px; letter-spacing: .04em; }
.sp-block {
  border-left: 3px solid var(--navy); padding: 10px 14px; margin: 10px 0;
  background: #FBFAF7; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: .9rem;
}
.sp-block b { color: var(--navy-deep); }
details.spoiler { border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin: 10px 0; background: var(--card); }
details.spoiler summary { font-weight: 600; font-size: .88rem; color: var(--navy-deep); cursor: pointer; }

/* ---- checklist ---- */
.dim { margin: 16px 0 6px; font-size: .70rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.check {
  display: flex; gap: 11px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); margin-bottom: 6px; background: var(--card); font-size: .88rem; cursor: pointer;
}
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--good); flex: none; }
.check.fail { border-color: #E8C4C4; background: var(--bad-soft); }
/* 2026-10-12: a long status pill ("Possible inaccuracies identified — see details") is flex:none, so on a phone it pushed
   the row's text past the screen and the whole result page grew wider than the phone. The pill now wraps within a share of
   the row, and the text beside it may shrink and break long words. */
.check > .pill[style*="flex:none"] { max-width: 42%; }   /* the status pill beside a text column, not a row of pills */
.check > span:not(.pill) { min-width: 0; overflow-wrap: break-word; }
.check.fail input { accent-color: var(--bad); }
.scorebar { font-size: .95rem; font-weight: 600; padding: 12px 2px; font-family: var(--serif); }

/* ---- log ---- */
table.log { width: 100%; border-collapse: collapse; font-size: .84rem; background: var(--card); border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow); }
table.log th { text-align: left; padding: 9px 10px; background: var(--navy-deep); color: #fff; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
table.log td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
/* phones (final retest 2026-10-12: History was 383–401 px wide at 360/390): each row stacks — the station line on its own,
   then band, score and date on one wrapping line; no column can push the page wider than the screen */
@media (max-width: 560px) {
  table.log, table.log tbody, table.log tr { display: block; width: 100%; }
  table.log tr:first-child:has(th) { display: none; }
  table.log th { display: none; }
  table.log tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
  table.log td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  table.log td:first-child { flex: 1 1 100%; }
  table.log td:not(:first-child) { font-size: .78rem; }
  table.log .tag { white-space: normal; display: inline-block; max-width: 100%; }
}
.pill { font-weight: 700; }
.pill.good { color: var(--ok); } .pill.mid { color: var(--gold-deep); } .pill.bad { color: var(--serious); }
.pill.attn { color: var(--attn); } .pill.sys { color: var(--system); }
/* status chips: a pill beside text is a tinted chip; colour is never the only signal (the chip always has words) */
span.pill { display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); font-size: .74rem; line-height: 1.45; letter-spacing: .01em; background: var(--line-soft); border: 1px solid transparent; }
span.pill.good { background: var(--ok-soft); border-color: var(--ok-line); }
span.pill.mid { background: var(--gold-soft); border-color: var(--gold-line); }
span.pill.attn { background: var(--attn-soft); border-color: var(--attn-line); border-style: dashed; }
span.pill.bad { background: var(--serious-soft); border-color: var(--serious-line); }
span.pill.sys { background: var(--system-soft); border-color: var(--system-line); }
.check.sys { background: var(--system-soft); border-color: var(--system-line); }
.check.attn-row { background: var(--attn-soft); border-color: var(--attn-line); }

/* ---- tabs ---- */
nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: 6px; background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 20;
}
nav.tabs button {
  flex: 1; border: 0; background: #E9EFF5; border-radius: var(--r-sm); padding: 11px 4px;
  font-size: .8rem; color: var(--ink-2);
  font-weight: 600; font-family: var(--sans); letter-spacing: .03em; position: relative;
  transition: background .15s, color .15s; min-height: 44px;
}
nav.tabs button.on {
  background: var(--navy-deep); color: #fff; font-weight: 700;
  box-shadow: 0 2px 8px rgba(15,39,64,.28);
}
.notice {
  background: var(--gold-soft); border: 1px solid #EAD9B8; color: #6B4A12;
  border-radius: var(--r-sm); padding: 11px 14px; font-size: .8rem; margin-bottom: 14px;
}
.center { text-align: center; }
.mt { margin-top: 12px; }
.fieldline { font-size: .86rem; color: var(--ink-2); display: flex; gap: 10px; margin: 7px 0; align-items: baseline; }
.tr-ic { display: flex; align-items: center; color: var(--gold-deep); flex: none; }
.trapline {
  display: block; font-size: .74rem; color: var(--muted); margin-top: 7px;
  border-top: 1px dashed var(--line); padding-top: 6px; line-height: 1.45;
}
.trapline b { color: var(--ink-soft); }
/* ---- home hero + tiles (glossy, restrained) ---- */
.hero-home {
  background: linear-gradient(160deg, var(--navy-deep) 0%, #0B1F31 60%, #12283C 100%);
  border: 0; position: relative; overflow: hidden; text-align: center;
}
.hero-home h2, .hero-home p { margin-left: auto; margin-right: auto; }
.hero-home::after {
  content: ""; position: absolute; top: -60%; left: -20%; width: 80%; height: 160%;
  background: linear-gradient(115deg, rgba(255,255,255,.07), rgba(255,255,255,0) 55%);
  transform: rotate(8deg); pointer-events: none;
}
.grid-home { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile { margin: 0; cursor: pointer; padding: 16px 14px; text-align: center; }
.tile b { font-family: var(--serif); font-size: 1.02rem; display: block; }
.tile span { font-size: .76rem; color: var(--muted); }
.tile:active { transform: scale(.985); }
.btn { position: relative; }
.btn.gold, .btn:not(.ghost):not(.danger) { box-shadow: inset 0 1px 0 rgba(255,255,255,.25), var(--shadow); }
.slogan {
  font-family: var(--serif); font-style: italic; font-size: 1.02rem; color: var(--ink-soft);
  border-left: 3px solid var(--gold); padding: 4px 0 4px 14px; margin: 14px 0;
}

/* ---- desktop layout (wide screens) ---- */
@media (min-width: 1000px) {
  main { max-width: 1140px; padding: 26px 28px 96px; }
  #app { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 18px; align-items: start; }
  #app > * { grid-column: 1 / -1; min-width: 0; }
  #app > .case-card { grid-column: auto; }
  .grid-home { grid-template-columns: repeat(4, 1fr); }
}

/* quieter secondary metadata on station cards */
.tag.quiet { background: transparent; color: var(--muted); padding-left: 2px; text-transform: none; letter-spacing: 0; }
/* coach graphics — bands and squares, never gauges */
.next-card { border: 1.5px solid var(--gold); background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; margin: 8px 0 4px; cursor: pointer; }
.next-card:focus { outline: 2px solid var(--gold-deep); }
.dots { display: flex; align-items: flex-end; gap: 6px; height: 46px; padding: 4px 0 0; position: relative; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--navy); margin-bottom: calc(var(--lvl) * 10px); opacity: .85; }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--gold); }
.dots-scale { position: absolute; right: 0; top: 0; display: flex; flex-direction: column; justify-content: space-between; height: 46px; font-size: .6rem; color: var(--muted); text-align: right; }
.dots-scale i { font-style: normal; line-height: 1; }
.bandbar { display: grid; grid-template-columns: 150px 1fr 150px; align-items: center; gap: 10px; margin: 6px 0; font-size: .82rem; }
.bb-label { color: var(--ink); }
.bb-track { position: relative; display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line-soft); }
.bb-zone { flex: 1; } .bb-zone.z1 { flex: 0 0 50%; background: var(--attn-soft); } .bb-zone.z2 { flex: 0 0 25%; background: var(--gold-soft); } .bb-zone.z3 { flex: 0 0 25%; background: var(--good-soft); }
.bb-mark { position: absolute; top: 0; width: 4px; height: 12px; margin-left: -2px; background: var(--navy); border-radius: 2px; }
.bb-mark.strong { background: var(--good); } .bb-mark.developing { background: var(--attn); }
.bb-n { color: var(--muted); font-size: .76rem; text-transform: capitalize; }
.phase-strip { font-size: .8rem; }
.ps-row { display: flex; align-items: center; gap: 4px; margin: 3px 0; }
.ps-label { width: 22px; font-weight: 700; color: var(--ink); }
.ps-sq { width: 16px; height: 16px; border-radius: 3px; background: var(--line-soft); display: inline-block; }
.ps-sq.met { background: var(--good); } .ps-sq.partial { background: var(--gold); } .ps-sq.missed { background: #FFFFFF; box-shadow: inset 0 0 0 2px var(--attn); }
.ps-key { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: .7rem; color: var(--muted); }
@media (max-width: 520px) { .bandbar { grid-template-columns: 110px 1fr; } .bb-n { grid-column: 2; margin-top: -4px; } }

.grid-recent { display: grid; grid-template-columns: 1fr; gap: 10px; }
.grid-recent .case-card { margin: 0; }
@media (min-width: 760px) { .grid-recent { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 400px) { nav.tabs { gap: 4px; padding-left: 6px; padding-right: 6px; } nav.tabs button { font-size: .72rem; letter-spacing: 0; padding-left: 2px; padding-right: 2px; } }

/* coach plans: only the top loop open by default */
details.plan-fold { border: 1px solid var(--line); border-radius: 10px; padding: 0; margin-top: 8px; background: var(--card); }
details.plan-fold > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-size: .9rem; }
details.plan-fold > summary::-webkit-details-marker { display: none; }
details.plan-fold > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 700; }
details.plan-fold[open] > summary::after { content: "–"; }
details.plan-fold > summary:focus-visible { outline: 2px solid var(--gold-deep); border-radius: 10px; }
details.plan-fold > .check { margin: 0 8px 8px; }
/* station brief: keep every role button inside the first desktop screen */
.brief-door { font-size: .9rem; line-height: 1.5; margin-bottom: 2px; }
.rec-line { padding: 6px 10px; }
@media (min-width: 760px) { .brief-door + * .btn.big, .stage .btn.big.mt { margin-top: 8px; } .brief-door { font-size: .88rem; } }


/* ════════════ shared components (2026-10-14) ════════════ */
/* focus: one visible style for every interactive element */
:where(a, button, input, select, textarea, summary, [role=button], [tabindex]):focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; box-shadow: var(--focus); border-radius: 6px; }
.msg[tabindex="-1"]:focus { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
a { color: var(--navy); }
/* buttons: gold = the one primary action on a screen, navy = commit/navigate, ghost = alternative, danger = destructive */
.btn { min-height: 44px; }
.btn.ghost:hover { border-color: var(--faint); }
.btn.quiet { background: transparent; color: var(--navy-deep); border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; padding: 10px 6px; }
.btn.small { padding: 7px 12px; font-size: .82rem; min-height: 36px; }
.btn-group { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.btn-group.center { justify-content: center; }
/* section tints: related sections share a tint; status never borrows them */
.tint-teal { background: var(--teal-soft); border-color: var(--teal-line); }
.tint-plum { background: var(--plum-soft); border-color: var(--plum-line); }
.tint-sky { background: var(--sky-soft); border-color: var(--sky-line); }
.tint-gold { background: var(--gold-soft); border-color: var(--gold-line); }
.tint-sand { background: var(--sand-soft); }
/* cards carry one plain neutral border (.stage); no coloured top line (owner 2026-10-23, pinned in card-highlights-2026-10-23.test.mjs) */
.kicker.teal { color: var(--teal); } .kicker.plum { color: var(--plum); } .kicker.sky { color: var(--sky); }
/* balanced grids for comparable choices; cards in a row share height and keep their action at the bottom */
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--s3); grid-template-columns: 1fr; margin-bottom: 14px; align-items: stretch; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.choice { display: flex; flex-direction: column; gap: var(--s2); margin: 0; min-width: 0; }
.choice h3 { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.choice p { font-size: .88rem; color: var(--ink-2); }
.choice .facts { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.choice .facts b { color: var(--ink-2); font-weight: 600; }
.choice > .btn-group, .choice > .btn:last-child { margin-top: auto; padding-top: var(--s2); }
.stage > h3.section-title, .section-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin: 0 0 6px; }
/* primary next-step card (resume first) */
.resume { border: 1.5px solid var(--gold); background: linear-gradient(180deg, #FFFDF8, var(--gold-soft)); }
.resume .row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; justify-content: space-between; }
.resume .what { min-width: 0; flex: 1 1 240px; }
.resume .what b { font-family: var(--serif); font-size: 1.05rem; display: block; }
.resume .what span { font-size: .84rem; color: var(--ink-2); }
/* system notes: pending, saved-not-graded, technical, connection — never styled as a clinical result */
.sys-note, #score-status:not(:empty) { background: var(--system-soft); border: 1px solid var(--system-line); color: var(--ink-2); border-radius: var(--r-sm); padding: 10px 14px; font-size: .86rem; text-align: left; margin: 8px 0; }
.sys-note b { color: var(--ink); }
.sys-note .btn, #score-status .btn { margin-left: 6px; }
/* disclosures: optional detail, opened deliberately; one look everywhere */
details.disc { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); margin: 0 0 8px; }
details.disc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 48px; font-weight: 600; font-size: .92rem; color: var(--navy-deep); }
details.disc > summary::-webkit-details-marker { display: none; }
details.disc > summary::before { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--gold-deep); border-bottom: 2px solid var(--gold-deep); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details.disc[open] > summary::before { transform: rotate(45deg); }
details.disc > summary .disc-meta { margin-left: auto; font-weight: 500; font-size: .78rem; color: var(--muted); text-align: right; }
details.disc > .disc-body { padding: 2px 14px 14px; border-top: 1px solid var(--line-soft); }
details.disc[open] > summary { border-bottom: 0; }
.disc-group { margin-top: 14px; }
.disc-group > .dim:first-child { margin-top: 0; }
/* ── result: one presentation for every result (spoken, partner, written, circuit, fresh and reopened) ── */
.result { text-align: left; }
.result-head { border-radius: var(--r); padding: 16px 18px; margin: 4px 0 12px; border: 1px solid var(--line); background: var(--card); border-left-width: 5px; }
.result-head .result-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.result-head .result-kicker { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.result-head .result-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.25; margin: 2px 0 2px; outline: none; }
.result-head .result-sub { font-size: .9rem; color: var(--ink-2); }
.result-head .result-explain { font-size: .86rem; color: var(--ink-2); margin-top: 8px; }
.result-head[data-tone=good] { border-left-color: var(--ok); } .result-head[data-tone=good] .result-title { color: var(--ok); }
.result-head[data-tone=steady] { border-left-color: var(--gold); } .result-head[data-tone=steady] .result-title { color: var(--gold-deep); }
.result-head[data-tone=attention] { border-left-color: var(--attn); } .result-head[data-tone=attention] .result-title { color: var(--attn); }
.result-head[data-tone=serious] { border-left-color: var(--serious); background: var(--serious-soft); border-color: var(--serious-line); } .result-head[data-tone=serious] .result-title { color: var(--serious); }
.result-head[data-tone=system] { border-left-color: var(--system); background: var(--system-soft); border-color: var(--system-line); } .result-head[data-tone=system] .result-title { color: var(--ink); }
.result-section { margin: 0 0 12px; }
.result-section > .dim:first-child { margin-top: 0; }
.result-safety { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--card); margin-bottom: 12px; }
.result-safety.has-issue { border-color: var(--serious-line); }
.result-safety > .dim:first-child { margin-top: 0; }
.result-summary { margin-bottom: 12px; }
.result-summary .card-s { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; min-width: 0; }
.result-summary .card-s .dim { margin: 0 0 6px; }
.result-summary .card-s b { font-weight: 600; }
.result-summary .card-s p { font-size: .88rem; }
.result-summary .card-s .note { color: var(--ink-2); font-size: .84rem; margin-top: 4px; }
.result-summary ol { margin: 0; padding-left: 20px; font-size: .9rem; } .result-summary ol li + li { margin-top: 6px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 4px 0 16px; }
.result-actions:empty { display: none; }
.result-details-title { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 16px 0 8px; }
.result-footnote { margin-top: 10px; }
#transcript:not(:empty) { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 14px 10px; margin: 0 0 8px; background: var(--card); }
#transcript > .dim:first-child { margin-top: 10px; }
/* the coach and the demonstration sit below the details */
#coach-box .msg { max-width: 100%; }
/* chapter / category navigation for long collections */
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.jump a, .jump button { font-size: .8rem; padding: 6px 11px; border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--line); color: var(--navy-deep); text-decoration: none; font-weight: 600; min-height: 34px; display: inline-flex; align-items: center; cursor: pointer; font-family: var(--sans); }
.jump a:hover, .jump button:hover { border-color: var(--gold); }
.jump button[aria-pressed=true] { background: var(--navy-deep); color: #fff; border-color: var(--navy-deep); }
/* empty and error states */
.empty { text-align: center; padding: 22px 16px; }
.empty p { color: var(--ink-2); font-size: .92rem; max-width: 52ch; margin: 6px auto 0; }
/* long labels never push a page wider than the screen */
.case-card h3, .choice h3, .resume .what b, .check span, .dim { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .result-head { padding: 14px 14px; } .result-head .result-title { font-size: 1.3rem; }
  .result-actions .btn { flex: 1 1 100%; }
  details.disc > summary { flex-wrap: wrap; } details.disc > summary .disc-meta { margin-left: 18px; text-align: left; flex-basis: 100%; }
}
.result-title:focus { outline: none; box-shadow: none; }
.tile { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 92px; }
.tile:hover { box-shadow: var(--shadow-lift); }
.hero-home .btn.gold { max-width: 420px; }
details.disc .disc-body > .stage { border: 0; box-shadow: none; padding: 8px 0 0; margin: 0; background: transparent; }
details.disc .disc-body > .stage > .kicker:first-child { display: none; }
.pending-stage { background: var(--system-soft); border-color: var(--system-line); }
.pending-stage > .kicker { color: var(--system); }
.next-card { background: linear-gradient(180deg, #FFFDF8, var(--gold-soft)); }
[id^="au-"], [id^="ph-"] { scroll-margin-top: 170px; }
[id^="ph-"]:focus { outline: none; }
.btn.quiet { box-shadow: none !important; }
details.disc > summary .disc-label { flex: 1 1 auto; min-width: 0; }
@media (max-width: 560px) {
  /* phones: in a result, the status chip sits above its text instead of squeezing it */
  .result .check { flex-direction: column; gap: 6px; }
  .result .check > .pill[style*="flex:none"] { max-width: 100%; align-self: flex-start; }
  .grid-2 > .choice .btn-group .btn, .choice > .btn { width: 100%; }
}
/* the self-scoring form's critical-fail boxes are choices, not findings: red only once ticked */
label.check.fail { background: var(--card); border-color: var(--serious-line); }
label.check.fail:has(input:checked) { background: var(--serious-soft); }
/* the self-scoring sheet: named sections with a running count and a pinned section bar (2026-10-14) */
.score-nav { position: sticky; top: 62px; z-index: 12; background: linear-gradient(180deg, var(--card) 88%, rgba(255,255,255,0)); padding: 8px 0 10px; margin: 0 0 4px; }
.score-nav .sec-count { font-weight: 500; color: var(--muted); margin-left: 4px; }
.score-sec { border-top: 1px solid var(--line-soft); padding-top: 4px; margin-top: 8px; scroll-margin-top: 124px; }
.score-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.score-sec-head .dim { margin-bottom: 6px; }
.score-sec-head .sec-count { font-size: .78rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
#score-sheet, #scorebar { scroll-margin-top: 76px; }
.score-sheet .scorebar { border-top: 1px solid var(--line); margin-top: 10px; }
.score-nav .sec-label { text-transform: capitalize; }
/* "Ask about this feedback": a quiet secondary action under the practice points (the main action stays "Try again") */
.coach-ask { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--gold-line); }
.coach-ask .btn { background: var(--card); }

/* ---- library study tools (docs/digital-library/DIGITAL-LIBRARY-SPEC-2026-10-21.md §3): phone first — one column at
   375 px, 44 px tap targets, no horizontal scroll ---- */
.linkbtn { background: none; border: 0; color: var(--gold-deep); font: inherit; font-size: .88rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0 2px; min-height: 44px; }
.lib-tile { text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; min-height: 44px; }
.lib-tile:focus-visible, .lib-plan-link:focus-visible { outline: none; box-shadow: var(--focus); }
.lib-tile .kicker { margin-bottom: 2px; }
.lib-tile-text { font-size: .9rem; color: var(--ink-2); }
.lib-plan-link { color: var(--navy-deep); font-size: 1rem; display: inline-flex; align-items: center; min-height: 44px; }
.wb-sec { margin-bottom: 10px; }
.pk-search { margin-bottom: 0; }
.pk-card { padding: 0; }
.pk-card > summary { cursor: pointer; padding: 14px 18px; min-height: 44px; display: flex; align-items: center; list-style: none; }
.pk-card > summary::-webkit-details-marker { display: none; }
.pk-card > summary::after { content: '+'; margin-left: auto; color: var(--muted); font-weight: 700; }
.pk-card[open] > summary::after { content: '–'; }
.pk-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.pk-body { padding: 0 18px 14px; }
.pk-line { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: .92rem; }
.pk-line.hit { background: var(--gold-soft); }
.pk-mark { flex: none; min-width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pk-say { color: var(--ink-2); font-style: italic; }
.pk-gap { min-height: 36px; text-align: left; }
.pk-note { margin-top: 8px; }
.fc-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--canvas); padding: 18px; margin: 6px 0 12px; }
.fc-card h2 { font-size: 1.15rem; }
.fc-card p { margin: 6px 0; font-size: .95rem; }
.fc-meta { font-size: .74rem; color: var(--muted); letter-spacing: .04em; margin-bottom: 6px; }
.fc-q { font-weight: 600; color: var(--navy-deep); }
.fc-back { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; }
.fc-actions { flex-wrap: wrap; }
.fc-actions .btn { flex: 1; min-width: 140px; }
.fc-keys { margin-top: 0; }
.fc-tools { justify-content: flex-end; margin: 0; }
.pp-step p { font-size: .92rem; }
.pt { margin-top: 10px; }
.pt-plan-week + .pt-plan-week { margin-top: 6px; }
.pt-week { margin: 8px 0; }
.pt-title { font-size: .9rem; margin-bottom: 4px; }
.pt-task { align-items: center; min-height: 44px; }
.pt-task input { width: 20px; height: 20px; flex: none; }
.pt-notes-label { display: block; margin: 12px 0 4px; font-size: .88rem; }
#pt-notes, .sr-note, .pm-entry input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; font-size: .95rem; background: var(--card); }
.pm-code { border: 1px dashed var(--gold-line); border-radius: var(--r-sm); background: var(--card); padding: 12px; margin-top: 10px; }
.pm-code-label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.pm-code-text { font-family: ui-monospace, Menlo, monospace; font-size: 1.8rem; font-weight: 700; letter-spacing: .12em; color: var(--navy-deep); }
.pm-entry { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 0 auto 14px; }
.pm-entry input { font-family: ui-monospace, Menlo, monospace; font-size: 1.3rem; letter-spacing: .1em; text-transform: uppercase; min-height: 48px; }
.sr-notes .sr-note-label { display: block; margin: 10px 0 4px; font-size: .88rem; font-weight: 600; }
.sr-notes-out { margin: 8px 0; }
@media (max-width: 560px) { .pm-code-text { font-size: 1.5rem; } .fc-actions .btn { min-width: 0; } }
@media (hover: none) { .fc-keys { display: none; } }

/* ---- printing (spec §5): one screen at a time from the browser's own print. App chrome is hidden; the content and the
   personal watermark always print (the watermark is never hidden here: it stays fixed, so it repeats on every page) ---- */
@media print {
  @page { margin: 14mm 12mm; }
  html, body { background: #fff !important; background-image: none !important; color: #000; font-size: 11.5pt; }
  #tabs, nav.tabs, header.app, .rowbtns, .btn, .btn-group, nav.jump, .filters, .sr-tools, .sr-tabs, .fc-actions, .fc-keys, .fc-tools, .pm-code .btn-group, .primary-bar, #b-backlib, .sr-save .btn, .sr-pick { display: none !important; }
  .sr-choice input[type=radio] { display: none !important; }
  .sr-opt { border: 0; background: none; padding: 0 6px 0 0; min-height: 0; }
  .sr-opt:not(.on) { display: none; }
  .sr-opt.on::before { content: '✓ '; }
  .stage, .check, .fc-card, .pk-card, .sr-item { box-shadow: none !important; background: #fff !important; break-inside: avoid; }
  .stage { border-color: #ccc; }
  main, #app, .wrap, .sr-cols { display: block !important; max-width: none !important; width: auto !important; }
  #app > * { grid-column: auto !important; }
  .sr-col-attempt { position: static !important; max-height: none !important; overflow: visible !important; }
  .pk-card:not([open]) > .pk-body { display: none; }
  .pk-list:not(:has(details[open])) .pk-card > .pk-body { display: block; }
  .pk-list:not(:has(details[open])) .pk-card::details-content { content-visibility: visible; display: block; }
  .pk-card > summary::after { content: ''; }
  .fc-hide-print > :not(h2) { display: none !important; }   /* the answer side, under its gap name */
  a { color: #000; text-decoration: none; }
  #bp-wm, .bp-wm { display: block !important; position: fixed !important; inset: 0 !important; visibility: visible !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #bp-wm text, .bp-wm text { fill-opacity: .12; }
}
