/* NNUE neuron atlas: static UI. Colours are tokens; dark values are stepped, not inverted. */
:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6e69;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.12);
  --link: #1c5cab;
  --accent: #2a78d6;
  --focus: #2a78d6;
  --mark: #2a78d6;
  --mark-2: #eb6834;
  --code-bg: #f0efec;
  --banner-bg: #fff4d6;
  --banner-ink: #5c4300;
  --sq-light: #ede0c8;
  --sq-dark: #b48a64;
  --sq-coord-light: #8a6847;
  --sq-coord-dark: #f4ead9;
  --st-solved: #0ca30c;
  --st-partial: #9fd38a;
  --st-unresolved: #fab219;
  --st-dead: #898781;
  --st-pending: #f0efec;
  --fc: #6a4fd1;
  --o2o: #08775b;
  --ft: #9a5200;
  --fxa: #2a6fca;
  --fxb: #b8327f;
  --pos: #e34948;
  --neg: #2a78d6;
  --pass: #0a7a0a;
  --fail: #c0392b;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #383835;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #a3a29b;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.12);
    --link: #86b6ef;
    --accent: #3987e5;
    --focus: #86b6ef;
    --mark: #3987e5;
    --mark-2: #d95926;
    --code-bg: #232322;
    --banner-bg: #3a2e0c;
    --banner-ink: #f7dc9a;
    --sq-light: #c9b79c;
    --sq-dark: #8b6a4d;
    --sq-coord-light: #6b4f36;
    --sq-coord-dark: #efe2cc;
    --st-pending: #383835;
    --fc: #a896f5;
    --o2o: #3cc59f;
    --ft: #f0a24a;
    --fxa: #6aa6ef;
    --fxb: #ec7fbd;
    --pos: #e66767;
    --neg: #3987e5;
    --pass: #5fd35f;
    --fail: #ff7b6b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #383835;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #a3a29b;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.12);
  --link: #86b6ef;
  --accent: #3987e5;
  --focus: #86b6ef;
  --mark: #3987e5;
  --mark-2: #d95926;
  --code-bg: #232322;
  --banner-bg: #3a2e0c;
  --banner-ink: #f7dc9a;
  --sq-light: #c9b79c;
  --sq-dark: #8b6a4d;
  --sq-coord-light: #6b4f36;
  --sq-coord-dark: #efe2cc;
  --st-pending: #383835;
  --fc: #a896f5;
  --o2o: #3cc59f;
  --ft: #f0a24a;
  --fxa: #6aa6ef;
  --fxb: #ec7fbd;
  --pos: #e66767;
  --neg: #3987e5;
  --pass: #5fd35f;
  --fail: #ff7b6b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  overflow-wrap: anywhere;
}
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.4em; }
h1 { font-size: 1.45rem; font-weight: 600; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: 0.95rem; font-weight: 600; color: var(--ink-2); }
p { margin: 0 0 0.6em; }
code, pre { font-family: var(--mono); font-size: 0.85em; }
.quiet { color: var(--muted); font-style: italic; }
.small { font-size: 0.85em; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* top bar */
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 650; color: var(--ink); text-decoration: none; }
.navlink { color: var(--link); font-size: 0.9em; }
.netname { color: var(--ink-2); font-size: 0.9em; flex: 1 1 auto; }
.top button, .btn {
  font: inherit; font-size: 0.85em; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.btn[aria-pressed="true"], .seg button[aria-pressed="true"] {
  background: var(--ink); color: var(--surface); border-color: var(--ink);
}
.banner {
  background: var(--banner-bg); color: var(--banner-ink); padding: 8px 16px; font-size: 0.9em;
  border-bottom: 1px solid var(--border);
}
main { max-width: 1240px; margin: 0 auto; padding: 16px; }
main:focus { outline: none; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin: 0 0 14px; min-width: 0;
}
.card > h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.card > h2 .small { font-weight: 400; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 14px; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 0 0 12px; }
.controls label { font-size: 0.9em; color: var(--ink-2); }
.search {
  font: inherit; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--axis);
  background: var(--surface); color: var(--ink); width: min(100%, 320px);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; }
