/* src/press/styles/coin.css */
@charset "utf-8";

/* ============================================================================
   Upstream Press — the book's tokens.
   Layer one of three: this file (fonts, tokens, foundation), then
   diagram.css (every .fl-* rule), then reader/reader.css (every component).
   Served concatenated as /wiznotes/reader.css and inlined, with the fonts
   base64'd, into every offline file.

   THE IDEA
   The page is paper and the text is ink. Every affordance is drawn with a
   typesetter's tools — a rule, a numeral, a change of weight, small caps —
   never an app's (cards, fills, chips, glass). The chrome is a running head:
   set on the same paper, never louder than a subhead, present when reached
   for and forgotten while reading.

   TYPE
   Literata (variable: ital, opsz 7–72, wght 300–700) is the text face AND the
   display face: it was drawn for long-form reading on phones (Google Play
   Books), its x-height and hairlines survive 17px on an OLED, and its optical
   size axis carries it from 13px captions to 64px part titles, so no second
   serif is needed. Plus Jakarta Sans — the COIN face — is demoted to what a
   grotesque is good at: chrome, labels, tags, table heads, tabular numerals,
   and the diagrams. It never sets a sentence the author wrote.

   SIZE
   One root token, --fs, drives the whole reading surface through rem. The
   chrome (running head, sheets, search, popover, lightbox) is pinned in px
   and does not move when the reader changes type size. The enhancer's
   pre-paint stamp puts data-fz on <html> (0 default · 1 larger · 2 largest ·
   3 smaller — the store's contract), and the three overrides below read it.

   THEMES
   Light is the complete definition on bare :root. The two dark blocks are
   verbatim copies of each other — keep them that way. The print block at the
   end uses :root:root:root (0,3,0) so it beats both dark selectors (0,2,0) on
   specificity, not source order; the predecessor shipped near-white text on
   white paper because a plain @media print :root lost that fight.

   SCOPE
   Tokens live on :root; the site's own pages never load this sheet, so they
   cannot collide. Element rules that would restyle the marketing site are
   scoped with :has(#wz-reader), which every reader page carries and nothing
   else does.
   ============================================================================ */


/* ----------------------------------------------------------------------------
   1. FACES — self-hosted, latin subset
   Three files under /wiznotes/fonts, immutable-cached by filename. The
   offline bundle replaces each url() with a data: URI (see reader/css.ts),
   so a student in a basement gets Literata, not whatever the phone has.
   The italic is captions, ledes, standfirsts and the running head; it is
   loaded late, never preloaded.
   ---------------------------------------------------------------------------- */
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/wiznotes/fonts/Literata-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/wiznotes/fonts/Literata-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/wiznotes/fonts/PlusJakartaSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The fallback is designed, not suffered. Iowan Old Style ships on every
   iPhone and Mac (it is the Apple Books default) and is the closest local
   match to Literata's colour and x-height; Charter is the second choice.
   Measured in Chrome at 17px: Literata sets 5.2% wider than Iowan, hence
   size-adjust 105% so line breaks land within a word of the real face.
   No 500 face on purpose: weight 500 (.hy, .dgr, .adv) resolves to the
   regular, so marks stay marks and never go bold in the fallback. */
@font-face {
  font-family: "Literata Fallback";
  src: local("Iowan Old Style"), local("IowanOldStyle-Roman"), local("Charter"), local("Charter-Roman");
  size-adjust: 105%;
}
@font-face {
  font-family: "Literata Fallback";
  font-style: italic;
  src: local("Iowan Old Style Italic"), local("IowanOldStyle-Italic"), local("Charter Italic"), local("Charter-Italic");
  size-adjust: 105%;
}
@font-face {
  font-family: "Literata Fallback";
  font-weight: 600 700;
  src: local("Iowan Old Style Bold"), local("IowanOldStyle-Bold"), local("Charter Bold"), local("Charter-Bold");
  size-adjust: 105%;
}


/* ----------------------------------------------------------------------------
   2. TOKENS — LIGHT (the default and the complete definition)
   ---------------------------------------------------------------------------- */
:root {
  /* type -------------------------------------------------------------- */
  --fs: 17px;                       /* the one root size; data-fz swaps it */
  --lead: 1.5;
  --lh: calc(1rem * var(--lead));   /* one body line = the rhythm unit (25.5px at 17) */
  --font-text: "Literata", "Literata Fallback", "Iowan Old Style", Charter, Georgia, serif;
  --font-ui: "Plus Jakarta Sans", -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-display: var(--font-text); /* consumed by diagram.css for .fig-t */

  /* scale: tight (1.13–1.2) through the text sizes, opening up at display —
     a book scale, not a strict geometric one. px shown at --fs 17. */
  --t-2: .765rem;    /* 13   captions, numerals, table heads, page refs */
  --t-1: .882rem;    /* 15   tables, ledes, explanations, contents-in-book */
  --t0: 1rem;        /* 17   body, subheads, block heads */
  --t1: 1.125rem;    /* 19   standfirst, MCQ stems, subtitle */
  --t2: 1.333rem;    /* 22.7 */
  --t3: 1.6rem;      /* 27   */
  --t4: 2rem;        /* 34   chapter title on a phone */
  --t5: 2.6rem;      /* 44   chapter numeral; chapter title >= 600px */
  --t6: 3.4rem;      /* 58   part title, book title on a phone */

  /* space: seven multiples of the line, nothing else -------------------- */
  --sp-1: calc(var(--lh) * .25);
  --sp-2: calc(var(--lh) * .5);
  --sp-3: var(--lh);
  --sp-4: calc(var(--lh) * 1.5);
  --sp-5: calc(var(--lh) * 2);
  --sp-6: calc(var(--lh) * 3);
  --sp-7: calc(var(--lh) * 5);

  /* measure and gutters. 60ch of Literata (a wide 0) is ~68–72 characters
     of prose — inside the 62–72 window. The phone gets whatever it gets;
     hyphenation and leading make that column legible, nothing else can. */
  --measure: 60ch;
  --gutter: clamp(20px, 5vw, 40px);
  --bleed: 0px;                     /* tables and figures may exceed the measure on wide screens */
  --bar-h: 48px;

  /* paper and ink ------------------------------------------------------- */
  --paper: #f7f4ee;                 /* uncoated book stock, not screen white */
  --paper-2: #efebe3;               /* sunken: code, hover, sticky stub */
  --paper-3: #fbf9f5;               /* raised: sheet, popover, the report card */
  --ink: #1b1a2e;                   /* body: navy-black, so it lives with COIN navy */
  --ink-head: #10104f;              /* COIN navy: titles, subheads, stubs, links */
  --ink-2: #4a4960;                 /* secondary: standfirsts, glosses          8:1  */
  --ink-3: #6f6e82;                 /* muted: numerals, labels, tags            4.7:1 */
  --rule: rgba(16, 16, 79, .14);        /* hairline between siblings */
  --rule-strong: rgba(16, 16, 79, .42); /* structural: chapter rule, table head/foot, block heads */
  --rule-faint: rgba(16, 16, 79, .08);

  /* the accent, disciplined. #00c2f4 is 2:1 on this paper: it is never
     text. It appears as a mark in a short list of places (focus, the one
     active cross-link, the popover's head rule, a corrected block's margin
     rule) and nowhere else. */
  --accent: #00c2f4;
  --accent-ink: #026c8c;            /* the only typesettable cyan: 5.6:1 on paper */
  --aqua: #a3e0e4;
  --sel: rgba(163, 224, 228, .5);   /* selection is COIN aqua */

  /* the clinical code: three inks, no highlighter ----------------------- */
  --hy-line: #e3b94a;               /* the examiner's pencil under a high-yield phrase */
  --go: #1c6b48;                    /* .adv, right answer            5.9:1 */
  --stop: #b4232a;                  /* .dgr, wrong answer            5.9:1 */
  --kw-line: #b3b0bd;               /* dotted indexer's mark under a cross-link */

  --w-text: 400;
  --w-bold: 600;                    /* 700 blots at text sizes; 600 is the ceiling in prose */
  --scrim: rgba(16, 16, 79, .28);
  --e3: 0 12px 32px rgba(16, 16, 79, .14), 0 2px 6px rgba(16, 16, 79, .08); /* the only shadow: things that float */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --focus-ring: var(--accent);

  /* consumed by diagram.css --------------------------------------------- */
  --band: #5f5d74;                  /* edge + arrowhead; if this is ever undefined every arrow loses its head */
  --text-muted: var(--ink-3);
  --text-heading: var(--ink-head);
}

/* Dark is the same book in a dim room: navy-black paper, warm off-white ink,
   never #000 on #fff. The variable font lets body weight rise 30 units so
   light-on-dark reads at the same visual weight as dark-on-light.
   THIS BLOCK APPEARS VERBATIM UNDER BOTH SELECTORS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14141f; --paper-2: #1b1b28; --paper-3: #1e1e2b;
    --ink: #e3dfd6; --ink-head: #f1ede4; --ink-2: #b8b4ac; --ink-3: #8b8898;
    --rule: rgba(227, 223, 214, .13); --rule-strong: rgba(227, 223, 214, .38); --rule-faint: rgba(227, 223, 214, .07);
    --accent: #00c2f4; --accent-ink: #6fd6f2; --aqua: #a3e0e4; --sel: rgba(0, 194, 244, .32);
    --hy-line: #9b8535; --go: #62c99c; --stop: #f0908a; --kw-line: #5f5e6f;
    --w-text: 430; --w-bold: 640;
    --scrim: rgba(0, 0, 0, .55);
    --e3: 0 12px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(227, 223, 214, .08);
    --band: #8d8ba0; --text-muted: var(--ink-3); --text-heading: var(--ink-head);
  }
}
:root[data-theme="dark"] {
  --paper: #14141f; --paper-2: #1b1b28; --paper-3: #1e1e2b;
  --ink: #e3dfd6; --ink-head: #f1ede4; --ink-2: #b8b4ac; --ink-3: #8b8898;
  --rule: rgba(227, 223, 214, .13); --rule-strong: rgba(227, 223, 214, .38); --rule-faint: rgba(227, 223, 214, .07);
  --accent: #00c2f4; --accent-ink: #6fd6f2; --aqua: #a3e0e4; --sel: rgba(0, 194, 244, .32);
  --hy-line: #9b8535; --go: #62c99c; --stop: #f0908a; --kw-line: #5f5e6f;
  --w-text: 430; --w-bold: 640;
  --scrim: rgba(0, 0, 0, .55);
  --e3: 0 12px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(227, 223, 214, .08);
  --band: #8d8ba0; --text-muted: var(--ink-3); --text-heading: var(--ink-head);
}

/* reader-set type size: one token, the whole surface follows; the chrome
   does not. The values are the store's (0 default · 1 · 2 · 3 smaller). */
:root[data-fz="3"] { --fs: 15px; }
:root[data-fz="1"] { --fs: 19px; }
:root[data-fz="2"] { --fs: 21px; }

@media (min-width: 900px)  { :root { --bleed: 4rem; } }
@media (min-width: 1100px) { :root { --bleed: 5rem; } }


