/* ZSAS project page.
   Deep navy ink on a cool paper, amber for our method, blue for normal and red for abnormal.
   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: #5f6e81;
  --rule: #d3dae3;
  --rule-soft: #e3e8ee;
  --link: #245992;
  --answer: #de9419;
  --answer-soft: #fef0d3;
  --answer-ink: #7d5000;
  --on-answer: #1a1200;
  --ordinary: #4375b6;
  --ordinary-soft: #e4edf8;
  --ordinary-ink: #2d5a94;
  --rare: #ba4448;
  --rare-soft: #f9e6e5;
  --rare-ink: #9a3237;
  --bar: #9fb4cc;
  --raised: #ffffff;
  --focus: #245992;
  --shadow: 0 1px 2px rgba(15, 36, 57, 0.06), 0 12px 32px -16px rgba(15, 36, 57, 0.22);
  --lift: 0 1px 2px rgba(15, 36, 57, 0.16);
  /* figures are drawn on white and keep a white plate in both themes; labels on images are always light on dark */
  --plate: #ffffff;
  --plate-ink: #0f2439;
  --plate-rule: #c9d1db;
  --on-image: #ffffff;
  --scrim: rgba(12, 22, 36, 0.72);
  --scrim-fade: rgba(8, 16, 28, 0.82);
  --knob-ring: rgba(15, 36, 57, 0.32);
  --backdrop: rgba(8, 16, 28, 0.78);
  --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;
  --ordinary-soft: #17293f;
  --ordinary-ink: #a6c5e8;
  --rare: #ed7e72;
  --rare-soft: #3a1d1e;
  --rare-ink: #f3a097;
  --bar: #3c5674;
  --raised: #22344c;
  --focus: #99bcdf;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 36px -18px rgba(0, 0, 0, 0.7);
  --lift: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
html:has(dialog[open]) { overflow: hidden; }

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; }
.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 sup, .affil 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.small { color: var(--ink-3); font-size: 0.9rem; }
.venue { margin: 0.9rem 0 0; font-size: 0.97rem; font-weight: 600; font-stretch: 104%; color: var(--answer-ink); }
.lede { margin: 1.3rem 0 0; font-size: 1.2rem; line-height: 1.5; color: var(--ink-2); max-width: 41rem; text-wrap: pretty; }
.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 small { font-weight: 400; font-size: 0.82rem; }
.btn small:empty { display: none; }
.btn[aria-disabled="true"] { border-style: dashed; border-color: var(--rule); color: var(--ink-3); background: transparent; cursor: default; }

/* ------------------------------------------------------------------ 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); }
.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 .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--on-image);
  box-shadow: 0 0 0 1px var(--knob-ring); 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: var(--on-image) 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 var(--knob-ring), 0 4px 12px var(--knob-ring); }
.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: var(--scrim); color: var(--on-image); pointer-events: none; }
.reveal .tag.l { left: 0.7rem; }
.reveal .tag.r { right: 0.7rem; }

.console-body { padding: clamp(1.1rem, 2.4vw, 1.75rem); display: grid; gap: 1.1rem; align-content: center; }
.console-body h2 { font-size: 1.2rem; font-stretch: 108%; letter-spacing: -0.005em; margin: 0; max-width: none; }
.console-body h2 span { color: var(--ink-3); font-weight: 500; }
.console-body p { margin: 0; font-size: 0.95rem; color: var(--ink-2); line-height: 1.5; }
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(--raised); color: var(--ink); font-weight: 620; box-shadow: var(--lift); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }

/* normal and abnormal sentences: the hero excerpt and the prompt browser share these lists */
.said { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem clamp(1rem, 2.5vw, 1.75rem); align-items: start; }
.said h3 { margin: 0 0 0.5rem; display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.82rem; font-weight: 640;
  font-stretch: var(--narrow); line-height: 1.3; }
