/* EntryPoint Intelligence. Design notes: site/DESIGN.md. Light + dark via prefers-color-scheme.
   Layout: one centred reading column (--measure); data blocks break out symmetrically to --wide. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #eceef2;
  --ink: #14171c;
  --ink-2: #3d4450;
  --muted: #5b6370;
  --line: #e3e6ea;
  --line-2: #c9ced6;
  --link: #1a5fb4;
  --accent: #ea580c;
  --accent-ink: #b33c0a;
  --hover: #f3f6fb;
  --code-bg: #f1f3f6;
  --ev: #2f6db5;
  --ok: #17712f; --bad: #b42828;
  /* chart series (validated set) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --ord-1: #86b6ef; --ord-2: #3987e5; --ord-3: #1c5cab;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  /* type scale (1.25) */
  --fs-xs: 0.8125rem; --fs-sm: 0.875rem; --fs-base: 1.0625rem; --fs-lg: 1.1875rem;
  --fs-h4: 0.8125rem; --fs-h3: 1.1875rem; --fs-h2: 1.5rem; --fs-h1: clamp(1.9rem, 1.4rem + 1.8vw, 2.5rem);
  --fs-hero: clamp(2.2rem, 1.5rem + 2.8vw, 3.25rem);
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;
  --r: 8px;
  --measure: 42rem; --wide: 64rem; --gutter: 1.5rem;
  --ease: 150ms ease;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111317;
    --surface: #111317;
    --surface-2: #181b20;
    --surface-3: #20242a;
    --ink: #e9ebee;
    --ink-2: #c4c9d0;
    --muted: #9aa2ad;
    --line: #262a31;
    --line-2: #3a404a;
    --link: #8cb8f5;
    --accent: #f97316;
    --accent-ink: #fb923c;
    --hover: #171c24;
    --code-bg: #1c2026;
    --ev: #8cb8f5;
    --ok: #4cc26a; --bad: #f07575;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --ord-1: #184f95; --ord-2: #3987e5; --ord-3: #9ec5f4;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs-base)/1.65 var(--font-sans); }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 3px; }
::selection { background: rgba(234, 88, 12, 0.2); }
h1, h2, h3, h4 { color: var(--ink); text-wrap: balance; font-family: var(--font-sans); }
h1 { font-size: var(--fs-h1); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--s3); }
h2 { font-size: var(--fs-h2); font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; margin: var(--s7) 0 var(--s3); }
h3 { font-size: var(--fs-h3); font-weight: 650; line-height: 1.3; margin: var(--s6) 0 var(--s2); }
h4 { font-size: var(--fs-h4); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: var(--s5) 0 var(--s2); }
p, ul, ol, dl, blockquote { margin: 0 0 var(--s4); }
li { margin: 0.2rem 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.86em; }
code { background: var(--code-bg); padding: 0.06em 0.3em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--surface-2); padding: var(--s4); border-radius: var(--r); overflow-x: auto; line-height: 1.5; border: 1px solid var(--line); }
pre code { background: none; padding: 0; overflow-wrap: normal; }
:is(h1, h2, h3) code { background: none; padding: 0; font-size: 0.92em; }
blockquote { padding: var(--s1) var(--s4); border-left: 3px solid var(--line-2); color: var(--ink-2); }
blockquote p { margin: var(--s2) 0; }
hr { display: none; }
strong { font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.ev, .gr, .tablewrap, .mermaid-wrap, .chartfig { position: relative; } /* keeps visually-hidden text inside scroll boxes */
.vh { position: absolute !important; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); color: var(--ink); padding: 0.5rem 0.75rem; z-index: 50; border-radius: var(--r); border: 1px solid var(--line-2); }