/* ----------------------------------------------------------------------------
   3. FOUNDATION — scoped to reader pages
   The site around the reader is a dark editorial shell with its own body
   rule; :has(#wz-reader) reverses it only where a book is on the page.
   ---------------------------------------------------------------------------- */
html:has(#wz-reader) {
  font-size: var(--fs);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 12px);
  background: var(--paper);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]):has(#wz-reader) { color-scheme: dark; } }
html[data-theme="dark"]:has(#wz-reader) { color-scheme: dark; }

body:has(#wz-reader) {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: var(--w-text);
  font-size: 1rem;
  line-height: var(--lead);
  font-optical-sizing: auto;
  font-kerning: normal;
  /* lining figures everywhere: "Class III", "< 90 mmHg" and "GCS 8" are the
     payload of the sentence; old-style 3s and 9s dropping below the baseline
     are beautiful in a novel and dangerous in an exam text. */
  font-variant-numeric: lining-nums proportional-nums;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  overflow-x: visible;
}
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body:has(#wz-reader) { -webkit-font-smoothing: antialiased; } }
html[data-theme="dark"] body:has(#wz-reader) { -webkit-font-smoothing: antialiased; }

/* :where() keeps these at element specificity, so any single class in
   reader.css (.rel, .card, .rbtn …) wins over them as it would over a bare
   element rule */
:where(.reader) *, :where(.reader) *::before, :where(.reader) *::after { box-sizing: border-box; }
:where(.reader) a { color: var(--ink-head); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--rule-strong); text-underline-offset: .18em; }
:where(.reader) b, :where(.reader) strong { font-weight: var(--w-bold); }
:where(.reader) ::selection { background: var(--sel); }
:where(.reader) :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.sr-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .reader, .reader *, .reader *::before, .reader *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


/* ----------------------------------------------------------------------------
   4. PRINT TOKENS — dark on white whatever the screen theme says
   :root:root:root is (0,3,0): it beats :root:not([data-theme="light"]) and
   :root[data-theme="dark"], both (0,2,0), on specificity alone, so source
   order and the OS setting are irrelevant. The --fl-* tokens are restated
   here for the same reason: diagram.css's own print block is only (0,1,0).
   Element rules for print live at the end of reader.css.
   ---------------------------------------------------------------------------- */
@media print {
  :root:root:root, :root:root:root[data-theme="dark"], :root:root:root[data-theme="light"] {
    color-scheme: light;
    --fs: 10.5pt;
    --paper: #fff; --paper-2: #fff; --paper-3: #fff;
    --ink: #000; --ink-head: #000; --ink-2: #222; --ink-3: #555;
    --rule: #bbb; --rule-strong: #000; --rule-faint: #ddd;
    --accent: #000; --accent-ink: #000; --aqua: #fff; --sel: transparent;
    --hy-line: #888; --go: #14432f; --stop: #7a161a; --kw-line: #999;
    --w-text: 400; --w-bold: 700;
    --scrim: transparent; --e3: none;
    --band: #333355; --text-muted: #444; --text-heading: #000;
    --fl-plain-fill: #fff; --fl-plain-line: #666688; --fl-plain-ink: #000;
    --fl-go-fill: #fff; --fl-go-line: #2f7d5c; --fl-go-ink: #14432f;
    --fl-stop-fill: #fff; --fl-stop-line: #a51f25; --fl-stop-ink: #7a161a;
    --fl-state-fill: #fff; --fl-state-line: #0b7fa5; --fl-state-ink: #0a0a33;
    --fl-key-fill: #fff; --fl-key-line: #0b7fa5; --fl-key-ink: #0a0a33;
    --fl-label-bg: #fff;
  }
  html:has(#wz-reader), body:has(#wz-reader) { background: #fff !important; color: #000 !important; -webkit-font-smoothing: auto; }
  @page { margin: 18mm 16mm; }
}


/* src/press/styles/diagram.css */
/* =========================================================================
   Upstream Press — flow diagram skin. Layer two of three.
   AUTHORITATIVE for diagrams. These class names are emitted by
   src/press/lib/flow/engine.ts (fl-node / fl-n-<cls> / fl-t / fl-t-<cls> /
   fl-e / fl-elb / fl-el) and are NOT negotiable — they come out of the
   renderer's string templates. Concatenated after coin.css and before
   reader.css; reader.css restyles the host (.fig, .fig-t, .flow) in the
   book's grammar and leaves every .fl-* rule to this file.

   --band is load-bearing: the engine fills the arrowhead marker with
   var(--band). If --band is ever undefined, every arrow loses its head.
   ========================================================================= */

:root {
  --band:          #5f5d74;   /* edges + arrowheads */
  --fl-plain-fill: #efece5;   /* one step sunk into the paper (#f7f4ee) */
  --fl-plain-line: #bcb9c6;
  --fl-plain-ink:  #10104f;
  --fl-go-fill:    #e0f1e7;   /* action / treatment */
  --fl-go-line:    #3f9d74;
  --fl-go-ink:     #12523a;
  --fl-stop-fill:  #f9e6e3;   /* danger / contraindication */
  --fl-stop-line:  #b4232a;
  --fl-stop-ink:   #8c1a1f;
  --fl-state-fill: #e3f1f6;   /* decision point */
  --fl-state-line: #00c2f4;
  --fl-state-ink:  #10104f;
  --fl-key-fill:   #10104f;   /* terminal outcome */
  --fl-key-line:   #00effe;
  --fl-key-ink:    #ffffff;
  --fl-label-bg:   #f7f4ee;   /* = --paper, or every edge label sits in a white patch */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --band:          #8d8ba0;
    --fl-plain-fill: #1e1e2b;   /* one step raised from the dark paper (#14141f) */
    --fl-plain-line: #47465c;
    --fl-plain-ink:  #e3dfd6;
    --fl-go-fill:    #123322;
    --fl-go-line:    #3fbf95;
    --fl-go-ink:     #9be8c6;
    --fl-stop-fill:  #3a1a1c;
    --fl-stop-line:  #f0908a;
    --fl-stop-ink:   #ffc9cb;
    --fl-state-fill: #10303f;
    --fl-state-line: #00c2f4;
    --fl-state-ink:  #d6f4ff;
    --fl-key-fill:   #00c2f4;
    --fl-key-line:   #00effe;
    --fl-key-ink:    #06163a;
    --fl-label-bg:   #14141f;   /* = dark --paper */
  }
}

:root[data-theme="dark"] {
  --band:          #8d8ba0;
  --fl-plain-fill: #1e1e2b;   /* one step raised from the dark paper (#14141f) */
  --fl-plain-line: #47465c;
  --fl-plain-ink:  #e3dfd6;
  --fl-go-fill:    #123322;
  --fl-go-line:    #3fbf95;
  --fl-go-ink:     #9be8c6;
  --fl-stop-fill:  #3a1a1c;
  --fl-stop-line:  #f0908a;
  --fl-stop-ink:   #ffc9cb;
  --fl-state-fill: #10303f;
  --fl-state-line: #00c2f4;
  --fl-state-ink:  #d6f4ff;
  --fl-key-fill:   #00c2f4;
  --fl-key-line:   #00effe;
  --fl-key-ink:    #06163a;
  --fl-label-bg:   #14141f;   /* = dark --paper */
}

/* ---- host ------------------------------------------------------------- */
.fig { margin: 0 0 18px; }
.fig-cap { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; }
.fig-t {
  font-family: var(--font-display, "Plus Jakarta Sans", sans-serif);
  font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
  color: var(--text-heading, #10104f);
}
.fig-s { font-size: 12.5px; line-height: 1.45; color: var(--text-muted, #545479); }

.flow {
  overflow-x: auto;                 /* wide pathways scroll in their own box —
                                       the page body must never scroll sideways */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 2px 4px;
  cursor: zoom-in;
}
.flow svg { display: block; max-width: none; height: auto; }
.fl-err {
  font: 12px/1.5 ui-monospace, Menlo, monospace;
  color: var(--fl-stop-ink); background: var(--fl-stop-fill);
  border: 1px solid var(--fl-stop-line); border-radius: 6px; padding: 8px 10px;
}

/* ---- nodes ------------------------------------------------------------ */
.fl-node { fill: var(--fl-plain-fill); stroke: var(--fl-plain-line); stroke-width: 1.2; }
.fl-n-go    { fill: var(--fl-go-fill);    stroke: var(--fl-go-line); }
.fl-n-stop  { fill: var(--fl-stop-fill);  stroke: var(--fl-stop-line);  stroke-width: 1.6; }
.fl-n-state { fill: var(--fl-state-fill); stroke: var(--fl-state-line); stroke-width: 1.5; }
.fl-n-key   { fill: var(--fl-key-fill);   stroke: var(--fl-key-line);   stroke-width: 1.4; }

/* Text must NEVER carry a stroke paint — a stroke on 11px type reads as a
   synthetic bold and muddies the glyphs. Note stroke-width initialises to 1px
   whether or not a stroke paints, so testing stroke-width tells you nothing;
   the meaningful assertion is stroke === 'none'. */
.fl-t {
  fill: var(--fl-plain-ink); stroke: none;
  font: 11px/1 "Plus Jakarta Sans", Roboto, system-ui, sans-serif;
}
.fl-t-go    { fill: var(--fl-go-ink); }
.fl-t-stop  { fill: var(--fl-stop-ink);  font-weight: 600; }
.fl-t-state { fill: var(--fl-state-ink); font-weight: 600; }
.fl-t-key   { fill: var(--fl-key-ink);   font-weight: 600; }

/* ---- edges ------------------------------------------------------------ */
.fl-e { stroke: var(--band); stroke-width: 1.3; fill: none; }
.fl-e.dash { stroke-dasharray: 4 3; opacity: .8; }
.fl-elb { fill: var(--fl-label-bg); stroke: none; }
.fl-el {
  fill: var(--text-muted, #545479); stroke: none;
  font: 10px/1 "Plus Jakarta Sans", "Roboto Condensed", system-ui, sans-serif;
  font-weight: 600;
}

/* ---- print: always dark-on-white, whatever the screen theme is --------- */
@media print {
  :root, :root[data-theme="dark"] {
    --band:          #333355;
    --fl-plain-fill: #ffffff; --fl-plain-line: #666688; --fl-plain-ink: #000000;
    --fl-go-fill:    #ffffff; --fl-go-line:    #2f7d5c; --fl-go-ink:    #14432f;
    --fl-stop-fill:  #ffffff; --fl-stop-line:  #a51f25; --fl-stop-ink:  #7a161a;
    --fl-state-fill: #ffffff; --fl-state-line: #0b7fa5; --fl-state-ink: #0a0a33;
    --fl-key-fill:   #ffffff; --fl-key-line:   #0b7fa5; --fl-key-ink:   #0a0a33;
    --fl-label-bg:   #ffffff;
  }
  .flow { overflow: visible; cursor: auto; break-inside: avoid; page-break-inside: avoid; }
  .fig  { break-inside: avoid; page-break-inside: avoid; }
}


/* src/press/reader/reader.css */
/* =========================================================================
   Upstream Press — the public reader, set as a book.

   Layer three. Served concatenated as coin.css + diagram.css + this file by
   /wiznotes/reader.css, so every token, the light/dark swap and the
   :root:root:root print tokens in coin.css are already in scope and never
   restated here. Nothing below defines a colour literal: if a value is not
   a token, it is a shape, a size or a ratio.

   THE GRAMMAR
   Paper and ink. Hairline rules between siblings, a 1.5px strong rule where
   a structure begins, small caps over a strong rule for every block head,
   numerals in the UI face that hang in the margin when there is one. No
   card, no fill behind serif text, no radius above 6px on the reading
   surface. Three things float, and they are the only shadow: the popover,
   the bottom sheet, the report card. Cyan is a mark — focus, the one active
   cross-link, the popover's head rule, a corrected block's margin rule —
   and never a wash.

   THE MARKUP
   The block registry (src/press/lib/blocks/registry.ts) emits `.blk
   .blk-<kind>`, `.sec-h`, `.acc`, `.tbl`, `.fig`, `.term`; the pages under
   src/app/wiznotes/[org] emit the chrome (`.rbar`), the openers (`.hero`,
   `.part`, `.chapter-head`) and the listings; the enhancer builds the
   sheet, the search overlay, the popover, the lightbox and the report card
   at run time. css.test.ts asserts every class any of them emits has a rule
   here.

   Tailwind is deliberately absent. Paper and screen are one system.
   ========================================================================= */


/* ----------------------------------------------------------------------------
   1. SHELL
   ---------------------------------------------------------------------------- */
/* clip, not hidden: a hidden overflow would make .reader the scroll
   container and break the sticky running head */
.reader { position: relative; min-height: 100svh; overflow-x: clip; background: var(--paper); color: var(--ink); font-family: var(--font-text); }
/* the measure lives on .reader-main; the gutter sits outside it so the
   column is exactly --measure wide on every screen that can afford it */
.reader-main {
  box-sizing: content-box;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--sp-6);
}
.reader-wide { max-width: var(--measure); }


/* ----------------------------------------------------------------------------
   2. THE RUNNING HEAD — a chrome bar that recedes
   Solid paper, one hairline, no glass: it sits ON the page. At the top of a
   chapter it is two lines (book in small caps over chapter in italic); as
   the reader scrolls into the text the book line fades, the chapter title
   centres and the hairline settles in. Scroll-driven, no JS. Browsers
   without scroll timelines get the settled (quiet) state permanently, which
   is a perfectly good running head. Everything here is px.
   ---------------------------------------------------------------------------- */
@property --recede { syntax: "<number>"; inherits: true; initial-value: 1; }

.rbar {
  --recede: 1;                       /* the quiet state is the default */
  --recede-eff: var(--recede);
  position: sticky; top: 0; z-index: 40;
  min-height: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 6px 0 var(--gutter);
  display: flex; align-items: center; gap: 2px;
  background: var(--paper);
  font-family: var(--font-ui); font-size: 13px; line-height: 1; color: var(--ink-2);
}
.rbar::after {                         /* the hairline arrives with the text */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--rule); opacity: var(--recede);
}
.rbar:hover, .rbar:focus-within { --recede-eff: 0; }   /* reached for: it returns */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .rbar:has(.rbar-sec) { animation: bar-recede linear both; animation-timeline: scroll(root block); animation-range: 40px 240px; }
  }
}
@keyframes bar-recede { from { --recede: 0; } to { --recede: 1; } }

.rbar-titles { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; min-width: 0; height: var(--bar-h); }
.rbar-titles > .rbar-home, .rbar-sec { grid-area: 1 / 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbar-home {
  font-family: var(--font-text); font-variant-caps: small-caps; font-size: 12.5px; letter-spacing: .1em;
  color: var(--ink-3); text-decoration: none; white-space: nowrap;
}
.rbar-titles > .rbar-home {
  opacity: calc(1 - var(--recede-eff));
  transform: translateY(calc(-8px * (1 - var(--recede-eff))));
}
.rbar-sec {
  font-family: var(--font-text); font-style: italic; font-size: 14.5px; color: var(--ink-head);
  transform: translateY(calc(8px * (1 - var(--recede-eff))));
}
/* a page with no chapter (the shelf, a title page) keeps the book line put */
.rbar-titles:not(:has(.rbar-sec)) > .rbar-home { opacity: 1; transform: none; }
@media (hover: hover) { .rbar-home:hover { color: var(--ink-head); } }
.rbar-spacer { flex: 1 1 auto; }
.rbar-tools { flex: none; display: flex; align-items: center; gap: 0; }

/* text buttons: PJS tracked caps, no border, no fill — a running head has
   words in it, not pills */
.rbtn {
  appearance: none; -webkit-appearance: none; background: none; border: 0; margin: 0; border-radius: 6px;
  min-width: 36px; height: 40px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent; text-decoration: none;
  font-family: var(--font-ui); font-weight: 600; font-size: 11px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
@media (hover: hover) { .rbtn:hover { color: var(--ink-head); background: var(--paper-2); } }
.rbtn:active { background: var(--paper-2); }
.rbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.rbtn:disabled, .rbtn[aria-disabled="true"] { opacity: .35; cursor: default; background: none; pointer-events: none; }
.rbtn[aria-pressed="true"], .rbtn.is-on { color: var(--accent-ink); }
.rbtn.icon { font-size: 17px; font-weight: 400; letter-spacing: 0; text-transform: none; }
/* the type-size control is set in the text face: the control shows the face it changes */
.size { display: inline-flex; align-items: center; }
.size-btn { min-width: 32px; padding: 0 4px; font-family: var(--font-text); font-weight: 500; font-size: 15px; text-transform: none; letter-spacing: 0; }
.size-mark { font-family: var(--font-ui); font-size: 9px; font-weight: 600; vertical-align: super; margin-left: 1px; }

/* a 375px screen: the tools cluster scrolls sideways so the running head
   keeps its width; "Expand all" steps aside — printing opens all anyway */
@media (max-width: 480px) {
  .rbar { padding-left: calc(var(--gutter) - 4px); }
  .rbar-tools { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 62vw; }
  .rbar-tools::-webkit-scrollbar { display: none; }
  .rbar-tools > * { flex: 0 0 auto; }
  #wz-expand { display: none; }
  .rbtn { min-width: 34px; padding: 0 6px; }
  .size-btn { min-width: 30px; padding: 0 3px; }
}


/* ----------------------------------------------------------------------------
   3. THINGS THAT FLOAT — sheet, search overlay, lightbox, report card
   (px-pinned chrome; the three surfaces the design lets carry a shadow)
   ---------------------------------------------------------------------------- */
.sheet-scrim, .srch-scrim, .report-scrim, .lightbox {
  position: fixed; inset: 0; z-index: 95;
  background: var(--scrim);
}
.sheet-scrim { display: flex; align-items: flex-end; }
/* the bottom sheet: one edge, a grab handle that says the gesture out
   loud, and the page still visible above it — phone only */
.sheet {
  inline-size: 100%; max-block-size: 78svh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid var(--accent); border-radius: 14px 14px 0 0;
  background: var(--paper-3); color: var(--ink); box-shadow: var(--e3);
  font: 400 16px/1.5 var(--font-text);
  animation: sheet-up .32s var(--ease-sheet);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grab {
  display: block; box-sizing: content-box; inline-size: 36px; block-size: 4px; margin: -8px auto 6px; padding: 12px 24px;
  border-radius: 2px; background: var(--rule-strong); background-clip: content-box; touch-action: none;
}
.sheet-title { margin: 6px 0 4px; font-weight: 600; font-size: 17px; line-height: 1.25; color: var(--ink-head); }
.sheet-gloss { margin: 0; color: var(--ink-2); hanging-punctuation: first; text-wrap: pretty; }
.sheet-go, .term-pop-go {
  display: inline-block; margin-top: 12px; padding-bottom: 3px;
  font-family: var(--font-ui); font-weight: 600; font-size: 11px; line-height: 1; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid currentColor;
}
.sheet-go { min-block-size: 44px; line-height: 44px; padding-bottom: 0; border-bottom: 0; }
.sheet :focus-visible, .term-pop-go:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* the chapter's own contents, in the sheet */
.toc-sheet-list { display: block; margin: 4px 0 0; border-top: 1px solid var(--rule); counter-reset: tocs; }
.toc-sheet-item {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; align-items: baseline;
  min-block-size: 44px; padding: 10px 0; border-bottom: 1px solid var(--rule);
  color: var(--ink-head); font-size: 15px; line-height: 1.35; text-decoration: none; counter-increment: tocs;
}
.toc-sheet-item::before { content: counter(tocs); font-family: var(--font-ui); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-3); text-align: right; }
.toc-sheet-item[aria-current] { color: var(--accent-ink); }
.toc-sheet-item[aria-current]::before { color: var(--accent-ink); }

/* search: a sheet from the top, an input that is a rule, ruled hits */
.srch-scrim { display: flex; justify-content: center; align-items: flex-start; }
.srch-overlay {
  inline-size: 100%; max-block-size: 100svh; display: flex; flex-direction: column;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 0 0;
  background: var(--paper-3); color: var(--ink); border-bottom: 1px solid var(--rule); box-shadow: var(--e3);
  font-family: var(--font-text);
  animation: search-in .22s var(--ease) both;
}
@keyframes search-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.srch-overlay .srch-input, .srch-form .srch-input {
  flex: 1 1 auto; min-width: 0; appearance: none; -webkit-appearance: none;
  background: none; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; margin: 0;
  padding: 8px 0; font: 400 17px/1.3 var(--font-text); color: var(--ink);   /* 17px: below 16px iOS zooms the page on focus */
  caret-color: var(--accent);
}
.srch-overlay .srch-input { margin: 0 var(--gutter); width: auto; }
.srch-input:focus { outline: none; border-bottom-color: var(--ink-head); }
.srch-input::placeholder { color: var(--ink-3); font-style: italic; }
.srch-input::-webkit-search-cancel-button, .srch-input::-webkit-search-decoration { -webkit-appearance: none; }
.srch-out { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px var(--gutter) calc(16px + env(safe-area-inset-bottom, 0px)); }
.srch-row { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.srch-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.srch-row.is-concept .srch-where::after { content: "\00a0\00b7\00a0term"; }
.srch-row.srch-all { font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); border-bottom: 0; }
.srch-none { padding: 20px 0; margin: 0; font-style: italic; color: var(--ink-3); }
.srch-where { display: block; margin-bottom: 3px; font-family: var(--font-ui); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.srch-snippet { display: block; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.srch-snippet mark, .mention-snip mark { background: none; color: var(--ink-head); font-weight: 500; text-decoration: underline; text-decoration-color: var(--hy-line); text-decoration-thickness: .11em; text-underline-offset: .17em; }
@media (hover: hover) { .srch-row:hover .srch-snippet, .srch-row:hover { color: var(--ink-head); } }

/* the lightbox: a pathway at least at natural size, panning; a small one
   grows to fill the width, a wide one is never shrunk to fit */
.lightbox { z-index: 70; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--paper) 96%, transparent); }
@supports not (background: color-mix(in srgb, red, blue)) { .lightbox { background: var(--paper); } }
.lightbox-body { width: min(100%, 1400px); max-height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; padding: calc(56px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.lightbox-body svg { display: block; width: auto; min-width: 100%; max-width: none; height: auto; margin: 0 auto; }
.lb-close { position: absolute; top: calc(6px + env(safe-area-inset-top, 0px)); right: 8px; font-size: 18px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-2); }

/* the report card: the one floating card, on raised paper with a hairline;
   its fields are bottom rules, not boxes */
.report-scrim { z-index: 100; display: grid; place-items: center; padding: 16px; }
.report-card {
  inline-size: min(34rem, 100%); max-block-size: min(90svh, 44rem); overflow: auto;
  padding: 20px 24px 22px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--paper-3); color: var(--ink); box-shadow: var(--e3);
  font: 400 15px/1.5 var(--font-text);
}
.report-card h2 { margin: 0 0 8px; font-weight: 600; font-size: 17px; line-height: 1.25; color: var(--ink-head); }
.report-quote { margin: 0 0 16px; padding-left: 12px; border-left: 1.5px solid var(--rule-strong); font-style: italic; color: var(--ink-2); }
.report-card label, .report-card label > span { display: block; margin-bottom: 4px; font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.report-card textarea, .report-card input {
  display: block; inline-size: 100%; margin: 0 0 14px; padding: 6px 0;
  appearance: none; -webkit-appearance: none; background: none; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0;
  color: var(--ink); font: 400 max(15px, 16px)/1.4 var(--font-text); caret-color: var(--accent);
}
.report-card textarea { min-block-size: 5.5rem; resize: vertical; }
.report-card textarea:focus, .report-card input:focus { outline: none; border-bottom-color: var(--ink-head); }
.report-actions { display: flex; gap: 4px; justify-content: flex-end; }
.report-msg { margin: 0 0 12px; font-size: 14px; color: var(--stop); }
.report-msg.is-ok { color: var(--go); }

/* back to the top of the chapter: a paper disc with a hairline */
.wz-top {
  position: fixed; inset-block-end: calc(20px + env(safe-area-inset-bottom, 0px)); inset-inline-end: 20px; z-index: 60;
  inline-size: 44px; block-size: 44px; border: 1px solid var(--rule); border-radius: 50%;
  background: var(--paper-3); color: var(--ink-2); font: 400 18px/1 var(--font-text); box-shadow: var(--e3); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.wz-top.is-on { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) { .wz-top:hover { color: var(--ink-head); } }
.wz-top:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }


/* ----------------------------------------------------------------------------
   4. THE TITLE PAGE (a book, or the department's shelf)
   A part page one size up: a short ink bar, a kicker in small caps, the
   title light and large, and the apparatus in the UI face.
   ---------------------------------------------------------------------------- */
.hero {
  min-height: min(72svh, 40rem); display: flex; flex-direction: column; justify-content: center;
  padding: var(--sp-6) 0 var(--sp-5);
}
.page-kicker, .po-kicker {
  margin: 0 0 var(--sp-3);
  font-size: var(--t0); line-height: 1.2; font-variant-caps: all-small-caps; letter-spacing: .16em; color: var(--ink-3);
}
.page-kicker::before, .po-kicker::before {   /* the one ornament: a short ink bar says "a title page" */
  content: ""; display: block; width: 2.5rem; height: 2px; background: var(--ink-head); margin-bottom: var(--sp-3);
}
.page-kicker { color: var(--accent-ink); }   /* cyan-ink, once per book */
.page-title {
  margin: 0 0 var(--sp-2);
  font-weight: 300; font-size: clamp(var(--t6), 13vw, 5.5rem); line-height: 1; font-variation-settings: "opsz" 72;
  letter-spacing: -.02em; color: var(--ink-head); text-wrap: balance;
}
.page-sub { margin: 0 0 var(--sp-4); font-style: italic; font-size: var(--t2); line-height: 1.3; color: var(--ink-2); text-wrap: balance; }
.page-meta { margin: 0 0 var(--sp-1); font-family: var(--font-ui); font-weight: 500; font-size: 12px; line-height: 1.5; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.page-meta a { color: inherit; }
/* the imprint line (editors, owner) is set in the text face over a hairline;
   the stamp line after it goes back to the UI face */
.hero .page-meta { padding-top: var(--sp-2); border-top: 1px solid var(--rule); font-family: var(--font-text); font-weight: var(--w-text); font-size: var(--t-1); letter-spacing: 0; color: var(--ink-2); }
.hero .page-meta + .page-meta { padding-top: 0; border-top: 0; font-family: var(--font-ui); font-weight: 500; font-size: 12px; letter-spacing: .04em; color: var(--ink-3); }
.page-actions { display: flex; flex-wrap: wrap; gap: 1.2rem; margin: var(--sp-4) 0 0; }
.page-actions a { font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 3px; }

/* a page whose header is not the hero (concept, search, changelog) */
.reader-main > header:not(.hero) { padding-top: var(--sp-6); }
.reader-main > header:not(.hero) .page-title { font-weight: 500; font-size: var(--t4); line-height: 1.08; letter-spacing: -.012em; margin-bottom: var(--sp-3); }
@media (min-width: 600px) { .reader-main > header:not(.hero) .page-title { font-size: var(--t5); } }


/* ----------------------------------------------------------------------------
   5. PART TITLE PAGES AND THE CONTENTS
   A page, not a heading: the roman numeral in small caps, a title at up to
   64px in Literata Light at the top of the optical axis, and the part's
   contents as a ruled list with hanging tabular numbers.
   ---------------------------------------------------------------------------- */
.part { margin: var(--sp-6) 0 0; scroll-margin-top: var(--bar-h); }
.part:has(.po-title) { min-height: min(56svh, 34rem); display: flex; flex-direction: column; justify-content: center; padding: var(--sp-6) 0 var(--sp-5); }
.hero + .part { margin-top: 0; }
.po-title {
  margin: 0 0 var(--sp-3);
  font-weight: 300; font-size: clamp(var(--t6), 11vw, 4rem); line-height: 1; font-variation-settings: "opsz" 72;
  letter-spacing: -.02em; color: var(--ink-head); text-wrap: balance;
}
.po-meta { margin: 0 0 var(--sp-4); font-family: var(--font-ui); font-weight: 500; font-size: 12px; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.part-name {
  margin: 0 0 var(--sp-2);
  font-size: var(--t0); line-height: 1.2; font-variant-caps: small-caps; letter-spacing: .12em; color: var(--ink-2);
}
.part-list, .card-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); max-width: 34rem; }
.part-list li, .card-list li { border-bottom: 1px solid var(--rule); }
.part-list a, .card {
  display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; column-gap: .6rem; align-items: baseline;
  padding: calc(var(--lh) * .35) 0;
  color: var(--ink-head); text-decoration: none; font-size: var(--t1); line-height: 1.3; text-wrap: pretty;
}
.card { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
.part-list .n { font-family: var(--font-ui); font-weight: 500; font-size: var(--t-2); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.part-list .pg { font-family: var(--font-ui); font-weight: 500; font-size: var(--t-2); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.card-t { display: block; }
.card-s { display: block; font-family: var(--font-ui); font-weight: 500; font-size: 12px; line-height: 1.5; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--ink-3); }
@media (hover: hover) {
  .part-list a:hover, .card:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .18em; }
  .card:hover .card-s { text-decoration: none; }
}
@media (min-width: 900px) {
  .part-list, .card-list.is-two { columns: 2; column-gap: 3rem; max-width: none; }
  .part-list li, .card-list.is-two li { break-inside: avoid; }
  .part-list:has(li:only-child), .card-list.is-two:has(li:only-child) { columns: 1; }
}


/* ----------------------------------------------------------------------------
   6. THE CHAPTER OPENER
   Numeral in Literata Light at opsz 72, part name in small caps, a title
   that fills the measure, an upright abstract, a folio line in the UI face,
   and the chapter rule — 1.5px strong — which is also the first rule of the
   accordion list.
   ---------------------------------------------------------------------------- */
.sec { padding-top: var(--sp-6); scroll-margin-top: calc(var(--bar-h) + 8px); }
.sec-body { counter-reset: acc; }
.chapter-head { position: relative; margin: 0; padding-bottom: var(--sp-2); border-bottom: 1.5px solid var(--rule-strong); }
.chapter-part {
  margin: 0 0 var(--sp-2);
  font-size: var(--t-2); line-height: 1.2; font-variant-caps: small-caps; letter-spacing: .14em; color: var(--ink-3);
}
.chapter-n {
  display: block; margin: 0 0 var(--sp-2);
  font-weight: 300; font-size: var(--t5); line-height: 1; font-variation-settings: "opsz" 72;
  font-variant-caps: normal; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; color: var(--ink-head);
}
.chapter-title {
  margin: 0 0 var(--sp-3);
  font-weight: 500; font-size: var(--t4); line-height: 1.08; font-variation-settings: "opsz" 72;
  letter-spacing: -.012em; color: var(--ink-head); text-wrap: balance;
}
@media (min-width: 600px) { .chapter-title { font-size: var(--t5); } }
.chapter-author { margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); font-style: italic; font-size: var(--t-1); color: var(--ink-2); }
.chapter-sum { margin: 0 0 var(--sp-3); max-width: 56ch; font-size: var(--t1); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; hanging-punctuation: first; }
.chapter-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem;
  font-family: var(--font-ui); font-weight: 500; font-size: 12px; line-height: 1.4; letter-spacing: .03em; font-variant-numeric: tabular-nums; color: var(--ink-3);
}
.chapter-meta a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.stamp { font-variant-numeric: tabular-nums; }

/* the printing-of-record banner (?from=): a note between rules, not a box */
.printing-banner {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem;
  margin: 0; padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule);
  font-size: var(--t-1); line-height: 1.45; color: var(--ink-2); text-wrap: pretty;
}
.printing-banner b { color: var(--ink-head); }
.printing-banner a { font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid currentColor; }

.empty { margin: var(--sp-4) 0; font-style: italic; color: var(--ink-3); }


/* ----------------------------------------------------------------------------
   7. THE ACCORDION — 80% of the surface
   No card. A <details> is a numbered subhead between hairlines; its body is
   prose set flush to the measure. Collapsed and open differ by the glyph
   (+ becomes −) and the body, not by colour, fill or shadow.
   ---------------------------------------------------------------------------- */
.blk-section > .acc { margin: 0; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--bar-h) + 12px); counter-increment: acc; }
.sec-body > .blk-section:first-child > .acc { border-top: 0; }   /* the chapter rule is the list's first rule */
.blk-section:last-child > .acc, .blk-section:has(+ :not(.blk-section)) > .acc { border-bottom: 1px solid var(--rule); }

.acc > summary.acc-sum, .acc[open] > summary.acc-sum {
  list-style: none; position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) 18px; column-gap: .6rem; align-items: baseline;
  min-height: 44px; padding: var(--sp-2) 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::marker { content: ""; }

.sec-h { margin: 0; color: var(--ink-head); }
.acc-sum > .sec-h2 {
  grid-column: 1;
  padding-left: 1.7rem; text-indent: -1.7rem;   /* the numeral hangs; wrapped lines align with the title */
  font-weight: 600; font-size: var(--t0); line-height: 1.3; letter-spacing: -.003em; text-wrap: balance;
}
.acc-sum > .sec-h2::before {                    /* the subhead numeral, 1 2 3 … within the chapter */
  content: counter(acc);
  display: inline-block; width: 1.7rem; text-indent: 0;
  font-family: var(--font-ui); font-weight: 500; font-style: normal; font-size: var(--t-2); line-height: 1; letter-spacing: 0;
  font-variant-numeric: tabular-nums; color: var(--ink-3);
}
.ext-tag {
  display: inline-block; margin-left: .6rem; text-indent: 0; vertical-align: baseline; white-space: nowrap;
  font-family: var(--font-ui); font-weight: 600; font-size: .647rem; line-height: 1; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.acc-chev {                              /* a plus drawn with two hairlines; the upright collapses to a minus */
  grid-column: 2; grid-row: 1; align-self: center; justify-self: end;
  position: relative; width: 16px; height: 16px;
}
.acc-chev::before, .acc-chev::after {
  content: ""; position: absolute; left: 50%; top: 50%; background: var(--ink-3);
  transform: translate(-50%, -50%);
  transition: transform .2s var(--ease), background-color .15s var(--ease);
}
.acc-chev::before { width: 12px; height: 1.5px; }
.acc-chev::after { width: 1.5px; height: 12px; }
.acc[open] > summary .acc-chev::after { transform: translate(-50%, -50%) scaleY(0); }
@media (hover: hover) {
  .acc > summary:hover .acc-chev::before, .acc > summary:hover .acc-chev::after { background: var(--ink-head); }
}

/* the lede turns a closed drawer into a subhead over a line of text — a
   digest a reader can skim like a page */
.acc-summary {
  grid-column: 1; margin-top: .2rem;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-weight: var(--w-text); font-size: var(--t-1); line-height: 1.45; color: var(--ink-2); text-wrap: pretty;
}
.is-extended > .acc > summary .acc-summary { color: var(--ink-3); }
.acc[open] > summary .acc-summary { display: none; }

/* EXTENDED — a quieter voice, not a disabled one. Weight is the classic
   primary/secondary device of a contents list; the body is full ink. */
.is-extended > .acc > summary .sec-h2 { font-weight: 400; color: var(--ink-2); }
.blk.is-extended { padding: 0; background: none; border-radius: 0; }

/* THE BODY — the reading surface */
.acc-body { padding: var(--sp-1) 0 var(--sp-4); hanging-punctuation: first last; text-wrap: pretty; }
.acc-body > .blk + .blk { margin-top: var(--sp-2); }
/* a level-3 section inside the drawer: a run-in subhead, no rule */
.sec-h3 { margin: var(--sp-3) 0 var(--sp-1); font-weight: 600; font-size: var(--t0); line-height: 1.3; color: var(--ink-head); }
.acc-body > .blk-section:first-child > .sec-h3 { margin-top: 0; }
.blk-section > .sec-h3 + .blk { margin-top: 0; }

/* DEEP DIVES — unnumbered, their kind in navy tracked caps, opened by a
   generated side-head in the same grammar as .blk-h */
.blk-deepdive > .acc.dd { margin: 0; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--bar-h) + 12px); }
.blk-deepdive:last-child > .acc.dd, .blk-deepdive:has(+ :not(.blk-deepdive)) > .acc.dd { border-bottom: 1px solid var(--rule); }
.dd-head { grid-column: 1; font-weight: 500; font-size: var(--t0); line-height: 1.3; color: var(--ink-head); text-wrap: balance; }
.dd-tag {
  display: inline-block; margin-right: .5rem; vertical-align: baseline; white-space: nowrap;
  font-family: var(--font-ui); font-weight: 600; font-size: .647rem; line-height: 1; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-head);
}
.dd-body { padding: var(--sp-1) 0 var(--sp-4); hanging-punctuation: first last; text-wrap: pretty; }
.dd-body > * + * { margin-top: var(--sp-2); }


