/* ═══════════════════════════════════════════════════════════════════
   Bright site — the ONE copy of the design tokens and chrome.
   Per-site color arrives at runtime: js/site.js sets --accent /
   --accent-bg from site-config.js. Do not fork this file per page.
   ═══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --paper:   #FBFBF9;
  --panel:   #F4F3EF;
  --ink:     #16181D;
  --ink-2:   #3A3F4A;
  --ink-3:   #6A6F7C;
  --rule:    #D6D4CC;
  --accent:  #0B5D5D;      /* overridden from config */
  --accent-bg: #E4EEED;

  --ok:      #1F6F4A;
  --warn:    #8A6212;
  --alert:   #A03323;

  --sans: ui-sans-serif, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --mono: ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;

  --measure: 72ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101216; --panel: #171A20;
    --ink: #E8E9EC; --ink-2: #BFC3CC; --ink-3: #8B909C;
    --rule: #2C313B;
    --accent: #4FA9A4; --accent-bg: #12262A;
    --ok: #6DBE8F; --warn: #D2A44A; --alert: #E08574;
  }
}
:root[data-theme="dark"] {
  --paper: #101216; --panel: #171A20;
  --ink: #E8E9EC; --ink-2: #BFC3CC; --ink-3: #8B909C;
  --rule: #2C313B;
  --accent: #4FA9A4; --accent-bg: #12262A;
  --ok: #6DBE8F; --warn: #D2A44A; --alert: #E08574;
}
:root[data-theme="light"] {
  --paper: #FBFBF9; --panel: #F4F3EF;
  --ink: #16181D; --ink-2: #3A3F4A; --ink-3: #6A6F7C;
  --rule: #D6D4CC;
  --accent: #0B5D5D; --accent-bg: #E4EEED;
  --ok: #1F6F4A; --warn: #8A6212; --alert: #A03323;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--sans);
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; font-family: var(--serif); font-weight: 600; }
code { font-family: var(--mono); font-size: 0.92em; }

