:root {
  --bg-deep: #050811;
  --bg-glass: rgba(11, 18, 34, 0.58);
  --bg-glass-strong: rgba(9, 15, 28, 0.72);
  --bg-glass-subtle: rgba(16, 25, 44, 0.46);
  --border-glass: rgba(56, 189, 248, 0.28);
  --border-highlight: rgba(56, 189, 248, 0.52);

  --dem-primary: #2563eb;
  --dem-bright: #38bdf8;
  --dem-glow: rgba(56, 189, 248, 0.35);

  --rep-primary: #dc2626;
  --rep-bright: #f87171;
  --rep-glow: rgba(248, 113, 113, 0.35);

  --accent-gold: #fbbf24;
  --accent-emerald: #34d399;
  --accent-purple: #a855f7;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --header-height: 70px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

#webgl-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 42%, #0d182e 0%, #050811 75%);
}

#webgl-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Ambient Vignette + Zoomed-In Tilt-Shift Blur & Vignette FX */
.fx-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(circle at 50% 50%, transparent 62%, rgba(3, 6, 14, 0.58) 100%),
    linear-gradient(180deg, rgba(56, 189, 248, 0.03) 0%, transparent 15%, transparent 85%, rgba(37, 99, 235, 0.04) 100%);
  transition: background 0.6s ease;
}

.fx-overlay.zoomed-in {
  background:
    radial-gradient(circle at 50% 50%, transparent 32%, rgba(3, 6, 14, 0.55) 68%, rgba(2, 4, 11, 0.92) 100%);
}

.tilt-shift-top,
.tilt-shift-bottom {
  position: fixed;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.65s ease;
}

.tilt-shift-top {
  top: 0;
  height: 24vh;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 100%);
}

.tilt-shift-bottom {
  bottom: 0;
  height: 24vh;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 100%);
}

body.county-zoomed .tilt-shift-top,
body.county-zoomed .tilt-shift-bottom {
  opacity: 1;
}

/* Unified Frosted Glassmorphism Base */
.glass-panel {
  background: rgba(11, 18, 34, 0.54);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 14px;
  box-shadow:
    0 14px 36px -6px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.16);
}

/* Top Header Command Bar */
.top-bar {
  position: fixed;
  top: 10px;
  left: 16px;
  right: 16px;
  min-height: 52px;
  height: 52px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  gap: 12px;
}

.brand-block {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulseDot 1.8s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

.brand-titles h1 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Flashy 3D Extruded Title Effect for "TEXAS 2026 MIDTERM" */
.title-3d-flashy {
  font-family: var(--font-display);
  font-size: 18.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 0%, #bae6fd 55%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #1d4ed8)
          drop-shadow(0 2px 0 #1e3a8a)
          drop-shadow(0 3px 0 #0f172a)
          drop-shadow(0 0 14px rgba(56, 189, 248, 0.65));
  transform: perspective(300px) rotateX(6deg);
  display: inline-block;
}

.title-atlas-sub {
  font-size: 13.5px;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.03em;
}

.alpha-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(56, 189, 248, 0.35));
  border: 1px solid rgba(192, 132, 252, 0.7);
  color: #f3e8ff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.brand-titles p {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.subtext-dem {
  color: #38bdf8;
  font-weight: 700;
}

.subtext-rep {
  color: #f87171;
  font-weight: 700;
}

/* Race Switcher (Senate vs Governor vs House vs Execs) */
.race-nav-container {
  position: absolute;
  left: calc(50% - 70px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: auto;
  transition: left 0.25s ease;
}

@media (max-width: 1560px) {
  .race-nav-container {
    left: calc(50% - 95px);
  }
}

@media (max-width: 1380px) {
  .race-nav-container {
    position: static;
    transform: none;
    margin: 0 auto 0 16px;
  }
}

.race-switcher {
  display: flex;
  background: rgba(6, 11, 22, 0.72);
  padding: 2px;
  border-radius: 9px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  gap: 2px;
  flex-wrap: nowrap;
}

.race-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.race-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.race-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.42), rgba(56, 189, 248, 0.24));
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.25);
}

.race-btn .race-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}


.exec-pill-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.exec-pill-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

.exec-pill-btn.active {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.35), rgba(56, 189, 248, 0.25));
  color: #fef08a;
  border: 1px solid rgba(250, 204, 21, 0.6);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.house-district-select {
  background: rgba(15, 23, 42, 0.50);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.30);
  color: #f8fafc;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.house-district-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
}

