/* Friesach design study. Map navigation and data handling remain in the base app. */
:root { --red:#bd263a; --red-soft:#fce9ed; }
body { font-family:'Segoe UI',system-ui,sans-serif; }
main { grid-template-columns:minmax(340px,390px) minmax(0,1fr); }
aside { background:#f6f8fa; border-right:1px solid #d7e1e5; }
.friesach-brand { display:flex; align-items:center; gap:15px; padding:20px; background:#102e39; color:white; border-top:5px solid #c52940; }
.friesach-brand img { width:108px; height:42px; object-fit:contain; background:white; border-radius:4px; padding:5px; }
.friesach-brand strong { display:block; font-size:18px; font-weight:750; letter-spacing:.06em; }
.friesach-brand small { display:block; margin-top:4px; font-size:10px; color:#b9d4dc; letter-spacing:.14em; text-transform:uppercase; }
.sidebar-tabs { padding:10px 12px; gap:6px; border:0; background:#102e39; }
.sidebar-tab { min-height:38px; margin:0; border:0; border-radius:5px; background:#21424f; color:#c2d9e0; font-size:11px; }
.sidebar-tab[aria-selected=true] { background:#fff; color:#102e39; box-shadow:none; }
.sidebar-tab::before,.sidebar-tab::after { display:none; }
.sidebar-tab-icon { width:18px; height:18px; }
.fire-logo-crop img { width:100%; height:100%; object-fit:contain; position:static; }
.sidebar-head { padding:20px 18px 14px; background:#fff; border:0; }
h1 { font-size:20px; color:#102e39; }
h1 span { font-size:11px; color:#647e89; }
.summary { gap:0; padding-top:18px; }
.stat { padding:2px 12px; border:0; border-right:1px solid #d9e4e8; border-radius:0; background:transparent; }
.stat:first-child { padding-left:0; }
.stat:last-child { border:0; }
.stat b { font-size:27px; color:#102e39; }
.stat:first-child b { color:#bd263a; }
.stat span { font-size:9px; color:#67808a; }
.filters { margin:0; padding:16px 18px; gap:10px; background:#eaf0f3; border:0; }
.filter-field { display:flex; flex-direction:column; gap:5px; min-width:0; color:#435e6a; font-size:10px; font-weight:700; letter-spacing:.03em; }
.filter-field.search-field { grid-column:1/-1; }
.filters .search-wrap { grid-column:auto; background:#fff; border:1px solid #ccdade; border-radius:5px; }
.filters input { font-size:13px; min-height:40px; }
.filters select { width:100%; min-height:40px; background:#fff; border:1px solid #ccdade; border-radius:5px; color:#102e39; font-size:12px; }
.filters input:focus,.filters select:focus { outline:2px solid #127386; outline-offset:2px; }
.result-head { padding:14px 18px 10px; color:#536e79; font-size:10px; letter-spacing:.08em; }
#list { padding:0 12px 14px; }
.card { border:1px solid #dce6ea; border-radius:5px; margin-bottom:9px; padding:14px; background:#fff; box-shadow:none; border-left:4px solid #97afb9; }
.card:has(.status.running),.card:has(.status.open) { border-left-color:#c52940; }
.card.active { border-color:#127386; box-shadow:inset 4px 0 #127386; }
.card h2 { font-size:15px; color:#102e39; }
.card .time { color:#607b86; font-size:11px; }
.status { border-radius:4px; letter-spacing:.04em; }
.deps .dep { border-radius:3px; background:#edf3f5; color:#395b69; }
.map-wrap { background:#eaf1f1; }
.map-caption { position:absolute; left:24px; top:24px; z-index:4; pointer-events:none; color:#214852; }
.map-caption b { display:block; font-size:25px; font-weight:300; letter-spacing:.14em; }
.map-caption small { display:block; font-size:9px; margin-top:6px; text-transform:uppercase; letter-spacing:.18em; }
.municipality { fill:#ccdedd; stroke:#f4f8f7; }
.municipality:hover { fill:#b2cccb; }
.municipality.running,.municipality.running:hover { fill:#bc2941; }
.district-boundary { stroke:#738f96; }
.station .active-beacon,.station .running-pin-accent { display:none!important; }
.station.running .running-pin-body { fill:#bd263a; stroke:#fff; stroke-width:1.6; animation:friesachSignal 1.8s ease-in-out infinite; }
.station .done-pin-body { fill:#214b5a; stroke:#fff; }
.station.selected-incident .pin-body { fill:#e8991a; }
.station .done-icon { filter:none!important; }
.station.running .base-dot { fill:#bd263a; }
.legend { border:1px solid #cedfe1; border-radius:5px; box-shadow:0 6px 20px #183c4812; }
.legend-tabs { border-radius:5px 5px 0 0; background:#102e39; padding:5px; gap:3px; }
.legend-tab { border:0; border-radius:3px; color:#bed5dc; background:transparent; margin:0!important; padding:7px!important; box-shadow:none!important; }
.legend-tab[aria-selected=true] { color:#102e39; background:white; }
.legend .running { background:#bd263a; border-radius:2px; }
.legend .done { background:linear-gradient(90deg,#648b91,#dfebeb); border-radius:2px; }
.legend .none { background:#ccdedd; }
.event-tabs { padding:8px 12px; gap:3px; }
.event-tab { border-radius:4px; }
.settings-panel,.parameter-help { border-radius:6px; box-shadow:0 10px 35px #102e3930; }
.map-credit img { opacity:.85; }
@keyframes friesachSignal { 50% { stroke:#ffa9b7; filter:drop-shadow(0 0 5px #c52940); } }
@media(prefers-reduced-motion:reduce) { .station.running .running-pin-body { animation:none; } }
main.ui-dark .sidebar-head, main.ui-dark .filters { background:#17333f; }
main.ui-dark h1,main.ui-dark .stat b { color:#edf5f7; }
main.ui-dark .card h2 { color:#edf5f7; }
main.ui-dark .filter-field { color:#a9c6ce; }
main.ui-dark .filters select,main.ui-dark .filters .search-wrap { background:#102b36; color:#fff; border-color:#3b5963; }
@media(max-width:900px) { .map-caption { top:12px; left:16px; } .map-caption b { font-size:19px; } }
@media(max-width:700px) { main { grid-template-columns:minmax(0,1fr); } .friesach-brand { padding:12px 16px; } .friesach-brand img { width:90px; height:33px; } .friesach-brand strong { font-size:15px; } .map-caption { top:12px; left:12px; } .map-caption b { font-size:15px; } .map-caption small { font-size:7px; } }
main.preview-mode .map-caption { top:80px; }

.filters .search-wrap input { display:block; border:0; background:transparent; width:100%; padding-left:34px; }
#incidentMap.dragging .running-pin-body, #incidentMap.zooming .running-pin-body, #incidentMap.flying .running-pin-body, main.list-scrolling .running-pin-body { animation-play-state:paused!important; filter:none!important; }

/* Revision 2: neutral interface, transparent logo placement, blue technical calls. */
.friesach-brand { background:#fff; color:#252a2d; border-top-color:#c52940; }
.friesach-brand img { background:transparent; padding:0; border-radius:0; width:130px; height:46px; }
.friesach-brand small { color:#777d80; }
.sidebar-tabs { background:#f4f4f3; border-bottom:1px solid #dedfdd; }
.sidebar-tab { background:#e7e8e6; color:#606765; }
.sidebar-tab[aria-selected=true] { background:#fff; color:#282d2b; box-shadow:inset 0 -3px #c52940; }
.map-wrap { background:#f3f3f0; }
.map-caption { color:#666d69; }
.municipality { fill:#d6dbd7; stroke:#f8faf7; }
.municipality:hover { fill:#bcc6bf; }
.district-boundary { stroke:#88968d; }
.legend-tabs { background:#eeefec; }
.legend-tab { color:#646b65; }
.legend-tab[aria-selected=true] { color:#252c27; box-shadow:inset 0 -2px #c52940!important; }
.filters { background:#eeefed; }
.card h2,h1,.stat b { color:#292f2c; }
.station.technical.running .running-pin-body { fill:#1775c5; animation-name:friesachTechnicalSignal; }
.station.technical.running .base-dot { fill:#1775c5; filter:drop-shadow(0 0 3px #1775c580); }
.station.technical .done-pin-body { fill:#457da8; }
.station.technical.selected-incident .pin-body { fill:#1775c5; stroke:#ffc359; }
.fire-logo-crop { background:#c52940; mask:url('./friesach-brand.svg') center/contain no-repeat; }
.fire-logo-crop img { visibility:hidden; }
@keyframes friesachTechnicalSignal { 50% { stroke:#badfff; filter:drop-shadow(0 0 5px #1775c5); } }
main.ui-dark .friesach-brand { background:#242a28; color:#f4f5f3; }
main.ui-dark .friesach-brand small { color:#b7c1bb; }
main.ui-dark .sidebar-tabs { background:#303733; border-color:#475149; }
@media(max-width:700px) { .friesach-brand img { width:118px; height:42px; } }

/* Revision 3: continuous incident journal and warm grey map. */
.map-wrap { background:#faf9f6; }
.municipality { fill:#dedbd5; stroke:#faf9f6; }
.municipality:hover { fill:#c9c4ba; }
.district-boundary { stroke:#938c81; stroke-opacity:.65; }
.legend .none { background:#dedbd5; }
.legend .done { background:linear-gradient(90deg,#a49b8b,#eeeae2); }
#list { padding:0 0 20px; background:#fff; }
#list > li { contain-intrinsic-size:auto 122px; }
.card { display:grid; grid-template-columns:66px minmax(0,1fr); gap:15px; margin:0; padding:17px 18px; border:0; border-bottom:1px solid #e9e6e0; border-radius:0; background:#fff; box-shadow:none; }
.card:has(.status.open),.card:has(.status.running) { border-left:0; background:#fffaf9; }
.card:hover,.card:focus-visible { transform:none; background:#f5f3ee; outline:2px solid #b3a99b; outline-offset:-2px; }
.card.active { border:0; border-bottom:1px solid #d9c7a6; background:#fff3dd; box-shadow:inset 3px 0 #c78b25; }
.row-clock { align-self:stretch; display:flex; flex-direction:column; align-items:flex-start; padding:2px 13px 0 0; border-right:1px solid #e7e1d7; color:#575149; }
.row-clock strong { font-size:20px; font-weight:650; font-variant-numeric:tabular-nums; letter-spacing:-.04em; }
.row-clock small { margin-top:5px; font-size:10px; color:#918678; }
.card:has(.status.open) .row-clock strong { color:#bd263a; }
.row-body { min-width:0; }
.card .card-top { display:flex; align-items:center; gap:8px; justify-content:space-between; min-height:18px; }
.card .incident-title-row h2 { margin:5px 0 4px; font-size:14px; }
.card .meta { font-size:11px; color:#746b60; }
.card .status { background:transparent; padding:0; font-size:9px; letter-spacing:.09em; }
.card .status::before { content:'●'; margin-right:5px; font-size:7px; }
.card .deps { gap:0; margin-top:7px; }
.card .deps .dep { padding:0; border:0; background:transparent; font-size:10px; color:#8b8174; }
.card .deps .dep + .dep::before { content:' · '; white-space:pre; }
.row-timeline { margin-top:5px; font-size:9px; color:#94897a; }
.row-timeline:empty { display:none; }
.result-head { background:#f1eee8; color:#827666; }
main.ui-dark #list { background:#18211d; }
main.ui-dark .card { background:#18211d; border-bottom-color:#3a403b; }
main.ui-dark .card:has(.status.open) { background:#29221f; }
main.ui-dark .row-clock { color:#d8d4cb; border-color:#4c4a42; }
@media(max-width:430px) { .card { grid-template-columns:56px minmax(0,1fr); gap:12px; padding:14px 12px; } .row-clock strong { font-size:18px; } }

/* Revision 4: incident categories on the map and expandable row details. */
.municipality.running.technical,.municipality.running.technical:hover { fill:#2782c5; }
.municipality.running.fire,.municipality.running.fire:hover { fill:#bd263a; }
.station.collision.running .running-pin-body { fill:#1775c5; animation-name:friesachTechnicalSignal; }
.station.collision.running .base-dot { fill:#1775c5; }
.legend .running { background:linear-gradient(90deg,#bd263a 0 50%,#2782c5 50%); }
.legend .fire-key { background:#bd263a; border-radius:2px; } .legend .technical-key { background:#2782c5; border-radius:2px; } .legend .idle { background:#dedbd5; }
.quick-status { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,1fr); gap:4px; padding:4px; margin-top:3px; border:1px solid #d9d4cb; border-radius:5px; background:#e5e2dc; }
.quick-status button { min-height:34px; border:0; border-radius:3px; background:transparent; color:#766d61; font-size:12px; cursor:pointer; }
.quick-status button[aria-pressed=true] { background:white; color:#38332b; font-weight:700; box-shadow:0 1px 4px #55432c18; }
.quick-status button[data-status=open][aria-pressed=true] { color:#b32238; }
.quick-status button:focus-visible { outline:2px solid #946d2f; outline-offset:1px; }
.filters select[hidden] { display:none!important; }
.municipality.outside-district { opacity:.22; }
main.ui-dark .quick-status { background:#303832; border-color:#465048; }
main.ui-dark .quick-status button { color:#c9d1ca; }
main.ui-dark .quick-status button[aria-pressed=true] { background:#49554c; color:#fff; }
.map-caption { top:96px; max-width:calc(100% - 48px); } .map-caption b { font-size:20px; letter-spacing:.08em; } @media(max-width:700px) { .map-caption { top:82px; } .map-caption b { font-size:15px; } }
.station .status-pin { scale:var(--district-pin-scale,1); transform-origin:0 0; }
.station.done.fire .base-dot { fill:#bd263a; stroke:#fff; }
.station.done.fire .done-pin-body { fill:#bd263a; }
.station.done.technical .base-dot,.station.done.collision .base-dot { fill:#1775c5; stroke:#fff; }
.station.done.technical .done-pin-body,.station.done.collision .done-pin-body { fill:#1775c5; }
.station.running .base-dot, .station.done.is-hovered .base-dot, .station.selected-incident .base-dot { visibility:hidden; }
.station-count { cursor:pointer; }
.station-count circle { fill:#28353d; stroke:#fff; stroke-width:1; }
.station-count text { fill:#fff; stroke:none; font-family:'Segoe UI',sans-serif; font-size:6px; font-weight:700; pointer-events:none; }
.station:focus-visible .base-dot { stroke:#d09a3c!important; stroke-width:2!important; }
#stationIncidents { width:min(420px,calc(100vw - 32px)); max-height:80dvh; padding:0; border:1px solid #d7d2c9; border-radius:9px; color:#302e29; background:#fff; box-shadow:0 20px 80px #18232344; }
#stationIncidents::backdrop { background:#13242b55; }
#stationIncidents header { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:20px; border-bottom:1px solid #e9e3d9; background:#f6f3ed; }
#stationIncidents header small { font-size:11px; color:#827767; }
#stationIncidents h2 { font-size:18px; margin:5px 0 0; }
#closeStationIncidents { flex:none; width:34px; height:34px; border:1px solid #d7d2c9; border-radius:4px; background:white; font-size:24px; cursor:pointer; }
.station-event { display:grid; grid-template-columns:1fr auto; gap:6px 12px; width:100%; padding:17px 20px; border:0; border-bottom:1px solid #ece7de; background:white; color:#302e29; text-align:left; cursor:pointer; }
.station-event small { grid-column:1/-1; color:#877c6c; font-size:11px; }
.station-event strong { font-size:14px; }
.station-event span { color:#877c6c; font-size:10px; }
.station-event:hover,.station-event:focus-visible { background:#fff1d8; outline:2px solid #bc8c39; outline-offset:-2px; }
.view-actions { grid-column:1/-1; display:flex; justify-content:space-between; gap:10px; }
.view-actions button { border:0; background:transparent; color:#756958; font-size:10px; padding:5px 0; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
#viewFeedback { grid-column:1/-1; font-size:10px; color:#6e7c62; }
#viewFeedback:empty { display:none; }
#viewLinkFallback { grid-column:1/-1; padding-left:8px; font-size:11px; }
#mapFreshness { position:absolute; bottom:12px; right:48px; z-index:6; padding:7px 10px; border:1px solid #d6ded2; border-radius:4px; background:#f8fbf6ee; color:#4d7050; font-size:10px; pointer-events:none; }
#mapFreshness.stale { border-color:#e6b35e; color:#98600f; background:#fff4deee; }
.card.new-incident { animation:newIncidentNotice 2s ease-out 3; box-shadow:inset 3px 0 #c89732; }
@keyframes newIncidentNotice { 0%,100% { background:#fff; } 50% { background:#fff0cb; } }
@media(prefers-reduced-motion:reduce) { .card.new-incident { animation:none; background:#fff0cb; } }

/* Phone layout: one scrollable page instead of two cramped fixed-height panes. */
@media(max-width:800px) {
 html,body { height:auto; min-height:100%; overflow-x:hidden; overflow-y:auto; }
 .app { height:auto; min-height:100svh; overflow:visible; }
 main { display:flex; flex-direction:column; height:auto; min-height:100svh; }
 .map-wrap { order:1; height:58svh; min-height:360px; max-height:580px; border-bottom:1px solid #dcd8d0; }
 .map-frame-shell { inset:104px 0 40px; }
 aside { order:2; height:auto; min-height:0; flex:none; overflow:visible; box-shadow:none; }
 #list { flex:none; height:auto; max-height:none; overflow:visible; padding-bottom:24px; }
 #list > li { content-visibility:visible; }
 .map-tools { top:8px; left:8px; right:8px; width:auto; align-items:stretch; }
 .legend { width:100%; max-width:none; opacity:1; }
 .legend-tabs { display:flex; flex-wrap:wrap; gap:3px; }
 .legend-tab { flex:1 1 auto; min-height:30px; font-size:10px; white-space:normal; }
 .legend-primary { flex-wrap:wrap; padding:7px 9px; gap:6px 10px; font-size:9px; }
 .legend-primary,.weather-scale,.gauge-scale,.wildfire-scale,.outage-scale,.alert-scale { font-size:9px; }
 .map-caption,main.preview-mode .map-caption { top:84px; left:12px; max-width:calc(100% - 24px); }
 .map-caption b { font-size:15px; letter-spacing:.04em; }
 .map-caption small { display:none; }
 .map-credit { width:100px; bottom:5px; left:8px; }
 .map-credit img { max-height:32px; }
 #mapFreshness { bottom:9px; right:45px; max-width:calc(100% - 158px); padding:5px 6px; font-size:9px; }
 .friesach-brand { padding:14px 16px; }
 .sidebar-tabs { padding:8px 12px; grid-template-columns:1fr 1fr 40px; }
 .close-list { display:none!important; }
 .sidebar-tab { min-height:42px; font-size:12px; }
 .sidebar-tab-label { display:inline!important; }
 .sidebar-head { padding:14px 16px 12px; }
 h1 { font-size:18px; padding:0; }
 h1 span { display:block; font-size:10px; margin-top:4px; }
 .summary { width:100%; margin-top:8px; padding-top:8px; grid-template-columns:1fr 1fr 1.45fr; }
 .stat { padding:0 10px; min-height:36px; overflow:visible; }
 .stat b,.stat.compact b { font-size:23px; }
 .stat span { font-size:9px; line-height:1.2; }
 .filters { grid-template-columns:minmax(0,1fr) minmax(0,1fr); padding:14px 16px; gap:10px; }
 .filter-field.search-field { grid-column:1/-1; }
 .filter-field { font-size:10px; }
 .filters input,.filters select { min-height:44px; font-size:16px; }
 .quick-status button { min-height:42px; font-size:13px; }
 .view-actions { flex-wrap:wrap; }
 .view-actions button { min-height:36px; font-size:11px; }
 .result-head { font-size:10px; padding:13px 16px; }
 .card { padding:15px 16px; grid-template-columns:62px minmax(0,1fr); gap:13px; }
 .row-clock strong { font-size:20px; }
 .card .incident-title-row h2 { font-size:15px; }
 .card .meta { font-size:12px; }
 .parameter-help { width:min(360px,calc(100vw - 24px)); max-height:65svh; height:auto; }
 main.preview-mode .map-wrap,main.list-hidden .map-wrap { height:100svh; min-height:360px; max-height:none; }
 main.preview-mode { min-height:100svh; }
 main.preview-mode aside { display:none; }
 #stationIncidents { max-height:85svh; }
}
@media(max-width:800px) and (orientation:landscape) {
 .map-wrap { height:85svh; min-height:300px; }
}

/* Give the permanently visible legend its own layout space on every screen. */
.map-wrap { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto minmax(0,1fr); padding-bottom:43px; }
.map-tools,main.list-hidden .map-tools { position:relative; inset:auto; grid-column:1; grid-row:1; width:auto; margin:10px 12px 0; align-items:flex-end; }
.map-caption,main.preview-mode .map-caption { position:relative; inset:auto; grid-column:1; grid-row:2; margin:10px 24px 0; max-width:calc(100% - 48px); }
.map-caption b { font-size:19px; }
.map-caption small { font-size:8px; }
.map-frame-shell { position:relative; inset:auto; grid-column:1; grid-row:3; width:100%; height:100%; min-height:0; }

/* Keep the header logo on phones, and the map logo in map-only views. */
@media (max-width:800px) {
 main:not(.list-hidden):not(.preview-mode) .map-credit { display:none; }
 main:not(.list-hidden):not(.preview-mode) #mapFreshness { max-width:calc(100% - 55px); }
}

.outage-marker.unplanned .outage-dot { fill:#ffd43b; stroke:#6f530c; }
.outage-marker.unplanned.selected .outage-dot { stroke:#17202b; }
.outage-bolt { fill:#352705; pointer-events:none; }
.outage-scale .unplanned { background:#ffd43b; border-color:#80601b; }
.outage-card:not(.planned) { --outage-color:#ffd43b; }
.outage-card:not(.planned) .outage-card-icon { color:#352705; }
.outage-area.unplanned { fill:#ffd43b42; stroke:#a67710; }
.outage-marker.unplanned .outage-halo { fill:none; stroke:#b88408; stroke-width:2; transform-box:fill-box; transform-origin:center; animation:friesachMapPulse 1.75s ease-out infinite; pointer-events:none; }
.station .active-signal-ring { display:none; pointer-events:none; }
.station.running .active-signal-ring { display:block; fill:none; stroke:#bd263a; stroke-width:2.5; transform-box:fill-box; transform-origin:center; animation:friesachMapPulse 1.75s ease-out infinite; }
.station.running:is(.technical,.collision) .active-signal-ring { stroke:#1775c5; }
@keyframes friesachMapPulse {
 0% { transform:scale(1); opacity:.9; }
 80%,100% { transform:scale(1.7); opacity:0; }
}
#incidentMap:is(.dragging,.zooming,.flying) .active-signal-ring, main.list-scrolling .active-signal-ring { visibility:hidden; animation-play-state:paused; }
@media (prefers-reduced-motion:reduce) {
 .station.running .active-signal-ring, .outage-marker.unplanned .outage-halo { animation:none; opacity:.65; }
}
@media(max-width:800px) {
 .map-wrap { min-height:390px; height:62svh; }
 .map-tools,main.list-hidden .map-tools { margin:8px 8px 0; align-items:stretch; }
 .map-caption,main.preview-mode .map-caption { margin:8px 12px 0; max-width:calc(100% - 24px); }
 .map-caption b { font-size:15px; }
 .map-frame-shell { inset:auto; }
}

/* Keep the legend readable while leaving it in its own row above the map. */
.map-tools .legend { width:min(620px,100%); max-width:100%; }
.legend .legend-tabs { flex-wrap:wrap; gap:4px; }
.legend .legend-tab {
 flex:1 1 auto; min-height:32px; font-size:12px; line-height:1.25;
 white-space:normal; overflow-wrap:anywhere; text-overflow:clip;
}
.legend .legend-panel {
 max-width:100%; flex-wrap:wrap; gap:7px 12px; padding:9px 10px;
 font-size:13px; line-height:1.3;
}
.legend .legend-panel > span { min-width:0; max-width:100%; white-space:normal; }
.legend .legend-panel i { flex:none; width:13px; height:13px; }
.legend .support-key-rings b { width:16px; height:16px; font-size:9px; }
.legend .alert-scale img { flex:none; width:16px; height:16px; }
@media(max-width:800px) {
 .map-tools .legend { width:100%; }
 .legend .legend-tab { min-height:34px; }
 .legend .legend-panel { gap:6px 10px; }
}

/* In a short desktop window, the header and filters scroll with the list. */
@media (min-width:801px) and (max-height:650px) {
 html:not(.compact-page) .app { min-height:0; }
 main:not(.compact-mode):not(.list-hidden) aside { overflow-y:auto; }
 main:not(.compact-mode):not(.list-hidden) aside > * { flex-shrink:0; }
 main:not(.compact-mode):not(.list-hidden) #list { flex:none; overflow:visible; }
}

@media (max-width:800px) {
 html.compact-page main #list { flex:1 1 auto; overflow:auto; }
 html.compact-page main aside { overflow:hidden; }
 html:not(.compact-page) main:not(.list-hidden) #list { overscroll-behavior:auto; }
}

/* Only the map-only embedding uses this compact, full-height layout. */
.app:has(> main.preview-mode) { height:100dvh; min-height:0; overflow:hidden; }
.app > main.preview-mode { height:100%; min-height:0; }
main.preview-mode .map-wrap {
 height:100%; min-height:0; max-height:none;
 grid-template-rows:auto minmax(0,1fr); padding-bottom:32px;
}
main.preview-mode .map-caption { display:none; }
main.preview-mode .map-frame-shell { grid-row:2; }
main.preview-mode .map-tools { margin:4px 6px 0; align-items:flex-end; }
main.preview-mode .map-tools .legend { width:min(490px,100%); }
main.preview-mode .legend .legend-tabs { gap:2px; padding:3px; }
main.preview-mode .legend .legend-tab {
 min-height:23px; padding:4px!important; font-size:9px; line-height:1.15;
}
main.preview-mode .legend .legend-panel {
 gap:4px 8px; padding:5px 7px; font-size:10px; line-height:1.2;
}
main.preview-mode .legend .legend-panel i { width:10px; height:10px; }
main.preview-mode .legend .support-key-rings b { width:13px; height:13px; font-size:8px; }
main.preview-mode .legend .alert-scale img { width:13px; height:13px; }
main.preview-mode .map-credit { width:90px; bottom:4px; left:6px; }
main.preview-mode .map-credit img { max-height:25px; }
main.preview-mode #mapFreshness {
 bottom:5px; right:40px; max-width:calc(100% - 145px);
 padding:4px 5px; font-size:9px;
}
main.preview-mode .map-help { bottom:4px; }