.chips legend, .seg legend { font-size: 0.8em; color: var(--muted); padding: 0; margin-bottom: 2px; }
.chip-check { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85em; color: var(--ink);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px 2px 6px; background: var(--surface); cursor: pointer; }
.chip-check input { margin: 0; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 0; padding: 0; margin: 0; }
.seg .opts { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { font: inherit; font-size: 0.85em; background: var(--surface); color: var(--ink); border: 0;
  border-right: 1px solid var(--border); padding: 4px 10px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.range { display: inline-flex; align-items: center; gap: 6px; }
.range input { width: 120px; }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 0.82em; color: var(--ink-2); margin: 4px 0 10px; }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; border: 1px solid var(--border); }
.legend .ramp { display: inline-block; width: 140px; height: 12px; border-radius: 3px; vertical-align: -2px; margin: 0 6px; border: 1px solid var(--border); }
.legend .mk { position: relative; display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; background: var(--surface-2); border-radius: 3px; --fg: var(--ink); }

/* network: cells */
.cell {
  position: relative; display: block; border-radius: 3px; text-decoration: none; color: var(--fg, var(--ink));
  min-width: 0; transition: opacity 120ms;
}
.cell:hover { outline: 2px solid var(--ink); outline-offset: 0; z-index: 1; }
.dim .cell.off { opacity: 0.16; }
.cell[data-status="solved"]::after, .cell[data-status="unresolved"]::after, .mk.solved::after, .mk.unresolved::after,
.cell[data-status="partial"]::after, .mk.partial::after {
  content: ""; position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; border-radius: 50%;
}
.cell[data-status="solved"]::after, .mk.solved::after { background: var(--fg, var(--ink)); }
/* partial: half-filled dot (filled solved, ring unresolved), so the status does not rely on colour alone */
.cell[data-status="partial"]::after, .mk.partial::after {
  border: 1.5px solid var(--fg, var(--ink)); width: 7px; height: 7px;
  background: linear-gradient(90deg, var(--fg, var(--ink)) 50%, transparent 50%);
}
.cell[data-status="unresolved"]::after, .mk.unresolved::after { border: 1.5px solid var(--fg, var(--ink)); width: 7px; height: 7px; }
.cell[data-status="dead"], .mk.dead {
  background-image: linear-gradient(135deg, transparent 44%, var(--fg, var(--ink)) 45%, var(--fg, var(--ink)) 55%, transparent 56%) !important;
  background-blend-mode: normal;
}
.pairs { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; max-width: 980px; }
.pc { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 3fr 2fr; gap: 1px; aspect-ratio: 1; min-width: 0; }
.pc .p { grid-column: 1 / 3; font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.pc .f { font-size: 9px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.pc .f::after { top: 1px !important; right: 1px !important; width: 4px !important; height: 4px !important; }
.stacks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.stack { min-width: 0; }
.stack .sh { font-size: 0.8em; color: var(--ink-2); margin-bottom: 4px; line-height: 1.3; min-height: 4em; }
.stack .sh b { color: var(--ink); }
.stack .lab { font-size: 0.7em; color: var(--muted); margin: 4px 0 2px; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.g4 .cell { aspect-ratio: 1; }
.g4 .cell.skip { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.flow { font-size: 0.82em; color: var(--ink-2); margin: 0 0 8px; }

/* results table */
.tbl-wrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 0.86em; }
.tbl th, .tbl td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; overflow-wrap: normal; }
.tbl td.lab { min-width: 13em; }
.tbl th { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.tbl th button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.id { white-space: nowrap; font-family: var(--mono); font-size: 0.95em; }
.st { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.st i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--border); }

/* unit page */
.crumbs { font-size: 0.85em; color: var(--ink-2); margin-bottom: 6px; }
.unit-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; }
.unit-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; border-radius: 999px;
  padding: 2px 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); letter-spacing: 0.02em; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip.mock { background: var(--banner-bg); color: var(--banner-ink); }
