:root {
  interpolate-size: allow-keywords;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-dark: #090d16;
  --bg-dark-elevated: #111827;
  
  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-dark: #1f293d;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-light: #f8fafc;
  
  --color-school: #2563eb;
  --color-school-light: #eff6ff;
  --color-school-border: #bfdbfe;
  
  --color-city: #059669;
  --color-city-light: #ecfdf5;
  --color-city-border: #a7f3d0;
  
  --color-county: #d97706;
  --color-county-light: #fffbeb;
  --color-county-border: #fde68a;
  
  --color-accent: #3b82f6;
  --color-danger: #dc2626;
  --color-warning: #ea580c;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --shadow-glow: 0 0 20px -3px rgba(37, 99, 235, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (max-width: 900px) {
  html {
    scroll-padding-top: 120px;
  }
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  overflow-wrap: break-word;
}

p, blockquote, .section-subtitle-desc {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
}

/* LIVE CITIZEN STATUS BAR (BELOW HEADER & NAV) */
.top-status-bar {
  background: #ffffff;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.status-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-weight: 500;
}

.live-beacon {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse-beacon 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-beacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.status-quick-links {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.status-quick-links strong {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.status-sep {
  color: var(--border-subtle);
}

/* APP HEADER */
.app-header {
  background: radial-gradient(circle at 15% 20%, #1e293b 0%, #090d16 100%);
  color: #ffffff;
  padding: 36px 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.app-header::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 500px;
  height: 100%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.header-container {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 32px;
  position: relative;
  z-index: 1;
}

@media (max-width: 1024px) {
  .header-container {
    grid-template-columns: 1fr;
  }
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
}

.header-titles h1 {
  font-size: clamp(2rem, 1.6rem + 1.8vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #ffffff 40%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-titles .subtitle {
  color: #94a3b8;
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 650px;
}

.header-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 14px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-card.highlight-school {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(30, 58, 138, 0.3) 100%);
  border-color: rgba(96, 165, 250, 0.45);
}

.stat-card-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-card-num {
  font-size: 1.65rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #f8fafc;
  line-height: 1.2;
}

.stat-card-sub {
  font-size: 0.7rem;
  color: #cbd5e1;
  margin-top: 4px;
}

/* ==========================================================================
   NAVIGATION BAR: CATEGORIZED DROPDOWN SYSTEM WITH PERSISTENT HEADER BRAND
   ========================================================================== */
.nav-bar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
  will-change: box-shadow;
}

.nav-bar.is-scrolled {
  box-shadow: 0 6px 20px -4px rgba(15, 23, 42, 0.12), 0 2px 6px -1px rgba(15, 23, 42, 0.06);
  border-bottom-color: rgba(203, 213, 225, 0.85);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
  padding-bottom: 8px;
  min-height: 56px;
}

/* Persistent Brand Lockup in Sticky Nav */
.nav-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 5px 10px 5px 6px;
  border-radius: var(--radius-md);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  border: 1px solid transparent;
}

.nav-brand-lockup:hover {
  background: var(--bg-subtle);
  border-color: var(--border-light);
  text-decoration: none;
}

.nav-brand-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e293b 0%, #090d16 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.nav-brand-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.nav-brand-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav-brand-subtitle {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--color-school);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-grow: 1;
  flex-wrap: nowrap;
}

.nav-municipality-indicator {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-municipality-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.nav-city-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.6);
}

/* Modern Cross-Document View Transitions (Multi-Page App Smooth Transitions) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

::view-transition-old(root) {
  animation: 0.18s cubic-bezier(0.4, 0, 1, 1) both fade-out;
}

::view-transition-new(root) {
  animation: 0.22s cubic-bezier(0, 0, 0.2, 1) both fade-in;
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Base Nav Button Styles - Modern Segmented Pills */
.nav-item-btn,
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.85);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 600;
  color: #334155;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.nav-item-btn:hover,
.nav-dropdown-trigger:hover {
  background: #f8fafc;
  color: var(--text-main);
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.nav-item-btn.active,
.nav-dropdown.has-active .nav-dropdown-trigger {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.nav-item-btn.active .tab-icon,
.nav-dropdown.has-active .nav-dropdown-trigger .tab-icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.nav-item-btn.active .tab-icon,
.nav-dropdown.has-active .tab-icon {
  transform: scale(1.1);
}

.tab-icon {
  font-size: 1.05rem;
  transition: transform 0.15s ease;
}

.dropdown-arrow {
  font-size: 0.72rem;
  color: var(--text-subtle);
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.nav-dropdown.has-active .dropdown-arrow {
  color: #94a3b8;
}

.nav-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Container */
.nav-dropdown {
  position: relative;
}

/* Dropdown Menu Panel */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 320px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 1001;
  animation: dropdownFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

#dropdown-personnel .dropdown-menu {
  left: auto;
  right: 0;
}

.nav-dropdown.open .dropdown-menu {
  display: flex;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dropdown Item Button */
.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.dropdown-item:hover {
  background: var(--bg-subtle);
  border-color: var(--border-light);
}

.dropdown-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.d-item-icon {
  font-size: 1.25rem;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.d-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.d-item-text strong {
  font-size: 0.88rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dropdown-item.active .d-item-text strong {
  color: var(--color-school);
}

.d-item-text small {
  font-size: 0.74rem;
  color: var(--text-subtle);
  line-height: 1.35;
}

/* Badges inside dropdown items */
.badge-tag {
  font-size: 0.68rem;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.badge-alert {
  font-size: 0.68rem;
  font-weight: 700;
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.tab-count-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  margin-left: 2px;
}

/* Hub Secondary Sub-Navigation Bar (Budgets & Properties Hubs) */
.hub-subnav-bar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 0;
  position: sticky;
  top: 61px;
  z-index: 95;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.hub-subnav-container {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 4px;
}

.hub-subnav-container::-webkit-scrollbar {
  display: none;
}

.hub-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hub-subnav-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.hub-subnav-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

/* Hub Feature Showcase Cards on Home Page */
.hub-feature-section {
  margin: 40px 0 20px;
}

.hub-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 18px;
}

.hub-feature-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.hub-feature-card:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.12);
}

.hub-feature-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.hub-feature-icon {
  font-size: 2rem;
  line-height: 1;
}

.hub-feature-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.hub-feature-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.3;
}

.hub-feature-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 18px;
}

.hub-feature-action {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.15s ease;
}

.hub-feature-card:hover .hub-feature-action {
  gap: 10px;
  color: #1d4ed8;
}

@media (max-width: 900px) {
  .hub-feature-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .hub-subnav-bar {
    top: 56px;
    padding: 6px 0;
  }
  .hub-subnav-btn {
    font-size: 0.76rem;
    padding: 5px 10px;
  }
}

/* MAIN CONTENT */
.main-content {
  padding: 28px 24px 80px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
  scroll-margin-top: 76px;
}

.tab-pane.active {
  display: block;
}

section[id],
div[id] {
  scroll-margin-top: 76px;
}

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

.section-intro {
  margin-bottom: 28px;
}

.section-badge-bar {
  margin-bottom: 8px;
}

.section-date-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-school);
  background: var(--color-school-light);
  border: 1px solid var(--color-school-border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
  letter-spacing: 0.02em;
}

.section-date-badge.alert-badge {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.section-intro h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.section-intro p {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 900px;
  line-height: 1.6;
}

/* CALCULATOR SECTION */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1.65fr;
  gap: 28px;
}

