:root {
  --bg: #0f1117;
  --panel: #181b24;
  --border: #2a2f3d;
  --text: #e6e8ef;
  --muted: #9aa3b5;
  --subtle: #868fa3;
  --inset: #12151d;
  --pass: #3ddc84;
  --fail: #ff5d5d;
  --none: #8b93a7;
  --accent: #6ea8fe;
  --agent-panel: #161d2b;
  --agent-border: #35476a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
header h1 { font-size: 16px; margin: 0; }
header .muted { color: var(--muted); margin-left: 8px; }
main { padding: 20px 24px; max-width: 1280px; margin: 0 auto; }
h2 { font-size: 15px; margin: 24px 0 8px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
code, pre { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { background: #0b0d13; border: 1px solid var(--border); padding: 10px; overflow: auto; max-height: 360px; border-radius: 6px; }
.muted { color: var(--muted); }
.message { max-width: 380px; white-space: pre-wrap; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; border: 1px solid var(--border); }
.badge.pass { color: var(--pass); border-color: var(--pass); }
.badge.fail { color: var(--fail); border-color: var(--fail); }
.badge.none { color: var(--none); }
.badge.kind { color: var(--accent); }
form.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
input, select, button {
  background: #0b0d13;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
}
input[type="number"] { width: 64px; }
input.rate-input { width: 7rem; }
input.probe-id-input { width: 18rem; max-width: 100%; }
.rate-form { margin: 10px 0 14px; }
button { cursor: pointer; }
button.primary { background: var(--accent); color: #0b0d13; border-color: var(--accent); }
.flash { color: var(--pass); font-size: 12px; margin-left: 6px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.chart { width: 100%; height: auto; }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.chart .dot-pass { fill: var(--pass); }
.chart .dot-fail { fill: var(--fail); }
.chart .dot-none { fill: none; stroke: var(--none); stroke-width: 1.5; }
.chart .tick, .chart .chart-empty { fill: var(--muted); font-size: 10px; }
.login { max-width: 360px; margin: 80px auto; }
.login input { width: 100%; margin: 8px 0 12px; }
.error { color: var(--fail); }
details summary { cursor: pointer; color: var(--muted); }
body.wide main { max-width: 1480px; }
.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}
.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 14px;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-count {
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  padding: 1px 7px;
  margin-left: 4px;
}
.run-bar { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.run-bar .subhead { margin-top: 0; }
.run-endpoint { font-size: 12px; margin: 8px 0 0; }
.trials-heading { font-size: 13px; margin: 22px 0 4px; }
.compare-scroll { overflow-x: auto; }
.compare-table { min-width: 100%; }
.compare-table th, .compare-table td { vertical-align: top; white-space: nowrap; }
.compare-table td .badge { display: inline-block; }
.cell-values {
  display: block;
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  margin-top: 4px;
  max-width: 26ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compare-note { font-size: 12.5px; color: var(--subtle); margin: 10px 0 0; max-width: 78ch; }
.compare-note code { color: var(--text); margin-right: 4px; }
.compare-note.verdict-flipped, .compare-note.verdict-values-changed { color: var(--text); }
.badge.verdict-stable { color: var(--pass); border-color: var(--pass); }
.badge.verdict-flipped { color: var(--fail); border-color: var(--fail); }
.badge.verdict-values-changed { color: #e6c36e; border-color: #e6c36e; }
.badge.verdict-drifted { color: #e6c36e; }
.badge.verdict-single, .badge.verdict-unscored { color: var(--none); }
.review-layout .message-block { white-space: pre-wrap; max-height: none; }
.review-layout textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}
.review-layout .panel > h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.review-layout .panel > p,
.review-layout .behavior p,
.review-layout .metric-spec p { max-width: 68ch; }
.review-layout .behavior,
.review-layout .metric-spec {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.review-layout .behavior:last-child,
.review-layout .metric-spec:last-child { margin-bottom: 0; }
.review-layout .behavior > strong,
.review-layout .metric-spec > strong { margin-right: 6px; }
.review-layout .behavior p,
.review-layout .metric-spec p { margin: 8px 0 0; }
.review-layout .behavior + .subhead,
.review-layout .metric-spec + .subhead { margin-top: 18px; }
.review-layout details { margin: 8px 0; }
.review-layout details[open] { margin-bottom: 14px; }
.review-layout .metric-spec details { margin: 10px 0 0; }
.agent-panel {
  padding: 0;
  background: var(--agent-panel);
  border-color: var(--agent-border);
  border-left: 3px solid var(--accent);
}
.agent-panel > details > summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  padding: 12px 16px;
  color: var(--text);
  list-style: none;
}
.agent-panel > details > summary::-webkit-details-marker { display: none; }
.agent-panel > details > summary::before { content: "▸"; color: var(--muted); }
.agent-panel > details[open] > summary::before { content: "▾"; }
.agent-panel > details[open] > summary { border-bottom: 1px solid var(--agent-border); }
.agent-panel .agent-body { padding: 14px 16px; }
.agent-panel .agent-body > p:first-child { margin-top: 0; }
.agent-panel ul { margin: 0 0 10px; padding-left: 1.2em; max-width: 68ch; }
.agent-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.probe-header h2 { font-size: 18px; margin: 0 0 6px; }
.probe-header > p { margin: 0 0 12px; }
.decision-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.decision-bar form.stack { display: inline; }
.metric-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.trial-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.metric-breakdown { margin: 10px 0 14px; }
.metric-result { border-left: 2px solid var(--border); padding: 7px 10px; }
.metric-result-head, .metric-observation {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.metric-result p { margin: 4px 0 7px; }
.metric-observation { color: var(--subtle); font-size: 12px; margin-top: 5px; }
.metric-details { max-height: 180px; margin: 6px 0 0; }
.tool-call {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.tool-call-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
summary.tool-call-head { cursor: pointer; }
.tool-call-io {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.review-layout aside .tool-call-io { grid-template-columns: minmax(0, 1fr); }
.io-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 10px 0 4px;
}
.tool-call-io .io-label { margin-top: 0; }
.tool-call pre {
  margin: 0;
  max-height: 220px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.coverage-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.behavior-card { border-left: 3px solid var(--border); }
.behavior-card.cover-uncovered { border-left-color: var(--fail); }
.behavior-card.cover-rejected { border-left-color: var(--none); }
.behavior-card.cover-pending { border-left-color: #e6c36e; }
.behavior-card.cover-live { border-left-color: var(--pass); }
.behavior-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.behavior-card p { max-width: 68ch; margin: 10px 0 0; }
.behavior-probes { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--border); }
.behavior-probe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.probe-count { color: var(--subtle); font-size: 12px; margin-left: auto; }
.uncovered-note { color: var(--fail); }
.warning-list { margin: 0; padding-left: 1.2em; }
.warning-list li { margin-bottom: 6px; }
.assurance-split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; margin-top: 14px; }
.rule-list { list-style: none; margin: 0; padding: 0; }
.rule-list li { display: flex; gap: 10px; padding: 4px 0 4px 10px; border-left: 3px solid var(--border); font-size: 13px; }
.rule-line { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; min-width: 30px; }
.rule-note { font-size: 12px; margin-top: 12px; max-width: 60ch; }
.risk { border-left: 3px solid var(--border); padding: 0 0 0 12px; margin-bottom: 18px; }
.risk.watch-unwatched { border-left-color: var(--fail); }
.risk.watch-partly { border-left-color: #e6c36e; }
.risk.watch-watched { border-left-color: var(--pass); }
.risk-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.risk p { max-width: 68ch; margin: 8px 0 0; }
.check-label { color: var(--subtle); font-size: 12px; margin-top: 10px; }
.check-list { margin: 4px 0 0; padding-left: 1.2em; font-size: 13px; }
.check-list li { margin-bottom: 3px; }
.risk-miss { color: #e6c36e; font-size: 13px; }
.risk-probes { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; }
.badge.watch-unwatched { color: var(--fail); border-color: var(--fail); }
.badge.watch-partly { color: #e6c36e; border-color: #e6c36e; }
.badge.watch-watched { color: var(--pass); border-color: var(--pass); }
.badge.cover-uncovered { color: var(--fail); border-color: var(--fail); }
.badge.cover-rejected { color: var(--none); }
.badge.cover-pending { color: #e6c36e; border-color: #e6c36e; }
.badge.cover-live { color: var(--pass); border-color: var(--pass); }
.badge.status-pending { color: #e6c36e; border-color: #e6c36e; }
.badge.status-approved, .badge.side-benign { color: var(--pass); border-color: var(--pass); }
.badge.status-rejected, .badge.side-mutating { color: var(--fail); border-color: var(--fail); }
.badge.side-uncertain { color: #e6c36e; border-color: #e6c36e; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline; }
.size-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.size-stat {
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}
.size-label, .size-hint {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
}
.size-label {
  text-transform: uppercase;
  font-weight: 600;
}
.size-value {
  display: block;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin: 4px 0 2px;
}
.size-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.section-lead {
  color: var(--subtle);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0 0 14px;
  max-width: 68ch;
}
.subhead {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 14px 0 6px;
}
.metric-how { color: var(--subtle); font-size: 12.5px; line-height: 1.5; margin: 6px 0 0; }
.tip-label {
  position: relative;
  cursor: help;
}
h2 .help,
h2 .tip-label { margin-left: 6px; vertical-align: middle; }
h2 .tip-label { margin-left: 0; }
h2 .badge.tip-label { margin-left: 8px; }
.help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #0b0d13;
  color: var(--muted);
  font: 11px/1 inherit;
  cursor: help;
}
.help-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: max(220px, min(400px, 70vw));
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  white-space: pre-line;
}
th .help { text-transform: none; }
th .help-tip { left: 0; right: auto; }
th:nth-last-child(-n+2) .help-tip { left: auto; right: 0; }
.help:hover .help-tip,
.help:focus .help-tip,
.help:focus-visible .help-tip,
.tip-label:hover .help-tip,
.tip-label:focus .help-tip,
.tip-label:focus-visible .help-tip { display: block; }
@media (max-width: 960px) {
  .review-layout { grid-template-columns: 1fr; }
  .assurance-split { grid-template-columns: 1fr; }
}
