* {
  box-sizing: border-box;
}

:root {
  --bg: #080b12;
  --panel: rgba(18, 23, 35, 0.88);
  --panel-solid: #121723;
  --panel-soft: rgba(255, 255, 255, 0.06);
  --panel-softer: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f7f9ff;
  --muted: #aeb8ca;
  --muted-strong: #d8deeb;
  --accent: #7dd3fc;
  --accent-2: #a78bfa;
  --good: #2ecc71;
  --mid: #f1c40f;
  --bad: #e74c3c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    "Inter",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(125, 211, 252, 0.14), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(167, 139, 250, 0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 410px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: relative;
  z-index: 10;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(18, 23, 35, 0.96), rgba(12, 16, 25, 0.96)),
    var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 32%),
    radial-gradient(circle at 30% 0%, rgba(125, 211, 252, 0.1), transparent 20rem);
}

.sidebar > * {
  position: relative;
}

.app-header {
  margin-bottom: 24px;
}

.logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  margin-bottom: 18px;
  padding: 6px 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 35% 25%, rgba(125, 211, 252, 0.1), transparent 14rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.brand-logo {
  display: block;
  width: min(100%, 350px);
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 16px 28px rgba(0, 0, 0, 0.32))
    drop-shadow(0 0 18px rgba(125, 211, 252, 0.08));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.subtitle {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.55;
  font-size: 1rem;
}

.cached-cities {
  margin-top: 14px;
}

.cached-label {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #9ca3af;
}

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

.cached-city-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.cached-city-btn:hover {
  border-color: rgba(96, 165, 250, 0.9);
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-1px);
}

.cached-city-btn.active {
  border-color: rgba(34, 197, 94, 0.95);
  background: rgba(22, 101, 52, 0.35);
}

.search-section {
  margin-top: 22px;
}

label,
.control-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted-strong);
  font-weight: 800;
  font-size: 0.88rem;
}

.search-row {
  display: flex;
  gap: 9px;
  margin-bottom: 10px;
}

.control-group {
  margin-top: 18px;
}

input,
.map-style-select {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  background: rgba(5, 8, 14, 0.72);
  color: var(--text);
  font-size: 0.94rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input {
  flex: 1;
  min-width: 0;
}

.map-style-select {
  cursor: pointer;
}

input:focus,
.map-style-select:focus {
  border-color: rgba(125, 211, 252, 0.7);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.12);
  background: rgba(5, 8, 14, 0.92);
}

button {
  padding: 12px 15px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff, #dbeafe);
  color: #07111f;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(125, 211, 252, 0.16);
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(125, 211, 252, 0.22);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-btn {
  width: 100%;
  margin-top: 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.075));
  color: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: none;
}

.secondary-btn:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--border);
}

.secondary-btn:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.11);
  box-shadow: none;
}

.status {
  margin: 18px 0;
  padding-left: 10px;
  border-left: 3px solid rgba(125, 211, 252, 0.65);
  background: transparent;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 13px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.legend-swatch {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 18px currentColor;
}

.legend-swatch.high {
  background: var(--good);
  color: var(--good);
}

.legend-swatch.medium {
  background: var(--mid);
  color: var(--mid);
}

.legend-swatch.low {
  background: var(--bad);
  color: var(--bad);
}

.method-note {
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.045));
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--muted-strong);
}

.method-note summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  color: var(--text);
  font-weight: 950;
  border-bottom: 1px solid var(--border);
}

.method-note summary::-webkit-details-marker {
  display: none;
}

.method-note summary::after {
  content: "⌄";
  color: var(--accent);
  font-size: 1rem;
  transition: transform 150ms ease;
}

.method-note[open] summary::after {
  transform: rotate(180deg);
}

.method-note summary span {
  display: block;
  letter-spacing: -0.02em;
}

.method-note summary small {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.2);
  color: #dff6ff;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.method-note p {
  margin: 0;
  padding: 14px 16px 8px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.91rem;
}

.score-breakdown {
  display: grid;
  gap: 8px;
  padding: 10px 12px 14px;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(5, 8, 14, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.075);
}