.said h3 b { padding: 0.12rem 0.5rem; border-radius: 999px; font-weight: 640; }
.said .normal b { background: var(--ordinary-soft); color: var(--ordinary-ink); }
.said .abnormal b { background: var(--rare-soft); color: var(--rare-ink); }
.said h3 span { color: var(--ink-3); font-weight: 500; }
.said ul, .said ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; counter-reset: s; }
.said li { position: relative; padding: 0.4rem 0.6rem 0.4rem 0.8rem; font-size: 0.93rem; line-height: 1.4; background: var(--sunk); border-radius: 0.35rem; }
.said li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px 0 0 3px; }
.said .normal li::before { background: var(--ordinary); }
.said .abnormal li::before { background: var(--rare); }
.said ol li { counter-increment: s; padding-left: 2.3rem; }
.said ol li::after { content: counter(s); position: absolute; left: 0.75rem; top: 0.4rem; font-size: 0.8rem; color: var(--ink-3); }
.said li.off { display: none; }
.said mark { background: var(--answer-soft); color: var(--answer-ink); border-radius: 2px; padding: 0 0.1em; font-weight: 600; }
.said .empty { font-size: 0.9rem; color: var(--ink-3); margin: 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: repeat(2, minmax(0, 1fr)); gap: 1rem clamp(2rem, 5vw, 4.5rem); }
.abstract p { font-size: 1.06rem; margin: 0; }
.stats { margin: 2.4rem 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.stats li { padding: 1.1rem 1.25rem 0 0; }
.stats li + li { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.stats b { display: block; font-stretch: var(--wide); font-weight: 650; font-size: clamp(1.6rem, 1.1rem + 1.5vw, 2.3rem); line-height: 1.1; letter-spacing: -0.02em; }
.stats b small { font-size: 0.5em; font-weight: 600; letter-spacing: 0; color: var(--ink-2); margin-left: 0.15em; }
.stats span { display: block; margin-top: 0.35rem; font-size: 0.92rem; line-height: 1.4; color: var(--ink-2); }

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; }
figcaption.wide { max-width: 56rem; margin-inline: auto; text-align: center; text-wrap: balance; }
.plate { background: var(--plate); 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); }

/* method */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; margin-top: 2.5rem; }
h3 + .duo { margin-top: 1rem; }

/* ------------------------------------------------------------------ interactive overview */
.flow { margin-top: 1.8rem; --r-cls: #3b3d40; --r-p: #247a65; --r-enc: #566aa3; --r-f: #835ea6; --r-m: #b3561f; --r-l: #a9455f;
  --r-alt: #9a5f08; --r-fire: #d6551c; --on-c: #ffffff; }
:root[data-theme="dark"] .flow { --r-cls: #aab3bd; --r-p: #5fc0a5; --r-enc: #93a6de; --r-f: #c09be0; --r-m: #f2976a; --r-l: #ea8fa5;
  --r-alt: #f4b94a; --r-fire: #f58a55; --on-c: #0c1624; }
.flow[hidden] { display: none; }
.flow-plate { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.9rem; box-shadow: var(--shadow); overflow: hidden; }
.flow-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; padding: 0.85rem clamp(0.9rem, 1.8vw, 1.5rem);
  border-bottom: 1px solid var(--rule-soft); }
.flow-ctl [hidden] { display: none; }
.flow-ctl .seg { display: inline-flex; }
.flow-ctl .seg label { padding: 0.36rem 0.8rem; font-size: 0.88rem; }
.flow-epochs { display: flex; flex-wrap: wrap; gap: 3px; }
.flow-epochs button { width: 1.6rem; height: 1.6rem; padding: 0; border: 1px solid var(--rule); border-radius: 0.3rem; background: var(--surface);
  color: var(--ink-2); font-size: 0.74rem; font-weight: 600; line-height: 1; cursor: pointer; }
.flow-epochs button.A { background: var(--answer-soft); border-color: color-mix(in srgb, var(--answer) 45%, var(--surface)); color: var(--answer-ink); }
.flow-epochs button:hover { border-color: var(--ink-3); }
.flow-epochs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.flow-ex { margin: 0; font-size: 0.86rem; color: var(--ink-3); }
.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: 58rem; 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: "Times New Roman", Times, serif; font-style: italic; font-size: 1.16em; font-weight: 400; }
.flow svg .sub { font-size: 0.72em; }
.flow svg .b, .flow svg text.b { font-weight: 650; }
.flow svg text.say { font-size: 13.5px; }
.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.name { font-size: 17px; font-weight: 680; font-stretch: 106%; }
.flow svg text.quote { font-size: 11.5px; font-stretch: var(--narrow); }
.flow svg text.pillt { font-size: 11px; font-weight: 650; }
.flow svg text.pillt.normal { fill: var(--ordinary-ink); }
.flow svg text.pillt.abnormal { fill: var(--rare-ink); }
.flow svg text.role { fill: var(--c); font-weight: 600; }
.flow svg text.lanet { font-size: 12px; font-weight: 600; fill: var(--ink-3); }
.flow svg .pill.normal { fill: var(--ordinary-soft); }
.flow svg .pill.abnormal { fill: var(--rare-soft); }
.flow svg .mark.normal, .flow svg .sq.normal { fill: var(--ordinary); }
.flow svg .mark.abnormal, .flow svg .sq.abnormal { fill: var(--rare); }
.flow svg .sq.hot { stroke: var(--answer); stroke-width: 2.2; paint-order: stroke; }
.flow svg .cell { fill: var(--sunk); stroke: var(--ink-3); stroke-width: 1; }
.flow svg .cell.hot { fill: var(--answer-soft); stroke: var(--answer); }
.flow svg .frame { fill: none; stroke: var(--rule); stroke-width: 1; }
.flow svg .ghost { fill: var(--sunk); }
.flow .flake path { fill: none; stroke: var(--r-enc); stroke-width: 1.6; stroke-linecap: round; }
.flow .flame { fill: var(--r-fire); }
.flow.is-train .at-infer, .flow.is-infer .at-train { display: none; }

