/* Senseable City Lab Inspired Design System */
:root {
  /* Studio Matter palette — Light */
  --golden-yellow: #FFD23F; /* primary accent */
  --terracotta-orange: #D96831; /* secondary accent */
  --cream-beige: #fcf4ed; /* background */
  --white: #ffffff; /* surface */
  --off-white: #fbf2e2; /* surface-alt */
  --light-gray: #E6DAC7; /* hairlines */
  --medium-gray: #5A5550; /* muted text */
  --dark-gray: #1B1B1B; /* primary text */
  --charcoal: #2A2A2A;
  
  /* Legacy tokens mapped for compatibility */
  --primary-navy: #141A22; /* used for some titles/borders */
  --primary-blue: #141A22;
  --accent-blue: #141A22;
  --accent-cyan: var(--terracotta-orange);
  --accent-orange: var(--terracotta-orange);
  --deep-navy: #141A22;
  --dusty-blue: #334155; /* slate (sparingly in light) */
  --marker-stroke: #1B1B1B; /* marker border */
  --bench-sun-fill: #FFD23F; /* bright yellow */
  --bench-shade-fill: #4FA3B6; /* teal */
  --bench-sun-stroke: #1B1B1B;
  --bench-shade-stroke: #1B1B1B;
  --icon-focus-ring: #FFD23F;

  /* Status */
  --success: #27ae60;
  --warning: #f39c12;
  --error: #e74c3c;
  --info: #334155;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.12);
  --shadow-md: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.16);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.18), 0 6px 6px rgba(0,0,0,0.18);

  /* Amenity color tokens */
  --amenity-bench: #D96831;           /* Terracotta */
  --amenity-water: #607CAA;           /* Dusty Blue */
  --amenity-toilet: #002666;          /* Deep Navy */
}

/* Dark Mode — Shady Night */
:root[data-theme="dark"] {
  --golden-yellow: #FFD23F;
  --terracotta-orange: #D96831;
  --cream-beige: #111827; /* background */
  --white: #0B1220; /* surface */
  --off-white: #141A22; /* surface-alt */
  --light-gray: #2A3440; /* hairlines */
  --medium-gray: #C9C1B6; /* muted text */
  --dark-gray: #F6F2E9; /* primary text */
  --charcoal: #E8E2D6; /* content text */

  --primary-navy: #141A22; /* surface tone */
  --primary-blue: #141A22;
  --accent-blue: #141A22;
  --accent-cyan: var(--golden-yellow); /* accent becomes yellow */
  --accent-orange: var(--terracotta-orange);
  --deep-navy: #141A22;
  --dusty-blue: #334155; /* slate, sparingly */
  --marker-stroke: #141A22; /* marker border */

  /* Amenity colors for contrast */
  --amenity-bench: #FFD23F;           /* benches pop */
  --amenity-drinking_water: #C9C1B6;
  --amenity-toilets: #FFD23F;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--dark-gray);
  background-color: var(--cream-beige);
  min-height: 100vh;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Header - Academic Style */
.header {
  background: linear-gradient(135deg, var(--off-white) 0%, var(--white) 60%, var(--off-white) 100%);
  color: var(--dark-gray);
  padding: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--light-gray);
}
/* dark mode removed */

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  pointer-events: none;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo { color: var(--terracotta-orange); display: block; }
/* dark mode removed */

.title {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--deep-navy) 0%, var(--golden-yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.title-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--medium-gray);
  letter-spacing: 0.02em;
}

.affiliation {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--medium-gray);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.separator {
  color: var(--golden-yellow);
  font-weight: 500;
}

.header-stats {
  display: flex;
  gap: var(--space-xl);
  background: var(--off-white);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--light-gray);
}
:root[data-theme="dark"] .header-stats {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.15);
}

.stat-item {
  text-align: center;
  min-width: 80px;
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--golden-yellow);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--light-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-xs);
}

