/* Memory tasks, round 3: SC (state only + compact observation text) vs S (round 2, full text), plus the SCL / SCR follow-ups.
   Round-2 stylesheet with round-3 arm tokens and the follow-up section; layout ideas follow the robodawn.top/results replay. */

: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;
  /* series: arm identity (reference palette slots 2/1/3, validated all-pairs in both modes):
     SC = evaluated arm, S = reference arm (round 2), SCL / SCR = follow-ups (never on one chart together) */
  --s-SC: #eb6834;
  --s-S: #2a78d6;
  --s-SCL: #1baf7a;
  --s-SCR: #1baf7a;
  /* series: cost components (validated adjacent order) */
  --c-cache_write: #4a3aa7;
  --c-cache_read: #1baf7a;
  --c-uncached_input: #eda100;
  --c-output: #e87ba4;
  /* label ink on top of each component fill, picked by the fill's luminance */
  --on-c-cache_write: #ffffff;
  --on-c-cache_read: #17201e;
  --on-c-uncached_input: #17201e;
  --on-c-output: #17201e;
  --chart-surface: #fcfcf8;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --tick: #7d7b74;
  /* replay stage + agent panel stay dark in both themes */
  --stage: #1d2622;
  --agent: #1b2521;
  --agent-2: #141c19;
  --agent-line: #2f3b36;
  --agent-rail: #36443e;
  --agent-text: #e6ece2;
  --agent-text-2: #b9c6bf;
  --agent-muted: #8fa097;
  --agent-ok: #a9d6b3;
  --agent-warn: #f1c38e;
  --agent-bad: #f0a194;
  --strip-bg: #f1f1ea;
  --strip-ok: #b9c9be;
  --strip-bad: #c9422c;
  --strip-cur: #fbe4da;
  --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;
    --s-SC: #d95926;
    --s-S: #3987e5;
    --s-SCL: #199e70;
    --s-SCR: #199e70;
    --c-cache_write: #9085e9;
    --c-cache_read: #199e70;
    --c-uncached_input: #c98500;
    --c-output: #d55181;
    --on-c-cache_write: #17201e;
    --on-c-cache_read: #0c100e;
    --on-c-output: #0c100e;
    --chart-surface: #171c1a;
    --grid: #2c2c2a;
    --axis: #45443f;
    --tick: #9a988f;
    --stage: #0c100e;
    --agent: #131a17;
    --agent-2: #0e1411;
    --strip-bg: #202623;
    --strip-ok: #52665a;
    --strip-bad: #e0664f;
    --strip-cur: #4a2a1d;
  }
}

*, *::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); }
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 8px; }
.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; }
.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); }
.runs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.run-card { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 10px 14px; font-size: 13px; color: var(--muted); min-width: 0; }
.run-card strong { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.run-card code { font-size: 12px; overflow-wrap: anywhere; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.key.SC { background: var(--s-SC); }
.key.S { background: var(--s-S); }
.key.SCL { background: var(--s-SCL); }
.key.SCR { background: var(--s-SCR); }
.key.sq { border-radius: 2px; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 10px; }
.tile { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 12px 16px 12px; min-width: 0; }
.tile h3 { margin: 0 0 6px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.tile-row { display: flex; align-items: baseline; gap: 8px; }
.tile-row .who { font-size: 12.5px; color: var(--muted); width: 3.2em; flex: none; display: flex; align-items: center; gap: 6px; }
.tile-row .val { font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.4px; line-height: 1.3; }
.tile-row.S .val { font-size: 19px; font-weight: 500; color: var(--text); }
.tile .cmp { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--text); }
.tile .cmp b { color: var(--ink); }

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: 880px; }
.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; }

