/* Theme tokens. Every colour in this file and in the pages is one of these, so a theme is only this block.
   Day is the default; night applies with data-theme="dark" (set by /theme.js from the person's choice, before
   paint) or, without JavaScript, from the operating system. Never write a literal colour below this block:
   add a token here instead, in both themes. */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f5; --panel: #ffffff; --ink: #1d1d1b; --muted: #6b6b66; --line: #e4e3de; --line-strong: #cfcdc6;
  --accent: #2f5bd3; --accent-ink: #ffffff; --accent-soft: #e8eefc;
  --del-bg: #fbe9e7; --del-strong: #f2b8b0; --add-bg: #e6f4ea; --add-strong: #a8dab5;
  --good: #1f7a3d; --warn: #9a6400; --bad: #b3261e; --chip: #efeee9; --band: #e6e5df;
  --warn-bg: #fff4dc; --warn-ink: #6b4a00; --warn-line: #f0d58f;
  --s-low: #d93b30; --s-mid: #e0a100; --s-good: #2e9e52; --s-max: #12c95a; --s-ghost: #e9e8e3;
  --on-strong: #ffffff; --on-mid: #1d1d1b;
  --shadow-sm: 0 8px 28px rgba(0, 0, 0, .14); --shadow-md: 0 14px 40px rgba(0, 0, 0, .18); --shadow-lg: 0 24px 80px rgba(0, 0, 0, .3);
  --backdrop: rgba(10, 10, 9, .5);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151514; --panel: #1d1d1b; --ink: #ecebe6; --muted: #9b9a94; --line: #2c2c29; --line-strong: #3b3b37;
  --accent: #7c9cf5; --accent-ink: #10131c; --accent-soft: #1f2840;
  --del-bg: #3a1d1a; --del-strong: #6b2b25; --add-bg: #17301f; --add-strong: #24573a;
  --good: #6fcf8e; --warn: #e5b45c; --bad: #ff8a80; --chip: #2a2a27; --band: #0f0f0e;
  --warn-bg: #3a2d10; --warn-ink: #f1cf86; --warn-line: #5c4718;
  --s-low: #ef5a4f; --s-mid: #e8b420; --s-good: #3dbb66; --s-max: #3dff8b; --s-ghost: #2e2e2b;
  --on-strong: #ffffff; --on-mid: #1d1d1b;
  --shadow-sm: 0 8px 28px rgba(0, 0, 0, .45); --shadow-md: 0 14px 40px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 80px rgba(0, 0, 0, .6);
  --backdrop: rgba(0, 0, 0, .62);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
  --bg: #151514; --panel: #1d1d1b; --ink: #ecebe6; --muted: #9b9a94; --line: #2c2c29; --line-strong: #3b3b37;
  --accent: #7c9cf5; --accent-ink: #10131c; --accent-soft: #1f2840;
  --del-bg: #3a1d1a; --del-strong: #6b2b25; --add-bg: #17301f; --add-strong: #24573a;
  --good: #6fcf8e; --warn: #e5b45c; --bad: #ff8a80; --chip: #2a2a27; --band: #0f0f0e;
  --warn-bg: #3a2d10; --warn-ink: #f1cf86; --warn-line: #5c4718;
  --s-low: #ef5a4f; --s-mid: #e8b420; --s-good: #3dbb66; --s-max: #3dff8b; --s-ghost: #2e2e2b;
  --on-strong: #ffffff; --on-mid: #1d1d1b;
  --shadow-sm: 0 8px 28px rgba(0, 0, 0, .45); --shadow-md: 0 14px 40px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 80px rgba(0, 0, 0, .6);
  --backdrop: rgba(0, 0, 0, .62);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line-strong); background: var(--panel); border-radius: 6px; padding: 6px 12px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 10px; width: 100%; }
