/* Self-hosted type — Fraunces (display), IBM Plex Sans (body), IBM Plex Mono (data). Latin subset. */
@font-face{font-family:'Fraunces';font-style:normal;font-weight:400;font-display:swap;src:url('fraunces-400.woff2') format('woff2');}
@font-face{font-family:'Fraunces';font-style:normal;font-weight:500;font-display:swap;src:url('fraunces-500.woff2') format('woff2');}
@font-face{font-family:'Fraunces';font-style:normal;font-weight:600;font-display:swap;src:url('fraunces-600.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:400;font-display:swap;src:url('plexsans-400.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:500;font-display:swap;src:url('plexsans-500.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:600;font-display:swap;src:url('plexsans-600.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:700;font-display:swap;src:url('plexsans-700.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;src:url('plexmono-400.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:500;font-display:swap;src:url('plexmono-500.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:600;font-display:swap;src:url('plexmono-600.woff2') format('woff2');}

/* Research log design system: cool paper, Fraunces display + IBM Plex Sans/Mono,
   one cobalt accent, honest semantic colors; categorical data slots in fixed order. */

:root {
  /* Cool paper + crisp surfaces — deliberately not warm-cream. */
  --page: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #14171e;      /* cool near-black */
  --ink-2: #454b57;
  --muted: #656b78;    /* AA on both paper and white surfaces */
  --grid: #e5e8ee;     /* hairline — charts + rules */
  --baseline: #c2c7d1;
  --line: #e5e8ee;
  --ring: rgba(20, 23, 30, 0.12);
  --accent: #2a52e0;   /* confident cobalt — the one bold hue */
  --accent-ink: #1e3fbf;
  --accent-wash: #eef2fe;
  --good: #12855a;
  --critical: #cf3b34;
  /* data palette — hue-separated, harmonized (slots 2 and 4 are both greens) */
  --slot-0: #8b909c;
  --slot-1: #2a52e0;
  --slot-2: #12a37b;
  --slot-3: #dd991c;
  --slot-4: #0e8a4f;
  --slot-5: #6a4cd6;
  --slot-6: #e0503f;
  --slot-7: #dd77a8;
  --slot-8: #ec6f34;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 13px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 23, 30, 0.04), 0 6px 22px rgba(20, 23, 30, 0.05);
  --shadow-lift: 0 6px 16px rgba(20, 23, 30, 0.07), 0 20px 48px rgba(20, 23, 30, 0.09);
}

/* Light only, by request: learning and discovery should be joyous. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
[id] { scroll-margin-top: 84px; } /* anchor jumps land below the sticky topbar */

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16.5px/1.62 var(--sans);
  font-feature-settings: "ss01", "cv05";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration: none; overflow-wrap: anywhere; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } /* outline follows the element's own radius */
:focus:not(:focus-visible) { outline: none; }
code, pre { font-family: var(--mono); font-size: 0.85em; }
code { overflow-wrap: anywhere; } /* long paths/slugs must not widen the page */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 550; letter-spacing: -0.01em; line-height: 1.15; text-wrap: balance; }
h1, h2, h3, h4, .crumbs, figcaption { overflow-wrap: break-word; }
.muted { color: var(--muted); }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.plain { list-style: none; margin: 0; padding: 0; }
.count { color: var(--muted); font-weight: 400; font-size: 0.8em; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--surface); padding: 8px 14px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--grid);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 16px; height: 16px; border-radius: 5px;
  background: linear-gradient(140deg, var(--slot-1), var(--slot-5));
  flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.kicker { font: 500 10px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.wordmark { font-family: var(--display); font-weight: 550; font-size: 16px; white-space: nowrap; letter-spacing: -0.005em; }

.topnav { display: flex; gap: 2px; flex: 1; }
.topnav a {
  color: var(--ink-2); padding: 6px 11px; border-radius: 8px; font-size: 14px; white-space: nowrap; font-weight: 500;
}
.topnav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--ink); font-weight: 600; background: var(--surface); box-shadow: inset 0 0 0 1px var(--grid); }

.topbar-tools { display: flex; align-items: center; gap: 10px; }
.gh-link {
  font: 500 13px var(--sans); color: var(--ink-2);
  padding: 7px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap;
}
.gh-link:hover { text-decoration: none; color: var(--ink); border-color: var(--baseline); }

.site-search { position: relative; }
.site-search input {
  width: 200px; padding: 6px 10px; font: 13px var(--sans);
  border: 1px solid var(--grid); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
.site-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; width: 280px; }
#search-results {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  width: min(380px, calc(100vw - 24px)); max-height: 60vh; overflow: auto;
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#search-results li a {
  display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink);
}
#search-results li a:hover, #search-results li a.active { background: var(--page); text-decoration: none; }
#search-results .kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 6px; }
#search-results .hit-text { display: block; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#search-results .search-meta { padding: 8px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--grid); margin-top: 4px; }
#search-results .search-meta a { display: block; padding: 0; }

