/* PLBench trace viewer — no external dependencies, light/dark via tokens. */

:root {
  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --surface-2: #f0f2f5;
  --border:    #d9dde3;
  --text:      #1c2128;
  --text-dim:  #5c6672;
  --accent:    #2f6feb;

  --ok:      #1a7f4b;
  --fail:    #c0392b;
  --warn:    #b3730b;
  --void:    #6b7280;

  /* personas */
  --f1: #2f6feb;   /* the requester        */
  --f2: #8250df;   /* the glossary         */
  --f3: #6b7280;   /* the refusal          */

  /* tools */
  --t-schema:  #0d7c8a;
  --t-rows:    #0f766e;
  --t-ask:     #2f6feb;
  --t-compile: #9a5b00;
  --t-scratch: #7a3fb5;
  --t-submit:  #1a7f4b;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --radius: 8px;
}

:root[data-theme="dark"],
:root:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0f1115;
    --surface:   #171a21;
    --surface-2: #1e222b;
    --border:    #2c313c;
    --text:      #e3e6eb;
    --text-dim:  #98a0ad;
    --accent:    #6ea0ff;
    --ok:   #4cc38a; --fail: #ff7b72; --warn: #e3b341; --void: #98a0ad;
    --f1:   #6ea0ff; --f2:   #b283f7; --f3:   #98a0ad;
    --t-schema:#4ec5d4; --t-rows:#3bbba4; --t-ask:#6ea0ff;
    --t-compile:#e0a458; --t-scratch:#b283f7; --t-submit:#4cc38a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:        #0f1115;
  --surface:   #171a21;
  --surface-2: #1e222b;
  --border:    #2c313c;
  --text:      #e3e6eb;
  --text-dim:  #98a0ad;
  --accent:    #6ea0ff;
  --ok:   #4cc38a; --fail: #ff7b72; --warn: #e3b341; --void: #98a0ad;
  --f1:   #6ea0ff; --f2:   #b283f7; --f3:   #98a0ad;
  --t-schema:#4ec5d4; --t-rows:#3bbba4; --t-ask:#6ea0ff;
  --t-compile:#e0a458; --t-scratch:#b283f7; --t-submit:#4cc38a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* `hidden` must win over the display rules below: `.empty { display: flex }` and
   `.layout { display: grid }` are more specific than the UA's [hidden] rule, so the
   empty-state card kept rendering under a loaded episode. */
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 var(--sans);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-dim); }
.small { font-size: 12px; }

/* ── top bar ─────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: .1px; }
.topbar h1 .sep { color: var(--text-dim); font-weight: 400; margin: 0 6px; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; }
.back { font-size: 13px; color: var(--text-dim); }

.btn {
  display: inline-block; padding: 5px 11px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); color: var(--text);
  font: 500 12.5px var(--sans); cursor: pointer;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { border-color: var(--accent); color: var(--accent); }

/* ── banners ─────────────────────────────────────────────────────── */
.banner {
  padding: 9px 18px; font-size: 13px; border-bottom: 1px solid var(--border);
}
.banner-void { background: color-mix(in srgb, var(--fail) 12%, var(--surface)); }
.banner-info { background: var(--surface-2); color: var(--text-dim); }
/* The `?src=` back door.  Deliberately loud: a page built by parsing a transcript in
   the browser is not the product, and a reader must not mistake it for one. */
.banner-debug {
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  border-left: 3px solid var(--warn);
}

