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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  height: 100vh;
  overflow: hidden;
  color: #333;
}

/* Sidebar */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  min-width: 320px;
  background: rgba(250, 250, 250, 0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 1000;
}

/* On desktop the sidebar is fixed over the map, so push Leaflet's left-side
   controls (zoom +/-) out from behind it. */
.leaflet-left {
  left: 320px;
}

#sidebar h1 {
  font-size: 1.15rem;
  padding: 16px 16px 4px;
  color: #222;
  line-height: 1.3;
}

#sidebar .subtitle {
  font-size: 0.8rem;
  color: #777;
  padding: 0 16px 12px;
}

.control-group {
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

.control-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  margin-bottom: 6px;
}

/* Collapsible section headers */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

/* Header wraps the label/h3, so cancel their bottom margin */
.collapsible-header label,
.collapsible-header h3 {
  margin-bottom: 0;
}

.collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  color: #bbb;
  padding: 0 2px;
  line-height: 1;
  font-family: monospace;
}

.collapse-btn:hover {
  color: #666;
}

/* Row that groups a section label with an action icon button */
.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.control-label-row label {
  margin-bottom: 0;
}

/* Groups reset + collapse buttons together on the right */
.collapsible-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Subtle icon buttons (reset ↺, random 🎲) */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #bbb;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: color 0.15s, transform 0.15s;
}

.icon-btn:hover {
  color: #555;
  transform: scale(1.2);
}

.icon-btn-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transition: max-width 0.22s ease-out, opacity 0.18s ease-out;
}

.icon-btn:hover .icon-btn-label {
  max-width: 56px;
  opacity: 1;
}

/* Spacing for second parameter sub-label */
.param-section {
  margin-top: 10px;
}

/* Parameter sub-labels (Eps / MinPts) — quieter than section titles */
#params-content label {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #444;
  font-size: 0.75rem;
}

/* Clickable label links (e.g. slider titles) */
.control-group label a {
  color: inherit;
  text-decoration: none;
}

.control-group label a:hover {
  text-decoration: underline;
}

/* Multi-select dropdown */
.multi-select {
  position: relative;
}

.multi-select-toggle {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multi-select-toggle:hover {
  border-color: #999;
}

.multi-select-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.multi-select-search {
  padding: 6px;
  border-bottom: 1px solid #eee;
}

.multi-select-search input {
  width: 100%;
  padding: 5px 8px;
  font-size: 0.82rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  outline: none;
}

.multi-select-search input:focus {
  border-color: #E41A1C;
}

.multi-select-options {
  max-height: 240px;
  overflow-y: auto;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: default;
  border-left: 3px solid transparent;
}

.multi-select-option:hover {
  background: #f5f5f5;
}

.multi-select-option.selected {
  background: #fef2f2;
  border-left-color: #E41A1C;
  font-weight: 600;
}

.multi-select-option .cuisine-checkbox {
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #E41A1C;
}

.multi-select-option .cuisine-name {
  flex: 1;
  cursor: pointer;
}

.multi-select-option .cuisine-name:hover {
  color: #E41A1C;
}

/* Slider */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Wrapper injected by initSliderBubbles() — provides a positioning context for the bubble */
.slider-wrap {
  flex: 1;
  position: relative;
}

#eps-slider,
#minpts-slider {
  flex: 1;
  width: 100%;
  cursor: pointer;
  accent-color: #E41A1C;
}

#eps-value,
#minpts-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #E41A1C;
  min-width: 40px;
  text-align: right;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #999;
  margin-top: 2px;
}

/* Toggle checkboxes */
.toggle-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.toggle-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #444;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  accent-color: #E41A1C;
  cursor: pointer;
}

/* Info panel */
.info-panel {
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

.info-panel h3 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  margin-bottom: 8px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

.info-item {
  font-size: 0.82rem;
}

.info-item .info-label {
  color: #888;
}

.info-item .info-value {
  font-weight: 600;
  color: #333;
}

.info-item.full-width {
  grid-column: 1 / -1;
}

/* About section */
.about-text {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  font-size: 0.78rem;
  color: #888;
  line-height: 1.5;
  margin-top: auto;
}

.about-text a {
  color: #377EB8;
}

/* Map container */
#map-container {
  flex: 1;
  position: relative;
}

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

/* Loading overlay */
#loading {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  color: #555;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: #E41A1C;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}

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

