/* Inceptor dashboard styles, shared by every page (index, bug, analyze, tables).
 * Light + dark via prefers-color-scheme, overridable with <html data-theme="light|dark">.
 * Every colour is a token. Chrome is neutral (ink, greys); strong colour is reserved for
 * data: phases (categorical), phase outcomes and pass/fail (status). Agents are shown
 * by name with a small neutral marker, never with a phase-like fill. */
:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #fcfcfb;
  --surface-2: #f2f1ec;
  --surface-3: #e7e6e0;
  --ink: #0b0b0b;
  --ink-2: #4a4946;
  --muted: #6b6a65;
  --grid: #e7e6e0;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.22);
  --sel: #0b0b0b;                         /* selection ring / current marker */
  --sel-bg: rgba(11, 11, 11, 0.055);
  --hover: rgba(11, 11, 11, 0.035);
  --focus: #2a78d6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
  --bar: #8a8984;                         /* neutral data ink (single-series bars) */

  /* phases: categorical, fixed order (the purpose colours they replace, light + dark) */
  --p-planning: #e87ba4;
  --p-localization: #3987e5;
  --p-repair: #9085e9;
  --p-validation: #eda100;
  --p-other: #898781;
  /* text on a phase or outcome fill: near-black everywhere, in both themes; every fill is
   * light enough for it (>= 4.5:1), so no label switches to white */
  --on-fill: #0b0b0b;
  --pt-planning: var(--on-fill); --pt-localization: var(--on-fill);
  --pt-repair: var(--on-fill); --pt-validation: var(--on-fill); --pt-other: var(--on-fill);

  /* phase outcomes (status; always paired with a glyph): green, red, mid grey, light grey */
  --o-succeeded: #0ca30c;
  --o-failed: #e05252;
  --o-blocked: #807e78;
  --o-unchecked: #b4b2aa;
  /* the same as text (>= 4.5:1 on the surface) */
  --ot-succeeded: #006300;
  --ot-failed: #b42323;
  --ot-blocked: #4a4946;
  --ot-unchecked: #5f5e59;
  /* text drawn on an outcome fill (--on-fill) */
  --of-succeeded: var(--on-fill); --of-failed: var(--on-fill); --of-blocked: var(--on-fill); --of-unchecked: var(--on-fill);
  /* the file marks of Localization and Repair: grey = looked at, never edited; one colour per
   * localization -> repair cycle = edited (no red, green or teal: those are the validations') */
  --f-seen: #a3a19a;
  --cy-1: #8e3bc4; --cy-2: #9a7a00; --cy-3: #3d4fc4; --cy-4: #4f6d7a;
  /* warnings (badges, flags, build failures) */
  --warn: #fab219;
  --ot-warn: #7f5300;

  /* external validation (the benchmark's verdict): green / red, used for nothing else */
  --pass: #0ca30c;
  --fail: #d03b3b;
  /* self-validation (the agent's own builds and tests: Validation outcomes, action dots):
   * teal = passed, red = errored (round or pill shapes; the square box is external
   * validation's); fill, text, and text drawn on the fill (black) */
  --sv-pass: #12a090; --svt-pass: #0b6b62; --svf-pass: var(--on-fill);
  --sv-err: #e05252; --svt-err: #b42323; --svf-err: var(--on-fill);
  --v-none: #c3c2b7;

  --panel-w: 400px;
  /* the whole page drawn larger (core.js TV.zoom maps the mouse and the pop-ups) */
  --zoom: 1.15;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --surface-3: #2e2e2b;
    --ink: #f4f4f1; --ink-2: #c3c2b7; --muted: #9c9a92; --grid: #2c2c2a; --axis: #4a4945;
    --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.22);
    --sel: #f4f4f1; --sel-bg: rgba(255, 255, 255, 0.07); --hover: rgba(255, 255, 255, 0.04);
    --focus: #6da7ec; --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6); --bar: #9c9a92;
    --p-planning: #d55181; --p-localization: #3987e5;
    --p-repair: #9085e9; --p-validation: #c98500; --p-other: #898781;
    --f-seen: #7a7872; --cy-1: #b57be8; --cy-2: #d4b13a; --cy-3: #7d8cf2; --cy-4: #8fb0bf;
    --o-succeeded: #0ca30c; --o-failed: #e05252; --o-blocked: #a9a79f; --o-unchecked: #807e78;
    --ot-succeeded: #3fcf3f; --ot-failed: #f08080; --ot-blocked: #c3c2b7; --ot-unchecked: #b3b1a9;
    --warn: #fab219; --ot-warn: #fab219;
    --pass: #0ca30c; --fail: #e66767; --v-none: #5d5c57;
    --sv-pass: #14b8a6; --svt-pass: #4fd1c2; --svf-pass: #0b0b0b; --sv-err: #e05252; --svt-err: #f08080; --svf-err: #0b0b0b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --surface-3: #2e2e2b;
  --ink: #f4f4f1; --ink-2: #c3c2b7; --muted: #9c9a92; --grid: #2c2c2a; --axis: #4a4945;
  --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.22);
  --sel: #f4f4f1; --sel-bg: rgba(255, 255, 255, 0.07); --hover: rgba(255, 255, 255, 0.04);
  --focus: #6da7ec; --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6); --bar: #9c9a92;
  --p-planning: #d55181; --p-localization: #3987e5;
  --p-repair: #9085e9; --p-validation: #c98500; --p-other: #898781;
  --f-seen: #7a7872; --cy-1: #b57be8; --cy-2: #d4b13a; --cy-3: #7d8cf2; --cy-4: #8fb0bf;
  --o-succeeded: #0ca30c; --o-failed: #e05252; --o-blocked: #a9a79f; --o-unchecked: #807e78;
  --ot-succeeded: #3fcf3f; --ot-failed: #f08080; --ot-blocked: #c3c2b7; --ot-unchecked: #b3b1a9;
  --warn: #fab219; --ot-warn: #fab219;
  --pass: #0ca30c; --fail: #e66767; --v-none: #5d5c57;
    --sv-pass: #14b8a6; --svt-pass: #4fd1c2; --svf-pass: #0b0b0b; --sv-err: #e05252; --svt-err: #f08080; --svf-err: #0b0b0b;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scrollbar-gutter: stable; }
.wprobe { height: 0; margin: 0; padding: 0; }   /* page-*.js: measures the view's width */   /* a scrollbar that comes and goes would change the width and redraw the views */
body { background: var(--bg); color: var(--ink); font-size: 13px; line-height: 1.45; min-height: 100vh; overflow-x: hidden; zoom: var(--zoom); }
button, select, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 650; }