/* AP Call and Attribution in Top Left */
.ap-call-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.ap-source-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* Dedicated Floating Selection Panel (To the left of info panel, Right of left info tab) */
.race-selection-floating-panel {
  position: fixed;
  top: calc(var(--header-height, 70px) + 12px);
  left: 372px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  width: auto;
  max-width: min(560px, calc(100vw - 780px));
  transition: left 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, transform 0.25s ease;
}

body.left-minimized .race-selection-floating-panel {
  left: 52px;
  max-width: min(560px, calc(100vw - 600px));
}

.fl-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.fl-mode-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fl-mode-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.fl-mode-tab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
}

.fl-mode-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(56, 189, 248, 0.35));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.fl-green-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

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

.fl-hide-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.fl-hide-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.fl-reopen-btn {
  position: fixed;
  top: calc(var(--header-height, 70px) + 12px);
  left: 372px;
  z-index: 1000;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  transition: all 0.2s ease;
}

.fl-reopen-btn:hover {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 14px rgba(56, 189, 248, 0.35);
}

body.left-minimized .fl-reopen-btn {
  left: 52px;
}

.race-selection-floating-panel.panel-hidden {
  display: none !important;
}

/* Dock Reopen Pills - Removed per specification */
.dock-reopen-pill {
  display: none !important;
}

.dock-hide-pill-btn *,
.fl-hide-btn *,
.fl-reopen-btn * {
  pointer-events: none;
}

.fl-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fl-stepper-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fl-stepper-btn {
  background: rgba(15, 23, 42, 0.50);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 12px;
  font-weight: 800;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.fl-stepper-btn:hover {
  background: rgba(2, 132, 199, 0.65);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.fl-select-container {
  flex: 1;
}

.fl-district-summary, .fl-exec-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.fl-sum-cand.dem {
  color: #38bdf8;
  font-weight: 700;
  transition: all 0.2s ease;
}

.fl-sum-cand.rep {
  color: #f87171;
  font-weight: 700;
  transition: all 0.2s ease;
}

.fl-sum-cand.winner-highlight {
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.fl-sum-cand.winner-highlight.dem {
  background: rgba(37, 99, 235, 0.26);
  border: 1px solid rgba(56, 189, 248, 0.65);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.fl-sum-cand.winner-highlight.rep {
  background: rgba(220, 38, 38, 0.26);
  border: 1px solid rgba(248, 113, 113, 0.65);
  color: #f87171;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.4);
}

.fl-sum-cand:not(.winner-highlight) {
  opacity: 0.70;
  font-weight: 500;
}

.cand-winner-highlight {
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cand-winner-highlight.dem {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.cand-winner-highlight.rep {
  background: rgba(248, 113, 113, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

/* District and Statewide Selection Titles Highlighted in Color in Summaries */
.fl-sum-title {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-right: 6px;
  white-space: nowrap;
}

.fl-sum-title.dem {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.fl-sum-title.rep {
  background: rgba(248, 113, 113, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.6);
  color: #f87171;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

.cand-title-highlight {
  display: inline-block;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 5px;
}

.cand-title-highlight.dem {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.cand-title-highlight.rep {
  background: rgba(248, 113, 113, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.6);
  color: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

.opt-chip.chip-dem-highlight {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(14, 165, 233, 0.22);
}

.opt-chip.chip-dem-highlight .opt-v {
  color: #38bdf8;
  font-weight: 800;
}

.opt-chip.chip-rep-highlight {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(239, 68, 68, 0.22);
}

.opt-chip.chip-rep-highlight .opt-v {
  color: #f87171;
  font-weight: 800;
}

.viz-btn-icon {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
  stroke: currentColor;
}

.viz-btn-icon.viz-btn-steps {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 5px;
}

.fl-sum-vs {
  color: #64748b;
  font-size: 10px;
}

.fl-sum-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: auto;
}

.fl-sum-badge.flip {
  background: rgba(234, 179, 8, 0.25);
  border: 1px solid rgba(250, 204, 21, 0.7);
  color: #fef08a;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}

.fl-sum-badge:not(.flip) {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
}

.exec-pill-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  max-width: 550px;
}

.exec-pill-btn {
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(56, 189, 248, 0.20);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.exec-pill-btn:hover {
  color: #f8fafc;
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.45);
}

.exec-pill-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.40), rgba(56, 189, 248, 0.30));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.30);
}
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.exec-pill-btn:hover {
  color: #f8fafc;
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.5);
}

.exec-pill-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.45), rgba(56, 189, 248, 0.35));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* Top Statewide AP Scoreboard */
.statewide-scoreboard {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(7, 12, 24, 0.52);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  z-index: 3;
}

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

.cand-party-bar {
  width: 4px;
  height: 28px;
  border-radius: 3px;
}

.cand-party-bar.dem {
  background: var(--dem-bright);
  box-shadow: 0 0 10px var(--dem-bright);
}

.cand-party-bar.rep {
  background: var(--rep-bright);
  box-shadow: 0 0 10px var(--rep-bright);
}

.cand-info {
  display: flex;
  flex-direction: column;
}

.cand-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}

.ap-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--dem-primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.cand-votes {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

.cand-pct {
  font-family: var(--font-mono);
  font-size: 15.5px;
  font-weight: 700;
}

.cand-pct.dem { color: var(--dem-bright); }
.cand-pct.rep { color: var(--rep-bright); }

.score-divider {
  width: 1px;
  height: 26px;
  background: rgba(148, 163, 184, 0.2);
}

.state-shift-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-mono);
}

.state-shift-badge .shift-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
}

.state-shift-badge .shift-lbl {
  font-size: 9.5px;
  color: var(--text-muted);
}

/* Top-Right Selected Options Summary HUD (positioned to the left of the Right Panel) */
.active-options-hud {
  position: fixed;
  top: calc(var(--header-height, 70px) + 14px);
  right: 404px;
  z-index: 12;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: min(540px, calc(100vw - 840px));
  padding: 6px 10px;
  transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.32s ease;
}

body.right-minimized .active-options-hud {
  right: 190px;
  max-width: min(760px, calc(100vw - 580px));
}

/* Special Non-Voter / Total Population Info Block to the left of "Race" in Info Bar */
.nonvoter-hud-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-family: var(--font-mono);
}