/* ── chrome ── */
.topnav {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 20px; border-bottom: 1px solid var(--rule);
  background: var(--paper); position: sticky; top: 0; z-index: 10;
}
.topnav .logo { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.topnav .logo:hover { text-decoration: none; color: var(--accent); }
.topnav .navlinks { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.topnav .navlinks a { color: var(--ink-2); font-size: 0.95rem; }
.topnav .navlinks a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.theme-toggle {
  border: 1px solid var(--rule); background: var(--panel); color: var(--ink-2);
  border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: 0.85rem;
}

/* ── grouped bar (js/site.js navRender) ─────────────────────────────────────
 *
 * Eleven flat links wrapped to two rows and mixed three kinds of thing. The
 * eight content sections now sit in three disclosures behind Home, and the
 * two that were never navigation left: Feedback has a floating button on
 * every page already, and Sign out moved to .navutil on the right.
 *
 * A group opens on CLICK. Not hover -- a hover menu has no touch behaviour,
 * and the burger already established click as the pattern here. */
.topnav .navgroup { position: relative; }
.topnav .navtop {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--ink-2); font: inherit; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 4px;
}
.topnav .navtop:hover { color: var(--accent); }
.topnav .navtop[aria-current="true"] { color: var(--accent); font-weight: 600; }
.topnav .navtop .caret { font-size: 0.7em; opacity: 0.7; }
.topnav .navgroup.open .navtop .caret { transform: rotate(180deg); }
.topnav .navpanel {
  display: none; position: absolute; right: 0; top: calc(100% + 9px);
  min-width: 190px; padding: 6px; z-index: 20;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}
.topnav .navgroup.open .navpanel { display: block; }
.topnav .navpanel a {
  display: block; padding: 8px 10px; border-radius: 7px; white-space: nowrap;
}
.topnav .navpanel a:hover { background: var(--accent-bg); text-decoration: none; }
.topnav .navpanel a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.topnav .navutil { display: flex; align-items: center; gap: 12px; }
.topnav .navutil a { color: var(--ink-3); font-size: 0.9rem; }

/* ── Mobile: collapse the bar behind a burger (<=720px) ─────────────────────
 *
 * Eleven links and a toggle wrap to three rows on a phone and take half the
 * screen before any content starts. Same pattern as brightlathe's
 * bl-topnav.css: the links are hidden under 720px, a burger reveals them as a
 * full-width stack, and a scrim closes it.
 *
 * THE BURGER AND SCRIM ARE INJECTED BY js/site.js, not written into any page.
 * Twenty-one hand-written pages carry their own nav markup (CLAUDE.md part 3,
 * trap 3) and a sweep across them has already shipped a stale menu once today.
 * One stylesheet and one script reach every page at once; markup does not.
 */
#navburger { display: none; }
#navscrim { display: none; }

@media (max-width: 720px) {
  .topnav { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .topnav .logo { order: -1; margin-right: auto; font-size: 1.02rem; }

  #navburger {
    order: 0; display: flex; flex-direction: column; justify-content: center;
    gap: 4px; width: 40px; height: 32px; padding: 0 9px; flex: none;
    background: none; border: 1px solid var(--rule); border-radius: 8px;
    cursor: pointer;
  }
  #navburger span {
    display: block; height: 2px; width: 100%; background: var(--ink-2);
    border-radius: 2px; transition: transform .2s, opacity .2s;
  }

  /* The theme toggle stays on the bar: it is one small control, it is the
     thing a reader reaches for in bed, and burying it costs two taps. */
  .topnav .navlinks { display: none; }

  .topnav.nav-open {
    position: relative; z-index: 10002;
    padding-bottom: 12px; box-shadow: 0 16px 36px rgba(0, 0, 0, .28);
  }
  .topnav.nav-open .navlinks {
    display: flex; flex-direction: column; gap: 0;
    width: 100%; margin-left: 0; order: 3;
  }
  .topnav.nav-open .navlinks a {
    display: block; width: 100%; font-size: 1rem; font-weight: 600;
    padding: 13px 12px; border-radius: 10px; line-height: 1.2;
  }
  .topnav.nav-open .navlinks a[aria-current="page"] { background: var(--accent-bg); }

  /* NO NESTING ON A PHONE. The stack is already two taps from the page; a
     group that had to be opened inside it would put its links three deep,
     which is where a link stops existing. Every group renders open, its
     label demoted to a heading. */
  .topnav.nav-open .navgroup { width: 100%; }
  .topnav.nav-open .navtop {
    width: 100%; justify-content: flex-start; padding: 14px 12px 4px;
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--ink-3); cursor: default; pointer-events: none;
  }
  .topnav.nav-open .navtop .caret { display: none; }
  .topnav.nav-open .navpanel {
    display: block; position: static; border: 0; box-shadow: none;
    padding: 0; min-width: 0; background: none;
  }
  .topnav.nav-open .navpanel a {
    font-size: 1rem; font-weight: 600; padding: 13px 12px;
  }

  .topnav.nav-open #navburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .topnav.nav-open #navburger span:nth-child(2) { opacity: 0; }
  .topnav.nav-open #navburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  #navscrim.show {
    display: block; position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45); z-index: 10001;
  }
}

/* THE PAGE'S OWN INTRODUCTION IS GONE, ON EVERY SCREEN.
 *
 * Every page opened with a paragraph under its title explaining what the page
 * is -- "The OpenRN series from WisTech Open, written for associate-degree and
 * technical-college programmes..." -- four or five lines before anything you
 * came for. Hidden on phones first (Matt: "kill stuff like that that just
 * takes space"), then everywhere: "we need to remove the unnecessary prose
 * from the desktop version also". A wide screen has room for it, which is not
 * the same as it earning the room.
 *
 * 541 pages carry one and most are generated, so this is one rule rather than
 * an edit sweep across a tree that has already shipped a stale menu once.
 *
 * SCOPED TO .pagehead ON PURPOSE. `.sub` is also the class on the licence
 * attributions at the foot of the library pages -- "OpenStax, Rice University
 * · CC BY-NC-SA 4.0" -- which have to stay visible. Hiding every .sub would
 * have taken them down too.
 *
 * The stats line stays: "9 books · 216 chapters · 10,745 pages" is one line
 * and is the only thing in that header anyone uses.
 *
 * The prose is still IN the pages, not deleted, so this is one line to undo
 * and nothing was lost in the meantime. */
