/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --bg: #f3f8ef;
  --bg-alt: #e6f1df;
  --surface: #ffffff;
  --surface-2: #eef5e9;
  --border: #cfe0c6;
  --text: #11261a;
  --text-2: #3d5444;
  --muted: #5d7364;
  --brand: #17583a;
  --brand-ink: #f1f8ec;
  --accent: #23844a;
  --accent-soft: #d6ebcb;
  --focus: #2a78d6;
  --grid: #dbe8d3;
  --band: #134a30;
  --band-ink: #e8f5e1;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #8a5cd6;
  --good: #2f8f46; --warn: #c27c00; --bad: #c8382d;
  --c0: #2a78d6; --c1: #eb6834; --c2: #1baf7a; --c3: #eda100; --c4: #e87ba4; --c5: #008300;
  --shadow: 0 1px 2px rgba(20, 30, 20, .06), 0 8px 24px rgba(20, 30, 20, .06);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1610; --bg-alt: #0f1f15; --surface: #13271a; --surface-2: #17301f; --border: #24432d;
    --text: #e6f2e4; --text-2: #bfd3c1; --muted: #8fa894;
    --brand: #8fdc8f; --brand-ink: #0b1610; --accent: #7ed68a; --accent-soft: #17351f;
    --focus: #3987e5; --grid: #1f3826; --band: #0f2b19; --band-ink: #d9f0d3;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #2bbd88; --series-4: #a585f0;
    --good: #5cc275; --warn: #e0a634; --bad: #ef6b5f;
    --c0: #3987e5; --c1: #d95926; --c2: #199e70; --c3: #c98500; --c4: #d55181; --c5: #2f9a2f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1610; --bg-alt: #0f1f15; --surface: #13271a; --surface-2: #17301f; --border: #24432d;
  --text: #e6f2e4; --text-2: #bfd3c1; --muted: #8fa894;
  --brand: #8fdc8f; --brand-ink: #0b1610; --accent: #7ed68a; --accent-soft: #17351f;
  --focus: #3987e5; --grid: #1f3826; --band: #0f2b19; --band-ink: #d9f0d3;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #2bbd88; --series-4: #a585f0;
  --good: #5cc275; --warn: #e0a634; --bad: #ef6b5f;
  --c0: #3987e5; --c1: #d95926; --c2: #199e70; --c3: #c98500; --c4: #d55181; --c5: #2f9a2f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--sans); overflow-x: hidden;
}
img, canvas { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); max-width: 26ch; }
h3 { font-size: 1.2rem; }
h1 em { font-style: italic; color: var(--accent); }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-family: var(--serif); font-weight: 700; font-size: 1.15rem; flex-shrink: 0; }
.brand img { border-radius: 7px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--text-2); text-decoration: none; font-size: .9rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.nav a:hover, .nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.nav-ext { color: var(--accent); font-weight: 600; }
.top-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-shrink: 0; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 6px; row-gap: 4px; }
  .nav { order: 3; flex-basis: 100%; mask-image: linear-gradient(90deg, #000 88%, transparent); }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  background: var(--brand); color: var(--brand-ink); font: 600 .95rem var(--sans);
  text-decoration: none; cursor: pointer; transition: transform .15s ease, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: .85rem; }
.btn-block { width: 100%; margin-top: 16px; }

/* ---------------------------------------------------------------- sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
@media (max-width: 600px) { .section { padding: 52px 0; } }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .6em; }
.section-lede { color: var(--text-2); max-width: 68ch; margin-bottom: 28px; }
.sub { margin-top: 48px; }
.prose p { color: var(--text-2); }
.two-col { display: grid; gap: 32px; grid-template-columns: 1fr; margin-top: 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; } }
.facts { padding: 0; margin: 0 0 1em; list-style: none; }
.facts li { padding: 6px 0 6px 20px; position: relative; color: var(--text-2); font-size: .95rem; }
.facts li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.facts b { color: var(--text); font-variant-numeric: tabular-nums; }
.note { margin-top: 24px; padding: 14px 16px; border-left: 3px solid var(--c3); background: var(--surface); border-radius: 0 10px 10px 0; color: var(--text-2); font-size: .95rem; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 56px 0 72px; background: radial-gradient(1200px 500px at 85% -10%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.15fr 1fr; } }
.lede { font-size: 1.12rem; color: var(--text-2); max-width: 58ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 32px; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; }
@media (min-width: 600px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat dt { font-size: .75rem; color: var(--muted); }
.stat dd { margin: 2px 0 0; font: 700 1.5rem/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.hero-figure { margin: 0; }
.hero-figure figcaption { font-size: .85rem; color: var(--muted); margin-top: 10px; text-align: center; }

.compare { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 1; touch-action: pan-y; }
.compare img { width: 100%; height: 100%; object-fit: cover; }
.compare .compare-top { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare input:focus-visible ~ .compare-tag { outline: 2px solid var(--focus); }
.compare-tag { position: absolute; bottom: 12px; font-size: .75rem; font-weight: 600; background: rgba(10, 15, 12, .7); color: #fff; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.compare-tag.left { left: 12px; } .compare-tag.right { right: 12px; }

/* ---------------------------------------------------------------- figures */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card-fig, .pred-pair figure, .media-tiles figure, .real-grid figure { margin: 0; }
.card-fig img, .pred-pair img, .media-tiles img, .real-grid img { border-radius: 10px; width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--border); }
figcaption { font-size: .82rem; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- pipeline */
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 20px; }
.step {
  display: grid; gap: 16px 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; grid-template-columns: auto 1fr;
}
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font: 700 1rem var(--serif); }
.step-body p { color: var(--text-2); }
.step-media { grid-column: 1 / -1; }
.step-media > img { border-radius: 10px; width: 100%; max-width: 360px; aspect-ratio: 1; object-fit: cover; }
@media (min-width: 860px) {
  .step { grid-template-columns: auto 1fr 340px; padding: 24px; }
  .step-media { grid-column: auto; }
}
.media-pair { display: flex; align-items: center; gap: 8px; }
.media-pair img { width: calc(50% - 16px); border-radius: 10px; aspect-ratio: 1; object-fit: contain; }
.media-pair .arrow { color: var(--muted); font-size: 1.3rem; }
.checker { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--bg) 0 50%) 0 0 / 16px 16px; border: 1px solid var(--border); }
.media-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th { font-size: .78rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; }
.share-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent); vertical-align: middle; margin-right: 8px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }

/* ---------------------------------------------------------------- factors */
.factor-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .factor-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: start; } }
.factor-figure { margin: 0; position: relative; }
.factor-figure img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 1; }
.factor-badge { position: absolute; top: 12px; left: 12px; background: rgba(10, 15, 12, .72); color: #fff; font: 600 .8rem var(--sans); padding: 4px 10px; border-radius: 999px; }
.factor-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.slider-label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
.factor-ticks { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); padding: 0 4px; margin-bottom: 18px; }
.factor-text { min-height: 210px; }
.factor-text p { color: var(--text-2); }
.param { font: .85rem/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; color: var(--text); }
.factor-nav { display: flex; justify-content: space-between; gap: 8px; }

/* ---------------------------------------------------------------- results */
.model-cards { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 24px 0; }
@media (min-width: 720px) { .model-cards { grid-template-columns: 1fr 1fr; } }
.model-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.model-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.model-card h3 { margin: 0; }
.tag { font-size: .72rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.model-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.model-card dt { font-size: .75rem; color: var(--muted); }
.model-card dd { margin: 0; font: 700 1.6rem/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; }
.key-1 { background: var(--series-1); } .key-2 { background: var(--series-2); }
.key-3 { background: var(--series-3); } .key-4 { background: var(--series-4); }

.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chart-head { display: flex; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; align-items: flex-start; }
.chart-head h3 { margin-bottom: 2px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { white-space: nowrap; flex-shrink: 0; }
.seg button { border: 0; background: transparent; color: var(--text-2); font: 600 .8rem var(--sans); padding: 7px 11px; border-radius: 7px; cursor: pointer; min-height: 34px; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg-wide { margin-bottom: 14px; }
.legend { display: flex; gap: 18px; font-size: .85rem; color: var(--text-2); margin: 14px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart .baseline { stroke: var(--border); }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .s1 { stroke: var(--series-1); } .chart .s2 { stroke: var(--series-2); }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .d1 { fill: var(--series-1); } .chart .d2 { fill: var(--series-2); }
.chart .s3 { stroke: var(--series-3); } .chart .s4 { stroke: var(--series-4); }
.chart .d3 { fill: var(--series-3); } .chart .d4 { fill: var(--series-4); }
.chart .end-label { fill: var(--text-2); font: 600 11px var(--sans); }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 10px; font-size: .8rem; min-width: 150px; transform: translate(-50%, -110%); white-space: nowrap; z-index: 2; }
.tooltip .tt-title { color: var(--muted); font-size: .72rem; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-row strong { font-variant-numeric: tabular-nums; min-width: 42px; }
.tooltip .tt-row span { color: var(--text-2); }
.table-toggle { margin-top: 12px; }
.table-toggle summary, .more summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--accent); padding: 6px 0; }
.table-toggle .table-wrap { max-height: 320px; overflow: auto; margin-top: 8px; }

.insight-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 760px) { .insight-grid { grid-template-columns: repeat(3, 1fr); } }
.insight { border-top: 3px solid var(--accent); background: var(--surface); padding: 14px 16px; border-radius: 0 0 12px 12px; }
.insight h4 { font-size: 1rem; margin-bottom: 4px; }
.insight p { color: var(--text-2); font-size: .92rem; margin: 0; }
.pred-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .pred-pair { grid-template-columns: 1fr; } }
.more { margin-top: 24px; }
.more .pred-pair { margin-top: 12px; }
.more img { aspect-ratio: auto; object-fit: contain; background: #fff; }

/* ---------------------------------------------------------------- demo */
.demo { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .demo { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); } }
.demo-controls { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; align-self: start; }
.model-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.model-status p { margin: 2px 0 0; }
.model-status.ready strong { color: var(--accent); }
progress { width: 100%; height: 8px; margin-top: 12px; accent-color: var(--accent); }
.mini { font: 700 .8rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.thumbs button, .upload { aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--border); padding: 0; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.upload { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .72rem; font-weight: 600; color: var(--text-2); text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--text-2); margin-top: 12px; }
.check input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
output { font-variant-numeric: tabular-nums; color: var(--text); }
.stage { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; min-height: 280px; }
.stage canvas { width: 100%; height: auto; }
.stage canvas.hidden { visibility: hidden; position: absolute; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .95rem; padding: 16px; text-align: center; }
.stage.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent); animation: sweep 1.2s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.det-summary { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.det-summary li { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px 4px 10px; font-size: .82rem; }
.det-summary strong { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- sim2real */
.real-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 480px) { .real-grid { grid-template-columns: repeat(2, 1fr); } }
.cv-results { margin-top: 32px; }
.pending { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 18px 20px; }
.pending p { margin: 2px 0 0; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--c3); flex-shrink: 0; box-shadow: 0 0 0 0 color-mix(in srgb, var(--c3) 60%, transparent); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------------------------------------------------------------- team */
.people { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 20px 0 28px; }
.person { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.person strong { display: block; }
.person span { font-size: .8rem; color: var(--muted); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 .9rem var(--sans); flex-shrink: 0; }
.paper-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; padding: 20px 22px; }
.paper-title { font: 600 1.15rem/1.4 var(--serif); }

/* ---------------------------------------------------------------- footer / toast */
.footer { border-top: 1px solid var(--border); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); font-size: .9rem; color: var(--text-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .88rem; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* ================================================================ v3: 3D branch site */
code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85rem; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.tag.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

/* server pill */
.server-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; white-space: nowrap; background: var(--surface); }
.server-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.server-pill.up i { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.server-pill.down i { background: var(--bad); }
@media (max-width: 480px) { .server-pill span { display: none; } }

/* problem cards */
.card-row { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 820px) { .card-row { grid-template-columns: repeat(3, 1fr); } }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.info-card p { color: var(--text-2); margin: 0; }

/* architecture diagram */
.arch { display: grid; gap: 14px; margin-top: 8px; }
.arch-row { display: grid; gap: 10px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 820px) { .arch-row { grid-template-columns: 1fr auto 1fr auto 1fr; } }
.arch-arrow { color: var(--muted); font-size: 1.2rem; text-align: center; }
@media (max-width: 819px) { .arch-row .arch-arrow { transform: rotate(90deg); } }
.arch-split { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .arch-split { grid-template-columns: 1fr 1fr; } }
.arch-branch { display: grid; gap: 8px; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface); align-content: start; }
.arch-b { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.arch-label { margin: 0 0 2px; font: 700 .78rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.arch-node { display: grid; gap: 2px; text-align: center; padding: 10px 12px; border-radius: 10px; border: 1.5px solid; cursor: pointer; font: inherit; color: var(--text); text-decoration: none; transition: transform .12s ease, box-shadow .12s; }
.arch-node:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.arch-node b { font-size: .95rem; }
.arch-node span { font-size: .8rem; color: var(--text-2); }
.arch-wide { width: 100%; }
.arch-down { display: block; }
.n-green { background: color-mix(in srgb, #3f8f4f 12%, var(--surface)); border-color: color-mix(in srgb, #3f8f4f 55%, transparent); }
.n-blue { background: color-mix(in srgb, #2a78d6 10%, var(--surface)); border-color: color-mix(in srgb, #2a78d6 50%, transparent); }
.n-amber { background: color-mix(in srgb, #eda100 13%, var(--surface)); border-color: color-mix(in srgb, #c98500 55%, transparent); }
.n-red { background: color-mix(in srgb, #e0453a 10%, var(--surface)); border-color: color-mix(in srgb, #e0453a 50%, transparent); }
.n-purple { background: color-mix(in srgb, #8a5cd6 11%, var(--surface)); border-color: color-mix(in srgb, #8a5cd6 50%, transparent); }

/* simulation */
.sim { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .sim { grid-template-columns: 230px minmax(0, 1fr); } }
.sim-rail { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
@media (min-width: 980px) { .sim-rail { flex-direction: column; overflow: visible; position: sticky; top: 76px; align-self: start; } }
.rail-group { margin: 8px 0 2px; font: 700 .7rem var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); white-space: nowrap; display: none; }
@media (min-width: 980px) { .rail-group { display: block; } }
.rail-group.ga { color: var(--series-1); } .rail-group.gb { color: var(--accent); }
.rail-step { display: flex; gap: 8px; align-items: center; text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 10px; padding: 7px 10px; font: 600 .82rem var(--sans); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
@media (min-width: 980px) { .rail-step { white-space: normal; } }
.rail-step[aria-current="true"] { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.rail-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .72rem; flex-shrink: 0; }
.rail-step[aria-current="true"] .rail-num { background: var(--brand); color: var(--brand-ink); }
.sim-stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-height: 520px; min-width: 0; }
.sim-title { font-size: 1.45rem; margin-bottom: 14px; }
.sim-panel { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .sim-panel { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }
.sim-media { display: grid; gap: 12px; min-width: 0; }
.sim-media figure { margin: 0; }
.sim-media img { border-radius: 10px; width: 100%; }
.sim-text p { color: var(--text-2); }
.sim-text h3 { font-size: 1.1rem; }
.sim-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.fork-note { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--text) !important; font-size: .92rem; }
.duo { grid-template-columns: 1fr 1fr; }
.duo img { aspect-ratio: 1; object-fit: contain; background: var(--surface-2); border: 1px solid var(--border); }
.arrowed { position: relative; }
.arrowed::after { content: "→"; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); background: var(--surface); border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; color: var(--text-2); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.trio img { aspect-ratio: 1; object-fit: contain; border: 1px solid var(--border); }
.checker-bg img { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--bg) 0 50%) 0 0 / 14px 14px; }
.seg-wrap { flex-wrap: wrap; }
.plant-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .plant-grid { grid-template-columns: repeat(2, 1fr); } }
.plant-grid img { aspect-ratio: 1; object-fit: cover; border: 3px solid var(--cc); }
.dot-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.ov-fig { position: relative; border-radius: 10px; overflow: hidden; line-height: 0; }
.ov-fig img { border-radius: 0 !important; aspect-ratio: 1; object-fit: cover; }
.ov-fig .overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ov-fig .factor-badge { line-height: 1.4; }
.class-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--text-2); }
.class-legend span { display: inline-flex; align-items: center; gap: 6px; }
.class-legend i { width: 14px; height: 10px; border: 2.5px solid; border-radius: 2px; }
.cam-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cam-row .check { margin: 0; }
.readouts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; font-size: .9rem; }
.readouts dt { color: var(--muted); }
.readouts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.readouts dd.ok { color: var(--good); } .readouts dd.warn { color: var(--warn); }
.readouts.compact { font-size: .85rem; margin: 6px 0 0; }
.readouts.compact dd { text-align: left; }
.readouts small { color: var(--muted); font-weight: 400; }
.plan-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
.flight-plan { width: 150px; height: 150px; background: color-mix(in srgb, #8a6a43 22%, var(--surface)); border-radius: 8px; border: 1px solid var(--border); }
.plan-row { stroke: color-mix(in srgb, #3f8f4f 45%, transparent); stroke-width: 4; }
.plan-foot { fill: color-mix(in srgb, #2a78d6 16%, transparent); stroke: #2a78d6; stroke-width: 1.5; }
.plan-path { fill: none; stroke: #e0453a; stroke-width: 2; stroke-dasharray: 5 4; }
.plan-num { font: 700 11px var(--sans); fill: var(--text); }
.plan-scale { stroke: var(--text); stroke-width: 2; }
.stat-row.tight { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 600px) { .stat-row.tight { grid-template-columns: repeat(4, 1fr); } }
.stat-row.tight dd { font-size: 1.2rem; }
.mini-bench { display: grid; gap: 10px; }
.mb-row { display: grid; grid-template-columns: 90px 1fr 52px; gap: 10px; align-items: center; font-size: .9rem; }
.mb-row b { font-variant-numeric: tabular-nums; text-align: right; }
.mb-bar { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.mb-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* AUC bars */
.auc-bars { display: grid; gap: 10px; }
.auc-row { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; font-size: .85rem; }
.auc-row b { font-variant-numeric: tabular-nums; text-align: right; }
.auc-track { position: relative; height: 14px; background: var(--surface-2); border-radius: 7px; }
.auc-track i { position: absolute; inset: 0 auto 0 0; border-radius: 7px; background: var(--series-1); }
.auc-track i.bad { background: var(--bad); } .auc-track i.good { background: var(--good); }
.auc-track .chance { position: absolute; left: 50%; top: -4px; bottom: -4px; border-left: 2px dashed var(--text); opacity: .6; }
.auc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
@media (max-width: 480px) { .auc-row { grid-template-columns: 1fr 40px; } .auc-row .auc-track { grid-column: 1 / -1; grid-row: 2; } }

/* results */
.model-cards { grid-template-columns: 1fr; }
@media (min-width: 640px) { .model-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .model-cards { grid-template-columns: repeat(4, 1fr); } }
.model-card dd { font-size: 1.35rem; }
.data-table tr.best td, .data-table tr.best th { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.data-table th[scope="row"] { font-size: .9rem; color: var(--text); background: transparent; font-weight: 600; }
.heat td { background: color-mix(in srgb, var(--accent) calc(var(--heat) * 32%), transparent); }
.pred-pair.wide { grid-template-columns: 1fr; }
@media (min-width: 860px) { .pred-pair.wide { grid-template-columns: 1.4fr 1fr; } }
.pred-pair.wide img { aspect-ratio: auto; object-fit: contain; }
.on-white { background: #fff; }

/* analyse */
.offline-card { border: 1px dashed var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--surface)); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.offline-card p { margin: 6px 0; color: var(--text-2); }
.analyze { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 940px) { .analyze { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); } }
.an-controls { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; align-self: start; }
.an-controls .mini:first-child { margin-top: 0; }
.an-output { min-width: 0; display: grid; gap: 12px; align-content: start; }
.dropzone { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 14px; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer; color: var(--text-2); background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over, .dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.thumbs button { position: relative; }
.thumbs button span { position: absolute; left: 4px; bottom: 4px; background: rgba(10, 15, 12, .72); color: #fff; font: 600 .68rem var(--sans); padding: 1px 6px; border-radius: 999px; }
.field-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }
.select { width: 100%; min-height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); padding: 0 10px; font: .92rem var(--sans); }
.field-hint { margin: 6px 0 0; }
.an-controls .slider-label { margin-top: 14px; }
.queue { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.qitem { position: relative; width: 74px; height: 74px; flex-shrink: 0; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; padding: 0; cursor: pointer; background: var(--surface-2); }
.qitem img { width: 100%; height: 100%; object-fit: cover; }
.qitem[aria-current="true"] { border-color: var(--accent); }
.qbadge { position: absolute; left: 3px; right: 3px; bottom: 3px; font: 700 .62rem var(--sans); color: #fff; background: rgba(10, 15, 12, .75); border-radius: 6px; padding: 1px 3px; }
.qbadge.good { background: var(--good); } .qbadge.warn { background: var(--warn); } .qbadge.bad { background: var(--bad); }
.stage canvas.hidden { display: none; }
.view-toggles { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.view-toggles .check { margin: 0; }
.class-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 11px 4px 8px; font: 600 .8rem var(--sans); cursor: pointer; }
.chip i { width: 10px; height: 10px; border-radius: 3px; }
.chip strong { font-variant-numeric: tabular-nums; }
.chip[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 16px; }
.verdict { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border-left: 5px solid var(--muted); background: var(--surface-2); flex-wrap: wrap; }
.verdict .eyebrow { display: block; margin: 0; color: var(--text-2); }
.verdict strong { font: 700 1.35rem/1.25 var(--serif); }
.verdict.good { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.verdict.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 11%, var(--surface)); }
.verdict.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.verdict > span:not(.crop-tag) { color: var(--text-2); }
.crop-tag { font: 700 .78rem var(--sans); text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--border); background: var(--surface); padding: 4px 10px; border-radius: 999px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: grid; }
.kpi span { font-size: .75rem; color: var(--muted); }
.kpi b { font: 700 1.45rem/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: .75rem; }
.report-cols { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .report-cols { grid-template-columns: 1fr 1fr; } }
.report h4 { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.heat-grid { display: grid; gap: 3px; }
.heat-grid span { aspect-ratio: 4 / 3; display: grid; place-items: center; border-radius: 5px; font: 600 .72rem var(--sans); font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--bad) calc(var(--share) * 75%), color-mix(in srgb, var(--good) 22%, var(--surface-2))); color: var(--text); }
.heat-grid span.empty { background: var(--surface-2); }
.notes { margin: 0; padding-left: 18px; color: var(--text-2); font-size: .9rem; }
.notes li { margin: 4px 0; }
.dl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.disclaimer { margin: 0; }
.gt-check summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--accent); }
.gt-check table { margin-top: 8px; }
.gt-check td.diff { color: var(--bad); font-weight: 700; }
.field-report { margin-top: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.field-report h3 { margin: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

/* ================================================================ v4: greener theme accents */
.hero { background:
  radial-gradient(900px 480px at 88% -8%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
  radial-gradient(700px 380px at -10% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.topbar { border-bottom-color: color-mix(in srgb, var(--accent) 28%, var(--border)); }
.section.alt { background: linear-gradient(180deg, var(--bg-alt), color-mix(in srgb, var(--bg-alt) 70%, var(--bg))); }
.info-card { border-top: 3px solid color-mix(in srgb, var(--accent) 55%, var(--border)); }
.info-card.objective { background: var(--band); border-color: var(--band); color: var(--band-ink); }
.info-card.objective h3 { color: var(--band-ink); }
.info-card.objective p { color: color-mix(in srgb, var(--band-ink) 88%, transparent); }
.footer { background: var(--band); color: var(--band-ink); border-top: 0; }
.footer .muted { color: color-mix(in srgb, var(--band-ink) 70%, transparent); }
.btn:not(.btn-ghost) { box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 4px 14px color-mix(in srgb, var(--brand) 28%, transparent); }
input[type="range"] { accent-color: var(--accent); }
section.drag-over { outline: 3px dashed var(--accent); outline-offset: -10px; }

/* ================================================================ synthesize a plot */
.syn-steps { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.syn-steps li { display: inline-flex; align-items: center; gap: 7px; font: 600 .8rem var(--sans); color: var(--muted);
  border: 1px solid var(--border); background: var(--surface); padding: 5px 11px 5px 5px; border-radius: 999px; transition: background .2s, color .2s; }
.syn-steps li b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .72rem; }
.syn-steps li.done { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.syn-steps li.done b { background: var(--accent); color: var(--brand-ink); }
.syn-steps li.active { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
.syn-steps li.active b { background: var(--brand); color: var(--brand-ink); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); } }
.syn { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .syn { grid-template-columns: minmax(0, 330px) minmax(0, 1fr); align-items: start; } }
.syn-controls { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
@media (min-width: 980px) { .syn-controls { position: sticky; top: 76px; } }
.syn-controls .mini:first-child { margin-top: 0; }
.syn-controls .slider-label { margin-top: 12px; }
.syn-controls .field-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
.syn-controls input[type="range"] { width: 100%; }
.syn-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.syn-examples span { flex-basis: 100%; }
.syn-readouts { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 14px !important; }
.syn-controls .btn-block + .btn-block { margin-top: 8px; }
.syn-output { display: grid; gap: 18px; min-width: 0; }
.syn-leaves { display: grid; gap: 12px; }
.syn-empty { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 18px; text-align: center; color: var(--muted); background: var(--surface); }
.syn-leaf { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 10px; min-width: 0; }
.syn-leaf.rejected { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.syn-leaf.rejected .syn-stage-row { opacity: .6; }
.syn-leaf header { display: flex; align-items: center; gap: 10px; min-width: 0; }
.syn-leaf-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.syn-leaf-title strong, .syn-leaf header > strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; margin-right: 6px; }
.syn-leaf-title .swatch { margin: 0; }
.select-small { width: auto; min-height: 34px; font-size: .82rem; max-width: 46%; }
.syn-x { width: 32px; height: 32px; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.syn-stage-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .syn-stage-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.syn-stage-row figure { margin: 0; display: grid; gap: 4px; align-content: start; min-width: 0; }
.syn-stage-row img, .syn-stage-row canvas { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.syn-stage-row canvas { image-rendering: pixelated; background: #6b5a43; }
.syn-stage-row figure.checker img { background: repeating-conic-gradient(color-mix(in srgb, var(--text) 9%, transparent) 0 25%, transparent 0 50%) 50% / 14px 14px, var(--surface); }
.syn-stage-row figcaption { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.syn-wait { grid-column: 2 / -1; display: grid; place-items: center; font-size: .85rem; color: var(--text-2); border: 1px dashed var(--border); border-radius: 8px; padding: 10px; text-align: center; }
.syn-wait span { display: inline-flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.bad-text { color: var(--bad); }
.warn-text { color: var(--warn) !important; }
.syn-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--text-2); align-items: center; }
.syn-facts b { color: var(--text); font-variant-numeric: tabular-nums; }
.syn-facts .qbadge { position: static; padding: 2px 9px; border-radius: 999px; font-size: .72rem; }
.syn-reason { margin: 0; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.syn-result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 16px; min-width: 0; }
.syn-result.busy { opacity: .6; }
.syn-res-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.syn-res-head h3 { margin: 0; }
.syn-res-head .seg-wide { margin: 0; }
.syn-res-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .syn-res-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.syn-canvas { min-height: 0; }
.syn-canvas canvas { width: 100%; height: auto; }
.syn-legend { flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.syn-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.syn-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.kpis.two { grid-template-columns: repeat(2, 1fr) !important; }
.compact-table td, .compact-table th { padding: 6px 8px; }
.compact-table td.diff { color: var(--bad); font-weight: 700; }
.relsize { border-top: 1px solid var(--border); padding-top: 14px; }
.relsize h4 { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.relsize-row { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.relsize-row figure { margin: 0; display: grid; gap: 6px; }
.relsize-row img { background: var(--surface-2); border-radius: 8px; width: 100%; aspect-ratio: 1; object-fit: contain; }
.relsize-row canvas { width: 100%; image-rendering: pixelated; border-radius: 8px; }
.relsize-row figcaption { font-size: .75rem; color: var(--muted); }
.relsize-arrow { font-size: 1.6rem; color: var(--accent); }
.relsize-note { grid-column: 1 / -1; margin: 0; }
@media (max-width: 560px) { .relsize-row { grid-template-columns: 1fr 1fr; } }