@media (max-width: 1024px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.calc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.calc-card:hover {
  box-shadow: var(--shadow-md);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-title-row h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.tooltip-badge, .formula-badge {
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-subtle);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.calc-hint {
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-bottom: 16px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.currency-symbol {
  position: absolute;
  left: 18px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.styled-input {
  width: 100%;
  padding: 16px 18px 16px 38px;
  font-size: 1.55rem;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.15s ease;
}

.styled-input:focus {
  border-color: var(--color-school);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Range Slider */
.slider-wrapper {
  margin-bottom: 20px;
}

.styled-slider {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-school);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  border: 2px solid #ffffff;
  transition: transform 0.1s ease;
}

.styled-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-subtle);
  margin-top: 6px;
  font-family: var(--font-mono);
}

.quick-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.preset-label {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 700;
}

.preset-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.preset-btn.active, .preset-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
  border-color: #cbd5e1;
}

.calc-summary-panel {
  background: var(--bg-dark);
  color: #ffffff;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border-dark);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: #94a3b8;
}

.summary-line:last-child {
  margin-bottom: 0;
}

.summary-line strong {
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

.summary-line.main-total {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.summary-line.main-total .total-highlight {
  font-size: 1.7rem;
  color: #38bdf8;
  font-weight: 800;
}

.info-alert {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: #166534;
  display: flex;
  gap: 12px;
  line-height: 1.5;
}

.alert-icon {
  font-size: 1.2rem;
}

/* Stacked bar */
.progress-stacked-wrapper {
  margin-bottom: 24px;
}

.progress-stacked {
  display: flex;
  height: 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.stack-segment {
  height: 100%;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.legend-row {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.school-dot { background-color: var(--color-school); }
.city-dot { background-color: var(--color-city); }
.county-dot { background-color: var(--color-county); }

.entity-cards-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.entity-calc-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  background: var(--bg-surface);
  border-left: 6px solid #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.entity-calc-card.schools-card {
  border-left-color: var(--color-school);
  background: linear-gradient(180deg, #ffffff 0%, var(--color-school-light) 100%);
}

.entity-calc-card.city-card {
  border-left-color: var(--color-city);
  background: linear-gradient(180deg, #ffffff 0%, var(--color-city-light) 100%);
}

.entity-calc-card.county-card {
  border-left-color: var(--color-county);
  background: linear-gradient(180deg, #ffffff 0%, var(--color-county-light) 100%);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.entity-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.entity-amt {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.entity-pct-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.components-list {
  margin-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.component-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.component-val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* BUDGET OVERVIEW */
.budget-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 900px) {
  .budget-comparison-grid {
    grid-template-columns: 1fr;
  }
}

.budget-overview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.budget-overview-card.school-theme {
  border-top: 6px solid var(--color-school);
}

.budget-overview-card.city-theme {
  border-top: 6px solid var(--color-city);
}

.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.school-badge {
  background: var(--color-school-light);
  color: var(--color-school);
  border: 1px solid var(--color-school-border);
}

.city-badge {
  background: var(--color-city-light);
  color: var(--color-city);
  border: 1px solid var(--color-city-border);
}

.big-amount {
  font-size: 2.3rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 4px 0 8px;
}

.per-year {
  font-size: 1rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.overview-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.budget-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--bg-subtle);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.b-metric {
  display: flex;
  flex-direction: column;
}

.b-metric .label {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 700;
  text-transform: uppercase;
}

.b-metric .val {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin-top: 2px;
}

.line-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.line-item-row {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--bg-surface);
  transition: border-color 0.15s ease;
}

.line-item-row:hover {
  border-color: var(--border-subtle);
}

.line-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 0.94rem;
  margin-bottom: 4px;
}

.line-amt {
  font-family: var(--font-mono);
  color: var(--color-school);
  font-weight: 800;
}

.city-theme .line-amt {
  color: var(--color-city);
}

.line-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* BENEFITS SECTION */
.benefits-summary-banner {
  background: linear-gradient(135deg, #111827 0%, #090d16 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
  border: 1px solid var(--border-dark);
}

.b-stat {
  display: flex;
  flex-direction: column;
}

.b-stat .stat-title {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
}

.b-stat .stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
  margin: 4px 0;
}

.b-stat .stat-detail {
  font-size: 0.78rem;
  color: #cbd5e1;
}

.benefits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

.benefits-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.benefits-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.benefits-card-sub {
  font-size: 0.86rem;
  color: var(--text-subtle);
  margin-bottom: 18px;
}

.plans-list, .cost-share-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-item-box {
  background: var(--bg-subtle);
  border-left: 4px solid var(--color-school);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.plan-title {
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--text-main);
}

.plan-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-school);
  margin-bottom: 4px;
}

.plan-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.cost-share-item {
  background: var(--bg-subtle);
  border-left: 4px solid var(--color-city);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.cost-share-header {
  font-weight: 800;
  font-size: 0.94rem;
  margin-bottom: 6px;
}

.cost-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.cost-example {
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
  border: 1px solid var(--border-light);
  line-height: 1.5;
}

.benefits-deep-dive {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.benefits-deep-dive h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 18px;
}

.retiree-benefits-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.retiree-benefit-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  background: var(--bg-subtle);
}

.retiree-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.retiree-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.retiree-impact-tag {
  font-size: 0.74rem;
  font-weight: 800;
  background: #fef3c7;
  color: #92400e;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid #fde68a;
}

.retiree-authority {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.retiree-details {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* CONTROVERSIES / ETHICS ALERTS */
.controversies-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.controversy-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
  border-left: 6px solid #cbd5e1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.controversy-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.controversy-card.sev-high {
  border-left-color: var(--color-danger);
}

.controversy-card.sev-medium {
  border-left-color: var(--color-warning);
}

.controversy-card.sev-low {
  border-left-color: var(--color-school);
}

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

.controversy-title-wrap h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.controversy-entity {
  font-size: 0.82rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.sev-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
}

.sev-badge.sev-high {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.sev-badge.sev-medium {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.sev-badge.sev-low {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.controversy-summary {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.controversy-body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.controversy-impact-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.controversy-status {
  font-size: 0.8rem;
  color: var(--text-subtle);
  font-weight: 600;
}

/* STAFF DIRECTORY */
.filter-controls {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  flex: 1;
  min-width: min(100%, 280px);
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  color: var(--text-subtle);
  pointer-events: none;
}

.styled-input-search {
  width: 100%;
  padding: 12px 16px 12px 42px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--bg-surface);
  transition: all 0.15s ease;
}

.styled-input-search:focus {
  border-color: var(--color-school);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-buttons {
  display: flex;
  gap: 8px;
}

.filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

.staff-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.data-table th {
  background: var(--bg-subtle);
  padding: 14px 18px;
  font-weight: 800;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-light);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.data-table tr:hover {
  background: #f8fafc;
}

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

.salary-tag {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #166534;
  background: #dcfce7;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.entity-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

.pill-school {
  background: var(--color-school-light);
  color: var(--color-school);
}

.pill-city {
  background: var(--color-city-light);
  color: var(--color-city);
}

/* ETHICS GRID */
.ethics-official-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
}

.ethics-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ethics-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ethics-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.ethics-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.ethics-title {
  font-size: 0.88rem;
  color: var(--color-school);
  font-weight: 700;
}

.ethics-filing-type {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin: 12px 0 8px;
}

.business-item, .property-item {
  background: var(--bg-subtle);
  border-left: 3px solid var(--color-warning);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.property-item {
  border-left-color: var(--color-city);
}

.business-name {
  font-weight: 800;
  color: var(--text-main);
}

.business-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.conflict-notice {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  line-height: 1.5;
}

.card-action-bar {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.verify-link {
  color: var(--color-school);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  display: inline-block;
  transition: color 0.15s ease;
}

.verify-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* VENDORS GRID */
.vendors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
}

.vendor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.vendor-card:hover {
  transform: translateY(-2px);
}

.vendor-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.vendor-entity {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.vendor-spend {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-school);
  margin: 10px 0;
}

.vendor-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========================================================
   CITIZEN INVESTIGATION TOOLKIT & OPRA PORTAL
   ======================================================== */

/* Hero Search Component */
.toolkit-hero-search {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
  border-top: 4px solid var(--color-school);
}

.toolkit-search-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.toolkit-search-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.toolkit-search-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.toolkit-search-bar-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.styled-input-lg {
  flex: 1;
  min-width: min(100%, 260px);
  padding: 14px 18px;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.styled-input-lg:focus {
  border-color: var(--color-school);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.action-btn-primary {
  background: var(--color-school);
  color: #ffffff;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.action-btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

/* Dynamic Search Results Container */
.toolkit-results-container {
  margin-top: 20px;
}

.search-empty-state {
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-results-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.2s ease;
}

.search-header-meta {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-count-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-main);
}

.count-pill {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.staff-pill {
  background: #dbeafe;
  color: #1e40af;
}

.ethics-pill {
  background: #fef3c7;
  color: #92400e;
}

.prop-pill {
  background: #dcfce7;
  color: #166534;
}

.search-portal-quicklinks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

.portal-quick-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.mini-portal-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.county-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.county-pill:hover {
  background: #2563eb;
  color: #ffffff;
}

.city-pill {
  background: #fdf2f8;
  color: #9d174d;
  border: 1px solid #fbcfe8;
}

.city-pill:hover {
  background: #db2777;
  color: #ffffff;
}

.fds-pill {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.fds-pill:hover {
  background: #ca8a04;
  color: #ffffff;
}

.biz-pill {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.biz-pill:hover {
  background: #16a34a;
  color: #ffffff;
}

/* Result Blocks & Cards */
.result-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-block-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 6px;
}

.result-cards-subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.result-mini-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.result-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.rmc-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.rmc-header strong {
  font-size: 1.05rem;
  color: var(--text-main);
}

.rmc-salary {
  font-size: 1rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-school);
}

.rmc-tax {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #b91c1c;
}

.rmc-tag {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-subtle);
}

.rmc-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.rmc-note {
  font-size: 0.78rem;
  color: var(--text-subtle);
  line-height: 1.4;
}

.rmc-actions {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.rmc-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-school);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

.rmc-body {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.rmc-item {
  margin-top: 2px;
}

.rmc-guidance {
  font-size: 0.78rem;
  color: #991b1b;
  background: #fef2f2;
  padding: 6px 8px;
  border-radius: 4px;
  margin-top: 4px;
  line-height: 1.4;
}

.rmc-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 4px;
}

.no-local-matches-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.no-local-matches-box h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.no-local-matches-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 16px;
  line-height: 1.5;
}

.portal-cta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.action-btn-portal {
  background: var(--bg-dark);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.action-btn-portal:hover {
  background: var(--color-school);
  color: #ffffff;
}

/* Step-by-Step Portal Guide Cards */
.investigation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.tool-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tool-card-top h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.tool-badge-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tool-explainer {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.step-by-step-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
}

.step-by-step-box ol {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-main);
  line-height: 1.5;
}

.tool-direct-link {
  margin-top: auto;
}

.external-pill-link {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--color-school);
  font-weight: 700;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}

.external-pill-link:hover {
  background: var(--color-school);
  color: #ffffff;
  border-color: var(--color-school);
}

/* Custodian Directory Grid */
.opra-custodians-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.custodian-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.custodian-card.city-custodian {
  border-top: 5px solid var(--color-city);
}

.custodian-card.boe-custodian {
  border-top: 5px solid var(--color-school);
}

.custodian-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.custodian-icon {
  font-size: 2.2rem;
}

.custodian-header h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.custodian-sub {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.custodian-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  background: var(--bg-subtle);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.c-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.84rem;
}

.c-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.c-val {
  color: var(--text-main);
  line-height: 1.4;
}

.email-link {
  color: var(--color-school);
  font-weight: 700;
  text-decoration: none;
}

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

.external-pill-link-sm {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-school);
  text-decoration: none;
}

.external-pill-link-sm:hover {
  text-decoration: underline;
}

.custodian-instructions {
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: #fdfdfd;
  border-left: 3px solid var(--border-subtle);
  padding: 10px 12px;
  border-radius: 4px;
}

/* OPRA Generator Component */
.opra-generator-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.opra-selector-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.selector-field {
  flex: 1;
  min-width: min(100%, 260px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selector-field label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.target-custodian-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.target-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-subtle);
}

.target-custodian-badge strong {
  font-size: 0.86rem;
  color: var(--color-school);
  font-family: var(--font-mono);
}

.opra-preview-box {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-dark);
  color: #f1f5f9;
  resize: vertical;
  line-height: 1.6;
}

.opra-action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.action-btn-copy {
  background: var(--bg-dark);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.action-btn-copy:hover {
  background: #334155;
}

.action-btn-email {
  background: var(--color-school);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.action-btn-email:hover {
  background: #1d4ed8;
  color: #ffffff;
}

/* FOOTER */
.app-footer {
  background: var(--bg-dark);
  color: #94a3b8;
  padding: 40px 0;
  border-top: 1px solid var(--border-dark);
  font-size: 0.88rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 600px;
}

.footer-badge {
  color: #10b981;
  font-weight: 700;
  font-size: 0.82rem;
}

.footer-sources {
  font-size: 0.78rem;
  color: #64748b;
}

/* ==========================================================================
   DEMOGRAPHICS & SPATIAL TAX ANALYSIS
   ========================================================================== */
.demo-citywide-banner {
  background: linear-gradient(135deg, #090d16 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-sm);
}

.demo-stat-box {
  display: flex;
  flex-direction: column;
}

.demo-stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.demo-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
  margin: 2px 0;
}

.demo-stat-sub {
  font-size: 0.76rem;
  color: #cbd5e1;
}

/* Generic Section Header & Badges */
.section-header {
  margin-bottom: 24px;
}

.section-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  line-height: 1.3;
}

.section-update-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  line-height: 1.3;
  max-width: 100%;
  word-break: break-word;
}

.section-header h2 {
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 10px;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.section-header p {
  color: var(--text-muted);
  font-size: clamp(0.88rem, 2.5vw, 1rem);
  line-height: 1.6;
  text-wrap: pretty;
  max-width: 85ch;
}

.section-subtitle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.section-subtitle-row h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.section-subtitle-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.pill-tag {
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
}

.pill-tag.alert-tag {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* Zip code comparison */
.zip-comparison-section {
  margin-bottom: 40px;
}

.zip-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 900px) {
  .zip-cards-grid {
    grid-template-columns: 1fr;
  }
}

.zip-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.zip-card.zip-07013 {
  border-top: 6px solid var(--color-school);
}

.zip-card.zip-07012 {
  border-top: 6px solid #8b5cf6;
}

.zip-card.zip-07011 {
  border-top: 6px solid var(--color-city);
}

.zip-card.zip-07014 {
  border-top: 6px solid #f59e0b;
}

.zip-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.zip-code-title {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.zip-area-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.zip-neighborhoods {
  font-size: 0.82rem;
  color: var(--text-subtle);
  margin-bottom: 20px;
  line-height: 1.45;
}

.zip-stat-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.metric-name {
  color: var(--text-muted);
  font-weight: 600;
}

.metric-val {
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.zip-takeaway-box {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: auto;
}

.zip-takeaway-box h4 {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zip-takeaway-box ul {
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.5;
}

/* Neighborhoods Grid */
.neighborhoods-section {
  margin-bottom: 40px;
}

.neighborhoods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
}

.neighborhood-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.neighborhood-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.n-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.n-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.n-top h4 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.n-zip {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.n-character {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-school);
}

.n-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.n-metric-box {
  background: var(--bg-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.n-metric-label {
  font-size: 0.7rem;
  color: var(--text-subtle);
  font-weight: 700;
  text-transform: uppercase;
}

.n-metric-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.n-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.n-tax-dynamic {
  background: #f8fafc;
  border-left: 3px solid var(--color-county);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-top: auto;
}

/* ========================================================
   FAMILY DEMOGRAPHICS & SCHOOL FEEDER NETWORK
   ======================================================== */
.family-schools-section {
  margin-bottom: 44px;
}

.highlight-school-pill {
  background: var(--color-school-light);
  color: var(--color-school);
  border: 1px solid var(--color-school-border);
}

.family-stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.family-stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.family-stat-box.highlight-stat {
  border-left: 4px solid var(--color-school);
}

.f-stat-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}

.f-stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.f-stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.family-tax-comparison-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

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

.ftc-header h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.fiscal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-recipient {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-subsidizer {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-balanced {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.stat-highlight-tag {
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--text-main);
}

/* Schools Feeder Explorer */
.schools-feeder-container {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.schools-feeder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.schools-feeder-header h4 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.schools-feeder-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 650px;
  line-height: 1.45;
}

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

.schools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.school-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.school-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.school-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
}

.school-type-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.school-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.school-address {
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-top: 3px;
}

.school-enrollment-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  text-align: center;
  min-width: 65px;
}

.seb-num {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-school);
  display: block;
}

.seb-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.school-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.s-spec-item {
  background: var(--bg-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.s-spec-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.s-spec-val {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1px;
}

.s-spec-val.highlight-warn {
  color: #b91c1c;
}

.school-feeder-box {
  background: #f8fafc;
  border-left: 3px solid var(--color-school);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.feeder-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  display: block;
  margin-bottom: 2px;
}

.feeder-path {
  font-weight: 700;
  color: var(--text-main);
}

.feeder-path span {
  color: var(--color-school);
}

.school-notes-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: auto;
  border-top: 1px dashed var(--border-light);
  padding-top: 10px;
}

/* Equity Takeaways Grid */
.equity-takeaways-section {
  margin-bottom: 20px;
}

.takeaways-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.takeaway-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--color-school);
}

.takeaway-card h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.takeaway-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========================================================
   TAB: PROPERTY VALUES & ASSESSMENTS STYLES
   ======================================================== */

.prop-metrics-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.prop-metric-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.prop-metric-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-school);
}

.prop-metric-box:nth-child(2)::before {
  background: var(--color-city);
}

.prop-metric-box:nth-child(3)::before {
  background: var(--color-county);
}

.prop-metric-box:nth-child(4)::before {
  background: #8b5cf6;
}

.p-met-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.p-met-val {
  font-size: 1.55rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 4px;
}

.p-met-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Filter Controls Panel */
.prop-filter-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.filter-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.filter-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  color: var(--text-main);
}

.filter-icon {
  font-size: 1.2rem;
}

.filter-results-badge {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--color-school-light);
  color: var(--color-school);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-school-border);
}

.btn-reset-filters {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset-filters:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.filter-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.filter-group input,
.filter-group select {
  padding: 8px 12px;
  font-size: 0.88rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-sans);
}

.filter-group input:focus,
.filter-group select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* View Toolbar */
.prop-view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.view-toggle-group {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.prop-view-info {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Property Cards Grid */
.properties-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.no-properties-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.no-properties-msg h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.property-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

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

.prop-address {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.prop-neighborhood {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: 3px;
  font-weight: 500;
}

/* Tier Badges */
.prop-tier-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.prop-tier-badge.tier-highest {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.prop-tier-badge.tier-high {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.prop-tier-badge.tier-median {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.prop-tier-badge.tier-mod {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Main Tax Banner */
.prop-main-tax-banner {
  background: #fafafa;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  border-left: 4px solid #dc2626;
}

.prop-tax-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}

.prop-tax-amount {
  font-size: 1.65rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #b91c1c;
  line-height: 1.2;
}

.tax-period {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-subtle);
}

.prop-tax-splits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.tax-split-item {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.school-split {
  background: var(--color-school-light);
  color: var(--color-school);
}

.city-split {
  background: var(--color-city-light);
  color: var(--color-city);
}

.county-split {
  background: var(--color-county-light);
  color: var(--color-county);
}

/* Specs Grid */
.prop-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.spec-item {
  background: var(--bg-subtle);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-subtle);
}

.spec-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.highlight-assess {
  color: var(--color-school);
  font-family: var(--font-mono);
}

/* Extra Details */
.prop-extra-details {
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
}

.extra-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ed-label {
  color: var(--text-subtle);
  font-weight: 600;
}

.ed-val {
  color: var(--text-main);
  font-weight: 500;
  text-align: right;
}

/* Card Actions */
.prop-card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-light);
}

.btn-load-calculator {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: var(--color-school-light);
  color: var(--color-school);
  border: 1px solid var(--color-school-border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-load-calculator:hover {
  background: var(--color-school);
  color: #ffffff;
  border-color: var(--color-school);
}

/* Properties Table Styles */
.properties-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
}

.properties-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.properties-data-table thead th {
  background: var(--bg-subtle);
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.properties-data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  white-space: nowrap;
}

.properties-data-table tbody tr:hover {
  background: #f8fafc;
}

.btn-table-action {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--color-school);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-table-action:hover {
  background: var(--color-school);
  color: #ffffff;
  border-color: var(--color-school);
}

/* Assessment Explainer Card */
.assessment-explainer-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 30px;
}

.explainer-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.explainer-content h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #14532d;
  margin-bottom: 6px;
}

.explainer-content p {
  font-size: 0.88rem;
  color: #166534;
  line-height: 1.55;
  margin-bottom: 8px;
}

.explainer-detail {
  font-size: 0.82rem;
  color: #15803d;
  font-weight: 500;
  margin-bottom: 0 !important;
}

.explainer-detail code {
  background: #dcfce7;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #14532d;
}

/* ========================================================
   PROPERTIES PAGINATION BAR & CONTROLS
   ======================================================== */
.properties-pagination-wrapper {
  margin: 18px 0;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.pagination-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pagination-summary strong {
  color: var(--text-main);
  font-weight: 700;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-pages-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn,
.pagination-nav-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  min-height: 38px;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled),
.pagination-nav-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: var(--color-school);
  color: var(--color-school);
  transform: translateY(-1px);
}

.pagination-btn.active {
  background: var(--color-school);
  border-color: var(--color-school);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.pagination-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border-light);
  background: var(--bg-subtle);
  transform: none;
}

.pagination-ellipsis {
  padding: 0 6px;
  color: var(--text-subtle);
  font-weight: 700;
  user-select: none;
}

/* ========================================================
   PAGE SOURCE CITATION FOOTER (ON EVERY TAB)
   ======================================================== */
.page-source-footer {
  margin-top: 36px;
  margin-bottom: 24px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--color-school);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}

.source-footer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.source-icon {
  font-size: 1.1rem;
}

.source-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.source-links-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
}

.source-links-list li a {
  color: var(--color-school);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.source-links-list li a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.source-doc-desc {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* ========================================================
   TAB: SURROUNDING TOWNS COMPARISON STYLES
   ======================================================== */
.comparative-insight-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.insight-pill {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.comparative-insight-banner p {
  font-size: 0.88rem;
  color: #166534;
  line-height: 1.55;
  margin: 0;
}

/* Interactive Cross-Town Comparator Control Panel */
.comparator-control-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.comparator-control-header {
  margin-bottom: 18px;
}

.cch-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cch-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.cch-title-wrap h3 {
  margin: 0 0 4px 0;
  font-size: 1.25rem;
  color: var(--text-main);
  font-weight: 800;
}

.cch-title-wrap p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.comparator-inputs-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.comp-input-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-with-affix {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-affix:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-affix {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-subtle);
  margin-right: 6px;
}

.input-with-affix input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
}

.comparator-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.comp-preset-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.comp-preset-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.comp-preset-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

.comp-help-text {
  display: block;
  font-size: 0.72rem;
  color: var(--text-subtle);
  margin-top: 6px;
}

.comp-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.comp-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.comparator-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.c-filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.comp-county-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.comp-county-btn {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.comp-county-btn:hover {
  background: #f8fafc;
  color: var(--text-main);
}

.comp-county-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.comp-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-color-box {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.legend-color-box.seg-school { background: #059669; }
.legend-color-box.seg-muni { background: #2563eb; }
.legend-color-box.seg-county { background: #d97706; }

/* Horizontal Stacked Spending Split Bar */
.comp-split-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
}

.comp-stacked-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 9999px;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.bar-seg {
  height: 100%;
  position: relative;
  transition: width 0.3s ease;
}

.bar-seg-school {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.bar-seg-muni {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.bar-seg-county {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.comp-split-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.label-school { color: #059669; }
.label-muni { color: #2563eb; }
.label-county { color: #b45309; }

/* Responsive Data Table according to responsive-table guide */
.surrounding-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(720px, 85vh);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  container-type: inline-size;
  -webkit-overflow-scrolling: touch;
}

.surrounding-table-wrapper:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.surrounding-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  text-align: left;
}

.surrounding-data-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 3;
}

.surrounding-data-table thead th {
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid #cbd5e1;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.surrounding-data-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: #ffffff;
  z-index: 1;
  font-weight: 700;
  border-bottom: 1px solid var(--border-light);
  padding: 12px 14px;
  white-space: nowrap;
}

.surrounding-data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  white-space: nowrap;
}

.surrounding-data-table tbody tr.highlight-focus-row th {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
}

.surrounding-data-table tbody tr.highlight-focus-row td {
  background: #eff6ff;
}

.surrounding-data-table tbody tr:hover td,
.surrounding-data-table tbody tr:hover th {
  background: #f8fafc;
}

.btn-town-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-town-switch:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.btn-town-switch.active-town {
  background: #059669;
  border-color: #047857;
  cursor: default;
}

.town-badge-bench {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-subtle);
  font-weight: 500;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Surrounding Town Cards */
.surrounding-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 16px;
  margin-bottom: 32px;
}

.surround-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.surround-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.surround-card.clifton-border {
  border-top: 4px solid var(--color-school);
  border-color: #bfdbfe;
}

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

.surround-town-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.surround-town-sub {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.surround-tax-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.s-tax-box {
  display: flex;
  flex-direction: column;
}

.s-tax-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-subtle);
}

.s-tax-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.surround-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.sm-metric {
  display: flex;
  flex-direction: column;
  background: #fdfdfd;
  border: 1px solid var(--border-light);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.sm-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-subtle);
}

.sm-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

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

.surround-notes {
  background: #f8fafc;
  border-left: 3px solid var(--color-county);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-top: auto;
}

/* ==========================================================================
   INTERACTIVE CROSS-SECTION NAVIGATION BUTTONS & JUMP LINKS
   ========================================================================== */

/* Header Stat Cards Clickable Style */
.clickable-stat-card {
  cursor: pointer;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease;
  user-select: none;
}

.clickable-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  border-color: var(--color-school);
}

.clickable-stat-card:focus-visible {
  outline: 2px solid var(--color-school);
  outline-offset: 2px;
}

.clickable-stat-card::after {
  content: "Explore ➔";
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
}

.clickable-stat-card:hover::after {
  background: var(--color-school);
  color: #ffffff;
}

/* Calculator Entity Card Action Bars */
.entity-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-light);
}

/* Action Bars in Cards (Controversies, Ethics, Vendors, Surrounding Towns) */
.card-action-bar-jumps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* Primary Jump Action Button */
.btn-jump-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--color-school);
  background: #eff6ff;
  color: var(--color-school);
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.35;
  text-decoration: none;
}

.btn-jump-action:hover {
  background: var(--color-school);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.btn-jump-action:active {
  transform: translateY(0);
}

/* Secondary Jump Action Button */
.btn-jump-action.secondary {
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.btn-jump-action.secondary:hover {
  border-color: var(--text-main);
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Alert / Urgency Jump Button */
.btn-jump-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid #f87171;
  background: #fef2f2;
  color: #b91c1c;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.35;
}

.btn-jump-alert:hover {
  background: #b91c1c;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(185, 28, 28, 0.2);
}

/* Budget Inline Jump Link */
.btn-jump-budget-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.btn-jump-budget-link:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
}

/* Property Card Action Jump Buttons */
.btn-jump-prop-toolkit {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #c2410c;
  transition: all 0.15s ease;
}

.btn-jump-prop-toolkit:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
  transform: translateY(-1px);
}

.btn-jump-prop-area {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  transition: all 0.15s ease;
}

.btn-jump-prop-area:hover {
  background: #334155;
  color: #ffffff;
  border-color: #334155;
  transform: translateY(-1px);
}

/* Staff Table Pill Tags & Jump Links */
.btn-jump-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 1px solid #fde047;
  background: #fef9c3;
  color: #854d0e;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-jump-tag:hover {
  background: #ca8a04;
  color: #ffffff;
  border-color: #ca8a04;
}

.btn-jump-tag-search {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 1px solid #bae6fd;
  background: #e0f2fe;
  color: #0369a1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-jump-tag-search:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE PHONE RESPONSIVENESS (< 768px & < 480px)
   ========================================================================== */

@media (max-width: 768px) {
  /* Container & Layout */
  .container {
    padding: 0 14px;
  }

  /* 1. App Hero Header on Phones: High-Contrast, Scannable & Compact */
  .app-header {
    padding: 20px 0 18px;
  }

  .header-container {
    gap: 18px;
  }

  .brand-badge {
    font-size: 0.7rem;
    padding: 5px 10px;
    margin-bottom: 10px;
    line-height: 1.3;
    white-space: normal;
  }

  .header-titles h1 {
    font-size: 1.75rem;
    line-height: 1.18;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    color: #ffffff;
    background: none;
    -webkit-text-fill-color: #ffffff;
    word-break: break-word;
  }

  .header-titles .subtitle {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #cbd5e1;
  }

  /* 3-Column Scannable Stat Strip on Mobile instead of 3 Tall Stacked Blocks */
  .header-stat-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
  }

  .clickable-stat-card::after {
    display: none !important;
  }

  .stat-card {
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    text-align: center;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }

  .stat-card-label {
    font-size: 0.68rem;
    color: #cbd5e1;
    line-height: 1.25;
    margin-bottom: 3px;
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  .stat-card-num {
    font-size: 1.18rem;
    color: #ffffff;
  }

  .stat-card-sub {
    font-size: 0.65rem;
    color: #93c5fd;
    margin-top: 2px;
    line-height: 1.2;
    text-wrap: pretty;
  }

  /* 2. Sticky Top Header & Navigation Bar on Phones: Two-Tier Clean Layout */
  .nav-bar {
    top: 0;
    padding: 6px 0 8px;
    background: #ffffff;
    border-bottom: 2px solid var(--border-light);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    padding: 0 12px;
    gap: 6px;
    min-height: auto;
    overflow: visible;
  }

  .nav-municipality-indicator,
  .nav-city-quick-wrap {
    display: none;
  }

  /* Tier 1: Full-width readable Brand Header Row */
  .nav-brand-lockup {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 4px 4px 6px;
    gap: 10px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 0;
  }

  .nav-brand-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .nav-brand-icon {
    font-size: 1rem;
  }

  .nav-brand-text {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  .nav-brand-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
  }

  .nav-brand-subtitle {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
  }

  /* Tier 2: Full-width Horizontal Touch Tab Bar */
  .nav-menu {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 8px;
    scroll-padding: 0 8px;
    gap: 8px;
    width: 100%;
  }

  .nav-menu::-webkit-scrollbar {
    display: none;
  }

  .nav-item-btn,
  .nav-dropdown-trigger {
    padding: 9px 13px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 40px;
  }

  .nav-item-btn.active,
  .nav-dropdown.has-active .nav-dropdown-trigger {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  }

  .tab-pane,
  section[id],
  div[id],
  h1[id],
  h2[id],
  h3[id],
  h4[id] {
    scroll-margin-top: 135px;
  }

  /* 3. Live Citizen Status Bar on Phones: Clean Pill Chips */
  .top-status-bar {
    padding: 10px 0;
    background: #f8fafc;
  }

  .status-bar-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .live-status-pill {
    font-size: 0.8rem;
    line-height: 1.35;
    color: #0f172a;
  }

  .status-quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
    font-size: 0.76rem;
  }

  .status-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 5px 8px;
    border-radius: 6px;
    color: #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .status-item:last-child {
    grid-column: 1 / -1;
  }

  .status-quick-links strong {
    font-size: 0.8rem;
    color: #0f172a;
  }

  .status-sep {
    display: none;
  }

  /* Mobile Bottom Sheet for Dropdowns */
  .dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 100%;
    max-width: 100vw;
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--border-light);
    border-bottom: none;
    box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.3);
    padding: 24px 16px calc(18px + env(safe-area-inset-bottom, 12px));
    max-height: 82vh;
    overflow-y: auto;
    animation: mobileSheetSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2200;
  }

  /* Visual handle on top of bottom sheet */
  .dropdown-menu::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 4px;
    background: var(--border-subtle);
    border-radius: var(--radius-pill);
  }

  /* Blurred Backdrop when sheet is open */
  .nav-dropdown.open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2150;
  }

  @keyframes mobileSheetSlide {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .dropdown-item {
    padding: 12px 14px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
  }

  .d-item-text strong {
    font-size: 0.94rem;
  }

  .d-item-text small {
    font-size: 0.78rem;
  }

  /* Calculator Section on Mobile */
  .calc-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .calc-card {
    padding: 20px 16px;
  }

  .styled-input {
    font-size: 1.35rem;
    padding: 14px 14px 14px 34px;
  }

  .currency-symbol {
    font-size: 1.2rem;
    left: 14px;
  }

  .calc-summary-panel {
    padding: 16px;
  }

  .summary-line.main-total .total-highlight {
    font-size: 1.45rem;
  }

  .quick-presets {
    gap: 6px;
  }

  .preset-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
    min-height: 40px;
  }

  .entity-calc-card {
    padding: 16px;
  }

  .entity-name {
    font-size: 1.05rem;
  }

  .entity-amt {
    font-size: 1.25rem;
  }

  .budget-comparison-grid,
  .neighborhoods-grid,
  .takeaways-grid,
  .properties-cards-grid,
  .investigation-grid,
  .opra-custodians-grid,
  .vendors-grid,
  .surrounding-cards-grid,
  .result-cards-subgrid,
  .family-stats-ribbon,
  .schools-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .schools-feeder-header {
    flex-direction: column;
    gap: 12px;
  }

  .school-filter-pills {
    width: 100%;
    flex-wrap: wrap;
  }

  .school-filter-pills .filter-btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }

  /* Filter Controls */
  .prop-filter-panel {
    padding: 18px 16px;
  }

  .filter-controls-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filter-controls {
    flex-direction: column;
    gap: 12px;
  }

  .filter-buttons {
    flex-wrap: wrap;
    width: 100%;
  }

  .filter-btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }

  /* Horizontal Scrolling Tables Touch Momentum */
  .staff-table-wrapper,
  .properties-table-wrapper,
  .surrounding-table-wrapper {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  .data-table th,
  .data-table td,
  .properties-data-table th,
  .properties-data-table td,
  .surrounding-data-table th,
  .surrounding-data-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  /* Citizen Investigation Toolkit */
  .toolkit-hero-search {
    padding: 20px 16px;
  }

  .toolkit-search-header {
    flex-direction: column;
    gap: 10px;
  }

  .toolkit-search-bar-row {
    flex-direction: column;
  }

  .action-btn-primary {
    width: 100%;
    padding: 12px 18px;
    text-align: center;
  }

  .opra-generator-box {
    padding: 18px 16px;
  }

  .opra-selector-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .target-custodian-badge {
    width: 100%;
  }

  .opra-action-buttons {
    flex-direction: column;
  }

  .action-btn-copy,
  .action-btn-email {
    width: 100%;
    justify-content: center;
  }

  /* Mobile Jump Links & Navigation Buttons */
  .card-action-bar-jumps {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-jump-action,
  .btn-jump-alert,
  .btn-jump-budget-link {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
  }

  /* Mobile Pagination */
  .pagination-bar {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px 10px;
    text-align: center;
  }

  .pagination-nav {
    justify-content: center;
    width: 100%;
    gap: 4px;
  }

  .pagination-pages-group {
    max-width: 100%;
    overflow-x: auto;
    padding: 4px 2px;
    -webkit-overflow-scrolling: touch;
  }

  .pagination-btn,
  .pagination-nav-btn {
    padding: 6px 10px;
    font-size: 0.82rem;
    min-height: 42px;
    min-width: 38px;
  }

  /* Page Footer */
  .footer-top {
    flex-direction: column;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  /* Extra compact & readable for smaller mobile devices */
  .container {
    padding: 0 12px;
  }

  .header-titles h1 {
    font-size: 1.55rem;
  }

  .header-stat-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .stat-card {
    padding: 8px 6px;
  }

  .stat-card-num {
    font-size: 1.05rem;
  }

  .nav-brand-title {
    font-size: 0.94rem;
  }

  .nav-brand-subtitle {
    font-size: 0.6rem;
    padding: 2px 6px;
  }

  .nav-item-btn,
  .nav-dropdown-trigger {
    padding: 8px 11px;
    font-size: 0.82rem;
  }

  .section-intro h2 {
    font-size: 1.4rem;
  }

  .section-intro p {
    font-size: 0.88rem;
  }

  .prop-metrics-ribbon {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .prop-metric-box {
    padding: 12px 14px;
  }

  .p-met-val {
    font-size: 1.35rem;
  }

  .prop-specs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .spec-item {
    padding: 6px 8px;
  }

  .spec-val {
    font-size: 0.82rem;
  }
}

/* ==========================================================================
   TAB 5: JOINED INTELLIGENCE & CROSS-DATASET REPORTS
   ========================================================================== */

.intel-nav-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-surface);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.intel-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-primary);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.intel-nav-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.intel-nav-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.intel-nav-btn.active .btn-icon {
  transform: scale(1.1);
}

.intel-report-panel {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.intel-report-panel.active {
  display: block;
}

.intel-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.intel-panel-header h3 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.intel-panel-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 820px;
  line-height: 1.55;
}

/* REPORT 1: ITEMIZED TAX GROCERY RECEIPT */
.receipt-quick-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-surface);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
}

