@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --map-ui-bg: #0d1f2d;
  --map-ui-panel: #13273f;
  --map-ui-text: #ffffff;
  --map-ui-muted: rgba(255, 255, 255, 0.72);
  --map-ui-line: rgba(255, 255, 255, 0.18);
  --map-ui-active: #ffffff;
  --map-ui-accent: #10b981;
}

.leaflet-container {
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.leaflet-bar,
.legend.leaflet-control {
  border: 1px solid var(--map-ui-line) !important;
  border-radius: 18px !important;
  background: rgba(13, 31, 45, 0.94) !important;
  color: var(--map-ui-text) !important;
  box-shadow: 0 18px 42px rgba(9, 18, 34, 0.28) !important;
  backdrop-filter: blur(10px);
}

.leaflet-control-layers {
  border: 1px solid rgba(13, 31, 45, 0.12) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #0d1f2d !important;
  box-shadow: 0 18px 42px rgba(9, 18, 34, 0.18) !important;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.leaflet-control-layers-expanded {
  min-width: 286px;
  max-width: min(360px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 12px !important;
  overflow-y: auto;
}

.leaflet-control-layers-toggle {
  width: 44px !important;
  height: 44px !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  position: relative;
}

.leaflet-control-layers-toggle::before,
.leaflet-control-layers-toggle::after {
  content: "";
  position: absolute;
  left: 13px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #0d1f2d;
}

.leaflet-control-layers-toggle::before {
  top: 16px;
  box-shadow: 0 6px 0 #0d1f2d;
}

.leaflet-control-layers-toggle::after {
  top: 28px;
}

.leaflet-control-layers-list {
  margin: 0 !important;
}

.leaflet-control-layers-base,
.leaflet-control-layers-overlays {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaflet-control-layers-overlays {
  max-height: min(76dvh, 420px);
  overflow-y: auto;
  padding-right: 2px;
}

.leaflet-control-layers label {
  margin: 0 !important;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(13, 31, 45, 0.06);
  color: rgba(13, 31, 45, 0.74);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  --layer-accent: #10b981;
  --layer-border: rgba(16, 185, 129, 0.42);
}

.leaflet-control-layers-base label {
  --layer-accent: #0d1f2d;
  --layer-border: rgba(13, 31, 45, 0.18);
}

.leaflet-control-layers-overlays label:nth-child(1) {
  --layer-accent: #d7191c;
  --layer-border: rgba(215, 25, 28, 0.48);
}

.leaflet-control-layers-overlays label:nth-child(2) {
  --layer-accent: #f59e0b;
  --layer-border: rgba(245, 158, 11, 0.5);
}

.leaflet-control-layers-overlays label:nth-child(3) {
  --layer-accent: #2c7bb6;
  --layer-border: rgba(44, 123, 182, 0.5);
}

.leaflet-control-layers-overlays label:nth-child(4) {
  --layer-accent: #7b3294;
  --layer-border: rgba(123, 50, 148, 0.5);
}

.leaflet-control-layers-overlays label:nth-child(5) {
  --layer-accent: #4d4d4d;
  --layer-border: rgba(77, 77, 77, 0.38);
}

.leaflet-control-layers label:hover {
  border-color: var(--layer-border);
  background: rgba(13, 31, 45, 0.08);
  color: #0d1f2d;
}

.leaflet-control-layers label:has(.leaflet-control-layers-selector:checked) {
  border-color: var(--layer-border);
  background: rgba(13, 31, 45, 0.06);
  color: #0d1f2d;
}

.leaflet-control-layers label > span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.leaflet-control-layers-selector {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0 !important;
  accent-color: var(--layer-accent);
}

.leaflet-control-layers-selector + span {
  min-width: 0;
  white-space: normal;
}

.leaflet-control-layers-separator {
  height: 1px;
  margin: 10px 0 !important;
  border: 0 !important;
  background: rgba(13, 31, 45, 0.12);
}

.leaflet-bar {
  overflow: hidden;
}

.leaflet-bar a,
.leaflet-bar a:hover {
  width: 38px !important;
  height: 38px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--map-ui-line) !important;
  background: var(--map-ui-bg) !important;
  color: var(--map-ui-text) !important;
  font-family: Manrope, system-ui, sans-serif !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  line-height: 38px !important;
}

.leaflet-bar a:last-child {
  border-bottom: 0 !important;
}

.leaflet-bar a:hover {
  background: var(--map-ui-panel) !important;
}

.leaflet-control-attribution {
  border-radius: 12px 0 0 0;
  background: rgba(13, 31, 45, 0.82) !important;
  color: rgba(255, 255, 255, 0.66) !important;
  font-family: Manrope, system-ui, sans-serif !important;
}

.leaflet-control-attribution a {
  color: rgba(255, 255, 255, 0.86) !important;
}

.legend.leaflet-control {
  max-width: min(450px, calc(100vw - 28px));
  padding: 10px 12px;
  overflow-x: auto;
}

.leaflet-bottom.leaflet-left .legend.leaflet-control {
  margin: 0 0 14px 14px !important;
}

.legend.leaflet-control svg {
  display: block;
  max-width: 100%;
}

.legend.leaflet-control text,
.legend.leaflet-control .tick text {
  fill: var(--map-ui-text) !important;
  font-family: Manrope, system-ui, sans-serif !important;
  font-size: 10px !important;
}

.legend.leaflet-control path,
.legend.leaflet-control line {
  stroke: rgba(255, 255, 255, 0.68) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(13, 31, 45, 0.96) !important;
  color: var(--map-ui-text) !important;
  box-shadow: 0 18px 42px rgba(9, 18, 34, 0.34) !important;
}

.leaflet-popup-content {
  color: var(--map-ui-text) !important;
  font-family: Manrope, system-ui, sans-serif !important;
  font-size: 13px;
  line-height: 1.45;
}

.leaflet-tooltip {
  border: 1px solid var(--map-ui-line) !important;
  border-radius: 12px !important;
  background: rgba(13, 31, 45, 0.94) !important;
  color: var(--map-ui-text) !important;
  box-shadow: 0 12px 28px rgba(9, 18, 34, 0.28) !important;
  font-family: Manrope, system-ui, sans-serif !important;
}

@media (max-width: 640px) {
  .leaflet-control-layers-expanded {
    min-width: 0;
    width: min(330px, calc(100vw - 22px));
  }

  .legend.leaflet-control {
    max-width: calc(100vw - 22px);
  }

  .leaflet-bottom.leaflet-left .legend.leaflet-control {
    margin: 0 0 10px 10px !important;
  }
}
