/* LEX EUROPE — Map mobile chrome (Wave 6)
   Loaded after inline styles; complements syncMapChrome() JS. */

@media (max-width: 800px) {
  /* Leaflet controls: clear of bottom nav + attribution readable */
  .leaflet-bottom.leaflet-right {
    right: 8px;
    bottom: calc(var(--mobnavh, 56px) + env(safe-area-inset-bottom, 0px) + 10px);
  }
  .leaflet-bottom.leaflet-left {
    left: 8px;
    bottom: calc(var(--mobnavh, 56px) + env(safe-area-inset-bottom, 0px) + 10px);
  }
  .leaflet-control-attribution {
    max-width: calc(100vw - 100px);
    font-size: 7.5px !important;
    line-height: 1.35 !important;
    padding: 3px 6px !important;
    white-space: normal !important;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.82) !important;
    border: 1px solid var(--hud-line, rgba(200, 16, 46, 0.28)) !important;
    border-radius: 2px;
  }
  .leaflet-popup-content-wrapper {
    max-width: min(92vw, 300px) !important;
    border-radius: 3px !important;
  }
  .leaflet-popup-content {
    font-size: 11px !important;
    line-height: 1.5 !important;
    margin: 10px 12px !important;
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .leaflet-popup-close-button {
    width: 32px !important;
    height: 32px !important;
    font-size: 20px !important;
    line-height: 32px !important;
    padding: 0 !important;
  }
  /* Severity legend — bottom-left, above zoom + mobnav */
  .map-legend,
  .heatmap-legend {
    position: fixed !important;
    left: 10px !important;
    bottom: calc(var(--mobnavh, 56px) + env(safe-area-inset-bottom, 0px) + 52px) !important;
    right: auto !important;
    top: auto !important;
    z-index: 450 !important;
    max-width: calc(100vw - 80px);
    padding: 6px 10px !important;
    font-size: 8px !important;
    line-height: 1.4 !important;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  }
  /* Classification strip: truncate long label on narrow screens */
  #classbar .cls-l {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 72vw;
  }
}

@media (max-width: 480px) {
  .leaflet-control-zoom {
    margin-bottom: 4px !important;
  }
  .map-legend,
  .heatmap-legend {
    font-size: 7.5px !important;
    padding: 5px 8px !important;
    max-width: calc(100vw - 60px);
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
  .leaflet-bottom.leaflet-right,
  .leaflet-bottom.leaflet-left {
    bottom: calc(var(--mobnavh, 46px) + 6px);
  }
}