.preset-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  margin-right: 4px;
}

.preset-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.preset-btn:hover {
  background: #e2e8f0;
}

.preset-btn.active {
  background: var(--color-school);
  color: #ffffff;
  border-color: var(--color-school);
}

.receipt-interactive-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 28px;
  align-items: start;
}

.receipt-controls-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.receipt-controls-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-group-receipt {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group-receipt label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-dollar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.dollar-symbol {
  position: absolute;
  left: 14px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.input-dollar-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 34px;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  background: var(--bg-surface);
  transition: border-color 0.2s;
}

.input-dollar-wrapper input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.receipt-summary-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.r-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.r-pill-total {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.r-pill-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.r-pill-val {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.r-pill-total .r-pill-val {
  color: var(--color-school);
  font-size: 1.25rem;
}

.receipt-insights-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.receipt-insights-card h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.receipt-takeaway-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.receipt-takeaway-list li {
  position: relative;
  padding-left: 18px;
  line-height: 1.5;
}

.receipt-takeaway-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--color-school);
  font-weight: bold;
}

.receipt-copy-btn {
  align-self: flex-start;
  margin-top: 4px;
}

/* THE RECEIPT PAPER SLIP */
.receipt-slip-container {
  display: flex;
  justify-content: center;
}

.receipt-paper {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  color: #1e293b;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  padding: 24px 20px;
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.16), 0 4px 12px -2px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  position: relative;
  border-radius: 4px;
}

