/* Cognitive Bias Ontology explorer: black & white specimen sheet.
   Archivo (variable width) for display and text, JetBrains Mono for ontology terms.
   Both SIL Open Font Licence. One accent, used only for small signals. */

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #000000;
  --ink-2: #4d4d4d;          /* 8.4:1 on white */
  --inv-bg: #000000;         /* inverted bands */
  --inv-fg: #ffffff;
  --inv-2: #b3b3b3;          /* 10:1 on black */
  --accent: #c42a0e;         /* on white, 5.7:1 */
  --accent-inv: #ff3b1f;     /* on black, 5.9:1 */
  --gutter: 40px;
  --gap: 24px;
  --heavy: 6px;
  --sans: "Archivo", "Arial Narrow", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #000000; --ink: #ffffff; --ink-2: #b3b3b3;
    --inv-bg: #ffffff; --inv-fg: #000000; --inv-2: #4d4d4d;
    --accent: #ff3b1f; --accent-inv: #c42a0e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #000000; --ink: #ffffff; --ink-2: #b3b3b3;
  --inv-bg: #ffffff; --inv-fg: #000000; --inv-2: #4d4d4d;
  --accent: #ff3b1f; --accent-inv: #c42a0e;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 12px; }
code, .t, .mono { font-family: var(--mono); font-size: .92em; letter-spacing: -0.01em; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 10; font-family: var(--mono); }
.skip:focus { left: 16px; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.display { font-family: var(--sans); font-stretch: 125%; font-weight: 800; letter-spacing: -0.02em; line-height: .92; text-transform: uppercase; }
.kicker, .mast-label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

/* ---- grid ---------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding: 0 var(--gutter); max-width: 1600px; margin: 0 auto; }
.label-col { grid-column: 1 / span 3; }
.body-col { grid-column: 4 / span 9; }
.full { grid-column: 1 / -1; }
.inv { background: var(--inv-bg); color: var(--inv-fg); }
.inv .muted { color: var(--inv-2); }

/* ---- masthead ------------------------------------------------------ */
.masthead { background: var(--inv-bg); color: var(--inv-fg); }
.masthead .grid { display: block; }
.mast-top { display: flex; justify-content: space-between; align-items: stretch; gap: 16px; border-bottom: 1px solid var(--inv-2); }
.mast-top .mast-label { padding: 14px 0; color: var(--inv-2); }
.mast-top .mast-label b { color: var(--accent-inv); font-weight: 500; }
.mast-nav { display: flex; flex-wrap: wrap; }
.mast-nav a {
  font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; text-decoration: none;
  padding: 0 16px; min-height: 44px; display: inline-flex; align-items: center; border-left: 1px solid var(--inv-2);
}
.mast-nav a:hover, .mast-nav a:focus-visible { background: var(--inv-fg); color: var(--inv-bg); outline-offset: -3px; }
.mast-nav a[aria-current="page"] { background: var(--inv-fg); color: var(--inv-bg); }
.mast-title { padding: 20px 0 22px; }
.wordmark { text-decoration: none; display: inline-block; font-size: 44px; }
body[data-view="overview"] .wordmark { font-size: clamp(44px, 8.6vw, 136px); }
body[data-view="overview"] .mast-title { padding: 28px 0 32px; }
.mast-sub { margin: 14px 0 0; font-family: var(--mono); font-size: 13px; color: var(--inv-2); }

main { outline: none; }
section.band { padding: 48px 0; border-top: var(--heavy) solid var(--ink); }
section.band.inv { border-top-color: var(--inv-bg); }
section.band:first-child { border-top: 0; }
.band h2 { font-size: 30px; font-stretch: 112%; font-weight: 700; letter-spacing: -0.015em; line-height: 1.1; }
.lede { font-size: 24px; line-height: 1.32; max-width: 34em; margin: 0 0 12px; }

/* ---- oversized numerals ------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 40px; border-top: var(--heavy) solid var(--ink); }
.stat { padding: 12px 20px 4px 0; border-right: 2px solid var(--ink); }
.stat + .stat { padding-left: 20px; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-stretch: 125%; font-weight: 800; font-size: clamp(56px, 8.4vw, 150px); line-height: .9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-top: 10px; }

/* ---- pattern filter ------------------------------------------------ */
.filter { display: flex; flex-wrap: wrap; margin: 0 0 12px; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.chip {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); background: var(--paper);
  border: 0; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); border-radius: 0; padding: 10px 12px; min-height: 44px; cursor: pointer;
}
.chip:hover, .chip:focus-visible { background: var(--ink); color: var(--paper); outline-offset: -6px; outline-color: var(--paper); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip .n { margin-left: 8px; font-weight: 700; }
#filter-status { font-family: var(--mono); font-size: 12px; min-height: 18px; }

/* ---- clusters + tiles --------------------------------------------- */
.cluster { margin-top: 48px; }
.cluster-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding-top: 10px; border-top: 2px solid var(--ink); margin-bottom: 20px; }
.cluster-head .kicker { grid-column: 1 / span 3; padding-top: 6px; }
.cluster-head h3 { grid-column: 4 / span 9; font-size: 34px; font-stretch: 112%; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; max-width: 22em; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.tile {
  display: flex; flex-direction: column; min-height: 280px; padding: 14px 16px 16px; background: var(--paper); color: var(--ink);
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); text-decoration: none;
}
.tile .idx { font-family: var(--mono); font-size: 12px; display: flex; justify-content: space-between; margin-bottom: 28px; }
.tile h4 { font-size: 26px; font-stretch: 112%; font-weight: 750; line-height: 1; letter-spacing: -0.02em; margin-bottom: 8px; }
.tile .who { font-size: 14px; margin-bottom: 10px; }
.tile .story { font-size: 15px; font-style: italic; margin-bottom: 14px; }
.tile .uses { margin-top: auto; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; }
.tile .uses b { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.tile .count { font-family: var(--mono); font-size: 12px; border-top: 2px solid currentColor; padding-top: 8px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.tile:hover, .tile:focus-visible, .tile.hit { background: var(--ink); color: var(--paper); }
.tile:focus-visible { outline: 3px solid var(--paper); outline-offset: -9px; }
.tile.dim { color: var(--ink-2); background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--ink) 10%, transparent) 7px 8px); }
.tile.dim:hover, .tile.dim:focus-visible { background: var(--ink); color: var(--paper); }