/* ── metric strip ────────────────────────────────────────────────── */
.metrics {
  display: flex; flex-wrap: wrap; gap: 26px; align-items: flex-start;
  padding: 14px 18px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.metric { min-width: 76px; }
.metric .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.metric .v { font-size: 20px; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; }
.metric .v small { font-size: 12px; font-weight: 400; color: var(--text-dim); }
.v-ok { color: var(--ok); } .v-fail { color: var(--fail); }

.stack { display: flex; height: 7px; width: 168px; border-radius: 4px; overflow: hidden;
         background: var(--surface-2); margin-top: 6px; }
.stack i { display: block; height: 100%; }
.stack-legend { display: flex; gap: 10px; font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.stack-legend b { font-weight: 500; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; }

/* ── layout ──────────────────────────────────────────────────────────
 * Three explicitly placed columns.  Two rules matter and both were bugs once:
 *
 *  - every column is min-width:0 (and the flexible one minmax(0,1fr)), because
 *    a grid track's default min-width is auto: one unbreakable string — a
 *    200-character JSONL line — would widen the track and push its neighbour
 *    out of the viewport.
 *  - the columns themselves are NOT sticky.  The sticky box is `.col-inner`
 *    inside a stretched column.  A sticky *grid item* is constrained by its
 *    grid area, and below 1400px the right column spans the full width on the
 *    next row, so the sticky left column slid on top of it at the bottom of
 *    the page.  A sticky *child* of a stretched item is bounded by that item
 *    and cannot leave its own row.
 */
.layout {
  display: grid; grid-template-columns: 306px minmax(0, 1fr) 372px;
  gap: 16px; padding: 16px 18px 60px; align-items: stretch;
}
.col-left  { grid-column: 1; grid-row: 1; }
.col-mid   { grid-column: 2; grid-row: 1; }
.col-right { grid-column: 3; grid-row: 1; }
.col-left, .col-mid, .col-right { min-width: 0; }

.col-inner {
  position: sticky; top: 58px;
  max-height: calc(100vh - 74px);
  overflow-y: auto; overflow-x: hidden;
}

/* two columns: the tab column drops to full width on its own row and stops
   being pinned — at that width it is taller than pinning is worth */
@media (max-width: 1400px) {
  .layout { grid-template-columns: 300px minmax(0, 1fr); }
  .col-right { grid-column: 1 / -1; grid-row: 2; }
  .col-right .col-inner { position: static; max-height: none; overflow: visible; }
}

/* one column: nothing pinned, order is request -> timeline -> tabs */
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-left  { grid-column: 1; grid-row: 1; }
  .col-mid   { grid-column: 1; grid-row: 2; }
  .col-right { grid-column: 1; grid-row: 3; }
  .col-inner { position: static; max-height: none; overflow: visible; }
}

/* ── panels ──────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--border);
         border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.panel-head {
  margin: 0; padding: 9px 12px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim);
  cursor: pointer; user-select: none; display: flex; align-items: center;
  border-bottom: 1px solid transparent;
}
.panel[data-open="true"] .panel-head { border-bottom-color: var(--border); }
.chev { margin-left: auto; }
.chev::before { content: "▸"; }
.panel[data-open="true"] .chev::before { content: "▾"; }
.panel-body { padding: 12px; display: none; }
.panel[data-open="true"] .panel-body { display: block; }
.prose { white-space: pre-wrap; font-size: 13px; }

/* budget bars */
.bar-row { margin-bottom: 9px; }
.bar-row .lbl { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.bar-row .lbl b { font-weight: 500; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar.is-spent i { background: var(--warn); }

/* ── term lifeline (P2) ──────────────────────────────────────────────
 * The chart is inline SVG with no library.  Colour is deliberately not
 * load-bearing: `--ok` and `--fail` sit below the CVD separation floor, so the
 * state is also in the line style (solid / dashed / dotted), the end marker
 * (✓ / ✕ / none) and the legend text.  Greyscale-print safe by construction.
 */
.lifeline { display: block; width: 100%; max-width: 520px; height: auto;
            margin: 2px 0 6px; overflow: visible; }
.life-head { margin-bottom: 8px; color: var(--text-dim); }
.life-head b { color: var(--text); font-variant-numeric: tabular-nums; }

.life-label { font: 600 10.5px var(--mono); fill: var(--text-dim); }
.life-tick  { font: 10px var(--sans); fill: var(--text-dim);
              font-variant-numeric: tabular-nums; }
.life-badge { font: 9.5px var(--sans); fill: var(--text-dim); }

/* Labels stay in muted ink even though the marks are coloured: repeating the state
   in the type makes the panel loud and, since the palette fails CVD separation
   anyway, a coloured label carries no information the glyphs do not. */

.life-row.is-linked { cursor: pointer; }
.life-row:hover .life-hit,
.life-row:focus-visible .life-hit { fill: color-mix(in srgb, var(--accent) 9%, transparent); }
.life-row:focus { outline: none; }
.life-row:focus-visible .life-hit { stroke: var(--accent); stroke-width: 1; }

.life-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px;
               font-size: 11px; color: var(--text-dim); }
.life-key { display: inline-flex; align-items: center; gap: 5px; }
.life-glyph { flex: 0 0 auto; overflow: visible; }
.life-note { margin-top: 8px; font-size: 11px; line-height: 1.45; }

.life-tip {
  position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none;
  max-width: 260px; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); color: var(--text);
  box-shadow: 0 6px 20px rgb(0 0 0 / .16);
  font: 11.5px/1.5 var(--mono); white-space: pre-line;
}

/* compact term list — still used by the Ledger table's row colouring */
.term { display: flex; align-items: baseline; gap: 7px; padding: 5px 0;
        border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.term:last-child { border-bottom: 0; }
.term .surface { font-family: var(--mono); font-weight: 600; overflow: hidden;
                text-overflow: ellipsis; }
.term .trail { margin-left: auto; padding-left: 8px; flex: 0 0 auto; white-space: nowrap;
              color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.term.is-resolved .surface { color: var(--ok); }
.term.is-lost-seen .surface { color: var(--fail); }
.term.is-lost-unseen .surface { color: var(--void); }
.term.is-given .surface { color: var(--text-dim); font-weight: 500; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12px; word-break: break-all;
         overflow-wrap: anywhere; min-width: 0; }

/* ── timeline ────────────────────────────────────────────────────── */
.mid-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.mid-title { font-size: 12px; font-weight: 600; text-transform: uppercase;
             letter-spacing: .06em; color: var(--text-dim); }
.filter { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; }

.card { background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); margin-bottom: 10px; scroll-margin-top: 64px; }
.card.is-target { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.card-head { display: flex; align-items: center; gap: 9px; padding: 9px 12px; flex-wrap: wrap; }
.card-head .turn-no { font: 600 12px var(--mono); color: var(--text-dim); min-width: 30px; }
.card-head .lat { margin-left: auto; font-size: 11.5px; color: var(--text-dim);
                  font-variant-numeric: tabular-nums; }
.card-body { padding: 0 12px 12px; }

.tool {
  font: 600 11.5px var(--mono); padding: 2px 8px; border-radius: 20px;
  color: #fff; white-space: nowrap;
}
.tool-get_schema, .tool-describe_table { background: var(--t-schema); }
.tool-sample_rows                      { background: var(--t-rows); }
.tool-ask_user                         { background: var(--t-ask); }
.tool-compile_plsql                    { background: var(--t-compile); }
.tool-execute_scratch, .tool-reset_scratch { background: var(--t-scratch); }
.tool-submit                           { background: var(--t-submit); }
.tool-unknown                          { background: var(--void); }

.pill { font: 500 11px var(--sans); padding: 2px 7px; border-radius: 20px;
        border: 1px solid var(--border); color: var(--text-dim); white-space: nowrap; }
.pill-ok   { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.pill-fail { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 45%, var(--border)); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.pill-f1 { color: var(--f1); border-color: color-mix(in srgb, var(--f1) 45%, var(--border)); }
.pill-f2 { color: var(--f2); border-color: color-mix(in srgb, var(--f2) 45%, var(--border)); }
.pill-f3 { color: var(--f3); border-color: color-mix(in srgb, var(--f3) 45%, var(--border)); }

.field { margin-top: 10px; }
.field > .field-k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
                    color: var(--text-dim); margin-bottom: 4px; }

pre.block {
  margin: 0; padding: 9px 11px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px;
  overflow-x: auto; white-space: pre; line-height: 1.5;
}
pre.block.wrap { white-space: pre-wrap; word-break: break-word;
                 overflow-wrap: anywhere; }
.clip { position: relative; max-height: 15.5em; overflow: hidden; }
.clip::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3em;
               background: linear-gradient(transparent, var(--surface-2)); }
.toggle { margin-top: 5px; font: 500 12px var(--sans); color: var(--accent);
          background: none; border: 0; padding: 0; cursor: pointer; }

/* ask_user sub-blocks */
.part { border-left: 3px solid var(--border); padding: 2px 0 2px 11px; margin-top: 10px; }
.part-f1 { border-left-color: var(--f1); }
.part-f2 { border-left-color: var(--f2); }
.part-f3 { border-left-color: var(--f3); }
.part-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 5px; }
.part-text { white-space: pre-wrap; font-size: 13px; }
.chip { font: 500 11px var(--mono); padding: 1px 6px; border-radius: 4px;
        background: var(--surface-2); color: var(--text-dim); }

.issues { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.issue { font-size: 11.5px; padding: 3px 8px; border-radius: 5px; background: var(--surface-2); }
.issue-fatal { color: var(--fail); background: color-mix(in srgb, var(--fail) 12%, var(--surface-2)); }
.issue-risk  { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface-2)); }
.issue-g10   { color: var(--accent); }