.receipt-edge-top,
.receipt-edge-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: radial-gradient(circle, transparent, transparent 50%, #ffffff 50%, #ffffff 100%);
  background-size: 12px 12px;
}

.receipt-edge-top {
  top: -6px;
}

.receipt-edge-bottom {
  bottom: -6px;
  transform: rotate(180deg);
}

.receipt-header {
  text-align: center;
}

.receipt-city-logo {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.receipt-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.receipt-subtitle {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.receipt-cert-line {
  font-size: 0.68rem;
  color: #64748b;
  margin-bottom: 10px;
}

.receipt-dashed-divider {
  border-top: 1.5px dashed #cbd5e1;
  margin: 10px 0;
}

.receipt-double-divider {
  border-top: 3px double #0f172a;
  margin: 12px 0 10px 0;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  margin-bottom: 3px;
  color: #334155;
}

.receipt-items-table {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.receipt-item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  line-height: 1.35;
}

.receipt-item-desc {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
}

.item-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.tag-schools, .tag-boe {
  background: #dbeafe;
  color: #1e40af;
}

.tag-city {
  background: #d1fae5;
  color: #065f46;
}

.tag-county, .tag-passaic {
  background: #fef3c7;
  color: #92400e;
}

.item-title {
  font-size: 0.77rem;
  color: #1e293b;
}

.receipt-item-numbers {
  text-align: right;
  white-space: nowrap;
}

.item-annual {
  font-weight: 700;
  color: #0f172a;
}

.item-mo {
  font-size: 0.68rem;
  color: #64748b;
  margin-left: 4px;
}

.receipt-subtotals {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.receipt-subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.receipt-subtotal-row.small {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: normal;
}

.receipt-grand-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.02rem;
  font-weight: 900;
  color: #0f172a;
  padding: 4px 0;
}

.receipt-footer {
  text-align: center;
  margin-top: 12px;
}

.receipt-barcode {
  font-size: 1rem;
  letter-spacing: 3px;
  font-weight: bold;
  color: #0f172a;
  margin-top: 6px;
}

.receipt-barcode-number {
  font-size: 0.64rem;
  color: #64748b;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.receipt-thanks {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.5px;
}

.receipt-cert-tag {
  font-size: 0.6rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* REPORT 2: HOMES TO FUND SALARIES EQUIVALENCY */
.homes-calc-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.benchmark-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-muni {
  background: var(--color-city-light);
  color: #065f46;
  border: 1px solid var(--color-city-border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-school {
  background: var(--color-school-light);
  color: #1e40af;
  border: 1px solid var(--color-school-border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.intel-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-surface);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.intel-filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.intel-filter-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

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

.filter-pill-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.filter-pill-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.filter-pill-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

.homes-summary-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.hs-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.hs-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hs-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--color-danger);
  font-family: var(--font-mono);
}

.hs-sub {
  font-size: 0.74rem;
  color: var(--text-subtle);
  line-height: 1.35;
}

.intel-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.intel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.intel-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.intel-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.intel-table tr:hover td {
  background: #f8fafc;
}

.homes-count-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 6px;
}

.homes-number {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-danger);
}

.homes-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.homes-progress-bar {
  width: 100%;
  max-width: 130px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.homes-progress-fill {
  height: 100%;
  border-radius: 999px;
}

.fill-school {
  background: var(--color-school);
}

.fill-city {
  background: var(--color-city);
}

.homes-context-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: block;
  max-width: 260px;
}

/* REPORT 3: NEIGHBORHOOD FISCAL BALANCE SHEET */
.state-aid-banner {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.25);
}

.sa-icon {
  font-size: 2.4rem;
  background: rgba(255, 255, 255, 0.15);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.sa-text h4 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.sa-text p {
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.95;
}

.balance-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.balance-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.balance-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-donor {
  border-top: 4px solid var(--color-city);
}

.card-recipient {
  border-top: 4px solid var(--color-warning);
}

.bc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.bc-zip {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.5px;
}

.bc-area {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.balance-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.balance-badge.donor {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.balance-badge.recipient {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.bc-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bc-stat {
  background: var(--bg-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bc-stat-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
}

.bc-stat-val {
  font-size: 1.12rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.bc-stat-val.val-donor {
  color: var(--color-city);
}

.bc-stat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bc-driver-box {
  background: var(--bg-primary);
  border-left: 3px solid var(--color-school);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.bc-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bc-feeder-lbl {
  font-size: 0.72rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  font-weight: 600;
}

.bc-footer strong {
  font-size: 0.85rem;
  color: var(--text-main);
}

.balance-sheet-deepdive {
  margin-top: 28px;
}

.balance-sheet-deepdive h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-main);
}

.feeder-distribution-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.econ-pill {
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
}

/* REPORT 4: TAX PER SQ FT & HOUSING VINTAGE DISPARITY */
.vintage-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.vintage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.vc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vc-tag {
  background: var(--bg-dark);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.vc-count {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.vc-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.vc-metric-highlight {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
}

.vc-big-val {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-school);
}

.vc-big-lbl {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 700;
  text-transform: uppercase;
}

.vc-stats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
}

.vc-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.vc-row strong {
  color: var(--text-main);
  font-weight: 700;
}

.vintage-insight-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 26px;
}

.vib-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.vib-icon {
  font-size: 1.4rem;
}

.vib-header h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.vib-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

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

.vib-col {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
}

.vib-col strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

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

.vintage-sample-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

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

.tax-sqft-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* RESPONSIVE MEDIA QUERIES FOR INTELLIGENCE */
@media (max-width: 1024px) {
  .receipt-interactive-layout {
    grid-template-columns: 1fr;
  }

  .receipt-slip-container {
    justify-content: stretch;
  }

  .receipt-paper {
    max-width: 100%;
  }

  .homes-summary-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }

  .balance-sheet-grid {
    grid-template-columns: 1fr;
  }

  .vintage-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .vib-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .receipt-summary-pills {
    grid-template-columns: 1fr;
  }

  .homes-summary-ribbon {
    grid-template-columns: 1fr;
  }

  .vintage-grid {
    grid-template-columns: 1fr;
  }

  .state-aid-banner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

/* ==========================================================================
   TAB 6: COMMERCIAL RATABLES & PILOT TAX SHIFT
   ========================================================================== */

.pilot-metrics-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.pm-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.pm-lbl {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.5px;
}

.pm-val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
}

.pm-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.pilot-content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.pilot-content-card.highlight-card {
  border: 2px solid var(--color-school);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
}

.card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.card-head-row h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.card-head-row p {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 820px;
  line-height: 1.5;
}

.pilot-project-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 260px;
}

.pilot-project-selector label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
}

/* Ratable Shift Timeline */
.ratable-shift-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.rst-row {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 20px;
  transition: all 0.2s ease;
}

.rst-row.rst-current {
  background: #fff1f2;
  border-color: #fecdd3;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.08);
}

.rst-year-badge {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rst-year-badge strong {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.pill-current {
  background: #e11d48;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.rst-bars-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rst-bar-split {
  height: 28px;
  border-radius: var(--radius-pill);
  display: flex;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
}

.rst-bar-res {
  background: #ef4444;
  display: flex;
  align-items: center;
  padding: 0 12px;
  white-space: nowrap;
  transition: width 0.5s ease;
}

.rst-bar-comm {
  background: #475569;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  white-space: nowrap;
  transition: width 0.5s ease;
}

.rst-notes {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.shift-callout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.sc-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  gap: 14px;
}

.sc-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.sc-item strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.sc-item p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0;
}

/* PILOT Comparison Simulator */
.pilot-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.pilot-col {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pilot-col-standard {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
}

.pilot-col-abatement {
  background: #ecfdf5;
  border: 2px solid #10b981;
}

.p-col-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-col-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.5px;
}

.p-col-tag.pilot-tag {
  color: #047857;
}

.p-col-head h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.p-col-total {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.p-col-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.p-row.zero-row {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.p-val-school {
  color: var(--color-school);
  font-weight: 700;
}

.p-val-city {
  color: var(--color-city);
  font-weight: 700;
}

.p-val-county {
  color: var(--color-county);
  font-weight: 700;
}

.p-val-zero {
  color: #dc2626;
  font-weight: 800;
}

.p-col-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.82rem;
  line-height: 1.45;
}

.p-col-footer.pilot-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #065f46;
}

/* School Impact Callout */
.pilot-school-impact-banner {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  box-shadow: 0 4px 16px rgba(153, 27, 27, 0.25);
}

.psib-icon {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.15);
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.psib-content h4 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.psib-content p {
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 12px;
  opacity: 0.95;
}

.psib-bottom {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.psib-pill {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
}

.psib-pill.danger {
  background: #ffffff;
  color: #991b1b;
}

/* Commercial Appeal Badges */
.appeal-risk-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.appeal-risk-badge.risk-low {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.appeal-risk-badge.risk-med {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.appeal-risk-badge.risk-high {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Solutions Grid */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.solution-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.sol-num {
  font-size: 1.8rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--border-subtle);
  line-height: 1;
}

.solution-card h4 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-main);
}

.sol-proposal {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sol-benefit {
  margin-top: auto;
  background: #eff6ff;
  border-left: 3px solid var(--color-school);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #1e40af;
  line-height: 1.45;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .pilot-metrics-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }

  .pilot-comparison-grid {
    grid-template-columns: 1fr;
  }

  .shift-callout-grid {
    grid-template-columns: 1fr;
  }

  .solutions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pilot-metrics-ribbon {
    grid-template-columns: 1fr;
  }

  .rst-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pilot-school-impact-banner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .psib-icon {
    margin: 0 auto;
  }
}

/* ==========================================================================
   WHAT-IF FAIR TAX BURDEN & EQUALIZATION ENGINE STYLES
   ========================================================================== */

.fair-metrics-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.fm-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fm-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.fm-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 6px;
}

.fm-val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.fm-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.text-purple {
  color: #8b5cf6 !important;
}

/* Fair Card Containers */
.fair-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.fair-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.fc-icon {
  font-size: 1.8rem;
  line-height: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  flex-shrink: 0;
}

.fair-card-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

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

/* 5 Root Inequities Grid */
.inequities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.inequity-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.inequity-card:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

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

.inequity-metric {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-danger);
  background: #fee2e2;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.inequity-severity {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
}

.inequity-severity.critical {
  background: #ef4444;
  color: #ffffff;
}

.inequity-severity.high {
  background: #f97316;
  color: #ffffff;
}

.inequity-severity.medium {
  background: #eab308;
  color: #1e293b;
}

.inequity-card h4 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.inequity-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
  flex-grow: 1;
}

.inequity-remedy {
  font-size: 0.8rem;
  color: var(--color-city);
  background: var(--color-city-light);
  border: 1px solid var(--color-city-border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.inequity-remedy strong {
  display: block;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 2px;
}

/* Scenario Presets Bar */
.scenario-presets-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.preset-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-pill-btn:hover {
  background: var(--bg-primary);
  border-color: var(--color-accent);
}

.preset-pill-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.preset-pill-btn .pill-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.preset-pill-btn.active .pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-primary {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-accent {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
}

/* Active Scenario Details Callout */
.scenario-details-callout {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  align-items: center;
}

.sdc-summary strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.sdc-summary p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.sdc-impact {
  font-size: 0.8rem;
  line-height: 1.35;
}

.sdc-impact strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.sdc-impact.winners strong {
  color: var(--color-city);
}

.sdc-impact.losers strong {
  color: var(--color-danger);
}

/* ==========================================================================
   WHAT-IF SANDBOX CALCULATOR (2-COLUMN GRID)
   ========================================================================== */

.what-if-sandbox {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 30px;
  align-items: start;
}

.sandbox-controls-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sandbox-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}

.sandbox-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.sp-icon {
  font-size: 1.35rem;
}

.sandbox-panel-header h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.sandbox-input-group {
  margin-bottom: 16px;
}

.sandbox-input-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.tooltip-hint {
  cursor: help;
  color: var(--text-subtle);
  font-size: 0.8rem;
}

.input-with-affix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-affix:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-with-affix .affix {
  padding: 9px 12px;
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-subtle);
  border-right: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.input-with-affix input {
  border: none;
  padding: 9px 12px;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  background: transparent;
}

.field-hint {
  display: block;
  font-size: 0.74rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

.sandbox-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sandbox-input-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

.sandbox-input-group select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Policy Slider Controls */
.slider-control-group {
  margin-bottom: 22px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slider-label-row label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
}

.slider-label-row strong {
  font-family: var(--font-mono);
  color: var(--color-school);
  font-size: 0.92rem;
  margin-left: 4px;
}

.lever-badge {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-city-light);
  color: #065f46;
  border: 1px solid var(--color-city-border);
}

.slider-control-group input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-subtle);
  outline: none;
  accent-color: var(--color-accent);
  cursor: pointer;
  margin: 6px 0;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.slider-desc {
  display: block;
  font-size: 0.74rem;
  color: var(--text-subtle);
  margin-top: 5px;
}

/* Switch Toggle Control */
.toggle-control-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.toggle-text strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

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

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider.round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.slider.round:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider.round {
  background-color: var(--color-city);
}

input:checked + .slider.round:before {
  transform: translateX(22px);
}

.sandbox-reset-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* ==========================================================================
   RESULTS DASHBOARD COLUMN (DYNAMIC WHAT-IF OUTPUTS)
   ========================================================================== */

.sandbox-results-panel {
  background: linear-gradient(145deg, #ffffff, var(--bg-subtle));
  border: 2px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: sticky;
  top: 20px;
}

.results-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.rph-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.equity-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* KPI Impact Grid */
.kpi-impact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-impact-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.kpi-impact-card.highlight-card {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.kpi-impact-card.savings-card {
  border-color: #86efac;
  background: #f0fdf4;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.kpi-value.current-val {
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.savings-pct {
  font-weight: 700;
  color: #15803d;
}

/* Visual Comparison Track */
.visual-comparison-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.vc-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.vc-bar-track {
  height: 14px;
  background: #fee2e2;
  border-radius: 7px;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}

.vc-bar-before {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #fca5a5;
  border-radius: 7px;
}

.vc-bar-after {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 7px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.vc-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Equity Score Meter */
.equity-score-meter-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

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

.esm-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.esm-score {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.92rem;
  color: #059669;
}

.esm-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.esm-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.3s ease, background 0.3s ease;
}

.esm-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-subtle);
}

/* Destination Breakdown */
.destination-breakdown-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.destination-breakdown-box h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 10px 0;
}

.dest-split-bars {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.dest-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.dest-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.dest-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dest-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Fiscal Guarantee Banner */
.fiscal-guarantee-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.fgb-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.fgb-text strong {
  display: block;
  font-size: 0.78rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.fgb-text p {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

/* ==========================================================================
   SAMPLE HOUSEHOLD PROFILES CARDS
   ========================================================================== */

.sample-profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.sample-profile-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.sample-profile-card:hover {
  background: var(--bg-surface);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.spc-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.3;
}

.spc-meta {
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-bottom: 12px;
  line-height: 1.4;
}

.spc-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 12px;
}

.spc-col {
  display: flex;
  flex-direction: column;
}

.spc-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 600;
}

.spc-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
}

.spc-relief-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  background: #dcfce7;
  color: #15803d;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

.spc-apply-btn {
  margin-top: auto;
  width: 100%;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

.spc-apply-btn:hover {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

/* Roadmap Steps List */
.roadmap-steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.roadmap-step-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all 0.2s ease;
}

.roadmap-step-card:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

.rsc-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-dark);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
}

.rsc-content h4 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.rsc-law {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--color-school);
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.rsc-content p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.rsc-timeline {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-subtle);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* Civic Action Card */
.civic-action-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #090d16, #1e293b);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-top: 20px;
  gap: 20px;
}

