/* RoboTwin 2.0 · DO-WAM c2r_mem official evaluations (17.5k / 20k / 27.5k EMA + 17.5k seed 43).
   Same visual language as the GPT planner pages (memab_scf_scm): warm paper, 1px lines, orange accent,
   dark video stage. Series = checkpoint identity (reference palette slots orange / blue / aqua).
   validate_palette.js: light (#fcfcf8) PASS, CVD worst dE 23.1, aqua 2.74:1 -> relief via direct labels + tables;
   dark (#171c1a) PASS, CVD worst dE 19.6. The seed-43 run is the 17.5k checkpoint: same hue, hollow marker. */

:root {
  color-scheme: light;
  --paper: #f7f7f2;
  --card: #fcfcf8;
  --card-2: #f1f1ea;
  --card-3: #ecece5;
  --ink: #17201e;
  --text: #3d463f;
  --muted: #6b7266;
  --line: #dcded6;
  --line-2: #e8e9e2;
  --accent: #e4531f;
  --accent-soft: #f7a283;
  --accent-bg: #fdeee7;
  --ok: #23653d;
  --ok-bg: #e3efe4;
  --bad: #a13732;
  --bad-bg: #f7e5e1;
  --warn: #93591c;
  --warn-bg: #f8ecd9;
  --focus: #e4531f;
  --r-s17500: #eb6834;
  --r-s20000: #2a78d6;
  --r-s27500: #1baf7a;
  --chart-surface: #fcfcf8;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --tick: #7d7b74;
  --exp: #6b7266;
  --bar: #9aa39a;
  --stage: #1d2622;
  --strip-bg: #f1f1ea;
  --strip-ok: #b9c9be;
  --strip-bad: #c9422c;
  --strip-cur: #fbe4da;
  --cell-ok: #cfe5d4;
  --cell-ok-ink: #1d5a34;
  --cell-bad: #f3d3cc;
  --cell-bad-ink: #93302b;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", monospace;
  --header-h: 54px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111513;
    --card: #171c1a;
    --card-2: #202623;
    --card-3: #2a312d;
    --ink: #eef1ec;
    --text: #cdd3cc;
    --muted: #97a097;
    --line: #2f3632;
    --line-2: #262c29;
    --accent: #f26a3d;
    --accent-soft: #f7a283;
    --accent-bg: #3a2219;
    --ok: #7fd19a;
    --ok-bg: #1b3325;
    --bad: #f39a8e;
    --bad-bg: #3b201c;
    --warn: #eab676;
    --warn-bg: #3a2c19;
    --focus: #f7a283;
    --r-s17500: #d95926;
    --r-s20000: #3987e5;
    --r-s27500: #199e70;
    --chart-surface: #171c1a;
    --grid: #2c2c2a;
    --axis: #45443f;
    --tick: #9a988f;
    --exp: #b4bcb4;
    --bar: #5f6a63;
    --stage: #0c100e;
    --strip-bg: #202623;
    --strip-ok: #52665a;
    --strip-bad: #e0664f;
    --strip-cur: #4a2a1d;
    --cell-ok: #1f4a2e;
    --cell-ok-ink: #a7e0b8;
    --cell-bad: #4f2520;
    --cell-bad-ink: #f5b3a8;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111513;
  --card: #171c1a;
  --card-2: #202623;
  --card-3: #2a312d;
  --ink: #eef1ec;
  --text: #cdd3cc;
  --muted: #97a097;
  --line: #2f3632;
  --line-2: #262c29;
  --accent: #f26a3d;
  --accent-soft: #f7a283;
  --accent-bg: #3a2219;
  --ok: #7fd19a;
  --ok-bg: #1b3325;
  --bad: #f39a8e;
  --bad-bg: #3b201c;
  --warn: #eab676;
  --warn-bg: #3a2c19;
  --focus: #f7a283;
  --r-s17500: #d95926;
  --r-s20000: #3987e5;
  --r-s27500: #199e70;
  --chart-surface: #171c1a;
  --grid: #2c2c2a;
  --axis: #45443f;
  --tick: #9a988f;
  --exp: #b4bcb4;
  --bar: #5f6a63;
  --stage: #0c100e;
  --strip-bg: #202623;
  --strip-ok: #52665a;
  --strip-bad: #e0664f;
  --strip-cur: #4a2a1d;
  --cell-ok: #1f4a2e;
  --cell-ok-ink: #a7e0b8;
  --cell-bad: #4f2520;
  --cell-bad-ink: #f5b3a8;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  font-synthesis: none;
  overflow-x: hidden;
}
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .4; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: .92em; overflow-wrap: anywhere; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; }
::selection { background: #ffc9aa; color: #17201e; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  height: var(--header-h); display: flex; align-items: center; gap: 22px;
  max-width: 1600px; margin: 0 auto; padding: 0 24px;
}
.brand { text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -.2px; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 700; }
.brand small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.top nav { display: flex; gap: 18px; }
.top nav a { text-decoration: none; color: var(--text); font-size: 14.5px; padding: 15px 0 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.top nav a:hover { color: var(--accent); }
.top nav a.on { border-bottom-color: var(--accent); color: var(--ink); }
.top .back { margin-left: auto; text-decoration: none; font-size: 13.5px; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 11px; white-space: nowrap; background: var(--card); }
.top .back:hover { border-color: var(--accent); color: var(--accent); }

.loading { color: var(--muted); padding: 40px 24px; }
.error { margin: 16px 0; padding: 12px 14px; border: 1px solid var(--bad); background: var(--bad-bg); color: var(--bad); border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }

/* ---------- overview ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 0 24px 60px; }
.hero { padding: 30px 0 4px; }
.kicker { margin: 0 0 8px; font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.hero h1 { margin: 0 0 12px; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.2; letter-spacing: -.6px; }
.lede-main { margin: 0 0 14px; font-size: 16px; line-height: 1.7; color: var(--text); max-width: 940px; }
.lede-main b { color: var(--ink); }
.caveat { margin: 0 0 16px; padding: 8px 12px; border-left: 3px solid var(--warn); background: var(--warn-bg); color: var(--text); font-size: 14px; border-radius: 0 6px 6px 0; }
.caveat b { color: var(--warn); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--kc, var(--muted)); }
.key.hollow { background: transparent; border: 2px solid var(--kc, var(--muted)); }
.k-s17500 { --kc: var(--r-s17500); }
.k-s20000 { --kc: var(--r-s20000); }
.k-s27500 { --kc: var(--r-s27500); }
.k-s17500-seed43 { --kc: var(--r-s17500); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 10px; }
.tile { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 12px 16px; min-width: 0; display: flex; flex-direction: column; }
.tile h3 { margin: 0 0 2px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tile .tsub { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.tile .big { font-size: 28px; font-weight: 600; color: var(--ink); letter-spacing: -.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile .big small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.tile .frac { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.tile .splits { margin-top: auto; border-top: 1px solid var(--line-2); padding-top: 7px; display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.tile .splits dt { color: var(--muted); }
.tile .splits dd { margin: 0; color: var(--ink); text-align: right; }
.tile .splits dd small { color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.tile .splits dd.na { color: var(--muted); }

section.block { margin-top: 38px; }
section.block > h2 { font-size: 22px; letter-spacing: -.3px; margin: 0 0 6px; }
section.block > .lede { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; max-width: 900px; }
section.block > .lede b { color: var(--text); font-weight: 600; }
.card { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 16px 18px; min-width: 0; }
.card + .card { margin-top: 14px; }
.card > h3 { margin: 0 0 10px; font-size: 16px; }
.card > h3 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.grid2 > .card + .card { margin-top: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.note b { color: var(--text); font-weight: 600; }

/* lineage */
.lineage { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; }
.lane { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 12px 16px 14px; min-width: 0; position: relative; }
.lane.cont { border-style: dashed; }
.lane h3 { margin: 0; font-size: 14.5px; }
.lane .lname { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; margin: 2px 0 8px; }
.lane .lnote { font-size: 13px; color: var(--text); margin: 0 0 10px; }
.steps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.steps .arrow { color: var(--muted); font-size: 13px; }
.stepbox { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 13px; background: var(--card-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.stepbox.eval { background: var(--card); color: var(--ink); border-color: var(--kc); box-shadow: inset 3px 0 0 var(--kc); font-weight: 600; }
.stepbox.eval small { font-weight: 400; color: var(--muted); }
.cfgchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.cfgchips span { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; color: var(--text); white-space: nowrap; background: var(--card); }
.cfgchips span b { font-weight: 600; color: var(--ink); font-family: var(--mono); font-size: 11.5px; }
.ckpts { margin-top: 14px; }

/* tables */
table.nums { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.nums th, table.nums td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
table.nums th:first-child, table.nums td:first-child { text-align: left; }
table.nums thead th { color: var(--muted); font-weight: 500; font-size: 13px; background: var(--card-2); }
table.nums td.left, table.nums th.left { text-align: left; }
table.nums tr.sum td { font-weight: 600; background: var(--card-2); color: var(--ink); }
table.nums td .ci { display: block; font-size: 11.5px; color: var(--muted); }
table.nums td code { font-size: 12px; }
.pv { font-weight: 600; color: var(--ink); }
.pv.sig { color: var(--warn); }
.who { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.disc { display: inline-grid; grid-template-columns: 60px 60px; align-items: center; vertical-align: middle; margin-left: 4px; }
.disc span { height: 9px; display: block; }
.disc .l { justify-self: end; background: var(--kc); border-radius: 3px 0 0 3px; }
.disc .r { justify-self: start; background: var(--kc); border-radius: 0 3px 3px 0; }
.disc-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.disc-cell .n { min-width: 2.2em; text-align: right; }
.disc-cell .n.r { text-align: left; }

/* per-task table */
.tbl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.tbl-tools input[type=search] { font-size: 13.5px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); min-width: 180px; }
.tbl-tools input[type=search]:focus { outline: none; border-color: var(--accent); }
.tbl-tools label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tbl-tools .legend-hot { display: inline-flex; align-items: center; gap: 6px; }
.tbl-tools .legend-hot i { width: 14px; height: 14px; border-radius: 3px; background: color-mix(in srgb, var(--warn-bg) 80%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); display: inline-block; }
.tasktbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 860px; }
.tasktbl th, .tasktbl td { padding: 6px 7px; border-bottom: 1px solid var(--line-2); vertical-align: middle; text-align: center; }
.tasktbl thead th { font-size: 12.5px; color: var(--muted); font-weight: 500; background: var(--card-2); white-space: nowrap; }
.tasktbl thead tr.g th { border-bottom: 0; padding-bottom: 0; color: var(--ink); font-weight: 600; }
.tasktbl thead th.sortable { cursor: pointer; user-select: none; }
.tasktbl thead th.sortable:hover { color: var(--accent); }
.tasktbl thead th .arr { font-size: 10px; margin-left: 3px; color: var(--accent); }
.tasktbl thead th[aria-sort="none"] .arr { color: transparent; }
.tasktbl th.sep, .tasktbl td.sep { border-left: 1px solid var(--line); }
.tasktbl td.task { text-align: left; min-width: 180px; position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 1px 0 0 var(--line-2); }
.tasktbl thead th:first-child { position: sticky; left: 0; z-index: 2; text-align: left; }
.tasktbl td.task a { font-family: var(--mono); font-size: 12.5px; color: var(--ink); text-decoration: none; word-break: break-all; }
.tasktbl td.task a:hover { color: var(--accent); text-decoration: underline; }
.tasktbl td.task .lim { display: block; font-size: 11px; color: var(--muted); }
.tasktbl tr.hot td { background: color-mix(in srgb, var(--warn-bg) 70%, transparent); }
.tasktbl tr.hot td.task { background: color-mix(in srgb, var(--warn-bg) 70%, var(--card)); }
.tasktbl tfoot td { font-weight: 600; color: var(--ink); background: var(--card-2); border-bottom: 0; }
.tasktbl tfoot td.task { background: var(--card-2); }
.cnt { display: inline-flex; flex-direction: column; align-items: center; min-width: 34px; text-decoration: none; color: var(--ink); border-radius: 4px; padding: 1px 4px; }
.cnt:hover { background: var(--card-3); }
.cnt .b { display: block; height: 3px; width: 26px; border-radius: 2px; background: var(--card-3); position: relative; overflow: hidden; margin-top: 2px; }
.cnt .b i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar); }
.cnt.hi { color: var(--ok); font-weight: 700; }
.cnt.lo { color: var(--bad); font-weight: 700; }
.spread { font-weight: 600; color: var(--muted); }
.spread.s3 { color: var(--text); }
.spread.s5 { color: var(--warn); }
.tasktbl td.s43 { color: var(--text); }

/* charts */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text); margin: 0 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i.bar { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--bar); }
.legend i.expd { display: inline-block; width: 16px; height: 2px; background: var(--exp); position: relative; }
.legend i.expd::after { content: ''; position: absolute; left: 5px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--exp); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart text { font-family: var(--sans); }
.chart .t-tick { fill: var(--tick); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .t-label { fill: var(--text); font-size: 12.5px; }
.chart .t-strong { fill: var(--ink); font-size: 13px; font-weight: 600; }
.chart .t-val { fill: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .t-grp { fill: var(--ink); font-size: 13px; font-weight: 600; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axisline { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart-cap { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

.repro-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; margin-bottom: 14px; }
.repro-stats > div { padding: 9px 14px; border-left: 1px solid var(--line-2); min-width: 0; }
.repro-stats > div:first-child { border-left: 0; }
.repro-stats .k { font-size: 12.5px; color: var(--muted); }
.repro-stats .v { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.repro-stats .s { font-size: 12px; color: var(--muted); }

.staged-list { margin: 0; padding-left: 18px; font-size: 14px; }
.staged-list li { margin: 4px 0; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; border-radius: 6px; padding: 7px 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.dark:hover { color: var(--paper); opacity: .9; }

.foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.foot code { font-size: 12px; }
.paths { margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.paths li { padding: 4px 0; border-top: 1px solid var(--line-2); overflow-wrap: anywhere; }
.paths li:first-child { border-top: 0; }
.paths b { color: var(--text); font-weight: 500; margin-right: 6px; }

/* tooltip */
.tip { position: fixed; z-index: 60; pointer-events: none; max-width: 300px; background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(0,0,0,.12); border-radius: 6px; padding: 7px 10px; font-size: 12.5px; line-height: 1.45; }
.tip b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.tip .tl { display: flex; align-items: center; gap: 6px; }

/* ---------- episode browser ---------- */
.app { display: grid; grid-template-columns: 286px minmax(0, 1fr); max-width: 1600px; margin: 0 auto; }
.side { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; border-right: 1px solid var(--line); background: var(--card); padding: 14px 10px 20px; min-height: calc(100vh - var(--header-h)); }
.side h4 { margin: 12px 8px 6px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.runtabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; background: var(--card-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px; }
.runtabs a { display: flex; align-items: center; gap: 6px; text-decoration: none; font-size: 12.5px; padding: 4px 7px; border-radius: 5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runtabs a:hover { color: var(--ink); }
.runtabs a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }
.side input[type=search] { width: 100%; margin-top: 10px; font-size: 13.5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.side input[type=search]:focus { outline: none; border-color: var(--accent); }
.side .side-note { margin: 8px 8px 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.tasklist { list-style: none; margin: 0; padding: 0; }
.tasklist a { display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; gap: 0 6px; align-items: baseline; text-decoration: none; padding: 5px 8px; border-radius: 6px; color: var(--ink); }
.tasklist a:hover { background: var(--card-2); }
.tasklist a.on { background: var(--accent-bg); }
.tasklist .tn { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasklist .ts { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tasklist a.on .ts { color: var(--accent); }
.tasklist .tv { font-size: 11px; color: var(--muted); font-family: var(--mono); text-align: right; white-space: nowrap; }
.tasklist .empty { padding: 8px; font-size: 13px; color: var(--muted); }

.content { min-width: 0; padding: 18px 24px 48px; }
.ep-head h1 { margin: 0; font-size: 22px; letter-spacing: -.3px; font-family: var(--mono); font-weight: 600; word-break: break-all; }
.ep-head .sub { margin: 2px 0 12px; font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.ep-head .sub b { color: var(--ink); font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 1px 7px; border-radius: 3px; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.fail { color: var(--bad); background: var(--bad-bg); }

/* seed matrix */
.matrix { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 10px 14px 12px; margin-bottom: 14px; }
.matrix > summary { cursor: pointer; font-size: 14px; color: var(--ink); font-weight: 600; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.matrix > summary::-webkit-details-marker { display: none; }
.matrix > summary::before { content: '▾'; color: var(--muted); font-weight: 400; }
.matrix:not([open]) > summary::before { content: '▸'; }
.matrix > summary small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.mx-block { margin-top: 10px; }
.mx-title { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
.mx-title b { color: var(--ink); font-weight: 600; }
.mx { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 3px 8px; align-items: center; }
.mx .rl { font-size: 12px; color: var(--text); display: flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mx .rl small { color: var(--muted); }
.cells { display: flex; gap: 2px; }
.cells a, .cells span { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 3px; font-size: 11px; text-decoration: none; position: relative; font-weight: 600; }
.cells .c-ok { background: var(--cell-ok); color: var(--cell-ok-ink); }
.cells .c-bad { background: var(--cell-bad); color: var(--cell-bad-ink); }
.cells .c-na { border: 1px dashed var(--line); color: var(--muted); font-weight: 400; }
.cells a:hover { outline: 2px solid var(--ink); outline-offset: -1px; }
.cells a.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.cells a.hv::after { content: ''; position: absolute; right: 1px; top: 1px; border-style: solid; border-width: 0 6px 6px 0; border-color: transparent var(--ink) transparent transparent; opacity: .55; }
.mx-seeds { display: flex; gap: 2px; margin-left: 100px; }
.mx-seeds span { width: 22px; flex: none; font-size: 9.5px; color: var(--muted); text-align: center; font-family: var(--mono); }
.mx-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.mx-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.mx-legend i.ok { background: var(--cell-ok); }
.mx-legend i.bad { background: var(--cell-bad); }
.mx-legend i.na { border: 1px dashed var(--muted); }
.mx-legend i.hv { background: linear-gradient(225deg, var(--ink) 0 30%, var(--card-3) 30%); opacity: .7; }

/* replay */
.replay { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.replay:fullscreen { overflow: auto; }
.replay-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.replay-heading h3 { font-size: 16px; margin: 0; line-height: 1.45; font-weight: 600; flex: 1 1 320px; min-width: 0; }
.replay-heading h3 small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.stage { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.world { min-width: 0; border-right: 1px solid var(--line); }
.vwrap { position: relative; background: var(--stage); aspect-ratio: 4 / 3; overflow: hidden; }
.vwrap video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--stage); image-rendering: auto; }
.vbadges { position: absolute; top: 10px; left: 10px; display: flex; gap: 4px; flex-wrap: wrap; z-index: 2; }
.vbadges span { font-size: 12px; color: #eef0ea; background: #141b18b8; padding: 2px 8px; border-radius: 3px; }
.vstart { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; background: #0a130a30; width: 100%; z-index: 1; }
.vstart:hover { background: #0a130a50; }
.vstart[hidden] { display: none; }
.vstart > span { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: #ffffffe6; color: #17201e; font-size: 18px; padding-left: 3px; }
.vstart strong { font-size: 15px; font-weight: 500; text-shadow: 0 1px 6px #0008; }
.vcap { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 6px 12px; color: #f3f4ed; font-size: 13.5px; line-height: 1.5; background: #141b18d8; border-radius: 6px; pointer-events: none; z-index: 2; font-variant-numeric: tabular-nums; }
.vcap b { color: #f7a283; font-weight: 500; margin-right: 8px; white-space: nowrap; }
.vcap:empty { display: none; }
.vfail { position: absolute; top: 44px; left: 10px; right: 10px; font-size: 12.5px; color: #f1c38e; background: #141b18d8; padding: 4px 8px; border-radius: 4px; z-index: 2; }
.novideo { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; color: #d5ddd7; font-size: 14px; }
.novideo strong { color: #f3f4ed; font-size: 16px; font-weight: 600; }
.novideo small { color: #9fb0a7; font-size: 12.5px; max-width: 440px; line-height: 1.55; }
.novideo code { color: #cfd8d2; font-size: 11.5px; overflow-wrap: anywhere; }
.novideo a { color: #f7a283; }

.facts-panel { min-width: 0; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.facts-panel h4 { margin: 0; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kv { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.kv dd small { color: var(--muted); font-size: 12px; }
.kv dd code { font-size: 12px; }
.xlinks { display: flex; flex-direction: column; gap: 6px; }
.xl { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; color: var(--ink); background: var(--card); }
a.xl:hover { border-color: var(--accent); }
.xl .vid { font-size: 11.5px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.xl.na { border-style: dashed; color: var(--muted); }
.nav2 { display: flex; flex-wrap: wrap; gap: 6px; }
.nav2 a, .nav2 span { font-size: 13px; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; color: var(--ink); background: var(--card); white-space: nowrap; }
.nav2 a:hover { border-color: var(--accent); color: var(--accent); }
.nav2 span { color: var(--muted); opacity: .6; }

.controls { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line); flex-wrap: nowrap; }
.controls button { font-size: 17px; line-height: 1; color: var(--text); padding: 4px; }
.controls .play { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 13px; padding: 0; flex: none; }
.controls .tnav { display: flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 13px; white-space: nowrap; color: var(--text); }
.controls .clock { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 92px; }
.controls input[type=range] { --progress: 0%; flex: 1; min-width: 60px; appearance: none; -webkit-appearance: none; height: 4px; border-radius: 4px; margin: 0; cursor: pointer; background: linear-gradient(to right, var(--accent) var(--progress), var(--card-3) var(--progress)); }
.controls input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.controls input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.controls select { font-size: 13.5px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--text); }
.controls .fs { display: grid; place-items: center; color: var(--muted); width: 26px; height: 26px; }
.controls .fs:hover { color: var(--accent); }

.strip { position: relative; height: 34px; background: var(--strip-bg); border-top: 1px solid var(--line); overflow: hidden; cursor: pointer; }
.strip.static { cursor: default; }
.strip .sg { position: absolute; top: 0; bottom: 0; border-left: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-bottom: 3px solid var(--strip-ok); font-family: var(--mono); font-size: 10px; color: var(--muted); display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; }
.strip .sg.last-bad { border-bottom-color: var(--strip-bad); }
.strip .sg.cur { background: var(--strip-cur); color: var(--ink); }
.strip:not(.static) .sg:hover { background: var(--card-3); }
.strip .cursor { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; margin-left: -1px; }
.strip-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 16px 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); }
.strip-legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 5px; }
.notes { margin: 12px 2px 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .world { border-right: 0; }
  .facts-panel { border-top: 1px solid var(--line); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lineage { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px 12px; }
  .side .tasklist { max-height: 230px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .repro-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repro-stats > div:nth-child(3) { border-left: 0; }
  .repro-stats > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 640px) {
  :root { --header-h: 50px; }
  .top-in { padding: 0 12px; gap: 12px; }
  .brand small { display: none; }
  .brand { font-size: 15px; }
  .top nav { gap: 12px; }
  .top nav a { font-size: 14px; }
  .top .back { padding: 4px 8px; font-size: 12.5px; }
  .page { padding: 0 16px 40px; }
  .content { padding: 14px 16px 40px; }
  .hero { padding-top: 20px; }
  .lede-main { font-size: 15px; }
  .tiles { gap: 8px; }
  .tile { padding: 10px 10px; }
  .tile .big { font-size: 22px; }
  .tile .big small { font-size: 12.5px; margin-left: 3px; }
  .tile .splits { font-size: 12px; gap: 1px 6px; }
  .tile .splits dd small { display: none; }
  .card { padding: 12px 12px; }
  table.nums { font-size: 13px; }
  table.nums th, table.nums td { padding: 5px 6px; }
  .controls { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .controls input[type=range] { order: 5; flex-basis: 100%; }
  .controls .clock { min-width: 0; }
  .strip-legend { padding-left: 12px; padding-right: 12px; }
  .facts-panel { padding: 10px 12px 12px; }
  .vcap { font-size: 12.5px; padding: 4px 9px; left: 6px; right: 6px; bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tasktbl td.task { min-width: 132px; }
  .tasktbl td.task a { font-size: 11.5px; }
  .mx { grid-template-columns: 74px minmax(0, 1fr); }
  .mx-seeds { margin-left: 82px; }
  .mx .rl { font-size: 11.5px; }
  .repro-stats .v { font-size: 17px; }
  .tbl-tools input[type=search] { min-width: 0; width: 100%; }
}
@media (max-width: 360px) {
  .brand b { display: none; }
  .top nav { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

table.nums a, .tasktbl td.task a { text-underline-offset: 3px; }