/* ---------- the grid: wrap > prose; reading column centred, data blocks break out ---------- */
.wrap { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.prose { padding: var(--s6) 0 var(--s8); }
.prose > * { max-width: var(--measure); margin-left: auto !important; margin-right: auto !important; } /* components set block margins only */
.prose > :is(.tablewrap, .chartfig, .multiples, .mermaid-wrap, .stats, .excards, .plate, pre, details.tableview, .wide) {
  max-width: var(--wide);
}
.prose > .stats.two { max-width: var(--measure); }
.prose > h2:first-child, .prose > span:first-child + h2 { margin-top: 0; }

/* ---------- header ---------- */
header.site { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-top { display: flex; align-items: center; gap: var(--s4); padding-top: var(--s3); padding-bottom: var(--s3); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; min-width: 0; margin-right: auto; }
.mark { display: inline-flex; width: 28px; height: 28px; flex: none; }
.mark svg { width: 28px; height: 28px; display: block; }
.brand-name { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name b { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-name small { font-size: 0.75rem; color: var(--muted); }
.asof { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.asof b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.menubtn { display: none; }
.navrow { padding-bottom: 0; }
.navgroups { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s5); }
.navgroup { margin: 0; }
.navlabel { display: block; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 0.5rem; }
.navgroup ul { list-style: none; margin: 0; padding: 0; display: flex; }
.navgroup li { margin: 0; }
.navgroup a { display: block; padding: 0.25rem 0.5rem 0.6rem; font-size: 0.9375rem; color: var(--ink-2); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.navgroup a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.navgroup a[aria-current] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.navgroup a .tail { display: none; }
@media (max-width: 1099px) {
  .js .menubtn {
    display: inline-flex; align-items: center; gap: 0.5rem; font: 600 0.9375rem/1 var(--font-sans); color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0.55rem 0.8rem; cursor: pointer; min-height: 2.5rem;
  }
  .menubtn-bars { width: 16px; height: 12px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
  .menubtn-bars::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid currentColor; }
  .menubtn[aria-expanded="true"] .menubtn-bars { border-color: transparent; }
  .menubtn[aria-expanded="true"] .menubtn-bars::after { top: 3px; border-top-width: 2px; transform: rotate(45deg); }
  .menubtn[aria-expanded="true"] .menubtn-bars::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid currentColor; transform: rotate(-45deg); }
  .js .navrow { display: none; }
  .js .navrow.open { display: block; }
  .navrow { border-top: 1px solid var(--line); padding-top: var(--s3); padding-bottom: var(--s4); }
  .navgroups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
  .navgroup ul { flex-direction: column; }
  .navlabel { padding: 0 0 var(--s1); }
  .navgroup a { padding: 0.45rem 0; font-size: 1rem; border-bottom: 0; white-space: normal; }
  .navgroup a .tail { display: inline; }
  .navgroup a[aria-current] { box-shadow: inset 3px 0 0 var(--accent); padding-left: 0.6rem; }
}
@media (max-width: 640px) {
  .navgroups { grid-template-columns: 1fr; gap: var(--s3); }
  .navgroup + .navgroup { border-top: 1px solid var(--line); padding-top: var(--s3); }
  .asof { display: none; }
  .brand-name small { display: none; }
}

/* ---------- page head ---------- */
.pagehead { border-bottom: 1px solid var(--line); padding: var(--s7) 0 var(--s6); background: var(--surface-2); }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 var(--s2); }
.crumbs { font-size: var(--fs-sm); color: var(--muted); margin: 0 0 var(--s2); }
.crumbs a { color: var(--ink-2); }
.lede { font-size: var(--fs-lg); line-height: 1.5; color: var(--ink-2); margin: 0; }
h1.mono { font-family: var(--font-mono); font-weight: 600; font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.headmeta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.contents { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line-2); }
.contents-h { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s2); }
.contents ol, .contents ul { margin: 0; padding: 0 0 0 1.4rem; columns: 2; column-gap: var(--s6); font-size: var(--fs-sm); }
.contents li { margin: 0 0 0.3rem; break-inside: avoid; padding-left: 0.15rem; }
.contents li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.contents a { color: var(--ink-2); text-decoration: none; }
.contents a:hover { color: var(--link); text-decoration: underline; }
.contents ul { list-style: none; padding-left: 0; }
@media (max-width: 640px) { .contents ol, .contents ul { columns: 1; } }

/* ---------- chips, tags, buttons ---------- */
.chip { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--line-2); border-radius: 999px; padding: 0.1rem 0.6rem; font-size: var(--fs-xs); color: var(--ink-2); background: var(--surface); line-height: 1.5; white-space: nowrap; }
.chip.ok, .chip.bad { font-weight: 600; }
.chip.ok { color: var(--ok); } .chip.bad { color: var(--bad); }
.chip.ok::before { content: "\2713"; } .chip.bad::before { content: "\2715"; }
.vtag { display: inline-block; font: 600 0.75rem/1.6 var(--font-mono); padding: 0 0.4rem; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); }
.vtag::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 2px; margin-right: 0.35rem; vertical-align: 0.02em; background: var(--line-2); }
.vtag.s1::before { background: var(--series-1); } .vtag.s2::before { background: var(--series-2); }
.vtag.s3::before { background: var(--series-3); } .vtag.s4::before { background: var(--series-4); }
.btn { display: inline-flex; align-items: center; padding: 0.65rem 1.1rem; border-radius: var(--r); font-weight: 600; font-size: 0.9375rem; text-decoration: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.more { font-weight: 600; }

/* ---------- evidence: level markers (shape + words) and grades (muted words) ---------- */
.ev { display: inline; white-space: nowrap; font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--muted); margin-left: 0.15em; }
.ev::before {
  content: ""; display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; margin-right: 0.3em; vertical-align: -0.04em;
  border: 1.5px solid var(--ev); box-sizing: border-box;
}
.ev-primary_source::before { background: var(--ev); }
.ev-self_description::before { background: linear-gradient(90deg, var(--ev) 50%, transparent 50%); }
.ev-cluster::before { background: radial-gradient(circle, var(--ev) 0 26%, transparent 30%); }
.ev-hint::before { border-style: dotted; border-width: 2px; }
.ev-none::before { border-color: var(--line-2); border-radius: 1px; height: 0; border-width: 1px 0 0; width: 0.6em; vertical-align: 0.25em; }
.gr { font-size: 0.75rem; color: var(--muted); white-space: nowrap; border-bottom: 1px dotted var(--line-2); margin-left: 0.15em; cursor: help; }
.gr-weak { font-style: italic; }
.prov { color: var(--muted); font-size: 0.92em; }
.lname { color: var(--ink); }
.addrwrap { white-space: normal; }
a.addr, a.txh { font-family: var(--font-mono); font-size: 0.88em; }
code a.addr, code a.txh { font-size: inherit; }
a.addr code, a.txh code { color: inherit; background: transparent; padding: 0; font-size: 1em; overflow-wrap: anywhere; }
.pill { font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; margin-left: 0.3em; }
.tp { font-size: var(--fs-xs); color: var(--muted); }
.evkey { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s5); background: var(--surface-2); font-size: var(--fs-sm); }
.evkey-h { font-weight: 650; margin: 0 0 var(--s2); color: var(--ink); }
.evkey ul { list-style: none; margin: 0 0 var(--s4); padding: 0; }
.evkey li { display: grid; grid-template-columns: 9.5rem 1fr; gap: var(--s3); padding: 0.3rem 0; border-top: 1px solid var(--line); margin: 0; }
.evkey li:first-child { border-top: 0; }
.evkey li .ev { font-size: var(--fs-sm); color: var(--ink); margin: 0; }
.evkey li > span:last-child { color: var(--ink-2); }
.evkey-g { line-height: 2; margin: 0 0 var(--s2); }
.evkey-g .gr { font-size: var(--fs-sm); margin-right: 0.6rem; }
.evkey-n { color: var(--muted); margin: 0; }
@media (max-width: 640px) { .evkey li { grid-template-columns: 1fr; gap: 0; } .evkey { padding: var(--s3) var(--s4); } }
details.evdetails { margin-bottom: var(--s5); }
details.evdetails > summary, details.tableview > summary {
  cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--link); width: fit-content; padding: 0.2rem 0; list-style-position: inside;
}
details.evdetails[open] > summary { margin-bottom: var(--s3); }