/* ----------------------------------------------------------------------------
   8. BLOCKS AND RHYTHM
   Every apparatus block (Pathways, Deep dives, Numbers to know, Pearls,
   Check yourself, See also, References) is introduced the same way — small
   caps over a strong rule — and separated by the same interval, so a
   chapter reads as sections of one chapter, not a stack of widgets.
   ---------------------------------------------------------------------------- */
.blk { position: relative; }
.blk > :first-child { margin-top: 0; }
.blk > :last-child { margin-bottom: 0; }
.sec-body > .blk + .blk { margin-top: 0; }
.sec-body > .blk-paragraph, .sec-body > .blk-list, .sec-body > .blk-table, .sec-body > .blk-figure, .sec-body > .blk-image,
.sec-body > .blk-video, .sec-body > .blk-audio, .sec-body > .blk-embed { margin-top: var(--sp-3); }
.sec-body > .blk-diagram, .sec-body > .blk-deepdive, .sec-body > .blk-numbers, .sec-body > .blk-pearls, .sec-body > .blk-mcq,
.sec-body > .blk-seealso, .sec-body > .blk-references, .sec-body > .blk-callout { margin-top: var(--sp-5); }
.sec-body > .blk-mcq + .blk-mcq, .sec-body > .blk-deepdive + .blk-deepdive,
.sec-body > .blk-numbers + .blk-numbers, .sec-body > .blk-pearls + .blk-pearls { margin-top: 0; }
.sec-body > .blk-diagram + .blk-diagram, .acc-body > .blk-diagram + .blk-diagram { margin-top: var(--sp-4); }
.acc-body > .blk-diagram, .acc-body > .blk-mcq, .acc-body > .blk-deepdive, .acc-body > .blk-callout { margin-top: var(--sp-4); }
.acc-body > .blk-mcq + .blk-mcq, .acc-body > .blk-deepdive + .blk-deepdive { margin-top: 0; }

