.map-view-hidden { display: none !important; }
body.mode-3d #map.map-view-hidden { display: block !important; position: absolute; left: -20000px; width: var(--map3d-leaflet-width); visibility: hidden; pointer-events: none; }
#map3d { flex: 1; min-width: 0; height: 100vh; position: relative; z-index: 1; background: var(--map-bg); }
#map3d-surface { position: absolute; inset: 0; font-family: inherit; }
.map3d-switch { display: flex; gap: 6px; }
#map3d-controls > .map3d-switch, #map3d-status, #map3d-options { margin-left: 12px; margin-right: 12px; }
#map3d-controls button { padding: 9px 12px; background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 12px; cursor: pointer; }
.map3d-switch button { flex: 1; }
#map3d-controls button[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
#map3d-controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#map3d-controls button:disabled { opacity: .6; cursor: wait; }
#map3d-status { font-size: 11px; color: var(--text-muted); line-height: 1.5; margin: 8px 0; }
#map3d-options { border: 1px solid var(--border); border-radius: 8px; padding: 10px; color: var(--text-secondary); font-size: 12px; }
#map3d-options label { display: flex; gap: 8px; align-items: center; margin: 9px 0; }
#map3d-options input { accent-color: var(--accent); }
#map3d-options small { display: block; margin-top: 10px; color: var(--text-faint); line-height: 1.5; }
#map3d .maplibregl-popup-content { background: var(--popup-bg); color: var(--popup-text); border: 1px solid var(--border); border-radius: 10px; max-height: 260px; overflow: auto; }
#map3d .maplibregl-popup-close-button { color: var(--popup-text); }
#map3d .maplibregl-ctrl-group { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm); }
#map3d .maplibregl-ctrl-group button + button { border-top-color: var(--border); }
#map3d .maplibregl-ctrl-group button:hover { background-color: var(--accent-bg); }
body:not(.light-mode) #map3d .maplibregl-ctrl-icon { filter: invert(1); }
#map3d .maplibregl-ctrl-attrib { background: var(--overlay-bg); color: var(--text-secondary); }
#map3d .maplibregl-ctrl-attrib a { color: var(--text-secondary); }
#map3d .maplibregl-ctrl-scale { background: var(--overlay-bg); color: var(--text-secondary); border-color: var(--text-muted); }
#map3d .maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--popup-bg); }
#map3d .maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--popup-bg); }
.map3d-popup { border-collapse: collapse; font: inherit; font-size: 12px; }
.map3d-popup td { padding: 5px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.map3d-popup td:first-child { font-weight: 600; }
#map3d .maplibregl-ctrl-top-right { top: 65px; }
#map3d .maplibregl-canvas-container { cursor: grab; }
#map3d .maplibregl-canvas-container:active { cursor: grabbing; }
#map3d .maplibregl-canvas-container:active .maplibregl-canvas { cursor: grabbing !important; }
#map3d .maplibregl-canvas.map3d-dragging { cursor: grabbing !important; }
#map3d .maplibregl-ctrl-group button { width: 44px; height: 44px; }
.map3d-home button { color: var(--text-secondary); font: inherit; font-size: 22px; }
.map3d-home button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 768px) {
    #map3d .maplibregl-ctrl-top-right { top: 180px; left: 0; right: auto; }
    #map3d .maplibregl-ctrl-top-right .maplibregl-ctrl { float: left; }
    #map3d .maplibregl-ctrl-top-left { top: 180px; }
    #map3d .maplibregl-ctrl-attrib { max-width: 240px; }
    body.mode-3d:has(.sidebar.oculta) .sidebar-backdrop { display: none; }
}