.method-subnote {
  margin: 4px 12px 14px;
  padding: 12px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.score-row strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 3px;
}

.score-row span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.score-row b {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.9), rgba(167, 139, 250, 0.9));
  color: #06111f;
  font-size: 0.95rem;
  font-weight: 950;
  box-shadow: 0 0 24px rgba(125, 211, 252, 0.18);
}

h2 {
  margin: 24px 0 12px;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.result-card {
  position: relative;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.045));
  border-radius: 16px;
  cursor: pointer;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.9;
}

.result-card:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.065));
  border-color: var(--border-strong);
}

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

.score {
  font-size: 1.2rem;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.score-pill {
  color: #07111f;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.disclaimer {
  margin: 24px 0 10px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.085);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.map-panel {
  position: relative;
  min-height: 400px;
  background: #0b1020;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  filter: saturate(0.94) contrast(1.02);
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28) !important;
}

.leaflet-control-zoom a {
  background: rgba(18, 23, 35, 0.92) !important;
  color: white !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}


.loading-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: grid !important;
  place-content: center !important;
  text-align: center;
  gap: 14px;
  background:
    radial-gradient(circle at center, rgba(125, 211, 252, 0.14), transparent 22rem),
    rgba(8, 11, 18, 0.9);
  backdrop-filter: blur(8px);
  color: white;
}
.progress-wrap {
  display: none;
  margin-top: 14px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.25s ease;
}

.progress-text {
  margin: 7px 0 0;
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: right;
}

.loading-overlay.hidden {
  display: none !important;
}

.spinner {
  width: 62px;
  height: 62px;
  margin: 0 auto;
  border: 5px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ffffff;
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 40px rgba(125, 211, 252, 0.32);
}

.loading-overlay p {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.loading-overlay span {
  color: var(--muted);
  font-size: 0.92rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .sidebar {
    max-height: none;
  }

  .map-panel {
    height: 58vh;
  }

  #map {
    min-height: 58vh;
  }
}

@media (max-width: 560px) {
  .sidebar {
    padding: 20px;
  }

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

  button {
    width: 100%;
  }

  .method-note summary {
    align-items: flex-start;
  }

  .method-note summary small {
    display: none;
  }
}
/* Google Maps-style mobile layout */
.mobile-sidebar-toggle {
  display: none;
}

@media (max-width: 980px) {
  .mobile-sidebar-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    position: fixed !important;
    left: 16px !important;
    right: 16px !important;
    bottom: calc(env(safe-area-inset-bottom) + 18px) !important;
    z-index: 999999 !important;
    width: auto !important;
    height: 56px !important;
    padding: 0 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 999px !important;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(219, 234, 254, 0.88)) !important;
    color: #07111f !important;
    font-weight: 900 !important;
    font-size: 1rem !important;
    letter-spacing: -0.01em !important;
    box-shadow:
      0 18px 40px rgba(0, 0, 0, 0.35),
      0 2px 10px rgba(255, 255, 255, 0.18) inset !important;
    backdrop-filter: blur(14px) saturate(1.1) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.1) !important;
    transition:
      transform 0.2s ease,
      box-shadow 0.2s ease,
      background 0.2s ease,
      color 0.2s ease !important;
  }

  .mobile-sidebar-toggle:hover,
  .mobile-sidebar-toggle:active {
    transform: translateY(-1px) scale(1.01) !important;
    box-shadow:
      0 22px 46px rgba(0, 0, 0, 0.4),
      0 2px 12px rgba(255, 255, 255, 0.22) inset !important;
  }

  .mobile-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(7, 17, 31, 0.08);
    color: #07111f;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    flex-shrink: 0;
  }

  .mobile-toggle-text {
    display: inline-block;
    line-height: 1;
  }

  body.sidebar-open .mobile-sidebar-toggle {
    background:
      linear-gradient(135deg, rgba(125, 211, 252, 0.94), rgba(167, 139, 250, 0.9)) !important;
    color: #07111f !important;
    box-shadow:
      0 22px 48px rgba(0, 0, 0, 0.42),
      0 2px 12px rgba(255, 255, 255, 0.2) inset !important;
  }

  body.sidebar-open .mobile-toggle-icon {
    background: rgba(7, 17, 31, 0.12);
  }
}
/* FINAL mobile Google-Maps-style layout override */
.mobile-sidebar-toggle {
  display: none;
}

