/* Shared page layout and styles. Component styles live in css/. */
:root {
  --paper: #ffffff;
  --ink: #17252d;
  --ink-2: #3a464e;
  --slate: #6a7479;
  --slate-tx: #5b656a;
  --rule: #dde2e5;
  --rule-2: #edf0f2;
  --band: #f2f5f6;
  --block: #dae0e3;
  --block-2: #c3ccd0;
  --block-now: #8f9a9f;
  --green: #00a86b;
  --green-ink: #007a4e;
  --green-2: #5cc69a;
  --green-tint: #e2f4ec;
  --violet: #7c3aed;
  --violet-tint: #efe8fd;
  --orange: #e07a1f;
  --orange-tint: #fbe9d8;
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 40rem;
  --wide: clamp(70rem, 78vw, 80rem);
  --intro: 76rem;
  --stepper: 80rem;
  --rail-w: 12rem;
  --gutter: clamp(1rem, 2.25vw, 2.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 56px; -webkit-text-size-adjust: 100%; overflow-x: clip; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 18px; line-height: 1.62; font-optical-sizing: auto;
  font-variation-settings: "opsz" 14; text-rendering: optimizeLegibility; overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.18em; }
a:hover { color: var(--green-ink); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--green-ink); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 6px 12px; font-family: var(--sans); font-size: 14px; z-index: 60; }
.skip:focus { left: 8px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.c-jello { color: var(--green-ink); } .c-adapter { color: var(--violet); } .c-muted { color: var(--slate); }

/* ---------------------------------------------------------------- masthead */
.masthead { max-width: 58rem; margin: 0 auto; padding: 88px var(--gutter) 40px; text-align: center; }
.title { margin: 0; font-weight: 400; }
.title-short {
  display: block; font-size: clamp(64px, 11vw, 112px); line-height: 0.92; letter-spacing: -0.02em;
  font-weight: 600; font-variation-settings: "opsz" 72;
}
.title-long {
  display: block; margin: 18px auto 0; max-width: 30ch; font-size: clamp(23px, 3.1vw, 32px); line-height: 1.22;
  font-weight: 400; font-variation-settings: "opsz" 36; letter-spacing: -0.005em;
}
.expansion { margin: 14px 0 0; font-style: italic; color: var(--slate); font-size: 17px; }
.authors { margin: 30px 0 0; font-family: var(--sans); font-size: 17px; font-weight: 500; }
.authors a { text-decoration-style: dotted; }
.venue { margin: 2px 0 0; font-family: var(--sans); font-size: 15px; color: var(--slate); }
.links { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 13px; border: 1px solid var(--ink);
  border-radius: 6px; background: var(--paper); font-family: var(--sans); font-size: 15px; font-weight: 500;
  text-decoration: none; color: var(--ink); cursor: pointer; line-height: 1.2;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.btn:disabled, .btn[aria-disabled="true"] { color: var(--slate-tx); border-color: var(--block-2); cursor: default; }
.btn:not(:disabled, [aria-disabled="true"]):hover { background: var(--ink); color: #fff; }
.btn-small { padding: 6px 12px 6px 10px; font-size: 13.5px; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #2b3a43; }
.btn-small svg { width: 14px; height: 14px; }
.linkish { background: none; border: 0; padding: 0; font-family: var(--sans); font-size: 13px; color: var(--green-ink); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }

/* ---------------------------------------------------------------- page structure */
main { padding: 0 0 40px; container: page / inline-size; }
.part, .bibfoot { padding-inline: var(--gutter); }
.column { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.wide { max-width: var(--wide); margin-left: auto; margin-right: auto; }
.stepper-wide { max-width: var(--stepper); margin: 24px auto 0; }
/* Reserve room for widgets while their scripts load near the viewport. */
#stepper[data-pending] { min-height: 750px; }
#sx[data-pending] { min-height: 700px; }
#pareto[data-pending] { min-height: 560px; }
@media (width <= 860px) {
  #stepper[data-pending] { min-height: 1500px; }
  #sx[data-pending] { min-height: 1060px; }
  #pareto[data-pending] { min-height: 580px; }
}
h2 {
  font-size: 28px; line-height: 1.2; font-weight: 600; margin: 96px 0 18px; letter-spacing: -0.008em;
  font-variation-settings: "opsz" 36; text-wrap: balance;
}
h3 { font-size: 21px; line-height: 1.3; font-weight: 600; margin: 0 auto 12px; font-variation-settings: "opsz" 24; text-wrap: balance; }
h4 { font-size: 17px; line-height: 1.35; font-weight: 600; margin: 0 0 8px; font-variation-settings: "opsz" 18; }
p { margin: 0 0 1em; }
/* paper sentences read as ordinary page text (no quote rule, no source tag) */
.lede { margin: 0 auto 8px; }
.sec-sub { margin-top: 80px; }
.sec-sub > .column + .column, .sec-sub > h3 + .column { margin-top: 0; }
.sec-sub > .column:has(.lede) { margin-bottom: 24px; }
.sub-tight { margin-top: 28px; }
.illus { font-family: var(--sans); font-size: 13px; margin: 0 0 10px; color: var(--ink-2); }
.readout { font-family: var(--sans); font-size: 14px; color: var(--ink-2); min-height: 1.6em; margin: 10px 0 0; }
.hint { font-family: var(--sans); font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }

/* ---------------------------------------------------------------- abstract and forward-pass teaser */
.intro {
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 56px var(--gutter) 24px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: start;
}
.abs-col h2 { margin: 0 0 18px; }
.abs { font-size: 18.5px; margin: 0; }
.abs p { margin: 0 0 14px; }
.abs p:last-child { margin-bottom: 0; }
.intro-teaser { width: 100%; max-width: var(--measure); min-width: 0; margin-inline: auto; }
.teaser { margin: 0; }

@container page (min-width: 48rem) {
  .column { max-width: var(--wide); }
}

@container page (min-width: 68rem) {
  .intro {
    max-width: calc(var(--intro) + 2 * var(--gutter));
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 4cqi, 3.5rem);
  }
  .intro-teaser { padding-top: 1.5rem; }
}

/* ---------------------------------------------------------------- qualitative pairs (round-1 01 gallery format) */
#qualitative > h2 { text-align: center; }
.q4-tabs-wrap { display: flex; justify-content: center; margin: 0 0 18px; }
.q4-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.5rem, 1.5cqi, 1.25rem); max-width: 58rem; margin: 0 auto; }
.q4-h { font-family: var(--sans); font-size: 14px; font-weight: 600; margin: 0 0 8px; text-align: center; }
.q4-img { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 4px; overflow: hidden; margin-bottom: 8px; aspect-ratio: 1; background: #ccd3d7; cursor: zoom-in; }
.q4-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.q4-img:hover img { transform: scale(1.02); }
.q4-img .calls { position: absolute; top: 8px; left: 8px; font-family: var(--sans); font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.92); color: var(--ink); border-radius: 3px; padding: 1px 6px; }
.q4-img .q4-lab { position: absolute; bottom: 8px; left: 8px; font-family: var(--sans); font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.92); color: var(--ink-2); border-radius: 3px; padding: 1px 6px; }
.q4-img.ours .q4-lab, .q4-img.ours .calls { color: var(--green-ink); }
.q4-cap { margin-top: 16px; font-size: 15px; line-height: 1.55; color: var(--ink-2); font-variation-settings: "opsz" 10; }

/* block stack drawn by JC.blockStack (shared helper) */
.stack .cell { fill: var(--block); transition: fill 90ms; }
.stack .theta { fill: #f6f2fe; }
.stack .theta-t { font-family: var(--serif); font-style: italic; font-size: 10px; fill: transparent; }
.stack .times { font-family: var(--sans); font-size: 11.5px; font-weight: 700; fill: var(--green-ink); }
.stack .bnum { font-family: var(--sans); font-size: 9px; fill: var(--slate-tx); font-variant-numeric: tabular-nums; pointer-events: none; }
.stack .pass { fill: transparent; }
.stack .blk.loop .cell { fill: var(--green-2); }
.stack .blk.loop .theta { fill: var(--violet-tint); }
.stack .blk.loop .theta-t { fill: var(--violet); }
.stack .blk.loop .bnum { fill: #0b3a28; }
.stack .blk.loop .pass.show { fill: rgba(255,255,255,.55); }
.stack .blk.loop .pass.hit { fill: #fff; }
.stack .blk.done .cell { fill: var(--block-2); }
.stack .blk.loop.done .cell { fill: var(--green); }
.stack .blk.on .cell { fill: var(--ink); }
.stack .blk.loop.on .cell { fill: #00704a; }
.stack .blk.on .bnum { fill: #fff; }

/* ---------------------------------------------------------------- figure text, citations, glossary */
figure { margin: 0; }
figcaption { font-family: var(--serif); font-size: 15px; line-height: 1.55; color: var(--ink-2); font-variation-settings: "opsz" 10; }
figcaption strong { color: var(--ink); font-weight: 600; }
.float-label { font-weight: 600; color: var(--ink); font-family: var(--sans); }
.katex { font-size: 1.04em; }
.cites { font-family: var(--sans); font-size: 0.8em; color: var(--slate); white-space: nowrap; }
.cites a.cite { text-decoration: underline dotted; color: var(--green-ink); cursor: help; }
a.xref-main { text-decoration: none; color: var(--green-ink); }
a.xref-main:hover { text-decoration: underline; }
.xref-note { text-decoration: underline dotted var(--slate); text-underline-offset: 0.2em; cursor: help; }
.xref-plain { text-decoration: none; color: inherit; }

.term { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: help; text-decoration: underline dotted; text-decoration-color: #9aa3a8; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.term:hover, .term[aria-expanded="true"] { text-decoration-color: var(--ink); background: var(--band); border-radius: 2px; }
.gcard { position: absolute; z-index: 70; width: min(380px, calc(100vw - 24px)); background: #fff; border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 6px 24px rgba(23,37,45,.14); padding: 12px 14px; font: 14.5px/1.5 var(--serif); color: var(--ink-2); display: none; }
.gcard.open { display: block; max-height: calc(100dvh - 24px); overflow: auto; }
.gc-h, .cc-t { display: block; font: 600 13.5px var(--sans); color: var(--ink); margin-bottom: 4px; }
.gc-src { display: block; font: 12px var(--sans); color: var(--slate-tx); margin-top: 6px; }
.cc-n { font: 600 11px var(--sans); color: #fff; background: var(--ink); border-radius: 3px; padding: 1px 5px; margin-right: 6px; float: left; margin-top: 2px; }
.cc-t { font-family: var(--serif); font-size: 15px; }
.cc-a, .cc-v { display: block; font: 12.5px var(--sans); color: var(--slate-tx); }

/* chart tooltip */
.tip { position: fixed; z-index: 80; pointer-events: none; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 11px; box-shadow: 0 6px 24px rgba(23,37,45,.14); font-family: var(--sans); font-size: 13px; line-height: 1.45; max-width: 300px; }
.tip[hidden] { display: none; }
.tip b { font-weight: 600; }
.tp-k { display: flex; align-items: center; gap: 6px; color: var(--slate-tx); font-size: 12.5px; }
.tp-k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tp-v { display: grid; grid-template-columns: auto auto; gap: 0 10px; margin-top: 4px; width: max-content; }
.tp-v span { color: var(--slate-tx); }

/* ---------------------------------------------------------------- controls (01) */
.seg-ctl { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 6px; padding: 2px; gap: 2px; background: var(--paper); }
.seg-ctl button { border: 0; background: none; padding: 5px 11px; border-radius: 4px; font-family: var(--sans); font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.seg-ctl button:hover { color: var(--ink); background: var(--band); }
.seg-ctl button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tabs { display: flex; gap: 0 4px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; position: relative; }
.tabs button { border: 0; background: none; padding: 10px 12px 9px; font-family: var(--sans); font-size: 14.5px; color: var(--slate-tx); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.ctl-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; padding-right: 40px; position: relative; min-height: 32px; }
.chart-box { position: relative; }
.chart-x { position: absolute; top: 0; right: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); cursor: pointer; color: var(--ink-2); padding: 0; }
.chart-x:hover { border-color: var(--ink); color: var(--ink); }
.chart-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.in-dlg .chart-x { display: none; }
.chart-note { font-family: var(--sans); font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }
.switch { display: inline-flex; gap: 7px; align-items: center; font-family: var(--sans); font-size: 13.5px; cursor: pointer; }
.switch input { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; }
svg .tick { font-family: var(--sans); font-size: 12px; fill: var(--slate); font-variant-numeric: tabular-nums; }
svg .alabel { font-family: var(--sans); font-size: 12.5px; fill: var(--ink-2); }
svg .gl { stroke: #eceff1; }

/* ---------------------------------------------------------------- method (position only; widgets in css/method.css) */
#alg\:jello > h3 { margin-bottom: 12px; }
.paper-algorithm { border-block: 1.5px solid var(--ink); padding: 10px 0 12px; margin: 0 0 18px; }
.paper-algorithm > figcaption { border-bottom: 1px solid var(--ink); padding-bottom: 8px; margin: 0 0 10px; }
.alg-body { font-family: var(--serif); font-size: 15.5px; line-height: 1.55; overflow-x: auto; position: relative; }
.alg-input { margin: 0 0 6px; }
.alg-lines { margin: 0; padding-left: 2.2em; }
.alg-lines li { padding-left: calc(var(--depth) * 1.4em); }
.alg-lines li::marker { font-family: var(--sans); font-size: 12px; color: var(--slate); }
.alg-kw { font-weight: 700; }
.alg-comment { color: var(--slate); }
.sc { font-variant: small-caps; letter-spacing: 0.02em; }
.xo-open { margin-top: 24px; display: flex; justify-content: center; }

/* ---------------------------------------------------------------- results: Pareto explorer */
.pb-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 18px; margin-bottom: 14px; }
.pb-chart { position: relative; }
.pb-chart .chart-x { top: auto; bottom: 0; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 8px 0 0; font-family: var(--sans); font-size: 13px; }
.lg { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 3px 2px; cursor: pointer; color: var(--ink-2); }
.lg i { width: 16px; height: 3px; border-radius: 2px; background: var(--c); position: relative; }
.lg i::after { content: ""; position: absolute; left: 4.5px; top: -2.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.lg.ours { font-weight: 700; color: var(--ink); }
.lg[aria-pressed="false"] { opacity: 0.4; text-decoration: line-through; }
svg.pareto { display: block; width: 100%; cursor: zoom-in; }
.in-dlg svg.pareto { cursor: crosshair; }
svg.pareto:focus-visible { outline: 2px solid var(--green-ink); outline-offset: 4px; }
.pareto .grid line.h { stroke: #eceff1; }
.pareto .grid line.v { stroke: #f2f4f5; }
.pareto .axis { stroke: #7f898f; stroke-width: 1; }
.pareto .ll { font-family: var(--sans); font-size: 12.5px; font-weight: 600; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.pareto .ll.ours { font-size: 13.5px; font-weight: 700; }
.pareto .lead { fill: none; stroke-width: 1; stroke-dasharray: 1.5 3.5; opacity: .55; }
.pareto .alabel { font-family: var(--sans); font-size: 12.5px; fill: var(--ink-2); }
.pareto .frontier { fill: none; stroke-linejoin: round; stroke-linecap: round; opacity: 0.9; }
.pareto .pt { stroke: #fff; stroke-width: 1.2; }
.pareto .pt.dom { opacity: .32; }
.pareto .ring { fill: none; stroke-width: 2; pointer-events: none; }

/* ---------------------------------------------------------------- results: tables (web-native, no value bars) */
.tbl-cap { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin: 0 0 12px; font-variation-settings: "opsz" 10; }
.tbl-cap strong { color: var(--ink); }
.tb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-bottom: 6px; }
.tb-bar:has(.tb-head) { border-bottom: 1px solid var(--rule); }
.tb-head { flex: 1 1 50%; min-width: 0; align-self: flex-end; }
.tb-head .tabs { border-bottom: 0; margin-bottom: 0; }
.tb-head .tabs button { margin-bottom: 0; }
.tb-tools { display: flex; justify-content: flex-end; align-items: center; margin-left: auto; gap: 16px; }
.tbl-reset { background: none; border: 0; padding: 2px 0; font-family: var(--sans); font-size: 13px; color: var(--green-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.tbl-reset[disabled] { color: var(--slate); text-decoration: none; cursor: default; opacity: 0.6; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.wt { --cell-inset: 10px; width: 100%; border-collapse: separate; border-spacing: 0; font-family: var(--sans); font-size: 14px; font-variant-numeric: tabular-nums lining-nums; }
.wt th, .wt td { padding: 7px var(--cell-inset); white-space: nowrap; text-align: right; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.wt .mcol { text-align: left; font-weight: 400; position: sticky; left: 0; background: var(--paper); z-index: 1; }
.wt .trn-c, .wt .trn-h { text-align: left; color: var(--slate-tx); font-size: 13px; }
.wt thead th { font-weight: 600; font-size: 13px; color: var(--ink-2); vertical-align: bottom; border-bottom: 1px solid var(--ink); background: var(--paper); }
.wt thead tr.gh th { border-bottom: 0; padding-bottom: 0; }
.wt thead th.grp-h { text-align: center; border-bottom: 1px solid var(--rule); font-weight: 500; }
.wt thead button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: baseline; gap: 3px; }
.wt thead button:hover { color: var(--ink); }
.sort-i { width: 0; height: 0; border: 4px solid transparent; border-top-color: #c2cacd; margin-left: 2px; transform: translateY(2px); }
.wt th.sorted { color: var(--ink); }
.wt th[aria-sort="descending"] .sort-i { border-top-color: var(--ink); }
.wt th[aria-sort="ascending"] .sort-i { border-top-color: transparent; border-bottom-color: var(--ink); transform: translateY(-2px); }
.wt tr.grp th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--slate); padding-top: 14px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.wt .grp-label { position: sticky; inset-inline-start: var(--cell-inset); display: inline-block; }
.wt tbody tr:hover > * { background: #f6f8f9; }
.wt tr.ours .mcol { box-shadow: inset 3px 0 0 var(--green); font-weight: 600; }
.wt tr.ours > * { background: var(--green-tint); }
.wt tr.ours:hover > * { background: #d5efe3; }
.wt strong { font-weight: 700; color: var(--ink); }
.wt u { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.wt .trn { display: block; font-size: 11.5px; color: var(--slate-tx); font-weight: 400; }
.wt .katex { font-size: 1em; }
.delta { display: block; font-size: 11px; line-height: 1.2; color: var(--slate-tx); font-weight: 500; }
.delta.up { color: var(--green-ink); } .delta.down { color: #a8433b; }
.tbl3 { max-width: 48rem; margin: 48px auto 0; }

/* ---------------------------------------------------------------- results: gallery */
#gal { container: gallery / inline-size; }
.gal-ctl { margin-bottom: 12px; }
.gal-tabs:empty { display: none; }
.gal-picks { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; position: relative; }
.gal-picks button { flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 4px; opacity: .55; transition: opacity 150ms; position: relative; font-family: var(--sans); font-size: 11.5px; color: var(--ink-2); text-align: center; }
.gal-picks button img { width: 54px; height: 54px; object-fit: cover; border-radius: 3px; }
.gal-picks button span { display: block; max-width: 70px; margin: 2px auto 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-picks button:has(span) img { width: 70px; height: 70px; }
.gal-picks button:hover { opacity: .85; }
.gal-picks button[aria-pressed="true"] { opacity: 1; }
.gal-picks button[aria-pressed="true"] img { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.gal-prompt, .vd-prompt { font-style: italic; color: var(--ink-2); font-size: 15.5px; margin: 6px 0 14px; }
.seed { font-style: normal; font-family: var(--sans); font-size: 12.5px; color: var(--slate-tx); margin-left: 6px; white-space: nowrap; }
.gal-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 16px 10px; }
.gi figcaption { font-family: var(--sans); font-size: 12.5px; line-height: 1.35; margin-top: 6px; }
.gi figcaption b { display: block; font-weight: 600; color: var(--ink); font-size: 13px; }
.gi.ours figcaption b { color: var(--green-ink); }
.gi figcaption span { color: var(--slate-tx); }
.gi-img { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #ccd3d7; border-radius: 4px; overflow: hidden; cursor: zoom-in; aspect-ratio: 1; }
.gi-img img { width: 100%; height: 100%; object-fit: cover; }
.gi.ours .gi-img { box-shadow: 0 0 0 2px var(--green); }
.gi-img:hover { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------------------------------------------------------------- results: videos */
.vd-picks { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; position: relative; }
.vd-picks button { flex: none; width: 112px; padding: 0; border: 0; background: none; cursor: pointer; font-family: var(--sans); font-size: 11.5px; line-height: 1.3; color: var(--ink-2); text-align: left; }
.vd-picks button img { width: 112px; height: 62px; object-fit: cover; border-radius: 3px; margin-bottom: 3px; opacity: .65; }
.vd-picks button span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vd-picks button:hover img { opacity: .85; }
.vd-picks button[aria-pressed="true"] { opacity: 1; color: var(--ink); }
.vd-picks button[aria-pressed="true"] img { opacity: 1; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.vd-ctl { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.vd-arms { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 6px; padding: 3px 11px 3px 8px; font-family: var(--sans); font-size: 13px; cursor: pointer; }
.chip input { accent-color: var(--ink); margin: 0; }
.chip.ours { color: var(--green-ink); font-weight: 600; }
.vd-grid { display: grid; grid-template-columns: repeat(min(var(--n), 4), minmax(0, 1fr)); gap: 10px; }
.vd-stage { position: relative; }
.vd video { width: 100%; height: auto; aspect-ratio: 320 / 176; display: block; border-radius: 4px; background: #1d262b; }
.vd-open { position: absolute; inset: 0; border: 0; padding: 0; border-radius: 4px; background: none; cursor: zoom-in; }
.vd.ours video { box-shadow: 0 0 0 2px var(--green); }
.vd figcaption { font-family: var(--sans); font-size: 12.5px; margin-top: 6px; line-height: 1.35; }
.vd figcaption b { display: block; font-size: 13px; color: var(--ink); }
.vd.ours figcaption b { color: var(--green-ink); }
.vd figcaption span { color: var(--slate-tx); }
.vd-transport { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.vd-play, .vd-step { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ink); background: var(--paper); display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--ink); }
.vd-step { border-color: var(--rule); }
:is(.vd-play, .vd-step):hover { background: var(--ink); color: #fff; }
:is(.vd-play, .vd-step) svg { width: 14px; height: 14px; fill: currentColor; }
.vd-play .i-pause, .vd-play.on .i-play { display: none; }
.vd-play.on .i-pause { display: inline; }
.vd-range { flex: 1; min-width: 0; accent-color: var(--ink); }
.vd-t { font-family: var(--sans); font-size: 13px; color: var(--ink-2); min-width: 10ch; text-align: right; }

/* ---------------------------------------------------------------- results: what JELLO adds */
.dims-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 22px; }
.dims-mn { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; }
.dims-mn > span:empty { display: none; }
.dims-h { margin-top: 0; }
.dims-sub { margin-top: 56px; }
.dims-sub .dims-pick { margin-top: 4px; }
.dims-q p, .lede-block p { margin: 0 0 12px; }
.lede-block { margin-bottom: 24px; }
.dc-svg { display: block; width: 100%; }
.dc-label { font-family: var(--sans); font-size: 13px; fill: var(--ink); }
.dc-group { font-family: var(--sans); font-size: 13px; font-weight: 600; fill: var(--ink); }
.dc-sub { font-family: var(--sans); font-size: 12px; fill: var(--slate-tx); font-variant-numeric: tabular-nums; }
.dc-sub.head { fill: var(--ink-2); }
.dc-legend text { font-family: var(--sans); font-size: 12.5px; fill: var(--ink-2); }
.row-l { stroke: #f0f2f3; }
.dc-svg .pa { fill: #fff; stroke: var(--slate); stroke-width: 1.8; }
.dc-svg .pb { fill: var(--green); stroke: #fff; stroke-width: 1.2; }
.dc-arrow { stroke: var(--slate); stroke-width: 1.6; fill: none; }
.dc-arrow.up { stroke: var(--green); stroke-width: 2.2; }
.dc-d { font-family: var(--sans); font-size: 11.5px; font-weight: 600; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.dc-d.up { fill: var(--green-ink); }

/* ---------------------------------------------------------------- BibTeX footer */
.bibfoot { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 120px auto 0; }
.foot-c { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; border-top: 1px solid var(--rule); padding-top: 22px; }
.foot-c h2 { font-size: 28px; margin: 0 0 12px; }
.foot-c > div { min-width: 0; }
.acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.click-copy { position: relative; cursor: copy; border-radius: 6px; }
.click-copy pre { margin: 0; padding: 18px 20px; background: var(--band); border: 1px solid var(--rule); border-radius: 6px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--ink); transition: background .2s; }
.click-copy:hover pre { background: #e9eef0; }
.click-copy .hint { position: absolute; top: 8px; right: 10px; margin: 0; font-size: 12px; color: var(--slate-tx); background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 1px 9px; opacity: 0; transition: opacity .15s; }
.click-copy:hover .hint, .click-copy:focus-visible .hint, .click-copy.done .hint { opacity: 1; }
.click-copy.done .hint { color: var(--green-ink); }
.bib-note { font-family: var(--sans); font-size: 13px; margin: 8px 0 0; }

/* ---------------------------------------------------------------- dialog + viewer */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: rgba(23,37,45,.55); }
.dlg { width: min(1240px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border-radius: 8px; display: none; flex-direction: column; overflow: hidden; }
.dlg[open] { display: flex; }
.dlg.viewer { width: calc(100vw - 32px); height: calc(100dvh - 32px); max-width: 1600px; }
.dlg.viewer:not(.video-viewer) { max-width: max(1600px, 90vw); height: 80dvh; }
.dlg-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--rule); flex: none; }
.dlg-title { margin: 0; font-family: var(--sans); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg-body { padding: 18px 22px 22px; overflow: auto; flex: 1; min-height: 0; }
.dlg.viewer .dlg-body { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.v-btn { min-width: 32px; height: 32px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); cursor: pointer; font-family: var(--sans); font-size: 18px; line-height: 1; color: var(--ink); }
.v-btn:hover { border-color: var(--ink); }
.v-btn.v-text { font-size: 13px; padding: 0 10px; }
.v-btn[hidden] { display: none; }
.vw-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: 13px; }
.vw-nav, .vw-scale { display: flex; align-items: center; gap: 4px; }
.vw-nav { padding-inline-end: 10px; border-inline-end: 1px solid var(--rule); }
.vw-count, .vw-zoom { min-width: 46px; text-align: center; color: var(--ink-2); }
.vw-hint { margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
.vw-panes { flex: 1; display: grid; grid-template-columns: repeat(min(var(--n), 7), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 8px; padding: 10px; min-height: 0; background: #e9edef; }
.vw-pane { position: relative; min-height: 0; display: flex; flex-direction: column; }
.vw-stage { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; border-radius: 4px; min-height: 0; background: #dfe4e6; }
.vw-stage.drag { cursor: grabbing; }
.vw-wrap { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.vw-wrap img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.vw-wrap.px img { image-rendering: pixelated; }
.vw-lab { position: absolute; top: 8px; left: 8px; max-width: calc(100% - 62px); font-family: var(--sans); font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.94); border-radius: 3px; padding: 2px 7px; color: var(--ink-2); pointer-events: none; }
.vw-sub { font-weight: 400; color: var(--slate-tx); }
.vw-pane.ours .vw-lab { color: var(--green-ink); }
.vw-fullscreen { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; padding: 0; }
.vw-fullscreen svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.video-viewer .vd-open { display: none; }
.video-viewer .vd-transport { flex: 1; margin: 0; }
.video-viewer .vw-panes { display: block; overflow-y: auto; overscroll-behavior-y: contain; }
.video-viewer .vd-grid { width: min(100%, 720px, 120dvh); margin-inline: auto; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.viewer :is(img, video):fullscreen { object-fit: contain; background: #000; border-radius: 0; box-shadow: none; image-rendering: auto; }
.vw-info { flex: none; padding: 8px 16px 10px; border-top: 1px solid var(--rule); }
.vw-info:empty { display: none; }
.vw-prompt { margin: 0; font-style: italic; font-size: 14.5px; color: var(--ink-2); }
.vw-seed { font-style: normal; font-family: var(--sans); font-size: 12.5px; color: var(--slate-tx); margin-left: 6px; }
.dlg.wide .chart-box.in-dlg { min-width: 0; }

/* ---------------------------------------------------------------- section rail: round-1 09 placement, grey blocks only */
.rail { display: none; }
.strip { display: none; }
@media (min-width: 90rem) {
  body {
    --page-max: calc(var(--rail-w) + var(--stepper) + 2 * var(--gutter));
    max-width: var(--page-max); margin-inline: auto; padding-inline-start: var(--rail-w);
  }
  .rail {
    display: block; position: fixed; inset-block: 0; inset-inline-start: max(0px, (100% - var(--page-max)) / 2);
    width: var(--rail-w); padding: 28px 12px 28px 20px;
    overflow-y: auto; scrollbar-width: thin; z-index: 20; background: var(--paper); font-family: var(--sans);
  }
  .rail-head { display: block; margin: 0 0 5px; font-family: var(--serif); font-weight: 650; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
  .rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .rail a.blk { display: grid; grid-template-columns: 40px 1fr; align-items: center; column-gap: 10px; padding: 2px 0; text-decoration: none; color: var(--slate-tx); font-size: 12.5px; line-height: 1.25; }
  .rail .box { height: 14px; width: 40px; border-radius: 3px; background: var(--block); transition: background-color .2s; }
  .rail li.sub .box { height: 9px; width: 28px; margin-left: 6px; }
  .rail li.sub a.blk { font-size: 12px; padding: 1px 0; }
  .rail .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail a.blk:hover .box { background: var(--block-2); }
  .rail a.blk:hover .lbl { color: var(--ink); }
  .rail a.now .box { background: var(--block-now); }
  .rail a.now .lbl { color: var(--ink); font-weight: 500; }
}
@media (width < 90rem) {
  .rail-head { display: none; }
  .strip { display: flex; position: sticky; top: 0; z-index: 30; height: 42px; align-items: center; padding: 0 var(--gutter); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--rule-2); font-family: var(--sans); }
  .strip-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 0; cursor: pointer; min-width: 0; flex: 1; text-align: left; }
  .strip-cur { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .strip-blocks { display: flex; gap: 2px; align-items: center; height: 14px; min-width: 77px; flex: 0 0 auto; }
  .strip-blocks i { display: block; width: 5px; height: 12px; border-radius: 1px; background: var(--block); }
  .strip-blocks i.sub { height: 7px; width: 4px; }
  .strip-blocks i.now { background: var(--block-now); }
  body.rail-open .rail { display: block; position: fixed; inset: 42px 0 auto 0; z-index: 29; background: var(--paper); border-bottom: 1px solid var(--rule); box-shadow: 0 10px 30px rgba(23,37,45,.12); padding: 12px var(--gutter) 16px; font-family: var(--sans); max-height: calc(100vh - 42px); overflow-y: auto; }
  body.rail-open .rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  body.rail-open .rail a.blk { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; padding: 4px 0; text-decoration: none; font-size: 14px; color: var(--ink-2); }
  body.rail-open .rail .box { height: 10px; border-radius: 2px; background: var(--block); }
  body.rail-open .rail li.sub .box { height: 6px; width: 28px; margin-left: 6px; }
  body.rail-open .rail a.now .box { background: var(--block-now); }
  body.rail-open .rail a.now { color: var(--ink); }
}

/* ---------------------------------------------------------------- responsive */
@container gallery (max-width: 42rem) {
  .gal-row { grid-template-columns: repeat(min(var(--n), 2), minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  body { font-size: 17px; }
  .masthead { padding-top: 56px; }
  .intro { padding-top: 48px; }
  .abs { font-size: 17.5px; }
  h2 { font-size: 24px; margin-top: 72px; }
  h3 { font-size: 19px; }
  .sec-sub { margin-top: 64px; }
  .q4-h { font-size: 12px; min-height: 2.6em; }
  #q4-tabs, .pb-bb, .pb-metric { width: 100%; }
  #q4-tabs { max-width: 32rem; }
  #q4-tabs .seg-ctl, .pb-controls .seg-ctl { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pb-bb .seg-ctl button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .pb-metric .seg-ctl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #q4-tabs button, .pb-controls button, .tb-tools > * { min-height: 44px; }
  .q4-img .q4-lab { bottom: 4px; left: 4px; font-size: 11px; padding: 0 4px; }
  .q4-img .calls { top: 4px; left: 4px; font-size: 11px; padding: 0 4px; }
  .foot-c { grid-template-columns: 1fr; gap: 10px; }
  .acts { flex-direction: row; }
  .vd-grid { grid-template-columns: repeat(min(var(--n), 2), minmax(0, 1fr)); gap: 6px; }
  .vd-transport { gap: 6px; }
  .vd-play, .vd-step { width: 44px; height: 44px; }
  .vw-hint { display: none; }
  .vw-panes { grid-template-columns: repeat(min(var(--n), 2), minmax(0, 1fr)); padding: 6px; }
  .dlg.viewer .v-btn { min-width: 44px; height: 44px; }
  .dlg, .dlg.viewer { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .dlg:not(.viewer) { height: auto; }
  .dlg-body { padding: 14px; }
  .wt { --cell-inset: 8px; font-size: 13px; }
  .wt th, .wt td { padding-block: 6px; }
  .wt .mcol { max-inline-size: min(46vw, 180px); white-space: normal; }
}
@media (orientation: portrait) {
  .vw-panes { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(min(260px, 36dvh), 1fr); overflow-y: auto; overscroll-behavior-y: contain; }
  .vw-panes:not(.zoomed) .vw-stage { touch-action: pan-y; }
  .vw-lab { position: static; order: -1; max-width: none; padding: 5px 8px; background: transparent; pointer-events: auto; }
  .vw-info { max-height: 20dvh; overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
