/* ==========================================================================
   THEME FILE — the ONLY place visual tokens live.
   Contract: reference/theme.md (in the skill). Swap the look = replace this
   file (and theme/fonts/). Kit CSS (src/kit.css) only reads var(--token).

   Default theme "lavender-ink": light lavender-grey page, white cards, deep
   navy ink, indigo accent, hot pink second accent, green/orange status.
   Poppins + IBM Plex Mono, self-hosted (SIL OFL 1.1, licences in fonts/).
   Dark mode is derived from the same family (the "terminal" navy).
   ========================================================================== */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/poppins-300-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-600-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibmplexmono-400-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibmplexmono-500-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibmplexmono-600-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;

  /* --- surfaces ----------------------------------------------------------- */
  --bg: #E6E8F2;            /* page plane */
  --bg-glow-1: rgba(85, 95, 255, .13);   /* top-right radial glow */
  --bg-glow-2: rgba(249, 25, 116, .07);  /* bottom-left radial glow */
  --surface: #FFFFFF;       /* cards, panels, chart surface */
  --surface-2: #F2F4F9;     /* inset rows, zebra, inactive tabs */
  --surface-3: #E3E7F0;     /* pressed / track */
  --line: #D0D6E3;          /* hairline borders */
  --line-2: #B6BFD3;        /* stronger borders, axes */

  /* --- ink (text). Contrast on --surface AND --bg checked by shoot audit -- */
  --ink: #00081C;           /* headings, key text */
  --ink-2: #273143;         /* body text (thin weight needs >= 7:1) */
  --muted: #3A4560;         /* secondary text, captions (>= 7:1 on surface and page) */
  --faint: #56627C;         /* meta text, only at weight >= 400 (>= 4.5:1) */

  /* --- accents ------------------------------------------------------------- */
  --acc: #555FFF;           /* primary accent: links, focus, "the answer" */
  --acc-ink: #3039C8;       /* accent as text (>= 7:1 on surface) */
  --acc-2: #7F87FF;
  --acc-soft: #DEE0FF;
  --acc-softer: #EEEFFF;
  --hot: #F91974;           /* second accent: the problem, "not this" */
  --hot-ink: #A80C4D;
  --hot-soft: #FDD9E8;

  /* --- status (fixed meaning; always paired with an icon + word) ---------- */
  --good: #1CAA53;   --good-ink: #0B6B33;  --good-soft: #DCF1E3;
  --warn: #FF760D;   --warn-ink: #9A4200;  --warn-soft: #FFE3CE;
  --bad: #F91974;    --bad-ink: #A80C4D;   --bad-soft: #FDD9E8;
  --info: #555FFF;   --info-ink: #3039C8;  --info-soft: #EEEFFF;
  --untested: #56627C; --untested-ink: #3A4560; --untested-soft: #E3E7F0;

  /* --- text techniques ----------------------------------------------------- */
  --mark-bg: #FFF0A8;       /* highlight marker */
  --mark-ink: #00081C;
  --strike-ink: #4E5873;    /* the "old" text in strike-then-replace (weight 400) */
  --new-bg: #555FFF;        /* the "new" chip in strike-then-replace */
  --new-ink: #FFFFFF;
  --on-acc: #FFFFFF;        /* text on a solid accent / status fill */
  --comment-mark: rgba(249, 25, 116, .20);  /* reader's comment highlight */
  --ul-line: rgba(85, 95, 255, .55);        /* UL word underline (strong) */
  --ul-line-soft: rgba(85, 95, 255, .25);   /* UL word underline (later uses) */

  /* --- terminal / code (dark in both modes, like the reference deck) ------ */
  --term: #0F1424;  --term-2: #171D30;  --term-line: #232B44;
  --term-ink: #D3D9E6; --term-faint: #95A2BC;
  --ch-1: #8D9AB5;  /* comment */      --ch-2: #FFB27A;  /* constant */
  --ch-3: #9AD8FF;  /* entity/var */   --ch-4: #D3D9E6;  /* foreground */
  --ch-5: #FF8DBA;  /* function */     --ch-6: #8FE3B0;  /* tag */
  --ch-7: #B9BEFF;  /* keyword */      --ch-8: #A8E6C0;  /* string */
  --ch-9: #FF6B8E;  /* invalid */      --ch-10: #0F1424;
  --ch-11: rgba(249, 25, 116, .22);   /* diff deleted bg */
  --ch-12: rgba(28, 170, 83, .22);    /* diff inserted bg */
  --ch-13: rgba(255, 118, 13, .22);   /* diff changed bg */
  --ch-14: #D3D9E6; --ch-15: #95A2BC; --ch-16: #0F1424; /* editor bg */
  --ch-17: rgba(85, 95, 255, .20);    /* line highlight */
  --ch-18: rgba(85, 95, 255, .14);    --ch-19: #95A2BC;
  --ch-20: rgba(127, 135, 255, .35);  --ch-21: #555FFF;
  --ch-22: #0A0E1B; /* tab strip */   --ch-23: #232B44; /* borders */
  --ch-24: #56627C; /* line numbers */ --ch-25: #232B44; --ch-26: #171D30;

  /* --- chart palette (validated with dataviz validate_palette.js) ---------
     light on #FFFFFF: ALL CHECKS PASS (worst adjacent CVD dE 8.4).
     Fixed order, never cycled. Max 5 series; fold the rest into "Other". */
  --series-1: #555FFF; --series-2: #F91974; --series-3: #0E9FB8;
  --series-4: #F2690B; --series-5: #1CAA53;
  --grid: #E3E7F0;     --axis: #B6BFD3;

  /* --- type ---------------------------------------------------------------- */
  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --w-thin: 300;            /* body prose: thin, so ink must be >= 7:1 */
  --w-body: 300;
  --w-medium: 500;
  --w-strong: 600;          /* bold = the ONE key point */
  --w-head: 600;
  --fs-xs: .8125rem;        /* 13px: meta, kicker */
  --fs-s: .9375rem;         /* 15px: captions, chips */
  --fs-m: 1.0625rem;        /* 17px: body */
  --fs-l: 1.25rem;          /* 20px: lead */
  --fs-xl: clamp(1.375rem, 3.6vw, 1.75rem);   /* h3 */
  --fs-2xl: clamp(1.75rem, 5.4vw, 2.75rem);   /* h2 band title */
  --fs-3xl: clamp(2.25rem, 8vw, 4.25rem);     /* h1 page title */
  --fs-num: clamp(2.125rem, 8.5vw, 4.5rem);   /* BigNumber */
  --lh-body: 1.62;
  --lh-tight: 1.25;
  --lh-head: 1.06;
  --ls-head: -.03em;
  --ls-kicker: .18em;

  /* --- space (4px base) ---------------------------------------------------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --gutter: clamp(16px, 4.5vw, 48px);         /* page side gutter (16px on phones) */
  --band-gap: clamp(44px, 7vw, 80px);         /* vertical space between sections of the article */
  --measure: 38rem;                            /* article column: ~65 characters */
  --page-max: 72rem;

  /* --- shape --------------------------------------------------------------- */
  --r-s: 8px; --r-m: 14px; --r-l: 20px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 8, 28, .06), 0 2px 6px rgba(0, 8, 28, .05);
  --shadow-md: 0 6px 16px rgba(0, 8, 28, .10), 0 1px 3px rgba(0, 8, 28, .06);
  --shadow-lg: 0 18px 44px rgba(0, 8, 28, .18), 0 4px 12px rgba(0, 8, 28, .08);
  --ring: 0 0 0 4px rgba(85, 95, 255, .16);
  --ring-hot: 0 0 0 4px rgba(249, 25, 116, .13);

  /* --- motion (every duration < 600ms; nothing loops forever) -------------- */
  --ease: cubic-bezier(.2, .75, .25, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 560ms;
  --stagger: 90ms;
}