.blk-h, .side-head, .h-sub,
.blk:not(.blk-diagram) + .blk-diagram::before, .sec-body > .blk-diagram:first-child::before, .acc-body > .blk-diagram:first-child::before,
.blk:not(.blk-mcq) + .blk-mcq::before, .sec-body > .blk-mcq:first-child::before, .acc-body > .blk-mcq:first-child::before,
.blk:not(.blk-deepdive) + .blk-deepdive::before, .sec-body > .blk-deepdive:first-child::before, .acc-body > .blk-deepdive:first-child::before {
  display: block; margin: 0 0 var(--sp-2); padding-top: var(--sp-2); border-top: 1.5px solid var(--rule-strong);
  font-family: var(--font-text); font-weight: var(--w-text); font-size: var(--t0); line-height: 1.2; font-variant-caps: small-caps; letter-spacing: .12em; text-transform: none; color: var(--ink-2);
}
.blk:not(.blk-diagram) + .blk-diagram::before, .sec-body > .blk-diagram:first-child::before, .acc-body > .blk-diagram:first-child::before { content: "Pathways"; }
.blk:not(.blk-mcq) + .blk-mcq::before, .sec-body > .blk-mcq:first-child::before, .acc-body > .blk-mcq:first-child::before { content: "Check yourself"; }
.blk:not(.blk-deepdive) + .blk-deepdive::before, .sec-body > .blk-deepdive:first-child::before, .acc-body > .blk-deepdive:first-child::before { content: "Deep dives"; margin-bottom: 0; padding-bottom: var(--sp-2); border-bottom: 1px solid var(--rule); }
.blk:not(.blk-deepdive) + .blk-deepdive > .acc.dd, .sec-body > .blk-deepdive:first-child > .acc.dd, .acc-body > .blk-deepdive:first-child > .acc.dd { border-top: 0; }
.seealso > .blk-h { display: block; }