/* --------------------------------------------------------------- layout */

main { max-width: 1200px; margin: 0 auto; padding: 34px 28px 96px; }
.band { margin-top: 60px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 25px; font-weight: 550; }
.section-head .more { font-size: 13.5px; white-space: nowrap; font-family: var(--mono); }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 6px 0 8px; font-size: clamp(30px, 4vw, 40px); }
.lede { color: var(--ink-2); max-width: 68ch; margin: 0 0 10px; font-size: 17px; line-height: 1.6; }
.lede strong { color: var(--ink); font-weight: 600; }
.result-count { color: var(--muted); font-size: 13px; margin-left: auto; }

.site-footer {
  max-width: 1200px; margin: 0 auto; padding: 24px;
  border-top: 1px solid var(--grid); color: var(--ink-2); font-size: 14px;
}
.footer-note { color: var(--muted); font-size: 13px; }

/* ----------------------------------------------------------------- hero */

.hero { padding: 26px 0 4px; }
.hero h1 { font-size: clamp(40px, 5.4vw, 62px); margin: 6px 0 20px; letter-spacing: -0.022em; line-height: 1.03; max-width: 15ch; font-weight: 550; }
.hero .lede { font-size: 19px; max-width: 60ch; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 26px 0 16px; }
.stat-tile {
  flex: 1 1 150px; min-width: 150px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; color: var(--ink); display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow); transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
a.stat-tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat-label { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.stat-value { font-family: var(--display); font-size: 34px; font-weight: 550; line-height: 1.05; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat-sub { font: 500 12px var(--mono); color: var(--ink-2); }

.claim-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.claim-pill {
  font: 600 12px var(--mono); padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--grid); background: var(--surface); color: var(--ink);
}
.claim-pill:hover { text-decoration: none; border-color: var(--baseline); }
.claim-pill.status-check { border-color: color-mix(in srgb, var(--good) 45%, var(--grid)); }
.claim-pill.status-cross { border-color: color-mix(in srgb, var(--critical) 45%, var(--grid)); }
.claim-pill.status-check span[aria-hidden] { color: var(--good); }
.claim-pill.status-cross span[aria-hidden] { color: var(--critical); }
.claim-pill.status-half span[aria-hidden] { color: var(--accent); }
.claim-pill.status-open span[aria-hidden], .claim-pill.status-pause span[aria-hidden] { color: var(--muted); }
.strip-legend { font-size: 12.5px; margin: 8px 0 0; }
.strip-legend .status-check { color: var(--good); }
.strip-legend .status-cross { color: var(--critical); }
.strip-legend .status-half { color: var(--accent); }
.strip-legend .status-open { color: var(--muted); }

/* claims at a glance — a proportional status bar, not a wall of id pills */
.claims-glance {
  display: block; margin: 6px 0 0; padding: 13px 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius); box-shadow: var(--shadow);
}
.claims-glance:hover { text-decoration: none; border-color: var(--baseline); }
.cg-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--page); box-shadow: inset 0 0 0 1px var(--grid); }
.cg-seg { display: block; min-width: 5px; }
.cg-seg + .cg-seg { border-left: 1.5px solid var(--surface); } /* keep small slivers distinct */
.cg-check { background: var(--good); }
.cg-half { background: var(--accent); }
.cg-open { background: #a2a9b6; }
.cg-cross { background: var(--critical); }
.cg-pause { background: var(--muted); }
.cg-legend { display: block; margin-top: 9px; font-size: 13.5px; color: var(--ink-2); }
.cg-legend b { color: var(--ink); }
.cg-more { color: var(--accent-ink); font-weight: 600; margin-left: 4px; white-space: nowrap; }

.glossary-box {
  margin: 14px 0 0; padding: 11px 18px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.glossary-box summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; font-size: 13px; }
.glossary-box dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; margin: 12px 0 4px; }
.glossary-box dt { font: 600 13px var(--mono); color: var(--ink); }
.glossary-box dd { margin: 0; color: var(--ink-2); font-size: 13.5px; }
@media (max-width: 640px) {
  .glossary-box dl { grid-template-columns: 1fr; gap: 2px; }
  .glossary-box dd { margin: 0 0 8px; }
}