.pagehead .sub { display: none; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px 60px; }
.crumbs { font-size: 0.85rem; color: var(--ink-3); margin: 18px 0 0; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--accent); }

/* ── hub ── */
.hero { padding: 56px 0 30px; max-width: var(--measure); }
.hero .eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.8rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 8px 0 12px; }
.hero p { color: var(--ink-2); font-size: 1.05rem; margin: 0; }
/* The way in for someone who has never seen the site. It sits under the hero
   rather than in the card grid below, because the grid is a list of things to
   study with and this is not one of them — it is the map of the grid. */
.hero .herostart {
  display: inline-flex; align-items: baseline; gap: 7px;
  margin-top: 20px; padding: 8px 16px;
  border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent); font-weight: 600; font-size: 0.95rem;
  text-decoration: none;
}
.hero .herostart span { color: var(--ink-3); font-weight: 400; }
.hero .herostart:hover { background: var(--accent); color: var(--paper); }
.hero .herostart:hover span { color: var(--paper); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 34px 0; }
.card {
  display: block; border: 1px solid var(--rule); border-radius: 10px;
  padding: 20px; background: var(--panel); color: var(--ink);
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card .icon { font-size: 1.6rem; }
.card .name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 8px 0 6px; }
.card .desc { color: var(--ink-2); font-size: 0.92rem; min-height: 2.6em; }
.card .cta { color: var(--accent); font-weight: 600; font-size: 0.92rem; margin-top: 10px; }

/* ── lenses ── */
/* The lens switcher is the main thing to DO on an app home page — four real
   ways into the same library — and at 0.9rem in a grey pill it read as a
   footnote. Sized up, tinted with the accent and given room, so it is the
   first thing after the intro that looks clickable. */
.lensbar {
  font-size: 1.05rem; color: var(--ink-2);
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 11px 22px; display: inline-block; margin: 14px 0 20px;
  background: var(--accent-bg);
}
.lensbar a {
  color: var(--accent); font-weight: 600; text-decoration: none;
  padding: 2px 2px; border-bottom: 2px solid transparent;
}
.lensbar a:hover { border-bottom-color: var(--accent); }
@media (max-width: 640px) {
  .lensbar { font-size: 0.98rem; padding: 10px 16px; border-radius: 14px; display: block; }
}
.lenshome { font-size: 0.85rem; color: var(--ink-3); margin-top: 4px; }

/* "Read it in the textbook" — the shelf's page in the OpenStax books. */
.bookrow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
           border: 1px solid var(--rule); border-left: 4px solid var(--accent);
           border-radius: 10px; background: var(--panel);
           padding: 9px 14px; margin: 14px 0; font-size: 0.95rem; }
.bookrow .blead { color: var(--ink-3); font-size: 0.82rem; text-transform: uppercase;
                  letter-spacing: 0.04em; }
.bookrow .bwhy { color: var(--ink-3); font-size: 0.8rem; margin-left: auto; }

/* "Practice this shelf" — the same box as the textbook line so the two reads
   as one pair of exits, and stays out of the video list below. Filled in by
   js/practicelink.js once the item count is known; hidden until then. */
.practicerow[hidden] { display: none; }
.practicerow .pgo { font: inherit; cursor: pointer; padding: 4px 12px;
                    border: 1px solid var(--accent); border-radius: 999px;
                    background: none; color: var(--accent); }
.practicerow .pgo:hover { background: var(--accent); color: var(--paper); }

/* ── notices ── */
.notice {
  border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--paper));
  color: var(--ink-2); border-radius: 8px; padding: 10px 14px; margin: 18px 0;
  font-size: 0.9rem; max-width: var(--measure);
}

