/* ════════════════════════════════════════════════════════
   SPARK SENIOR HEALTH — DESIGN SYSTEM
   ════════════════════════════════════════════════════════ */

/* ── Palette primitives ──────────────────────────────────
   Each color is defined as H + S channels so L can be
   varied per-context: hsl(var(--blue-h), var(--blue-s), L%)
   ──────────────────────────────────────────────────────── */
:root {
  --blue-h:   227; --blue-s:   80%;   /* #050e2e at L=10 */
  --white-h:  230; --white-s:  75%;   /* hsl(230,75%,97%) at L=97 */
  --gold-h:    45; --gold-s:   74%;   /* #d7a920 at L=48 */
  --orange-h:  35; --orange-s: 72%;   /* #d28922 at L=48 */
  --red-h:      5; --red-s:    56%;   /* #bf4136 at L=48 */

  /* Accent palette — used on content pages */
  --green-h:       161; --green-s:       71%;
  --teal-h:        185; --teal-s:        76%;
  --purple-h:      258; --purple-s:      48%;
  --blue-accent-h: 211; --blue-accent-s: 75%;
}

/* ── Concrete palette tokens ─────────────────────────── */
:root {
  /* Blue scale */
  --blue-10: hsl(var(--blue-h), var(--blue-s), 10%);
  --blue-12: hsl(var(--blue-h), var(--blue-s), 12%);

  /* White/pale scale */
  --pale-97:  hsl(var(--white-h), var(--white-s), 97%);
  --pale-95:  hsl(var(--white-h), var(--white-s), 95%);

  /* Gold */
  --gold:     hsl(var(--gold-h), var(--gold-s), 48%);
  --gold-lt:  hsl(var(--gold-h), var(--gold-s), 78%);
  --gold-dk:  hsl(var(--gold-h), var(--gold-s), 30%);

  /* Orange */
  --orange:   hsl(var(--orange-h), var(--orange-s), 48%);
  --orange-lt: hsl(var(--orange-h), var(--orange-s), 70%);

  /* Red */
  --red:      hsl(var(--red-h), var(--red-s), 48%);
  --red-lt:   hsl(var(--red-h), var(--red-s), 60%);
  --red-dk:   hsl(var(--red-h), var(--red-s), 30%);

  /* Accent colors */
  --green:         hsl(var(--green-h), var(--green-s), 36%);
  --green-lt:      hsl(var(--green-h), var(--green-s), 49%);
  --teal:          hsl(var(--teal-h), var(--teal-s), 30%);
  --teal-lt:       hsl(var(--teal-h), var(--teal-s), 46%);
  --purple:        hsl(var(--purple-h), var(--purple-s), 50%);
  --purple-lt:     hsl(var(--purple-h), var(--purple-s), 69%);
  --blue-accent:   hsl(var(--blue-accent-h), var(--blue-accent-s), 41%);
  --blue-accent-lt:hsl(var(--blue-accent-h), var(--blue-accent-s), 58%);
}

/* ── Semantic tokens — dark theme (default) ─────────── */
:root {
  /* Backgrounds */
  --bg:      var(--blue-10);   /* page, nav, headers */
  --bg-card: var(--blue-12);   /* cards */

  /* Text */
  --text:         var(--pale-97);
  --text-sub:     hsla(var(--white-h), var(--white-s), 97%, 0.55);
  --text-faint:   hsla(var(--white-h), var(--white-s), 97%, 0.35);

  /* Borders */
  --border-color: hsla(var(--gold-h), var(--gold-s), 48%, 0.15);
  --border-mid:   hsla(var(--gold-h), var(--gold-s), 48%, 0.30);

  /* Shadows */
  --shadow-sm:    0 2px 12px hsla(var(--blue-h), var(--blue-s),  5%, 0.40);
  --shadow-md:    0 4px 24px hsla(var(--blue-h), var(--blue-s),  5%, 0.50);
  --shadow-lg:    0 8px 40px hsla(var(--blue-h), var(--blue-s),  5%, 0.60);

  /* Radii */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-pill: 9999px;

  /* Typography */
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans:  'IBM Plex Sans', sans-serif;
  --font-mono:  'IBM Plex Mono', monospace;

  /* Transitions */
  --t-fast: .13s ease;
  --t-base: .20s ease;
  --t-slow: .32s ease;
}

/* ── Semantic overrides — light theme ───────────────── */
body.light-theme {
  --bg:      var(--pale-97);
  --bg-card: var(--pale-95);

  --text:         var(--blue-10);
  --text-sub:     hsla(var(--blue-h), var(--blue-s), 10%, 0.55);
  --text-faint:   hsla(var(--blue-h), var(--blue-s), 10%, 0.35);

  --border-color: hsla(var(--blue-h), var(--blue-s), 10%, 0.10);
  --border-mid:   hsla(var(--blue-h), var(--blue-s), 10%, 0.20);

  --shadow-sm:    0 2px 12px hsla(var(--blue-h), var(--blue-s), 10%, 0.06);
  --shadow-md:    0 4px 24px hsla(var(--blue-h), var(--blue-s), 10%, 0.10);
  --shadow-lg:    0 8px 40px hsla(var(--blue-h), var(--blue-s), 10%, 0.12);
}

/* ════ SPARK SITE NAV ════ */
:root {
  --nav-navy:  var(--bg);           /* nav bg tracks page bg */
  --nav-pale:  var(--pale-97);
  --nav-gold:  var(--gold);
  --nav-rust:  var(--red);
  --nav-amber: var(--orange);
  --nav-serif: var(--font-serif);
  --nav-mono:  var(--font-mono);
}
body.light-theme {
  --nav-navy:  var(--pale-97);      /* light nav in light mode */
}

nav:not(#top-nav):not(#pres-dot-nav) {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: var(--nav-navy);
  transition: background .2s;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 0;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--nav-rust), var(--nav-amber), var(--nav-gold), transparent) 1;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--pale-97);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 28px;
  margin-right: 28px;
}
.nav-brand-spark { background: linear-gradient(90deg, var(--gold), var(--red)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: hsla(var(--white-h), var(--white-s), 97%, 0.55);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.nav-link:hover { color: var(--gold); background: hsla(var(--gold-h), var(--gold-s), 48%, 0.10); }

.nav-dropdown { position: relative; }

.nav-dropdown-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: hsla(var(--white-h), var(--white-s), 97%, 0.55);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
  user-select: none;
}
.nav-dropdown-label:hover { color: var(--gold); background: hsla(var(--gold-h), var(--gold-s), 48%, 0.10); }

.nav-caret {
  font-size: 9px;
  opacity: .6;
  transition: transform var(--t-base);
  display: inline-block;
}
.nav-dropdown:hover .nav-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10000;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  padding: 6px;
  min-width: 230px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--t-base), transform var(--t-base);
  box-shadow: var(--shadow-lg);
}
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: background var(--t-fast);
  cursor: pointer;
}
.nav-dropdown-item:hover { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.10); }

.nav-dropdown-item-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: hsla(var(--gold-h), var(--gold-s), 48%, 0.50);
  width: 18px;
  flex-shrink: 0;
  padding-top: 1px;
}
.nav-dropdown-item-title {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
}
.nav-dropdown-item-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text);
  margin-top: 2px;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

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

.nav-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-pill);
  color: var(--gold);
}

.nav-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: hsla(var(--white-h), var(--white-s), 97%, 0.55);
  font-size: 14px;
  flex-shrink: 0;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.nav-theme-toggle:hover { color: var(--gold); background: hsla(var(--gold-h), var(--gold-s), 48%, 0.10); border-color: var(--gold); }
body.light-theme .nav-theme-toggle { color: var(--text); border-color: var(--border-mid); }
body.light-theme .nav-theme-toggle:hover { color: var(--gold); border-color: var(--gold); background: hsla(var(--gold-h), var(--gold-s), 48%, 0.10); }

.nav-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: hsla(var(--white-h), var(--white-s), 97%, 0.60);
  font-size: 18px;
  margin-left: 12px;
  flex-shrink: 0;
}
.nav-mobile-toggle:hover { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.10); color: var(--gold); }

.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 9998;
  overflow-y: auto;
  padding: 16px 20px 40px;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border-color);
}
.nav-mobile-menu.open { display: flex; }

.nav-mobile-section {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: hsla(var(--gold-h), var(--gold-s), 48%, 0.55);
  padding: 16px 8px 8px;
}
.nav-mobile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background var(--t-fast);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.nav-mobile-item:hover { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.08); }
.nav-mobile-item-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: hsla(var(--gold-h), var(--gold-s), 48%, 0.45);
  width: 18px;
  flex-shrink: 0;
}
.nav-mobile-item-title { font-size: 14px; color: var(--text); font-weight: 500; }
.nav-mobile-item-sub { font-family: var(--font-mono); font-size: 10px; color: var(--text); margin-top: 2px; }
.nav-mobile-divider { height: 1px; background: var(--border-color); margin: 8px 0; }

@media (max-width: 768px) {
  nav:not(#top-nav):not(#pres-dot-nav) { padding: 0 20px; height: 52px; }
  .nav-brand { padding-right: 16px; margin-right: 0; border-right: none; font-size: 14px; }
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }
}

/* ════ BOOK PAGE TOP-NAV ════ */
#top-nav {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 9990;
  background: var(--pale-97);    /* light in dark mode — contrasts page */
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  gap: 0;
  transition: background var(--t-base), color var(--t-base);
}
.tn-brand {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  padding-right: 18px;
  border-right: 1px solid var(--border-color);
  margin-right: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tn-section {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
  flex: 1;
}
.tn-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xs);
  margin-left: auto;
  color: var(--gold);
}
/* top-nav inverts in light mode: dark bg so it contrasts the light page */
body.light-theme #top-nav { background: var(--blue-10); }
body.light-theme #top-nav .tn-brand { border-right-color: var(--border-mid); }
body.light-theme #top-nav .tn-section { color: hsla(var(--white-h), var(--white-s), 97%, 0.55); }
body.light-theme #top-nav .tn-badge { border-color: hsla(var(--gold-h), var(--gold-s), 48%, 0.35); color: var(--gold); }