.nonvoter-hud-top {
  font-size: 10.5px;
  font-weight: 800;
  color: #ffffff;
}

.nonvoter-hud-sub {
  font-size: 9.5px;
  color: #93c5fd;
  margin-top: 1px;
}

.opt-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.32);
  font-family: var(--font-mono);
  font-size: 10px;
  color: #e2e8f0;
  white-space: nowrap;
}

.opt-chip .opt-k {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 9px;
}

.opt-chip .opt-v {
  color: #7dd3fc;
  font-weight: 700;
}

.opt-chip.party-chip-dem {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 116, 144, 0.28);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}
.opt-chip.party-chip-dem .opt-k,
.opt-chip.party-chip-dem .opt-v {
  color: #38bdf8 !important;
}

.opt-chip.party-chip-rep {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(185, 28, 28, 0.28);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}
.opt-chip.party-chip-rep .opt-k,
.opt-chip.party-chip-rep .opt-v {
  color: #f87171 !important;
}

.opt-chip.chip-demo-highlight {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.28);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

.opt-chip.chip-demo-highlight .opt-k {
  color: #7dd3fc !important;
  font-weight: 700;
}

.opt-chip.chip-demo-highlight .opt-v {
  color: #ffffff !important;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}

/* Minimalist Vertically-Centered Sidebar Toggle Handles - Highly Glassmorphic */
.sidebar-mid-handle {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2100;
  width: 24px;
  height: 58px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  pointer-events: auto;
  user-select: none;
  transition: left 0.32s cubic-bezier(0.16, 1, 0.3, 1), right 0.32s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.sidebar-mid-handle:hover {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.4);
}

.sidebar-mid-handle svg {
  pointer-events: none;
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
}

/* Small gap between buttons and panels: left dock is 340px -> handle at 354px (14px gap) */
#btn-toggle-left {
  left: 354px;
}

body.left-minimized #btn-toggle-left {
  left: 14px;
}

body.left-minimized #btn-toggle-left svg {
  transform: rotate(180deg);
}

/* Small gap between buttons and panels: right dock is 384px -> handle at 398px (14px gap) */
#btn-toggle-right {
  right: 398px;
}

body.right-minimized #btn-toggle-right {
  right: 14px;
}

body.right-minimized #btn-toggle-right svg {
  transform: rotate(180deg);
}

/* Explicit Hide & Collapse Buttons inside Docks */
.dock-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.dock-header-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.dock-hide-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #94a3b8;
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.18s ease;
}

.dock-hide-pill-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.county-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Left Control Dock */
.left-dock {
  position: fixed;
  top: calc(var(--header-height, 70px) + 14px);
  left: 16px;
  bottom: 16px;
  width: 332px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}

body.left-minimized .left-dock {
  transform: translateX(-360px);
  opacity: 0;
  pointer-events: none;
}