/* ── university tree ── */
.stats { color: var(--ink-3); font-size: 0.9rem; margin: 6px 0 26px; }
.unit { margin: 34px 0; }
.unit > h2 { border-bottom: 2px solid var(--ink); padding-bottom: 6px; font-size: 1.45rem; }
.theme-block { margin: 18px 0 26px; }
.theme-block > h3 { color: var(--ink-2); font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; margin: 0 0 10px; }
.concept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.concept-card {
  border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px;
  background: var(--panel); color: var(--ink); display: block;
}
.concept-card:hover { border-color: var(--accent); text-decoration: none; }
.concept-card .cname { font-weight: 600; }
.concept-card .cmeta { color: var(--ink-3); font-size: 0.82rem; margin-top: 3px; }

/* ── concept page: shelf list ── */
.shelfrow {
  display: flex; align-items: baseline; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--rule); flex-wrap: wrap;
}
.shelfrow .sname { font-weight: 600; font-size: 1.02rem; }
.shelfrow .scount { color: var(--ink-3); font-size: 0.85rem; margin-left: auto; white-space: nowrap; }
/* A shelf the item bank has not reached yet. It holds its place in the list --
   the list is the map, and hiding the unwritten rows makes "nothing to study"
   and "not written yet" look the same -- but it reads quieter than a stocked
   row, and its link goes to the shelf page, never into an empty drill. */
.shelfrow.empty .sname { font-weight: 500; }
.shelfrow.empty .sname a { color: var(--ink-3); }
.shelfrow.empty .scount { font-style: italic; opacity: 0.8; }
.rolemix { color: var(--ink-3); font-size: 0.82rem; }

/* ── shelf page: video rows ── */
.rolehead {
  margin: 28px 0 4px; font-size: 0.85rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent); font-weight: 700;
  border-bottom: 1px solid var(--rule); padding-bottom: 4px;
}
.rolehead .roledesc { color: var(--ink-3); font-weight: 400; text-transform: none; letter-spacing: 0; }
.vidrow {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 4px;
  border-bottom: 1px dotted var(--rule); flex-wrap: wrap;
}
.vidrow .dur {
  font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3);
  min-width: 52px; text-align: right;
}
.vidrow .vtitle { flex: 1 1 24ch; }
.vidrow .vchan { color: var(--ink-3); font-size: 0.85rem; white-space: nowrap; }
.vidrow .anchor {
  font-family: var(--mono); font-size: 0.75rem; color: var(--accent);
  margin-left: 8px; white-space: nowrap;
}
.vidrow .secref {
  font-family: var(--mono); font-size: 0.75rem; color: var(--accent);
  margin-left: 8px; white-space: nowrap; text-decoration: none;
  opacity: 0.85;
}
.vidrow .secref:hover { text-decoration: underline; opacity: 1; }
/* ── shelf page: relevance bands ── */
.bandsec { margin: 30px 0 0; }
.bandhead {
  font-family: var(--serif); font-size: 1.18rem; font-weight: 600;
  border-bottom: 2px solid var(--ink); padding-bottom: 5px;
}
.bandhead .bandcount {
  font-family: var(--mono); font-size: 0.85rem; font-weight: 400;
  color: var(--ink-3); margin-left: 4px;
}
.bandhead .banddesc {
  font-family: var(--sans); font-size: 0.85rem; font-weight: 400;
  color: var(--ink-3); letter-spacing: 0;
}
details.bandsec > summary { cursor: pointer; }
details.bandsec > summary:hover { border-bottom-color: var(--accent); }
.vidrow .vhome { font-size: 0.8rem; color: var(--ink-3); white-space: nowrap; }

