/* Layout: single 1040px column, poster section numbering kept; method cards in a 2-up grid. */
:root {
  --bg: #ffffff; --panel: #f1f3ed; --ink: #1a1d21; --ink-2: #4a5059; --ink-3: #6f7680;
  --line: #d9ded3; --green: #5e9400; --green-ink: #4a7600; --slate: #2e3a46; --slate-2: #5b6874;
  --drop: #c8553d; --chip: #e8f2d8;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111417; --panel: #1a1f23; --ink: #eceff1; --ink-2: #b7bec6; --ink-3: #8b939c;
    --line: #2c343b; --green: #8cc63f; --green-ink: #9fd45a; --slate: #c9d2da; --slate-2: #8b98a5;
    --drop: #e27a62; --chip: #26321a; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--body); }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
a { color: var(--green-ink); }
code { font-family: var(--mono); font-size: .88em; background: var(--panel); padding: 1px 5px; border-radius: 4px; }

.nav { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1040px; margin: 0 auto; padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font: 800 1.05rem var(--display); color: var(--ink); text-decoration: none; }
.nav-links { display: flex; gap: 18px; flex-wrap: wrap; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--green-ink); }

.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.hero h1 { font: 800 clamp(2rem, 4.4vw, 3.1rem)/1.12 var(--display); margin: 10px 0 12px; text-wrap: balance; letter-spacing: -.01em; }
.subtitle { font: 700 1.25rem/1.4 var(--display); color: var(--green-ink); margin: 0 0 18px; }
.authors { margin: 0; font-weight: 600; }
.affil { margin: 0 0 22px; color: var(--ink-2); }
.draft-tag { display: inline-block; margin: 0; font-size: .85rem; font-weight: 600; color: #fff; background: #d9610f; padding: 3px 10px; border-radius: 4px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 6px; background: var(--slate); color: var(--bg); text-decoration: none; font-weight: 700; font-size: .95rem; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--slate-2); }
.btn.disabled { background: var(--panel); color: var(--ink-3); cursor: default; }
.btn:focus-visible, .tabs button:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.section { padding: 44px 0 8px; display: flex; flex-direction: column; gap: 18px; }
h2 { font: 800 1.6rem/1.25 var(--display); margin: 18px 0 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-size: 1rem; }
h3.sub { font: 700 1.2rem var(--display); margin: 12px 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h3, h4 { margin: 0; }
h4 { font: 700 1.08rem var(--display); }
.expected { font: 600 .72rem var(--body); letter-spacing: .06em; text-transform: uppercase; color: #a24a0b; background: #fdebdc; padding: 2px 8px; border-radius: 4px; }
@media (prefers-color-scheme: dark) { .expected { color: #f3b07c; background: #3a2414; } }

.cards { display: grid; gap: 14px; }
.cards.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--panel); border-radius: 8px; padding: 16px 18px; min-width: 0; }
.card h3 { font: 700 1.02rem var(--display); margin-bottom: 4px; }
.card p { margin: 0; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-top: 2px solid var(--line); }
.stat .big { font: 800 2.6rem/1 var(--display); color: var(--green-ink); }
.stat span:last-child { color: var(--ink-2); }

.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.stack div { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); }
.stack b { font-family: var(--display); }
.stack span { color: var(--ink-2); font-size: .95rem; }

.pipeline { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.pipeline li { counter-increment: s; border: 2px solid var(--green); border-radius: 10px; padding: 12px 16px 12px 52px; position: relative; display: flex; flex-direction: column; }
.pipeline li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font: 700 .9rem/26px var(--display); text-align: center; }
.pipeline span { color: var(--ink-2); font-size: .95rem; }

.bullets { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; max-width: 75ch; }
.bullets.small { font-size: .95rem; }
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
@media (max-width: 460px) { .method-grid { grid-template-columns: 1fr; } }
.method { background: var(--panel); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.method.wide { grid-column: 1 / -1; }
.method p { margin: 0; }
.diagram { width: 100%; height: auto; margin-top: 4px; }
.diagram .lbl { fill: var(--ink-2); font: 600 12px var(--body); }
.diagram .lbl.small { font-size: 10.5px; }
.diagram .fm rect { fill: #e9d3b8; stroke: #b9853f; }
.diagram .fm rect.unc { fill: #e3e5e8; stroke: #8a929b; }
.diagram .txt text, .diagram .txt-in { fill: #1a1d21; font: 600 12px var(--body); text-anchor: middle; }
.diagram .arrows path, .diagram .arrow { stroke: var(--ink-3); stroke-width: 2; fill: none; marker-end: none; }
.diagram rect.drift { fill: #cfe6b0; stroke: var(--green); }
.diagram .grid rect { fill: #cfd5dc; }
.diagram .grid rect.pick { fill: var(--green); }
.diagram .kept rect { fill: var(--green); }
.diagram .seq rect.txtk { fill: #c7cfe8; }
.diagram .seq rect.keep { fill: #e9c48f; }
.diagram .seq rect.drop { fill: none; stroke: var(--drop); stroke-dasharray: 3 2; }
.diagram .seq rect.act { fill: #bfe0b2; }
.diagram .cross { stroke: var(--drop); stroke-width: 1.6; fill: none; }

.timeline { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; align-items: center; max-width: 560px; }
.tl-label { font-weight: 700; }
.tl-row { display: flex; gap: 4px; }
.tl-row span { flex: 1; text-align: center; padding: 6px 4px; border-radius: 4px; font-size: .85rem; font-weight: 600; color: #fff; }
.tl-row .inf { background: var(--slate); color: var(--bg); }
.tl-row .exe { background: var(--green); }
.tl-row .w2 { flex: 2; }

.defs { display: grid; grid-template-columns: minmax(180px, max-content) 1fr; gap: 10px 20px; margin: 0; }
.defs dt { font-weight: 700; }
.defs dd { margin: 0; color: var(--ink-2); min-width: 0; }
@media (max-width: 600px) { .defs { grid-template-columns: 1fr; gap: 2px; } .defs dd { margin-bottom: 10px; } }

.bars { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 52px; gap: 10px; align-items: center; }
.bl { color: var(--ink-2); font-size: .95rem; }
.bt { height: 16px; background: var(--panel); border-radius: 3px; overflow: hidden; }
.bt i { display: block; height: 100%; background: var(--green); border-radius: 0 4px 4px 0; }
.bt i.g { background: #9aa2ab; } .bt i.d { background: var(--slate); } .bt i.a { background: var(--green-ink); }
.bar-row b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.note { margin: 2px 0 0; color: var(--ink-3); font-size: .9rem; }
@media (max-width: 520px) { .bar-row { grid-template-columns: 110px 1fr 44px; } }

.tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; }
@media (max-width: 480px) { .tables { grid-template-columns: 1fr; } }
.tbl { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { background: var(--slate); color: var(--bg); font-weight: 700; }
td { font-variant-numeric: tabular-nums; }
tr.base td { background: var(--panel); }
tr.best td { font-weight: 700; background: var(--chip); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { font: 700 .95rem var(--body); padding: 8px 16px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink-2); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.vslot { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vslot video { width: 100%; aspect-ratio: 4 / 3; background: var(--panel); border-radius: 8px; object-fit: cover; display: block; }
.vslot .ph { aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: 8px; display: grid; place-items: center; text-align: center; color: var(--ink-3); font-size: .88rem; padding: 10px; }
.vslot .ph code { display: block; margin-top: 4px; word-break: break-all; }
.vslot figcaption { font-weight: 600; font-size: .95rem; }

.footer { margin-top: 56px; padding: 22px 0 36px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .9rem; }

.tbl.wide { grid-column: 1 / -1; }
.tbl.summary { max-width: 720px; }
thead th.grp { text-align: center; border-left: 1px solid var(--slate-2); }
thead tr:nth-child(2) th { border-left: 1px solid var(--slate-2); }
thead th[rowspan] { vertical-align: bottom; }
h4.detail { font: 700 1.05rem var(--display); margin: 8px 0 0; }
.tbl.summary thead th { text-align: center; }
.tbl.summary thead th[rowspan] { text-align: left; }
.tbl.summary td { text-align: center; }
.tbl.summary td:first-child { text-align: left; }