/* Light mode: site nav bg tracked via --nav-navy → --bg → --pale-97 (set in design system) */
/* Text colors flip to dark ink */
body.light-theme nav:not(#top-nav):not(#pres-dot-nav) .nav-brand { color: var(--blue-10); }
body.light-theme nav:not(#top-nav):not(#pres-dot-nav) .nav-link { color: var(--text); }
body.light-theme nav:not(#top-nav):not(#pres-dot-nav) .nav-dropdown-label { color: var(--text); }
body.light-theme nav:not(#top-nav):not(#pres-dot-nav) .nav-dropdown-menu { background: var(--pale-97); border-color: var(--border-color); box-shadow: var(--shadow-md); }
body.light-theme nav:not(#top-nav):not(#pres-dot-nav) .nav-dropdown-item-title { color: var(--text); }
body.light-theme nav:not(#top-nav):not(#pres-dot-nav) .nav-dropdown-item-sub { color: var(--text); }
body.light-theme nav:not(#top-nav):not(#pres-dot-nav) .nav-dropdown-divider { background: var(--border-color); }
body.light-theme .nav-mobile-toggle { color: var(--text); border-color: var(--border-mid); }
body.light-theme .nav-mobile-menu { background: var(--pale-97); border-top-color: var(--border-color); }
body.light-theme .nav-mobile-item-title { color: var(--text); }
body.light-theme .nav-mobile-item-sub { color: var(--text); }

/* ════ NAV RAIL (SLIDE DOTS) ════ */
.nav-rail {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 900;
}
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsla(var(--gold-h), var(--gold-s), 48%, 0.25);
  cursor: pointer;
  transition: background var(--t-base), transform var(--t-base);
  border: none;
  padding: 0;
}
.nav-dot:hover, .nav-dot.active {
  background: var(--gold);
  transform: scale(1.4);
}


/* ════════════════════════════════════════════════════════
   GLOBAL BASE
   ════════════════════════════════════════════════════════ */

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

html, body {
  min-height: 100%;
  font-family: var(--font-sans);
}

body {
  background: var(--bg);
  color: var(--text);
}

/* ── Page-level scrollbar — gold pill on dark track ─── */
html { scrollbar-width: thin; scrollbar-color: var(--gold) var(--blue-10); }
html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-track { background: var(--blue-10); }
html::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 999px; border: 2px solid var(--blue-10); }
html::-webkit-scrollbar-thumb:hover { background: hsl(var(--gold-h), var(--gold-s), 60%); }
/* Light mode */
body.light-theme { scrollbar-color: var(--gold) var(--pale-97); }
body.light-theme::-webkit-scrollbar-track { background: var(--pale-97); }
body.light-theme::-webkit-scrollbar-thumb { background: var(--gold); border-color: var(--pale-97); }


/* ════════════════════════════════════════════════════════
   HOME PAGE
   ════════════════════════════════════════════════════════ */

/* Layout composition — full-height flex column */
body.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Hero block ── */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px 60px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.hero__rings {
  position: absolute;
  pointer-events: none;
}
.hero__rings--br { bottom: 0; right: 0; }
.hero__rings--tl { top: 0; left: 0; opacity: 0.12; transform: rotate(180deg); }

/* All direct hero children stack in z above the SVG rings */
.hero > :not(.hero__rings) { position: relative; z-index: 1; }

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: hsla(var(--gold-h), var(--gold-s), 48%, 0.60);
  margin-bottom: 28px;
}

.hero__name {
  font-family: var(--font-serif);
  font-size: clamp(60px, 10vw, 108px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.035em;
  color: var(--text);
  margin-bottom: 2px;
}
.hero__name-spark {
  background: linear-gradient(90deg, var(--gold), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__co {
  font-family: var(--font-serif);
  font-size: clamp(22px, 4vw, 42px);
  font-weight: 400;
  color: var(--text);
  letter-spacing: .07em;
  margin-bottom: 28px;
}

.hero__divider {
  width: 72px;
  height: 3px;
  margin: 0 auto 28px;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--gold));
  border-radius: var(--r-xs);
}

.hero__tagline {
  font-family: var(--font-serif);
  font-size: clamp(17px, 2.5vw, 24px);
  font-style: italic;
  color: var(--pale-97);
  margin-bottom: 52px;
}
body.light-theme .hero__tagline { color: var(--ink); }

.hero__chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__chip {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-mid);
  color: var(--gold);
  background: hsla(var(--gold-h), var(--gold-s), 48%, 0.07);
}

/* ── Site footer block ── */
.site-footer {
  background: var(--bg);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--gold), var(--orange), var(--red), transparent) 1;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer__brand {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.site-footer__brand-spark {
  background: linear-gradient(90deg, var(--gold), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-footer__links {
  display: flex;
  gap: 24px;
}

.site-footer__link {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: color var(--t-fast);
}
.site-footer__link:hover { color: var(--gold); }

.site-footer__meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text);
  letter-spacing: .06em;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero { padding: 60px 24px 48px; }
  .site-footer { padding: 20px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer__links { gap: 16px; }
}

@media (max-width: 480px) {
  .hero__chips { gap: 6px; }
  .hero__chip { font-size: 8.5px; padding: 4px 10px; }
  .site-footer { padding: 16px; }
  .site-footer__meta { display: none; }
}


/* ════════════════════════════════════════════════════════
   TECH STACK  ·  body.tech-stack / html.tech-stack-page
   ════════════════════════════════════════════════════════ */

/* Full-viewport canvas layout — override global min-height */
html.tech-stack-page,
html.tech-stack-page body { height: 100%; overflow: hidden; }
html.tech-stack-page body { display: flex; flex-direction: column; }

/* ── Legend ── */
#legend {
  position: absolute;
  bottom: 28px;
  left: 32px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text);
  letter-spacing: .06em;
}
.legend-item--faint { color: hsla(var(--white-h), var(--white-s), 97%, 0.25); }
.legend-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot--gold   { background: var(--gold); }
.legend-dot--red    { background: var(--red); }
.legend-dot--slate  { background: hsl(var(--blue-accent-h), var(--blue-accent-s), 35%); }
.legend-dot--purple { background: var(--purple); }

/* ── Canvas ── */
#canvas-wrap { flex: 1; position: relative; overflow: hidden; }
svg#map { width: 100%; height: 100%; cursor: grab; }
svg#map:active { cursor: grabbing; }

/* ── Node circles ── */
.node-circle { cursor: pointer; transition: filter var(--t-base); }
.node-circle:hover { filter: brightness(1.25) drop-shadow(0 0 10px hsla(var(--gold-h), var(--gold-s), 48%, 0.50)); }
.node-circle.active-node { filter: brightness(1.3) drop-shadow(0 0 14px hsla(var(--gold-h), var(--gold-s), 48%, 0.70)); }

.node-label { font-family: var(--font-sans); font-size: 11px; font-weight: 600; fill: var(--pale-97); pointer-events: none; text-anchor: middle; dominant-baseline: middle; }
.node-sublabel { font-family: var(--font-mono); font-size: 8.5px; fill: hsla(var(--white-h), var(--white-s), 97%, 0.55); pointer-events: none; text-anchor: middle; dominant-baseline: middle; }
.node-icon { font-size: 20px; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }

.conn-line { stroke-width: 1.5; fill: none; opacity: 0.35; }
.conn-line.highlight { opacity: 0.9; stroke-width: 2; }

/* ── Popup ── */
#popup {
  position: absolute;
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  width: 280px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity var(--t-base), transform var(--t-base);
  overflow: hidden;
}
#popup.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }

.popup-head {
  padding: 13px 16px 10px;
  border-bottom: 1px solid var(--border-color);
}
.popup-icon { font-size: 20px; margin-bottom: 5px; display: block; }
.popup-name { font-family: var(--font-serif); font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.popup-cat { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }

.popup-body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.popup-desc { font-size: 11.5px; color: var(--text); line-height: 1.6; }
.popup-price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 8px;
  background: hsla(var(--gold-h), var(--gold-s), 48%, 0.07);
  border-radius: var(--r-sm);
  font-size: 11px;
}
.popup-price-label { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; color: hsla(var(--gold-h), var(--gold-s), 48%, 0.55); }
.popup-price-val { font-family: var(--font-mono); font-size: 10.5px; color: var(--gold); font-weight: 500; }
.popup-connects { font-family: var(--font-mono); font-size: 9px; color: var(--text); letter-spacing: .06em; line-height: 1.8; }

.popup-close {
  position: absolute;
  top: 8px; right: 10px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: var(--r-xs);
  line-height: 1;
}
.popup-close:hover { color: var(--text); background: hsla(var(--white-h), var(--white-s), 97%, 0.08); }

/* ════════════════════════════════════════════════════════
   EQUIPMENT STACK  ·  body.eq-stack
   ════════════════════════════════════════════════════════ */

html.eq-stack-page { font-size: 14px; scroll-behavior: smooth; }

/* ── Shared meta pill ── */
.meta-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-mid);
  color: var(--text);
  white-space: nowrap;
}
.meta-pill--gold       { border-color: var(--border-mid);   color: var(--gold); }
.meta-pill--green      { border-color: hsla(var(--green-h), var(--green-s), 49%, 0.30); color: var(--green-lt); }
.meta-pill--d1         { border-color: hsla(var(--gold-h),  var(--gold-s),  48%, 0.35); color: var(--gold); }
.meta-pill--m3         { border-color: hsla(var(--orange-h),var(--orange-s),70%, 0.35); color: var(--orange-lt); }
.meta-pill--m6,
.meta-pill--m9         { border-color: hsla(var(--green-h), var(--green-s), 49%, 0.35); color: var(--green-lt); }

/* ── Page header bar (sticky below site nav) ── */
.page-hdr {
  background: var(--bg);
  border-bottom: 1px solid var(--border-mid);
  padding: 0 32px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 0;
  position: sticky;
  top: 56px;
  z-index: 200;
}

.page-hdr__brand {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  padding-right: 18px;
  margin-right: 14px;
  border-right: 1px solid var(--border-mid);
  white-space: nowrap;
  flex-shrink: 0;
}

.page-hdr__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

/* ── Phase timeline ── */
.phase-timeline {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 48px;
  display: flex;
  gap: 0;
  align-items: center;
  overflow-x: auto;
}

.phase-timeline__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 100px;
  cursor: pointer;
  text-decoration: none;
}
.phase-timeline__node:hover .phase-timeline__dot { transform: scale(1.2); }

.phase-timeline__dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--text-faint);
  border: 2px solid var(--text-faint);
  transition: transform var(--t-fast);
  position: relative;
  z-index: 2;
}
.phase-timeline__dot--d1 { background: var(--gold);          border-color: var(--gold); }
.phase-timeline__dot--m3 { background: var(--orange-lt);     border-color: var(--orange-lt); }
.phase-timeline__dot--m6 { background: var(--green-lt);      border-color: var(--green-lt); }
.phase-timeline__dot--m9 { background: var(--blue-accent-lt);border-color: var(--blue-accent-lt); }

.phase-timeline__label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
}

.phase-timeline__count {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--text);
}
.phase-timeline__count--d1 { color: var(--gold); }
.phase-timeline__count--m3 { color: var(--orange-lt); }
.phase-timeline__count--m6 { color: var(--green-lt); }
.phase-timeline__count--m9 { color: var(--blue-accent-lt); }

.phase-timeline__line {
  flex: 1;
  height: 1px;
  background: var(--border-mid);
  position: relative;
  top: -22px;
}

/* ── Content section ── */
.content-section {
  padding: 40px 48px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg);
}
.content-section:last-of-type { border-bottom: none; }

.content-section__header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
}

.content-section__title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--text);
  line-height: 1.2;
}

.content-section__desc {
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.65;
  margin-top: 6px;
  max-width: 760px;
}

/* ── Phase badge ── */
.phase-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
.phase-badge--d1 { background: hsla(var(--gold-h),        var(--gold-s),        48%, 0.09); color: var(--gold);          border: 1px solid var(--border-mid); }
.phase-badge--m3 { background: hsla(var(--orange-h),      var(--orange-s),      48%, 0.10); color: var(--orange-lt);     border: 1px solid hsla(var(--orange-h),      var(--orange-s),      70%, 0.25); }
.phase-badge--m6 { background: hsla(var(--green-h),       var(--green-s),       36%, 0.10); color: var(--green-lt);      border: 1px solid hsla(var(--green-h),       var(--green-s),       49%, 0.25); }
.phase-badge--m9 { background: hsla(var(--blue-accent-h), var(--blue-accent-s), 41%, 0.10); color: var(--blue-accent-lt);border: 1px solid hsla(var(--blue-accent-h), var(--blue-accent-s), 58%, 0.25); }

/* ── Category label ── */
.cat-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 6px 0;
  margin: 20px 0 10px;
  border-top: 1px solid var(--border-color);
}
.cat-label:first-child { margin-top: 0; border-top: none; }

/* ── Card grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
/* ── Equipment card ── */
.eq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--t-fast);
  cursor: pointer;
  position: relative;
}
.eq-card.open {
  overflow: visible;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.eq-card:hover,
.eq-card.open { border-color: var(--border-mid); }

.eq-card__top {
  padding: 14px 16px 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.eq-card__icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}
.eq-card__icon--green  { background: hsla(var(--green-h),       var(--green-s),       36%, 0.10); color: var(--green-lt); }
.eq-card__icon--red    { background: hsla(var(--red-h),         var(--red-s),         48%, 0.10); color: var(--red-lt); }
.eq-card__icon--blue   { background: hsla(var(--blue-accent-h), var(--blue-accent-s), 41%, 0.10); color: var(--blue-accent-lt); }
.eq-card__icon--teal   { background: hsla(var(--teal-h),        var(--teal-s),        30%, 0.10); color: var(--teal-lt); }
.eq-card__icon--amber  { background: hsla(var(--orange-h),      var(--orange-s),      48%, 0.10); color: var(--orange-lt); }
.eq-card__icon--purple { background: hsla(var(--purple-h),      var(--purple-s),      50%, 0.10); color: var(--purple-lt); }
.eq-card__icon--gold   { background: hsla(var(--gold-h),        var(--gold-s),        48%, 0.09); color: var(--gold); }

.eq-card__name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 4px;
}

.eq-card__tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.eq-card__footer {
  padding: 8px 16px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
}

.eq-card__cost {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--gold);
}

.eq-card__cost-note {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text);
}

.eq-card__toggle {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color var(--t-fast);
  user-select: none;
}
.eq-card:hover .eq-card__toggle,
.eq-card.open  .eq-card__toggle { color: var(--text); }

.eq-card__toggle-arrow {
  display: inline-block;
  transition: transform var(--t-base);
  font-size: 10px;
}
.eq-card.open .eq-card__toggle-arrow { transform: rotate(180deg); }

.eq-card__detail {
  display: none;
  position: absolute;
  left: -1px; right: -1px;
  top: 100%;
  padding: 12px 16px 14px;
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.7;
  border: 1px solid var(--border-mid);
  border-top: none;
  border-bottom-left-radius: var(--r-md);
  border-bottom-right-radius: var(--r-md);
  background: var(--bg);
  z-index: 10;
}
.eq-card.open .eq-card__detail { display: block; }

.eq-card__bill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: hsla(var(--green-h), var(--green-s), 36%, 0.10);
  color: var(--green-lt);
  border: 1px solid hsla(var(--green-h), var(--green-s), 49%, 0.18);
  margin-top: 8px;
}

/* ── Clarification card ── */
.clarify {
  padding: 0 48px 56px;
}

.clarify__card {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-left: 3px solid var(--orange-lt);
  border-radius: var(--r-md);
  padding: 28px 30px 26px;
}

.clarify__eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange-lt);
  margin-bottom: 8px;
}

.clarify__title {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--text);
  margin-bottom: 6px;
}