/* ── shelf page: single-question rows (the quiz group's first tranche) ── */
details.band-questions { margin: 6px 0 14px; }
details.band-questions > summary.bandhead {
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  border-bottom: 1px solid var(--rule); padding-bottom: 4px;
}
.qrow {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 4px;
  border-bottom: 1px dotted var(--rule); flex-wrap: wrap;
}
.qrow .dur {
  font-family: var(--mono); font-size: 0.75rem; color: var(--accent);
  min-width: 52px; text-align: right; white-space: nowrap;
}
.qrow .vtitle { flex: 1 1 24ch; }
.qrow .vchan { color: var(--ink-3); font-size: 0.85rem; white-space: nowrap; }
.badge.qb { margin-left: 6px; font-size: 0.65rem; }
.tranchehead {
  margin: 16px 0 2px; font-size: 0.78rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-2); font-weight: 700;
}
.tranchehead .bandcount {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 400;
  color: var(--ink-3); margin-left: 4px;
}
.tranchehead .dmbrands {
  text-transform: none; letter-spacing: 0; font-weight: 400;
  color: var(--ink-3);
}

/* ── shelf page: channel picker ── */
.chanbar { margin: 18px 0 -8px; }
.chanhead {
  font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 700; margin-bottom: 8px;
}
.chanchips { display: flex; flex-wrap: wrap; gap: 8px; }
.chanchip {
  display: inline-flex; align-items: baseline; gap: 7px;
  border: 1px solid var(--rule); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 4px 12px; cursor: pointer;
  font: inherit; font-size: 0.88rem;
}
.chanchip:hover { border-color: var(--accent); }
.chanchip.on {
  border-color: var(--accent); background: var(--accent-bg);
  color: var(--accent); font-weight: 600;
}
.chanchip .ccount { color: var(--ink-3); font-size: 0.78rem; font-family: var(--mono); }

.badge {
  font-size: 0.7rem; letter-spacing: 0.03em; padding: 1px 7px;
  border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-3);
  white-space: nowrap;
}
.badge.p-creator     { border-color: var(--ok);    color: var(--ok); }
.badge.p-platform    { border-color: var(--ink-3); }
.badge.p-regulator   { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.badge.p-institution { border-color: var(--accent); color: var(--accent); }
.badge.p-synthetic   { border-color: var(--alert); color: var(--alert); }
.badge.p-ai          { border-color: var(--alert); color: var(--alert); }
.badge.p-unreviewed  { border-color: var(--warn);  color: var(--warn); }

.kicker { color: var(--ink-3); font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 26px 0 4px; }
.pagehead h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 4px 0 8px; }
.pagehead .sub { color: var(--ink-2); max-width: var(--measure); }
.chip {
  display: inline-block; background: var(--accent-bg); color: var(--accent);
  border-radius: 6px; padding: 2px 9px; font-size: 0.8rem; font-weight: 600;
}

footer.site {
  border-top: 1px solid var(--rule); margin-top: 50px; padding: 18px 20px;
  color: var(--ink-3); font-size: 0.85rem;
}


/* ── OpenStax attribution notice (js/openstax-attrib.js) ────────────────────
   Required on every page view of hosted OpenStax text, including partial
   views. Quiet, but never hidden: display:none here would be a licence
   failure, so this block deliberately has no collapsed state. */
.ox-attrib {
  margin: 1.25rem 0 0;
  padding: .7rem .9rem;
  border-top: 1px solid var(--rule);
  background: var(--panel);
  font-family: var(--sans);
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--ink-3);
}
.ox-attrib p { margin: 0 0 .25rem; }
.ox-attrib p:last-child { margin-bottom: 0; }
.ox-attrib a { color: var(--ink-2); }
.ox-attrib-src em { font-style: italic; color: var(--ink-2); }
/* The free-access line is the one part the licence names verbatim, so it
   takes the highest-contrast ink rather than the accent: site.js resolves
   --accent from config at load, and a theme switched afterwards can leave
   the light-mode accent sitting on a dark panel. */
.ox-attrib-free a { color: var(--ink); font-weight: 600; text-decoration: underline; }
.ox-attrib-missing {
  border: 1px solid var(--alert);
  border-top: 1px solid var(--alert);
  color: var(--alert);
  background: transparent;
}

/* Print: the free-access line must survive onto every physical page. */
@media print {
  .ox-attrib { break-inside: avoid; }
  .ox-attrib-free { display: block; }
}

