:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --text: #111827;
  --text-light: #374151;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --radius: 14px;
  
  /* Data visualization colors - colorblind friendly blue→yellow→orange gradient */
  --color-low: #1e64ff;      /* Blue for low zero-sum */
  --color-mid: #ffff9b;      /* Yellow for medium */
  --color-high: #ff9600;     /* Orange for high zero-sum */
  
  /* Accent colors - slate/teal tones to avoid partisan association */
  --primary: #5b7c99;
  --primary-light: #7b9cb5;
  --primary-dark: #3d5a6c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 0;
  height: auto;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

code, pre, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* HKS Top Bar */
.hks-bar {
  background: #53565a;
  padding: 4px 0;
}

.hks-bar__inner {
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.hks-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.hks-shield-img {
  height: 22px;
  width: auto;
}

.hks-text {
  color: #ffffff;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 16px 0;
  min-height: 72px;
}

/* Brand / Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand__text {
  display: flex;
  flex-direction: column;
}

.brand__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 28px;
  letter-spacing: -0.3px;
  color: #374151;
  line-height: 1.1;
}

.brand__subtitle {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  margin-top: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Dropdown container */
.nav__dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown menu */
.nav__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 180px;
  margin-top: 4px;
  z-index: 1000;
}

.nav__dropdown:hover .nav__dropdown-menu {
  display: block;
}

.nav__dropdown-item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  letter-spacing: 0.1px;
  text-align: left;
}

.nav__dropdown-item:hover {
  background: rgba(165, 28, 48, 0.08);
  color: #a51c30;
}

.nav__link {
  position: relative;
  border: none;
  background: transparent;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.2s ease;
  border-radius: 8px;
  letter-spacing: 0.1px;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: #a51c30;
  border-radius: 0;
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__link:hover {
  color: #a51c30;
  background: transparent;
}

.nav__link:hover::after {
  transform: scaleX(1);
}

.nav__link[aria-current="page"] {
  color: #a51c30;
  font-weight: 500;
}

.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  background: #a51c30;
}

/* Mobile menu toggle */
.nav__mobile-toggle {
  display: none;
  border: none;
  background: transparent;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
  border-radius: 8px;
}

.nav__mobile-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav.nav--open {
    display: flex;
  }

  .nav__link {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
  }

  .nav__link::after {
    display: none;
  }

  .nav__mobile-toggle {
    display: flex;
  }

  .brand__subtitle {
    display: none;
  }
}

.main { padding: 18px 0 26px; }

h1 { font-size: 24px; font-weight: 700; margin: 0; }
h2 { font-size: 16px; font-weight: 700; margin: 20px 0 10px 0; }
h3 { font-size: 14px; font-weight: 600; margin: 12px 0 8px 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card--emphasized {
  border: 1px solid var(--primary);
  background: rgba(37, 99, 235, 0.02);
}

.muted { color: var(--muted); }

.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--border-light);
  border-color: var(--text);
}

.result {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
  margin: 10px 0;
}

.video {
  border: 1px dashed var(--border);
  border-radius: 12px;
  height: 220px;
  display: grid;
  place-items: center;
  background: #f9fafb;
}
.video__title { font-weight: 600; margin-bottom: 4px; }

/* Enhanced Video Styles */
.video-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.video-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.video-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #1e293b;
}

.video-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.video-description {
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1),
    0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.video-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
  border-radius: 18px;
  z-index: -1;
  opacity: 0.6;
}

.video-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 16px;
}

.video-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.video-source {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

.page { display: none; }
.page--active { display: block; }

.hidden { display: none; }

.scale-hint {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
}

.survey { display: grid; gap: 12px; }

.q {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.q legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; }

.choices {
  display: flex;
  gap: 0;
  width: 100%;
}

.choice {
  flex: 1;
  border: 1px solid var(--border);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.choice:first-child {
  border-radius: 10px 0 0 10px;
}

.choice:last-child {
  border-radius: 0 10px 10px 0;
}

.choice:not(:first-child) {
  border-left: none;
}

.choice--text {
  padding: 16px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.choice:hover {
  background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
  color: #f97316;
  z-index: 1;
}

.choice[aria-pressed="true"] {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  border-color: #f97316;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.choice[aria-pressed="true"] + .choice {
  border-left: 1px solid #f97316;
}

/* Language toggle buttons */
.lang-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}
.lang-btn:hover {
  border-color: #0891b2;
  color: #0891b2;
}
.lang-btn--active {
  background: #0891b2;
  color: #fff;
  border-color: #0891b2;
}
.lang-btn--active:hover {
  background: #0e7490;
  border-color: #0e7490;
  color: #fff;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.stat {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  transition: all 0.2s ease;
}
.stat:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.stat__label { font-size: 12px; color: var(--muted); }
.stat__value { font-weight: 700; margin-top: 4px; }

.score {
  font-size: 22px;
  font-weight: 800;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 14px 0;
  background: #fff;
}

.list { margin: 0; padding-left: 18px; }

.select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  min-width: 200px;
  transition: all 0.2s ease;
}

.select:hover {
  border-color: var(--primary);
}

.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#chart-container {
  max-height: 400px;
}

