/* ==========================================================================
   AIAgentBriefs — PRISM STUDIO x ORBITAL NODES Production Stylesheet
   Vibrant Neo-Brutalist Modular Light + Obsidian IDE Consoles + Animated Nodes
   100% PC & Mobile Responsive (@container + WCAG 2.2 + Optional Dark Theme)
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-elev: #f5f6fa;
  --bg-card: #ffffff;
  --bg-card-hover: #fbfcfe;
  --bg-input: #ffffff;
  --text: #111318;
  --text-muted: #4b5263;
  --text-dim: #667085;
  /* Reactive Agent Theme Tokens (updated live by Agent Switcher) */
  --theme-accent: #10b981;
  --theme-accent-ink: #ffffff;
  --theme-tint: #ecfdf5;
  --accent: var(--theme-accent);
  --accent-ink: var(--theme-accent-ink);
  --accent-soft: var(--theme-tint);
  /* Obsidian Console Tokens (Orbital Cockpit DNA) */
  --obs-bg: #0c0e14;
  --obs-panel: #141824;
  --obs-border: rgba(255, 255, 255, 0.14);
  --obs-text: #f3f6fc;
  --obs-muted: #9aa5bc;
  --tok-orange: #ff6b2c;
  --tok-sky: #38bdf8;
  --tok-amber: #fbbf24;
  --tok-mint: #34d399;
  --cyan: #0284c7;
  --amber: #b45309;
  --border: #111318;
  --border-subtle: rgba(17, 19, 24, 0.14);
  --shadow-hard: 4px 4px 0 #111318;
  --shadow-hard-lg: 6px 6px 0 #111318;
  --shadow-hard-sm: 3px 3px 0 #111318;
  --font-display: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  /* Concentric Nested Radii: R_outer (20px) = R_inner (8px) + pad (12px) */
  --r-outer: 20px;
  --r-mid: 14px;
  --r-inner: 8px;
  --ease-snappy: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-h: 68px;
}

[data-theme="dark"] {
  --bg: #08090e;
  --bg-elev: #11141f;
  --bg-card: #131724;
  --bg-card-hover: #191f30;
  --bg-input: #0b0e16;
  --text: #f4f7fc;
  --text-muted: #a0abc2;
  --text-dim: #79859e;
  --theme-tint: #0d161b;
  --accent-soft: rgba(16, 185, 129, 0.14);
  --cyan: #38bdf8;
  --amber: #fbbf24;
  --border: rgba(255, 255, 255, 0.24);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --shadow-hard: 4px 4px 0 rgba(0, 0, 0, 0.72);
  --shadow-hard-lg: 6px 6px 0 rgba(0, 0, 0, 0.8);
  --shadow-hard-sm: 3px 3px 0 rgba(0, 0, 0, 0.65);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: var(--header-h);
  border-bottom: 2px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: var(--header-h);
  flex-wrap: wrap;
  padding-block: 8px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.brand-logo-svg {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: block;
}

.brand-wordmark em {
  font-style: normal;
  color: var(--theme-accent);
  transition: color 0.25s ease;
}

.logo-orbit {
  stroke: var(--theme-accent);
  transition: stroke 0.25s ease;
}

.logo-sat {
  fill: var(--theme-accent);
  transition: fill 0.25s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: var(--r-inner);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1.5px solid transparent;
  transition: all 0.16s var(--ease-snappy);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-elev);
  border-color: var(--border);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.lang-pill {
  min-height: 40px;
  min-width: 40px;
  padding: 7px 12px;
  border-radius: var(--r-inner);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--border);
  transition: transform 0.12s, box-shadow 0.12s, background 0.16s;
}

.icon-btn:active,
.lang-pill:active,
.btn:active,
.ag-chip:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--border);
}

.lang-pill {
  font-family: var(--font-mono);
  background: var(--theme-tint);
}