/* Error message */
#error-msg {
  display: none;
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #E31A1C;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  z-index: 3000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Analysis modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 5000;
  justify-content: center;
  align-items: center;
}

.modal {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  font-size: 1.05rem;
  color: #222;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-intro {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.55;
  margin-bottom: 12px;
}

.analysis-status {
  font-size: 0.78rem;
  color: #999;
  margin-bottom: 8px;
}

.analysis-table-wrap {
  overflow-x: auto;
}

#analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

#analysis-table th {
  background: #f5f5f5;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #ddd;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

#analysis-table th:hover {
  background: #eee;
}

#analysis-table th.sort-asc::after {
  content: " ▲";
  font-size: 0.65rem;
}

#analysis-table th.sort-desc::after {
  content: " ▼";
  font-size: 0.65rem;
}

#analysis-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f0f0f0;
}

#analysis-table tr:hover td {
  background: #fafafa;
}

/* ===== Sidebar inner wrapper ===== */
/* Fills the sidebar flex column on desktop; becomes the scrollable area on mobile */

#sidebar-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ===== Mobile-only elements: hidden on desktop ===== */

#mobile-bar,
#mobile-panel-header,
#mobile-done-btn {
  display: none;
}

/* ===== Mobile layout (≤768px) ===== */

@media (max-width: 768px) {
  /* Sidebar becomes a full-screen slide-up overlay */
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    /* Higher opacity than desktop — full-screen panel should feel mostly solid */
    background: rgba(250, 250, 250, 0.70);
    min-width: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease;
    border-right: none;
  }

  #sidebar.mobile-open {
    transform: translateY(0);
  }

  /* Scrollable content area */
  #sidebar-inner {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }

  /* Mobile panel header — extra top padding for notch/Dynamic Island */
  #mobile-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid #eee;
  }

  .mobile-panel-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
  }

  #mobile-close-panel {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0 4px;
  }

  #mobile-close-panel:hover {
    color: #333;
  }

  /* Done button pinned to panel bottom */
  #mobile-done-btn {
    display: block;
    flex-shrink: 0;
    margin: 12px 16px;
    padding: 14px;
    background: #E41A1C;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
  }

  #mobile-done-btn:hover {
    background: #c0161a;
  }

  /* Fixed bottom bar — height grows to accommodate home indicator safe area.
     Math: content area = (64 + safe) - 10 - (10 + safe) = 44px always. */
  #mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    gap: 10px;
    align-items: stretch;
  }

  #mobile-cuisine-pill {
    flex: 1;
    padding: 0 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
    font-family: inherit;
    display: flex;
    align-items: center;
  }

  #mobile-cuisine-pill:hover {
    border-color: #999;
  }

  #mobile-open-panel {
    width: 44px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #555;
    font-family: inherit;
  }

  #mobile-open-panel:hover {
    border-color: #999;
    background: #f5f5f5;
  }

  /* Sidebar is off-screen on mobile — reset the desktop left offset */
  .leaflet-left {
    left: 0;
  }

  /* Push map controls below notch/Dynamic Island */
  #theme-toggle {
    top: calc(12px + env(safe-area-inset-top));
  }

  .leaflet-top {
    padding-top: env(safe-area-inset-top);
  }

  /* Prevent Safari auto-zoom on input focus (triggers below 16px font-size) */
  .multi-select-search input {
    font-size: 16px;
  }

  /* Cuisine dropdown floated above the bottom bar (opened from the pill) */
  .dropdown-floating {
    position: fixed !important;
    bottom: 74px;
    left: 12px;
    right: 12px;
    top: auto !important;
    z-index: 4000;
    max-height: 60vh;
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    display: block !important;
  }
}

/* ===== Theme toggle button ===== */

#theme-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  padding: 0;
  line-height: 1;
}

#theme-toggle:hover {
  background: rgba(240, 240, 240, 0.80);
}

/* ===== Leaflet zoom controls — frosted glass ===== */

