@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #16161a;
  --ink-2: #3a3a42;
  --muted: #85858f;
  --line: #ececea;
  --line-2: #e2e2df;
  --accent: #0f4d3a;
  --accent-soft: #e8efe9;
  --warm: #d97757;
  --warm-soft: #f7ece6;
  --gold: #b08545;
  --critical: #9b2a2a;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(20,20,30,.03);
  --shadow-panel: 0 1px 2px rgba(20,20,30,.04), 0 0 0 1px var(--line-2);
  --shadow-deep: 0 14px 40px -20px rgba(20,20,30,.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Geist', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Shell ── */
.shell { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; }
.main { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.content { padding: 24px 36px 48px; }

/* ── Sidebar ── */
.sidebar {
  width: 240px; background: transparent; padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; flex-shrink: 0;
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #f7f6f3;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; letter-spacing: -.02em;
}
.brand-name { font-family: 'Instrument Serif', serif; font-size: 22px; letter-spacing: -.01em; line-height: 1; }
.brand-name em { font-style: italic; color: var(--accent); }
.brand-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; letter-spacing: .02em; }

.nav-section { margin-top: 8px; }
.nav-label {
  font-size: 10.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .08em; padding: 14px 10px 8px; font-weight: 500;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px;
  border-radius: var(--radius-sm); color: var(--ink-2); font-size: 13px;
  font-weight: 500; cursor: pointer; margin-bottom: 1px; position: relative;
  transition: background var(--dur-fast) ease;
}
.nav-item:hover { background: rgba(0,0,0,.03); }
.nav-item.active {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-panel);
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .75; }
.nav-item.active svg { opacity: 1; color: var(--accent); }
.nav-item .b {
  margin-left: auto; font-family: 'Geist Mono'; font-size: 10.5px;
  color: var(--muted); background: rgba(0,0,0,.04); padding: 1px 6px; border-radius: 5px;
}
.nav-item.disabled {
  opacity: .45; cursor: not-allowed;
}
.nav-item.disabled:hover { background: rgba(0,0,0,.02); }

