:root {
  --bg: #070b14;
  --bg-elev: #0d1422;
  --surface: rgba(14, 21, 36, 0.86);
  --surface-solid: #101829;
  --surface-hover: rgba(23, 34, 56, 0.92);
  --subtle: rgba(148, 163, 184, 0.08);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;

  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.13);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --rose: #fb7185;
  --rose-soft: rgba(244, 63, 94, 0.14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 8px 24px -14px rgba(0, 0, 0, 0.5);

  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-elev: #ffffff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-hover: #f8fafc;
  --subtle: rgba(15, 23, 42, 0.045);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.22);

  --text: #0f172a;
  --text-soft: #334155;
  --text-muted: #64748b;

  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.1);
  --cyan: #0891b2;
  --cyan-soft: rgba(8, 145, 178, 0.1);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.11);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.1);
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, 0.1);

  --shadow-lg: 0 24px 55px -24px rgba(15, 23, 42, 0.18);
  --shadow-sm: 0 8px 24px -16px rgba(15, 23, 42, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.drawer-open { overflow: hidden; }

/* Atmosphere */
.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
  opacity: 0.025;
  background-image: radial-gradient(var(--text) 0.5px, transparent 0.5px);
  background-size: 6px 6px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 45% at 50% 0%, black 25%, transparent 100%);
  opacity: 0.38;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.2;
}
[data-theme="light"] .bg-glow { opacity: 0.12; }

.bg-glow-1 {
  width: 520px;
  height: 520px;
  top: -210px;
  left: -130px;
  background: radial-gradient(circle, #10b981, transparent 70%);
}

.bg-glow-2 {
  width: 460px;
  height: 460px;
  top: -60px;
  right: -140px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
}

.container {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

/* Header & Persistent View Switcher */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--emerald-soft);
  border: 1px solid color-mix(in srgb, var(--emerald) 35%, transparent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.search-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--subtle);
  border: 1px solid var(--border);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.view-nav-bar {
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.view-nav-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px 0;
}

.view-nav-scroll::-webkit-scrollbar { display: none; }

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.view-tab:hover {
  color: var(--text);
  background: var(--subtle);
}

.view-tab.active {
  color: var(--text);
  background: var(--emerald-soft);
  border-color: color-mix(in srgb, var(--emerald) 40%, transparent);
  font-weight: 600;
}

.tab-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--subtle);
  color: var(--text-muted);
}

.view-tab.active .tab-badge {
  background: color-mix(in srgb, var(--emerald) 22%, transparent);
  color: var(--emerald);
}

/* Main shell */
.main-shell {
  flex: 1;
  padding: 28px 0 56px;
}

.view-panel {
  animation: viewIn 0.22s ease;
}

.view-panel[hidden] { display: none; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: 20px; }

/* Masthead */
.masthead {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
  align-items: end;
  padding-bottom: 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.meta-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--emerald) 25%, transparent);
}

.masthead h1,
.view-header h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.4vw, 2.45rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(115deg, #34d399 0%, #22d3ee 65%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="light"] .gradient-text {
  background: linear-gradient(115deg, #059669 0%, #0284c7 65%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.lead {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
  max-width: 62ch;
}

.view-header {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

/* Compact KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kpi-cell {
  padding: 12px 13px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.kpi-val {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.kpi-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Blocks */
.block { margin-bottom: 30px; }
.block-tight { margin-bottom: 24px; }

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.block-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.block-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  width: fit-content;
}

.pill-emerald { background: var(--emerald-soft); color: var(--emerald); }
.pill-cyan { background: var(--cyan-soft); color: var(--cyan); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-rose { background: var(--rose-soft); color: var(--rose); }
.pill-violet { background: var(--violet-soft); color: var(--violet); }
.pill-neutral { background: var(--subtle); color: var(--text-muted); border: 1px solid var(--border); }

/* 5 Findings (compact clickable cards) */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.finding-card {
  text-align: left;
  font: inherit;
  color: var(--text);
  padding: 15px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.finding-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.finding-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.25;
}

.finding-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.card-more {
  margin-top: auto;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--emerald);
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.chart-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-wide { grid-column: 1 / -1; }

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-head h3 {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 1rem;
}

.chart-head p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chart-host {
  width: 100%;
  overflow-x: auto;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-bar-hit {
  cursor: pointer;
  transition: opacity 0.14s ease;
}

.chart-bar-hit:hover { opacity: 0.82; }

.text-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--cyan);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.text-link:hover { text-decoration: underline; }

/* Two column layout */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* Rank & Geography */
.rank-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.rank-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
}

.rank-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.rank-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--subtle);
  overflow: hidden;
}