/* ---------------- dark: same family, stepped for a navy page -------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #070B16; --bg-glow-1: rgba(108, 116, 255, .16); --bg-glow-2: rgba(240, 48, 126, .08);
    --surface: #0F1424; --surface-2: #151B2E; --surface-3: #1D2439;
    --line: #232B44; --line-2: #36415F;
    --ink: #F4F6FB; --ink-2: #DCE1EC; --muted: #B4BDD1; --faint: #98A3BC;
    --acc: #8D94FF; --acc-ink: #B9BEFF; --acc-2: #6C74FF; --acc-soft: #272D5C; --acc-softer: #1A1F42;
    --hot: #FF4F96; --hot-ink: #FF8DBA; --hot-soft: #3B1529;
    --good: #34C76E; --good-ink: #7BE3A4; --good-soft: #11301F;
    --warn: #FF8F3A; --warn-ink: #FFB984; --warn-soft: #3A2410;
    --bad: #FF4F96; --bad-ink: #FF8DBA; --bad-soft: #3B1529;
    --info: #8D94FF; --info-ink: #B9BEFF; --info-soft: #1A1F42;
    --untested: #98A3BC; --untested-ink: #C5CDDD; --untested-soft: #1D2439;
    --mark-bg: #5B4A00; --mark-ink: #FFF6CC;
    --strike-ink: #A3ADC4; --new-bg: #8D94FF; --new-ink: #070B16; --on-acc: #070B16;
    --comment-mark: rgba(255, 79, 150, .30);
    --ul-line: rgba(141, 148, 255, .70); --ul-line-soft: rgba(141, 148, 255, .32);
    --term: #060914; --term-2: #0D1120; --term-line: #232B44; --ch-16: #060914; --ch-22: #03050D; --ch-26: #0D1120;
    --series-1: #6C74FF; --series-2: #F0307E; --series-3: #1496AC; --series-4: #E2620C; --series-5: #1E9C4F;
    --grid: #1D2439; --axis: #36415F;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .30);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35);
    --ring: 0 0 0 4px rgba(141, 148, 255, .22);
    --ring-hot: 0 0 0 4px rgba(255, 79, 150, .18);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070B16; --bg-glow-1: rgba(108, 116, 255, .16); --bg-glow-2: rgba(240, 48, 126, .08);
  --surface: #0F1424; --surface-2: #151B2E; --surface-3: #1D2439;
  --line: #232B44; --line-2: #36415F;
  --ink: #F4F6FB; --ink-2: #DCE1EC; --muted: #B4BDD1; --faint: #98A3BC;
  --acc: #8D94FF; --acc-ink: #B9BEFF; --acc-2: #6C74FF; --acc-soft: #272D5C; --acc-softer: #1A1F42;
  --hot: #FF4F96; --hot-ink: #FF8DBA; --hot-soft: #3B1529;
  --good: #34C76E; --good-ink: #7BE3A4; --good-soft: #11301F;
  --warn: #FF8F3A; --warn-ink: #FFB984; --warn-soft: #3A2410;
  --bad: #FF4F96; --bad-ink: #FF8DBA; --bad-soft: #3B1529;
  --info: #8D94FF; --info-ink: #B9BEFF; --info-soft: #1A1F42;
  --untested: #98A3BC; --untested-ink: #C5CDDD; --untested-soft: #1D2439;
  --mark-bg: #5B4A00; --mark-ink: #FFF6CC;
  --strike-ink: #A3ADC4; --new-bg: #8D94FF; --new-ink: #070B16; --on-acc: #070B16;
  --comment-mark: rgba(255, 79, 150, .30);
  --ul-line: rgba(141, 148, 255, .70); --ul-line-soft: rgba(141, 148, 255, .32);
  --term: #060914; --term-2: #0D1120; --term-line: #232B44; --ch-16: #060914; --ch-22: #03050D; --ch-26: #0D1120;
  --series-1: #6C74FF; --series-2: #F0307E; --series-3: #1496AC; --series-4: #E2620C; --series-5: #1E9C4F;
  --grid: #1D2439; --axis: #36415F;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .30);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35);
  --ring: 0 0 0 4px rgba(141, 148, 255, .22);
  --ring-hot: 0 0 0 4px rgba(255, 79, 150, .18);
}

/* ==========================================================================
   KIT CSS — layout + components. Reads ONLY var(--token) from theme.css.
   Phone first (390px), then wider. Motion < 600ms, runs once, off for reduced motion.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 132px; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink-2);
  font-family: var(--font-sans); font-weight: var(--w-body); font-size: var(--fs-m); line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70vw 50vw at 100% 0%, var(--bg-glow-1), transparent 60%),
              radial-gradient(55vw 45vw at 0% 100%, var(--bg-glow-2), transparent 60%), var(--bg);
}
img, svg, video { max-width: 100%; }
a { color: var(--acc-ink); font-weight: 400; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--acc); }
b, strong { color: var(--ink); font-weight: var(--w-strong); }
p { margin: 0 0 var(--s-4); max-width: var(--measure); }
ul, ol { max-width: var(--measure); }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); font-weight: var(--w-head); letter-spacing: var(--ls-head); }
h3 { font-size: var(--fs-xl); line-height: var(--lh-tight); margin: var(--s-6) 0 var(--s-3); }
code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: .05em .35em; border-radius: 6px; color: var(--ink); font-weight: 400; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
::selection { background: var(--acc-soft); color: var(--ink); }
::highlight(gmr-comment) { background-color: var(--comment-mark); }

/* ---------------- top bar + rail ---------------- */
.top { position: sticky; top: 0; z-index: 40; background: var(--bg); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 10px var(--gutter); max-width: var(--page-max); margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); text-decoration: none; min-width: 0; min-height: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-dot { width: 11px; height: 11px; border-radius: 3px; background: var(--acc); flex: none; }
.top-actions { display: flex; align-items: center; gap: var(--s-2); flex: none; }
.cchip, .theme-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 40px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 var(--fs-s) var(--font-mono); text-decoration: none; cursor: pointer; box-shadow: var(--shadow-sm); }
.cchip svg, .theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.theme-btn svg path { fill: currentColor; stroke: none; }
.cchip:not([data-zero]) { border-color: var(--hot); color: var(--hot-ink); box-shadow: var(--ring-hot); }
.theme-btn { padding: 0; }
.progress { height: 3px; background: transparent; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--hot)); border-radius: 0 2px 2px 0; }
.rail { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.rail ol { list-style: none; display: flex; gap: 6px; margin: 0; padding: 8px 0 10px; overflow-x: auto; scrollbar-width: none; max-width: none; }
.rail ol::-webkit-scrollbar { display: none; }
.rail a { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 6px 12px 6px 6px; border-radius: var(--r-pill); text-decoration: none; color: var(--muted); font-size: var(--fs-s); font-weight: 400; border: 1px solid transparent; min-height: 40px; }
.rail-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font: 500 var(--fs-xs) var(--font-mono); background: var(--surface-3); color: var(--ink-2); }
.rail .is-past .rail-n { background: var(--acc-soft); color: var(--acc-ink); }
.rail .is-on a { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }
.rail .is-on .rail-n { background: var(--acc); color: var(--on-acc); }
.rail a:hover { color: var(--ink); }

/* ---------------- page structure ---------------- */
.main { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter) var(--s-8); }
.hero { padding: clamp(40px, 9vw, 96px) 0 clamp(24px, 5vw, 48px); }
.kicker { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: var(--ls-kicker); text-transform: uppercase; color: var(--acc-ink); display: flex; align-items: center; gap: 12px; margin-bottom: var(--s-4); }
.kicker::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: var(--acc); flex: none; }
.kicker-hot { color: var(--hot-ink); } .kicker-hot::before { background: var(--hot); }
.kicker-small { margin-top: var(--s-5); }
.hero-title { font-size: var(--fs-3xl); line-height: var(--lh-head); margin: 0 0 var(--s-5); max-width: 18ch; letter-spacing: -.035em; }
.hero-what { margin: 0; display: grid; gap: 10px; max-width: var(--measure); }
.hero-what > div { display: grid; gap: 2px; padding-left: var(--s-4); border-left: 3px solid var(--acc-soft); }
.hero-what > div:first-child { border-left-color: var(--acc); }
.hero-what dt { font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); }
.hero-what dd { margin: 0; color: var(--ink); font-size: var(--fs-m); line-height: 1.6; }
.def { }
.hero-answer { font-size: var(--fs-l); line-height: 1.5; color: var(--ink); font-weight: 400; max-width: 34rem; padding-left: var(--s-4); border-left: 3px solid var(--acc); }
.band { padding-top: var(--band-gap); scroll-margin-top: 120px; }
.band-head { margin-bottom: var(--s-4); max-width: var(--measure); }
.band-title { font-size: clamp(1.45rem, 4.2vw, 2.05rem); line-height: 1.2; margin: 0; max-width: 30ch; }
.band .band-body > * + * { margin-top: var(--s-6); }
.band .band-body > p + p, .band .band-body > p + ul, .band .band-body > p + ol, .band .band-body > ul + p, .band .band-body > ol + p { margin-top: var(--s-4); }
.band-body > p { margin-bottom: 0; }
/* article prose: one comfortable column; pictures may break out wider */
.band-body > p, .band-body > ul, .band-body > ol, .band-body > h3, .band-body > blockquote { max-width: var(--measure); line-height: 1.75; }
.band-body > p { font-size: 1.0625rem; }
.band-body > h3 { margin-top: var(--s-6); }
.previously, .handoff { max-width: var(--measure); display: grid; gap: 4px; padding: 12px 16px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); color: var(--ink); line-height: 1.65; }
.previously { border-left: 3px solid var(--acc); }
.handoff { border-left: 3px solid var(--good); margin-top: var(--s-6); }
.previously p, .handoff p { margin: 0; }
.flowk { font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); }
.handoff .flowk { color: var(--good-ink); }
.story { margin: 0; max-width: var(--measure); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-sm); }
.story-title { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-2); }
.story ol { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; color: var(--ink); line-height: 1.55; }
.muted-line { color: var(--muted); }