/* Side card */
.side-card {
  margin-top: auto; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); padding: 14px; position: relative; overflow: hidden;
}
.side-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(15,77,58,.06), transparent 50%);
  pointer-events: none;
}
.side-card-title {
  font-size: 12px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.side-card-body { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.side-user {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #0f4d3a, #1a6b53);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600;
}
.uname { font-size: 12.5px; font-weight: 600; }
.urole { font-size: 10.5px; color: var(--muted); }
.logout-btn {
  cursor: pointer; opacity: .5; transition: opacity var(--dur-fast) ease;
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
}
.logout-btn:hover { opacity: 1; background: rgba(0,0,0,.04); }

/* ── Topbar ── */
.topbar {
  padding: 20px 36px 0; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 10; background: var(--bg);
}
.crumbs { font-size: 12px; color: var(--muted); font-family: 'Geist Mono'; }
.crumbs .sep { margin: 0 6px; opacity: .5; }
.crumbs strong { color: var(--ink); font-weight: 500; }
.top-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Buttons */
.pill-btn {
  height: 34px; padding: 0 12px; border-radius: var(--radius-md);
  border: 1px solid var(--line-2); background: var(--surface);
  font-size: 12.5px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; font-family: inherit;
  transition: background var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.pill-btn:hover { background: #fafaf8; }
.pill-btn svg { width: 14px; height: 14px; }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { background: #2a2a32; }
.icon-tool {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  border: 1px solid var(--line-2); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); cursor: pointer; position: relative;
  transition: background var(--dur-fast) ease;
}
.icon-tool:hover { background: #fafaf8; }
.dot {
  position: absolute; top: 7px; right: 7px; width: 7px; height: 7px;
  background: var(--warm); border-radius: 50%; border: 2px solid var(--surface);
  animation: pulse-dot 2s infinite;
}

/* ── Hero ── */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-bottom: 24px; }
.hero-left { padding: 6px 4px 0; }
.eyebrow {
  font-family: 'Geist Mono'; font-size: 11px; color: var(--accent);
  text-transform: uppercase; letter-spacing: .12em;
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse-dot 2s infinite;
}
h1.hero-title {
  font-family: 'Instrument Serif', serif; font-size: 44px; line-height: 1.05;
  letter-spacing: -.015em; font-weight: 400; color: var(--ink);
}
h1.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub {
  font-size: 14px; color: var(--ink-2); margin-top: 14px;
  max-width: 520px; line-height: 1.55;
}
.hero-meta {
  display: flex; gap: 18px; margin-top: 22px;
  font-size: 11.5px; color: var(--muted); font-family: 'Geist Mono';
}
.hero-meta span b { color: var(--ink); font-weight: 500; }

/* Hero right card */
.hero-right {
  background: linear-gradient(160deg, #fff 0%, #fbf9f4 100%);
  border: 1px solid var(--line-2); border-radius: var(--radius-2xl);
  padding: 24px 26px; position: relative; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, var(--shadow-deep);
}
.hero-right::before {
  content: ""; position: absolute; top: -60px; right: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(176,133,69,.12), transparent 70%);
}
.hero-r-label {
  font-family: 'Geist Mono'; font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em;
}
.hero-r-row { display: flex; align-items: flex-end; gap: 14px; margin-top: 6px; }
.hero-r-value {
  font-family: 'Instrument Serif', serif; font-size: 54px;
  line-height: 1; letter-spacing: -.02em; color: var(--ink);
}
.hero-r-delta {
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 600; font-family: 'Geist Mono'; margin-bottom: 8px;
}
.hero-r-cap { font-size: 12px; color: var(--muted); margin-top: 8px; }
.hero-r-bar {
  margin-top: 18px; height: 8px; background: rgba(0,0,0,.05);
  border-radius: var(--radius-pill); overflow: hidden; position: relative;
}
.hero-r-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), #1a6b53);
  border-radius: var(--radius-pill); max-width: 100%;
}
.hero-r-bar-marker {
  position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink);
}
.hero-r-foot {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-family: 'Geist Mono'; font-size: 10.5px; color: var(--muted);
}
.hero-r-foot b { color: var(--ink); font-weight: 500; }
.hero-r-bottom {
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; font-size: 12px;
}
.hero-r-bottom-label {
  font-family: 'Geist Mono'; font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.hero-r-bottom-value {
  font-family: 'Instrument Serif', serif; font-size: 22px; margin-top: 4px;
}

/* ── Metric strip ── */
.strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-xl); overflow: hidden; margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.metric {
  padding: 22px 24px; border-right: 1px solid var(--line); position: relative;
  transition: background var(--dur-fast) ease;
}
.metric:last-child { border-right: none; }
.metric:hover { background: #fefefe; }
.metric-label {
  font-family: 'Geist Mono'; font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.metric-value {
  font-family: 'Instrument Serif', serif; font-size: 38px;
  line-height: 1.05; letter-spacing: -.015em; margin-top: 10px; color: var(--ink);
}
.metric-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: 11.5px; color: var(--muted); font-family: 'Geist Mono';
}
.trend {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--accent); font-weight: 500;
}
.trend.warn { color: var(--warm); }
.trend.neutral { color: var(--muted); }
.metric-spark {
  position: absolute; right: 18px; bottom: 18px;
  width: 90px; height: 36px; opacity: .85;
}

/* ── Section heading ── */
.sect-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 6px 0 14px;
}
.sect-title {
  font-family: 'Instrument Serif', serif; font-size: 24px;
  letter-spacing: -.01em; color: var(--ink);
}
.sect-title em { font-style: italic; color: var(--accent); }
.sect-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ── Segment control ── */
.seg {
  display: inline-flex; background: rgba(0,0,0,.04);
  border-radius: var(--radius-md); padding: 3px;
}
.seg div {
  padding: 5px 11px; border-radius: 7px; font-size: 12px;
  color: var(--ink-2); cursor: pointer; font-family: 'Geist Mono';
  transition: all var(--dur-fast) ease;
}
.seg div.active {
  background: var(--surface); box-shadow: 0 1px 2px rgba(20,20,30,.06);
  color: var(--ink); font-weight: 500;
}
.seg div:hover:not(.active) { background: rgba(0,0,0,.03); }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 22px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 24px; }

