  :root {
    /* Braintied shareable-record theme: dark grey ground, lighter cards */
    --paper: #1b1d21; --card: #26292f; --card2: #2d3138;
    --ink: #e9eaec; --muted: #9aa0a9; --line: #3a3f47;
    --bt: #ccff00;                       /* Braintied chartreuse (homepage) */
    --bt-bg: #2b3220; --bt-line: #55622e;
    --other: #8fb0e8;                    /* counterparty identity — retint per party */
    --other-bg: #232a38; --other-line: #3d4d6b;

    /* CLIENT THEME LAYER.
       --bt* is the Braintied IDENTITY and never recolors: the mark, the wordmark,
       the BRAINTIED tag, Braintied quote blocks. Those must read as us on every
       page we deliver.
       --accent* is PAGE CHROME: section numbers, links, buttons, focus rings,
       callouts. That is what takes the client's colour, which is what makes a
       delivered page feel co-branded rather than repainted.
       Defaults to Braintied, so any page that sets no theme is unchanged. */
    --accent: var(--bt);
    --accent-ink: var(--bt-ink, #1b1d21);
    --accent-bg: var(--bt-bg);
    --accent-line: var(--bt-line);
    --kept: #8fd4a0; --partial: #e0bd6e; --gap: #e2938a;
    --chip-kept: #263a2c; --chip-partial: #3a3222; --chip-gap: #3c2825;
    --radius: 1.5rem;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body { background: var(--paper); color: var(--ink);
    font: 16px/1.65 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased; }
  /* Links always carry the brand, never browser-default blue. --accent is the
     page-chrome variable, so a client-themed page gets that client's colour and
     an unthemed one stays Braintied chartreuse. Both light and dark resolve
     legibly because --accent tracks --bt in each. Underline is thin and offset
     so a paragraph containing two links still reads as prose. */
  a { color: var(--accent); text-decoration: underline;
    text-decoration-thickness: 1px; text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
    transition: text-decoration-color 120ms ease-out; }
  a:hover { text-decoration-color: var(--accent); }
  /* No `a:visited` colour rule. It was redundant for prose (the base `a` rule is
     already --accent) and its only real effect was specificity: `a:visited` is
     (0,1,1) and beats a plain class, so every section link in the contents rail
     and the bottom bar turned chartreuse once clicked and read as the current
     section. Reading history is not information this document wants to show. */
  a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px;
    border-radius: 2px; text-decoration-color: var(--accent); }
  .wrap { max-width: 800px; margin: 0 auto; padding: 40px 20px 96px;  overflow-x: clip;}
  .brandbar { display: flex; align-items: center; gap: 16px; padding-bottom: 16px;
    margin-bottom: 0; border-bottom: 0; flex-wrap: wrap; }
  .mark { width: 30px; height: 29px; color: var(--bt); flex: 0 0 auto;
    display: inline-flex; align-items: center; }
  .mark svg { width: 100%; height: 100%; display: block; }
  .wordmark { font-weight: 700; font-size: 24px; letter-spacing: -0.05em;
    color: var(--bt); line-height: 1; display: inline-flex; align-items: baseline; }
  .wordmark .r { font-size: 0.4em; position: relative; top: -0.75em; margin-left: 3px; }
  /* -- Co-brand lockup (CLIENT-THEMES.md rule 4) ---------------------------
     A client's real mark sits beside ours in the brand bar, separated by a
     hairline. Both halves are display:none by default and each client turns on
     its own pair inside its theme block, so a record with no data-client
     renders exactly as it did before this existed, and a client with no mark
     yet does not get an orphan divider.
     Client marks are usually fixed-colour lockups (a white wordmark), which
     disappears the moment the page goes light. The fill overrides below remap
     those literal fills onto page tokens: the mark body follows --ink and the
     secondary tint follows --muted, so the lockup's own light/dark
     relationship survives in both modes. */
  .cobrand-div { display: none; flex: 0 0 auto; width: 1px; align-self: stretch;
    min-height: 26px; background: var(--line); }
  .cobrand { display: none; flex: 0 0 auto; align-items: center; max-width: 100%;
    color: var(--ink); }
  .cobrand svg { height: 26px; width: auto; display: block; }
  .cobrand svg path[fill="white"], .cobrand svg path[fill="#fff"],
  .cobrand svg path[fill="#FFFFFF"] { fill: currentColor; }
  .eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--bt); font-weight: 700; }
  h1 { font-size: 38px; line-height: 1.12; margin: 12px 0 8px; font-weight: 800;
    letter-spacing: -0.025em; }
  #doc > h1, #doc h1.page-title { display: none; }
  .sub { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
  h2 { font-size: 24px; margin: 60px 0 8px; font-weight: 700; letter-spacing: -0.015em;
    padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  #doc > h2:first-of-type { margin-top: 28px; }
  h2 .n { color: var(--accent); margin-right: 10px; font-variant-numeric: tabular-nums; }
  h3 { font-size: 16.5px; margin: 28px 0 8px; font-weight: 700; }
  p { margin: 12px 0; }
  .scroll { overflow: auto; max-height: none; max-width: 100%;
    overscroll-behavior: contain;
    margin: 14px 0; border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 8px); background: var(--card); }
  .scroll:hover, .scroll:focus-within { outline: 1px solid var(--accent-line); }
  /* Tables read in place. Cells wrap and the table takes the column width;
     a ledger that genuinely needs one line per row opts back in with
     .scroll.ledger. Until 2026-09-12 every cell was nowrap and the box was
     capped at 560px, so a six-column table needed two scrollbars to read
     (measured on the RA·NUE record set; G: "hard to see all the info in
     tables without scrolling"). */
  .scroll table { width: 100%; }
  /* break-word, never `anywhere`. `anywhere` counts a single character as a
     column's min-content width, so the auto table algorithm starves every short
     column and breaks its words down the middle ("Wholesale accounts" as six
     stacked fragments, measured 2026-09-12). break-word keeps min-content at the
     longest word, which is what a first column needs. A long unbreakable token
     inside <code> still gets to break anywhere, since those are paths and slugs. */
  .scroll th, .scroll td { white-space: normal; word-break: normal;
    overflow-wrap: break-word; }
  .scroll th:first-child, .scroll td:first-child { min-width: 6ch; }
  .scroll code, #doc code { overflow-wrap: anywhere; }
  /* Keep a product code, a domain or a version string on one line. Browsers
     break after an existing hyphen, so "BPC-157" and "ra-nue.com/pharmacy"
     split across lines in a narrow column; wrapping the token rather than
     swapping in a non-breaking hyphen keeps the text byte-identical to copy. */
  #doc .nb { white-space: nowrap; }
  .scroll.ledger { max-height: min(62vh, 560px); }
  .scroll.ledger table { width: max-content; min-width: 100%; }
  .scroll.ledger th, .scroll.ledger td { white-space: nowrap; }
  /* On a phone a table.stack turns each row into a block and each cell
     prints its own header from data-label, so nothing is read sideways. */
  @media (max-width: 640px) {
    .scroll table.stack thead { display: none; }
    .scroll table.stack tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .scroll table.stack tr:last-child { border-bottom: 0; }
    .scroll table.stack td { display: block; border: 0; padding: 2px 0 6px; }
    .scroll table.stack td::before { content: attr(data-label); display: block; font-size: 10.5px;
      letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700;
      margin-bottom: 1px; }
    .scroll table.stack td:empty { display: none; }
  }
  table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px;
    font-variant-numeric: tabular-nums; }
  th, td { border-bottom: 1px solid var(--line); padding: 10px 13px; text-align: left;
    vertical-align: top; }
  tr:last-child td { border-bottom: 0; }
  th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted); font-weight: 700; background: var(--card2);
    position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }
  .tag { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em;
    padding: 2px 9px; border-radius: 999px; vertical-align: middle; margin-right: 6px;
    white-space: nowrap; }
  .tag-bt { background: var(--bt-bg); color: var(--bt); border: 1px solid var(--bt-line); }
  .tag-other { background: var(--other-bg); color: var(--other); border: 1px solid var(--other-line); }
  blockquote { margin: 14px 0; padding: 14px 18px;
    border-radius: 0 calc(var(--radius) - 8px) calc(var(--radius) - 8px) 0; font-size: 15px; }
  blockquote.q-other { background: var(--other-bg); border-left: 3px solid var(--other); }
  blockquote.q-bt { background: var(--bt-bg); border-left: 3px solid var(--bt); }
  blockquote .who { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
  .chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 10px;
    border-radius: 999px; white-space: nowrap; }
  .c-kept { background: var(--chip-kept); color: var(--kept); }
  .c-partial { background: var(--chip-partial); color: var(--partial); }
  .c-gap { background: var(--chip-gap); color: var(--gap); }
  .card { background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px 24px; margin: 16px 0; }
  ul, ol { padding-left: 22px; margin: 10px 0; }
  li { margin: 6px 0; }
  /* -- Commands (pre / code) ----------------------------------------------
     A page that exists to be typed from needs per-block copy, not one
     Copy-as-Markdown for the whole document: nobody pastes a whole page into a
     Recovery Terminal. wireCodeCopy() wraps each <pre> in .cmd at load.
     The button sits OUTSIDE the <pre> deliberately — the markdown serializer
     reads pre.innerText, so a button inside would export its own label into
     the code fence. */
  /* Wrap rather than scroll. A one-line `sudo defaults write …` is 118
     characters; in an overflow-x box it clips under the Copy button and on a
     phone it hides most of itself behind a gesture nobody makes in a document.
     Wrapping costs nothing here because the button, not a text selection, is
     how the command gets copied. */
  pre { margin: 0; padding: 14px 16px; color: var(--ink);
    white-space: pre-wrap; overflow-wrap: anywhere;
    font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
  code { font: 0.88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: var(--card2); border: 1px solid var(--line);
    border-radius: 5px; padding: 1px 5px; }
  pre code { background: none; border: 0; padding: 0; font-size: inherit; }
  .cmd { position: relative; margin: 14px 0; background: var(--card2);
    border: 1px solid var(--line); border-radius: calc(var(--radius) - 8px); }
  .cmd > pre { padding-right: 84px; }
  .cmdcopy { position: absolute; top: 8px; right: 8px; z-index: 1; }
  @media print { .cmdcopy { display: none; } .cmd > pre { padding-right: 16px; } }
  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px; margin: 16px 0; }
  .stats .card { margin: 0; text-align: center; padding: 16px 10px; }
  .stat { font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums; }
  .statlabel { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
  /* -- Checklists (ul.checklist) ------------------------------------------
     Ported from operator.html 2026-08-08 so a shareable record can carry an
     actionable list, not just a description of one. Uses --accent (page chrome)
     rather than --bt, so a client-themed record ticks in that client's colour;
     see the theme note at the top of this file. */
  ul.checklist { list-style: none; padding-left: 2px; }
  ul.checklist li { display: flex; align-items: flex-start; gap: 10px; margin: 7px 0; }
  ul.checklist input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; flex: 0 0 auto;
    width: 17px; height: 17px; margin-top: 4px; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: 5px; background: var(--card2);
    display: grid; place-content: center; transition: border-color .15s, background .15s;
  }
  ul.checklist input[type="checkbox"]:hover { border-color: var(--accent); }
  ul.checklist input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  ul.checklist input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
  ul.checklist input[type="checkbox"]:checked::after {
    content: ''; width: 9px; height: 5px; border: 2px solid var(--accent-ink);
    border-top: 0; border-right: 0; transform: rotate(-45deg) translateY(-1px);
  }
  ul.checklist li.done > span { color: var(--muted); text-decoration: line-through; }

  .foot { color: var(--muted); font-size: 13px; margin-top: 60px;
    border-top: 1px solid var(--line); padding-top: 18px; }
  strong { font-weight: 700; }