.cac-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cac-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.cac-content h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #ffffff;
}

.cac-content p {
  font-size: 0.86rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

.cac-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .what-if-sandbox {
    grid-template-columns: 1fr;
  }

  .sandbox-results-panel {
    position: static;
  }

  .scenario-details-callout {
    grid-template-columns: 1fr;
  }

  .civic-action-card {
    flex-direction: column;
    text-align: center;
  }

  .cac-content {
    flex-direction: column;
  }

  .roadmap-step-card {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 12px;
  }

  .rsc-number {
    margin-bottom: 4px;
  }
}

@media (max-width: 640px) {
  .sandbox-row-2 {
    grid-template-columns: 1fr;
  }

  .kpi-impact-grid {
    grid-template-columns: 1fr;
  }

  .cac-actions {
    flex-direction: column;
    width: 100%;
  }

  .cac-actions button {
    width: 100%;
  }
}

/* Table Responsive Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
  margin-top: 10px;
  margin-bottom: 20px;
}

.table-responsive .data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

/* Helpers & Badges */
.font-mono {
  font-family: var(--font-mono);
}

.font-bold {
  font-weight: 700;
}

.salary-highlight {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #065f46;
  background: #dcfce7;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Generic Button Variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-school);
  color: #ffffff;
  border-color: var(--color-school);
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: #e2e8f0;
  border-color: #475569;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: #94a3b8;
}

.btn-outline-secondary {
  background: var(--bg-surface);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-outline-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--text-subtle);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-success {
  background: var(--color-city) !important;
  color: #ffffff !important;
  border-color: var(--color-city) !important;
}

/* Cross-Tab Pilot Fair Tax Callout */
.pilot-fair-tax-callout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 2px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 28px;
  gap: 20px;
}

.pftc-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pftc-icon {
  font-size: 2rem;
  line-height: 1;
}

.pftc-content h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.pftc-content p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .pilot-fair-tax-callout {
    flex-direction: column;
    text-align: center;
  }
  .pftc-content {
    flex-direction: column;
  }
}

/* ==========================================================================
   5 VISUAL ILLUSTRATIONS & DRILL-DOWN ENGINES
   ========================================================================== */

/* 1. INTERACTIVE TAX FLOW ECOSYSTEM (SANKEY FLOW) */
.tax-flow-card {
  margin-bottom: 30px;
}

.flow-toggle-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.flow-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.flow-toggle-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.flow-toggle-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ft-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ft-indicator.status-quo {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.ft-indicator.what-if {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.tax-flow-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  overflow-x: auto;
}

.flow-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 220px;
}

.flow-col-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flow-node {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.flow-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-subtle);
}

.flow-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.flow-node-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.flow-node-pct {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
}

.flow-node-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}

.flow-node-sub {
  font-size: 0.75rem;
  color: var(--text-subtle);
  line-height: 1.35;
}

.flow-node.pool-node {
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  border: 2px solid #3b82f6;
  box-shadow: 0 0 20px -3px rgba(59, 130, 246, 0.25);
  text-align: center;
  padding: 24px 18px;
}

.flow-node.pool-node .flow-node-header {
  justify-content: center;
}

.flow-node.pool-node .flow-node-val {
  font-size: 1.55rem;
  color: var(--color-school);
}

.flow-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-size: 1.4rem;
  opacity: 0.7;
}

/* 2. THE EQUITY BALANCE SCALE WIDGET */
.balance-scale-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
}

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

.bsw-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
}

.bsw-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  transition: all 0.3s ease;
}

