/* MeshBuddy MapLibre migration layer. Leaflet rollback remains in index-classic.html. */
#map {
  position: relative;
  overflow: hidden;
  background: #030806;
}

#map .maplibregl-map,
#map .maplibregl-canvas {
  font-family: var(--tac-font-mono, "IBM Plex Mono", monospace);
}

.maplibregl-ctrl-top-left {
  top: 14px;
  left: 14px;
}

.maplibregl-ctrl-bottom-right {
  right: 8px;
  bottom: 8px;
}

.maplibregl-ctrl-group {
  border: 1px solid rgba(70, 224, 107, .24) !important;
  border-radius: 0 !important;
  background: rgba(6, 15, 12, .90) !important;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .45) !important;
}

.maplibregl-ctrl button {
  width: 40px !important;
  height: 40px !important;
  color: #d7f5e2 !important;
}

.maplibregl-ctrl button:hover {
  background: rgba(70, 224, 107, .14) !important;
}

.maplibregl-ctrl-attrib {
  color: rgba(204, 224, 210, .55) !important;
  background: rgba(3, 8, 6, .75) !important;
  border: 1px solid rgba(70, 224, 107, .18);
  border-radius: 0 !important;
}

.maplibregl-ctrl-attrib a {
  color: rgba(204, 224, 210, .70) !important;
}

.maplibregl-popup {
  z-index: 780;
}

.maplibregl-popup-content {
  background: rgba(5, 11, 9, .96) !important;
  color: var(--tac-text, #d9f2df) !important;
  border: 1px solid rgba(70, 224, 107, .34);
  border-radius: 0 !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .55);
  padding: 0 !important;
  max-width: min(340px, calc(100vw - 36px));
  font-family: var(--tac-font-mono, "IBM Plex Mono", monospace);
}

.maplibregl-popup-tip {
  border-top-color: rgba(5, 11, 9, .96) !important;
  border-bottom-color: rgba(5, 11, 9, .96) !important;
}

.maplibregl-popup-close-button {
  color: rgba(220, 245, 226, .72) !important;
  font-size: 22px;
  line-height: 22px;
  padding: 6px 8px !important;
}

.maplibregl-popup-close-button:hover {
  color: #ff5f67 !important;
  background: transparent !important;
}

.meshbuddy-maplibre-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 760;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(70, 224, 107, .28);
  background: rgba(4, 12, 9, .92);
  color: #dff7e5;
  font: 700 12px/1.35 var(--tac-font-mono, "IBM Plex Mono", monospace);
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}

.meshbuddy-maplibre-toast.is-visible {
  opacity: 1;
}

.meshbuddy-maplibre-toast.warn {
  border-color: rgba(255, 184, 77, .48);
  color: #ffdc91;
}

.meshbuddy-maplibre-toast.bad {
  border-color: rgba(255, 95, 103, .52);
  color: #ffb3b7;
}

.maplibre-panel {
  position: absolute;
  z-index: 740;
  width: 300px;
  max-width: calc(100vw - 36px);
  max-height: min(72vh, 560px);
  overflow: auto;
  background: rgba(7, 14, 11, .94);
  border: 1px solid rgba(70, 224, 107, .28);
  color: #dcefe2;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .55);
  font-family: var(--tac-font-mono, "IBM Plex Mono", monospace);
}

.maplibre-panel.is-hidden {
  display: none !important;
}

.npn-map-layer-control {
  top: 214px;
  right: 392px;
}

#mapLayersToggle,
#solarStormTopToggle,
#weatherRadarTopToggle,
#trafficCamsTopToggle,
#radioTowersTopToggle,
#fccUlsTopToggle,
#cellTowersTopToggle,
#lmsTowersTopToggle,
#faaCrossrefTopToggle,
#npnAdsbTopToggle,
#npnRingsToggle {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  align-self: auto !important;
  white-space: nowrap !important;
}

.npn-range-control {
  top: 224px;
  right: 720px;
}

.npn-solar-control {
  top: 268px;
  right: 392px;
}

#npn-adsb-overlay-panel {
  top: 184px;
  right: 392px;
}

