/* ========== Design Tokens ========== */
:root {
  --navy: #0a0d14;
  --navy-2: #10151f;
  --navy-3: #182130;
  --gold: #2ED573;
  --gold-soft: #e6f1ea;
  --gold-hover: #23b45f;
  --cream: #f4f4f0;
  --paper: #ffffff;
  --ink: #0a0d14;
  --ink-80: rgba(10,13,20,0.82);
  --ink-60: rgba(10,13,20,0.6);
  --ink-40: rgba(10,13,20,0.4);
  --ink-20: rgba(10,13,20,0.2);
  --ink-10: rgba(10,13,20,0.1);
  --ink-06: rgba(10,13,20,0.06);
  --border: rgba(10,13,20,0.09);
  --border-strong: rgba(10,13,20,0.16);
  --green: #1f7a4c;
  --green-soft: #dcefe2;
  --amber: #c48419;
  --amber-soft: #fbeed5;
  --red: #b3321a;
  --red-soft: #fadbd3;
  --blue: #2b5ea6;
  --blue-soft: #dbe6f4;
  --shadow-sm: 0 1px 2px rgba(10,13,20,0.04);
  --shadow-md: 0 4px 16px rgba(10,13,20,0.06);
  --radius: 6px;
  --radius-lg: 10px;
  --serif: 'League Spartan', 'Inter', sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body { overflow-x: hidden; min-height: 100%; width: 100%; max-width: 100%; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; font-size: inherit; }

/* ========== Top Bar ========== */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.brand-logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.brand-logo-img { height: 24px; width: auto; display: block; }
.brand-sep { color: rgba(255,255,255,0.2); font-size: 16px; font-weight: 300; }
.brand-tag { color: rgba(255,255,255,0.85); font-weight: 400; }

.topbar-right { display: flex; align-items: center; gap: 18px; font-size: 12px; }
.live-dot {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em;
}
.live-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #3ab87a; box-shadow: 0 0 8px #3ab87a;
}
.avatar-circle {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff;
}
.avatar-circle.gold { background: var(--gold); color: var(--navy); border: none; }

/* ========== Sub Nav ========== */
.subnav {
  background: var(--paper);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.subnav-link {
  padding: 16px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-60);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 150ms ease;
}
.subnav-link:hover { color: var(--ink); }
.subnav-link.active {
  color: var(--ink);
  border-bottom-color: var(--navy);
  font-weight: 600;
}
.subnav-spacer { flex: 1; }
.time-filter {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.time-filter button {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-60);
  border-right: 1px solid var(--border);
  background: var(--paper);
}
.time-filter button:last-child { border-right: none; }
.time-filter button.active {
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
  border: 1px solid var(--gold);
  margin: -1px;
}

/* ========== Main ========== */
main {
  padding: 32px 32px 64px;
  max-width: 1800px;
  margin: 0 auto;
}
.view { display: none; }
.view.active { display: block; }

/* Page header */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.page-sub {
  font-size: 13px;
  color: var(--ink-60);
  margin-top: 6px;
  letter-spacing: 0.01em;
}
.page-actions { display: flex; align-items: center; gap: 12px; }
.btn {
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: all 150ms ease;
  white-space: nowrap;
}
.btn-ghost {
  background: var(--paper);
  border: 1px solid var(--border-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--cream); border-color: var(--ink-40); }
.btn-primary {
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
}
.btn-primary:hover { background: var(--navy-2); }
.btn-gold {
  background: var(--gold);
  color: var(--navy);
  border: 1px solid var(--gold);
  font-weight: 600;
}
.btn-gold:hover { background: var(--gold-hover); }
.btn-small { padding: 6px 12px; font-size: 12px; }

.review-meta {
  font-size: 11px;
  color: var(--ink-60);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
  margin-right: 16px;
  align-self: center;
}
.review-meta strong { color: var(--ink); font-weight: 600; }

/* ========== KPI Cards ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-60);
  text-transform: uppercase;
}
.kpi-value {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 8px;
  line-height: 1;
  color: var(--ink);
}
.kpi-unit {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-60);
  margin-left: 4px;
}
.kpi-delta {
  font-size: 12px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.delta-pos { color: var(--green); font-weight: 600; }
.delta-neg { color: var(--green); font-weight: 600; } /* for 'decision time ↓' = good */
.delta-warn { color: var(--amber); font-weight: 600; }
.delta-note { color: var(--ink-60); }

/* ========== Panels ========== */
.row-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.panel-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.panel-sub {
  font-size: 12px;
  color: var(--ink-60);
  margin-top: 4px;
}
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pill-live {
  background: var(--amber-soft);
  color: var(--amber);
}
.pill-pass { background: var(--green-soft); color: var(--green); }
.pill-review { background: var(--amber-soft); color: var(--amber); }
.pill-fail { background: var(--red-soft); color: var(--red); }
.pill-neutral { background: var(--ink-06); color: var(--ink-60); }

/* Funnel */
.funnel-row {
  margin-bottom: 14px;
}
.funnel-row:last-child { margin-bottom: 0; }
.funnel-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.funnel-label {
  font-size: 13px;
  font-weight: 500;
}
.funnel-vals {
  font-size: 12px;
  color: var(--ink-60);
}
.funnel-vals strong {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  font-weight: 600;
  margin-right: 10px;
}
.funnel-bar {
  height: 8px;
  background: var(--ink-06);
  border-radius: 3px;
  overflow: hidden;
}
.funnel-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 3px;
  transition: width 400ms ease;
}
.funnel-fill.gold { background: var(--gold); }
.funnel-fill.green { background: var(--green); }

.funnel-callout {
  margin-top: 18px;
  padding: 12px 14px;
  background: #fbf7ec;
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-80);
}
.funnel-callout strong { color: var(--ink); }
.funnel-callout-delta { color: var(--green); font-weight: 600; }

/* DESC Compliance */
.desc-overall {
  background: var(--navy);
  color: #fff;
  padding: 18px 20px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.desc-overall-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
}
.desc-overall-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-top: 4px;
}
.desc-overall-val {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.desc-gate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.desc-gate:last-of-type { border-bottom: none; }
.desc-gate-name { font-weight: 500; }
.desc-gate-right { display: flex; align-items: center; gap: 14px; }
.desc-gate-count { font-size: 12px; color: var(--ink-60); font-variant-numeric: tabular-nums; }
.status-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.status-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
}
.status-dot.pass { color: var(--green); }
.status-dot.pass::before { background: var(--green); }
.status-dot.review { color: var(--amber); }
.status-dot.review::before { background: var(--amber); }
.status-dot.fail { color: var(--red); }
.status-dot.fail::before { background: var(--red); }

.desc-note {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fbf7ec;
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink-80);
  line-height: 1.55;
}
.desc-note strong { color: var(--ink); }

/* Sector Trends */
table.plain {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.plain thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  text-transform: uppercase;
  padding: 10px 14px;
  background: var(--navy);
}
table.plain tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.plain tbody tr:last-child td { border-bottom: none; }
table.plain tbody tr:hover { background: var(--cream); cursor: pointer; }
.num-cell {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
}
.delta-cell {
  font-weight: 600;
  font-size: 12px;
}
.delta-cell.up { color: var(--green); }
.delta-cell.down { color: var(--red); }

/* Recent Activity */
.activity-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.activity-dot.scored { background: var(--amber); }
.activity-dot.advanced { background: var(--green); }
.activity-dot.matched { background: var(--blue); }
.activity-dot.flagged { background: var(--red); }
.activity-main { flex: 1; font-size: 13px; }
.activity-title { font-weight: 600; }
.activity-sub { font-size: 12px; color: var(--ink-60); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--ink-40); white-space: nowrap; }

/* ========== Requests Table ========== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-box {
  flex: 1;
  min-width: 280px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 13px;
  color: var(--ink);
}
.search-box:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }
.filter-chip {
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-60);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-chip:hover { background: var(--cream); }
.filter-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.req-table {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.req-table td.req-id {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--ink-60);
}
.req-table td.req-title { font-weight: 600; }
.req-table td.req-sector { font-size: 12px; color: var(--ink-60); }
.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.status-tag.submitted { background: var(--ink-06); color: var(--ink-80); }
.status-tag.classified { background: var(--blue-soft); color: var(--blue); }
.status-tag.scored { background: var(--amber-soft); color: var(--amber); }
.status-tag.shortlisted { background: var(--green-soft); color: var(--green); }
.status-tag.evaluating { background: var(--gold-soft); color: var(--navy); }
.status-tag.piloted { background: var(--navy); color: #fff; }
.score-cell {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
}
.score-cell.high { color: var(--green); }
.score-cell.mid { color: var(--amber); }
.score-cell.low { color: var(--red); }

/* ========== Evaluation Detail ========== */
.eval-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}
.breadcrumbs {
  font-size: 12px;
  color: var(--ink-60);
  margin-bottom: 8px;
}
.breadcrumbs a { color: var(--ink-60); }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { margin: 0 8px; color: var(--ink-40); }
.eval-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.eval-title {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.eval-vendor {
  font-size: 18px;
  color: var(--ink-60);
  font-weight: 400;
}
.eval-vendor::before { content: '—'; margin-right: 10px; color: var(--ink-40); }
.status-badge {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.status-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
}
.status-badge.eval { background: var(--amber-soft); color: var(--amber); }
.status-badge.eval::before { background: var(--amber); }
.eval-meta {
  display: flex;
  gap: 22px;
  font-size: 12px;
  color: var(--ink-60);
  margin-top: 10px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.eval-meta strong { color: var(--ink); font-weight: 600; }

.scoring-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.scoring-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.scoring-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-badge {
  background: var(--navy);
  color: var(--gold);
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ai-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 6px var(--gold);
}
.scoring-title { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.scoring-meta { font-size: 11px; color: var(--ink-60); margin-top: 4px; font-variant-numeric: tabular-nums; }
.confidence { text-align: right; }
.confidence-label { font-size: 10px; color: var(--ink-60); letter-spacing: 0.1em; text-transform: uppercase; }
.confidence-val { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); }

.score-dials {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 30px 24px;
}
.dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dial-circle {
  position: relative;
  width: 92px;
  height: 92px;
}
.dial-circle svg { transform: rotate(-90deg); }
.dial-circle .bg-ring { stroke: var(--ink-06); stroke-width: 6; fill: none; }
.dial-circle .fg-ring { stroke-width: 6; fill: none; stroke-linecap: round; }
.dial-circle .fg-ring.green { stroke: var(--green); }
.dial-circle .fg-ring.amber { stroke: var(--amber); }
.dial-circle .fg-ring.red { stroke: var(--red); }
.dial-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
}
.dial-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink);
}
.dial-name { font-size: 11px; color: var(--ink-60); }