/* ---------------- text kit ---------------- */
.lead p { font-size: var(--fs-l); line-height: 1.5; color: var(--ink); font-weight: 400; max-width: 34rem; margin: 0; }
.callout { display: grid; grid-template-columns: 36px 1fr; gap: var(--s-3); padding: var(--s-4) var(--s-5) var(--s-4) var(--s-4); border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); max-width: 44rem; }
.callout-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font: 600 var(--fs-m) var(--font-mono); color: var(--on-acc); background: var(--info); }
.callout-word { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--info-ink); margin: 6px 0 4px; }
.callout-word b { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-size: var(--fs-s); }
.callout-body p:last-child { margin-bottom: 0; }
.callout-warning { background: var(--warn-soft); border-color: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 14%, transparent); }
.callout-warning .callout-icon { background: var(--warn); } .callout-warning .callout-word { color: var(--warn-ink); }
.callout-warning .callout-body { color: var(--ink); }
.callout-decision { border-color: var(--acc); box-shadow: var(--ring), var(--shadow-md); }
.callout-decision .callout-icon { background: var(--acc); }
.callout-untested { background: var(--untested-soft); border-style: dashed; border-color: var(--line-2); }
.callout-untested .callout-icon { background: var(--untested); } .callout-untested .callout-word { color: var(--untested-ink); }
.callout-good { border-color: var(--good); } .callout-good .callout-icon { background: var(--good); } .callout-good .callout-word { color: var(--good-ink); }
mark, .hl { background: linear-gradient(transparent 12%, var(--mark-bg) 12%, var(--mark-bg) 88%, transparent 88%); color: var(--mark-ink); padding: 0 .15em; border-radius: 3px; font-weight: 400; }
del, s { color: var(--strike-ink); font-weight: 400; text-decoration-thickness: 2px; text-decoration-color: var(--hot); }
.swap { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .4em; }
.swap-old { color: var(--strike-ink); }
.swap-arrow { color: var(--acc); font-family: var(--font-mono); }
.swap-new { background: var(--new-bg); color: var(--new-ink); border-radius: 6px; padding: 0 .4em; font-weight: 500; }
.tag { display: inline-block; vertical-align: .12em; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; border-radius: var(--r-pill); padding: 2px 9px; line-height: 1.5; border: 1px solid; white-space: nowrap; }
.tag-measured { color: var(--good-ink); background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.tag-simulated { color: var(--warn-ink); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.tag-docs { color: var(--acc-ink); background: var(--acc-softer); border-color: var(--acc-soft); }
.tag-estimate { color: var(--warn-ink); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); border-style: dashed; }
.tag-untested { color: var(--untested-ink); background: var(--untested-soft); border-color: var(--line-2); border-style: dashed; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-4); }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.bignum { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s-5); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: var(--s-2); align-items: flex-start; }
.bignum-value { font-family: var(--font-display); font-size: var(--fs-num); line-height: 1; font-weight: var(--w-head); letter-spacing: -.04em; color: var(--acc); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.bignum-unit { font: 500 var(--fs-s) var(--font-mono); color: var(--faint); letter-spacing: 0; }
.bignum-label { color: var(--ink-2); font-size: var(--fs-s); line-height: 1.4; }
.bignum .tag { white-space: normal; max-width: 100%; line-height: 1.35; }
.bignum-hot .bignum-value { color: var(--hot); } .bignum-good .bignum-value { color: var(--good-ink); } .bignum-ink .bignum-value { color: var(--ink); }
.bignum-small .bignum-value { font-size: clamp(1.75rem, 7vw, 2.5rem); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chip { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 14px; box-shadow: var(--shadow-sm); }
.chips-accent .chip { color: var(--acc-ink); background: var(--acc-softer); border-color: var(--acc-soft); box-shadow: none; }
.chips-hot .chip { color: var(--hot-ink); background: var(--hot-soft); border-color: transparent; box-shadow: none; }
.compare-wrap { overflow-x: auto; max-width: 100%; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.compare { border-collapse: collapse; width: 100%; font-size: var(--fs-s); min-width: 320px; }
.compare caption { text-align: left; padding: var(--s-3) var(--s-4) 0; font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.compare th, .compare td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.compare thead th { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.compare tbody th { color: var(--ink); font-weight: 500; }
.compare tr:last-child > * { border-bottom: 0; }
.compare .pick { background: var(--acc-softer); color: var(--ink); }
.compare thead .pick { color: var(--acc-ink); }
.compare-small { font-size: var(--fs-xs); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.step { display: grid; grid-template-columns: 36px 1fr; gap: var(--s-3); align-items: start; }
.step-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 var(--fs-s) var(--font-mono); color: var(--acc-ink); background: var(--acc-softer); border: 1px solid var(--acc-soft); }
.step-title { color: var(--ink); font-weight: 500; padding-top: 3px; }
.step-text { color: var(--muted); font-size: var(--fs-s); }
.verdict { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-5); box-shadow: var(--shadow-md); }
.verdict-word { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 6vw, 2.25rem); line-height: 1; letter-spacing: -.03em; padding: 10px 14px; border-radius: var(--r-m); background: var(--acc-softer); color: var(--acc-ink); }
.verdict-no .verdict-word { background: var(--hot-soft); color: var(--hot-ink); }
.verdict-yes .verdict-word { background: var(--good-soft); color: var(--good-ink); }
.verdict-mixed .verdict-word { background: var(--warn-soft); color: var(--warn-ink); }
.verdict-title { margin: 4px 0 var(--s-2); font-size: var(--fs-l); letter-spacing: -.01em; line-height: 1.3; }
.verdict-body { color: var(--ink-2); font-size: var(--fs-s); }
.verdict-body p { margin-bottom: var(--s-2); }
.nottested { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.nottested li { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-2); padding: 10px 14px; border: 1px dashed var(--line-2); border-radius: var(--r-s); background: var(--untested-soft); color: var(--ink-2); font-size: var(--fs-s); }
.nt-icon { font-family: var(--font-mono); color: var(--untested-ink); font-weight: 600; }
.qa { margin: 0; display: grid; gap: var(--s-3); max-width: 44rem; }
.qa-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s-4); }
.qa dt, .qa dd { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-2); margin: 0; }
.qa dt { color: var(--ink); font-weight: 500; margin-bottom: 6px; }
.qa dt span, .qa dd span { font: 600 var(--fs-xs) var(--font-mono); color: var(--acc-ink); padding-top: 3px; }
.qa dd span { color: var(--good-ink); }
.nextsteps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); counter-reset: ns; }
.nextsteps li { counter-increment: ns; display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); align-items: baseline; padding: 12px 16px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); }
.ns-who { font: 500 var(--fs-xs) var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--acc-ink); background: var(--acc-softer); border-radius: var(--r-pill); padding: 2px 10px; }
.ns-what { color: var(--ink); }
.split { display: grid; gap: var(--s-4); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s-5); box-shadow: var(--shadow-sm); }
.card-title { margin: 0 0 var(--s-2); font-size: var(--fs-l); letter-spacing: -.01em; }
.card > p:last-child { margin-bottom: 0; }
.card-accent { border-color: var(--acc); box-shadow: var(--ring), var(--shadow-md); }
.card-hot { border-color: var(--hot); box-shadow: var(--ring-hot), var(--shadow-md); }
.card-good { border-top: 4px solid var(--good); }
.card-warn { border-color: var(--warn); background: var(--warn-soft); }
.source, .band-body > p.source { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--faint); font-weight: 400; margin-top: var(--s-2); }
.decide-link { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 16px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--acc); box-shadow: var(--ring); color: var(--ink); text-decoration: none; font-size: var(--fs-s); max-width: 100%; }
.decide-link-k { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); }
.decide-link-id { font: 600 var(--fs-s) var(--font-mono); color: var(--on-acc); background: var(--acc); border-radius: 6px; padding: 0 8px; }
.decide-link-t { font-weight: 500; }
.decide-link:hover { background: var(--acc-softer); }
.btn, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--r-pill); font: 500 var(--fs-s) var(--font-sans); cursor: pointer; border: 1px solid var(--acc); }
.btn { background: var(--acc); color: var(--on-acc); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--surface); color: var(--acc-ink); }
.btn:hover { filter: brightness(1.06); } .btn-ghost:hover { background: var(--acc-softer); }

/* ---------------- UL words ---------------- */
.ul { text-decoration: underline; text-decoration-style: dotted; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: help; border-radius: 3px; }
.ul-strong { text-decoration-color: var(--ul-line); }
.ul-soft { text-decoration-color: var(--ul-line-soft); text-decoration-thickness: 1px; }
.ul:hover { background: var(--acc-softer); text-decoration-color: var(--acc); }
.ul-card { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-lg); padding: var(--s-4); font-size: var(--fs-s); }
.ul-crumbs { font: 400 11px var(--font-mono); letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.ul-word { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: var(--fs-l); letter-spacing: -.01em; }
.ul-desc { margin: 6px 0 var(--s-3); color: var(--ink-2); }
.ul-see { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s-3); }
.ul-see .chip { cursor: pointer; }
.ul-more { background: none; border: 0; padding: 0; color: var(--acc-ink); font: 500 var(--fs-s) var(--font-sans); cursor: pointer; min-height: 32px; }
.ul-panel { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: var(--s-5); overflow-y: auto; }
.ul-panel-head { display: flex; justify-content: flex-end; }
.ul-close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 22px; cursor: pointer; }
.ul-panel-word { font-size: var(--fs-2xl); margin: var(--s-2) 0; }
.ul-aliases { font-size: var(--fs-s); color: var(--muted); }
.ul-details { margin-top: var(--s-4); color: var(--ink-2); }
.ul-details p, .ul-details ul { font-size: var(--fs-s); }

/* ---------------- tooltip, toast, hint, storage ---------------- */
.tip { position: fixed; z-index: 80; max-width: min(320px, calc(100vw - 16px)); background: var(--term); color: var(--term-ink); font: 400 var(--fs-xs) var(--font-mono); line-height: 1.5; padding: 8px 12px; border-radius: var(--r-s); box-shadow: var(--shadow-md); pointer-events: none; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--term); color: var(--term-ink); padding: 10px 16px; border-radius: var(--r-pill); box-shadow: var(--shadow-lg); font-size: var(--fs-s); display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); }
.toast-btn { background: var(--acc); color: var(--on-acc); border: 0; border-radius: var(--r-pill); padding: 6px 14px; font: 500 var(--fs-s) var(--font-sans); cursor: pointer; min-height: 36px; }
.hint { position: fixed; z-index: 50; left: 12px; right: 12px; bottom: 12px; max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; background: var(--surface); color: var(--ink-2); border: 1px solid var(--acc); box-shadow: var(--ring), var(--shadow-lg); border-radius: var(--r-m); padding: 12px 14px 12px 16px; font-size: var(--fs-s); }
.hint p { margin: 0; }
.hint-x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; font-size: 20px; }
.storage-warn { position: fixed; z-index: 95; top: 0; left: 0; right: 0; background: var(--warn-soft); color: var(--ink); border-bottom: 2px solid var(--warn); padding: 10px var(--gutter); font-size: var(--fs-s); text-align: center; }

/* ---------------- comment popup ---------------- */
.cbtn { position: fixed; z-index: 85; background: var(--hot-ink); color: var(--on-acc); border: 0; border-radius: var(--r-pill); padding: 0 16px; min-height: 40px; font: 500 var(--fs-s) var(--font-sans); box-shadow: var(--shadow-lg); cursor: pointer; }
.cpop { position: fixed; z-index: 86; width: 380px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--hot); box-shadow: var(--ring-hot), var(--shadow-lg); border-radius: var(--r-l); padding: var(--s-4); }
.cpop-sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-width: none; border-radius: var(--r-l) var(--r-l) 0 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.cpop-k { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--hot-ink); margin-bottom: var(--s-2); }
.cpop-k span { text-transform: none; letter-spacing: 0; color: var(--muted); }
.cpop-quote, .rv-quote { margin: 0 0 var(--s-3); padding: 6px 0 6px 12px; border-left: 3px solid var(--hot); color: var(--ink); font-size: var(--fs-s); max-height: 7.5em; overflow: auto; }
.cpop-text, .q-note textarea, .copy-fallback { width: 100%; font: 400 var(--fs-m) var(--font-sans); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 10px 12px; resize: vertical; }
.cpop-text:focus, .q-note textarea:focus { outline: 2px solid var(--acc); border-color: transparent; }
.cpop-actions { display: flex; gap: var(--s-2); align-items: center; margin-top: var(--s-3); flex-wrap: wrap; }
.cpop-hint { font: 400 var(--fs-xs) var(--font-mono); color: var(--faint); margin-left: auto; }