/* Main Content */
.main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 200px);
}

/* Analysis Panel */
.analysis-panel {
  background: var(--white);
  border-bottom: 2px solid var(--light-gray);
  padding: var(--space-xl) 0;
}
:root[data-theme="dark"] .analysis-panel {
  background: var(--white);
}

.status-section {
  margin-bottom: var(--space-xl);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent-cyan);
  color: var(--white);
  border-radius: var(--radius-md);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
  transition: all var(--transition-normal);
}

.status-indicator.hidden {
  display: none;
}

.status-indicator.success {
  background: var(--success);
}

.status-indicator.error {
  background: var(--error);
}

.status-indicator.warning {
  background: var(--warning);
}

.status-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.95); }
}

.instructions {
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.instruction-text {
  font-size: 1rem;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.method-separator {
  font-weight: 600;
  color: var(--medium-gray);
  font-size: 0.875rem;
}

/* Controls Grid */
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: var(--space-xl);
}

.control-section {
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-navy);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--terracotta-orange);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Buttons */
.button-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary-navy);
  color: var(--white);
  font-family: var(--font-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  min-height: 80px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Smooth theme transitions */
body, .header, .control-section, .instructions, .leaflet-control-zoom a, .leaflet-control-attribution, .footer, .filter-category, .map-container, .status-indicator, .btn, .theme-toggle {
  transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}

/* Inline toggle for shade-aware */
.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--light-gray);
  background: var(--white);
}
.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--golden-yellow);
}
.toggle-label {
  font-size: 0.9rem;
  color: var(--charcoal);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

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

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--terracotta-orange);
}

.btn-secondary {
  background: var(--primary-navy);
}

.btn-icon {
  font-size: 1.5rem;
}

.btn-text {
  font-size: 1rem;
  font-weight: 600;
}

.btn-subtext {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Parameters */
.parameter-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.parameter-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.parameter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--light-gray);
  outline: none;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.slider-value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-cyan);
  min-width: 60px;
  text-align: right;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.radio-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-item input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--medium-gray);
  border-radius: 50%;
  position: relative;
  transition: all var(--transition-fast);
}

.radio-custom::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform var(--transition-fast);
}

.radio-item input[type="radio"]:checked + .radio-custom {
  border-color: var(--accent-cyan);
}

.radio-item input[type="radio"]:checked + .radio-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

.radio-label {
  font-size: 0.875rem;
  color: var(--charcoal);
}

/* Filter Matrix */
.filter-matrix {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.filter-category {
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.category-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background: var(--primary-navy);
  padding: var(--space-sm) var(--space-md);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-items {
  padding: var(--space-sm);
  background: var(--white);
}

.filter-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.filter-item:hover {
  background: var(--off-white);
}

.filter-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-cyan);
  margin: 0;
}

.filter-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.filter-label {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--charcoal);
}

.filter-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--medium-gray);
  background: var(--light-gray);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  min-width: 24px;
  text-align: center;
  transition: all var(--transition-fast);
}

.filter-item input[type="checkbox"]:checked + .filter-marker + .filter-label + .filter-count {
  background: var(--accent-cyan);
  color: var(--white);
}

/* Saved neighborhoods */
.saved-neighborhoods {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.saved-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.saved-input {
  flex: 1 1 220px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--charcoal);
}

.saved-input:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.saved-save-btn {
  min-height: auto;
  padding: var(--space-sm) var(--space-lg);
}

.saved-hint {
  font-size: 0.85rem;
  color: var(--medium-gray);
  margin: 0;
}

.saved-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.saved-empty {
  font-size: 0.9rem;
  color: var(--medium-gray);
  font-style: italic;
}

.saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.saved-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.saved-title {
  font-weight: 600;
  color: var(--primary-navy);
}

.saved-meta {
  font-size: 0.75rem;
  color: var(--medium-gray);
}

.saved-actions {
  display: flex;
  gap: var(--space-xs);
}

