/* ═══════════════════════════════════════════════════════
   SKIPPER for Agentforce Voice — Voice Bot Test Harness
   Same visual system as Skipper for Salesforce: calm,
   macOS-native sidebar + pane layout. Neutral palette,
   single typeface, hairline rules, mono micro-labels.
   ═══════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root, :root[data-theme="light"] {
  --bg: #f5f4f1;
  --surface: #fff;
  --border: #e4e3df;
  --border2: #d0cfc9;
  --text: #18170f;
  --t2: #6b6a64;
  --t3: #aeada6;
  --accent: #111;
  --afg: #fff;
  --green: #1a6e40;
  --gbg: #eef7f2;
  --amber: #8a5c08;
  --abg: #fef9ec;
  --red: #b54040;
  --r-bg: #fdf3f3;
  --accent-hover: #2a2a28;
  --ok-border: #cbe8d8;
  --warn-border: #f0d680;
  --err-border: #f0cfcb;
  --err-border2: #e3b8b4;
  --red-hover: #9c3535;
  --hover: #eae9e4;
  --mode-text-bg: #eef2ff;
  --mode-text-fg: #3b5998;
  --mode-text-border: #c7d2fe;
  --mode-voice-bg: #fdf4ff;
  --mode-voice-fg: #86198f;
  --mode-voice-border: #f5d0fe;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r: 5px;
  --r-lg: 10px;
  --sw: 196px;
  --ease: 100ms cubic-bezier(0.4, 0, 0.2, 1);
  --brand: #5b3fd9;                    /* the Skipper logo's purple */
  --brand-soft: rgba(91, 63, 217, .08);
  --link: #0066cc;
}

:root[data-theme="dark"] {
  --brand: #9d8bff;
  --brand-soft: rgba(157, 139, 255, .14);
  --link: #7ab4ff;
  --bg: #171613;
  --surface: #1f1e1a;
  --border: #33322c;
  --border2: #4a4941;
  --text: #edece6;
  --t2: #a5a49c;
  --t3: #706f67;
  --accent: #edece6;
  --afg: #171613;
  --green: #77d6a2;
  --gbg: #16271c;
  --amber: #e6b962;
  --abg: #2c2515;
  --red: #eb8a8a;
  --r-bg: #2d1a1a;
  --accent-hover: #ffffff;
  --ok-border: #2f5a42;
  --warn-border: #5a4a1f;
  --err-border: #5a2f2f;
  --err-border2: #6b3a3a;
  --red-hover: #f2a0a0;
  --hover: #26251f;
  --mode-text-bg: #1e2540;
  --mode-text-fg: #a9bdf5;
  --mode-text-border: #33406b;
  --mode-voice-bg: #2b1e35;
  --mode-voice-fg: #e0a9f0;
  --mode-voice-border: #4a3358;
}

html, body {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

.muted { color: var(--t2); }
.small { font-size: 11.5px; }
.hidden { display: none !important; }

a { color: inherit; }

/* ─── Shell + sidebar ─────────────────────────────────── */

.shell { display: flex; min-height: 100vh; }

.sb {
  width: var(--sw);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sb-logo { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.sb-brand .wm {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.sb-brand .ws { font-size: 11px; color: var(--t3); margin-top: 1px; }

.nav { padding: 0 6px; flex: 1; }

.ni {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: var(--r);
  background: none;
  cursor: pointer;
  color: var(--t2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 400;
  text-align: left;
  transition: background .1s, color .1s;
  user-select: none;
  margin-bottom: 1px;
}
.ni svg { flex-shrink: 0; width: 14px; height: 14px; opacity: .65; }
.ni:hover { background: var(--bg); color: var(--text); }
.ni.on { background: var(--text); color: var(--afg); }
.ni.on svg { opacity: 1; }
.ni:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.ncount {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t3);
  letter-spacing: .02em;
}
.ni.on .ncount { color: var(--afg); opacity: .6; }

.ndiv { height: 1px; background: var(--border); margin: 8px 6px; }

.sb-foot {
  padding: 0 16px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sb-state {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--t2);
  line-height: 1.35;
}
.ver {
  font-size: 10px;
  color: var(--t3);
  letter-spacing: .04em;
  font-family: var(--mono);
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.g { background: var(--green); }
.dot.a { background: var(--amber); }
.dot.r { background: var(--red); }
.dot.n { background: var(--t3); }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ─── Main pane ───────────────────────────────────────── */

.main { flex: 1; padding: 32px 44px 56px; max-width: 1000px; min-width: 0; }
.pane { display: none; }
.pane.on { display: block; }

.ph { margin-bottom: 24px; display: flex; align-items: flex-start; gap: 16px; }
.ph > div { min-width: 0; }
.ph h1 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.ph p { color: var(--t2); font-size: 12px; margin-top: 3px; line-height: 1.55; }
.ph-actions { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

.sl {
  font-size: 10px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 10px;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sl-note { letter-spacing: 0; text-transform: none; font-size: 11px; color: var(--t3); }
.sec { margin-bottom: 30px; }
.sec:last-child { margin-bottom: 0; }

/* ─── Cards / rows ────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.cr {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cr:last-child { border-bottom: none; }
.crt { flex: 1; min-width: 0; }
.crt .rl { font-size: 12.5px; font-weight: 500; }
.crt .rd {
  font-size: 11.5px;
  color: var(--t2);
  margin-top: 1px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crc { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }

.cr.clickable { cursor: pointer; transition: background var(--ease); }
.cr.clickable:hover { background: var(--bg); }

/* Run rows: fixed slots on the right so checks, status and verdict line up down the list. */
.run-slot { flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.run-slot.checks { width: 230px; }
.run-slot.status { width: 92px; }
.run-slot.verdict { width: 92px; }

.empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--t3);
  font-size: 12.5px;
  line-height: 1.6;
}
.empty strong { color: var(--t2); font-weight: 500; display: block; margin-bottom: 2px; }

/* mono chip — a compact technical tag */
.chip {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .03em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 7px;
  color: var(--t2);
  white-space: nowrap;
}
.chip.solid { background: var(--accent); color: var(--afg); border-color: var(--accent); }
.chip.mode-text { background: var(--mode-text-bg); color: var(--mode-text-fg); border-color: var(--mode-text-border); font-weight: 500; }
.chip.chip-pass { color: var(--green); background: var(--gbg); border-color: var(--ok-border); }
.chip.chip-mixed { color: var(--amber); background: var(--abg); border-color: var(--warn-border); }
.chip.chip-fail { color: var(--red); background: var(--r-bg); border-color: var(--err-border); }
.chip.mode-voice { background: var(--mode-voice-bg); color: var(--mode-voice-fg); border-color: var(--mode-voice-border); font-weight: 500; }

/* ─── Status pills ────────────────────────────────────── */

.st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--t2);
  white-space: nowrap;
}
.st .dot { width: 6px; height: 6px; }
.st.running { color: var(--amber); background: var(--abg); border-color: var(--warn-border); }
.st.done { color: var(--green); background: var(--gbg); border-color: var(--ok-border); }
.st.bad { color: var(--red); background: var(--r-bg); border-color: var(--err-border); }

.verdict { font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.verdict.pass { color: var(--green); }
.verdict.fail { color: var(--red); }
.verdict.unset { color: var(--t3); font-weight: 400; }
.verdict.review { color: var(--amber); }

/* automatic checks — VoiceCall found / Case created */
.checks-cell { display: flex; flex-direction: column; gap: 3px; }
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--t2);
  white-space: nowrap;
}

/* ─── Form controls ───────────────────────────────────── */

label.fl {
  display: block;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--t2);
  margin-bottom: 6px;
}

input[type=text],
input[type=search],
input[type=tel],
input[type=url],
input[type=password],
input[type=email],
input[type=number],
input[type=time],
textarea,
select {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
textarea.tall { min-height: 120px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .06);
}
input::placeholder, textarea::placeholder { color: var(--t3); }

/* Drop the native macOS select chrome so selects match the text inputs. */
select {
  appearance: none;
  -webkit-appearance: none;
  height: 33px;
  padding-right: 30px;
  line-height: 1.3;
  cursor: pointer;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%236b6a64' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px 6px;
}
select:hover { border-color: var(--t3); }
select:disabled { cursor: default; opacity: .6; }
input.mono, textarea.mono { font-family: var(--mono); font-size: 11.5px; }

.hint { font-size: 11px; color: var(--t3); margin-top: 5px; line-height: 1.45; }
.field-warn { font-size: 11px; color: var(--amber); margin-top: 6px; }

.fg { display: flex; flex-direction: column; gap: 14px; }
.fg.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.settings-group + .settings-group { border-top: 1px solid var(--border); padding-top: 14px; }
.settings-group-title { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--text); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.var-rows { display: flex; flex-direction: column; gap: 8px; }
.var-row { display: flex; align-items: center; gap: 8px; }
.var-row .var-name { flex: 0 0 38%; }
.var-row .var-value { flex: 1; }
.var-add { margin-top: 8px; }

/* ─── Test case editor — options-page style sections ── */

.ed-sec { padding: 16px; border-bottom: 1px solid var(--border); }
.ed-sec > .sl { margin-bottom: 12px; }
.ed-foot { padding: 12px 16px; display: flex; align-items: center; gap: 8px; background: var(--bg); }

.target-row { display: flex; align-items: center; gap: 8px; }
.target-row select, .target-row input { flex: 1; }

/* ─── Buttons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .1s, border-color .1s, color .1s;
  white-space: nowrap;
}
.btn svg { width: 13px; height: 13px; }
.bp { background: var(--accent); color: var(--afg); border-color: var(--accent); }
.bp:hover { background: var(--accent-hover); }
.bs { background: var(--surface); color: var(--text); border-color: var(--border2); }
.bs:hover { background: var(--bg); }
.bsm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { background: var(--border2); border-color: var(--border2); color: var(--surface); cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bdanger { background: var(--surface); color: var(--red); border-color: var(--border2); }
.bdanger:hover { background: var(--r-bg); border-color: var(--err-border2); }
.bdanger.confirm { background: var(--red); color: var(--afg); border-color: var(--red); }
.bdanger.confirm:hover { background: var(--red-hover); }

/* icon-only button */
.ib {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: none;
  color: var(--t2);
  cursor: pointer;
  transition: background .1s, color .1s;
}
.ib:hover { background: var(--bg); color: var(--text); border-color: var(--border); }
.ib:disabled { color: var(--t3); cursor: not-allowed; }
.ib:disabled:hover { background: none; border-color: transparent; }

/* ─── Callouts ────────────────────────────────────────── */

.callout {
  border-radius: var(--r);
  padding: 10px 13px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.callout:last-child { margin-bottom: 0; }
.callout.a { background: var(--abg); color: var(--amber); border: 1px solid var(--warn-border); }
.callout.n { background: var(--bg); color: var(--t2); border: 1px solid var(--border); }
.callout.ok { background: var(--gbg); color: var(--green); border: 1px solid var(--ok-border); }
.callout.err { background: var(--r-bg); color: var(--red); border: 1px solid var(--err-border); }
.callout code { background: var(--surface); }

/* ─── Connected-state row ─────────────────────────────── */

.cs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.cs:last-child { margin-bottom: 0; }
.cs-b {
  font-size: 10px;
  font-family: var(--mono);
  background: var(--accent);
  color: var(--afg);
  border-radius: 3px;
  padding: 2px 7px;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.cs-k {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--t2);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-s {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--green);
  flex-shrink: 0;
}

/* ─── Numbered steps ──────────────────────────────────── */

.how { padding: 14px 16px; }
.hw-lbl {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 9px;
}
.hs { list-style: none; display: flex; flex-direction: column; gap: 7px; counter-reset: step; }
.hs li {
  position: relative;
  padding: 0 0 0 27px;
  counter-increment: step;
  font-size: 12.5px;
  line-height: 1.6;
}
.hs li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--afg);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hs strong { font-weight: 500; }

/* ─── About / stat grid ───────────────────────────────── */

.ag { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
}
.ab .abl {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 3px;
}
.ab .abv { font-size: 13px; font-weight: 500; word-break: break-all; }
.ab .abs { font-size: 11.5px; color: var(--t2); margin-top: 1px; }

kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 3px;
  padding: 2px 7px;
  box-shadow: 0 1px 0 var(--border2);
}

/* ─── Runs filters + pager ────────────────────────────── */

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1 1 220px; min-width: 160px; }
.filters select { flex: 0 0 auto; width: auto; min-width: 130px; }