/* ---------------- code (Code Hike) ---------------- */
.code { margin: 0; border-radius: var(--r-m); background: var(--ch-16); border: 1px solid var(--term-line); box-shadow: var(--shadow-lg); overflow: hidden; max-width: 100%; color: var(--ch-4); }
.code-bar { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px; min-height: 42px; background: var(--ch-22); border-bottom: 1px solid var(--term-line); font: 400 var(--fs-xs) var(--font-mono); color: var(--term-faint); }
.code-dots { display: inline-flex; gap: 6px; } .code-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f56; display: block; }
.code-dots i:nth-child(2) { background: #ffbd2e; } .code-dots i:nth-child(3) { background: #27c93f; }
.code-file { color: var(--term-ink); font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-lang { text-transform: uppercase; letter-spacing: .1em; font-size: 10px; }
.code-copy { background: transparent; color: var(--term-ink); border: 1px solid var(--term-line); border-radius: var(--r-pill); padding: 0 12px; min-height: 30px; font: 500 11px var(--font-mono); cursor: pointer; }
.code-copy:hover { border-color: var(--acc-2); }
.code-pre { margin: 0; padding: 14px 0; overflow-x: auto; font: 400 13px/1.65 var(--font-mono); background: transparent !important; color: var(--ch-4); }
.code-compact .code-pre { font-size: 12.5px; }
.ch-row { display: flex; padding-right: 16px; }
.ch-ln { color: var(--ch-24); text-align: right; padding: 0 12px 0 14px; user-select: none; flex: none; }
.ch-code-line { flex: 1; white-space: pre; }
.ch-mark { background: var(--ch-17); box-shadow: -6px 0 0 0 var(--ch-17), -9px 0 0 0 var(--acc-2); }
.ch-mark-inline { background: var(--ch-17); border-radius: 4px; outline: 1px solid var(--acc-2); }
.has-focus .ch-unfocus { opacity: .5; transition: opacity var(--dur); }
.code:hover .has-focus .ch-unfocus { opacity: .7; }
.ch-diff { display: flex; } .ch-diff-sign { width: 2ch; flex: none; text-align: center; color: var(--term-faint); user-select: none; }
.ch-add { background: var(--ch-12); } .ch-add .ch-diff-sign { color: #7BE3A4; }
.ch-del { background: var(--ch-11); } .ch-del .ch-diff-sign { color: #FF8DBA; }
.ch-callout { position: sticky; left: 12px; margin: 6px 16px 10px; padding: 8px 12px; background: var(--acc); color: var(--on-acc); font: 500 12.5px/1.45 var(--font-sans); border-radius: var(--r-s); white-space: normal; width: max-content; max-width: min(36ch, calc(100% - 32px)); }
.ch-callout-arrow { position: absolute; top: -6px; left: 14px; width: 12px; height: 12px; background: var(--acc); transform: rotate(45deg); }
.ch-link { color: var(--ch-7); text-decoration: underline; text-decoration-color: var(--acc-2); }
.ch-tip { text-decoration: underline dotted var(--ch-5); text-underline-offset: 3px; cursor: help; }
.ch-collapse > summary { list-style: none; cursor: pointer; }
.ch-collapse > summary::-webkit-details-marker { display: none; }
.ch-collapse-trigger { position: relative; }
.ch-collapse-trigger::after { content: "▾"; position: absolute; right: 16px; top: 0; color: var(--term-faint); }
.ch-collapse:not([open]) > .ch-collapse-trigger::after { content: "▸ show"; font: 400 11px var(--font-mono); }
.code-tabs { display: flex; flex-wrap: wrap; border-radius: var(--r-m); overflow: hidden; background: var(--ch-22); border: 1px solid var(--term-line); box-shadow: var(--shadow-lg); }
.code-tab-radio { position: absolute; opacity: 0; pointer-events: none; }
.code-tab { padding: 0 16px; min-height: 42px; display: inline-flex; align-items: center; font: 500 var(--fs-xs) var(--font-mono); color: var(--term-faint); cursor: pointer; border-right: 1px solid var(--term-line); border-bottom: 2px solid transparent; }
.code-tab:hover { color: var(--term-ink); }
.code-tab-panels { flex-basis: 100%; }
.code-tab-panel { display: none; }
.code-tab-panel .code { border: 0; border-radius: 0; box-shadow: none; }
.code-tab-panel .code-bar { display: none; }
.code-tab-radio:focus-visible + .code-tab { outline: 2px solid var(--acc); outline-offset: -2px; }
.code-tabs .code-tab-radio:nth-of-type(1):checked ~ .code-tab-panels .code-tab-panel:nth-child(1),
.code-tabs .code-tab-radio:nth-of-type(2):checked ~ .code-tab-panels .code-tab-panel:nth-child(2),
.code-tabs .code-tab-radio:nth-of-type(3):checked ~ .code-tab-panels .code-tab-panel:nth-child(3),
.code-tabs .code-tab-radio:nth-of-type(4):checked ~ .code-tab-panels .code-tab-panel:nth-child(4),
.code-tabs .code-tab-radio:nth-of-type(5):checked ~ .code-tab-panels .code-tab-panel:nth-child(5) { display: block; }
.code-tab-radio:checked + .code-tab { color: var(--term-ink); background: var(--ch-16); border-bottom-color: var(--acc-2); }
.scrolly { display: grid; gap: var(--s-5); }
.scrolly > *, .scrolly-step, .scrolly-inline, .scrolly-body { min-width: 0; }
.scrolly-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-7); max-width: none; }
.scrolly-step { display: grid; gap: var(--s-3); }
.scrolly-num { font: 600 var(--fs-s) var(--font-mono); color: var(--acc-ink); }
.scrolly-title { margin: 0; font-size: var(--fs-l); letter-spacing: -.01em; }
.scrolly-body p { margin-bottom: var(--s-2); }
.scrolly-sticky { display: none; }

/* ---------------- pictures ---------------- */
.pic-caption { font-size: var(--fs-s); color: var(--muted); margin-top: var(--s-3); }
.filmstrip { margin: 0; }
.filmstrip-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 62%); gap: var(--s-4); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px var(--s-4); }
.frame { scroll-snap-align: start; }
.frame-phone { position: relative; border-radius: 26px; padding: 30px 12px 14px; background: var(--ink); box-shadow: var(--shadow-lg); }
.frame-notch { position: absolute; top: 11px; left: 50%; width: 60px; height: 8px; border-radius: 6px; background: var(--term-line); transform: translateX(-50%); }
.frame-screen { background: var(--surface); border-radius: 16px; min-height: 260px; padding: 14px; font-size: var(--fs-s); color: var(--ink-2); }
.frame-screen > :first-child { margin-top: 0; }
.frame-title { margin-top: var(--s-3); font-weight: 500; color: var(--ink); font-size: var(--fs-s); }
.frame-hot .frame-phone { box-shadow: var(--ring-hot), var(--shadow-lg); } .frame-good .frame-screen { outline: 2px solid var(--good); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-width: 44rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 var(--s-5) 34px; }
.tl-dot { position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--acc); }
.tl-hot .tl-dot { border-color: var(--hot); } .tl-good .tl-dot { border-color: var(--good); } .tl-warn .tl-dot { border-color: var(--warn); }
.tl-when { font: 500 var(--fs-xs) var(--font-mono); color: var(--muted); letter-spacing: .06em; }
.tl-title { color: var(--ink); font-weight: 500; }
.tl-text { color: var(--muted); font-size: var(--fs-s); }
.stack { margin: 0; }
.stack-layers { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; max-width: 40rem; }
.stack-layer { position: relative; padding: 14px 18px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 0 -2px var(--surface-3), var(--shadow-sm); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.stack-label { color: var(--ink); font-weight: 500; }
.stack-sub { grid-column: 1; color: var(--muted); font-size: var(--fs-s); }
.stack-note { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 500 var(--fs-xs) var(--font-mono); color: var(--acc-ink); }
.stack-accent { border-color: var(--acc); box-shadow: 0 6px 0 -2px var(--acc-soft), var(--ring); }
.stack-hot { border-color: var(--hot); box-shadow: 0 6px 0 -2px var(--hot-soft), var(--ring-hot); }
.stack-good { border-left: 4px solid var(--good); }
.ba { margin: 0; }
.ba-stage { position: relative; display: grid; border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.ba-pane { grid-area: 1 / 1; padding: var(--s-5); padding-top: 44px; min-height: 160px; }
.ba-before { background: var(--hot-soft); }
.ba-after { background: var(--good-soft); clip-path: inset(0 0 0 var(--pos)); }
.ba-label { position: absolute; top: 10px; font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); background: var(--surface); padding: 2px 10px; border-radius: var(--r-pill); }
.ba-before .ba-label { left: 10px; } .ba-after .ba-label { right: 10px; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: var(--ink); pointer-events: none; }
.ba-handle span { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); transform: translate(-50%, -50%); }
.ba-range { width: 100%; margin-top: var(--s-3); accent-color: var(--acc); min-height: 32px; }
html:not(.js) .ba-after { clip-path: none; position: relative; } html:not(.js) .ba-range, html:not(.js) .ba-handle { display: none; }
.pipe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pipe-box { padding: 12px 16px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pipe-label { color: var(--ink); font-weight: 500; font-size: var(--fs-s); } .pipe-sub { color: var(--muted); font-size: var(--fs-xs); }
.pipe-accent { border-color: var(--acc); box-shadow: var(--ring); } .pipe-hot { border-color: var(--hot); box-shadow: var(--ring-hot); } .pipe-good { border-color: var(--good); }
.pipe-arrow { color: var(--acc); font: 500 var(--fs-l) var(--font-mono); }

/* ---------------- article, URL anatomy, HTTP chain, where-it-fits ---------------- */
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-5); box-shadow: var(--shadow-sm); max-width: 46rem; }
.article-kicker { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); }
.article-title { margin: 6px 0 0; font-size: var(--fs-l); font-weight: 600; color: var(--ink); line-height: 1.25; }
.article-oneline { margin: var(--s-3) 0 var(--s-4); padding: 10px 14px; border-radius: var(--r-m); background: var(--acc-softer); border-left: 3px solid var(--acc); color: var(--ink); font-weight: 500; max-width: none; }
.article-oneline-k { display: block; font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acc-ink); margin-bottom: 2px; }
.article-body { counter-reset: para; }
.article-body > p, .article-body > ol > li, .article-body > ul > li { color: var(--ink-2); line-height: 1.6; }
.article-body > p { position: relative; padding-left: 16px; margin: 0 0 var(--s-3); max-width: none; border-left: 2px solid var(--line); }
.article-body > p::before { content: none; }
.article-body b, .article-body strong { color: var(--ink); font-weight: 600; }
.article-body code { font: 500 .86em var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere; color: var(--ink); }
.hopref { font: 600 11px var(--font-mono); color: var(--acc-ink); background: var(--acc-softer); border: 1px solid var(--acc-soft); border-radius: var(--r-pill); padding: 5px 10px; display: inline-block; line-height: 1.2; text-decoration: none; white-space: nowrap; vertical-align: .1em; }
.hopref:hover { background: var(--acc-soft); }

.urlana { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-4); box-shadow: var(--shadow-sm); }
.urlana-title { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-3); }
.urlana-url { font: 500 13px/2.1 var(--font-mono); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 12px; overflow-wrap: anywhere; word-break: break-all; }
.ua-seg { border-bottom: 3px solid var(--c, var(--line-2)); padding-bottom: 1px; }
.ua-n { font: 600 9px var(--font-mono); color: var(--muted); margin-right: 1px; vertical-align: super; }
.ua-host { --c: var(--series-1); } .ua-path { --c: var(--series-3); }
.ua-q0 { --c: var(--series-2); } .ua-q1 { --c: var(--series-4); } .ua-q2 { --c: var(--series-5); } .ua-q3 { --c: var(--series-1); } .ua-hash { --c: var(--hot); }
.urlana-parts { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: 10px; max-width: none; }
.urlana-parts li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.ua-badge { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font: 600 11px var(--font-mono); color: var(--ink); background: var(--surface); border: 2px solid var(--c, var(--line-2)); }
.ua-what { display: grid; gap: 2px; min-width: 0; }
.urlana .ua-name, .urlana .ua-val { background: none; border: 0; padding: 0; border-radius: 0; }
.ua-name { font: 600 12.5px var(--font-mono); color: var(--ink); }
.ua-val { font: 400 12px var(--font-mono); color: var(--ink-2); overflow-wrap: anywhere; word-break: break-all; }
.ua-mean { color: var(--ink-2); font-size: var(--fs-s); line-height: 1.45; }
.urlana-note { margin: var(--s-3) 0 0; color: var(--muted); font-size: var(--fs-s); max-width: none; }