.clarify__intro {
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 20px;
  max-width: 700px;
}

.clarify__items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clarify__item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  background: hsla(var(--blue-h), var(--blue-s), 5%, 0.18);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-color);
}

.clarify__num {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--orange-lt);
  opacity: 0.5;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 1px;
}

.clarify__item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.clarify__item-body {
  font-size: 11px;
  color: var(--text);
  line-height: 1.6;
}
.clarify__item-body strong { color: var(--text); font-weight: 500; }

/* ── Page footer ── */
.page-foot {
  background: var(--bg);
  border-top: 1px solid var(--border-color);
  padding: 16px 48px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--text);
  letter-spacing: 0.06em;
  line-height: 1.7;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .page-hdr,
  .content-section,
  .clarify { padding-left: 20px; padding-right: 20px; }
  .phase-timeline { padding-left: 20px; padding-right: 20px; }
  .card-grid { grid-template-columns: 1fr; }
  .page-foot { padding-left: 20px; padding-right: 20px; }
}


/* ════════════════════════════════════════════════════════
   DENSITY MAP  ·  body.density-map
   ════════════════════════════════════════════════════════ */

/* Viewport lock — full-canvas page */
html.density-map-page,
html.density-map-page body { height: 100%; overflow: hidden; }

body.density-map {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
}

/* ── MAIN LAYOUT ── */
body.density-map #layout {
  position: fixed;
  top: 56px; bottom: 0; left: 0; right: 0;
  display: flex;
}

/* ── LEFT SIDEBAR ── */
#sidebar {
  width: 252px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  overflow: hidden;
}
#sidebar-header {
  padding: 18px 14px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.dm-sidebar-brand {
  font-family: var(--font-serif); font-size: 15px; font-weight: 700;
  color: var(--gold); margin-bottom: 8px;
}
.sb-title {
  font-family: var(--font-mono); font-size: 8px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--text); margin-bottom: 8px;
}
.sort-btns { display: flex; gap: 3px; }
.sort-btn {
  flex: 1;
  background: hsla(var(--white-h), var(--white-s), 97%, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text); font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 4px; border-radius: 5px; cursor: pointer;
  transition: all var(--t-fast); text-align: center;
}
.sort-btn:hover { color: var(--text); background: hsla(var(--white-h), var(--white-s), 97%, 0.14); }
.sort-btn.active { background: var(--red); border-color: var(--red); color: #fff; }

#county-list { overflow-y: auto; flex: 1; padding: 5px 7px; }
#county-list::-webkit-scrollbar { width: 4px; }
#county-list::-webkit-scrollbar-track { background: transparent; }
#county-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

.county-row {
  padding: 8px 10px; border-radius: var(--r-sm);
  cursor: pointer; margin-bottom: 2px;
  border: 1px solid transparent;
  transition: all var(--t-fast);
}
.county-row:hover { background: hsl(var(--blue-h), var(--blue-s), 14%); border-color: var(--border-color); }
.county-row.active { background: hsl(var(--blue-h), var(--blue-s), 14%); border-color: var(--blue-accent); }
.cr-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.cr-name { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--text); }
.cr-phase {
  font-family: var(--font-mono); font-size: 8px; padding: 2px 6px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: .06em; flex-shrink: 0;
}
.phase-1 { background: rgba(212,168,67,.2); color: var(--gold); }
.phase-2 { background: rgba(168,85,247,.2); color: #a855f7; }
.phase-3 { background: rgba(46,204,138,.12); color: var(--green-lt); }
.phase-4 { background: rgba(90,106,126,.2); color: var(--text); }
.cr-stats { display: flex; gap: 8px; margin-bottom: 5px; }
.cr-stat { font-family: var(--font-mono); font-size: 9px; color: var(--text); }
.cr-stat span { color: var(--text); }
.cr-bar-wrap { background: hsla(var(--white-h), var(--white-s), 97%, 0.08); border-radius: 2px; height: 3px; overflow: hidden; }
.cr-bar { height: 3px; border-radius: 2px; transition: width .4s ease; }

#detail-panel {
  border-top: 1px solid var(--border-color);
  padding: 13px 14px; flex-shrink: 0;
  background: var(--bg);
  display: none;
}
#detail-panel.visible { display: block; }
.dp-county { font-family: var(--font-serif); font-size: 15px; margin-bottom: 3px; }
.dp-seat { font-family: var(--font-mono); font-size: 9px; color: var(--text); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 11px; }
.dp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dp-card {
  background: hsl(var(--blue-h), var(--blue-s), 14%);
  border: 1px solid var(--border-color);
  border-radius: var(--r-sm); padding: 7px 9px;
}
.dp-card--ffs   { border-left: 3px solid var(--blue-accent-lt); }
.dp-card--score { border-left: 3px solid var(--green-lt); }
.dp-card-val { font-family: var(--font-mono); font-size: 15px; color: var(--text); }
.dp-card-label { font-family: var(--font-mono); font-size: 8px; color: var(--text); letter-spacing: .07em; text-transform: uppercase; margin-top: 2px; }
.dp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.dp-tag {
  font-family: var(--font-mono); font-size: 8px; padding: 3px 7px;
  border-radius: 3px; letter-spacing: .05em;
}
.tag-hpsa   { background: rgba(212,168,67,.18); color: var(--gold); border: 1px solid rgba(212,168,67,.3); }
.tag-nofqhc { background: rgba(46,204,138,.1); color: var(--green-lt); border: 1px solid rgba(46,204,138,.2); }
.tag-aco-hi { background: rgba(192,57,43,.18); color: var(--red-lt); border: 1px solid rgba(192,57,43,.3); }
.tag-aco-lo { background: rgba(46,204,138,.1); color: var(--green-lt); border: 1px solid rgba(46,204,138,.2); }
.dp-clinic-info {
  margin-top: 9px; padding: 7px 9px;
  background: hsl(var(--blue-h), var(--blue-s), 14%); border: 1px solid var(--border-color);
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 9px; color: var(--text);
  line-height: 1.5;
}
.dp-clinic-info strong { color: var(--text); font-weight: 500; }

/* ── MAP AREA ── */
#map-wrap {
  flex: 1; position: relative; overflow: hidden;
  background: hsl(var(--blue-h), var(--blue-s), 3%);
}
body.light-theme #map-wrap {
  background: hsl(var(--blue-h), var(--blue-s), 82%);
}
#map-svg { width: 100%; height: 100%; cursor: grab; display: block; }
#map-svg:active { cursor: grabbing; }

/* ── CONTROLS PANEL ── */
#controls {
  position: absolute; top: 14px; right: 14px;
  width: 186px;
  background: hsla(var(--blue-h), var(--blue-s), 12%, 0.96);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  overflow: hidden;
}
body.light-theme #controls {
  background: hsla(var(--white-h), var(--white-s), 95%, 0.96);
}
.ctrl-section {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}
.ctrl-section:last-child { border-bottom: none; }
.ctrl-label {
  font-family: var(--font-mono); font-size: 8px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text); margin-bottom: 7px;
}
.ctrl-tabs { display: flex; gap: 3px; }
.ctrl-tab {
  flex: 1; background: hsla(var(--white-h), var(--white-s), 97%, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text); font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 4px; border-radius: 5px; cursor: pointer;
  transition: all var(--t-fast); text-align: center;
}
.ctrl-tab--sm { font-size: 8px; }
.ctrl-tab:hover { color: var(--text); }
.ctrl-tab.active { color: #fff; }
.ctrl-tab.active[data-stage="1"] { background: var(--gold);     border-color: var(--gold);     color: hsl(var(--blue-h), var(--blue-s), 10%); }
.ctrl-tab.active[data-stage="2"] { background: #a855f7;         border-color: #a855f7;         color: #fff; }
.ctrl-tab.active[data-stage="3"] { background: var(--green-lt); border-color: var(--green-lt); color: hsl(var(--blue-h), var(--blue-s), 10%); }
.ctrl-tab.ffs-active   { background: var(--blue-accent);  border-color: var(--blue-accent); }
.ctrl-tab.score-active { background: var(--green);         border-color: var(--green); }
.ctrl-tab.aco-active   { background: var(--red);            border-color: var(--red); }

.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.toggle-row:last-child { margin-bottom: 0; }
.toggle-label { font-family: var(--font-sans); font-size: 11px; color: var(--text); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ring-swatch { width: 18px; height: 3px; border-radius: 1px; flex-shrink: 0; }
.toggle-switch { position: relative; width: 30px; height: 16px; flex-shrink: 0; display: block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 8px;
  background: hsla(var(--white-h), var(--white-s), 97%, 0.14); cursor: pointer; transition: background .15s;
}
.toggle-switch input:checked + .toggle-track { background: var(--blue-accent-lt); }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text); transition: left .15s; pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.toggle-switch input:checked ~ .toggle-thumb { left: 16px; }

/* ── LEGEND ── */
.legend-row { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.legend-row:last-child { margin-bottom: 0; }
.legend-swatch { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
.legend-swatch.sq { border-radius: 2px; }
.legend-text { font-family: var(--font-mono); font-size: 9px; color: var(--text); letter-spacing: .03em; }
.legend-sub { display: flex; gap: 10px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-color); }
.legend-sub-item { display: flex; align-items: center; gap: 5px; }
.legend-sub-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-sub-text { font-family: var(--font-mono); font-size: 8px; color: var(--text); }

/* ── LEGEND SYMBOL GRID ── */
.dm-legend-grid {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-color);
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px 8px;
}
.dm-legend-item { display: flex; align-items: center; gap: 4px; }
.dm-legend-item--full { grid-column: 1 / -1; }
.dm-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dm-legend-dot--hosp { width: 10px; height: 10px; background: #8a3a30; border: 1px solid var(--red-lt); border-radius: 2px; flex-shrink: 0; }
.dm-legend-dot--sat  { width: 10px; height: 10px; background: #0e4d5e; border: 1.5px solid #2ab5cc; border-radius: 2px; flex-shrink: 0; transform: rotate(45deg); }
.dm-legend-dot--multi   { width: 14px; height: 14px; border: 2px dashed var(--purple-lt); border-radius: 2px; flex-shrink: 0; background: rgba(155,111,208,0.15); }
.dm-legend-dot--multi50 { width: 14px; height: 14px; border: 2px dashed #2ab5cc; border-radius: 2px; flex-shrink: 0; background: rgba(42,181,204,0.12); }
.dm-legend-txt { font-family: var(--font-mono); font-size: 8px; color: var(--text); }

/* ── TOOLTIP ── */
#tooltip {
  position: absolute; pointer-events: none;
  background: hsla(var(--blue-h), var(--blue-s), 10%, 0.98);
  border: 1px solid var(--border-color);
  border-radius: var(--r-sm); padding: 10px 14px;
  font-family: var(--font-sans); font-size: 12px;
  z-index: 300; opacity: 0; transition: opacity .08s;
  min-width: 160px; max-width: 230px;
}
body.light-theme #tooltip {
  background: hsla(var(--white-h), var(--white-s), 95%, 0.98);
}
.tt-name { font-family: var(--font-serif); font-size: 14px; margin-bottom: 7px; color: var(--text); }
.tt-row { display: flex; justify-content: space-between; gap: 12px; color: var(--text); font-size: 11px; line-height: 1.7; }
.tt-row span { color: var(--text); font-family: var(--font-mono); font-size: 10px; }
.tt-badge { display: inline-block; font-family: var(--font-mono); font-size: 8px; padding: 2px 6px; border-radius: 3px; letter-spacing: .05em; margin-top: 5px; }
.tt-badge.p1 { background: rgba(212,168,67,.2); color: var(--gold); }
.tt-badge.p2 { background: rgba(168,85,247,.2); color: #a855f7; }
.tt-badge.p3 { background: rgba(46,204,138,.1); color: var(--green-lt); }
.tt-badge.p4 { background: rgba(90,106,126,.2); color: var(--text); }
.tt-badge.hosp { background: rgba(192,57,43,.18); color: var(--red-lt); }

/* ── ZOOM CONTROLS ── */
#zoom-btns { position: absolute; bottom: 20px; right: 14px; display: flex; flex-direction: column; gap: 4px; z-index: 100; }
.zoom-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: hsla(var(--blue-h), var(--blue-s), 12%, 0.95);
  border: 1px solid var(--border-color);
  color: var(--text); font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast); flex-shrink: 0;
}
body.light-theme .zoom-btn { background: hsla(var(--white-h), var(--white-s), 95%, 0.95); }
.zoom-btn:hover { background: hsla(var(--white-h), var(--white-s), 97%, 0.08); color: var(--text); }
.zoom-btn.reset { font-size: 13px; font-family: var(--font-mono); }

/* ── COMPASS ── */
#compass {
  position: absolute; bottom: 20px; left: 14px; z-index: 100;
  font-family: var(--font-mono); font-size: 9px; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 0;
  opacity: 0.7;
}
#compass svg { width: 24px; height: 24px; }

/* ── LOADING ── */
#loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; z-index: 50;
  background: var(--bg);
}
.load-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border-color); border-top-color: var(--red);
  animation: dm-spin .8s linear infinite; margin-bottom: 14px;
}
@keyframes dm-spin { to { transform: rotate(360deg); } }
.load-text { font-family: var(--font-mono); font-size: 10px; color: var(--text); letter-spacing: .12em; text-transform: uppercase; }
.load-sub  { font-family: var(--font-mono); font-size: 9px; color: var(--border-color); margin-top: 6px; letter-spacing: .08em; }