.saved-action-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  background: var(--primary-navy);
  color: var(--white);
}

.saved-action-btn:hover {
  transform: translateY(-1px);
  background: var(--accent-cyan);
}

.saved-action-btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.saved-action-btn.delete {
  background: var(--terracotta-orange);
}

.saved-action-btn.delete:hover {
  background: #b45226;
}

.saved-action-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Map Section */
.map-section {
  flex: 1;
  position: relative;
}

.map-container {
  height: 70vh;
  min-height: 500px;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin: var(--space-lg);
  border: 2px solid var(--light-gray);
}

.map {
  width: 100%;
  height: 100%;
}

.map-overlay {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 1000;
  pointer-events: none;
}

.zoom-indicator,
.coordinate-display {
  background: rgba(0,0,0,0.8);
  color: var(--white);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
}

.coordinate-display {
  display: flex;
  gap: 2px;
}

.coord-separator {
  color: var(--medium-gray);
}

/* Shade legend */
.shade-legend {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(0,0,0,0.8);
  color: var(--white);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  pointer-events: none;
}
.shade-legend .legend-item { display: inline-flex; align-items: center; gap: 6px; }
.shade-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid #B9D6BC; }
.shade-legend .swatch-sun { background: #FFD23F; }
.shade-legend .swatch-shade { background: #4FA3B6; }
.shade-legend .swatch-trees { background: #CFE7D1; border-color: #B9D6BC; }

/* Amenity SVG marker */
.amenity-marker { display: inline-flex; align-items: center; justify-content: center; padding: 4px; border-radius: 6px; color: currentColor; box-shadow: none; transition: box-shadow 120ms ease-out; }
.amenity-marker:hover, .amenity-marker:focus-within { box-shadow: 0 0 0 1px #FFD23F, 0 2px 6px rgba(0,0,0,0.18); }
.amenity-marker svg { display: block; }

/* Bench icon wrapper */
.bm-bench-icon { line-height: 0; display: inline-flex; }
.bm-bench-icon svg { display: block; }
.bm-bench-icon:focus-visible, .bm-bench-icon:hover { outline: 1px solid var(--icon-focus-ring); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .amenity-marker { transition: none; }
}

/* Solar indicator and recompute chip */
.solar-indicator {
  background: var(--white);
  color: var(--dark-gray);
  border: 1px solid var(--light-gray);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.how-btn {
  appearance: none; border: 1px solid var(--light-gray); background: var(--white);
  color: var(--dark-gray); border-radius: 50%; width: 28px; height: 28px; cursor: pointer;
}
.how-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.25); display: none; place-items: center; z-index: 3000; pointer-events: none; }
.how-overlay.is-open { display: grid; pointer-events: auto; }
.how-card { background: var(--cream-beige); color: var(--dark-gray); border: 1px solid var(--light-gray); border-radius: 20px; width: min(560px, 92vw); padding: 18px 20px; box-shadow: var(--shadow-lg); }
.how-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.how-close { appearance: none; border: 1px solid var(--light-gray); background: var(--white); color: var(--dark-gray); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.how-list { margin: 8px 0 12px; padding-left: 18px; }
.how-notes { font-size: 0.85rem; color: var(--medium-gray); }

.how-card h3 { color: var(--terracotta-orange); text-transform: none; letter-spacing: 0.02em; margin: 0; }
.how-close:hover, .how-btn:hover { outline: 2px solid var(--golden-yellow); outline-offset: 2px; }
.how-close:focus-visible, .how-btn:focus-visible, .site-footer a:focus-visible { outline: 2px solid var(--golden-yellow); outline-offset: 2px; }
body[data-lock="scroll"] { overflow: hidden; }

.status-chip { display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; border: 1px solid var(--light-gray); background: var(--white); color: var(--dark-gray); }

.counts-overlay { background: var(--white); color: var(--dark-gray); border: 1px solid var(--light-gray); border-radius: 6px; padding: 4px 8px; font-family: var(--font-mono); font-size: 0.75rem; }
.recompute-chip {
  background: var(--golden-yellow);
  color: #1B1B1B;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Minute select */
.time-minutes { appearance: none; border: 1px solid var(--light-gray); background: var(--white); color: var(--dark-gray); border-radius: 6px; padding: 4px 8px; }

/* Leaflet control theming */
.leaflet-control-zoom a {
  background: var(--white) !important;
  color: var(--dark-gray) !important;
  border: 1px solid var(--light-gray) !important;
  box-shadow: none !important;
}
/* dark mode removed */
.leaflet-control-attribution {
  background: var(--white) !important;
  color: var(--medium-gray) !important;
  border: 1px solid var(--light-gray) !important;
}
/* dark mode removed */

/* Custom Leaflet Styles */
.leaflet-popup-content-wrapper {
  background: var(--white);
  color: var(--charcoal);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--light-gray);
}

.leaflet-popup-content {
  margin: var(--space-md);
  line-height: 1.4;
  font-family: var(--font-primary);
}

.leaflet-popup-tip {
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.popup-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-navy);
  margin-bottom: var(--space-xs);
}

.popup-type {
  font-size: 0.875rem;
  color: var(--medium-gray);
  margin-bottom: var(--space-sm);
}

.popup-details {
  font-size: 0.875rem;
  color: var(--charcoal);
  line-height: 1.5;
}

/* Marker Cluster Styles */
.marker-cluster-small { background-color: var(--golden-yellow); color: var(--deep-navy); }
.marker-cluster-medium { background-color: var(--dusty-blue); color: var(--white); }
.marker-cluster-large { background-color: var(--primary-navy); color: var(--white); }

/* Footer */
.site-footer { background: #fbf2e2; border-top: 1px solid #E6DAC7; margin-top: auto; }
.site-footer .wrap { max-width: 1200px; margin: 0 auto; padding: 28px 20px; }
.footer-topline { text-align: center; color: #607CAA; letter-spacing: 0.08em; font-size: 0.95rem; margin-bottom: 14px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.footer-col h4 { color: var(--terracotta-orange); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-col a { color: #002666; text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 1px; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--golden-yellow); }
.footer-col p { color: #5A5550; margin: 0; font-size: 0.95rem; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; color: #5A5550; font-size: 0.8rem; margin-top: 18px; padding-top: 10px; border-top: 1px solid #E6DAC7; }
.footer-bottom a { color: #002666; text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; text-decoration-color: var(--golden-yellow); text-underline-offset: 2px; }
.back-to-top { text-align: right; }

/* Responsive Design */
@media (max-width: 1200px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }
  
  .header-content {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
  }
  
  .header-stats {
    align-self: stretch;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
  
  .title {
    font-size: 2.5rem;
  }
  
  .instruction-text {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }
  
  .button-group {
    flex-direction: row;
  }
  
  .btn {
    min-height: 60px;
    flex-direction: row;
    gap: var(--space-sm);
  }
  
  .map-container {
    height: 60vh;
    margin: var(--space-md);
    border-radius: var(--radius-md);
  }
  
  .footer-grid { grid-template-columns: 1fr; }
}

/* Theme Toggle Button */
.theme-toggle {
  appearance: none;
  border: 1px solid var(--light-gray);
  background: var(--white);
  color: var(--dark-gray);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.theme-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.theme-toggle:active { transform: translateY(0); }
/* dark mode removed */

@media (max-width: 480px) {
  .title {
    font-size: 2rem;
  }
  
  .affiliation {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
  
  .header-stats {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .map-overlay {
    top: var(--space-sm);
    right: var(--space-sm);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --cream-beige: #ffffff;
    --light-gray: #e0e0e0;
    --medium-gray: #404040;
    --dark-gray: #000000;
  }
}