/* ----------------------------------------------------------------- chips */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px var(--sans); padding: 3.5px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
a.chip:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); color: var(--ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--slot-0); flex: none; }
.chip[data-slot="1"] .dot { background: var(--slot-1); }
.chip[data-slot="2"] .dot { background: var(--slot-2); }
.chip[data-slot="3"] .dot { background: var(--slot-3); }
.chip[data-slot="4"] .dot { background: var(--slot-4); }
.chip[data-slot="5"] .dot { background: var(--slot-5); }
.chip[data-slot="6"] .dot { background: var(--slot-6); }
.chip[data-slot="7"] .dot { background: var(--slot-7); }
.chip[data-slot="8"] .dot { background: var(--slot-8); }
.chip.track { color: var(--muted); border-style: dashed; }
.chip.tag { color: var(--muted); background: var(--page); }
.chip.prog.pending { color: var(--muted); border-style: dashed; cursor: help; }
.chip.status span[aria-hidden] { font-weight: 700; }
.chip.status-check span[aria-hidden] { color: var(--good); }
.chip.status-cross span[aria-hidden] { color: var(--critical); }
.chip.status-half span[aria-hidden] { color: var(--accent); }
.chip.status-open span[aria-hidden], .chip.status-pause span[aria-hidden] { color: var(--muted); }
.card-date { font: 500 12px var(--mono); color: var(--ink-2); white-space: nowrap; }

/* experiment lifecycle status (finished / in progress) */
.chip.xstatus { font-weight: 600; gap: 5px; }
.chip.xstatus .xdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--slot-0); }
.chip.x-done { color: var(--ink-2); }
.chip.x-done .xdot { background: var(--good); }
.chip.x-live {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--grid));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.chip.x-live .xdot { background: var(--accent); animation: livepulse 2s ease-out infinite; }
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .chip.x-live .xdot { animation: none; } }

/* ------------------------------------------------------------ feed cards */

.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 18px; }
.feed-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.feed-card:hover { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card-thumb { display: block; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 10px 12px 2px; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed-card h3 { margin: 0; font-size: 19px; line-height: 1.26; font-weight: 550; }
.feed-card h3 a { color: var(--ink); }
.feed-card h3 a:hover { color: var(--accent-ink); text-decoration: none; }
.card-finding { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 0; font-size: 13px; }

/* ------------------------------------------------ practitioner brief (top) */

.verdict-banner { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.verdict-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--slot-0); flex: none; }
.verdict-banner.tone-positive .verdict-dot { background: var(--good); }
.verdict-banner.tone-negative .verdict-dot { background: var(--critical); }
.verdict-banner.tone-mixed .verdict-dot { background: var(--slot-3); }
.verdict-banner.tone-neutral .verdict-dot { background: var(--slot-0); }
.verdict-tag { font-family: var(--display); font-size: 27px; font-weight: 550; line-height: 1.18; letter-spacing: -0.015em; color: var(--ink); }

/* card-scaled verdict: same tone-coded dot as the detail banner, sized for a card */
.card-verdict { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 9px; }
.card-verdict .verdict-dot { width: 8px; height: 8px; position: relative; top: 1px; }
.card-verdict.tone-positive .verdict-dot { background: var(--good); }
.card-verdict.tone-negative .verdict-dot { background: var(--critical); }
.card-verdict.tone-mixed .verdict-dot { background: var(--slot-3); }
.card-verdict.tone-neutral .verdict-dot { background: var(--slot-0); }
.status-note { margin: 10px 0 0; font-size: 14px; color: var(--muted); font-style: italic; }
.card-verdict-tag { font-family: var(--display); font-weight: 560; font-size: 17px; line-height: 1.24; letter-spacing: -0.011em; color: var(--ink); text-wrap: balance; }
.feed-card.big .card-verdict-tag { font-size: 20px; }

.practitioner-brief {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 6px 26px 22px; margin: 0 0 32px; box-shadow: var(--shadow);
}
.practitioner-brief .brief-row { padding: 16px 0; border-top: 1px solid var(--line); }
.practitioner-brief .brief-row:first-child { padding-top: 18px; border-top: 0; }
.practitioner-brief .brief-row .kicker { margin: 0 0 6px; color: var(--accent-ink); }
.practitioner-brief .brief-row p:last-child { margin: 0; font-size: 17px; line-height: 1.62; color: var(--ink); }
.practitioner-brief .brief-kpis { margin: 16px 0 2px; gap: 10px; }
.practitioner-brief .brief-kpis .stat-tile { flex: 1 1 130px; min-width: 130px; padding: 11px 13px; }
.practitioner-brief .brief-kpis .stat-value { font-size: 21px; }

/* chart plain framing */
.viz-read {
  margin: 2px 0 12px; padding: 10px 14px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--grid));
}
.viz-read .kicker { margin: 0 0 3px; color: var(--accent-ink); }
.viz-read p:last-child { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.viz-takeaway { margin: 10px 0 2px; font-size: 14.5px; color: var(--ink); }
.viz-takeaway span { font-weight: 650; }
.viz-technical { margin: 8px 0 0; }
.viz-technical > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.viz-technical p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; }