.left-dock::-webkit-scrollbar {
  width: 5px;
}
.left-dock::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 99px;
}

.control-section {
  background: rgba(9, 15, 29, 0.44);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 11px;
  padding: 10px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.section-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.14);
  padding: 2px 6px;
  border-radius: 4px;
}

.demo-pop-note {
  font-size: 10px;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  line-height: 1.35;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.65);
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.custom-checkbox .check-mark {
  display: none;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: #38bdf8;
}

#btn-toggle-nonvoters.active .custom-checkbox {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

#btn-toggle-nonvoters.active .custom-checkbox .check-mark {
  display: block;
}

/* Button Grids */
.btn-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.chip-btn {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.52);
  color: var(--text-secondary);
  padding: 7px 8px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

.chip-btn.span-2 {
  grid-column: span 2;
}

.chip-btn:hover {
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(30, 41, 59, 0.68);
}

.chip-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.38), rgba(14, 165, 233, 0.26));
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.62);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.22);
  font-weight: 600;
}

.chip-btn.party-dem.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.48), rgba(56, 189, 248, 0.28));
  border-color: #38bdf8;
}

.chip-btn.party-rep.active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.48), rgba(248, 113, 113, 0.28));
  border-color: #f87171;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.25);
}

.chip-btn.party-split.active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.42) 0%, rgba(168, 85, 247, 0.35) 50%, rgba(37, 99, 235, 0.48) 100%);
  border-color: #c084fc;
}

/* Income Level Layer Buttons */
.chip-btn[data-income="all"].active {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.4), rgba(34, 197, 94, 0.4), rgba(251, 191, 36, 0.4), rgba(168, 85, 247, 0.45));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
  font-weight: 700;
}

.chip-btn[data-income="low"].active {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.7), rgba(100, 116, 139, 0.45));
  border-color: #94a3b8;
  color: #f1f5f9;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.35);
  font-weight: 700;
}

.chip-btn[data-income="middle"].active {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.5), rgba(34, 197, 94, 0.45));
  border-color: #4ade80;
  color: #bbf7d0;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
  font-weight: 700;
}

.chip-btn[data-income="high"].active {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.55), rgba(251, 191, 36, 0.45));
  border-color: #fde047;
  color: #fef08a;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
  font-weight: 700;
}

.chip-btn[data-income="wealthy"].active {
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.6), rgba(168, 85, 247, 0.5));
  border-color: #c084fc;
  color: #f3e8ff;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
  font-weight: 700;
}

.opt-chip.chip-income-highlight {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(15, 23, 42, 0.55);
}

.opt-chip.chip-income-highlight .opt-v {
  color: #38bdf8;
  font-weight: 800;
}

/* Search Input */
.county-search-wrap {
  position: relative;
}

