:root[data-theme="dark"] {
  --map-control-surface: rgb(29 38 50 / 83%);
  --map-control-hover: rgb(52 65 83 / 94%);
  --map-control-active: rgb(63 80 102 / 86%);
  --map-control-shadow: 0 2px 10px rgb(5 12 20 / 32%);
  --map-control-ink: #d6e1ee;
  --map-label-color: #e0e8f2;
  --map-water-label-color: #b0d7f2;
  --map-label-halo: rgb(13 20 29 / 96%);
  --map-route-casing: #111b2a;
  --map-route-ink: #80b8fd;
}

[data-theme="dark"] #map {
  background: #233b50;
}

[data-theme="dark"] #map .leaflet-tile-pane {
  filter: none;
}

[data-theme="dark"] .atlas-globe-scene {
  background:
    radial-gradient(circle at 10% 19%, #8aa5c2 0 .6px, transparent 1.2px),
    radial-gradient(circle at 84% 14%, #7187a7 0 .7px, transparent 1.2px),
    radial-gradient(circle at 90% 83%, #8c9ebb 0 .6px, transparent 1.2px),
    radial-gradient(circle at 14% 88%, #596f90 0 .6px, transparent 1.2px),
    radial-gradient(circle at 23% 64%, #6e82a3 0 .6px, transparent 1.2px),
    radial-gradient(ellipse at 50% 62%, #111b2c, #090e17 80%);
}

[data-theme="dark"] .atlas-globe-halo {
  box-shadow:
    inset 0 0 5px 0 rgb(126 190 255 / 65%),
    0 0 0 1px rgb(103 173 245 / 42%),
    0 0 14px 3px rgb(72 142 229 / 33%),
    0 0 43px 7px rgb(41 98 185 / 22%);
}

[data-theme="dark"] #map .atlas-basemap-label.is-selected > .atlas-basemap-context-caption {
  background: #15202c;
}

[data-theme="dark"] #map .atlas-neighborhood-label > span {
  color: #c1ccd8;
}

[data-theme="dark"] #map .atlas-neighborhood-label:is(:focus-visible, :hover, [aria-pressed="true"]) > span {
  color: var(--map-selection-color);
}

[data-theme="dark"] #map .atlas-tourist-zone-label[data-zone-id] > span {
  color: var(--zone-night-color, var(--map-label-color));
  -webkit-text-stroke-color: var(--map-label-halo);
}

[data-theme="dark"] #map .atlas-tourist-zone {
  fill-opacity: .2;
  stroke-opacity: .7;
}

[data-theme="dark"] #map .atlas-district-boundary {
  stroke: #82b7e6;
}

[data-theme="dark"] .route-tooltip-outline > path {
  fill: #244f85;
  stroke: var(--map-route-casing);
}

[data-theme="dark"] .map-tools #settings-button,
[data-theme="dark"] .map-tools .map-navigation :is(.map-tool, .zoom-buttons),
[data-theme="dark"] .neighborhood-control {
  color: var(--map-control-ink);
}

[data-theme="dark"] .map-tools #settings-button:active:enabled,
[data-theme="dark"] .map-tools .map-navigation .map-tool:active:enabled,
[data-theme="dark"] .map-tools .map-navigation .zoom-buttons > button:active:enabled {
  background: var(--map-control-active);
}

[data-theme="dark"] .map-tools .map-navigation .zoom-buttons > button:first-child::after {
  background: rgb(223 235 255 / 17%);
}

@media (hover: hover) {
  [data-theme="dark"] .map-tools #settings-button:hover:enabled,
  [data-theme="dark"] .map-tools .map-navigation .map-tool:hover:enabled,
  [data-theme="dark"] .map-tools .map-navigation .zoom-buttons > button:hover:enabled,
  [data-theme="dark"] .neighborhood-control > summary:hover {
    background: var(--map-control-hover);
  }
}

[data-theme="dark"] .map-error {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  border-color: var(--workspace-popover-border);
}

[data-theme="dark"] .neighborhood-toggle {
  border-color: rgb(225 235 255 / 16%);
}

[data-theme="dark"] #toggle-neighborhoods {
  background: #59677a;
}

[data-theme="dark"] #toggle-neighborhoods:checked {
  background: #3269a6;
}

[data-theme="dark"] .leaflet-container .leaflet-control-attribution {
  background: rgb(18 26 37 / 83%);
  color: #b6c2d1;
}

[data-theme="dark"] .leaflet-container .leaflet-control-attribution a:hover {
  color: var(--map-label-color);
}

@media (max-width: 760px) {
  [data-theme="dark"] .mobile-dock {
    background: var(--map-control-surface);
    border-color: rgb(222 235 255 / 15%);
    box-shadow: var(--map-control-shadow);
  }

  [data-theme="dark"] .mobile-dock button {
    color: var(--map-control-ink);
  }

  [data-theme="dark"] .mobile-dock button.active {
    background: #2e4562;
    color: #f2f7fd;
  }
}