/* ── ERROR STATE ── */
#error-state {
  position: absolute; inset: 0; display: none; flex-direction: column;
  align-items: center; justify-content: center; z-index: 50;
  background: var(--bg); text-align: center; padding: 40px;
}
#error-state.visible { display: flex; }
.err-title { font-family: var(--font-serif); font-size: 22px; color: var(--red-lt); margin-bottom: 10px; }
.err-body  { font-family: var(--font-mono); font-size: 10px; color: var(--text); line-height: 1.8; max-width: 400px; }


/* ════════════════════════════════════════════════════════
   COUNTY INTEL  ·  body.county-intel
   ════════════════════════════════════════════════════════ */

body.county-intel {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── DASHBOARD TABS in #top-nav ── */
/* #top-nav container + .tn-brand already defined in main.css (shared).
   Only the tab buttons and right label are county-intel-specific. */
.dn-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text);
  padding: 9px 16px; height: 44px;
  transition: all var(--t-fast); white-space: nowrap;
}
.dn-tab:hover { color: var(--text); }
.dn-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
/* county-intel #top-nav matches page bg (no contrast-flip) */
body.county-intel #top-nav { background: var(--bg-card); }
body.light-theme.county-intel #top-nav { background: var(--pale-95); }
/* .dn-tab light mode: dark text on pale bg */
body.light-theme .dn-tab { color: var(--text); }
body.light-theme .dn-tab:hover { color: var(--text); }
body.light-theme .dn-tab.active { color: var(--gold); }
.dn-right { display: none; }

/* ── VIEWS ── */
.view { display: none; padding: 116px 24px 40px; min-height: 100vh; }
/* 56px site-nav + 44px top-nav + 16px gap = 116px */
.view.active { display: block; }

/* ── SECTION HEADER ── */
.view-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.view-title { font-family: var(--font-serif); font-size: 28px; color: var(--text); line-height: 1.1; }
.view-title span { color: var(--red-lt); font-style: italic; }
.view-sub {
  font-family: var(--font-mono); font-size: 10px; color: var(--text);
  letter-spacing: .08em; text-transform: uppercase; margin-top: 4px;
}
.view-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text); text-align: right; }

/* ── SCORE BAR ── */
.score-bar-wrap { display: flex; align-items: center; gap: 7px; }
.score-bar-track { flex: 1; height: 6px; background: var(--border-color); border-radius: 3px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 3px; transition: width .6s ease; }
.score-num { font-family: var(--font-mono); font-size: 11px; font-weight: 500; min-width: 30px; text-align: right; }

/* ── KPI STRIP ── */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--r-md); padding: 14px 16px;
}
.kpi-val { font-family: var(--font-serif); font-size: 28px; font-weight: 700; color: var(--gold); }
.kpi-label { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin-top: 2px; }
.kpi-sub { font-size: 10px; color: var(--text); margin-top: 4px; }

/* ── RANKING TABLE ── */
#view-ranking .filter-row {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
}
.filter-chip {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 20px; padding: 5px 14px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text); cursor: pointer;
  transition: all var(--t-fast);
}
.filter-chip:hover { border-color: var(--text-sub); color: var(--text); }
.filter-chip.active { background: hsla(var(--red-h), var(--red-s), 48%, 0.15); border-color: var(--red); color: var(--red-lt); }
.search-input {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 20px; padding: 5px 14px;
  font-family: var(--font-mono); font-size: 10px; color: var(--text);
  outline: none; width: 180px;
}
.search-input::placeholder { color: var(--text); }
.search-input:focus { border-color: var(--blue-accent); }

.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th {
  background: var(--bg-card); padding: 9px 10px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text); text-align: left;
  border-bottom: 1px solid var(--border-color); white-space: nowrap; cursor: pointer;
}
.rank-table th:hover { color: var(--text); }
.rank-table th.sort-asc::after  { content: ' ↑'; color: var(--red-lt); }
.rank-table th.sort-desc::after { content: ' ↓'; color: var(--red-lt); }
.rank-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.rank-table tr { transition: background var(--t-fast); cursor: pointer; }
.rank-table tr:hover td { background: var(--bg-card); }
.rank-table tr.highlight td { background: hsla(var(--red-h), var(--red-s), 48%, 0.08); }

.rank-num { font-family: var(--font-mono); font-size: 10px; color: var(--text); }
.county-name { font-weight: 600; font-size: 13px; }
.hpsa-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .06em;
  text-transform: uppercase; font-weight: 500;
}
.hpsa-y { background: hsla(var(--green-h), var(--green-s), 49%, 0.12); color: var(--green-lt); border: 1px solid rgba(46,204,138,0.3); }
.hpsa-n { background: var(--border-color); color: var(--text); }
.rural-tag { font-family: var(--font-mono); font-size: 9px; color: var(--text); }

.factor-cell { font-family: var(--font-mono); font-size: 11px; text-align: center; }
.f-10 { color: var(--green-lt); font-weight: 600; }
.f-8  { color: #6ed4a0; }
.f-6  { color: var(--gold); }
.f-4  { color: var(--orange); }
.f-2, .f-1 { color: var(--red-lt); }

/* ── CLUSTER VIEW ── */
#view-clusters .cluster-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cluster-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--r-md); padding: 16px; cursor: pointer;
  transition: all var(--t-base); position: relative; overflow: hidden;
}
.cluster-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.cluster-card:hover { border-color: var(--text-sub); transform: translateY(-2px); }
.cluster-card.rank-1::before     { background: var(--gold); }
.cluster-card.rank-2::before     { background: var(--text-sub); }
.cluster-card.rank-3::before     { background: var(--orange); }
.cluster-card.rank-other::before { background: var(--blue-accent); }
.cluster-card.rank-current::before { background: var(--red); }

.cluster-rank { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text); margin-bottom: 6px; }
.cluster-name { font-family: var(--font-serif); font-size: 17px; line-height: 1.2; margin-bottom: 4px; }
.cluster-corridor { font-family: var(--font-mono); font-size: 9px; color: var(--blue-accent-lt); margin-bottom: 10px; }
.cluster-score-big { font-family: var(--font-serif); font-size: 36px; font-weight: 700; color: var(--gold); line-height: 1; }
.cluster-meta-row { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.cluster-meta-item { text-align: center; }
.cluster-meta-val { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text); }
.cluster-meta-label { font-family: var(--font-mono); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin-top: 1px; }
.cluster-counties-list { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.cluster-county-pill {
  display: inline-block; margin: 2px 2px 0 0; padding: 2px 8px; border-radius: 10px;
  font-family: var(--font-mono); font-size: 9px;
  background: hsla(var(--white-h), var(--white-s), 97%, 0.08); color: var(--text);
}
.cluster-county-pill.top { background: hsla(var(--red-h), var(--red-s), 48%, 0.15); color: var(--red-lt); }
.cluster-note {
  margin-top: 10px; padding: 8px 10px; border-radius: 6px;
  background: hsla(var(--white-h), var(--white-s), 97%, 0.03); border: 1px solid var(--border-color);
  font-size: 11px; color: var(--text); line-height: 1.5;
}
.current-tag {
  position: absolute; top: 12px; right: 12px;
  background: var(--red); color: white;
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 4px;
}

/* ── SCORING MODEL VIEW ── */
#view-model .model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.factor-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 16px; }
.factor-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.factor-card-name { font-weight: 600; font-size: 13px; }
.factor-weight { font-family: var(--font-mono); font-size: 20px; font-weight: 500; color: var(--gold); }
.factor-desc { font-size: 11px; color: var(--text); line-height: 1.5; margin-bottom: 12px; }
.factor-table { width: 100%; border-collapse: collapse; }
.factor-table td { padding: 5px 8px; border-bottom: 1px solid var(--border-color); font-family: var(--font-mono); font-size: 10px; }
.factor-table td:first-child { color: var(--gold); font-weight: 600; width: 30px; }
.factor-table td:last-child { color: var(--text); }
.factor-source {
  margin-top: 10px; padding: 6px 8px; border-radius: 5px;
  background: hsla(var(--blue-accent-h), var(--blue-accent-s), 41%, 0.15);
  border-left: 2px solid var(--blue-accent);
  font-family: var(--font-mono); font-size: 9px; color: var(--blue-accent-lt);
}
.factor-pending {
  margin-top: 10px; padding: 6px 8px; border-radius: 5px;
  background: hsla(var(--gold-h), var(--gold-s), 48%, 0.15);
  border-left: 2px solid var(--gold);
  font-family: var(--font-mono); font-size: 9px; color: var(--gold);
}
.modifier-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--r-md); padding: 16px; margin-bottom: 14px;
  border-left: 3px solid var(--purple-lt); grid-column: 1 / -1;
}
.modifier-title { font-family: var(--font-serif); font-size: 16px; margin-bottom: 8px; }
.modifier-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.modifier-table th {
  background: rgba(107,63,160,0.15); padding: 7px 10px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--purple-lt); text-align: left;
}
.modifier-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-color); font-family: var(--font-mono); font-size: 10px; color: var(--text); }
.weight-visual { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 20px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); }
.weight-block { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.weight-fill-v { width: 100%; border-radius: 4px; transition: height .8s ease; }
.weight-label-v { font-family: var(--font-mono); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--text); text-align: center; line-height: 1.3; }
.weight-pct-v { font-family: var(--font-mono); font-size: 11px; color: var(--gold); font-weight: 600; }

/* ── COUNTY DETAIL VIEW ── */
#view-detail .detail-search-row { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; }
.detail-search {
  flex: 1; max-width: 320px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--r-sm); padding: 10px 16px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text); outline: none;
}
.detail-search:focus { border-color: var(--blue-accent); }
.detail-suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--r-sm); max-height: 200px; overflow-y: auto;
}
.detail-sugg-item { padding: 8px 14px; cursor: pointer; font-family: var(--font-mono); font-size: 11px; transition: background var(--t-fast); }
.detail-sugg-item:hover { background: var(--bg-card); color: var(--red-lt); }
.detail-wrap { position: relative; }

#county-detail-panel { display: grid; grid-template-columns: 280px 1fr; gap: 14px; }
.detail-left { display: flex; flex-direction: column; gap: 12px; }
.detail-hero { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 20px; text-align: center; }
.detail-rank-big { font-family: var(--font-serif); font-size: 60px; color: var(--red-lt); line-height: 1; margin-bottom: 4px; }
.detail-county-name { font-family: var(--font-serif); font-size: 22px; margin-bottom: 2px; }
.detail-score-big { font-family: var(--font-mono); font-size: 32px; font-weight: 500; color: var(--gold); margin-top: 8px; }
.detail-score-label { font-family: var(--font-mono); font-size: 9px; color: var(--text); text-transform: uppercase; letter-spacing: .08em; }
.detail-tags { display: flex; gap: 6px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.detail-stats { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 14px; }
.detail-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border-color); }
.detail-stat-row:last-child { border-bottom: none; }
.detail-stat-label { font-family: var(--font-mono); font-size: 9px; color: var(--text); text-transform: uppercase; letter-spacing: .06em; }
.detail-stat-val { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text); }
.detail-right { display: flex; flex-direction: column; gap: 12px; }
.factor-breakdown { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 16px; }
.factor-breakdown-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text); margin-bottom: 14px; }
.fb-row { display: grid; grid-template-columns: 140px 1fr 40px 30px; align-items: center; gap: 10px; margin-bottom: 10px; }
.fb-label { font-size: 11px; color: var(--text); }
.fb-sub { font-size: 9px; color: var(--text); font-family: var(--font-mono); }
.fb-bar-track { height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.fb-bar-fill { height: 100%; border-radius: 4px; transition: width .8s ease; }
.fb-score { font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-align: center; }
.fb-weight { font-family: var(--font-mono); font-size: 9px; color: var(--text); text-align: right; }
.cluster-context { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 14px; }
.no-selection { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 300px; color: var(--text); gap: 10px; }
.no-selection-icon { font-size: 48px; opacity: .3; }
.no-selection-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* ── MAP VIEW ── */
#view-map { padding-top: 116px; }
#map-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; height: calc(100vh - 130px); min-height: 600px; }
#map-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); position: relative; overflow: hidden; }
#map-svg { width: 100%; height: 100%; cursor: default; }
.county-path { stroke: var(--bg); stroke-width: 0.5px; transition: opacity .15s; cursor: pointer; }
.county-path:hover { opacity: 0.8; stroke: var(--text); stroke-width: 1.2px; }
.county-path.selected { stroke: var(--text); stroke-width: 1.8px; opacity: 1 !important; }
.state-border { fill: none; stroke: hsla(var(--white-h), var(--white-s), 97%, 0.15); stroke-width: 1.5px; pointer-events: none; }
#map-tooltip {
  position: absolute; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--r-sm);
  padding: 10px 13px; font-family: var(--font-mono); font-size: 10px;
  pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 20;
  min-width: 180px; max-width: 240px;
}
#map-tooltip.visible { opacity: 1; }
.tt-val { color: var(--text); font-weight: 500; }