.leaflet-bar {
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.leaflet-bar a {
  background: rgba(255, 255, 255, 0.65);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

.leaflet-bar a:hover {
  background: rgba(240, 240, 240, 0.80);
}

/* ===== Smooth theme transition ===== */

body,
#sidebar,
#sidebar h1,
#sidebar .subtitle,
.control-group,
.control-group label,
#params-content label,
.collapse-btn,
.multi-select-toggle,
.multi-select-menu,
.multi-select-option,
.toggle-row label,
.info-panel,
.info-panel h3,
.info-item .info-label,
.info-item .info-value,
.about-text,
#loading,
.modal,
.modal-header,
.modal-close,
#analysis-table th,
#analysis-table td,
#theme-toggle,
#mobile-bar,
#mobile-cuisine-pill,
#mobile-open-panel,
#mobile-panel-header,
#mobile-close-panel {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===== Slider value bubble ===== */

.slider-bubble {
  position: absolute;
  top: -34px;
  left: 0;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #E41A1C;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.slider-bubble.visible {
  opacity: 1;
}

/* Downward-pointing caret */
.slider-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, 0.88);
}

/* ===== Custom restaurant popup ===== */

.restaurant-popup-wrap .leaflet-popup-content-wrapper {
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
  border: none;
  animation: popup-rise 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.restaurant-popup-wrap .leaflet-popup-content {
  margin: 0;
}

.restaurant-popup-wrap .leaflet-popup-close-button {
  color: rgba(0, 0, 0, 0.28) !important;
  font-size: 18px !important;
  top: 5px !important;
  right: 7px !important;
  line-height: 1 !important;
  padding: 0 !important;
}

.restaurant-popup-wrap .leaflet-popup-close-button:hover {
  color: rgba(0, 0, 0, 0.55) !important;
}

@keyframes popup-rise {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.rp-inner {
  display: flex;
  min-width: 175px;
  max-width: 240px;
}

.rp-accent {
  width: 4px;
  flex-shrink: 0;
}

.rp-body {
  padding: 10px 14px 10px 11px;
  flex: 1;
}

.rp-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
  margin-bottom: 6px;
  padding-right: 16px; /* keep text clear of Leaflet's × button */
}

.rp-cluster {
  cursor: pointer;
}

.rp-cluster:hover {
  opacity: 0.75;
}

.rp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rp-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  line-height: 1.5;
}

.rp-cuisine {
  background: #f0f0f0;
  color: #555;
}

/* .rp-cluster background + color set inline via cluster color */

/* ===== Dot hover nameplate tooltip ===== */

.dot-nameplate {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 6px !important;
  padding: 3px 9px !important;
  font-size: 0.73rem !important;
  font-weight: 500 !important;
  color: #1a1a1a !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  white-space: nowrap;
}

.dot-nameplate::before {
  border-top-color: rgba(255, 255, 255, 0.88) !important;
}

/* ===== Ripple ring on dot click ===== */

.ripple-ring {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ripple-expand 0.65s ease-out forwards;
}

@keyframes ripple-expand {
  0%   { width: 10px;  height: 10px;  opacity: 0.85; }
  100% { width: 44px;  height: 44px;  opacity: 0;    }
}

/* Larger ripple for hotspot polygon clicks */
.ripple-ring-lg {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ripple-expand-lg 0.75s ease-out forwards;
}

@keyframes ripple-expand-lg {
  0%   { width: 24px;  height: 24px;  opacity: 0.75; }
  100% { width: 96px;  height: 96px;  opacity: 0;    }
}

/* ===== Dark mode overrides ===== */

[data-theme="dark"] body {
  color: #e0e0e0;
}

[data-theme="dark"] #sidebar {
  background: rgba(26, 26, 26, 0.82);
  border-right-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] #sidebar h1 {
  color: #f0f0f0;
}

[data-theme="dark"] #sidebar .subtitle {
  color: #888;
}

[data-theme="dark"] .control-group {
  border-top-color: #2a2a2a;
}

[data-theme="dark"] .control-group label {
  color: #999;
}

[data-theme="dark"] #params-content label {
  color: #c0c0c0;
}

[data-theme="dark"] .collapse-btn {
  color: #555;
}

[data-theme="dark"] .collapse-btn:hover {
  color: #aaa;
}

[data-theme="dark"] .icon-btn {
  color: #555;
}

[data-theme="dark"] .icon-btn:hover {
  color: #bbb;
}