/* diagram */
.fb .lane rect { fill: color-mix(in srgb, var(--ink-3) 7%, transparent); stroke: var(--rule); }
.fb .lane.on rect { fill: color-mix(in srgb, var(--answer) 9%, transparent); stroke: color-mix(in srgb, var(--answer) 38%, transparent); }
.fb .lane.on .lanet { fill: var(--answer-ink); }
.fb .lane { transition: opacity 0.35s ease; }
.fb .lane.idle { opacity: 0.55; }
.fn { transition: opacity 0.45s ease; }
.fn.is-todo { opacity: 0.15; }
.fn.idle:not(.is-todo), .fe.idle:not(.is-todo) { opacity: 0.4; }
.fn.is-off, .fe.is-off { display: none; }
.fn.can { cursor: pointer; outline: none; }
.fn :is(rect, 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) 14%, var(--surface)); stroke: color-mix(in srgb, var(--c) 55%, var(--surface)); }
.fn .box.adapt { fill: var(--answer-soft); stroke: color-mix(in srgb, var(--answer) 70%, var(--surface)); }
.fn.is-on :is(rect, circle).box, .fn.is-on .pic.box .frame { stroke: var(--c); stroke-width: 2.4; }
.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; }
.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-alt); }
.fe.k-grad .ln { stroke-dasharray: 5 4; }
.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; }

