/* Intel Dashboard — cactus dark theme */
:root {
  --bg: #1d1f21;
  --panel: #282a2e;
  --panel-2: #373b41;
  --border: #373b41;
  --text: #c9cacc;
  --text-2: #969896;
  --text-3: #666;
  --text-4: #444;
  --accent: #2bbc8a;
  --accent-text: #2bbc8a;
  --fail: #cc6666;
  --warn: #f0c674;
  --score-low: #666;
  --score-mid: #f0c674;
  --score-high: #de935f;
  --score-top: #2bbc8a;
  --mono: "Menlo", "Monaco", "Consolas", monospace;
  --sans: -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
}

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

.app {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 20px;
}
.brand-logo {
  width: 26px; height: 26px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  font-family: var(--mono);
}
.brand-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.brand-env {
  font-size: 10px;
  color: var(--text-3);
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 16px 16px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
  border: none;
  background: none;
  text-align: left;
  transition: background 0.1s;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: rgba(43,188,138,0.08); color: var(--accent); }
.nav-icon { flex-shrink: 0; }
.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
.nav-dot {
  margin-left: auto;
  width: 6px; height: 6px;
  border-radius: 50%;
}
.nav-dot.running { background: var(--accent); animation: pulse 1.2s infinite; }
.nav-dot.warn { background: var(--warn); }

.sidebar-foot {
  margin-top: auto;
  padding: 0 12px;
}

.run-banner {
  background: var(--panel-2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.run-banner-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.run-progress {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.run-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s;
}
.run-banner-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-3);
  font-family: var(--mono);
}

.kbd {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--panel-2);
  padding: 0 4px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* ── Main ── */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
.crumbs {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}
.crumbs .sep { margin: 0 4px; }
.crumbs .here { color: var(--text); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--text-3);
}
.search-box input {
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  width: 180px;
  font-family: var(--sans);
}
.search-box input::placeholder { color: var(--text-3); }

.icon-btn {
  border: none;
  background: var(--panel-2);
  color: var(--text-2);
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:hover { background: var(--border); color: var(--text); }
.icon-btn.primary { background: var(--accent); color: var(--bg); }
.icon-btn.primary:hover { opacity: 0.85; }

.view {
  padding: 24px;
  flex: 1;
}

/* ── Section headers ── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.section-sub {
  font-size: 12px;
  color: var(--text-3);
}
.section-actions { display: flex; gap: 8px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
}
.btn:hover { border-color: var(--accent); }
.btn.sm { padding: 3px 8px; font-size: 11px; }

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.toolbar-spacer { flex: 1; }

.chip {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--sans);
}
.chip:hover { border-color: var(--text-2); }
.chip.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.chip .count {
  font-family: var(--mono);
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.7;
}
.divider-y {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.select {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--sans);
  outline: none;
}
.select option { background: var(--panel); }

/* ── Items ── */
.item-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.item-row:hover { background: rgba(255,255,255,0.02); }
.item-row.selected { background: rgba(43,188,138,0.06); }

.item-score {
  flex-shrink: 0;
  width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.item-body { flex: 1; min-width: 0; }
.item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.item-summary {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.item-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* ── Score ── */
.score-num {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-num .pct { font-size: 10px; font-weight: 400; }
.s-low { color: var(--score-low); }
.s-mid { color: var(--score-mid); }
.s-high { color: var(--score-high); }
.s-top { color: var(--score-top); }

.score-bar {
  position: relative;
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: visible;
  width: 100%;
}
.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s;
}
.score-bar-fill.s-low { background: var(--score-low); }
.score-bar-fill.s-mid { background: var(--score-mid); }
.score-bar-fill.s-high { background: var(--score-high); }
.score-bar-fill.s-top { background: var(--score-top); }
.score-bar-threshold {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 9px;
  background: var(--text-3);
}

/* ── Badges ── */
.badge {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--mono);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text-2);
}
.badge.dot::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge.solid-ok { background: rgba(43,188,138,0.12); color: var(--accent); }
.badge.solid-ok.dot::before { background: var(--accent); }
.badge.solid-warn { background: rgba(240,198,116,0.12); color: var(--warn); }
.badge.solid-warn.dot::before { background: var(--warn); }
.badge.solid-fail { background: rgba(204,102,102,0.12); color: var(--fail); }
.badge.solid-fail.dot::before { background: var(--fail); }
.badge.solid-accent { background: rgba(43,188,138,0.12); color: var(--accent); }
.badge.solid-accent.dot::before { background: var(--accent); }
.badge.solid-mute { background: var(--panel-2); color: var(--text-3); }
.badge.solid-mute.dot::before { background: var(--text-3); }

.tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  background: var(--panel-2);
  border-radius: 3px;
  color: var(--text-2);
}

.dot:not(.badge) {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot.good, .dot.ok { background: var(--accent); }
.dot.degraded, .dot.warn { background: var(--warn); }
.dot.disabled, .dot.fail, .dot.err { background: var(--fail); }
.dot.running { background: var(--accent); animation: pulse 1.2s infinite; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.dot-sep { color: var(--text-3); font-size: 10px; }

/* ── Confidence ── */
.confidence-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-2);
}
.conf-pips {
  display: inline-flex;
  gap: 2px;
}
.pip {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-3);
}
.confidence-chip.tentative .pip:nth-child(1) { background: var(--warn); }
.confidence-chip.firm .pip:nth-child(1),
.confidence-chip.firm .pip:nth-child(2) { background: var(--accent); }
.confidence-chip.confirmed .pip { background: var(--accent); }

/* ── Trend ── */
.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-family: var(--mono);
}
.trend-chip.emerging, .trend-chip.growing { color: var(--accent); }
.trend-chip.stable { color: var(--text-3); }
.trend-chip.declining { color: var(--fail); }