.httpchain { margin: 0; }
.httpchain-title { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-3); }
.hc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: none; position: relative; }
.hc-hop { display: grid; grid-template-columns: 40px 1fr; gap: 10px; position: relative; padding-bottom: var(--s-3); scroll-margin-top: 120px; }
.hc-hop:not(:last-child)::before { content: ""; position: absolute; left: 19px; top: 42px; bottom: 0; border-left: 2px dashed var(--line-2); }
.hc-hop:target .hc-body { box-shadow: var(--ring); }
.hc-n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--font-mono); color: var(--on-acc); background: var(--acc); text-decoration: none; }
.hc-hot .hc-n { background: var(--hot-ink); } .hc-good .hc-n { background: var(--good-ink); }
.hc-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 12px; box-shadow: var(--shadow-sm); min-width: 0; display: grid; gap: 6px; }
.hc-who { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 500; color: var(--ink); font-size: var(--fs-s); }
.hc-arrow { color: var(--acc-ink); }
.hc-req, .hc-hdr { display: flex; gap: 8px; align-items: baseline; font: 400 12px/1.5 var(--font-mono); color: var(--ink); min-width: 0; }
.hc-req code, .hc-hdr code { overflow-wrap: anywhere; word-break: break-all; min-width: 0; }
.hc-method { flex: none; font-weight: 600; color: var(--acc-ink); }
.hc-k { flex: none; color: var(--muted); }
.hc-res { display: grid; gap: 4px; padding: 8px 10px; border-radius: var(--r-s); background: var(--surface-2); }
.hc-status { justify-self: start; font: 600 11.5px var(--font-mono); padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid; }
.st-redir { color: var(--acc-ink); border-color: var(--acc-soft); background: var(--acc-softer); }
.st-ok { color: var(--good-ink); border-color: transparent; background: var(--good-soft); }
.st-bad { color: var(--hot-ink); border-color: transparent; background: var(--hot-soft); }
.st-other { color: var(--ink); border-color: var(--line); }
.hc-why { margin: 0; color: var(--ink-2); font-size: var(--fs-s); line-height: 1.45; max-width: none; }

.fitcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-5); box-shadow: var(--shadow-md); }
.fit-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: var(--s-3); }
.fit-k { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); }
.fit-name { font-weight: 600; font-size: var(--fs-l); color: var(--ink); }
.fit-rows { margin: 0; display: grid; gap: 0; }
.fit-rows > div { display: grid; grid-template-columns: 8.5em 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.fit-rows dt { font: 500 11.5px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fit-rows dd { margin: 0; color: var(--ink); font-size: var(--fs-s); line-height: 1.45; }
.fit-spof { margin-top: var(--s-3); display: grid; grid-template-columns: auto auto 1fr; gap: 4px 10px; align-items: baseline; padding: 10px 14px; border-radius: var(--r-m); }
.fit-spof-k { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.fit-spof span:last-child { grid-column: 1 / -1; color: var(--ink); font-size: var(--fs-s); }
.fit-yes { background: var(--hot-soft); } .fit-yes b { color: var(--hot-ink); }
.fit-partly { background: var(--warn-soft, var(--hot-soft)); } .fit-partly b { color: var(--warn-ink); }
.fit-no { background: var(--good-soft); } .fit-no b { color: var(--good-ink); }
@media (max-width: 719px) { .fit-rows > div { grid-template-columns: 1fr; gap: 2px; } .article { padding: var(--s-4); } .article-body > p { padding-left: 12px; } }

/* ---------------- regions, mesh, icon cards ---------------- */
.regions { margin: 0; }
.rg-grid { display: grid; gap: var(--s-3); }
.rg-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-4); box-shadow: var(--shadow-md); }
.rg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 600; color: var(--ink); font-size: var(--fs-l); margin-bottom: var(--s-3); }
.rg-pin { width: 12px; height: 12px; border-radius: 50%; background: var(--acc); box-shadow: var(--ring); }
.rg-sub { font: 400 var(--fs-xs) var(--font-mono); color: var(--muted); }
.rg-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rg-row { padding: 8px 12px; border-radius: var(--r-s); background: var(--surface-2); color: var(--ink); font-size: var(--fs-s); border-left: 3px solid var(--line-2); }
.rg-accent { border-left-color: var(--acc); background: var(--acc-softer); } .rg-hot { border-left-color: var(--hot); background: var(--hot-soft); } .rg-good { border-left-color: var(--good); background: var(--good-soft); }
.rg-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: center; justify-items: center; }
.rg-link { display: flex; align-items: center; gap: 8px; font: 500 var(--fs-xs) var(--font-mono); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 12px; box-shadow: var(--shadow-sm); }
.rg-arrow { color: var(--acc); font-size: var(--fs-m); transform: rotate(90deg); display: inline-block; }
.rg-link-hot .rg-arrow { color: var(--hot); } .rg-link-good .rg-arrow { color: var(--good-ink); }
@media (min-width: 720px) { .rg-grid { grid-template-columns: 1fr auto 1fr; align-items: center; } .rg-arrow { transform: none; } }
.mesh { margin: 0; max-width: 460px; }
.mesh svg { width: 100%; height: auto; display: block; }
.mesh-link line { stroke: var(--series-1); stroke-width: 2; }
.mesh-head { fill: var(--series-1); }
.mesh-link text { font: 500 9px var(--font-mono); fill: var(--ink); }
.mesh-node rect { fill: var(--surface); stroke: var(--acc); stroke-width: 2; }
.mesh-hot rect { stroke: var(--hot); } .mesh-good rect { stroke: var(--good); }
.mesh-label { font: 600 10.5px var(--font-sans); fill: var(--ink); }
.mesh-sub { font: 400 8.5px var(--font-mono); fill: var(--muted); }
.mesh-center { font: 600 12px var(--font-mono); fill: var(--acc-ink); }
html.js .mesh[data-reveal] .mesh-link line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--dur-slow) var(--ease) 200ms; }
html.js .mesh[data-reveal].in-view .mesh-link line { stroke-dashoffset: 0; }
.iconcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); max-width: none; }
.iconcard { display: grid; gap: 4px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s-4); box-shadow: var(--shadow-sm); }
.ic-glyph { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font: 600 22px var(--font-mono); color: var(--acc-ink); background: var(--acc-softer); border: 1px solid var(--acc-soft); margin-bottom: 6px; }
.ic-hot .ic-glyph { color: var(--hot-ink); background: var(--hot-soft); border-color: transparent; } .ic-good .ic-glyph { color: var(--good-ink); background: var(--good-soft); border-color: transparent; }
.ic-title { color: var(--ink); font-weight: 500; }
.ic-text { color: var(--muted); font-size: var(--fs-s); line-height: 1.45; }

/* ---------------- flow player ---------------- */
.flow { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-md); padding: var(--s-5) var(--s-4); }
.flow-title { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-4); }
.flow-stage { position: relative; height: 196px; margin: 0 4px; }
.flow-rail { position: absolute; left: 6%; right: 6%; top: 62px; height: 2px; background: var(--line); }
.flow-actor { position: absolute; z-index: 2; top: 42px; transform: translateX(-50%); width: 28%; max-width: 160px; text-align: center; }
.flow-node { width: 40px; height: 40px; margin: 0 auto 8px; border-radius: 12px; background: var(--surface-2); border: 2px solid var(--line-2); transition: border-color var(--dur), background var(--dur); }
.flow-actor.is-on .flow-node { border-color: var(--acc); background: var(--acc-softer); }
.flow-actor-label { color: var(--ink); font-weight: 500; font-size: var(--fs-s); line-height: 1.25; }
.flow-actor-sub { color: var(--muted); font-size: 12px; line-height: 1.3; }
.flow-state { display: inline-block; margin-top: 6px; font: 500 11px var(--font-mono); padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.flow-self .flow-node { box-shadow: var(--ring); }
.flow-self.flow-hot .flow-node { border-color: var(--hot); background: var(--hot-soft); box-shadow: var(--ring-hot); }
.flow-self-label { position: absolute; top: -40px; z-index: 3; background: var(--surface); padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--line); left: 50%; transform: translateX(-50%); white-space: nowrap; font: 500 11px var(--font-mono); color: var(--acc-ink); }
.flow-arrow { position: absolute; z-index: 1; top: calc(61px + var(--lane, 0px)); height: 4px; background: currentColor; color: var(--acc); border-radius: 2px; }
.flow-arrow.flow-hot { color: var(--hot); } .flow-arrow.flow-good { color: var(--good); }
.flow-arrow[data-dir="r"]::after, .flow-arrow[data-dir="l"]::after { content: ""; position: absolute; top: -5px; border: 7px solid transparent; }
.flow-arrow[data-dir="r"]::after { right: 14px; border-left: 10px solid currentColor; }
.flow-arrow[data-dir="l"]::after { left: 14px; border-right: 10px solid currentColor; }
.flow-arrow-label { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 3; box-shadow: var(--shadow-sm); font: 500 11px var(--font-mono); color: var(--ink); background: var(--surface); padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--line); max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }
.flow-dot { position: absolute; z-index: 4; top: calc(55px + var(--lane, 0px)); width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 5px color-mix(in srgb, var(--acc) 22%, transparent); animation: flow-move var(--dur-slow) var(--ease) both; }
.flow-dot.flow-hot { background: var(--hot); box-shadow: 0 0 0 5px color-mix(in srgb, var(--hot) 22%, transparent); }
.flow-dot.flow-good { background: var(--good); }
@keyframes flow-move { from { left: var(--x1); } to { left: var(--x2); } }
.flow-arrow.is-past { opacity: .7; height: 3px; background: repeating-linear-gradient(90deg, currentColor 0 7px, transparent 7px 12px); }
.flow-arrow.is-past::after { display: none; }
.flow-trail { display: inline-flex; align-items: center; gap: 6px; font: 500 var(--fs-xs) var(--font-mono); color: var(--ink-2); min-height: 44px; cursor: pointer; white-space: nowrap; }
.flow-controls .flow-trail input { accent-color: var(--acc); width: 18px; height: 18px; min-width: 0; min-height: 0; flex: none; margin: 0; }
.flow-map .flow-controls { flex-wrap: wrap; }