@media (max-width: 980px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
  }

  .app-shell {
    display: block !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .map-panel {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    z-index: 1 !important;
    display: block !important;
    background: #0b1020 !important;
  }

  #map,
  .leaflet-container {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    display: block !important;
  }

  .sidebar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100vw !important;
    height: 82dvh !important;
    max-height: 82dvh !important;
    z-index: 999998 !important;
    overflow-y: auto !important;
    border-right: 0 !important;
    border-top: 1px solid var(--border) !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.55) !important;
    transform: translateY(110%) !important;
    transition: transform 240ms ease !important;
    padding-top: 34px !important;
  }

  .sidebar::after {
    content: "";
    position: fixed;
    top: 12px;
    left: 50%;
    width: 46px;
    height: 5px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.35);
  }

  body.sidebar-open .sidebar {
    transform: translateY(0) !important;
  }

  .mobile-sidebar-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    position: fixed !important;
    left: 16px !important;
    right: 16px !important;
    bottom: calc(env(safe-area-inset-bottom) + 18px) !important;
    z-index: 999999 !important;
    width: auto !important;
    height: 56px !important;
    padding: 0 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 999px !important;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(219, 234, 254, 0.88)) !important;
    color: #07111f !important;
    font-weight: 950 !important;
    font-size: 1rem !important;
    letter-spacing: -0.01em !important;
    box-shadow:
      0 18px 40px rgba(0, 0, 0, 0.35),
      0 2px 10px rgba(255, 255, 255, 0.18) inset !important;
    backdrop-filter: blur(14px) saturate(1.1) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.1) !important;
  }

  body.sidebar-open .mobile-sidebar-toggle {
    bottom: calc(82dvh + env(safe-area-inset-bottom) + 10px) !important;
    background:
      linear-gradient(135deg, rgba(125, 211, 252, 0.94), rgba(167, 139, 250, 0.9)) !important;
  }

  .leaflet-control-zoom {
    margin-top: 18px !important;
    margin-left: 18px !important;
  }

  .leaflet-control-attribution {
    font-size: 10px !important;
  }
}
.progress-wrap {
  display: none;
  margin-top: 14px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.25s ease;
}

.progress-text {
  margin: 7px 0 0;
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: right;
}
/* Final loading popup override - no card box */
.loading-overlay {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  text-align: center !important;
  padding: 24px !important;
  background:
    radial-gradient(circle at center, rgba(125, 211, 252, 0.11), transparent 22rem),
    rgba(8, 11, 18, 0.86) !important;
  backdrop-filter: blur(8px) !important;
}

.loading-box {
  width: min(420px, 88vw) !important;
  max-width: 420px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  text-align: center !important;
}

.loading-box .spinner {
  width: 68px !important;
  height: 68px !important;
  margin: 0 auto 20px !important;
}

.loading-copy {
  margin-bottom: 20px !important;
}

.loading-overlay .loading-title {
  margin: 0 !important;
  color: #f8fafc !important;
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.15 !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45) !important;
}

.loading-overlay .loading-subtitle {
  margin: 8px auto 0 !important;
  max-width: 360px !important;
  color: #b9d2f0 !important;
  font-size: 0.98rem !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45) !important;
}

.loading-box .progress-bar {
  width: 100% !important;
  height: 10px !important;
  margin-top: 18px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  background: rgba(15, 23, 42, 0.88) !important;
  border: 1px solid rgba(148, 163, 184, 0.34) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35) !important;
}

.loading-box .progress-fill {
  width: 0%;
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #38bdf8, #22c55e) !important;
  transition: width 0.25s ease !important;
}

.loading-overlay .progress-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 10px !important;
  color: #dbeafe !important;
  font-size: 0.86rem !important;
  font-weight: 800 !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5) !important;
}