/* A compact select that sits inside a section label row. */
.sl-select {
  width: auto;
  margin-left: auto;
  padding: 3px 6px;
  font-size: 11px;
  border-radius: 3px;
  color: var(--t2);
  height: auto;
  padding-right: 20px;
  background-position: right 6px center;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 11.5px;
  color: var(--t2);
}
.pager .pager-range { font-family: var(--mono); font-size: 11px; color: var(--t3); }
.pager .pager-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pager select { width: auto; height: auto; padding: 3px 20px 3px 6px; font-size: 11px; border-radius: 3px; background-position: right 6px center; }

/* ─── Runs table ──────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--t3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  vertical-align: middle;
}
tbody tr { cursor: pointer; transition: background var(--ease); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
td.num, td.time { font-family: var(--mono); font-size: 11.5px; color: var(--t2); white-space: nowrap; }
td.case-name { font-weight: 500; }
tbody td.empty-cell {
  text-align: center;
  color: var(--t3);
  font-size: 12.5px;
  padding: 26px 14px;
  cursor: default;
}
tbody td.empty-cell:hover { background: none; }

/* ─── Investigation page ──────────────────────────────── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--t2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.back-link:hover { color: var(--text); }
.inv-page { display: flex; flex-direction: column; gap: 20px; }
.inv-page .sec { margin-bottom: 0; }
.inv-page > .callout { margin-bottom: 0; }
.inv-page > .sec { margin-top: 12px; }
.inv-page > .sec > .sl { flex-wrap: wrap; }

/* Story on the left, facts on the right — like an issue in a tracker */
.inv-top { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 40px; align-items: start; margin-top: 4px; }
.inv-main { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.inv-main > .callout { margin: 0; }
.inv-fetch-error { display: flex; flex-direction: column; gap: 8px; }
.inv-raw-error summary { cursor: pointer; font-size: 11.5px; opacity: .8; }
.inv-raw-error code { display: block; margin-top: 6px; padding: 6px 8px; border-radius: 3px; font-family: var(--mono); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.inv-callout-acts { display: flex; gap: 16px; }
.inv-callout-acts .inv-act { color: inherit; opacity: .85; text-decoration: underline; text-underline-offset: 2px; }
.inv-callout-acts .inv-act:hover { color: inherit; opacity: 1; }

.inv-title { flex: 1; min-width: 0; }
.inv-title h1 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
.inv-title p { color: var(--t2); font-size: 12px; margin-top: 3px; }

/* One heading style for the whole column */
.inv-h { font: 10px/1.4 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--t3); margin: 0 0 10px; }

/* The headline: what happened vs expected, in large type */
.inv-problem { display: flex; flex-direction: column; gap: 18px; position: relative; }
.inv-claim.happened .inv-claim-k { color: var(--red); }
.inv-claim.expected .inv-claim-k { color: var(--green); }
.inv-claim-k { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.happened .inv-claim-k { color: var(--red); }
.expected .inv-claim-k { color: var(--green); }
.inv-claim-v { margin: 0; font-size: 19px; line-height: 1.4; font-weight: 500; letter-spacing: -.01em; white-space: pre-wrap; word-break: break-word; }
.expected .inv-claim-v { color: var(--t2); font-weight: 400; }
.inv-problem-edit { position: absolute; top: 0; right: 0; }

/* Quiet text actions: Copy, Change, Re-fetch, Edit, Close */
.inv-act {
  background: none; border: 0; padding: 0; font: inherit; font-size: 12px;
  color: var(--t3); cursor: pointer; text-decoration: none;
}
.inv-act:hover { color: var(--text); }
.inv-act.danger:hover, .inv-act.confirm { color: var(--red); }

/* The facts rail: a reference table, label | value */
.inv-rail { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.inv-props { display: flex; flex-direction: column; margin: 0; border-top: 1px solid var(--border); }
.inv-prop { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.inv-prop dt { font-family: var(--mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--t3); padding-top: 3px; }
.inv-prop dd { margin: 0; font-size: 12.5px; line-height: 1.4; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.inv-prop dd .mono { font-family: var(--mono); font-size: 11.5px; }
.inv-wrap { overflow-wrap: anywhere; }
.inv-acts { display: flex; gap: 12px; }
.inv-copyable { display: flex; align-items: flex-start; gap: 6px; }
.inv-copy { display: inline-flex; flex: none; padding: 2px; margin-top: -1px; border-radius: 3px; }
.inv-copy svg { width: 13px; height: 13px; }
.inv-copy.copied { color: var(--green, #2f9e6b); }
.inv-sev { width: auto; height: auto; padding: 3px 24px 3px 7px; font-size: 12.5px; background-position: right 8px center; }
.inv-acts .inv-act { font-size: 11.5px; }
.inv-ext { color: var(--link); text-decoration: none; font-weight: 500; }
.inv-ext:hover { text-decoration: underline; }
.inv-ext-arrow { margin-left: 3px; font-family: var(--sans); font-weight: 400; }
.inv-close-btn { width: 100%; justify-content: center; }
.inv-rail-foot { display: flex; gap: 16px; justify-content: center; margin-top: -4px; }

/* Sections of the story column share one heading style */
.inv-block { margin-top: 16px; }
.inv-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.inv-sec-head h2 { font: 10px/1.4 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--t3); margin: 0; }
.inv-sec-head .btn { margin-left: auto; }
.inv-sec-note { font-size: 12px; color: var(--t3); }
.inv-prop-sub { font-size: 11.5px; color: var(--t3); }

/* Reproduce: one line to start, one line per answer */
.inv-page .replays { gap: 8px; }
.inv-page .replay-form { background: none; border: 0; padding: 0; }
.replay-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.replay-line select { width: auto; max-width: 170px; padding-top: 5px; padding-bottom: 5px; font-size: 12.5px; }
.replay-line .btn { margin-right: 4px; }
.replay-on { font-size: 12.5px; color: var(--t3); }
.replay-sub { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; color: var(--t3); }
.replay-sub .replay-closebar .seg-b { padding: 5px 12px; font-weight: 500; }
.replay-closebar > .muted { margin-right: auto; }
.replay-closebar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 16px; background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.replay-cost { font-size: inherit; color: inherit; }
.replay-where.other { color: var(--amber); }
.replay-sub .replay-about { margin-left: auto; font-size: inherit; }
.replay-sub .replay-about[open] { flex-basis: 100%; margin-left: 0; }

.inv-page .replay-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: clip; }
.inv-page .replay-group:first-of-type { margin-top: 8px; }
.replay-sum { display: flex; align-items: center; gap: 12px; padding: 9px 12px; cursor: pointer; list-style: none; }
.replay-sum::-webkit-details-marker { display: none; }
.replay-sum::after { content: '▸'; margin-left: auto; font-size: 13px; color: var(--t3); transition: transform var(--ease); }
.replay-group[open] > .replay-sum::after { transform: rotate(90deg); }
.replay-sum:hover { background: var(--hover); }
.replay-pips { display: inline-flex; gap: 3px; }
.replay-pip { width: 8px; height: 8px; border-radius: 50%; background: var(--border2); }
.replay-pip.r { background: var(--red); }
.replay-pip.g { background: var(--green); }
.replay-pip.a { background: var(--amber); }
.replay-pip.x { background: none; box-shadow: inset 0 0 0 1.5px var(--border2); }
.replay-pip.pulse { animation: pulse 1.6s ease-in-out infinite; }
.replay-verdict { font-size: 13px; font-weight: 600; white-space: nowrap; }
.replay-verdict.bad { color: var(--red); }
.replay-verdict.ok { color: var(--green); }
.replay-meta { font-size: 12px; color: var(--t3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-body { border-top: 1px solid var(--border); }
.replay-body-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.replay-body > .callout { margin: 8px 12px; }
.replay-again { display: flex; align-items: center; gap: 12px; }

/* Evidence: below a rule, read when you need it */
.inv-evidence { border-top: 1px solid var(--border); padding-top: 28px; }

/* Fewer boxes in the trace: turns separated by rules, steps as plain rows */
.inv-page .tl-filters { top: 0; background: var(--bg); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 8px 0; }
.inv-page .tl-body { gap: 0; }
.inv-page .tl-turn { background: none; border: 0; border-radius: 0; border-top: 1px solid var(--border); padding: 16px 0; }
.inv-page .tl-turn:first-child { border-top: 0; }
.inv-page .tl-turn.bad { background: var(--r-bg); border-radius: var(--r-md, 8px); padding-left: 12px; padding-right: 12px; }
.inv-page .tl-steps { gap: 0; }
.inv-page .tl-step { background: none; border: 0; border-radius: 0; }
.inv-page .tl-step-sum { padding: 3px 0; }
.inv-page .tl-step-sum:hover { background: var(--hover); }
.inv-page .tl-step[open] { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin: 4px 0; }
.inv-page .tl-step[open] > .tl-step-sum { padding: 6px 10px; }
.inv-page .tl-step.bad { background: var(--r-bg); border-radius: var(--r); }

@media (max-width: 900px) {
  .inv-top { grid-template-columns: 1fr; gap: 28px; }
  .inv-rail { position: static; order: -1; }
}

/* ─── Overlay + modal (run detail) ────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, .40);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 24px 24px;
  overflow-y: auto;
}
.modal {
  width: 860px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .02),
    0 16px 48px -8px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mh {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mh h2 { font-size: 14px; font-weight: 500; letter-spacing: -.01em; }
.mh .mh-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mb {
  padding: 18px;
  overflow-y: auto;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mb .sec { margin-bottom: 0; }
.mb::-webkit-scrollbar { width: 10px; }
.mb::-webkit-scrollbar-track { background: transparent; }
.mb::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 3px solid var(--surface); }

/* key/value list inside the modal */
.kv {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.kv > div {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
.kv > div:last-child { border-bottom: none; }
.kv dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--t3);
  padding-top: 1px;
}
.kv dd { font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.kv dd.mono { font-family: var(--mono); font-size: 11.5px; color: var(--t2); }

/* ─── Transcript ──────────────────────────────────────── */

.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding: 2px;
}
.transcript::-webkit-scrollbar { width: 8px; }
.transcript::-webkit-scrollbar-track { background: transparent; }
.transcript::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.turn { display: flex; flex-direction: column; max-width: 82%; }
.turn .who {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 4px;
}
.turn .what {
  font-size: 13px;
  line-height: 1.6;
  padding: 9px 13px;
  border-radius: var(--r-lg);
  white-space: pre-wrap;
  word-break: break-word;
}
.turn.bot { align-self: flex-start; }
.turn.bot .what {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.turn.user { align-self: flex-end; align-items: flex-end; }
.turn.user .what {
  background: var(--text);
  border: 1px solid var(--text);
  color: var(--afg);
}
.turn.user .who { color: var(--t3); }

/* ─── Traces & Reasoning ──────────────────────────────── */

.traces-list { display: flex; flex-direction: column; gap: 8px; }
.trace-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.trace-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  background: var(--bg);
}
.trace-summary:hover { background: var(--hover); }
.trace-body {
  padding: 10px 12px;
  font-size: 11.5px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trace-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.trace-action-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 3px;
  padding: 2px 6px;
}

/* ─── Investigations ──────────────────────────────────── */

.chip.sev-low { color: var(--t3); }
.chip.sev-high { color: var(--amber); background: var(--abg); border-color: var(--warn-border); }
.chip.sev-critical { color: var(--red); background: var(--r-bg); border-color: var(--err-border); font-weight: 500; }

/* Reporters (a client's people) only get the Investigations area. */
body.role-reporter .ni:not([data-view="investigations"]),
body.role-reporter .ndiv,
body.role-reporter .nsub,
body.role-reporter #config-pill,
body.role-reporter #config-banner { display: none !important; }

.inv-call { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.inv-summary { font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.inv-candidates { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.inv-candidate { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--text); font-size: 12px; }

.replays { display: flex; flex-direction: column; gap: 12px; }
.replay-form-main { display: flex; align-items: center; gap: 16px 24px; padding: 14px 16px; flex-wrap: wrap; }
.replay-what { flex: 1 1 280px; min-width: 0; }
.replay-q { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.replay-what p { font-size: 12px; line-height: 1.5; color: var(--t2); margin: 0; }
.replay-what strong { color: var(--text); font-weight: 600; }
.replay-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.replay-controls select { width: auto; }
.replay-form-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid var(--border); background: var(--bg); }
.replay-about { font-size: 11.5px; color: var(--t2); }
.replay-about > summary { cursor: pointer; text-align: right; }
.replay-about[open] { flex-basis: 100%; }
.replay-about[open] > summary { text-align: left; margin-bottom: 6px; }
.replay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg); }
.replay-head .rl { font-size: 12.5px; font-weight: 500; }
.replay-head .rd { font-size: 11px; color: var(--t3); }
.replay-group > .callout { margin: 10px 16px 0; }
.replay-run { border-bottom: 1px solid var(--border); }
.replay-run:last-child { border-bottom: none; }
.replay-run > .cr { border-bottom: none; flex-wrap: wrap; }
.replay-run .crt { flex: 1 0 100%; }
.replay-run .crc { margin-left: auto; }
.replay-run .rd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replay-run > .table-wrap, .replay-trace { padding: 0 16px 14px; }
.replay-cost { font-size: 11.5px; line-height: 1.5; margin: 0; color: var(--t2); }
.replay-notes { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.replay-rejudge { margin-left: 10px; font-size: 11px; }
.report-editor { margin-bottom: 14px; padding: 14px 16px; }
.replay-score { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border2); border-radius: var(--r); overflow: hidden; }
.seg-b { font: inherit; font-size: 11.5px; padding: 4px 9px; border: 0; background: var(--surface); color: var(--t2); cursor: pointer; }
.seg-b + .seg-b { border-left: 1px solid var(--border2); }
.seg-b:hover { background: var(--bg); color: var(--text); }
.seg-b.on.bad { background: var(--r-bg); color: var(--red); }
.seg-b.on.ok { background: var(--gbg); color: var(--green); }
.seg-b:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.cmp th { text-align: left; font-weight: 500; color: var(--t3); font-size: 11px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.cmp td { padding: 8px; vertical-align: top; border-bottom: 1px solid var(--border); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.cmp td.cmp-caller { color: var(--t2); }
.check-row { align-items: flex-start; }
.check-row .rl .chip { margin-right: 4px; vertical-align: 1px; }
.check-row .st { flex-shrink: 1; white-space: normal; max-width: 240px; }
.persona-who .hint { margin-top: 22px; }
/* the Callers page: the rules every caller follows */
#callers-base { padding: 16px 18px; }
#callers-base ul { margin: 4px 0 0; padding-left: 18px; font-size: 12px; }
#callers-base li + li { margin-top: 3px; }
.persona-preview { white-space: pre-wrap; max-height: 360px; overflow: auto; margin-top: 10px; }
.check-draft { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.draft-bar { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.draft-total { font-weight: 500; margin-right: auto; }
.draft-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--t2); text-decoration: underline; cursor: pointer; }
.draft-link:hover { color: var(--text); }
.draft-group { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.draft-group > header { display: flex; align-items: baseline; gap: 8px; padding: 7px 12px; background: var(--bg2, rgba(127,127,127,.08)); border-bottom: 1px solid var(--border); }
.draft-group > header h4 { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--t2); }
.draft-group > header .draft-link { margin-left: auto; }
.draft-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 12px; cursor: pointer; }
.draft-row + .draft-row { border-top: 1px solid var(--border); }
.draft-row:hover { background: rgba(127,127,127,.06); }
.draft-row input { margin-top: 3px; flex: none; }
.draft-row.is-have { opacity: .55; cursor: default; }
.draft-text { min-width: 0; }
.draft-title { font-size: 13px; overflow-wrap: anywhere; }
.draft-have { margin-left: 8px; font-size: 11px; color: var(--t3); }
.draft-note { margin-top: 1px; font-size: 11.5px; color: var(--t3); overflow-wrap: anywhere; }
.draft-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px 0; background: var(--bg, inherit); border-top: 1px solid var(--border); }
.check-editor { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.inv-folds { display: flex; flex-direction: column; border-top: 1px solid var(--border); margin-top: 6px; }
.inv-fold { border-bottom: 1px solid var(--border); }
.inv-fold > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 2px;
  cursor: pointer;
  list-style: none;
}
.inv-fold > summary::-webkit-details-marker { display: none; }
.inv-fold > summary::before { content: '▸'; font-size: 12px; color: var(--t2); transition: transform var(--ease); }
.inv-fold[open] > summary::before { transform: rotate(90deg); }
.inv-fold-title { font-size: 12.5px; font-weight: 500; }
.inv-fold-body { padding: 0 2px 16px; }
.inv-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.inv-event { padding: 8px 0; }
.inv-event.ev-note .inv-event-meta strong { color: var(--brand); }
.inv-event.ev-trace .inv-event-meta strong { color: var(--green); }
.inv-event-meta { font-size: 11px; color: var(--t3); }
.inv-event-meta strong { color: var(--t2); font-weight: 500; }
.inv-event-text { font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* Trace timeline: one block per turn, its steps folded */
.tl { display: flex; flex-direction: column; gap: 12px; }
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl-head > .muted { min-width: 0; overflow-wrap: anywhere; }
.inv-call .mono { overflow-wrap: anywhere; }
.tl-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--t2); cursor: pointer; }
.tl-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  position: sticky;
  top: 0;
  z-index: 2;
}
.tl-presets { flex-wrap: wrap; align-items: center; }
.tl-more {
  font: inherit;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--t2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tl-more.on, .tl-more:hover { color: var(--text); }
.tl-more:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tl-more-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.tl-advanced { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.tl-types { display: flex; flex-wrap: wrap; gap: 4px; }
.tl-type {
  font: inherit;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--t3);
  cursor: pointer;
}
.tl-type.on { background: var(--text); border-color: var(--text); color: var(--afg); }
.tl-type:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tl-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tl-filter-row select { max-width: 260px; }
.tl-body { display: flex; flex-direction: column; gap: 12px; }
.tl-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.trace-action-pill.chosen { font-weight: 600; color: var(--text); border-color: var(--text); }
.tl-prompt > summary { cursor: pointer; font-size: 11.5px; color: var(--t2); }
.tl-prompt > pre { margin-top: 6px; max-height: 420px; }
.tl-vars tr.internal td { color: var(--t3); }
.tl-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.tl-turn.bad { border-color: var(--err-border); }
.tl-turn-empty { padding: 0 12px; }
.tl-turn-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.tl-steps { display: flex; flex-direction: column; gap: 4px; }
.tl-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 12px;
}
.tl-step.bad { border-color: var(--err-border); background: var(--r-bg); }
.tl-step-sum {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  list-style: none;
  min-width: 0;
}
.tl-step-sum::-webkit-details-marker { display: none; }
.tl-step.empty-step .tl-step-sum { cursor: default; }
.tl-kind {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--t3);
  min-width: 70px;
}
.tl-kind.k-action { color: var(--brand); }
.tl-step.bad .tl-kind { color: var(--red); }
.tl-name { flex-shrink: 0; font-size: 11px; color: var(--t2); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-what { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-step.bad .tl-what { color: var(--red); }
.tl-step-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
}
.tl-say { font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; margin: 0; }
.tl-json {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.tl-vars { width: 100%; border-collapse: collapse; font-size: 11px; }
.tl-vars th { text-align: left; font-weight: 500; color: var(--t3); padding: 3px 8px 3px 0; }
.tl-vars td { padding: 3px 8px 3px 0; vertical-align: top; word-break: break-word; }
.tl .turn { max-width: 90%; }

@media (max-width: 640px) {
  .tl-name { display: none; }
  .tl-kind { min-width: 0; }
}

/* ─── Toasts ──────────────────────────────────────────── */

.toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .16);
  padding: 10px 13px;
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in .16s var(--ease);
}
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ─── Responsive ──────────────────────────────────────── */

@media (max-width: 900px) {
  .sb-account { margin-bottom: 0; }
  .sb-account-row .sb-email { display: none; }
  .shell { flex-direction: column; }
  .sb {
    width: auto;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sb-brand { padding: 0; border-bottom: none; margin-bottom: 0; }
  .sb-brand .ws { display: none; }
  .nav { display: flex; padding: 0; flex: 1; gap: 2px; }
  .ni { width: auto; padding: 6px 10px; }
  .ncount { display: none; }
  .ndiv { display: none; }
  .sb-foot { flex-direction: row; margin-top: 0; padding: 0; align-items: center; gap: 10px; }
  .sb-state span { display: none; }
  .main { padding: 22px 18px 44px; }
  .cr { flex-wrap: wrap; }
  .crt { flex: 1 1 100%; }
  .crc { width: 100%; justify-content: flex-end; }
  .fg.two, .ag, .settings-group { grid-template-columns: 1fr; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  .turn { max-width: 94%; }
  .overlay { padding: 3vh 12px 12px; }
}

/* ---------- batches ---------- */

.batch-cases {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 4px 14px;
  max-height: 260px;
  overflow: auto;
}

.batch-case {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
}

.batch-case:last-child { border-bottom: none; }
.batch-case span:first-of-type { flex: 1; }
.batch-case .rd { flex: none; }
.batch-case input { margin: 0; }

/* inline text buttons (Copy / Download transcript) */
.link-btn {
  background: none;
  border: none;
  color: var(--t2);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--text); }

/* transcript turn timestamps */
.voice-timeline { max-height: none; }
.turn .heard { font-size: 12px; color: var(--t2); margin-top: 4px; max-width: 100%; }
.turn .heard.bad { color: var(--red); }
.turn .heard.slow { color: var(--amber); }
.turn.rec-only .what { background: transparent; color: var(--t2); border: 1px dashed var(--border2); }
.dead-air { display: inline-block; font-size: 11.5px; color: var(--t2); border: 1px dashed var(--border2); border-radius: 4px; padding: 2px 10px; }
.dead-air.bad { color: var(--red); border-color: var(--err-border); }
.turn .heard em { font-style: normal; color: var(--text); }
.turn-trace { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.turn.playing .what { box-shadow: 0 0 0 2px var(--accent); }
.turn .tstamp.seek { font: inherit; background: none; border: 0; padding: 0; margin-left: 6px; cursor: pointer; color: inherit; text-decoration: underline dotted; }
.turn .tstamp.seek:disabled { cursor: default; text-decoration: none; }
.turn .tstamp {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t3);
  margin-left: 6px;
}

/* ─── Batch history ───────────────────────────────────── */

.batch-run-block {
  flex-shrink: 0; /* a child of the scrolling .mb: scroll, don't squash */
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 12px;
  overflow: hidden;
}
.batch-run-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.coverage { padding: 4px 12px 12px; }
.cov-bundle + .cov-bundle { margin-top: 14px; }
.cov-part { padding: 4px 0; }
.cov-untested { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 2px 0 4px 14px; }
#template-panel { padding: 16px 18px; margin-top: 12px; }
table.usage { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.usage th, table.usage td { padding: 7px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
table.usage th:first-child, table.usage td:first-child { text-align: left; }
table.usage tr:last-child td { border-bottom: none; }
.chips-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.batch-run-block.focused { border-color: var(--accent); }
.batch-run-form {
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.batch-run-form .fg.two { max-width: 560px; }
.sc-fold > .trace-summary { padding: 9px 12px; }
.scorecard { display: flex; flex-direction: column; }
.sc-case { border-top: 1px solid var(--border); padding: 0 12px; }
.sc-case > summary { list-style: none; cursor: pointer; }
.sc-case > summary::-webkit-details-marker { display: none; }
details.sc-case > summary .sc-name::before { content: '▸'; display: inline-block; width: 12px; margin-left: 0; color: var(--t3); font-size: 10px; }
details.sc-case[open] > summary .sc-name::before { content: '▾'; }
details.sc-case[open] { background: var(--bg); }
.sc-case > summary:hover, .sc-case > .sc-row:hover { background: var(--hover); }
.sc-checks { padding: 0 0 8px; }
.sc-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.sc-row .sc-name { flex: 1; min-width: 0; }
.sc-row .sc-cell { flex: none; width: calc(min(150px, 40% / var(--sc-cols, 1))); display: flex; justify-content: flex-end; }
.sc-row:not([style]) .sc-cell, .sc-row[style*="--sc-cols: 1"] .sc-cell { width: auto; }
.sc-cols { padding: 8px 12px 4px; border-bottom: 1px solid var(--border); }
.sc-col-head { font-size: 11.5px; color: var(--t2); text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.sc-del { width: 18px; height: 18px; }
.sc-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
.sc-actions label { display: inline-flex; align-items: center; gap: 5px; }
.sc-head .sc-name { font-weight: 500; }
.sc-name > * { margin-left: 6px; }
.sc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-cmpcell { display: inline-flex; align-items: center; gap: 4px; }
.cmp-mark { font-size: 12px; font-weight: 600; width: 12px; text-align: center; }
.cmp-mark.better { color: var(--green); }
.cmp-mark.worse { color: var(--red); }
.sc-vs { padding: 8px 12px 0; }
.sc-check { padding-left: 14px; font-size: 12.5px; color: var(--t2); }
.sc-runs { display: flex; flex: none; gap: 4px; }
.sc-runs .run-dot { padding: 1px 5px; }
.run-dot {
  display: inline-flex; align-items: center; gap: 4px;
  font: inherit; font-size: 11px; font-family: var(--mono);
  color: var(--t3); background: none; border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 7px; cursor: pointer;
}
.run-dot:hover { color: var(--text); border-color: var(--border2); }
.run-dot .dot { width: 6px; height: 6px; }
.batch-run-rows { display: flex; flex-direction: column; }
.batch-run-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.batch-run-row:last-child { border-bottom: none; }
.batch-run-row:hover { background: var(--bg); }

.sb-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── sign-in pages (hosted mode) ─── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; padding: 28px; }
.auth-card h1 { font-size: 18px; font-weight: 600; margin: 14px 0 4px; color: var(--text); }
.auth-card form { margin-top: 18px; }
.auth-card .btn { width: 100%; justify-content: center; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--text); }
.auth-brand span { font-weight: 400; letter-spacing: 0; color: var(--t2); margin-left: 4px; }

/* ─── account + workspace switcher (hosted mode) ─── */
.sb-account { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sb-account select { font-size: 12px; padding: 5px 8px; }
.sb-account-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sb-email { font-size: 11px; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-link { background: none; border: 0; padding: 0; font: inherit; font-size: 11px; color: var(--t2); cursor: pointer; text-decoration: underline; }
.sb-link:hover { color: var(--text); }
.member-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.member-row .mono { flex: 1 1 200px; overflow: hidden; text-overflow: ellipsis; }
body.role-member .owner-only { pointer-events: none; opacity: .45; }

/* ═══ Setup — laid out like Skipper for Salesforce's options page ═══
   One narrow column; small uppercase section heads with a line of
   description; white cards of rows or forms; sentence-case labels. */

/* Sidebar: Setup's sub-pages, shown while Setup is open */
.nsub { display: none; flex-direction: column; margin: 2px 0 4px 22px; padding-left: 8px; border-left: 1px solid var(--border); }
.nsub.on { display: flex; }
.nsi {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 5px 8px; border: none; border-radius: var(--r); background: none;
  color: var(--t2); font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.nsi:hover { background: var(--bg); color: var(--text); }
.nsi.on { color: var(--text); font-weight: 500; background: var(--hover); }
.nsi:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.nsi-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.nsi-dot.ok { background: var(--green); }
.nsi-dot.todo { background: var(--amber); }

.setup-page { max-width: 640px; }
.setup-sub { display: none; }
.setup-sub.on { display: block; }
.setup-page .setup-tabs { display: none; margin-bottom: 20px; }

.setup-page .sh {
  padding: 0 2px; margin-bottom: 10px;
  font: 10px/1.4 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--t3);
}
.setup-page .sd { padding: 0 2px; margin-bottom: 10px; font-size: 12px; color: var(--t2); line-height: 1.5; }
.setup-page .card.pad { padding: 18px; }
.setup-page .fl {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--t2);
}
.setup-page .hs { margin: 0; }
.field-hint { margin-top: 6px; font-size: 12px; color: var(--t2); line-height: 1.5; }
.field-hint:empty { display: none; }
.set-st { font-size: 12px; color: var(--t3); }
.set-st.ok { color: var(--green); }
.set-st.err { color: var(--red); }
.settings-actions { margin-top: 18px; }
.foot { padding: 0 2px; font-size: 11px; color: var(--t3); line-height: 1.6; }

/* Checklist rows on the overview open their sub-page */
.cr.cr-link { cursor: pointer; }
.cr.cr-link:hover { background: var(--bg); }
.cr.cr-link:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t2); white-space: nowrap; }
.check .dot { width: 6px; height: 6px; }
.check.ok { color: var(--green); }
.check.todo { color: var(--amber); }
.check .chev { color: var(--t3); margin-left: 4px; }

/* Pills (org type; narrow-screen sub-pages) — selected = logo purple */
.ppills { display: flex; gap: 6px; }
.ppill {
  flex: 1 1 0; min-width: 0; display: inline-flex; align-items: baseline; justify-content: center; gap: 6px;
  padding: 5px 12px; white-space: nowrap;
  font: inherit; font-size: 12px; font-weight: 500; color: var(--text);
  background: transparent; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
  transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.ppill:hover { background: var(--bg); }
.ppill:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ppill-sub { font-size: 11px; font-weight: 400; color: var(--t3); overflow: hidden; text-overflow: ellipsis; }
.ppill[aria-checked="true"], .ppill[aria-selected="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.ppill[aria-checked="true"] .ppill-sub { color: var(--brand); opacity: .7; }

/* Screens inside a card (org: connected / connect) */
.fscr { display: flex; flex-direction: column; gap: 16px; }
.matchline { font-size: 13px; font-weight: 600; color: var(--text); }
.conn-key { font-family: var(--mono); font-size: 12px; color: var(--t2); }
.conn-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.connopts { display: flex; gap: 16px; }
.connopts a, .notthis a { font-size: 12px; color: var(--link); text-decoration: none; }
.connopts a:hover, .notthis a:hover { text-decoration: underline; }
.connopts a.danger { color: var(--red); }
.notthis { font-size: 12px; }

/* A saved secret: masked, with Replace / Remove — never an input */
.keyrow { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); }

/* Key field with the show/hide eye */
.iw { position: relative; }
.iw input { padding-right: 36px; font-family: var(--mono); font-size: 12px; }
.ir {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; padding: 4px; color: var(--t3); background: none; border: none; cursor: pointer;
}
.ir:hover { color: var(--text); }

/* Folded extras ("Already logged in with the sf CLI?") */
.howto summary {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t2);
  cursor: pointer; list-style: none; user-select: none;
}
.howto summary::-webkit-details-marker { display: none; }
.howto summary::before {
  content: ''; width: 5px; height: 5px;
  border-right: 1.3px solid currentColor; border-bottom: 1.3px solid currentColor;
  transform: rotate(-45deg); transition: transform .12s;
}
.howto[open] summary::before { transform: rotate(45deg); }
.howto summary:hover { color: var(--text); }
.howto-body { margin-top: 10px; padding: 12px 14px; background: var(--bg); border-radius: var(--r); }

@media (max-width: 900px) {
  .nsub, .nsub.on { display: none; }
  .setup-page .setup-tabs { display: flex; overflow-x: auto; }
  .setup-page .setup-tabs .ppill { flex: 0 0 auto; }
}
@media (max-width: 520px) {
  .ppill-sub { display: none; }
  .setup-page .cr { flex-wrap: wrap; }
}
.inv-page .tl-presets .ppill { flex: 0 0 auto; padding: 3px 11px; }
.inv-page .tl-presets .tl-more { margin-left: auto; }
/* Within a turn, what was said leads; how the bot got there is quieter */
.inv-page .tl-step:not(.bad):not([open]) .tl-what { color: var(--t2); font-size: 11.5px; }
.inv-page .tl-step:not(.bad):not([open]) .tl-name { color: var(--t3); }
/* A failed attempt shows its whole error — the reason is the point */
.crt .rd.replay-error { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; color: var(--red); margin-top: 3px; }
.replay-error-raw { display: inline; }
.replay-error-raw summary { display: inline; cursor: pointer; color: var(--t3); text-decoration: underline; }
.replay-error-raw code { display: block; margin-top: 4px; font-family: var(--mono); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--t2); }
.crt .rd.replay-hungup { white-space: normal; overflow: visible; text-overflow: clip; margin-top: 3px; }
.crt .rd.replay-hungup strong { color: var(--text); font-weight: 500; }
.replay-body-head .inv-act { white-space: nowrap; }
.seg-icons .seg-b { display: inline-flex; align-items: center; padding: 5px 8px; }
.seg-icons .seg-b svg { width: 12px; height: 12px; }
.seg-icons .seg-b:not(.on):hover:first-child { color: var(--green); }
.seg-icons .seg-b:not(.on):hover:last-child { color: var(--red); }
.seg-icons .seg-q { font-weight: 600; font-size: 12px; line-height: 12px; min-width: 28px; justify-content: center; }
.seg-icons .seg-b.on.unsure { background: var(--abg); color: var(--amber); }
.seg-icons .seg-q:not(.on):hover { color: var(--amber); }
.seg-icons .seg-b:not(.on):hover:first-child { color: var(--green); }
.replay-pip.u { background: var(--abg); box-shadow: inset 0 0 0 1.5px var(--amber); }

/* ─── One test case: status, tabs, the brief ──────────── */

.case-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.case-head > div:first-child { flex: 1; min-width: 0; }
.case-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.case-title input { flex: 1; max-width: 420px; font-size: 15px; font-weight: 500; }
.case-title .ib { opacity: .55; }
.case-title .ib:hover, .case-title .ib:focus-visible { opacity: 1; }
.case-head h1 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
.case-head p { color: var(--t2); font-size: 12px; margin-top: 3px; }
.case-head .ph-actions { margin-left: 0; }

.case-status { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); font-size: 12.5px; line-height: 1.5; }
.case-status.fail { background: var(--r-bg); border-color: var(--err-border); }
.case-status.pass { background: var(--gbg); border-color: var(--ok-border); }
.case-status > .dot { margin-top: 6px; }
.case-status > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.case-status strong { font-weight: 600; }
.case-status p { color: var(--t2); font-size: 12px; margin-top: 2px; }

.case-tabs { display: flex; gap: 2px; margin: 20px 0 22px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.case-tab { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 12px; font: inherit; font-size: 12.5px; color: var(--t2); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.case-tab:hover { color: var(--text); }
.case-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.case-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.case-tab .n { font-size: 11px; color: var(--t3); font-variant-numeric: tabular-nums; }
.case-tab .n.bad { color: var(--red); }

.case-lead { color: var(--t2); font-size: 12px; line-height: 1.5; margin-bottom: 12px; }
.case-save-bar { display: flex; align-items: center; gap: 10px; margin-top: 16px; }

/* the brief: a summary, then label | content rows */
.case-brief { padding: 0; background: none; border: 0; box-shadow: none; }
.case-brief.creating { margin-top: 20px; }
.case-part { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.case-part:first-child { border-top: 0; padding-top: 0; }
.case-part:last-child { padding-bottom: 0; }
.case-part-k { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 1px; }
.case-part-k .sl { margin: 0; }
.case-part-k .link-btn { margin-left: 0; font-size: 12px; }
.case-part-v { min-width: 0; font-size: 13px; line-height: 1.55; }
.case-editing { display: grid; gap: 12px; padding: 14px; background: var(--bg); border: 1px solid var(--border2); border-radius: var(--r-lg); }
.case-brief.creating .case-editing { padding: 0; background: none; border: 0; }
@media (max-width: 640px) {
  .case-part { grid-template-columns: 1fr; gap: 8px; }
  .case-part-k { flex-direction: row; align-items: baseline; justify-content: space-between; }
}

.case-goal { max-width: 68ch; white-space: pre-wrap; color: var(--text); }
.case-fact-mark { background: var(--brand-soft); color: inherit; border-radius: 3px; padding: 0 3px; box-shadow: inset 0 -1px 0 var(--brand); }
.case-insert { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.case-insert:empty { display: none; }
.case-insert-btn { cursor: pointer; background: var(--brand-soft); color: var(--text); }
.case-insert-btn:hover { border-color: var(--brand); }
.case-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.case-fact { display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 10px; border-radius: var(--r); background: var(--brand-soft); font-size: 12.5px; max-width: 100%; overflow-wrap: anywhere; }
.case-fact span { color: var(--t2); font-size: 11.5px; }
.case-fact b { font-weight: 500; }

.case-caller { display: flex; gap: 12px; align-items: flex-start; }
.case-avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 12px; }
.case-caller p { font-size: 12.5px; margin-top: 1px; max-width: 62ch; }
.case-caller ul { margin: 6px 0 0; padding-left: 16px; color: var(--t2); font-size: 12.5px; }
.case-caller li + li { margin-top: 2px; }

.case-crits { display: grid; gap: 14px; }
.case-crit h3 { font-size: 11.5px; font-weight: 500; color: var(--t2); margin-bottom: 4px; }
.case-crit ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.case-crit li { display: flex; gap: 10px; align-items: baseline; }
.case-crit li .dot { transform: translateY(-1px); }
.case-why { display: block; color: var(--red); font-size: 12px; }
.case-why.unk { color: var(--t2); }

.case-how { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.case-how li { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.case-how .k { width: 120px; flex-shrink: 0; font-weight: 500; }
.case-how .v { min-width: 0; overflow-wrap: anywhere; }
.case-how .v .chip { margin-left: 6px; }
.case-how.small { font-size: 12px; }
.case-how .run-open { margin-left: 10px; font-size: 12px; color: var(--t2); }
.case-how .run-open:hover { color: var(--text); }

/* Run page: same head, status line, tabs and brief as the test case page. */
.run-verdict { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.run-verdict .seg-b { padding: 5px 14px; font-size: 12.5px; }
.run-conv-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#run-detail-view .case-how .k { width: 150px; }

/* the Test target form */
.tt-form { display: grid; gap: 18px; }
.tt-group { display: grid; gap: 8px; }
.tt-h { font-size: 13px; font-weight: 600; color: var(--text); }
.tt-lead { margin: -4px 0 0; }
.tt-org { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin: 0; }
.tt-org b { font-weight: 500; }
.tt-kind { justify-self: start; }
.tt-kind .seg-b { font-size: 12.5px; padding: 6px 12px; }
.tt-kind .seg-b.on { background: var(--brand-soft); color: var(--text); font-weight: 500; }
.tt-pick { display: grid; gap: 12px; max-width: 560px; }
@media (max-width: 640px) { .tt-kind { justify-self: stretch; } .tt-kind .seg-b { flex: 1; padding: 6px 8px; } }

.case-runs { display: grid; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.case-run { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border: 0; border-bottom: 1px solid var(--border); font: inherit; font-size: 12.5px; color: var(--text); text-align: left; cursor: pointer; flex-wrap: wrap; }
.case-run:last-child { border-bottom: 0; }
.case-run:hover { background: var(--bg); }
.case-run:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.case-run-word { font-weight: 500; min-width: 110px; }
.case-run-tally { margin-left: auto; font-variant-numeric: tabular-nums; }

/* checks tab */
.check-groups { display: grid; gap: 18px; }
.check-group > .sl { margin-bottom: 8px; }
.check-row > .dot { margin-top: 5px; }
.check-tech { font-size: 11px; color: var(--t3); white-space: normal; }
.check-why { color: var(--red); white-space: normal; }
.check-rename { width: 100%; font-weight: 500; }

.case-adv summary { cursor: pointer; color: var(--t2); font-size: 12px; }
.case-adv[open] summary { margin-bottom: 10px; }
.case-danger { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }

/* checks tab: how the call should end */
.outcome-step { padding: 18px 20px; display: grid; gap: 14px; margin-bottom: 14px; }
.outcome-step h2 { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.outcome-step .case-lead { margin: 3px 0 0; }
.outcome-step .case-lead b { color: var(--text); font-weight: 600; }
.outcome-ends { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .outcome-ends { grid-template-columns: 1fr; } }
.outcome-end { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border2); border-radius: var(--r-lg); cursor: pointer; }
.outcome-end:hover { background: var(--bg); }
.outcome-end:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.outcome-end input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.outcome-end b { display: block; font-weight: 600; font-size: 12.5px; }
.outcome-end small { display: block; color: var(--t2); font-size: 12px; margin-top: 2px; line-height: 1.45; }
.outcome-rec { display: grid; gap: 8px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.outcome-rec-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.outcome-rec-h select { width: auto; }
.outcome-rec-h .ib { margin-left: auto; }
.outcome-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.outcome-field > input { flex: 1 1 160px; min-width: 0; }
.outcome-field > select { flex: 0 0 auto; width: auto; }
.outcome-field > input[hidden] { display: none; }
.case-other { margin-top: 22px; }
.case-other > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; padding: 4px 0; }
.case-other > summary .n { font-size: 11px; font-weight: 400; color: var(--t3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.case-other[open] > summary { margin-bottom: 6px; }
.case-other .actions { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conds { gap: 10px; margin: 8px 0 0; }
.cond-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cond-line > select { flex: 0 0 auto; width: auto; }
.cond-line > input { flex: 1 1 160px; min-width: 0; }
.cond-line > .ib { margin-left: auto; }
.cond-line > .chip { flex-shrink: 0; }
.cond-text { flex: 1 1 auto; min-width: 0; display: grid; font-size: 12.5px; }

/* Investigation page: head, progress, tabs (.case-tabs), overview pieces */
.inv-progress { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
.inv-progress li { display: flex; align-items: center; color: var(--t3); }
.inv-progress li + li::before { content: ''; width: 22px; height: 1px; background: var(--border2); margin: 0 8px; }
.inv-progress .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--border2); margin-right: 7px; }
.inv-progress .done { color: var(--text); }
.inv-progress .done .dot { background: var(--green); border-color: var(--green); }
.inv-progress .now { color: var(--text); font-weight: 600; }
.inv-progress .now .dot { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft); }


.inv-rate { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.inv-rate-n { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.inv-pips { display: flex; gap: 4px; }
.inv-pip { width: 22px; height: 8px; border-radius: 2px; background: var(--border2); }
.inv-pip.r { background: var(--red); }
.inv-pip.g { background: var(--green); }

.inv-diag { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.inv-diag .inv-sec-head { margin-bottom: 0; }
.inv-diag .inv-sec-head .inv-act { margin-left: auto; }
.inv-diag-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-diag-badge { font-size: 12px; padding: 2px 9px; border-radius: 4px; background: var(--hover); color: var(--t2); }
.inv-diag-badge.conf-high { background: var(--gbg); color: var(--green); }
.inv-diag-badge.conf-low { background: var(--r-bg); color: var(--red); }
.inv-diag-card { border-radius: var(--r-md, 8px); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.inv-diag-card { background: var(--hover); }
.inv-diag-caution { margin: 0; font-size: 13px; color: var(--amber); }
.inv-diag-step { display: flex; flex-direction: column; gap: 6px; }
.inv-diag-step + .inv-diag-step { margin-top: 6px; }
.inv-diag-step-k { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--t2); }
.inv-diag-n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border2); font-size: 11px; }
.inv-diag-fix-box { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--r); padding: 10px 12px; }
.inv-diag-fix-box pre { flex: 1; min-width: 0; }
.inv-diag-card .btn, .inv-diag-empty .btn { align-self: flex-start; }
.inv-diag-empty { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.inv-diag-empty p { margin: 0; }
.inv-diag-more summary { font-size: 13px; padding: 4px 0; }
.inv-diag-more > summary { list-style: none; }
.inv-diag-more > summary::before { content: '▸'; display: inline-block; width: 14px; transition: transform .1s; }
.inv-diag-more[open] > summary::before { transform: rotate(90deg); }
.inv-diag .inv-sec-head { flex-wrap: wrap; }
.inv-diag-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inv-diag-card .inv-diag-k { color: var(--text); font-size: 12px; }
.inv-diag-fix-where { margin: 0; font-size: 13px; color: var(--t2); }
.inv-diag-fix-text { margin: 0; font: inherit; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.inv-diag-fix-why { margin: 0; font-size: 13px; color: var(--t2); }
.inv-diag-meta { margin: 0; font-size: 12px; color: var(--t3); }
.inv-diag-lead { margin: 0; font-size: 14px; font-weight: 400; line-height: 1.5; }
.inv-diag-sec { display: flex; flex-direction: column; gap: 8px; }
.inv-diag-k { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--t3); }
.inv-diag-verdict { display: flex; flex-direction: column; gap: 8px; }
.inv-diag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-diag-chip { font-size: 12px; padding: 2px 9px; border-radius: 4px; background: var(--hover); color: var(--t2); }
.inv-diag-chip.conf-medium { background: var(--abg); color: var(--amber); }
.inv-diag-chip.conf-high { background: var(--gbg); color: var(--green); }
.inv-diag-chip.conf-low { background: var(--r-bg); color: var(--red); }
.inv-diag-more > .inv-diag-why { margin-top: 12px; }
.inv-diag-why { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 18px 24px; padding-top: 14px; border-top: 1px solid var(--border); }
.inv-diag-sec + .inv-diag-sec { margin-top: 0; }
.inv-diag-bullets.numbered { list-style: decimal; }
.inv-diag-bullets.ruled-out { list-style: none; padding-left: 0; }
.inv-diag-bullets.ruled-out li::before { content: '✕ '; color: var(--t3); }
.inv-diag-fix-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--t2); margin-bottom: 6px; }
.inv-diag-tl { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; counter-reset: tl; }
.inv-diag-tl li { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.inv-diag-tl li.unverified q { opacity: .6; text-decoration: line-through; }
.inv-diag-tl q { color: var(--t2); }
.inv-diag-where { font-size: 12px; color: var(--t3); }
.inv-diag-text { margin: 0; font-size: 13.5px; }
blockquote.inv-diag-quote { margin: 0; padding: 8px 12px; border-radius: var(--r-md, 8px); background: var(--r-bg); font-size: 13px; white-space: pre-wrap; display: block; }
.inv-diag-fix { display: block; background: var(--gbg); border-radius: var(--r-md, 8px); padding: 8px 12px; }
.inv-diag-fix pre { margin: 0; flex: 1; min-width: 0; font: inherit; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.inv-diag-more summary { cursor: pointer; font-size: 12px; color: var(--t2); }
.inv-diag-ev { display: flex; gap: 8px; align-items: baseline; margin: 8px 0 0; font-size: 13px; }
.inv-diag-ev q { color: var(--t2); }
.inv-diag-ev.unverified q { opacity: .6; text-decoration: line-through; }
.inv-diag-bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.inv-diag-list { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; }
.inv-diag-list dt { font-size: 12px; color: var(--t3); padding-top: 2px; }
.inv-diag-list dd { margin: 0; }
.inv-diag-quote { display: flex; gap: 8px; align-items: baseline; margin: 0 0 6px; font-size: 13px; }
.inv-diag-quote q { color: var(--t2); }
.inv-diag-quote.unverified q { opacity: .6; text-decoration: line-through; }
.inv-cite { background: var(--hover); border: 0; border-radius: 4px; padding: 1px 6px; font-size: 11.5px; cursor: pointer; color: var(--text); flex: none; }
.inv-cite:hover { background: var(--brand-soft); color: var(--brand); }
.inv-cite.plain { cursor: default; }
.inv-cite.plain:hover { background: var(--hover); color: var(--text); }
.tl-flash { animation: tl-flash 1.6s ease-out; }
@keyframes tl-flash { 0% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .tl-flash { animation: none; outline: 2px solid var(--brand); } }
@media (max-width: 860px) {
  .inv-diag-list { grid-template-columns: 1fr; gap: 2px; }
  .inv-diag-list dd { margin-bottom: 8px; }
}
@media (max-width: 640px) {
  .inv-diag-fix-box { flex-direction: column; }
  .inv-diag-fix-box .btn, .inv-diag-card .btn { width: 100%; justify-content: center; min-height: 44px; }
  .inv-diag-card-head { flex-wrap: wrap; }
}
blockquote.inv-diag-quote.unverified { opacity: .65; }
.inv-diag-sec .inv-act { align-self: flex-start; }
.inv-diag-warn { margin: 0; }

.case-lines { margin: 0 0 6px; padding-left: 20px; }
.case-lines li { margin: 2px 0; }

/* ─── Voice timeline: the call in a scrollable box, the player docked on top ─── */
.vt-box { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.vt { position: relative; gap: 0; max-height: min(66vh, 620px); overflow-y: auto; padding: 8px 16px; }
.vt-row { padding: 7px 0; }
.vt-row .turn { max-width: 100%; }
.vt-row .turn.user { align-items: flex-end; }
.vt-row .turn.user .what, .vt-row .turn.bot .what { max-width: 86%; }
.vt-row.playing .what { box-shadow: 0 0 0 2px var(--accent); }
.vt-row .turn.user .heard { text-align: right; }
.vt-wide { text-align: center; padding: 5px 0; }

.rp { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg); }
.rp-play { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: var(--bg); display: grid; place-items: center; cursor: pointer; }
.rp-play:hover { background: var(--accent-hover); }
.rp-icon { display: block; width: 12px; height: 12px; background: currentColor; clip-path: polygon(18% 0, 100% 50%, 18% 100%); }
.rp-play.on .rp-icon { clip-path: none; background: linear-gradient(90deg, currentColor 0 34%, transparent 34% 66%, currentColor 66%); }
.rp-time { flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--t2); min-width: 34px; font-variant-numeric: tabular-nums; }
.rp-dur { text-align: right; }
.rp-speed { flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--t2); background: none; border: 1px solid var(--border2); border-radius: 4px; padding: 2px 9px; cursor: pointer; }
.rp-speed:hover { color: var(--text); border-color: var(--t2); }
.rp-track { position: relative; flex: 1; height: 26px; }
.rp-ticks { position: absolute; inset: 0; pointer-events: none; }
.rp-tick { position: absolute; top: 3px; width: 2px; height: 6px; margin-left: -1px; border-radius: 1px; background: var(--border2); }
.rp-tick.user { top: auto; bottom: 3px; background: var(--t3); }
.rp-tick.bad { background: var(--red); height: 9px; }
.rp-seek { -webkit-appearance: none; appearance: none; position: absolute; inset: 0; width: 100%; margin: 0; background: transparent; cursor: pointer; --p: 0%; }
.rp-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; margin-top: 0; background: linear-gradient(90deg, var(--accent) var(--p), var(--border2) var(--p)); }
.rp-seek::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border2); }
.rp-seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.rp-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); }
.rp-seek::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
@media (max-width: 560px) { .rp { gap: 8px; padding: 8px 12px; } .rp-speed { display: none; } }