/* ---- bar chart: shared vocabulary, on an inverted band ------------ */
.bars { display: grid; grid-template-columns: minmax(0, 24em) minmax(0, 1fr); column-gap: 16px; row-gap: 4px; align-items: center; }
.bars .bl { font-family: var(--mono); font-size: 13.5px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .bl small { font-family: var(--sans); color: var(--inv-2); font-size: 12px; margin-left: 8px; }
.bars .track { position: relative; height: 30px; display: flex; align-items: center; border-left: 2px solid var(--inv-fg); }
.bars .bar { height: 18px; background: var(--inv-fg); }
.bars .val { font-family: var(--mono); font-size: 13px; font-weight: 700; margin-left: 10px; font-variant-numeric: tabular-nums; }
.bars .track:hover .bar, .bars .track:focus-visible .bar { background: var(--accent-inv); }
.axis-note { font-family: var(--mono); font-size: 12px; color: var(--inv-2); margin-top: 16px; max-width: 70em; }

/* ---- matrix -------------------------------------------------------- */
.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.matrix { border-collapse: collapse; font-size: 14px; }
.matrix th, .matrix td { padding: 0; }
.matrix thead th { vertical-align: bottom; height: 190px; }
.matrix thead tr:first-child th { height: auto; }
.matrix thead th .vh { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12.5px; display: inline-block; padding: 6px 0; }
.matrix thead th.fs .vh { font-family: var(--mono); font-size: 12px; }
.matrix thead th.group { height: auto; text-align: left; font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; background: var(--ink); color: var(--paper); }
.matrix th.row { position: sticky; left: 0; z-index: 1; background: var(--paper); text-align: left; font-weight: 600; white-space: nowrap; padding-right: 14px; height: 26px; }
.matrix th.row a { text-decoration: none; }
.matrix th.row a:hover { text-decoration: underline; }
.matrix tr.cluster-row th { position: sticky; left: 0; background: var(--paper); text-align: left; font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; padding: 20px 0 6px; white-space: normal; }
.matrix td.cell { width: 26px; height: 26px; min-width: 26px; position: relative; border: 1px solid var(--ink); }
.matrix td.cell .m { position: absolute; inset: 4px; }
.matrix td.cell.story .m { background: var(--ink); }
.matrix td.cell.doc .m { box-shadow: inset 0 0 0 2px var(--ink); }
.matrix td.cell.file .m { background: repeating-linear-gradient(135deg, var(--ink) 0 1.5px, transparent 1.5px 5px); }
.matrix td.gap { width: 14px; min-width: 14px; border: 0; }
.matrix td.tot, .matrix th.tot { font-family: var(--mono); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; min-width: 26px; }
.matrix tr.sum th, .matrix tr.sum td { padding-top: 8px; font-weight: 700; }
.matrix tbody tr:not(.cluster-row):hover th.row { background: var(--ink); color: var(--paper); }
.matrix td.cell:hover { outline: 3px solid var(--ink); outline-offset: 1px; z-index: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; margin: 8px 0 20px; align-items: center; }
.legend .key { display: inline-flex; align-items: center; gap: 10px; }
.legend .sw { width: 22px; height: 22px; display: inline-block; border: 1px solid var(--ink); position: relative; }
.legend .sw::after { content: ""; position: absolute; inset: 3px; }
.legend .sw.story::after { background: var(--ink); }
.legend .sw.doc::after { box-shadow: inset 0 0 0 2px var(--ink); }
.legend .sw.file::after { background: repeating-linear-gradient(135deg, var(--ink) 0 1.5px, transparent 1.5px 5px); }
.note { font-size: 14px; color: var(--ink-2); max-width: 46em; }

/* ---- bias view ----------------------------------------------------- */
.bias-head { padding: 36px 0 32px; }
.bias-head .grid { row-gap: 16px; }
.bias-head h1 { font-size: clamp(38px, 6vw, 96px); overflow-wrap: anywhere; }
.bias-meta { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; margin-top: 18px; }
.bias-def { font-size: 21px; line-height: 1.4; max-width: 36em; margin-top: 18px; }
.pager { display: flex; flex-wrap: wrap; margin-top: 8px; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); width: fit-content; max-width: 100%; }
.pager a, .pager select, .toggle button {
  font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); background: var(--paper);
  border: 0; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); border-radius: 0; padding: 10px 14px; min-height: 44px;
  text-decoration: none; display: inline-flex; align-items: center; cursor: pointer;
}
.pager a:hover, .pager a:focus-visible { background: var(--ink); color: var(--paper); outline-color: var(--paper); outline-offset: -6px; }