/* ── Panel ── */
.panel {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-xl); padding: 22px 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-normal) var(--ease-out);
}
.panel:hover { box-shadow: 0 4px 16px rgba(20,20,30,.06); }
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 18px;
}
.panel-title {
  font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -.005em;
}
.panel-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ── Legend ── */
.legend {
  display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-2);
  font-family: 'Geist Mono';
}
.legend .sw, .sw {
  width: 8px; height: 8px; border-radius: 3px; display: inline-block;
  margin-right: 6px; vertical-align: middle;
}

/* ── Donut / Risk ── */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.risk-list { flex: 1; }
.risk-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.risk-row:last-child { border: none; }
.risk-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.risk-name { font-size: 13px; font-weight: 500; flex: 1; }
.risk-count { font-family: 'Geist Mono'; font-size: 12.5px; color: var(--ink); }
.risk-pct { font-family: 'Geist Mono'; font-size: 10.5px; color: var(--muted); margin-left: 6px; }

/* ── Campaign list ── */
.camp {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-fast) ease;
}
.camp:last-child { border: none; }
.camp:hover { background: rgba(0,0,0,.01); }
.camp-ic {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.camp-ic.warm { background: var(--warm-soft); color: var(--warm); }
.camp-ic.gold { background: #f5ecdc; color: var(--gold); }
.camp-ic.ink { background: #ececea; color: var(--ink); }
.camp-info { flex: 1; }
.camp-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.camp-meta {
  font-size: 11.5px; color: var(--muted); font-family: 'Geist Mono'; margin-top: 2px;
}
.camp-rate { text-align: right; min-width: 120px; }
.camp-rate-val {
  font-family: 'Instrument Serif', serif; font-size: 22px; letter-spacing: -.01em;
}
.camp-rate-cap {
  font-family: 'Geist Mono'; font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.camp-bar {
  width: 130px; height: 5px; background: rgba(0,0,0,.05);
  border-radius: var(--radius-pill); margin-top: 8px; overflow: hidden;
}
.camp-bar-fill {
  height: 100%; background: var(--accent); border-radius: var(--radius-pill);
}

/* ── Insight card ── */
.insight {
  padding: 20px 22px; border-radius: var(--radius-xl);
  background: linear-gradient(160deg, #15302a 0%, #0f4d3a 100%);
  color: #eef2ee; position: relative; overflow: hidden;
}
.insight::before {
  content: ""; position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%);
}
.insight-eye {
  font-family: 'Geist Mono'; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .12em; opacity: .7;
}
.insight-title {
  font-family: 'Instrument Serif', serif; font-size: 22px; line-height: 1.2;
  margin-top: 10px; letter-spacing: -.01em;
}
.insight-body {
  font-size: 12.5px; opacity: .85; margin-top: 10px; line-height: 1.55; max-width: 90%;
}
.insight-cta {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.12); font-size: 12px; font-weight: 500;
  backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.15);
  cursor: pointer; transition: background var(--dur-fast) ease;
}
.insight-cta:hover { background: rgba(255,255,255,.2); }

/* ── Feed ── */
.feed-item {
  display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line);
}
.feed-item:last-child { border: none; }
.feed-ic {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 13px;
}
.feed-ic.warm { background: var(--warm-soft); color: var(--warm); }
.feed-ic.gold { background: #f5ecdc; color: var(--gold); }
.feed-title { font-size: 13px; font-weight: 500; }
.feed-meta { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: 'Geist Mono'; }

/* ── Cohort table ── */
.cohort-table { width: 100%; border-collapse: separate; border-spacing: 6px; }
.cohort-th {
  font-family: 'Geist Mono'; font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 500;
  padding: 10px 14px; text-align: center;
}
.cohort-label {
  text-align: left; padding: 10px 14px; font-weight: 500;
}
.cohort-cell {
  border-radius: var(--radius-sm); padding: 10px; text-align: center;
  font-family: 'Geist Mono'; font-size: 12.5px;
  transition: transform var(--dur-fast) ease;
}
.cohort-cell:hover { transform: scale(1.04); }

/* ── Footer ── */
footer {
  padding: 28px 36px; display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); font-family: 'Geist Mono';
  border-top: 1px solid var(--line); margin-top: auto;
}

/* ── Dropdown ── */
.dropdown { position: relative; display: inline-flex; }
.dropdown-trigger { position: relative; }
.dropdown-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-right: 4px;
}
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 180px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-md); padding: 4px;
  box-shadow: 0 8px 24px rgba(20,20,30,.1);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: all var(--dur-fast) var(--ease-out);
  z-index: 100;
}
.dropdown-menu.open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-item {
  padding: 8px 12px; border-radius: 6px; font-size: 12.5px;
  cursor: pointer; transition: background var(--dur-fast) ease;
}
.dropdown-item:hover { background: rgba(0,0,0,.04); }
.dropdown-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ── Toast ── */
.toast {
  padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; min-width: 200px;
  box-shadow: 0 8px 24px rgba(20,20,30,.12);
  transform: translateX(100%); opacity: 0;
  transition: all var(--dur-normal) var(--ease-out);
}
.toast-visible { transform: translateX(0); opacity: 1; }
.toast-exit { transform: translateX(100%); opacity: 0; }
.toast-info { background: var(--ink); color: #fff; }
.toast-success { background: var(--accent); color: #fff; }
.toast-warning { background: var(--warm); color: #fff; }

/* ── Login ── */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg); width: 1440px; margin: 0 auto;
}
.login-container {
  width: 480px; text-align: center;
}
.login-brand {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 40px;
}
.login-title {
  font-family: 'Instrument Serif', serif; font-size: 22px; font-weight: 400;
  color: var(--ink); margin-bottom: 32px;
}
.login-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.login-card {
  display: flex; align-items: center; gap: 16px; padding: 20px 24px;
  background: var(--surface); border: 2px solid var(--line-2);
  border-radius: var(--radius-xl); cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
}
.login-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(15,77,58,.08); }
.login-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.login-card-info { text-align: left; }
.login-card-name { font-size: 16px; font-weight: 600; }
.login-card-role { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.login-card-badge {
  display: inline-block; margin-top: 6px; padding: 2px 10px;
  border-radius: var(--radius-pill); background: var(--accent-soft);
  color: var(--accent); font-size: 11px; font-weight: 500; font-family: 'Geist Mono';
}
.login-form { margin-top: 8px; }
.login-input-group { text-align: left; margin-bottom: 16px; }
.login-input-group label {
  display: block; font-size: 12px; font-weight: 500; color: var(--ink-2);
  margin-bottom: 6px;
}
.login-input-group input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit;
  background: var(--surface); color: var(--ink);
}
.login-submit {
  width: 100%; padding: 12px; border: none; border-radius: var(--radius-md);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background var(--dur-fast) ease;
}
.login-submit:hover { background: #2a2a32; }
.login-footer {
  margin-top: 40px; font-size: 11px; color: var(--muted); font-family: 'Geist Mono';
}

/* ── Screen header ── */
.screen-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
}
.screen-title {
  font-family: 'Instrument Serif', serif; font-size: 36px;
  line-height: 1.1; font-weight: 400; letter-spacing: -.01em;
}
.screen-title em { font-style: italic; color: var(--accent); }
.screen-sub {
  font-size: 13.5px; color: var(--muted); margin-top: 6px; max-width: 480px;
}
.screen-controls { display: flex; gap: 8px; align-items: center; }