textarea { min-height: 72px; resize: vertical; }
label { display: block; font-weight: 600; margin: 14px 0 4px; }
.hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.wrap { max-width: 980px; margin: 0 auto; padding: 32px 20px 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.topbar .brand, .tabs button, .score-pill { white-space: nowrap; }
.topbar { flex-wrap: wrap; row-gap: 6px; min-width: 0; }
.score-pill { display: inline-flex; align-items: center; gap: 8px; }
.brand img { height: 26px; width: auto; display: block; }
.brand span { color: var(--ink); }
h1 { font-size: 28px; letter-spacing: -.02em; margin: 8px 0 6px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.hero-input { display: flex; gap: 8px; margin-top: 14px; }
.hero-input input { font-size: 17px; padding: 12px 14px; }
.hero-input button { padding: 0 22px; font-size: 15px; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
details > summary { cursor: pointer; color: var(--muted); margin-top: 14px; }
.estimate { margin-top: 14px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 16px; }
.est-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.level-meter { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; font-size: 12px; }
.level-meter span { padding: 2px 10px; color: var(--muted); }
.level-meter span + span { border-left: 1px solid var(--line-strong); }
.level-meter .on { color: var(--on-strong); font-weight: 600; }
.level-meter .on.low { background: var(--s-good); }
.level-meter .on.medium { background: var(--s-mid); color: var(--on-mid); }
.level-meter .on.heavy { background: var(--s-low); }
.est-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; }
@media (max-width: 720px) { .est-grid { grid-template-columns: 1fr; } }
.est-k { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.est-v { font-size: 20px; font-weight: 600; margin: 2px 0; }
.est-level { margin: 14px 0 0; }
.est-level.heavy { color: var(--bad); }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.banner { border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 13.5px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.banner.ok { background: var(--add-bg); color: var(--good); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
/* Column headers stay in view while a long table scrolls. The bottom rule is a shadow because collapsed borders
   don't travel with a sticky cell. */
thead th { position: sticky; top: 0; z-index: 3; background: var(--bg); border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line-strong); }
.pane thead th { top: -18px; } /* flush with the top of the viewer pane, past its 18px padding */
.status { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.status.done { background: var(--add-bg); color: var(--good); }
.status.running { background: var(--accent-soft); color: var(--accent); }
.status.failed, .status.cancelled, .status.interrupted { background: var(--del-bg); color: var(--bad); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.chip { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--chip); color: var(--muted); margin-left: 4px; }

/* Run page */
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.dot.done { background: var(--good); border-color: var(--good); }
.dot.running { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
.dot.failed, .dot.cancelled { background: var(--bad); border-color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-note { color: var(--muted); font-size: 13px; }
.stage-err { color: var(--bad); font-size: 12.5px; white-space: pre-wrap; }
.log { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; height: 360px; overflow: auto; padding: 10px 12px; font: 12px/1.55 var(--mono); }
.log .ln { white-space: pre-wrap; word-break: break-word; }
.log .ln b { color: var(--muted); font-weight: 400; }

/* Viewer */
.app { display: grid; grid-template-rows: auto 1fr; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar .site { font-weight: 600; }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tabs button { border: none; background: none; padding: 6px 12px; border-radius: 6px; color: var(--muted); }
.tabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.score-pill { margin-left: auto; font-size: 13px; color: var(--muted); }
.score-pill strong { color: var(--ink); font-size: 15px; }
.body { display: grid; grid-template-columns: 290px 1fr; min-height: 0; }
/* Sidebar: site files above, the open file's change log below, each scrolling on its own (vertically only). The
   rows are set by viewer.js (layoutSidebar): a draggable split, or one pane minimised to its title bar. */
.sidebar { border-right: 1px solid var(--line); background: var(--panel); overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) 7px minmax(0, 1fr); min-height: 0; }
.sidebar input { margin: 0 12px 8px; width: calc(100% - 24px); padding: 6px 9px; }
.sb-pane { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
/* Fixed rows, so a hidden divider never lets the log slide into its row. */
#sb-tree { grid-row: 1; } #sb-split { grid-row: 2; } #sb-log { grid-row: 3; }
/* Section headers: a darker band than the panel, so the tree and the log read as two blocks. */
.sb-head { display: flex; align-items: center; gap: 4px; padding: 5px 6px 5px 4px; border-bottom: 1px solid var(--line-strong); flex: none; background: var(--band); }
.sb-title { flex: 1; text-align: left; border: 0; background: none; padding: 3px 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); border-radius: 5px; }
.sb-title:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.sb-head .sb-min { background: transparent; border-color: transparent; }
.sb-head .sb-min:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.sb-title .muted { font-weight: 500; }
.sb-min { width: 24px; height: 24px; padding: 0; display: inline-grid; place-items: center; }
.sb-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
#sb-tree .sb-body { padding-top: 8px; }
.sb-split { cursor: row-resize; position: relative; background: var(--panel); touch-action: none; outline: none; }
.sb-split::before { content: ''; position: absolute; left: 0; right: 0; top: 3px; height: 1px; background: var(--line-strong); }
.sb-split::after { content: ''; position: absolute; left: 50%; top: 1px; width: 28px; height: 5px; margin-left: -14px; border-radius: 3px; background: var(--line-strong); }
.sb-split:hover::before, .sb-split:focus-visible::before, body.sb-dragging .sb-split::before { background: var(--accent); height: 2px; top: 2.5px; }
.sb-split:hover::after, .sb-split:focus-visible::after, body.sb-dragging .sb-split::after { background: var(--accent); }
body.sb-dragging { cursor: row-resize; user-select: none; }
#sb-log .sb-head { border-top: 1px solid var(--line-strong); }
.sidebar[data-min] .sb-split { display: none; }
.sidebar[data-min="tree"] #sb-tree .sb-body, .sidebar[data-min="log"] #sb-log .sb-body { display: none; }
.sidebar[data-min="tree"] #sb-tree .sb-head { border-bottom: 0; }
/* Off the Files tab there is no open file, so the tree takes the whole panel. */
.sidebar.no-log { grid-template-rows: minmax(0, 1fr) 0 0 !important; }
.sidebar.no-log .sb-split, .sidebar.no-log #sb-log { display: none; }
.sidebar.no-log #sb-tree .sb-body { display: block; }
.sidebar.no-log .sb-min[data-sb-toggle="tree"] { display: none; }
/* Change rows in the narrow panel: attribute and a mini score on one line, step · stage · id under it, then the
   reasons, all tight. */
/* Each change is a card: a header band (attribute, mini score, step · id), a line, then the reason and the small
   print. Cards sit apart on the panel background and lift on hover. */
#chglog { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
#chglog .chg { display: block; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; cursor: default; line-height: 1.45; transition: border-color .12s, box-shadow .12s, transform .12s; }
#chglog .chg.jumps { cursor: pointer; }
#chglog .chg:hover, #chglog .chg:focus-within { border-color: var(--accent); box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 10%, transparent); }
#chglog .chg.jumps:hover { transform: translateY(-1px); }
#chglog .chg.jumps:hover .chg-head { background: var(--accent-soft); }
#chglog .chg-head { padding: 8px 12px 7px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--chip) 55%, var(--panel)); transition: background .12s; }
#chglog .chg-top { display: flex; align-items: center; gap: 8px; }
#chglog .chg-top .attr { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
#chglog .chg-mini { flex: none; margin-left: auto; }
#chglog .chg-step { margin: 3px 0 0; }
#chglog .chg-id { font-family: var(--mono); font-size: 11px; }
#chglog .chg-sens { color: var(--warn); }
#chglog .chg-body { padding: 9px 12px 10px; }
#chglog .why { margin: 0 0 6px; font-size: 12.5px; }
#chglog .exp { font-size: 11.5px; line-height: 1.4; margin-top: 2px; }
#chglog .chg-claims { font-size: 11px; margin-top: 5px; }
#chglog .sb-empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 8px; }
/* A minified before → after score: small numbers and thin bars. */
.joined.xs { grid-template-columns: auto auto auto auto auto; column-gap: 3px; }
.joined.xs .jn { font-size: 11px; }
.joined.xs .jd { font-size: 10.5px; min-width: 18px; }
.joined.xs .pips { gap: 1px; }
.joined.xs .pips i { width: 3px; height: 9px; border-radius: 1px; }
.joined.xs .jm { height: 9px; }
.joined.xs .pips.na, .joined.xs .pips.pending { width: calc(10 * 3px + 9 * 1px); }
.sb-empty { padding: 14px 12px; font-size: 12.5px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; }
.node { display: flex; align-items: center; gap: 6px; padding: 3px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.node:hover { background: var(--bg); }
.node.on { background: var(--accent-soft); color: var(--accent); }
.node .name { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.node .badge { font-size: 10px; font-weight: 700; border-radius: 3px; padding: 0 4px; }
.badge.new { background: var(--add-strong); color: var(--good); }
.badge.merge, .badge.rewrite { background: var(--accent-soft); color: var(--accent); }
.badge.retired { background: var(--del-strong); color: var(--bad); }
.node .count { font-size: 11px; color: var(--muted); }
.folder { font-weight: 600; color: var(--muted); }
.group { padding: 10px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.main { overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.filebar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.filebar .opts { margin-left: auto; display: flex; gap: 14px; color: var(--muted); }
.filebar .opts label { display: inline-flex; gap: 5px; margin: 0; font-weight: 400; align-items: center; }
.filebar .opts input { width: auto; }
.chg { font-size: 12.5px; }
.chg-step { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chg-step .step-no { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chg .attr { font-weight: 600; }
.chg .why { color: var(--ink); margin-bottom: 3px; }
.chg .exp { color: var(--muted); }
@media (max-width: 760px) { .chg { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.diff { overflow: auto; font: 12.5px/1.55 var(--mono); background: var(--panel); }
.diff-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border-bottom: 1px solid var(--line-strong); }
.diff-head div { padding: 7px 12px; font: 600 12px var(--sans); }
.diff-head div + div { border-left: 1px solid var(--line-strong); }
.diff-head .lbl { color: var(--muted); font-weight: 400; margin-left: 6px; font-family: var(--mono); }
.rows { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px minmax(0, 1fr); }
.rows > div { padding: 0 8px; white-space: pre-wrap; word-break: break-word; min-height: 19px; }
.rows .no { color: var(--muted); text-align: right; user-select: none; padding-right: 8px; opacity: .7; }
.rows .no.r { border-left: 1px solid var(--line-strong); }
.rows .del { background: var(--del-bg); }
.rows .add { background: var(--add-bg); }
.rows .del mark { background: var(--del-strong); color: inherit; border-radius: 2px; }
.rows .add mark { background: var(--add-strong); color: inherit; border-radius: 2px; }
.rows .empty { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--bg) 6px 12px); }
.rows .fold { grid-column: 1 / -1; text-align: center; color: var(--accent); background: var(--bg); cursor: pointer; font-family: var(--sans); font-size: 12px; padding: 3px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rows .flash { outline: 2px solid var(--accent); outline-offset: -2px; }
.placeholder { padding: 40px; color: var(--muted); font-family: var(--sans); }
.pane { overflow: auto; padding: 18px 22px 40px; }
.idx { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.idx .card { padding: 14px 18px; min-width: 160px; }
.idx .big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--line-strong); vertical-align: middle; }
.bar.after { background: var(--accent); }
.delta-pos { color: var(--good); font-weight: 600; }
.delta-neg { color: var(--bad); font-weight: 600; }
tr.attr-row td { font-size: 13px; }
.ev { color: var(--muted); font-size: 12px; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; padding: 5px 8px; }

/* Score pips: ten slots, before and after joined in the middle */
.joined { display: inline-grid; grid-template-columns: 22px auto 38px auto 22px; align-items: center; column-gap: 5px; white-space: nowrap; vertical-align: middle; }
.joined .jn { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.joined .jn.b { text-align: right; color: var(--muted); }
.joined .jd { font-size: 12.5px; font-variant-numeric: tabular-nums; display: flex; justify-content: center; align-items: center; }
.joined .jm { width: 2px; height: 18px; border-radius: 1px; background: var(--line-strong); }
.pips { display: inline-flex; gap: 2px; }
.pips i { width: 6px; height: 16px; border-radius: 2px; background: var(--s-ghost); }
.pips.low i.on { background: var(--s-low); }
.pips.mid i.on { background: var(--s-mid); }
.pips.good i.on { background: var(--s-good); }
.pips.max i.on { background: var(--s-max); box-shadow: 0 0 6px color-mix(in srgb, var(--s-max) 55%, transparent); }
.pips.na, .pips.pending { width: calc(10 * 6px + 9 * 2px); justify-content: center; }
.pips.l.na { justify-content: flex-end; }
.pips.r.na { justify-content: flex-start; }
.pips-na { font-size: 11px; color: var(--muted); }
.joined.sm { grid-template-columns: 18px auto 32px auto 18px; column-gap: 4px; }
.joined.sm .pips i { width: 4px; height: 12px; border-radius: 1.5px; }
.joined.sm .pips { gap: 1.5px; }
.joined.sm .pips.na, .joined.sm .pips.pending { width: calc(10 * 4px + 9 * 1.5px); }
.joined.sm .jm { height: 14px; }
.joined.sm .jn, .joined.sm .jd { font-size: 12px; }

/* Tooltips */
.tip { position: fixed; z-index: 1000; max-width: 380px; background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; font: 12.5px/1.5 var(--sans); box-shadow: var(--shadow-sm); pointer-events: none; }
.tip-title { font-weight: 600; margin-bottom: 3px; }
.tip-what { color: var(--muted); margin-bottom: 6px; }
.tip-quote { border-left: 3px solid var(--accent); padding-left: 8px; margin: 6px 0; }
.tip-row { display: grid; grid-template-columns: 74px 1fr; gap: 6px; font-size: 12px; }
.tip-row span { color: var(--muted); }
.tip-flag { margin-top: 6px; font-size: 12px; color: var(--warn); }
.tip ul { margin: 6px 0 0; padding-left: 18px; }
.code { border-bottom: 1px dotted var(--muted); cursor: help; font-family: var(--mono); font-size: .95em; }
[data-tip], [data-tip-html] { cursor: help; }
.has-tip { border-bottom: 1px dotted var(--muted); }

/* Full-page modal */
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: var(--backdrop); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 3vh 3vw; animation: fade .12s ease-out; }
.modal { position: relative; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 14px; width: min(1200px, 100%); height: 100%; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-body { overflow: auto; padding: 30px 38px 48px; }
/* Compact confirmation dialog */
.modal-backdrop.sm { padding: 16px; }
.modal.sm { width: min(540px, 100%); height: auto; max-height: 100%; }
.modal.sm .modal-body { padding: 26px 28px 24px; }
.confirm-title { margin: 0 44px 12px 0; font-size: 19px; }
.modal.sm p { margin: 0 0 10px; line-height: 1.5; }
.confirm-list { margin: 6px 0 4px; font-size: 13px; }
.confirm-list summary { cursor: pointer; color: var(--muted); }
.confirm-list ol { max-height: 200px; overflow: auto; margin: 8px 0 0; padding-left: 22px; }
.confirm-list li { margin: 2px 0; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal .banner { margin: 12px 0 0; }
button.primary.danger { background: var(--bad); border-color: var(--bad); color: var(--on-strong); }
.modal-x { position: absolute; top: 14px; right: 16px; z-index: 2; width: 34px; height: 34px; padding: 0; line-height: 0; border-radius: 50%; display: grid; place-items: center; }
.modal-x svg { display: block; }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 720px) { .modal-backdrop { padding: 0; } .modal { border-radius: 0; } .modal-body { padding: 22px 16px 40px; } }

/* Strategy overlay */
.strat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-right: 40px; }
.strat-head h1 { margin: 0; }
.strat-goal { font-size: 17px; line-height: 1.55; max-width: 860px; margin: 12px 0 22px; }
.strat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .strat-grid { grid-template-columns: 1fr; } }
.strat-sec { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.strat-sec h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.strat-sec ul, .strat-sec ol { margin: 0; padding-left: 20px; }
.strat-sec li { margin: 4px 0; }
.strat-sec ol.steps { list-style: none; padding: 0; counter-reset: s; }
.strat-sec ol.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 8px; margin: 8px 0; }
.strat-sec ol.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.io { display: grid; grid-template-columns: 1fr 24px 1fr; align-items: start; gap: 8px; }
.io .arrow { text-align: center; color: var(--muted); font-size: 20px; padding-top: 22px; }
.io ul { list-style: none; padding: 0; }
.io li { font-family: var(--mono); font-size: 12px; background: var(--chip); border-radius: 5px; padding: 4px 8px; margin: 4px 0; }
.guard li::marker { content: '⚠ '; color: var(--warn); }
.checks li::marker { content: '✓ '; color: var(--good); }
.strat-attr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.strat-attr:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.attr-score { border-left: 1px solid var(--line); padding-left: 24px; }
.attr-score h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.attr-score .kv { grid-template-columns: 110px 1fr; }
.attr-score .anchors { grid-template-columns: 1fr; gap: 6px; }
.attr-score .anchors > div { display: grid; grid-template-columns: 26px 1fr; align-items: baseline; }
.attr-score .anchors b { font-size: 15px; }
@media (max-width: 860px) { .strat-attr { grid-template-columns: 1fr; gap: 14px; } .attr-score { border-left: 0; padding-left: 0; } }
.attr-card h4 { margin: 0 0 6px; font-size: 15px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 13px; margin-top: 8px; }
.kv > span { color: var(--muted); }
.anchors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.anchors > div { border-radius: 8px; padding: 8px 10px; font-size: 12.5px; background: var(--chip); }
.anchors b { display: block; font-size: 16px; }
.anchors .a0 b { color: var(--s-low); } .anchors .a5 b { color: var(--s-mid); } .anchors .a10 b { color: var(--s-good); }
.tiers-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tiers-mini > div { background: var(--chip); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.mode { font-size: 10.5px; border-radius: 3px; padding: 0 4px; margin-left: 4px; background: var(--panel); color: var(--muted); }

/* Pipeline table */
.icon-btn { border: 1px solid transparent; background: none; padding: 3px; border-radius: 6px; color: var(--muted); line-height: 0; }
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.icon-btn:disabled { opacity: .3; border-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.log-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.log-head h2 { margin: 0; }
.log-head select { width: auto; margin-left: auto; padding: 4px 8px; font-size: 13px; max-width: 60%; }
.log-head .clear { font-size: 12px; }
.log .ln b[data-tip] { cursor: help; }
.log .empty { color: var(--muted); font-family: var(--sans); }
.run-total { color: var(--muted); font-size: 12.5px; }
/* Pipeline tab: fills the viewer below the top bar. The table and the log scroll inside it. */
.pipeline-pane { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; padding: 14px 18px 16px; }
.pipeline-pane > .banner { margin: 0; }
.pl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pl-version select { width: auto; padding: 4px 8px; font-size: 13px; font-weight: 600; }
.pl-actions { margin-left: auto; display: flex; gap: 8px; }
.pipeline-pane .runlayout { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Pipeline header: title, totals, layout switch and log button */
.pipe { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.pipe-head { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pipe-head h2 { margin: 0; }
.pipe-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 5px 12px; font-size: 13px; background: var(--panel); color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
#openlog { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 12px; }
#openlog .ico { line-height: 0; }
#openlog[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
body.view-split #openlog { display: none; }

/* The table: one line per stage */
/* The table scrolls inside the card (both ways), so its sticky header holds while the rows move. */
.table-scroll { overflow: auto; flex: 1 1 auto; min-height: 0; }
.stage-table { font-size: 13px; }
.stage-table th, .stage-table td { white-space: nowrap; vertical-align: middle; padding: 8px 12px; }
.stage-table th { font-size: 11px; background: var(--bg); position: sticky; top: 0; }
.stage-table tbody tr:last-child td { border-bottom: 0; }
.stage-table tbody tr:hover td { background: color-mix(in srgb, var(--chip) 55%, transparent); }
.stage-table tbody tr.on td { background: var(--accent-soft); }
.stage-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stage-table .c-act { width: 1%; padding-right: 4px; }
.stage-table .acts { display: flex; gap: 2px; }
.stage-table .c-stage { display: flex; align-items: center; gap: 9px; }
.stage-table .c-stage .name { font-weight: 600; }
.stage-table .c-stage .name[data-tip] { cursor: help; }
.stage-table tr.failed .name { color: var(--bad); }
.err-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--bad); color: var(--on-strong); font-size: 11px; font-weight: 700; }
.stage-table .model { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Layouts. Pipeline: the table takes the page and the log slides in from the right, full height.
   Split: the condensed table and the log share the screen half and half. */
.logpane { display: flex; flex-direction: column; min-height: 0; }
.logpane .log { flex: 1; min-height: 0; height: auto; }
.log-close { display: none; }
body.view-pipeline .logpane { position: fixed; top: 0; right: 0; bottom: 0; z-index: 800; width: min(680px, 94vw); padding: 18px 18px 18px 20px;
  background: var(--bg); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-md);
  transform: translateX(100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
body.view-pipeline.log-open .logpane { transform: none; visibility: visible; transition: transform .22s ease; }
body.view-pipeline .log-close { display: inline-flex; }
body.view-split .pipeline-pane .runlayout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 18px; }
body.view-split .logpane { min-height: 0; height: 100%; }
body.view-split .stage-table .c-x { display: none; }
@media (max-width: 900px) {
  body.view-split .pipeline-pane .runlayout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .logpane { transition: none !important; } }

/* Home: an internal tool page. Wide where the window allows; the intro and the URL box keep a readable width. */
.wrap.home { max-width: 1520px; padding: 36px 32px 72px; }
@media (max-width: 720px) { .wrap.home { padding: 24px 16px 56px; } }
.home h1 { margin-top: 18px; }
.home .lede { max-width: 760px; margin: 0 0 6px; font-size: 14.5px; }
.home #f, .home #health { max-width: 980px; }
.home h2 { margin: 40px 0 12px; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-seg button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; }
.theme-seg button span { font-size: 12px; }
.theme-seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 600px) { .theme-seg button span { display: none; } }
.topbar .theme-seg { margin-left: 8px; }

/* Trials table: one line per site. Site, created, status, readiness, then the actions. */
.sites-card { padding: 0; overflow: visible; }
table.sites { table-layout: auto; }
table.sites th { white-space: nowrap; padding: 12px 20px; font-size: 11px; }
table.sites td { vertical-align: middle; white-space: nowrap; padding: 16px 20px; }
table.sites tbody tr:last-child td { border-bottom: 0; }
table.sites tbody tr:hover td { background: color-mix(in srgb, var(--chip) 45%, transparent); }
table.sites .c-site { width: 100%; }
.site-name { font-weight: 600; font-size: 14.5px; margin-right: 10px; }
.c-site .star { margin-left: 6px; vertical-align: -2px; }
.c-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.st-line { display: inline-flex; align-items: center; gap: 8px; }
.st-prog { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mode-chip { margin: 0; }
.score-line { display: inline-flex; align-items: baseline; gap: 6px; color: inherit; font-variant-numeric: tabular-nums; }
.score-line:hover { text-decoration: none; }
.score-line:hover .sc-n { text-decoration: underline; }
.score-line .arrow { color: var(--muted); }
.sc-n { font-weight: 600; }
.sc-n.low { color: var(--s-low); } .sc-n.mid { color: var(--s-mid); } .sc-n.good { color: var(--s-good); } .sc-n.max { color: var(--s-max); }
.sc-d { font-weight: 600; font-size: 12.5px; margin-left: 2px; }
.ver-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; vertical-align: 1px; }
@media (max-width: 1000px) { table.sites .c-when, table.sites th:nth-child(2) { display: none; } }

/* Buttons in the table: Open is the main one; the rest are quiet. */
.acts-cell { text-align: right; white-space: nowrap; width: 1%; position: relative; }
.acts-cell .acts { display: inline-flex; align-items: center; gap: 8px; }
.btn-open { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; padding: 5px 16px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn-open:hover { text-decoration: none; filter: brightness(1.08); }
.btn-open.sm { padding: 3px 12px; font-size: 12.5px; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 11px; background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 6px; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost.sm { padding: 3px 10px; font-size: 12.5px; }
/* Cancel a trial: quiet until hovered, then the colour of a cancelled status. */
.btn-ghost.btn-cancel:hover { border-color: var(--bad); color: var(--bad); }
.btn-ghost:disabled { opacity: .6; cursor: default; border-color: var(--line-strong); color: var(--muted); }
.btn-ghost svg { display: block; }
.btn-link { font-size: 13px; font-weight: 600; padding: 5px 4px; }
.ver-btn svg { transition: transform .15s; }
.ver-btn.open { border-color: var(--accent); color: var(--accent); }
.ver-btn.open svg { transform: rotate(180deg); }
@media (max-width: 760px) { .acts-cell .btn-link, .acts-cell [data-new] { display: none; } }

/* Versions list: one aligned row per version, with column headings, so it reads at a glance. */
.versions-menu { position: absolute; right: 12px; top: calc(100% - 6px); z-index: 60; width: min(1000px, calc(100vw - 32px)); text-align: left; white-space: normal;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-md); overflow: hidden; }
.vm-head { padding: 12px 18px; font-size: 13px; border-bottom: 1px solid var(--line); }
.vm-row { display: grid; grid-template-columns: 26px 86px 118px minmax(0, 1fr) 128px 118px 108px; align-items: center; column-gap: 14px; padding: 9px 18px; }
.vm-cols { padding-top: 8px; padding-bottom: 8px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--bg); }
.vm-list { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; }
.vm-list li { border-bottom: 1px solid var(--line); white-space: nowrap; }
.vm-list li:last-child { border-bottom: 0; }
.vm-list li:hover { background: color-mix(in srgb, var(--chip) 45%, transparent); }
.vm-list li.starred { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.vm-star { display: inline-grid; place-items: center; }
.vm-ver { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.vm-latest { margin: 0; background: var(--accent-soft); color: var(--accent); }
.vm-when { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vm-from { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.vm-score { font-size: 13px; }
.vm-acts { display: inline-flex; justify-content: flex-end; align-items: center; gap: 6px; }
@media (max-width: 760px) { .vm-row { grid-template-columns: 26px 70px minmax(0, 1fr) 112px; } .vm-row > :nth-child(3), .vm-row > :nth-child(4), .vm-row > :nth-child(6) { display: none; } }
.star-btn { border: 0; background: none; padding: 3px; border-radius: 6px; display: inline-grid; place-items: center; color: var(--muted); }
.star-btn:hover { background: var(--chip); color: var(--ink); }
.star-btn svg, .star svg { fill: none; stroke: currentColor; }
.star-btn.on, .star.on { color: var(--s-mid); }
.star-btn.on svg, .star.on svg { fill: currentColor; }
.star { display: inline-grid; place-items: center; }

/* Scorecard */
.idx { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.idx .card { padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.idx .card.main { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.idx .lbl { color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 6px; }
.idx .lbl .w { font-size: 11px; }
.idx .ba { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.idx .ba .from { color: var(--muted); font-weight: 600; }
.idx .ba .arrow { color: var(--muted); font-weight: 400; font-size: 18px; margin: 0 2px; }
.idx .pct { font-size: 13px; font-weight: 600; }
.idx .ba.low .to { color: var(--s-low); } .idx .ba.mid .to { color: var(--s-mid); } .idx .ba.good .to { color: var(--s-good); } .idx .ba.max .to { color: var(--s-max); }
.idx .ev { margin-top: 2px; }
/* The run's outcome at a glance: small cards under the index, each with a hover explanation; the ones that open a
   detail carry an arrow and lift on hover. */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; text-decoration: none; min-width: 0; cursor: help; transition: border-color .12s, box-shadow .12s, transform .12s; }
.stat.nav { cursor: pointer; }
.stat.nav:hover, .stat.nav:focus-visible { border-color: var(--accent); box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 10%, transparent); transform: translateY(-1px); outline: none; }
.st-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.st-lbl .go { color: var(--muted); flex: none; }
.stat.nav:hover .go { color: var(--accent); }
.st-val { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.st-val .of { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat.good .st-val { color: var(--s-good); }
.stat.warn .st-val { color: var(--s-low); }
.stat.note .st-val { color: var(--warn); }
.st-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Project size: a grid of headline cards, then tables of what was added and removed. */
.ps-intro { max-width: 860px; margin: 0 0 10px; }
.ps-defs { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 18px; font-size: 12.5px; }
.ps-defs > div { display: flex; gap: 6px; align-items: baseline; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.ps-defs b { white-space: nowrap; }
.ps-defs span { color: var(--muted); }
.ps { min-width: 0; }
.ps-scroll { overflow-x: auto; max-width: 100%; }
.ps h2.ps-h { margin-bottom: 4px; }
.ps .ps-defs + h2.ps-h { margin-top: 8px; }
.ps p.ps-sub { margin: 0 0 10px; max-width: 860px; }
.ps-bloat > div[data-tip-html] { cursor: help; }
.ps-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.ps-grid .st-sub { white-space: normal; line-height: 1.35; }
.ps-grid .stat.accent .st-val { color: var(--accent); }
.ps-arrow { color: var(--muted); font-weight: 400; margin: 0 6px; font-size: 15px; }
.ps-origins tr.ps-origin td { border-top: 1px solid var(--line-strong); }
.ps-origins tr.ps-kind td:first-child { padding-left: 26px; color: var(--muted); }
.ps-origins tr.ps-kind td { font-size: 12.5px; }
.ps td.ok { color: var(--s-good); font-weight: 600; }
.ps td.bad { color: var(--s-low); font-weight: 600; }
.ps tr.ps-total td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.ps-bloat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 14px; }
.ps-bloat > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel); }
.ps-bloat .est-v { color: var(--s-good); }
.ps-all { margin-top: 10px; }
.ps-all summary { cursor: pointer; color: var(--muted); }
@media (max-width: 760px) { .ps-bloat { grid-template-columns: 1fr; } }
/* Detail views behind the cards. */
.sz-detail-head { margin-bottom: 14px; }
.sz-detail-head .back { font-size: 13px; }
.sz-detail-head h2 { margin: 6px 0 4px; }
.sz-detail h3 { margin: 22px 0 8px; font-size: 14px; }
/* Verification findings: owners at a glance, one filter card per kind, a chip on every finding. */
.vf-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 12px; }
.vf-owner { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; text-decoration: none; font-size: 12.5px; }
.vf-owner.nav:hover { border-color: var(--accent); }
.vk-big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vf-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.vf-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--own); border-radius: 8px; background: var(--panel); color: inherit; cursor: pointer; }
.vf-kind:hover:not(:disabled) { border-color: var(--own); }
.vf-kind[aria-pressed="true"] { background: color-mix(in srgb, var(--own) 14%, var(--panel)); border-color: var(--own); }
.vf-kind:disabled { opacity: .5; cursor: default; }
.vk-owner { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.vk-label { font-weight: 650; font-size: 13px; }
.vk-n { font-size: 11.5px; color: var(--muted); }
.own-ours { --own: var(--accent); } .own-client { --own: var(--warn); } .own-pass { --own: var(--good); }
.vk-chip { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 4px; margin-right: 6px; color: var(--own); background: color-mix(in srgb, var(--own) 14%, transparent); cursor: help; }
.vk-note { display: inline-block; font-size: 10.5px; padding: 0 6px; border-radius: 4px; margin-right: 6px; border: 1px solid var(--bad); color: var(--bad); cursor: help; }
.vf-bar { align-items: center; gap: 10px; margin-bottom: 8px; }
.vf-bar .seg button { font-size: 12.5px; padding: 4px 10px; }
.vf-state { font-size: 11px; margin-top: 2px; }
.vf-state.ok { color: var(--good); } .vf-state.bad { color: var(--bad); }
/* Links to pages of this site inside the comparison open the page in the viewer, not a tab. */
a.site-link { text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; }
.rows a.site-link { color: inherit; text-decoration-color: var(--accent); }
.link-note { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; max-width: min(720px, calc(100vw - 32px)); padding: 10px 12px 10px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); box-shadow: 0 6px 24px color-mix(in srgb, var(--ink) 18%, transparent); font-size: 13px; }
.link-note a { white-space: nowrap; font-weight: 600; }
.cl-sec { margin-top: 18px; }
.cl-sec h3 { margin-bottom: 2px; }
.cl-val + .cl-val { margin-top: 3px; }
@media (max-width: 760px) { .vf-summary { grid-template-columns: minmax(0, 1fr); } }
.vf-list { margin: 0; padding-left: 16px; font-size: 12.5px; }
.vf-list li + li { margin-top: 3px; }
.vf td:first-child { width: 28%; }
.gq td { vertical-align: top; font-size: 12.5px; }
.gq td:first-child { width: 28%; }
.gq .ok { color: var(--good); font-weight: 700; } .gq .bad { color: var(--bad); font-weight: 700; }
.gq-files { font-size: 11px; margin-top: 3px; }
.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.chips button { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; }
.chips button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filters label.inline { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.filters label.inline input { width: auto; }
.agents-hit { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 2px; }
.chg-count { white-space: nowrap; }
.chg-count .pg { color: var(--muted); font-size: 12px; display: block; }
/* Scorecard table: fixed columns, attributes grouped by tier */
table.scorecard { table-layout: fixed; margin-top: 8px; }
table.scorecard col.sc-id { width: 48px; }
table.scorecard col.sc-score { width: 280px; } /* fits the full-size before | after bars (about 250px) */
table.scorecard col.sc-agents { width: 220px; }
table.scorecard col.sc-chg { width: 110px; }
table.scorecard th, table.scorecard td { padding: 12px 14px; }
table.scorecard .num { text-align: right; font-variant-numeric: tabular-nums; }
table.scorecard td.sc-num { color: var(--muted); font-family: var(--mono); font-size: 12.5px; padding-top: 14px; }
table.scorecard tr.attr-row:hover td { background: color-mix(in srgb, var(--chip) 45%, transparent); }
table.scorecard td .joined { margin-top: 1px; }
.sc-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.sc-ev { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 3px 10px; margin: 0; font-size: 12.5px; line-height: 1.45; }
.sc-ev dt { color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.sc-ev dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.sc-ev dt:first-child + dd { color: var(--muted); }
table.scorecard td.ev { font-size: 12.5px; line-height: 1.45; }
tr.tier-row td { background: var(--chip); padding: 9px 14px; border-bottom: 1px solid var(--line-strong); font-size: 12.5px; }
tr.tier-row .tier-name { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin-right: 10px; }
tr.tier-row .tier-score { float: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Change log */
table.catalog { table-layout: fixed; }
table.catalog td { overflow-wrap: anywhere; }
table.catalog a.mono { word-break: break-all; }
.attr-tag { font-weight: 600; }

[hidden] { display: none !important; }
.attr-tag.code { font-family: inherit; font-size: inherit; }
table.catalog td:nth-child(3) { white-space: nowrap; }

/* Scorecard sections: Performance and Scope and size */
.sz-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.sz-switch a { padding: 6px 16px; color: var(--muted); font-weight: 600; }
.sz-switch a + a { border-left: 1px solid var(--line-strong); }
.sz-switch a:hover { text-decoration: none; color: var(--ink); }
.sz-switch a.on { background: var(--accent-soft); color: var(--accent); }
.sz { max-width: 1100px; }
.sz h2 { margin-top: 30px; }
.sz h3 { font-size: 14px; margin: 18px 0 8px; }
.sz-hero { border: 1px solid var(--line); border-left: 4px solid var(--s-mid); border-radius: 10px; padding: 16px 20px; background: var(--panel); }
.sz-hero.low { border-left-color: var(--s-good); }
.sz-hero.heavy { border-left-color: var(--s-low); }
.sz-hero p { margin: 8px 0 0; }
.sz-verdict { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sz-level { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.sz-kpis, .sz-mix { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.sz-mix { grid-template-columns: repeat(3, 1fr); }
.sz-kpis > div, .sz-mix > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel); }
@media (max-width: 860px) { .sz-kpis { grid-template-columns: repeat(2, 1fr); } .sz-mix { grid-template-columns: 1fr; } }
.sz-table td, .sz-table th { padding: 7px 10px; }
.sz-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sz-table tr.chosen td { background: var(--accent-soft); }
.sz-bar { display: inline-block; width: 140px; height: 8px; border-radius: 4px; background: var(--s-ghost); vertical-align: middle; overflow: hidden; }
.sz-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.sz-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 960px) { .sz-cols { grid-template-columns: 1fr; } }
.sz-page { font-weight: 600; overflow-wrap: anywhere; }
.sz-url { font-size: 12px; overflow-wrap: anywhere; }
.sz-note { margin-top: 16px; }
.sz-assume { margin-top: 26px; color: var(--muted); }
.sz-assume p { margin: 8px 0; max-width: 820px; }
.run-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.run-type { font-size: 13px; }

/* Files view: Split / New only and Text / Rendered */
.view-segs { display: inline-flex; gap: 8px; margin-left: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 3px 10px; font-size: 12px; background: var(--panel); color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.diff.single .diff-head { grid-template-columns: 1fr; }
.diff.single .rows { grid-template-columns: 44px minmax(0, 1fr); }
.diff.rendered { font-family: var(--sans); }
.md-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.diff.single .md-cols { grid-template-columns: minmax(0, 1fr); }
.md-cols > .md + .md { border-left: 1px solid var(--line-strong); }
.md { padding: 18px 24px 40px; font: 14.5px/1.6 var(--sans); color: var(--ink); max-width: 860px; overflow-wrap: anywhere; }
.diff.single .md { margin: 0 auto; }
.md h1 { font-size: 24px; margin: 0 0 12px; } .md h2 { font-size: 19px; margin: 24px 0 8px; } .md h3 { font-size: 16px; margin: 18px 0 6px; } .md h4, .md h5, .md h6 { font-size: 14.5px; margin: 14px 0 6px; }
.md p, .md ul, .md ol { margin: 0 0 12px; }
.md table { margin: 0 0 14px; font-size: 13.5px; }
.md th, .md td { border: 1px solid var(--line); }
.md img { max-width: 100%; height: auto; border-radius: 6px; }
.md blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--chip); padding: 1px 4px; border-radius: 4px; }
.md pre { background: var(--chip); padding: 10px 12px; border-radius: 6px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md .md-note { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line-strong); padding-top: 6px; margin: 14px 0 6px; font-family: var(--mono); }
.md .md-raw { display: inline-block; color: var(--muted); }
.md-fm { font-size: 12px; margin-bottom: 18px; }
.md-fm th { width: 1%; white-space: nowrap; color: var(--muted); font-weight: 600; }
.md h1.flash, .md h2.flash, .md h3.flash, .md h4.flash { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.filebar { flex-wrap: wrap; row-gap: 6px; }
.seg button, .filebar .opts label { white-space: nowrap; }

/* Review analysis: the waiting state, and the one-page report beside the approach choice */
.status.waiting { background: var(--warn-bg); color: var(--warn-ink); }
.dot.waiting { background: var(--warn); border-color: var(--warn); }
.banner.choose { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.banner.choose .muted { color: inherit; opacity: .8; }
.icon-btn.attn { color: var(--warn); border-color: var(--warn); animation: attn 1.6s ease-in-out infinite; }
@keyframes attn { 50% { background: var(--warn-bg); } }
.chip.good { background: var(--add-bg); color: var(--good); }
.chip.on { background: var(--accent-soft); color: var(--accent); }
/* An estimate shown on the scorecard but not counted in the index: dashed outline, dimmed score. */
.chip.sc-est { background: transparent; border: 1px dashed var(--muted); cursor: help; vertical-align: 1px; }
.attr-row.est td:nth-child(3) { opacity: .6; }
.rv { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
.rv-report { min-width: 0; }
.rv-report table { display: block; overflow-x: auto; font-size: 12.5px; }
.rv-choice { position: sticky; top: 0; display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.rv-choice h2 { margin: 0; font-size: 17px; }
.rv-choice > p { margin: 0 0 4px; font-size: 13px; }
.rv-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px; cursor: pointer; font-weight: 400; margin: 0; }
.rv-opt input { width: auto; margin: 3px 0 0; }
.rv-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rv-body { display: grid; gap: 6px; font-size: 13px; line-height: 1.45; }
.rv-title { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 14px; }
.rv-title .chip { margin-left: 6px; }
.rv-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.rv-stats b { color: var(--ink); }
.rv-kv { display: none; grid-template-columns: max-content 1fr; gap: 3px 10px; font-size: 12px; color: var(--muted); }
.rv-kv > span:nth-child(odd) { font-weight: 600; color: var(--ink); }
.rv-opt:has(input:checked) .rv-kv { display: grid; }
.rv-go { display: grid; gap: 6px; margin-top: 4px; }
.rv-go button { width: 100%; padding: 10px 12px; }
.rv-note { font-size: 12px; }
@media (max-width: 900px) { .rv { grid-template-columns: 1fr; } .rv-choice { position: static; } }
.rv-report th { white-space: nowrap; }

/* Per-stage model: the plan in the table, and the picker with our recommendation */
.model-plan { font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-plan .has-tip { cursor: help; }

/* Run summary above the stage table: one line of live figures, then progress by plan stage. */
.pl-summary { padding: 12px 16px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.pl-grid { display: grid; grid-template-columns: minmax(170px, 1.7fr) repeat(7, minmax(92px, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pl-sec { padding: 8px 12px; min-width: 0; cursor: help; }
.pl-sec + .pl-sec { border-left: 1px solid var(--line); }
.pl-sec:hover, .pl-sec:focus-visible { background: color-mix(in srgb, var(--chip) 55%, transparent); outline: none; }
.pl-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pl-val { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.35; white-space: nowrap; }
.pl-val .status { font-size: 12px; vertical-align: 2px; }
.pl-retries { color: var(--warn); font-weight: 600; }
.pl-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-progress { display: flex; gap: 3px; }
.pl-seg { min-width: 0; cursor: help; outline: none; }
.pl-bar { height: 8px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.pl-bar span { display: block; height: 100%; background: var(--good); transition: width .4s; }
.pl-seg.run .pl-bar { background: var(--accent-soft); }
.pl-seg.run .pl-bar span { background: var(--accent); }
.pl-seg.run .pl-bar { background-image: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--accent) 22%, transparent) 6px 12px); background-size: 17px 17px; animation: pl-move 1s linear infinite; }
.pl-seg.wait .pl-bar { background: var(--warn-bg); outline: 1px solid var(--warn); }
.pl-seg.bad .pl-bar { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.pl-seg-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-seg-lbl b { color: var(--ink); font-weight: 600; }
.pl-seg.run .pl-seg-lbl, .pl-seg.wait .pl-seg-lbl { color: var(--ink); }
.pl-seg:hover .pl-bar, .pl-seg:focus-visible .pl-bar { filter: brightness(.92); }
@keyframes pl-move { to { background-position: 17px 0; } }
.stage-table .c-step { width: 1%; padding-left: 4px; padding-right: 2px; }
/* Narrow screens and the condensed Split view: the figures wrap into rows of four. */
@media (max-width: 700px) { .pipe-head { flex-wrap: wrap; } .model-plan { order: 3; flex-basis: 100%; } }
@media (max-width: 1100px) { .pl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .pl-sec:nth-child(4n + 1) { border-left: 0; } .pl-sec:nth-child(n + 5) { border-top: 1px solid var(--line); } }
body.view-split .pl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.view-split .pl-sec:nth-child(4n + 1) { border-left: 0; }
body.view-split .pl-sec:nth-child(n + 5) { border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .pl-seg.run .pl-bar { animation: none; } }
.model-off-text { color: var(--warn); }
.c-model { white-space: nowrap; }
.model-btn { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); }
.model-btn.ro { border-color: transparent; padding-left: 0; }
.model-btn:hover { border-color: var(--accent); }
.model-btn .caret { color: var(--muted); font-size: 10px; }
.model-tag { font-size: 10.5px; color: var(--accent); }
.model-off { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.model-ran { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.model-menu { position: fixed; z-index: 950; width: 340px; max-width: calc(100vw - 16px); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-md); padding: 12px; display: grid; gap: 10px; font-size: 13px; }
.mm-head { font-size: 13px; }
.mm-rec { background: var(--add-bg); border: 1px solid var(--good); border-radius: 8px; padding: 8px 10px; line-height: 1.45; font-size: 12.5px; }
.mm-rec-title { font-weight: 600; color: var(--good); margin-bottom: 2px; }
.mm-opts { display: grid; gap: 6px; }
.mm-opt { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; border-radius: 8px; }
.mm-opt.rec { border-color: var(--good); }
.mm-opt.on { background: var(--accent-soft); border-color: var(--accent); }
.mm-opt .mm-name { font-weight: 600; margin-right: auto; }
.mm-radio { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.mm-opt.on .mm-radio { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.mm-reset { color: var(--muted); font-size: 12.5px; }
.mm-note { font-size: 12px; line-height: 1.4; }

/* Fan-out approval */
.fo-list { display: grid; gap: 8px; max-height: 56vh; overflow: auto; padding-right: 2px; }
.fo-area { border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; font-size: 12.5px; }
.fo-area.rec { border-color: var(--good); }
.fo-area:has([data-area]:not(:checked)) { opacity: .7; }
.fo-on { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-weight: 400; font-size: 13px; cursor: pointer; }
.fo-on input, .fo-detail input, .fo-reviews input { width: auto; margin: 2px 0 0; }
.fo-meta { color: var(--muted); padding-left: 22px; }
.fo-detail, .fo-reviews { padding-left: 22px; font-weight: 400; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; margin: 0; }
.fo-reviews label { display: flex; gap: 4px; align-items: center; margin: 0; font-weight: 400; }
.rv-go [data-reset] { background: none; border: none; color: var(--accent); padding: 2px; font-size: 12.5px; }

/* Personas and the pause countdown */
.countdown { display: inline-block; margin-left: 4px; }
.countdown b { font-variant-numeric: tabular-nums; }
.ps { display: grid; gap: 14px; max-width: 900px; }
.ps-head h2 { margin: 0 0 4px; }
.ps-head p { margin: 0 0 4px; font-size: 13px; }
.ps-how { font-size: 12px; }
.ps-list { display: grid; gap: 8px; }
.ps-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; margin: 0; font-weight: 400; cursor: pointer; }
.ps-row.rec { border-color: var(--good); }
.ps-row:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.ps-row input { width: auto; margin: 3px 0 0; }
.ps-body { display: grid; gap: 4px; font-size: 13px; }
.ps-title { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ps-score { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ps-score .bar { width: 90px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; display: inline-block; }
.ps-score .bar span { display: block; height: 100%; background: var(--good); }
.ps-problems { font-size: 12px; }
.ps-new { display: grid; gap: 6px; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; }
.ps-new label { margin: 0; font-weight: 400; font-size: 13px; }
.ps-new button { justify-self: start; }
.ps .rv-go { display: flex; gap: 10px; align-items: center; }
.ps .rv-go button.primary { width: auto; }

/* Viewer header: site and version switchers, in place of the site name */
.crumbs { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.crumb { display: inline-flex; margin: 0; font-weight: inherit; }
.crumb select { width: auto; max-width: 240px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; background-color: transparent; color: var(--ink); cursor: pointer; text-overflow: ellipsis; }
.crumb select:hover, .crumb select:focus-visible { border-color: var(--line-strong); background-color: var(--panel); }
.crumb select option { background: var(--panel); color: var(--ink); }
.crumb-site select { font-weight: 600; }
.crumb-ver select { font-size: 13px; color: var(--muted); max-width: 280px; }
.crumb-sep { color: var(--line-strong); padding: 0 2px; }
@media (max-width: 900px) { .crumb-ver select { max-width: 150px; } .crumb-site select { max-width: 170px; } }

/* A tab focused on one stage: a bar that names it, links back and clears the focus */
.focus-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--ink); font-size: 13px; }
.focus-bar b { color: var(--accent); }
.focus-bar a { font-size: 12.5px; font-weight: 600; }
.focus-bar .focus-back { margin-left: auto; }
.tree-focus { margin: 0 10px 6px; padding: 6px 8px; border-radius: 6px; background: var(--accent-soft); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.tree-focus b { color: var(--accent); }
.tree-focus a { margin-left: auto; font-weight: 600; }

/* Pipeline: the "Go to" menu of one stage */
.goto-menu { position: fixed; z-index: 950; width: 290px; padding: 6px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-md); display: grid; gap: 2px; font-size: 13px; }
.gm-head { padding: 6px 8px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.gm-head b { color: var(--ink); }
.gm-item { display: grid; grid-template-columns: 18px auto 1fr; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; color: var(--ink); }
.gm-item svg { color: var(--accent); }
a.gm-item:hover, a.gm-item:focus-visible { background: var(--accent-soft); text-decoration: none; outline: none; }
.gm-l { font-weight: 600; }
.gm-n { justify-self: end; font-size: 12px; color: var(--muted); white-space: nowrap; }
.gm-item.off { opacity: .45; cursor: default; }
.gm-item.off svg { color: var(--muted); }

/* Viewer header pickers: a button for the site and one for the version, each opening a table of records */
.pk-btn { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font-size: 13.5px; white-space: nowrap; }
.pk-btn:hover, .pk-btn[aria-expanded="true"] { border-color: var(--line-strong); background: var(--panel); }
.pk-site-btn { font-weight: 600; font-size: 14px; }
.pk-ver-btn .muted { font-size: 12.5px; }
.pk-ver-btn .status { font-size: 11px; }
.pk-btn svg { color: var(--muted); transition: transform .15s; }
.pk-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.pk-menu { position: fixed; z-index: 960; width: min(1040px, calc(100vw - 16px)); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-md); overflow: hidden; font-size: 13px; }
.pk-menu-site { width: min(880px, calc(100vw - 16px)); }
.pk-title { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.pk-title b { color: var(--ink); }
.pk-body { max-height: min(60vh, 460px); overflow: auto; }
.pk-row { display: grid; align-items: center; column-gap: 14px; padding: 9px 14px; color: var(--ink); border-bottom: 1px solid var(--line); white-space: nowrap; }
.pk-body .pk-row:last-child { border-bottom: 0; }
.pk-ver { grid-template-columns: 112px 118px minmax(120px, 1fr) minmax(150px, 1.2fr) 118px 108px 82px 60px; }
.pk-site { grid-template-columns: minmax(170px, 1.4fr) 64px 96px minmax(140px, 1.2fr) 118px 82px 118px; }
.pk-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pk-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.pk-head { padding-top: 7px; padding-bottom: 7px; background: var(--bg); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
a.pk-row:hover, a.pk-row:focus-visible { background: color-mix(in srgb, var(--chip) 70%, transparent); text-decoration: none; outline: none; }
a.pk-row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.pk-v, .pk-name { display: inline-flex; align-items: center; gap: 6px; }
.pk-chip { margin: 0; background: var(--accent-soft); color: var(--accent); }
.pk-star { display: inline-flex; color: var(--s-mid); margin-left: 4px; vertical-align: -1px; }
.pk-st { display: inline-flex; align-items: center; gap: 8px; }
.pk-prog { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pk-ba { display: inline-flex; align-items: baseline; gap: 4px; }
.pk-arrow { color: var(--muted); }
.pk-ba .delta-pos, .pk-ba .delta-neg { font-size: 12px; margin-left: 2px; }
.sc-low { color: var(--s-low); } .sc-mid { color: var(--s-mid); } .sc-good { color: var(--s-good); } .sc-max { color: var(--s-max); } .sc-na { color: var(--muted); }
@media (max-width: 900px) { .pk-ver { grid-template-columns: 90px minmax(0, 1fr) 118px 60px; } .pk-ver > :nth-child(2), .pk-ver > :nth-child(3), .pk-ver > :nth-child(6), .pk-ver > :nth-child(7) { display: none; }
  .pk-site { grid-template-columns: minmax(0, 1fr) 64px 118px; } .pk-site > :nth-child(3), .pk-site > :nth-child(4), .pk-site > :nth-child(6), .pk-site > :nth-child(7) { display: none; } }

/* Start dialog: a compact header, the choices on the left in open sections, the run size on the right, one footer */
.start-dialog { width: min(1160px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel); color: var(--ink); overflow: hidden; }
.start-dialog[open] { display: flex; flex-direction: column; }
.start-dialog::backdrop { background: var(--backdrop); }
.start-dialog > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sd-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 24px; border-bottom: 1px solid var(--line); }
.sd-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.sd-site { font-size: 12.5px; color: var(--muted); background: var(--chip); border-radius: 999px; padding: 2px 10px; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-site:empty { display: none; }
.sd-x { margin-left: auto; border: 0; background: none; font-size: 20px; line-height: 1; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); padding: 0; }
.sd-x:hover { color: var(--ink); background: var(--chip); }
.sd-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; flex: 1; }
.sd-form { padding: 4px 32px 28px; overflow-y: auto; min-height: 0; }
.sd-side { border-left: 1px solid var(--line); background: var(--bg); padding: 22px 20px; overflow-y: auto; min-height: 0; }
.sd-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--line); }
.sd-start { padding: 10px 22px; font-size: 15px; }

/* Sections: a title (its tooltip says when to pick each option) and the choices under it, separated by space and a rule */
.sd-sec { padding: 22px 0 24px; border-top: 1px solid var(--line); margin: 0; }
.sd-sec:first-child { border-top: 0; padding-top: 22px; }
.sd-title { margin: 0 0 14px; font-size: 16px; font-weight: 650; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sd-title label { display: inline; margin: 0; font: inherit; }
.sd-sub { font-size: 13px; font-weight: 400; color: var(--muted); }

/* Trial type: one segmented control */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; background: var(--chip); border: 1px solid var(--line); border-radius: 10px; }
.segmented label { display: flex; align-items: center; justify-content: center; margin: 0; padding: 9px 12px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; position: relative; user-select: none; }
.segmented label:hover { color: var(--ink); }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.segmented label:has(input:checked) { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .18), 0 0 0 1px var(--line-strong); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented .skel-pill { width: auto; height: 36px; border-radius: 7px; }
.sd-mode-desc { margin: 10px 2px 0; color: var(--muted); font-size: 13px; min-height: 18px; }

/* Page budget: a slider from 10 to every page found */
.budget { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 6px 16px; align-items: center; }
.budget output { font-size: 16px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.budget .budget-scale { grid-column: 1 / -1; }
input[type=range]#max_pages { width: 100%; padding: 0; border: 0; background: none; accent-color: var(--accent); margin: 0; height: 22px; cursor: pointer; }
input[type=range]#max_pages:disabled { opacity: .4; cursor: default; }
.budget-scale { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.budget-note { text-align: center; flex: 1; }
.budget-split { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }

/* Options: radio tiles side by side; each one's tooltip says what it costs or buys against the recommended one */
.oc-opts { display: grid; gap: 10px; }
.oc-opts.row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.oc-opts.row4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.oc-opts .skel-line { height: 58px; border-radius: 10px; }
label.oc-opt { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-weight: 400; cursor: pointer; background: var(--panel); transition: border-color .15s, background .15s; }
label.oc-opt:hover { border-color: var(--line-strong); }
label.oc-opt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
label.oc-opt input { width: 16px; height: 16px; margin: 2px 0 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.oc-text { display: flex; flex-direction: column; min-width: 0; }
.oc-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.oc-desc { color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 3px; }
.oc-delta { font-size: 11.5px; color: var(--ink); opacity: .75; margin-top: 5px; font-variant-numeric: tabular-nums; }
.oc-delta:empty { display: none; }
.rec { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 0 6px; line-height: 16px; }
.oc-warn { margin: 12px 0 0; font-size: 12.5px; color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 6px 10px; }

/* Judge, verification and sensitive changes: small inline choices under the model, no box */
.callouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin-top: 20px; }
.callout { min-width: 0; transition: opacity .15s; }
.cg-label { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.cg-label .has-tip { border-bottom-color: var(--line-strong); }
.cg-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cg-opts .skel-line { width: 100%; height: 18px; }
label.cg-opt { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
label.cg-opt input { width: 15px; height: 15px; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.cg-rec { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.site-opts { gap: 8px 28px; }
.dim { opacity: .4; }

/* Inputs, folded away */
.sd-more > summary { cursor: pointer; list-style: none; margin: 0; }
.sd-more > summary::-webkit-details-marker { display: none; }
.sd-more > summary::before { content: '▸'; color: var(--muted); font-size: 13px; margin-right: -4px; }
.sd-more[open] > summary::before { content: '▾'; }
.sd-more:not([open]) > summary { margin-bottom: 0; }
.sd-more .grid2 label { margin-top: 12px; }

/* Run size panel */
.rs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.rs-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; color: var(--muted); }
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-grid .skel-block { height: 78px; }
.rs-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; min-width: 0; transition: border-color .4s, box-shadow .4s; }
.rs-tile.chg { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.rs-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.rs-v { font-size: 20px; font-weight: 650; margin: 3px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-s { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.rs-delta { margin-top: 12px; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: var(--chip); }
.rs-delta.is-rec { color: var(--muted); }
.rs-break { margin-top: 18px; }
.rs-break .rs-k { margin-bottom: 6px; }
.rs-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-top: 7px; }
.rs-row > span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.rs-bar { height: 5px; background: var(--chip); border-radius: 3px; margin-top: 3px; overflow: hidden; }
.rs-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.rs-note { margin: 16px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.rs-error { color: var(--bad); font-size: 13px; }
.rs-gap { margin-top: 18px; }
.sd-side .skel-line { margin-top: 8px; }

/* Placeholders while the site is read or the choices load */
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line, .skel-block, .skel-pill { background: linear-gradient(90deg, var(--chip) 25%, var(--line) 50%, var(--chip) 75%); background-size: 200% 100%; animation: skel 1.4s infinite; border-radius: 6px; }
.skel-line { display: block; height: 12px; } .skel-line.w40 { width: 40%; }
.skel-block { height: 64px; }
.skel-pill { height: 24px; width: 120px; border-radius: 999px; display: inline-block; }

@media (max-width: 1080px) { .oc-opts.row4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .callouts { grid-template-columns: 1fr; gap: 14px; } }
@media (max-width: 860px) {
  .sd-main { grid-template-columns: 1fr; overflow-y: auto; }
  .sd-form, .sd-side { overflow: visible; }
  .sd-side { border-left: 0; border-top: 1px solid var(--line); order: -1; }
  .start-dialog { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
}
@media (max-width: 560px) { .sd-form { padding: 4px 18px 22px; } .oc-opts.row2, .oc-opts.row4 { grid-template-columns: 1fr; } .sd-foot { flex-direction: column; align-items: stretch; } .sd-start { width: 100%; } }

/* ---------- the showcase (home page): starred, finished full trials, one info-packed row per company ---------- */
/* Showcase and Trials tabs. The line under them runs from screen edge to screen edge: a 1px bar the width of the
   page column, widened by a box-shadow and clipped to its own height, so it adds no horizontal scroll. */
.home-tabs { position: relative; display: flex; align-items: flex-end; gap: 4px; margin: 44px 0 20px; }
.home-tabs::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line);
  box-shadow: 0 0 0 100vmax var(--line); clip-path: inset(0 -100vmax); pointer-events: none; }
.home-tabs [role="tab"] { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none;
  padding: 10px 16px 12px; margin-bottom: 0; font: inherit; font-size: 17px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
.home-tabs [role="tab"]:first-child { margin-left: -16px; }
.home-tabs [role="tab"]:hover { color: var(--ink); }
.home-tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.home-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab-n { font-size: 12px; font-weight: 700; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--chip); color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.tab-n:empty { display: none; }
/* Beside the Trials count: how many are running and queued, with a pulsing dot while one runs. */
.tab-live { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tab-live[hidden] { display: none; }
.tab-live i { position: relative; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tab-live i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: tab-pulse 1.6s ease-out infinite; }
@keyframes tab-pulse { from { transform: scale(1); opacity: .6; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tab-live i::after { animation: none; } }
[aria-selected="true"] .tab-n { background: var(--accent-soft); color: var(--accent); }
.tab-note { margin-left: auto; padding-bottom: 14px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .tab-note { display: none; } .home-tabs [role="tab"] { padding: 10px 12px 12px; font-size: 16px; } .home-tabs [role="tab"]:first-child { margin-left: -12px; } }
.shw-empty { padding: 20px; line-height: 1.6; }
/* The Runs tab: every run, one row each. */
table.runs-all td { padding-top: 10px; padding-bottom: 10px; }
table.runs-all .c-site .vm-star { width: 26px; margin: 0 6px 0 -6px; vertical-align: middle; }
table.runs-all .c-site .site-name { font-weight: 500; }
table.runs-all .c-from { font-size: 13px; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1000px) { table.runs-all .c-from, table.runs-all th:nth-child(3) { display: none; } }
.showcase { display: flex; flex-direction: column; gap: 10px; }
.shw-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 20px; }
.shw-row:hover { border-color: var(--line-strong); }
.shw-id { display: flex; align-items: center; gap: 12px; color: inherit; min-width: 0; }
.shw-id:hover { text-decoration: none; }
.shw-id:hover .shw-name { text-decoration: underline; }
.shw-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.shw-mono { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: var(--accent-soft); color: var(--accent); }
.shw-who { display: flex; flex-direction: column; min-width: 0; }
.shw-name { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shw-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shw-metrics { display: grid; grid-template-columns: 1.5fr repeat(5, 1fr); gap: 4px; grid-column: 1 / -1; grid-row: 2; }
.shw-m { padding: 4px 14px; border-left: 1px solid var(--line); color: inherit; min-width: 0; }
a.shw-m:hover { text-decoration: none; }
a.shw-m:hover .sc-n.big { text-decoration: underline; }
.shw-m-v { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.shw-m-v .sc-n { font-size: 14px; }
.shw-m-v .sc-n.big { font-size: 20px; }
.shw-m-v .arrow { color: var(--muted); font-size: 13px; }
.shw-m-v .sc-d { font-size: 12.5px; }
.shw-m-k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 1px; }
.shw-m:first-child { border-left: 0; padding-left: 0; }
/* The original site's marketing pages: a metric like the rest (its detail is in the tooltip). */
.shw-of { font-size: 14px; font-weight: 600; opacity: .75; margin-left: 3px; }
.shw-m-s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shw-acts { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .shw-row { padding: 12px 14px; gap: 12px; }
  .shw-metrics { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
  .shw-m-score { grid-column: 1 / -1; }
  .shw-acts .btn-link { display: none; }
}
.ps-defs > div.has-def-tip { cursor: help; }
.ps-defs > div.has-def-tip b { border-bottom: 1px dotted var(--muted); }

/* Start dialog, run size: what makes it this size, and the site as one bar */
.rs-drv { padding: 8px 0; border-top: 1px solid var(--line); }
.rs-drv:first-of-type { border-top: 0; padding-top: 2px; }
.rs-drv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rs-drv-n { font-size: 12.5px; font-weight: 600; }
.rs-drv-v { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-drv-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.rs-lvl, .rs-moves { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; padding: 0 6px; line-height: 16px; white-space: nowrap; }
.rs-lvl.low { background: var(--s-good); color: var(--on-strong); }
.rs-lvl.medium { background: var(--s-mid); color: var(--on-mid); }
.rs-lvl.heavy { background: var(--s-low); color: var(--on-strong); }
.rs-moves { border: 1px solid var(--line-strong); color: var(--muted); font-weight: 600; }
.rs-stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 1px; background: var(--line); }
.rs-stack > i { display: block; min-width: 3px; }
.rs-legend { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; line-height: 1.7; }
.rs-legend li { display: flex; align-items: baseline; gap: 6px; }
.rs-legend li > i { width: 9px; height: 9px; border-radius: 2px; flex: none; align-self: center; }
.rs-legend li > .muted { margin-left: auto; font-variant-numeric: tabular-nums; }
.sg-m1 { background: var(--accent); }
.sg-m0 { background: color-mix(in srgb, var(--accent) 40%, var(--panel)); }
.sg-b1 { background: var(--s-good); }
.sg-b0 { background: color-mix(in srgb, var(--s-good) 40%, var(--panel)); }
.sg-k { background: var(--s-mid); }
.sg-u { background: var(--line-strong); }
.rs-colls { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 11.5px; }
.rs-colls th { text-align: left; font-weight: 600; color: var(--muted); padding: 3px 6px 3px 0; border-bottom: 1px solid var(--line); }
.rs-colls td { padding: 3px 6px 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.rs-colls .num { text-align: right; font-variant-numeric: tabular-nums; }
.rs-colls td:last-child { color: var(--muted); }
.budget-split .btn-link { font-size: 12px; padding: 0; }

/* Websites tab: opportunities, the websites with no trial yet */
.opp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 36px 0 12px; }
.opp-head h2 { margin: 0; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.opp-head .muted { font-size: 12.5px; }
table.opps td { white-space: normal; padding: 12px 20px; }
table.opps .c-opp { white-space: nowrap; }
table.opps .c-ind, table.sites .c-ind { white-space: nowrap; color: var(--muted); font-size: 13px; }
table.sites .c-site { white-space: nowrap; }
table.opps .c-about { width: 100%; font-size: 13px; line-height: 1.45; min-width: 240px; }
.opp-id { display: inline-flex; align-items: center; gap: 12px; }
.opp-logo { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; background: #fff; padding: 4px; box-sizing: border-box; flex: none; border: 1px solid var(--line); }
.opp-mono { display: inline-flex; align-items: center; justify-content: center; background: var(--chip); color: var(--muted); font-size: 11px; font-weight: 650; padding: 0; }
.opp-host { font-size: 12px; }
.opp-tag { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; border-radius: 999px; padding: 0 7px; line-height: 17px; display: inline-block; vertical-align: middle; }
.opp-tag.req { color: var(--accent); border: 1px solid var(--accent); }
@media (max-width: 900px) { table.opps .c-proj, table.opps th:nth-child(3) { display: none; } }
table.opps .c-web, table.opps .c-proj { white-space: nowrap; font-size: 13px; }
table.opps .c-opp { width: 100%; }
table.opps .opp-main { color: var(--ink); }
table.opps .acts-cell { white-space: nowrap; }
.rows.raw { grid-template-columns: 52px minmax(0, 1fr); }

/* The start dialog's "The site" section: the kind of site, then one row per part with its share of the words and
   what the run does with it (src/treatments.js). */
.site-kind { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.groups { display: grid; gap: 6px; }
.grp { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 190px; gap: 2px 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.grp.changed { border-color: var(--accent); }
.grp-name { display: flex; flex-direction: column; min-width: 0; }
.grp-name > span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-meta { color: var(--muted); font-size: 12px; }
.grp-share { position: relative; height: 18px; border-radius: 4px; background: var(--bg); overflow: hidden; font-size: 11.5px; }
.grp-share:empty { background: none; }
.grp-share i { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); }
.grp-share span { position: relative; padding-left: 6px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.grp-pick select { padding: 5px 8px; font-size: 13px; }
.grp-fixed { display: inline-block; padding: 5px 8px; font-size: 13px; color: var(--muted); }
.grp-why { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.grp-rec { color: var(--accent); }
.groups-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 720px) { .grp { grid-template-columns: 1fr 150px; } .grp-share { grid-column: 1 / -1; grid-row: 2; } }

/* The start dialog's read-out: this setup beside the recommended one, and what agents get (public/cockpit.js). */
.rs-vs { display: block; margin-top: 2px; color: var(--accent); font-weight: 600; }
.cmp-same { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmp-table th, .cmp-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.cmp-table thead th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.cmp-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cmp-table .cmp-sec th { padding-top: 10px; font-size: 11px; color: var(--muted); font-weight: 650; border-bottom-color: var(--line-strong); }
.cmp-d.up { color: #2e8b57; font-weight: 600; }
.cmp-d.down { color: #c0562a; font-weight: 600; }
.cmp-eq { color: var(--muted); }
.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ag-list li { display: grid; grid-template-columns: 84px 1fr; gap: 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.ag-k { grid-row: 1 / span 2; align-self: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.ag-v { font-weight: 650; font-size: 14px; }
.ag-t { font-size: 12px; color: var(--muted); line-height: 1.35; }
.cmp-table tbody th { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink); }
.cmp-table tbody .cmp-sec th { color: var(--muted); font-size: 11px; }

/* ---------- the start dialog as a full page: three steps side by side ---------- */
.start-dialog { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border: 0; border-radius: 0; margin: 0; }
.sd-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.05fr); }
.sd-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-left: 1px solid var(--line); }
.sd-col:first-child { border-left: 0; }
.sd-step { margin: 0; padding: 14px 24px 12px; font-size: 15px; font-weight: 650; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.sd-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; align-self: center; }
.sd-colbody { padding: 16px 24px 24px; overflow-y: auto; min-height: 0; flex: 1; }
.sd-expect { background: var(--bg); }
.sd-side { border-left: 0; background: none; padding: 16px 24px 24px; }
.sd-h { margin: 20px 0 8px; font-size: 13.5px; font-weight: 650; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sd-foot { padding: 10px 24px; }
.sd-sum { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sd-sum-line { font-size: 14px; }
.sd-sum-line:empty { display: none; }
/* Who the site is */
.who { margin: 0 0 12px; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.who-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 7px 10px; border-top: 1px solid var(--line); font-size: 13px; }
.who-row:first-child { border-top: 0; }
.who dt { color: var(--muted); font-size: 12px; }
.who dd { margin: 0; min-width: 0; }
.who dd span { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.who .skel-line { margin: 8px 10px; }
.pack-pick { margin: 0; }
.pack-pick label { font-size: 12px; color: var(--muted); font-weight: 500; margin: 0 0 4px; }
.pack-pick select { padding: 5px 8px; font-size: 13px; }
/* One decision: a small label and its choices stacked one per line */
.fld { margin: 0 0 14px; transition: opacity .15s; }
.fld.dim { opacity: .45; }
.fld-l { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 5px; }
.fld-l label { display: inline; margin: 0; font: inherit; color: inherit; }
.fld-l output { font-size: 13.5px; color: var(--ink); text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.fld .segmented label { padding: 6px 10px; font-size: 13px; }
.fld .sd-mode-desc { margin: 5px 2px 0; font-size: 12px; min-height: 0; }
.fld .budget { display: block; }
.opt-rows { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.opt-rows .skel-line { margin: 8px 10px; height: 14px; }
label.opt-row { display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 8px 5px 10px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 400; cursor: pointer; min-width: 0; }
label.opt-row:first-child { border-top: 0; }
label.opt-row:hover { background: var(--chip); }
label.opt-row:has(input:checked) { background: var(--accent-soft); }
label.opt-row:has(input:checked) .opt-name { font-weight: 600; }
label.opt-row input { width: 14px; height: 14px; margin: 0; padding: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.opt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.opt-rec { flex: none; font-size: 10.5px; color: var(--accent); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
label.opt-row .oc-delta { margin: 0 0 0 auto; flex: none; font-size: 11.5px; white-space: nowrap; }
label.opt-row .oc-delta:empty { display: block; }
.opt-i { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--muted); font: italic 600 10.5px/1 Georgia, serif; cursor: help; }
.opt-i:hover, .opt-i:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.sd-more { margin: 0 0 12px; padding: 0; border: 0; }
.sd-more > summary.fld-l { justify-content: flex-start; padding: 6px 0; }
.sd-more > summary .sd-sub { text-transform: none; letter-spacing: 0; font-size: 12px; }
.sd-more[open] > summary { margin-bottom: 6px; }
.inputs label { margin: 8px 0 3px; font-size: 12.5px; }
.inputs textarea { min-height: 54px; }
/* Structure rows fit a column */
.sd-col .grp { grid-template-columns: minmax(0, 1fr) 150px; }
.sd-col .grp-share { grid-column: 1 / -1; grid-row: 2; height: 14px; }
.sd-col .grp-share span { line-height: 14px; font-size: 11px; }
.sd-col .site-kind { font-size: 13px; }
/* When it is done */
.rs-finish { margin-top: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.rs-finish b { font-size: 15px; }
.rs-finish span:last-child { color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) {
  .sd-main { grid-template-columns: 1fr; overflow-y: auto; }
  .sd-col { border-left: 0; border-top: 1px solid var(--line); }
  .sd-colbody { overflow: visible; }
  .sd-side { order: 0; border-top: 0; }
}

/* ---------- the top navigation every page shares ---------- */
.topnav { display: flex; align-items: center; gap: 2px; }
.topnav a { padding: 5px 10px; border-radius: 7px; font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.topnav a:hover { color: var(--ink); background: var(--chip); text-decoration: none; }
.topnav a.on { color: var(--ink); background: var(--chip); font-weight: 650; }
.home-top .topnav { margin-right: auto; margin-left: 14px; }

/* ---------- the new-trial page (/new): three steps side by side under the top bar ---------- */
.nt-body { margin: 0; overflow: hidden; }
form.nt { display: flex; flex-direction: column; height: 100vh; min-height: 0; margin: 0; }
.nt-top { flex: none; }
.nt-site { font-size: 12.5px; color: var(--muted); background: var(--chip); border-radius: 999px; padding: 2px 10px; margin-right: auto; }
.nt-site:empty { display: none; }
.nt-top .topnav + .nt-site:empty + #theme, .nt-top #theme { margin-left: auto; }
.nt-top .nt-site:not(:empty) + #theme { margin-left: 0; }
.nt #health:empty { display: none; }
.nt #health .banner { margin: 8px 16px 0; }
.nt .sd-main { flex: 1; min-height: 0; display: grid; }
.nt .sd-foot { flex: none; background: var(--panel); }
.nt-empty { margin: 4px 0; font-size: 13px; line-height: 1.45; }
/* The website picker at the top of step 1 */
.pick { padding: 12px 24px; border-bottom: 1px solid var(--line); flex: none; }
.pick-l { display: block; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 5px; }
.pick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.pick-row select, .pick-new input { padding: 7px 10px; font-size: 14px; }
.pick-row button { white-space: nowrap; padding: 7px 14px; }
.pick-new { margin-top: 8px; }
.pick-new .hint { margin: 4px 0 0; display: block; }
.pick-new .hint.bad { color: var(--warn-ink); }
.pick .banner { margin: 8px 0 0; }
/* Tabs for the first and last steps */
.tabbar { display: flex; gap: 2px; padding: 6px 20px 0; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; }
.tabbar button { border: 0; background: none; border-radius: 7px 7px 0 0; padding: 7px 10px 8px; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabbar button:hover { color: var(--ink); }
.tabbar button.on { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }
.tabbar .tab-n { margin-left: 5px; font-size: 11px; color: var(--accent); font-weight: 700; }
.tabbed > .tp { display: none; }
.tabbed > .tp.show,
.tabbed[data-tab="company"] > .tp[data-panel="company"], .tabbed[data-tab="structure"] > .tp[data-panel="structure"],
.tabbed[data-tab="size"] > .tp[data-panel="size"], .tabbed[data-tab="start"] > .tp[data-panel="start"],
.tabbed[data-tab="compare"] > .tp[data-panel="compare"], .tabbed[data-tab="detail"] > .tp[data-panel="detail"] { display: block; }
.tp > .rs-break:first-child, .tp > .sd-h:first-child { margin-top: 0; }
/* Where the site starts */
.sp-level { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; background: var(--chip); color: var(--ink); letter-spacing: 0; text-transform: none; }
.sp-level.none { color: #c0562a; }
.sp-level.established { color: #2e8b57; }
.sp-table td { vertical-align: top; }
.sp-table td:last-child { color: var(--accent); }
.sp-n { color: var(--muted); }
.sp-y { color: #2e8b57; font-weight: 600; }
@media (max-width: 1100px) { .nt-body { overflow: auto; } form.nt { height: auto; min-height: 100vh; } .nt .sd-main { display: block; } }

/* What happened: the breakdown of a failed or stopped trial on its Pipeline tab (public/pipeline.js, src/failure.js). */
.fail-card { margin: 12px 0 16px; border-color: var(--del-strong); border-left: 4px solid var(--bad); }
.fail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fail-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--bad); }
.fail-title { margin: 4px 0 0; font-size: 19px; line-height: 1.3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fail-acts { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.fail-conf { font-size: 11.5px; font-weight: 600; text-transform: capitalize; }
.fail-conf.certain { background: var(--del-bg); color: var(--bad); }
.fail-conf.likely { background: var(--warn-bg); color: var(--warn-ink); }
.fail-detail { margin: 12px 0 8px; font-size: 14.5px; line-height: 1.55; max-width: 72em; }
.fail-fix { font-size: 14px; line-height: 1.5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fail-yes { background: var(--add-bg); color: var(--good); font-size: 12px; }
.fail-no { background: var(--warn-bg); color: var(--warn-ink); font-size: 12px; }
.fail-sec { margin-top: 18px; }
.fail-sec h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
.fail-sec h4 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.fail-pre { margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--del-bg); color: var(--ink); font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.fail-ev { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.55; }
.fail-ev li + li { margin-top: 4px; }
.fail-ev.bad li { color: var(--bad); }
/* Every stage as a small block: green done, red where it stopped, grey not run. */
.fail-line { display: flex; gap: 3px; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.fail-line li { width: 18px; height: 10px; border-radius: 2px; background: var(--s-ghost); }
.fail-line li.fl-done { background: var(--s-good); }
.fail-line li.fl-failed, .fail-line li.fl-cancelled { background: var(--s-low); }
.fail-line li.fl-running { background: var(--accent); }
.fail-att { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; font-size: 13.5px; }
.fail-att summary { cursor: pointer; line-height: 1.6; }
.fail-att summary .ok { color: var(--good); }
.fail-att summary .bad { color: var(--bad); }
.fail-file { font-family: var(--mono); font-size: 12.5px; }
.fail-k { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fail-said { line-height: 1.5; }
.fail-acts-list { margin: 0; padding-left: 20px; font-size: 12.5px; line-height: 1.55; }
.fail-acts-list li.said { color: var(--muted); }
.fail-logbox > summary { cursor: pointer; list-style: none; }
.fail-logbox > summary::-webkit-details-marker { display: none; }
.fail-log { max-height: 340px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font: 12px/1.6 var(--mono); }
.fail-log .ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.fail-log .ln b { color: var(--muted); font-weight: 400; margin-right: 6px; }
.fail-log .ln.hot { color: var(--bad); font-weight: 600; }

/* The pipeline application a trial runs (new.html #pl-app, src/sitecategory.js). The publisher pipeline is set apart
   with the accent, so a publication's trial is never mistaken for a marketing one. */
.pl-app { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.pl-app.is-publisher { border-color: var(--accent); background: var(--accent-soft); }
.pl-app .pl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pl-app .pl-k { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pl-app .pl-name { font-size: 15px; font-weight: 650; color: var(--ink); }
.pl-app .pl-cat { font-size: 12px; color: var(--muted); }
.pl-app p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
.pl-app ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.pl-app li + li { margin-top: 2px; }
.pl-app .pl-surf { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pl-app .pl-surf span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.sg-g { background: repeating-linear-gradient(135deg, var(--line-strong) 0 4px, var(--panel) 4px 8px); }
.grp.gated .grp-share i { background: var(--line-strong); }
.grp-fixed.gated, .grp.gated .grp-pick select { font-weight: 600; }
.pack-pick + .pack-pick { margin-top: 10px; }
.tip-row.tip-row-w { grid-template-columns: 118px 1fr; }

/* A row's "More" menu (index.html moreMenu): everything but the version list and Open. */
.more-wrap { position: relative; display: inline-flex; }
.more-btn { padding: 4px 8px; line-height: 0; }
.more-btn.open { background: var(--accent-soft); border-color: var(--accent); }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 70; min-width: 170px; padding: 4px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); text-align: left; }
.mm-item { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap; }
.mm-item:hover, .mm-item:focus-visible { background: var(--accent-soft); outline: none; }
.mm-item.danger { color: var(--s-low); }
.mm-item[disabled] { opacity: .5; cursor: default; }