/* Breadcrumbs */
.breadcrumbs {
  padding-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumbs a:hover { color: var(--theme-accent); }

/* Reactive Prism Hero Canvas */
.hero-section {
  padding: clamp(26px, 3.8vw, 48px) 0 clamp(30px, 4vw, 48px);
  background: var(--theme-tint);
  border-bottom: 2px solid var(--border);
  transition: background 0.3s ease;
}

.agent-switcher {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ag-chip {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-hard-sm);
  transition: background 0.2s, color 0.2s, transform 0.12s;
}

.ag-chip.active {
  background: var(--theme-accent);
  color: #ffffff;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #111318;
  flex-shrink: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  background: var(--bg-card);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--theme-accent);
}

.hero-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.3vw + 0.4rem, 3.8rem);
  line-height: 0.99;
  letter-spacing: -0.038em;
  font-weight: 800;
}

.hero-title mark,
.hero-title em {
  font-style: normal;
  background: var(--theme-accent);
  color: #ffffff;
  padding: 0 10px;
  border-radius: 10px;
  display: inline-block;
  transition: background 0.25s;
}

.hero-lead {
  margin: 0 0 22px;
  max-width: 64ch;
  color: var(--text-muted);
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
}

/* Orbital Animated 4-Node Pipeline Strip (Piece #1 from Proposal 2) */
.pipeline-strip {
  background: var(--obs-bg);
  color: var(--obs-text);
  border: 2px solid var(--border);
  border-radius: var(--r-outer);
  padding: 16px;
  box-shadow: var(--shadow-hard-lg);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.pipeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--obs-muted);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--obs-border);
}

.nodes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.node-box {
  background: var(--obs-panel);
  border: 1px solid var(--obs-border);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 0.2s, transform 0.16s;
}

.node-box:hover {
  border-color: var(--theme-accent);
  transform: translateY(-2px);
}

.node-box.node-lock {
  border-color: rgba(251, 191, 36, 0.55);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.09), var(--obs-panel));
}

.node-k {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.nk-o { color: var(--tok-orange); }
.nk-s { color: var(--tok-sky); }
.nk-a { color: var(--tok-amber); }
.nk-m { color: var(--tok-mint); }

.node-v { font-weight: 700; font-size: 0.88rem; color: var(--obs-text); line-height: 1.25; }
.node-s { font-size: 0.75rem; color: var(--obs-muted); margin-top: 3px; }

.cable-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  margin-top: 14px;
  overflow: hidden;
  position: relative;
}

.cable-pulse {
  position: absolute;
  inset: 0 auto 0 0;
  width: 28%;
  background: linear-gradient(90deg, transparent, var(--tok-orange), var(--theme-accent), var(--tok-sky), transparent);
  animation: cableSlide 2.6s linear infinite;
}

@keyframes cableSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(420%); }
}

/* Vibrant Modular Hero Bento (Obsidian Console + $960 Savings + Guardrail Card) */
.hero-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr) minmax(0, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.neo-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-outer);
  padding: 18px;
  box-shadow: var(--shadow-hard);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.neo-amber {
  background: #fef3c7;
  color: #1c1917;
}

[data-theme="dark"] .neo-amber {
  background: #2b2109;
  color: #fef3c7;
}

/* Obsidian Console Card (Piece #2 from Proposal 2) */
.console-card {
  background: var(--obs-bg);
  color: var(--obs-text);
  border: 2px solid var(--border);
  border-radius: var(--r-outer);
  padding: 16px;
  box-shadow: var(--shadow-hard-lg);
  display: flex;
  flex-direction: column;
}

.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--obs-border);
  flex-wrap: wrap;
}

.console-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--tok-mint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.console-card .field-label { color: var(--obs-muted); }
.console-card .field-input,
.console-card .field-select {
  background: var(--obs-panel);
  color: var(--obs-text);
  border: 1.5px solid var(--obs-border);
}

/* Syntax-Highlighted IDE Brief Output */
.ide-output {
  background: #06070b;
  border: 1px solid var(--obs-border);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.62;
  color: var(--obs-text);
  max-height: 245px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.ide-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
}

.ide-ln {
  color: #556078;
  text-align: right;
  user-select: none;
}

.tok-o { color: var(--tok-orange); font-weight: 700; }
.tok-s { color: var(--tok-sky); font-weight: 700; }
.tok-a { color: var(--tok-amber); font-weight: 700; background: rgba(251, 191, 36, 0.14); padding: 0 4px; border-radius: 4px; }
.tok-m { color: var(--tok-mint); font-weight: 700; }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  border: 2px solid var(--border);
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.15s;
}