/* sequence layout: actors are columns, time goes down, one row per step */
.seq { --gut: 30px; position: relative; margin: 0 0 var(--s-2); }
.seq-head { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); margin-left: var(--gut); gap: 4px; position: relative; z-index: 2; }
.seq-actor { text-align: center; padding: 8px 4px; border-radius: var(--r-m); background: var(--surface-2); border: 2px solid var(--line-2); min-width: 0; transition: border-color var(--dur), background var(--dur); }
.seq-actor.is-on { border-color: var(--acc); background: var(--acc-softer); }
.seq-actor-label { color: var(--ink); font-weight: 500; font-size: var(--fs-s); line-height: 1.2; hyphens: auto; -webkit-hyphens: auto; }
.seq-actor-sub { color: var(--muted); font-size: 12px; line-height: 1.25; hyphens: auto; -webkit-hyphens: auto; }
@media (max-width: 719px) { .seq { --gut: 26px; } .seq-head { gap: 3px; } .seq-actor { padding: 6px 1px; } .seq-actor-label { font-size: 12.5px; } .seq-actor-sub { font-size: 10.5px; letter-spacing: -.01em; } }
.seq-body { position: relative; padding: var(--s-2) 0 var(--s-3); min-height: 40px; }
.seq-lifelines { position: absolute; inset: 0 0 0 var(--gut); pointer-events: none; }
.seq-lifelines span { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--line-2); transform: translateX(-1px); }
.seq-row { position: relative; display: grid; grid-template-columns: var(--gut) 1fr; align-items: end; padding: 6px 0 4px; }
.seq-row.is-past .seq-arrow, .seq-row.is-past .seq-self { opacity: .35; }
.seq-row.is-past .seq-label { color: var(--muted); font-weight: 400; }
.seq-n { align-self: end; font: 600 11px var(--font-mono); color: var(--muted); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: -2px; }
.seq-row.is-on .seq-n { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.seq-row.is-on.flow-hot .seq-n { background: var(--hot-ink); border-color: var(--hot-ink); }
.seq-lane { position: relative; min-width: 0; }
.seq-label { font: 500 11.5px/1.35 var(--font-mono); color: var(--ink); padding: 0 2px 6px; overflow-wrap: anywhere; position: relative; z-index: 3; }
.seq-label > span { background: var(--surface); padding: 0 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.seq-row.is-on .seq-label { font-weight: 600; }
.seq-track { position: relative; height: 16px; }
.seq-arrow { position: absolute; top: 6px; height: 3px; background: currentColor; color: var(--acc); border-radius: 2px; }
.seq-row.flow-hot .seq-arrow, .seq-row.flow-hot .seq-self { color: var(--hot); } .seq-row.flow-good .seq-arrow, .seq-row.flow-good .seq-self { color: var(--good); }
.seq-row.is-past .seq-arrow { height: 2px; top: 7px; }
.seq-arrow::after { content: ""; position: absolute; top: -5px; border: 6.5px solid transparent; }
.seq-arrow[data-dir="r"]::after { right: -2px; border-left: 9px solid currentColor; }
.seq-arrow[data-dir="l"]::after { left: -2px; border-right: 9px solid currentColor; }
.seq-self { position: absolute; top: 0; width: 16px; height: 16px; margin-left: -8px; border-radius: 5px; border: 3px solid currentColor; color: var(--acc); background: var(--surface); }
.seq-track .flow-dot { top: 0; }
.flow-caption { min-height: 3.2em; margin: var(--s-2) 0 var(--s-3); color: var(--ink); font-size: var(--fs-m); font-weight: 400; display: flex; gap: 10px; align-items: baseline; max-width: none; }
.flow-hop { font: 600 11px var(--font-mono); color: var(--acc-ink); background: var(--acc-softer); border: 1px solid var(--acc-soft); border-radius: var(--r-pill); padding: 1px 8px; margin-right: 8px; white-space: nowrap; vertical-align: .1em; }
.flow-count { font: 500 var(--fs-xs) var(--font-mono); color: var(--acc-ink); flex: none; }
.flow-cap-hot { color: var(--hot-ink); }
.flow-controls { display: flex; gap: 8px; align-items: center; }
.flow-controls button { min-width: 44px; min-height: 44px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 500 var(--fs-s) var(--font-sans); cursor: pointer; padding: 0 14px; }
.flow-controls button:disabled { opacity: .4; cursor: default; }
.flow-controls .flow-play { background: var(--acc); color: var(--on-acc); border-color: var(--acc); min-width: 92px; }
.flow-controls input { flex: 1; min-width: 60px; accent-color: var(--acc); min-height: 32px; }
.flow-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: 2px; max-width: none; }
.flow-list button { width: 100%; display: grid; grid-template-columns: 26px 1fr; gap: 8px; text-align: left; background: none; border: 0; border-radius: var(--r-s); padding: 8px 8px; color: var(--muted); font: 300 var(--fs-s)/1.45 var(--font-sans); cursor: pointer; min-height: 40px; }
.flow-list-n { font: 500 var(--fs-xs) var(--font-mono); color: var(--faint); padding-top: 2px; }
.flow-list .is-past button { color: var(--ink-2); }
.flow-list .is-on button { background: var(--acc-softer); color: var(--ink); font-weight: 400; }
.flow-list .is-on .flow-list-n { color: var(--acc-ink); }

/* ---------------- calculator ---------------- */
.calc { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-md); padding: var(--s-5) var(--s-4); }
.calc-title { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-4); }
.calc-inputs { display: grid; gap: var(--s-4); margin-bottom: var(--s-5); }
.calc-input { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; border: 0; padding: 0; margin: 0; min-width: 0; }
.calc-label { color: var(--ink-2); font-size: var(--fs-s); padding: 0; }
.calc-value { font: 600 var(--fs-s) var(--font-mono); color: var(--acc-ink); }
.calc-input input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--acc); min-height: 32px; }
.calc-choice .seg { grid-column: 1 / -1; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: var(--r-pill); padding: 0 14px; min-height: 38px; font: 400 var(--fs-s) var(--font-sans); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }
.calc-out .chart { margin-top: var(--s-4); box-shadow: none; border-style: dashed; }
.calc-note { font-size: var(--fs-s); color: var(--muted); margin-top: var(--s-3); }
.tiles-calc { grid-template-columns: 1fr; }
@media (min-width: 720px) { .tiles-calc { grid-template-columns: repeat(3, 1fr); } }

/* ---------------- charts ---------------- */
.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-5) var(--s-4); box-shadow: var(--shadow-sm); }
.chart-head { margin-bottom: var(--s-4); }
.chart-title { color: var(--ink); font-weight: 500; font-size: var(--fs-m); line-height: 1.35; }
.chart-sub { color: var(--muted); font-size: var(--fs-s); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 0 0 var(--s-3); font: 400 var(--fs-xs) var(--font-mono); color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 6px; }
.bars { display: grid; gap: var(--s-3); }
.bars-tight { gap: var(--s-2); }
.bar-label { font-size: var(--fs-s); color: var(--ink); margin-bottom: 4px; }
.bar-note { color: var(--muted); }
.bar-track { position: relative; min-height: 18px; margin-bottom: 3px; padding-right: 8.5em; }
.bar-fill { position: relative; height: 14px; }
.bar-ink, .stack-ink { display: flex; gap: 2px; height: 100%; width: 100%; border-radius: 0 4px 4px 0; transform-origin: left center; overflow: hidden; }
.bar-fill .bar-value { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 8px; }
.bar-ink:hover, .stack-seg:hover { filter: brightness(1.08); }
.bar-value { font: 500 var(--fs-xs) var(--font-mono); color: var(--ink); white-space: nowrap; line-height: 1; }
.bar-unit { color: var(--muted); font-weight: 400; }
.bar-hl .bar-label { font-weight: 600; color: var(--ink); } .bar-hl .bar-ink { box-shadow: var(--ring); }
.stack-seg { height: 100%; min-width: 2px; }

.line-plot { position: relative; padding: 0 92px 34px 44px; }
.line-area { position: relative; height: 100%; }
.line-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.axis-line { stroke: var(--axis); stroke-width: 1; vector-effect: non-scaling-stroke; }
.line-path { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.y-tick { position: absolute; left: -44px; width: 38px; text-align: right; transform: translateY(-50%); font: 400 11px var(--font-mono); color: var(--muted); }
.line-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--surface); cursor: pointer; }
.line-dot::after { content: ""; position: absolute; inset: -10px; }
.line-end { position: absolute; left: calc(100% + 8px); transform: translateY(-50%); font: 500 11px/1.25 var(--font-mono); color: var(--ink); width: 84px; }
.x-ticks { position: absolute; left: 44px; right: 92px; bottom: 12px; height: 16px; }
.x-ticks span { position: absolute; transform: translateX(-50%); font: 400 11px var(--font-mono); color: var(--muted); }
.x-label { position: absolute; bottom: -6px; left: 44px; right: 92px; text-align: center; font: 400 11px var(--font-mono); color: var(--muted); }
.multiples { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-5); }
.multiple-title { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-2); }
.chart-table { margin-top: var(--s-4); }
.chart-table summary { cursor: pointer; font: 500 var(--fs-xs) var(--font-mono); color: var(--acc-ink); min-height: 32px; display: flex; align-items: center; }
.chart-table .compare-wrap { margin-top: var(--s-2); box-shadow: none; }

/* ---------------- globe ---------------- */
.globe { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-4); box-shadow: var(--shadow-sm); }
.globe-stage { position: relative; aspect-ratio: 2 / 1; }
.globe-2d { width: 100%; height: 100%; display: block; }
.globe-grid { stroke: var(--grid); stroke-width: .6; }
.globe-arc { fill: none; stroke: var(--series-1); stroke-width: 1.6; stroke-dasharray: 4 3; }
.globe-arc-label { font: 500 8px var(--font-mono); fill: var(--ink); }
.globe-pt circle { fill: var(--series-1); stroke: var(--surface); stroke-width: 1.5; }
.globe-pt.globe-hot circle { fill: var(--series-2); }
.globe-pt text { font: 500 9px var(--font-sans); fill: var(--ink); }
.globe-3d { position: absolute; inset: 0; display: none; }
.globe-3d.on, .globe-3d:has(canvas) { display: block; }
.globe-stage:has(.globe-3d canvas) .globe-2d { visibility: hidden; }
.globe-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }

/* ---------------- decide page ---------------- */
.decide { display: grid; gap: var(--s-7); margin-top: var(--s-6); }
.q { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-l); padding: var(--s-5) var(--s-4); box-shadow: var(--shadow-md); margin: 0; min-width: 0; scroll-margin-top: 130px; }
.q.is-answered { border-color: var(--good); }
.q-head { display: flex; align-items: center; gap: 12px; padding: 0; float: left; width: 100%; margin-bottom: var(--s-4); }
.q-head + * { clear: both; }
.q-id { font: 600 var(--fs-m) var(--font-mono); color: var(--on-acc); background: var(--acc); padding: 2px 10px; border-radius: 8px; flex: none; }
.q.is-answered .q-id { background: var(--good-ink); }
.q-title { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: var(--fs-xl); letter-spacing: -.02em; line-height: 1.2; }
.q-premise { background: var(--surface-2); border-radius: var(--r-m); padding: var(--s-4); margin-bottom: var(--s-4); }
.q-premise p, .q-premise li { font-size: var(--fs-s); }
.q-premise :last-child { margin-bottom: 0; }
.q-more { margin-top: var(--s-3); }
.q-more summary { cursor: pointer; font: 500 var(--fs-xs) var(--font-mono); color: var(--acc-ink); min-height: 36px; display: flex; align-items: center; }
.q-question { font-size: var(--fs-l); color: var(--ink); font-weight: 400; line-height: 1.45; }
.q-kind { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-3); }
.opts { display: grid; gap: var(--s-3); }
.opt { display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-m); border: 1.5px solid var(--line); cursor: pointer; background: var(--surface); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.opt:hover { border-color: var(--acc-2); }
.opt input { width: 22px; height: 22px; margin: 4px 0 0; accent-color: var(--acc); }
.opt:has(input:checked) { border-color: var(--acc); box-shadow: var(--ring); background: var(--acc-softer); }
.opt-rec { border-style: dashed; border-color: var(--acc-2); }
.opt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.opt-idlabel { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: baseline; flex: 1 1 14rem; }
.opt-id { font: 600 var(--fs-s) var(--font-mono); color: var(--acc-ink); }
.opt-label { color: var(--ink); font-weight: 500; }
.opt-rec-chip { font: 500 10px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--on-acc); background: var(--acc); padding: 2px 8px; border-radius: var(--r-pill); }
.opt-detail p { font-size: var(--fs-s); margin-bottom: var(--s-2); }
.opt-why { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.why { border-radius: var(--r-s); padding: 8px 12px; font-size: var(--fs-s); }
.why ul { margin: 0; padding-left: 18px; }
.why li { margin: 2px 0; }
.why-k { font: 500 10px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 2px; }
.why-for { background: var(--good-soft); } .why-for .why-k { color: var(--good-ink); }
.why-against { background: var(--hot-soft); } .why-against .why-k { color: var(--hot-ink); }
.q-rec { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-left: 3px solid var(--acc); background: var(--acc-softer); border-radius: 0 var(--r-s) var(--r-s) 0; font-size: var(--fs-s); color: var(--ink-2); }
.q-note { display: grid; gap: 6px; margin-top: var(--s-4); }
.q-note span { font-size: var(--fs-s); color: var(--muted); }
.review, .copyout { padding-top: var(--band-gap); }
.empty { color: var(--muted); }
.rv-group { margin-top: var(--s-5); }
.rv-page { font-size: var(--fs-l); margin: 0 0 var(--s-3); }
.rv-n { color: var(--muted); font-weight: 400; }
.rv-item { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s-4) 56px var(--s-4) var(--s-4); margin-bottom: var(--s-3); box-shadow: var(--shadow-sm); }
.rv-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--hot-ink); font-size: 22px; line-height: 1; cursor: pointer; }
.rv-x:hover { background: var(--hot-soft); border-color: var(--hot); }
.rv-sec { font: 500 var(--fs-xs) var(--font-mono); color: var(--muted); margin-bottom: 4px; }
.rv-text { color: var(--ink); margin: 0 0 var(--s-2); }
.rv-actions { display: flex; gap: var(--s-4); font-size: var(--fs-s); }
.rv-edit { background: none; border: 0; color: var(--acc-ink); font: 400 var(--fs-s) var(--font-sans); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.copy-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin: var(--s-4) 0; }
.copy-status { font-size: var(--fs-s); color: var(--good-ink); }
.copy-preview { background: var(--term); color: var(--term-ink); border-radius: var(--r-m); padding: var(--s-4); font: 400 12.5px/1.6 var(--font-mono); white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; border: 1px solid var(--term-line); }

/* ---------------- pager + footer ---------------- */
.pager { max-width: var(--page-max); margin: 0 auto; padding: var(--s-8) var(--gutter) var(--s-5); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.pager-card { display: grid; gap: 4px; padding: var(--s-4); border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; min-height: 88px; }
.pager-next { text-align: right; border-color: var(--acc); box-shadow: var(--ring), var(--shadow-sm); }
.pager-k { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); }
.pager-t { color: var(--ink); font-weight: 500; font-size: var(--fs-s); line-height: 1.35; }
.foot { max-width: var(--page-max); margin: 0 auto; padding: var(--s-5) var(--gutter) var(--s-9); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-xs); }
.foot p { max-width: none; font-family: var(--font-mono); margin-top: var(--s-3); }
.foot-tags { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.foot-tags .tag { margin-left: 8px; } .foot-tags .tag:first-child { margin-left: 0; }

/* ---------------- motion: reveal once ---------------- */
html.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); transition-delay: calc(var(--i, 0) * var(--stagger)); }
html.js [data-reveal].in-view { opacity: 1; transform: none; }
html.js .chart[data-reveal] .bar-ink { transform: scaleX(0); transition: transform var(--dur-slow) var(--ease); transition-delay: calc(var(--d, 0ms) + 120ms); }
html.js .chart[data-reveal].in-view .bar-ink { transform: none; }
html.js .chart[data-reveal] .line-svg { clip-path: inset(0 100% 0 0); transition: clip-path var(--dur-slow) var(--ease-in-out) 150ms; }
html.js .chart[data-reveal].in-view .line-svg { clip-path: inset(0 0 0 0); }
.calc .bar-fill { transition: width var(--dur) var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  html.js [data-reveal] { opacity: 1; transform: none; }
  html.js .chart[data-reveal] .bar-ink { transform: none; }
  html.js .chart[data-reveal] .line-svg { clip-path: none; }
  html.js .mesh[data-reveal] .mesh-link line { stroke-dashoffset: 0; }
}

@media (max-width: 719px) {
  .ch-code-line { white-space: pre-wrap; overflow-wrap: anywhere; }
  .ch-row { padding-right: 10px; }
  .pipe { flex-direction: column; align-items: stretch; }
  .pipe-arrow { align-self: center; transform: rotate(90deg); line-height: 1; }
  .compare-cards .compare, .compare-cards tbody, .compare-cards tr, .compare-cards th, .compare-cards td { display: block; width: 100%; }
  .compare-cards .compare { min-width: 0; }
  .compare-cards thead { display: none; }
  .compare-cards caption { display: block; width: auto; }
  .compare-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .compare-cards tr:last-child { border-bottom: 0; }
  .compare-cards tbody th { padding: 0 0 4px; border: 0; font-size: var(--fs-m); }
  .compare-cards td { padding: 2px 0; border: 0; display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; }
  .compare-cards td::before { content: attr(data-label); font: 500 11px/1.6 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .compare-cards .pick { background: transparent; color: var(--acc-ink); font-weight: 500; }
  .ch-callout { margin-left: 12px !important; width: max-content; max-width: min(34ch, calc(100vw - 80px)); }
  .compare { font-size: .875rem; }
  .compare th, .compare td { padding: 10px 10px; hyphens: auto; -webkit-hyphens: auto; }
}

/* ---------------- wider screens ---------------- */
@media (min-width: 720px) {
  .split { grid-template-columns: 1fr 1fr; }
  .flow { padding: var(--s-6); } .calc { padding: var(--s-6); } .chart { padding: var(--s-6); } .q { padding: var(--s-6); }
  .flow-stage { height: 168px; }
  .flow-actor-sub { font-size: 13px; }
  .opt-why { grid-template-columns: 1fr 1fr; }
  .calc-inputs { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .filmstrip-track { grid-auto-columns: 240px; }
  .bar-track { min-height: 20px; }
  .bar-fill { height: 18px; }
}
@media (min-width: 1100px) {
  .band-body { max-width: 56rem; }
  .scrolly { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; gap: var(--s-7); }
  .scrolly-inline { display: none; }
  .scrolly-step { min-height: 46vh; opacity: .45; transition: opacity var(--dur); }
  .scrolly-step.is-on, .scrolly-step:first-child:not(.is-on):only-child { opacity: 1; }
  html:not(.js) .scrolly-step { opacity: 1; }
  .scrolly-sticky { display: grid; grid-template-columns: minmax(0, 1fr); position: sticky; top: 140px; }
  .scrolly-code { min-width: 0; }
  .scrolly-code { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity var(--dur); }
  .scrolly-code[data-active] { opacity: 1; visibility: visible; }
}
@media (max-width: 380px) { .pager { grid-template-columns: 1fr; } .pager-next { text-align: left; } }
@media print { .top, .pager, .hint, .cbtn, .toast { display: none !important; } body::before { display: none; } }

/* ---------- DocShelf: browse a docs tree, full docs readable in place ---------- */
.docshelf { margin: var(--s-5) 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-sm); padding: var(--s-4); }
.ds-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-bottom: var(--s-3); }
.ds-k { font: 600 var(--fs-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); }
.ds-count { font: 500 12px var(--font-mono); color: var(--muted); margin-left: auto; }
.ds-list { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px dashed var(--line-2); }
.ds-root { padding-left: 0; border-left: 0; }
.ds-dir > details > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 4px; min-height: 40px; box-sizing: border-box; }
.ds-dir > details > summary { list-style: none; }
.ds-dir > details > summary::-webkit-details-marker { display: none; }
.ds-dir > details > summary::before { content: "▸"; color: var(--acc-ink); font-size: 12px; width: 12px; }
.ds-dir > details[open] > summary::before { content: "▾"; }
.ds-dirname { font: 600 14px var(--font-mono); color: var(--ink); }
.ds-dirlabel { font-size: var(--fs-xs); color: var(--ink-2); flex: 1 1 12rem; }
.ds-file { padding: 6px 4px; border-top: 1px solid var(--line); }
.ds-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.ds-name { font-weight: 500; color: var(--ink); }
.ds-type, .ds-chip { font: 500 11px var(--font-mono); letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 1px 8px; }
.ds-chip-full { color: var(--acc-ink); background: var(--acc-softer); border-color: var(--acc-soft); }
.ds-desc { flex-basis: 100%; font-size: var(--fs-s); color: var(--ink-2); line-height: 1.45; }
.ds-file-full > details > summary { cursor: pointer; list-style: none; display: grid; gap: 6px; padding: 4px 0; }
.ds-file-full > details > summary::-webkit-details-marker { display: none; }
.ds-open { justify-self: start; font: 600 12px var(--font-mono); color: var(--on-acc); background: var(--acc); border-radius: var(--r-pill); padding: 10px 14px; min-height: 40px; box-sizing: border-box; display: inline-flex; align-items: center; }
.ds-file-full > details[open] > summary .ds-open::after { content: " (open)"; }
.ds-doc { margin: var(--s-3) 0 var(--s-2); padding: var(--s-4); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-m); min-width: 0; overflow-wrap: anywhere; }
.ds-path code { font: 500 12px var(--font-mono); color: var(--muted); }
.ds-title { font-family: var(--font-display); font-size: var(--fs-l, 1.3rem); margin: 6px 0 var(--s-3); color: var(--ink); }
.ds-meta { margin: 0 0 var(--s-4); padding: var(--s-3); border: 1px dashed var(--acc-2); border-radius: var(--r-m); background: var(--surface); display: grid; gap: 6px; }
.ds-meta-k { font: 600 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); }
.ds-meta-row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; font-size: 13px; }
.ds-meta-row dt { font: 600 12px var(--font-mono); color: var(--ink); }
.ds-meta-row dd { margin: 0; color: var(--ink-2); min-width: 0; }
.ds-meta-row ul { margin: 0; padding: 0; list-style: none; }
.ds-meta-row code { font: 500 12px var(--font-mono); overflow-wrap: anywhere; }
.ds-body { font-size: var(--fs-s); line-height: 1.6; color: var(--ink-2); }
.ds-body h2 { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); margin: var(--s-4) 0 var(--s-2); }
.ds-body h3 { font-size: 1rem; color: var(--ink); margin: var(--s-3) 0 var(--s-2); }
.ds-body p { margin: 0 0 var(--s-3); max-width: none; }
.ds-body ul, .ds-body ol { padding-left: 1.2em; margin: 0 0 var(--s-3); }
.ds-body strong { color: var(--ink); }
.ds-body code { font: 500 .88em var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; overflow-wrap: anywhere; color: var(--ink); }
.ds-body pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: var(--s-3); overflow-x: auto; max-width: 100%; }
.ds-body pre code { border: 0; background: none; padding: 0; white-space: pre; overflow-wrap: normal; }
.ds-body table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 0 0 var(--s-3); display: block; overflow-x: auto; }
.ds-body th, .ds-body td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.ds-body th { background: var(--surface-2); color: var(--ink); }
.ds-link { color: var(--acc-ink); }
@media (max-width: 719px) { .docshelf { padding: var(--s-3); } .ds-list { padding-left: 8px; } .ds-meta-row { grid-template-columns: 1fr; gap: 2px; } .ds-doc { padding: var(--s-3); } }