.finding-callout.demoted { border-left-color: var(--baseline); box-shadow: none; }
.finding-callout.demoted .finding-label { color: var(--muted); }
details.finding-callout > summary { cursor: pointer; list-style: none; }
details.finding-callout > summary::-webkit-details-marker { display: none; }
details.finding-callout > summary::before { content: "▸ "; color: var(--muted); }
details.finding-callout[open] > summary::before { content: "▾ "; }

/* ------------------------------------------------------------ native charts */

.viz-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.viz-chart {
  margin: 0; padding: 16px 18px 12px;
  background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.viz-chart figcaption { margin-bottom: 13px; }
.viz-chart figcaption strong { display: block; font-family: var(--display); font-weight: 550; font-size: 18px; line-height: 1.3; letter-spacing: -0.005em; }
.viz-chart figcaption .muted { display: block; font-size: 13.5px; margin-top: 4px; max-width: 62ch; }
.viz-axes { font-size: 12px; margin: 0 0 8px; letter-spacing: 0.01em; }
.viz-axes b { color: var(--ink-2); font-weight: 600; }
.viz-svg { display: block; width: 100%; height: auto; }
.viz-svg text { paint-order: stroke; }
.viz-svg [data-viz-series-line] { transition: opacity 0.12s; }
.viz-svg [data-viz-pt] { cursor: pointer; }
.viz-svg [data-viz-pt]:hover { opacity: 0.8; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.viz-key {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px var(--sans); color: var(--ink-2);
  background: var(--page); border: 1px solid var(--grid); border-radius: 999px;
  padding: 3px 10px; cursor: pointer;
}
.viz-key .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.viz-key:hover { border-color: var(--baseline); }
.viz-key.off { opacity: 0.45; }
.viz-key.off .dot { background: var(--muted) !important; }
.viz-src { font-size: 12px; margin: 8px 0 2px; }
.viz-chart .chart-table summary { cursor: pointer; font-size: 12px; color: var(--accent-ink); padding: 4px 0; }
.viz-chart .chart-table .table-wrap { max-height: 260px; overflow-y: auto; margin: 8px 0; }
.viz-tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--ink); color: var(--page);
  font: 500 12px var(--sans); padding: 5px 9px; border-radius: 6px;
  box-shadow: 0 2px 10px rgba(11, 11, 11, 0.2);
  max-width: 260px;
}
.card-thumb .viz-mini { display: block; width: 100%; height: 170px; padding: 10px 10px 4px; }

/* ---------------------------------------------------------- activity chart */

