#map {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: #0b1720;
}

.leaflet-container {
  font-family: inherit;
}

.field-marker-wrapper {
  border: 0;
  background: transparent;
}

.field-marker {
  position: relative;
  width: var(--marker-size);
  height: var(--marker-size);
  display: grid;
  place-items: center;
  border: 2px solid var(--marker-rim);
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 24%, rgba(255, 255, 255, 0.82), transparent 0 18%, rgba(255, 255, 255, 0.2) 19%, transparent 36%),
    radial-gradient(circle at 50% 58%, var(--marker-color) 0 48%, var(--marker-rim) 100%);
  box-shadow:
    0 0 0 3px var(--marker-glow),
    0 0 14px var(--marker-glow),
    0 8px 18px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    inset 0 -8px 13px rgba(0, 0, 0, 0.23);
  color: var(--marker-text);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  isolation: isolate;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.field-marker::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -3px;
  border: 1px solid var(--marker-rim);
  border-radius: inherit;
  opacity: 0.22;
}

.field-marker:hover {
  transform: scale(1.12);
  box-shadow:
    0 0 0 5px var(--marker-glow),
    0 0 20px var(--marker-glow),
    0 10px 24px rgba(0, 0, 0, 0.42),
    0 0 14px rgba(255, 255, 255, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.26),
    inset 0 -8px 13px rgba(0, 0, 0, 0.23);
}

.field-marker span {
  transform: translateY(-1px);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.field-marker small {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #10212c;
  border-radius: 999px;
  background: #f3f7f8;
  color: #10212c;
  font-size: 0.58rem;
  font-weight: 900;
}

.mobile-marker-label {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  pointer-events: none;
}

.mobile-marker-label::before {
  display: none;
}

.mobile-marker-readout {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  color: #fff8f8;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.95),
    0 0 7px rgba(0, 0, 0, 0.7);
}

.mobile-marker-readout small {
  position: absolute;
  right: -8px;
  bottom: -8px;
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  border: 1px solid rgba(3, 12, 16, 0.92);
  border-radius: 999px;
  background: rgba(255, 248, 248, 0.94);
  color: #3b0710;
  font-size: 0.48rem;
  font-weight: 900;
  text-shadow: none;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #10212c;
  color: var(--text);
}

.leaflet-popup-content {
  min-width: 220px;
  margin: 16px;
}

.popup-title {
  margin-bottom: 11px;
  font-size: 1.05rem;
}

.popup-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 16px;
  margin: 0;
}

.popup-grid dt {
  color: var(--muted);
}

.popup-grid dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.popup-events {
  margin: 13px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.debug-data {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.debug-data summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.debug-data ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.debug-data li {
  display: grid;
  gap: 2px;
  padding: 7px;
  border: 1px solid rgba(65, 227, 214, 0.16);
  border-radius: 9px;
  background: rgba(2, 8, 12, 0.45);
}

.debug-data a {
  color: var(--text);
  font-weight: 900;
}

.debug-data span {
  color: var(--muted);
}

.popup-summary {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

.format-stats {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.format-stats h4 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legend {
  position: absolute;
  z-index: 500;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 16, 24, 0.9);
  color: var(--muted);
  font-size: 0.7rem;
  backdrop-filter: blur(8px);
}

.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend small {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}

.legend-dot.low {
  background: #fff8f0;
  box-shadow: 0 0 8px rgba(255, 248, 240, 0.44);
}

.legend-dot.mid {
  background: #ff8a76;
  box-shadow: 0 0 8px rgba(255, 82, 101, 0.42);
}

.legend-dot.high {
  background: #7a0014;
  box-shadow: 0 0 8px rgba(184, 15, 37, 0.58);
}

.loading {
  position: absolute;
  z-index: 600;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--muted);
}

.loading.error {
  color: var(--danger);
}

@media (max-width: 780px) {
  .is-mobile-map .field-marker {
    border-width: 1px;
    box-shadow:
      0 0 0 2px var(--marker-glow),
      0 4px 10px rgba(0, 0, 0, 0.3);
    font-size: 0.68rem;
    transition: none;
  }

  .is-mobile-map .field-marker:hover {
    transform: none;
    box-shadow:
      0 0 0 2px var(--marker-glow),
      0 4px 10px rgba(0, 0, 0, 0.3);
  }

  .is-mobile-map .field-marker small {
    min-width: 16px;
    height: 16px;
    border-width: 1px;
    font-size: 0.5rem;
  }

  .legend {
    right: 10px;
    bottom: 10px;
    align-items: start;
    flex-direction: column;
  }

  .legend small {
    padding: 8px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