/* The lens's own "what this ordering is" line, at the foot of the home page.
   Separated from the shelves above it so it reads as a closing note rather
   than another row. */
.lensfoot {
  margin: 34px 0 8px; padding-top: 16px; border-top: 1px solid var(--rule);
  color: var(--ink-3); font-size: 0.88rem; max-width: 62ch;
}

/* A section that is visible but not finished. Shown rather than hidden --
   a tester who cannot see a section cannot know it is coming -- so the card
   stays clickable and says so plainly instead. */
.badge {
  display: inline-block; margin-left: 8px; vertical-align: 2px;
  font-family: var(--sans); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 999px;
  padding: 2px 8px;
}
.card.soon { border-style: dashed; }
.card.soon .desc, .card.soon .icon { opacity: 0.72; }

/* "Functionality demo" banner. Deliberately loud: a tester who does not know
   this is a demo will read a thin chapter as a broken product and file the
   wrong bug. text-transform rather than typing it in caps, so the sentence
   stays readable to a screen reader. */
.demobanner {
  margin: 4px 0 26px;
  font-family: var(--sans);
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--alert);
  border: 2px solid var(--alert);
  border-radius: 10px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--alert) 8%, transparent);
  text-align: center;
}

/* ── reviewer flags ──
   The X on each video row: "this does not belong on this shelf". Deliberately
   quiet until hovered - a reviewer reads far more rows than she flags, and a
   column of red X's would fight the titles for attention. */
.vidrow { position: relative; }
.flagbtn {
  margin-left: 8px; border: 1px solid transparent; background: none;
  color: var(--ink-3); border-radius: 6px; padding: 1px 8px; cursor: pointer;
  font-size: 0.95rem; line-height: 1.4; opacity: 0.35; transition: opacity .12s;
}
.vidrow:hover .flagbtn { opacity: 1; }
.flagbtn:hover { border-color: var(--alert); color: var(--alert); }
.flagbtn:focus-visible { opacity: 1; outline: 2px solid var(--accent); }

/* A flagged row stays legible - struck through rather than hidden, because
   she needs to see what she has already decided when she comes back. */
.vidrow.flagged { opacity: 0.55; }
.vidrow.flagged .vtitle { text-decoration: line-through; }
.vidrow.flagged .flagbtn { opacity: 1; color: var(--alert); border-color: var(--alert); }
.vidrow.flagbusy { opacity: 0.4; }
.vidrow.flagerr { background: color-mix(in srgb, var(--alert) 14%, transparent); border-radius: 6px; }

/* The same X on a PRACTICE QUESTION, in the answer review (js/qflag.js).
   It rides the .flagbtn look above and only changes what it has to: there is
   no row to hover here, so it sits on the "Correct. / Not quite." line and
   uses that line as its hover target. Slightly louder at rest than the video
   one - a reviewer passes far fewer questions than video rows, and the button
   has to be findable without a hunt. */
h3.vline { display: flex; align-items: center; gap: 8px; }
h3.vline .vchip { margin-left: 0; }
h3.vline .qflag { margin-left: auto; }
.qflag { opacity: 0.5; margin-left: 8px; }
h3.vline:hover .qflag, .qflag:hover, .qflag:focus-visible { opacity: 1; }
.qflag.on { opacity: 1; color: var(--alert); border-color: var(--alert); }
.qflag.busy { opacity: 0.4; }
.qflag.err { border-color: var(--alert);
             background: color-mix(in srgb, var(--alert) 14%, transparent); }

/* Touch targets: on a phone there is no hover, so the button is always
   visible and big enough to hit. */
@media (hover: none) {
  .flagbtn { opacity: 0.8; padding: 6px 12px; }
}

/* ── Keyword search (js/search.js fills the .kwsearch shell) ──────────
   Results are quotes at timestamps and pages, styled deliberately UNLIKE the
   curated video rows — quote bars, mono clocks, no role/band chrome — so a
   search hit can never masquerade as a placement. */