.activity-chart {
  margin: 0 0 6px; padding: 14px 16px 8px;
  background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius);
}
.activity-chart figcaption { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.activity-chart svg { display: block; width: 100%; max-height: 150px; }
.activity-chart svg a { cursor: pointer; }
.activity-chart svg a:hover rect, .activity-chart svg a:focus rect { opacity: 0.72; }
.activity-chart .chart-table summary { cursor: pointer; font-size: 12px; color: var(--accent-ink); padding: 4px 0; }
.activity-chart .chart-table .table-wrap { max-height: 220px; overflow-y: auto; }

/* -------------------------------------------------------------- explorer */

.filter-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  position: sticky; top: 54px; z-index: 5;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(6px);
  padding: 10px 0; border-bottom: 1px solid var(--grid); margin-bottom: 18px;
}
.filter-row input[type="search"], .filter-row select {
  font: 14px var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 11px;
}
.filter-row select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4.5l4 4 4-4' stroke='%23656b78' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.filter-row select:hover { border-color: var(--baseline); }
.filter-row input[type="search"] { flex: 1 1 220px; min-width: 180px; }
.explorer-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 14px; }
.explorer-item[hidden] { display: none; }

/* status segmented control (Finished / In progress / All) */
.seg {
  display: inline-flex; gap: 2px; padding: 3px; margin: 6px 0 14px;
  background: var(--surface); border: 1px solid var(--grid); border-radius: 10px; max-width: 100%; flex-wrap: wrap;
}
.seg-btn {
  font: 600 13.5px var(--sans); color: var(--ink-2); background: transparent; border: 0;
  border-radius: 8px; padding: 7px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-selected="true"] { background: var(--page); color: var(--ink); box-shadow: inset 0 0 0 1px var(--grid); }
.seg-n { font: 600 11px var(--mono); color: var(--muted); background: var(--page); border-radius: 999px; padding: 1px 7px; }
.seg-btn[aria-selected="true"] .seg-n { background: var(--surface); color: var(--accent-ink); }
.explorer-provenance { margin: 2px 0 0; }
.explorer-provenance summary { cursor: pointer; font-size: 13px; color: var(--accent-ink); }
.explorer-provenance p { max-width: 74ch; font-size: 13.5px; margin: 8px 0 0; }

/* --------------------------------------------------------- detail layout */

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 40px; }
.detail-side { min-width: 0; }
.detail-main { min-width: 0; } /* grid children size by min-content otherwise */
.side-toc { position: sticky; top: 70px; font-size: 13px; max-height: calc(100vh - 90px); overflow: auto; }
.side-toc p { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; margin: 0 0 6px; }
.side-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--grid); }
.side-toc ol ol { border-left: 0; margin-left: 10px; }
.side-toc li a { display: block; padding: 3px 0 3px 12px; color: var(--ink-2); }
.side-toc li a:hover { color: var(--ink); text-decoration: none; }
.side-toc li.lv3 a { padding-left: 24px; font-size: 12px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 4px 0 2px; }
.crumbs a { color: var(--ink-2); }
.detail-main h1 { font-size: 28px; margin: 6px 0 10px; line-height: 1.25; letter-spacing: -0.01em; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.chip.gh { margin-left: auto; }

.finding-callout {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--baseline); border-radius: var(--radius);
  padding: 15px 20px; margin: 0 0 28px; box-shadow: var(--shadow);
}
.finding-callout .finding-label {
  margin: 0 0 5px; font: 500 11px var(--mono);
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
}
.finding-callout p:last-child { line-height: 1.62; }
.finding-callout p:last-child { margin: 0; color: var(--ink); }
.finding-more { white-space: nowrap; font-weight: 600; font-size: 0.94em; }