.bias-body { border-top: var(--heavy) solid var(--ink); padding: 0 0 48px; }
.bias-body .grid { row-gap: 40px; }
.diagram-col { grid-column: 1 / span 8; min-width: 0; padding-top: 28px; }
.aside-col { grid-column: 9 / span 4; min-width: 0; padding-top: 28px; }
.diagram-frame { border: 3px solid var(--ink); }
.diagram-bar { display: flex; justify-content: space-between; align-items: stretch; flex-wrap: wrap; background: var(--ink); color: var(--paper); }
.diagram-bar h2 { padding: 12px 14px; align-self: center; }
.toggle { display: inline-flex; }
.toggle button { border: 0; border-left: 2px solid var(--paper); background: var(--ink); color: var(--paper); }
.toggle button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.toggle button:hover, .toggle button:focus-visible { background: var(--paper); color: var(--ink); outline-color: var(--ink); outline-offset: -6px; }
figure.diagram { margin: 0; background: var(--paper); }
.diagram-scroll { overflow: auto; -webkit-overflow-scrolling: touch; padding: 20px; }
.diagram-scroll svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.scroll-hint { font-family: var(--mono); font-size: 12px; padding: 10px 14px 0; margin: 0; }
figure.diagram figcaption { font-size: 14px; padding: 12px 14px 14px; border-top: 2px solid var(--ink); }
.kinds { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 14px; align-items: center; }
.kinds .k { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.kinds svg { display: block; overflow: visible; }

/* SVG graph: class origin is drawn with fill, border and hatching, never colour */
svg .node text { fill: var(--ink); }
svg .node .n1 { font-family: var(--sans); font-size: 14px; font-weight: 650; }
svg .node .n2, svg .node .n3 { font-family: var(--mono); font-size: 11.5px; }
svg .node .n3 { font-style: italic; }
svg .node .bg { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5px; }
svg .node.k-framester .bg { fill: var(--ink); }
svg .node.k-framester text { fill: var(--paper); }
svg .node.k-external .bg { stroke-dasharray: 7 4; }
svg .hatch-bg { fill: var(--paper); }
svg .hatch-ln { stroke: var(--ink); stroke-width: 2px; }
svg .node .strip-edge { stroke: var(--ink); stroke-width: 2px; }
svg .node:focus { outline: none; }
svg .node.on .bg, svg .node:focus .bg { stroke-width: 4px; }
svg .node.inv-on .bg { fill: var(--ink); }
svg .node.inv-on text { fill: var(--paper); }
svg .node.k-framester.inv-on .bg { fill: var(--paper); }
svg .node.k-framester.inv-on text { fill: var(--ink); }
svg .edge path { fill: none; stroke: var(--ink); stroke-width: 1.5px; }
svg .edge.sub path { stroke-dasharray: 5 4; }
svg .edge .lbl rect { fill: var(--paper); }
svg .edge .lbl text { font-family: var(--mono); font-size: 11px; fill: var(--ink); }
svg .arrow { fill: var(--ink); }
svg .arrow.hollow { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5px; }
svg.focusing .edge { opacity: .15; }
svg.focusing .node { opacity: .3; }
svg.focusing .edge.on, svg.focusing .node.on { opacity: 1; }
svg.focusing .edge.on path { stroke-width: 3px; }
svg.focusing .edge.on .lbl rect { fill: var(--ink); }
svg.focusing .edge.on .lbl text { fill: var(--paper); }
svg .edge, svg .node { transition: opacity .15s ease; }

.aside-col h2, .below h2 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 12px; padding-top: 8px; border-top: 4px solid var(--ink); }
.aside-block { margin-bottom: 36px; }
.aside-block:last-child { margin-bottom: 0; }
.story-title { font-size: 26px; font-stretch: 112%; font-weight: 750; letter-spacing: -0.015em; line-height: 1.05; margin-bottom: 12px; }
.story p { font-size: 15.5px; line-height: 1.55; }
.story.clamped { max-height: 18em; overflow: hidden; position: relative; }
.story.clamped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4em; background: linear-gradient(transparent, var(--paper)); }
.more { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); padding: 8px 12px; min-height: 44px; cursor: pointer; margin-top: 4px; }
.more:hover, .more:focus-visible { background: var(--ink); color: var(--paper); outline-color: var(--ink); }
ol.cqs { list-style: none; margin: 0; padding: 0; counter-reset: cq; }
ol.cqs li { counter-increment: cq; border-bottom: 2px solid var(--ink); padding: 12px 0; display: grid; grid-template-columns: 3.4em 1fr; }
ol.cqs li::before { content: "CQ" counter(cq); font-family: var(--mono); font-size: 11px; font-weight: 700; background: var(--ink); color: var(--paper); align-self: start; text-align: center; padding: 3px 0; margin-right: 10px; }
ol.cqs .q { font-weight: 650; font-size: 16px; line-height: 1.35; }
ol.cqs .a { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
details.sparql { margin-top: 8px; grid-column: 2; }
details.sparql summary { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
details.sparql pre { font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--ink); color: var(--paper); padding: 14px; overflow-x: auto; margin: 4px 0 0; white-space: pre; }

.below { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 40px; }
.below > .triples { grid-column: 1 / span 8; min-width: 0; }
.below > .reuse { grid-column: 9 / span 4; min-width: 0; }
table.tri { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tri th, .tri td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--ink); vertical-align: top; }
.tri thead th { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; background: var(--ink); color: var(--paper); padding: 8px 10px; }
.tri td.p { font-family: var(--mono); font-size: 13px; font-weight: 700; white-space: nowrap; }
.tri .t { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
dl.reuse-list { margin: 0; }
dl.reuse-list dt { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-top: 16px; }
dl.reuse-list dt:first-child { margin-top: 0; }
dl.reuse-list dd { margin: 4px 0 0; font-size: 15px; }
dl.reuse-list dd.mono { font-family: var(--mono); font-size: 13px; }

/* ---- about --------------------------------------------------------- */
.prose { max-width: 44em; }
.prose p, .prose li { font-size: 17px; }
.prose h3 { font-size: 22px; font-stretch: 112%; font-weight: 700; margin: 36px 0 10px; padding-top: 10px; border-top: 2px solid var(--ink); }
.prose ol, .prose ul { padding-left: 1.3em; margin: 0 0 12px; }
.prose li { margin-bottom: 4px; }
.gaps li { font-size: 15px; }

/* ---- colophon ------------------------------------------------------ */
.colophon { background: var(--inv-bg); color: var(--inv-fg); padding: 28px 0 48px; }
.colophon .mast-label { grid-column: 1 / span 3; color: var(--accent-inv); }
.colophon-body { grid-column: 4 / span 9; font-size: 14px; max-width: 54em; }
.colophon-body p { margin-bottom: 10px; }

/* ---- tooltip ------------------------------------------------------- */
.tooltip { position: fixed; z-index: 20; pointer-events: none; max-width: 320px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 12px; line-height: 1.45; padding: 10px 12px; border: 2px solid var(--paper); outline: 2px solid var(--ink); }
.tooltip b { display: block; font-weight: 700; margin-bottom: 3px; }

/* ---- responsive ---------------------------------------------------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .diagram-col, .aside-col, .below > .triples, .below > .reuse { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  :root { --gutter: 16px; --gap: 16px; --heavy: 5px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .label-col, .body-col, .full, .colophon .mast-label, .colophon-body, .diagram-col, .aside-col { grid-column: 1 / -1; }
  .label-col { margin-bottom: 14px; }
  .mast-top { flex-direction: column; gap: 0; }
  .mast-top .mast-label { padding: 12px 0 8px; }
  .mast-nav { margin: 0 calc(-1 * var(--gutter)); border-top: 1px solid var(--inv-2); }
  .mast-nav a { flex: 1 1 auto; justify-content: center; padding: 0 8px; font-size: 12px; }
  .mast-nav a:first-child { border-left: 0; }
  .wordmark { font-size: 30px; }
  body[data-view="overview"] .wordmark { font-size: 44px; }
  .lede { font-size: 19px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px 12px 12px 0; border-bottom: 2px solid var(--ink); }
  .stat + .stat { padding-left: 0; }
  .stat:nth-child(2n) { border-right: 0; padding-left: 12px; }
  .stat b { font-size: 58px; }
  .cluster-head { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .cluster-head .kicker, .cluster-head h3 { grid-column: 1 / -1; }
  .cluster-head h3 { font-size: 24px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile { min-height: 0; }
  .tile .idx { margin-bottom: 14px; }
  .band h2 { font-size: 24px; }
  .bars { grid-template-columns: minmax(0, 11em) minmax(0, 1fr); column-gap: 8px; }
  .bars .bl { font-size: 12px; }
  .bars .bl small { display: none; }
  .bias-def { font-size: 17px; }
  .pager a, .pager select { flex: 1 1 auto; }
  .below { grid-template-columns: minmax(0, 1fr); }
  .tri td.p { white-space: normal; }
  .tri td, .tri th { overflow-wrap: anywhere; font-size: 13px; padding-right: 8px; }
  .diagram-scroll { padding: 10px; }
  .matrix thead th { height: 160px; }
  .story-title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .matrix td.cell.story .m, .legend .sw.story::after { background: CanvasText; }
  .bars .bar { background: CanvasText; }
  svg .node.k-framester .bg { fill: CanvasText; }
  svg .node.k-framester text { fill: Canvas; }
}

/* ---- 2026 additions: doors, tested questions, story walk, compare, quiz, search ---- */
.doors { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); max-width: 60em; }
.doors li { border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.doors a { display: block; padding: 12px 14px 4px; font-size: 20px; font-stretch: 112%; font-weight: 750; letter-spacing: -0.015em; line-height: 1.1; text-decoration: none; }
.doors span { display: block; padding: 0 14px 12px; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.doors li:hover, .doors li:focus-within { background: var(--ink); color: var(--paper); }
.doors li:hover span, .doors li:focus-within span { color: var(--paper); }
.doors a:focus-visible { outline-color: var(--paper); outline-offset: -6px; }
.band h2.kicker { font-size: 12px; font-stretch: 100%; font-weight: 500; letter-spacing: .06em; line-height: 1.5; }
.go { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }

/* status tags: shape, not colour */
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border: 2px solid var(--ink); margin: 0 6px 4px 0; white-space: nowrap; }
.tag.s-answered { background: var(--ink); color: var(--paper); }
.tag.s-partial { background: repeating-linear-gradient(135deg, var(--paper) 0 4px, color-mix(in srgb, var(--ink) 16%, var(--paper)) 4px 6px); }
.tag.s-unanswerable { border-style: dashed; }
.tag.o { border: 0; padding-left: 0; font-weight: 500; color: var(--ink-2); }
.cq-tags { margin: 8px 0 0; }
.cq-note { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 0; }
.cq-run { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.cq-run .more { margin-top: 0; }
.more:disabled { opacity: .6; cursor: progress; }
.run-status { font-family: var(--mono); font-size: 12px; }
.cq-result { margin-top: 8px; }
table.res { border-collapse: collapse; font-size: 14px; width: 100%; }
.res th { font-family: var(--mono); font-size: 11.5px; font-weight: 500; text-align: left; background: var(--ink); color: var(--paper); padding: 5px 8px; }
.res td { padding: 6px 8px; border-bottom: 1px solid var(--ink); font-weight: 600; }
details.orig summary { color: var(--ink-2); }
.orig-res { margin-top: 8px; }
.orig-res .note { margin: 0; }
ol.cqs li.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--ink) 14%, var(--paper)); } to { background: transparent; } }

