/* The terrain canvas sits below existing place windows and above 2D tiles. */
#terrain3dMap { position:absolute; inset:0; z-index:450; font-family:var(--font-ui,'Instrument Sans',sans-serif); }
#map.pt-terrain-active > .leaflet-map-pane > .leaflet-tile-pane,
#map.pt-terrain-active > .leaflet-map-pane > .leaflet-overlay-pane,
#map.pt-terrain-active > .leaflet-map-pane > .leaflet-marker-pane,
#map.pt-terrain-active > .leaflet-map-pane > .leaflet-shadow-pane,
#map.pt-terrain-active > .leaflet-map-pane > .leaflet-peaktales-position-pane,
#map.pt-terrain-active > .leaflet-control-container .leaflet-control-zoom,
#map.pt-terrain-active > .leaflet-control-container .leaflet-control-attribution { visibility:hidden!important; }
/* The transformed main pane is a stacking context: raise it as a whole so
   desktop popups are above WebGL. Only popup content may receive pointer events.
   Scope all rules to this map's own panes; embedded maps stay ordinary 2D. */
#map.pt-terrain-active > .leaflet-map-pane { z-index:500; pointer-events:none; }
#map.pt-terrain-active > .leaflet-map-pane > .leaflet-popup-pane { z-index:700; pointer-events:none; }
#map.pt-terrain-active > .leaflet-map-pane > .leaflet-popup-pane > .leaflet-popup { pointer-events:auto; }
#terrain3dMap .maplibregl-ctrl-top-right { top:calc(var(--pt-header-height,64px) + 12px); right:calc(var(--sidebar-current-width,0px) + 12px); transition:right .68s cubic-bezier(.22,1,.36,1); }
#terrain3dMap .maplibregl-ctrl-bottom-right { right:var(--sidebar-current-width,0px); transition:right .68s cubic-bezier(.22,1,.36,1); }
#terrain3dMap .maplibregl-ctrl-group { background:rgba(17,30,38,.93); border:1px solid rgba(148,163,184,.22); border-radius:10px; box-shadow:none; }
#terrain3dMap .maplibregl-ctrl-group button { width:32px; height:32px; }
#terrain3dMap .maplibregl-ctrl-group button+button { border-top:1px solid rgba(148,163,184,.18); }
#terrain3dMap .maplibregl-ctrl-icon { filter:invert(1); }
#terrain3dMap .maplibregl-ctrl-attrib { font-size:9px; line-height:14px; padding:0 4px; background:rgba(255,255,255,.82); }
#terrain3dMap .maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin:0; }
@media (max-width:699px), (max-height:500px) and (max-width:1024px) {
  #terrain3dMap .maplibregl-ctrl-top-right { top:calc(var(--pt-safe-top,0px) + 90px); right:16px; }
  #terrain3dMap .maplibregl-ctrl-attrib { font-size:8px; line-height:12px; }
}