#map-legend {
  position: absolute; bottom: 14px; left: 14px;
  background: hsla(var(--blue-h), var(--blue-s), 5%, 0.88);
  border: 1px solid var(--border-color); border-radius: var(--r-sm);
  padding: 10px 13px; font-family: var(--font-mono); font-size: 9px;
}
.leg-title { text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin-bottom: 8px; }
.leg-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; color: var(--text); }
.leg-swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }

#map-filter-bar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.map-filter-btn {
  background: hsla(var(--blue-h), var(--blue-s), 5%, 0.85);
  border: 1px solid var(--border-color); border-radius: 14px;
  padding: 4px 12px; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text);
  cursor: pointer; transition: all var(--t-fast); backdrop-filter: blur(6px);
}
.map-filter-btn:hover { color: var(--text); border-color: var(--text-sub); }
.map-filter-btn.active { background: var(--red); border-color: var(--red); color: white; }
body.light-theme #map-legend {
  background: hsla(var(--white-h), var(--white-s), 97%, 0.92);
  border-color: var(--border-color);
}
body.light-theme .map-filter-btn {
  background: hsla(var(--white-h), var(--white-s), 97%, 0.90);
  border-color: var(--border-color);
  color: var(--text);
}
body.light-theme .map-filter-btn:hover { color: var(--text); border-color: var(--text-sub); }
body.light-theme .map-filter-btn.active { background: var(--red); border-color: var(--red); color: white; }

#map-right-panel { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
#map-county-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 16px; min-height: 200px; }
.map-no-selection { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 180px; color: var(--text); gap: 8px; text-align: center; }
#map-top-counties { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 14px; flex: 1; overflow-y: auto; }
.map-top-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background var(--t-fast); border-radius: 4px; }
.map-top-row:hover { background: hsla(var(--white-h), var(--white-s), 97%, 0.08); }
.map-top-row:last-child { border-bottom: none; }
.map-top-rank { font-family: var(--font-mono); font-size: 10px; color: var(--text); width: 24px; }
.map-top-name { flex: 1; font-size: 12px; font-weight: 500; }
.map-top-score { font-family: var(--font-mono); font-size: 11px; }
.map-top-bar { flex: 1; height: 4px; background: var(--border-color); border-radius: 2px; overflow: hidden; }
.map-top-fill { height: 100%; border-radius: 2px; }

.region-toggle-btn { border-color: hsla(258, 48%, 50%, 0.5) !important; }
.region-toggle-btn.active { background: hsl(258,48%,50%) !important; border-color: hsl(258,48%,69%) !important; color: var(--pale-97) !important; }
body.light-theme .region-toggle-btn.active { color: var(--pale-97) !important; }

.region-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--r-md); padding: 13px 14px;
  margin-bottom: 0; cursor: pointer;
  transition: border-color var(--t-base), background var(--t-fast);
  position: relative; overflow: hidden;
}
.region-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.region-card:hover { background: var(--bg); border-color: var(--border-mid); }
.region-card.active-region { background: hsla(var(--white-h), var(--white-s), 97%, 0.03); }

.region-card-header {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px;
}
.region-card-name { font-family: var(--font-serif); font-size: 14px; line-height: 1.2; }
.region-card-sub { font-family: var(--font-mono); font-size: 9px; color: var(--text); margin-top: 2px; }
.firara-badge {
  background: hsla(var(--red-h), var(--red-s), 48%, 0.15);
  border: 1px solid var(--red); color: var(--red-lt);
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 4px;
  white-space: nowrap; flex-shrink: 0;
}
.region-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 8px;
}
.region-stat { background: var(--bg); border-radius: 5px; padding: 6px 8px; }
.region-stat-val { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text); line-height: 1; }
.region-stat-lbl { font-family: var(--font-mono); font-size: 8px; text-transform: uppercase; color: var(--text); margin-top: 2px; letter-spacing: .04em; }
.region-progress-wrap { margin-top: 8px; }
.region-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.region-progress-label { font-family: var(--font-mono); font-size: 9px; color: var(--text); text-transform: uppercase; letter-spacing: .05em; }
.region-progress-val { font-family: var(--font-mono); font-size: 10px; font-weight: 600; }
.region-progress-track { height: 7px; background: var(--border-color); border-radius: 4px; overflow: visible; position: relative; }
.region-progress-fill { height: 100%; border-radius: 4px; transition: width .9s cubic-bezier(.4,0,.2,1); }
.region-milestone-line { position: absolute; top: -3px; bottom: -3px; width: 1.5px; background: hsla(var(--white-h), var(--white-s), 97%, 0.5); border-radius: 1px; }
.region-milestone-label { position: absolute; top: -16px; font-family: var(--font-mono); font-size: 8px; color: hsla(var(--white-h), var(--white-s), 97%, 0.6); white-space: nowrap; transform: translateX(-50%); }
.region-card-desc { margin-top: 8px; font-size: 10px; color: var(--text); line-height: 1.45; border-top: 1px solid var(--border-color); padding-top: 7px; }
.region-summary-bar {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 10px; padding: 10px 12px;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md);
}
.region-summary-item { text-align: center; }
.region-summary-val { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text); }
.region-summary-lbl { font-family: var(--font-mono); font-size: 8px; text-transform: uppercase; color: var(--text); letter-spacing: .05em; margin-top: 1px; }

/* ── SCROLLBAR ── */
body.county-intel ::-webkit-scrollbar { width: 6px; height: 6px; }
body.county-intel ::-webkit-scrollbar-track { background: var(--bg); }
body.county-intel ::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }

/* ── ANIMATIONS ── */
@keyframes ci-fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.view.active > * { animation: ci-fadeUp .3s ease both; }
.view.active > *:nth-child(2) { animation-delay: .05s; }
.view.active > *:nth-child(3) { animation-delay: .1s; }
.view.active > *:nth-child(4) { animation-delay: .15s; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) { #view-clusters .cluster-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 800px) {
  #view-clusters .cluster-grid { grid-template-columns: 1fr; }
  #county-detail-panel { grid-template-columns: 1fr; }
  #view-model .model-grid { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2,1fr); }
  .view { padding-left: 16px; padding-right: 16px; }
}

/* ═══════════════════════════════════════════════════════
   FINANCIAL MODEL · body.financial-model
   ═══════════════════════════════════════════════════════ */

/* Page-local shorthand tokens */
body.financial-model {
  --fm-ink-3:    hsl(var(--blue-h), var(--blue-s), 15%);
  --fm-steel:    hsla(var(--white-h), var(--white-s), 97%, 0.22);
  --fm-gold-dim: hsla(var(--gold-h), var(--gold-s), 48%, 0.09);
  --fm-green-dim:hsla(var(--green-h), var(--green-s), 36%, 0.10);
  --fm-blue-dim: hsla(var(--blue-accent-h), var(--blue-accent-s), 41%, 0.10);
  --fm-red-dim:  hsla(var(--red-h), var(--red-s), 48%, 0.10);
}

/* #top-nav matches page bg (no contrast-flip) */
body.financial-model #top-nav { background: var(--bg-card); }
body.light-theme.financial-model #top-nav { background: var(--pale-95); }

/* Tab bar inside #top-nav */
.tabs { display: flex; align-items: center; gap: 2px; height: 100%; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text);
  padding: 9px 16px; height: 44px;
  transition: all var(--t-fast); white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
body.light-theme .tab { color: var(--text); }
body.light-theme .tab:hover { color: var(--text); }
body.light-theme .tab.active { color: var(--gold); }

/* SCENARIO BAR */
.sc-bar {
  background: var(--fm-ink-3);
  border-bottom: 1px solid var(--border-color);
  padding: 9px 32px;
  margin-top: 44px; /* offset for fixed #top-nav (out of flow) */
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  position: sticky; top: 100px; z-index: 199;
}
body.light-theme .sc-bar { background: var(--pale-95); }
.sc-label { font-family: var(--font-mono); font-size: 9px; color: var(--text); letter-spacing: .12em; text-transform: uppercase; }
.sc-group { display: flex; align-items: center; gap: 8px; }
.sc-btns { display: flex; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; overflow: hidden; }
.sc-btn { background: none; border: none; border-right: 1px solid var(--border-color); padding: 6px 12px; font-family: var(--font-mono); font-size: 10px; color: var(--text); cursor: pointer; transition: all .13s; letter-spacing: .04em; }
.sc-btn:last-child { border-right: none; }
.sc-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.sc-btn.active { color: var(--gold); background: var(--fm-gold-dim); }
body.light-theme .sc-btn:hover { background: rgba(0,0,0,0.04); }
body.light-theme .sc-btn.active { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.08); }
.sc-readout { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text); }
.sc-readout strong { color: var(--text); }
.sc-pill { font-family: var(--font-mono); font-size: 9px; background: hsla(var(--green-h), var(--green-s), 49%, 0.12); color: var(--green-lt); border: 1px solid hsla(var(--green-h), var(--green-s), 49%, 0.25); border-radius: 3px; padding: 3px 8px; }

/* PANELS */
body.financial-model .panel { display: none; padding: 40px 32px 24px; max-width: 1280px; margin: 0 auto; }
body.financial-model .panel.active { display: block; }
.eyebrow { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.section-title { font-family: var(--font-serif); font-size: 24px; color: var(--text); letter-spacing: -0.01em; margin-bottom: 18px; }
.section-title em { color: var(--green-lt); }
hr.rule { border: none; border-top: 1px solid var(--border-color); margin: 22px 0; }

/* KPI STRIP */
.kpi-strip { display: grid; grid-template-columns: repeat(6,1fr); gap: 1px; background: var(--border-color); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.kpi { background: var(--bg-card); padding: 14px; }
.kpi-val { font-family: var(--font-serif); font-size: 22px; color: var(--text); margin-bottom: 4px; }
.kpi-lbl { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; color: var(--text); }
.kpi-sub { font-family: var(--font-mono); font-size: 9px; color: var(--fm-steel); margin-top: 3px; }
.pos { color: var(--green-lt) !important; } .neg { color: var(--red-lt) !important; }
.wh { color: var(--text) !important; }

/* REVENUE TABLE */
.tbl-wrap { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tbl thead th { background: var(--fm-ink-3); padding: 9px 12px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--text); border-bottom: 1px solid var(--border-mid); font-weight: 400; text-align: right; }
.tbl thead th:first-child { text-align: left; width: 36%; }
.tbl thead th.yr1 { color: var(--red-lt); } .tbl thead th.yr2 { color: var(--blue-accent-lt); } .tbl thead th.yr3 { color: var(--green-lt); }
.tbl td { padding: 7px 12px; font-family: var(--font-mono); font-size: 11px; color: var(--text); border-bottom: 1px solid var(--border-color); text-align: right; }
.tbl td:first-child { text-align: left; color: var(--text); font-family: var(--font-sans); font-size: 12px; padding-left: 12px; }
.tbl td.indent { padding-left: 28px; }
.tbl td.indent2 { padding-left: 44px; }
.tbl tr.group-hdr td { background: var(--fm-ink-3); color: var(--gold); font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; padding: 7px 12px; }
.tbl tr.sub-hdr td { background: rgba(255,255,255,0.02); color: var(--orange-lt); font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; padding: 6px 12px 6px 28px; }
.tbl tr.subtotal td { background: var(--fm-gold-dim); color: var(--text); font-weight: 500; border-top: 1px solid var(--border-mid); }
.tbl tr.cogs-total td { background: var(--fm-red-dim); color: var(--red-lt); font-weight: 500; }
.tbl tr.anc-net td { background: var(--fm-blue-dim); color: var(--blue-accent-lt); font-weight: 500; }
.tbl tr.denial-row td { color: var(--red-lt); }
.tbl tr.total-rev td { background: var(--fm-green-dim); color: var(--green-lt); font-weight: 700; font-size: 12px; border-top: 1px solid var(--border-mid); }
.tbl tr.exp-total td { background: var(--fm-red-dim); color: var(--red-lt); font-weight: 500; }
.tbl tr.ebitda-row td { background: hsla(var(--green-h), var(--green-s), 36%, 0.10); color: var(--green-lt); font-weight: 700; border-top: 1px solid var(--border-mid); border-bottom: 1px solid var(--border-mid); }
.tbl tr.net-row td { background: hsla(var(--green-h), var(--green-s), 36%, 0.16); color: var(--green-lt); font-weight: 700; }
.tbl tr:last-child td { border-bottom: none; }
.pct-cell { color: var(--fm-steel); font-size: 9.5px; text-align: right; }

/* CHART */
.chart-wrap { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; overflow: hidden; }
.chart-label { font-family: var(--font-mono); font-size: 9px; color: var(--text); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }

/* MONTHLY TABLE */
.pl-wrap { overflow-x: auto; }
.pl-tbl { width: 100%; border-collapse: collapse; font-size: 10.5px; min-width: 900px; }
.pl-tbl thead th { background: var(--fm-ink-3); padding: 7px 9px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--text); border-bottom: 1px solid var(--border-mid); font-weight: 400; text-align: right; white-space: nowrap; }
.pl-tbl thead th:nth-child(-n+3) { text-align: left; }
.pl-tbl td { padding: 5px 9px; font-family: var(--font-mono); font-size: 10px; color: var(--text); border-bottom: 1px solid var(--border-color); text-align: right; white-space: nowrap; }
.pl-tbl td:nth-child(-n+3) { text-align: left; }
.pl-tbl tr.yr-hdr td { background: var(--fm-ink-3); color: var(--gold); font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; padding: 6px 9px; text-align: left; }
.pl-tbl tr.yr-tot td { background: var(--fm-gold-dim); font-weight: 500; color: var(--text); border-top: 1px solid var(--border-mid); }

/* CLINIC GRID */
.clinic-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 10px; margin-bottom: 18px; }
.clinic-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; padding: 12px 14px; }
.clinic-name { font-family: var(--font-sans); font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.clinic-detail { font-family: var(--font-mono); font-size: 9.5px; color: var(--text); line-height: 1.8; }

/* STAGE CARDS */
.stage-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; margin-bottom: 18px; }
.stage-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.stage-hdr { padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
.stage-label { font-family: var(--font-serif); font-size: 14px; }
.stage-range { font-family: var(--font-mono); font-size: 8.5px; color: var(--text); margin-top: 2px; }
.stage-pmpm { font-family: var(--font-mono); font-size: 18px; font-weight: 500; margin-top: 5px; }
.stage-body { padding: 8px 12px; }
.stage-role { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--border-color); font-family: var(--font-mono); font-size: 9px; }
.stage-role:last-child { border-bottom: none; }
.stage-foot { display: flex; justify-content: space-between; padding: 7px 12px; background: var(--fm-gold-dim); font-family: var(--font-mono); font-size: 10px; }