.pager { display: flex; gap: 8px; font-size: 0.85em; }
.label-big { font-size: 1.08rem; margin: 2px 0 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 0.9em; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.metrics { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 4px 0 6px; font-size: 0.9em; }
.metrics b { font-size: 1.15em; font-variant-numeric: tabular-nums; }
.metrics span { color: var(--ink-2); }
.bar { display: inline-block; height: 8px; border-radius: 0 4px 4px 0; background: var(--mark); vertical-align: middle; }
.bar.neg { background: var(--mark-2); border-radius: 4px 0 0 4px; }
.barcell { width: 40%; min-width: 80px; }
pre.code { background: var(--code-bg); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 6px 0; line-height: 1.45; }
blockquote { margin: 6px 0; padding: 6px 12px; border-left: 3px solid var(--axis); color: var(--ink-2); }
.subhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 14px 0 6px; }
.subhead h3 { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 0.85em; margin: 0 0 8px; color: var(--ink-2); }

/* histograms */
.hists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 10px 18px; }
.hist { max-width: 460px; }
.hist svg { width: 100%; height: auto; display: block; overflow: visible; }
.hist .t { font-size: 0.82em; color: var(--ink-2); margin-bottom: 2px; }
.hist rect.b { fill: var(--mark); }
.hist rect.hit { fill: transparent; }
.hist rect.hit:hover + rect.b, .hist g:hover rect.b { fill: var(--link); }
.hist .ax { stroke: var(--axis); stroke-width: 1; }
.hist .mkline { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.hist text { fill: var(--muted); font-size: 9px; font-family: var(--font); }

/* boards */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.bcard { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.bzoom { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in; border-radius: 4px; }
.bzoom:hover svg { outline: 2px solid var(--link); outline-offset: 1px; }
.bzoom:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.bcard .bzoom svg { width: 100%; height: auto; display: block; border-radius: 4px; }
.bedit { align-self: flex-start; margin-top: 5px; font: inherit; font-size: 0.76em; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.bedit:hover { border-color: var(--link); }

/* magnified board dialog */
dialog.zoom { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 14px; background: var(--surface);
  color: var(--ink); width: min(96vw, 760px); max-height: 96vh; overflow: auto; box-sizing: border-box; }
dialog.zoom::backdrop { background: rgba(0, 0, 0, 0.6); }
.zhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.zhead .small { flex: 1; text-align: center; color: var(--ink-2); }
.zbtn { font: inherit; font-size: 0.9em; padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-2); color: var(--ink); cursor: pointer; }
.zbtn:disabled { opacity: 0.4; cursor: default; }
.znav { font-size: 1.3em; line-height: 1; padding: 2px 12px; }
.zboard svg { display: block; width: min(100%, calc(96vh - 190px)); height: auto; margin: 0 auto; border-radius: 6px; }
.zcap { margin-top: 10px; font-size: 0.95em; color: var(--ink-2); line-height: 1.45; }
.zcap b { color: var(--ink); }
.zfen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: 0.85em; }
.zfen code { flex: 1 1 260px; overflow-wrap: anywhere; color: var(--ink-2); }
.zedit { font-weight: 600; }
.bcard figcaption { font-size: 0.78em; color: var(--ink-2); margin-top: 4px; line-height: 1.35; }
.bcard figcaption b { color: var(--ink); font-size: 1.1em; font-variant-numeric: tabular-nums; }
.sq-l { fill: var(--sq-light); }
.sq-d { fill: var(--sq-dark); }
.coord-l { fill: var(--sq-coord-light); font: 600 9px var(--font); }
.coord-d { fill: var(--sq-coord-dark); font: 600 9px var(--font); }
.coord-net { font-style: italic; }
.frame-help p { margin: 0 0 6px; font-size: 0.88em; color: var(--ink-2); max-width: 90ch; }
.pc-img { pointer-events: none; }
.kring { fill: rgba(42, 120, 214, 0.16); stroke: #2a78d6; stroke-width: 3; }

/* heatmaps */
.hm-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
figure.hm { margin: 0; min-width: 0; }
.hm figcaption, .hm-t { font-size: 0.78em; color: var(--ink-2); margin-bottom: 2px; }
.hm svg { width: 100%; height: auto; display: block; }
.hm .kq { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.kb-pick { display: grid; grid-template-columns: repeat(4, 34px); gap: 2px; }
.kb-pick button { font: 11px var(--mono); padding: 3px 0; border: 1px solid var(--border); border-radius: 3px;
  background: var(--surface-2); color: var(--ink); cursor: pointer; }
.kb-pick button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.hm-controls { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; margin-bottom: 10px; }
.hm-scale { display: inline-block; width: 120px; height: 10px; border-radius: 3px; vertical-align: middle; margin: 0 6px; border: 1px solid var(--border); }

/* matrices */
table.mat { border-collapse: separate; border-spacing: 1px; font-size: 10px; }
.mat th { font-weight: 500; color: var(--ink-2); padding: 0 3px; white-space: nowrap; }
.mat td { width: 18px; min-width: 14px; height: 16px; padding: 0; border-radius: 2px; }
.mat td a { display: block; width: 100%; height: 100%; }
.strip { display: grid; grid-template-columns: repeat(64, minmax(0, 1fr)); gap: 1px; margin: 2px 0 6px; }
.strip span { aspect-ratio: 1 / 2; border-radius: 1px; }

.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 320px;
  background: var(--ink); color: var(--surface); font-size: 12px; line-height: 1.35;
  padding: 6px 8px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); white-space: pre-line;
}
details > summary { cursor: pointer; color: var(--ink-2); font-size: 0.88em; }
.err { color: #d03b3b; }
.conds { font-size: 0.9em; margin: 6px 0; }
.cond { font-weight: 600; }

/* info toggletips (glossary) */
button.info {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 15px; height: 15px; margin: 0 0 0 4px; padding: 0; vertical-align: 0.08em;
  border: 1px solid var(--axis); border-radius: 50%; background: var(--surface); color: var(--ink-2);
  font: italic 700 10px/1 Georgia, "Times New Roman", serif; cursor: help;
}
button.info::before { content: ""; position: absolute; inset: -7px; } /* larger touch target */
button.info:hover, button.info[aria-expanded="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.term { white-space: nowrap; }
.gpop {
  position: absolute; z-index: 60; width: max-content; max-width: 380px; padding: 10px 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--axis); border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22); font-size: 0.84rem; line-height: 1.45; font-style: normal; font-weight: 400;
  text-align: left; white-space: normal;
}
.gpop b { display: block; margin-bottom: 2px; }
.gpop p { margin: 4px 0 0; }
.gpop .how { color: var(--ink-2); }
.gpop .how-k { font-weight: 600; }

/* connectome (network view) */
.flow-lead { max-width: 110ch; font-size: 0.92em; color: var(--ink-2); }
.flow-answer { max-width: 110ch; font-size: 0.92em; padding: 8px 12px; border-left: 3px solid var(--fc); background: var(--surface-2); border-radius: 0 6px 6px 0; }
.flow-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 0.88em; color: var(--ink-2); margin: 8px 0 6px; }
.flow-tools label { display: inline-flex; align-items: center; gap: 8px; }
.flow-tools input[type="range"] { width: min(220px, 50vw); }
.flow-out { font-variant-numeric: tabular-nums; color: var(--ink); }
.flow-slot { margin: 4px 0 8px; }
.flow-svg { display: block; width: 100%; height: auto; }
.flow-svg.narrow { max-width: 470px; margin: 0 auto; }
.flow-terms .term { margin-right: 2px; }
.fx-t { fill: var(--ink); font: 600 12px var(--font); }
.fx-s { fill: var(--ink-2); font: 11px var(--font); }
.fx-i { fill: var(--muted); font: 10px var(--font); }
.narrow .fx-t { font-size: 11.5px; }
.narrow .fx-s { font-size: 10.5px; }
.fx-halo { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.fx-bl { fill: var(--sq-light); }
.fx-bd { fill: var(--sq-dark); }
.fx-lines line, .fx-lines path { fill: none; }
.fx-arrow { stroke: var(--ink-2); stroke-width: 1.2; fill: none; }
.fx-arrhead { fill: var(--ink-2); }
.fx-lane { fill: var(--surface-2); fill-opacity: 0.5; stroke: var(--border); }
.fx-in { fill: var(--surface); stroke: var(--axis); }
.fx-in.on { fill: var(--ft); stroke: var(--ft); }
.fx-ftl { stroke: var(--ft); stroke-opacity: 0.5; stroke-width: 0.8; }
.fx-a { fill: var(--fxa); }
.fx-b { fill: var(--fxb); }
.fx-o2o { stroke: var(--o2o); stroke-width: 1.2; }
.fx-p { fill: var(--surface); stroke: var(--o2o); stroke-width: 1.4; }
.fx-x { fill: var(--o2o); font: 700 9px var(--font); }
.fx-copy { stroke: var(--axis); stroke-width: 1; }
.fx-cat { fill: var(--surface-2); stroke: var(--axis); }
.fx-catdot { fill: var(--ink-2); }
.fx-fcl { stroke: var(--fc); stroke-opacity: 0.28; stroke-width: 0.7; }
.fx-fcl.fx-dense { stroke-opacity: 0.12; stroke-width: 0.6; }
.fx-fcl.fx-legline { stroke-opacity: 0.7; stroke-width: 1; }
.fx-fc0, .fx-fc1, .fx-fc2 { fill: var(--fc); }
.fx-ac0 { fill: var(--o2o); }
.fx-skipnode { fill: var(--surface); stroke: var(--fc); stroke-width: 1.8; }
.fx-skip { stroke: var(--fc); stroke-width: 1.5; stroke-dasharray: 5 3; fill: none; }
.fx-psqt { stroke: var(--ft); stroke-width: 1.5; stroke-dasharray: 5 3; fill: none; }
.fx-psqtbox { fill: var(--surface); stroke: var(--ft); stroke-dasharray: 5 3; }
.fx-sum { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.fx-plus { fill: var(--ink); font: 700 15px var(--font); }
.fx-evalbox { fill: var(--surface-2); stroke: var(--ink); stroke-width: 1.2; }
.fx-panel { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.fx-funnel { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 3; }
.fx-cline { stroke: var(--axis); stroke-width: 1; }
.fx-cline.on { stroke: var(--ink); stroke-width: 2; }
.fx-contact { fill: var(--surface); stroke: var(--axis); }
.fx-contact.on { fill: var(--ink); stroke: var(--ink); }
.fx-arm { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.fx-pivot { fill: var(--ink); }
.fx-selbox { fill: var(--surface); stroke: var(--axis); stroke-dasharray: 3 3; }
.fx-st { fill: var(--muted); font: 600 11px var(--font); }
.fx-sp { fill: var(--muted); font: 9.5px var(--font); }
.fx-sel.on .fx-selbox { fill: var(--ink); stroke: var(--ink); stroke-dasharray: none; }
.fx-sel.on .fx-st, .fx-sel.on .fx-sp { fill: var(--surface); }
.fx-run { fill: var(--ink); font: 700 10px var(--font); }
.fx-idle { fill: var(--muted); font: italic 9.5px var(--font); }
.fx-legidle { fill: var(--surface); stroke: var(--axis); stroke-dasharray: 3 3; }
.fx-hit { cursor: pointer; outline: none; }
.fx-hitbox { fill: transparent; stroke: transparent; }
.fx-hit:hover .fx-hitbox, .fx-hit:focus-visible .fx-hitbox { stroke: var(--link); stroke-width: 1.6; }
.fx-sel:hover .fx-selbox, .fx-sel:focus-visible .fx-selbox { stroke: var(--link); stroke-width: 2.2; stroke-dasharray: none; }
.fx-sel:not(.on):hover .fx-st, .fx-sel:not(.on):focus-visible .fx-st { fill: var(--link); }
.fx-pill { color: var(--ink-2); }
.fx-pill rect { fill: var(--surface); stroke: currentColor; stroke-width: 1; }
.fx-pill text { fill: currentColor; font: 600 10.5px var(--font); }
.fx-badge rect { fill: currentColor; }
.fx-badge text { fill: var(--surface); font: 700 10px var(--font); }
.fx-pill.fc, .fx-badge.fc { color: var(--fc); }
.fx-pill.o2o, .fx-badge.o2o { color: var(--o2o); }
.fx-pill.ft, .fx-badge.ft { color: var(--ft); }
.fx-badge.sw { color: var(--ink); }

/* mini-connectome (unit page) */
.mini-slot { margin: 2px 0 4px; }
.mini-svg { display: block; width: 100%; height: auto; max-width: 880px; }
.mini-svg.narrow { max-width: 440px; }
.mc-lab { fill: var(--ink-2); font: 600 11px var(--font); }
.mc-lab.on { fill: var(--ink); font-weight: 800; }
.mc-sub { fill: var(--muted); font: 9.5px var(--font); }
.mc-lane { fill: var(--muted); font: 8.5px var(--font); }
.mc-box { fill: var(--surface-2); stroke: var(--axis); }
.mc-box.mc-dn { fill: var(--surface); stroke: var(--mark-2); stroke-width: 2; }
.mc-in { fill: var(--ink-2); font: 9.5px var(--font); }
.mc-bar { fill: var(--surface-2); stroke: var(--axis); stroke-width: 0.6; }
.mc-skipbar { fill: var(--surface); stroke: var(--fc); stroke-width: 1; }
rect.mc-hi { fill: var(--ink); }
rect.mc-up { fill: var(--mark); }
rect.mc-dn { fill: var(--mark-2); }
.mc-stkbox { fill: var(--surface); stroke: var(--axis); }
.mc-stkt { fill: var(--ink-2); font: 600 9.5px var(--font); }
.mc-stkg.idle .mc-stkbox { stroke-dasharray: 2 2; }
.mc-stkg.idle .mc-stkt { fill: var(--muted); }
.mc-stkg.mc-hi .mc-stkbox { fill: var(--ink); stroke: var(--ink); stroke-dasharray: none; }
.mc-stkg.mc-hi .mc-stkt { fill: var(--surface); }
.mc-stkg.mc-dn .mc-stkbox { stroke: var(--mark-2); stroke-width: 2; stroke-dasharray: none; }
.mc-cellbox { fill: var(--surface); stroke: var(--axis); }
.mc-cellbox.dashed { stroke-dasharray: 4 3; }
a.mc-cell, .mc-cell.fx-hit { cursor: pointer; outline: none; }
a.mc-cell:hover .mc-cellbox, a.mc-cell:focus-visible .mc-cellbox, .mc-cell.fx-hit:hover .mc-cellbox, .mc-cell.fx-hit:focus-visible .mc-cellbox { stroke: var(--link); stroke-width: 2; }
a.mc-cell:focus-visible .mc-cellbox { stroke-width: 3; }
.mc-cname { fill: var(--ink); font: 600 10.5px var(--font); }
.mc-csub { fill: var(--ink-2); font: 9.5px var(--font); }
a.mc-cell .mc-cname { fill: var(--link); }
.mc-cbox { fill: var(--ink); }
.mc-center .mc-cname, .mc-center .mc-csub { fill: var(--surface); }
.mc-edge { fill: none; stroke-linecap: round; stroke-opacity: 0.85; }
.mc-edge.pos { stroke: var(--pos); }
.mc-edge.neg { stroke: var(--neg); }
.mc-edge.o2o { stroke: var(--o2o); }
.mc-edge.dashed { stroke-dasharray: 4 3; }
.mini-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 2px 0 0; }
.mini-legend .lg { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-left: 8px; border: 1px solid var(--border); }
.mini-legend .lg:first-child { margin-left: 0; }
.mini-legend .lg.hi { background: var(--ink); }
.mini-legend .lg.up { background: var(--mark); }
.mini-legend .lg.dn { background: var(--mark-2); }
.mini-legend .lg.idle { background: var(--surface); border: 1px dashed var(--axis); }

/* example sections, percentile examples, counterexamples */
.exnote { max-width: 100ch; margin-top: -2px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.qsec { margin: 4px 0 14px; }
.qtitle { font-size: 0.88em; margin-bottom: 6px; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px 18px; }
.qgroup { min-width: 0; }
.qhead { font-size: 0.82em; color: var(--ink-2); margin-bottom: 4px; }
.qhead b { color: var(--ink); }
.qboards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qboards .bcard figcaption { font-size: 0.72em; }
.ptrack { display: block; width: 100%; max-width: 260px; height: auto; margin: 3px 0 2px; }
.pt-axis { stroke: var(--axis); stroke-width: 2; }
.pt-tick { stroke: var(--axis); stroke-width: 1; }
.pt-lab { fill: var(--muted); font: 8px var(--font); }
.pt-gap { stroke: var(--mark-2); stroke-width: 3; stroke-opacity: 0.55; }
.pt-act { fill: var(--ink); }
.pt-pred { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.pt-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.pt-dot.act { background: var(--ink); }
.pt-dot.pred { border: 2px solid var(--ink); width: 9px; height: 9px; }
.cxkind { display: inline-block; font-weight: 700; font-size: 0.95em; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 8px; margin-bottom: 3px; }
.cxkind.scorer_too_low::before { content: "↓ "; }
.cxkind.scorer_too_high::before { content: "↑ "; }
.cxrow b { font-size: 1em !important; }
.cxnote { display: block; color: var(--ink-2); margin-top: 2px; }
.conds-tbl td .pass { color: var(--pass); font-weight: 600; white-space: nowrap; }
.conds-tbl td .fail { color: var(--fail); font-weight: 600; white-space: nowrap; }
details.vgroup { margin: 6px 0; }
details.vgroup > summary { font-weight: 600; color: var(--ink-2); }
details.vgroup > p { margin: 4px 0; }
.head-actions { margin: 8px 0 0; }

/* jump targets */
@keyframes atlas-flash { from { box-shadow: 0 0 0 3px var(--link); } to { box-shadow: 0 0 0 3px transparent; } }
.flash { animation: atlas-flash 1.6s ease-out; border-radius: 6px; }

/* footer */
.foot { max-width: 1240px; margin: 0 auto; padding: 0 16px 24px; font-size: 0.78em; color: var(--muted); }
.foot a { color: inherit; }

@media (max-width: 560px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { margin-top: 6px; }
  .kv dd { padding-left: 10px; }
}
@media (max-width: 760px) {
  .pairs { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .stacks { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 10px; }
  .stack .sh { min-height: 5.4em; }
  .card { padding: 12px; }
  h1 { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cell { transition: none; }
  .flash { animation: none; outline: 3px solid var(--link); outline-offset: 2px; }
}
@media (forced-colors: active) {
  .cell { border: 1px solid CanvasText; }
}

.evalline { font-size: 0.82em; color: var(--ink-2); margin-bottom: 2px; }
.evalline b { color: var(--ink); font-variant-numeric: tabular-nums; }

.effect-line { margin: 6px 0 0; font-size: 0.92em; color: var(--ink-2); }
.effect-line b { color: var(--ink); }

table.sib { border-collapse: collapse; width: 100%; font-size: 0.9em; }
.sib th, .sib td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sib td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sib tr.sib-self td { background: var(--surface-2); }
.sib-bar { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--surface-2); vertical-align: middle; }
.sib-bar i { display: block; height: 100%; border-radius: 3px; background: var(--link); }
.tblwrap { overflow-x: auto; }