/* prose */
.blk p { margin: 0 0 var(--sp-2); }
.blk ul, .blk ol { margin: 0 0 var(--sp-2); padding-left: 1.25rem; }
.blk ul { list-style-type: "\2013\2002"; }          /* the hanging en dash of a printed handbook */
.blk li { margin: 0 0 calc(var(--lh) * .2); padding-left: .1rem; }
.blk li > ul, .blk li > ol { margin: calc(var(--lh) * .2) 0 0; }
.blk li::marker { color: var(--ink-3); }
.blk ol li::marker { font-family: var(--font-ui); font-size: .85em; font-variant-numeric: tabular-nums; }
.blk h4 { margin: var(--sp-3) 0 var(--sp-1); font-weight: 600; font-size: var(--t0); line-height: 1.3; color: var(--ink-head); }
.blk h5 { margin: var(--sp-2) 0 var(--sp-1); font-weight: var(--w-text); font-style: italic; font-size: var(--t0); line-height: 1.3; color: var(--ink-2); }
.blk code { font: .86em/1 var(--font-mono); background: var(--paper-2); padding: .05em .3em; border-radius: 3px; }
.blk sub, .blk sup { font-size: .72em; line-height: 0; position: relative; vertical-align: baseline; }
.blk sup { top: -.5em; }
.blk sub { top: .25em; }
/* hyphenate only where the measure is short; on a 70-character line the rag
   is fine and hyphens in clinical compounds look fussy */
@media (max-width: 640px) {
  .acc-body, .dd-body, .chapter-sum, .tbl td, .pearl, .num, .mcq-q, .mcq-t, .mcq-why, .callout {
    hyphens: auto; -webkit-hyphens: auto;
    hyphenate-limit-chars: 8 4 4; -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4;
  }
}

/* a block whose source moved after it was derived: editors see this */
.blk.is-stale { opacity: .82; }
/* changed since the printing the reader arrived from (?from=): a cyan
   margin rule — the accent as a mark — and a label in the UI face */
.blk.is-changed { box-shadow: -2px 0 0 0 var(--accent); padding-left: .8rem; }
.blk.is-changed::after {
  content: "corrected"; position: absolute; inset-block-start: 0; inset-inline-end: 0;
  font-family: var(--font-ui); font-weight: 600; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink);
}
@media (min-width: 900px) { .blk.is-changed { margin-left: -.8rem; } }

/* the erratum flag, injected into every block by the enhancer */
.blk-report {
  position: absolute; inset-block-start: 2px; inset-inline-end: 0; z-index: 1;
  inline-size: 24px; block-size: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent;
  color: var(--ink-3); font: 400 13px/1 var(--font-text); cursor: pointer; opacity: 0;
  transition: opacity .18s var(--ease);
}
.blk:hover > .blk-report, .blk:focus-within > .blk-report, .blk-report:focus-visible { opacity: 1; }
@media (hover: hover) { .blk-report:hover { color: var(--stop); } }
.blk-report:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
@media (hover: none) { .blk-report { opacity: .3; } }
@media (min-width: 1100px) { .blk-report { inset-inline-end: auto; inset-inline-start: calc(100% + 1.2rem); } }
/* a drawer's flag sits beside its chevron, never on it */
.blk-section > .blk-report, .blk-deepdive > .blk-report { inset-block-start: calc(var(--sp-2) + 1px); inset-inline-end: 26px; }
@media (min-width: 1100px) { .blk-section > .blk-report, .blk-deepdive > .blk-report { inset-inline-end: auto; } }