.kwsearch {
  margin: 14px 0 18px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px 14px;
}
.kwsearch .kwhead {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.kwsearch .kwtitle { font-weight: 700; color: var(--ink); }
.kwsearch .kwhint { font-size: 0.82em; color: var(--ink-3); }
.kwsearch input[type="search"] {
  width: 100%; box-sizing: border-box;
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px; padding: 8px 12px;
}
.kwsearch input[type="search"]:focus {
  outline: 2px solid var(--accent); outline-offset: -1px;
}
.kwcounts { font-size: 0.82em; color: var(--ink-3); margin: 8px 0 0; }
.kwcounts b { color: var(--ink); }
.kwgroup { margin-top: 10px; }
.kwgrouphead {
  font-size: 0.78em; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 4px;
}
.kwhit {
  display: block; text-decoration: none;
  padding: 6px 8px; border-radius: 6px;
  border-left: 2px solid var(--rule);
  margin: 2px 0;
}
.kwhit:hover { background: var(--accent-bg); }
.kwhit .kwclock {
  font-family: var(--mono);
  font-size: 0.85em; color: var(--accent); margin-right: 8px;
}
.kwhit .kwvtitle { color: var(--ink); font-weight: 600; font-size: 0.92em; }
.kwhit .kwchan { font-size: 0.8em; color: var(--ink-3); margin-left: 6px; }
.kwhit .kwquote {
  display: block; font-size: 0.88em; color: var(--ink-3);
  font-style: italic; margin-top: 2px;
}
.kwhit .kwquote mark {
  background: var(--accent-bg); color: var(--ink);
  font-style: normal; padding: 0 2px; border-radius: 2px;
}
.kwhit .kwmore { font-size: 0.78em; color: var(--ink-3); }
.kwempty { font-size: 0.88em; color: var(--ink-3); padding: 6px 8px; }
.kwerr { font-size: 0.88em; color: var(--alert); padding: 6px 8px; }


/* ── the case's permanent reference id, on the list ────────────────────────
   ALWAYS shown. A case number is a catalogue label — the thing you write in a
   note to say which case you mean — not a review aid, so it is not behind the
   R toggle that hides the per-response ids inside an item. Fixed width so the
   column reads straight down; user-select:all so one click grabs it. */
.csid {
  display: inline-block;
  min-width: 4.5em;
  margin-right: .6em;
  font: 500 11px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted, #8a8a94);
  user-select: all;
}

/* clinical-area headings in the case list */
h4.areahead {
  margin: 1.4em 0 .2em;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
}
h4.areahead .stats { font-weight: 400; opacity: .65; }

/* ── FOLDED BOOK LISTS ─────────────────────────────────────────
   The practice panels list chapters under their book, folded (Matt,
   2026-09-02: "so they don't have to scroll forever"). By textbook is 271
   chapters across ten books; By Open RN chapter is 119 across eight.

   <details>/<summary>, the idiom books.css already uses for the reader's own
   table of contents: no JS, works with scripting off, keyboard-reachable and
   announced without any help from us.

   Collapsed by default, but the count rides on the fold. A folded list that
   hid where the questions are would trade scrolling for hunting.

   These live here rather than in practice/css/practice.css because THAT FILE
   IS LINKED FROM NOWHERE -- checked 2026-09-02, no page loads it. */
.bookfold { border-bottom: 1px solid var(--rule, #ddd); }
.bookfold > summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline;
                      padding: 12px 2px; font-size: 1.05rem; font-weight: 600;
                      color: var(--ink, #111); }
.bookfold > summary:hover { color: var(--accent, #0B5D5D); }
.bookfold > summary:focus-visible { outline: 3px solid var(--accent, #0B5D5D);
                                    outline-offset: 2px; }
.bookfold .bookname { flex: 1 1 auto; }
.bookfold .bookcount { flex: 0 0 auto; font-size: 0.82rem; font-weight: 400;
                       color: var(--ink-3, #777); }
.bookfold[open] > summary { border-bottom: 1px solid var(--rule, #eee); }
.bookfold[open] { padding-bottom: 8px; }
@media print { .bookfold { border: 0; } .bookfold > summary { display: none; } }