/* ── Hero metrics (3-col) ── */
.hero-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px;
}
.hero-metric-card {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-xl); padding: 20px 22px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-normal) var(--ease-out);
}
.hero-metric-card:hover { box-shadow: 0 4px 16px rgba(20,20,30,.06); }

/* ── Data table ── */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table thead th {
  padding: 14px 16px; font-family: 'Geist Mono'; font-size: 10.5px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  font-weight: 500; text-align: center; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 16px; text-align: center; border-bottom: 1px solid var(--line);
  font-family: 'Geist Mono'; font-size: 12.5px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--dur-fast) ease; }
.data-table tbody tr:hover { background: rgba(0,0,0,.015); }

.sortable {
  cursor: pointer; user-select: none;
  transition: background var(--dur-fast) ease;
}
.sortable:hover { background: rgba(0,0,0,.03); }
.sort-icon { font-size: 11px; margin-left: 4px; opacity: .4; }
.sort-icon.active { opacity: 1; color: var(--accent); }

/* ── Campaign detail cards ── */
.campaign-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.campaign-detail-card { padding: 18px 20px; }
.detail-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-label {
  font-family: 'Geist Mono'; font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; display: block;
}
.detail-value {
  font-family: 'Instrument Serif', serif; font-size: 18px; display: block;
  margin-top: 2px;
}