/* bpage-provenance-css — two columns, centered in .wrap, never full-bleed */
  .provenance {
    margin: 28px auto 0;
    padding: 14px 16px;
    background: var(--card, #26292f);
    border: 1px solid var(--line, #3a3f47);
    border-radius: var(--radius-sm, 12px);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  .prov-head {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bt, #ccff00);
    font-weight: 700;
    margin: 0 0 12px;
  }
  /* two columns of field pairs */
  .prov-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
    margin: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  .prov-grid > .prov-item,
  .prov-grid > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .prov-grid dt,
  .prov-grid .prov-k {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted, #9aa0a9);
    font-weight: 650;
    margin: 0;
    line-height: 1.3;
  }
  .prov-grid dd,
  .prov-grid .prov-v,
  .prov-grid code {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--ink, inherit);
    background: transparent;
    border: 0;
    padding: 0;
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }
  .prov-note {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--muted, #9aa0a9);
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.45;
  }
  @media (max-width: 560px) {
    .provenance { padding: 12px; }
    .prov-grid { grid-template-columns: 1fr; gap: 10px; }
  }
  @media print {
    .provenance { break-inside: avoid; overflow: visible; }
  }
  /* /bpage-provenance-css */


  /* Sticky title + tools chrome (shared pattern with operator.html) */
  :root {
    --bt-ink: #1b1d21;
  }
  :root[data-theme="light"] {
    --paper: #f4f5f3; --card: #ffffff; --card2: #fafbf8;
    --ink: #1b1d21; --muted: #5f666e; --line: #e0e3dc;
    --bt: #6f8c00; --bt-ink: #ffffff; --bt-bg: #f2f7dc; --bt-line: #cfe07a;
    --kept: #2c6e49; --partial: #8a6516; --gap: #a33b2e;
    --chip-kept: #e3efe8; --chip-partial: #f6efdd; --chip-gap: #f7e4e0;
    --other: #3d5a80; --other-bg: #e8eef6; --other-line: #b7c7dd;
    --accent: var(--bt); --accent-ink: var(--bt-ink);
    --accent-bg: var(--bt-bg); --accent-line: var(--bt-line);
  }
  .sticky-chrome {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    margin: 0 0 22px; padding: 10px 0 12px;
    border-bottom: 1px solid var(--line);
  }
  /* Title sits in the band between the two chrome rules, with more space
     above the type than below it so it does not hug the brand-row rule. */
  .sticky-title-row { min-width: 0; margin: 0; padding: 20px 0 8px; }
  .sticky-title {
    margin: 0;
    font-size: clamp(1.05rem, 2.4vw, 1.4rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .toolbar {
    position: static;
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    padding: 0; margin: 0; border: 0; background: transparent;
  }
  .btn {
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    border-radius: 999px; padding: 7px 15px; font: inherit; font-size: 13px;
    font-weight: 600; cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
  }

  /* ------------------------------------------------------------------ */
  /* CLIENT THEMES                                                       */
  /* Set data-client on <html>. Braintied identity is untouched; only    */
  /* page chrome and the counterparty tint change. Add a client by       */
  /* copying one block and swapping the four accent values plus --other. */
  /* Colours must come from the client's approved brand, never invented. */
  /* ------------------------------------------------------------------ */

  /* Silver Dollar.
     SOURCE: silver-dollar/apps/web/app/globals.css, the shipped app theme.
     Every value below is lifted from a real app token so a deliverable page and
     the product it describes are the same colour system. The mapping is in
     CLIENT-THEMES.md; the app token name is in the comment on each line group.

     Dark is primary: the deep indigo canvas is the app's own dark mode and the
     look Silver Dollar asked deliverables to carry. Light is the blue-grey
     counterpart built from the app's Indigo tint, NOT the ivory marketing
     surface, so neither mode reads warm.
     Braintied identity tokens (--bt*) are untouched. */
  [data-client="silver-dollar"] {
    /* --bg / --surface / --surface-2 */
    --paper:#161B2A; --card:#1D2436; --card2:#252D42;
    /* --ink / --ink-2 / --surface-3 as the rule colour */
    --ink:#FBF6EF;   --muted:#B9BEC7; --line:#30394F;
    /* --accent (Dusty Rose) / --on-accent */
    --accent:#D6A0B2; --accent-ink:#1F2942;
    /* --accent-soft / --accent-soft-2 */
    --accent-bg:#342431; --accent-line:#452D3A;
    /* --brand-silver over --surface-2, so the counterparty tint is not the accent */
    --other:#B9BEC7; --other-bg:#252D42; --other-line:#30394F;
    /* --good / --warm / --alert */
    --kept:#5CC49B; --partial:#CB9A64; --gap:#D97A70;
    /* --good-soft / --warm-soft / --alert-soft */
    --chip-kept:#16271F; --chip-partial:#2A2114; --chip-gap:#2C1917;
  }
  [data-theme="light"][data-client="silver-dollar"] {
    /* --surface-3 / --surface / 50% mix of the two (see CLIENT-THEMES.md) */
    --paper:#E8EAF0; --card:#FFFFFF; --card2:#F4F5F8;
    /* --ink / --ink-2 / Indigo --accent-soft-2 */
    --ink:#1F2942;   --muted:#596176; --line:#D9DCE4;
    /* Indigo tint --accent / --on-accent */
    --accent:#1F2942; --accent-ink:#FFFFFF;
    /* Indigo tint --accent-soft / --accent-soft-2 */
    --accent-bg:#E8EAF0; --accent-line:#D9DCE4;
    /* --brand-berry with its soft pair, distinct from the indigo accent */
    --other:#8E3B5E; --other-bg:#F4E3E9; --other-line:#EAD0DB;
    /* --good-ink / --warm-ink / --alert-ink (AA on a light surface) */
    --kept:#17664E; --partial:#75471D; --gap:#8A342D;
    /* --good-soft / --warm-soft / --alert-soft */
    --chip-kept:#E7F4EE; --chip-partial:#F6EFE5; --chip-gap:#F7EBE9;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"])[data-client="silver-dollar"] {
      --paper:#E8EAF0; --card:#FFFFFF; --card2:#F4F5F8;
      --ink:#1F2942;   --muted:#596176; --line:#D9DCE4;
      --accent:#1F2942; --accent-ink:#FFFFFF;
      --accent-bg:#E8EAF0; --accent-line:#D9DCE4;
      --other:#8E3B5E; --other-bg:#F4E3E9; --other-line:#EAD0DB;
      --kept:#17664E; --partial:#75471D; --gap:#8A342D;
      --chip-kept:#E7F4EE; --chip-partial:#F6EFE5; --chip-gap:#F7EBE9;
    }
  }


  /* Silver Dollar is FULLY CLIENT-BRANDED (owner call, 2026-08-04): every colour
     on the page is theirs, including the Braintied mark and wordmark. This
     overrides the co-delivered default above. Scoped to the client attribute, so
     the Braintied default record and every other client keep the chartreuse
     identity untouched. Values are app tokens: --accent on --accent-soft. */
  [data-client="silver-dollar"] {
    --bt: #D6A0B2; --bt-bg: #342431; --bt-line: #452D3A; --bt-ink: #1F2942;
  }
  [data-theme="light"][data-client="silver-dollar"] {
    --bt: #1F2942; --bt-bg: #E8EAF0; --bt-line: #D9DCE4; --bt-ink: #FFFFFF;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"])[data-client="silver-dollar"] {
      --bt: #1F2942; --bt-bg: #E8EAF0; --bt-line: #D9DCE4; --bt-ink: #FFFFFF;
    }
  }


  /* Quigley-Simpson.
     SOURCE: Sentigen-App/scripts/seed-meeting-room-template-quigley-simpson-20260721.sql
     — the branding.colors block of the shipped QS meeting-room template, itself
     extracted from quigleysimpson.com's live Elementor kit (post-6149.css).
     Palette: primary #007E7E, secondary #13505B, accent #30C7C0,
     accentText #062A2E, mid #26ABA5, ice #C9E9EE, surface #0E3A40,
     surfaceDeep #071E23, text #F2FAFA, textMuted #C9E9EE, textSubtle #8FB5BC.
     The app-token name behind each line group is in the comment; anything that
     is not a listed token states the mix it was derived from.

     Dark is primary: deep teal is QS's own look, so it gets the base block.
     CO-DELIVERED (not white-labelled): --bt* is untouched, so our mark, wordmark
     and quote blocks stay chartreuse while every page-chrome colour is theirs.

     Two colour axes keep the two parties apart: accent runs on primary/accent
     teal, --other runs on the secondary/ice axis, so a QS quote never reads as
     a link or a section number. */
  [data-client="quigley-simpson"] {
    /* surfaceDeep / surface / 50% mix of surface and secondary */
    --paper:#071E23; --card:#0E3A40; --card2:#11454E;
    /* text / textSubtle / secondary flattened to a solid rule colour */
    --ink:#F2FAFA;   --muted:#8FB5BC; --line:#13505B;
    /* accent / accentText */
    --accent:#30C7C0; --accent-ink:#062A2E;
    /* 30% primary over surfaceDeep / 50% mix of primary and surface */
    --accent-bg:#053B3E; --accent-line:#075C5F;
    /* ice over the card2 mix, so the counterparty tint is not the accent teal */
    --other:#C9E9EE; --other-bg:#11454E; --other-line:#13505B;
    /* The QS brand kit carries no semantic status colours, so --kept/--partial/
       --gap and their chips deliberately keep the template's dark-tuned
       defaults rather than inventing three shades. */
    /* Fixed-colour lockup: the wordmark is white (handled by the generic
       .cobrand fill rule) and the swoosh tail is literal ice. Map it to --muted
       so it stays the lighter of the two marks in dark and the lighter of the
       two in light, instead of vanishing on a pale canvas. */
    --cobrand-tint: var(--muted);
  }
  [data-theme="light"][data-client="quigley-simpson"] {
    /* text as the canvas (role inversion) / white / 15% ice over white */
    --paper:#F2FAFA; --card:#FFFFFF; --card2:#F7FCFC;
    /* accentText as the darkest ink / secondary / ice as the rule colour */
    --ink:#062A2E;   --muted:#13505B; --line:#C9E9EE;
    /* primary (the light-surface brand colour) / text as the on-accent fill */
    --accent:#007E7E; --accent-ink:#F2FAFA;
    /* 15% accent over white / 35% accent over white */
    --accent-bg:#E0F7F6; --accent-line:#B7EBE9;
    /* secondary with an ice pair, off the accent axis */
    --other:#13505B; --other-bg:#E4F4F7; --other-line:#C9E9EE;
    /* Same hues as the template's own dark --kept/--partial/--gap, darkened to
       reach AA on a light surface; chips are those hues at L 94%. */
    --kept:#256033; --partial:#765919; --gap:#7B281E;
    --chip-kept:#EAF6ED; --chip-partial:#F7F3E8; --chip-gap:#F7EAE8;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"])[data-client="quigley-simpson"] {
      --paper:#F2FAFA; --card:#FFFFFF; --card2:#F7FCFC;
      --ink:#062A2E;   --muted:#13505B; --line:#C9E9EE;
      --accent:#007E7E; --accent-ink:#F2FAFA;
      --accent-bg:#E0F7F6; --accent-line:#B7EBE9;
      --other:#13505B; --other-bg:#E4F4F7; --other-line:#C9E9EE;
      --kept:#256033; --partial:#765919; --gap:#7B281E;
      --chip-kept:#EAF6ED; --chip-partial:#F7F3E8; --chip-gap:#F7EAE8;
    }
  }
  /* QS ships a real mark, so it turns on its half of the co-brand lockup. */
  /* Quigley-Simpson: FULLY CLIENT-BRANDED (owner call, 2026-08-12).
     Co-delivered was the first cut, and side by side the two identities read
     as a clash rather than a partnership: our chartreuse against their teal is
     two brands competing for the same page. A client deliverable should read
     as THEIRS, delivered by us — the co-brand lockup in the bar carries the
     "by Braintied" part, so the chrome does not need to.
     Their accent on their soft accent pair, so our mark becomes one more
     element in their system instead of a foreign object. */
  [data-client="quigley-simpson"] {
    --bt: #30C7C0; --bt-bg: #0E3A40; --bt-line: #13505B; --bt-ink: #062A2E;
  }
  [data-theme="light"][data-client="quigley-simpson"] {
    --bt: #007E7E; --bt-bg: #E0F7F6; --bt-line: #B7EBE9; --bt-ink: #F2FAFA;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"])[data-client="quigley-simpson"] {
      --bt: #007E7E; --bt-bg: #E0F7F6; --bt-line: #B7EBE9; --bt-ink: #F2FAFA;
    }
  }

  /* ---- Mantra (mantradose.com) -------------------------------------------
     FULLY CLIENT-BRANDED. Derived from the shipped DAO console's own token
     file, mantra-dao/app/generated/design-v4.css, not eyedropped and not
     designed: the deliverable and the product are one colour system.

     Mantra's look is black-first. `--color-void` #000 is the real canvas, so
     dark is the base block and light is the inversion, the same way the DAO
     and the storefront treat it. Two colour axes keep the parties apart:
     accent runs on spore/bloom (the brand pink), --other runs on the violet
     axis, so a Mantra quote never reads as a link or a section number.

     Type note (licensing gate, CLIENT-THEMES.md §Type): Mantra's display face
     "She Lost Her Mind Serif" and its body face PP Mori are commercial
     desktop/trial cuts and are NOT embedded — publishing this page would
     redistribute them. 42dot Sans, the brand system's own UI face, is SIL OFL
     and is the one safe to self-host; until it is subset and embedded the page
     runs on the template's stack, which is why no font-family override ships
     in this block. Do not swap in the serif without a webfont licence. */
  [data-client="mantra"] {
    /* void / basalt+bruise / bruise-2 */
    --paper:#000000; --card:#0f0f12; --card2:#16161a;
    /* bone / drift+ash / a flattened rule between bruise-2 and umber */
    --ink:#ffffff;   --muted:#b3b3b3; --line:#2a2a30;
    /* spore (the signature pink) / void as the on-accent fill */
    --accent:#f640b5; --accent-ink:#000000;
    /* ~22% spore over void / ~45% spore over void, flattened */
    --accent-bg:#2e0c23; --accent-line:#5c1745;
    /* violet axis, deliberately off the pink so quotes never read as links */
    --other:#b9a6ee; --other-bg:#1c1730; --other-line:#3a2f5c;
  }
  [data-theme="light"][data-client="mantra"] {
    --paper:#ffffff; --card:#faf7f9; --card2:#f3eef2;
    --ink:#0a0a0a;   --muted:#5c5c63; --line:#e4dae0;
    /* magenta is the light-surface cut of spore: spore itself fails AA on white */
    --accent:#c62c8d; --accent-ink:#ffffff;
    --accent-bg:#fdeaf6; --accent-line:#f5c2e2;
    --other:#5b46a0; --other-bg:#efecf9; --other-line:#d8d0ee;
    /* Template dark-tuned status hues darkened to reach AA on a light surface */
    --kept:#256033; --partial:#765919; --gap:#7B281E;
    --chip-kept:#EAF6ED; --chip-partial:#F7F3E8; --chip-gap:#F7EAE8;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"])[data-client="mantra"] {
      --paper:#ffffff; --card:#faf7f9; --card2:#f3eef2;
      --ink:#0a0a0a;   --muted:#5c5c63; --line:#e4dae0;
      --accent:#c62c8d; --accent-ink:#ffffff;
      --accent-bg:#fdeaf6; --accent-line:#f5c2e2;
      --other:#5b46a0; --other-bg:#efecf9; --other-line:#d8d0ee;
      --kept:#256033; --partial:#765919; --gap:#7B281E;
      --chip-kept:#EAF6ED; --chip-partial:#F7F3E8; --chip-gap:#F7EAE8;
    }
  }
  /* Fully branded: our mark takes their pink so it reads as one more element
     in their system. The co-brand lockup in the bar says who delivered it. */
  [data-client="mantra"] {
    --bt: #f640b5; --bt-bg: #2e0c23; --bt-line: #5c1745; --bt-ink: #000000;
  }
  [data-theme="light"][data-client="mantra"] {
    --bt: #c62c8d; --bt-bg: #fdeaf6; --bt-line: #f5c2e2; --bt-ink: #ffffff;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"])[data-client="mantra"] {
      --bt: #c62c8d; --bt-bg: #fdeaf6; --bt-line: #f5c2e2; --bt-ink: #ffffff;
    }
  }

  /* Mantra lockup: the real mantradose.com header logo, emblem plus wordmark.
     Its Adobe-exported fills were stripped and its classes namespaced (mtr-st*)
     so nothing collides with page CSS; the SVG inherits currentColor, which is
     --ink, so it reads on both the black and the white canvas. */
  /* Mantra reading rhythm. This record runs denser than most — long itemised
     tables, several per section — and at the template's default spacing the
     tables butt against the prose above and below them until a section reads as
     one undifferentiated block. Scoped to this client so no other record moves. */
  [data-client="mantra"] #doc h2 { margin-top: 76px; padding-bottom: 12px; }
  [data-client="mantra"] #doc h2 + p { margin-top: 18px; }
  [data-client="mantra"] #doc h3 { margin-top: 34px; color: var(--accent); }
  [data-client="mantra"] #doc table { margin: 22px 0 34px; }
  [data-client="mantra"] #doc th, [data-client="mantra"] #doc td { padding: 12px 14px; }
  [data-client="mantra"] #doc th { font-size: 11px; letter-spacing: .1em; }
  /* A table immediately after another needs a visible gap, not just margin. */
  [data-client="mantra"] #doc table + table { margin-top: 34px; }
  [data-client="mantra"] #doc p + table { margin-top: 18px; }
  [data-client="mantra"] #doc .stats { margin: 26px 0 34px; }
  [data-client="mantra"] #doc p.card { margin: 26px 0 34px; padding: 22px 26px; }
  /* First row of a body table carries the most weight; give the head contrast. */
  [data-client="mantra"] #doc thead th { border-bottom-color: var(--accent-line); }

  [data-client="mantra"] .cobrand-mantra,
  [data-client="mantra"] .cobrand-div { display: inline-flex; }
  [data-client="mantra"] .cobrand-mantra svg { height: 22px; color: var(--ink); }

  /* The Mantra lockup ships as the official brand file rather than a redrawn
     path, so the geometry is exactly the asset. Two <img> because an <img>
     cannot inherit currentColor; one per surface. Before 2026-08-23 the rules
     below revealed .cobrand-mantra and the divider while no such span existed,
     so a Mantra page drew a divider with nothing after it. */
  [data-client="mantra"] .cobrand-mantra img { height: 20px; width: auto; display: none; }
  [data-client="mantra"] .cobrand-mantra .cb-dark { display: block; }
  [data-theme="light"][data-client="mantra"] .cobrand-mantra .cb-dark { display: none; }
  [data-theme="light"][data-client="mantra"] .cobrand-mantra .cb-light { display: block; }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"])[data-client="mantra"] .cobrand-mantra .cb-dark { display: none; }
    :root:not([data-theme="dark"])[data-client="mantra"] .cobrand-mantra .cb-light { display: block; }
  }
  [data-client="quigley-simpson"] .cobrand-qs,
  [data-client="quigley-simpson"] .cobrand-div { display: inline-flex; }
  .cobrand svg path[fill="#C9E9EE"] { fill: var(--cobrand-tint, currentColor); }

  /* Infamous PR. Fully branded, monochromatic. Mixing chartreuse with a
     client accent reads as two brands on one page (G, 2026-08-26). Black
     field, white type, grey chrome. --bt follows their ink so the mark
     is part of their system. */
  [data-client="infamous"] {
    --paper:#0a0a0a; --card:#141414; --card2:#1c1c1c;
    --ink:#f4f4f4;   --muted:#9a9a9a; --line:#2c2c2c;
    --accent:#f4f4f4; --accent-ink:#0a0a0a;
    --accent-bg:#1c1c1c; --accent-line:#3a3a3a;
    --bt:#f4f4f4; --bt-bg:#1c1c1c; --bt-line:#3a3a3a; --bt-ink:#0a0a0a;
    --other:#c8c8c8; --other-bg:#1a1a1a; --other-line:#3a3a3a;
    --kept:#e8e8e8; --partial:#b0b0b0; --gap:#8a8a8a;
    --chip-kept:#242424; --chip-partial:#1c1c1c; --chip-gap:#161616;
  }
  [data-theme="light"][data-client="infamous"] {
    --paper:#f6f6f6; --card:#ffffff; --card2:#f0f0f0;
    --ink:#111111;   --muted:#5c5c5c; --line:#e2e2e2;
    --accent:#111111; --accent-ink:#ffffff;
    --accent-bg:#efefef; --accent-line:#cfcfcf;
    --bt:#111111; --bt-bg:#efefef; --bt-line:#cfcfcf; --bt-ink:#ffffff;
    --other:#333333; --other-bg:#f3f3f3; --other-line:#dddddd;
    --kept:#222222; --partial:#555555; --gap:#777777;
    --chip-kept:#ececec; --chip-partial:#f3f3f3; --chip-gap:#f7f7f7;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"])[data-client="infamous"] {
      --paper:#f6f6f6; --card:#ffffff; --card2:#f0f0f0;
      --ink:#111111;   --muted:#5c5c5c; --line:#e2e2e2;
      --accent:#111111; --accent-ink:#ffffff;
      --accent-bg:#efefef; --accent-line:#cfcfcf;
      --bt:#111111; --bt-bg:#efefef; --bt-line:#cfcfcf; --bt-ink:#ffffff;
      --other:#333333; --other-bg:#f3f3f3; --other-line:#dddddd;
      --kept:#222222; --partial:#555555; --gap:#777777;
      --chip-kept:#ececec; --chip-partial:#f3f3f3; --chip-gap:#f7f7f7;
    }
  }
  [data-client="infamous"] .cobrand-infamous,
  [data-client="infamous"] .cobrand-div { display: inline-flex; }
  [data-client="infamous"] .cobrand-infamous {
    font-weight: 800; letter-spacing: 0.22em; font-size: 12px;
    color: var(--ink); line-height: 1;
  }

  /* Coxie 360. Fully branded, and the first LIGHT-PRIMARY theme: the brand is
     a black brush-script mark on white (coxie360.com og:image, "Coxie -
     Branding Font & Logo"), and the site runs light surfaces. So the BASE
     block here is the light look and the dark blocks are the overrides —
     the reverse of every theme above. Because the template's own :root is
     dark-primary, a light-primary client must define EVERY token in the base
     block or the root's dark chips leak onto a white page.
     SOURCE: coxie360.com Squarespace site.css (versioned-site-css/64c963a72…).
     Real tokens: ink #0e0e0e / #272727 / #3e3e3e, surfaces #f6f6f6 / #fafafa,
     lines #e7e7e7 / #d0d0d0 / #c4c4c4, coral #f0523d, blue #00b2ff.
     Derivations are commented per line; status chips keep the template's own
     hues because the Coxie kit carries no semantic colours (QS precedent).
     --bt follows ink (Infamous precedent): monochrome brand, chartreuse
     beside it reads as two brands competing for one page. */
  /* :root prefix is load-bearing: the template's own :root[data-theme="light"]
     block is (0,2,0) and would beat a bare [data-client] base block, leaking
     chartreuse into the light look (found on the first coxie360 page). */
  :root[data-client="coxie360"] {                  /* base = LIGHT (primary) */
    --paper:#f6f6f6; --card:#ffffff; --card2:#fafafa;   /* site surfaces */
    --ink:#0e0e0e;   --muted:#3e3e3e; --line:#e7e7e7;   /* site ink/line */
    --accent:#c93a26; --accent-ink:#ffffff;  /* #f0523d darkened to 5.1:1 on white */
    --accent-bg:#fdedea; --accent-line:#f7c8bf;         /* coral 8% / 30% into white */
    --bt:#0e0e0e; --bt-bg:#ececec; --bt-line:#d0d0d0; --bt-ink:#ffffff;
    --other:#0077b3; --other-bg:#e5f4fb; --other-line:#b8e2f6; /* #00b2ff held to AA */
    --kept:#2c6e49; --partial:#8a6516; --gap:#a33b2e;   /* template light hues */
    --chip-kept:#e3efe8; --chip-partial:#f6efdd; --chip-gap:#f7e4e0;
  }
  :root[data-theme="dark"][data-client="coxie360"] {
    --paper:#0e0e0e; --card:#1a1a1a; --card2:#272727;   /* site ink as canvas */
    --ink:#f6f6f6;   --muted:#c4c4c4; --line:#3e3e3e;   /* site tokens */
    --accent:#f0523d; --accent-ink:#0e0e0e;             /* coral holds 5.5:1 on #0e0e0e */
    --accent-bg:#2a1512; --accent-line:#57241c;         /* coral 12% / 30% into #0e0e0e */
    --bt:#f6f6f6; --bt-bg:#272727; --bt-line:#3e3e3e; --bt-ink:#0e0e0e;
    --other:#00b2ff; --other-bg:#0d2331; --other-line:#155273;
    --kept:#8fd4a0; --partial:#e0bd6e; --gap:#e2938a;   /* template dark hues */
    --chip-kept:#263a2c; --chip-partial:#3a3222; --chip-gap:#3c2825;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"])[data-client="coxie360"] {
      --paper:#0e0e0e; --card:#1a1a1a; --card2:#272727;
      --ink:#f6f6f6;   --muted:#c4c4c4; --line:#3e3e3e;
      --accent:#f0523d; --accent-ink:#0e0e0e;
      --accent-bg:#2a1512; --accent-line:#57241c;
      --bt:#f6f6f6; --bt-bg:#272727; --bt-line:#3e3e3e; --bt-ink:#0e0e0e;
      --other:#00b2ff; --other-bg:#0d2331; --other-line:#155273;
      --kept:#8fd4a0; --partial:#e0bd6e; --gap:#e2938a;
      --chip-kept:#263a2c; --chip-partial:#3a3222; --chip-gap:#3c2825;
    }
  }
  /* The real Coxie mark (brush script in a hand-drawn circle) inlined as a
     data URI so the page stays self-contained after publish — the Mantra
     ../_assets refs break the moment a page leaves the artifacts tree. The
     source card is black-on-white; clipping to a circle keeps the white disc,
     which reads as a badge on the dark canvas rather than disappearing. */
  [data-client="coxie360"] .cobrand-coxie360,
  [data-client="coxie360"] .cobrand-div { display: inline-flex; }
  [data-client="coxie360"] .cobrand-coxie360 img {
    height: 34px; width: 34px; display: block; border-radius: 50%;
    background: #ffffff;
  }

  .btn:hover { border-color: var(--accent); }
  .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .status { font-size: 12px; color: var(--kept, #8fd4a0); font-weight: 650; margin-left: auto; }
  [contenteditable="true"] { outline: 2px dashed var(--accent); outline-offset: 10px; border-radius: 4px; }
  [contenteditable="true"]:focus { outline-style: solid; }

  /* ── Reader mode (data-mode="reader") ────────────────────────────────────
     A page sent to a client is a finished document, not a working file, so the
     operator affordances come off: Edit, Copy as Markdown, Reset edits. This
     rule is only the JS-off half. The script REMOVES every [data-op-only]
     control from the DOM and never wires the editing subsystem at all, so
     nothing here is load-bearing for inertness. A page without the attribute
     is unaffected. */
  :root[data-mode="reader"] [data-op-only] { display: none !important; }
  /* Checklists still render, read-only: a delivered list is something to read,
     not to tick, and Reset edits is gone so a tick would be one-way. */
  :root[data-mode="reader"] ul.checklist input[type="checkbox"] { cursor: default; }
  :root[data-mode="reader"] ul.checklist input[type="checkbox"]:hover { border-color: var(--line); }

  /* ── Page tabs (data-tabs="on") ──────────────────────────────────────────
     One artifact, several pages. Tabs are REAL LINKS to sibling slugs, so every
     page stays independently linkable, printable and readable with JS off —
     these get forwarded, and a tab that exists only in JS state cannot be sent
     to anyone. The current tab is a <span>, not a link to itself, and is marked
     in the HTML rather than by script.

     The strip lives INSIDE .sticky-chrome, above the title row: one sticky
     element, one blur, one border, one z-index. Two sticky bars cannot collide
     when there is only one of them. */
  .tabs { display: none; }
  :root[data-tabs="on"] .tabs {
    display: flex; gap: 4px; align-items: center;
    margin: 0 0 10px; padding-bottom: 2px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  :root[data-tabs="on"] .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab {
    flex: 0 0 auto; white-space: nowrap;
    padding: 6px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 650; line-height: 1.35;
    color: var(--muted); background: transparent;
    border: 1px solid transparent; text-decoration: none;
  }
  .tabs a.tab, .tabs a.tab:visited { color: var(--ink); text-decoration: none;
    background: var(--card2); border: 1px solid var(--line); opacity: .82; }
  .tabs a.tab:hover { color: var(--ink);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-color: var(--accent-line); }
  .tabs a.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .tabs .tab[aria-current="page"] {
    color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
  }

  @media (max-width: 560px) {
    .sticky-title { font-size: 1.05rem; white-space: normal; display: -webkit-box;
      -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .toolbar { gap: 6px; }
    .btn { padding: 6px 12px; font-size: 12.5px; }
  }
  @media print {
    .sticky-chrome { position: static; backdrop-filter: none; background: #fff;
      border-bottom: 1px solid #ccc; }
    .toolbar, .tabs { display: none !important; }
    .sticky-title { white-space: normal; overflow: visible; text-overflow: unset;
      font-size: 26px; }
  }

  /* One header row. Title takes the space it needs and truncates rather than
     pushing the controls off; tabs sit next to it; controls go right. Below
     900px it stacks, because three groups on one line at phone width means
     none of them is readable. */
  .chrome-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .chrome-row .sticky-title-row { margin: 0; padding: 20px 0 8px; flex: 0 1 auto; min-width: 0; }
  .chrome-row .sticky-title { white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 46ch; }
  .chrome-row .tabs { margin: 0; }
  .chrome-row .toolbar { margin: 0; margin-left: auto; flex: 0 0 auto; }
  @media (max-width: 900px) {
    .chrome-row { gap: 10px; }
    .chrome-row .toolbar { margin-left: 0; }
  }
  /* Square icon button for the theme toggle. The label was a word that named
     the state you were NOT in, which reads backwards to half of everyone. */
  .btn.iconbtn { width: 34px; height: 34px; padding: 0; display: inline-flex;
    align-items: center; justify-content: center; }
  .btn.iconbtn svg { width: 17px; height: 17px; display: block; }
  /* -- Header chrome: one brand row, one page row -------------------------
     The brand row is identity plus controls on ONE line: Braintied, the
     co-brand lockup, then the tools pushed right by a flexible spacer. The
     page row underneath carries the set: current page as heavy text with an
     accent underline, siblings as quiet links.

     Hand-built on the Mantra and Quigley-Simpson sets first, then folded back
     here 2026-08-23 so every page gets it without anyone rebuilding it. */
  .sticky-chrome .brandrow { align-items: center; padding-bottom: 9px;
    border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
  .sticky-chrome .brandrow .brandbar { flex: 0 1 auto; min-width: 0;
    margin: 0; padding: 0; border: 0; }
  .sticky-chrome .brandrow .spacer { flex: 1 1 auto; }
  .sticky-chrome .brandrow .toolbar { margin: 0; flex: 0 0 auto; }
  .sticky-chrome .pagerow { align-items: center; gap: 14px; padding: 4px 0 14px;
    overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .sticky-chrome .pagerow::-webkit-scrollbar { display: none; }
  /* flex-shrink stays 0. The row is the only shrinkable thing in a nowrap
     strip, so a shrinkable current tab is the one item that collapses when
     the tabs overflow. Measured 2026-08-23 at 375px with six tabs: the
     current tab rendered at clientWidth 0 against scrollWidth 135, an
     invisible gap where the page name should be. The strip scrolls; the
     tab does not need to give way. */
  .pnav-cur { flex: 0 0 auto; min-width: 0; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; font-size: 1.12rem; font-weight: 800;
    letter-spacing: -.02em; color: var(--ink);
    padding-bottom: 5px; border-bottom: 2px solid var(--accent); }
  .pnav-link { flex: 0 0 auto; white-space: nowrap; font-size: 13px; font-weight: 650;
    color: var(--muted); text-decoration: none;
    padding-bottom: 5px; border-bottom: 2px solid transparent; }
  .pnav-link:hover { color: var(--ink); border-bottom-color: var(--line); }
  .pnav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  /* Title stays visible on tabbed pages. The page row is the sibling links
     under it, not a replacement for the document name. */
  /* Legacy pill strip. Pages published before 2026-08-23 still carry that
     markup; the page row supersedes it. */
  .sticky-chrome .tabs { display: none !important; }

  /* -- Previous / next cards ----------------------------------------------
     Both directions, each naming its destination, so the first page of a set
     offers a way forward and the last offers a way back. Emitted by `bpage`
     rather than assembled by script: it has to be there with JS off, and it
     has to print.

     Until 2026-08-23 this template styled a class the generator did not emit,
     while the generator emitted a class this template did not style, so every
     tabbed page rendered its cards as bare inline links. Measured that day on
     five live pages: zero matching CSS rules. If you rename either side,
     rename both. */
  .pgends { display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    margin: 40px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }
  .pgend { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px;
    border-radius: 12px; border: 1px solid var(--line); background: var(--card2);
    text-decoration: none; min-width: 0; }
  .pgend:hover { border-color: var(--accent-line); background: var(--accent-bg); }
  .pgend:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .pgend.next { text-align: right; align-items: flex-end; }
  .pgdir { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--accent); font-weight: 700; }
  .pgname { font-weight: 700; color: var(--ink); font-size: 14.5px; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (max-width: 560px) { .pgends { grid-template-columns: 1fr; } }
  @media print { .pgends { display: none; } }
  /* ── Contents (auto-built; hidden when the doc is short) ─────────────────
     Two shapes from one markup block:
       WIDE  (>=1180px) a pinned sidebar that tracks the section you are reading
       NARROW(< 1180px) a thumb-reachable bar at the bottom that opens a sheet
     The nav lives OUTSIDE #doc, so it never lands in saved edits, the exported
     markdown, or print. */
  #toc { display: none; }
  #toc.on { display: block; }
  #toc .tochead { font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase;
    color: var(--muted); font-weight: 680; margin-bottom: 8px; }
  #toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
  #toc li { margin: 0; }
  #toc a { display: block; color: var(--ink); text-decoration: none;
    padding: 7px 10px 7px 12px; border-radius: 8px; border-left: 2px solid transparent;
    font-size: 14px; line-height: 1.35; }
  #toc a::before { counter-increment: toc; content: counter(toc) ". ";
    color: var(--muted); font-variant-numeric: tabular-nums; }
  /* When the headings carry their own numbers, the entry text already starts
     with one. Two sequences then run side by side ("1. 01 Why this page
     exists"), and they are not even the same format. The document's own
     numbering wins; this counter is only for documents that have none. */
  #toc ol.self-numbered a::before { content: none; counter-increment: none; }
  #toc ol.self-numbered .tocnum { color: var(--accent); font-weight: 700;
    font-variant-numeric: tabular-nums; margin-right: 8px; }
  #toc a:hover, #toc a:focus-visible { color: var(--bt);
    background: color-mix(in srgb, var(--bt) 9%, transparent); }
  /* the section currently under the reader */
  #toc a[aria-current="true"] { color: var(--bt); font-weight: 680;
    border-left-color: var(--bt);
    background: color-mix(in srgb, var(--bt) 12%, transparent); }
  #toc a[aria-current="true"]::before { color: var(--bt); }

  /* mobile-only chrome, hidden by default */
  #tocBar, #tocScrim, #toc .tocclose { display: none; }

  /* ---- WIDE: pinned sidebar ---- */
  @media (min-width: 1180px) {
    #toc.on { position: fixed; top: 84px; left: max(16px, calc(50vw - 610px));
      width: 232px; max-height: calc(100vh - 120px); overflow-y: auto;
      z-index: 30; padding: 14px 10px 14px 8px;
      background: var(--card); border: 1px solid var(--line);
      border-radius: var(--radius); scrollbar-width: thin; }
    #toc .tochead { padding-left: 12px; }
  }
  /* Only shift the page once the sidebar actually exists (body.hasnav). */
  @media (min-width: 1180px) {
    body.hasnav .wrap { margin-left: max(268px, calc(50vw - 362px)); margin-right: auto; }
  }

  /* ---- NARROW: bottom bar + sheet ---- */
  @media (max-width: 1179px) {
    #toc.on { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
      max-height: 72vh; overflow-y: auto;
      padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
      background: var(--card); border-top: 1px solid var(--line);
      border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.28);
      transform: translateY(101%); transition: transform .22s ease;
      visibility: hidden; }
    #toc.on.open { transform: translateY(0); visibility: visible; }
    #toc a { padding: 13px 12px; font-size: 15.5px; }   /* big tap targets */
    #toc .tocclose { display: block; width: 100%; margin-top: 6px; padding: 12px;
      font: inherit; font-weight: 650; color: var(--ink); background: transparent;
      border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }

    #tocScrim.on { display: block; position: fixed; inset: 0; z-index: 60;
      background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s ease;
      pointer-events: none; }
    #tocScrim.on.open { opacity: 1; pointer-events: auto; }

    #tocBar.on { display: flex; position: fixed; z-index: 59;
      left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
      align-items: center; gap: 4px; min-height: 58px; padding: 6px 8px;
      background: var(--card); color: var(--ink);
      border: 1px solid var(--line); border-radius: 20px;
      box-shadow: 0 6px 24px rgba(0,0,0,.22);
      font: inherit; }
    #tocBar .barprev, #tocBar .barnext {
      flex: 0 0 48px; height: 48px; border: 0; border-radius: 14px;
      background: transparent; color: var(--ink); font: inherit;
      font-size: 1.55rem; line-height: 1; cursor: pointer; }
    #tocBar .barprev:disabled, #tocBar .barnext:disabled { opacity: 0.28; }
    /* The jump region is the button; the bar around it became a container when
       the compact tools moved in, because a button cannot nest buttons. The
       layout below reproduces the single-button bar exactly on a page with no
       tools, so an untabbed record looks and behaves as it always did. */
    #tocBar .barjump { display: flex; align-items: center; gap: 8px;
      flex: 1; min-width: 0; min-height: 48px; padding: 0 8px; margin: 0; border: 0; border-radius: 14px;
      background: transparent; color: inherit; font: inherit;
      text-align: left; cursor: pointer; }
    #tocBar .barjumptext { flex: 1; min-width: 0; }
    #tocBar .barnow { display: block; font-weight: 650; font-size: 16px;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #tocBar .barlbl { display: none; }
    #tocBar .barcaret { color: var(--bt); font-size: 12px; flex: 0 0 auto; }
    /* Reduced bottom menu: on a tabbed page the thumb bar also carries the
       compact tools, so the sticky header on a phone stays tabs + title and
       nothing duplicates. One bar, never two. */
    #tocBar .bartools { display: none; }
    :root[data-tabs="on"] #tocBar .bartools { display: flex; gap: 6px; flex: 0 0 auto; }
    :root[data-tabs="on"] #tocBar .bartools .btn {
      padding: 6px 11px; font-size: 12px; background: var(--card2); }
    /* No sections to jump to: the bar is tools only, and hugs the right edge
       rather than stretching a mostly empty pill across the screen. */
    #tocBar.toolsonly { left: auto; justify-content: flex-end; }
    #tocBar.toolsonly .barjump,
    #tocBar.toolsonly .barprev,
    #tocBar.toolsonly .barnext { display: none; }
    /* The top toolbar stands down only once the bottom bar is really there
       (body.hasnav is set by the script), so a JS-off page keeps its tools. */
    :root[data-tabs="on"] body.hasnav .toolbar { display: none; }
    /* keep the last content clear of the floating bar */
    body.hasnav .wrap { padding-bottom: 108px; }
  }

  @media print { #toc, #tocBar, #tocScrim { display: none !important; } }