.loading-overlay .progress-row span {
  color: #dbeafe !important;
  font-size: 0.86rem !important;
}

.loading-overlay .progress-row span:last-child {
  color: #7dd3fc !important;
  font-variant-numeric: tabular-nums !important;
}
.tool-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.tool-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.tool-btn.active {
  background: rgba(125, 211, 252, 0.14);
  color: var(--text);
  border-color: rgba(125, 211, 252, 0.35);
}
.score-bar-row {
  margin: 7px 0;
}

.score-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  margin-bottom: 3px;
}

.score-bar-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.85);
}
.amenity-pin-dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #8b5cf6;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25), 0 8px 18px rgba(0, 0, 0, 0.35);
}
.leaflet-interactive.parking-lot-animate {
  animation: lotFadeIn 0.45s ease-out both;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes lotFadeIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}
.parking-lot-animate {
  animation: parkingLotPop 1s ease-out both !important;
}

@keyframes parkingLotPop {
  0% {
    opacity: 0 !important;
    stroke-width: 0 !important;
    filter: brightness(2);
  }

  45% {
    opacity: 1 !important;
    stroke-width: 8 !important;
    filter: brightness(1.8);
  }

  100% {
    opacity: 1 !important;
    filter: brightness(1);
  }
}
.lot-tooltip {
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 8px;
}

/* =========================================================
   FEATURE UPDATE: filters, source badge, map actions
   ========================================================= */

.hidden {
  display: none !important;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: -6px 0 16px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  border: 1px solid rgba(125, 211, 252, 0.22);
  color: #dff6ff;
  background: rgba(125, 211, 252, 0.1);
}

.source-badge.cached {
  border-color: rgba(34, 197, 94, 0.35);
  color: #d1fae5;
  background: rgba(34, 197, 94, 0.12);
}

.source-badge.live {
  border-color: rgba(167, 139, 250, 0.35);
  color: #ede9fe;
  background: rgba(167, 139, 250, 0.12);
}

.filter-panel {
  margin: 0 0 16px;
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-header span {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 950;
}

.filter-header small {
  padding: 4px 8px;
  border-radius: 999px;
  color: #dff6ff;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.22);
  font-size: 0.7rem;
  font-weight: 850;
}

.filter-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 10px 0 7px;
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 850;
}

.filter-control strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.range-input {
  width: 100%;
  accent-color: #7dd3fc;
}

.filter-number {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(5, 8, 14, 0.72);
  color: var(--text);
  font-weight: 750;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: #7dd3fc;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 12px;
}

.filter-actions button {
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: none;
  font-size: 0.78rem;
}

.filter-actions button:first-child {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.95), rgba(167, 139, 250, 0.92));
  color: #07111f;
}

.filter-actions button:last-child {
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  border: 1px solid var(--border);
}

.compact-select {
  padding: 10px 12px !important;
  font-size: 0.84rem !important;
}

.pin-hint {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 500;
  transform: translateX(-50%);
  max-width: min(460px, calc(100vw - 460px));
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  pointer-events: none;
}


/* =========================================================
   CLEAN MAP + POPUP UI
   Replaces the older stacked popup overrides.
   ========================================================= */

.leaflet-popup-content-wrapper {
  border-radius: 20px !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: rgba(255, 255, 255, 0.985) !important;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.38) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  color: #0f172a !important;
  line-height: 1.42 !important;
  font-size: 0.9rem !important;
  max-height: 78vh !important;
  overflow-y: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.985) !important;
}

/* Shared popup shell */
.gf-popup {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  color: #0f172a !important;
  overflow: hidden !important;
}

.gf-popup-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  background:
    radial-gradient(circle at top left, rgba(125, 211, 252, 0.22), transparent 9rem),
    linear-gradient(135deg, #f8fafc, #eef2ff) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.gf-eyebrow {
  max-width: 210px !important;
  margin-bottom: 5px !important;
  color: #64748b !important;
  font-size: 0.7rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.055em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
}