.event { display: flex; gap: 9px; align-items: center; padding: 6px 12px; margin-bottom: 10px;
         border: 1px dashed var(--border); border-radius: 6px; font-size: 12.5px;
         color: var(--text-dim); background: var(--surface); }

/* tables */
table.grid { border-collapse: collapse; width: 100%; font-size: 12px; }
table.grid th, table.grid td { border: 1px solid var(--border); padding: 4px 7px;
                               text-align: left; white-space: nowrap; }
table.grid th { background: var(--surface-2); font-weight: 600; }
.scroll-x { overflow-x: auto; }

/* ── right tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.tab { padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px;
       background: var(--surface); color: var(--text-dim);
       font: 500 12.5px var(--sans); cursor: pointer; }
.tab.is-active { color: var(--text); border-color: var(--accent); background: var(--surface-2); }
.tab-body { background: var(--surface); border: 1px solid var(--border);
            border-radius: var(--radius); padding: 12px; }

/* ── empty state ─────────────────────────────────────────────────── */
.empty { display: flex; justify-content: center; padding: 60px 18px; }
.empty-card { max-width: 640px; width: 100%; background: var(--surface);
              border: 1px dashed var(--border); border-radius: 12px; padding: 28px 30px; }
.empty-card.is-over { border-color: var(--accent); background: var(--surface-2); }
.empty-card h2 { margin: 0 0 8px; font-size: 17px; }
.empty-card ul { padding-left: 18px; }
.empty-card li { margin: 5px 0; }
.drop-hint { color: var(--text-dim); }

/* ── PL/SQL highlighting ─────────────────────────────────────────── */
.sql-kw  { color: var(--f2); font-weight: 600; }
.sql-str { color: var(--ok); }
.sql-num { color: var(--t-compile); }
.sql-com { color: var(--text-dim); font-style: italic; }

/* inline argument chips for the small tools */
.args { display: flex; flex-wrap: wrap; gap: 6px; }
.arg { font: 500 12px var(--mono); padding: 2px 8px; border-radius: 5px;
       background: var(--surface-2); border: 1px solid var(--border); }
.arg b { color: var(--text-dim); font-weight: 500; }

/* clipped prose inside an ask part sits on the card background, not the code one */
.part-text.clip::after { background: linear-gradient(transparent, var(--surface)); }


/* ── run index (P4) ──────────────────────────────────────────────────
 * Shares every token with run.html so the two pages read as one product.
 * The status colours here are the same ones the lifeline uses and carry the same
 * caveat: EX pass/fail always ships with a ✓/✗ glyph and the word, never colour alone.
 */
.index-main { padding: 16px 18px 60px; max-width: 1500px; margin: 0 auto; }

.banner-synthetic {
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
  border-left: 4px solid var(--warn); color: var(--text);
}

.runbar { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px;
          font-size: 12px; }
.runbit { display: inline-flex; align-items: baseline; gap: 6px; }
.runbit .k { color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em;
             font-size: 10.5px; }
.runbit .v { font-family: var(--mono); font-size: 11.5px; }
.runbit.warn .k, .runbit.warn .v { color: var(--warn); }