.btn {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 7px; padding: 4px 10px; cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.35;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: default; pointer-events: none; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.icon { padding: 4px 8px; min-width: 30px; justify-content: center; }
select, input[type="search"] {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; padding: 4px 8px; min-width: 0;
}
input[type="search"] { padding: 5px 10px; }

/* segmented control (tabs, level, toggles) */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 11px; border-radius: 7px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.seg.small button { padding: 2px 8px; font-size: 12px; }

/* page tabs: underlined text, one row */
.tabs { display: flex; align-items: flex-end; gap: 18px; border-bottom: 1px solid var(--border); margin: 0 0 14px; flex-wrap: wrap; }
.tabs .tab { border: 0; background: none; padding: 8px 2px 9px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab:hover { color: var(--ink); }
.tabs .tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--sel); }
.tabs .tab-ctl { margin-left: auto; display: flex; gap: 8px; align-items: center; padding-bottom: 6px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ page shell */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 24px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.top .sub { color: var(--muted); font-size: 12.5px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.logo .logomark { flex: none; display: block; }
.logo .word { font-weight: 500; color: var(--ink-2); letter-spacing: -0.015em; }
.logo .word b { font-weight: 750; color: var(--ink); }
.logo.home { text-decoration: none; padding: 3px; margin: -3px 0; border-radius: 6px; transition: background-color .15s; }
.logo.home:hover { background: var(--surface-2); }
.top .top-r { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 20px 24px 60px; }
.foot { color: var(--muted); font-size: 11.5px; margin-top: 28px; }

/* ------------------------------------------------------------------ shared marks */
.adot { display: inline-block; width: 8px; height: 8px; background: var(--ink-2); flex: none; vertical-align: 0; }
.adot.claude { border-radius: 50%; }
.adot.codex { border-radius: 2px; }
.adot.qwen { width: 7px; height: 7px; border-radius: 1px; transform: rotate(45deg); }
.agent { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }

/* the external validation's mark: a square box (core.js TV.markHTML, TV.extBox) */
.xbox { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; vertical-align: -1px; border: 1.5px solid var(--v-none); box-sizing: border-box; }
.xbox.pass { background: var(--pass); border-color: var(--pass); }
.xbox.fail { background: var(--fail); border-color: var(--fail); }
.tpill .xbox, .seg .xbox, .gext .xbox, .lgm .xbox { margin-right: 4px; }
.rdots { display: inline-flex; gap: 3px; align-items: center; flex: none; }
/* an action's self-check: a dot (✓ / ✗ belong to the external validation alone) */
.vdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--v-none); margin-right: 4px; vertical-align: 0; flex: none; }
.vdot.v-pass { background: var(--sv-pass); } .vdot.v-fail { background: var(--sv-err); }
.st-h > .vg > .vdot { margin-right: 0; }       /* a step row: the dot alone */

.tpill { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 650; border: 1px solid var(--border-strong); white-space: nowrap; line-height: 18px; }
.tpill.pass { color: var(--ot-succeeded); border-color: color-mix(in srgb, var(--pass) 70%, transparent); background: color-mix(in srgb, var(--pass) 10%, var(--surface)); }
.tpill.fail { color: var(--ot-failed); border-color: color-mix(in srgb, var(--fail) 70%, transparent); background: color-mix(in srgb, var(--fail) 9%, var(--surface)); }
.tpill.unknown { color: var(--ot-unchecked); }

/* phase strip / phase-outcome strip: pieces placed by action index (core.js), 1px gap */
.strip { position: relative; display: block; height: 8px; border-radius: 3px; overflow: hidden; min-width: 3px; flex: none; }
.strip i { position: absolute; top: 0; bottom: 0; display: block; }
.strip.tall { height: 10px; }
.strip.outs { height: 5px; border-radius: 2px; }
.strip.outs i { background: var(--oc); }
.strips { display: flex; flex-direction: column; gap: 2px; min-width: 3px; flex: none; }
.track { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }

.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -0.5px; }
.pchip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; white-space: nowrap; }
.pchip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
/* phase outcome chip: the solid fill the strips, bars and boxes use, so chips double as legend */
.opill {
  display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 17px;
  border: 1px solid var(--oc); background: var(--oc); color: var(--ofc);
}
.opill b { color: inherit; font-weight: 800; }
/* the dashboard's three Validation outcomes (core.js TV.OUTCOMES) on the engine's colours */
.o-passed { --oc: var(--sv-pass); --otc: var(--svt-pass); --ofc: var(--svf-pass); }
.o-errored { --oc: var(--sv-err); --otc: var(--svt-err); --ofc: var(--svf-err); }
.o-unchecked { --oc: var(--o-unchecked); --otc: var(--ot-unchecked); --ofc: var(--of-unchecked); }
.opill .ev { font-weight: 500; opacity: 0.85; }
/* outcome history of a phase whose checks changed: earlier outcomes hollow, the final one solid */
.ohist { display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.opill.hist { background: var(--surface); color: var(--otc); padding: 0 5px; }
.oh-arr { font-style: normal; color: var(--muted); font-size: 10px; }
.opill.cur { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--sel); }

/* process badges and flags: short labelled pills with a tooltip definition */
.badge, .flag {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 550; padding: 0 6px; border-radius: 4px; line-height: 17px;
  border: 1px solid var(--border-strong); color: var(--ink-2); background: var(--surface-2); white-space: nowrap; cursor: help;
}
.sev-bad { color: var(--ot-failed); border-color: color-mix(in srgb, var(--o-failed) 50%, transparent); background: color-mix(in srgb, var(--o-failed) 8%, var(--surface)); }
.sev-warn { color: var(--ot-warn); border-color: color-mix(in srgb, var(--warn) 70%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.sev-good { color: var(--ot-succeeded); border-color: color-mix(in srgb, var(--o-succeeded) 50%, transparent); background: color-mix(in srgb, var(--o-succeeded) 8%, var(--surface)); }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.midchip { display: inline-block; font-family: ui-monospace, Menlo, monospace; font-size: 11px; padding: 0 5px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; line-height: 17px; }
.vg { font-weight: 700; font-size: 11.5px; white-space: nowrap; }
.vg.v-none { color: var(--muted); font-weight: 600; }
.v-pass { color: var(--svt-pass); }
.v-fail { color: var(--svt-err); }
.tag { display: inline-block; font-size: 11px; padding: 0 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; line-height: 17px; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 11.5px; color: var(--ink-2); }
.lg-t { font-weight: 650; color: var(--muted); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.05em; margin-left: 10px; }
.lg-t:first-child { margin-left: 0; }
.lgm { display: inline-flex; align-items: center; gap: 4px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.note { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 12px; color: var(--ink-2); }

/* ------------------------------------------------------------------ page head, navigation, status */
.nav { display: flex; gap: 2px; align-items: center; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 4px 10px; border-radius: 7px; font-weight: 550; white-space: nowrap; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.rstate { max-width: 260px; }
.rstate .lbl { overflow: hidden; text-overflow: ellipsis; }
.rs-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--axis); flex: none; }
body.rules-custom .rs-dot { background: var(--focus); }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin: 2px 0 14px; flex-wrap: wrap; }
.pagehead h1 { font-size: 22px; letter-spacing: -0.015em; }
.ph-sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; max-width: 760px; }
.ph-r { display: flex; gap: 8px; align-items: center; }
.close-x { font-size: 15px; min-width: 34px; height: 32px; }
.status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; padding: 7px 12px; margin: 0 0 12px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); }
.status .rs-name { font-weight: 650; color: var(--ink); }
.status .rs-x { color: var(--ink-2); }
.status .rs-edit { margin-left: auto; font-weight: 600; }
.status.ok { border-color: color-mix(in srgb, var(--o-succeeded) 40%, var(--border)); }
.status.ok .rs-name::before { content: "● "; color: var(--o-succeeded); }
.status.busy .rs-name::before { content: "◌ "; color: var(--focus); }
.status.warn { border-color: color-mix(in srgb, var(--warn) 70%, transparent); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: var(--ink-2); }
.btn.danger { color: var(--ot-failed); border-color: color-mix(in srgb, var(--o-failed) 50%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--o-failed) 8%, var(--surface)); }
.btn.small { padding: 1px 8px; font-size: 11.5px; border-radius: 6px; }
.btn.icon.small { min-width: 24px; padding: 1px 5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.yours { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--focus); border: 1px solid color-mix(in srgb, var(--focus) 45%, transparent); border-radius: 4px; padding: 0 4px; margin-left: 6px; line-height: 15px; }
.yours.swe { color: var(--muted); border-color: color-mix(in srgb, var(--muted) 45%, transparent); }