.county-search-input {
  width: 100%;
  background: rgba(6, 11, 22, 0.58);
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 8px;
  padding: 8px 10px 8px 30px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.county-search-input:focus {
  border-color: var(--dem-bright);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 210px;
  overflow-y: auto;
  background: rgba(8, 14, 28, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  z-index: 30;
  display: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
}

.search-results-dropdown.open {
  display: block;
}

.search-result-item {
  padding: 7px 10px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.search-result-item:hover {
  background: rgba(56, 189, 248, 0.18);
}

/* Slider Controls */
.slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 7px;
}

.slider-label-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.slider-label-line span:last-child {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: rgba(30, 41, 59, 0.85);
  border-radius: 99px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

/* Color Legend */
.legend-bar {
  height: 8px;
  border-radius: 99px;
  margin: 6px 0 4px;
  background: linear-gradient(90deg, #dc2626 0%, #f87171 28%, #a855f7 50%, #38bdf8 72%, #1d4ed8 100%);
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

/* Right County Inspector & Analytics Drawer */
.right-dock {
  position: fixed;
  top: calc(var(--header-height, 70px) + 14px);
  right: 16px;
  bottom: 44px;
  width: 376px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  overflow-y: auto;
  background: rgba(11, 18, 34, 0.48);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(56, 189, 248, 0.36);
  box-shadow:
    0 16px 40px -8px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.18);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}

body.right-minimized .right-dock {
  transform: translateX(400px);
  opacity: 0;
  pointer-events: none;
}

.county-header-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.county-title-group h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.flipped-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(56, 189, 248, 0.22));
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fde68a;
}

.metro-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(0, 210, 255, 0.18);
  border: 1px solid rgba(0, 210, 255, 0.7);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.income-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.25s ease;
}

.income-pill.tier-wealthy {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(192, 132, 252, 0.85);
  color: #f3e8ff;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.6);
}

.income-pill.tier-high {
  background: rgba(251, 191, 36, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.85);
  color: #fef08a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.income-pill.tier-middle,
.income-pill.tier-middle-high {
  background: rgba(34, 197, 94, 0.20);
  border: 1px solid rgba(74, 222, 128, 0.75);
  color: #bbf7d0;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.income-pill.tier-middle-low {
  background: rgba(13, 148, 136, 0.22);
  border: 1px solid rgba(20, 184, 166, 0.75);
  color: #99f6e4;
  box-shadow: 0 0 8px rgba(13, 148, 136, 0.3);
}

.income-pill.tier-low {
  background: rgba(100, 116, 139, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #f1f5f9;
  box-shadow: 0 0 8px rgba(148, 163, 184, 0.25);
}

.income-pill.tier-extreme-poverty {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.85);
  color: #e2e8f0;
  box-shadow: 0 0 8px rgba(15, 23, 42, 0.6);
}

/* Map Overlay Explanatory Notes (at bottom of left panel) */
.dock-overlay-notes {
  margin-top: 14px;
  padding: 8px 10px;
  background: rgba(10, 18, 30, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.35;
  backdrop-filter: blur(8px);
}

.dock-overlay-notes .note-left {
  flex: 1.15;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.dock-overlay-notes .note-right {
  flex: 0.85;
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.county-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.reset-cam-btn {
  border: 1px solid rgba(56, 189, 248, 0.38);
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
  padding: 5px 9px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.reset-cam-btn:hover {
  background: rgba(14, 165, 233, 0.3);
  color: #fff;
}

/* KPI Grid inside Right Drawer */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.kpi-card {
  background: rgba(12, 20, 38, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 9px;
  padding: 8px 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-val {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 3px;
}

.kpi-sub {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* AP News Race Results Card inside Right Drawer */
.ap-race-card {
  background: rgba(12, 20, 38, 0.48);
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ap-race-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ap-race-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.ap-shift-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.ap-shift-pill.dem {
  background: rgba(37, 99, 235, 0.24);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.ap-shift-pill.rep {
  background: rgba(220, 38, 38, 0.24);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.45);
}

.cand-bar-row {
  margin-bottom: 7px;
}

.cand-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 3px;
}

.cand-bar-labels .votes-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 7px;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-fill.dem {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.progress-fill.rep {
  background: linear-gradient(90deg, #b91c1c, #f87171);
}

/* Breakdown Bars (Demographics, Gender, Age, Education) */
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.breakdown-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.breakdown-name {
  color: var(--text-primary);
  font-weight: 500;
}

.breakdown-stats {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

.split-bar {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.8);
}

.split-dem {
  background: linear-gradient(90deg, #1d4ed8, #38bdf8);
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-rep {
  background: linear-gradient(90deg, #f87171, #dc2626);
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scatter / Pattern Correlation Canvas inside Right Dock */
.scatter-box {
  background: rgba(7, 13, 26, 0.52);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 9px;
  padding: 8px;
}

.scatter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.scatter-tab {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-secondary);
  font-size: 10px;
  padding: 4px 4px;
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
}

.scatter-tab.active {
  background: rgba(56, 189, 248, 0.24);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.55);
}

#correlation-canvas {
  width: 100%;
  height: 138px;
  display: block;
  cursor: crosshair;
}

/* Bottom Floating Quick-Presets, Single Time Cycle Button & Snapshot HUD */
.bottom-hud {
  position: fixed;
  bottom: 14px;
  left: 360px;
  right: 404px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  gap: 10px;
  pointer-events: auto;
  transition: left 0.32s cubic-bezier(0.16, 1, 0.3, 1), right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

body.left-minimized .bottom-hud {
  left: 16px;
}

body.right-minimized .bottom-hud {
  right: 165px;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.hud-pill-btn {
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: rgba(12, 20, 38, 0.62);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.hud-pill-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex-shrink: 0;
}

.hud-pill-btn:hover {
  color: #fff;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(25, 39, 68, 0.78);
}

.hud-pill-btn.active,
.hud-pill-btn.util-btn {
  background: rgba(56, 189, 248, 0.18);
  color: #e2e8f0;
  border-color: rgba(56, 189, 248, 0.45);
}

/* Make Morning/Daytime & Snapshot buttons less round */
.hud-pill-btn.util-btn {
  border-radius: 6px;
}

.hud-pill-btn.util-btn:hover {
  background: rgba(56, 189, 248, 0.32);
  color: #ffffff;
}

.round-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  background: rgba(12, 20, 38, 0.72) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #fde047;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.round-icon-btn:hover {
  transform: scale(1.08);
  border-color: rgba(56, 189, 248, 0.7) !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.tour-btn {
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(14, 165, 233, 0.16) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

.tour-btn.playing {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.38), rgba(56, 189, 248, 0.48)) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
  animation: pulse-tour 2s infinite ease-in-out;
}

@keyframes pulse-tour {
  0%, 100% {
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
  }
  50% {
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.7);
  }
}

/* Attached San Antonio Inline Icon & Texas Icon + Hover Icon Swap */
.hud-inline-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.tx-icon-swap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tx-icon-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.tx-icon-img.tx-default {
  opacity: 1;
}

.tx-icon-img.tx-hover {
  opacity: 0;
}

.tx-icon-trigger:hover .tx-icon-img.tx-default,
.tx-icon-link:hover .tx-icon-img.tx-default {
  opacity: 0;
}

.tx-icon-trigger:hover .tx-icon-img.tx-hover,
.tx-icon-link:hover .tx-icon-img.tx-hover {
  opacity: 1;
  transform: scale(1.06);
}

/* "Made in Texas" Bottom-Right Footer with Native Creation Link, AI Disclaimer & Flaticon Credits */
.made-in-texas-footer {
  position: fixed;
  bottom: 11px;
  right: 16px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  color: #ffffff;
  font-family: var(--font-display);
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(11, 18, 34, 0.58);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: auto;
  transition: border-radius 0.2s ease, padding 0.2s ease, background 0.2s ease;
}

.made-in-texas-footer:hover {
  border-radius: 10px;
  padding: 6px 12px;
  background: rgba(11, 18, 34, 0.86);
}

.footer-main-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.footer-sub-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.88);
  max-height: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.24s ease, max-width 0.28s ease, opacity 0.22s ease, margin-top 0.22s ease;
}

.made-in-texas-footer:hover .footer-sub-row {
  max-height: 22px;
  max-width: 420px;
  opacity: 1;
  margin-top: 3px;
}

.native-creation-link {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 600;
}

.native-creation-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-sep {
  color: rgba(148, 163, 184, 0.6);
}

.footer-ai-disclaimer {
  color: rgba(203, 213, 225, 0.85);
}

.tx-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
}

.tx-flaticon-attr {
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-weight: 400;
  color: rgba(148, 163, 184, 0.78);
  max-height: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.24s ease, max-width 0.28s ease, opacity 0.22s ease, margin-top 0.22s ease;
}

.tx-flaticon-attr a {
  color: rgba(203, 213, 225, 0.85);
  text-decoration: none;
}

.tx-flaticon-attr a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.made-in-texas-footer:hover .tx-flaticon-attr {
  max-height: 18px;
  max-width: 520px;
  opacity: 1;
  margin-top: 2px;
}

/* Hover Tooltip (Glassmorphic like Top-Right Overlay) */
.hover-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  width: 312px;
  padding: 12px 14px;
  background: rgba(11, 18, 34, 0.58);
  backdrop-filter: blur(26px) saturate(190%);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 13px;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.hover-tooltip.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.tt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tt-county-name {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
}

.tt-region-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.tt-shift-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.34);
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.tt-cand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  padding: 3px 0;
}

.tt-cand-row strong {
  font-family: var(--font-mono);
}

.tt-meta-footer {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

/* Income Percentages Strip (Hover Tooltip & County Overlay directly above the bottom line) */
.tt-income-strip,
.insp-income-strip {
  margin-top: 6px;
  margin-bottom: 4px;
  padding: 5px 7px;
  background: rgba(15, 23, 42, 0.70);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.income-strip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.strip-title {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7dd3fc;
}

.strip-median-tag {
  color: #f8fafc;
  font-weight: 700;
}

.income-strip-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

.inc-pill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 1px;
  background: rgba(11, 18, 34, 0.88);
  border: 1px solid currentColor;
  border-radius: 5px;
  text-align: center;
  gap: 1px;
}

.inc-pill-name {
  font-family: var(--font-mono);
  font-size: 8px;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.92;
  letter-spacing: -0.02em;
}

.inc-pill-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.inc-pill-pct {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
}

@media (max-width: 1280px) {
  .left-dock { width: 290px; }
  .right-dock { width: 320px; }
  #btn-toggle-left { left: 304px; }
  #btn-toggle-right { right: 334px; }
  body.left-minimized #btn-toggle-left { left: 14px !important; }
  body.right-minimized #btn-toggle-right { right: 14px !important; }
  .bottom-hud { left: 316px; right: 346px; }
  .active-options-hud { right: 346px; }
  .statewide-scoreboard { display: none; }
}

/* Share Popover Modal */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease;
  visibility: hidden;
}

.share-modal.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.share-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: rgba(11, 18, 34, 0.95);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid rgba(56, 189, 248, 0.42);
  box-shadow:
    0 24px 60px -12px rgba(0, 0, 0, 0.85),
    0 0 35px rgba(56, 189, 248, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 20px;
  color: var(--text-primary);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-modal.visible .share-card {
  transform: scale(1) translateY(0);
}

.share-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.share-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-header-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(56, 189, 248, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.share-header-icon {
  width: 20px;
  height: 20px;
  color: #38bdf8;
}

.share-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin: 0;
}

.share-sub {
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

.share-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.share-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fff;
}

/* Copy URL Box */
.share-url-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(7, 13, 26, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 9px;
  padding: 5px 6px;
  margin-bottom: 16px;
}

.share-url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #7dd3fc;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-copy-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(37, 99, 235, 0.35);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.share-copy-btn:hover {
  background: rgba(37, 99, 235, 0.65);
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.share-copy-btn.copied {
  background: rgba(34, 197, 94, 0.35);
  border-color: rgba(34, 197, 94, 0.75);
  color: #86efac;
}

/* Social Grid: Copy Link, Email, Instagram, Threads, TikTok, Facebook */
.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.share-grid-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 6px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.share-grid-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.share-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
}

.share-grid-btn:hover .share-icon-circle {
  transform: scale(1.08);
}

.share-icon-circle svg {
  width: 19px;
  height: 19px;
}

.share-copy-icon {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.share-email-icon {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.share-ig-icon {
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.22), rgba(253, 29, 29, 0.22));
  color: #f472b6;
  border: 1px solid rgba(244, 114, 182, 0.4);
}

.share-threads-icon {
  background: #000000;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0;
  overflow: hidden;
}

.share-threads-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.share-tiktok-icon {
  background: rgba(0, 242, 234, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.share-fb-icon {
  background: rgba(24, 119, 242, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.share-toast {
  position: absolute;
  bottom: -38px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 23, 42, 0.94);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.5);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 99px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile "Best Viewed on Desktop" Modal */
.mobile-notice-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  visibility: hidden;
}

.mobile-notice-modal.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.mobile-notice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mobile-notice-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: rgba(11, 18, 34, 0.94);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow:
    0 24px 60px -12px rgba(0, 0, 0, 0.85),
    0 0 35px rgba(56, 189, 248, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 22px 20px;
  color: var(--text-primary);
  transform: scale(0.94) translateY(8px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-notice-modal.visible .mobile-notice-card {
  transform: scale(1) translateY(0);
}

.mobile-notice-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.mobile-notice-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fff;
}

.mobile-notice-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.mobile-notice-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(56, 189, 248, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.mobile-notice-icon {
  width: 24px;
  height: 24px;
  color: #38bdf8;
}

.mobile-notice-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin: 0;
}

.mobile-notice-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mobile-notice-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
}

.mobile-notice-features {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(7, 13, 26, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.mnf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #cbd5e1;
}

.mnf-item span:first-child {
  font-size: 13px;
  flex-shrink: 0;
}

.mobile-notice-actions {
  display: flex;
  gap: 8px;
}

.mobile-notice-action-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #0284c7 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.6);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: all 0.18s ease;
  text-align: center;
}

.mobile-notice-action-btn:hover {
  filter: brightness(1.12);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.55);
}

/* Minimalist Navigation Control Scheme HUD (Positioned Above Bottom Bar, Centered) */
.control-scheme-hud {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: #94a3b8;
  transition: bottom 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}

body.clean-map-mode .control-scheme-hud,
body.bottom-hud-hidden .control-scheme-hud {
  bottom: 18px !important;
}

.control-scheme-hud.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.csh-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.csh-mouse-icon {
  font-size: 11px;
  opacity: 0.75;
}

.csh-action {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 9.5px;
}

.csh-desc {
  color: #94a3b8;
  font-weight: 500;
  font-size: 10px;
}

.csh-sep {
  color: rgba(148, 163, 184, 0.25);
  font-size: 10px;
}

.csh-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  margin-left: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.csh-close-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.12);
}

/* Detail Panel Statistical Disclaimer: Doubled font size & clean muted grey */
.insp-disclaimer {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 13.5px;
  line-height: 1.45;
  color: #94a3b8;
  opacity: 0.82;
  font-style: italic;
  font-family: var(--font-sans);
  text-align: left;
}

/* Active Density Heatmap Indicator in Top-Right Info Panel (Red-Orange with Radiant Glow) */
.hud-chip.highlight-density-heatmap {
  border-color: rgba(255, 69, 0, 0.65) !important;
  background: rgba(255, 69, 0, 0.16) !important;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.45), inset 0 0 6px rgba(255, 69, 0, 0.22);
}

.chip-v-density {
  color: #ff4500 !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 69, 0, 0.85), 0 0 14px rgba(249, 115, 22, 0.65);
}

/* Low-End Machine Optimization: Lightweight Blur & Simplified FX */
body.low-perf .glass-panel,
body.low-perf .dock-bar,
body.low-perf .top-score-bar,
body.low-perf .right-dock,
body.low-perf .hud-options-capsule,
body.low-perf .legend-card,
body.low-perf .time-cycle-btn,
body.low-perf .selector-dock-panel,
body.low-perf .minimal-controls-badge {
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

body.low-perf .tilt-shift-top,
body.low-perf .tilt-shift-bottom {
  display: none !important;
}

body.low-perf .fx-overlay {
  background: radial-gradient(circle at 50% 50%, transparent 65%, rgba(2, 4, 11, 0.40) 100%) !important;
}

body.low-perf .fx-overlay.zoomed-in {
  background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(2, 4, 11, 0.55) 100%) !important;
}

/* =========================================================================
   CLEAN ROUND LOADING BAR OVERLAY
   ========================================================================= */
.atlas-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.96) 0%, rgba(3, 7, 18, 0.98) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.55s ease;
}

.atlas-loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.atlas-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 34px 44px;
  background: rgba(11, 18, 34, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.2);
  text-align: center;
}

.round-loader-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.round-loader-svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.round-loader-track {
  fill: none;
  stroke: rgba(56, 189, 248, 0.14);
  stroke-width: 8;
}

.round-loader-bar {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  transition: stroke-dashoffset 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.8));
}