.bsw-stage {
  position: relative;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.bsw-beam-container {
  position: relative;
  width: 90%;
  max-width: 320px;
  height: 8px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
}

.bsw-beam-bar {
  width: 100%;
  height: 6px;
  background: #475569;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.bsw-pan {
  position: absolute;
  top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  min-width: 95px;
  text-align: center;
}

.bsw-pan.left-pan {
  left: -20px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.bsw-pan.right-pan {
  right: -20px;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
}

.pan-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.pan-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pan-val {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 800;
}

.pan-sub {
  font-size: 0.68rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.bsw-fulcrum {
  position: absolute;
  bottom: 12px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 22px solid #334155;
}

.bsw-base {
  position: absolute;
  bottom: 4px;
  width: 48px;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
}

.bsw-subtext {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
}

/* 3. PERSONAL SAVINGS WATERFALL BREAKDOWN */
.waterfall-breakdown-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

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

.wfb-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.wfb-hint {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.wfb-steps-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wfb-step-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.wfb-step-icon {
  font-size: 1rem;
}

.wfb-step-info {
  display: flex;
  flex-direction: column;
}

.wfb-step-title {
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.wfb-step-desc {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.wfb-step-delta {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.wfb-step-delta.relief {
  background: #dcfce7;
  color: #15803d;
}

.wfb-step-delta.neutral {
  background: #e2e8f0;
  color: var(--text-muted);
}

.wfb-step-total {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-main);
  min-width: 72px;
  text-align: right;
}

/* 4. CLICK-TO-DRILL-DOWN TAX DOLLAR INSPECTOR */
.dest-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dest-hint {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.dest-inspector-tray {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-light);
}

.dit-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.dit-tab-btn {
  padding: 5px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dit-tab-btn:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.dit-tab-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

.dit-content-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.dit-line-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.dit-item-name {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

.dit-item-name small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-subtle);
  font-weight: 400;
}

.dit-item-pct {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.dit-item-amt {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-main);
}

/* 5. INTERACTIVE NEIGHBORHOOD COMPARISON CARDS & GAUGES */
.neighborhood-visual-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.nvc-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.nvc-card:hover {
  background: var(--bg-surface);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

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

.nvc-zip {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
}

.nvc-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.nvc-badge.severe {
  background: #fee2e2;
  color: #b91c1c;
}

.nvc-badge.moderate {
  background: #fef3c7;
  color: #b45309;
}

.nvc-badge.high-gross {
  background: #dbeafe;
  color: #1d4ed8;
}

.nvc-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.3;
}

.nvc-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.nvc-metric-label {
  color: var(--text-subtle);
}

.nvc-metric-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.nvc-effort-track {
  margin-bottom: 12px;
}

.nvc-effort-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.nvc-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.nvc-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.nvc-relief-box {
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  font-size: 0.78rem;
}

.nvc-relief-val {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #15803d;
  font-size: 0.88rem;
}

.nvc-load-btn {
  margin-top: 8px;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-school);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nvc-load-btn:hover {
  background: var(--color-school);
  color: #ffffff;
  border-color: var(--color-school);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .tax-flow-diagram {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .flow-connector {
    transform: rotate(90deg);
    margin: 4px 0;
  }
}

/* ==========================================================================
   CITY SWITCHER (CLIFTON vs. PARSIPPANY-TROY HILLS) & PARSIPPANY ZIP STYLES
   ========================================================================== */
.header-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.header-live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  color: #cbd5e1;
  backdrop-filter: blur(8px);
}

.live-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseBeacon 2s infinite;
  flex-shrink: 0;
}

.header-live-text {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-top-bar .brand-badge {
  margin-bottom: 0;
}

.city-switcher-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 4px 6px 4px 12px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.city-switcher-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.city-switcher-pills::-webkit-scrollbar {
  display: none;
}

.city-switcher-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-right: 2px;
  flex-shrink: 0;
}

.city-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.city-switch-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.city-switch-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: rgba(147, 197, 253, 0.5);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.city-btn-county {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.22);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* Nav Bar City Switcher */
.nav-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-city-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 3px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.city-switch-btn.compact {
  padding: 4px 10px;
  font-size: 0.74rem;
  color: #475569;
  border-radius: var(--radius-pill);
}

.city-switch-btn.compact:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.city-switch-btn.compact.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
}

/* Parsippany ZIP Code Card Accent Top Borders */
.zip-card.zip-07054 { border-top-color: #2563eb; }
.zip-card.zip-07034 { border-top-color: #dc2626; }
.zip-card.zip-07878 { border-top-color: #059669; }
.zip-card.zip-07950 { border-top-color: #7c3aed; }

@media (max-width: 768px) {
  .header-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .city-switcher-group {
    width: 100%;
    justify-content: flex-start;
    padding: 4px 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .city-switcher-label {
    display: none;
  }

  .city-switch-btn {
    flex-shrink: 0;
    justify-content: center;
    padding: 5px 10px;
    font-size: 0.74rem;
  }

  .nav-top-row {
    width: 100%;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 6px;
    gap: 8px;
  }

  .nav-city-switcher {
    overflow-x: auto;
    max-width: 58%;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-city-switcher::-webkit-scrollbar {
    display: none;
  }

  .comparator-inputs-grid {
    grid-template-columns: 1fr;
  }

  .nav-brand-lockup {
    width: auto;
    border-bottom: none;
    padding: 2px 0;
  }

  .nav-brand-subtitle {
    display: none;
  }
}

/* ==========================================================================
   TAB: CLIFTON ELECTION 2026 CANDIDATE DOSSIERS & VOTER HUB
   ========================================================================== */

/* Hero Highlights Banner & Condensed Strip */
.election-hero-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.election-hero-strip {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.election-hero-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.election-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}

.election-hero-card .hero-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.election-hero-card .hero-content h4 {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.election-hero-card .hero-content p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

/* Quick Nav Anchor Bar */
.election-quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
}

.election-quick-pill {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.election-quick-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  transition: all 0.15s ease;
}

.election-quick-pill:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
}

/* Scroll clearance for Election deep links & in-page anchors */
#election-search-anchor,
#election-ballot-overview,
#election-candidates-heading,
#election-controversies-heading,
#election-matrix-heading,
#election-boe-heading,
#election-nj-candidates-heading,
#election-voting-heading {
  scroll-margin-top: 100px;
}

@media (max-width: 900px) {
  #election-search-anchor,
  #election-ballot-overview,
  #election-candidates-heading,
  #election-controversies-heading,
  #election-matrix-heading,
  #election-boe-heading,
  #election-nj-candidates-heading,
  #election-voting-heading {
    scroll-margin-top: 135px;
  }
}

/* Search & Filtering Toolbar */
.election-controls-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.election-search-row {
  margin-bottom: 16px;
}

.election-search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.election-search-input-box .search-input-icon {
  position: absolute;
  left: 16px;
  font-size: 1.1rem;
  color: #64748b;
  pointer-events: none;
  z-index: 2;
}

.election-search-input-box input {
  width: 100%;
  padding: 12px 48px 12px 48px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.election-search-input-box input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-clear-search {
  position: absolute;
  right: 14px;
  background: #e2e8f0;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  color: #475569;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 2;
}

.btn-clear-search:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.election-filters-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}

.filter-group-status,
.filter-group-category {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 65px;
}

.btn-group-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 4px;
  max-width: 100%;
}

.filter-group-status .filter-btn {
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-group-status .filter-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

.category-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-pill-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.cat-pill-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.election-results-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.85rem;
  color: #64748b;
}

.election-expand-controls {
  display: flex;
  gap: 8px;
}

.btn-toggle-expand {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle-expand:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

/* Candidate Cards Container & Grid */
.election-candidates-main-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.candidate-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
  margin-top: 8px;
}

.candidate-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.candidate-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.candidate-card.is-incumbent {
  border-top: 3.5px solid #2563eb;
}

.candidate-card.is-challenger {
  border-top: 3.5px solid #059669;
}

.candidate-card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.card-council-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 1.5px 7px;
  border-radius: var(--radius-pill);
}

.candidate-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.candidate-photo-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  background: #f1f5f9;
}

.candidate-card.is-incumbent .candidate-photo-box {
  border-color: #93c5fd;
}

.candidate-card.is-challenger .candidate-photo-box {
  border-color: #86efac;
}

.candidate-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.25s ease;
}

.candidate-card:hover .candidate-photo-img {
  transform: scale(1.06);
}

.candidate-avatar-fallback,
.candidate-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.candidate-card.is-incumbent .candidate-avatar-fallback,
.candidate-card.is-incumbent .candidate-avatar {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1d4ed8;
}

.candidate-card.is-challenger .candidate-avatar-fallback,
.candidate-card.is-challenger .candidate-avatar {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #047857;
}

.candidate-identity {
  flex: 1;
  min-width: 0;
  padding-right: 0;
}

.candidate-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 2px;
  word-wrap: break-word;
}

.candidate-role {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.3;
}

.candidate-ballot-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ballot-num {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: #0f172a;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.candidate-status-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
}

.status-incumbent {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.status-challenger {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.candidate-tagline {
  font-size: 0.8rem;
  font-style: italic;
  color: #1e293b;
  background: #f8fafc;
  border-left: 2.5px solid #cbd5e1;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  margin: 6px 0 10px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.candidate-card.is-incumbent .candidate-tagline {
  border-left-color: #2563eb;
  background: #f0f7ff;
}

.candidate-card.is-challenger .candidate-tagline {
  border-left-color: #059669;
  background: #f0fdf4;
}

.candidate-badges-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.badge-pledge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-pill);
}

.cand-cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-pill);
}

/* Accessible Details Accordion */
.candidate-accordion {
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  margin-top: auto;
}

.candidate-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2563eb;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.candidate-accordion-summary::-webkit-details-marker {
  display: none;
}

.candidate-accordion-summary:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.candidate-accordion-summary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.summary-btn-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.accordion-arrow {
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.candidate-accordion[open] .accordion-arrow {
  transform: rotate(180deg);
}

.candidate-expanded-content {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Segmented Dossier Tab Nav */
.candidate-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.cand-tab-btn {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cand-tab-btn:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.cand-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.cand-tab-panes {
  position: relative;
}

.cand-tab-pane {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.cand-tab-pane::-webkit-scrollbar {
  width: 4px;
}

.cand-tab-pane::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.cand-tab-pane::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.pillars-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 4px;
  border-bottom: 1px dashed #cbd5e1;
}

.candidate-pillars-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pillar-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.pillar-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.pillar-icon {
  font-size: 0.95rem;
}

.pillar-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.pillar-desc {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.candidate-quote-box {
  position: relative;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 10px 12px 10px 24px;
  font-size: 0.82rem;
  font-style: italic;
  color: #92400e;
  line-height: 1.45;
}

.quote-mark {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 1.3rem;
  line-height: 1;
  color: #d97706;
  font-family: serif;
}

.candidate-civic-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.civic-box-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.candidate-civic-box p {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.45;
  margin: 0;
}

/* Empty search state */
.empty-election-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.empty-election-state h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.empty-election-state p {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 16px;
}

/* Platform Comparison Matrix Table */
.election-matrix-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-top: 16px;
}

.election-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.election-matrix-table thead th {
  background: #0f172a;
  color: #f8fafc;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #1e293b;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.election-matrix-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.election-matrix-table tbody tr:hover {
  background: #f8fafc;
}

.election-matrix-table tbody td {
  padding: 12px 14px;
  vertical-align: top;
  color: #334155;
  line-height: 1.45;
}

.matrix-candidate-cell {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.matrix-ballot-badge {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: #1e293b;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.matrix-role-sub {
  display: block;
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.3;
}

.matrix-pillar-text strong {
  display: block;
  font-size: 0.82rem;
  color: #0f172a;
  margin-bottom: 2px;
}

.matrix-pillar-text p {
  font-size: 0.78rem;
  color: #475569;
  margin: 0;
}

.matrix-pledge-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ==========================================================================
   BALLOT OVERVIEW & OFFICES ARCHITECTURE GRID
   ========================================================================== */
.ballot-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ballot-office-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ballot-office-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ballot-office-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 6px;
  flex-wrap: wrap;
}

.ballot-office-level {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.ballot-vote-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-pill);
  background: #ffffff;
  white-space: nowrap;
}

.ballot-office-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.25;
}

.ballot-office-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.ballot-office-meta .meta-tag {
  font-size: 0.72rem;
  color: #475569;
  background: #f1f5f9;
  padding: 1.5px 6px;
  border-radius: 3px;
}

.ballot-office-tax {
  font-size: 0.74rem;
  color: #1e293b;
  background: #eff6ff;
  border-left: 2.5px solid #3b82f6;
  padding: 4px 8px;
  border-radius: 0 3px 3px 0;
  margin-bottom: 6px;
  line-height: 1.35;
}

.ballot-office-desc {
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.4;
  margin: 0;
}

/* Board of Education Cards Grid */
.boe-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  margin-top: 14px;
}

.boe-card {
  background: var(--bg-surface);
  border: 1.5px solid #bfdbfe;
  border-top: 3.5px solid var(--color-school);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.boe-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.boe-card.boe-card-unexpired {
  border-top-color: #f59e0b;
}

.boe-vote-instruction.instruction-unexpired {
  color: #b45309;
  font-weight: 700;
}

.off-cycle-notice-block {
  border: 1px solid var(--border-color);
  border-left: 4px solid #64748b !important;
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(100, 116, 139, 0.05);
}

.boe-card-header {
  margin-bottom: 10px;
}

.boe-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 6px;
  flex-wrap: wrap;
}