/* 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-alt); stroke-dasharray: 5 4; }
.flow-legend .h.grad { fill: var(--r-alt); }
.flow-legend .key { width: 0.7rem; height: 0.7rem; border-radius: 2px; }
.flow-legend .key.normal { background: var(--ordinary); }
.flow-legend .key.abnormal { background: var(--rare); }
.flow-legend b { display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border: 1.3px solid var(--ink-3); border-radius: 50%;
  font-size: 0.7rem; font-weight: 700; color: var(--ink-2); }

/* 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: 7%; right: 7%; 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(var(--n, 7), 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-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.4rem; overflow-x: auto;
  font-size: 0.98rem; white-space: nowrap; }
.flow-eq i { font-family: "Times New Roman", Times, serif; font-size: 1.14em; }
.flow-eq sub { font-size: 0.72em; }

/* illustrations */
.fi .ibox { fill: var(--surface); stroke: var(--rule); stroke-width: 1.3; }
.fi .ibox.tint { fill: color-mix(in srgb, var(--r-enc) 14%, var(--surface)); stroke: color-mix(in srgb, var(--r-enc) 55%, var(--surface)); }
.fi .ibox.role { fill: color-mix(in srgb, var(--c) 13%, var(--surface)); stroke: var(--c); }
.fi .ar .ln, .fi .wire { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; }
.fi .ar .hd { fill: var(--ink-2); }
.fi .ar.role .ln, .fi .wire.role { stroke: var(--c); }
.fi .ar.role .hd { fill: var(--c); }
.fi .plus { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.fi .grid path { fill: none; stroke: var(--on-image); stroke-width: 0.6; opacity: 0.45; }
.fi .bar { stroke-width: 1; }
.fi .bar.normal { fill: var(--ordinary-soft); stroke: var(--ordinary); }
.fi .bar.abnormal { fill: var(--rare-soft); stroke: var(--rare); }
.fi .pic.dim { opacity: 0.3; }
.fi .ep rect { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.2; }
.fi .ep.A rect { fill: var(--answer-soft); stroke: color-mix(in srgb, var(--answer) 70%, var(--surface)); }
.fi .ep.on rect { stroke: var(--ink); stroke-width: 2.6; }
.flow svg text.ept { font-size: 11.5px; font-weight: 700; fill: var(--ink-2); }
.flow svg .ep.A text.ept { fill: var(--answer-ink); }
.fx-collage { position: relative; }
.fx-collage img { width: 100%; height: auto; }
.fx-pick { position: absolute; left: 0; top: 0; width: 20.1%; height: 40.5%; border: 3px solid var(--answer); border-radius: 4px; }
.fx-cap { margin: 0.7rem 0 0; font-size: 0.88rem; line-height: 1.45; color: var(--ink-2); }
.fx-cap b { color: var(--ink); font-weight: 650; }
.fx-said { gap: 0.6rem 0.9rem; }
.fx-said li { font-size: 0.86rem; background: var(--surface); }
.fx-tag { margin: 0 0 0.4rem; display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.8rem; font-weight: 640; font-stretch: var(--narrow); line-height: 1.3; }
.fx-tag b { padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 640; }
.fx-tag span { color: var(--ink-3); font-weight: 500; }
.fx-said .normal .fx-tag b { background: var(--ordinary-soft); color: var(--ordinary-ink); }
.fx-said .abnormal .fx-tag b { background: var(--rare-soft); color: var(--rare-ink); }
.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; align-content: 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; }
  .flow-ctl .seg label { padding: 0.36rem 0.6rem; font-size: 0.84rem; }
  .flow-ctl .seg label span { display: none; }
  .fx-said { grid-template-columns: minmax(0, 1fr); }
  .flow-detail { padding-left: 0.6rem; padding-right: 0.6rem; }
  .flow-ill { padding: 0.6rem 0.5rem; }
  .flow svg.fi text.cap { font-size: 14px; }
  .flow svg.fi text.say { font-size: 15px; }
  .flow svg.fi text.sym { font-size: 16px; }
  .flow svg.fi text.ept { font-size: 13.5px; }
}