.cards { display: grid; gap: 12px; margin-bottom: 14px;
         grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card-stat { background: var(--surface); border: 1px solid var(--border);
             border-radius: var(--radius); padding: 11px 13px; }
.card-stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
                color: var(--text-dim); }
.card-stat .v { font-size: 23px; font-weight: 600; line-height: 1.25; margin-top: 2px; }
.card-stat .n { margin-top: 2px; }
.cards-note { grid-column: 1 / -1; margin-top: -4px; }

#variants { display: flex; flex-wrap: wrap; gap: 10px; }
.vstat { border: 1px solid var(--border); border-radius: var(--radius);
         padding: 8px 12px; min-width: 190px; }
.vhead { font-size: 12.5px; }
.vbody { display: flex; gap: 12px; margin-top: 3px; font-size: 12px;
         color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* one filter row above everything it scopes */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
           margin: 14px 0 10px; padding: 10px 12px; background: var(--surface);
           border: 1px solid var(--border); border-radius: var(--radius); }
.filter-group { display: inline-flex; border: 1px solid var(--border);
                border-radius: 6px; overflow: hidden; }
.seg { border: 0; background: var(--surface); color: var(--text-dim);
       font: 500 12.5px var(--sans); padding: 5px 12px; cursor: pointer; }
.seg.is-active { background: var(--accent); color: #fff; }
.filters .f { font-size: 12px; color: var(--text-dim); display: inline-flex;
              align-items: center; gap: 5px; }
.filters select, .filters input {
  font: 12.5px var(--sans); padding: 4px 7px; border: 1px solid var(--border);
  border-radius: 5px; background: var(--surface); color: var(--text); }
.filters .showing { margin-left: auto; }

.index-table { width: 100%; }
.index-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.index-table th.is-sorted { color: var(--accent); }
.index-table th.n, .index-table td.n { text-align: right;
                                       font-variant-numeric: tabular-nums; }
.index-table tr.is-void { background: color-mix(in srgb, var(--fail) 5%, transparent); }
.taskcell code { font-size: 11.5px; }

.verdict { font-weight: 600; white-space: nowrap; font-size: 12px; }
.verdict.v-ok { color: var(--ok); }
.verdict.v-fail { color: var(--fail); }

.vcell { min-width: 130px; vertical-align: top; }
.vcell.is-void { background: color-mix(in srgb, var(--fail) 7%, transparent); }
.vcell.is-missing, .vcell.is-dup { background: var(--surface-2); }
.vlink { display: flex; flex-direction: column; gap: 1px; padding: 2px 0;
         color: inherit; }
.vlink:hover { text-decoration: none; }
.vlink:hover .vscore { text-decoration: underline; }
.vscore { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.chiprow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.chip-void { color: var(--fail);
             border-color: color-mix(in srgb, var(--fail) 45%, var(--border)); }

.cutcell { font-variant-numeric: tabular-nums; }
.cutbar { display: block; height: 4px; margin-top: 3px; border-radius: 2px;
          background: var(--surface-2); overflow: hidden; }
.cutbar i { display: block; height: 100%; background: var(--ok); }

.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* Phone. The single-file bundle gets opened on one more often than not -- someone is
   handed the file in a chat and taps it -- and at 390px the default grid puts one stat
   card per screen, so the table everything else is about is three scrolls down. */
@media (max-width: 600px) {
  .index-main { padding: 12px 12px 44px; }
  .topbar { padding: 9px 12px; gap: 10px; }
  .topbar h1 { font-size: 13.5px; }
  #btn-index { display: none; }           /* a download link does nothing useful here */
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-stat { padding: 9px 10px; }
  .card-stat .v { font-size: 18px; }
  .card-stat .k { font-size: 10px; }
  .runbar { gap: 3px 12px; font-size: 11px; margin-bottom: 10px; }
  .runbit .v { font-size: 10.5px; word-break: break-all; }
  .filters { gap: 6px 10px; padding: 8px 9px; }
  .filters .showing { margin-left: 0; width: 100%; }
  .vstat { min-width: 0; flex: 1 1 100%; }
  .life-tip { max-width: min(260px, calc(100vw - 24px)); }
}

/* ── ProcArena results page (paper mirror) ───────────────────────────
 * index.html + stats.js.  Shares every token with the trace viewer.
 */

/* the brand mark: same gradient as the hero title, usable in any bar */
.brand {
  background: linear-gradient(100deg, var(--text) 30%, var(--accent) 75%, var(--f2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800; letter-spacing: -.6px;
}
.topbar h1.brand { font-size: 16.5px; }
.back .brand { font-size: 13.5px; }

/* topbar anchor nav */
.topnav { display: flex; gap: 18px; margin-left: 10px; }
.topnav a { font-size: 12.5px; font-weight: 500; color: var(--text-dim); }
.topnav a:hover { color: var(--text); text-decoration: none; }

/* hero — big, centred, quiet. Type does the work; one gradient accent on the title. */
.hero { padding: 64px 0 34px; max-width: 860px; margin: 0 auto; text-align: center; }
.hero-kicker {
  margin: 0 0 18px; font: 600 11.5px var(--mono);
  text-transform: uppercase; letter-spacing: .14em; color: var(--text-dim);
  display: inline-block; padding: 5px 14px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface);
}
.hero-title {
  margin: 0; font-size: clamp(44px, 8vw, 64px); font-weight: 800;
  letter-spacing: -2.5px; line-height: 1.05;
  background: linear-gradient(100deg, var(--text) 30%, var(--accent) 75%, var(--f2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  margin: 12px 0 0; font-size: clamp(16px, 2.6vw, 19px); font-weight: 500;
  color: var(--text-dim); letter-spacing: -.2px;
}
.hero-blurb {
  margin: 20px auto 0; max-width: 680px; font-size: 14px; line-height: 1.75;
  color: var(--text); text-align: center;
}
.hero-blurb b { font-weight: 600; }
.hero-btns { display: flex; gap: 12px; margin: 28px 0 0; justify-content: center;
             flex-wrap: wrap; }
.btn-hero {
  display: inline-block; padding: 10px 26px; border-radius: 9px;
  font: 600 13.5px var(--sans); letter-spacing: .1px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-hero:hover { text-decoration: none; transform: translateY(-1px);
                  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-hero-ghost { background: var(--surface); color: var(--text);
                  border-color: var(--border); }
.btn-hero-ghost:hover { box-shadow: 0 6px 18px rgb(0 0 0 / .08); }
.btn-hero.is-soon, .btn.is-soon { opacity: .55; cursor: not-allowed; }
.btn-hero.is-soon:hover { transform: none; box-shadow: none; }

/* leaderboard — one measure, one hue, sorted; labels in ink, never in the bar */
.lb { display: grid; gap: 9px; max-width: 760px; }
.lb-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) 118px;
  gap: 12px; align-items: center;
}
.lb-label { font-size: 13px; font-weight: 500; text-align: right;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-track { height: 16px; background: var(--surface-2); border-radius: 4px;
            overflow: hidden; }
.lb-fill { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0;
           background: linear-gradient(90deg,
             color-mix(in srgb, var(--accent) 78%, var(--surface)), var(--accent)); }
.lb-val { font: 600 13px var(--sans); font-variant-numeric: tabular-nums;
          display: flex; align-items: baseline; gap: 7px; }
.lb-n { font: 400 11px var(--mono); color: var(--text-dim); }

/* dialect switch above the EX matrices */
.table-tools { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.table-tools .f { font-size: 12px; color: var(--text-dim); }

.paper-block { margin: 34px 0; }
.paper-block h3 { font-size: 17px; font-weight: 700; letter-spacing: -.2px;
                  margin: 0 0 4px; display: flex; align-items: baseline;
                  gap: 9px; flex-wrap: wrap; }
.tag { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .07em;
       color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
       border-radius: 4px; padding: 2px 7px; white-space: nowrap; }

.ptable { background: var(--surface); }
.ptable th { position: sticky; }
.ptable th, .ptable td { font-variant-numeric: tabular-nums; }
.ctable th.gsep, .ctable td.gsep { border-left: 2px solid var(--text-dim); }

.excell { min-width: 52px; text-align: center; }
.ptable th.ovcell, .ptable td.ovcell { border-left: 2px solid var(--text-dim); }
td.ovcell b { font-size: 13px; }
.ctable tbody tr:hover th { color: var(--accent); }
.excell.is-missing { background: var(--surface-2); color: var(--text-dim); font-size: 10.5px; }
.excell.is-all  { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.excell.is-none { background: color-mix(in srgb, var(--fail) 8%, var(--surface)); }
.exlink { display: block; padding: 2px 4px; color: inherit; }
.exlink:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 12%, transparent);
                border-radius: 4px; }
.exlink b { font-size: 13px; }
.pending-row td { background: var(--surface-2); text-align: center; }

/* figures */
.fig { margin-top: 12px; background: var(--surface); border: 1px solid var(--border);
       border-radius: var(--radius); padding: 14px; }
.fig-legend { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 10px;
              font-size: 11.5px; color: var(--text-dim); }
.fig-key { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px;
          background: var(--void); }

/* retention-vs-turns scatter (paper Fig. 2) */
.scatter { display: block; width: 100%; max-width: 780px; height: auto;
           margin: 0 auto; }
.sc-grid { stroke: var(--border); stroke-width: 1; }
.sc-median { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 4 4;
             opacity: .55; }
.sc-tick { font: 10.5px var(--mono); fill: var(--text-dim); }
.sc-axis { font: 500 11.5px var(--sans); fill: var(--text-dim); }
.sc-hint { font: italic 11px var(--sans); fill: var(--text-dim); opacity: .85; }
.sc-pt circle { stroke: var(--surface); stroke-width: 1.5; opacity: .92; }
.sc-closed circle { fill: var(--accent); }
.sc-open circle { fill: color-mix(in srgb, var(--accent) 42%, var(--surface));
                  stroke: var(--accent); stroke-width: 1.2; }
.sc-label { font: 11px var(--sans); fill: var(--text); paint-order: stroke;
            stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.sw-closed { background: var(--accent); }
.sw-open { background: color-mix(in srgb, var(--accent) 42%, var(--surface));
           box-shadow: inset 0 0 0 1.5px var(--accent); }

/* heatmaps (action distribution, failure attribution) */
.hm { display: grid; gap: 3px; min-width: 620px; margin-bottom: 14px; }
.hm-head { font: 600 10px var(--mono); text-transform: uppercase;
           letter-spacing: .05em; color: var(--text-dim); padding: 2px 6px 4px;
           align-self: end; }
.hm-col { text-align: center; }
.hm-label { display: flex; align-items: center; justify-content: flex-end;
            padding: 0 10px 0 0; font-size: 12.5px; font-weight: 500;
            white-space: nowrap; }
.hm-cell { display: flex; align-items: center; justify-content: center;
           min-height: 32px; border-radius: 5px;
           font: 600 11px var(--mono); color: var(--text); }
.hm-dark { color: #fff; }
.hm-exbar { display: flex; align-items: center; gap: 8px; padding-left: 12px; }
.hm-exbar i { display: block; height: 10px; max-width: calc(100% - 44px);
              background: var(--ok); border-radius: 3px; }
.hm-exbar span { font: 600 11.5px var(--mono); color: var(--text-dim); }
.hm-note { display: flex; align-items: center; padding-left: 12px;
           font: 11.5px var(--mono); color: var(--text-dim); }

@media (max-width: 600px) {
  .hero { padding-top: 30px; }
  .topnav { display: none; }
  .lb-row { grid-template-columns: 96px minmax(0, 1fr) 92px; gap: 8px; }
  .lb-label { font-size: 11.5px; }
  .lb-val { font-size: 11.5px; gap: 4px; }
}

/* ── v7: the merged Table 6 + paper figures ───────────────────────── */

.t6 th.t6-group { font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim); border-bottom: none; padding-bottom: 2px; }
.t6 tbody tr.t6-block th { text-align: left; background: var(--surface-2);
  font-size: 12.5px; letter-spacing: .02em; padding: 8px 10px;
  border-top: 2px solid var(--text-dim); }
.t6 td.excell u { text-decoration: underline; text-underline-offset: 2px; }
.t6 td.excell b { font-weight: 800; }

.paperfig { margin: 12px 0 0; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; padding: 14px; }
.paperfig img { display: block; width: 100%; height: auto; }

.chip-spent { margin-left: auto; color: var(--text-dim); font-weight: 600; }

/* ── v9: overview, filterable leaderboard, colored-number results ── */

.figcap { margin: 10px 2px 0; font-size: 12px; color: var(--text-dim);
  line-height: 1.55; }

/* shared hover tooltip */
.viztip { position: absolute; z-index: 60; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 9px 12px;
  border-radius: 8px; font-size: 13px; line-height: 1.55;
  box-shadow: 0 6px 20px rgb(0 0 0 / .25); max-width: 300px; }
.viztip i { opacity: .72; font-style: normal; font-size: 12px; }

/* leaderboard — one thick bar per model, filterable, animated re-rank */
.lbwrap { padding: 18px 24px 16px; }
.lb3-head { display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; margin-bottom: 16px; position: relative; }
.lb3-filter { font-size: 13px; color: var(--text-dim); }
.lb3-gear { font-size: 16px; line-height: 1; padding: 6px 10px; }
.lb3 { position: relative; }
.lb3-grid { position: absolute; inset: 0 0 0 190px; pointer-events: none; }
.lb3-gridline { position: absolute; top: 0; bottom: 24px; width: 1px;
  background: var(--border); }
.lb3-gridline b { position: absolute; bottom: -20px; left: 50%;
  transform: translateX(-50%); font-weight: 500; font-size: 12px;
  color: var(--text-dim); }
.lb3-row { position: absolute; left: 0; right: 0; height: 64px;
  display: grid; grid-template-columns: 190px 1fr; align-items: center;
  transition: transform .55s cubic-bezier(.4,.1,.2,1); will-change: transform; }
.lb3-row.no-anim { transition: none; }
.lb3-name { font-size: 17px; font-weight: 700; padding-right: 18px;
  white-space: nowrap; }
.lb3-track { position: relative; height: 40px; }
.lb3-bar { display: flex; align-items: center; height: 100%;
  transition: transform .18s ease; transform-origin: left center; }
.lb3-bar i { display: block; height: 100%; border-radius: 0 8px 8px 0;
  min-width: 2px; transition: width .55s cubic-bezier(.4,.1,.2,1),
  background .2s; }
.lb3-row.no-anim .lb3-bar i { transition: none; }
.lb3-val { margin-left: 12px; font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.lb3-row:hover .lb3-bar { transform: scale(1.03); }
.lb3-row:hover .lb3-name { color: var(--accent); }

/* gear popover */
.lb3-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 34px rgb(0 0 0 / .18);
  padding: 14px 16px; min-width: 320px; }
.lb3-pop-group { margin-bottom: 12px; }
.lb3-pop-group .filter-group { flex-wrap: wrap; }
.lb3-pop-label { font-size: 11.5px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.lb3-pop-foot { display: flex; justify-content: flex-end; margin-top: 4px; }
.lb3-apply { font-weight: 600; }
.lb3-pop-hint { font-size: 12px; color: var(--fail); margin-bottom: 6px; }

/* results table — plain cells, score-colored numbers */
.t6 { width: 100%; border-collapse: separate; border-spacing: 2px;
  background: transparent; }
.t6 thead th { font-size: 13px; font-weight: 600; color: var(--text-dim);
  padding: 8px 6px; text-align: center; background: transparent; border: none; }
.t6 thead th:first-child { text-align: left; }
.t6 tbody th { font-size: 15px; font-weight: 700; text-align: left;
  padding: 10px 12px 10px 2px; white-space: nowrap; background: transparent;
  border: none; }
.t6 td.excell { min-width: 62px; height: 46px; text-align: center;
  font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  border-radius: 7px; border: none; padding: 0; background: var(--surface); }
.t6 td.excell a { display: flex; width: 100%; height: 100%;
  align-items: center; justify-content: center; text-decoration: none; }
.t6 td.excell a:hover { text-decoration: underline; text-underline-offset: 3px; }
.t6 td.excell.is-missing { color: var(--text-dim); font-size: 11px;
  font-weight: 500; background: var(--surface-2); }
.t6 td.ovcell { outline: 2px solid color-mix(in srgb, var(--text) 20%, transparent);
  outline-offset: -2px; font-weight: 800; }
.t6 th.ovcell { color: var(--text); }
.tools-cond { font-size: 12px; color: var(--text-dim); margin-left: auto;
  align-self: center; }
.rampbar { display: flex; align-items: center; gap: 10px; margin: 14px 2px 0; }
.rampbar i { flex: 0 1 260px; height: 10px; border-radius: 5px; display: block; }
.rampbar-lab { font-size: 11.5px; color: var(--text-dim); }

/* ── v10: bigger type, rebuilt Figure-1 overview, calm bars ───────── */

.paper-block h3 { font-size: 40px; font-weight: 800; letter-spacing: -0.6px;
  line-height: 1.15; margin: 0 0 20px; }
.topbar { min-height: 66px; }
.brand { font-size: 24px; }
.topnav { gap: 26px; }
.topnav a { font-size: 16px; font-weight: 600; }
.hero-sub { font-size: 21px; line-height: 1.5; }
.hero-kicker { font-size: 13.5px; }

/* leaderboard bars: quiet by default, saturate on hover */
:root { --lb-bar: #a9cdf5; --lb-bar-hover: #2a78d6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --lb-bar: #25578f; --lb-bar-hover: #3987e5; }
}
:root[data-theme="dark"] { --lb-bar: #25578f; --lb-bar-hover: #3987e5; }
.lb3-bar i { background: var(--lb-bar) !important; }
.lb3-row:hover .lb3-bar i { background: var(--lb-bar-hover) !important; }

/* the rebuilt Figure 1 */
.ov { display: flex; flex-direction: column; gap: 18px; }
.ov-scen { display: grid;
  grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: center; }
.ov-group { border: 2px solid #3d9950; border-radius: 16px; padding: 16px 18px;
  background: color-mix(in srgb, #3d9950 5%, var(--surface)); }
.ov-group-name { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.ov-group-name span { font-weight: 600; color: var(--text-dim); font-size: 16px; }
.ov-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ov-chip { border: 1.5px solid #3d9950; border-radius: 10px; padding: 7px 12px;
  font-size: 14.5px; font-weight: 600; background: var(--surface); }
.ov-person { font-size: 58px; padding: 0 10px; align-self: center; }

.ov-modes { display: grid; grid-template-columns: 2fr 3fr; gap: 16px;
  align-items: start; }
@media (max-width: 980px) { .ov-modes { grid-template-columns: 1fr; }
  .ov-scen { grid-template-columns: 1fr; } }
.ov-panel { border-radius: 16px; padding: 18px 20px; }
.ov-direct { border: 2px solid #3457c4;
  background: color-mix(in srgb, #3457c4 4%, var(--surface)); }
.ov-inter { border: 2px solid #e2711d;
  background: color-mix(in srgb, #e2711d 4%, var(--surface)); }
.ov-panel-head { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.ov-direct .ov-panel-head { color: #3457c4; }
.ov-inter .ov-panel-head { color: #cf5f0e; }
:root[data-theme="dark"] .ov-direct .ov-panel-head { color: #7ea4f2; }
:root[data-theme="dark"] .ov-inter .ov-panel-head { color: #f09a52; }
.ov-panel-tag { font-size: 12.5px; font-style: italic; font-weight: 600;
  color: var(--text-dim); margin-left: 8px; }
.ov-step { font-size: 15.5px; font-weight: 700; margin: 12px 0 8px;
  display: flex; align-items: center; gap: 8px; }
.ov-num { display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--text);
  color: var(--bg); font-size: 13px; font-weight: 700; font-style: normal; }
.ov-under { font-weight: 600; color: #cf5f0e; font-size: 13px; }
.ov-req { border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--surface); padding: 12px 14px; font-size: 14px;
  line-height: 1.6; font-style: italic; color: var(--text); }
.ov-arrow { display: flex; align-items: center; gap: 8px; margin: 14px 0;
  font-size: 15px; }
.ov-arr { font-size: 22px; font-weight: 800; }
.ov-code { background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 14px; font-family: "JetBrains Mono", ui-monospace,
  monospace; font-size: 12px; line-height: 1.55; overflow-x: auto; margin: 0; }
.ov-tagline { margin-top: 14px; text-align: center; font-size: 15px;
  font-weight: 700; font-style: italic; border-top: 1.5px solid var(--border);
  padding-top: 12px; }
.ov-turns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .ov-turns { grid-template-columns: 1fr; } }
.ov-turn { border: 1.5px dashed color-mix(in srgb, #e2711d 45%, var(--border));
  border-radius: 12px; padding: 10px 12px; }
.ov-turn-head { font-size: 13.5px; font-weight: 800; margin-bottom: 8px; }
.ov-turn-head code { font-weight: 600; color: #c2403c; font-size: 12.5px; }
.ov-bubble { border-radius: 9px; padding: 8px 11px; font-size: 13px;
  line-height: 1.55; margin-top: 6px; }
.ov-call { border: 1.5px solid color-mix(in srgb, #c2403c 55%, var(--border));
  background: var(--surface); }
.ov-result { background: var(--surface-2); border: 1.5px solid var(--border); }
.ov-reply { border: 1.5px solid color-mix(in srgb, #e2711d 60%, var(--border));
  background: color-mix(in srgb, #e2711d 6%, var(--surface)); }
.ov-bubble .mono { font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; }
.ov-options { margin: 8px 0 0 0; padding-left: 20px; }
.ov-options li { margin: 3px 0; }
.ov-options li.is-chosen { font-weight: 700; }
.ov-options li.is-chosen::after { content: " ✓"; color: #2e8b46; }
.ov-intro { margin-top: 22px; font-size: 16.5px; line-height: 1.8;
  color: var(--text); }

/* SQL keyword tint inside the rebuilt figure's code blocks */
.ov-code .sql-kw { color: #7f3fbf; font-weight: 600; }
:root[data-theme="dark"] .ov-code .sql-kw { color: #c193ee; }

/* ── v11: Figure 1 stacked vertically, original artwork ───────────── */

.ov-modes { grid-template-columns: 1fr; }
.ov-person { width: 240px; max-width: 30vw; height: auto; align-self: center;
  border-radius: 14px; }
.ov-ci { width: 20px; height: 20px; vertical-align: -4px; margin-right: 7px; }
.ov-ic { width: 26px; height: 26px; vertical-align: middle; }
.ov-bubble .ov-ic { width: 20px; height: 20px; vertical-align: -4px;
  margin-right: 4px; }
.ov-step .ov-ic { margin-left: 6px; }
.ov-flow { display: grid; grid-template-columns: 1.1fr auto 1.3fr; gap: 18px;
  align-items: center; }
@media (max-width: 900px) { .ov-flow { grid-template-columns: 1fr; } }
.ov-arrow-mid { margin: 0; flex-direction: column; text-align: center;
  display: flex; align-items: center; gap: 4px; }
.ov-arrow-mid .ov-arr { font-size: 30px; }
.ov-turns { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1200px) { .ov-turns { grid-template-columns: repeat(4, 1fr); } }
.ov-code-mini { max-width: 720px; }
.ov-inter .ov-arrow { justify-content: center; }
.ov-inter .ov-code-mini { margin: 0 auto; }
.ov-inter .ov-step { justify-content: flex-start; }

/* ── v12: Figure 1 as the provided artwork, blended into the page ── */
.ov-figure { margin: 4px auto 0; max-width: 1080px; }
.ov-figure img { display: block; width: 100%; height: auto; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ov-figure { background: #fbfbf9;
    border-radius: 18px; padding: 22px 24px; }
}
:root[data-theme="dark"] .ov-figure { background: #fbfbf9;
  border-radius: 18px; padding: 22px 24px; }

/* ── v14: analysis charts as lieflat cards, full content width, page-sized type ── */
.index-main { max-width: 1600px; }
.pc-intro { margin: -6px 0 0; font-size: 14px; color: var(--text); }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 22px 0 0; }
.pc-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px 28px 18px; min-width: 0;
  display: flex; flex-direction: column; }
.pc-card.wide { grid-column: 1 / -1; }
.pc-card h2 { font-size: 21px; font-weight: 700; letter-spacing: -.02em;
  line-height: 1.3; margin: 0 0 6px; color: var(--text); }
.pc-card .sub { font-size: 14px; line-height: 1.5; color: var(--text); opacity: .82; margin: 0 0 16px; }
.pc-card .sub code { font-size: 13px; }
.pc-card svg { display: block; width: 100%; height: auto; margin: auto 0; }
.pc-card svg text { font-family: var(--sans); }
.pc-card .src { font-size: 11.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-dim); margin-top: 14px; }
.pc-paperfig { margin: auto 0; background: #fff; border-radius: 8px; padding: 10px 12px; }
.pc-paperfig img { display: block; width: 100%; height: auto; }
.pc-card.wide .pc-paperfig { max-width: 1300px; margin: auto; width: 100%; }
@media (max-width: 1000px) { .pc-grid { grid-template-columns: 1fr; } }

/* lieflat reveal animations */
.pc-card .pop { transform-box: fill-box; transform-origin: center;
  animation: pc-pop .5s cubic-bezier(.2,.7,.3,1.3) both; }
@keyframes pc-pop { from { transform: scale(0); } to { transform: none; } }
.pc-card .fade { animation: pc-fade .9s ease both; }
@keyframes pc-fade { from { opacity: 0; } }
.pc-card .draw { stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: pc-draw 1s cubic-bezier(.4,0,.2,1) both; }
@keyframes pc-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .pc-card .pop, .pc-card .fade { animation: none; }
  .pc-card .draw { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
}

/* leaderboard: solid bars, black type, bare gear */
.lb3-filter { font-size: 14.5px; font-weight: 600; color: var(--text); }
.lb3-gear { font-size: 26px; font-weight: 800; line-height: 1; padding: 2px 6px;
  border: 0; background: none; color: var(--text); cursor: pointer; }
.lb3-gear:hover { color: var(--accent); background: none; }
.lb3-name { font-size: 17px; font-weight: 700; color: var(--text); }
.lb3-track { height: 34px; }
.lb3-bar i { border-radius: 0 999px 999px 0; background: var(--lb-bar) !important; }
.lb3-row:hover .lb3-bar i { background: var(--lb-bar-hover) !important; }
.lb3-val { font-size: 17px; font-weight: 800; color: var(--text); }
.lb3-gridline b { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
:root { --lb-bar: #5b8fdc; --lb-bar-hover: #2a78d6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --lb-bar: #4a7fcf; --lb-bar-hover: #6ea0ff; }
}
:root[data-theme="dark"] { --lb-bar: #4a7fcf; --lb-bar-hover: #6ea0ff; }