.gf-popup h3 {
  margin: 0 !important;
  color: #0f172a !important;
  font-size: 1.7rem !important;
  font-weight: 950 !important;
  letter-spacing: -0.045em !important;
  line-height: 1 !important;
}

.gf-badge {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  border-radius: 999px !important;
  padding: 6px 10px !important;
  color: #581c87 !important;
  background: #f3e8ff !important;
  border: 1px solid #d8b4fe !important;
  font-size: 0.72rem !important;
  font-weight: 900 !important;
}

/* Parking popups: horizontal dashboard card */
.gf-popup-parking {
  width: min(860px, calc(100vw - 500px)) !important;
  min-width: 720px !important;
  display: grid !important;
  grid-template-columns: 1.08fr 0.92fr 0.92fr !important;
  grid-template-areas:
    "header header header"
    "insight insight insight"
    "stats redevelopment amenity"
    "actions actions actions" !important;
}

.gf-popup-parking .gf-popup-header {
  grid-area: header !important;
}

.gf-popup-parking .gf-insight {
  grid-area: insight !important;
}

.gf-popup-parking .stats-section {
  grid-area: stats !important;
  border-right: 1px solid #e5e7eb !important;
}

.gf-popup-parking .redevelopment-section {
  grid-area: redevelopment !important;
  border-right: 1px solid #e5e7eb !important;
}

.gf-popup-parking .amenity-section {
  grid-area: amenity !important;
}

.gf-popup-section {
  padding: 12px 16px !important;
  border-bottom: 1px solid #e5e7eb !important;
  background: #ffffff !important;
}

.gf-popup-parking .stats-section,
.gf-popup-parking .redevelopment-section,
.gf-popup-parking .amenity-section {
  display: block !important;
  min-width: 0 !important;
  border-bottom: none !important;
}

.gf-insight {
  color: #475569 !important;
  background: #f8fafc !important;
  font-size: 0.82rem !important;
  line-height: 1.42 !important;
  font-weight: 750 !important;
}

.gf-section-title {
  margin-bottom: 9px !important;
  color: #334155 !important;
  font-size: 0.72rem !important;
  font-weight: 950 !important;
  letter-spacing: 0.055em !important;
  text-transform: uppercase !important;
}

.gf-stat-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 18px !important;
  padding: 4px 0 !important;
  font-size: 0.82rem !important;
}

.gf-stat-row span {
  color: #64748b !important;
  font-weight: 750 !important;
}

.gf-stat-row strong {
  color: #0f172a !important;
  font-weight: 950 !important;
  font-variant-numeric: tabular-nums !important;
  text-align: right !important;
}

.gf-coord-row strong {
  font-size: 0.76rem !important;
}

.score-bar-row {
  margin: 7px 0 !important;
}

.score-bar-label {
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 3px !important;
  color: #334155 !important;
  font-size: 0.73rem !important;
  font-weight: 850 !important;
}

.score-bar-track {
  height: 7px !important;
  border-radius: 999px !important;
  background: #e5e7eb !important;
  overflow: hidden !important;
}

.score-bar-fill {
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #38bdf8, #8b5cf6) !important;
  opacity: 0.9 !important;
}

/* Action buttons */
.gf-popup-actions {
  grid-area: actions !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  padding: 12px 16px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e5e7eb !important;
}

.gf-popup-actions a,
.gf-popup-actions button {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 36px !important;
  padding: 8px 10px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #eef2ff !important;
  color: #4338ca !important;
  font-family: inherit !important;
  font-size: 0.73rem !important;
  font-weight: 950 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.gf-popup-actions a:hover,
.gf-popup-actions button:hover {
  transform: none !important;
  background: #e0e7ff !important;
  box-shadow: none !important;
}

.gmaps-icon {
  width: 16px !important;
  height: 16px !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
}

.gmaps-icon svg {
  width: 16px !important;
  height: 16px !important;
  display: block !important;
}

.coord-icon {
  font-size: 0.9rem !important;
  line-height: 1 !important;
}

/* Amenity pin popups: compact, not dashboard grid */
.gf-popup-pin {
  width: min(410px, calc(100vw - 44px)) !important;
  min-width: 0 !important;
  display: block !important;
}

.gf-popup-pin .gf-popup-section,
.gf-popup-pin .gf-insight,
.gf-popup-pin .gf-popup-actions,
.gf-popup-pin .gf-popup-footer {
  display: block !important;
  grid-area: auto !important;
  grid-column: auto !important;
  border-right: none !important;
}

.gf-popup-pin .gf-popup-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
}

