.nav{
  position: fixed;
  top: 20px;
  right: 70px;
  z-index: 3;
}

#mapbox{
  position: relative;
  height: 100vh;
  padding: 0;
}
#mapbox .sec-title{
  position: absolute;
  top: 40px;
  left: 40px;
  text-align: left;
  z-index: 2;
}
#atl-map{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---------- Layer toggle buttons ---------- */
#map-controls{
  position: absolute;
  top: 120px;
  left: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3;
}
#map-controls button{
  appearance: none;
  border: 2px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: background .2s, border-color .2s, transform .05s, box-shadow .2s;
}
#map-controls button:hover{
  background: rgba(0,0,0,.7);
}

#map-ontrols button.active{
  border-color: #66ccff;
  box-shadow: 0 0 0 2px rgba(102,204,255,.20) inset;
}

/* Emphasize ONLY the Composite score button, always */
#map-controls button[data-layer="composite"],
#map-controls button[data-layer="composite"].active{
  font-weight: 800;
  letter-spacing: .2px;
  color: #e7f7ff;
  box-shadow:
    0 0 0 2px rgba(102,204,255,.18),
    0 8px 24px rgba(0,0,0,.35);
  background:
    radial-gradient(100% 150% at 50% 25%, rgba(102,204,255,.18), transparent 70%),
    rgba(0,0,0,.58);
}

/* Gap under Composite score to separate it from the next button */
#map-controls button[data-layer="composite"]{
  margin-bottom: clamp(16px, 4vh, 36px);
}

/* ---------- Legend wrapper (transparent) ----------
   Inner legend pieces (.legend-bar, .legend-ticks, etc.)
   are styled by JS-injected CSS; the container stays clean. */
#map-legend{
  position: absolute;
  bottom: 50px;
  left: 50px;
  z-index: 3;
  background: transparent;
  border: none;
  padding: 0;
  pointer-events: auto;
}

/* Categorical legend: left-align everything */
#map-legend .cats{
  display: grid;
  grid-template-columns: 12px auto; 
  gap: 6px 10px;
  align-items: center;
  justify-items: start;             
  text-align: left;                 
}
#map-legend .cats > div { text-align: left; }
#map-legend .dot{ width:10px; height:10px; border-radius:50% }

/* ---------- Mapbox popup tweaks ---------- */
.mapboxgl-popup-content{
  background: rgba(0,0,0,.85) !important;
  color: #fff !important;
  border-radius: 8px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.mapboxgl-popup-tip{
  border-top-color: rgba(0,0,0,.85) !important;
  border-bottom-color: rgba(0,0,0,.85) !important;
}

/* --- One-time zoom hint overlay --- */
#mapbox .map-hint{
  position: absolute;
  right: 18px;
  bottom: 18px;           
  z-index: 10;            
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font: 600 12px/1.2 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;   
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
  will-change: opacity, transform;
}
#mapbox .map-hint.show{
  opacity: 1;
  transform: translateY(0);
}
#mapbox .map-hint .kbd{
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 6px;
  padding: 2px 6px;
  font-weight: 800;
}
#mapbox .map-hint .sep{
  opacity: .6;
}

/* Prevent scroll chaining while cursor is over the map */
#atl-map { overscroll-behavior: contain; }
