.heatmap-layout .filters {
  position: sticky;
  top: 1rem;
}

.heatmap-main {
  display: flex;
  flex-direction: column;
}

.map-card {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
}

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

/* Leaflet's own CSS assumes tiles/controls come from its default z-index
   stack — this app's header sits well above that already, so nothing
   extra is needed there, but the popup/font should still match the site. */
.leaflet-popup-content {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.5;
}

.map-legend {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 500;
  background: rgba(248, 246, 240, 0.95);
  border: 1px solid var(--line-strong);
  padding: 0.6rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink);
  min-width: 160px;
}

.legend-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--slate);
}

.legend-bar {
  display: flex;
  height: 12px;
  border: 1px solid var(--line-strong);
}

.legend-swatch {
  flex: 1;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
}

@media (max-width: 860px) {
  #map { height: 420px; }
}