/* ── Stacked bar ── */
.stacked-bar-wrap { margin-top: 8px; }
.stacked-bar-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px;
}
.stacked-bar-item {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
}
.stacked-bar-label { color: var(--ink-2); font-weight: 500; }
.stacked-bar-value { font-family: 'Geist Mono'; font-size: 12px; color: var(--ink); }
.stacked-bar-pct { font-family: 'Geist Mono'; font-size: 10.5px; color: var(--muted); }

/* ── Waterfall ── */
.waterfall { display: flex; flex-direction: column; gap: 12px; }
.waterfall-row { display: flex; align-items: center; gap: 12px; }
.waterfall-label {
  width: 140px; font-size: 12px; font-weight: 500;
  color: var(--ink-2); flex-shrink: 0;
}
.waterfall-bar-wrap {
  flex: 1; height: 28px; background: rgba(0,0,0,.03);
  border-radius: 6px; overflow: hidden;
}
.waterfall-bar {
  height: 100%; border-radius: 6px;
  transition: width var(--dur-slow) var(--ease-out);
}
.waterfall-value {
  width: 90px; text-align: right; font-family: 'Geist Mono';
  font-size: 12.5px; font-weight: 500; flex-shrink: 0;
}

/* ── Lift comparison ── */
.lift-comparison {
  display: flex; align-items: center; gap: 16px; margin-top: 8px;
}
.lift-group { flex: 1; text-align: center; }
.lift-label {
  font-family: 'Geist Mono'; font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.lift-value {
  font-family: 'Instrument Serif', serif; font-size: 28px; margin-top: 6px;
}
.lift-sub { font-size: 11px; color: var(--muted); }
.lift-rate {
  font-family: 'Geist Mono'; font-size: 12px; font-weight: 500;
  margin-top: 10px; color: var(--ink);
}
.lift-bar {
  height: 6px; background: rgba(0,0,0,.05); border-radius: var(--radius-pill);
  margin-top: 6px; overflow: hidden;
}
.lift-bar-fill { height: 100%; border-radius: var(--radius-pill); }
.lift-vs {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0 8px;
}
.lift-delta {
  font-family: 'Instrument Serif', serif; font-size: 24px;
  color: var(--accent); font-weight: 400;
}
.lift-delta-label {
  font-family: 'Geist Mono'; font-size: 9px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.attribution-badge {
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 500; font-family: 'Geist Mono';
}

/* ── Cost breakdown ── */
.cost-breakdown {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.cost-card { flex: 1; text-align: center; padding: 20px 16px; }
.cost-card-header {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; font-family: 'Geist Mono';
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px;
}
.cost-card-value {
  font-family: 'Instrument Serif', serif; font-size: 32px;
  letter-spacing: -.01em;
}
.cost-card-desc {
  font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.5;
}
.cost-card-minus, .cost-card-equals {
  font-family: 'Instrument Serif', serif; font-size: 28px;
  color: var(--muted); flex-shrink: 0;
}

/* ── Empty state ── */
.empty-state {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: var(--muted); font-size: 13px;
  font-family: 'Geist Mono';
}

/* ── Not found ── */
.not-found {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; text-align: center;
}
.not-found h2 {
  font-family: 'Instrument Serif', serif; font-size: 48px; font-weight: 400;
  margin-bottom: 12px;
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,87,.3); }
  50% { box-shadow: 0 0 0 4px rgba(217,119,87,0); }
}

.fade-in {
  opacity: 0; transform: translateY(8px);
  animation: fadeIn var(--dur-slow) var(--ease-out) forwards;
}
.stagger-1 { animation-delay: 60ms; }
.stagger-2 { animation-delay: 120ms; }
.stagger-3 { animation-delay: 180ms; }
.stagger-4 { animation-delay: 240ms; }
.stagger-5 { animation-delay: 300ms; }
.stagger-6 { animation-delay: 360ms; }

/* Chart line draw-in */
.chart-line {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawLine 1.2s var(--ease-out) forwards;
  animation-delay: 200ms;
}
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}