/* ---------- tables ---------- */
.tablewrap {
  overflow-x: auto; margin-top: var(--s4); margin-bottom: var(--s5); border: 1px solid var(--line); border-radius: var(--r);
  /* scroll shadows: visible only when there is more table to the side */
  background:
    linear-gradient(to right, var(--surface), var(--surface)) left / 1.5rem 100% no-repeat local,
    linear-gradient(to left, var(--surface), var(--surface)) right / 1.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.16), transparent) left / 0.75rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.16), transparent) right / 0.75rem 100% no-repeat scroll,
    var(--surface);
}
table { border-collapse: collapse; font-size: var(--fs-sm); width: 100%; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; padding: var(--s3) var(--s4) var(--s2); }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--line); line-height: 1.45; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-2); vertical-align: bottom; background: var(--surface-2); }
tbody th { font-weight: 600; }
td.num, th.num { text-align: right; }
td.num { white-space: nowrap; }
table.data td, table.data tbody th { white-space: nowrap; }
@media (max-width: 760px) { .tablewrap > table.data { min-width: 0; } }
tbody tr:hover > * { background: var(--hover); }
td code, th code { overflow-wrap: normal; word-break: normal; white-space: nowrap; }
td:last-child code { white-space: normal; overflow-wrap: break-word; }
thead th .ev { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink-2); }
@media (max-width: 760px) {
  .tablewrap > table { min-width: 36rem; }
  .tablewrap > table.narrow-ok { min-width: 0; }
  th, td { padding: 0.5rem 0.65rem; }
}
@media (max-width: 640px) {
  /* prose tables become labelled blocks on phones */
  .tablewrap > table.stack { min-width: 0; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td, table.stack tbody th { display: block; width: auto; }
  table.stack caption { display: block; }
  table.stack tr { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td, table.stack tbody th { border: 0; padding: 0.1rem 0; text-align: left; white-space: normal; }
  table.stack tr > :first-child { font-weight: 650; padding-bottom: 0.25rem; }
  table.stack [data-label]::before { content: attr(data-label); display: block; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-top: 0.35rem; }
  table.stack td.num { text-align: left; }
  table.stack td { overflow-wrap: anywhere; }
  table.stack td code { white-space: normal; overflow-wrap: anywhere; }
  tbody tr:hover > * { background: none; }
}
.sharecell { min-width: 8rem; }
.sharetrack { display: inline-block; width: 4rem; height: 0.5rem; margin-right: 0.45rem; background: var(--line); border-radius: 0 3px 3px 0; vertical-align: middle; }
.sharebar { display: block; height: 100%; background: var(--series-1); border-radius: 0 3px 3px 0; }
.scrollhint { display: none; font-size: var(--fs-xs); color: var(--muted); margin-bottom: calc(-1 * var(--s2)); }

/* ---------- key/value ledgers (example pages) ---------- */
dl.facts, dl.ledger { border-top: 1px solid var(--line-2); margin-bottom: var(--s5); }
dl.facts > div, dl.ledger > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: var(--s4); padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
dl.facts dt, dl.ledger dt { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
dl.facts dd, dl.ledger dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.facts a.txh { font-size: 0.82em; }
.lhow { font-size: var(--fs-sm); color: var(--muted); margin-top: 0.15rem; line-height: 1.5; }
.lhow code { font-size: 0.9em; }
@media (max-width: 560px) {
  dl.facts > div, dl.ledger > div { grid-template-columns: 1fr; gap: 0.1rem; }
  dl.facts dt, dl.ledger dt { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
}

/* ---------- example pages ---------- */
.summary { font-size: var(--fs-lg); line-height: 1.6; color: var(--ink); }
.op { border: 1px solid var(--line); border-radius: var(--r); margin-top: var(--s4); margin-bottom: var(--s4); padding: 0 var(--s5) var(--s3); background: var(--surface); }
.op-h, details.op > summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 calc(-1 * var(--s5)); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r) var(--r) 0 0; }
.op-h h3, .op-t { margin: 0 var(--s2) 0 0; font-size: 1.0625rem; font-weight: 650; }
.of { color: var(--muted); font-weight: 500; }
.op-idx { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); }
details.op > summary { cursor: pointer; border-bottom: 0; border-radius: var(--r); list-style: none; }
details.op > summary::-webkit-details-marker { display: none; }
details.op > summary::before { content: "\25B8"; color: var(--muted); margin-right: 0.2rem; }
details.op[open] > summary::before { content: "\25BE"; }
details.op[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.op-sum { margin-top: var(--s4); color: var(--ink-2); }
.op h4 { margin-top: var(--s5); }
.op .ledger { margin-bottom: var(--s3); }
ol.calls, ul.calls { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.calls > li { padding: 0.5rem 0; border-top: 1px solid var(--line); margin: 0; }
.calls > li:first-child { border-top: 0; }
.call-h { margin: 0; }
.call-meta { margin: 0.2rem 0 0; font-size: var(--fs-sm); color: var(--muted); }
.call-note { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 0.15rem; overflow-wrap: anywhere; }
.callno { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--ink-2); background: var(--surface-3); border-radius: 4px; padding: 0.05rem 0.4rem; margin-right: 0.35rem; white-space: nowrap; }
ul.assets { padding-left: 1.2rem; }
ul.assets li { margin: 0.4rem 0; }
code.msg { white-space: normal; }
.ok { color: var(--ok); } .bad { color: var(--bad); }
ul.notes { padding-left: 1.2rem; color: var(--ink-2); }
ul.cannot { list-style: none; padding: 0; border-top: 1px solid var(--line); }
ul.cannot li { padding: 0.55rem 0 0.55rem 1.6rem; border-bottom: 1px solid var(--line); margin: 0; position: relative; }
ul.cannot li::before { content: "?"; position: absolute; left: 0; top: 0.7rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 1px solid var(--line-2); font: 700 0.7rem/1.05rem var(--font-sans); text-align: center; color: var(--muted); }
@media (max-width: 640px) { .op { padding: 0 var(--s4) var(--s3); } .op-h, details.op > summary { margin: 0 calc(-1 * var(--s4)); padding: var(--s3) var(--s4); } .op-idx { margin-left: 0; } }

/* ---------- stat tiles: hairline-topped figures, no boxes ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 var(--s5); margin-top: var(--s4); margin-bottom: var(--s5); }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: var(--s3) 0 var(--s4); border-top: 1px solid var(--line-2); }
.stat-label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); line-height: 1.35; }
.stat-value { font-size: 1.875rem; font-weight: 700; line-height: 1.15; margin: var(--s2) 0 var(--s1); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.02em; color: var(--ink); }
.stat-sub { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.4; }
@media (max-width: 760px) { .stats.three { grid-template-columns: 1fr 1fr; } .stat-value { font-size: 1.5rem; } }
@media (max-width: 420px) { .stats.three, .stats.two { grid-template-columns: 1fr; } }

/* ---------- charts ---------- */
.chartfig { margin-top: var(--s5); margin-bottom: var(--s6); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s5) var(--s3); background: var(--surface); }
.charttitle { font-size: var(--fs-sm); font-weight: 650; color: var(--ink); margin: 0 0 var(--s2); }
.chartbox { margin: 0 auto; }
.chartbox.v-narrow { display: none; max-width: 34rem; }
.chartbox.only-narrow { max-width: 34rem; }
@media (max-width: 919px) { .chartbox.v-wide { display: none; } .chartbox.v-narrow { display: block; } }
svg.chart { width: 100%; height: auto; display: block; font-family: var(--font-sans); overflow: visible; }
svg.chart .grid { stroke: var(--line); }
svg.chart .axis { stroke: var(--line-2); }
svg.chart .leader { stroke: var(--line-2); }
svg.chart .tick { fill: var(--muted); font-variant-numeric: tabular-nums; }
svg.chart .rowlab { fill: var(--ink-2); }
svg.chart .vlabel { fill: var(--ink); }
svg.chart .note { fill: var(--ink-2); }
svg.chart .hit { cursor: crosshair; outline: none; }
svg.chart .hit:hover, svg.chart .hit:focus { fill: var(--ink); fill-opacity: 0.06; }
svg.chart .hit:focus-visible { stroke: var(--accent-ink); stroke-width: 1.5; }
.s1 { fill: var(--series-1); } .s2 { fill: var(--series-2); } .s3 { fill: var(--series-3); } .s4 { fill: var(--series-4); }
.s1-line { stroke: var(--series-1); } .s2-line { stroke: var(--series-2); } .s3-line { stroke: var(--series-3); } .s4-line { stroke: var(--series-4); }
.s1-area { fill: var(--series-1); } .s2-area { fill: var(--series-2); }
.s2-dot { fill: var(--series-2); stroke: var(--surface); }
.o1 { fill: var(--ord-1); } .o2 { fill: var(--ord-2); } .o3 { fill: var(--ord-3); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); padding: 0; margin: 0 0 var(--s2); font-size: var(--fs-sm); color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.figcap { font-size: var(--fs-sm); color: var(--ink-2); margin: var(--s3) 0 var(--s1); }
details.tableview { margin: var(--s2) auto; }
.chartfig details.tableview .tablewrap { margin-bottom: var(--s2); }
details.tableview .tablewrap { max-height: 28rem; overflow: auto; }
details.tableview thead th { position: sticky; top: 0; z-index: 1; }
.multiples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s4); margin-bottom: var(--s5); }
.multiples .chartfig { margin: 0; height: 100%; }
@media (max-width: 760px) { .multiples { grid-template-columns: 1fr; } .chartfig { padding: var(--s3); } }
.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 6px; padding: 0.45rem 0.65rem; font-size: var(--fs-xs); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16); white-space: pre; font-variant-numeric: tabular-nums; }
.tip b { font-weight: 650; }