.decomp { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; }
.factor { flex: 1 1 180px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: var(--card); min-width: 0; }
.factor.total { border-color: var(--ink); }
.factor .f-name { font-size: 13px; color: var(--muted); }
.factor .f-val { font-size: 30px; font-weight: 600; color: var(--ink); letter-spacing: -.5px; line-height: 1.25; }
.factor .f-sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.op { align-self: center; font-size: 24px; color: var(--muted); padding: 0 2px; }
.decomp-note { margin: 10px 0 0; font-size: 14px; color: var(--text); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.grid2 > .card + .card { margin-top: 0; }
table.nums { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.nums th, table.nums td { padding: 6px 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; white-space: normal; }
table.nums thead th { color: var(--muted); font-weight: 500; font-size: 13px; background: var(--card-2); }
table.nums td.sub { padding-left: 24px; color: var(--muted); }
table.nums td.up { color: var(--bad); }
table.nums td.down { color: var(--ok); }
.price-notes { margin: 12px 0 0; padding: 0 0 0 18px; font-size: 13.5px; color: var(--text); }
.price-notes li { margin: 4px 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

.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 { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legend i.dot { border-radius: 50%; }
.legend i.hollow { border-radius: 50%; background: transparent !important; border: 2px solid var(--muted); }
.legend i.line { height: 2px; width: 16px; border-radius: 1px; }
.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-in { font-size: 12px; font-weight: 500; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axisline { stroke: var(--axis); stroke-width: 1; }
.chart a:focus { outline: none; }
.chart a:focus .ring, .chart a:hover .ring { stroke: var(--ink); stroke-width: 1.5; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart-cap { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

.lists { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.lists .card { margin: 0; }
.lists h3 { display: flex; align-items: center; gap: 8px; }
.lists h3 .ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.lists .up h3 .ico { background: var(--bad-bg); color: var(--bad); }
.lists .down h3 .ico { background: var(--ok-bg); color: var(--ok); }
.facts { list-style: none; margin: 0; padding: 0; }
.facts > li { padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.facts > li:first-child { border-top: 0; padding-top: 2px; }
.facts .fk { color: var(--ink); font-weight: 500; }
.facts .fv { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 6px; white-space: nowrap; }
.up .facts .fv { color: var(--bad); }
.down .facts .fv { color: var(--ok); }
.facts .fd { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.facts ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--text); }
.facts ul li { margin: 2px 0; }
.facts ul code { font-size: 12.5px; }
.flat-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* per-task table */
.tasktbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 900px; }
.tasktbl th, .tasktbl td { padding: 8px 8px; 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 th.grp { border-bottom: 0; padding-bottom: 0; }
.tasktbl th:first-child, .tasktbl td:first-child { text-align: left; }
.tasktbl td.task { min-width: 170px; }
.tasktbl td.task .tname { font-family: var(--mono); font-size: 13px; color: var(--ink); word-break: break-all; }
.tasktbl td.task .badge { display: inline-block; margin: 3px 4px 0 0; font-size: 11.5px; padding: 0 6px; border-radius: 3px; font-family: var(--sans); }
.badge.hot { background: var(--bad-bg); color: var(--bad); }
.badge.cool { background: var(--ok-bg); color: var(--ok); }
.tasktbl tr.hot td { background: color-mix(in srgb, var(--bad-bg) 45%, transparent); }
.tasktbl tr.cool td { background: color-mix(in srgb, var(--ok-bg) 55%, transparent); }
.tasktbl td.sep { border-left: 1px solid var(--line); }
.tasktbl td.task, .tasktbl thead tr:first-child th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 1px 0 0 var(--line-2); }
.tasktbl thead tr:first-child th:first-child { background: var(--card-2); }
.tasktbl tr.hot td.task { background: color-mix(in srgb, var(--bad-bg) 45%, var(--card)); }
.tasktbl tr.cool td.task { background: color-mix(in srgb, var(--ok-bg) 55%, var(--card)); }
.tasktbl tfoot td:first-child { position: sticky; left: 0; z-index: 1; }
.tasktbl .num { text-align: right; white-space: nowrap; }
.tasktbl tfoot td { font-weight: 600; color: var(--ink); background: var(--card-2); }
.cellx { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 62px; padding: 4px 4px; border-radius: 6px; text-decoration: none; border: 1px solid var(--line); background: var(--card); line-height: 1.3; }
.cellx:hover { border-color: var(--accent); }
.cellx .m { font-size: 12px; font-weight: 600; white-space: nowrap; }
.cellx.ok .m { color: var(--ok); }
.cellx.fail .m { color: var(--bad); }
.cellx.fail { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.cellx .u { font-size: 13px; color: var(--ink); font-weight: 500; }
.cellx .c { font-size: 11.5px; color: var(--muted); }
.cellx.has-note .m::after { content: ' ⓘ'; font-weight: 400; color: var(--muted); }
.ratio-cell { text-align: left !important; min-width: 190px; }
.ratio-cell .rv { font-weight: 600; color: var(--ink); }
.ratio-cell .rd { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rbar { display: block; height: 6px; border-radius: 3px; background: var(--card-3); margin-top: 4px; width: 120px; position: relative; overflow: hidden; }
.rbar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--muted); border-radius: 3px; }
.note-btn { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; margin-top: 4px; }
.note-btn:hover { color: var(--accent); border-color: var(--accent); }
tr.notes-row td { background: var(--card-2); text-align: left; font-size: 13px; }
tr.notes-row ul { margin: 0; padding-left: 18px; }
tr.notes-row li { margin: 3px 0; white-space: normal; }
tr.notes-row .v-ok { color: var(--ok); font-weight: 600; }
tr.notes-row .v-bad { color: var(--bad); font-weight: 600; }

.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; }

/* 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; }
.tip .tl i { width: 12px; height: 2px; display: inline-block; border-radius: 1px; }

/* ---------- episode browser ---------- */
.app { display: grid; grid-template-columns: 272px 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: 8px 8px 6px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.side .side-note { margin: 0 8px 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tasklist { list-style: none; margin: 0; padding: 0; }
.tasklist > li { padding: 7px 8px 8px; border-radius: 6px; }
.tasklist > li.on { background: var(--accent-bg); }
.tasklist .tn { font-family: var(--mono); font-size: 12.5px; color: var(--ink); display: block; margin-bottom: 4px; word-break: break-all; }
.tasklist .chips { display: flex; gap: 6px; }
.hchip { flex: 1 1 0; display: flex; align-items: center; gap: 6px; text-decoration: none; font-size: 12px; padding: 3px 7px; border-radius: 5px; border: 1px solid var(--line); background: var(--card); color: var(--text); white-space: nowrap; min-width: 0; font-variant-numeric: tabular-nums; }
.hchip:hover { border-color: var(--accent); }
.hchip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--ink); font-weight: 500; }

.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); }
.ep-head .sub .key { margin-right: 4px; vertical-align: -1px; }
.eprow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.eptabs { display: flex; gap: 10px; flex-wrap: wrap; }
.eptab { display: grid; grid-template-columns: 76px auto; gap: 2px 10px; align-items: center; text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px 6px 6px; background: var(--card); min-width: 0; }
.eptab:hover { border-color: var(--accent); }
.eptab.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.eptab img { grid-row: span 3; width: 76px; height: 57px; object-fit: cover; border-radius: 4px; background: var(--card-3); display: block; }
.eptab strong { font-size: 14px; color: var(--ink); font-family: var(--mono); }
.eptab .pill { justify-self: start; }
.eptab small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pairlink { display: flex; flex-direction: column; justify-content: center; text-decoration: none; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 12px; font-size: 13.5px; color: var(--ink); background: transparent; min-width: 0; }
.pairlink:hover { border-color: var(--accent); color: var(--accent); }
.pairlink small { color: var(--muted); font-size: 12px; }
.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); }

.ep-meta { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.ep-meta b { color: var(--ink); font-weight: 500; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.chip { font-size: 12.5px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 1px 10px; color: var(--text); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip code { font-size: 12px; }
.chip.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--bad); }
.chip.okc { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); color: var(--ok); }
.coststats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 12px 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.coststats > div { padding: 8px 12px; border-left: 1px solid var(--line-2); min-width: 0; }
.coststats > div:first-child { border-left: 0; }
.coststats .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.coststats .v { font-size: 17px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.coststats .s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* replay card */
.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.15fr) 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); }
.vbadges { position: absolute; top: 10px; left: 10px; display: flex; gap: 4px; flex-wrap: wrap; z-index: 2; }
.vbadges span, .vbadges button { font-size: 12px; color: #eef0ea; background: #141b18b8; padding: 2px 8px; border-radius: 3px; }
.vbadges button:hover { background: #141b18e6; }
.vbadges button.on { background: #eef0ea; color: #17201e; }
.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: 7px 12px; color: #f3f4ed; font-size: 13.5px; line-height: 1.5; background: #141b18d8; border-radius: 6px; pointer-events: none; max-height: 45%; overflow: hidden; z-index: 2; }
.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; }

.obs { padding: 10px 14px; border-top: 1px solid var(--line); }
.obs-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.obs-head b { color: var(--ink); font-weight: 600; }
.obs-note { font-size: 12.5px; padding: 3px 8px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); }
.obs-imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.obs-imgs figure { margin: 0; position: relative; aspect-ratio: 4 / 3; background: var(--card-3); border-radius: 4px; overflow: hidden; cursor: zoom-in; padding: 0; border: 0; display: block; width: 100%; }
.obs-imgs figure.unseen img { opacity: .45; filter: grayscale(.6); }
.obs-imgs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.obs-imgs figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 6px; font-size: 11px; color: #eef0ea; background: #141b18a8; text-align: left; }
.grip { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 7px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.grip b { font-family: var(--mono); font-weight: 400; color: var(--ink); margin: 0 3px; white-space: nowrap; }

.agent { min-width: 0; background: var(--agent); color: var(--agent-text); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; contain: size; min-height: 560px; }
.agent-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--agent-line); }
.agent-head .av { width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.agent-head strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--agent-text); }
.agent-head small { display: block; font-size: 12px; color: var(--agent-muted); }
.agent-body { min-height: 0; overflow-y: auto; padding: 14px 16px 18px; scrollbar-width: thin; scrollbar-color: #3c4a44 transparent; overscroll-behavior: contain; }
.agent-foot { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--agent-line); font-size: 12px; color: var(--agent-muted); }
.agent-foot .sd { width: 7px; height: 7px; border-radius: 50%; background: #56645e; flex: none; }
.agent-foot .sd.on { background: #8fd19e; }
.agent-foot .cnt { margin-left: auto; font-family: var(--mono); letter-spacing: .5px; white-space: nowrap; }

.tc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 12px; color: var(--agent-muted); }
.tc-idx { font-family: var(--mono); color: var(--agent-muted); }
.tc-tool { font-family: var(--mono); font-size: 14px; color: var(--agent-text); font-weight: 500; overflow-wrap: anywhere; }
.tc-time { margin-left: auto; font-family: var(--mono); }
.tc-phase { font-size: 11px; color: #c3cfc8; border: 1px solid #3c4a44; border-radius: 3px; padding: 0 5px; letter-spacing: .5px; white-space: nowrap; }
.tc-phase.decision { border-color: var(--accent-soft); color: var(--accent-soft); }
.tc-cost { margin: 8px 0 0; font-family: var(--mono); font-size: 12px; color: #d7e0da; background: var(--agent-2); border: 1px solid var(--agent-line); border-radius: 5px; padding: 5px 8px; line-height: 1.6; }
.tc-cost b { color: #fff; font-weight: 600; }
.tc-cost .cw { color: #c9c2ff; }
.tc-cost .cr { color: #8fe0bf; }
.tc-cost .co { color: #f6b7cf; }
.tc-sec { margin-top: 12px; }
.tc-lbl { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--agent-muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tc-lbl em { font-style: normal; text-transform: none; letter-spacing: 0; color: #7f8f87; }
.state { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; font-size: 13.5px; line-height: 1.55; border-left: 2px solid #4a5a53; padding-left: 10px; }
.state dt { color: var(--agent-muted); font-family: var(--mono); font-size: 12px; padding-top: 2px; white-space: nowrap; }
.state dd { margin: 0; color: #eef2eb; overflow-wrap: anywhere; }
.plan { margin: 0; font-size: 14px; line-height: 1.6; color: var(--agent-text-2); overflow-wrap: anywhere; white-space: pre-line; }
.plan.big { color: #eef2eb; }
.tool-code { padding: 8px 11px; background: var(--agent-2); border: 1px solid var(--agent-line); border-radius: 5px; }
.tool-code > div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--agent-muted); margin-bottom: 4px; }
.tool-code code { display: block; font-size: 12.5px; line-height: 1.65; color: #dfe7da; white-space: pre-wrap; overflow-wrap: anywhere; }
.tool-code code .fn { color: #f7b08e; }
.tool-code code .arm { color: #9fc2d0; }
.tool-code code .num { color: #dfd79a; }
.tool-code code .x { text-decoration: line-through; text-decoration-color: #e0826c; opacity: .8; }
.res-title { font-size: 13px; font-weight: 500; margin: 0 0 6px; }
.res-title.ok { color: var(--agent-ok); }
.res-title.warn { color: var(--agent-warn); }
.res { border-left: 2px solid #5f8a6c; padding: 1px 0 1px 10px; margin: 0 0 7px; font-size: 13px; line-height: 1.5; color: #d2dcd5; }
.res.bad { border-color: #c0795a; color: #ecd2c2; }
.res .rc { font-family: var(--mono); font-size: 12px; color: #eef2eb; overflow-wrap: anywhere; }
.res .rm { font-family: var(--mono); font-size: 11.5px; color: #a3b3ab; margin-left: 8px; white-space: nowrap; }
.res .rn { display: block; color: #b9c6bf; font-size: 12.5px; overflow-wrap: anywhere; }
.res .ic { font-weight: 700; margin-right: 6px; }
.res .ic.ok { color: var(--agent-ok); }
.res .ic.bad { color: var(--agent-bad); }
.pending .res-block { opacity: .35; }
.pending .res-block::before { content: '执行中，等待返回…'; display: block; font-size: 12px; color: var(--accent-soft); margin-bottom: 4px; }
.priv { font-size: 12.5px; color: #cdd7d0; border: 1px dashed #4b5a53; border-radius: 5px; padding: 5px 9px; }
.priv b { color: var(--agent-warn); font-weight: 500; }
.verdict { margin-top: 12px; padding-top: 10px; border-top: 1px solid #35503f; font-size: 14px; }
.verdict.ok { color: #b7e3c0; }
.verdict.bad { color: var(--agent-warn); border-color: #5c4a3a; }
.verdict .vm { display: block; font-family: var(--mono); font-size: 12px; color: #a3b3ab; margin-top: 3px; }
.tailnote { margin-top: 12px; font-size: 13px; color: var(--agent-warn); border: 1px solid #5c4a3a; border-radius: 5px; padding: 6px 9px; }
.agent details { margin-top: 10px; }
.agent details > summary { cursor: pointer; font-size: 12.5px; color: #a7b6ae; padding: 2px 0; }
.agent details > summary:hover { color: #fff; }
.agent pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; color: #d7e0da; background: var(--agent-2); border: 1px solid var(--agent-line); border-radius: 5px; padding: 8px 10px; max-height: 320px; overflow: auto; }
.agent .fnote { font-size: 11.5px; color: #7f8f87; margin: 4px 0 0; }

.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: 88px; }
.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); }
.controls .fs:hover { color: var(--accent); }

.strip-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 6px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.seg2 { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.seg2 button { padding: 2px 9px; border-radius: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.seg2 button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.strip { position: relative; height: 36px; background: var(--strip-bg); border-top: 1px solid var(--line); overflow: hidden; cursor: pointer; }
.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.bad { border-bottom-color: var(--strip-bad); }
.strip .sg.cur { background: var(--strip-cur); color: var(--ink); }
.strip .sg:hover { background: var(--card-3); }
.strip .tail { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--muted) 18%, transparent) 5px 6px); border-left: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.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); }
.strip-legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 5px; }

.spark { padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.spark-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.spark-head b { color: var(--ink); font-weight: 600; }
.spark .chart { cursor: pointer; }

.notes { margin: 12px 2px 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.turnlist-wrap { margin-top: 18px; }
.turnlist-wrap > h3 { font-size: 15px; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.turnlist-wrap > h3 small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.turnlist { max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--card); position: relative; }
.tl-row { display: grid; grid-template-columns: 44px 52px minmax(0, 1fr) 64px 70px 70px; gap: 8px; align-items: center; width: 100%; padding: 5px 10px; border-bottom: 1px solid var(--line-2); text-align: left; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text); }
.tl-row:hover { background: var(--card-2); }
.tl-row.cur { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.tl-row.hdr { position: sticky; top: 0; z-index: 1; background: var(--card-2); color: var(--muted); font-size: 12px; cursor: default; }
.tl-row .ix { font-family: var(--mono); color: var(--muted); }
.tl-row .cm { font-family: var(--mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.tl-row .st.ok { color: var(--ok); }
.tl-row .st.bad { color: var(--bad); }
.tl-row .r { text-align: right; white-space: nowrap; }
details.sysp { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.sysp > summary { cursor: pointer; font-size: 14px; color: var(--text); }
details.sysp pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; max-height: 380px; overflow: auto; color: var(--text); }

.lightbox { position: fixed; inset: 0; z-index: 80; background: #000c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 4px; background: #111; }
.lightbox p { margin: 0; color: #eee; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .world { border-right: 0; }
  .agent { contain: none; min-height: 0; max-height: none; border-top: 1px solid var(--line); }
  .agent-body { overflow: visible; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coststats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .coststats > div:nth-child(4) { border-left: 0; }
  .coststats > div:nth-child(n+4) { border-top: 1px solid var(--line-2); }
}
@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; }
  .tasklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .grid2, .lists, .runs { grid-template-columns: minmax(0, 1fr); }
}
@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; }
  .tasklist { grid-template-columns: minmax(0, 1fr); }
  .tasklist > li { padding: 5px 6px; }
  .tasklist .tn { margin-bottom: 3px; }
  .coststats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coststats > div:nth-child(4) { border-left: 1px solid var(--line-2); }
  .coststats > div:nth-child(odd) { border-left: 0; }
  .coststats > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
    .pairlink { width: 100%; }
  .controls { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .controls input[type=range] { order: 5; flex-basis: 100%; }
  .controls .clock { min-width: 0; }
  .obs { padding: 8px 10px; }
  .obs-imgs { gap: 6px; }
  .tl-row { grid-template-columns: 34px minmax(0, 1fr) 58px 62px; }
  .tl-row .vt, .tl-row .tk { display: none; }
  .factor .f-val { font-size: 24px; }
  .op { font-size: 18px; }
  .card { padding: 12px 12px; }
  .strip-bar, .strip-legend, .spark { padding-left: 12px; padding-right: 12px; }
  .agent-body { padding: 12px 12px 14px; }
  .state { grid-template-columns: minmax(0, 1fr); gap: 0 8px; }
  .state dt { padding-top: 4px; }
}
/* episode picker: a plain panel on desktop, a collapsible block on phones */
.picker > summary { display: none; }
.legend-right { margin-left: auto; }
@media (max-width: 1100px) {
  .replay { display: flex; flex-direction: column; }
  .stage { display: contents; }
  .replay-heading { order: 0; }
  .world { order: 1; }
  .controls { order: 2; }
  .strip-bar { order: 3; }
  .strip { order: 4; }
  .strip-legend { order: 5; }
  .agent { order: 6; }
  .spark { order: 7; }
}
@media (max-width: 860px) {
  .picker > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-size: 14px; color: var(--ink); }
  .picker > summary::-webkit-details-marker { display: none; }
  .picker > summary::after { content: '▾'; color: var(--muted); }
  .picker[open] > summary::after { content: '▴'; }
  .picker > summary small { color: var(--muted); font-family: var(--mono); font-size: 12px; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .picker[open] > summary { margin-bottom: 8px; }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 10px 10px; }
  .tile-row { gap: 6px; }
  .tile-row .who { width: auto; gap: 4px; }
  .tile-row .val { font-size: 19px; }
  .tile-row.S .val { font-size: 16px; }
  .tile .cmp { font-size: 12px; }
  .decomp { flex-direction: column; }
  .factor { flex: none; }
  .op { align-self: center; line-height: 1; padding: 0; }
  table.nums { font-size: 13px; }
  table.nums th, table.nums td { padding: 5px 6px; }
  table.nums td:first-child { min-width: 7.5em; }
  .eptabs { flex-wrap: nowrap; gap: 6px; width: 100%; }
  .eptabs .eptab { flex: 1 1 0; }
  .eptab { grid-template-columns: minmax(0, 1fr); padding: 6px 8px; gap: 2px; }
  .eptab img { display: none; }
  .eptab small { white-space: normal; }
  .vcap { font-size: 12.5px; padding: 5px 9px; left: 6px; right: 6px; bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .legend-right { margin-left: 0; }
}
@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; }
}

/* ---------- full request panel (requests.json) ---------- */
.st-hit { --st: var(--c-cache_read); }
.st-same { --st: var(--tick); }
.st-write { --st: var(--c-cache_write); }
.reqp { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); scroll-margin-top: calc(var(--header-h) + 8px); min-width: 0; }
.reqp > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 11px 16px; list-style: none; }
.reqp > summary::-webkit-details-marker { display: none; }
.reqp > summary::before { content: '▸'; color: var(--muted); width: 1em; flex: none; }
.reqp[open] > summary::before { content: '▾'; }
.reqp[open] > summary { border-bottom: 1px solid var(--line); }
.reqp > summary:hover .rq-title { color: var(--accent); }
.rq-title { font-weight: 600; color: var(--ink); font-size: 15.5px; }
.rq-sumturn { font-family: var(--mono); font-size: 12.5px; color: var(--text); background: var(--card-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.rq-sumturn:empty { display: none; }
.rq-hint { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.rq-body { padding: 12px 16px 16px; min-width: 0; }
.rq-explain { border: 1px solid color-mix(in srgb, var(--c-cache_read) 45%, var(--line)); background: color-mix(in srgb, var(--c-cache_read) 8%, var(--card)); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.rq-explain > b { color: var(--ink); font-size: 14.5px; }
.rq-explain p { margin: 4px 0 0; color: var(--ink); }
.rq-explain .rq-ex2 { font-size: 13.5px; color: var(--text); }
.rq-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 2px; }
.rq-badge { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 3px; }
.rq-badge.ok { color: var(--ok); background: var(--ok-bg); }
.rq-badge.warn { color: var(--warn); background: var(--warn-bg); }
.rq-meta { font-size: 12.5px; color: var(--muted); }
details.rq-how > summary { cursor: pointer; font-size: 13px; color: var(--text); margin-top: 4px; }
.rq-how p, p.rq-how { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; overflow-wrap: anywhere; line-height: 1.55; }
p.rq-how.warn { color: var(--warn); background: var(--warn-bg); padding: 6px 10px; border-radius: 5px; font-size: 13px; }
.rq-phnote { font-size: 12.5px; color: var(--warn); background: var(--warn-bg); padding: 5px 10px; border-radius: 5px; margin: 8px 0 0; }
.rq-stripwrap { margin: 14px 0 2px; }
.rq-strip-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.rq-strip-head .legend { margin: 0; }
.rq-mark { fill: none; stroke: var(--ink); stroke-width: 1.5; pointer-events: none; }
.rq-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 14px; }
.rq-nav b { color: var(--ink); }
.rq-nav span { color: var(--muted); font-size: 12.5px; }
.rq-nav .rq-btn:last-child { margin-left: auto; }
.rq-btn { font-size: 12.5px; border: 1px solid var(--line); border-radius: 5px; padding: 2px 9px; background: var(--card); color: var(--text); white-space: nowrap; }
.rq-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.rq-none { color: var(--muted); font-size: 13.5px; }
.coststats.rq-stats { margin: 0; }
.rq-stats .v { font-size: 16px; font-variant-numeric: tabular-nums; }
.rq-stats .s { white-space: normal; overflow: visible; }
.rq-tokbar { display: flex; gap: 2px; height: 22px; margin: 8px 0 4px; border-radius: 4px; overflow: hidden; }
.rq-tokbar > span { display: flex; align-items: center; min-width: 3px; padding: 0 6px; font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.rq-tokbar .c-cache_read { background: var(--c-cache_read); color: var(--on-c-cache_read); }
.rq-tokbar .c-cache_write { background: var(--c-cache_write); color: var(--on-c-cache_write); }
.rq-tokbar .c-uncached_input { background: var(--c-uncached_input); color: var(--on-c-uncached_input); padding: 0; }
.rq-diff { border: 1px solid var(--line); border-radius: 6px; background: var(--card-2); padding: 8px 12px; font-size: 13.5px; margin: 8px 0; overflow-wrap: anywhere; }
.rq-diff p { margin: 3px 0; }
.rq-diff b { color: var(--ink); }
.rq-diff .rq-warnline { color: var(--warn); }
.rq-diff .rq-sub { color: var(--text); font-size: 13px; }
.rq-diff .rq-check { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rq-check .okc { color: var(--ok); font-weight: 600; }
.rq-check .badc { color: var(--bad); font-weight: 600; }
.legend.rq-legend { margin: 10px 0 8px; }
.legend i.st-hit, .legend i.st-same, .legend i.st-write { background: var(--st); }
.legend i.st-same { background: repeating-linear-gradient(135deg, var(--tick) 0 2px, transparent 2px 4px); border: 1px dashed var(--tick); }
.rq-parts { list-style: none; margin: 0; padding: 0; }
.rq-row { border: 1px solid var(--line-2); border-left: 4px solid var(--st); border-radius: 6px; padding: 8px 12px 10px; margin: 0 0 8px; background: color-mix(in srgb, var(--st) 7%, var(--card)); min-width: 0; }
.rq-row.st-same { border-left-style: dashed; background: var(--card); }
.rq-rh { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; }
.rq-no { font-family: var(--mono); color: var(--muted); font-size: 12px; min-width: 1.5em; }
.rq-role { font-size: 11.5px; font-weight: 600; padding: 0 7px; border-radius: 3px; white-space: nowrap; line-height: 1.7; }
.rq-role.r-system { background: var(--ink); color: var(--paper); }
.rq-role.r-user { background: var(--card-3); color: var(--ink); }
.rq-role.r-assistant { background: var(--accent-bg); color: var(--accent); }
.rq-role.r-tool { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--muted); }
.rq-role.r-injected { background: var(--warn-bg); color: var(--warn); }
.rq-lbl { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.rq-tag { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; white-space: nowrap; }
.rq-tag.ph { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.rq-st { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); white-space: nowrap; }
.rq-st::before { content: ''; width: 9px; height: 9px; border-radius: 2px; background: var(--st); flex: none; }
.rq-st.st-same::before { background: repeating-linear-gradient(135deg, var(--tick) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--tick); }
.rq-meta2 { font-size: 12px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.rq-frags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rq-frag { font-size: 11.5px; padding: 0 6px; border-radius: 3px; border: 1px solid var(--line); border-left: 3px solid var(--st); background: var(--card); color: var(--text); white-space: nowrap; }
.rq-frag.st-same { border-left-style: dashed; }
.rq-textwrap { min-width: 0; }
pre.rq-text { margin: 6px 0 0; font: 12px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; max-height: 13.5em; overflow: auto; color: var(--text); }
pre.rq-text.exp { max-height: 70vh; }
.rq-row.st-hit pre.rq-text:not(.exp) { max-height: 7em; }
pre.rq-text.ph { font-style: italic; color: var(--muted); }
.rq-text .fr.alt { background: color-mix(in srgb, var(--c-cache_write) 9%, transparent); }
.rq-text .fr.st-same { background: color-mix(in srgb, var(--tick) 22%, transparent); }
.rq-text .fr.st-hit { background: color-mix(in srgb, var(--c-cache_read) 20%, transparent); }
.rq-text .rq-more { color: var(--muted); font-style: italic; }
.rq-expand { margin-top: 5px; }
.rq-imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 170px)); gap: 8px; margin-top: 6px; }
.rq-thumb { display: block; text-decoration: none; min-width: 0; }
.rq-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--card-3); border: 1px solid var(--line); }
.rq-thumb:hover img { border-color: var(--accent); }
.rq-thumb span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-noimg { font-size: 12px; color: var(--warn); border: 1px dashed var(--line); padding: 6px; border-radius: 4px; }
details.rq-params { margin-top: 12px; }
details.rq-params > summary { cursor: pointer; font-size: 13px; color: var(--text); }
details.rq-params pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; max-height: 320px; overflow: auto; color: var(--text); }
.rq-open { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin-top: 12px; padding: 7px 10px; text-align: left; border: 1px solid var(--agent-line); border-radius: 5px; background: var(--agent-2); color: #f7b08e; font-size: 13px; }
.rq-open:hover { border-color: var(--accent-soft); color: #ffd2bd; }
.rq-open small { color: var(--agent-muted); font-size: 11.5px; }
/* overview: why the cache missed */
.why-cache .why-rule { margin: 0 0 8px; font-size: 14px; color: var(--text); }
.why-cache .why-rule b { color: var(--ink); }
.why-cache .why-list { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--text); }
.why-cache .why-list li { margin: 6px 0; }
.why-cache .why-list b { color: var(--ink); }
.why-cache .why-links { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.why-cache .why-links a { color: var(--accent); }
@media (max-width: 640px) {
  .reqp > summary { padding: 10px 12px; }
  .rq-hint { margin-left: 0; flex-basis: 100%; }
  .rq-body { padding: 10px 12px 12px; }
  .rq-explain { padding: 8px 10px; }
  .rq-row { padding: 7px 9px 9px; }
  .rq-imgs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .rq-nav span { flex-basis: 100%; order: 3; }
  pre.rq-text { font-size: 11.5px; padding: 6px 8px; }
}

/* ---------- round 2 additions ---------- */
.caveat.info { border-left-color: var(--line); background: var(--card-2); }
.caveat.info b { color: var(--ink); }
.pairs-line { margin: -6px 0 14px; font-size: 14px; color: var(--text); max-width: 980px; }
.pairs-line b { color: var(--ink); }
.pairs-line a { color: var(--accent); text-decoration: none; font-family: var(--mono); font-size: 13px; }
.pairs-line a:hover { text-decoration: underline; }
tr.notes-row li .key { vertical-align: -1px; }
.why-cache .why-sum { margin: 10px 0 0; font-size: 14px; color: var(--text); padding: 8px 12px; border-radius: 6px; background: var(--card-2); }
.why-cache .why-sum b { color: var(--ink); }
.chart .pairline { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: .7; pointer-events: none; }
.pairlink > span { display: inline-flex; align-items: center; gap: 6px; }
.cellnote { margin: 10px 0 0; padding: 8px 12px; border-radius: 6px; font-size: 13.5px; line-height: 1.55; border-left: 3px solid var(--line); background: var(--card-2); color: var(--text); }
.cellnote.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.cellnote.ok { border-left-color: var(--ok); background: var(--ok-bg); }
.cellnote b { color: var(--ink); margin-right: 4px; }
.cellnote .cn-v { font-weight: 600; color: var(--ink); }
.cellnote .cn-v:not(:empty)::after { content: ' — '; font-weight: 400; color: var(--muted); }
.cellnote .cn-n { overflow-wrap: anywhere; }
.rq-na { border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px; background: var(--card-2); font-size: 14px; color: var(--text); }
.rq-na b { color: var(--ink); }
.rq-na p { margin: 4px 0 8px; font-size: 13.5px; color: var(--muted); }

/* ---------- round 3: hero links, follow-ups ---------- */
.run-card a, .caveat a.jump, .ep-head .sub a.r2link { color: var(--accent); text-decoration: none; }
.run-card a:hover, .caveat a.jump:hover, .ep-head .sub a.r2link:hover { text-decoration: underline; }
.caveat a.jump { font-weight: 600; white-space: nowrap; }
.fu-card > h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.fu-card > h3 code { font-size: 14.5px; }
.fu-card > h3 small { flex-basis: 100%; margin: 2px 0 0; font-size: 12.5px; overflow-wrap: anywhere; }
.fu-card > h3 small code { font-size: 12px; }
.fu-head { margin: 0 0 4px; font-size: 16px; color: var(--ink); }
.fu-head b { font-weight: 600; }
.fu-tally { margin: 0 0 12px; font-size: 13.5px; color: var(--text); }
.fu-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.futbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.futbl th, .futbl td { padding: 6px 5px; border-bottom: 1px solid var(--line-2); text-align: center; vertical-align: middle; }
.futbl thead th { font-size: 12.5px; color: var(--muted); font-weight: 500; background: var(--card-2); }
.futbl thead th:first-child { text-align: left; }
.futbl th.fu-who { text-align: left; font-weight: 500; color: var(--ink); max-width: 9.5em; }
.futbl .fu-nm { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.futbl th.fu-who small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; line-height: 1.35; }
.futbl th.fu-who small.fu-tot { color: var(--text); margin-top: 2px; white-space: nowrap; }
.futbl tr.fu-new th, .futbl tr.fu-new td { background: color-mix(in srgb, var(--accent-bg) 60%, transparent); }
.futbl .cellx { margin: 0 auto; max-width: 110px; }
.cellx .fm { font-size: 11.5px; color: var(--text); white-space: nowrap; margin-top: 1px; }
.fu-cap { margin: 6px 0 0; }
.fu-nh { margin: 0 0 6px; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.fu-notes { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.fu-notes li { margin: 0 0 8px; }
.fu-notes li .key { vertical-align: -1px; }
.fu-notes a { color: var(--accent); text-decoration: none; font-family: var(--mono); font-size: 12.5px; }
.fu-notes a:hover { text-decoration: underline; }
.fu-notes .v-ok { color: var(--ok); font-weight: 600; }
.fu-notes .v-bad { color: var(--bad); font-weight: 600; }
.fu-notes .fu-en { display: block; color: var(--muted); overflow-wrap: anywhere; }
.fu-next { margin: 14px 0 0; font-size: 14px; color: var(--text); padding: 8px 12px; border-radius: 6px; background: var(--card-2); border-left: 3px solid var(--warn); }
.fu-next b { color: var(--ink); }
.fu-next a { color: var(--accent); text-decoration: none; font-family: var(--mono); font-size: 13px; }
.fu-next a:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .fu-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .fu-head { font-size: 15px; }
  .futbl th, .futbl td { padding: 5px 3px; }
  .futbl th.fu-who { max-width: 7.5em; }
  .futbl .cellx { min-width: 58px; }
}
/* the press / imitate rows carry a third chip (the follow-up): wrap two per line */
.tasklist .chips { flex-wrap: wrap; }
.tasklist .chips .hchip { flex: 1 1 calc(50% - 3px); }
@media (max-width: 640px) {
  /* keep the imitate follow-up table (cells carry a first-move line) inside a 390px screen */
  .futbl th.fu-who { max-width: 6.2em; }
  .cellx .fm { white-space: normal; text-align: center; line-height: 1.25; }
  .futbl th.fu-who small.fu-tot { white-space: normal; }
}