[data-theme="dark"] .multi-select-toggle {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

[data-theme="dark"] .multi-select-toggle:hover {
  border-color: #666;
}

[data-theme="dark"] .multi-select-menu {
  background: #2a2a2a;
  border-color: #444;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .multi-select-search {
  border-bottom-color: #333;
}

[data-theme="dark"] .multi-select-search input {
  background: #1e1e1e;
  border-color: #444;
  color: #e0e0e0;
}

[data-theme="dark"] .multi-select-search input:focus {
  border-color: #E41A1C;
}

[data-theme="dark"] .multi-select-option {
  color: #e0e0e0;
}

[data-theme="dark"] .multi-select-option:hover {
  background: #333;
}

[data-theme="dark"] .multi-select-option.selected {
  background: #2a1a1a;
  border-left-color: #E41A1C;
}

[data-theme="dark"] .multi-select-option .cuisine-name:hover {
  color: #ff6b6b;
}

[data-theme="dark"] .toggle-row label {
  color: #ccc;
}

[data-theme="dark"] .info-panel {
  border-top-color: #2a2a2a;
}

[data-theme="dark"] .info-panel h3 {
  color: #999;
}

[data-theme="dark"] .info-item .info-label {
  color: #888;
}

[data-theme="dark"] .info-item .info-value {
  color: #e0e0e0;
}

[data-theme="dark"] .about-text {
  border-top-color: #2a2a2a;
  color: #888;
}

[data-theme="dark"] .about-text a {
  color: #5b9fd4;
}

[data-theme="dark"] #loading {
  background: rgba(0, 0, 0, 0.7);
  color: #bbb;
}

[data-theme="dark"] .spinner {
  border-color: #444;
  border-top-color: #E41A1C;
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.75);
}

[data-theme="dark"] .modal {
  background: #1e1e1e;
  color: #e0e0e0;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: #333;
}

[data-theme="dark"] .modal-header h2 {
  color: #f0f0f0;
}

[data-theme="dark"] .modal-close {
  color: #777;
}

[data-theme="dark"] .modal-close:hover {
  color: #ccc;
}

[data-theme="dark"] .modal-intro {
  color: #aaa;
}

[data-theme="dark"] .analysis-status {
  color: #666;
}

[data-theme="dark"] #analysis-table th {
  background: #252525;
  color: #aaa;
  border-bottom-color: #444;
}

[data-theme="dark"] #analysis-table th:hover {
  background: #333;
}

[data-theme="dark"] #analysis-table td {
  border-bottom-color: #252525;
  color: #ccc;
}

[data-theme="dark"] #analysis-table tr:hover td {
  background: #242424;
}

[data-theme="dark"] .leaflet-bar a {
  background: rgba(30, 30, 30, 0.78);
  color: #e0e0e0;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .leaflet-bar a:hover {
  background: rgba(50, 50, 50, 0.90);
}

[data-theme="dark"] #theme-toggle {
  background: rgba(30, 30, 30, 0.75);
  border-color: #555;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] #theme-toggle:hover {
  background: rgba(50, 50, 50, 0.95);
}

[data-theme="dark"] #mobile-bar {
  background: rgba(26, 26, 26, 0.78);
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] #mobile-cuisine-pill {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

[data-theme="dark"] #mobile-open-panel {
  background: #2a2a2a;
  border-color: #444;
  color: #c0c0c0;
}

[data-theme="dark"] #mobile-panel-header {
  border-bottom-color: #333;
}

[data-theme="dark"] .mobile-panel-title {
  color: #777;
}

[data-theme="dark"] #mobile-close-panel {
  color: #777;
}

[data-theme="dark"] .slider-bubble {
  background: rgba(38, 38, 38, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ff7070;
}

[data-theme="dark"] .slider-bubble::after {
  border-top-color: rgba(38, 38, 38, 0.92);
}

[data-theme="dark"] .restaurant-popup-wrap .leaflet-popup-content-wrapper {
  background: #1e1e1e;
}

[data-theme="dark"] .restaurant-popup-wrap .leaflet-popup-tip {
  background: #1e1e1e;
}

[data-theme="dark"] .restaurant-popup-wrap .leaflet-popup-close-button {
  color: rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] .restaurant-popup-wrap .leaflet-popup-close-button:hover {
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="dark"] .rp-name {
  color: #f0f0f0;
}

[data-theme="dark"] .rp-cuisine {
  background: #2a2a2a;
  color: #aaa;
}

[data-theme="dark"] .dot-nameplate {
  background: rgba(32, 32, 32, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f0f0f0 !important;
}

[data-theme="dark"] .dot-nameplate::before {
  border-top-color: rgba(32, 32, 32, 0.92) !important;
}

/* ===== Dot layer fade-in ===== */

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

.dots-fade-in {
  animation: dots-fade-in 0.55s ease-out forwards;
}