/* answers and the story walk on the graph */
svg.answering .node:not(.answer) { opacity: .28; }
svg.answering .edge { opacity: .35; }
svg .node.answer .bg { stroke-width: 5px; }
svg.walking .node.ghost, svg.walking .edge.ghost { opacity: .18; }
/* the sentence's individuals: heavy outline and a hard offset shadow, so fill keeps meaning "Framester" */
svg.walking .node.now .bg { stroke-width: 5px; }
svg.walking .node.now { filter: drop-shadow(6px 6px 0 var(--ink)); }
.walk { border-bottom: 2px solid var(--ink); }
.walk-bar { display: flex; align-items: stretch; border-bottom: 2px solid var(--ink); }
.walk-btn { font-family: var(--mono); font-size: 18px; background: var(--paper); color: var(--ink); border: 0; border-right: 2px solid var(--ink); min-width: 56px; min-height: 44px; cursor: pointer; }
.walk-btn + .walk-count + .walk-btn, .walk-count + .walk-btn { border-right: 0; border-left: 2px solid var(--ink); }
.walk-btn:hover:not(:disabled), .walk-btn:focus-visible { background: var(--ink); color: var(--paper); outline-color: var(--paper); outline-offset: -6px; }
.walk-btn:disabled { color: var(--ink-2); cursor: default; }
.walk-count { flex: 1; margin: 0; align-self: center; text-align: center; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.walk-text { margin: 0; padding: 16px 18px 6px; font-size: 19px; line-height: 1.4; font-weight: 500; max-width: 42em; }
.walk-nodes { margin: 0; padding: 0 18px 14px; font-size: 13.5px; color: var(--ink-2); }
.walk-end { padding: 0 18px 14px; margin: 0; }

/* questions table */
.qtable-wrap { overflow-x: auto; }
.qtable td { font-size: 14.5px; }
.qtable td .t { max-width: 46em; white-space: normal; }
.qtable td.o { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.qtable tr[hidden] { display: none; }

/* compare */
.pager button { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); background: var(--paper);
  border: 0; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); border-radius: 0; padding: 10px 14px; min-height: 44px; cursor: pointer; }
