:root {
  color-scheme: light;
  --bg: #fbfbfc;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --ink: #0f1218;
  --ink-2: #444a56;
  --muted: #727987;
  --rule: #e1e4ea;
  --accent: #2a64c8;
  --accent-ink: #1d4f9f;
  --accent-soft: #eef3fb;
  --bar: #2a78d6;
  --bar-ref: #9aa1ad;
  --code-bg: #f2f4f7;
  --figure-bg: #ffffff;
  --fig-filter: none;
  --shadow: 0 1px 2px rgba(15, 18, 24, 0.06), 0 0 0 1px rgba(15, 18, 24, 0.07);
  /* hero band and the agents-vs-humans figure */
  --h-bg: #f3f5f8; --h-card: #ffffff; --h-ink: #0f1218; --h-ink2: #444a56; --h-muted: #727987;
  --h-rule: rgba(15, 18, 24, 0.09); --h-edge: var(--rule); --h-dots: rgba(15, 18, 24, 0.08);
  --h-glow1: rgba(42, 100, 200, 0.18); --h-glow2: rgba(120, 90, 200, 0.10);
  --h-title: linear-gradient(100deg, #0f1218 35%, #2a64c8 100%);
  --h-btn: #ffffff; --h-btn-hover: #eef1f5; --h-ring: rgba(15, 18, 24, 0.12);
  --h-primary: #0f1218; --h-primary-ink: #ffffff; --h-primary-glow: 0 6px 20px rgba(15, 18, 24, 0.18);
  --h-line: #0f1218; --h-area: rgba(42, 100, 200, 0.08); --h-ref: rgba(15, 18, 24, 0.10); --h-halo: rgba(15, 18, 24, 0.2);
  --h-divider: rgba(15, 18, 24, 0.16); --h-tip: #0f1218; --h-tip-ink: #ffffff;
  /* action clusters, in the paper's Figure 1 colours: ensemble purple, model orange, data green */
  --c-sub: #8856a7; --c-mod: #e6842e; --c-dir: #2f9e77; --c-oth: #c3c8d1; --c-mod-ink: #2b1604;
  --gutter: clamp(16px, 4vw, 72px);
  --fig-max: 1100px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0d12;
    --surface: #12151c;
    --surface-2: #191d26;
    --ink: #eceef2;
    --ink-2: #b4bac6;
    --muted: #7f8795;
    --rule: #232833;
    --accent: #7aa7f0;
    --accent-ink: #9dbff5;
    --accent-soft: #111826;
    --bar: #3987e5;
    --bar-ref: #5d6573;
    --code-bg: #12151c;
    --figure-bg: #ffffff;
    --fig-filter: brightness(0.9);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
    --h-bg: #0b0d12; --h-card: #12151c; --h-ink: #eceef2; --h-ink2: #b4bac6; --h-muted: #7f8795;
    --h-rule: rgba(255, 255, 255, 0.08); --h-edge: transparent; --h-dots: rgba(255, 255, 255, 0.07);
    --h-glow1: rgba(57, 135, 229, 0.42); --h-glow2: rgba(120, 90, 220, 0.22);
    --h-title: linear-gradient(100deg, #ffffff 30%, #bcd3f8 100%);
    --h-btn: rgba(255, 255, 255, 0.06); --h-btn-hover: rgba(255, 255, 255, 0.13); --h-ring: rgba(255, 255, 255, 0.13);
    --h-primary: #eceef2; --h-primary-ink: #0b0d12; --h-primary-glow: 0 0 28px rgba(122, 167, 240, 0.3);
    --h-line: #eceef2; --h-area: rgba(122, 167, 240, 0.08); --h-ref: rgba(255, 255, 255, 0.10); --h-halo: rgba(255, 255, 255, 0.5);
    --h-divider: rgba(255, 255, 255, 0.22); --h-tip: #eceef2; --h-tip-ink: #0b0d12;
    --c-sub: #a57fd6; --c-mod: #ee9a4c; --c-dir: #36b48a; --c-oth: #4b5261; --c-mod-ink: #2b1604;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #12151c;
  --surface-2: #191d26;
  --ink: #eceef2;
  --ink-2: #b4bac6;
  --muted: #7f8795;
  --rule: #232833;
  --accent: #7aa7f0;
  --accent-ink: #9dbff5;
  --accent-soft: #111826;
  --bar: #3987e5;
  --bar-ref: #5d6573;
  --code-bg: #12151c;
  --figure-bg: #ffffff;
  --fig-filter: brightness(0.9);
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
  --h-bg: #0b0d12; --h-card: #12151c; --h-ink: #eceef2; --h-ink2: #b4bac6; --h-muted: #7f8795;
  --h-rule: rgba(255, 255, 255, 0.08); --h-edge: transparent; --h-dots: rgba(255, 255, 255, 0.07);
  --h-glow1: rgba(57, 135, 229, 0.42); --h-glow2: rgba(120, 90, 220, 0.22);
  --h-title: linear-gradient(100deg, #ffffff 30%, #bcd3f8 100%);
  --h-btn: rgba(255, 255, 255, 0.06); --h-btn-hover: rgba(255, 255, 255, 0.13); --h-ring: rgba(255, 255, 255, 0.13);
  --h-primary: #eceef2; --h-primary-ink: #0b0d12; --h-primary-glow: 0 0 28px rgba(122, 167, 240, 0.3);
  --h-line: #eceef2; --h-area: rgba(122, 167, 240, 0.08); --h-ref: rgba(255, 255, 255, 0.10); --h-halo: rgba(255, 255, 255, 0.5);
  --h-divider: rgba(255, 255, 255, 0.22); --h-tip: #eceef2; --h-tip-ink: #0b0d12;
  --c-sub: #a57fd6; --c-mod: #ee9a4c; --c-dir: #36b48a; --c-oth: #4b5261; --c-mod-ink: #2b1604;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(16px, calc(13.5px + 0.3vw), 20px);
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

/* Fluid layout: content spans the window minus a margin that grows with it. */
.wrap, .wrap-wide { margin: 0; padding: 0 var(--gutter); }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--h-bg) 90%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--h-rule);
}
.topbar .wrap-wide { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; }
.brand { font-weight: 700; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.topbar nav { display: flex; gap: 18px; font-size: 15px; }
.topbar nav a { color: var(--ink-2); text-decoration: none; }
.topbar nav a:hover { color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.theme-toggle {
  display: none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { color: var(--ink); background: var(--surface-2); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }

/* ---- header ---- */
header.hero { padding: 56px 0 8px; }
.kicker { font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 10px; }
.subtitle { font-size: clamp(19px, 2.6vw, 23px); line-height: 1.35; color: var(--ink-2); margin: 0 0 22px; font-weight: 450; }
.authors { margin: 0; font-size: 16px; }
.affil { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.venue { margin: 10px 0 0; font-size: 15px; color: var(--ink-2); }

.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  font-size: 15px; font-weight: 550; text-decoration: none;
  color: var(--ink); background: var(--surface); box-shadow: var(--shadow);
}
.btn:hover { color: var(--ink); background: var(--surface-2); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn.primary:hover { background: var(--ink-2); color: var(--bg); }

/* ---- text ---- */
section { padding: 8px 0; }
h2 { font-size: clamp(24px, calc(18px + 0.6vw), 32px); letter-spacing: -0.015em; line-height: 1.25; margin: 56px 0 12px; }
h3 { font-size: clamp(18px, calc(15px + 0.3vw), 22px); line-height: 1.35; margin: 36px 0 8px; }
p { margin: 0 0 16px; }
.lede { font-size: 18px; color: var(--ink); }
.muted { color: var(--muted); }
strong { font-weight: 650; }

.tldr {
  margin: 28px 0 8px; padding: 18px 20px 18px 22px;
  background: var(--accent-soft); border-radius: 10px; box-shadow: inset 3px 0 0 var(--accent);
}
.tldr h2 { margin: 0 0 8px; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.tldr ul { margin: 0; padding-left: 20px; }
.tldr li { margin: 6px 0; }

/* ---- summary + contents ---- */
.intro-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 28px 0 8px; }
@media (min-width: 1100px) {
  .intro-grid { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
}
.intro-grid .tldr { margin: 0; }
.toc { background: var(--surface); box-shadow: var(--shadow); border-radius: 10px; padding: 18px 20px; }
.toc h2 { margin: 0 0 8px; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.toc ol { counter-reset: toc; list-style: none; margin: 0; padding: 0; }
.toc li { counter-increment: toc; margin: 5px 0; line-height: 1.4; }
.toc li > a::before { content: counters(toc, ".") "  "; color: var(--muted); font-variant-numeric: tabular-nums; white-space: pre; }
.toc ol ol { margin: 4px 0 6px; padding-left: 1.4em; font-size: 0.92em; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent-ink); text-decoration: underline; }
/* land anchor jumps below the sticky top bar */
[id] { scroll-margin-top: 72px; }

/* ---- figures ---- */
figure { margin: 28px 0; }
/* Figures shrink with the window and stop growing at a fixed size (--fig-max), centered. */
figure.wide { margin: 32px 0; padding: 0 var(--gutter); }
figure.wide > .frame, figure.wide > figcaption { width: min(100%, var(--fig-max)); margin-left: auto; margin-right: auto; }
figure.demo { max-width: 900px; margin: 24px auto; }
figure .frame {
  background: var(--figure-bg); border-radius: 10px; padding: 14px;
  box-shadow: var(--shadow); filter: var(--fig-filter);
}
figure img { display: block; width: 100%; height: auto; }
figcaption { margin-top: 10px; font-size: clamp(14px, calc(12px + 0.2vw), 16.5px); line-height: 1.55; color: var(--ink-2); }
figcaption b { color: var(--ink); }

/* ---- stat tiles ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin: 20px 0 8px; }
.stat { background: var(--surface); box-shadow: var(--shadow); border-radius: 10px; padding: 14px 14px 12px; }
.stat .v { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.stat .l { font-size: 13.5px; color: var(--ink-2); line-height: 1.35; margin-top: 4px; }

/* ---- finding blocks ---- */
.finding { border-top: 1px solid var(--rule); padding-top: 4px; }
.finding .num { font-size: 13px; font-weight: 700; color: var(--accent-ink); letter-spacing: 0.05em; margin-top: 30px; display: block; }
.finding h3 { margin-top: 4px; }

/* ---- inline chart ---- */
.chart { background: var(--surface); box-shadow: var(--shadow); border-radius: 10px; padding: 16px 18px 10px; margin: 20px auto; position: relative; max-width: var(--fig-max); }
.chart-title { font-size: 15px; font-weight: 600; margin: 0; }
.chart-sub { font-size: 13.5px; color: var(--muted); margin: 2px 0 10px; }
.bars { --label-w: 84px; position: relative; padding: 4px 0 6px; }
.bars .row { display: grid; grid-template-columns: var(--label-w) 1fr; align-items: center; gap: 10px; padding: 6px 0; outline-offset: 2px; }
.bars .name { font-size: 14px; color: var(--ink-2); text-align: right; }
.bars .track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bars .fill { display: block; height: 22px; background: var(--bar); border-radius: 0 4px 4px 0; flex: none; }
.bars .fill.ref { background: var(--bar-ref); }
.bars .v { font-size: 14px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.bars .row:hover .fill, .bars .row:focus .fill { filter: brightness(1.08); }
.bars-ref { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); pointer-events: none; }
.tooltip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.4;
  padding: 6px 9px; border-radius: 6px; max-width: 260px; z-index: 5;
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 18px 0 20px; }
.tile { background: var(--surface); box-shadow: var(--shadow); border-radius: 10px; padding: 14px; }
.tile .v { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.tile .who { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.tile .l { font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }

/* ---- code ---- */
pre, code { font-family: var(--mono); font-size: 14px; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
pre {
  background: var(--code-bg); border-radius: 10px; padding: 14px 16px; margin: 14px 0 20px;
  overflow-x: auto; line-height: 1.55; position: relative;
}
pre code { background: none; padding: 0; }
.copy {
  position: absolute; top: 8px; right: 8px; font: 600 12px var(--font);
  background: var(--surface); color: var(--ink-2); border: 0; box-shadow: var(--shadow);
  border-radius: 6px; padding: 4px 8px; cursor: pointer;
}
.copy:hover { color: var(--ink); }
.c { color: var(--muted); }

/* ---- table ---- */
.table-wrap { overflow-x: auto; margin: 12px 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 650; color: var(--ink-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.note { font-size: 14.5px; color: var(--ink-2); border-left: 3px solid var(--rule); padding: 2px 0 2px 12px; margin: 16px 0; }

footer { margin: 64px 0 0; padding: 24px 0 40px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
footer p { margin: 0 0 6px; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .topbar nav { gap: 12px; font-size: 14px; }
  .topbar nav a.hide-sm { display: none; }
  header.hero { padding-top: 36px; }
  h2 { margin-top: 44px; }
  figure .frame { padding: 8px; }
}

/* ======================================================================
   Hero band (always dark) and the agents-vs-humans figure
   ====================================================================== */
.hero-band {
  position: relative; overflow: hidden; background: var(--h-bg); color: var(--h-ink);
  padding: 56px 0 56px; border-bottom: 1px solid var(--h-edge);
}
.hero-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--h-dots) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}
.hero-glow {
  position: absolute; left: -10%; right: -10%; top: -35%; height: 110%; pointer-events: none;
  filter: blur(80px); opacity: 0.55;
  background:
    radial-gradient(40% 32% at 20% 28%, var(--h-glow1), transparent 70%),
    radial-gradient(30% 26% at 78% 18%, var(--h-glow2), transparent 70%);
  animation: glow-drift 18s ease-in-out infinite alternate;
}
@keyframes glow-drift { to { transform: translate3d(3%, 5%, 0) scale(1.06); } }
.hero-inner { position: relative; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.badge {
  font-size: 13px; line-height: 1.3; padding: 6px 12px; border-radius: 999px; color: var(--h-ink2);
  background: var(--h-btn); border: 1px solid var(--h-ring);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.badge b { color: var(--h-ink); font-weight: 650; margin-right: 7px; }
.hero-band h1 {
  font-size: clamp(46px, 8vw, 96px); line-height: 1.02; letter-spacing: -0.04em; margin: 0 0 10px;
  background: var(--h-title);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-band .subtitle { color: var(--h-ink2); max-width: 980px; }
.hero-band .authors { color: var(--h-ink); }
.hero-band .affil { color: var(--h-muted); }
.hero-band .btn { background: var(--h-btn); color: var(--h-ink); box-shadow: 0 0 0 1px var(--h-ring); }
.hero-band .btn:hover { background: var(--h-btn-hover); color: var(--h-ink); }
.hero-band .btn.primary { background: var(--h-primary); color: var(--h-primary-ink); box-shadow: var(--h-primary-glow); }
.hero-band .btn.primary:hover { background: var(--h-primary); color: var(--h-primary-ink); filter: brightness(1.12); }

.versus { margin-top: 46px; }
.versus-title { font-size: clamp(22px, calc(16px + 0.8vw), 30px); color: var(--h-ink); margin: 0 0 6px; }
.versus-sub { color: var(--h-ink2); max-width: 1000px; margin: 0 0 14px; font-size: 0.95em; }
.vs-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 2px 0 18px; font-size: 13.5px; color: var(--h-muted); }
.vs-legend b { color: var(--h-ink); font-weight: 600; margin-right: 4px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.c-submission { background: var(--c-sub); }
.c-model { background: var(--c-mod); }
.c-direction { background: var(--c-dir); }
.c-other { background: var(--c-oth); }

.vs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr); }
.vs-divider { position: relative; display: flex; align-items: center; justify-content: center; }
.vs-divider::before {
  content: ""; position: absolute; top: 10px; bottom: 10px; left: 50%; width: 1px;
  background: linear-gradient(transparent, var(--h-divider), transparent);
}
.vs-divider span {
  position: relative; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--h-ink2); background: var(--h-bg); padding: 7px 9px; border-radius: 999px;
  border: 1px solid var(--h-divider);
}
@media (max-width: 900px) {
  .vs-grid { grid-template-columns: minmax(0, 1fr); }
  .vs-divider { height: 46px; }
  .vs-divider::before { top: 50%; bottom: auto; left: 8px; right: 8px; width: auto; height: 1px;
    background: linear-gradient(90deg, transparent, var(--h-divider), transparent); }
}
.vs-side { background: var(--h-card); border: 1px solid var(--h-rule); border-radius: 14px; padding: 16px 20px 8px; }
.vs-side-head { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.05em; margin-bottom: 4px; }
.vs-icon svg { display: block; width: 26px; height: 26px; fill: none; stroke: var(--h-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.vs-icon .f { fill: var(--h-ink); stroke: none; }

.trace { padding: 12px 0 14px; border-top: 1px solid var(--h-rule); }
.vs-side-head + .trace { border-top: 0; }
.trace-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 14px; margin-bottom: 8px; }
.trace-name { font-weight: 650; color: var(--h-ink); }
.trace-meta { color: var(--h-muted); }
.trace-final { margin-left: auto; color: var(--h-ink2); }
.trace-final b { color: var(--h-ink); }
.trace-plot { position: relative; height: 62px; margin: 0 14px 8px 50px; }
.trace-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trace-plot .ref { stroke: var(--h-ref); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trace-plot .area { fill: var(--h-area); }
.trace-plot .line { fill: none; stroke: var(--h-line); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ref-label { position: absolute; left: -50px; width: 44px; text-align: right; transform: translateY(-50%); font-size: 10px; line-height: 1; color: var(--h-muted); pointer-events: none; }
.end-dot {
  position: absolute; right: -5px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--h-line); box-shadow: 0 0 0 2px var(--h-card), 0 0 14px var(--h-halo);
  opacity: 0; transition: opacity 0.4s 1.5s;
}
.curtain {
  position: absolute; top: -10px; bottom: -10px; left: 0; right: -16px; background: var(--h-card);
  transform-origin: right center;
}
.played .end-dot { opacity: 1; }
.played .curtain { transform: scaleX(0); transition: transform 1.6s cubic-bezier(0.3, 0.7, 0.25, 1); }

.ribbon { display: flex; gap: 1px; height: 20px; border-radius: 4px; overflow: hidden; margin: 0 14px 0 50px; }
.ribbon.dense { gap: 0; }
.cell { flex: 1 1 0; min-width: 0; opacity: 0.1; transform: scaleY(0.35); }
.played .cell { animation: cell-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: calc(var(--d) * 1ms); }
@keyframes cell-in { to { opacity: 1; transform: none; } }
.cell:hover, .cell:focus { filter: brightness(1.25) saturate(1.1); outline: none; }

.diff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin-top: 16px; }
.diff-card { background: var(--h-card); border: 1px solid var(--h-rule); border-radius: 14px; padding: 16px 20px 12px; }
.diff-title { margin: 0 0 4px; font-size: 16px; color: var(--h-ink); }
.diff-take { margin: 0 0 12px; font-size: 13.5px; line-height: 1.45; color: var(--h-ink2); }
.diff-src { margin: 10px 0 0; font-size: 11.5px; color: var(--h-muted); }
.stack-row, .sbar-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.stack-name, .sbar-name { color: var(--h-ink2); text-align: right; }
.stack-bar { display: flex; gap: 2px; height: 20px; transform-origin: left center; transform: scaleX(0); }
.seg { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; white-space: nowrap;
  font-size: 11px; font-weight: 650; color: #fff; border-radius: 3px; }
.seg.c-model { color: var(--c-mod-ink); }
.seg.c-other { color: var(--h-ink); }
.seg:hover, .seg:focus { filter: brightness(1.15); outline: none; }
.sbar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sbar-fill { height: 16px; background: var(--c-dir); border-radius: 0 4px 4px 0; transform-origin: left center; transform: scaleX(0); flex: none; }
.sbar-fill.ref { background: var(--c-dir); }
.sbar-val { font-size: 12.5px; font-weight: 650; color: var(--h-ink); white-space: nowrap; }
.sbar-row:focus { outline: 1px solid var(--h-divider); outline-offset: 3px; border-radius: 4px; }
.played .stack-bar, .played .sbar-fill { transform: none; transition: transform 0.9s calc(var(--r) * 120ms) cubic-bezier(0.2, 0.8, 0.2, 1); }

.static .cell, .static .stack-bar, .static .sbar-fill { opacity: 1; transform: none; animation: none; transition: none; }
.static .curtain { display: none; }
.static .end-dot { opacity: 1; transition: none; }
.vs-error { color: var(--h-muted); }
.vs-tip {
  position: fixed; z-index: 50; pointer-events: none; opacity: 0; transition: opacity 0.12s;
  background: var(--h-tip); color: var(--h-tip-ink); font-size: 12.5px; line-height: 1.4; padding: 6px 9px; border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* scroll reveal and count-up (only when JS runs) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .hero-glow { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cell, .stack-bar, .sbar-fill { opacity: 1; transform: none; animation: none; transition: none; }
  .curtain { display: none; }
  .end-dot { opacity: 1; transition: none; }
}