.gf-popup-footer {
  padding: 10px 16px 14px !important;
  color: #64748b !important;
  background: #f8fafc !important;
  font-size: 0.74rem !important;
  font-weight: 750 !important;
  font-variant-numeric: tabular-nums !important;
}

/* Map interaction polish */
.lot-tooltip {
  border: 1px solid rgba(168, 85, 247, 0.32) !important;
  border-radius: 10px !important;
  padding: 7px 9px !important;
  background: rgba(15, 23, 42, 0.94) !important;
  color: #f8fafc !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32) !important;
  font-size: 0.82rem !important;
  font-weight: 900 !important;
}

.parking-lot-hover {
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.95)) drop-shadow(0 0 18px rgba(168, 85, 247, 0.38)) !important;
}

.amenity-pin-dot {
  width: 22px !important;
  height: 22px !important;
  border-radius: 999px !important;
  background: #8b5cf6 !important;
  border: 3px solid #ffffff !important;
  box-shadow:
    0 0 0 4px rgba(139, 92, 246, 0.25),
    0 0 24px rgba(139, 92, 246, 0.5),
    0 8px 18px rgba(0, 0, 0, 0.35) !important;
}

.clear-pins-btn,
#clear-pins-btn {
  width: 100%;
  margin: 8px 0 8px !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #07111f !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: none !important;
  font-size: 0.82rem !important;
}

@media (max-width: 1100px) {
  .gf-popup-parking {
    width: min(720px, calc(100vw - 420px)) !important;
    min-width: 620px !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "header header"
      "insight insight"
      "stats redevelopment"
      "amenity amenity"
      "actions actions" !important;
  }

  .gf-popup-parking .redevelopment-section {
    border-right: none !important;
  }

  .gf-popup-parking .amenity-section {
    border-top: 1px solid #e5e7eb !important;
  }
}

@media (max-width: 980px) {
  .pin-hint {
    top: 16px;
    left: 16px;
    right: 16px;
    transform: none;
    max-width: none;
    border-radius: 16px;
  }

  .filter-actions {
    grid-template-columns: 1fr;
  }

  .leaflet-popup-content {
    min-width: 280px !important;
    max-width: 330px !important;
  }

  .gf-popup-parking,
  .gf-popup-pin {
    width: min(330px, calc(100vw - 36px)) !important;
    min-width: 0 !important;
    display: block !important;
  }

  .gf-popup-parking .stats-section,
  .gf-popup-parking .redevelopment-section,
  .gf-popup-parking .amenity-section {
    display: block !important;
    border-right: none !important;
    border-top: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
  }

  .gf-popup-actions,
  .gf-popup-pin .gf-popup-actions {
    grid-template-columns: 1fr !important;
  }
}
/* =========================================================
   TRUE FINAL POPUP + CLEAR PINS FIX
   ========================================================= */

/* Clear pins button spacing + polish */
#clear-pins-btn,
.clear-pins-btn {
  width: 100% !important;
  margin: 10px 0 12px !important;
  padding: 11px 14px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #ffffff, #e0f2fe) !important;
  color: #07111f !important;
  border: 1px solid rgba(125, 211, 252, 0.35) !important;
  font-weight: 950 !important;
  box-shadow: 0 10px 24px rgba(125, 211, 252, 0.12) !important;
}

#clear-pins-btn:hover,
.clear-pins-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 14px 30px rgba(125, 211, 252, 0.18) !important;
}

/* Force Leaflet to stop making tiny receipt popups */
.leaflet-popup {
  width: auto !important;
}

.leaflet-popup-content-wrapper {
  width: auto !important;
  max-width: none !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}

.leaflet-popup-content {
  width: auto !important;
  min-width: 680px !important;
  max-width: 760px !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 !important;
}

