/* Shinobi Cloud Recorder — styled to match shinobi.security
   palette: near-black bg, cyan accent (#22D3EE / #73EEF8), purple secondary. */

@font-face {
  font-family: "Nexa";
  src: url("/static/img/nexa-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nexa";
  src: url("/static/img/nexa-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --bg-2: #101216;
  --surface: #14171c;
  --surface-2: #1a1e25;
  --border: #262b33;
  --border-soft: #1f242b;
  --text: #f8f9fa;
  --text-muted: #8ca2ac;
  --text-dim: #c6c6c6;
  --accent: #22d3ee;
  --accent-bright: #73eef8;
  --accent-purple: #bf5cef;
  --danger: #ef4444;
  --radius: 14px;
  --font-head: "Nexa", "Roboto", system-ui, sans-serif;
  --font-body: "Roboto", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle radial + grid glow behind everything, echoing the marketing site. */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 75% -10%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(191, 92, 239, 0.08), transparent 60%),
    linear-gradient(180deg, #0b0d11, #0a0a0a);
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 6px;
}

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.muted { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn-primary {
  font-family: var(--font-head);
  font-weight: 700;
  background: var(--accent);
  color: #04181c;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 15px;
  transition: filter 0.15s, transform 0.05s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  color: var(--text-dim);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-bright); }

.btn-mock {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.03em;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: var(--accent-bright);
  border-radius: 8px;
  padding: 6px 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn-mock:hover { background: rgba(34, 211, 238, 0.20); border-color: var(--accent); }
.btn-mock::before { content: "▷ "; font-size: 10px; }
/* HTMX sets .htmx-request on the button while the POST is in flight. */
.btn-mock.htmx-request { opacity: 0.5; pointer-events: none; }
.btn-mock.htmx-request::before { content: "… "; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card .logo { height: 30px; width: auto; object-fit: contain; align-self: flex-start; margin-bottom: 6px; }
.login-card h1 { margin: 0 0 8px; font-size: 26px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.login-card input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }
.login-card .btn-primary { margin-top: 8px; }
.alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ffb4b4;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
}

/* ---------- Admin users ---------- */
.notice {
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: var(--accent-bright);
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
}
.admin-page .alert, .admin-page .notice { margin-bottom: 18px; }
.admin-card { padding: 20px 24px; margin-bottom: 24px; }
.admin-card h2 { margin: 0 0 14px; font-size: 18px; }
.admin-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-form input[type="text"],
.admin-form input[type="password"],
.inline-form input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-form input:focus, .inline-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 2px 8px 2px 0; }
.inline-form input[type="password"] { width: 150px; }
.admin-table .actions { white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  padding: 12px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* logo | centered nav | user */
  align-items: center;
  gap: 24px;
}
.topbar-inner .brand { justify-self: start; }
.topbar-inner .topbar-right { justify-self: end; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo { height: 26px; width: auto; object-fit: contain; }
.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  padding-left: 14px;
  letter-spacing: 0.04em;
}
.topbar-right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.topbar-right .btn-ghost { white-space: nowrap; }
/* Signed-in user chip: gradient avatar (initial) + name in a subtle pill. */
.user-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 4px 14px 4px 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px;
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: #04181c; font-family: var(--font-head); font-weight: 700;
  font-size: 12px; line-height: 1; text-transform: uppercase;
}
.user-name { font-size: 13px; font-weight: 500; color: var(--text); letter-spacing: 0.01em; }
/* Centered header nav: Dashboard + analysis dimensions, on the same row as the
   logo/user (grid column 2). Active state kept in sync across HTMX panel swaps via
   an out-of-band swap into #topnav. */
.topbar-nav { justify-self: center; min-width: 0; }
.topnav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; }
.tnav {
  font-family: var(--font-head); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 12px; background: transparent; border: none;
  color: var(--text-muted); padding: 8px 13px; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tnav:hover { color: var(--text); }
.tnav.is-active { color: var(--accent-bright); border-bottom-color: var(--accent); }

/* ---------- Page ---------- */
.page { max-width: 1040px; margin: 0 auto; padding: 40px 24px 80px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 34px; }

/* ---------- Tabs (CLOUD / APPLICATIONS) ---------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}
.tab {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 13px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent-bright); border-bottom-color: var(--accent); }
/* Divider between tab groups (Scorecard | Cloud·Applications | dimensions | Benchmark). */
.tab-sep { flex: 0 0 auto; align-self: center; width: 1px; height: 20px; background: var(--border); margin: 0 10px; }

/* ---------- Controls ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-end;
  padding: 20px 22px;
  margin-bottom: 22px;
}
.control { display: flex; flex-direction: column; gap: 8px; }
.control-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.seg-btn {
  font-family: var(--font-body);
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--accent); color: #04181c; font-weight: 700; }

select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 9px 34px 9px 12px;
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  min-width: 190px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238ca2ac' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }

/* ---------- Results ---------- */
.results { padding: 6px 0 8px; overflow: hidden; }
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.range-cloud {
  margin: 0 0 2px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.range-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.range-title { margin: 0; font-size: 28px; }
.results-meta { display: flex; align-items: center; gap: 14px; }
.pill {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-purple);
  border: 1px solid rgba(191, 92, 239, 0.4);
  background: rgba(191, 92, 239, 0.08);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.run-date { font-size: 13px; color: var(--text-muted); }

.results-table { width: 100%; border-collapse: collapse; }
.results-table th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--text-muted);
  padding: 16px 26px;
  border-bottom: 1px solid var(--border-soft);
}
.results-table td { padding: 18px 26px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table tbody tr:hover { background: rgba(34, 211, 238, 0.03); }
.model-cell { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.results-table tbody tr:first-child .model-cell { color: var(--accent-bright); }

.rate { display: flex; align-items: baseline; gap: 10px; }
.rate-frac { font-size: 16px; font-weight: 700; font-family: var(--font-head); }
.rate-pct { font-size: 13px; color: var(--text-muted); }
.bar {
  margin-top: 8px;
  height: 6px;
  width: 180px;
  max-width: 100%;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 999px;
}
.time-cell { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--text-dim); }

.empty { padding: 40px 26px; color: var(--text-muted); text-align: center; }

@media (max-width: 640px) {
  .controls { gap: 18px; }
  select { min-width: 150px; }
  .bar { width: 120px; }
}

/* ---------- Assurance tab ---------- */
.assurance-body { padding: 8px 26px 22px; }
.danger { color: var(--danger); font-weight: 600; }
.text-pass { color: #22c55e; font-weight: 600; }

/* Comparison matrix: metrics down the side, models across the top. */
.assurance-matrix {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.assurance-matrix th,
.assurance-matrix td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  text-align: right;
  white-space: nowrap;
}
.assurance-matrix thead th {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.assurance-matrix thead th.metric-col { color: var(--text-muted); }
.assurance-matrix .metric-col {
  text-align: left;
  white-space: normal;
  color: var(--text-dim);
  font-size: 13px;
  width: 38%;
}
.assurance-matrix tbody td.num {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

/* The first model column is the product under test — give it a quiet spine. */
.assurance-matrix .col-primary {
  background: rgba(34, 211, 238, 0.05);
  border-left: 1px solid rgba(34, 211, 238, 0.25);
  border-right: 1px solid rgba(34, 211, 238, 0.25);
}
.assurance-matrix thead th.col-primary { color: var(--accent-bright); }

/* Category divider rows. */
.assurance-matrix .group-row td {
  padding: 22px 16px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: normal;
}
.assurance-matrix tbody tr.group-row:first-child td { padding-top: 6px; }
.group-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.group-subtitle { color: var(--text-muted); font-size: 12px; margin-left: 12px; }

/* Per-cell semantics. */
.assurance-matrix td.cell-best { color: var(--accent-bright); font-weight: 700; }
.assurance-matrix td.cell-danger { color: var(--danger); font-weight: 700; }
.assurance-matrix td.cell-good { color: #22c55e; font-weight: 600; }

.assurance-matrix tbody tr:not(.group-row):hover td { background: rgba(34, 211, 238, 0.03); }
.assurance-matrix tbody tr:not(.group-row):hover td.col-primary { background: rgba(34, 211, 238, 0.08); }

.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-dim);
}
.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.legend-dot.dot-best { background: var(--accent-bright); }
.legend-dot.dot-danger { background: var(--danger); }

.assurance-method {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- Executive summary card (above the matrix) ---------- */
.exec-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 6px 0 26px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.exec-col { background: linear-gradient(180deg, var(--surface), var(--bg-2)); padding: 22px 24px; }
.exec-primary {
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(34, 211, 238, 0.12), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--bg-2));
  border-left: 3px solid var(--accent);
}
.exec-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.exec-primary .exec-eyebrow { color: var(--accent); }
.exec-name { font-family: var(--font-head); font-weight: 700; font-size: 22px; margin-bottom: 18px; }
.exec-primary .exec-name { color: var(--accent-bright); }
.exec-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.exec-stat { display: flex; flex-direction: column; gap: 4px; }
.exec-figure { font-family: var(--font-head); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1; }
.exec-figure.exec-good { color: #22c55e; }
.exec-figure.exec-bad { color: var(--danger); }
.exec-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }

/* ---------- Methodology context in matrix column headers ---------- */
.assurance-matrix th.model-head { vertical-align: top; }
.model-head-name { display: block; }
.mode-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mode-targeted { background: rgba(34, 211, 238, 0.15); color: var(--accent-bright); border: 1px solid rgba(34, 211, 238, 0.4); }
.mode-generic { background: rgba(140, 162, 172, 0.12); color: var(--text-muted); border: 1px solid var(--border); }
.mode-continuous { background: rgba(191, 92, 239, 0.12); color: var(--accent-purple); border: 1px solid rgba(191, 92, 239, 0.4); }
.model-head-objective {
  display: block;
  margin-top: 6px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  white-space: normal;
  max-width: 180px;
}

/* ---------- Collapsible section toggles (framework / trend) ---------- */
.section-toggle {
  margin-top: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

/* ---------- Framework alignment table ---------- */
.framework-table, .trend-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.framework-table th, .trend-table th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.framework-table td, .trend-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.framework-table tr:last-child td, .trend-table tr:last-child td { border-bottom: none; }
.fw-observed { color: var(--text); font-weight: 500; }
.fw-ref { color: var(--text-muted); font-size: 12px; }
.fw-verdict {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.fw-pass { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.fw-fail { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.fw-pending { background: rgba(140, 162, 172, 0.12); color: var(--text-muted); }

/* ---------- Trend table ---------- */
.trend-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.trend-table th:not(:first-child) { text-align: right; }
.trend-date { font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.trend-table .col-primary { background: rgba(34, 211, 238, 0.05); }

@media (max-width: 640px) {
  .exec-summary { grid-template-columns: 1fr; }
}

/* ---------- Per-model evidence cards ---------- */
.evidence-card {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-2);
}
.evidence-card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.evidence-model {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

/* ---------- Expandable evidence sections ---------- */
.evidence-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-top: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.evidence-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}
.evidence-toggle .arrow {
  transition: transform 0.2s;
  font-size: 10px;
}
.evidence-toggle.is-open .arrow {
  transform: rotate(90deg);
}

.evidence-panel {
  display: none;
  margin-top: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 13px;
  line-height: 1.6;
}
.evidence-panel.is-open {
  display: block;
}

.evidence-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.evidence-item:last-child {
  border-bottom: none;
}
.evidence-item-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.evidence-item-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.evidence-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.badge-pass { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.badge-fail { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-warn { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.badge-info { background: rgba(34, 211, 238, 0.15); color: var(--accent); }
.badge-muted { background: rgba(140,162,172,.15); color: var(--text-muted); border-color: var(--border); }

.evidence-reasoning {
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
  margin-top: 4px;
}

.evidence-detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 4px 12px;
  padding: 4px 0;
}
.evidence-detail-label {
  color: var(--text-muted);
  font-size: 12px;
}
.evidence-detail-value {
  color: var(--text);
  font-size: 12px;
}

/* ---------- Benchmark tab ---------- */
.bench-controls { flex-direction: column; align-items: stretch; gap: 14px; }
.bench-form { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
.bench-action { justify-content: flex-end; }
.bench-action .btn-primary { padding: 10px 20px; font-size: 14px; }
.bench-action .btn-primary[disabled] { opacity: 0.45; cursor: not-allowed; }
.bench-disabled-note { font-size: 12px; }
.bench-disabled-note code { color: var(--accent); background: var(--bg); padding: 1px 5px; border-radius: 4px; }

.bench-jobs { margin-top: 22px; padding: 0 0 10px; }
.bench-error { margin: 14px 26px 0; }
.bench-job-list { display: flex; flex-direction: column; }
.bench-job { padding: 18px 26px; border-bottom: 1px solid var(--border-soft); }
.bench-job:last-child { border-bottom: none; }
.bench-job-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bench-job-title { display: flex; align-items: baseline; gap: 10px; }
.bench-model { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.bench-job-meta { display: flex; align-items: center; gap: 12px; }

.bench-status {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}
.bench-queued { background: rgba(140,162,172,0.14); color: var(--text-muted); }
.bench-running { background: rgba(34,211,238,0.15); color: var(--accent-bright); border: 1px solid rgba(34,211,238,0.4); }
.bench-completed { background: rgba(34,197,94,0.15); color: #22c55e; }
.bench-failed { background: rgba(239,68,68,0.15); color: var(--danger); }
.bench-cancelled { background: rgba(234,179,8,0.14); color: #eab308; }
.bench-interrupted { background: rgba(140,162,172,0.14); color: var(--text-muted); }

.bench-progress-row { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.bench-solved { color: var(--text-dim); }
.bench-bar { margin-top: 8px; width: 100%; }
.bench-joberror { margin-top: 8px; font-size: 12px; color: var(--danger); }

.bench-logwrap { margin-top: 12px; }
.bench-logwrap summary { cursor: pointer; font-size: 12px; color: var(--text-muted); user-select: none; }
.bench-logwrap summary:hover { color: var(--accent-bright); }
.bench-log {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.app-detail { flex: 1 1 100%; min-width: 260px; }
.bench-app-detail { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.bench-app-meta { font-size: 12px; }
.bench-shinobi-note { font-size: 12px; }
.bench-vulns { border: none; padding: 0; margin: 0; }
.bench-vuln-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.bench-vuln-option input { cursor: pointer; }

/* --- Benchmark result page ---
   Scoped under .result-page (added to <main class="page">) so the padding
   fixes below don't leak onto other pages that reuse the bare .card frame.
   Spacing scale for this page: 22px/24px inner card padding, 18px gap
   between stacked cards/sections, 8-10px micro-rhythm inside components. */

/* This page uses the system/Roboto stack for its headings (not the Nexa
   display font) — a deliberate, Dave-approved deviation scoped to the result
   page only; the topbar and every other page keep Nexa. Redefining the
   custom property cascades to h1/h2, the model/app title, and the KPI values. */
.result-page { --font-head: -apple-system, "Segoe UI", system-ui, "Roboto", sans-serif; }

/* Every direct block on this page gets consistent inner padding + a single
   vertical rhythm between blocks (the root cause of the "text touches the
   border" look was .card having zero padding of its own). */
.result-page .card { padding: 22px 24px; margin-bottom: 18px; }
.result-page > .card:last-child,
.result-page > .kpi-grid:last-child { margin-bottom: 0; }

/* Section headings inside cards ("Per-target verdicts (3)", "Run trace"…) */
.result-page .card h2 { margin: 0 0 16px; font-size: 16px; }

/* ---- Header / summary card ---- */
.result-page .result-card .eyebrow { margin: 0 0 10px; }
.result-page .result-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.result-page .result-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 21px; }
.result-page .result-model,
.result-page .result-app { font-family: var(--font-head); font-weight: 700; color: var(--text); }
.result-page .result-app { color: var(--accent-bright); }
.result-page .result-vs { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); }

/* Metadata row: label/value pairs, separated from the title by a hairline
   and given generous column gaps so it reads as a tidy strip, not a cramped
   line of text. */
.result-page .ctx-strip {
  display: flex;
  flex-wrap: wrap;
  column-gap: 32px;
  row-gap: 12px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.result-page .ctx-pair { display: flex; flex-direction: column; gap: 4px; }
.result-page .ctx-pair dt { margin: 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.result-page .ctx-pair dd { margin: 0; font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ---- KPI band ---- */
.result-page .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0 0 18px; }
.result-page .kpi { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.result-page .kpi-value { font-family: var(--font-head); font-size: 1.7rem; color: var(--accent-bright); line-height: 1.15; font-variant-numeric: tabular-nums; }
.result-page .kpi-label { color: var(--text-muted); font-size: 0.72rem; margin-top: 8px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- Per-target verdict rows ---- */
/* Verdicts laid out as columns grouped by status (Confirmed / Claimed / Missed). */
.result-page .verdict-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; align-items: start; }
.result-page .verdict-col-head { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.result-page .verdict-col-note { color: var(--text-muted); text-transform: none; font-weight: 400; letter-spacing: 0; }
.result-page .fp-caption { margin: 0 0 12px; font-size: 13px; }
.result-page .verdict-col-count { color: var(--text-muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.result-page .verdict-row { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.result-page .verdict-row:first-of-type { padding-top: 2px; }
.result-page .verdict-row:last-child { border-bottom: none; padding-bottom: 2px; }
.result-page .verdict-row summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.result-page .verdict-row summary::-webkit-details-marker { display: none; }
/* Clean rotating chevron in place of the default disclosure triangle. */
.result-page .verdict-row summary::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.result-page .verdict-row[open] summary::before { transform: rotate(45deg); }
/* Expanded rationale / matched / corroborated lines get a proper indent so
   they read as children of the summary row, not a flush wall of text. */
.result-page .verdict-row .muted { margin: 8px 0 0 22px; line-height: 1.6; font-size: 13px; }

/* ---- Reported findings table ---- */
.result-page .findings-table { width: 100%; border-collapse: collapse; }
.result-page .findings-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.result-page .findings-table td { text-align: left; padding: 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; font-size: 13.5px; color: var(--text-dim); }
.result-page .findings-table tbody tr:last-child td { border-bottom: none; }
.result-page .findings-table td:first-child { color: var(--text); font-weight: 500; }

/* ---- Trace viewer ---- */
/* Tabs and download links live in their own rows so they never jumble;
   downloads are pushed to the right on wide viewports and wrap to their own
   line on narrow ones. */
.result-page .viewer-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.result-page .viewer-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.result-page .viewer-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
/* Tabs override .btn-mock's default cyan tint so only the selected tab reads as
   active — inactive tabs are muted, one active tab gets the accent treatment. */
.result-page .viewer-tab { background: transparent; border-color: var(--border); color: var(--text-muted); }
.result-page .viewer-tab:hover { background: var(--bg-2); border-color: var(--border-soft); color: var(--text); }
.result-page .viewer-tab.active { background: rgba(34, 211, 238, 0.20); border-color: var(--accent); color: var(--accent-bright); }
.result-page .jsonl-view { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; max-height: 520px; overflow: auto; font-family: ui-monospace, "Cascadia Code", monospace; font-size: 12.5px; }
.result-page .jsonl-rec { border-bottom: 1px solid var(--border-soft); padding: 10px 16px; }
.result-page .jsonl-rec:last-child { border-bottom: none; }
.result-page .jsonl-rec summary { cursor: pointer; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
/* Expanded JSON gets its own inset panel (darker than the surrounding
   surface) so the pretty-printed record is legible against the list. */
.result-page .jsonl-rec pre {
  margin: 10px 0 4px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.result-page .tok-key { color: var(--accent-bright); } .result-page .tok-str { color: #9ece6a; } .result-page .tok-num { color: #e0af68; }
.result-page .tok-bool { color: var(--accent-purple); } .result-page .tok-null { color: var(--text-muted); }
.result-page .viewer-more { margin-top: 10px; }

@media (max-width: 640px) {
  .result-page .result-head { align-items: flex-start; }
  .result-page .viewer-downloads { margin-left: 0; }
}

/* --- Coverage matrix tab --- */
.cov-controls{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.cov-select{display:flex;align-items:center;gap:8px}
.cov-select label{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted)}
.cov-select select{background:var(--bg-2);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-family:var(--font-body);font-size:14px}
.cov-summary{display:flex;gap:26px;flex-wrap:wrap;margin-left:auto}
.cov-stat{display:flex;flex-direction:column;gap:2px}
.cov-stat b{font-family:var(--font-head);font-size:20px;color:var(--accent-bright);font-variant-numeric:tabular-nums}
.cov-stat span{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted)}

/* --- coverage matrix --- */
.cov-wrap{overflow-x:visible}
.cov-matrix tfoot td{background:var(--surface-2);border-top:2px solid var(--border);padding:12px 10px}
.cov-matrix tfoot td.foot-label{text-align:right;color:var(--text-muted);text-transform:uppercase;font-size:11px;letter-spacing:.06em;font-weight:600}
.cov-matrix tfoot td.foot-pct{text-align:center;font-family:var(--font-head);font-weight:700;color:var(--accent-bright);font-variant-numeric:tabular-nums;font-size:15px}
.cov-matrix{border-collapse:separate;border-spacing:0;width:100%;font-size:13px}
.cov-matrix thead th{position:sticky;top:0;z-index:5;background:var(--surface-2);border-bottom:1px solid var(--border);padding:12px 10px;font-weight:600;vertical-align:bottom;white-space:nowrap}
.cov-matrix thead th.mh{text-align:center;color:var(--text)}
.cov-matrix thead th.mh .mcount{display:block;font-size:11px;color:var(--text-muted);font-variant-numeric:tabular-nums;margin-top:3px}
.cov-matrix thead th.mh.primary{color:var(--accent-bright)}
.cov-matrix thead th.corner{left:0;z-index:6;text-align:left;min-width:300px}

/* sticky vuln column */
.cov-matrix td.vuln,.cov-matrix th.corner{position:sticky;left:0;background:var(--surface);box-shadow:1px 0 0 var(--border)}
.cov-matrix td.vuln{z-index:4;padding:10px 14px 10px 14px;min-width:300px;border-bottom:1px solid var(--border-soft)}
.cov-matrix tbody tr:hover td{background:rgba(34,211,238,.04)}
.cov-matrix tbody tr:hover td.vuln{background:#171b21}
.vid{font-family:var(--font-head);color:var(--accent-bright);font-size:12px;margin-right:8px}
.vtitle{color:var(--text)}
.vmeta{display:flex;align-items:center;gap:8px;margin-top:4px}
.chip{font-size:10px;padding:1px 7px;border-radius:5px;background:rgba(34,211,238,.12);color:var(--accent)}
.sev{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted)}
.sev.critical{color:#f87171}.sev.high{color:#fb923c}.sev.medium{color:#eab308}.sev.low{color:var(--text-muted)}

.cov-matrix td.cell{text-align:center;border-bottom:1px solid var(--border-soft);border-left:1px solid var(--border-soft);padding:0;height:44px}
.dot{display:inline-block;width:15px;height:15px;border-radius:50%;vertical-align:middle}
.dot.confirmed,.dot.full{background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.16)}
.dot.claimed,.dot.partial{background:transparent;border:2px solid #eab308;box-shadow:0 0 0 3px rgba(234,179,8,.10)}
.dot.missed,.dot.none{width:5px;height:5px;background:#333a44}
.cov-matrix td.cell.confirmed,.cov-matrix td.cell.full{background:rgba(34,197,94,.06)}
.cov-matrix td.cell.claimed,.cov-matrix td.cell.partial{background:rgba(234,179,8,.05)}

/* right totals column */
.cov-matrix td.total,.cov-matrix thead th.total{border-left:2px solid var(--border);text-align:center;min-width:96px}
.cov-matrix td.total{border-bottom:1px solid var(--border-soft);padding:8px 12px}
.tbar{height:6px;border-radius:3px;background:var(--bg-2);overflow:hidden;margin-top:4px}
.tbar > i{display:block;height:100%;background:linear-gradient(90deg,var(--accent),var(--accent-bright))}
.tnum{font-variant-numeric:tabular-nums;color:var(--text-dim);font-size:12px}
.tbody-row.zero td.vuln .vtitle{color:var(--text-muted)}

/* legend */
.cov-legend{display:flex;gap:22px;flex-wrap:wrap;align-items:center;margin-top:14px;font-size:12px;color:var(--text-muted)}
.cov-legend .lg{display:flex;align-items:center;gap:8px}

/* Coverage reliability */
.relcell{text-align:center;font-variant-numeric:tabular-nums;font-size:12px}
.relcell.full{color:#22c55e;background:rgba(34,197,94,.10)}
.relcell.partial{color:#eab308;background:rgba(234,179,8,.08)}
.relcell.none{color:var(--text-muted)}

/* ---------- Dashboard data tables (Affordability / Safety / Scorecard) ----------
   One polished family matching the assurance & coverage matrices: quiet
   uppercase header, generous rhythm, row hover, and a cyan spine + tint on the
   product-under-test (Shinobi) row. */
/* Clip these full-bleed tables to the card's rounded corners (scoped so the
   coverage matrix, which needs overflow:visible for sticky headers, is untouched). */
.card:has(> .aff-table), .card:has(> .sc-table) { overflow:hidden; }
.aff-table, .sc-table { width:100%; border-collapse:separate; border-spacing:0; font-size:13px; }
.aff-table thead th, .sc-table thead th {
  text-align:left; background:var(--surface-2); border-bottom:1px solid var(--border);
  padding:13px 16px; font-weight:600; color:var(--text-muted);
  text-transform:uppercase; font-size:11px; letter-spacing:.06em; white-space:nowrap;
}
.aff-table tbody td, .sc-table tbody td {
  padding:14px 16px; border-bottom:1px solid var(--border-soft);
  vertical-align:middle; font-variant-numeric:tabular-nums;
}
.aff-table tbody tr:last-child td, .sc-table tbody tr:last-child td { border-bottom:none; }
.aff-table tbody tr:hover td, .sc-table tbody tr:hover td { background:rgba(34,211,238,.04); }
.aff-table tbody td:first-child, .sc-table tbody td:first-child { min-width:170px; font-weight:500; }
/* Product-under-test (Shinobi) row: subtle tint + a cyan spine on its first cell. */
.aff-table tbody tr:has(td.primary) td, .sc-table tr.sc-row-primary td { background:rgba(34,211,238,.045); }
.aff-table tbody tr:has(td.primary):hover td, .sc-table tr.sc-row-primary:hover td { background:rgba(34,211,238,.075); }
.aff-table td.primary, .sc-table td.primary { color:var(--accent-bright); font-weight:700; box-shadow:inset 3px 0 0 var(--accent); }
.aff-table tbody td sup, .sc-table tbody td sup { color:var(--accent); margin-left:2px; cursor:help; }
.aff-muted { color:var(--text-muted); }
.aff-footnote, .safety-footnote, .sc-footnote { padding:14px 4px 0; font-size:12px; line-height:1.55; max-width:78ch; color:var(--text-muted); }

/* Affordability — cost-per-confirmed trend sparkline */
.spark { display:inline-flex; align-items:flex-end; gap:2px; height:26px; }
.spark-bar { width:6px; background:var(--accent); border-radius:2px 2px 0 0; opacity:.8; transition:opacity .15s; }
.aff-table tbody tr:hover .spark-bar { opacity:1; }
.spark-bar.none { background:var(--text-muted); opacity:.35; }

/* Safety — verdicts + per-run history */
.verdict-pass { color:#22c55e; }
.verdict-fail { color:#ef4444; }
.verdict-nodata { color:var(--text-muted); }
.safety-table td.safety-track { font-variant-numeric:tabular-nums; font-weight:600; }
.safety-history { display:inline-flex; align-items:center; gap:6px; flex-wrap:wrap; }
.safety-run-dot { font-size:14px; line-height:1; cursor:help; }
.safety-run-dot.verdict-pass-dot { color:#22c55e; }
.safety-run-dot.verdict-fail-dot { color:#ef4444; }
.safety-run-dot.verdict-nodata-dot { color:var(--text-muted); }

/* Scorecard — executive roll-up; each dimension cell drills into its own tab. */
.cohort-divider td {
  padding:9px 16px; font-size:11px; font-weight:600; text-transform:uppercase;
  letter-spacing:.08em; color:var(--text-muted); background:var(--bg-2);
  border-top:1px solid var(--border); border-bottom:1px solid var(--border);
}
.sc-cell {
  cursor:pointer; display:inline-flex; flex-direction:column; gap:3px;
  margin:-6px -8px; padding:6px 8px; border-radius:8px; transition:background .15s;
}
.sc-cell:hover { background:rgba(34,211,238,.09); }
.sc-headline { font-family:var(--font-head); font-weight:700; font-size:15px; color:var(--text); font-variant-numeric:tabular-nums; letter-spacing:-.01em; }
.sc-cell:hover .sc-headline { color:var(--accent-bright); }
.sc-sub { font-size:11px; color:var(--text-muted); }

/* ---------- shinobi-compare additions (scoreboard CSS above is verbatim) ---------- */
/* Sign out is a POST form (not a GET link); keep the button visually identical
   to the scoreboard's anchor .btn-ghost: no UA button background/font, and the
   form itself must not disturb the .topbar-right flex layout. */
.signout-form { display: contents; }
.signout-form .btn-ghost { background: transparent; border: 1px solid var(--border); font-family: inherit; cursor: pointer; }

/* ---------- Settings (API profiles + change password) ---------- */
.settings-page .alert, .settings-page .notice { margin-bottom: 18px; }
.settings-card { padding: 20px 24px; margin-bottom: 24px; }
.settings-card h2 { margin: 0 0 14px; font-size: 18px; }
.settings-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.settings-form input[type="text"],
.settings-form input[type="url"],
.settings-form input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.settings-form input[name="base_url"] { flex: 1 1 300px; }
.settings-table .actions { white-space: nowrap; }
.settings-table .test-result { margin-left: 8px; font-size: 12px; }

/* ---------- Compare page ---------- */
.compare-card { padding: 18px 20px; margin-bottom: 24px; }
.compare-card .cov-controls { margin-bottom: 0; }
.btn-primary[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-primary[disabled]:hover { filter: none; transform: none; }
#gt-panel { margin-top: 24px; }
#gt-panel .card { padding: 18px 20px; }
#gt-panel .card h2 { margin: 0 0 14px; font-size: 18px; }

/* ---------- Run pages ---------- */
/* The error dot has no scoreboard counterpart: an open red dot in the same
   visual language as .dot.claimed/.dot.partial. */
.dot.error{background:transparent;border:2px solid #ef4444;box-shadow:0 0 0 3px rgba(239,68,68,.12)}
.run-summary { margin: 0 0 18px; justify-content: flex-end; }
.run-progress { padding: 18px 20px; }
.run-progress h2 { margin: 0 0 8px; font-size: 18px; text-transform: capitalize; }
.run-progress .tbar { margin-top: 10px; }

/* ---------- Task 14 polish ---------- */
/* The scoreboard only ever puts .btn-ghost on anchors; our pages put it on
   real <button> elements (settings Test/Delete, admin row actions, Sign out).
   Without a dark color-scheme the UA renders native controls in light mode —
   ghost buttons came out white. Declaring the page dark fixes every native
   control (buttons, checkboxes, select popups, scrollbars); the transparent
   background keeps ghost buttons identical to the scoreboard's anchors. */
:root { color-scheme: dark; }
button.btn-ghost { background: transparent; font-family: inherit; cursor: pointer; }

/* Compare form layout: dojo app + API profile + Compare button on the first
   row (button pushed right — the scoreboard's margin-left:auto idiom from
   .cov-summary), the three project selects sharing a full second row as
   equal thirds. Without this the five .cov-select groups wrapped into three
   ragged rows with the button stranded on its own line. */
.compare-card #compare-btn { order: 3; margin-left: auto; }
.compare-card #projects-wrapper { order: 4; flex-basis: 100%; margin-top: 14px; }
.compare-card #projects-wrapper .cov-select { flex: 1 1 0; flex-direction: column; align-items: stretch; }
.compare-card #projects-wrapper .cov-select select { width: 100%; min-width: 0; }
.compare-card #projects-wrapper #dup-hint,
.compare-card #projects-wrapper .alert { flex-basis: 100%; }

/* The ground-truth panel is a single-column .cov-matrix: the sticky vuln
   column's right hairline (which separates it from model columns in the real
   matrix) draws a stray line at the table's right edge here. */
.gt-table td.vuln { box-shadow: none; }

/* ---------- Task 19: click-to-inspect cell overlay ---------- */
/* Every matrix cell is a click target (the whole td: a none-cell's dot is only
   5px). The hover tooltip (title attr) is untouched; a slightly stronger hover
   tint than the row's communicates clickability. */
.cov-matrix td.cell.clickable { cursor: pointer; }
.cov-matrix tbody td.cell.clickable:hover { background: rgba(34,211,238,.10); }

/* #cell-modal sits empty in the run page; :empty hides it. Once htmx swaps the
   cell fragment in, the container becomes the fixed full-screen layer and the
   partial's backdrop/card render inside it. */
#cell-modal:empty { display: none; }
#cell-modal { position: fixed; inset: 0; z-index: 60; }
.cell-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 6, 9, 0.78);
  display: grid; place-items: center;
  padding: 24px;
}
.cell-card {
  width: 100%; max-width: 1100px; max-height: 85vh;
  overflow: auto;
  padding: 22px 26px;
}
.cell-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cell-project { font-family: var(--font-head); font-weight: 700; font-size: 18px; }
/* Verdict badges reuse the .sev pill in the dot language's colors. */
.sev.full { color: #22c55e; }
.sev.partial { color: #eab308; }
.sev.none { color: var(--text-muted); }
.sev.error { color: #ef4444; }
.cell-close {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cell-close:hover { border-color: var(--accent); color: var(--accent-bright); }

/* Ground Truth | Matched finding, side by side; stacks on narrow viewports. */
.cell-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 800px) { .cell-cols { grid-template-columns: 1fr; } }
.cell-col {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--bg-2);
  padding: 16px 18px;
}
.cell-col-title {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
}
.cell-item-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.cell-meta { margin-bottom: 10px; }
.cell-desc {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}
.cell-loc { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.cell-loc-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.cell-loc-value, .cell-endpoint {
  font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
  font-size: 12.5px;
  color: var(--accent-bright);
  word-break: break-all;
}
.cell-endpoint { margin-bottom: 8px; }
.cell-finding + .cell-finding {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
.cell-fetch-error { margin: 0; font-size: 13px; color: #ffb4b4; }

/* Location coverage rows under the two columns. */
.cell-assessments { margin-top: 20px; }
.cell-assessment {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.cell-assessment:last-child { border-bottom: none; }
.cell-mark { width: 16px; text-align: center; font-weight: 700; }
.cell-mark.covered { color: var(--accent-bright); }
.cell-mark.missed { color: #eab308; }
.cell-assessment-loc {
  font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
  font-size: 12.5px;
  color: var(--text);
}
.cell-assessment-state { color: var(--text-dim); font-size: 12px; }

/* Footer: the adjudicator's rationale. */
.cell-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.cell-rationale-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.cell-rationale { margin: 0; font-size: 13px; line-height: 1.6; }