.rank-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
}

.rank-val {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-soft);
}

.regions-bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.region-item {
  display: grid;
  gap: 3px;
}

.region-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
}

.region-states {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ddd-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ddd-details summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
  cursor: pointer;
  user-select: none;
}

.ddd-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.ddd-chip {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--subtle);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.ddd-chip.hot {
  background: var(--violet-soft);
  border-color: color-mix(in srgb, var(--violet) 40%, transparent);
  color: var(--violet);
  font-weight: 600;
}

/* Toolbars & Inputs */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}

.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-pill.active {
  background: var(--emerald-soft);
  border-color: color-mix(in srgb, var(--emerald) 50%, transparent);
  color: var(--emerald);
  font-weight: 600;
}

.text-input,
.select-input {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.83rem;
  outline: none;
}

.text-input { width: min(250px, 100%); }
.text-input:focus, .select-input:focus { border-color: var(--emerald); }

.btn-subtle {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-subtle:hover { border-color: var(--border-strong); color: var(--text); }

/* Tech Radar Compact Scannable Table */
.radar-table-wrap { overflow: hidden; }

.radar-head {
  display: grid;
  grid-template-columns: 220px 1fr 125px 96px;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.align-right { text-align: right; }

.radar-list {
  display: grid;
}

.radar-row {
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 220px 1fr 125px 96px;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: background 0.14s ease;
}

.radar-row:last-child { border-bottom: 0; }
.radar-row:hover { background: var(--surface-hover); }

.radar-name strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.94rem;
  line-height: 1.2;
}

.radar-name span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.radar-tldr {
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.4;
}

.radar-mentions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.radar-mentions span {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-soft);
}

.mini-track {
  width: 68px;
  height: 4px;
  border-radius: 999px;
  background: var(--subtle);
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
}

/* Playbooks Strip */
.playbooks-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.playbook-tile {
  text-align: left;
  font: inherit;
  color: var(--text);
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.playbook-tile:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
}

.playbook-tile h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.25;
}

.playbook-tile p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* FAQ Collapsed with TL;DR */
.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item.open {
  border-color: color-mix(in srgb, var(--emerald) 45%, var(--border));
}

.faq-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 14px 18px;
  color: var(--text);
  font: inherit;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.faq-trigger:hover { background: var(--subtle); }

.faq-q-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-q {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

.faq-tldr {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.faq-chevron {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--subtle);
  color: var(--text-muted);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.faq-body {
  display: none;
  padding: 0 18px 16px;
  border-top: 1px solid var(--border);
}

.faq-item.open .faq-body { display: block; }

.faq-answer {
  margin: 12px 0 10px;
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.faq-credits {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* Stack & Directory */
.stack-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stack-tab {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.stack-tab.active {
  background: var(--emerald-soft);
  border-color: color-mix(in srgb, var(--emerald) 50%, transparent);
  color: var(--emerald);
}

.stack-panel { display: none; }
.stack-panel.active { display: block; }

.stack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mono-muted {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.compact-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--subtle);
  font-size: 0.83rem;
}

.compact-list strong { color: var(--text); white-space: nowrap; }
.compact-list span { color: var(--text-muted); text-align: right; font-size: 0.8rem; }

.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}

.dir-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.14s ease, transform 0.14s ease;
}

.dir-card:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
}

.dir-card h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.94rem;
}

.dir-card p {
  margin: 0;
  font-size: 0.81rem;
  color: var(--text-muted);
}

.dir-host {
  margin-top: auto;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--cyan);
}