/* ── Source pill ── */
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-2);
}

.also-seen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent);
}
.also-seen-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Drawer ── */
.drawer-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: -560px; bottom: 0;
  width: 560px;
  max-width: 100vw;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 101;
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { right: 0; }

.drawer-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.drawer-body h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
}
.drawer-body h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: 20px 0 8px;
}

/* ── Card ── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Stage panels ── */
.stage-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.stage-panel.s2 { border-color: var(--accent); }
.stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.stage-num {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(43,188,138,0.1);
  padding: 2px 6px;
  border-radius: 3px;
}
.stage-title { font-size: 12px; color: var(--text-2); }
.stage-meta {
  margin-left: auto;
  display: flex;
  gap: 4px;
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}
.stage-body {
  padding: 14px;
}
.stage-body .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  margin-bottom: 4px;
  margin-top: 12px;
}
.stage-body .label:first-child { margin-top: 0; }
.stage-body p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 4px;
}

.stage-locked {
  padding: 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}
.lock-bar { max-width: 200px; margin: 12px auto 0; }

/* ── KV pairs ── */
.kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-3); }
.kv .v { color: var(--text); }
.kv .v.mono { font-family: var(--mono); font-size: 11px; }

/* ── Digest ── */
.digest-wrap { max-width: 720px; }
.digest-hero { margin-bottom: 32px; }
.digest-date {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
  font-family: var(--mono);
}
.digest-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.digest-overview {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 20px;
}
.digest-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.digest-stat .l {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.digest-stat .v {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.digest-cat {
  margin-bottom: 24px;
}
.digest-cat-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.digest-cat-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.digest-cat-count {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}

.digest-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  gap: 12px;
}
.digest-item:last-child { border-bottom: none; }
.digest-item:hover { background: rgba(255,255,255,0.02); }
.digest-item-rank {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
  width: 24px;
}
.digest-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.digest-item-summary {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  line-height: 1.5;
}
.digest-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  flex-wrap: wrap;
}

/* ── Runs ── */
.runs-grid { display: flex; flex-direction: column; gap: 16px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-delta {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
  margin-top: 4px;
}
.stat-delta.up { color: var(--accent); }
.stat-delta.down { color: var(--fail); }

.run-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.run-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.run-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

.run-bar {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
}
.run-bar .step {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  border-radius: 4px;
  background: var(--panel-2);
}
.step .step-name {
  display: block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 2px;
}
.step .step-val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}
.step.ok { background: rgba(43,188,138,0.06); }
.step.ok .step-name { color: var(--accent); }
.step.warn { background: rgba(240,198,116,0.08); }
.step.warn .step-name { color: var(--warn); }
.step.fail { background: rgba(204,102,102,0.08); }
.step.fail .step-name { color: var(--fail); }
.step.running { background: rgba(43,188,138,0.1); }
.step.running .step-name { color: var(--accent); }

.run-sources-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.run-source-row {
  display: grid;
  grid-template-columns: 8px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}
.run-source-row:hover { background: var(--panel-2); }
.src-name { color: var(--text); }
.src-items { color: var(--text-3); font-family: var(--mono); font-size: 11px; }
.src-dur { color: var(--text-3); font-family: var(--mono); font-size: 11px; }

/* ── Sources ── */
.src-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.src-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.src-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.src-table tr:hover td { background: rgba(255,255,255,0.02); }
.src-id {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Sparkline ── */
.spark {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 20px;
}
.sp-bar {
  width: 4px;
  background: var(--accent);
  border-radius: 1px;
  min-height: 2px;
}
.sp-bar.fail { background: var(--fail); }

/* ── Stats ── */
.stats-wrap { display: flex; flex-direction: column; gap: 16px; }
.stats-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stats-row-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

.hist {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
  padding: 0;
  position: relative;
}
.hist-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}
.hist-bar.b-low { background: var(--score-low); }
.hist-bar.b-mid { background: var(--score-mid); }
.hist-bar.b-high { background: var(--score-high); }
.hist-bar.b-top { background: var(--score-top); }
.hist-threshold {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--fail);
  opacity: 0.4;
}
.hist-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-3);
  font-family: var(--mono);
}

.matrix {
  display: grid;
  grid-template-columns: auto repeat(5, 1fr);
  gap: 2px;
  font-size: 11px;
  font-family: var(--mono);
}
.mh {
  padding: 4px 6px;
  color: var(--text-3);
  text-align: center;
  font-weight: 500;
}
.mh.row { text-align: right; color: var(--text-2); }
.mc {
  padding: 4px;
  text-align: center;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}

.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-row {
  display: grid;
  grid-template-columns: 100px 1fr 30px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.cat-name { color: var(--text-2); }
.cat-bar {
  height: 6px;
  background: var(--panel-2);
  border-radius: 99px;
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.3s;
}
.cat-bar-fill.security { background: var(--fail); }
.cat-bar-fill.ai { background: var(--accent); }
.cat-count {
  text-align: right;
  font-family: var(--mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.timeline {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 50px;
}
.timeline-bar {
  flex: 1;
  display: flex;
  align-items: flex-end;
}
.tb-stack {
  width: 100%;
  background: var(--text-2);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}
.tb-stack.s1 { background: var(--accent); }

.empty {
  padding: 40px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}

/* ── Loading ── */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--text-3);
  gap: 12px;
}
.loading-spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-wrap {
  padding: 40px;
  text-align: center;
  color: var(--fail);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .stats-row-2, .stats-row-3 { grid-template-columns: 1fr; }
  .drawer { width: 100vw; }
}