.doc-section { margin: 0 0 40px; }
.doc-section > h2 {
  font-size: 24px; font-weight: 550; margin: 0 0 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.doc-src { font-size: 13px; margin: 0 0 10px; }
.pager-row { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; font-size: 14px; }
.pager { max-width: 46%; display: inline-flex; flex-direction: column; gap: 2px; }
.pager.next { text-align: right; }
.pager-dir { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.log-details > summary { cursor: pointer; color: var(--accent-ink); font-size: 14px; }

.mobile-toc { display: none; }
.empty-note { color: var(--ink-2); padding: 20px 0; }
.empty-note button, #filter-reset {
  font: 600 13px var(--sans); color: var(--accent-ink);
  background: var(--surface); border: 1px solid var(--grid); border-radius: 8px;
  padding: 6px 12px; cursor: pointer;
}
#filter-reset:hover { border-color: var(--baseline); }
.claim-card:target, .queue-card:target {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* --------------------------------------------------- rendered markdown */

.doc-section h3, .doc-page h2 { font-size: 20px; font-weight: 550; margin: 30px 0 9px; }
.doc-section h4, .doc-page h3 { font-size: 17px; font-weight: 550; margin: 22px 0 6px; }
.doc-page h4, .doc-section h5 { font-size: 15px; font-weight: 600; margin: 20px 0 5px; letter-spacing: 0.005em; }
/* cap the reading measure on rendered prose (program/notebook pages have no sidebar) */
.doc-section p, .doc-page p { margin: 11px 0; line-height: 1.68; max-width: 74ch; }
.doc-section li, .doc-page li { margin: 5px 0; line-height: 1.6; max-width: 74ch; }
.doc-section blockquote, .doc-page blockquote { max-width: 74ch; }
.doc-section img, .doc-page img { max-width: 100%; height: auto; border: 1px solid var(--grid); border-radius: 8px; background: #fff; }
.doc-section blockquote, .doc-page blockquote {
  margin: 12px 0; padding: 2px 16px; border-left: 3px solid var(--baseline); color: var(--ink-2);
}
.doc-section hr, .doc-page hr { border: 0; border-top: 1px solid var(--grid); margin: 22px 0; }
pre {
  background: var(--surface); border: 1px solid var(--grid); border-radius: 8px;
  padding: 12px 14px; overflow: auto; line-height: 1.5;
}
:not(pre) > code { background: var(--surface); border: 1px solid var(--grid); border-radius: 5px; padding: 1px 5px; }
pre code { border: 0; background: none; padding: 0; }

.table-wrap {
  overflow-x: auto; margin: 14px 0; border: 1px solid var(--grid); border-radius: 8px;
  /* scroll shadows: hint that wide tables pan sideways */
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 40px 100%,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 40px 100%,
    radial-gradient(farthest-side at 0 50%, var(--ring), transparent) left / 14px 100%,
    radial-gradient(farthest-side at 100% 50%, var(--ring), transparent) right / 14px 100%;
  background-repeat: no-repeat;
  background-color: var(--surface);
  background-attachment: local, local, scroll, scroll;
}
.md-table { border-collapse: collapse; width: 100%; font-size: 14px; background: transparent; }
.md-table th, .md-table td { padding: 7px 12px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: top; }
.md-table td { font-variant-numeric: tabular-nums; }
.md-table tbody tr:last-child td { border-bottom: 0; }
.md-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.md-table th { font-weight: 600; white-space: nowrap; background: var(--page); cursor: pointer; user-select: none; }
.md-table th::after { content: ""; display: inline-block; width: 0.9em; }
.md-table th.sort-asc::after { content: " \2191"; color: var(--accent-ink); }
.md-table th.sort-desc::after { content: " \2193"; color: var(--accent-ink); }

/* ---------------------------------------------------------------- figures */

.fig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.fig-card { margin: 0; background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius); overflow: hidden; }
.fig-card:hover { border-color: var(--baseline); }
.fig-link { display: block; background: #fff; }
.fig-link img { display: block; width: 100%; height: 180px; object-fit: contain; padding: 6px; border: 0; border-radius: 0; }
.fig-card figcaption { padding: 8px 12px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--grid); }

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 10, 10, 0.88);
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1100px, 88vw); max-height: 88vh; display: flex; flex-direction: column; }
.lightbox img { max-width: 100%; max-height: 80vh; object-fit: contain; background: #fff; border-radius: 8px; }
.lightbox figcaption { color: #d3d8e0; font-size: 13px; padding: 10px 2px; font-family: var(--mono); }
.lightbox button:focus-visible { outline-color: #fff; }
.fig-link:focus-visible { outline-offset: -3px; } /* inset so the card's overflow:hidden doesn't clip it */
.lightbox button {
  background: rgba(255, 255, 255, 0.12); color: #fff; border: 0; border-radius: 999px;
  width: 42px; height: 42px; font-size: 17px; cursor: pointer; flex: none;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.24); }
.lightbox .lightbox-close { position: absolute; top: 18px; right: 18px; }

/* ------------------------------------------------------------- data files */

.data-list { list-style: none; margin: 0; padding: 0; }
.data-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.data-row:last-child { border-bottom: 0; }
.data-row a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.data-row .muted { margin-left: auto; font-size: 12px; white-space: nowrap; }
.data-preview, .data-viewer-close {
  font: 600 12px var(--sans); color: var(--accent-ink);
  background: var(--surface); border: 1px solid var(--grid); border-radius: 6px;
  padding: 3px 10px; cursor: pointer;
}
.data-preview:hover, .data-viewer-close:hover { border-color: var(--baseline); }
.data-viewer { margin-top: 14px; border: 1px solid var(--grid); border-radius: var(--radius); background: var(--surface); }
.data-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--grid); }
.data-viewer-body { padding: 12px; max-height: 480px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.data-viewer-body details { padding-left: 16px; }
.data-viewer-body summary { cursor: pointer; color: var(--ink-2); }
.data-viewer-body .json-key { color: var(--accent-ink); }
.data-viewer-body .md-table { font-family: var(--sans); font-size: 12.5px; }
.data-viewer-body .md-table th { background: var(--surface-2); position: sticky; top: 0; }
.data-viewer-body .json-num { color: var(--ink); font-weight: 600; }
.data-viewer-body .json-str { color: var(--ink-2); }

/* ---------------------------------------------------- programs & claims */

.program-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.program-card {
  display: block; background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius);
  padding: 16px 18px; color: var(--ink); box-shadow: var(--shadow);
}
.program-card:hover { text-decoration: none; border-color: var(--baseline); }
.program-card .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--slot-0); }
.program-card[data-slot="1"] .dot { background: var(--slot-1); }
.program-card[data-slot="2"] .dot { background: var(--slot-2); }
.program-card[data-slot="3"] .dot { background: var(--slot-3); }
.program-card[data-slot="4"] .dot { background: var(--slot-4); }
.program-card[data-slot="5"] .dot { background: var(--slot-5); }
.program-card[data-slot="6"] .dot { background: var(--slot-6); }
.program-card[data-slot="7"] .dot { background: var(--slot-7); }
.program-card[data-slot="8"] .dot { background: var(--slot-8); }
.program-card h3 { margin: 6px 0 6px; font-size: 17px; }
.program-card p { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }

.claim-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.claim-filter {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer; font: inherit;
  background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius); padding: 10px 14px; min-width: 90px; color: var(--ink);
}
.claim-filter:hover { border-color: var(--baseline); }
.claim-filter[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.claim-filter .stat-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.claim-filter .stat-value { font-size: 22px; font-weight: 650; line-height: 1.05; }
.claim-card[hidden], .claim-group[hidden] { display: none; }

.claim-group h2 { font-size: 20px; margin: 30px 0 12px; }
.claim-card {
  background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.claim-card h3 { margin: 8px 0 6px; font-size: 17px; }
.claim-card p { margin: 6px 0; font-size: 14.5px; color: var(--ink-2); }
.claim-card .claim-implication { color: var(--ink); }
.claim-card details { margin: 8px 0; font-size: 14px; }
.claim-card summary { cursor: pointer; color: var(--accent-ink); }
.claim-id { font: 600 12px var(--mono); color: var(--muted); }
.claim-card .card-chips { margin-top: 10px; }

.exp-list li { padding: 9px 0; border-bottom: 1px solid var(--grid); }
.exp-list li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ queue */

.queue-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.queue-col > h2 { font-size: 16px; margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--grid); }
.queue-p0 > h2 { border-left: 3px solid var(--accent); }
.queue-p1 > h2 { border-left: 3px solid color-mix(in srgb, var(--accent) 62%, var(--surface)); }
.queue-p2 > h2 { border-left: 3px solid color-mix(in srgb, var(--accent) 34%, var(--surface)); }
.queue-card {
  background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 10px;
}
.queue-card h3 { margin: 6px 0; font-size: 15px; }
.queue-card p { margin: 4px 0; font-size: 13.5px; color: var(--ink-2); }
.queue-card details { font-size: 13.5px; margin-top: 6px; }
.queue-card summary { cursor: pointer; color: var(--accent-ink); }
.chip.effort { color: var(--muted); }
.chip.prio { font: 600 12px var(--mono); }
.chip.prio-p0 { color: #fff; background: var(--accent); border-color: var(--accent); }
.chip.prio-p1 { color: var(--accent-ink); background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.chip.prio-p2 { color: var(--ink-2); }

/* ------------------------------------------------------------- home split */

.split-band { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; align-items: start; }
.split-a, .split-b { min-width: 0; }
.split-b { position: sticky; top: 74px; align-self: start; } /* track the long exec-read column */
@media (max-width: 980px) { .split-b { position: static; } }
.exec-read ol { padding-left: 20px; }
.exec-read li { margin: 10px 0; color: var(--ink-2); }
.exec-read li code { color: var(--ink); }

/* plain-language "what we've learned" takeaways */
.learned-arc { font-size: 18.5px; line-height: 1.6; color: var(--ink); max-width: 60ch; margin: 0 0 26px; }
.learned-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.learned-item { display: flex; gap: 14px; }
.learned-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 9px; flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 0%, transparent); }
.learned-item h3 { margin: 0 0 5px; font-size: 19px; font-weight: 550; line-height: 1.28; }
.learned-item p { margin: 0; font-size: 15px; line-height: 1.62; color: var(--ink-2); max-width: 58ch; }
.learned-panel {
  background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: var(--radius); padding: 20px 24px 22px; margin: 0 0 36px;
}
.learned-panel > .kicker { color: var(--accent-ink); margin: 0 0 16px; }
.learned-panel .learned-arc { font-size: 17.5px; }
.learned-panel-note { margin: 18px 0 0; font-size: 13px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .detail-layout, .split-band { grid-template-columns: 1fr; }
  .detail-side { display: none; }
  .mobile-toc {
    display: block; margin: 0 0 22px; padding: 10px 14px;
    background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius);
    font-size: 14px;
  }
  .mobile-toc summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; }
  .mobile-toc ol { list-style: none; margin: 8px 0 0; padding: 0; }
  .mobile-toc li a { display: block; padding: 6px 0; color: var(--ink-2); }
  .mobile-toc ol ol { margin: 0 0 0 14px; }
  .topnav { overflow-x: auto; }
  .site-search input { width: 140px; }
  .site-search input:focus { width: 180px; }
  .wordmark { display: none; }
}
@media (max-width: 640px) {
  main { padding: 18px 14px 60px; }
  /* the topbar wraps: brand + tools on row one, nav gets the full second row */
  .topbar { padding: 8px 14px; gap: 10px; flex-wrap: wrap; row-gap: 4px; }
  .topnav { order: 3; flex-basis: 100%; justify-content: space-between; }
  .topnav a { padding: 9px 5px; font-size: 12.5px; }
  .topbar-tools { margin-left: auto; flex: 1 1 auto; justify-content: flex-end; }
  .site-search { position: static; flex: 1; max-width: 240px; }
  .site-search input, .site-search input:focus { width: 100%; padding: 9px 10px; }
  #search-results { left: 12px; right: 12px; width: auto; } /* anchors to the sticky topbar */
  .gh-link { padding: 9px 4px; }
  [id] { scroll-margin-top: 128px; } /* two-row sticky topbar (~116px) + breathing room */
  .filter-row { position: static; }
  /* sub-16px inputs make iOS Safari zoom the page on focus */
  .site-search input, .filter-row input[type="search"], .filter-row select { font-size: 16px; }
  .lightbox { padding: 8px; gap: 0; }
  .lightbox figure { max-width: 97vw; }
  .lightbox img { max-width: 97vw; max-height: 74vh; }
  .lightbox .lightbox-prev { position: absolute; bottom: 14px; left: 14px; }
  .lightbox .lightbox-next { position: absolute; bottom: 14px; right: 14px; }
  .feed-grid, .explorer-list { grid-template-columns: 1fr; }
  .stat-value { font-size: 24px; }
  .claim-pill { padding: 8px 11px; }
  .pager-row { flex-direction: column; }
  .pager { max-width: 100%; }
  .pager.next { text-align: left; }
}