/* ASSUMPTIONS */
.assum-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 12px; margin-bottom: 18px; }
.assum-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 14px 16px; }
.assum-title { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin-bottom: 10px; }
.assum-row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--border-color); font-size: 11.5px; gap: 8px; }
.assum-row:last-child { border-bottom: none; }
.assum-k { color: var(--text); font-family: var(--font-sans); }
.assum-v { color: var(--text); font-family: var(--font-mono); font-size: 10.5px; text-align: right; }

/* DISCLOSURE */
.disc { background: var(--fm-red-dim); border-left: 3px solid var(--red-lt); border-radius: 4px; padding: 9px 14px; font-family: var(--font-mono); font-size: 9.5px; color: var(--text); line-height: 1.65; margin-bottom: 16px; }
.disc strong { color: var(--red-lt); }
.info-box { background: var(--fm-blue-dim); border-left: 3px solid var(--blue-accent-lt); border-radius: 4px; padding: 9px 14px; font-family: var(--font-mono); font-size: 9.5px; color: var(--text); line-height: 1.65; margin-bottom: 14px; }
.info-box strong { color: var(--blue-accent-lt); }
.footnote { font-family: var(--font-mono); font-size: 9px; color: var(--fm-steel); line-height: 1.7; margin-top: 12px; }

/* CAPEX TAB */
.phase-pill { display: inline-block; font-family: var(--font-mono); font-size: 8px; padding: 2px 7px; border-radius: 3px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.ph-d1 { background: hsla(var(--green-h), var(--green-s), 36%, 0.15); color: var(--green-lt); }
.ph-m2 { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.15); color: var(--gold-lt); }
.ph-m3 { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.18); color: var(--orange-lt); }
.ph-m6 { background: hsla(var(--blue-accent-h), var(--blue-accent-s), 41%, 0.15); color: var(--blue-accent-lt); }
.ph-m9 { background: hsla(var(--purple-h), var(--purple-s), 50%, 0.15); color: var(--purple-lt); }
.capex-cat-hdr { background: var(--fm-ink-3); color: var(--text); font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .08em; padding: 9px 14px; border-bottom: 1px solid var(--border-mid); }
.capex-cat-hdr .life-badge { font-size: 9px; color: var(--text); font-weight: 400; margin-left: 10px; }
.capex-subtotal { background: var(--fm-gold-dim) !important; color: var(--gold) !important; font-weight: 500; }
.capex-grand { background: var(--fm-green-dim) !important; color: var(--green-lt) !important; font-weight: 700; font-size: 12px !important; }
.depr-tbl td, .depr-tbl th { padding: 7px 12px; font-family: var(--font-mono); font-size: 11px; text-align: right; border-bottom: 1px solid var(--border-color); }
.depr-tbl th { background: var(--fm-ink-3); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text); font-weight: 400; }
.depr-tbl td:first-child, .depr-tbl th:first-child { text-align: left; color: var(--text); font-family: var(--font-sans); font-size: 12px; }
.depr-note { font-family: var(--font-mono); font-size: 10px; color: var(--fm-steel); background: var(--fm-ink-3); border-left: 3px solid var(--orange); padding: 8px 12px; border-radius: 3px; margin-top: 14px; line-height: 1.65; }
@keyframes flash { 0%,100% { background: transparent } 40% { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.12) } }
.flash { animation: flash .4s ease; }

/* Light theme overrides */
body.light-theme.financial-model .tbl tr.sub-hdr td { background: rgba(0,0,0,0.02); }
body.light-theme.financial-model .sc-btn:hover { background: rgba(0,0,0,0.04); }
body.light-theme.financial-model .fm-ink-3,
body.light-theme.financial-model .tbl thead th,
body.light-theme.financial-model .tbl tr.group-hdr td,
body.light-theme.financial-model .pl-tbl thead th,
body.light-theme.financial-model .pl-tbl tr.yr-hdr td,
body.light-theme.financial-model .capex-cat-hdr,
body.light-theme.financial-model .depr-tbl th,
body.light-theme.financial-model .depr-note { background: var(--pale-95); }


/* ═══════════════════════════════════════════════════════
   BOOK STAGE-1 · body.stage-1  (sticky card stack)
   ═══════════════════════════════════════════════════════ */

body.stage-1 .slide {
  min-height: 100vh;
}
/* Title slide: stays full dark navy */
body.stage-1 .slide-title { background: var(--blue-10); color: var(--pale-97); }
body.light-theme.stage-1 .slide-title { background: var(--pale-97); color: var(--blue-10); }

/* Header band: inverted like presentation */
body.stage-1 .slide-header { background: var(--pale-97); color: var(--blue-10); }
body.light-theme.stage-1 .slide-header { background: var(--blue-10); color: var(--pale-97); }
body.light-theme.stage-1 .slide-header .sh-eyebrow { color: rgba(245,249,253,0.50); }
body.light-theme.stage-1 .slide-header .sh-title   { color: var(--pale-97); }
body.light-theme.stage-1 .slide-header .sh-desc    { color: rgba(245,249,253,0.60); }
body.light-theme.stage-1 .slide-header .sh-right   { color: rgba(245,249,253,0.50); }

/* Spacer (scroll dwell) */
body.stage-1 .slide-spacer { display: block; }

/* Nav-dot active state */
body.stage-1 #nav-rail .nav-dot.active { background: var(--gold); transform: scale(1.4); }

/* ═══════════════════════════════════════════════════════
   PRESENTATION · body.presentation
   ═══════════════════════════════════════════════════════ */

body.presentation {
  /* Alias old inline-style vars to design tokens */
  --navy:   var(--blue-10);
  --amber:  var(--orange);
  --rust:   var(--red);
  --pale:   var(--bg-card);
  --dark:   var(--text);
  --mid:    var(--text-sub);
  --soft:   var(--text-faint);
  --border: var(--border-color);
  --white:  var(--bg);
  --slide-w: 100%;
  --slide-h: auto;

  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

/* ── Dot navigation (right-side fixed) ── */
#pres-dot-nav {
  position: fixed; right: 24px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9990;
  height: auto; padding: 0; background: transparent;
  border-bottom: none; width: auto;
}
#pres-dot-nav a {
  width: 10px; height: 10px;
  background: hsla(45,74%,55%,0.4);
  border-radius: 50%; display: block;
  text-decoration: none; transition: background .2s;
}
#pres-dot-nav a:hover { background: var(--gold); }
#pres-dot-nav a.group-dot { background: var(--pale-97); }
body.light-theme #pres-dot-nav a.group-dot { background: var(--blue-10); }
#pres-dot-nav a.group-dot:hover { background: var(--gold); }
#pres-dot-nav a.group-dot.active { background: var(--gold); }
#pres-dot-nav a.active {
  background: var(--gold);
  transform: scale(1.5);
  box-shadow: 0 0 8px hsla(45,74%,55%,0.6);
}

/* ── Deck wrapper ── */
#deck {
  display: block;
  gap: 0; padding: 0;
  width: 100%; max-width: none;
  background: var(--bg);
}
/* Empty spacer injected after each slide for scroll dwell — height set by JS */
#deck .slide-spacer { display: block; }

/* ── Slide (sticky card stack) ── */
body.presentation .slide {
  width: 100%;
  height: calc(100vh - var(--nav-h, 56px));
  min-height: unset;
  position: sticky;
  top: var(--nav-h, 56px);
  overflow: hidden;
  page-break-after: always; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg);
}

/* Slide number badge */
.slide-num {
  display: block; width: 100%; padding: 10px 0;
  text-align: center; font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.6); letter-spacing: 4px;
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.07);
  border-top: 1px solid rgba(255,255,255,0.12);
}
.slide-num::before { content: '— '; }
.slide-num::after  { content: ' —'; }

/* ── Title slide ── */
body.presentation .slide-title {
  background: var(--blue-10);
  align-items: center; justify-content: center;
  height: calc(100vh - var(--nav-h, 56px));
  min-height: unset;
  display: flex; flex-direction: column;
  overflow: hidden;
}
body.light-theme.presentation .slide-title { background: var(--pale-97); }
body.presentation .title-inner {
  position: relative; z-index: 2;
  max-width: 860px; padding: 60px 48px; text-align: center; margin: auto;
  display: flex; flex-direction: column; align-items: center;
}
body.presentation .title-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text); margin-bottom: 28px; background: none;
}
body.light-theme.presentation .title-eyebrow { color: var(--text); }
body.presentation .title-brand {
  font-family: var(--font-serif); font-size: clamp(46px,7vw,80px);
  font-weight: 700; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 4px;
  background: linear-gradient(90deg, var(--gold), var(--red));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
body.presentation .title-brand span {
  display: block; font-size: clamp(24px,4vw,44px);
  font-weight: 300; letter-spacing: .08em;
  background: none; -webkit-text-fill-color: rgba(245,249,253,0.75); color: rgba(245,249,253,0.75);
}
body.light-theme.presentation .title-brand span { -webkit-text-fill-color: rgba(5,14,46,0.65); color: rgba(5,14,46,0.65); }
body.presentation .title-sub {
  font-family: var(--font-serif); font-size: clamp(13px,1.6vw,18px);
  font-style: italic; color: rgba(255,255,255,0.45); margin-bottom: 32px;
}
body.light-theme.presentation .title-sub { color: rgba(5,14,46,0.55); }
body.presentation .title-date {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255,255,255,0.35); margin-bottom: 40px;
}
body.light-theme.presentation .title-date { color: rgba(5,14,46,0.45); }
body.presentation .title-divider {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, var(--red), var(--gold));
  margin: 0 auto 28px;
}
body.presentation .title-meta-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 1px; background: rgba(255,255,255,0.07);
  border-radius: 10px; overflow: hidden;
  max-width: 720px; margin: 0 auto 44px;
}
body.light-theme.presentation .title-meta-grid { background: rgba(5,14,46,0.08); }
body.presentation .title-meta-cell {
  background: rgba(255,255,255,0.04); padding: 16px 18px; text-align: left;
}
body.light-theme.presentation .title-meta-cell { background: rgba(5,14,46,0.04); }
body.presentation .title-meta-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em;
  color: rgba(255,255,255,0.35); text-transform: uppercase; margin-bottom: 4px;
}
body.light-theme.presentation .title-meta-label { color: rgba(5,14,46,0.45); }
body.presentation .title-meta-val {
  font-family: var(--font-serif); font-size: 13.5px;
  color: var(--pale-97); line-height: 1.3;
}
body.light-theme.presentation .title-meta-val { color: var(--blue-10); }
body.presentation .title-footer {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .10em;
  text-transform: uppercase; color: rgba(255,255,255,0.18); margin-top: auto;
}
body.light-theme.presentation .title-footer { color: rgba(5,14,46,0.20); }
body.presentation .title-opp-box { background: none; color: var(--pale-97); }
body.light-theme.presentation .title-opp-box { background: none; color: var(--blue-10); }