/* 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; z-index: 1; 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; }
tbody td, tbody th { border-bottom: 1px solid var(--rule-soft); }
tbody th { font-weight: 500; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tr.ours td, tr.ours th { background: var(--answer-soft) !important; font-weight: 560; }
tr.ours th { font-weight: 700; }
td.best { font-weight: 750; }
td.mid, th.mid { text-align: center; }
td.sub { color: var(--ink-2); }
td.yes { color: var(--ink); font-weight: 700; }
td.no { color: var(--ink-3); }
td.barcell, th.barcell { text-align: left; min-width: 9rem; width: 22%; }
.ibar { display: block; height: 0.62rem; border-radius: 0 3px 3px 0; background: var(--bar); min-width: 2px; transition: width 0.35s cubic-bezier(0.3, 0.7, 0.2, 1); }
tr.ours .ibar { background: var(--answer); }
th button.sort { appearance: none; border: 0; background: none; padding: 0.1rem 0; margin: 0; font: inherit; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.3rem; }
th button.sort::after { content: ""; width: 0; height: 0; border: 0.26rem solid transparent; border-top-color: currentColor; margin-top: 0.26rem; opacity: 0.25; }
th button.sort:hover { color: var(--ink); }
th[aria-sort] button.sort { color: var(--ink); font-weight: 720; }
th[aria-sort] button.sort::after { opacity: 1; }
th[aria-sort="ascending"] button.sort::after { border-top-color: transparent; border-bottom-color: currentColor; margin-top: -0.26rem; }
.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.8rem; font-size: 0.88rem; }
.controls .hint { font-size: 0.88rem; color: var(--ink-3); margin: 0; }
.note { font-size: 0.9rem; color: var(--ink-2); margin: 0.8rem 0 0; max-width: 50rem; line-height: 1.5; }
.note b { color: var(--ink); font-weight: 640; }
.pair { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.5rem clamp(1.5rem, 4vw, 3rem); align-items: start; }
.pair h3 { margin-top: 0; }

/* 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(8, 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.66rem; line-height: 1.15; color: var(--on-image);
  font-stretch: var(--narrow); font-weight: 600; background: linear-gradient(transparent, var(--scrim-fade)); 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:not(.ours):has(input:checked) { border-color: var(--ink); }
.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: var(--on-answer); }
.methods label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.viewer-meta { font-size: 0.95rem; color: var(--ink-2); margin: 0.7rem 0 0; }
.viewer-meta b { color: var(--ink); font-weight: 640; }
.linkish { appearance: none; border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; text-decoration: underline;
  text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
.linkish:hover { text-decoration-thickness: 0.12em; }
.linkish[hidden] { display: none; }

/* prompt browser */
.browser { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.9rem; padding: clamp(1rem, 2.4vw, 1.6rem); }
.fields { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 13rem) minmax(0, 1fr); gap: 0.8rem 1rem; align-items: end; margin-bottom: 1.3rem; }
.fields label { display: grid; gap: 0.35rem; font-size: 0.82rem; font-weight: 600; color: var(--ink-3); font-stretch: var(--narrow); }
.fields select, .fields input { width: 100%; padding: 0.5rem 0.7rem; border: 1px solid var(--rule); border-radius: 0.45rem; background: var(--paper);
  color: var(--ink); font-size: 0.95rem; font-weight: 500; font-stretch: 100%; }
.fields select:hover, .fields input:hover { border-color: var(--ink-3); }
.fields input::placeholder { color: var(--ink-3); }
.browser .status { margin: 0; font-size: 0.95rem; color: var(--ink-2); }
.browser .status[hidden], .browser .said[hidden] { display: none; }

/* cite */
.bib { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 0.7rem; 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; }
.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: var(--plate); max-width: min(96vw, 110rem); max-height: 94vh; border-radius: 0.6rem; overflow: auto; }
dialog.zoom::backdrop { background: var(--backdrop); }
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 var(--plate-rule); background: var(--plate); color: var(--plate-ink); 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); }
  .console .said { grid-template-columns: minmax(0, 1fr); }
  .viewer, .pair { grid-template-columns: minmax(0, 1fr); }
  .viewer .reveal { max-width: 30rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li { padding: 1.1rem 1rem 1.1rem 0; }
  .stats li + li { padding-left: 0; border-left: 0; }
  .stats li:nth-child(even) { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
  .stats li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields label:last-child { grid-column: 1 / -1; }
}
@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; }
  .lede { font-size: 1.1rem; }
  .abstract .cols { grid-template-columns: minmax(0, 1fr); }
  .console { grid-template-columns: minmax(0, 1fr); }
  .console-stage { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .duo { grid-template-columns: minmax(0, 1fr); }
  .said { grid-template-columns: minmax(0, 1fr); }
  .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .methods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  th, td { padding: 0.45rem 0.6rem; }
  td.barcell, th.barcell { min-width: 5rem; }
}
@media (min-width: 60.0625rem) and (max-width: 76rem) {
  /* the side column of the viewer is narrow here: fewer, larger tiles */
  .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .methods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 23rem) {
  .bar .wrap { gap: 0.6rem; }
  .bar nav { gap: 0.7rem; }
  .bar nav a { font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ibar { transition: none; }
  .fn, .fe, .fb .lane, .fn .pic.box, .flow-rail i, .flow-steps .dot { transition: none; }
  .flow-detail.in > * { animation: none; }
}
@media print {
  .bar, .theme, .copy { display: none; }
}