.boe-school-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.boe-vote-instruction {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.boe-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.boe-slogan {
  font-size: 0.84rem;
  font-style: italic;
  color: #475569;
  margin-bottom: 6px;
}

.boe-card-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.boe-detail-row {
  font-size: 0.82rem;
  line-height: 1.45;
}

.boe-detail-label {
  font-weight: 700;
  color: #334155;
  margin-right: 4px;
}

.boe-detail-val {
  color: #475569;
}

.boe-card-body {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.boe-focus-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.boe-focus-text {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.boe-priority-box {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.45;
}

.boe-fiscal-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.boe-infra-box {
  background: #fefce8;
  border: 1px solid #fef08a;
}

.boe-priority-header {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
  font-size: 0.76rem;
}

.boe-priority-text {
  margin: 0;
  color: #334155;
}

/* ==========================================================================
   NEW JERSEY STATEWIDE & PASSAIC COUNTY CANDIDATES SECTION
   ========================================================================== */
.nj-offices-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.nj-office-block {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.nj-office-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.nj-office-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.office-flag-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.nj-office-title-row h4 {
  margin: 0 0 2px 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.nj-office-meta {
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.highlight-vote-rule {
  color: #1d4ed8;
  background: #eff6ff;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
  display: inline-block;
}

.nj-office-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.federal-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.county-badge {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.nj-office-importance {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 12px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 2.5px solid #cbd5e1;
}

.nj-candidates-subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}

.nj-candidate-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.nj-cand-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.nj-party-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.party-dem {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.party-rep {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.party-ind {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.nj-cand-name {
  margin: 0 0 3px 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.nj-cand-role {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 10px;
  line-height: 1.35;
}

.nj-cand-section {
  font-size: 0.8rem;
  line-height: 1.45;
  color: #334155;
  margin-top: 8px;
}

.nj-cand-section p {
  margin: 0;
}

.nj-section-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}

.local-impact-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 6px 10px;
}

/* Voting Guide Grid & Cards */
.voting-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 18px;
}

.voting-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.voting-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.voting-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.voting-card-header h4 {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.voting-sub {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.voting-fact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #f1f5f9;
  font-size: 0.84rem;
}

.v-label {
  color: #64748b;
  font-weight: 600;
}

.v-val {
  color: #0f172a;
  text-align: right;
}

.dropbox-explainer {
  font-size: 0.82rem;
  color: #475569;
  margin-bottom: 12px;
  line-height: 1.45;
}

.dropbox-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dropbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.dropbox-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.dropbox-info strong {
  display: block;
  font-size: 0.86rem;
  color: #0f172a;
}

.dropbox-info span {
  display: block;
  font-size: 0.8rem;
  color: #475569;
}

.dropbox-notes {
  display: inline-block;
  font-size: 0.72rem;
  color: #15803d;
  font-weight: 700;
  margin-top: 2px;
}

.clerk-info-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.clerk-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
}

.voting-links-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 768px) {
  .candidate-cards-grid {
    grid-template-columns: 1fr;
  }
  .election-results-status {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   INVESTIGATIVE DOSSIER, OUTSIDE BUSINESSES & CONTROVERSIES STYLING
   ========================================================================== */

/* Filter Toggle Buttons: Alert & Clean */
.filter-btn-alert {
  color: #b91c1c !important;
  border: 1px solid transparent !important;
}

.filter-btn-alert:hover,
.filter-btn-alert.active {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.15) !important;
}

.filter-btn-clean {
  color: #15803d !important;
  border: 1px solid transparent !important;
}

.filter-btn-clean:hover,
.filter-btn-clean.active {
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
  color: #166534 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(34, 197, 94, 0.15) !important;
}

/* Card Badges */
.badge-controversy-alert {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--radius-pill);
}

.badge-clean-record {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-pill);
}

/* Candidate Card: Investigative Dossier Block */
.candidate-investigative-dossier {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.candidate-card.has-controversies .candidate-investigative-dossier {
  border-color: #fca5a5;
  background: #fffafa;
}

.candidate-card.is-clean-record .candidate-investigative-dossier {
  border-color: #bbf7d0;
  background: #fcfdfc;
}

.dossier-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cbd5e1;
}

.dossier-title-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
}

.dossier-status-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.dossier-status-pill.pill-alert {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.dossier-status-pill.pill-clean {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.dossier-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dossier-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dossier-biz-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dossier-biz-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #ffffff;
  color: #1e293b;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
}

.dossier-biz-none {
  font-size: 0.78rem;
  color: #64748b;
  font-style: italic;
}

.dossier-text {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.45;
  margin: 0;
}

/* Controversies List inside Card */
.dossier-controversies-box {
  background: #ffffff;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.dossier-section-alert-head {
  font-size: 0.78rem;
  font-weight: 800;
  color: #991b1b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dossier-controversies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dossier-controversy-entry {
  background: #fff5f5;
  border-left: 3px solid #dc2626;
  border-radius: 0 4px 4px 0;
  padding: 8px 10px;
}

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

.dc-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #b91c1c;
}

.dc-era {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  font-family: var(--font-mono);
}

.dc-title {
  display: block;
  font-size: 0.82rem;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 4px;
}

.dc-details {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.45;
  margin: 0 0 6px 0;
}

.dc-outcome {
  font-size: 0.76rem;
  color: #1e293b;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #fee2e2;
  line-height: 1.4;
}

.dc-outcome strong {
  color: #047857;
}

/* Clean Record Box inside Card */
.dossier-clean-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.clean-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #15803d;
  margin-bottom: 4px;
}

.clean-check-icon {
  font-weight: 900;
  font-size: 0.95rem;
}

.dossier-clean-box p {
  font-size: 0.78rem;
  color: #166534;
  line-height: 1.4;
  margin: 0;
}

/* Recusal Watch Box */
.recusal-field {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.dossier-recusal-text {
  font-size: 0.76rem;
  color: #1e40af;
  line-height: 1.4;
  margin: 0;
}

/* ==========================================================================
   SPOTLIGHT SECTION: OUTSIDE BUSINESSES & CONTROVERSIES
   ========================================================================== */
.controversies-spotlight-container {
  margin-top: 20px;
  margin-bottom: 40px;
}

/* Stats Banner */
.spotlight-stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.sp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.sp-num {
  font-size: 1.55rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #0f172a;
  line-height: 1.1;
}

.sp-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.sp-stat.sp-alert .sp-num {
  color: #dc2626;
}

.sp-stat.sp-alert {
  border-color: #fecaca;
  background: #fff5f5;
}

.sp-stat.sp-clean .sp-num {
  color: #15803d;
}

.sp-stat.sp-clean {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.spotlight-sub-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 10px;
}

.spotlight-sub-hint {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 500;
}

.spotlight-group-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #991b1b;
}

/* Spotlight Accordions Stack (Condensed, Clean, No Duplication Overload) */
.spotlight-accordions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spotlight-accordion-card {
  background: var(--bg-surface);
  border: 1px solid #fecaca;
  border-left: 3.5px solid #dc2626;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.spotlight-accordion-card[open] {
  border-color: #f87171;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

.spotlight-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fffafa;
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 10px;
  flex-wrap: wrap;
}

.spotlight-accordion-summary::-webkit-details-marker {
  display: none;
}

.spotlight-accordion-summary:hover {
  background: #fef2f2;
}

.sp-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

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

.spotlight-cand-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.spotlight-cand-role {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
}

.sp-alert-pill {
  font-size: 0.7rem;
  font-weight: 800;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.sp-accordion-arrow {
  font-size: 0.85rem;
  color: #991b1b;
  transition: transform 0.2s ease;
}

.spotlight-accordion-card[open] .sp-accordion-arrow {
  transform: rotate(180deg);
}

.spotlight-accordion-content {
  padding: 12px 14px;
  border-top: 1px solid #fee2e2;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spotlight-sub-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.spotlight-biz-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.biz-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #1e293b;
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
}

.spotlight-items-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spotlight-controversy-item {
  background: #fffafa;
  border: 1px solid #fee2e2;
  border-left: 3px solid #dc2626;
  border-radius: 0 4px 4px 0;
  padding: 8px 10px;
}

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

.sc-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: #991b1b;
}

.sc-date {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  font-family: var(--font-mono);
}

.sc-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
}

.sc-details {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
  margin: 0 0 5px 0;
}

.sc-outcome {
  font-size: 0.74rem;
  color: #1e293b;
  background: #ffffff;
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid #fecaca;
  line-height: 1.35;
}

.sc-outcome strong {
  color: #047857;
}

.spotlight-recusal-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 0.74rem;
  color: #166534;
  line-height: 1.35;
}

.spotlight-recusal-box strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.spotlight-recusal-box p {
  margin: 0;
}

/* Clean Section: Compact Grid of Verified Clean Pills */
.clean-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.clean-candidate-pill {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-left: 3px solid #15803d;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  flex-wrap: wrap;
}

.clean-check {
  color: #15803d;
  font-weight: 900;
  font-size: 0.85rem;
}

.clean-num {
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: #f0fdf4;
  color: #166534;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid #bbf7d0;
}

.clean-name {
  color: #0f172a;
  font-weight: 700;
}

.clean-role-text {
  font-size: 0.72rem;
  color: #64748b;
  flex-basis: 100%;
  margin-left: 20px;
}

/* Condensed Matrix Details Snippet */
.matrix-p-condensed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.35;
  margin: 2px 0 0 0;
}

.clean-biz-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #dcfce7;
}

/* ==========================================================================
   VERIFIED SOURCES & PUBLIC RECORDS STYLES
   ========================================================================== */
.candidate-sources-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
}

.sources-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
}

.candidate-sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.candidate-source-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: all 0.15s ease;
}

.candidate-source-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.source-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.source-tag {
  font-size: 0.77rem;
  font-weight: 700;
  color: #0f172a;
}

.source-ext-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}

.source-ext-link:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  text-decoration: none;
}

.source-doc-text {
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

/* Primary Public Sources in Spotlight Cards */
.spotlight-sources-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spotlight-sub-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.sp-sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sp-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.15s ease;
}

.sp-source-pill:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  text-decoration: none;
}

/* ==========================================================================
   CANDIDATE HISTORIC EXPERIENCE & CAREER TIMELINE STYLES
   ========================================================================== */
.candidate-history-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.history-box-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
}

.history-service-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.history-summary-text {
  font-size: 0.81rem;
  color: #334155;
  line-height: 1.5;
  margin: 0;
}

.history-sub-title {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

/* Timeline */
.history-timeline-section {
  display: flex;
  flex-direction: column;
}

.history-timeline-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-entry {
  display: flex;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  align-items: flex-start;
}

.timeline-period-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-role {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
}

.timeline-org {
  font-size: 0.74rem;
  font-weight: 600;
  color: #2563eb;
}

.timeline-desc {
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.4;
  margin: 2px 0 0 0;
}

/* Credentials Row (Two Columns on Desktop) */
.history-creds-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .history-creds-row {
    grid-template-columns: 1fr;
  }
}

.history-col {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.history-bullets-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-bullets-list li {
  font-size: 0.76rem;
  color: #334155;
  line-height: 1.4;
  position: relative;
  padding-left: 12px;
}

.history-bullets-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #2563eb;
  font-weight: 900;
}

.history-tenure {
  font-size: 0.71rem;
  color: #64748b;
  font-weight: 600;
}

.history-item-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 1px;
}

/* Civic Leadership Tags */
.history-civic-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.history-civic-tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-civic-pill {
  font-size: 0.73rem;
  font-weight: 600;
  color: #1e293b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  line-height: 1.35;
}

/* ==========================================================================
   CANDIDATE CARD DETAIL SECTIONS & ELECTION GROUP HEADERS
   ========================================================================== */
.candidate-expanded-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
}

.candidate-detail-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease;
}

.candidate-detail-section:hover {
  border-color: #cbd5e1;
}

.candidate-detail-section.section-history {
  border-left: 3px solid #3b82f6;
}

.candidate-detail-section.section-platform {
  border-left: 3px solid #10b981;
}

.candidate-detail-section.section-dossier {
  border-left: 3px solid #6366f1;
}

.candidate-detail-section.section-dossier.has-alerts {
  border-left: 3px solid #ef4444;
}

.candidate-detail-section.section-sources {
  border-left: 3px solid #f59e0b;
}

.detail-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.detail-section-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-section-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.detail-section-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  flex-grow: 1;
}

.detail-section-body {
  padding: 12px 14px;
}

.sources-count-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

/* Candidates Grouping Headers on Election Page */
.candidates-group-wrapper {
  margin-top: 18px;
}

