/* DecisionAD project page.
   Colours come from the figure palette of the paper: deep navy ink (Blue ramp), amber for the answer, and the diverging
   blue-red scale of the evidence maps. One family (Archivo); its width axis separates display, text and small labels. */

:root {
  --paper: #f5f7fa;
  --surface: #ffffff;
  --sunk: #ebeff4;
  --ink: #0f2439;
  --ink-2: #44556b;
  --ink-3: #6b7a8d;
  --rule: #d3dae3;
  --rule-soft: #e3e8ee;
  --link: #245992;
  --answer: #de9419;
  --answer-soft: #fef0d3;
  --answer-ink: #7d5000;
  --ordinary: #4375b6;
  --rare: #ba4448;
  --c-aux: #1e9b99;
  --c-free: #858489;
  --c-dec: #954e9c;
  --c-ours: #de9419;
  --band: rgba(149, 78, 156, 0.07);
  --focus: #245992;
  --shadow: 0 1px 2px rgba(15, 36, 57, 0.06), 0 12px 32px -16px rgba(15, 36, 57, 0.22);
  --wide: 116%;
  --narrow: 92%;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0c1624;
  --surface: #121f31;
  --sunk: #0f1a2a;
  --ink: #e8edf4;
  --ink-2: #a9b7c8;
  --ink-3: #8293a8;
  --rule: #26374d;
  --rule-soft: #1b2a3e;
  --link: #99bcdf;
  --answer: #f4b94a;
  --answer-soft: #3a2d12;
  --answer-ink: #f9c55c;
  --ordinary: #7da5d5;
  --rare: #ed7e72;
  --c-aux: #12908d;
  --c-free: #989b9f;
  --c-dec: #c97fcb;
  --c-ours: #d28a14;
  --band: rgba(201, 127, 203, 0.09);
  --focus: #99bcdf;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 36px -18px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.62;
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
a:hover { text-decoration-thickness: 0.12em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
button, input, select { font: inherit; color: inherit; }

.wrap { width: min(100% - 2 * clamp(1.15rem, 4.5vw, 3.5rem), 75rem); margin-inline: auto; }
.measure { max-width: 41rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------------ top bar */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule-soft); }
.bar .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem; }
.mark { font-stretch: var(--wide); font-weight: 680; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.bar nav { margin-left: auto; display: flex; gap: clamp(0.9rem, 2vw, 1.75rem); }
.bar nav a { color: var(--ink-2); text-decoration: none; font-size: 0.94rem; font-stretch: var(--narrow); font-weight: 500; }
.bar nav a:hover { color: var(--ink); }
.theme { border: 1px solid var(--rule); background: transparent; border-radius: 999px; width: 2.25rem; height: 2.25rem; display: grid;
  place-items: center; cursor: pointer; color: var(--ink-2); flex: none; }
.theme:hover { color: var(--ink); border-color: var(--ink-3); }
.theme svg { width: 1.05rem; height: 1.05rem; }
:root[data-theme="dark"] .theme .sun, :root:not([data-theme="dark"]) .theme .moon { display: none; }
.bar .lab { display: inline-flex; align-items: center; gap: 0.5rem; flex: none; padding-left: 1.1rem; border-left: 1px solid var(--rule);
  color: var(--ink-2); font-size: 0.94rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.bar .lab:hover { color: var(--ink); }
.bar .lab img { width: 1.4rem; height: 1.4rem; border-radius: 0.2rem; }

/* ------------------------------------------------------------------ hero */
.hero { padding-block: clamp(2.25rem, 4.5vw, 3.75rem) clamp(2.5rem, 6vw, 4.5rem); }
h1 { margin: 0; font-stretch: var(--wide); font-weight: 650; font-size: clamp(2rem, 1.05rem + 3.1vw, 3.45rem); line-height: 1.05;
  letter-spacing: -0.022em; text-wrap: balance; max-width: 24ch; }
h1 .name { display: block; font-size: 0.44em; font-weight: 600; letter-spacing: 0; color: var(--answer-ink); margin-bottom: 0.8em; }
.byline { margin-top: 1.6rem; }
.lede { margin: 1.6rem 0 0; font-size: 1.2rem; line-height: 1.5; color: var(--ink-2); max-width: 40rem; text-wrap: pretty; }
.authors { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1.5rem; font-weight: 580; font-size: 1.1rem; }
.authors a { color: inherit; text-decoration: none; }
.authors a:hover { text-decoration: underline; }
.authors sup { font-weight: 400; color: var(--ink-3); line-height: 0; }
.affil { margin: 0.3rem 0 0; color: var(--ink-2); font-size: 0.97rem; }
.affil span { color: var(--ink-3); font-size: 0.9rem; }
.actions { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.68rem 1.15rem; border-radius: 0.5rem; border: 1px solid var(--ink);
  text-decoration: none; font-weight: 600; font-size: 0.98rem; font-stretch: 104%; line-height: 1.2; cursor: pointer; background: transparent; color: var(--ink); }
.btn svg { width: 1.05rem; height: 1.05rem; flex: none; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--answer)); border-color: transparent; }
.btn[aria-disabled="true"] { border-style: dashed; border-color: var(--rule); color: var(--ink-3); background: transparent; cursor: default; }
.btn[aria-disabled="true"] small { font-weight: 400; font-size: 0.82rem; }