/* ------------------------------------------------------------------ corpus page: filters, legend, sections */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 12px; }
.toolbar .search { flex: 0 1 250px; min-width: 170px; }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; }
.fgroup { display: inline-flex; align-items: center; gap: 7px; }
.flbl { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.seg .cnt { opacity: 0.6; font-variant-numeric: tabular-nums; font-weight: 500; margin-left: 2px; }
.seg .agent { font-weight: inherit; }
.toolbar .tb-r { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.legendcard { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; align-items: center; padding: 10px 14px; margin: 0 0 18px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 12px; }
.lg-title { grid-column: 1 / -1; font-size: 13px; font-weight: 650; margin: 0 0 2px; }
.lg-row { display: contents; }
.lg-k { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.lg-k b { font-weight: 650; }
.lg-k .muted { font-size: 11px; }
.lg-v { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ink-2); }
.lg-row + .lg-row .lg-k, .lg-row + .lg-row .lg-v { padding-top: 6px; border-top: 1px solid var(--grid); }
.lg-sample { display: inline-flex; gap: 1px; width: 34px; border-radius: 2px; overflow: hidden; flex: none; }
.lg-sample i { flex: 1; display: block; }
.lg-sample.tall { height: 10px; }
.lg-sample.thin { height: 5px; }
.lgm.sep { margin-left: 6px; }
.lg-inline { margin: 0 0 12px; }

.sect { margin: 0 0 20px; }
.sect-h { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 8px; min-height: 26px; }
.sect-h h2 { font-size: 14px; display: flex; align-items: baseline; gap: 8px; }
.sect-h .cnt { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.sect-acts { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sel { display: flex; align-items: center; justify-content: center; }
.sel input { margin: 0; width: 14px; height: 14px; cursor: pointer; accent-color: var(--ink); }

.bugs { overflow: hidden; }
.brow {
  display: grid; grid-template-columns: 22px minmax(76px, 0.32fr) repeat(var(--nag, 3), minmax(0, 1.4fr));
  align-items: center; column-gap: 16px; padding: 7px 16px 7px 12px; border-top: 1px solid var(--grid); color: inherit; cursor: pointer;
}
.bugs.single .brow { grid-template-columns: 22px minmax(76px, 0.3fr) minmax(0, 3fr); }
.brow:first-child { border-top: 0; }
.brow:not(.head):hover { background: var(--hover); }
.brow.head { cursor: default; font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; padding-top: 9px; padding-bottom: 7px; background: var(--surface-2); }
.brow.head .agent { font-weight: 650; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: 12px; }
.bid { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-decoration: none; }
.bid.nobug { font-weight: 500; font-style: italic; color: var(--ink-2); }
.bid:hover { text-decoration: underline; }
.acell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.acell .alabel { display: none; }
.acell.none { color: var(--muted); font-size: 12px; }
/* run dots in the table: links, one per run */
.acell .rdots { flex-wrap: wrap; max-width: 64px; gap: 4px; }
a.xbox:hover { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--sel); }
.track .an { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 11.5px; flex: none; }
.track > :not(.an) { flex-shrink: 1; }      /* the longest strip gives way to its count */
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
/* nothing uploaded yet: only the invitation shows */
#tab-list.isempty > :not(#emptyState) { display: none; }
.welcome { padding: 28px 24px; text-align: center; max-width: 640px; margin: 24px auto; }
.welcome h2 { margin: 0 0 8px; font-size: 17px; }
.welcome p { color: var(--ink-2); margin: 0 0 16px; }

body.dragging::after {
  content: "Drop to add these trajectories"; position: fixed; inset: 12px; z-index: 70; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--ink-2); border-radius: 16px; background: color-mix(in srgb, var(--bg) 85%, transparent); font-size: 18px; font-weight: 650; pointer-events: none;
}

/* ------------------------------------------------------------------ corpus page: statistics */
.scards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 14px; }
.scard { padding: 12px 14px 11px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sc-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-h .agent { font-size: 13.5px; }
.sc-h .model { color: var(--muted); font-size: 11px; font-family: ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hero b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.hero b small { font-size: 15px; font-weight: 600; color: var(--muted); }
.hero span { color: var(--ink-2); }
.sc-l { color: var(--ink-2); font-size: 12px; }
.sc-k { display: flex; gap: 4px 14px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 7px; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.sc-k b { color: var(--ink); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 14px; align-items: start; }
.statgrid .wide { grid-column: 1 / -1; }
.panel { padding: 14px 16px 14px; min-width: 0; }
.panel h3 { font-size: 13.5px; margin-bottom: 2px; }
.panel .desc { color: var(--muted); font-size: 12px; margin: 0 0 10px; }

/* stacked phase share bars */
.pshare { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.ps-l { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ps-l .agent { font-size: 12.5px; }
.gname { display: inline-flex; align-items: center; gap: 0; white-space: nowrap; min-width: 0; }
.pshare .bar100 { display: flex; height: 22px; border-radius: 4px; overflow: hidden; gap: 2px; }
.pshare .bar100 i { display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 10.5px; font-weight: 650; min-width: 1px; overflow: hidden; white-space: nowrap; }
.bar100 i.none { flex: 1; background: var(--surface-2); }

/* phase outcomes: one 100% bar per phase and group */
.phout { display: grid; grid-template-columns: minmax(110px, 140px) repeat(var(--nag, 3), minmax(0, 1fr)); column-gap: 14px; row-gap: 6px; align-items: center; font-size: 12px; }
.phout .bh { font-size: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--border); display: flex; align-items: center; min-width: 0; }
.phout .bl { display: flex; justify-content: flex-end; }
.phout .bc { display: flex; align-items: center; gap: 6px; min-width: 0; }
.phout .bv { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; width: 30px; flex: none; text-align: right; }
.bar100.mini { flex: 1; min-width: 0; display: flex; height: 18px; border-radius: 3px; overflow: hidden; gap: 1px; }
.bar100.mini i { display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 10px; font-weight: 650; min-width: 1px; overflow: hidden; white-space: nowrap; background: var(--oc); color: var(--ofc); }

/* 3-run pass matrix */
.pm-wrap { display: flex; flex-wrap: wrap; gap: 18px 36px; align-items: center; }
.pm { flex: 1 1 560px; max-width: 760px; display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px 10px; align-items: center; }
.pm-grid { display: grid; grid-template-columns: 18px repeat(var(--nb, 50), minmax(0, 1fr)); grid-auto-rows: 10px; gap: 2px; }
.pm-r { font-size: 9px; line-height: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pm-grid a { display: block; border-radius: 2px; border: 1.5px solid var(--v-none); }
.pm-grid .nil { display: block; }
.pm-grid a.pass { background: var(--pass); border-color: var(--pass); }
.pm-grid a.fail { background: var(--fail); border-color: var(--fail); }
.pm-grid a:hover { outline: 1.5px solid var(--sel); outline-offset: 1px; }
.tscroll { flex: 1 1 420px; min-width: 0; overflow-x: auto; }
.ptab { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.ptab th, .ptab td { padding: 5px 8px; border-bottom: 1px solid var(--grid); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptab th:first-child, .ptab td:first-child { text-align: left; }
.ptab th { font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; white-space: normal; vertical-align: bottom; line-height: 1.25; }
.ptab th:nth-child(-n+4) { white-space: nowrap; }
.ptab thead tr + tr th:first-child { text-align: right; }
.ptab th.grp { text-align: center; color: var(--ink-2); border-bottom-color: var(--border); }

/* ------------------------------------------------------------------ bug page */
.viewtitle { font-size: 20px; letter-spacing: -0.015em; margin: 2px 0 12px; }
.bugtitle { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.bugtitle h1 { font-size: 17px; }
.bugtitle .app { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bugnav { display: flex; gap: 4px; }

.matrix { display: grid; grid-template-columns: 170px repeat(var(--nr, 3), minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.mx-h { font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 4px; align-self: end; }
.mx-a { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 4px; min-width: 0; }
.mx-a .model { color: var(--muted); font-size: 11px; font-family: ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell {
  display: flex; flex-direction: column; gap: 7px; padding: 9px 11px; text-align: left; cursor: pointer; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
.cell:hover { border-color: var(--border-strong); }
.cell[aria-pressed="true"] { border-color: var(--sel); box-shadow: 0 0 0 1px var(--sel), var(--shadow); }
.cell .c1 { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-width: 0; }
.cell .cn { color: var(--ink-2); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.cell .c3 { display: flex; gap: 4px; flex-wrap: wrap; min-height: 0; }
.cell.missing { cursor: default; box-shadow: none; background: transparent; border-style: dashed; color: var(--muted); justify-content: center; font-size: 12px; }

.trajbar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 4px; }
.trajbar h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.trajbar .facts { color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* playhead: sticky under the header, drives every view of the selected trajectory */
.playhead {
  position: sticky; top: var(--hdr-h, 49px); z-index: 15; display: flex; align-items: center; gap: 6px;
  margin: 6px -8px 8px; padding: 6px 8px; border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
}
.playhead .btn.icon { min-width: 30px; height: 28px; padding: 0 8px; }
.playhead .btn.play { min-width: 34px; background: var(--ink); color: var(--surface); border-color: var(--ink); }
.playhead .btn.play svg { display: block; }
.playhead .btn.play:hover { background: var(--ink-2); }
.playhead input[type="range"] { flex: 1; min-width: 100px; accent-color: var(--ink-2); margin: 0 4px; }
.cursorlabel { min-width: 190px; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; overflow: hidden; }
.cursorlabel b { font-size: 14px; }
.cursorlabel .cl-mid { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--ink-2); }
.cursorlabel .opill.mini { font-size: 10.5px; line-height: 15px; padding: 0 6px; max-width: 180px; min-width: 0; }
.opill .ell { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.preload .details { transition: none; }
.playhead select { height: 28px; }

.view { min-width: 0; }
.loading { padding: 40px 0; color: var(--muted); text-align: center; }
.nodata { max-width: 640px; margin: 60px auto; padding: 24px 28px; }
.nodata h2 { font-size: 17px; margin-bottom: 8px; }
.nodata pre { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }

/* top-down */
.td-strips { position: relative; margin: 16px 0 14px; }
.td-over { position: relative; height: 30px; }
.td-seg { position: relative; height: 15px; margin-top: 3px; }
.ov { position: absolute; top: 0; bottom: 0; border: 0; border-radius: 5px; cursor: pointer; min-width: 2px; padding: 0 6px; overflow: hidden; text-align: left; }
.tsg { position: absolute; top: 0; bottom: 0; min-width: 1px; border: 0; padding: 0; border-radius: 2px; background: var(--oc); cursor: pointer; }
.tsg:hover { filter: brightness(1.1); box-shadow: 0 0 0 1px var(--sel); }
.tsg.cur { box-shadow: 0 0 0 1.5px var(--sel); z-index: 1; }
.tsg.fz { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tsg.fz.cur { box-shadow: 0 0 0 1.5px var(--sel); }
.tsg.fz i.fdot { width: 7px; height: 9px; }
.tsg.fz .fdots .more { font-size: 10px; line-height: 1; }
.ov span { display: block; font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 30px; }
.ov:hover { filter: brightness(1.08); }
.ov-anchor { position: absolute; top: -6px; bottom: -3px; width: 0; border-left: 2px dashed var(--ink-2); pointer-events: none; z-index: 1; }
.ov-anchor b { position: absolute; top: -13px; left: 3px; font-size: 9.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; letter-spacing: 0.02em; }
.ov-cursor { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--sel); pointer-events: none; border-radius: 1px; z-index: 2; box-shadow: 0 0 0 1px var(--surface); }
.td-legend { margin: 0 0 12px; }
.td-list { display: flex; flex-direction: column; gap: 8px; }
.pblk { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--pc); border-radius: 10px; box-shadow: var(--shadow); }
.pb-h, .cb-h, .st-h { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.pb-h { padding: 9px 12px; border-radius: 9px; flex-wrap: wrap; }
.pb-h:hover, .cb-h:hover, .st-h:hover { background: var(--hover); }
.caret { width: 12px; color: var(--muted); flex: none; font-size: 11px; }
.plabel { font-weight: 650; font-size: 14px; min-width: 96px; }
.prange { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; min-width: 64px; }
.psize { flex: 0 0 120px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.psize i { display: block; height: 100%; background: var(--pc); border-radius: 3px; }
.pn { color: var(--ink-2); font-size: 12px; min-width: 72px; font-variant-numeric: tabular-nums; }
.pb-body { padding: 0 12px 12px 28px; display: flex; flex-direction: column; gap: 4px; }
.pb-out { font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; padding: 0 2px 4px; overflow-wrap: anywhere; }
.pb-out .opill { vertical-align: 0; }
/* category group: consecutive actions of one category within a phase (neutral; colour is data) */
.cblk { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.cblk.cur > .cb-h { background: var(--sel-bg); box-shadow: inset 0 0 0 1.5px var(--sel); }
.cblk.hascur { box-shadow: 0 0 0 1px var(--sel); }
.pblk, .cblk, .step { scroll-margin-top: calc(var(--hdr-h, 50px) + var(--ph-h, 44px) + 10px); scroll-margin-bottom: 16px; }
.cb-h { padding: 4px 10px; border-radius: 7px; font-size: 12px; gap: 8px; }
.cb-c { min-width: 100px; flex: none; }
.cb-n { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; min-width: 24px; }
.cb-r { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 64px; }
.cb-body { padding: 0 8px 4px 24px; display: flex; flex-direction: column; }
.step { border-top: 1px dashed var(--border); }
.step.cur { background: var(--sel-bg); box-shadow: inset 3px 0 0 var(--sel); }
.st-h { padding: 4px 6px; font-size: 12px; }
.st-i { width: 34px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.st-t { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.vg.none { width: 10px; }

/* svg charts (timeline) */
svg { display: block; }
svg text { fill: var(--ink-2); font-size: 11px; }
.rl { font-size: 11px; fill: var(--ink-2); }
.rl.lane { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; }
.rl.muted { fill: var(--muted); }
.bandlbl { font-size: 11px; font-weight: 650; pointer-events: none; }
.segr { fill: var(--oc); }
.segr.fz { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; }
.seglbl.fzn { fill: var(--muted); font-weight: 600; }
rect.fdot { stroke: var(--surface); stroke-width: 0.6; pointer-events: none; }
.fmore { fill: var(--muted); font-weight: 650; pointer-events: none; font-variant-numeric: tabular-nums; }
/* file dots in HTML (pop-ups, details panel, phase headers, legends) */
.fdots { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.fdots.none { font-size: 11px; color: var(--muted); }
.fdots .more { font-size: 10.5px; color: var(--muted); margin-left: 2px; font-variant-numeric: tabular-nums; }
i.fdot { display: inline-block; width: 8px; height: 11px; border-radius: 2px; flex: none; }
.tt-files.dotted li { align-items: center; }
.tt-o .fdots, .dt-row .fdots { margin-right: 4px; }
.lg-s { font-size: 11px; color: var(--muted); font-style: italic; margin-left: 4px; }
/* the legend card of the trajectory views: tighter than the corpus page's */
.legendcard.lg-compact { gap: 5px 14px; padding: 8px 12px; margin: 0 0 12px; font-size: 11.5px; }
.legendcard.lg-compact .lg-k b { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.legendcard.lg-compact .lg-k .muted { font-style: italic; }
.legendcard.lg-compact .lg-row + .lg-row .lg-k, .legendcard.lg-compact .lg-row + .lg-row .lg-v { padding-top: 5px; }
.legendcard.lg-compact .lg-row.lg-cont .lg-k, .legendcard.lg-compact .lg-row.lg-cont .lg-v { border-top: 0; padding-top: 0; }
.legendcard.lg-compact .lg-row.lg-cont .lg-k .muted::before { content: '↳ '; font-style: normal; }
.seglbl { font-size: 11px; font-weight: 700; fill: var(--of-unchecked); pointer-events: none; }
.seglbl.o-passed { fill: var(--svf-pass); } .seglbl.o-errored { fill: var(--svf-err); }
.seglbl.o-unchecked { fill: var(--of-unchecked); }
.lanebg { fill: var(--surface-2); }
/* the category lanes: a caption, and the families (inspect, modify, execute, coordinate) bracketed */
.rl.cap { font-size: 10.5px; font-weight: 650; fill: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; cursor: help; }
.capline { stroke: var(--grid); stroke-width: 1; }
.rl.fam { font-size: 10.5px; font-style: italic; fill: var(--muted); cursor: help; }
.rl.lane { cursor: help; }
.fambr { fill: none; stroke: var(--axis); stroke-width: 1; }
.famsep { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 3; }
.mk { fill: var(--v-none); }
.mk.v-pass { fill: var(--sv-pass); }
.mk.v-fail { fill: var(--sv-err); }
.mk.cur { stroke: var(--sel); stroke-width: 2; }
.anchorline { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; }
.anchorlbl { font-size: 9.5px; font-weight: 650; fill: var(--ink-2); pointer-events: none; }
.axis { stroke: var(--axis); stroke-width: 1; }
.tick { stroke: var(--axis); }
.ticklbl { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.playline { stroke: var(--sel); stroke-width: 1.5; pointer-events: none; }
.band { pointer-events: none; }
.strip-l { font-size: 9.5px; fill: var(--muted); }
.curcol { fill: var(--sel-bg); pointer-events: none; }
.overlay { fill: transparent; cursor: pointer; }
.tl-wrap { padding: 10px 6px 6px; overflow-x: auto; }
.lgm .mk { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--v-none); }
.lgm .mk.v-pass { background: var(--sv-pass); } .lgm .mk.v-fail { background: var(--sv-err); }
.lgm .anchormk { display: inline-block; width: 0; height: 12px; border-left: 2px dashed var(--ink-2); margin: 0 3px; }
.lgm svg { overflow: visible; }
.hint { color: var(--muted); font-size: 11.5px; margin: 8px 2px 0; }

/* fingerprint */
.fp-legend { margin-bottom: 6px; }
.fp-sub { margin: 0 0 10px; }
.fpcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 6px; margin-bottom: 10px; box-shadow: var(--shadow); }
.fpcard.cur { border-color: var(--sel); box-shadow: 0 0 0 1px var(--sel), var(--shadow); }
.fpcard.missing { border-style: dashed; box-shadow: none; background: transparent; }
.fp-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.fp-h .fp-run { font-weight: 650; }
.fp-h .cur-tag { margin-left: auto; }
.fp-h [data-select] { margin-left: auto; }
.fp-wrap { overflow-x: auto; }
.bub { fill: var(--v-none); }
.bub.v-pass { fill: var(--sv-pass); }
.bub.v-fail { fill: var(--sv-err); }
.bub.cur { stroke: var(--sel); stroke-width: 2.2; }
.lgm .bub { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--v-none); }
.lgm .bub.v-pass { background: var(--sv-pass); } .lgm .bub.v-fail { background: var(--sv-err); }

/* action details panel */
.details {
  position: fixed; z-index: 30; top: 0; right: 0; bottom: 0; width: var(--panel-w); max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(105%); transition: transform 0.16s ease-out; visibility: hidden;
}
body.panel-open .details { transform: none; visibility: visible; }
.dt-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.dt-h .dt-i { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dt-h .dt-of { color: var(--muted); font-size: 12px; }
.dt-h .dt-btns { margin-left: auto; display: flex; gap: 4px; }
.dt-b { overflow: auto; padding: 4px 14px 30px; flex: 1; }
.dt-row { margin: 8px 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dt-k { margin-top: 14px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; }
.dt-text { white-space: pre-wrap; word-break: break-word; margin-top: 3px; }
.dt-code { margin: 4px 0 0; padding: 7px 9px; background: var(--surface-2); border-radius: 6px; white-space: pre-wrap; word-break: break-word; font-size: 11.5px; max-height: 240px; overflow: auto; }
.dt-seg > * { margin-top: 4px; }
.dt-meta { margin-top: 16px; color: var(--muted); font-size: 11.5px; word-break: break-all; }
/* wide screens: the details are a column of their own whenever a trajectory is open (body.docked),
 * empty until an action is picked, so picking one never changes the page's width; the close
 * button removes the column (body.dock-off) until an action is picked again */
@media (min-width: 1200px) {
  body.docked:not(.dock-off) .bugwrap, body.docked.panel-open .bugwrap { padding-right: calc(var(--panel-w) + 24px); }
  body.docked:not(.dock-off) .details { transform: none; visibility: visible; }
  .details { top: 53px; box-shadow: none; }
}
.dt-empty { margin: 24px 4px; color: var(--muted); font-size: 12.5px; }
.pending { visibility: hidden; }   /* filled in one go once the data is known */
kbd { font-family: ui-monospace, Menlo, monospace; font-size: 11px; padding: 0 4px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface-2); }

/* tooltip, help */
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 380px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 9px; box-shadow: var(--shadow-lg); font-size: 12px;
}
.tt-h { font-weight: 650; }
.tt-m { color: var(--ink-2); font-size: 11.5px; }
.tt-c { font-family: ui-monospace, Menlo, monospace; font-size: 11px; margin: 3px 0; word-break: break-all; color: var(--ink-2); }
/* files in the pop-ups: name, how often / where, and how it relates to the rest (edited later? localized before?) */
.tip { max-width: 430px; }
.tt-ph { display: inline-flex; align-items: center; gap: 4px; font-weight: 550; font-size: 11.5px; color: var(--ink-2); margin-left: 4px; }
.tt-ph i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.tt-k { margin: 6px 0 2px; font-size: 10.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tt-files { list-style: none; margin: 0; padding: 0; }
.tt-files li { display: flex; align-items: baseline; gap: 7px; line-height: 17px; min-width: 0; }
.tt-files .fn { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tt-files .cnt { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.tt-files .rel { margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; flex: none; }
.tt-files .rel.ok { color: var(--ink-2); }
.tt-files .rel.no { color: var(--ink-2); font-style: italic; }
.tt-files .more { color: var(--muted); font-size: 11px; }
.tt-o { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 2px; }
.tt-ok { font-size: 10.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 2px; }
.tt-o .opill.mini { font-size: 10.5px; line-height: 15px; padding: 0 6px; }
.help { position: fixed; z-index: 60; top: 64px; right: 20px; width: 340px; max-width: calc(100vw - 32px); padding: 14px 18px; box-shadow: var(--shadow-lg); }
.help h2 { margin: 0 0 8px; font-size: 15px; }
.help dl { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; margin: 0 0 10px; }
.help dt { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.help dd { margin: 0; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .brow { grid-template-columns: 22px minmax(66px, 0.3fr) repeat(var(--nag, 3), minmax(0, 1.4fr)); column-gap: 12px; }
  .statgrid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top { padding: 8px 16px; gap: 8px; }
  .top .sub { display: none; }
  .wrap { padding: 14px 16px 50px; }
  .btn.lbl-opt .lbl { display: none; }
  .hero b { font-size: 24px; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar .fgroup { max-width: 100%; }
  .toolbar .seg { flex-wrap: wrap; }
  .toolbar .tb-r { margin-left: 0; }
  .brow, .bugs.single .brow { grid-template-columns: 22px minmax(0, 1fr) auto; row-gap: 5px; padding: 10px 12px; }
  .brow .bid { grid-column: 2; }
  .brow .acell { grid-column: 2 / -1; }
  .acell .alabel { display: inline-flex; width: 64px; flex: none; font-weight: 550; font-size: 12px; }
  .pshare, .pm { grid-template-columns: 64px minmax(0, 1fr); }
  .phout { grid-template-columns: minmax(90px, 110px) repeat(var(--nag, 3), minmax(0, 1fr)); column-gap: 6px; }
  .phout .bv { display: none; }
  .pm-grid { grid-auto-rows: 7px; gap: 1px; }
  .pm-grid a { border-width: 1px; border-radius: 1px; }
  .pm-r { line-height: 7px; }
  .tabs { gap: 14px; }
  .tabs .tab-ctl { margin-left: 0; width: 100%; padding-bottom: 8px; }
  .matrix { grid-template-columns: repeat(var(--nr, 3), minmax(0, 1fr)); gap: 6px; }
  .matrix .mx-corner { display: none; }
  .matrix .mx-a { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 8px; margin-top: 4px; }
  .cell { padding: 7px 8px; gap: 5px; }
  .cell .cn .lng { display: none; }
  .cell .c3 { display: none; }
  .bugtitle .app { display: none; }
  .details { top: auto; height: 50vh; width: 100vw; border-left: 0; border-top: 1px solid var(--border); border-radius: 14px 14px 0 0; transform: translateY(105%); }
  .plabel { min-width: 0; }
  .psize, .pn { display: none; }
  .playhead { flex-wrap: wrap; row-gap: 4px; margin-left: -6px; margin-right: -6px; padding: 6px; }
  .playhead input[type="range"] { order: 9; flex: 1 1 100%; margin: 0; }
  .cursorlabel { min-width: 0; flex: 1; }
  .fpcard { padding: 6px 8px 4px; }
  .pb-body { padding-left: 12px; }
  .cb-body { padding-left: 10px; }
  .cb-c, .cb-n, .cb-r { min-width: 0; }
}

/* ------------------------------------------------------------------ rules: popover, lists, Rules page */
.help .pop-x { position: absolute; top: 8px; right: 8px; font-size: 13px; }
.help h2 { padding-right: 34px; }
.rulespop { width: 470px; max-height: calc(100vh - 90px); overflow: auto; }
.rulespop > .btn.primary { margin-top: 4px; }
.rulelist { list-style: none; margin: 8px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rulelist .rule { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--grid); }
.rulelist .rule:first-child { border-top: 0; }
.rulelist .rule.off .rtext { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--axis); }
.rid { font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; text-align: center; line-height: 17px; padding: 0 3px; white-space: nowrap; }
.rl-h { font-size: 12.5px; margin: 12px 0 0; }
.rulespop .rl-h:first-of-type { margin-top: 6px; }
.rulespop .fixed { margin-left: 4px; }
.tag.rule { border-color: var(--focus); color: var(--focus); }

.rwrap { max-width: 1180px; }
.rstatus { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 11px 16px; margin-bottom: 14px; }
.rs-l { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; min-width: 0; }
.rs-l b { font-size: 14px; }
.rs-applied { font-size: 12.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.rs-applied.ok::before { content: "●"; color: var(--o-succeeded); }
.rs-applied.warn { color: var(--ot-warn); }
.rs-applied.bad { color: var(--ot-failed); }
.rs-r { display: flex; gap: 6px; flex-wrap: wrap; }
.rsect { padding: 14px 16px 16px; margin-bottom: 14px; }
.rsect h2 { font-size: 14px; margin: 0 0 4px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rsect h2 .small { font-weight: 450; }
.rules-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; }
.rulelist.edit .rule { grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; padding: 7px 0; }
.rulelist.edit .rule.editing { background: var(--sel-bg); border-radius: 6px; }
.rulelist .empty { padding: 8px 0; font-size: 12px; text-align: left; }
.rtext { line-height: 1.5; }
.rbtns { display: inline-flex; align-items: center; gap: 2px; }
.fixed { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; cursor: help; }
.lockic { display: inline-block; vertical-align: -1px; margin-right: 3px; }
.rulelist .rule.locked .rid { background: var(--surface-3); }
.rl-note { margin: 0 0 8px; }
.rulelist.optlist { gap: 6px; }
.rulelist.optlist .rule { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; background: var(--surface); }
.rulelist.optlist .rule:first-child { border-top: 1px solid var(--border); }
.rulelist.optlist .rule .rtext { color: var(--ink-2); }
.rulelist.optlist .rule .rid { background: transparent; border-style: dashed; }
.rulelist.optlist .rule.added { border-color: color-mix(in srgb, var(--focus) 55%, transparent); background: color-mix(in srgb, var(--focus) 6%, var(--surface)); }
.rulelist.optlist .rule.added .rtext { color: var(--ink); }
.rulelist.optlist .rule.added .rid { border-style: solid; border-color: color-mix(in srgb, var(--focus) 55%, transparent); color: var(--focus); background: var(--surface); }
.addedpill { font-size: 11px; font-weight: 650; color: var(--focus); white-space: nowrap; margin-right: 2px; }
.optlist .rbtns { gap: 6px; }
#resetOptional { margin-top: 8px; }
.hitrow { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: 1px; }
.hits { font-size: 11px; padding: 0 7px; border-radius: 999px; line-height: 17px; border: 1px solid color-mix(in srgb, var(--focus) 55%, transparent); color: var(--focus); background: color-mix(in srgb, var(--focus) 7%, var(--surface)); white-space: nowrap; cursor: help; }
.hits.none { border-color: var(--border-strong); color: var(--muted); background: var(--surface-2); }
.custom-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
/* on/off switch */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span[aria-hidden] { width: 28px; height: 16px; border-radius: 999px; background: var(--axis); position: relative; transition: background-color .15s; }
.switch span[aria-hidden]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span[aria-hidden] { background: var(--ink); }
.switch input:checked + span[aria-hidden]::after { transform: translateX(12px); }
.switch input:focus-visible + span[aria-hidden] { outline: 2px solid var(--focus); outline-offset: 1px; }
/* rule builder */
.ruleform { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 9px; }
.rf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rf-kind { background: var(--surface-3); }
.rf-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.rf-sentence select { max-width: 100%; }
.rf-match { flex: 1 1 140px; min-width: 120px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; padding: 4px 8px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.rf-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.rf-err { margin-right: auto; color: var(--ot-failed); font-size: 12px; }
@media (max-width: 900px) { .rules-cols, .custom-cols { grid-template-columns: 1fr; gap: 18px; } }

/* ------------------------------------------------------------------ upload page (analyze.html) */
.anwrap { max-width: 1180px; }
@media (min-width: 1200px) { body.docked:not(.dock-off) .anwrap, body.docked.panel-open .anwrap { padding-right: calc(var(--panel-w) + 24px); max-width: calc(1180px + var(--panel-w)); } }
.anscreen { display: flex; flex-direction: column; gap: 14px; }
.anscreen > .pagehead { margin-bottom: 0; }
#err { margin-bottom: 14px; }
/* one upload: file bar, comparison with the corpus */
.filebar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.fb-l { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; min-width: 0; }
.fname { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; letter-spacing: -0.01em; }
.fmeta { display: inline-flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; font-size: 12.5px; }
.fmeta .model { color: var(--muted); font-size: 11.5px; }
.fb-r { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.fb-nav { display: inline-flex; gap: 4px; }
.fld { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; }
.fld input[type="text"] { width: 64px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; padding: 3px 7px; }
.notes .note { margin: 0 0 4px; }
.notes:empty { display: none; }
.dt-acts { margin: 10px 0 0; }
.busy { position: fixed; z-index: 65; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; background: var(--ink); color: var(--surface); padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow-lg); font-size: 12.5px; font-weight: 600; }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--surface) 35%, transparent); border-top-color: var(--surface); animation: spin .8s linear infinite; flex: none; }
.spin.small { width: 10px; height: 10px; border-color: color-mix(in srgb, var(--ink) 20%, transparent); border-top-color: var(--ink-2); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* ------------------------------------------------------------------ narrow screens (new pages) */
@media (max-width: 1100px) {
  .top .logo .word { display: none; }
}
@media (max-width: 760px) {
  .nav a { padding: 4px 7px; }
  .rstate .lbl { display: none; }
  .pagehead h1 { font-size: 19px; }
  .legendcard { grid-template-columns: 1fr; gap: 4px; }
  .lg-row + .lg-row .lg-v { border-top: 0; padding-top: 0; }
  .brow.head { display: none; }
  .filebar { align-items: flex-start; }
  .rulelist.edit .rule { grid-template-columns: 30px minmax(0, 1fr); }
  .rulelist.edit .rule > .fixed, .rulelist.edit .rule > .rbtns { grid-column: 2; justify-self: start; }
  .hitrow { display: flex; margin: 4px 0 0; }
}

/* Lookup tables page: the codebook's tables, read-only */
.lt-wrap { overflow-x: auto; margin: 8px 0 6px; border: 1px solid var(--border); border-radius: 8px; }
.ltable { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.45; }
.ltable.small { font-size: 12px; }
.ltable th { text-align: left; font-weight: 600; color: var(--ink-2); background: var(--surface-2); padding: 6px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ltable td { padding: 6px 9px; border-top: 1px solid var(--grid); vertical-align: top; }
.ltable tr:first-child td { border-top: 0; }
.ltable td:first-child { white-space: nowrap; }
.lt-follow { font-style: italic; color: var(--ink-2); }
.lt-note { margin: 6px 0 0; }
.lt-note .lockic { vertical-align: -1px; color: var(--muted); }
.lt-more summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); margin: 6px 0; }
.rf-sentence > .rid { align-self: center; }

/* Lookup tables page: version and rows bar, the user's rows, add forms, built-in blocks */
.lt-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; margin-bottom: 14px; }
.lt-bar b { font-size: 13.5px; }
.lt-sep { width: 1px; align-self: stretch; background: var(--border); }
.lt-bar-r { margin-left: auto; display: flex; gap: 6px; }
.lt-h { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin-bottom: 6px; }
.lt-h h2 { margin: 0; }
.lt-rows { list-style: none; margin: 6px 0 2px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--focus) 40%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--focus) 5%, var(--surface)); font-size: 12.5px; }
.lt-row.off { opacity: .55; }
.lt-row .lt-sent { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.lt-yours { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--focus); }
.lt-opens { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.lt-add { margin: 8px 0 4px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); }
.lt-add[hidden] { display: none; }
.lt-add h3 { font-size: 13px; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.lt-fields { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.lt-f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.lt-f.lt-grow { flex: 1 1 260px; }
.lt-f input[type="text"], .lt-f select { font: inherit; font-weight: 450; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 9px; min-height: 34px; }
.lt-f input[type="text"] { font-family: ui-monospace, Menlo, monospace; width: 100%; }
.lt-f input[type="text"]:focus, .lt-f select:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.lt-f input.lt-arg { width: 150px; }
/* the sentence the rule will read, left of the form's buttons */
.lt-preview { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.lt-foot .lt-preview + .rf-err:empty { display: none; }
.lt-add .lt-hint { margin: 8px 0 0; }
.lt-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.lt-foot .rf-err { margin-right: auto; }
.lt-foot .lt-preview + .rf-err { margin-right: 0; }
.lt-built { margin-top: 10px; border-top: 1px solid var(--grid); padding-top: 8px; }
.lt-built > summary { cursor: pointer; font-size: 12.5px; padding: 3px 0; list-style-position: inside; }
.lt-built > summary:hover b { text-decoration: underline; text-underline-offset: 2px; }
.lt-built[open] > summary { margin-bottom: 4px; }
.lt-sub { font-size: 12.5px; margin: 12px 0 4px; }
.lt-shell { font-size: 12.5px; line-height: 1.9; margin: 0; }
.lt-steps { margin: 4px 0 0; padding-left: 20px; font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.ltable code, .lt-shell code { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 3px; white-space: nowrap; }
.ltable td.lt-prog code, .ltable td.lt-tools code, .lt-shell.lt-wrapcode code { white-space: normal; }
.lt-semi { color: var(--muted); margin-right: 2px; }
.ltable td.lt-tools { line-height: 1.9; min-width: 220px; }
.ltable td.lt-prog { color: var(--ink-2); min-width: 220px; }
.ltable td.lt-n { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 650; }
.ltable td:last-child { width: 1%; }
.lt-ag { font-size: 10.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 2px; white-space: nowrap; }
.lt-same { font-style: italic; color: var(--ink-2); cursor: help; }
.lt-change { white-space: nowrap; }
.lt-opts { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lt-opt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; font-size: 12.5px; }
.lt-opt > span:nth-child(2) { flex: 1 1 300px; min-width: 0; }
.lt-opt.on { border-color: color-mix(in srgb, var(--focus) 45%, transparent); background: color-mix(in srgb, var(--focus) 5%, var(--surface)); }

/* unrecognised steps (review.js): a tool or program per row, with a suggested row */
.unrec { padding: 12px 16px 14px; margin-bottom: 14px; border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.ur-h { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.ur-h h2 { font-size: 14px; margin: 0; }
.ur-intro { margin: 6px 0 8px; max-width: 900px; }
.ur-list { display: flex; flex-direction: column; }
.ur-row { display: grid; grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.4fr) minmax(260px, 1.2fr); gap: 6px 14px; align-items: start; padding: 8px 0; border-top: 1px solid var(--grid); }
.ur-what { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.ur-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ot-warn); }
.ur-key { font-size: 12.5px; font-weight: 650; overflow-wrap: anywhere; }
.ur-ex { line-height: 1.6; min-width: 0; }
.ur-ex code { font-size: 11px; overflow-wrap: anywhere; }
.ur-act { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ur-act select { max-width: 100%; min-width: 0; flex: 1 1 180px; }
.ur-why { flex-basis: 100%; }
.ur-row.need select { outline: 2px solid var(--o-failed); outline-offset: 1px; }
.unrec-tag { color: var(--ot-warn); font-weight: 650; cursor: help; }
@media (max-width: 900px) { .ur-row { grid-template-columns: 1fr; } }

/* details panel: how a verdict was read, what decided a phase outcome, full texts, raw JSON */
.dt-ev { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.dt-ev.v-pass { color: var(--svt-pass); }
.dt-ev.v-fail { color: var(--svt-err); }
.evl { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; color: var(--ink); overflow-wrap: anywhere; }
.dt-why { margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.lnk { border: 0; background: none; padding: 0; font: inherit; font-weight: 650; color: var(--focus); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.jby { margin-left: 6px; font-size: 10.5px; font-weight: 650; color: var(--ink-2); border: 1px dashed var(--border-strong); border-radius: 999px; padding: 0 6px; line-height: 16px; white-space: nowrap; cursor: help; }
.dt-full { margin-left: 6px; text-transform: none; letter-spacing: 0; font-weight: 450; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
/* the thought and the result in full, in a fixed window that scrolls (as the raw JSON), so the
   phase and its outcome stay close below */
.dt-text.dt-long { max-height: 180px; overflow: auto; }
.dt-code.dt-long { max-height: 300px; overflow: auto; }
.dt-json { max-height: 420px; font-size: 11px; }
.dt-raw .dt-k { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.dt-raw .dt-k .muted { text-transform: none; letter-spacing: 0; font-weight: 450; }
.dt-raw .dt-k .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.dt-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.dt-acts [data-raw][aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
mark.evm { background: color-mix(in srgb, var(--warn) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }


/* ------------------------------------------------------------------ upload page (upload.html) */
.upwrap { max-width: 1000px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; border: 2px dashed var(--border-strong); text-align: center; box-shadow: none; }
.drop.over { border-color: var(--focus); background: color-mix(in srgb, var(--focus) 6%, var(--surface)); }
.drop-i { font-size: 22px; color: var(--muted); line-height: 1; }
.upcfg { margin-top: 14px; padding: 14px 16px; }
.relopts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.relopt { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; position: relative; }
.relopt input { position: absolute; opacity: 0; pointer-events: none; }
.relopt span { color: var(--muted); font-size: 12px; }
.relopt.on { border-color: var(--sel); box-shadow: 0 0 0 1px var(--sel); background: var(--sel-bg); }
.relopt:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.grpfields { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.grpfields .fld.grow { flex: 1; min-width: 200px; }
.grpfields .fld.grow input { width: 100%; }
.ufrow { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 90px 60px 132px 32px; gap: 10px; align-items: center; padding: 7px 2px; border-top: 1px solid var(--border); }
.ufrow.runs { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 90px 60px 64px 132px 32px; }
.ufrow.head { border-top: 0; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; padding-bottom: 3px; }
.uf-name { display: flex; flex-direction: column; min-width: 0; }
.uf-name b, .uf-model { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uf-model { display: block; }
.uf-run { width: 56px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); border-radius: 7px; padding: 3px 6px; }
.ufrow .num { font-variant-numeric: tabular-nums; }
.relmsg { margin: 10px 0 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink-2); }
.relmsg:empty { display: none; }
.relmsg .bad { color: var(--ot-failed); font-weight: 600; }
.upfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.drop.compact { padding: 14px 16px; }
.drop.compact .drop-i { display: none; }
.layout-help { max-width: 560px; text-align: left; font-size: 12.5px; }
.layout-help summary { cursor: pointer; color: var(--muted); text-align: center; }
.layout-help .tree { margin: 8px 0 4px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; font-size: 12px; line-height: 1.5; overflow-x: auto; }
/* a folder's runs; a run already in the table offers Replace / Add */
.ufrow.clashes { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 90px 60px 132px minmax(190px, 1.3fr) 32px; }
.ufrow.runs.clashes { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 90px 60px 64px 132px minmax(190px, 1.3fr) 32px; }
.ufrow.frun { grid-template-columns: minmax(80px, 1fr) minmax(90px, 1fr) 54px minmax(0, 2fr) 60px minmax(200px, 1.6fr); }
.ufrow.frun.hasclash { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.fhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fhead h2 { font-size: 15px; margin: 0; display: flex; align-items: baseline; gap: 6px; }
.fnotes { margin: 6px 0 10px; }
.fnotes p { margin: 2px 0; }
#fTable { max-height: 60vh; overflow-y: auto; }
.clash { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clash-w { font-size: 11.5px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.bulk { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--link, var(--focus)); cursor: pointer; font: inherit; text-decoration: underline; }
@media (max-width: 760px) {
  .relopts { grid-template-columns: 1fr; }
  .ufrow, .ufrow.runs, .ufrow.clashes, .ufrow.runs.clashes, .ufrow.frun { grid-template-columns: 1fr 1fr; }
  .ufrow.head { display: none; }
}

/* ------------------------------------------------------------------ comparison group (analyze.html#g=) */
.grpbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; margin-bottom: 10px; }
.grpbar h1 { font-size: 16px; margin: 0; }
.grpbar .gk { color: var(--muted); font-size: 12px; }
.gmembers { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.gmem { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; font-size: 12.5px; }
.gmem[aria-pressed="true"] { border-color: var(--sel); box-shadow: 0 0 0 1px var(--sel); }
.gmem .n { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
