/* Map instrumentation remains available when the header is expanded.
 * The map itself never changes dimensions while panels animate.
 *
 * Bottom-left vertical stack (from bottom upwards):
 * 1. Map navigation (center, base layer, fit MIZ)
 * 2. Leaflet scale and zoom controls
 * 3. Layers, legend and cursor coordinates
 */

.map-pane .map-toolbar {
  left: 12px;
  bottom: 12px;
  z-index: 640;
}

.map-pane .leaflet-bottom.leaflet-left {
  left: 10px;
  bottom: 49px;
  z-index: 620;
}

.map-pane .leaflet-bottom.leaflet-left .leaflet-control {
  margin-left: 0;
}

.map-pane .leaflet-control-scale {
  margin-bottom: 8px !important;
}

.map-pane .leaflet-control-zoom {
  margin-bottom: 9px;
  border: 1px solid rgba(91, 157, 190, .6);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

.map-pane .leaflet-control-zoom a {
  background: rgba(10, 33, 51, .9);
  color: #e1f4ff;
  border-color: rgba(91, 157, 190, .45);
}

.map-pane .leaflet-control-zoom a:hover,
.map-pane .leaflet-control-zoom a:focus-visible {
  background: rgba(22, 81, 110, .95);
  color: white;
}

/* These controls are outside the top navigation's reveal area. */
.map-pane .atc-map-tools {
  top: auto;
  bottom: 170px;
  left: 12px;
  z-index: 640;
  max-width: min(480px, calc(100% - 75px));
  gap: 6px;
}

.map-pane .atc-map-buttons {
  flex-wrap: wrap;
}

.map-pane .atc-map-buttons button,
.map-pane .atc-coordinates {
  border: 1px solid rgba(102, 176, 206, .55);
  border-radius: 6px;
  background: rgba(8, 30, 47, .82);
  backdrop-filter: blur(9px);
}

.map-pane .atc-map-popup {
  max-height: min(290px, 42vh);
  overflow-y: auto;
}

@media (max-width: 650px) {
  .map-pane .atc-map-tools {
    left: 10px;
    bottom: 170px;
    max-width: calc(100% - 65px);
  }

  .map-pane .atc-map-buttons button {
    padding: 6px;
    font-size: 10px;
  }

  .map-pane .atc-coordinates {
    font-size: 10px;
  }

  .map-pane .map-toolbar {
    left: 10px;
  }
}

@media (max-height: 550px) {
  .map-pane .atc-map-tools {
    bottom: 155px;
  }

  .map-pane .atc-map-popup {
    max-height: 28vh;
  }
}