.notice-bar {
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  color: var(--text-soft);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

/* Projects Compact Cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 12px;
}

.project-card {
  text-align: left;
  font: inherit;
  color: var(--text);
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.project-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--emerald-soft);
  border: 1px solid color-mix(in srgb, var(--emerald) 32%, transparent);
  color: var(--emerald);
  flex-shrink: 0;
}

.project-person strong { display: block; font-size: 0.88rem; line-height: 1.2; }
.project-person span { font-size: 0.74rem; color: var(--text-muted); }

.project-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.96rem;
  line-height: 1.28;
}

.project-tldr {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.42;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--subtle);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

/* Slide-Over Detail Drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  justify-content: flex-end;
}

.drawer[hidden] { display: none; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(5px);
}

.drawer-sheet {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  height: 100%;
  background: var(--surface-solid);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.2s ease;
}

@keyframes drawerIn {
  from { transform: translateX(28px); opacity: 0.7; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.drawer-nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--subtle);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
}

.icon-btn-sm:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.icon-btn-sm:disabled { opacity: 0.35; cursor: not-allowed; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.38rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.drawer-summary {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.pc-box {
  padding: 14px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

.pc-pros {
  background: color-mix(in srgb, var(--emerald-soft) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--emerald) 26%, transparent);
}

.pc-cons {
  background: color-mix(in srgb, var(--rose-soft) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--rose) 26%, transparent);
}

.pc-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.pc-pros .pc-title { color: var(--emerald); }
.pc-cons .pc-title { color: var(--rose); }

.pc-box ul {
  margin: 0;
  padding-left: 17px;
  display: grid;
  gap: 7px;
  color: var(--text-soft);
}

.verdict-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  font-size: 0.87rem;
  color: var(--text-soft);
}

.verdict-box strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 4px;
}

.step-card {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--subtle);
  border: 1px solid var(--border);
}

.step-card strong {
  display: block;
  font-size: 0.86rem;
  color: var(--emerald);
  margin-bottom: 4px;
}

.step-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.drawer-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 15px;
  border-radius: 10px;
  background: var(--emerald-soft);
  border: 1px solid color-mix(in srgb, var(--emerald) 45%, transparent);
  color: var(--emerald);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  width: fit-content;
}

/* Search Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding-top: min(11vh, 88px);
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(6px);
}

.modal-box {
  position: relative;
  width: min(620px, calc(100% - 24px));
  border-radius: 16px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.modal-input-row input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  outline: none;
}

.kbd-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--subtle);
  color: var(--text-muted);
  cursor: pointer;
}

.modal-results {
  max-height: min(58vh, 410px);
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 4px;
}

.search-result {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.search-result:hover {
  background: var(--subtle);
  border-color: var(--border);
}

.search-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.search-result strong { font-size: 0.89rem; }
.search-result p {
  margin: 0;
  font-size: 0.79rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Floating Chart Tooltip */
.chart-tooltip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 0.78rem;
  color: var(--text);
  max-width: 260px;
}

.chart-tooltip strong { display: block; font-family: var(--font-display); }
.chart-tooltip span { color: var(--text-muted); }

.empty-state {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 28px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
}

.footer-links a:hover { color: var(--emerald); }

/* Responsive */
@media (max-width: 1024px) {
  .masthead { grid-template-columns: 1fr; }
  .findings-grid { grid-template-columns: repeat(2, 1fr); }
  .playbooks-strip { grid-template-columns: 1fr; }
  .radar-head, .radar-row { grid-template-columns: 180px 1fr 110px 80px; }
}

@media (max-width: 760px) {
  .charts-grid, .two-col { grid-template-columns: 1fr; }
  .findings-grid { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .radar-head { display: none; }
  .radar-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 10px;
    padding: 14px;
  }
  .radar-tldr { grid-column: 1 / -1; }
  .radar-mentions { align-items: flex-start; }
  .compact-list li { flex-direction: column; gap: 2px; }
  .compact-list span { text-align: left; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .drawer { align-items: flex-end; }
  .drawer-sheet {
    width: 100%;
    height: min(86vh, 680px);
    border-left: 0;
    border-top: 1px solid var(--border-strong);
    border-radius: 18px 18px 0 0;
  }
}