.pager button:hover, .pager button:focus-visible { background: var(--ink); color: var(--paper); outline-color: var(--paper); outline-offset: -6px; }
.compare-pick { margin-top: 16px; }
.compare-pick select { min-width: 13em; }
table.cmp th[scope="row"] { font-family: var(--mono); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
table.cmp td { font-size: 13px; }
table.cmp td.both { background: repeating-linear-gradient(135deg, var(--paper) 0 6px, color-mix(in srgb, var(--ink) 9%, var(--paper)) 6px 8px); font-weight: 700; }
.cmp-graphs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); margin-top: 32px; }
.cmp-name { padding: 12px 14px; font-size: 13px; }
.cmp-name a { text-decoration: none; }
.cmp-name a:hover { text-decoration: underline; }
.cmp-by { padding: 12px 14px; color: var(--paper); opacity: .8; align-self: center; }
svg .shared-mark { fill: var(--ink); stroke: var(--paper); stroke-width: 1.5px; }
svg .edge.shared path { stroke-width: 3px; }
svg .edge.shared .lbl text { font-weight: 700; }

/* quiz */
.quiz h1, .quiz h2 { outline: none; }
.quiz-text { margin: 18px 0 20px; padding: 18px 20px 8px; border-left: var(--heavy) solid var(--ink); max-width: 44em; }
.quiz-text p { font-size: 19px; line-height: 1.45; }
.quiz-opts { max-width: 60em; }
.quiz-opts .chip { font-size: 13px; padding: 12px 16px; }
.chip:disabled { cursor: default; }
.chip.correct { background: var(--ink); color: var(--paper); }
.chip.correct::after { content: " ✓"; }
.chip.wrong { text-decoration: line-through; text-decoration-thickness: 2px; background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--ink) 14%, transparent) 7px 8px); }
.chip:disabled:not(.correct):not(.wrong) { color: var(--ink-2); }
.quiz-fb { margin-top: 16px; max-width: 44em; }
.quiz-verdict { font-size: 26px; font-stretch: 112%; font-weight: 750; letter-spacing: -0.015em; margin-bottom: 6px; }
.quiz-fb .pager { margin-top: 12px; }