/* ----------------------------------------------------------------------------
   9. THE CLINICAL CODE AND THE INLINE MARKS — inks, no highlighter
   Each carries meaning on two channels (colour or mark + weight) so a
   colour-blind reader and a greyscale print keep it. Nothing sits behind
   serif text, ever.
   ---------------------------------------------------------------------------- */
.hy {                                    /* the examinable sentence: a pencil rule under weight-500 text */
  font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--hy-line);
  text-decoration-thickness: .11em; text-underline-offset: .17em; text-decoration-skip-ink: none;
}
.exam {                                  /* the key-exam sentence: the same rule in navy */
  font-weight: 500; color: var(--ink-head);
  text-decoration: underline; text-decoration-color: var(--ink-head);
  text-decoration-thickness: .11em; text-underline-offset: .17em; text-decoration-skip-ink: none;
}
.dgr { color: var(--stop); font-weight: 500; }           /* the red flag: red ink */
.adv { color: var(--go); font-weight: 500; }             /* the advantage: green ink */
.aside { font-style: italic; color: var(--ink-2); }
.ref { font-family: var(--font-ui); font-weight: 500; font-size: .7em; line-height: 0; vertical-align: super; color: var(--ink-3); text-decoration: none; }
/* `note` is an inline expander: the aside text lives in data-note and is
   revealed in place, so the sentence never loses its thread */
