:root {
  --text: #121b29;
  --muted: #5b6576;
  --faint: #8a93a1;
  --rule: #e8eaee;
  --soft: #f5f6f8;
  --accent: #b8322f;
  --link: #2563c9;
  --decoder: #2f6fb7;
  --encoder: #d1495b;
  --wide: 1100px;
  --column: 800px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font: 400 17px/1.7 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

.hero, main, footer { max-width: var(--wide); margin: 0 auto; padding: 0 24px; }

/* Header */
.hero { text-align: center; padding-top: 72px; padding-bottom: 8px; }
h1 {
  max-width: 920px;
  margin: 0 auto 26px;
  font-size: clamp(30px, 4vw, 43px);
  line-height: 1.2;
  font-weight: 670;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
h1 .method { color: var(--accent); }
.authors, .affiliations, .notes { margin: 0 auto; }
.authors { max-width: 900px; font-size: 17px; line-height: 1.8; }
.authors span { display: inline-block; margin: 0 9px; white-space: nowrap; }
.authors a { color: var(--link); text-decoration: none; }
.authors a:hover { text-decoration: underline; }
.affiliations { margin-top: 8px; color: var(--muted); font-size: 15px; }
.affiliations span { display: inline-block; margin: 0 9px; }
.notes { margin-top: 4px; color: var(--muted); font-size: 14px; }
sup { font-size: 0.68em; line-height: 0; }

.links { margin: 24px 0 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.button {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.button:hover { background: #000; }
.button.disabled { background: var(--soft); color: var(--faint); cursor: default; }

/* Sections */
main > section { padding: 44px 0 8px; }
main > section + section { border-top: 1px solid var(--rule); margin-top: 36px; }
h2 { margin: 0 0 10px; font-size: 24px; line-height: 1.35; font-weight: 650; letter-spacing: -0.025em; }
h3 { font-size: 21px; font-weight: 630; letter-spacing: -0.025em; }
p { margin: 0 0 16px; }
.lede { max-width: var(--column); color: var(--muted); margin: 0 0 22px; }
.abstract { max-width: none; text-align: justify; hyphens: none; }
.abstract strong { font-weight: 650; }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: 15px; line-height: 1.6; }

.more { max-width: var(--column); margin: 14px 0 0; }
.more summary { cursor: pointer; width: fit-content; color: var(--muted); font-size: 15px; }
.more p { margin: 12px 0 0; }
.more img { display: block; width: 100%; height: auto; margin: 12px 0; }

/* Teaser and stats */
.teaser-panels { display: grid; gap: 24px; }
.teaser-panel { padding: 0; margin: 0; }
.teaser-panel svg { width: 100%; height: auto; display: block; }
.teaser-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.teaser-strips { display: grid; gap: 8px; }
.teaser-panel h3, .eff-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 9px; font-size: 17px; font-weight: 630; letter-spacing: -0.015em; }
.teaser-panel h3 b, .eff-card h3 b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: #97302d; background: #f8eae7; font-size: 15px; font-weight: 700; }
.stats { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stats strong { display: block; font-size: 30px; font-weight: 670; letter-spacing: -0.03em; color: var(--accent); line-height: 1.2; }
.stats span { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; line-height: 1.5; }

/* ---------- Step explainers ---------- */
.stepper { margin: 8px 0 0; }
.step-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: start; gap: 14px; min-height: 92px; }
.step-arrow { width: 40px; height: 40px; margin-top: 2px; border: 1px solid var(--rule); border-radius: 50%; background: #fff; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.step-arrow:hover { background: var(--soft); }
.step-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.step-words p { margin: 0; }
.step-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.4; }
.step-n { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: #fff; font-size: 13px; font-weight: 650; letter-spacing: 0; }
.step-line { margin-top: 4px !important; color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 760px; }
.step-stage { position: relative; min-height: 340px; margin: 18px 0 0; display: grid; align-items: start; }
/* All steps share one grid cell and stay in the layout, so the stage keeps the height of the tallest
   step. The next step fades in on top; the previous one fades out a little later. */
.step-view { width: 100%; grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .3s ease .25s, visibility 0s linear .55s; }
.step-view.on { opacity: 1; visibility: visible; z-index: 1; transition: opacity .45s ease, visibility 0s; }
.step-stage.instant > .step-view { transition: none; }
@media (prefers-reduced-motion: reduce) { .step-view, .step-view.on { transition: none; } }
.step-bar { display: flex; align-items: center; gap: 14px; margin: 18px 0 10px; }
.step-play { flex: none; width: 36px; height: 36px; border: 1px solid var(--rule); border-radius: 50%; background: #fff; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.step-play svg { width: 16px; height: 16px; fill: currentColor; }
.step-segments { flex: 1; display: flex; gap: 6px; }
.step-segments .seg { flex: 1; height: 18px; padding: 7px 0; border: 0; background: none; cursor: pointer; }
.seg i { display: block; height: 4px; width: 0; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 0 transparent; }
.seg { position: relative; }
.seg::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 4px; border-radius: 2px; background: var(--rule); }
.seg i { position: relative; }
.step-count { flex: none; min-width: 40px; text-align: right; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.stepper > figcaption { max-width: var(--column); }
.stepper button:focus-visible, .comparison:focus-visible, .switch button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.chips { display: flex; justify-content: center; gap: 6px; margin: 0 0 18px; }
.chips span { padding: 2px 11px; border-radius: 999px; font-size: 14px; color: var(--faint); background: var(--soft); font-variant-numeric: tabular-nums; transition: color .2s, background .2s; }
.chips span.on { color: #fff; background: var(--text); }
.note { margin: 16px 0 0; text-align: center; font-size: 15px; font-weight: 600; color: var(--text); }

/* Locality, step 1 */
.loc-probe { display: grid; grid-template-columns: minmax(0, 300px) 80px minmax(0, 300px); justify-content: center; align-items: center; gap: 18px; }
.probe-frame { position: relative; }
.probe-frame img, .probe-map img { display: block; width: 100%; height: auto; border-radius: 4px; }
.probe-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.probe-grid rect { fill: rgba(255, 255, 255, .08); stroke: #fff; stroke-width: .22; }
.probe-grid rect.center { fill: #0b2f6b; }
.probe-grid .dot { fill: #0b2f6b; stroke: #fff; stroke-width: .5; }
.probe-grid .pulse { fill: none; stroke: #fff; stroke-width: .5; }
.probe-link { width: 80px; fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.probe-map span { display: block; margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Locality, step 2 */
.erf-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; max-width: 900px; margin: 0 auto; }
.erf-map { position: relative; overflow: hidden; border-radius: 4px; }
.erf-map img { display: block; width: 100%; height: auto; }
.erf-map i { position: absolute; outline: 2px solid var(--text); box-shadow: 0 0 0 999px rgba(255, 255, 255, .62); }
.erf p { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin: 8px 0 0; font-size: 15px; }
.erf p span { color: var(--c); font-weight: 600; }
.erf p b { font-weight: 650; font-variant-numeric: tabular-nums; }

/* Locality, step 3 */
.time-table { display: grid; gap: 10px; max-width: 640px; margin: 0 auto; }
.time-head, .time-row { display: grid; grid-template-columns: 140px 40px repeat(3, 58px) 72px; align-items: center; justify-content: center; column-gap: 10px; }
.time-head span { text-align: center; font-size: 14px; color: var(--faint); }
.time-head span.on { color: var(--text); font-weight: 650; }
.time-head span:last-child { text-align: right; }
.time-row > span:first-child { font-size: 15px; font-weight: 600; color: var(--c); }
.tile { position: relative; display: block; height: 46px; border-radius: 4px; background: var(--soft); overflow: hidden; opacity: calc(.32 + .68 * var(--in, 0)); box-shadow: inset 0 0 0 calc(2px * var(--in, 0)) var(--text); }
.tile i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--c); }
.tile.older { background: none; box-shadow: none; opacity: .55; outline: 1px dashed #c3c8d0; outline-offset: -1px; }
.tile.older i { background: #c3c8d0; }
.time-row b { text-align: right; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }


.fill-key { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--muted); }



/* Paper style frames and streaming diagram (method figure colors) */
.o-svg { display: block; width: 100%; max-width: 760px; margin: 0 auto; overflow: visible; font-family: inherit; }
.oframe .o-plane { fill: #fff; }
.oframe .o-grid { fill: none; stroke: #dcdee2; stroke-width: .8; }
.oframe .o-edge { fill: none; stroke: #3d4450; stroke-width: 1.2; }
.oframe.unused .o-plane { fill: #fafaf9; }
.oframe.unused .o-grid { stroke: #eceef1; }
.oframe.unused .o-edge { stroke: #a9afb8; stroke-dasharray: 5 4; }
.o-label { font-size: 17px; text-anchor: middle; fill: #8b929d; }
.oframe.past .o-label { fill: #8a6500; font-weight: 600; }
.oframe.current .o-label { fill: #807dbb; font-weight: 650; }
.o-win { fill: #fee391; fill-opacity: .82; stroke: #e0a800; stroke-width: 1.6; stroke-linejoin: round; }
.o-query { fill: #807dbb; stroke: #5c58a0; stroke-width: .8; }
.o-links line { stroke: #e0a800; stroke-width: 1.5; stroke-dasharray: 5 4; }
.o-tag path { fill: none; stroke: #a9afb8; stroke-width: 1.2; }
.o-tag text { font-size: 14px; text-anchor: middle; font-weight: 600; }
.o-tag.cache path { stroke: #e0a800; }
.o-tag.cache text { fill: #8a6500; }
.o-tag.current path { stroke: #807dbb; }
.o-tag.current text { fill: #807dbb; }
.o-note { font-size: 14px; text-anchor: middle; fill: #8b929d; font-style: italic; }
.o-note.evict { fill: #8b929d; }
.o-note.cache { text-anchor: end; fill: #8a6500; font-style: normal; font-weight: 600; }
.o-note.exact { fill: #807dbb; font-style: normal; font-weight: 600; }
.o-arrow { stroke-width: 1.6; }
.o-arrow.g { stroke: #b1b8c2; } .o-arrow.y { stroke: #e0a800; } .o-arrow.p { stroke: #807dbb; }
.o-box { fill: #fff; stroke: #e0a800; stroke-width: 1.5; }
.o-box.now { stroke: #807dbb; }
.o-box.merge { fill: #f4f3fa; stroke: #807dbb; }
.o-side { font-size: 14px; fill: var(--muted); }
.o-side.end { text-anchor: end; }
.o-math { font: italic 19px "Times New Roman", Times, serif; fill: #2b2f36; text-anchor: middle; }
.o-math.small { font-size: 16px; fill: #4a505a; }
.o-math .sub { font: 12px Inter, system-ui, sans-serif; }
.o-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.o-legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px; box-sizing: border-box; }
.o-legend .q::before { background: #807dbb; }
.o-legend .w::before { background: #fee391; border: 1.5px solid #e0a800; }
.o-legend .u::before { background: #fafaf9; border: 1.5px dashed #a9afb8; }
.stream-svg .s-row { font-size: 15px; fill: var(--muted); }
.stream-svg .s-t { font-size: 18px; fill: #8b929d; text-anchor: middle; }
.stream-svg .s-t.past { fill: #8a6500; font-weight: 600; }
.stream-svg .s-t.current { fill: #807dbb; font-weight: 700; }
.stream-svg .s-op { font-size: 14px; font-weight: 600; fill: #7a4a1e; text-anchor: middle; }
.stream-svg .s-kv { font-size: 11px; font-weight: 700; text-anchor: middle; }
.stream-svg .s-tag { font-size: 13px; font-weight: 600; fill: #8a6500; text-anchor: middle; }
.stream-svg .s-arrow { stroke-width: 1.5; marker-end: url(#ms-g); }
.stream-svg .s-link { stroke: #e0a800; stroke-width: 1.8; }
.stream-svg .s-ghost rect, .stream-svg .s-ghost polygon { fill: #fafaf9; stroke: #a9afb8; stroke-dasharray: 4 3; }
.stream-svg .s-ghost text { fill: #a9afb8; }
.stream-svg .s-frame { fill: none; stroke: #3d4450; stroke-width: 1.2; }
.stream-svg .s-frame.out { stroke: #e58fbf; stroke-width: 2; }
.stream-svg .s-range { font-size: 11.5px; fill: #8b929d; text-anchor: middle; font-variant-numeric: tabular-nums; }
.stream-svg .s-ptitle { font-size: 14px; font-weight: 650; fill: var(--text); }
.stream-svg .s-ptitle.out { fill: #807dbb; }
.stream-svg .s-count { font-size: 12.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.stream-svg .s-blank { fill: #f3f4f6; }
.stream-svg .s-head { font-size: 14px; font-weight: 650; fill: #807dbb; text-anchor: middle; white-space: pre; }
.stream-svg .s-curcol { fill: #807dbb; fill-opacity: .06; stroke: #807dbb; stroke-width: 2; }
.stream-svg .s-latlabel { font-size: 11.5px; font-style: italic; fill: #6b7280; text-anchor: middle; }
.stream-svg .s-data { stroke: #8b929d; stroke-width: 1.6; }
.stream-svg .s-token { fill: #fee391; stroke: #e0a800; stroke-width: 1.4; }
.stream-svg .s-tag.kvtag { font-size: 11.5px; }
.stream-svg .s-evict { font-size: 11px; font-style: italic; fill: #8b929d; text-anchor: middle; }
.o-slot { fill: #fffcf0; stroke: #e0a800; stroke-width: 1.4; stroke-dasharray: 5 4; }
.o-slot-title { font-size: 14px; font-weight: 650; fill: #8a6500; text-anchor: end; }
.o-slot-sub { font-size: 12.5px; fill: #8b929d; text-anchor: end; }
.o-slot-holds { font-size: 12.5px; fill: #8a6500; text-anchor: middle; }
.o-kv rect { stroke-width: 1.4; }
.o-kv text { font-size: 12px; font-weight: 700; text-anchor: middle; }
.o-note.read { fill: #8a6500; font-style: normal; font-weight: 600; text-anchor: start; }
.o-note.compute { fill: #807dbb; font-style: normal; font-weight: 600; }

/* ---------- Results ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }
.tabs [role="tab"] { border: 1px solid var(--rule); background: #fff; color: var(--muted); padding: 5px 14px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.result-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 0 0 14px; }
.panel-note { max-width: 680px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.switch { display: inline-flex; flex: none; border-radius: 8px; background: var(--soft); padding: 3px; }
.switch button { border: 0; border-radius: 6px; padding: 3px 11px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.switch button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(18, 27, 41, .12); }
.example-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 10px; }
.example-head h3 { margin: 0; font-size: 18px; line-height: 1.4; }
.example-head p, #example-count, #frame-time { margin: 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.example-nav { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
button.arrow { width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: 50%; background: #fff; color: var(--text); font: 22px/1 Arial, sans-serif; cursor: pointer; }
button.arrow:disabled { opacity: .4; cursor: default; }
.all-view { position: relative; width: 100%; background: #fff; }
.all-view video { display: block; width: 100%; height: 100%; }
.all-labels span { position: absolute; margin: 8px 0 0 8px; padding: 1px 7px; border-radius: 4px; background: rgba(18, 27, 41, .78); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.6; pointer-events: none; white-space: nowrap; }
.all-labels span.ours { background: var(--accent); }
.all-view.has-below { margin-bottom: 68px; }
.all-labels span.below { margin: 5px 0 0; padding: 0; background: none; color: var(--text); text-align: center; font-size: 12.5px; line-height: 1.35; white-space: normal; }
.all-labels span.below.ours { color: var(--accent); background: none; }
.all-labels span.below b { display: block; margin: 1px 0; color: var(--muted); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.all-labels span.below.ours b { color: var(--accent); font-size: 16px; }
.all-labels span.below small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; font-variant-numeric: tabular-nums; }
.all-labels span.below.ours small { color: var(--accent); font-weight: 600; }
.all-labels i { position: absolute; box-shadow: inset 0 0 0 3px var(--accent); pointer-events: none; }
.example-note { margin: 0 0 10px; font-size: 15px; }
.zoom-legend { display: none; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.transport { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; }
.transport button { min-width: 64px; border: 1px solid var(--rule); border-radius: 6px; padding: 3px 10px; background: #fff; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.transport input { flex: 1; min-width: 30px; accent-color: var(--text); }
#frame-time { min-width: 108px; text-align: right; }
#media-status { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
@keyframes gallery-enter { from { transform: translateX(var(--enter, 12px)); opacity: .7; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: no-preference) { .enter { animation: gallery-enter .18s ease-out; } }

/* ---------- Efficiency ---------- */
.eff-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
.eff-card { margin: 0; display: grid; grid-template-rows: subgrid; grid-row: span 4; align-content: start; min-width: 0; }
.eff-card h3 { padding: 8px 0; margin-bottom: 5px; }
.eff-card > svg { width: 100%; min-width: 0; height: auto; display: block; aspect-ratio: 340 / 236; overflow: visible; }
.eff-plot .shade-label { font-size: 11px; fill: #b8322f; }
.eff-card > figcaption { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.legend li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend .sw { flex: none; width: 24px; height: 12px; overflow: visible; }
.eff-plot { font: 12px Inter, system-ui, sans-serif; fill: #505863; }
.eff-plot .axis-title { font-size: 13px; fill: #282e38; font-weight: 600; }
.eff-plot .x-title { font-size: 12.5px; fill: #505863; }
.eff-plot .better { font-size: 11px; font-style: italic; fill: #2c7a66; }
.eff-card .chart-key { padding: 8px 0 0; }
.legend-wrap { display: flex; flex-wrap: wrap; gap: 0 12px; }
.legend-wrap + .legend-wrap { margin-top: 2px; }
.legend .sw-dot { width: 12px; height: 12px; }

/* ---------- BibTeX and footer ---------- */
.bibtex { position: relative; }
.bibtex pre { margin: 0; padding: 18px 20px; background: var(--soft); border-radius: 8px; overflow-x: auto; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.copy { position: absolute; top: 10px; right: 10px; border: 0; border-radius: 6px; padding: 3px 10px; background: #fff; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.copy:hover { color: var(--text); }
footer { padding-top: 44px; padding-bottom: 48px; color: var(--muted); font-size: 14px; text-align: center; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding-top: 44px; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  main > section { padding-top: 32px; }
  main > section + section { margin-top: 24px; }
  .step-head { grid-template-columns: minmax(0, 1fr) 34px 34px; gap: 8px; min-height: 0; }
  .step-head .step-words { grid-row: 1; grid-column: 1; }
  .step-arrow { width: 34px; height: 34px; }
  .step-title { font-size: 17px; }
  .step-line { font-size: 15px; }
  .step-stage { min-height: 0; margin-top: 14px; }
  .loc-probe { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); gap: 8px; }
  .probe-link { width: 36px; }
  .probe-map span { font-size: 12px; }
  .erf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .time-head, .time-row { grid-template-columns: 92px 24px repeat(3, minmax(0, 40px)) 56px; column-gap: 6px; }
  .time-head span, .time-row > span:first-child, .time-row b { font-size: 12px; }
  .tile { height: 36px; }
  .example-head { flex-direction: column; align-items: flex-start; }
  .all-view.has-below { margin-bottom: 0; }
  .all-labels span.below { display: none; }
  .all-labels i { box-shadow: inset 0 0 0 2px var(--accent); }
  .zoom-legend:not(:empty) { display: block; }
  .all-labels span { margin: 4px 0 0 4px; padding: 0 5px; font-size: 11px; }
  .teaser-pair { gap: 6px; }
  .eff-grid { grid-template-columns: minmax(0, 1fr); row-gap: 26px; }
  .eff-card { grid-template-rows: none; grid-row: auto; }
  .o-legend { font-size: 12px; gap: 2px 12px; }
}
@media (max-width: 480px) {
  .o-label, .stream-svg .s-t { font-size: 28px; }
  .o-tag text, .o-note, .o-side { font-size: 24px; }
  .stream-svg .s-row { font-size: 16px; }
  .stream-svg .s-op { font-size: 20px; }
  .stream-svg .s-tag { font-size: 20px; }
  .stream-svg .s-ptitle { font-size: 22px; }
  .stream-svg .s-count { font-size: 18px; }
  .stream-svg .s-range { font-size: 13.5px; }
  .stream-svg .s-head { font-size: 16px; }
  .stream-svg .s-evict { font-size: 15px; }
  .stream-svg .s-tag.kvtag { font-size: 13.5px; }
  .stream-svg .s-latlabel { font-size: 13px; }
  .o-slot-title { font-size: 22px; }
  .o-slot-sub, .o-slot-holds { font-size: 18px; }
  .o-kv text { font-size: 16px; }
  .abstract { text-align: left; }
  .o-math { font-size: 28px; }
  .o-math.small { font-size: 24px; }
  .o-math .sub { font-size: 18px; }
  .step-words { min-height: 180px; }
  .hero, main, footer { padding-left: 16px; padding-right: 16px; }
  .authors span, .affiliations span { margin: 0 6px; }
  .all-labels span { font-size: 9.5px; }
}

/* ---------- Speed comparison ---------- */
.speed-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 18px; }
.speed-head, .sp-row, .speed-axis { display: grid; grid-template-columns: 150px 140px minmax(0, 1fr) 76px 92px; column-gap: 16px; align-items: center; }
.speed-head { padding: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.speed-head span:nth-child(n+4) { text-align: right; }
.sp-row { min-height: 40px; font-size: 15px; }
.sp-name { font-weight: 600; white-space: nowrap; }
.sp-kind { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sp-row.dec .sp-kind { color: #9a6a00; }
.sp-bar { position: relative; height: 40px; background: var(--grid); }
.sp-bar i { position: absolute; left: 0; top: 11px; height: 18px; border-radius: 0 3px 3px 0; background: #b9c0c9; }
.sp-bar b { position: absolute; top: 9px; margin-left: 8px; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-bar b.ref, .sp-bar em { left: 0; margin-left: 4px; color: var(--muted); font-weight: 500; font-style: italic; font-size: 13px; }
.sp-bar em { position: absolute; top: 10px; }
.sp-row.ours .sp-name, .sp-row.ours .sp-bar b { color: var(--accent); }
.sp-row.ours .sp-bar i { background: var(--accent); }
.sp-row.ours { background: linear-gradient(90deg, #fbf1ef, #fbf1ef00); }
.sp-row.official .sp-name { color: var(--muted); }
.sp-time, .sp-psnr { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.sp-psnr.up { color: #23795f; font-weight: 600; }
.sp-psnr.down { color: #b03a3a; }
.sp-psnr.ref { font-style: italic; }
.sp-bar b.inside { margin-left: 0; transform: translateX(calc(-100% - 6px)); color: #fff; }
.speed-axis { padding-top: 4px; }
.sp-ticks { position: relative; height: 20px; }
.sp-ticks span { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.sp-ticks span:first-child { transform: none; }
.speed > figcaption { margin-top: 10px; font-size: 14px; }
@media (max-width: 760px) {
  .speed-head, .sp-row, .speed-axis { grid-template-columns: 112px minmax(0, 1fr) 62px; column-gap: 8px; }
  .speed-head span:nth-child(2), .speed-head span:nth-child(4), .sp-time, .speed-axis > span:nth-child(2) { display: none; }
  .sp-row { font-size: 13px; padding: 3px 0; }
  .sp-name { grid-column: 1; grid-row: 1; line-height: 1.3; }
  .sp-kind { grid-column: 1; grid-row: 2; font-size: 11.5px; line-height: 1.3; }
  .sp-bar { grid-column: 2; grid-row: 1 / span 2; }
  .sp-psnr { grid-column: 3; grid-row: 1 / span 2; font-size: 12px; }
  .sp-bar b { font-size: 12px; margin-left: 4px; }
  .sp-bar b.inside { margin-left: 0; }
  .sp-ticks span.minor { display: none; }
}

/* ---------- Decoding race ---------- */
.race { margin: 34px 0 0; }
.race-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.race-head h3 { margin: 0; font-size: 18px; line-height: 1.4; }
.race-controls { display: flex; align-items: center; gap: 10px; }
.race .replay { border: 1px solid var(--rule); border-radius: 6px; padding: 3px 10px; background: #fff; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.race-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lane-video { position: relative; background: #eef0f3; }
.lane-video video { display: block; width: 100%; height: auto; }
.lane-tag { position: absolute; left: 8px; top: 8px; padding: 1px 7px; border-radius: 4px; background: rgba(18, 27, 41, .78); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.6; }
.lane.ours .lane-tag { background: var(--accent); }
.lane-bar { height: 6px; margin: 8px 0 0; background: var(--rule); }
.lane-bar i { display: block; width: 0; height: 100%; background: var(--muted); }
.lane.ours .lane-bar i { background: var(--accent); }
.lane p { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.lane p b { font-size: 20px; color: var(--muted); }
.lane.ours p b { color: var(--accent); }
.race figcaption { margin: 12px 0 0; }
.lane p b { white-space: nowrap; }
@media (max-width: 760px) {
  .race-lanes { gap: 8px; }
  .lane-tag { left: 4px; top: 4px; padding: 0 5px; font-size: 11px; }
  .lane p { font-size: 12px; gap: 6px; }
  .lane p b { font-size: 15px; }
}
.settings { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 4px 0 10px; }
.settings dt { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.settings dd { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; }
.settings-notes { margin: 0; }
.abstract-short { max-width: var(--column); margin: 0; }
.abstract-more .abstract { margin: 10px 0 0; }
.abstract-more { max-width: none; }