/* D3 Chart Container */
#d3-chart-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#d3-chart-container svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

#filters-panel label {
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

#filters-panel label:hover {
  color: var(--primary);
}

#filters-panel input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
}

@media (max-width: 900px) {
  #filters-panel {
    display: none;
  }
}

/* Step-based Navigation for Visualizations */
.viz-step-nav {
  margin-bottom: 24px;
  text-align: center;
}

.viz-step-nav__track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 12px;
  background: linear-gradient(to bottom, rgba(165, 28, 48, 0.02), rgba(165, 28, 48, 0.04));
  border-radius: 12px;
  border: 1px solid rgba(165, 28, 48, 0.08);
}

.viz-step-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  min-width: 180px;
}

.viz-step-btn:hover {
  border-color: var(--primary);
  background: rgba(165, 28, 48, 0.02);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(165, 28, 48, 0.1);
}

.viz-step-btn--active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(165, 28, 48, 0.06), rgba(165, 28, 48, 0.02));
  box-shadow: 0 2px 8px rgba(165, 28, 48, 0.15);
}

.viz-step-btn__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.viz-step-btn--active .viz-step-btn__number {
  background: var(--primary);
  color: #fff;
}

.viz-step-btn:hover .viz-step-btn__number {
  background: var(--primary);
  color: #fff;
}

.viz-step-btn__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.viz-step-btn__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  line-height: 1.2;
}

.viz-step-btn--active .viz-step-btn__title {
  color: var(--primary);
}

.viz-step-btn__subtitle {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.3;
}

.viz-step-nav__arrow {
  font-size: 18px;
  color: var(--muted);
  font-weight: 300;
  padding: 0 4px;
  user-select: none;
}

.viz-step-nav__hint {
  margin: 10px 0 0 0;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

/* Legacy tab styles (kept for compatibility) */
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none !important;
}

.tab-content--active {
  display: block !important;
}

/* Responsive adjustments for step navigation */
@media (max-width: 768px) {
  .viz-step-nav__track {
    flex-direction: column;
    gap: 12px;
  }
  
  .viz-step-btn {
    min-width: 100%;
    justify-content: flex-start;
  }
  
  .viz-step-nav__arrow {
    transform: rotate(90deg);
    padding: 0;
  }
}

/* View Selector (secondary control for switching chart types) */
.view-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.view-selector-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
}

.view-selector {
  display: inline-flex;
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
}

.view-selector__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.view-selector__btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.view-selector__btn--active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 4px rgba(165, 28, 48, 0.2);
}

.view-selector__btn--active:hover {
  background: var(--primary);
  color: #fff;
}

.view-selector__btn svg {
  flex-shrink: 0;
}

/* Legacy sub-tab styles (kept for compatibility) */
.sub-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.2s ease;
}

.sub-tab-btn:hover {
  color: var(--text);
}

.sub-tab-btn--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.sub-tab-content {
  display: none;
}

.sub-tab-content--active {
  display: block;
}

#scatter-filters-panel {
  display: contents;
}

#scatter-filter-summary {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
}

/* Leaflet map overrides */
#map-container {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

#map-container .leaflet-container {
  z-index: 1;
  border-radius: 12px;
}

/* Map filter panel styling */
#map-immigration-filters,
#map-demographic-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.map-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-filter-group h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 0 0 4px 0;
}

.map-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.map-filter-option:hover {
  background: var(--border-light);
  border-color: var(--primary);
}

.map-filter-option input[type="radio"],
.map-filter-option input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
}