/* ------------------------------------------------------------------ console (hero example) */
.console { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.9rem; box-shadow: var(--shadow); overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); margin-top: clamp(2rem, 4vw, 3rem); }
.console-stage { border-right: 1px solid var(--rule-soft); display: flex; flex-direction: column; }
.console-stage .zscale { border-bottom: 0; margin-top: auto; }
.reveal { position: relative; aspect-ratio: 1; background: var(--sunk); --pos: 50%; touch-action: pan-y; user-select: none; }
.reveal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reveal .over { clip-path: inset(0 0 0 var(--pos)); }
.reveal .pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
.reveal .gt { pointer-events: none; }
.reveal .gt[hidden] { display: none; }
.reveal .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 36, 57, 0.35); pointer-events: none; }
.reveal .handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 2.1rem; height: 2.1rem; margin: -1.05rem; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f2439' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center / 1.1rem no-repeat;
  box-shadow: 0 0 0 1px rgba(15, 36, 57, 0.3), 0 4px 12px rgba(15, 36, 57, 0.3); }
.reveal input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.reveal:has(input:focus-visible) .handle::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.reveal .tag { position: absolute; bottom: 0.7rem; padding: 0.2rem 0.55rem; border-radius: 0.3rem; font-size: 0.8rem; font-weight: 600;
  font-stretch: var(--narrow); background: rgba(12, 22, 36, 0.72); color: #fff; pointer-events: none; }
.reveal .tag.l { left: 0.7rem; }
.reveal .tag.r { right: 0.7rem; }

.zscale { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 1.1rem; font-size: 0.82rem; color: var(--ink-2);
  border-bottom: 1px solid var(--rule-soft); font-stretch: var(--narrow); }
.zscale i { flex: 1; height: 0.5rem; border-radius: 2px; background: var(--zramp); }
.console-body { padding: clamp(1.1rem, 2.4vw, 1.75rem); display: grid; gap: 1.25rem; align-content: center; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-size: 0.82rem; font-weight: 600; color: var(--ink-3); margin-bottom: 0.45rem; font-stretch: var(--narrow); }

.seg { display: flex; background: var(--sunk); border-radius: 0.55rem; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg label { flex: 1 1 auto; position: relative; text-align: center; padding: 0.45rem 0.75rem; border-radius: 0.4rem; font-size: 0.92rem;
  font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); font-weight: 620; box-shadow: 0 1px 2px rgba(15, 36, 57, 0.16); }
:root[data-theme="dark"] .seg label:has(input:checked) { background: #22344c; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }

.questions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.q { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.7rem; align-items: start; padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule); border-radius: 0.55rem; cursor: pointer; }
.q input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.q .sign { grid-row: span 2; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.95rem;
  background: var(--sunk); color: var(--ink-2); margin-top: 0.1rem; }
.q .text { font-size: 0.95rem; line-height: 1.35; color: var(--ink-2); }
.q .kind { font-size: 0.8rem; color: var(--ink-3); font-stretch: var(--narrow); }
.q:has(input:checked) { border-color: var(--answer); background: var(--answer-soft); }
.q:has(input:checked) .sign { background: var(--answer); color: #1a1200; }
.q:has(input:checked) .text { color: var(--ink); }
.q:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.answer { display: grid; gap: 0.4rem; }
.answer .row { display: grid; grid-template-columns: 2.1rem 1fr 3rem; align-items: center; gap: 0.6rem; font-weight: 620; }
.answer .track { height: 1.05rem; background: var(--sunk); border-radius: 3px; overflow: hidden; }
.answer .fill { display: block; height: 100%; width: 0; border-radius: 0 3px 3px 0; transition: width 0.45s cubic-bezier(0.3, 0.7, 0.2, 1); }
.answer .yes .fill { background: var(--answer); }
.answer .no .fill { background: var(--ink-3); }
.answer .no { color: var(--ink-2); font-weight: 500; }
.answer output { text-align: right; }
.fixed { margin: 0.9rem 0 0; font-size: 0.95rem; color: var(--ink-2); line-height: 1.5; }
.fixed b { color: var(--ink); font-weight: 650; }
.fixed .calc { display: block; margin-top: 0.55rem; font-size: 0.9rem; color: var(--ink-2); line-height: 1.9; }
.fixed .katex { font-size: 1.12em; }
.fixed .calc .katex { color: var(--ink); }
.fixed .calc sub, .fixed .calc sup { line-height: 0; }

/* ------------------------------------------------------------------ sections */
section.block { padding-block: clamp(2.75rem, 6vw, 5rem); border-top: 1px solid var(--rule-soft); }
h2 { margin: 0 0 1.4rem; font-stretch: var(--wide); font-weight: 640; font-size: clamp(1.55rem, 1.1rem + 1.6vw, 2.3rem); line-height: 1.12;
  letter-spacing: -0.018em; text-wrap: balance; max-width: 26ch; }
h3 { margin: 2.4rem 0 0.7rem; font-stretch: 108%; font-weight: 640; font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.005em; }
p { margin: 0 0 1rem; text-wrap: pretty; }
.abstract .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem clamp(2rem, 5vw, 4.5rem); }
.abstract p { font-size: 1.06rem; margin: 0; }
.abstract .roman { color: var(--answer-ink); font-weight: 640; }

figure { margin: 0; }
figcaption { margin-top: 0.8rem; font-size: 0.92rem; line-height: 1.5; color: var(--ink-2); max-width: 46rem; }
figcaption b { color: var(--ink); font-weight: 640; }
.plate { background: #fff; border: 1px solid var(--rule); border-radius: 0.7rem; padding: clamp(0.6rem, 1.6vw, 1.2rem); }
.plate img { width: 100%; height: auto; }
button.plate { display: block; width: 100%; cursor: zoom-in; }
button.plate:hover { border-color: var(--ink-3); }

/* challenges and properties */
.pairs { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.pairs li { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr) minmax(0, 1fr); gap: 0.4rem clamp(1rem, 3vw, 2.5rem); padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule); align-items: start; }
.pairs .topic { font-stretch: 108%; font-weight: 640; font-size: 1.08rem; line-height: 1.3; }
.pairs .topic span { color: var(--answer-ink); margin-right: 0.35rem; }
.pairs p { margin: 0; }
.pairs li.head { padding: 0.55rem 0; font-size: 0.86rem; font-weight: 640; color: var(--ink-3); font-stretch: var(--narrow); }
.pairs li.head span:last-child { color: var(--answer-ink); }
.pairs .who { display: none; font-size: 0.82rem; font-weight: 600; color: var(--ink-3); margin-bottom: 0.2rem; font-stretch: var(--narrow); }
.pairs .ours .who { color: var(--answer-ink); }
.pairs .them { color: var(--ink-2); }
.duo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; margin-top: 2.5rem; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 0.7rem; background: var(--surface); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; line-height: 1.3; }
th, td { padding: 0.5rem 0.8rem; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
thead th { font-weight: 600; font-size: 0.82rem; color: var(--ink-2); font-stretch: var(--narrow); border-bottom: 1px solid var(--rule); vertical-align: bottom; }
thead tr.top th { border-bottom: 0; padding-bottom: 0.1rem; color: var(--ink); font-size: 0.86rem; text-align: center; }
tbody td { border-bottom: 1px solid var(--rule-soft); }
tbody tr:last-child td { border-bottom: 0; }
tr.group td { font-size: 0.8rem; font-weight: 620; color: var(--ink-3); background: var(--sunk) !important; padding-block: 0.32rem; font-stretch: var(--narrow); }
tr.ours td { background: var(--answer-soft) !important; font-weight: 560; }
tr.ours td:first-child { font-weight: 700; }
td .best { font-weight: 750; }
td .second { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; }
td.none { color: var(--ink-3); }
td.barcell, th.barcell { text-align: left; min-width: 10.5rem; }
:root { --ibar-max: 6.5rem; }
@media (max-width: 40rem) { :root { --ibar-max: 3rem; } }
.ibar { display: inline-block; height: 0.62rem; border-radius: 0 3px 3px 0; background: var(--c-dec); vertical-align: middle; margin-right: 0.5rem; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0 0 0.9rem; }
.controls .seg { display: inline-flex; }
.controls .seg label { padding: 0.36rem 0.7rem; font-size: 0.88rem; }
.note { font-size: 0.9rem; color: var(--ink-2); margin-top: 0.8rem; max-width: 46rem; line-height: 1.5; }
.note b { color: var(--ink); font-weight: 640; }
/* a caption under a full-width table or figure is centered on it */
.note.wide, figcaption.wide { max-width: 56rem; margin-inline: auto; text-align: center; text-wrap: balance; }
details { margin-top: 2rem; border-top: 1px solid var(--rule); padding-top: 1.1rem; }
summary { cursor: pointer; font-stretch: 108%; font-weight: 640; font-size: 1.15rem; list-style-position: outside; margin-left: 1.2rem; }
details > *:not(summary) { margin-top: 1rem; }

/* method */
.principles { margin: 1.6rem 0 0; padding: 0; list-style: none; counter-reset: p; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.4rem clamp(1.25rem, 2.4vw, 2.25rem); }
.principles li { counter-increment: p; display: grid; gap: 0.7rem; align-content: start; }
.principles li::before { content: counter(p); width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.88rem;
  font-weight: 700; color: #fff; background: var(--dot, var(--ink-3)); margin-top: 0.05rem; }
.principles li:nth-child(1) { --dot: #3b3d40; }
.principles li:nth-child(2) { --dot: #b17b99; }
.principles li:nth-child(3) { --dot: #409ba0; }
.principles li:nth-child(4) { --dot: #64a483; }
.principles li:nth-child(5) { --dot: #de9419; }
:root[data-theme="dark"] .principles li:nth-child(1) { --dot: #65696d; }
.principles b { display: block; font-weight: 640; font-stretch: 106%; }
.principles span { color: var(--ink-2); font-size: 0.97rem; line-height: 1.5; display: block; margin-top: 0.15rem; }

/* chart */
.lead { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.5fr); gap: 1.5rem clamp(2rem, 4vw, 3.5rem); align-items: start; }
.lead figcaption { margin-top: 1.2rem; }
.chart { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.7rem; padding: 1rem clamp(0.6rem, 2vw, 1.25rem) 0.6rem; position: relative; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.3rem; margin: 0 0 0.4rem; padding: 0; list-style: none; font-size: 0.88rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend svg { width: 0.95rem; height: 0.95rem; overflow: visible; }
.chart svg.plot { display: block; width: 100%; height: auto; overflow: visible; }
.plot text { fill: var(--ink-2); font-size: 12px; font-family: inherit; }
.plot .axis-title { fill: var(--ink-2); font-size: 12.5px; }
.plot .grid { stroke: var(--rule-soft); stroke-width: 1; }
.plot .axis { stroke: var(--rule); stroke-width: 1; }
.plot .band { fill: var(--band); }
.plot .lab { fill: var(--ink); font-size: 12.5px; font-weight: 600; }
.plot .lab.ours { font-weight: 720; }
.plot .leader { stroke: var(--ink-3); stroke-width: 1; }
.plot .pt { stroke: var(--surface); stroke-width: 2; cursor: default; outline: none; }
.plot .pt.aux { fill: var(--c-aux); }
.plot .pt.free { fill: var(--c-free); }
.plot .pt.dec { fill: var(--surface); stroke: var(--c-dec); stroke-width: 2; }
.plot .pt.ours { fill: var(--c-ours); }
.plot .pt.on, .plot .pt:focus-visible { stroke: var(--ink); stroke-width: 2; }
.m-aux { fill: var(--c-aux); } .m-free { fill: var(--c-free); } .m-dec { fill: var(--surface); stroke: var(--c-dec); stroke-width: 2; } .m-ours { fill: var(--c-ours); }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: var(--paper); border-radius: 0.45rem; padding: 0.5rem 0.7rem;
  font-size: 0.86rem; line-height: 1.35; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); max-width: 15rem; opacity: 0; transition: opacity 0.12s; }
.tip.on { opacity: 1; }
.tip b { display: block; font-weight: 700; font-size: 0.95rem; }
.tip span { opacity: 0.78; }

/* evidence map viewer */
.viewer { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.viewer .reveal { border-radius: 0.7rem; overflow: hidden; border: 1px solid var(--rule); }
.viewer-side { display: grid; gap: 1.4rem; }
.thumbs { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0.4rem; }
.thumbs label { position: relative; display: block; border-radius: 0.45rem; overflow: hidden; cursor: pointer; border: 2px solid transparent; aspect-ratio: 1; background: var(--sunk); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.thumbs label:has(input:checked) { border-color: var(--answer); }
.thumbs label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.thumbs label span { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.7rem 0.1rem 0.15rem; font-size: 0.64rem; line-height: 1.15; color: #fff;
  font-stretch: var(--narrow); font-weight: 600; background: linear-gradient(transparent, rgba(8, 16, 28, 0.82)); text-align: center; }
.methods { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.45rem; }
.methods label { position: relative; display: block; cursor: pointer; border-radius: 0.5rem; overflow: hidden; border: 2px solid var(--rule); background: var(--surface); }
.methods img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.methods input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.methods span { display: block; padding: 0.3rem 0.2rem 0.35rem; font-size: 0.78rem; font-weight: 560; text-align: center; line-height: 1.2; white-space: nowrap; font-stretch: var(--narrow); }
.methods label:has(input:checked) { border-color: var(--ink); }
.methods label.ours:has(input:checked), .methods label.ours { border-color: var(--answer); }
.methods label.ours span { font-weight: 720; }
.methods label:has(input:checked) span { background: var(--ink); color: var(--paper); }
.methods label.ours:has(input:checked) span { background: var(--answer); color: #1a1200; }
.methods label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.94rem; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--answer); margin: 0; }
.viewer-meta { font-size: 0.95rem; color: var(--ink-2); margin: 0.7rem 0 0; }
.viewer-meta b { color: var(--ink); font-weight: 640; }

/* cite */
.bib { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 0.7rem; }
.bib { max-width: 62rem; }
.bib pre { margin: 0; padding: 1.2rem 1.25rem; overflow-x: auto; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.86rem; line-height: 1.6; }
.bib .todo { background: var(--answer-soft); color: var(--answer-ink); border-radius: 3px; padding: 0 0.2em; }
.copy { position: absolute; top: 0.7rem; right: 0.7rem; border: 1px solid var(--rule); background: var(--surface); border-radius: 0.4rem; padding: 0.3rem 0.7rem;
  font-size: 0.84rem; font-weight: 600; cursor: pointer; }
.copy:hover { border-color: var(--ink-3); }

footer { border-top: 1px solid var(--rule-soft); padding-block: 2.2rem 3rem; color: var(--ink-3); font-size: 0.88rem; line-height: 1.55; }
footer p { max-width: 52rem; margin: 0 0 0.5rem; }

dialog.zoom { border: 0; padding: 0; background: #fff; max-width: min(96vw, 110rem); max-height: 94vh; border-radius: 0.6rem; overflow: auto; }
dialog.zoom::backdrop { background: rgba(8, 16, 28, 0.78); }
dialog.zoom img { width: min(170vw, 110rem); max-width: none; height: auto; }
dialog.zoom form { position: sticky; top: 0; left: 0; display: flex; justify-content: flex-end; padding: 0.5rem; }
dialog.zoom button { border: 1px solid #c9d1db; background: #fff; color: #0f2439; border-radius: 0.4rem; padding: 0.3rem 0.8rem; font-weight: 600; cursor: pointer; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 60rem) {
  .console { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); }
  .questions { grid-template-columns: 1fr; }
  .principles { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
  .principles li { grid-template-columns: auto 1fr; }
  .duo, .viewer, .lead { grid-template-columns: 1fr; }
  .methods { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .viewer .reveal { max-width: 30rem; }
  .pairs li { grid-template-columns: 1fr 1fr; }
  .pairs .topic { grid-column: 1 / -1; }
  .pairs li.head { display: none; }
  .pairs .who { display: block; }
}
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .bar nav a.opt { display: none; }
  .bar .wrap { gap: 0.9rem; }
  .bar .lab { padding-left: 0; border-left: 0; }
  .bar .lab > span { display: none; }
  .pairs li { grid-template-columns: 1fr; }
  .lede { font-size: 1.1rem; }
  .abstract .cols { grid-template-columns: 1fr; }
  .console { grid-template-columns: 1fr; }
  .console-stage { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .principles { grid-template-columns: 1fr; }
  th, td { padding: 0.45rem 0.6rem; }
  .methods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pairs li { row-gap: 0.85rem; }
  .lead { grid-template-columns: 1fr; }
  .q .text { font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .answer .fill, .tip { transition: none; }
}
@media print {
  .bar, .theme, .copy { display: none; }
}

/* ------------------------------------------------------------------ interactive overview */
.flow { margin-top: 1.8rem; --r-q: #3b3d40; --r-enc: #5d8abf; --r-1: #b17b99; --r-2: #409ba0; --r-3: #64a483; --r-4: #7976ae;
  --r-5: #e97b42; --r-6: var(--answer); --on-c: #fff; --on-map: #1c2733; }
:root[data-theme="dark"] .flow { --r-q: #aab3bd; --r-enc: #7da5d5; --r-1: #d29dbb; --r-2: #5fbcc0; --r-3: #82c3a1; --r-4: #a3a0d6;
  --r-5: #f2976a; --on-c: #0c1624; }
.flow-plate { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.9rem; box-shadow: var(--shadow); overflow: hidden; }
.flow-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding: clamp(0.7rem, 1.5vw, 1.2rem) clamp(0.7rem, 1.5vw, 1.2rem) 0.2rem; }
.flow-svg { display: block; width: 100%; min-width: 60rem; height: auto; }

/* text and marks shared by the diagram and the illustrations */
.flow svg text { font-family: inherit; font-size: 14px; fill: var(--ink); }
.flow svg .m { font-family: KaTeX_Math, "Times New Roman", serif; font-style: italic; font-size: 1.14em; font-weight: 400; }
.flow svg .m.s { font-size: 0.84em; }
.flow svg .b { font-weight: 650; }
.flow svg text.say { font-size: 13.5px; }
.flow svg text.it { font-style: italic; }
.flow svg text.tiny { font-size: 12px; fill: var(--ink-2); }
.flow svg text.sym { font-size: 14.5px; }
.flow svg text.cap { font-size: 12.5px; fill: var(--ink-2); }
.flow svg text.num, .flow svg text.lab { font-size: 12.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.flow svg text.role { fill: var(--c); font-weight: 600; }
.flow svg text.yes { fill: var(--answer-ink); font-weight: 650; }
.flow svg text.cold { fill: var(--ordinary); }
.flow svg text.hot { fill: var(--rare); }
.flow svg .frame { fill: none; stroke: var(--rule); stroke-width: 1; }
.flow svg .track { fill: var(--sunk); }
.flow svg .fill.yes { fill: var(--answer); }
.flow svg .fill.no { fill: var(--ink-3); }
.flow svg .fill.role { fill: var(--c); }
.flow svg .fill.cold { fill: var(--ordinary); }
.flow svg .fill.hot { fill: var(--rare); }
.flow svg .dash { fill: none; stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 4 3; }
.flow svg .dash.role { stroke: var(--c); }
.flow svg .wins rect { fill: none; stroke: var(--on-map); stroke-width: 1.1; }
.flow svg .bd { fill: var(--c); }
.flow svg text.bdt { fill: var(--on-c); font-size: 12px; font-weight: 700; }
.flow .flake path { fill: none; stroke: var(--r-enc); stroke-width: 1.6; stroke-linecap: round; }

/* diagram */
.fb .lane.decision { fill: color-mix(in srgb, var(--answer) 9%, transparent); stroke: color-mix(in srgb, var(--answer) 38%, transparent); }
.fb .lane.evidence { fill: color-mix(in srgb, var(--ink-3) 7%, transparent); stroke: var(--rule); }
.flow svg text.lanet { font-size: 12px; font-weight: 600; fill: var(--ink-3); }
.flow svg text.lanet.decision { fill: var(--answer-ink); }
.fn { transition: opacity 0.45s ease; }
.fn.is-todo { opacity: 0.15; }
.fn.can { cursor: pointer; outline: none; }
.fn :is(rect, path, circle).box { fill: var(--surface); stroke: var(--rule); stroke-width: 1.3; transition: stroke 0.3s ease, stroke-width 0.3s ease; }
.fn .box.tint { fill: color-mix(in srgb, var(--c) 16%, var(--surface)); stroke: color-mix(in srgb, var(--c) 55%, var(--surface)); }
.fn .box.ref { fill: color-mix(in srgb, var(--c) 14%, var(--surface)); stroke: var(--c); stroke-dasharray: 5 4; }
.fn.is-on :is(rect, path, circle).box, .fn.is-on .pic.box .frame { stroke: var(--c); stroke-width: 2.4; }
.fn .ghost { fill: var(--sunk); }
.fn .pic.box { transform-box: fill-box; transform-origin: center; transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.fn.is-todo .pic.box { transform: scale(0.88); }
.fn .hit { fill: transparent; stroke: none; }
.fn.can:hover .hit { fill: color-mix(in srgb, var(--c) 9%, transparent); }
.fn.can:focus-visible .hit { stroke: var(--focus); stroke-width: 2; }
.fn .plus { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.grow rect { transform-box: fill-box; transform-origin: center bottom; transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.grow.x rect { transform-origin: left center; }
.fn.is-todo .grow rect { transform: scaleY(0); }
.fn.is-todo .grow.x rect { transform: scaleX(0); }
.fe { color: var(--ink-3); transition: opacity 0.4s ease; }
.fe .ln { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fe .hd { fill: currentColor; }
.fe.k-grad { color: var(--r-1); }
.fe.k-grad .ln { stroke-dasharray: 5 4; }
.fe.k-dot .ln { stroke-dasharray: 1.5 4.5; }
.fe.is-todo { opacity: 0.13; }
.fe.is-on { color: var(--c); }
.fe.is-on .ln { stroke-width: 2.2; }
.fe.going .hd { opacity: 0; }
.fp .dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.fp .frame { stroke: var(--surface); stroke-width: 2; }

/* legend */
.flow-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; margin: 0; padding: 0.3rem clamp(0.9rem, 1.8vw, 1.5rem) 0.85rem;
  font-size: 0.78rem; color: var(--ink-3); }
.flow-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.flow-legend svg { width: 1.9rem; height: 0.65rem; flex: none; }
.flow-legend svg.sq { width: 0.9rem; height: 0.9rem; }
.flow-legend .l { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.flow-legend .h { fill: var(--ink-3); }
.flow-legend .l.grad { stroke: var(--r-1); stroke-dasharray: 5 4; }
.flow-legend .h.grad { fill: var(--r-1); }
.flow-legend .l.dot { stroke-dasharray: 1.5 4; stroke-linecap: round; }
.flow-legend .l.ref { stroke: var(--r-3); stroke-dasharray: 4 3; fill: color-mix(in srgb, var(--r-3) 14%, transparent); }
.flow-legend .ramp { width: 4.5rem; height: 0.55rem; border-radius: 2px; background: linear-gradient(90deg, #4375b6, #a1c2e5, #f2f4f3, #fab48b, #ba4448); }

/* steps */
.flow-bar { display: flex; align-items: flex-start; gap: 0.9rem; padding: 0.9rem clamp(0.9rem, 1.8vw, 1.5rem) 0.85rem; border-top: 1px solid var(--rule-soft); }
.flow-play { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; background: var(--ink); color: var(--surface);
  display: grid; place-items: center; cursor: pointer; }
.flow-play svg { width: 1rem; height: 1rem; fill: currentColor; }
.flow-play .pause, .flow-play.playing .play { display: none; }
.flow-play.playing .pause { display: block; }
.flow-track { position: relative; flex: 1; min-width: 0; }
.flow-rail { position: absolute; left: 5%; right: 5%; top: 1.2rem; height: 2px; margin-top: -1px; background: var(--rule); }
.flow-rail i { display: block; width: 0; height: 100%; background: var(--ink-2); transition: width 250ms linear; }
.flow-steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); }
.flow-steps button { width: 100%; border: 0; background: none; padding: 0.25rem 0 0; font: inherit; color: var(--ink-3); cursor: pointer;
  display: grid; justify-items: center; gap: 0.3rem; }
.flow .dot { display: inline-grid; place-items: center; flex: none; border-radius: 50%; font-size: 0.8rem; font-weight: 700; line-height: 1; }
.flow .dot svg { width: 1rem; height: 1rem; }
.flow .dot .flake path { stroke: currentColor; stroke-width: 1.8; }
.flow-steps .dot { width: 1.9rem; height: 1.9rem; border: 2px solid var(--rule); background: var(--surface); color: var(--ink-3);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.flow-steps .done .dot { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--ink); }
.flow-steps .on .dot { border-color: var(--c); background: var(--c); color: var(--on-c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.flow-steps button:hover .dot { border-color: var(--c); }
.flow-steps .lab { font-size: 0.8rem; font-weight: 520; font-stretch: var(--narrow); white-space: nowrap; }
.flow-steps .on .lab { color: var(--ink); font-weight: 650; }

/* detail */
.flow-detail { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: 1.2rem clamp(1.5rem, 3.2vw, 3.2rem); align-items: center;
  padding: clamp(1rem, 2vw, 1.6rem) clamp(0.9rem, 1.8vw, 1.5rem) clamp(1.1rem, 2vw, 1.7rem); border-top: 1px solid var(--rule-soft); }
.flow-detail.in > * { animation: flow-in 0.35s ease both; }
@keyframes flow-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.flow-ill { background: var(--paper); border: 1px solid var(--rule-soft); border-radius: 0.7rem; padding: 0.9rem 1rem; }
.fi { display: block; width: 100%; height: auto; }
.flow-head { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.8rem; }
.flow-head .dot { width: 2rem; height: 2rem; margin-top: 0.1rem; background: var(--c); color: var(--on-c); font-size: 0.95rem; }
.flow-text h3 { margin: 0; font-size: 1.2rem; font-weight: 650; font-stretch: 108%; line-height: 1.25; }
.flow-gist { margin: 0.15rem 0 0; font-style: italic; color: var(--ink-2); font-size: 0.96rem; }
.flow-text > p { margin: 0 0 0.6rem; line-height: 1.55; font-size: 0.98rem; max-width: 38rem; }
.flow-eq { margin-top: 0.85rem; padding: 0.65rem 0.95rem; border-radius: 0.5rem; background: var(--sunk); display: grid; gap: 0.5rem; overflow-x: auto; }
.flow-eq .katex { font-size: 1.08em; }

/* illustrations */
.fi .bubble { fill: var(--surface); stroke: var(--rule); stroke-width: 1.3; }
.fi .ar .ln { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; }
.fi .ar .hd { fill: var(--ink-2); }
.fi .ar.thin .ln { stroke-width: 1.2; }
.fi .ar.ink .ln { stroke: var(--ink); } .fi .ar.ink .hd { fill: var(--ink); }
.fi .ar.cold .ln { stroke: var(--ordinary); } .fi .ar.cold .hd { fill: var(--ordinary); }
.fi .ar.hot .ln { stroke: var(--rare); } .fi .ar.hot .hd { fill: var(--rare); }
.fi .ar.role .ln { stroke: var(--c); } .fi .ar.role .hd { fill: var(--c); }
.fi .ar.grad .ln { stroke: var(--r-1); stroke-dasharray: 5 4; } .fi .ar.grad .hd { fill: var(--r-1); }
.fi .pic.cold .frame { stroke: var(--ordinary); stroke-width: 2.5; }
.fi .pic.hot .frame { stroke: var(--rare); stroke-width: 2.5; }
.fi .grid path { fill: none; stroke: rgba(255, 255, 255, 0.34); stroke-width: 0.5; }
.fi .fan { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.fi .node { fill: var(--ink-3); }
.fi .arc { fill: none; stroke: var(--rule); stroke-width: 1.2; stroke-dasharray: 3 3; }
.fi .axis { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.fi .hbar.mute { fill: var(--rule); }
.fi .tri.cold, .fi .pt.cold { fill: var(--ordinary); }
.fi .tri.hot, .fi .pt.hot { fill: var(--rare); }
.fi .pt { stroke: var(--paper); stroke-width: 2; }
.fi .lead { fill: none; stroke: var(--ordinary); stroke-width: 1; }
.fi .aff path { fill: none; stroke: #4b478f; stroke-width: 0.8; opacity: 0.75; }
.fi .aff circle { fill: #4b478f; stroke: #fff; stroke-width: 0.8; }
.fi .peak { fill: none; stroke: var(--on-map); stroke-width: 1.7; }
.fi .curve { fill: none; stroke: var(--answer); stroke-width: 2.4; }
.fi .curve.absent { stroke: var(--ink-3); stroke-width: 1.8; stroke-dasharray: 5 4; }
.pq { display: grid; gap: 1.1rem; padding: 0.2rem 0.1rem; }
.pq-row { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.75rem; row-gap: 0.35rem; }
.pq-tag { grid-row: 1 / span 3; font-size: 1.05rem; }
.pq-q { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.pq mark { background: none; color: inherit; padding: 0 0.1em; box-shadow: inset 0 -0.5em 0 color-mix(in srgb, var(--answer) 38%, transparent); }
.pq mark.neg { box-shadow: inset 0 -0.5em 0 color-mix(in srgb, var(--rare) 32%, transparent); }
.pq-read { margin: 0; font-size: 0.86rem; color: var(--ink-2); }
.pq-read b { margin-left: 0.6rem; color: var(--ink); font-weight: 400; }
.pq-bar { display: flex; align-items: center; gap: 0.55rem; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.pq-track { flex: 1; max-width: 13rem; height: 0.7rem; border-radius: 0.15rem; background: var(--sunk); overflow: hidden; }
.pq-track i { display: block; height: 100%; background: var(--answer); }
.linklike { border: 0; padding: 0; background: none; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 0.18em;
  cursor: pointer; }
@media (max-width: 62rem) {
  .flow-detail { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .flow-ill { max-width: 32rem; }
}
@media (max-width: 46rem) {
  .flow-steps .lab { display: none; }
  .flow-steps .dot { width: 1.55rem; height: 1.55rem; font-size: 0.72rem; }
  .flow-rail { top: 1.03rem; }
  .flow-play { width: 2.05rem; height: 2.05rem; }
  .flow-bar { gap: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .fn, .fe, .fn .pic.box, .grow rect, .flow-rail i, .flow-steps .dot { transition: none; }
  .flow-detail.in > * { animation: none; }
}