.btn-primary {
  background: var(--theme-accent);
  color: #ffffff;
}
.btn-primary:hover { filter: brightness(1.06); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-elev); }

.btn-dark {
  background: #111318;
  color: #ffffff;
}

.console-card .btn-secondary {
  background: var(--obs-panel);
  color: var(--obs-text);
  border-color: var(--obs-border);
  box-shadow: none;
}
.console-card .btn-secondary:hover { border-color: var(--tok-sky); }

.btn-sm {
  min-height: 38px;
  padding: 7px 13px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* Badges & Inputs */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-elev);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge-green { background: #d1fae5; border-color: #059669; color: #065f46; }
.badge-cyan { background: #e0f2fe; border-color: #0284c7; color: #075985; }
.badge-amber { background: #fef3c7; border-color: #d97706; color: #92400e; }

[data-theme="dark"] .badge-green,
.console-card .badge-green { background: rgba(16, 185, 129, 0.16); border-color: #34d399; color: #34d399; }
[data-theme="dark"] .badge-cyan,
.console-card .badge-cyan { background: rgba(56, 189, 248, 0.16); border-color: #38bdf8; color: #38bdf8; }
[data-theme="dark"] .badge-amber,
.console-card .badge-amber { background: rgba(251, 191, 36, 0.16); border-color: #fbbf24; color: #fbbf24; }

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.field-label {
  display: block;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9rem;
}

/* Sections */
.section {
  padding: clamp(38px, 4.8vw, 64px) 0;
  border-bottom: 2px solid var(--border-subtle);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.section-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw + 0.4rem, 2.45rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.section-sub {
  margin: 0;
  color: var(--text-muted);
  max-width: 64ch;
  font-size: 0.98rem;
}

/* Toolbar + Density Toggle */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: var(--r-outer);
  padding: 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-hard-sm);
}

.toolbar-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-wrap { flex: 1 1 280px; }

.density-switch {
  display: inline-flex;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.density-btn {
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.density-btn.active {
  background: #111318;
  color: #ffffff;
}

.pill-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s;
}

.filter-pill:hover { background: var(--theme-tint); }
.filter-pill.active {
  background: var(--theme-accent);
  color: #ffffff;
}

/* Collectible Modular Playbook Cards + @container Responsive */
.playbook-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.playbook-grid.density-1 { grid-template-columns: 1fr; }

.playbook-slot {
  container-type: inline-size;
  container-name: playbook-slot;
}

.playbook-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-outer);
  overflow: hidden;
  box-shadow: var(--shadow-hard);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.15s, box-shadow 0.15s;
}

.playbook-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hard-lg);
}

.pb-banner {
  padding: 9px 15px;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #111318;
}

.pb-cat-money { background: #d1fae5; }
.pb-cat-work { background: #dbeafe; }
.pb-cat-business { background: #ede9fe; }
.pb-cat-dev { background: #fee2e2; }
.pb-cat-life { background: #fef3c7; }
.pb-cat-shopping { background: #fce7f3; }
.pb-cat-messaging { background: #dcfce7; }

[data-theme="dark"] .pb-banner { color: #f4f7fc; }
[data-theme="dark"] .pb-cat-money { background: #0c2e22; }
[data-theme="dark"] .pb-cat-work { background: #102542; }
[data-theme="dark"] .pb-cat-business { background: #231842; }
[data-theme="dark"] .pb-cat-dev { background: #3b131b; }
[data-theme="dark"] .pb-cat-life { background: #362709; }
[data-theme="dark"] .pb-cat-shopping { background: #3a1228; }
[data-theme="dark"] .pb-cat-messaging { background: #0f301b; }

.pb-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.playbook-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.playbook-main { min-width: 0; flex: 1; }

.playbook-title {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.22;
}

.playbook-desc {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.48;
}

.playbook-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.quota-pips {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.q-pip { width: 10px; height: 6px; border-radius: 2px; background: rgba(17, 19, 24, 0.2); }
.q-pip.on { background: #059669; }
.q-pip.med { background: #d97706; }

.playbook-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.playbook-drawer {
  border-top: 1.5px dashed var(--border-subtle);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.playbook-drawer[hidden] { display: none; }

.var-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

@container playbook-slot (max-width: 480px) {
  .playbook-row-head { flex-direction: column; align-items: stretch; }
  .playbook-actions { width: 100%; border-top: 1px solid var(--border-subtle); padding-top: 10px; }
  .playbook-actions .btn { flex: 1; }
}

/* Bento Cards & Tables */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-12 { grid-column: span 12; }

.bento-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-outer);
  padding: 20px;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s, box-shadow 0.15s;
}
a.bento-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hard-lg);
}
.bento-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.2;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 2px solid var(--border);
  border-radius: var(--r-outer);
  background: var(--bg-card);
  box-shadow: var(--shadow-hard);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.9rem;
}
.compare-table th,
.compare-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1.5px solid var(--border-subtle);
  vertical-align: top;
}
.compare-table th {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-elev);
}
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table td:first-child { font-weight: 700; }

/* Calculator */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
}
.slider-group { margin-bottom: 16px; }
.slider-head { display: flex; justify-content: space-between; font-size: 0.88rem; font-weight: 700; margin-bottom: 6px; }
.range-input { width: 100%; accent-color: var(--theme-accent); cursor: pointer; }
.cost-bar-item { margin-bottom: 14px; }
.cost-bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; margin-bottom: 5px; }
.cost-bar-track {
  height: 14px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  overflow: hidden;
}
.cost-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--theme-accent);
  transition: width 0.3s var(--ease-snappy);
}
.verdict-box {
  background: var(--theme-tint);
  border: 2px solid var(--border);
  border-radius: var(--r-mid);
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--shadow-hard-sm);
}

/* Citation Capsule & Discover Visual */
.citation-capsule {
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-left: 6px solid var(--theme-accent);
  border-radius: var(--r-mid);
  padding: 16px 18px;
  margin: 12px 0 22px;
  max-width: 72ch;
}
.citation-capsule p { margin: 0; font-size: 0.98rem; }

.article-hero-img {
  border-radius: var(--r-outer);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-hard);
  margin: 20px 0 28px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

/* Affiliates & FAQ */
.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.affiliate-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-outer);
  padding: 18px;
  box-shadow: var(--shadow-hard);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-mid);
  padding: 4px 16px;
  box-shadow: var(--shadow-hard-sm);
}
.faq-item summary {
  padding: 14px 0;
  cursor: pointer;
  font-weight: 800;
  font-family: var(--font-display);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--theme-accent); font-size: 1.25rem; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 16px; color: var(--text-muted); max-width: 68ch; font-size: 0.94rem; }

/* Toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 90;
  background: #111318;
  color: #ffffff;
  border: 2px solid var(--theme-accent);
  padding: 12px 18px;
  border-radius: var(--r-mid);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.25s var(--ease-spring);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Footer */
.site-footer {
  padding: 44px 0 max(36px, env(safe-area-inset-bottom));
  background: var(--bg-elev);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}
.footer-col h4 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.footer-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 0.9rem; }
.footer-col a { color: var(--text-muted); font-weight: 500; }
.footer-col a:hover { color: var(--theme-accent); }
.footer-bottom {
  border-top: 1.5px solid var(--border-subtle);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--r-outer);
  background: var(--bg-elev);
}

/* Responsive Breakpoints */
@media (max-width: 1020px) {
  .hero-bento,
  .calc-layout,
  .affiliate-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .nodes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-7, .span-5, .span-6, .span-4 { grid-column: span 12; }
  .playbook-grid { grid-template-columns: 1fr; }
  .density-switch { display: none; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 24px); }
  .nodes-grid, .form-grid-2 { grid-template-columns: 1fr; }
  .field-input, .field-select, .field-textarea { font-size: 16px; }
  .pill-strip, .agent-switcher {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 6px;
  }
  .pill-strip::-webkit-scrollbar, .agent-switcher::-webkit-scrollbar { display: none; }
  .btn, .filter-pill, .ag-chip { min-height: 44px; flex-shrink: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