/* ---------- mermaid: natural size, scrolls inside its frame ---------- */
.mermaid-wrap { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); overflow-x: auto; margin-top: var(--s4); margin-bottom: var(--s5); background: var(--surface); }
pre.mermaid { background: transparent; margin: 0 auto; border: 0; padding: 0; width: max-content; min-width: 100%; text-align: center; font-size: 14px; }
pre.mermaid svg { max-width: none !important; height: auto; }
.scrollhint:has(+ .mermaid-wrap.overflows) { display: block; }
.mermaid-wrap.overflows { box-shadow: inset -12px 0 10px -10px rgba(0, 0, 0, 0.18); }

/* ---------- home ---------- */
.hero { border-bottom: 1px solid var(--line); padding: var(--s8) 0 var(--s7); background: var(--surface-2); }
.hero h1 { font-size: var(--fs-hero); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: var(--s4); }
.hero .lede { font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.plate { margin-top: 0; margin-bottom: var(--s6); }
.plate img { display: block; width: 100%; height: auto; border-radius: var(--r); background: #14130f; aspect-ratio: 12 / 5; object-fit: cover; }
.plate figcaption { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s2); max-width: var(--measure); margin-left: auto; margin-right: auto; }
.intro { font-size: var(--fs-lg); line-height: 1.6; }
ol.sequence { list-style: none; padding: 0; counter-reset: step; border-top: 1px solid var(--line-2); }
ol.sequence li { counter-increment: step; display: grid; grid-template-columns: 2rem 11rem minmax(0, 1fr); gap: var(--s3); padding: 0.65rem 0; border-bottom: 1px solid var(--line); margin: 0; }
ol.sequence li::before { content: counter(step); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
ol.sequence li.core strong { color: var(--accent-ink); }
ol.sequence li span { color: var(--ink-2); }
dl.roles { border-top: 1px solid var(--line-2); }
dl.roles > div { display: grid; grid-template-columns: 2rem 11rem minmax(0, 1fr); gap: var(--s3); padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
dl.roles dt { font-weight: 650; grid-column: 2; }
dl.roles dd { margin: 0; color: var(--ink-2); }
@media (max-width: 640px) {
  ol.sequence li { grid-template-columns: 1.5rem minmax(0, 1fr); gap: 0 var(--s2); }
  ol.sequence li span { grid-column: 2; }
  dl.roles > div { grid-template-columns: 1.5rem minmax(0, 1fr); gap: 0 var(--s2); }
  dl.roles dd { grid-column: 2; }
}
.groups { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); border-top: 1px solid var(--line-2); padding-top: var(--s3); }
.groups > li { margin: 0; }
.groups h3 { font-size: var(--fs-h4); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 var(--s2); }
.groups ul { list-style: none; padding: 0; margin: 0; }
.groups ul li { margin: 0; border-bottom: 1px solid var(--line); }
.groups ul a { display: block; padding: 0.5rem 0; font-weight: 600; text-decoration: none; color: var(--ink); }
.groups ul a:hover { color: var(--link); }
.groups ul a::after { content: " \2192"; color: var(--muted); }
@media (max-width: 640px) { .groups { grid-template-columns: 1fr; gap: var(--s4); } }
.callout { border-left: 3px solid var(--accent); padding: var(--s2) var(--s4); background: var(--surface-2); border-radius: 0 var(--r) var(--r) 0; }
.note-s { font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- examples gallery ---------- */
.excards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: var(--s4); margin-top: var(--s5); margin-bottom: var(--s6); }
.excard { position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s5); display: flex; flex-direction: column; margin: 0; background: var(--surface); }
.excard:hover { border-color: var(--line-2); background: var(--hover); }
.excard:focus-within { border-color: var(--accent); }
.excard p { font-size: var(--fs-sm); margin: var(--s2) 0; color: var(--ink-2); }
.excard > a:first-child { text-decoration: none; }
.excard > a:first-child::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.excard > a:first-child:focus-visible { outline: none; }
.excard > a:first-child:focus-visible::after { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.excard .exlinks { margin-top: auto; padding-top: var(--s2); border-top: 1px solid var(--line); position: relative; z-index: 1; }
.excard .addrwrap, .excard a.addr { position: relative; z-index: 1; }
.extitle { font-weight: 600; font-family: var(--font-mono); font-size: 0.9375rem; color: var(--ink); overflow-wrap: anywhere; }
.excard > a:first-child:hover .extitle { color: var(--link); }
.exmeta { margin-top: var(--s2); font-size: var(--fs-xs); color: var(--ink-2); display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }

/* ---------- attribution / who's who / method ---------- */
ol.rules { padding-left: 1.4rem; }
ol.rules li { margin: var(--s2) 0; }
ol.rules li::marker { font-weight: 700; color: var(--muted); }
ul.grades { list-style: none; padding: 0; border-top: 1px solid var(--line-2); }
ul.grades li { margin: 0; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
ul.grades li .gr { font-size: var(--fs-sm); color: var(--ink); margin-right: var(--s2); }
details.vendor { border-bottom: 1px solid var(--line); margin: 0 auto; }
.prose > details.vendor { max-width: var(--wide); }
.prose > p + details.vendor, .prose > details.vendor:first-of-type { border-top: 1px solid var(--line-2); }
details.vendor summary { cursor: pointer; padding: 0.6rem 0; line-height: 1.7; }
details.vendor .tablewrap { margin-top: var(--s2); }
dl.sources dt { font-weight: 650; margin-top: var(--s5); font-size: var(--fs-lg); }
dl.sources dd { margin: var(--s2) 0 0; }
details > summary { border-radius: 4px; }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-sm); padding: var(--s7) 0 var(--s6); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s6); }
.foot-grid h2 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 0.35rem 0; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; }
.foot-note { border-top: 1px solid var(--line); margin-top: var(--s6); padding-top: var(--s4); }
.foot-note p { margin: 0.35rem 0; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  :root { --gutter: 1rem; --fs-base: 1rem; }
  h2 { font-size: 1.3rem; margin-top: var(--s6); }
  .pagehead { padding: var(--s6) 0 var(--s5); }
  .hero { padding: var(--s7) 0 var(--s6); }
  .lede, .summary, .intro { font-size: 1.0625rem; }
  .prose { padding-top: var(--s5); }
}
@media (forced-colors: active) {
  .ev::before { border-color: CanvasText; }
  .ev-primary_source::before { background: CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  header.site, footer.site, .hero-cta, .contents { display: none; }
  .pagehead, .hero { background: none; }
}