/* ── Header band — inverts page bg ── */
body.presentation .header-band {
  background: var(--pale-97);
  padding: 22px 48px 22px;
  position: relative;
  display: flex;
  align-items: center;
}

/* ── Slide page number ── */
.slide-pg {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .10em;
  color: var(--blue-10);
  opacity: 0.45;
  padding-left: 20px;
  flex-shrink: 0;
}
body.light-theme.presentation .slide-pg { color: var(--pale-97); }
.slide-pg-abs {
  position: absolute;
  top: 18px;
  right: 28px;
  padding-left: 0;
  z-index: 10;
  color: var(--pale-97);
}
body.light-theme.presentation .slide-pg-abs { color: var(--blue-10); }
body.light-theme.presentation .header-band { background: var(--blue-10); }
body.presentation .header-band::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--gold) 60%, transparent 100%);
}
body.presentation .header-band h1 {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.6vw, 29px);
  font-weight: 700; color: var(--blue-10);
  letter-spacing: -0.02em;
  line-height: 1.2;
  flex: 1;
}
body.light-theme.presentation .header-band h1 { color: var(--pale-97); }
body.presentation .header-band h1 span { color: var(--orange); font-weight: 400; font-style: italic; }
body.light-theme.presentation .header-band h1 span { color: var(--gold); }

/* ── Content areas ── */
.content, .content-gray { padding: 44px 56px 24px; background: var(--bg); color: var(--text); }
body.presentation .content, body.presentation .content-gray { flex: 1; min-height: 0; overflow-y: auto; width: 1200px; max-width: 100%; scrollbar-width: none; }
body.presentation .content::-webkit-scrollbar, body.presentation .content-gray::-webkit-scrollbar { display: none; }
body.presentation .header-band { width: 100%; }

/* ── Card grids (scoped to avoid conflict with equipment-stack) ── */
body.presentation .card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
body.presentation .card-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
body.presentation .card-grid-5 { display: grid; grid-template-columns: repeat(5,1fr); gap: 16px; }

/* ── Cards ── */
body.presentation .card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 8px; padding: 24px; position: relative;
}
body.presentation .card h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
body.presentation .card p, body.presentation .card li { font-size: 13px; color: var(--text); line-height: 1.55; }
body.presentation .card ul { list-style: none; padding: 0; }
body.presentation .card ul li::before { content: "✓ "; color: var(--gold); }
body.presentation .card-dark { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 24px; }
.card-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--text); text-transform: uppercase; margin-bottom: 6px; }

/* ── Thesis rows ── */
.thesis-row { display: flex; align-items: flex-start; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border-color); }
.thesis-row:last-child { border-bottom: none; }
.thesis-icon { width: 44px; height: 44px; background: var(--pale-97); border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; }
body.light-theme.presentation .thesis-icon { background: var(--blue-10); }
body.presentation .spark-circle { background: var(--pale-97); color: var(--blue-10); }
body.light-theme.presentation .spark-circle { background: var(--blue-10); color: var(--gold); }
.thesis-row p { font-size: 18px; color: var(--text); line-height: 1.4; }
body.presentation .tam-card { background: var(--bg-card); border: 1px solid var(--border-color); }
body.presentation .tam-label { color: var(--text); }
body.presentation .tam-body { border-left: 1px solid var(--border-color); }
body.presentation .tam-title { color: var(--text); }
body.presentation .tam-desc { color: var(--text); }
body.light-theme.presentation .tam-card { background: var(--blue-10); border-color: transparent; }
body.light-theme.presentation .tam-label { color: rgba(245,249,253,0.55); }
body.light-theme.presentation .tam-body { border-left-color: rgba(255,255,255,0.12); }
body.light-theme.presentation .tam-title { color: rgba(245,249,253,0.9); }
body.light-theme.presentation .tam-desc { color: rgba(255,255,255,0.65); }
body.presentation .org-inc-header { background: var(--pale-97); }
body.presentation .org-inc-title { color: var(--blue-10); }
body.presentation .org-inc-sub { color: rgba(5,14,46,0.60); }
body.light-theme.presentation .org-inc-header { background: var(--blue-10); }
body.light-theme.presentation .org-inc-title { color: var(--pale-97); }
body.light-theme.presentation .org-inc-sub { color: rgba(245,249,253,0.70); }
body.presentation .donut-ring { background: conic-gradient(var(--pale-97) 0% 80%, var(--gold) 80% 100%); }
body.presentation .donut-hole { background: var(--bg-card); color: var(--text); }
body.presentation .donut-swatch { background: var(--pale-97); }
body.light-theme.presentation .donut-ring { background: conic-gradient(var(--blue-10) 0% 80%, var(--gold) 80% 100%); }
body.light-theme.presentation .donut-hole { background: var(--pale-97); color: var(--blue-10); }
body.light-theme.presentation .donut-swatch { background: var(--blue-10); }
.thesis-row p strong { color: var(--gold); font-weight: 700; }

/* ── Stat big ── */
.stat-big { font-size: 48px; font-weight: 800; color: var(--gold); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* ── Members hub (Purpose & Constituents slide) ── */
body.presentation .members-hub { background: var(--blue-10); border: 6px solid rgba(255,255,255,0.12); }
body.presentation .members-hub-text { color: var(--pale-97); }
body.light-theme.presentation .members-hub { background: var(--pale-97); border-color: rgba(9,27,91,0.12); }
body.light-theme.presentation .members-hub-text { color: var(--blue-10); }

/* ── Waterfall table ── */
body.presentation table.wf { width: 100%; border-collapse: collapse; font-size: 13px; }
body.presentation table.wf th { background: var(--pale-97); color: var(--blue-10); padding: 8px 12px; text-align: left; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
body.light-theme.presentation table.wf th { background: var(--blue-10); color: var(--pale-97); }
body.presentation table.wf td { padding: 8px 12px; border-bottom: 1px solid var(--border-color); color: var(--text); }
body.presentation table.wf tr:last-child td { font-weight: 700; color: var(--gold); background: var(--bg-card); }
body.presentation .investor-total-card { background: var(--pale-97); border-radius: 6px; padding: 10px 14px; margin-top: 10px; display: flex; justify-content: space-between; align-items: center; }
body.presentation .itc-label { font-size: 12px; color: rgba(5,14,46,0.7); }
body.light-theme.presentation .investor-total-card { background: var(--blue-10); }
body.light-theme.presentation .itc-label { color: rgba(245,249,253,0.7); }

/* ── Timeline ── */
.timeline { display: flex; gap: 0; position: relative; margin-top: 16px; }
.timeline-step { flex: 1; position: relative; padding: 24px 20px 20px; }
.timeline-step::before { content: ''; position: absolute; top: 16px; left: 0; right: 0; height: 2px; background: var(--border-color); }
.timeline-step:first-child::before { left: 50%; }
.timeline-step:last-child::before { right: 50%; }
.step-num { width: 32px; height: 32px; background: var(--pale-97); border-radius: 50%; color: var(--blue-10); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; position: relative; z-index: 2; }
body.light-theme.presentation .step-num { background: var(--blue-10); color: var(--pale-97); }
.timeline-step h4 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; text-align: center; }
.timeline-step .sub { font-size: 11px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; text-align: center; margin-bottom: 10px; }
.timeline-step ul { list-style: none; padding: 0; }
.timeline-step ul li { font-size: 12px; color: var(--text); padding: 3px 0 3px 14px; position: relative; }
.timeline-step ul li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-size: 11px; }

/* ── Team cards ── */
.team-card { border: 1px solid var(--border-color); border-radius: 8px; padding: 28px 20px 20px; text-align: center; background: var(--bg-card); cursor: pointer; transition: box-shadow .2s, transform .15s; position: relative; }
.team-card:hover { box-shadow: 0 8px 32px rgba(5,14,46,0.6); transform: translateY(-2px); }
.team-card:hover .bio-hint { opacity: 1; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: hsla(var(--gold-h), var(--gold-s), 48%, 0.10); margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--gold); }
.team-card h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.team-card .role { font-size: 11px; color: var(--text); text-transform: uppercase; letter-spacing: 1px; }
.team-divider { width: 28px; height: 2px; background: var(--gold); margin: 10px auto 0; }
.bio-hint { position: absolute; bottom: 10px; right: 10px; font-size: 10px; color: var(--gold); opacity: 0.7; transition: opacity .2s; font-style: italic; }

/* ── Bio modal / sidebar ── */
.bio-modal { display: none !important; }
#state-rankings-modal { display: none !important; }

/* ── Achievement list ── */
.achievement { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.achievement:last-child { border-bottom: none; }
.ach-icon { width: 36px; height: 36px; background: var(--bg-card); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.achievement h4 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.achievement p { font-size: 13px; color: var(--text); }

/* ── County / P&L tables ── */
body.presentation .county-table { width: 100%; border-collapse: collapse; font-size: 12px; }
body.presentation .county-table th { background: var(--blue-10); color: var(--text); padding: 8px 10px; text-align: left; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
body.presentation .county-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-color); color: var(--text); }
body.presentation .county-table tr.y1 td { background: hsla(var(--blue-h), var(--blue-s), 10%, 0.3); }
body.presentation .county-table tr.y2 td { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.07); }
body.presentation .county-table tr.y3 td { background: hsla(var(--blue-h), var(--blue-s), 12%, 0.5); }
.hpsa-yes { color: var(--green-lt); font-weight: 600; }
.hpsa-no  { color: var(--red-lt); font-weight: 600; }

body.presentation .pl-table { width: 100%; border-collapse: collapse; font-size: 12px; }
body.presentation .pl-table th { background: var(--blue-10); color: var(--pale-97); padding: 7px 12px; font-size: 10px; letter-spacing: 1px; text-align: right; }
body.presentation .pl-table th:first-child { text-align: left; }
body.presentation .pl-table td { padding: 7px 12px; border-bottom: 1px solid var(--border-color); color: var(--text); text-align: right; }
body.presentation .pl-table td:first-child { text-align: left; color: var(--text); font-weight: 500; }
body.presentation .pl-table tr.section-head td { background: var(--bg-card); color: var(--gold); font-weight: 700; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; }
body.presentation .pl-table tr.total-row td { font-weight: 700; border-top: 2px solid var(--border-mid); background: var(--pale-97); color: var(--blue-10); }
body.presentation .pl-table tr.ebitda-row td { font-weight: 700; font-size: 13px; background: var(--pale-97); color: var(--blue-10); }
body.light-theme body.presentation .pl-table tr.total-row td,
body.light-theme body.presentation .pl-table tr.ebitda-row td { background: var(--blue-10); color: var(--pale-97); }

/* ── Donut ── */
.donut-wrap { position: relative; width: 160px; height: 160px; }
.donut-wrap svg { transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center .pct { font-size: 28px; font-weight: 800; color: var(--gold); }
.donut-center .lbl { font-size: 10px; color: var(--text); }

/* ── Tech grid ── */
.tech-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.tech-item { border: 1px solid var(--border-color); border-radius: 8px; padding: 16px; background: var(--bg-card); }
.tech-item .t-cat { font-size: 9px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; font-weight: 700; }
.tech-item .t-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.tech-item .t-desc { font-size: 11px; color: var(--text); }

/* ── Stat box ── */
.stat-box { border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; background: var(--bg-card); text-align: center; }
.stat-box .big { font-size: 40px; font-weight: 800; color: var(--gold); line-height: 1; }
.stat-box .unit { font-size: 18px; font-weight: 800; color: var(--gold); }
.stat-box .desc { font-size: 12px; color: var(--text); margin-top: 6px; line-height: 1.4; }
.stat-box .source { font-size: 10px; color: var(--text); opacity: .7; margin-top: 8px; }

/* ── Phase badges ── */
.phase-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.phase-1 { background: hsla(var(--blue-h), var(--blue-s), 10%, 0.5); color: hsla(var(--gold-h), var(--gold-s), 48%, 0.9); }
.phase-2 { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.12); color: var(--gold); }
.phase-3 { background: hsla(var(--red-h), var(--red-s), 48%, 0.15); color: var(--red-lt); }

/* ── Sources & uses bar ── */
.uses-bar { height: 32px; border-radius: 4px; display: flex; overflow: hidden; margin: 12px 0; }
.uses-seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; transition: width .3s; }