/* ---------- docs mode: doc pages, meta block, maps, crumbs ---------- */
.hero-doc { padding-bottom: var(--s-4); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 6px; padding: 0; margin: 0 0 var(--s-3); font: 500 12.5px var(--font-mono); }
.crumbs li + li::before { content: "/"; color: var(--faint); margin-right: 6px; }
.crumbs a { color: var(--acc-ink); text-decoration: none; display: inline-block; padding: 10px 0; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: var(--muted); display: inline-block; padding: 10px 0; }
.main-doc .hero-title { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
.doc { max-width: 46rem; margin: 0 auto; padding: 0 var(--gutter, 16px) var(--s-6); min-width: 0; }
.doc-body { color: var(--ink-2); line-height: 1.7; font-size: var(--fs-m, 1.05rem); overflow-wrap: anywhere; }
.doc-body > * { max-width: 100%; }
.doc-body h2 { font-family: var(--font-display); color: var(--ink); font-size: 1.45rem; line-height: 1.25; margin: var(--s-6) 0 var(--s-3); }
.doc-body h3 { color: var(--ink); font-size: 1.15rem; margin: var(--s-5) 0 var(--s-2); }
.doc-body p { margin: 0 0 var(--s-3); }
.doc-body ul, .doc-body ol { padding-left: 1.3em; margin: 0 0 var(--s-3); }
.doc-body li { margin: 4px 0; }
.doc-body strong { color: var(--ink); }
.doc-body a { color: var(--acc-ink); }
.doc-body a.doc-deadlink { color: var(--muted); text-decoration: dotted underline; }
.doc-body :not(pre) > code { font: 500 .86em var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; color: var(--ink); }
.doc-body table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 0 0 var(--s-4); display: block; overflow-x: auto; }
.doc-body th, .doc-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc-body th { background: var(--surface-2); color: var(--ink); }
.doc-body blockquote { margin: 0 0 var(--s-3); padding: var(--s-2) var(--s-4); border-left: 3px solid var(--acc-2); background: var(--surface); border-radius: 0 var(--r-s) var(--r-s) 0; }
.doc-meta { margin: 0 0 var(--s-5); border: 1px dashed var(--acc-2); border-radius: var(--r-m); background: var(--surface); }
.doc-meta > summary { cursor: pointer; padding: 10px var(--s-4); min-height: 40px; box-sizing: border-box; font: 600 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); }
.doc-meta-hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); margin-left: 8px; }
.doc-meta dl { margin: 0; padding: 0 var(--s-4) var(--s-3); display: grid; gap: 6px; }
.doc-meta-row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; font-size: 13px; }
.doc-meta-row dt { font: 600 12px var(--font-mono); color: var(--ink); }
.doc-meta-row dd { margin: 0; min-width: 0; color: var(--ink-2); }
.doc-meta-row ul { list-style: none; margin: 0; padding: 0; }
.doc-meta-row code { font: 500 12px var(--font-mono); overflow-wrap: anywhere; }
.doc-meta-row a { color: var(--acc-ink); font: 500 12px var(--font-mono); overflow-wrap: anywhere; }
.doc-map-h { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); margin: var(--s-5) 0 var(--s-2); }
.doc-map-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.doc-map-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.doc-map-list a { font-weight: 600; color: var(--acc-ink); padding: 6px 0; }
.doc-map-n, .doc-map-t { font: 500 11px var(--font-mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 1px 8px; }
.doc-map-d { flex-basis: 100%; font-size: var(--fs-s); color: var(--ink-2); line-height: 1.45; }
.ul-linked { text-decoration-style: solid; }
/* FileTree */
.filetree { margin: var(--s-4) 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s-3) var(--s-4); font: 500 13.5px var(--font-mono); }
.ft-cap { font: 600 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); margin-bottom: 8px; }
.ft-list { list-style: none; margin: 0; padding-left: 16px; border-left: 1px dashed var(--line-2); }
.ft-root { padding-left: 0; border-left: 0; }
.ft-item { padding: 3px 0; }
.ft-row { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ft-name { color: var(--ink); } .ft-dir { color: var(--acc-ink); font-weight: 600; }
.ft-mark { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; border-radius: var(--r-pill); padding: 0 7px; border: 1px solid var(--line-2); color: var(--muted); }
.ft-added { color: var(--good-ink); background: var(--good-soft); border-color: transparent; }
.ft-changed { color: var(--acc-ink); background: var(--acc-softer); border-color: transparent; }
.ft-removed { color: var(--hot-ink, var(--ink)); background: var(--hot-soft, var(--surface-2)); border-color: transparent; }
.ft-is-removed > .ft-row .ft-name, .ft-is-removed > details .ft-name { text-decoration: line-through; color: var(--muted); }
.ft-conflict { color: var(--warn-ink); background: var(--warn-soft); border-color: transparent; }
.ft-note { font-family: var(--font-sans); font-size: 12.5px; color: var(--muted); }
.ft-file > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.ft-file > summary::-webkit-details-marker { display: none; }
.ft-open { font: 600 11px var(--font-mono); color: var(--acc-ink); text-decoration: underline; padding: 6px 0; }
.ft-content { margin: 6px 0 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); overflow-x: auto; font-size: 12.5px; line-height: 1.5; }
.ft-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.ft-side-k { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
@media (max-width: 719px) { .ft-pair { grid-template-columns: 1fr; } }
/* Stepper */
.stepper { margin: var(--s-4) 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s-4); box-shadow: var(--shadow-sm); }
.st-cap { font: 600 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc-ink); margin-bottom: var(--s-3); }
.st-head { display: flex; gap: 10px; align-items: baseline; }
.st-n { font: 600 13px var(--font-mono); color: var(--acc-ink); }
.st-title { font-weight: 600; color: var(--ink); }
.st-body { min-height: 6rem; margin: var(--s-2) 0 var(--s-3); }
.st-text { margin: 0 0 var(--s-2); color: var(--ink-2); line-height: 1.6; }
.st-state { border-collapse: collapse; width: 100%; font-size: 13px; }
.st-state th { text-align: left; font: 600 12px var(--font-mono); color: var(--muted); padding: 5px 10px 5px 0; vertical-align: top; width: 1%; white-space: nowrap; }
.st-state td { padding: 5px 0; } .st-state code { font: 500 12.5px var(--font-mono); overflow-wrap: anywhere; color: var(--ink); }
.st-state tr.st-changed td code { background: var(--warn-soft); border-radius: 4px; padding: 1px 4px; }
.st-code { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; overflow-x: auto; font-size: 12.5px; }
.st-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 18px; cursor: pointer; }
.st-btn:disabled { opacity: .4; cursor: default; }
.st-dots { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.st-dot { min-width: 40px; height: 40px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); font: 600 12px var(--font-mono); color: var(--muted); cursor: pointer; }
.st-dot.is-past { color: var(--acc-ink); border-color: var(--acc-soft); }
.st-dot.is-on { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.st-all { padding-left: 1.3em; margin: 0; } .st-all > li { margin-bottom: var(--s-3); }
/* CodeWalk */
.codewalk { margin: var(--s-4) 0; }
.cw-cap { display: flex; flex-wrap: wrap; gap: 4px 10px; font: 500 12.5px var(--font-mono); margin-bottom: 6px; }
.cw-repo { color: var(--muted); } .cw-file { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.cw-steps { list-style: none; padding: 0; margin: 0; counter-reset: cw; display: grid; gap: var(--s-3); }
.cw-step { counter-increment: cw; }
.cw-note { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; color: var(--ink-2); line-height: 1.5; margin-bottom: 6px; }
.cw-note::before { content: counter(cw); font: 600 12px var(--font-mono); color: var(--on-acc); background: var(--acc); border-radius: 50%; width: 22px; height: 22px; display: inline-grid; place-items: center; flex: none; }
.cw-lines { font: 600 11.5px var(--font-mono); color: var(--acc-ink); }
.cw-missing { color: var(--muted); font-style: italic; }
/* Mermaid */
.mermaid-fig { margin: var(--s-4) 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s-4); overflow-x: auto; }
.mermaid-svg svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.mermaid-box.is-drawn .mermaid-src { display: none; }
.mermaid-src { margin: 0; font-size: 12.5px; white-space: pre-wrap; color: var(--ink-2); }
.mermaid-cap { margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.doc-is-map .doc-body > h1:first-child, .doc-body > h1:first-child { display: none; }
@media (max-width: 719px) { .doc-meta-row { grid-template-columns: 1fr; gap: 2px; } .doc-meta dl { padding: 0 var(--s-3) var(--s-3); } .doc { padding: 0 0 var(--s-6); } }
.mermaid-svg { overflow-x: auto; }
.mermaid-svg svg { max-width: none !important; min-width: min(100%, 36rem); }
@media (min-width: 720px) { .mermaid-svg svg { max-width: 100% !important; min-width: 0; } }
.st-ctrl { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.st-dots { justify-content: center; }
@media (min-width: 720px) { .hint { left: auto; right: 16px; bottom: 16px; max-width: 300px; margin: 0; font-size: 13px; } }
.mermaid-svg svg { min-width: 0 !important; }
.mermaid-box.is-wide::after { content: "← scroll sideways →"; display: block; text-align: center; font: 500 11px var(--font-mono); color: var(--muted); margin-top: 6px; }
.codewalk, .cw-steps, .cw-step, .cw-note, .cw-step > * { min-width: 0; max-width: 100%; }
.cw-step figure.code { max-width: 100%; overflow-x: auto; }