/* search */
.search-form input { width: 100%; max-width: 40em; font-family: var(--mono); font-size: 18px; padding: 12px 14px; border: 3px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); }
.search-form input:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.search-count { font-family: var(--mono); font-size: 12px; margin: 10px 0 0; min-height: 18px; }
.res-kind { margin: 28px 0 8px; padding-top: 8px; border-top: 4px solid var(--ink); }
.res-list { list-style: none; margin: 0; padding: 0; }
.res-list li { display: grid; grid-template-columns: minmax(0, 18em) minmax(0, 1fr); gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--ink); }
.res-label { font-weight: 650; overflow-wrap: anywhere; }
.res-label.mono { font-weight: 700; font-size: 14px; }
.res-in { font-size: 14.5px; color: var(--ink-2); }
.res-in a { color: var(--ink); }

@media (max-width: 1100px) {
  .cmp-graphs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .doors { grid-template-columns: minmax(0, 1fr); }
  .res-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .walk-text, .quiz-text p { font-size: 17px; }
  .compare-pick select, .compare-pick button { flex: 1 1 100%; }
}
@media (forced-colors: active) {
  .tag.s-answered, .chip.correct { background: CanvasText; color: Canvas; }
  svg.walking .node.now { filter: none; }
  svg.walking .node.now .bg { stroke-width: 6px; }
  svg .shared-mark { fill: CanvasText; }
}