.composite-strip {
  background: var(--navy);
  color: #fff;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.composite-strip-left { font-size: 10px; letter-spacing: 0.14em; color: var(--gold); font-weight: 700; text-transform: uppercase; }
.composite-strip-left strong { display: block; color: #fff; font-size: 12px; letter-spacing: 0.02em; font-weight: 500; margin-top: 2px; }
.composite-strip-right { display: flex; align-items: center; gap: 18px; }
.percentile {
  font-size: 11px; color: rgba(255,255,255,0.6);
  letter-spacing: 0.08em;
}
.percentile strong { color: #fff; font-weight: 600; }
.composite-val {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.rationale-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 20px;
}
.rationale-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.trace-pill {
  background: var(--gold-soft);
  color: var(--navy);
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: 3px;
  text-transform: uppercase;
}
.rationale-line {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-80);
  margin-bottom: 14px;
}
.rationale-line:last-of-type { margin-bottom: 20px; }
.rationale-line strong { color: var(--ink); font-weight: 600; }
.rationale-score {
  display: inline-block;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
  color: var(--ink-60);
  margin-right: 6px;
}
.recommendation-box {
  border-left: 3px solid var(--gold);
  background: #fbf7ec;
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink-80);
  line-height: 1.55;
}
.recommendation-box-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.recommendation-box strong { color: var(--ink); font-weight: 600; }

.tabs-container {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  gap: 24px;
}
.tab {
  padding: 16px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-60);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--navy); font-weight: 600; }
.tab-body { padding: 8px 0; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Eval sidebar */
.sidebar-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.sidebar-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}
.sidebar-sub {
  font-size: 11px;
  color: var(--ink-60);
  margin-bottom: 14px;
}
.compliance-gate {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.compliance-gate:last-child { border-bottom: none; }
.compliance-gate-name { font-size: 13px; font-weight: 600; }
.compliance-gate-sub { font-size: 11px; color: var(--ink-60); margin-top: 2px; }
.check-circle {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--green);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.check-circle::after {
  content: '';
  width: 5px; height: 9px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px,-1px);
}

.vendor-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.vendor-row:last-child { border-bottom: none; }
.vendor-rank {
  background: var(--navy);
  color: #fff;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13px;
  width: 24px; height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vendor-main { flex: 1; }
.vendor-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.vendor-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.v-tag {
  background: var(--ink-06);
  color: var(--ink-80);
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 3px;
}
.vendor-meta { font-size: 10px; color: var(--ink-60); }
.vendor-meta::before { content: '· '; color: var(--ink-40); }
.vendor-score { text-align: right; flex-shrink: 0; }
.vendor-pct {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}
.vendor-pct-label { font-size: 9px; color: var(--ink-60); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }

/* Scoring breakdown table */
table.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.breakdown thead th {
  background: var(--navy);
  color: #fff;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 10px 16px;
  text-align: left;
}
table.breakdown tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
table.breakdown tbody tr:last-child td { border-bottom: none; }
.raw-score.green { color: var(--green); font-weight: 600; }
.raw-score.amber { color: var(--amber); font-weight: 600; }
.raw-score.red { color: var(--red); font-weight: 600; }
.evidence-link { color: var(--ink-60); font-size: 12px; }

/* ========== Vendors view ========== */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.vendor-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: all 200ms ease;
  cursor: pointer;
}
.vendor-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.vendor-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.vendor-card-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}
.vendor-card-meta { font-size: 11px; color: var(--ink-60); margin-top: 3px; }
.vendor-card-desc { font-size: 13px; color: var(--ink-80); line-height: 1.5; margin-bottom: 16px; }
.vendor-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.vendor-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.vs-label { font-size: 10px; color: var(--ink-60); letter-spacing: 0.08em; text-transform: uppercase; }
.vs-val { font-family: var(--serif); font-size: 17px; font-weight: 600; margin-top: 2px; }

/* Reports */
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.report-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.report-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}
.report-content { flex: 1; }
.report-name { font-family: var(--serif); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.report-desc { font-size: 12px; color: var(--ink-60); line-height: 1.5; }
.report-meta { font-size: 11px; color: var(--ink-40); margin-top: 8px; font-variant-numeric: tabular-nums; }

/* Global footer */
.ground-footer {
  padding: 18px 32px;
  background: var(--paper);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--ink-60);
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.ground-footer-right { color: var(--ink-60); }
.ground-footer-right span { margin-left: 18px; }
.ground-footer-right span:first-child { margin-left: 0; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,13,20,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(10,13,20,0.3);
}
.modal-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}
.modal-body {
  font-size: 13px;
  color: var(--ink-80);
  line-height: 1.6;
  margin-bottom: 24px;
}
.modal-body strong { color: var(--ink); font-weight: 600; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== NEW: Toasts ========== */
.toast-wrap {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast {
  background: var(--navy); color: #fff;
  border-radius: var(--radius); padding: 13px 16px 13px 14px;
  box-shadow: 0 14px 40px rgba(10,13,20,0.3);
  display: flex; align-items: flex-start; gap: 12px;
  max-width: 380px; font-size: 13px;
  border-left: 3px solid var(--gold);
  transform: translateY(8px); opacity: 0;
  animation: toastIn 240ms ease forwards;
}
@keyframes toastIn { to { transform: translateY(0); opacity: 1; } }
.toast.out { animation: toastOut 220ms ease forwards; }
@keyframes toastOut { to { transform: translateY(8px); opacity: 0; } }
.toast-ico {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  background: var(--gold); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.toast-title { font-weight: 600; }
.toast-sub { color: rgba(255,255,255,0.62); font-size: 12px; margin-top: 2px; line-height: 1.45; }

/* ========== NEW: Slide-over drawer (intake + vendor) ========== */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(10,13,20,0.5);
  display: none; z-index: 150; backdrop-filter: blur(1px);
}
.drawer-backdrop.active { display: block; animation: fade 200ms ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 560px; max-width: 94vw;
  background: var(--cream); z-index: 151;
  box-shadow: -20px 0 60px rgba(10,13,20,0.25);
  transform: translateX(100%); transition: transform 320ms cubic-bezier(.22,.61,.36,1);
  display: flex; flex-direction: column;
}
.drawer.active { transform: translateX(0); }
.drawer-head {
  background: var(--navy); color: #fff; padding: 22px 26px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.drawer-head h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.drawer-head .sub { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 4px; }
.drawer-close {
  width: 30px; height: 30px; border-radius: 6px; color: #fff; font-size: 18px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  display: inline-flex; align-items: center; justify-content: center;
}
.drawer-close:hover { background: rgba(255,255,255,0.16); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 26px; }

/* Form */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-60); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--paper); font-size: 13px; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--gold-soft); border-color: var(--gold);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Agent run console */
.agent-run { display: none; }
.agent-run.active { display: block; }
.run-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.run-spinner {
  width: 34px; height: 34px; border-radius: 8px; background: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  position: relative;
}
.run-spinner::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(46,213,115,0.3); border-top-color: var(--gold);
  animation: spin 800ms linear infinite;
}
.run-spinner.done::after { display: none; }
.run-spinner.done { background: var(--green); }
.run-spinner.done::before {
  content: ''; width: 6px; height: 11px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px,-1px);
}
@keyframes spin { to { transform: rotate(360deg); } }
.run-title { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.run-sub { font-size: 12px; color: var(--ink-60); margin-top: 2px; font-variant-numeric: tabular-nums; }

.step {
  display: flex; gap: 13px; padding: 11px 0; opacity: 0.35;
  transition: opacity 300ms ease; align-items: flex-start;
}
.step.show { opacity: 1; }
.step-icon {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  background: var(--ink-10); display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--ink-60);
  transition: all 250ms ease;
}
.step.running .step-icon { background: var(--navy); color: var(--gold); }
.step.done .step-icon { background: var(--green); color: #fff; }
.step.done .step-icon::after {
  content: ''; width: 5px; height: 9px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px,-1px);
}
.step.done .step-icon span { display: none; }
.step-main { flex: 1; }
.step-name { font-size: 13px; font-weight: 600; }
.step-detail { font-size: 12px; color: var(--ink-60); margin-top: 2px; line-height: 1.5; min-height: 0; }
.step-detail .tk {
  font-family: 'SF Mono', Menlo, monospace; font-size: 11px;
  background: var(--ink-06); padding: 1px 6px; border-radius: 3px; color: var(--ink-80);
}
.step-gate-line { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 4px; }
.mini-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.mini-dot.amber { background: var(--amber); }