.note { cursor: pointer; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: var(--rule-strong); text-decoration-thickness: 1px; text-underline-offset: .2em; }
.note::after { content: "\24D8"; margin-left: 2px; font-size: .8em; color: var(--ink-3); }
.note-body { display: block; margin: var(--sp-1) 0 var(--sp-2) 1.6rem; padding-left: .9rem; border-left: 1.5px solid var(--rule-strong); font-size: var(--t-1); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
/* never in a heading; a cross-link inside a mark keeps the mark's line, not its own */
.sec-h .hy, .sec-h .exam, .sec-h .dgr, .sec-h .adv, .dd-head .hy, .dd-head .exam, .blk-h .hy, .chapter-title .hy,
.sec-h .dgr, .sec-h .adv { font-weight: inherit; color: inherit; text-decoration: none; }
.hy .term, .exam .term, .dgr .term, .adv .term { text-decoration: none; color: inherit; }
.hy .term.is-active, .exam .term.is-active, .dgr .term.is-active, .adv .term.is-active { color: var(--accent-ink); }

/* the callout: a pencil rule down the left in the tone's ink, a label in
   the UI face — no fill, no radius */
.callout { margin: 0; padding: .1rem 0 .1rem 1rem; border-left: 1.5px solid var(--rule-strong); }
.callout > :last-child { margin-bottom: 0; }
.callout-label { margin: 0 0 var(--sp-1); font-family: var(--font-ui); font-weight: 600; font-size: 11px; line-height: 1.3; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.callout-note { border-left-color: var(--rule-strong); }
.callout-pearl { border-left-color: var(--ink-head); }
.callout-pearl .callout-label { color: var(--ink-head); }
.callout-exam { border-left-color: var(--hy-line); }
.callout-exam .callout-label { color: var(--ink-head); }
.callout-danger { border-left-color: var(--stop); }
.callout-danger .callout-label { color: var(--stop); }
.callout-guide, .callout-reversal { border-left-color: var(--go); }
.callout-guide .callout-label, .callout-reversal .callout-label { color: var(--go); }


/* ----------------------------------------------------------------------------
   10. TABLES — typography, not a grid widget
   Chicago rules: a strong rule above the head and below it, a strong rule at
   the foot, hairlines between rows, no verticals, no zebra, no fills. Heads
   in the UI face (labels), cells in Literata with tabular lining figures,
   the stub column in navy. .tbl-scroll is the only thing that scrolls
   sideways.
   ---------------------------------------------------------------------------- */
.tbl-cap { margin: 0 0 var(--sp-1); font-style: italic; font-size: var(--t-1); line-height: 1.45; color: var(--ink-2); }
.tbl-cap i { font-style: inherit; }
.tbl-scroll {
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  margin: var(--sp-2) calc(-1 * var(--bleed)) var(--sp-2);
  scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent;
  /* a right-edge shadow that a local paper gradient covers once you reach the end */
  background:
    linear-gradient(to left, var(--paper) 30%, transparent) 100% 0 / 40px 100% no-repeat local,
    linear-gradient(to left, var(--rule-strong), transparent) 100% 0 / 12px 100% no-repeat scroll;
}
.tbl-scroll.is-scrollable:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.tbl-scroll.is-scrolled-end { background: none; }   /* at the end there is nothing more to the right */
.tbl {
  display: table; width: 100%; margin: 0;
  border-collapse: separate; border-spacing: 0;    /* separate: sticky cells then carry their own rules */
  font-family: var(--font-text); font-size: max(var(--t-1), 14px); line-height: 1.4;
  font-variant-numeric: lining-nums tabular-nums; text-align: left;
  border-top: 1.5px solid var(--rule-strong); border-bottom: 1.5px solid var(--rule-strong);
}
.tbl th, .tbl td { padding: .5rem .9rem .5rem 0; vertical-align: top; text-align: left; border: 0; background: none; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl thead th {
  font-family: var(--font-ui); font-weight: 600; font-size: var(--t-2); line-height: 1.3; letter-spacing: .01em; color: var(--ink-2);
  vertical-align: bottom; padding-top: .55rem; padding-bottom: .45rem; border-bottom: 1px solid var(--rule-strong);
}
.tbl td { border-bottom: 1px solid var(--rule); }
.tbl tbody tr:last-child td, .tbl tbody tr:last-child th { border-bottom: 0; }
.tbl tbody td:first-child, .tbl tbody th { color: var(--ink-head); }        /* the stub carries the row's name */
.tbl tbody th { font-family: var(--font-ui); font-weight: 600; font-size: var(--t-2); line-height: 1.35; border-bottom: 1px solid var(--rule); }
.tbl td b, .tbl td strong { font-weight: 600; }
.tbl td p { margin: 0 0 .35em; }
.tbl td p:last-child { margin-bottom: 0; }
.tbl td ul, .tbl td ol { margin: 0; padding-left: 1.1em; }
.tbl td ul { list-style-type: "\2013\2002"; }
.tbl td li::marker { color: var(--ink-3); }
.tbl td:empty::before { content: "\2014"; color: var(--ink-3); }
/* three columns: a floor per cell so nothing crushes to one word; four or
   more (the importer marks those w-full): the table scrolls inside
   .tbl-scroll and the stub column stays put while the figures slide under it */
.tbl:has(th:nth-child(3)) th, .tbl:has(th:nth-child(3)) td { min-width: 9ch; }
.w-full .tbl:has(th:nth-child(4)) { min-width: 36rem; }
.w-full .tbl:has(th:nth-child(4)) th:first-child,
.w-full .tbl:has(th:nth-child(4)) td:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--paper);
  max-width: 11rem; box-shadow: 1px 0 0 var(--rule);
}
.w-full .tbl:has(th:nth-child(4)) thead th:first-child { z-index: 2; }


/* ----------------------------------------------------------------------------
   11. CROSS-LINKS AND THE POPOVER
   A .term is a dotted hairline under text-coloured words: an indexer's
   mark, not a hyperlink; a solid hairline says the concept is taught here.
   The active one is the only cyan on the page. The popover is the one card
   the design allows, because it floats; the enhancer sets its left/top from
   getBoundingClientRect, so it must stay position: fixed.
   ---------------------------------------------------------------------------- */
.term {
  color: inherit; cursor: pointer; font-weight: inherit; background: none; border-radius: 0;
  text-decoration: underline; text-decoration-style: dotted; text-decoration-thickness: 1px;
  text-decoration-color: var(--kw-line); text-underline-offset: .2em; text-decoration-skip-ink: all;
  -webkit-tap-highlight-color: transparent;
}
.term[data-home="1"] { text-decoration-style: solid; }
@media (hover: hover) { .term:hover { background: none; text-decoration-color: var(--ink-2); } }
.term.is-active, .term[aria-expanded="true"] {
  background: none; color: var(--accent-ink);
  text-decoration-style: solid; text-decoration-thickness: 1.5px; text-decoration-color: var(--accent);
}
.term:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sec-h .term, .dd-head .term, .blk-h .term, .chapter-title .term, .chapter-sum .term, .mcq-q .term, .part-list .term { text-decoration: none; color: inherit; }

.term-pop {
  position: fixed; z-index: 90;
  width: min(340px, calc(100vw - 16px));
  background: var(--paper-3); color: var(--ink);
  border: 1px solid var(--rule); border-top: 2px solid var(--accent); border-radius: 4px;
  box-shadow: var(--e3);
  padding: 12px 16px 13px;
  font: 400 15px/1.45 var(--font-text); font-variant-numeric: lining-nums;
  animation: pop-in .18s var(--ease) both;
}
.term-pop-term { margin: 0 0 4px; font-weight: 600; font-size: 16px; line-height: 1.25; color: var(--ink-head); }
.term-pop-gloss { margin: 0; color: var(--ink-2); hanging-punctuation: first; text-wrap: pretty; }
.term-pop-go { margin-top: 10px; }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* the hover bridge: an invisible strip across the 8px gap between the word
   and the card, so the pointer can cross without the card closing; drawn on
   whichever side the card was placed */
.term-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.term-pop[data-side="top"]::before { top: auto; bottom: -12px; }


/* ----------------------------------------------------------------------------
   12. THE APPARATUS — figures, numbers, pearls, questions, see also, references
   ---------------------------------------------------------------------------- */
/* figures: diagrams float on the paper with no frame; captions in the text
   face. Selectors carry two classes so they outrank diagram.css's
   single-class host rules, which are concatenated before this file. */
.blk .fig { margin: 0 calc(-1 * var(--bleed)); }
.blk .fig-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px .6rem; margin: 0 0 var(--sp-1); }
.blk .fig-num { font-family: var(--font-ui); font-weight: 600; font-size: 11px; line-height: 1.3; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.blk .fig-t { font-family: var(--font-text); font-weight: 600; font-size: var(--t0); line-height: 1.3; letter-spacing: 0; color: var(--ink-head); }
.blk .fig figcaption { margin: var(--sp-1) 0 0; font-family: var(--font-text); font-style: italic; font-size: var(--t-1); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.blk .fig .credit { font-style: normal; font-family: var(--font-ui); font-size: 11px; letter-spacing: .04em; color: var(--ink-3); }
.blk .flow { padding: 6px 0 4px; }
/* the enhancer sizes each pathway after drawing it: .is-fit shrinks the SVG
   to the column, .is-wide keeps it at drawn size and scrolls. The wide case
   gets scroll shadows that fade out at either end (background-attachment:
   local moves the paper-coloured masks with the content) and a line of
   caption text saying what to do. */
.blk .flow.is-wide {
  background:
    linear-gradient(to right, var(--paper) 40%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left,  var(--paper) 40%, transparent) right / 28px 100% no-repeat local,
    linear-gradient(to right, rgba(16, 16, 79, .07), transparent) left / 10px 100% no-repeat scroll,
    linear-gradient(to left,  rgba(16, 16, 79, .07), transparent) right / 10px 100% no-repeat scroll;
}
.fig-hint {
  margin: 2px 0 0; font-family: var(--font-ui); font-weight: 500; font-size: 11px; line-height: 1.4;
  letter-spacing: .04em; color: var(--ink-3); text-align: right;
}
.fig-hint::before { content: "\2194\00a0"; }
.blk .fig img, .blk .fig video { display: block; max-inline-size: 100%; height: auto; }
.blk .fig-audio audio { display: block; inline-size: 100%; }
.embed { padding: var(--sp-2) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: var(--t-1); }
.embed a { color: var(--ink-head); }
.media-missing { padding: var(--sp-2) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-style: italic; color: var(--ink-3); }
.audio-chapters { list-style: none; margin: var(--sp-2) 0 0; padding: 0; }
.audio-chapters li { display: flex; align-items: baseline; gap: 1rem; padding: calc(var(--lh) * .25) 0; border-bottom: 1px solid var(--rule); font-size: var(--t-1); }
.audio-chapters .t { flex: none; font-family: var(--font-ui); font-weight: 500; font-size: var(--t-2); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.media-qr { display: flex; gap: 1rem; align-items: flex-start; }
.media-qr-code svg { display: block; width: 88px; height: 88px; }
.media-qr-text { font-size: var(--t-1); line-height: 1.45; color: var(--ink-2); }
.media-qr-url { font-family: var(--font-mono); font-size: .8em; overflow-wrap: anywhere; }

/* numbers to know: a table without a table — hairline rows, tabular
   figures, page reference in the UI face at the right edge */
.nums { margin: 0; }
.num-list { list-style: none; margin: 0; padding: 0; }
.num {
  position: relative; display: flex; align-items: baseline; gap: 1rem;
  padding: calc(var(--lh) * .35) 0; border-bottom: 1px solid var(--rule);
  font-variant-numeric: lining-nums tabular-nums; text-wrap: pretty;
}
.num-pg { flex: none; margin-left: auto; font-family: var(--font-ui); font-weight: 500; font-size: var(--t-2); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }

/* pearls: upright one-liners on a hanging en rule */
.pearls ul { list-style: none; margin: 0; padding: 0; }
.pearl { margin: 0; padding: 0 0 var(--sp-2) 1.2em; text-indent: -1.2em; text-wrap: pretty; hanging-punctuation: first; }
.pearl::before { content: "\2013\2002"; color: var(--ink-3); }

/* check yourself: a ruled list of 44px rows; the verdict is an ink change
   and a mark, not a fill. The letter is in the markup (it prints and
   exports), so no counter here. */
.mcq { padding: var(--sp-2) 0 var(--sp-3); border-bottom: 1px solid var(--rule); }
.blk-mcq:last-child .mcq, .blk-mcq:has(+ :not(.blk-mcq)) .mcq { border-bottom: 0; }
.mcq-q { margin: 0 0 var(--sp-2); font-weight: 500; font-size: var(--t0); line-height: 1.45; color: var(--ink-head); text-wrap: pretty; }
.mcq-opts { list-style: none; margin: 0; padding: 0; }
.mcq-opts > li { display: grid; }
.mcq-opt {
  appearance: none; -webkit-appearance: none; background: none; border: 0; border-top: 1px solid var(--rule-faint); border-radius: 0; margin: 0;
  display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); align-items: baseline; inline-size: 100%;
  min-height: 44px; padding: calc(var(--lh) * .3) 0; text-align: start;
  font: inherit; font-size: var(--t-1); line-height: 1.45; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color .15s var(--ease);
}
.mcq-opt::before { content: none; }
.mcq-l { font-family: var(--font-ui); font-weight: 500; font-size: var(--t-2); line-height: 1; color: var(--ink-3); }
.mcq-t { display: block; }
@media (hover: hover) { .mcq:not(.is-done) .mcq-opt:hover { color: var(--ink-head); } }
.mcq-opt.is-right { color: var(--go); font-weight: 500; }
.mcq-opt.is-right .mcq-l { color: var(--go); font-family: var(--font-text); font-weight: 600; font-size: 1em; text-transform: none; }
.mcq-opt.is-right .mcq-l::before { content: "\2713"; }
.mcq-opt.is-wrong { color: var(--stop); }
.mcq-opt.is-wrong .mcq-l { color: var(--stop); font-family: var(--font-text); font-size: 1em; text-transform: none; }
.mcq-opt.is-wrong .mcq-l::before { content: "\2715"; }
.mcq-opt.is-right .mcq-l, .mcq-opt.is-wrong .mcq-l { font-size: 0; }
.mcq-opt.is-right .mcq-l::before, .mcq-opt.is-wrong .mcq-l::before { font-size: var(--t-1); }
.mcq.is-done .mcq-opt, .mcq-opt[aria-disabled="true"] { cursor: default; }
.mcq.is-done .mcq-opt:not(.is-right):not(.is-wrong) { color: var(--ink-3); }
.mcq-why { margin: var(--sp-2) 0 0 1.6rem; padding-left: .9rem; border-left: 1.5px solid var(--rule-strong); font-size: var(--t-1); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.mcq-why[hidden] { display: none; }
.wz-sr { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* see also: an inline run of italic titles; the chapter ends quietly.
   (The registry joins the links with a middot; nothing generated here.) */
.seealso { padding-bottom: var(--sp-2); font-size: var(--t0); line-height: 1.6; color: var(--ink-3); }
.rel { font-style: italic; color: var(--ink-head); text-decoration: none; }
@media (hover: hover) { .rel:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .18em; } }

/* references: the numbers-to-know grammar with hanging numerals */
.refs { margin: 0; }
.ref-list { list-style: none; margin: 0; padding: 0; counter-reset: ref; }
.ref-list li {
  position: relative; padding: calc(var(--lh) * .3) 0 calc(var(--lh) * .3) 2rem; border-bottom: 1px solid var(--rule);
  font-size: var(--t-1); line-height: 1.5; color: var(--ink-2); counter-increment: ref; overflow-wrap: anywhere;
}
.ref-list li::before { content: counter(ref); position: absolute; left: 0; top: calc(var(--lh) * .3 + .2em); font-family: var(--font-ui); font-weight: 500; font-size: var(--t-2); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.ref-list li:target { text-decoration: underline; text-decoration-color: var(--hy-line); text-decoration-thickness: .11em; text-underline-offset: .17em; }
.ref-list a { color: var(--ink-head); }

/* the colophon of an offline file: the imprint, small, over a hairline */
.foot { margin: var(--sp-6) 0 0; padding: var(--sp-3) 0 calc(var(--sp-3) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); }
.foot .page-meta { margin: 0; }

/* the chapter's pager: two titles on a hairline */
.pager { display: flex; justify-content: space-between; gap: 1.5rem; margin: var(--sp-6) 0 0; padding-top: var(--sp-3); border-top: 1px solid var(--rule); }
.pager a { max-inline-size: 46%; font-style: italic; font-size: var(--t0); line-height: 1.35; color: var(--ink-head); text-decoration: none; text-wrap: balance; }
.pager .k { display: block; margin-bottom: 4px; font-family: var(--font-ui); font-style: normal; font-weight: 600; font-size: 11px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pager .next { text-align: right; margin-left: auto; }
@media (hover: hover) { .pager a:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .18em; } }


/* ----------------------------------------------------------------------------
   13. THE OTHER PAGES — concept, index, search, changelog, subscribe
   Fresh, in the grammar: ruled lists, small caps over strong rules, fields
   that are bottom rules, no chips.
   ---------------------------------------------------------------------------- */
.h-sub { margin: var(--sp-5) 0 var(--sp-2); }
.concept-gloss { margin: 0 0 var(--sp-3); max-width: 56ch; font-size: var(--t1); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; hanging-punctuation: first; }
.concept-body { margin: var(--sp-4) 0 0; }
.concept-body p { margin: 0 0 var(--sp-2); }
.gloss-attrib { margin: 0 0 var(--sp-2); font-family: var(--font-ui); font-weight: 500; font-size: 12px; line-height: 1.5; letter-spacing: .03em; color: var(--ink-3); }
.gloss-attrib a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.gloss-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.gloss-item { padding: calc(var(--lh) * .4) 0; border-bottom: 1px solid var(--rule); text-wrap: pretty; }
.gloss-item .gloss-attrib { margin: 4px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; margin: 0; padding: 0; list-style: none; font-size: var(--t0); line-height: 1.6; }
.chip { font-style: italic; color: var(--ink-head); text-decoration: none; }
@media (hover: hover) { .chip:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .18em; } }

/* where a concept appears: title → chapter (a drawer) → block rows */
.mention-title { margin: var(--sp-3) 0 var(--sp-1); font-weight: 500; font-size: var(--t0); line-height: 1.3; color: var(--ink-head); }
.mention-ch { border-top: 1px solid var(--rule); }
.mention-ch:last-child, .mention-ch:has(+ :not(.mention-ch)) { border-bottom: 1px solid var(--rule); }
.mention-ch > summary {
  list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; column-gap: .6rem; align-items: baseline;
  min-height: 44px; padding: var(--sp-2) 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  font-weight: 600; font-size: var(--t0); line-height: 1.3; color: var(--ink-head);
}
.mention-ch > summary::-webkit-details-marker { display: none; }
.mention-ch > summary::marker { content: ""; }
.mention-ch > summary a { color: inherit; text-decoration: none; }
.mention-count { font-family: var(--font-ui); font-weight: 500; font-size: var(--t-2); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.mention-home { font-family: var(--font-ui); font-weight: 600; font-size: .647rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.mention-list { list-style: none; margin: 0; padding: 0 0 var(--sp-2); }
.mention-list li { border-top: 1px solid var(--rule-faint); }
.mention-list a { display: block; padding: calc(var(--lh) * .3) 0; color: var(--ink); text-decoration: none; }
.mention-h { display: block; font-family: var(--font-ui); font-weight: 500; font-size: 11px; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.mention-snip { display: block; font-size: var(--t-1); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
@media (hover: hover) { .mention-list a:hover .mention-snip { color: var(--ink-head); } }

/* the A–Z */
.az-nav { position: sticky; top: var(--bar-h); z-index: 30; display: flex; flex-wrap: wrap; gap: 0 .2rem; margin: 0 0 var(--sp-3); padding: var(--sp-1) 0; background: var(--paper); border-bottom: 1px solid var(--rule); font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .04em; }
.az-nav a, .az-nav span { display: inline-block; min-width: 1.7rem; padding: 6px 0; text-align: center; color: var(--ink-2); text-decoration: none; }
.az-nav span { color: var(--rule-strong); }
@media (hover: hover) { .az-nav a:hover { color: var(--accent-ink); } }
.az-letter { display: flex; align-items: baseline; gap: .8rem; margin: var(--sp-5) 0 var(--sp-1); padding-top: var(--sp-2); border-top: 1.5px solid var(--rule-strong); scroll-margin-top: calc(var(--bar-h) + 48px); font-weight: 300; font-size: var(--t4); line-height: 1; font-variation-settings: "opsz" 72; color: var(--ink-head); }
.az-count { font-family: var(--font-ui); font-weight: 500; font-size: var(--t-2); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.az-list { list-style: none; margin: 0; padding: 0; }
.az-list li { padding: calc(var(--lh) * .3) 0; border-bottom: 1px solid var(--rule); }
.az-list a { color: var(--ink-head); text-decoration: none; font-weight: 500; }
@media (hover: hover) { .az-list a:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .18em; } }
.az-meta { margin-left: .6rem; font-family: var(--font-ui); font-weight: 500; font-size: 11px; letter-spacing: .03em; font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.az-gloss { display: block; margin-top: 2px; font-size: var(--t-1); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.az-top { display: inline-block; margin: var(--sp-2) 0 0; font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; }

/* the search page */
.srch-form { display: flex; align-items: flex-end; gap: 1rem; margin: var(--sp-3) 0 var(--sp-4); }
.srch-form .rbtn { height: 36px; padding: 0; color: var(--accent-ink); }
.srch-hint, .srch-count { margin: 0 0 var(--sp-3); font-family: var(--font-ui); font-weight: 500; font-size: 12px; letter-spacing: .03em; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.srch-concepts { display: block; margin: 0 0 var(--sp-4); border-top: 1px solid var(--rule); }
.srch-concept { padding: calc(var(--lh) * .4) 0; border-bottom: 1px solid var(--rule); }
.srch-concept h2 { margin: 0; font-weight: 600; font-size: var(--t0); line-height: 1.3; color: var(--ink-head); }
.srch-concept h2 a { color: inherit; text-decoration: none; }
.srch-concept h2::after { content: "\00a0\00a0term"; font-family: var(--font-ui); font-weight: 600; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.srch-concept p { margin: 3px 0 0; font-size: var(--t-1); line-height: 1.45; color: var(--ink-2); }
.srch-group { margin: 0 0 var(--sp-4); }
.srch-chapter { margin: 0 0 var(--sp-1); padding-top: var(--sp-2); border-top: 1.5px solid var(--rule-strong); font-weight: var(--w-text); font-size: var(--t0); line-height: 1.2; font-variant-caps: small-caps; letter-spacing: .12em; text-transform: none; color: var(--ink-2); }
.srch-chapter a { color: inherit; text-decoration: none; }
.srch-hits { margin: 0; padding: 0; list-style: none; }
.srch-hits > li { border-bottom: 1px solid var(--rule); }
.srch-hits > li > a { display: block; padding: 12px 0; color: var(--ink); text-decoration: none; }
.srch-hits > li > a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* the changelog */
.wzp-changelog { padding-top: var(--sp-6); }
.wzp-cl-head { margin: 0 0 var(--sp-4); }
.wzp-cl-eyebrow { margin: 0 0 var(--sp-2); font-size: var(--t-2); line-height: 1.2; font-variant-caps: small-caps; letter-spacing: .14em; text-transform: none; color: var(--ink-3); }
.wzp-cl-eyebrow a { color: inherit; text-decoration: none; }
.wzp-cl-head h1 { margin: 0 0 var(--sp-2); font-weight: 500; font-size: var(--t4); line-height: 1.08; letter-spacing: -.012em; color: var(--ink-head); text-wrap: balance; }
.wzp-cl-sub { margin: 0; font-size: var(--t1); line-height: 1.45; color: var(--ink-2); }
.wzp-cl-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.5rem; margin: var(--sp-3) 0 var(--sp-4); padding: var(--sp-2) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.wzp-cl-filters label { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.wzp-cl-filters select, .subscribe-form input[type="email"] {
  appearance: none; -webkit-appearance: none; min-block-size: 36px; padding: 0 1.4rem 0 0; margin: 0;
  background: none; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0;
  color: var(--ink); font: 400 max(15px, 16px)/1.3 var(--font-text); letter-spacing: 0; text-transform: none;
}
.wzp-cl-filters select { background: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%) calc(100% - 9px) 55% / 5px 5px no-repeat, linear-gradient(-45deg, transparent 50%, var(--ink-3) 50%) calc(100% - 4px) 55% / 5px 5px no-repeat; }
.wzp-cl-filters button, .subscribe-form button[type="submit"] {
  appearance: none; -webkit-appearance: none; min-block-size: 36px; padding: 0 0 3px; margin: 0; background: none; border: 0; border-bottom: 1px solid currentColor; border-radius: 0;
  font-family: var(--font-ui); font-weight: 600; font-size: 11px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); cursor: pointer;
}
.wzp-cl-filters a { align-self: center; font-family: var(--font-ui); font-weight: 500; font-size: 12px; color: var(--ink-2); }
.wzp-cl-filters select:focus-visible, .wzp-cl-filters button:focus-visible, .subscribe-form :focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.wzp-cl-day { margin: 0 0 var(--sp-4); }
.wzp-cl-day h2 { margin: 0 0 var(--sp-1); padding-top: var(--sp-2); border-top: 1.5px solid var(--rule-strong); font-weight: var(--w-text); font-size: var(--t0); line-height: 1.2; font-variant-caps: small-caps; letter-spacing: .12em; text-transform: none; color: var(--ink-2); }
.wzp-cl-day ul { margin: 0; padding: 0; list-style: none; }
.wzp-cl-entry { padding: calc(var(--lh) * .4) 0; border-bottom: 1px solid var(--rule); font-size: var(--t-1); line-height: 1.5; color: var(--ink-2); }
.wzp-cl-entry p { margin: 4px 0 0; }
.wzp-cl-tag, .wzp-cl-safety { display: inline-block; margin-right: .6rem; font-family: var(--font-ui); font-weight: 600; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.wzp-cl-tag-correction { color: var(--stop); }
.wzp-cl-tag-addition { color: var(--go); }
.wzp-cl-tag-media { color: var(--accent-ink); }
.wzp-cl-safety { color: var(--stop); }
.wzp-cl-safety-entry { padding-left: .9rem; border-left: 1.5px solid var(--stop); }
.wzp-cl-section { font-weight: 600; color: var(--ink-head); text-decoration: none; }
.wzp-cl-empty { margin: var(--sp-4) 0; font-style: italic; color: var(--ink-3); }

/* subscribe: where the printed QR lands — a phone, bad signal, no JavaScript */
.subscribe-form { display: grid; gap: var(--sp-3); margin: var(--sp-3) 0 0; padding: var(--sp-3) 0 0; border-top: 1.5px solid var(--rule-strong); }
.subscribe-form > label { display: grid; gap: 4px; font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.subscribe-form > label.subscribe-consent { grid-template-columns: auto 1fr; gap: .7rem; align-items: start; font-family: var(--font-text); font-size: var(--t-1); font-weight: 400; line-height: 1.45; letter-spacing: 0; text-transform: none; color: var(--ink); }
.subscribe-form input[type="email"] { min-block-size: 40px; padding: 0; caret-color: var(--accent); }
.subscribe-form input[type="email"]:focus { outline: none; border-bottom-color: var(--ink-head); }
.subscribe-form fieldset { margin: 0; padding: 0; border: 0; }
.subscribe-form legend { padding: 0 0 var(--sp-1); font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.subscribe-form fieldset label, .subscribe-sections label { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; padding: .35rem 0; font-size: var(--t-1); line-height: 1.45; }
.subscribe-form input[type="radio"], .subscribe-form input[type="checkbox"] { inline-size: 18px; block-size: 18px; margin-top: 2px; accent-color: var(--ink-head); }
.subscribe-form details > summary { cursor: pointer; font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.subscribe-sections { display: grid; gap: 0; max-block-size: 18rem; overflow-y: auto; margin: var(--sp-1) 0 0; padding: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.subscribe-form button[type="submit"] { justify-self: start; min-block-size: 44px; }
.subscribe-note { margin: 0; font-size: var(--t-1); line-height: 1.5; color: var(--ink-2); }
.callout.callout-note + .subscribe-form { margin-top: var(--sp-4); }


/* ----------------------------------------------------------------------------
   14. WIDE SCREENS — numerals hang in the margin, the text column stays flush
   ---------------------------------------------------------------------------- */
@media (min-width: 1100px) {
  .chapter-n { position: absolute; right: calc(100% + 1.5rem); top: calc(var(--t-2) * 1.2 + var(--sp-2) + .1rem); margin: 0; text-align: right; }  /* baseline-aligned with the title */
  .chapter-head:has(.chapter-n) .chapter-part { margin-bottom: var(--sp-2); }
  .acc-sum > .sec-h2 { padding-left: 0; text-indent: 0; }
  .acc-sum > .sec-h2::before { position: absolute; right: calc(100% + 1.5rem); top: calc(var(--sp-2) + .3rem); width: auto; text-align: right; }
  .num-pg { position: absolute; left: calc(100% + 1.5rem); top: calc(var(--lh) * .35 + .25em); margin: 0; }
  .num { padding-right: 0; }
}


/* ----------------------------------------------------------------------------
   15. PRINT — element rules (the tokens are forced in coin.css §4)
   The enhancer opens every accordion and draws every diagram on beforeprint.
   ---------------------------------------------------------------------------- */
@media print {
  .rbar, .blk-report, .report-scrim, .term-pop, .sheet-scrim, .srch-scrim, .wz-top, .pager, .page-actions,
  .printing-banner, .fig-hint, .lightbox, .acc-chev, .acc-summary, .az-nav, .az-top { display: none !important; }
  .reader { overflow: visible; }
  .reader-main { max-width: none; padding-left: 0; padding-right: 0; }
  .hero { min-height: 0; break-after: page; }
  .part:has(.po-title) { min-height: 0; break-before: page; padding-top: var(--sp-5); }
  .sec { break-before: page; padding-top: 0; }
  .chapter-n { position: static; }
  .acc-sum > .sec-h2::before { position: static; }
  .acc > summary.acc-sum, .acc[open] > summary.acc-sum { grid-template-columns: minmax(0, 1fr); }
  .acc, .fig, .mcq, .num, .pearl, .tbl-scroll, tr, .callout { break-inside: avoid; }
  .tbl-scroll { overflow: visible; margin-left: 0; margin-right: 0; background: none; }
  .tbl { min-width: 0 !important; }
  .tbl th:first-child, .tbl td:first-child { position: static !important; box-shadow: none !important; max-width: none !important; }
  .blk .fig { margin-left: 0; margin-right: 0; }
  .blk .flow.is-wide { background: none; }
  .blk .flow svg { width: auto !important; max-width: 100%; }
  .num-pg { position: static; }
  .term { text-decoration: none; }
  /* the clinical code in monochrome: three distinguishable marks */
  .hy, .exam { text-decoration: underline; text-decoration-color: #000; text-decoration-thickness: 1.5px; color: #000; }
  .dgr { font-weight: 700; }
  .adv { text-decoration: underline; text-decoration-style: dotted; text-decoration-color: #000; }
  .mcq-why[hidden] { display: block; }
  .note-body { display: block; }
  .blk.is-changed { box-shadow: none; padding-left: 0; margin-left: 0; }
  .blk.is-changed::after { color: #000; }
  .reader a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
}