.candidates-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.group-title-lockup {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.group-title-lockup h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.group-subtitle {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 500;
}

.group-icon {
  font-size: 1rem;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS: ELECTION 2026 CONTROLS, ANCHORS & CANDIDATE CARDS
   ========================================================================== */
@media (max-width: 768px) {
  .election-controls-wrapper {
    padding: 16px 14px;
  }

  .filter-group-status,
  .filter-group-category {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .filter-group-status .btn-group-toggle {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: var(--radius-md);
  }

  .filter-group-status .filter-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 130px;
    text-align: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .filter-group-status .filter-btn[data-status="clean"] {
    flex: 1 1 100%;
  }

  .category-pills-row {
    width: 100%;
    gap: 6px;
  }

  .cat-pill-btn {
    padding: 5px 10px;
    font-size: 0.76rem;
  }

  .election-results-status {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .election-expand-controls {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .election-expand-controls .btn-toggle-expand {
    flex: 1;
    text-align: center;
  }

  /* Mobile Section Headers & Subtitles (Zero Overlap & Zero Cut-Off) */
  .section-header {
    margin-bottom: 20px;
  }

  .section-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }

  .section-header h2 {
    font-size: clamp(1.35rem, 4.5vw, 1.75rem);
    line-height: 1.25;
    margin-bottom: 8px;
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  .section-header p {
    font-size: 0.88rem;
    line-height: 1.5;
    text-wrap: pretty;
  }

  .section-subtitle-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
  }

  .section-subtitle-row h3 {
    font-size: clamp(1.15rem, 4vw, 1.3rem);
    line-height: 1.3;
    width: 100%;
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  .section-subtitle-row .pill-tag {
    white-space: normal;
    line-height: 1.35;
    max-width: 100%;
    text-wrap: pretty;
    word-break: break-word;
  }

  .section-subtitle-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 16px;
    text-wrap: pretty;
  }

  .nj-office-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nj-office-title-row {
    width: 100%;
  }

  .nj-office-title-row h4 {
    font-size: 1rem;
    line-height: 1.3;
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  .nj-office-badge {
    white-space: normal;
    line-height: 1.35;
    max-width: 100%;
    text-wrap: pretty;
    word-break: break-word;
  }

  .boe-badge-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .boe-badges-right {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .boe-name {
    font-size: 1.15rem;
    line-height: 1.3;
    text-wrap: balance;
  }

  .boe-vote-instruction {
    font-size: 0.78rem;
    line-height: 1.35;
    text-wrap: pretty;
    word-break: break-word;
  }

  .candidate-card-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cand-badges-left,
  .cand-badges-right {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .candidate-name {
    font-size: clamp(1.15rem, 4vw, 1.35rem);
    line-height: 1.25;
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  .group-title-lockup {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .group-title-lockup h4 {
    font-size: 0.95rem;
    line-height: 1.3;
    text-wrap: balance;
  }

  .group-subtitle {
    font-size: 0.72rem;
    line-height: 1.3;
    text-wrap: pretty;
  }

  .election-hero-card {
    padding: 10px 12px;
  }

  .election-hero-card h4 {
    font-size: 0.92rem;
    line-height: 1.25;
    text-wrap: balance;
  }

  .election-hero-card p {
    font-size: 0.78rem;
    line-height: 1.35;
    text-wrap: pretty;
  }

  .election-quick-pill {
    padding: 5px 10px;
    font-size: 0.76rem;
    line-height: 1.3;
    max-width: 100%;
    text-wrap: pretty;
  }
}

@media (max-width: 480px) {
  .candidate-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .candidate-card {
    padding: 16px;
  }

  .candidate-card-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .filter-group-status .filter-btn {
    flex: 1 1 100%;
  }
}

/* ==========================================================================
   VOTER COMPASS & CANDIDATE MATCHMAKER
   ========================================================================== */
.matchmaker-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin: 32px 0 40px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  scroll-margin-top: 135px;
}

.matchmaker-intro-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.matchmaker-intro-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.matchmaker-intro-text h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.matchmaker-intro-text p {
  font-size: 0.88rem;
  color: #334155;
  margin: 0;
  line-height: 1.5;
}

.compass-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.compass-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  background: #f8fafc;
  margin: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.compass-fieldset:focus-within {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.compass-legend {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compass-legend-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.compass-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.compass-option-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.compass-option-label:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
  transform: translateY(-1px);
}

.compass-option-label input[type="radio"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

.compass-option-label:has(input[type="radio"]:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.compass-option-content strong {
  display: block;
  font-size: 0.9rem;
  color: #0f172a;
  margin-bottom: 4px;
}

.compass-option-content p {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.compass-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.btn-compass-calc {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-compass-calc:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-compass-reset {
  background: #ffffff;
  color: #475569;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-compass-reset:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Matchmaker Results */
.matchmaker-results-box {
  margin-top: 32px;
  border-top: 2px dashed #cbd5e1;
  padding-top: 28px;
  animation: fadeIn 0.3s ease-out;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.results-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.results-toggle-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid #e2e8f0;
}

.results-toggle-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.results-toggle-btn.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.match-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.match-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  position: relative;
}

.match-card.is-top7 {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.match-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}

.match-top7-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1e3a8a;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
  align-self: flex-start;
}

.match-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.match-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #334155;
  flex-shrink: 0;
}

.match-info h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px;
  line-height: 1.25;
}

.match-meta {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Gauge Meter Bar */
.match-gauge-wrap {
  margin: 10px 0 14px;
}

.match-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.match-gauge-label {
  font-weight: 700;
  color: #334155;
}

.match-gauge-percent {
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.match-gauge-percent.gauge-high { color: #16a34a; }
.match-gauge-percent.gauge-mid { color: #2563eb; }
.match-gauge-percent.gauge-mod { color: #d97706; }

.match-gauge-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.match-gauge-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.match-gauge-fill.gauge-high { background: linear-gradient(90deg, #22c55e, #16a34a); }
.match-gauge-fill.gauge-mid { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.match-gauge-fill.gauge-mod { background: linear-gradient(90deg, #f59e0b, #d97706); }

.match-shared-reasons {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
  flex: 1;
}

.match-shared-reasons strong {
  display: block;
  font-size: 0.76rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 5px;
}

.match-shared-reasons p {
  font-size: 0.8rem;
  color: #1e293b;
  margin: 0;
  line-height: 1.4;
}

.match-jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  color: #2563eb;
  border: 1.5px solid #bfdbfe;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: center;
}

.match-jump-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* ==========================================================================
   INTERVIEW & STANCE SUMMARY TAB STYLING IN CANDIDATE CARD
   ========================================================================== */
.interview-stance-container {
  padding: 14px 4px 6px;
}

.interview-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
  max-width: 100%;
  word-break: break-word;
}

.interview-featured-quote {
  background: #f8fafc;
  border-left: 3px solid #2563eb;
  padding: 12px 14px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 16px;
  position: relative;
}

.interview-featured-quote p {
  font-size: 0.84rem;
  font-style: italic;
  color: #1e293b;
  line-height: 1.5;
  margin: 0;
}

.interview-stances-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stance-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.stance-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: #0f172a;
}

.stance-item p {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.45;
  margin: 0;
}

.highlight-compass {
  background: linear-gradient(135deg, #1d4ed8 0%, #047857 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

@keyframes cardPulseGlow {
  0% {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.6), 0 8px 24px rgba(37, 99, 235, 0.2);
    transform: scale(1.015);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.3), 0 12px 28px rgba(37, 99, 235, 0.15);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: scale(1);
  }
}

.card-highlight-flash {
  animation: cardPulseGlow 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  border-color: #2563eb !important;
}

@media (max-width: 768px) {
  .matchmaker-section {
    padding: 18px 14px;
    margin: 24px 0 32px;
  }
  .matchmaker-intro-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }
  .compass-options-grid {
    grid-template-columns: 1fr;
  }
  .match-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   COLLAPSIBLE PAGE SECTIONS SYSTEM
   ========================================================================== */
details.collapsible-section {
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-lg);
  background: #ffffff;
  margin: 28px 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  scroll-margin-top: 135px;
}

details.collapsible-section[open] {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

details.collapsible-section > summary.section-collapse-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 22px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  list-style: none;
  border-radius: calc(var(--radius-lg) - 1.5px);
  border-bottom: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}

details.collapsible-section > summary.section-collapse-summary::-webkit-details-marker {
  display: none;
}

details.collapsible-section[open] > summary.section-collapse-summary {
  border-bottom: 1px solid #e2e8f0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: #f1f5f9;
}

details.collapsible-section > summary.section-collapse-summary:hover {
  background: #e8eef5;
}

details.collapsible-section > summary.section-collapse-summary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.section-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 260px;
}

.section-collapse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #e2e8f0;
  color: #1e293b;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
}

details.collapsible-section:not([open]) .section-collapse-icon {
  transform: rotate(-90deg);
  background: #cbd5e1;
  color: #334155;
}

details.collapsible-section[open] .section-collapse-icon {
  transform: rotate(0deg);
  background: #2563eb;
  color: #ffffff;
}

.section-collapse-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.section-summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-toggle-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  transition: all 0.15s ease;
}

details.collapsible-section:not([open]) .section-toggle-badge {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

details.collapsible-section[open] .toggle-text-closed {
  display: none;
}

details.collapsible-section[open] .toggle-text-open {
  display: inline;
}

details.collapsible-section:not([open]) .toggle-text-closed {
  display: inline;
}

details.collapsible-section:not([open]) .toggle-text-open {
  display: none;
}

.collapsible-section-body {
  padding: 24px;
  animation: fadeIn 0.25s ease-out;
}

/* Global Sections Controls Toolbar */
.sections-global-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-top: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.sections-controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #334155;
}

.sections-controls-icon {
  font-size: 1.15rem;
}

.sections-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sections-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sections-toggle:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .sections-global-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .sections-btn-group {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .btn-sections-toggle {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 7px 8px;
  }
  .collapsible-section-body {
    padding: 16px 14px;
  }
  details.collapsible-section > summary.section-collapse-summary {
    padding: 14px 14px;
  }
  .section-summary-left {
    min-width: 100%;
  }
  .section-collapse-title {
    font-size: clamp(1.05rem, 3.8vw, 1.2rem);
  }
}

/* Horizontal scroll overscroll safety & mobile momentum */
.city-switcher-pills,
.city-switcher-group,
.hub-subnav-container,
.election-quick-nav,
.table-responsive,
.surrounding-table-wrapper,
.properties-table-wrapper,
.table-responsive-wrapper,
.intel-nav-toolbar,
.school-filter-pills,
.comp-county-filters,
.filter-controls-grid,
.comparator-presets,
.ratable-shift-timeline {
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

/* Seamless collapsible-section integration for card containers */
details.collapsible-section.pilot-content-card,
details.collapsible-section.fair-card {
  padding: 0;
  margin-bottom: 28px;
}

details.collapsible-section.highlight-card {
  border: 2px solid var(--color-school);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
}

details.collapsible-section .page-source-footer {
  margin: 0;
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .section-collapse-icon,
  .btn-sections-toggle,
  details.collapsible-section {
    transition: none !important;
  }
}

/* ==========================================================================
   FRONTEND UI DE-NOISING & CALM VISUAL HIERARCHY OVERHAUL
   ========================================================================== */

/* 1. Opt-in to intrinsic keyword interpolation (Modern Web Guidance) */
:root {
  interpolate-size: allow-keywords;
}

/* 2. Remove redundant stacked status & anchor bars above the fold */
.live-status-bar,
.election-quick-nav {
  display: none !important;
}

/* 3. Streamline Top Town Switcher Bar */
.header-top-bar {
  padding: 6px 0 !important;
}

.city-btn-county {
  display: none !important;
}

.city-switch-btn {
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
  gap: 5px !important;
}

/* 4. Compact the Top Hero Header (.app-header) so primary content starts higher */
.app-header {
  padding: 18px 0 16px;
}

.header-container {
  gap: 20px;
}

.header-titles h1 {
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2rem);
  margin-bottom: 4px;
  text-wrap: balance;
}

.header-titles .subtitle {
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 64ch;
  text-wrap: pretty;
}

.stat-card {
  padding: 10px 12px;
}

.stat-card-label {
  font-size: 0.68rem;
  margin-bottom: 2px;
}

.stat-card-num {
  font-size: 1.32rem;
}

.stat-card-sub {
  font-size: 0.66rem;
  margin-top: 2px;
}

/* 5. State-Aware Sticky Navigation Container Query */
.nav-bar.sticky-nav {
  container-type: scroll-state;
  container-name: main-sticky-nav;
}

@container main-sticky-nav scroll-state(stuck: top) {
  .nav-container {
    box-shadow: 0 6px 18px -6px rgba(15, 23, 42, 0.1);
  }
}

/* Subtle Nav Pill Badges instead of high-saturation fills */
.nav-item-btn .badge-tag {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 700 !important;
}

.nav-item-btn.active .badge-tag {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

/* 6. Clean & Concise Section Intro + Primary Voter Action Bar */
.section-intro {
  margin-bottom: 18px !important;
  padding-bottom: 14px !important;
}

.section-intro h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
  margin-bottom: 6px;
  text-wrap: balance;
}

.section-intro p,
.section-subtitle-desc {
  max-width: 72ch;
  font-size: 0.94rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.election-primary-cta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.btn-election-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2563eb;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  text-decoration: none !important;
  border: 1px solid #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
  transition: background 0.18s ease, transform 0.18s ease;
}

.btn-election-cta-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-election-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #1e293b !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  text-decoration: none !important;
  border: 1px solid #cbd5e1;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.btn-election-cta-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* 7. Calm & Unified Collapsible Section Rows (Eliminate Rainbow Pill Clutter) */
.sections-global-controls {
  padding: 8px 14px;
  margin-top: 12px;
  margin-bottom: 12px;
  background: #f8fafc;
}

details.collapsible-section {
  margin-top: 10px !important;
  margin-bottom: 10px !important;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

details.collapsible-section[open] {
  margin-top: 16px !important;
  margin-bottom: 20px !important;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

details.collapsible-section > summary.section-collapse-summary {
  padding: 13px 18px;
  background: #ffffff;
}

details.collapsible-section > summary.section-collapse-summary:hover {
  background: #f8fafc;
}

details.collapsible-section[open] > summary.section-collapse-summary {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.section-collapse-title {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Unify all section summary pills into a clean, non-competing slate pill */
.section-summary-right .pill-tag {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  padding: 3px 10px !important;
  box-shadow: none !important;
}

/* Subtle Ghost Expand Badge instead of heavy solid blue button on every row */
details.collapsible-section:not([open]) .section-toggle-badge {
  background: #f8fafc;
  color: #2563eb;
  border-color: #bfdbfe;
}

details.collapsible-section:not([open]) > summary.section-collapse-summary:hover .section-toggle-badge {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* 8. Defer rendering of heavy collapsible bodies until expanded */
details.collapsible-section[open] > .collapsible-section-body {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 320px;
}

/* 9. Streamlined Candidate Cards (Less Badge Clutter) */
.candidate-card-header-bar {
  padding: 8px 14px !important;
}

.candidate-badges-bar {
  gap: 6px !important;
}