.run-result {
  margin-top: 6px; display: none; animation: fade 320ms ease;
}
.run-result.show { display: block; }
.result-score {
  background: var(--navy); color: #fff; border-radius: var(--radius-lg);
  padding: 20px 22px; display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.result-score .big { font-family: var(--serif); font-size: 40px; font-weight: 700; color: var(--gold); line-height: 1; }
.result-score-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.result-score-sub { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 4px; }
.result-rec {
  border-left: 3px solid var(--gold); background: #fbf7ec; border-radius: 4px;
  padding: 13px 16px; font-size: 13px; line-height: 1.55; color: var(--ink-80); margin-bottom: 16px;
}
.result-rec strong { color: var(--ink); }

/* ========== NEW: Weight sliders ========== */
.weights-card {
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 20px;
}
.weights-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.weights-sub { font-size: 12px; color: var(--ink-60); margin-bottom: 18px; }
.weight-row { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 14px; padding: 9px 0; }
.weight-name { font-size: 13px; font-weight: 500; }
.weight-name span { display: block; font-size: 11px; color: var(--ink-60); font-weight: 400; }
.weight-row input[type=range] {
  -webkit-appearance: none; appearance: none; height: 5px; border-radius: 3px;
  background: var(--ink-10); width: 100%; cursor: pointer;
}
.weight-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--navy); border: 2px solid var(--gold); cursor: pointer;
}
.weight-row input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--navy);
  border: 2px solid var(--gold); cursor: pointer;
}
.weight-val { font-family: var(--serif); font-weight: 600; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.weights-foot {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.weights-foot-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60); font-weight: 700; }
.live-composite { font-family: var(--serif); font-size: 32px; font-weight: 700; }
.live-composite.pass { color: var(--green); }
.live-composite.warn { color: var(--amber); }
.threshold-tag { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.threshold-tag.pass { background: var(--green-soft); color: var(--green); }
.threshold-tag.warn { background: var(--amber-soft); color: var(--amber); }

/* ========== NEW: SVG trend chart ========== */
.chart-wrap { position: relative; }
.chart-svg { width: 100%; height: 200px; display: block; overflow: visible; }
.chart-grid line { stroke: var(--ink-06); stroke-width: 1; }
.chart-area { fill: url(#goldGrad); opacity: 0.5; }
.chart-line { fill: none; stroke: var(--navy); stroke-width: 2.5; }
.chart-line.gold { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 4 4; }
.chart-dot { fill: var(--navy); stroke: #fff; stroke-width: 2; }
.chart-xlabel { font-size: 10px; fill: var(--ink-60); font-family: var(--sans); }
.chart-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--ink-60); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend-swatch.navy { background: var(--navy); }
.legend-swatch.gold { background: var(--gold); }

/* empty state */
.empty-row td { text-align: center; padding: 40px 14px; color: var(--ink-60); font-size: 13px; }

/* clickable cursor for interactive rows already handled; vendor cards open drawer */
.kpi-value, .composite-val, .live-composite { transition: color 200ms ease; }

@media (max-width: 720px) {
  .topbar, .subnav, main, .ground-footer { padding-left: 16px; padding-right: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .weight-row { grid-template-columns: 96px 1fr 40px; }

  /* Top bar: keep brand, shrink status, wrap avatars */
  .topbar { gap: 8px; }
  .brand-tag, .brand-sep { display: none; }
  .topbar-right { gap: 10px; font-size: 11px; }
  .live-dot { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .splash { overflow-y: auto; }
  .subnav { gap: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-top: 0; padding-bottom: 0; white-space: nowrap; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav-link { flex: 0 0 auto; }

  /* Drawers & report modal go full-width */
  .drawer { width: 100%; max-width: 100%; box-shadow: none; }
  .rmodal { padding: 0; align-items: stretch; }
  .rmodal-box { max-width: 100%; max-height: 100%; border-radius: 0; }
  .rmodal-body { padding: 18px; }
  .rdoc-kpis { grid-template-columns: repeat(2, 1fr); }
  .rdoc-meta { gap: 14px; }

  /* Page headers stack */
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .page-title { font-size: 26px; }

  /* KPIs two-up on phone */
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .kpi-value { font-size: 30px; }

  /* Wide tables scroll horizontally inside their own container */
  .req-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .req-table table.plain { min-width: 660px; }
  .tab-pane { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.breakdown { min-width: 480px; }

  /* Intake / vendor toolbars stack */
  .toolbar { flex-wrap: wrap; gap: 8px; align-items: stretch; }
  .toolbar .search-box { flex: 1 0 100%; width: 100%; }
  .toolbar .filter-chip { flex: 0 0 auto; }
  .filter-row { flex-wrap: wrap; }

  /* Time filter wraps under title rather than overflowing */
  .time-filter { flex-wrap: wrap; }

  /* DESC compliance layer band stacks */
  .pipeline-desc-layer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pipeline-desc-layer .gates { margin-left: 0; }

  /* Proof + deployments stack and breathe */
  .proof-stats { grid-template-columns: repeat(2, 1fr); }
  .deploy { grid-template-columns: 40px 1fr; }
  .deploy .deploy-status { grid-column: 2; justify-self: start; margin-top: 4px; }
  .reg-health { grid-template-columns: repeat(2, 1fr); }
  .desc-overall-val { font-size: 34px; }
}

/* Phone-specific splash */
@media (max-width: 600px) {
  .splash-top { padding: 18px 18px 0; flex-wrap: wrap; gap: 10px; }
  .splash-pill { display: none; }
  .splash-brand { font-size: 18px; }
  .splash-brand span { font-size: 11px; margin-left: 8px; padding-left: 8px; }
  .splash-body { padding: 26px 18px; gap: 0; align-content: start; }
  .splash-kicker { font-size: 11px; letter-spacing: 2px; margin-bottom: 14px; }
  .splash-h1 { font-size: 34px; line-height: 1.08; word-break: break-word; }
  .splash-lead { font-size: 15px; margin-bottom: 22px; }
  .splash-proof { gap: 18px 22px; margin-bottom: 26px; }
  .splash-proof strong { font-size: 22px; }
  .splash-cta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .splash-enter { width: 100%; text-align: center; }
  .splash-sign { font-size: 12px; }
  .splash-tag { font-size: 15px; margin-top: 26px; }
  .splash-foot { padding: 16px 18px; gap: 14px; font-size: 11px; }
}

/* Utilities */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hide { display: none !important; }

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .vendor-grid { grid-template-columns: repeat(2, 1fr); }
  .row-2 { grid-template-columns: 1fr; }
  .eval-layout { grid-template-columns: 1fr; }
  .score-dials { grid-template-columns: repeat(3, 1fr); }
}

/* ===================================================== */
/* ============ DEMO COMPLETION ADDITIONS =============== */
/* ===================================================== */

/* ---- Entry splash ---- */
.splash {
  position: fixed; inset: 0; z-index: 200;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(46,213,115,0.16), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(46,213,115,0.08), transparent 55%),
    var(--navy);
  color: #fff;
  display: flex; flex-direction: column;
  opacity: 1; transition: opacity 520ms ease;
}
.splash.out { opacity: 0; pointer-events: none; }
.splash-top { display: flex; align-items: center; justify-content: space-between; padding: 28px 48px; }
.splash-brand { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 1px; color: var(--gold); }
.splash-brand { display: inline-flex; align-items: center; }
.splash-brand-img { height: 24px; width: auto; display: block; }
.splash-brand span { color: rgba(255,255,255,0.5); font-size: 13px; font-family: var(--sans); letter-spacing: 0.5px; margin-left: 14px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,0.18); }
.splash-pill { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold-soft); border: 1px solid rgba(46,213,115,0.35); padding: 6px 12px; border-radius: 100px; }
.splash-body { flex: 1; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; padding: 0 48px 40px; max-width: 1200px; margin: 0 auto; width: 100%; }
.splash-kicker { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); margin-bottom: 22px; }
.splash-h1 { font-family: var(--serif); font-size: 60px; line-height: 1.04; font-weight: 600; letter-spacing: -0.5px; margin-bottom: 22px; }
.splash-h1 em { font-style: normal; color: var(--gold); }
.splash-lead { font-size: 17px; line-height: 1.6; color: rgba(255,255,255,0.74); max-width: 540px; margin-bottom: 30px; }
.splash-proof { display: flex; gap: 28px; margin-bottom: 38px; flex-wrap: wrap; }
.splash-proof div { font-size: 13px; color: rgba(255,255,255,0.6); }
.splash-proof strong { display: block; font-family: var(--serif); font-size: 26px; color: #fff; font-weight: 600; margin-bottom: 2px; }
.splash-cta { display: flex; align-items: center; gap: 18px; }
.splash-enter {
  background: var(--gold); color: var(--navy); font-weight: 600; font-size: 15px;
  padding: 15px 30px; border-radius: 7px; letter-spacing: 0.3px;
  transition: background 160ms ease, transform 160ms ease;
}
.splash-enter:hover { background: var(--gold-soft); transform: translateY(-1px); }
.splash-sign { font-size: 13px; color: rgba(255,255,255,0.55); }
.splash-tag { margin-top: 40px; font-family: var(--serif); font-style: italic; font-size: 18px; color: rgba(255,255,255,0.5); }
.splash-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 26px; backdrop-filter: blur(4px);
}
.splash-card-h { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.splash-gate { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: 13px; color: rgba(255,255,255,0.8); }
.splash-gate:last-child { border-bottom: none; }
.splash-gate .ok { color: #6fcf97; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.splash-gate .ok::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #6fcf97; }
.splash-gate .ok.rev { color: #e0b35a; }
.splash-gate .ok.rev::before { background: #e0b35a; }
.splash-foot { padding: 20px 48px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; gap: 26px; flex-wrap: wrap; font-size: 12px; color: rgba(255,255,255,0.45); }
@media (max-width: 920px) {
  .splash-body { grid-template-columns: 1fr; }
  .splash-card { display: none; }
  .splash-h1 { font-size: 42px; }
  .splash-top, .splash-body, .splash-foot { padding-left: 24px; padding-right: 24px; }
}

/* ---- AllysAgent pipeline strip ---- */
.pipeline { margin-bottom: 20px; }
.pipeline-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pipeline-flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.pstep { position: relative; padding: 18px 18px 18px 20px; background: var(--paper); border: 1px solid var(--border); border-right: none; }
.pstep:first-child { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.pstep:last-child { border-right: 1px solid var(--border); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.pstep::after {
  content: ''; position: absolute; right: -10px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 18px; height: 18px; background: var(--paper); border-top: 1px solid var(--border); border-right: 1px solid var(--border); z-index: 2;
}
.pstep:last-child::after { display: none; }
.pstep-num { font-family: var(--serif); font-size: 12px; color: var(--gold-hover); letter-spacing: 1px; margin-bottom: 8px; }
.pstep-name { font-size: 13px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.pstep-desc { font-size: 11.5px; color: var(--ink-60); line-height: 1.45; margin-bottom: 12px; min-height: 48px; }
.pstep-metric { font-size: 12px; color: var(--ink-80); display: flex; align-items: baseline; gap: 5px; }
.pstep-metric strong { font-family: var(--serif); font-size: 19px; color: var(--navy); font-weight: 600; }
.pstep-bar { height: 3px; background: var(--ink-06); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.pstep-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-hover), var(--gold)); border-radius: 2px; }
.pipeline-desc-layer {
  margin-top: 12px; display: flex; align-items: center; gap: 12px;
  background: var(--navy); color: rgba(255,255,255,0.82); border-radius: var(--radius-lg);
  padding: 13px 20px; font-size: 12.5px;
}
.pipeline-desc-layer .tag { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); font-weight: 600; white-space: nowrap; }
.pipeline-desc-layer .gates { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.pipeline-desc-layer .gates span { font-size: 11px; color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.16); padding: 3px 9px; border-radius: 100px; }

/* ---- Deployments / proof panel ---- */
.proof-row { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 20px; margin-bottom: 20px; }
.proof-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.proof-stat { background: var(--navy); color: #fff; padding: 20px; }
.proof-stat .v { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.proof-stat .l { font-size: 11.5px; color: rgba(255,255,255,0.62); line-height: 1.4; }
.deploy-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.deploy { background: var(--paper); padding: 15px 18px; display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; transition: background 140ms ease; cursor: default; }
.deploy:hover { background: var(--cream); }
.deploy-logo { width: 44px; height: 44px; border-radius: 9px; background: var(--navy); color: var(--gold); font-family: var(--serif); font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; letter-spacing: 0.5px; }
.deploy-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.deploy-desc { font-size: 12px; color: var(--ink-60); margin-top: 2px; line-height: 1.4; }
.deploy-status { font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; font-weight: 600; padding: 4px 10px; border-radius: 100px; white-space: nowrap; }
.deploy-status.live { background: var(--green-soft); color: var(--green); }
.deploy-status.active { background: var(--amber-soft); color: var(--amber); }

/* ---- Report preview modal ---- */
.rmodal { position: fixed; inset: 0; z-index: 150; background: rgba(10,13,20,0.55); display: none; align-items: center; justify-content: center; padding: 32px; }
.rmodal.active { display: flex; }
.rmodal-box { background: var(--paper); border-radius: 12px; width: 100%; max-width: 760px; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(10,13,20,0.4); }
.rmodal-head { background: var(--navy); color: #fff; padding: 22px 26px; display: flex; align-items: flex-start; justify-content: space-between; }
.rmodal-title { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.rmodal-sub { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 5px; }
.rmodal-x { color: rgba(255,255,255,0.7); font-size: 22px; line-height: 1; background: rgba(255,255,255,0.1); width: 32px; height: 32px; border-radius: 7px; }
.rmodal-body { padding: 26px; overflow-y: auto; }
.rdoc-meta { display: flex; gap: 22px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.rdoc-meta div { font-size: 12px; color: var(--ink-60); }
.rdoc-meta strong { display: block; color: var(--ink); font-size: 13px; margin-top: 2px; }
.rdoc-section-title { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold-hover); margin: 22px 0 12px; font-weight: 700; }
.rdoc-section-title:first-child { margin-top: 0; }
.rdoc-line { font-size: 13.5px; line-height: 1.7; color: var(--ink-80); margin-bottom: 10px; }
.rdoc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.rdoc-kpi { border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.rdoc-kpi .v { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--navy); }
.rdoc-kpi .l { font-size: 11px; color: var(--ink-60); margin-top: 3px; }
.rdoc-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.rdoc-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-60); padding: 8px 10px; border-bottom: 1px solid var(--border-strong); }
.rdoc-table td { font-size: 13px; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.rmodal-foot { padding: 16px 26px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--cream); }
.rmodal-foot .hash { font-size: 11px; color: var(--ink-40); font-family: ui-monospace, monospace; }

/* ---- Gate detail drawer reuses .drawer; extra bits ---- */
.gate-clickable { cursor: pointer; transition: background 140ms ease; border-radius: 6px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.gate-clickable:hover { background: var(--cream); }
.gate-detail-std { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.gate-detail-std span { font-size: 11px; color: var(--ink-80); background: var(--ink-06); padding: 4px 10px; border-radius: 100px; }

/* ---- Vendor registry health strip ---- */
.reg-health { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 18px; }
.reg-h { background: var(--paper); padding: 16px 18px; }
.reg-h .v { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.reg-h .v .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.reg-h .l { font-size: 11.5px; color: var(--ink-60); margin-top: 4px; }
@media (max-width: 1280px) {
  .pipeline-flow { grid-template-columns: 1fr; }
  .pstep { border-right: 1px solid var(--border); border-bottom: none; border-radius: 0; }
  .pstep::after { display: none; }
  .pstep:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .pstep:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .pstep-desc { min-height: 0; }
  .proof-row { grid-template-columns: 1fr; }
  .reg-health { grid-template-columns: repeat(2, 1fr); }

  /* New: ingestion + architecture responsive */
  .intake-sources { grid-template-columns: repeat(2, 1fr); }
  .direction-row { gap: 8px; }
  .direction-note { margin-left: 0; flex: 1 0 100%; order: 3; }
  .req-table table.plain { min-width: 760px; }
  .arch-hero { flex-direction: column; align-items: flex-start; }
  .arch-layer { grid-template-columns: 1fr; gap: 12px; }
  .extract-field { grid-template-columns: 90px 1fr; }
}

/* ===== Final phone overrides (must come last to win source order) ===== */
@media (max-width: 720px) {
  /* Report modal goes full-screen on phones */
  .rmodal { padding: 0; align-items: stretch; }
  .rmodal-box { max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .rmodal-body { padding: 18px; }
  .rdoc-kpis { grid-template-columns: repeat(2, 1fr); }
  .rdoc-meta { gap: 14px; }
  .rdoc-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

  /* DESC compliance band stacks */
  .pipeline-desc-layer { flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; }
  .pipeline-desc-layer .tag { align-self: flex-start; }
  .pipeline-desc-layer .gates { margin-left: 0; }

  /* Proof + deployments */
  .proof-stats { grid-template-columns: repeat(2, 1fr); }
  .deploy { grid-template-columns: 40px 1fr; }
  .deploy .deploy-status { grid-column: 2; justify-self: start; margin-top: 4px; }
  .reg-health { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .splash-h1 { font-size: 33px; line-height: 1.08; word-break: break-word; }
  .splash-lead { font-size: 15px; }
  .splash-proof strong { font-size: 22px; }
  .splash-enter { width: 100%; text-align: center; }
  .splash-cta { flex-direction: column; align-items: stretch; gap: 12px; }
  .splash-tag { font-size: 15px; }
  .score-dials { grid-template-columns: repeat(2, 1fr) !important; }
  .composite-strip, .composite-card { flex-wrap: wrap; gap: 10px; }
}

/* ===== Ingestion, direction, architecture ===== */
.direction-row { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; flex-wrap: wrap; }
.direction-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60); }
.dir-chip { padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--paper); font-size: 12px; font-weight: 500; color: var(--ink-60); }
.dir-chip:hover { background: var(--cream); }
.dir-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.dir-chip[data-dir="need"] { color: var(--blue); }
.dir-chip[data-dir="supply"] { color: var(--gold-hover); }
.dir-chip.active[data-dir="need"], .dir-chip.active[data-dir="supply"] { color: #fff; }
.direction-note { font-size: 12px; color: var(--ink-60); margin-left: auto; }
.direction-note strong { color: var(--ink); }
.src-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-80); }
.src-ico { width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.src-ico.email { background: var(--blue-soft); color: var(--blue); }
.src-ico.api { background: #e7e0f4; color: #6a4fb0; }
.src-ico.portal { background: var(--green-soft); color: var(--green); }
.src-ico.sector { background: var(--amber-soft); color: var(--amber); }
.src-ico.direct { background: var(--ink-06); color: var(--ink-80); }
.dir-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dir-dot.need { background: var(--blue); }
.dir-dot.supply { background: var(--gold); }

.intake-sources { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; }
.isrc { background: var(--paper); padding: 16px 18px; position: relative; }
.isrc-top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.isrc-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.isrc-v { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--navy); }
.isrc-l { font-size: 11px; color: var(--ink-60); margin-top: 2px; }
.isrc-live { position: absolute; top: 14px; right: 14px; font-size: 9px; letter-spacing: 0.1em; color: var(--green); font-weight: 700; display: flex; align-items: center; gap: 5px; }
.isrc-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }

.intake-mode { display: flex; gap: 8px; margin-bottom: 20px; background: var(--ink-06); padding: 4px; border-radius: var(--radius); }
.intake-mode button { flex: 1; padding: 9px; font-size: 12px; font-weight: 600; border-radius: 4px; color: var(--ink-60); }
.intake-mode button.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.raw-panel { display: none; }
.raw-panel.active { display: block; }
.raw-source-pick { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.raw-source-pick button { padding: 6px 11px; font-size: 11px; font-weight: 600; border: 1px solid var(--border-strong); border-radius: 100px; color: var(--ink-60); background: var(--paper); }
.raw-source-pick button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.raw-box { width: 100%; min-height: 150px; padding: 13px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--paper); font-size: 12.5px; line-height: 1.6; font-family: 'SF Mono', Menlo, monospace; color: var(--ink-80); resize: vertical; }
.raw-box:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }
.raw-hint { font-size: 11px; color: var(--ink-60); margin: 8px 0 16px; line-height: 1.5; }
.raw-hint a { color: var(--blue); font-weight: 600; cursor: pointer; text-decoration: underline; }
.extract-preview { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: none; }
.extract-preview.show { display: block; animation: fade 300ms ease; }
.extract-head { background: var(--navy); color: #fff; padding: 11px 15px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.extract-head .gold-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.extract-field { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 10px 15px; border-bottom: 1px solid var(--border); font-size: 12.5px; align-items: baseline; opacity: 0; transform: translateY(4px); }
.extract-field.show { opacity: 1; transform: translateY(0); transition: all 260ms ease; }
.extract-field:last-child { border-bottom: none; }
.extract-key { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-60); font-weight: 700; }
.extract-val { color: var(--ink); font-weight: 500; }
.extract-val .conf { font-size: 10px; color: var(--green); font-weight: 700; margin-left: 8px; }

.arch-hero { background: var(--navy); color: #fff; border-radius: var(--radius-lg); padding: 26px 30px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.arch-hero h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.arch-hero p { font-size: 13px; color: rgba(255,255,255,0.7); max-width: 560px; line-height: 1.6; }
.arch-hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.arch-badge { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--gold-soft); border: 1px solid rgba(46,213,115,0.4); padding: 6px 12px; border-radius: 100px; white-space: nowrap; }
.arch-stack { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.arch-layer { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: center; box-shadow: var(--shadow-sm); }
.arch-layer-num { font-family: var(--serif); font-size: 12px; color: var(--gold-hover); letter-spacing: 1px; }
.arch-layer-name { font-family: var(--serif); font-size: 18px; font-weight: 600; margin-top: 3px; }
.arch-layer-sub { font-size: 11.5px; color: var(--ink-60); margin-top: 4px; line-height: 1.45; }
.arch-nodes { display: flex; gap: 10px; flex-wrap: wrap; }
.arch-node { background: var(--cream); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-size: 12px; }
.arch-node strong { display: block; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.arch-node span { font-size: 11px; color: var(--ink-60); }
.arch-node.desc-node { border-color: var(--gold); background: #fbf7ec; }
.arch-residency { background: var(--navy); color: #fff; border-radius: var(--radius-lg); padding: 20px 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.arch-residency .tag { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); font-weight: 700; white-space: nowrap; }
.arch-residency .txt { font-size: 12.5px; color: rgba(255,255,255,0.82); flex: 1; min-width: 260px; line-height: 1.55; }
.arch-residency .txt strong { color: #fff; }
.arch-residency .pills { display: flex; gap: 8px; flex-wrap: wrap; }
.arch-residency .pills span { font-size: 11px; color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.16); padding: 4px 10px; border-radius: 100px; }
@media (max-width: 1280px) {
  .intake-sources { grid-template-columns: repeat(2, 1fr); }
  .arch-layer { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 720px) {
  .intake-sources { grid-template-columns: repeat(2, 1fr); }
  .direction-note { margin-left: 0; flex: 1 0 100%; order: 3; }
  .req-table table.plain { min-width: 760px; }
  .arch-hero { flex-direction: column; align-items: flex-start; }
  .extract-field { grid-template-columns: 90px 1fr; }
}

/* ===== Audit trail page ===== */
.audit-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.audit-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 18px; }
.aud-stat { background: var(--paper); padding: 16px 18px; }
.aud-stat .v { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--navy); }
.aud-stat .v.mono { font-family: ui-monospace,'SF Mono',Menlo,monospace; font-size: 14px; letter-spacing: 0.02em; }
.aud-stat .l { font-size: 11.5px; color: var(--ink-60); margin-top: 4px; }
.audit-table { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.audit-log-row { display: grid; grid-template-columns: 150px 130px 1fr 130px; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--border); align-items: center; font-size: 13px; }
.audit-log-row:last-child { border-bottom: none; }
.audit-log-row:hover { background: var(--cream); }
.audit-log-row.head { background: var(--navy); color: #fff; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; position: sticky; top: 56px; }
.aud-ts { font-family: ui-monospace,'SF Mono',Menlo,monospace; font-size: 12px; color: var(--ink-60); }
.aud-ev { font-weight: 600; color: var(--ink); }
.aud-ev small { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-60); margin-top: 2px; }
.aud-actor { font-size: 12px; color: var(--ink-80); }
.aud-actor .role { display: block; font-size: 10.5px; color: var(--ink-60); }
.aud-hash { font-family: ui-monospace,'SF Mono',Menlo,monospace; font-size: 11px; color: var(--ink-40); display: flex; align-items: center; gap: 6px; }
.aud-hash::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.aud-kind { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.aud-kind.score { background: var(--amber-soft); color: var(--amber); }
.aud-kind.attest { background: var(--green-soft); color: var(--green); }
.aud-kind.decision { background: var(--gold-soft); color: var(--navy); }
.aud-kind.system { background: var(--ink-06); color: var(--ink-80); }
.aud-kind.ingest { background: var(--blue-soft); color: var(--blue); }

/* ===== Panel resolution ===== */
.panel-outcome { margin-top: 6px; padding: 14px 16px; border-radius: var(--radius); font-size: 12.5px; line-height: 1.5; display: none; }
.panel-outcome.show { display: block; }
.panel-outcome.approved { background: var(--green-soft); border-left: 3px solid var(--green); color: #14532d; }
.panel-outcome.rejected { background: var(--red-soft); border-left: 3px solid var(--red); color: #7a1f0d; }
.panel-outcome .oc-head { font-weight: 700; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.panel-outcome .oc-sub { color: var(--ink-80); }
.panel-outcome .oc-hash { font-family: ui-monospace,monospace; font-size: 10.5px; color: var(--ink-60); margin-top: 6px; }
.panel-vote-actions { display: flex; gap: 8px; margin-top: 12px; }
.panel-vote-actions button { flex: 1; padding: 9px; font-size: 12px; font-weight: 600; border-radius: var(--radius); }
.btn-approve { background: var(--green); color: #fff; }
.btn-approve:hover { background: #185f3b; }
.btn-reject { background: var(--paper); color: var(--red); border: 1px solid var(--red); }
.btn-reject:hover { background: var(--red-soft); }
@media (max-width: 720px) {
  .audit-stats { grid-template-columns: repeat(2, 1fr); }
  .audit-log-row { grid-template-columns: 1fr; gap: 6px; }
  .audit-log-row.head { display: none; }
  .audit-table { overflow-x: visible; }
}

/* ===== Vendor dossier drawer ===== */
.vd-status{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:16px}
.vd-rep{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--ink-80)}
.vd-rep .stars{color:var(--green);letter-spacing:1px}
.vd-note{background:var(--green-soft);border-left:3px solid var(--green);border-radius:0 8px 8px 0;padding:11px 14px;font-size:12px;color:var(--ink-80);line-height:1.55;margin:0 0 20px}
.vd-sec{margin:0 0 20px}
.vd-sec-title{font-family:var(--serif);font-size:11px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--ink-60);margin-bottom:11px;padding-bottom:6px;border-bottom:1px solid var(--border)}
.vd-kv{display:grid;grid-template-columns:1fr 1fr;gap:11px 18px}
.vd-kv.one{grid-template-columns:1fr}
.vd-k{font-size:10px;color:var(--ink-40);text-transform:uppercase;letter-spacing:.05em;margin-bottom:3px}
.vd-v{font-size:13px;color:var(--ink);font-weight:600;line-height:1.35;word-break:break-word}
.vd-ubo{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px dashed var(--border)}
.vd-ubo:last-child{border-bottom:none}
.vd-scr-row{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:8px}
.vd-proj{border:1px solid var(--border);border-radius:8px;padding:13px 14px;margin-bottom:10px;background:var(--paper)}
.vd-proj-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.vd-proj-name{font-size:13px;font-weight:700;color:var(--ink);line-height:1.3}
.vd-proj-client{font-size:11px;color:var(--ink-60);margin-top:2px}
.vd-proj-out{font-size:12px;color:var(--ink-80);line-height:1.55;margin-top:9px}
.vd-score{flex:0 0 auto;text-align:right;min-width:52px}
.vd-score .n{font-family:var(--serif);font-weight:700;font-size:17px;color:var(--green);line-height:1}
.vd-score .l{font-size:9px;color:var(--ink-40);text-transform:uppercase;letter-spacing:.04em;margin-top:3px}

/* ===== Live-app additions (app.js) ===== */
.step-icon.failed { background: var(--red); color: #fff; }
.step.show .step-icon.failed { background: var(--red); color: #fff; }
.run-error { display: none; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--red); border-radius: var(--radius); background: var(--red-soft); color: var(--red); font-size: 13px; line-height: 1.6; }
.run-error.show { display: block; }
.audit-banner { display: none; margin: 0 0 14px; padding: 12px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600; border: 1px solid; }
.audit-banner.show { display: block; }
.audit-banner.ok { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.audit-banner.bad { background: var(--red-soft); color: var(--red); border-color: var(--red); }

/* ============================================================
   AllysAgent conversational copilot (chat.js)
   ============================================================ */

/* ---- Floating launcher ---- */
#chatFab {
  position: fixed; right: 24px; bottom: 24px; z-index: 140;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gold); color: var(--navy); border: none;
  box-shadow: 0 10px 30px rgba(10,13,20,0.28);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, opacity 150ms ease;
}
#chatFab:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(10,13,20,0.34); background: var(--gold-hover); }
#chatFab svg { pointer-events: none; }
body.chat-open #chatFab { opacity: 0; pointer-events: none; transform: scale(0.8); }

/* ---- Chat drawer sizing (reuses .drawer) ---- */
#chatDrawer { width: 520px; }
.chat-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chat-drawer-body { padding: 0 !important; display: flex; flex-direction: column; overflow: hidden; position: relative; }

/* ---- Message list (shared by drawer + view) ---- */
.chat-messages {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 20px 22px; display: flex; flex-direction: column; gap: 16px;
}
.chat-turn { display: flex; flex-direction: column; gap: 12px; }
.chat-empty { margin: auto; text-align: center; color: var(--ink-60); font-size: 13px; padding: 30px 18px; line-height: 1.6; }
.chat-empty strong { display: block; font-family: var(--serif); font-size: 16px; color: var(--ink); margin-bottom: 6px; }

/* ---- Bubbles ---- */
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-bubble {
  max-width: 86%; padding: 10px 13px; border-radius: var(--radius-lg);
  font-size: 13px; line-height: 1.55; overflow-wrap: anywhere;
}
.chat-msg.user .chat-bubble {
  background: var(--gold-soft); border: 1px solid var(--gold); color: var(--ink);
  border-bottom-right-radius: 3px; white-space: pre-wrap;
}
.chat-msg.assistant .chat-bubble {
  background: var(--paper); border: 1px solid var(--border); color: var(--ink-80);
  border-bottom-left-radius: 3px; box-shadow: var(--shadow-sm);
}
.chat-bubble.error { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble ul, .chat-bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.chat-bubble li { margin-bottom: 3px; }
.chat-bubble a { color: var(--green); text-decoration: underline; }
.chat-bubble .md-code {
  font-family: 'SF Mono', Menlo, monospace; font-size: 11.5px;
  background: var(--ink-06); padding: 1px 5px; border-radius: 3px;
}
.chat-bubble .md-table-wrap { overflow-x: auto; margin: 6px 0; }
.chat-bubble .md-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.chat-bubble .md-table th, .chat-bubble .md-table td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; }
.chat-bubble .md-table th { background: var(--ink-06); font-weight: 600; }
.req-link { color: var(--green); font-weight: 600; cursor: pointer; border-bottom: 1px dashed var(--green); }
.req-link:hover { background: var(--green-soft); }

/* ---- Tool step lines ---- */
.chat-tool { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ink-60); }
.chat-tool.depth1 { padding-left: 22px; }
.chat-tool.depth2 { padding-left: 44px; }
.chat-tool-lead { color: var(--ink-40); flex-shrink: 0; }
.chat-tool-ico { flex-shrink: 0; width: 13px; text-align: center; }
.chat-tool-ico.ok { color: var(--green); }
.chat-tool-ico.error { color: var(--red); }
.chat-tool-spin {
  width: 11px; height: 11px; border: 2px solid var(--ink-10); border-top-color: var(--gold);
  border-radius: 50%; display: inline-block; animation: spin 800ms linear infinite;
}
.chat-tool-main { flex: 1; min-width: 0; }
.chat-tool-name { font-weight: 600; color: var(--ink-80); }
.chat-tool .tk {
  font-family: 'SF Mono', Menlo, monospace; font-size: 11px;
  background: var(--ink-06); padding: 1px 6px; border-radius: 3px; color: var(--ink-80);
}
.chat-tool-detail { margin-top: 3px; }
.chat-tool-detail summary { cursor: pointer; color: var(--ink-40); font-size: 11px; list-style: revert; }
.chat-tool-detail pre {
  margin: 4px 0 0; padding: 8px 10px; background: var(--ink-06); border-radius: var(--radius);
  font-size: 11px; overflow-x: auto; overflow-y: auto; max-height: 240px; white-space: pre-wrap; word-break: break-word;
}
.chat-tool-steps { margin-top: 4px; }

/* ---- Thinking indicator ---- */
.chat-thinking { display: inline-flex; gap: 5px; padding: 9px 13px; align-items: center; }
.chat-thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-40); animation: chatPulse 1.2s ease-in-out infinite; }
.chat-thinking span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatPulse { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }

/* ---- Composer ---- */
.chat-composer { border-top: 1px solid var(--border); padding: 12px 16px; background: var(--paper); }
.chat-composer.streaming .chat-input { opacity: 0.55; }
.chat-composer-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-input {
  flex: 1; resize: none; max-height: 140px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: 13px; font-family: var(--sans); line-height: 1.5;
  background: var(--paper); color: var(--ink); overflow-y: auto;
}
.chat-input:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }
.chat-attach-btn {
  width: 38px; height: 38px; flex-shrink: 0; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--paper); font-size: 16px; color: var(--ink-60); cursor: pointer;
}
.chat-attach-btn:hover { background: var(--cream); }
.chat-send { flex-shrink: 0; height: 38px; }

/* ---- Attachment chips ---- */
.chat-attach-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chat-attach-row:empty { display: none; }
.chat-attach {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  background: var(--cream); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; color: var(--ink-80);
}
.chat-attach .cx { cursor: pointer; color: var(--ink-40); font-size: 13px; line-height: 1; }
.chat-attach .cx:hover { color: var(--red); }

/* ---- Google Drive chip ---- */
.drive-chip { display: inline-flex; align-items: center; }
.drive-chip .drive-connect {
  font-size: 11px; font-weight: 600; background: var(--gold); color: var(--navy);
  border: 1px solid var(--gold); border-radius: 999px; padding: 4px 11px; cursor: pointer;
}
.drive-chip .drive-connect:hover { background: var(--gold-hover); }
.drive-chip .drive-on { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 4px 10px; }
.drive-chip .drive-off { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; }
.drive-chip .drive-x { cursor: pointer; font-size: 13px; line-height: 1; opacity: 0.75; }
#chatDriveChip .drive-on { background: rgba(46,213,115,0.16); color: var(--gold); }
#chatDriveChip .drive-off { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); }
#chatDriveChip .drive-x { color: var(--gold); }
#asstDriveChip .drive-on { background: var(--green-soft); color: var(--green); }
#asstDriveChip .drive-off { background: var(--ink-06); color: var(--ink-60); }
#asstDriveChip .drive-x { color: var(--ink-40); }

/* ---- Assistant full view ---- */
.asst-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.asst-side { position: sticky; top: 80px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.asst-side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.asst-kind-filter { font-size: 11px; padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--paper); color: var(--ink-80); }
.asst-thread-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.asst-thread { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; background: var(--paper); transition: border-color 120ms ease, background 120ms ease; }
.asst-thread:hover { background: var(--cream); }
.asst-thread.active { border-color: var(--gold); background: var(--gold-soft); }
.asst-thread-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asst-thread-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-thread-del { cursor: pointer; color: var(--ink-40); font-size: 15px; line-height: 1; flex-shrink: 0; }
.asst-thread-del:hover { color: var(--red); }
.asst-thread-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--ink-60); }
.asst-empty { font-size: 12px; color: var(--ink-60); padding: 10px 2px; }

.asst-conv { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: calc(100vh - 120px); min-height: 480px; position: relative; }
.asst-conv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.asst-conv-title { font-family: var(--serif); font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Panel discussion (evaluation sidebar) ---- */
.panel-comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.panel-comment:first-child { border-top: none; }
.panel-comment-av { background: var(--navy-3); color: #fff; border: none; flex-shrink: 0; }
.panel-comment-main { flex: 1; min-width: 0; }
.panel-comment-head { font-size: 12px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.panel-comment-org { font-weight: 400; color: var(--ink-60); font-size: 11px; }
.panel-comment-agent { font-size: 10px; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.panel-comment-time { margin-left: auto; font-size: 10.5px; color: var(--ink-40); font-weight: 400; }
.panel-comment-body { font-size: 12.5px; color: var(--ink-80); line-height: 1.5; margin-top: 2px; }
.panel-comment-body p { margin: 0 0 4px; }
.panel-comment-body p:last-child { margin-bottom: 0; }
.panel-comment-empty { font-size: 12px; color: var(--ink-60); padding: 6px 0 10px; }

.chat-intake-link { font-size: 12px; color: var(--green); cursor: pointer; font-weight: 600; }
.chat-intake-link:hover { text-decoration: underline; }

/* ---- v2: centered transcript column ---- */
.chat-col { width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* ---- v2: transcript anatomy ---- */
.chat-msg.user { flex-direction: column; align-items: flex-end; justify-content: flex-start; gap: 3px; }
.chat-msg.user .chat-bubble { max-width: 560px; }
#chatDrawer .chat-msg.user .chat-bubble { max-width: 72%; }
.msg-meta { font-size: 10.5px; color: var(--ink-40); text-align: right; opacity: 0; transition: opacity 120ms ease; }
.chat-msg:hover .msg-meta, .chat-msg:focus-within .msg-meta { opacity: 1; }
.chat-msg.assistant { display: block; }
.chat-msg.assistant .chat-bubble {
  max-width: 100%; background: transparent; border: none; padding: 0; border-radius: 0;
  font-size: 13.5px; line-height: 1.62; color: var(--ink-80); box-shadow: none;
}
.chat-msg.assistant .chat-bubble.error {
  background: var(--red-soft); border: 1px solid var(--red); color: var(--red);
  padding: 10px 13px; border-radius: var(--radius-lg);
}
.msg-author { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.avatar-circle.agent-av { width: 22px; height: 22px; background: var(--navy); color: var(--gold); border: none; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.msg-author-name { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.msg-author time { font-size: 10.5px; color: var(--ink-40); }
.msg-copy { margin-left: auto; font-size: 11px; color: var(--ink-40); background: none; border: none; padding: 2px 4px; cursor: pointer; opacity: 0; transition: opacity 120ms ease, color 120ms ease; }
.chat-turn:hover .msg-copy, .chat-turn:focus-within .msg-copy { opacity: 1; }
.msg-copy:hover { color: var(--green); }
.chat-day-sep { display: flex; align-items: center; gap: 12px; }
.chat-day-sep::before, .chat-day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.chat-day-sep span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-40); font-weight: 700; }
.chat-notice { font-size: 12.5px; color: var(--ink-60); background: var(--ink-06); border-radius: var(--radius); padding: 9px 13px; line-height: 1.5; }
.chat-notice.amber { background: var(--amber-soft); color: var(--amber); }
.chat-msg.chat-thinking-row { display: flex; align-items: center; gap: 6px; }
.thinking-label { font-size: 12px; color: var(--ink-60); font-style: italic; }
.chat-think-static { color: var(--ink-40); font-size: 16px; line-height: 1; padding: 4px 0; }
.chat-jump {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 78px; z-index: 20;
  background: var(--navy); color: #fff; font-size: 11px; font-weight: 600;
  border: none; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(10,13,20,0.25); white-space: nowrap;
}
.chat-jump:hover { background: var(--navy-3); }

/* ---- v2: agent activity block ---- */
.chat-activity { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-sm); }
.chat-activity > summary { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; list-style: none; }
.chat-activity > summary::-webkit-details-marker { display: none; }
.act-status { flex-shrink: 0; width: 15px; display: inline-flex; justify-content: center; }
.chat-activity-sum { font-size: 11.5px; color: var(--ink-60); white-space: nowrap; }
.act-caret { margin-left: auto; color: var(--ink-40); font-size: 10px; transition: transform 160ms ease; }
.chat-activity[open] > summary .act-caret { transform: rotate(180deg); }
.chat-activity-body { padding: 0 14px 8px; }
.agent-step { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; font-size: 12.5px; border-top: 1px solid var(--border); }
.agent-step:first-child { border-top: none; }
.agent-step.depth1 { padding-left: 22px; border-left: 2px solid var(--ink-10); }
.agent-step.depth2 { padding-left: 44px; border-left: 2px solid var(--ink-10); }
.agent-step-main { flex: 1; min-width: 0; }
.agent-step-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-step-label { color: var(--ink-80); font-weight: 500; }
.agent-step .tk, .chat-tool-fn {
  font-family: 'SF Mono', Menlo, monospace; font-size: 11px;
  background: var(--ink-06); padding: 1px 6px; border-radius: 3px; color: var(--ink-80);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.step-action { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--amber); background: var(--amber-soft); border-radius: 3px; padding: 2px 6px; }
.step-dur { margin-left: auto; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; color: var(--ink-40); font-variant-numeric: tabular-nums; white-space: nowrap; }
.agent-activity-foot { border-top: 1px solid var(--border); padding: 8px 14px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; color: var(--ink-40); }

/* ---- v2: composer ---- */
.chat-composer-hints { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; min-height: 14px; }
.hint-keys { font-size: 10.5px; color: var(--ink-40); }
.chat-count { font-size: 11px; color: var(--ink-40); margin-left: auto; font-variant-numeric: tabular-nums; }
.chat-count.over { color: var(--red); font-weight: 600; }
.chat-send.is-stop { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }
.chat-send.is-stop:hover { background: var(--red-soft); color: var(--red); }
.chat-send:disabled { opacity: 0.65; cursor: default; }

/* ---- v2: empty-state hero + suggestion chips ---- */
.chat-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 44px 8px 20px; }
.chat-hero-title { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); }
.chat-hero-sub { font-size: 13px; color: var(--ink-60); line-height: 1.6; max-width: 46ch; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; width: 100%; }
.chip-suggest {
  background: var(--paper); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 8px 14px; font-size: 12.5px; color: var(--ink-80); cursor: pointer; text-align: left;
  transition: border-color 120ms ease, background 120ms ease;
}
.chip-suggest:hover { border-color: var(--gold); background: var(--gold-soft); }
.chat-hero.compact { padding: 22px 16px; }
.chat-hero.compact .chat-hero-title { font-size: 16px; }
.chat-hero.compact .chat-hero-sub { display: none; }
.chat-hero.compact .chat-suggest { flex-direction: column; flex-wrap: nowrap; }
.chat-hero.compact .chip-suggest { width: 100%; }

/* ---- v2: thread list ---- */
.asst-search { width: 100%; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--paper); color: var(--ink); font-size: 12.5px; }
.asst-search:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }
.asst-group-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-40); font-weight: 700; margin: 8px 2px 2px; }
.asst-group-label:first-child { margin-top: 0; }
.asst-thread { min-height: 44px; }
.asst-thread.running { border-left: 3px solid var(--gold); }
.asst-thread-spin { width: 10px; height: 10px; flex-shrink: 0; border: 2px solid var(--ink-10); border-top-color: var(--gold); border-radius: 50%; display: inline-block; animation: spin 800ms linear infinite; }
.asst-thread-pin { flex-shrink: 0; border: none; background: none; padding: 0 2px; font-size: 13px; line-height: 1; color: var(--ink-40); cursor: pointer; opacity: 0; transition: opacity 120ms ease, color 120ms ease; }
.asst-thread:hover .asst-thread-pin, .asst-thread:focus-within .asst-thread-pin, .asst-thread-pin.pinned { opacity: 1; }
.asst-thread-pin:hover, .asst-thread-pin.pinned { color: var(--amber); }
.asst-thread-preview { font-size: 12px; color: var(--ink-60); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-thread-top .asst-thread-title { flex: 1; min-width: 0; }
.asst-start { margin-top: 8px; }

/* ---- v2: conversation header + drawer chrome ---- */
.conv-head-main { flex: 1; min-width: 0; }
.conv-head-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conv-head-title-row .asst-conv-title { min-width: 0; }
.conv-head-chips { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.conv-head-sub { font-size: 11.5px; color: var(--ink-60); margin-top: 3px; display: flex; align-items: center; gap: 6px; min-height: 14px; }
.conv-head-sub .chat-tool-spin { width: 10px; height: 10px; }
.conv-context-chip { font-size: 11px; font-weight: 600; background: var(--green-soft); border-radius: 999px; padding: 2px 9px; border-bottom: none; white-space: nowrap; }
.drawer-new, .drawer-open-full {
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px; padding: 4px 10px; cursor: pointer; white-space: nowrap;
}
.drawer-new:hover, .drawer-open-full:hover { background: rgba(255,255,255,0.16); color: #fff; }
#chatDrawerSub .req-link { color: #fff; border-bottom-color: rgba(255,255,255,0.5); }
#chatDrawerSub .req-link:hover { background: transparent; color: var(--gold-soft); }
.asst-back { display: none; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px 0 0; color: var(--green); font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; flex-shrink: 0; }
@keyframes titleFlash { from { background: var(--gold-soft); } to { background: transparent; } }
.title-updated { animation: titleFlash 1.2s ease; border-radius: 3px; }

/* ---- v2: accessibility ---- */
.sr-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
  #chatDrawer { width: 100%; height: 100dvh; }
  #chatFab { right: 16px; bottom: 16px; }
  .asst-layout { grid-template-columns: 1fr; }
  .asst-side { position: static; max-height: none; }
  .asst-conv { height: auto; min-height: 70vh; }
  .asst-conv { display: none; }
  .asst-layout.mobile-conv-open .asst-conv { display: flex; }
  .asst-layout.mobile-conv-open .asst-side { display: none; }
  .asst-back { display: inline-flex; }
  .hint-keys { display: none; }
  .chat-suggest { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chip-suggest { flex-shrink: 0; }
  #asstMessages .chat-hero .chat-suggest { flex-direction: column; overflow: visible; }
  #asstMessages .chat-hero .chip-suggest { width: 100%; flex-shrink: 1; }
  .asst-thread-pin, .asst-thread-del { opacity: 1; }
  .chat-jump { bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
  .chat-thinking span { animation: none; opacity: 0.6; transform: none; }
  .chat-tool-spin, .asst-thread-spin { animation: none; }
  .act-caret { transition: none; }
  .chat-activity[open] > summary .act-caret { transform: none; }
  .title-updated { animation: none; }
}

/* =====================================================================
   v3 — Claude-style reading experience (calm, generous, legible).
   Appended last so equal-specificity rules win by cascade order.
   ===================================================================== */

/* Reading column: narrower measure, generous air between turns */
.chat-col { max-width: 720px; gap: 26px; }
.asst-conv .chat-messages { padding: 30px 24px 36px; }
.chat-turn { gap: 14px; }

/* Assistant reply — flat document, comfortable measure */
.chat-msg.assistant .chat-bubble {
  font-size: 14.5px; line-height: 1.72; color: rgba(10, 13, 20, 0.86);
  letter-spacing: 0.001em;
}
.chat-msg.assistant .chat-bubble p { margin: 0 0 14px; }
.chat-msg.assistant .chat-bubble p:last-child { margin-bottom: 0; }
.chat-msg.assistant .chat-bubble strong { color: var(--ink); font-weight: 650; }
.chat-msg.assistant .chat-bubble ul,
.chat-msg.assistant .chat-bubble ol { margin: 4px 0 14px; padding-left: 22px; }
.chat-msg.assistant .chat-bubble li { margin-bottom: 6px; padding-left: 2px; }
.chat-msg.assistant .chat-bubble li::marker { color: var(--ink-40); }
.chat-msg.assistant .chat-bubble ol li::marker { color: var(--ink-60); font-variant-numeric: tabular-nums; }
.chat-msg.assistant .chat-bubble a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.chat-msg.assistant .chat-bubble > :first-child { margin-top: 0; }

/* Markdown block elements the model emits (headings / rules / quotes) */
.md-h { font-family: var(--sans); color: var(--ink); font-weight: 650; line-height: 1.3; }
.md-h1 { font-size: 18px; margin: 22px 0 10px; }
.md-h2 { font-size: 15.5px; margin: 20px 0 8px; }
.md-h3 { font-size: 13.5px; margin: 18px 0 6px; }
.md-h4 { font-size: 12.5px; margin: 16px 0 4px; text-transform: none; color: var(--ink-80); }
.chat-bubble > .md-h:first-child { margin-top: 0; }
.md-hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.md-quote {
  margin: 12px 0; padding: 2px 0 2px 15px; border-left: 2.5px solid var(--ink-20);
  color: var(--ink-60); font-size: 14px; line-height: 1.65;
}
.chat-bubble .md-code {
  background: rgba(10, 13, 20, 0.05); font-size: 12.5px; padding: 1.5px 6px; border-radius: 5px;
  color: var(--ink); border: 1px solid var(--border);
}
.chat-bubble .md-table { font-size: 12.5px; }
.chat-bubble .md-table th, .chat-bubble .md-table td { padding: 7px 10px; }
.chat-bubble .md-table th { background: rgba(10, 13, 20, 0.035); font-weight: 600; }

/* User message — soft warm neutral, no loud color, no tail notch (Claude-like) */
.chat-msg.user .chat-bubble {
  background: rgba(10, 13, 20, 0.045); border: 1px solid transparent; color: var(--ink);
  border-radius: 16px; padding: 11px 16px; font-size: 14px; line-height: 1.6;
}
.chat-msg.user .chat-bubble { max-width: 78%; }

/* Assistant author row — quieter identity */
.msg-author { margin-bottom: 9px; }
.avatar-circle.agent-av { width: 24px; height: 24px; font-size: 11.5px; }
.msg-author-name { font-size: 12.5px; font-weight: 600; color: var(--ink); letter-spacing: 0.005em; }

/* Agent activity — understated tool-use disclosure, not a boxy debug panel */
.chat-activity { border: none; background: rgba(10, 13, 20, 0.028); border-radius: 10px; box-shadow: none; }
.chat-activity > summary { padding: 8px 12px; gap: 9px; }
.chat-activity > summary:hover { background: rgba(10, 13, 20, 0.02); border-radius: 10px; }
.chat-activity .trace-pill { background: transparent; color: var(--ink-60); padding: 0; letter-spacing: 0.06em; }
.chat-activity-sum { color: var(--ink-40); }
.chat-activity-body { padding: 2px 12px 8px; }
.agent-step { border-top-color: var(--border); }
.agent-activity-foot { border-top-color: var(--border); color: var(--ink-40); }

/* Composer — the signature rounded, elevated input box */
.chat-composer { border-top: none; background: transparent; padding: 10px 24px 20px; }
.asst-conv .chat-composer-row,
.asst-conv .chat-composer-hints,
.asst-conv .chat-attach-row { max-width: 720px; margin-left: auto; margin-right: auto; }
.chat-composer-row {
  align-items: flex-end; gap: 8px; background: var(--paper);
  border: 1px solid var(--border-strong); border-radius: 24px;
  padding: 9px 10px 9px 16px; box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.chat-composer-row:focus-within { border-color: var(--ink-40); box-shadow: var(--shadow-md); }
.chat-composer.streaming .chat-composer-row { border-color: var(--border); }
.chat-input {
  display: block; border: none; background: transparent; box-shadow: none;
  padding: 8px 2px; font-size: 15px; line-height: 1.55;
  min-height: 28px; max-height: 220px; resize: none;
}
.chat-input:focus { outline: none; border: none; box-shadow: none; }
.chat-attach-btn {
  border: none; background: transparent; color: var(--ink-40); width: 34px; height: 34px;
  border-radius: 10px; font-size: 16px; flex-shrink: 0;
}
.chat-attach-btn:hover { background: rgba(10, 13, 20, 0.05); color: var(--ink-60); }
.chat-send {
  height: 34px; min-width: 34px; padding: 0 14px; border-radius: 12px;
  font-size: 12.5px; font-weight: 600; flex-shrink: 0;
}
.chat-composer-hints { margin-top: 8px; }
.hint-keys { color: var(--ink-40); }

/* Header — calm app-header feel */
.asst-conv-head { padding: 18px 26px; }
.asst-conv-title { font-size: 18px; }
.conv-head-sub { font-size: 12px; color: var(--ink-60); margin-top: 4px; }

/* Thread list rows — quieter, denser, Claude-sidebar calm */
/* flex-shrink:0 — the list is a flex column; without this, many rows get squashed
   below content height and title/preview/meta overflow into the next row. */
.asst-thread { border-color: transparent; background: transparent; padding: 9px 11px; border-radius: 8px; flex-shrink: 0; min-height: 0; }
.asst-thread:hover { background: rgba(10, 13, 20, 0.04); }
.asst-thread.active { border-color: transparent; background: rgba(46, 213, 115, 0.1); }
.asst-thread-title { font-size: 13px; font-weight: 550; }
.asst-thread-preview { font-size: 11.5px; color: var(--ink-40); }
.asst-search { border-radius: 10px; padding: 9px 12px; background: rgba(10, 13, 20, 0.035); border-color: transparent; }
.asst-search:focus { background: var(--paper); border-color: var(--gold); }

/* Hero — inviting first-run */
.chat-hero { padding: 52px 8px 24px; gap: 14px; }
.chat-hero-title { font-size: 24px; letter-spacing: -0.01em; }
.chat-hero-sub { font-size: 14px; }
.chip-suggest {
  border-color: var(--border); background: rgba(10, 13, 20, 0.02);
  border-radius: 12px; font-size: 13px; padding: 9px 14px;
}
.chip-suggest:hover { border-color: var(--gold); background: var(--gold-soft); }

/* Drawer keeps edge-to-edge but inherits the calm reading styles */
#chatDrawer .chat-composer { padding: 10px 18px 18px; }
#chatDrawer .chat-msg.user .chat-bubble { max-width: 84%; }
