/* Compact map controls and a drawer that pushes the map surface sideways. */
#map-screen {--header-height:62px;--drawer-width:min(220px,74vw);overflow:hidden}
#map-stage {position:absolute;top:var(--header-height);bottom:0;left:0;width:100%;transition:transform .22s ease}
#map-screen.drawer-open #map-stage {transform:translateX(var(--drawer-width))}
#map-screen #controls {top:var(--header-height)!important;bottom:0;left:0;width:var(--drawer-width);max-height:none!important;margin:0;border:0;border-right:1px solid var(--line);border-radius:0;display:flex;flex-direction:column;overflow:hidden;background:#fff;transform:translateX(-100%);visibility:hidden;transition:transform .22s ease,visibility .22s;z-index:4}
#map-screen.drawer-open #controls {transform:translateX(0);visibility:visible}
.drawer-heading {flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:#fff;z-index:1;border-bottom:1px solid var(--line);font:600 15px var(--heading)}
#close-controls {width:34px;height:34px;padding:0;font-size:25px;border:0;background:transparent}
#controls section {flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 14px 14px}
#controls .direction-settings {display:flex;flex-direction:column}
#controls #basemap {width:100%}
#toggle-controls {position:absolute;top:12px;left:12px;width:38px;height:38px;padding:0;display:grid;place-items:center;font-size:23px;line-height:1;border:1px solid #c6d9d5;border-radius:7px;background:#fffffff5;color:var(--ink);box-shadow:0 2px 8px #11292d18;z-index:3}
.drawer-open #toggle-controls {visibility:hidden}
#map-stage .maplibregl-ctrl-top-right {top:2px!important;right:2px}
#map-stage #show-beaches {top:82px!important;right:12px;padding:8px 9px;font-size:11px;gap:8px}
#map-stage #beach-error {top:125px;right:12px}
#map-stage #loading {inset:0}
#map-stage #error {bottom:145px}
#map-stage .maplibregl-ctrl-bottom-right {bottom:0;left:auto;right:4px;z-index:3}
#map-stage .maplibregl-ctrl-attrib {max-width:calc(100vw - 16px)}
#map-bottom {position:absolute;bottom:0;left:10px;right:10px;max-width:800px;margin:auto;z-index:3;padding:5px 8px 4px;border-radius:8px 8px 0 0;background:#fffffff0;box-shadow:0 3px 15px #11292d20}
#map-bottom #timeline {position:relative;inset:auto;max-width:none;width:100%;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
#map-bottom .time-controls {align-items:flex-start;gap:8px}
#map-bottom #play {width:30px;height:30px;font-size:12px;margin-top:0}
#map-bottom .time-track {padding-top:0}
#map-bottom #time {height:18px}
#map-bottom #time-dates {height:27px;font-size:9px;line-height:11px}
#map-bottom .time-date {top:2px;text-align:center}
#map-bottom .time-date small {display:block;font-size:8px;line-height:10px;font-weight:400;opacity:.85}
#map-bottom .time-date::before {top:-3px;height:3px}
#map-bottom .time-selected {color:var(--aqua-dark);font-weight:700}
#map-bottom #frame-loading {position:absolute;bottom:100%;right:0;font-size:9px;background:#fffffff0;padding:1px 4px;border-radius:3px}
#map-bottom #legend {position:relative;inset:auto;transform:none;width:100%;max-width:none;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent}
#map-bottom #ramp {height:17px;border-radius:3px}
#map-bottom #legend>div:first-child {position:absolute;inset:0 0 auto;height:17px;margin:0;display:flex;justify-content:center;align-items:center;font-size:10px;line-height:1;color:#fff;text-shadow:0 1px 3px #000,0 0 3px #0009}
#map-bottom #legend-title {font-weight:600}
#map-bottom .ticks {margin-top:1px;font-size:8px;line-height:11px}
#controls #wind-key {margin-top:14px;font-size:10px}
#controls #wind-key-note {font-size:10px;margin:8px 0}
#controls .wind-symbol {width:48px}
#controls .wind-references {gap:4px}
#controls .wind-references>div {gap:3px;font-size:9px}
@media(max-width:760px){
  #map-screen {--header-height:108px}
  #map-bottom {left:8px;right:8px;padding:4px 7px 3px;bottom:0}
  #map-bottom #ramp,#map-bottom #legend>div:first-child {height:16px}
  #map-bottom #legend-title {font-size:9px}
}
@media(prefers-reduced-motion:reduce){#map-stage,#map-screen #controls{transition:none}}
/* The source list stays at the bottom while options scroll independently. */
#map-sources {flex-shrink:0;padding:7px 12px max(7px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#f5f8f7;font-size:8px;line-height:11px;color:var(--muted);overflow-wrap:anywhere}
#map-sources>strong {display:block;margin-bottom:2px;font-size:8px;font-weight:500}
#map-sources .maplibregl-ctrl-attrib {float:none;clear:none;margin:0;padding:0;max-width:none;background:transparent;color:inherit;font:inherit}
#map-sources .maplibregl-ctrl-attrib a {display:inline;margin:0;color:inherit;font:inherit;text-decoration:underline}
#controls .wind-references {flex-direction:column;gap:4px}
#map-bottom {padding-bottom:max(4px,env(safe-area-inset-bottom))}

#controls #motion-control {margin-bottom:4px}
#controls .direction-settings>div:first-child>label {margin-top:0}
#controls:not(:has(#motion:checked)) .direction-settings {display:none}