/* Parking popup: compact wide dashboard */
.gf-popup-parking {
  width: 720px !important;
  max-width: calc(100vw - 470px) !important;
  min-width: 640px !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-areas:
    "header header"
    "insight insight"
    "stats stats"
    "redevelopment amenity"
    "actions actions" !important;
  background: #ffffff !important;
  color: #0f172a !important;
  overflow: hidden !important;
}

/* Header */
.gf-popup-parking .gf-popup-header {
  grid-area: header !important;
  padding: 12px 16px !important;
}

.gf-popup-parking .gf-popup h3,
.gf-popup-parking h3 {
  font-size: 1.55rem !important;
}

/* Insight line */
.gf-popup-parking .gf-insight {
  grid-area: insight !important;
  padding: 10px 16px !important;
  font-size: 0.78rem !important;
  line-height: 1.35 !important;
}

/* Stats: two columns so it does not become tall */
.gf-popup-parking .stats-section,
.gf-popup-parking > .gf-popup-section:nth-of-type(2) {
  grid-area: stats !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  column-gap: 22px !important;
  padding: 10px 16px !important;
  border-bottom: 1px solid #e5e7eb !important;
}

/* Breakdown sections side-by-side */
.gf-popup-parking .redevelopment-section,
.gf-popup-parking > .gf-popup-section:nth-of-type(3) {
  grid-area: redevelopment !important;
  padding: 10px 16px !important;
  border-right: 1px solid #e5e7eb !important;
}

.gf-popup-parking .amenity-section,
.gf-popup-parking > .gf-popup-section:nth-of-type(4) {
  grid-area: amenity !important;
  padding: 10px 16px !important;
}

/* Compact row sizing */
.gf-stat-row {
  padding: 3px 0 !important;
  font-size: 0.79rem !important;
}

.gf-section-title {
  margin-bottom: 6px !important;
  font-size: 0.7rem !important;
}

.score-bar-row {
  margin: 4px 0 !important;
}

.score-bar-label {
  font-size: 0.68rem !important;
  margin-bottom: 2px !important;
}

.score-bar-track {
  height: 5px !important;
}

/* Actions */
.gf-popup-parking .gf-popup-actions {
  grid-area: actions !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  padding: 10px 16px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e5e7eb !important;
}

.gf-popup-actions a,
.gf-popup-actions button {
  min-height: 32px !important;
  padding: 7px 10px !important;
  font-size: 0.7rem !important;
}

/* Amenity pin popup stays compact */
.gf-popup-pin {
  width: 380px !important;
  min-width: 380px !important;
  max-width: 380px !important;
  display: block !important;
}

.gf-popup-pin .gf-popup-section,
.gf-popup-pin .gf-insight,
.gf-popup-pin .gf-popup-actions,
.gf-popup-pin .gf-popup-footer {
  display: block !important;
  grid-area: auto !important;
  grid-column: auto !important;
  border-right: none !important;
}

.gf-popup-pin .gf-popup-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
}

/* Mobile: go back to narrow normal popup */
@media (max-width: 900px) {
  .leaflet-popup-content {
    min-width: 280px !important;
    max-width: 330px !important;
    max-height: 78vh !important;
    overflow-y: auto !important;
  }

  .gf-popup-parking,
  .gf-popup-pin {
    width: min(330px, calc(100vw - 36px)) !important;
    min-width: 0 !important;
    max-width: min(330px, calc(100vw - 36px)) !important;
    display: block !important;
  }

  .gf-popup-parking .stats-section,
  .gf-popup-parking > .gf-popup-section:nth-of-type(2),
  .gf-popup-parking .redevelopment-section,
  .gf-popup-parking > .gf-popup-section:nth-of-type(3),
  .gf-popup-parking .amenity-section,
  .gf-popup-parking > .gf-popup-section:nth-of-type(4) {
    display: block !important;
    border-right: none !important;
  }

  .gf-popup-actions,
  .gf-popup-pin .gf-popup-actions {
    grid-template-columns: 1fr !important;
  }
}