.round-loader-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.round-loader-icon {
  font-size: 24px;
  line-height: 1;
  color: #fbbf24;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.75));
  animation: pulse-star 1.8s ease-in-out infinite;
}

@keyframes pulse-star {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.18); opacity: 1; }
}

.round-loader-pct {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 5px;
  letter-spacing: -0.02em;
}

.round-loader-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f8fafc;
}

.round-loader-status {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #7dd3fc;
  min-height: 18px;
}

/* =========================================================================
   CLEAN VIEW (HIDE ALL PANELS) CONTROLS - Minimalist Grey Eye Icon Button
   ========================================================================= */
.clean-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #94a3b8;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.clean-view-btn:hover {
  background: rgba(51, 65, 85, 0.70);
  border-color: rgba(203, 213, 225, 0.45);
  color: #f1f5f9;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.clean-view-eye-icon {
  pointer-events: none;
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* 5 Divided Income Tiers on County Overlay */
.income-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.income-tier-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 8px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 7px;
  transition: all 0.22s ease;
}

.income-tier-row:hover {
  background: rgba(30, 41, 59, 0.58);
  border-color: rgba(148, 163, 184, 0.28);
}

.income-tier-row.active-tier {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.16);
}

.tier-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.tier-label-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.tier-name {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.tier-range {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.tier-active-badge {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  margin-left: 4px;
}

.tier-stats {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.tier-sub-count {
  color: var(--text-secondary);
  font-size: 9.5px;
}

.tier-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 1px;
}

.tier-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Income Stat Type Toggle in Left Dock */
#income-stat-toggle .chip-btn {
  font-size: 10px;
  padding: 4px 6px;
  letter-spacing: 0.02em;
}

#income-stat-toggle .chip-btn.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.8);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

body.clean-map-mode .clean-view-btn {
  background: rgba(56, 189, 248, 0.20);
  border-color: rgba(56, 189, 248, 0.55);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

body.clean-map-mode .left-dock,
body.clean-map-mode .right-dock,
body.clean-map-mode .race-selection-floating-panel,
body.clean-map-mode .sidebar-mid-handle,
body.clean-map-mode .dock-reopen-pill,
body.clean-map-mode .fl-reopen-btn,
body.clean-map-mode .active-options-hud,
body.clean-map-mode .bottom-hud {
  display: none !important;
}