/* ── Slide 1 title slide ── */
#slide-1 { background: var(--bg); display: flex; flex-direction: column; justify-content: flex-end; min-height: 80vh; }
.title-bg { position: absolute; inset: 0; background: linear-gradient(135deg, var(--blue-10) 0%, hsl(var(--blue-h), var(--blue-s), 22%) 45%, hsl(var(--blue-h), var(--blue-s), 15%) 100%); }
.title-arc { position: absolute; bottom: 0; right: 0; width: 420px; height: 420px; background: linear-gradient(135deg, hsla(var(--gold-h), var(--gold-s), 48%, 0.15) 0%, hsla(var(--gold-h), var(--gold-s), 48%, 0.03) 100%); border-radius: 50% 0 0 0; }
.title-content { position: relative; z-index: 2; padding: 0 64px 60px; }
.title-logo { display: flex; align-items: center; gap: 20px; margin-bottom: 48px; }
.spark-star { font-size: 72px; line-height: 1; filter: drop-shadow(0 0 20px hsla(var(--gold-h), var(--gold-s), 48%, 0.5)); }
.logo-text .spark { font-size: 72px; font-weight: 900; color: var(--text); letter-spacing: -2px; line-height: 1; }
.logo-text .senior { font-size: 64px; font-weight: 300; color: var(--text); letter-spacing: 2px; line-height: 1; }
.tagline { font-size: 20px; color: var(--gold); font-weight: 600; letter-spacing: 3px; text-transform: uppercase; margin-top: 8px; }
.title-meta { display: flex; gap: 40px; }
.title-meta .meta-item { color: var(--text); font-size: 13px; }
.title-meta .meta-item strong { color: var(--text); display: block; font-size: 15px; margin-bottom: 2px; }
.confidential-tag { position: absolute; bottom: 20px; left: 64px; font-size: 11px; color: var(--text); letter-spacing: 2px; text-transform: uppercase; }

/* ── Funnel ── */
.funnel { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
.funnel-level { padding: 14px 24px; font-size: 14px; font-weight: 600; color: var(--text); text-align: center; border-radius: 4px; margin: 2px auto; }

/* ── Pie ── */
.pie { width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--blue-10) 0% 80%, var(--gold) 80% 100%); }

/* ── Pullquote ── */
.pullquote { border-left: 4px solid var(--gold); padding: 12px 20px; font-size: 15px; color: var(--text); font-style: italic; background: var(--bg-card); border-radius: 0 6px 6px 0; }

/* ── Org chart ── */
.org-box { border: 2px solid var(--blue-10); border-radius: 8px; padding: 10px 18px; background: var(--blue-10); color: var(--text); font-size: 13px; font-weight: 700; text-align: center; display: inline-block; }
.org-sub { border: 1px solid var(--border-mid); border-radius: 8px; padding: 10px 18px; background: var(--bg-card); color: var(--text); font-size: 12px; font-weight: 700; text-align: center; display: inline-block; }
.org-line { width: 2px; background: var(--border-color); margin: 0 auto; }
.org-horiz { display: flex; justify-content: center; gap: 20px; align-items: flex-start; }
.org-branch { display: flex; flex-direction: column; align-items: center; gap: 0; }

/* ── Small helpers ── */
.gold-tag { display: inline-block; background: var(--gold); color: var(--blue-10); font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 3px; letter-spacing: 1px; text-transform: uppercase; vertical-align: middle; margin-left: 8px; }
.section-intro { font-size: 14px; color: var(--text); margin-bottom: 28px; line-height: 1.6; }
.divider { width: 40px; height: 3px; background: var(--gold); margin: 12px 0; }
body.presentation .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
body.presentation .three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

/* ── Heart cards ── */
.heart-card { border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; background: var(--bg-card); text-align: left; }
.heart-num { font-size: 36px; font-weight: 800; color: rgba(255,255,255,0.06); line-height: 1; margin-bottom: 8px; }
.heart-icon { font-size: 22px; margin-bottom: 8px; }
.heart-card h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.heart-card p { font-size: 12px; color: var(--text); line-height: 1.5; }

/* ── Value pill ── */
.value-pill { display: inline-block; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 4px; padding: 3px 10px; font-size: 12px; color: var(--gold); margin: 3px; font-weight: 600; }

/* ── Deleted slide placeholder ── */
.deleted-slide { background: var(--bg); min-height: 200px; display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 14px; letter-spacing: 2px; text-transform: uppercase; border: 1px dashed var(--border-color); }

/* ── Presentation sidebar ── */
#pres-sb-overlay { display: none; position: fixed; inset: 0; background: rgba(5,14,46,0.65); z-index: 1100; backdrop-filter: blur(2px); }
#pres-sb-overlay.open { display: block; }
#pres-sidebar { position: fixed; top: 0; right: 0; bottom: 0; width: min(900px,68vw,95vw); background: var(--blue-10); border-left: 1px solid var(--border-mid); z-index: 1101; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1); overflow: hidden; }
#pres-sidebar.open { transform: translateX(0); }
#pres-sb-head { padding: 28px 28px 20px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; position: relative; }
#pres-sb-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: hsla(var(--gold-h), var(--gold-s), 48%, 0.7); }
#pres-sb-title { font-family: var(--font-serif); font-size: clamp(18px,2.5vw,24px); font-weight: 700; color: var(--text); line-height: 1.2; padding-right: 36px; }
#pres-sb-close { position: absolute; top: 22px; right: 22px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); color: var(--text); width: 34px; height: 34px; border-radius: 50%; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
#pres-sb-close:hover { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.18); color: var(--text); }
#pres-sb-body { flex: 1; overflow-y: auto; padding: 28px 48px 28px 28px; scrollbar-width: none; }
#pres-sb-body::-webkit-scrollbar { display: none; }
#pres-sb-body h3 { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
#pres-sb-body .sb-role { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
#pres-sb-body p { font-size: 14px; line-height: 1.7; color: var(--text); margin: 0 0 12px; }
#pres-sb-body p strong { color: var(--text); }
#pres-sb-body .sb-divider { height: 1px; background: var(--border-color); margin: 20px 0; }
#pres-sb-body table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--text); }
#pres-sb-body table th { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: hsla(var(--gold-h), var(--gold-s), 48%, 0.8); padding: 8px 10px; border-bottom: 1px solid var(--border-mid); text-align: left; background: hsla(var(--blue-h), var(--blue-s), 3%, 0.4); }
#pres-sb-body table td { padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
#pres-sb-body table tr:hover td { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.05); }
#pres-sb-body .sb-callout { background: hsla(var(--gold-h), var(--gold-s), 48%, 0.08); border-left: 3px solid var(--gold); border-radius: 0 6px 6px 0; padding: 12px 16px; margin: 16px 0; font-size: 14px; color: var(--text); }

/* ── Presentation sidebar — light theme overrides ── */
body.light-theme #pres-sidebar { background: var(--pale-97); border-left-color: var(--border-color); }
body.light-theme #pres-sb-close { background: rgba(5,14,46,0.06); border-color: rgba(5,14,46,0.12); }
body.light-theme #pres-sb-close:hover { background: rgba(5,14,46,0.1); }
body.light-theme #pres-sb-body table th { background: rgba(5,14,46,0.06); color: var(--blue-10); }
body.light-theme #pres-sb-body table td { border-bottom-color: rgba(5,14,46,0.06); }
body.light-theme #pres-sb-body table tr:hover td { background: rgba(5,14,46,0.04); }
body.light-theme #pres-sb-body .sb-callout { background: rgba(5,14,46,0.04); }

/* ── MT Sattaur rich bio layout ── */
#pres-sb-body .bio-wrap { margin: -28px; }
#pres-sb-body .bio-header { background: rgba(0,0,0,0.3); padding: 1.4rem 1.6rem 1.2rem; }
body.light-theme #pres-sb-body .bio-header { background: var(--blue-10); }
#pres-sb-body .bio-header-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.9rem; }
#pres-sb-body .bio-brand { display: flex; flex-direction: column; gap: 2px; }
#pres-sb-body .bio-brand-spark { font-family: var(--font-mono); font-size: 9px; color: var(--gold); letter-spacing: .18em; text-transform: uppercase; }
#pres-sb-body .bio-brand-sub { font-family: var(--font-mono); font-size: 8px; font-weight: 300; color: rgba(255,255,255,0.4); letter-spacing: .1em; text-transform: uppercase; }
#pres-sb-body .bio-doc-tag { font-family: var(--font-mono); font-size: 9px; color: var(--gold); letter-spacing: .14em; text-transform: uppercase; border: 1px solid rgba(215,169,32,0.32); padding: 3px 8px; align-self: flex-start; }
#pres-sb-body .bio-name { font-family: var(--font-serif); font-size: clamp(1.15rem,2.2vw,1.55rem); font-weight: 700; color: #fff; letter-spacing: .025em; line-height: 1.1; }
#pres-sb-body .bio-name .mt-gold { color: var(--gold); }
#pres-sb-body .bio-title-line { font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.62); letter-spacing: .13em; text-transform: uppercase; margin-top: 0.35rem; }
#pres-sb-body .bio-contact-row { display: flex; gap: 1.4rem; margin-top: 0.75rem; padding-top: 0.7rem; border-top: 1px solid rgba(215,169,32,0.28); flex-wrap: wrap; }
#pres-sb-body .bio-cpill { font-size: 10px; color: rgba(255,255,255,0.55); }
#pres-sb-body .bio-cpill b { color: var(--gold); font-weight: 500; margin-right: 4px; }
#pres-sb-body .bio-gold-rule { height: 3px; background: linear-gradient(90deg, var(--gold) 0%, var(--amber) 55%, rgba(215,169,32,0) 100%); }
#pres-sb-body .bio-layout { display: grid; grid-template-columns: 1fr 210px; }
#pres-sb-body .bio-col { padding: 1.3rem 1.3rem 1.3rem 1.6rem; border-right: 2px solid var(--gold); }
#pres-sb-body .bio-opening { font-family: var(--font-serif); font-size: 14px; font-style: italic; color: var(--text); line-height: 1.72; margin-bottom: 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
#pres-sb-body .bio-section { margin-bottom: 1rem; }
#pres-sb-body .bio-slabel { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
#pres-sb-body .bio-slabel-text { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; color: var(--amber); white-space: nowrap; }
#pres-sb-body .bio-slabel-rule { flex: 1; height: 1px; background: rgba(210,137,34,0.22); }
#pres-sb-body .bio-section p { font-size: 14px; line-height: 1.74; color: var(--text); margin: 0; }
#pres-sb-body .bio-section p strong { color: var(--gold); font-weight: 600; }
body.light-theme #pres-sb-body .bio-section p strong { color: var(--blue-10); }
#pres-sb-body .bio-stats-col { background: rgba(0,0,0,0.28); padding: 1.3rem 1.2rem; }
body.light-theme #pres-sb-body .bio-stats-col { background: var(--blue-10); }
#pres-sb-body .bio-panel-hdg { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
#pres-sb-body .bio-stat { margin-bottom: 0.8rem; padding-bottom: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
#pres-sb-body .bio-stat:last-of-type { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
#pres-sb-body .bio-stat-num { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700; color: var(--gold); line-height: 1; }
#pres-sb-body .bio-stat-desc { font-size: 11px; color: rgba(255,255,255,0.6); line-height: 1.45; margin-top: 3px; }
#pres-sb-body .bio-divider { height: 1px; background: rgba(215,169,32,0.25); margin: 1rem 0 0.85rem; }
#pres-sb-body .bio-cap-row { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 0.5rem; }
#pres-sb-body .bio-cap-dot { width: 5px; height: 5px; background: var(--amber); border-radius: 50%; flex-shrink: 0; margin-top: 0.28rem; }
#pres-sb-body .bio-cap-text { font-size: 10px; color: rgba(255,255,255,0.75); line-height: 1.45; }
#pres-sb-body .bio-footer { background: rgba(0,0,0,0.28); border-top: 2px solid var(--gold); padding: 0.7rem 1.6rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
body.light-theme #pres-sb-body .bio-footer { background: var(--blue-10); }
#pres-sb-body .bio-footer-tagline { font-family: var(--font-serif); font-size: 11px; font-style: italic; color: var(--gold); }
#pres-sb-body .bio-footer-note { font-family: var(--font-mono); font-size: 8px; color: rgba(255,255,255,0.3); letter-spacing: .1em; text-transform: uppercase; }

/* ── Org structure — dynamic borders & LLC header ── */
body.presentation .org-inc-box { border:2px solid var(--pale-97); border-radius:10px; overflow:hidden; }
body.light-theme.presentation .org-inc-box { border-color:var(--blue-10); }
body.presentation .org-llc-box { border:2px solid var(--pale-97); border-radius:10px; overflow:hidden; }
body.light-theme.presentation .org-llc-box { border-color:var(--blue-10); }
body.presentation .org-llc-header { background:var(--pale-97); padding:14px 18px; }
body.presentation .org-llc-header > div:first-child { color:var(--blue-10); }
body.light-theme.presentation .org-llc-header { background:var(--blue-10); }
body.light-theme.presentation .org-llc-header > div:first-child { color:var(--pale-97); }

/* ── Waterfall — dynamic top border ── */
body.presentation .wf-card-a { border-top:3px solid var(--pale-97) !important; }
body.light-theme.presentation .wf-card-a { border-top:3px solid var(--blue-10) !important; }

/* ── Legal col A — dynamic top border ── */
body.presentation .legal-col-a { border-top:3px solid var(--pale-97) !important; }
body.light-theme.presentation .legal-col-a { border-top:3px solid var(--blue-10) !important; }