.map-filter-option input[type="radio"]:checked ~ label,
.map-filter-option input[type="checkbox"]:checked ~ label {
  font-weight: 600;
  color: var(--primary);
}

/* Map warning and info boxes */
#map-sample-size-warning {
  border-left: 4px solid #FF9800;
  background: rgba(255, 152, 0, 0.08);
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
}

#map-sample-size-warning p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

#map-filter-summary {
  border-left: 4px solid var(--primary);
  background: rgba(37, 99, 235, 0.05);
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

/* Map legend styling */
.map-legend {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: var(--shadow-md);
}

.map-legend h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 700;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-gradient {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.legend-gradient-bar {
  flex: 1;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(to right, 
    #2171b5 0%,      /* Blue for low */
    #74c476 40%,     /* Green mid-low */
    #fec44f 70%,     /* Yellow-gold mid-high */
    #fe9929 100%);   /* Orange for high */
  border: 1px solid var(--border);
}

.legend-gradient-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Leaflet popup overrides for better styling */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: 0;
  font-size: 12px;
}

.leaflet-popup-tip {
  background: #fff;
}

/* Filter panel layout improvements */
.map-filters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  padding: 12px;
  background: var(--border-light);
  border-radius: 10px;
}

@media (max-width: 768px) {
  .map-filters-container {
    grid-template-columns: 1fr;
  }
}

/* Filter column styling - Opportunity Atlas style */
.filter-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.filter-column__header {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.filter-column__options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-option-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f9fafb;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-option-item:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--primary);
}

.filter-option-item input[type="radio"],
.filter-option-item input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-option-item.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: var(--primary);
  font-weight: 600;
  color: var(--primary);
}

.filter-option-label {
  flex: 1;
  cursor: pointer;
}

/* Floating demographic filters panel */
#map-demographic-filters-panel {
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#map-demographic-filters-panel::-webkit-scrollbar {
  width: 6px;
}

#map-demographic-filters-panel::-webkit-scrollbar-track {
  background: var(--border-light);
  border-radius: 10px;
}

#map-demographic-filters-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

#map-demographic-filters-panel::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Responsive design for floating panel */
@media (max-width: 1024px) {
  #map-demographic-filters-panel {
    width: 280px;
    max-height: 480px;
  }
}

@media (max-width: 768px) {
  #map-demographic-filters-panel {
    position: static !important;
    width: 100% !important;
    max-height: none !important;
    margin-top: 16px;
    right: auto !important;
    top: auto !important;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  
  #map-container {
    height: 400px !important;
  }
}

/* Team member cards styling */
.team-member-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  text-align: center;
}

.team-member-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
  transform: translateY(-4px);
}

.team-member-avatar {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.team-member-name {
  margin: 12px 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.team-member-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  margin-bottom: 12px;
}

.team-member-bio {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
  margin: 0 0 16px 0;
  flex-grow: 1;
}

.team-member-contact {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.team-member-contact a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--border-light);
  color: var(--primary);
  transition: all 0.2s ease;
  text-decoration: none;
}

.team-member-contact a:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.team-member-contact svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   Chart Container Centering & Responsiveness
   ============================================ */

/* Chart.js Canvas Containers */
#distribution-chart,
#policy-chart-container,
#scatter-chart-container {
  display: block;
  max-width: 100%;
  height: auto !important;
}

/* Policy Index Distribution Chart */
.policy-chart-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* Scatter/Binscatter Chart */
.scatter-chart-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  position: relative;
  min-height: 420px;
}

.scatter-chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Distribution chart in Test Results */
.distribution-chart-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  position: relative;
  height: 250px;
}

/* Grid containers for charts - center content */
.chart-grid-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
  .policy-chart-wrapper,
  .scatter-chart-wrapper {
    max-width: 100%;
  }
  
  .distribution-chart-wrapper {
    height: 200px;
  }
}

/* Policy and Scatter chart grid layout responsive */
@media (max-width: 900px) {
  /* Stack grid items vertically on smaller screens */
  .card > div[style*="grid-template-columns: 1fr 1fr"],
  .card > div[style*="grid-template-columns: 1.3fr 1fr"] {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
  }
  
  .policy-chart-wrapper,
  .scatter-chart-wrapper {
    max-width: 100% !important;
    width: 100% !important;
  }
}