.maplibre-panel-head,
.npn-map-layer-title,
.npn-range-control-title,
.npn-solar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(70, 224, 107, .20);
  color: #46e06b;
  font-family: var(--tac-font-display, "Saira Condensed", sans-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.maplibre-panel-body,
.npn-map-layer-body,
.npn-range-control-body,
.npn-solar-body {
  padding: 12px;
}

.npn-map-layer-buttons,
.npn-range-buttons,
.npn-solar-buttons,
.npn-adsb-actions {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.npn-map-layer-buttons button,
.npn-range-buttons button,
.npn-solar-buttons button,
.npn-adsb-actions button,
.maplibre-panel button,
.maplibre-panel select,
.maplibre-panel input {
  min-height: 36px;
  border: 1px solid rgba(142, 164, 148, .26);
  border-radius: 0;
  background: rgba(13, 23, 18, .92);
  color: #dcefe2;
  font: 700 12px/1 var(--tac-font-display, "Saira Condensed", sans-serif);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.npn-map-layer-buttons button.active,
.npn-range-buttons button.active,
.npn-solar-buttons button.active,
.maplibre-panel button.active,
.actions button.radar-on,
.actions button.layer-on,
.actions button.ring-on,
.actions button.traffic-on,
.actions button.tower-on,
.actions button.uls-on,
.actions button.cell-on,
.actions button.lms-on,
.actions button.crossref-on,
.actions button.adsb-on,
.actions button.solar-on {
  border-color: rgba(70, 224, 107, .82);
  color: #46e06b;
  box-shadow: inset 3px 0 0 #46e06b;
}

.npn-map-layer-row,
.npn-range-row,
.npn-solar-row,
.npn-adsb-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
  color: rgba(220, 240, 224, .75);
  font-size: 12px;
  text-transform: uppercase;
}

.npn-map-layer-status,
.npn-range-control-status,
.npn-solar-status,
.npn-adsb-status {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(70, 224, 107, .18);
  color: rgba(220, 240, 224, .72);
  background: rgba(3, 8, 6, .55);
  font-size: 12px;
}

.npn-map-layer-status.good,
.npn-range-control-status.good,
.npn-solar-status.good,
.npn-adsb-status.good {
  color: #46e06b;
}

.npn-map-layer-status.warn,
.npn-range-control-status.warn,
.npn-solar-status.warn,
.npn-adsb-status.warn {
  color: #ffb84d;
}

.npn-map-layer-status.bad,
.npn-range-control-status.bad,
.npn-solar-status.bad,
.npn-adsb-status.bad {
  color: #ff5f67;
}

.meshbuddy-popup {
  min-width: 240px;
}

.meshbuddy-popup strong {
  display: block;
  color: #f3fff6;
  font-family: var(--tac-font-display, "Saira Condensed", sans-serif);
  font-size: 18px;
  letter-spacing: .04em;
}

.meshbuddy-popup span,
.meshbuddy-popup code,
.meshbuddy-popup a,
.meshbuddy-popup button {
  display: block;
  margin-top: 6px;
  color: rgba(220, 240, 224, .78);
  word-break: break-word;
}

.meshbuddy-popup a,
.meshbuddy-popup button {
  border: 1px solid rgba(70, 224, 107, .30);
  padding: 8px 10px;
  color: #46e06b;
  background: rgba(70, 224, 107, .08);
  text-align: center;
  text-decoration: none;
}

.meshbuddy-popup .tag {
  display: inline-block;
  margin: 0 8px 0 0;
  padding: 2px 6px;
  border: 1px solid currentColor;
  color: #46e06b;
  font-size: 11px;
}

.meshbuddy-popup .meta {
  display: grid;
  gap: 3px;
  margin: 8px 0;
}

.meshbuddy-popup img {
  max-width: 100%;
  max-height: 180px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .16);
  background: #000;
}

.meshbuddy-popup-pad {
  padding: 16px;
}

.maplibre-ao-label {
  padding: 2px 6px;
  color: #46e06b;
  background: rgba(3, 8, 6, .70);
  border: 1px solid rgba(70, 224, 107, .30);
  font: 700 11px/1 var(--tac-font-mono, "IBM Plex Mono", monospace);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.contact-letter-rail {
  z-index: 2;
}

@media (max-width: 920px) {
  .maplibregl-ctrl-top-left {
    top: 10px;
    left: 10px;
  }

  .npn-map-layer-control,
  .npn-range-control,
  .npn-solar-control,
  #npn-adsb-overlay-panel {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: 76px;
    width: auto;
    max-height: 48vh;
  }
}
