:root{--bg:#111b20;--panel:#17242b;--raised:#1d2d35;--line:#30434d;--text:#e4eeef;--muted:#94aab3;--accent:#80d3c4;--ink:#092d2b;--error:#f0b8a7;--shadow:0 16px 56px #0005;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--bg);color-scheme:dark}
*{box-sizing:border-box}body{margin:0;color:var(--text);background:var(--bg);min-height:100dvh}body[data-theme=light]{--bg:#edf2f2;--panel:#fbfdfd;--raised:#e7eeee;--line:#c9d6d9;--text:#162f38;--muted:#576c75;--accent:#147568;--ink:#fff;--error:#9c3524;color-scheme:light}button,input,select,textarea{font:inherit}button,.button{border:1px solid var(--line);background:var(--raised);color:var(--text);border-radius:7px;min-height:44px;padding:9px 13px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:5px}button:hover,.button:hover{border-color:var(--accent);background:var(--panel)}button:disabled{opacity:.45;cursor:default}.accent{background:var(--accent);color:var(--ink);border-color:transparent;font-weight:650}.accent:hover{background:var(--accent);filter:brightness(1.1)}button.active{color:var(--accent);border-color:var(--accent);background:color-mix(in srgb,var(--accent) 8%,var(--panel))}input,select,textarea{background:var(--bg);border:1px solid var(--line);color:var(--text);border-radius:6px;min-height:44px;width:100%;padding:9px 10px}input[type=checkbox]{width:18px;min-height:18px;accent-color:var(--accent)}input[type=range]{padding:0;accent-color:var(--accent)}label{display:block;margin:11px 0;color:var(--muted);font-size:12px;font-weight:550}label input,label select,label textarea{display:block;margin-top:5px;color:var(--text)}.check{display:flex;align-items:center;gap:9px;min-height:44px}.check input{margin:0;flex:none}h1,h2,h3,p{margin:0 0 12px}h1{font-size:29px;letter-spacing:-1px;font-weight:600}h2{font-size:17px;font-weight:600;letter-spacing:-.2px}h3{font-size:14px}p{color:var(--muted)}a{color:var(--accent)}:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.topbar{height:72px;display:flex;align-items:center;padding:0 24px;gap:46px;border-bottom:1px solid var(--line);background:var(--panel);position:relative;z-index:1001}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--text);font-size:17px;white-space:nowrap}.brand strong{font-weight:400;color:var(--muted)}.brand svg{width:30px;height:34px;stroke:var(--accent);stroke-width:1.5;fill:none}.topbar nav{display:flex;gap:7px}.topbar nav button{background:none;border-color:transparent;min-width:72px}.topbar nav button.active{border-color:var(--line);background:var(--raised)}.header-actions{margin-left:auto;display:flex;gap:8px}.header-actions button{border-color:transparent}.header-actions .accent{border-color:var(--accent)}#queue-badge:not(:empty){padding:1px 5px;border-radius:8px;background:var(--ink);color:var(--accent);font-size:10px}#map-workspace{height:calc(100dvh - 72px);display:grid;grid-template-columns:280px minmax(200px,1fr) 290px;grid-template-rows:minmax(0,1fr) 144px}.panel{background:var(--panel);padding:20px 18px;overflow:auto;scrollbar-width:thin}.panel:first-child{border-right:1px solid var(--line)}#inspector{border-left:1px solid var(--line)}.panel-tabs{display:flex;border-bottom:1px solid var(--line);gap:3px;margin:-5px -3px 22px}.panel-tabs button{background:none;border:0;padding:8px 7px;border-bottom:2px solid transparent;border-radius:0;flex:1;font-size:12px}.panel-tabs button.active{border-bottom-color:var(--accent)}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.section-heading h1{font-size:19px;margin:0;letter-spacing:-.4px}.section-heading h2{margin:0}.section-heading button{padding:3px 10px}.muted,.hint{color:var(--muted)}.hint{font-size:11px;line-height:1.7;margin:14px 0}.button-row{display:flex;gap:7px;margin:12px 0;flex-wrap:wrap}.button-row button{flex:1;font-size:12px}.track-day{font-size:10px;letter-spacing:1px;text-transform:uppercase;color:var(--muted);margin:24px 0 8px}.track-row{display:flex;gap:10px;padding:12px 8px;border-radius:7px;margin:2px -4px;cursor:pointer;border:1px solid transparent;align-items:flex-start}.track-row:has(input:checked){background:var(--raised);border-color:var(--line)}.track-row input{margin-top:5px}.track-name{font-size:12px;font-weight:600;color:var(--text);word-break:break-word}.track-meta{font-size:10px;color:var(--muted);margin-top:3px;font-variant-numeric:tabular-nums}.map-stage{position:relative;min-width:0;overflow:hidden;background:#dce5e3}#map{position:absolute;inset:0;background:#dce5e3}.map-tools{position:absolute;z-index:500;top:16px;left:16px;right:16px;display:flex;gap:6px;pointer-events:none}.map-tools button{pointer-events:auto;background:var(--panel);box-shadow:0 2px 10px #0002;font-size:12px}.map-tools #locate{margin-left:auto}.map-summary{position:absolute;z-index:500;top:73px;left:19px;padding:5px 9px;background:var(--panel);border:1px solid var(--line);border-radius:5px;display:flex;align-items:center;gap:7px;font-size:10px;max-width:90%}.dot{height:5px;width:5px;border-radius:50%;background:var(--accent);flex:none}.legend{position:absolute;z-index:500;bottom:30px;left:18px;background:var(--panel);padding:12px 14px;width:210px;border:1px solid var(--line);border-radius:8px;box-shadow:0 5px 20px #0002}.legend strong{font-size:11px}.legend small{font-size:9px;color:var(--muted);display:block;margin-top:5px}#legend-ramp{height:6px;border-radius:3px;margin:9px 0 4px;background:linear-gradient(90deg,#440154,#3b528b,#21918c,#5ec962,#fde725)}.legend-limits{display:flex;justify-content:space-between;font-size:10px;font-variant-numeric:tabular-nums}.empty-map{position:absolute;z-index:450;left:50%;top:43%;transform:translate(-50%,-50%);width:min(400px,85%);text-align:center;color:#183b3c}.eyebrow{font-size:10px;letter-spacing:2px;font-weight:700;color:var(--accent);margin-bottom:15px}.empty-map .eyebrow{color:#3b716e}.empty-map h2{font-size:31px;letter-spacing:-1px;font-weight:500}.empty-map p{color:#52716e;font-size:13px;line-height:1.8}.empty-map small{display:block;font-size:10px;color:#65837e;margin-top:14px}.empty-detail{padding-top:75px;text-align:center}.empty-detail>span{font-size:35px;color:var(--muted);display:block;margin-bottom:15px}.empty-detail p{font-size:12px;line-height:1.8}.stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:15px 0}.stat{background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:12px 10px}.stat span{font-size:10px;color:var(--muted);display:block}.stat strong{font-size:19px;font-weight:500;font-variant-numeric:tabular-nums}.detail-id{font-size:11px;font-family:monospace;color:var(--accent);overflow-wrap:anywhere}.chart{width:100%;height:130px;background:var(--bg);border-radius:6px;cursor:crosshair}.mini-table{font-size:11px;width:100%;border-collapse:collapse}.mini-table td,.mini-table th{padding:8px 4px;border-bottom:1px solid var(--line);text-align:left}.mini-table td:last-child{text-align:right;font-variant-numeric:tabular-nums}details{border-top:1px solid var(--line);padding-top:12px;margin-top:14px}summary{cursor:pointer;font-size:12px;min-height:36px}.timeline{grid-column:1/-1;border-top:1px solid var(--line);background:var(--panel);padding:10px 22px;display:flex;gap:14px;align-items:center;flex-wrap:wrap;position:relative}.timeline #scrubber{flex:1;min-width:100px}.timeline label{display:flex;align-items:center;gap:7px;margin:0}.timeline label select{margin:0;width:auto;min-height:38px;font-size:11px}.timeline output{font-size:11px;color:var(--muted);min-width:138px}.timeline button{min-height:38px}.timeline #play{width:42px;color:var(--accent)}#track-timeline{width:100%;height:64px;display:flex;align-items:center;gap:6px;overflow-x:auto;padding:2px}#track-timeline:empty{display:none}.timeline .timeline-strip{flex:1 0 132px;min-width:0;max-width:100%;height:44px;min-height:44px;padding:8px 12px;font-size:12px;justify-content:flex-start}.timeline-track-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.timeline-strip>svg{flex:none;color:var(--accent)}.timeline-strip:focus-visible{outline-offset:-3px}.workspace-page{max-width:1280px;margin:auto;padding:44px 38px 80px}.page-heading{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:28px}.page-heading h1{font-size:37px}.library-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}.library-toolbar label{margin-right:auto}table.data-table{border-collapse:collapse;width:100%;font-size:12px;margin-bottom:32px}table.data-table th{text-align:left;font-size:10px;letter-spacing:1px;color:var(--muted);text-transform:uppercase}table.data-table td,table.data-table th{padding:14px 10px;border-bottom:1px solid var(--line)}table.data-table button{font-size:11px;padding:5px 9px}.status-pill{padding:4px 7px;border-radius:5px;background:var(--raised);font-size:10px;white-space:nowrap}.status-pill.done{color:var(--accent)}.status-pill.failed,.error{color:var(--error)}.job{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:7px;background:var(--panel);padding:14px;margin:8px 0;font-size:12px}.job .grow{flex:1;overflow-wrap:anywhere}.job small{display:block;color:var(--muted)}.export-grid{display:grid;grid-template-columns:320px 1fr;gap:22px}.card{background:var(--panel);border:1px solid var(--line);padding:24px;border-radius:12px;height:fit-content}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.wide{width:100%}#image-preview{width:100%;height:auto;margin:14px 0;max-height:420px;object-fit:contain;background:var(--bg);border:1px solid var(--line)}dialog{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);width:min(620px,calc(100vw - 28px));max-height:90dvh;padding:26px}dialog::backdrop{background:#05151ac2;backdrop-filter:blur(3px)}#login-dialog{width:410px;padding:38px}#login-dialog h1{font-size:31px}.dialog-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.dialog-heading h2{margin:0;font-size:21px}.dialog-heading button{border:0;background:none;font-size:21px}.dropzone{border:1px dashed var(--accent);border-radius:10px;padding:24px;text-align:center;background:var(--bg)}#toast{position:fixed;z-index:5000;bottom:25px;left:50%;transform:translateX(-50%);max-width:90%;padding:12px 20px;background:var(--text);color:var(--bg);border-radius:7px;font-size:12px;box-shadow:var(--shadow);display:none}.area-card{padding:14px 0;border-bottom:1px solid var(--line)}.area-card h3{margin:0}.area-card p{font-size:11px;margin:7px 0}.area-actions{display:flex;gap:5px;flex-wrap:wrap}.area-actions button{font-size:11px;padding:6px 9px}.area-photo{width:100%;max-height:160px;object-fit:cover;margin-top:10px;border-radius:6px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.mobile-nav,.sheet-handle{display:none}.data-canvas{position:absolute;left:0;top:0;pointer-events:none}.leaflet-control-attribution{font-size:9px!important;background:#f3f6f2d9!important}.leaflet-control-scale{margin-left:18px!important;margin-bottom:8px!important}.leaflet-control-zoom{margin-top:122px!important}.leaflet-control-zoom a{height:44px!important;width:44px!important;line-height:44px!important;color:#1c383d!important}body.focus #sheet,body.focus #inspector,body.focus .timeline{display:none}body.focus #map-workspace{grid-template-columns:1fr;grid-template-rows:1fr}body.focus .topbar{display:none}body.focus #map-workspace{height:100dvh}[hidden]{display:none!important}.export-grid .check{font-size:11px}
@media(max-width:1180px){#map-workspace{grid-template-columns:245px minmax(200px,1fr) 255px}.topbar{gap:24px;padding:0 18px}.panel{padding:16px 13px}.map-tools span{display:none}.timeline{gap:9px}.timeline output{min-width:110px}}
@media(max-width:850px){.topbar{height:60px;padding:0 14px;gap:10px}.brand{font-size:14px}.brand svg{width:25px}.brand strong{display:none}.topbar nav{margin-left:auto;gap:0}.topbar nav button{min-width:48px;padding:7px;font-size:11px}.header-actions{margin:0;gap:0}.header-actions span{display:none}.header-actions button{padding:8px 9px}#map-workspace{height:calc(100dvh - 116px);display:block;position:relative}.map-stage{position:absolute;inset:0 0 60px}#sheet,#inspector{position:absolute;z-index:900;bottom:60px;left:0;right:0;border:1px solid var(--line);border-radius:18px 18px 0 0;max-height:75%;height:40%;padding:12px 18px;box-shadow:0 -8px 30px #0002}#inspector{display:none}.sheet-handle{display:flex;background:none;border:0;min-height:22px;width:100%;padding:0}.sheet-handle span{display:block;width:42px;height:4px;background:var(--line);border-radius:4px;margin:0 auto 10px}.panel-tabs{margin:0 0 14px}.panel-tabs button{font-size:12px;min-height:44px}body[data-height=collapsed] #sheet,body[data-height=collapsed] #inspector{height:60px;overflow:hidden}body[data-height=full] #sheet,body[data-height=full] #inspector{height:75%}body[data-sheet=details] #sheet{display:none}body[data-sheet=details] #inspector{display:block}.mobile-nav{display:flex;height:56px;position:fixed;bottom:0;left:0;right:0;z-index:1000;background:var(--panel);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.mobile-nav button{flex:1;border:0;border-radius:0;font-size:11px;background:none}.mobile-nav button.active{color:var(--accent)}.timeline{height:60px;position:absolute;bottom:0;left:0;right:0;padding:8px 12px;gap:8px;flex-wrap:nowrap}.timeline label,.timeline #reset-play,#track-timeline{display:none}.timeline output{font-size:9px;min-width:87px;max-width:100px}.timeline #play{flex:none}.timeline #scrubber{width:100%;min-width:0}.legend{bottom:auto;top:105px;left:14px;width:165px;padding:9px 11px}.legend small{display:none}.legend strong{font-size:10px}.map-summary{top:67px;font-size:9px;left:14px}.map-tools{top:12px;left:12px;right:12px}.map-tools button{min-width:44px}.leaflet-control-zoom{margin-top:106px!important}.leaflet-control-zoom a{height:40px!important;width:40px!important;line-height:40px!important}.empty-map{top:35%;}.empty-map h2{font-size:24px}.empty-map p{font-size:11px}.empty-map .eyebrow{font-size:8px}.workspace-page{padding:28px 18px 80px}.page-heading{display:block}.page-heading h1{font-size:29px}.page-heading button{margin-top:10px}.export-grid{grid-template-columns:1fr}.card{padding:20px}.library-toolbar{gap:7px}.library-toolbar button{font-size:11px}#library-table{overflow:auto}table.data-table{min-width:680px}.job{flex-wrap:wrap}.job .grow{min-width:60%}body:not([data-view=map]) .mobile-nav{display:none}body.focus .mobile-nav{display:none}body.focus .map-stage{bottom:0}.stats-grid{grid-template-columns:repeat(3,1fr)}.empty-detail{padding-top:10px}.hint{font-size:12px}.map-tools #focus-map span{display:inline}}
@media(prefers-reduced-motion:no-preference){dialog[open]{animation:appear .18s ease-out}@keyframes appear{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}}

@media(max-width:850px){.leaflet-control-zoom a{height:44px!important;width:44px!important;line-height:44px!important}.timeline{height:112px;flex-wrap:wrap;align-content:center}.timeline label{display:flex;font-size:10px;min-height:44px}.timeline label select{min-height:44px;max-width:90px}.timeline #reset-play{display:inline-flex;min-height:44px;font-size:10px}.timeline #play{min-height:44px}.map-stage{bottom:112px}#sheet,#inspector{bottom:112px}.timeline #scrubber{flex:1;min-width:120px}.timeline output{max-width:105px}.timeline label:first-of-type{margin-left:2px}.panel-tabs button,.mobile-nav button{min-height:44px}}

@media(max-width:850px){.sheet-handle{min-height:44px}.legend small{display:block}.legend{max-width:180px}}

#development-access{position:fixed;top:0;left:50%;transform:translateX(-50%);z-index:2000;background:var(--panel);color:var(--accent);padding:3px 12px;font-size:11px;border:1px solid var(--line);border-radius:0 0 6px 6px;pointer-events:none}

body.focus #sheet,body.focus #inspector,body.focus .timeline{display:none!important}
.timeline #play{min-width:44px;min-height:44px}

/* Map-first mobile layout. Essential controls remain at least 44px. */
.sheet-controls,.sheet-expand,#playback-toggle,#legend-toggle{display:none}
#playback-options{display:flex;align-items:center;gap:9px}
#basemap-button{white-space:nowrap}
#basemap-feedback:not(:empty){padding:10px;border:1px solid var(--line);border-radius:6px;background:var(--bg)}
@media(max-width:850px){
 body{--timeline-height:60px;--mobile-nav-height:calc(56px + env(safe-area-inset-bottom))}
 body[data-playback-options=open]{--timeline-height:116px}
 #map-workspace{height:calc(100dvh - 60px - var(--mobile-nav-height))}
 .topbar{padding:0 8px;gap:4px}.brand{gap:5px}.brand span{font-size:12px}.topbar nav button{min-width:44px;padding:6px;font-size:11px}.header-actions button{width:44px;min-width:44px;padding:0}
 .map-stage{bottom:var(--timeline-height)}
 .map-tools{left:8px;right:8px;gap:4px}.map-tools button{padding:8px;min-height:44px}.map-tools #focus-map span{display:none}
 .map-tools #focus-map{min-width:44px}.map-tools #basemap-button{font-size:11px}
 .map-summary{left:10px;right:10px;max-width:none;width:fit-content;top:65px}
 .map-summary #map-status{white-space:normal}
 #sheet,#inspector{bottom:var(--timeline-height);height:50%;max-height:calc(100% - var(--timeline-height) - 8px);padding:8px 14px 14px;overscroll-behavior:contain}
 body[data-height=full] #sheet,body[data-height=full] #inspector{height:calc(100% - var(--timeline-height) - 8px);max-height:none}
 body[data-height=collapsed] #sheet,body[data-height=collapsed] #inspector{display:none}
 .sheet-controls{display:flex;position:sticky;top:-8px;background:var(--panel);z-index:2;gap:8px;padding-bottom:6px;border-bottom:1px solid var(--line);margin-bottom:12px}
 .sheet-controls .sheet-handle,.sheet-expand{display:inline-flex;min-height:44px;width:auto;flex:1;font-size:12px;margin:0;padding:8px}
 #sheet .panel-tabs{display:none}
 .mobile-nav{height:var(--mobile-nav-height);padding-bottom:env(safe-area-inset-bottom)}.mobile-nav button{padding:8px 3px;min-width:0}
 .timeline{height:var(--timeline-height);display:flex;flex-wrap:nowrap;padding:8px;gap:6px}
 .timeline #play{width:44px;min-width:44px}.timeline #scrubber{min-width:30px;flex:1}.timeline output{min-width:0;width:76px;flex:none;font-size:9px}
 #playback-toggle{display:inline-flex;min-height:44px;min-width:44px;font-size:10px;padding:8px 5px}
 #playback-options{display:none}
 body[data-playback-options=open] .timeline{flex-wrap:wrap;align-content:center}
 body[data-playback-options=open] #playback-options{display:flex;width:100%;height:44px;justify-content:space-between;gap:8px}
 #playback-options label{min-height:44px;font-size:10px;margin:0;gap:5px;flex:1}
 #playback-options select{min-height:44px;max-width:85px;flex:1}#playback-options #reset-play{min-height:44px}
 .legend{top:auto;bottom:28px;left:10px;width:172px;max-width:calc(100% - 80px);padding:8px 10px}
 .legend small{display:none}.legend.expanded small{display:block}
 #legend-toggle{display:inline-flex;float:right;min-width:44px;min-height:44px;margin:-4px -6px 0 4px;font-size:10px;padding:5px}
 .legend strong{font-size:10px}.legend-limits{font-size:10px}#legend-ramp{margin-top:8px;clear:both}
 .leaflet-control-zoom{margin-top:106px!important}
 body.focus #map-workspace{height:100dvh}body.focus .map-stage{bottom:0}
 body.focus .map-tools #focus-map span{display:inline}
 .empty-map{top:35%;max-width:260px}.empty-map .eyebrow{display:none}.empty-map h2{font-size:20px}.empty-map p{font-size:11px}
}
@media(max-width:380px){.brand span{display:none}.topbar{gap:2px}.topbar nav button{padding:6px 4px}}
@media(max-width:850px) and (max-height:520px){.legend{width:156px}.legend #legend-toggle{display:inline-flex}.legend #legend-title{font-size:9px}.map-summary{top:62px}.map-tools{top:8px}.leaflet-control-zoom{margin-top:100px!important}}

@media(max-width:850px){
 .map-tools{display:grid;grid-template-columns:44px minmax(95px,1fr) 44px 44px}
 .map-tools #focus-map{grid-column:1;grid-row:1}.map-tools #basemap-button{grid-column:2;grid-row:1}.map-tools #rectangle{grid-column:3;grid-row:1}.map-tools #locate{grid-column:4;grid-row:1;margin:0}
 .map-tools #clear-extent{grid-column:1 / span 2;grid-row:2}.map-tools #finish-area{grid-column:3 / span 2;grid-row:2;white-space:normal;font-size:11px}
 body.focus .map-tools{grid-template-columns:minmax(80px,1fr) minmax(90px,1fr) 44px 44px}
 body.focus .map-tools #focus-map{font-size:10px;gap:3px}
 .map-tools:has(#clear-extent:not([hidden]),#finish-area)~.map-summary{top:114px}
 .map-stage:has(#clear-extent:not([hidden]),#finish-area) .leaflet-control-zoom{margin-top:154px!important}
}

/* In short landscape view, keep essential map controls clear of the timeline. */
@media(max-width:850px) and (max-height:520px){
 .legend:not(.expanded){width:44px;max-width:none;padding:0;bottom:6px;border:0;background:none;box-shadow:none}
 .legend:not(.expanded) #legend-title,.legend:not(.expanded) #legend-ramp,.legend:not(.expanded) .legend-limits{display:none}
 .legend:not(.expanded) #legend-toggle{float:none;margin:0;width:44px}
 .legend.expanded{bottom:6px;width:250px;max-width:calc(100% - 112px);max-height:calc(100% - 60px);overflow:auto}
 .leaflet-control-scale{margin-left:64px!important;margin-bottom:8px!important}
 .leaflet-control-zoom{display:flex;margin-top:62px!important}
 .leaflet-control-zoom a{border-bottom:0!important}.leaflet-control-zoom a:first-child{border-right:1px solid #ccc}
 .map-stage:has(#clear-extent:not([hidden]),#finish-area) .leaflet-control-zoom{margin-top:112px!important}
 .map-tools:has(#clear-extent:not([hidden]),#finish-area)~.map-summary{left:64px}
}
@media(min-width:500px) and (max-width:850px) and (max-height:520px){
 .topbar{height:44px}#map-workspace{height:calc(100dvh - 44px - var(--mobile-nav-height))}
 body[data-playback-options=open]{--timeline-height:60px}
 body[data-playback-options=open] .timeline{flex-wrap:nowrap}
 body[data-playback-options=open] #playback-options{width:auto;flex:none;gap:6px}
 #playback-options label{flex:none}#playback-options select{max-width:75px}
 .timeline output{width:65px}
}
/* Leaflet controls must stay below mobile panels, not intercept panel taps. */
.map-stage{isolation:isolate}

/* Compact Radiaverse-style scale: only the rail, labels and small controls
   are painted. Transparent 44px targets preserve touch and keyboard access. */
#legend.range-legend{top:106px;right:8px;bottom:28px;left:auto;width:80px;max-width:calc(100% - 72px);max-height:none;padding:0;border:0;background:transparent;box-shadow:none;display:grid;grid-template-columns:1fr;grid-template-rows:minmax(88px,1fr) 44px;gap:4px;border-radius:0;overflow:visible;pointer-events:none;color:#fff;text-shadow:0 1px 2px #000,0 0 3px #000,0 0 3px #000}
#legend.range-legend #legend-title,#legend.range-legend #range-status,#range-lock-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#range-control{grid-column:1;grid-row:1;position:relative;min-height:88px}
#range-rail{position:absolute;top:44px;bottom:44px;right:0;width:8px;border-radius:6px;background:#0005}
#legend.range-legend #legend-ramp{position:absolute;left:0;right:0;height:auto;min-height:2px;margin:0;border-radius:6px;clear:none;display:block}
#legend.range-legend .range-handle{position:absolute;right:10px;width:max-content;min-width:44px;height:44px;min-height:44px;padding:2px 12px 2px 0;margin:0;background:transparent;border:0;border-radius:4px;display:flex;justify-content:flex-end;touch-action:none;user-select:none;cursor:ns-resize;z-index:2;font-variant-numeric:tabular-nums;pointer-events:auto;color:inherit;text-shadow:inherit;transform:translateY(-50%)}
.range-handle-label{display:flex;flex-direction:column;align-items:flex-end;max-width:100%;font-size:14px;line-height:1.2;white-space:nowrap}
#legend.range-legend .range-handle-label small{display:block;font-size:12px;margin:0;color:inherit}
.range-handle>span:last-child{position:absolute;right:0;top:calc(50% - 7px);width:0;height:0;border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:8px solid var(--range-endpoint-color,#39f67a);font-size:0;filter:drop-shadow(0 0 1px #0008)}
.range-high>span:last-child{border-left-color:var(--range-endpoint-color,#ff4d4f)}
#legend.range-legend[data-close-handles=true] .range-high{transform:translateY(-100%)}
#legend.range-legend[data-close-handles=true] .range-low{transform:none}
#legend[data-close-handles=true] .range-high>span:last-child{top:auto;bottom:-7px}
#legend[data-close-handles=true] .range-low>span:last-child{top:-7px}
#range-axis-high,#range-axis-low{display:none}
#range-ticks{position:absolute;inset:0;pointer-events:none}
#range-ticks span{position:absolute;right:22px;transform:translateY(-50%);font-size:12px;line-height:1;white-space:nowrap;color:#dbe5d6;text-shadow:0 1px 2px #000,0 0 2px #000;opacity:.8}
#legend.range-legend #range-unlock{position:absolute;right:54px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;margin:0;transform:translateY(-50%);border:0;background:transparent;color:inherit;pointer-events:auto;filter:drop-shadow(0 1px 1px #000);opacity:1}
#legend.range-legend[data-close-handles=true] #range-unlock{transform:translateY(-100%)}
#range-unlock svg{fill:none;stroke:currentColor;stroke-width:1.7;flex:none}
#legend[data-locked=false] #range-unlock{visibility:hidden}
#legend.range-legend #legend-toggle{position:absolute;right:80px;bottom:0;display:inline-flex;float:none;margin:0;min-width:44px;width:44px;height:44px;min-height:44px;padding:0;font-size:17px;border:0;background:transparent;color:inherit;text-shadow:inherit;pointer-events:auto}
#legend.range-legend #legend-description{display:none}
#legend.range-legend.expanded #legend-description{display:block;position:absolute;right:calc(100% + 8px);bottom:48px;width:min(220px,calc(100vw - 112px));padding:12px;margin:0;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);text-shadow:none;font-size:11px;box-shadow:0 3px 14px #0002;pointer-events:auto}
#legend.range-legend #color-menu-button{grid-column:1;grid-row:2;width:80px;font-size:12px;min-height:44px;padding:2px 12px 2px 0;line-height:1.2;white-space:pre-line;text-align:right;justify-content:flex-end;border:0;background:transparent;color:inherit;text-shadow:inherit;pointer-events:auto}
#legend.range-legend button:focus-visible{outline:2px solid #fff;outline-offset:1px;box-shadow:0 0 0 3px #1b252b}
#legend.range-legend[data-categorical=true]{top:auto;bottom:28px;grid-template-rows:44px}
#legend.range-legend[data-categorical=true] #color-menu-button{grid-row:1}
#unlimited-scale{grid-column:1;grid-row:1;position:relative;display:grid;grid-template-columns:1fr 8px;grid-template-rows:auto 1fr auto;align-items:center;gap:8px;text-align:right;font-variant-numeric:tabular-nums;font-size:12px;padding:22px 0}
#unlimited-ramp{grid-column:2;grid-row:1/4;height:100%;min-height:44px;border-radius:5px}
#unlimited-midpoint{font-size:11px;color:inherit}
@media(max-width:850px){#legend.range-legend{top:104px}.map-stage:has(#clear-extent:not([hidden]),#finish-area) #legend.range-legend{top:154px}}
/* Very short landscape maps keep the existing horizontal accessible fallback. */
@media(max-height:520px){
 #legend.range-legend:not(.expanded){top:auto;bottom:28px;width:44px;height:44px;padding:0;display:block}
 #legend.range-legend:not(.expanded) #range-control,#legend.range-legend:not(.expanded) #range-unlock,#legend.range-legend:not(.expanded) #color-menu-button,#legend.range-legend:not(.expanded) #unlimited-scale{display:none}
 #legend.range-legend:not(.expanded) #legend-toggle{right:0}
 #legend.range-legend.expanded{top:auto;bottom:4px;width:min(300px,calc(100% - 76px));height:140px;max-height:none;min-height:0;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:44px 88px;padding:4px;gap:0}
 #legend.range-legend.expanded #color-menu-button{grid-column:1;grid-row:1;width:100%;white-space:normal;justify-content:center}
 #legend.range-legend.expanded #range-control{grid-column:1;grid-row:2;min-height:0}
 #legend.range-legend.expanded #range-rail{left:36px;right:36px;width:auto;height:8px;top:40px;bottom:auto}
 #legend.range-legend.expanded .range-handle{width:70px;min-width:70px;right:auto;padding:2px 0;justify-content:center}
 #legend.range-legend.expanded .range-high{transform:translate(-50%,-100%)}
 #legend.range-legend.expanded .range-low{transform:translateX(-50%)}
 #legend.range-legend.expanded .range-handle-label{align-items:center}
 #legend.range-legend.expanded .range-handle>span:last-child{right:calc(50% - 7px);top:auto;bottom:-7px;transform:rotate(90deg)}
 #legend.range-legend.expanded .range-low>span:last-child{top:-7px;bottom:auto;transform:rotate(-90deg)}
 #legend.range-legend.expanded #range-unlock{grid-column:2;grid-row:2;align-self:start;position:relative;right:auto;top:auto!important;transform:none}
 #legend.range-legend.expanded #legend-toggle{grid-column:2;grid-row:2;align-self:end;position:relative;right:auto;bottom:auto}
 #legend.range-legend.expanded #legend-description{bottom:48px;right:calc(100% + 4px);width:min(220px,calc(100vw - 400px))}
 #legend.range-legend.expanded #unlimited-scale{grid-column:1;grid-row:2;min-height:0;font-size:10px;padding:4px 8px;gap:2px}
 #legend.range-legend.expanded #unlimited-ramp{min-height:0}
 #legend.range-legend.expanded #unlimited-midpoint{font-size:9px}
 .map-stage:has(#clear-extent:not([hidden]),#finish-area) #legend.range-legend.expanded{top:auto}
}
@media(forced-colors:active){
 #legend.range-legend .range-handle-label,#legend.range-legend #color-menu-button,#legend.range-legend #range-unlock,#legend.range-legend #legend-toggle{color:CanvasText;background:Canvas;text-shadow:none;filter:none;forced-color-adjust:auto}
 #legend.range-legend .range-handle-label{padding:1px 3px;border-radius:3px}
 #legend.range-legend .range-handle:focus-visible,#legend.range-legend button:focus-visible{outline-color:Highlight;box-shadow:none}
 #legend-ramp,#unlimited-ramp{forced-color-adjust:none}
 #range-rail{background:CanvasText}
 #range-ticks span{color:CanvasText;background:Canvas;text-shadow:none;opacity:1}
 .range-handle>span:last-child{border-left-color:CanvasText;filter:none}
}

/* Scale and cell-statistic menu, shared by keyboard, desktop and touch. */
.color-menu fieldset{border:0;padding:0;margin:0 0 20px}.color-menu legend{font-size:15px;color:var(--muted);padding:0;margin-bottom:10px}
.color-menu .color-choice{display:flex;align-items:center;gap:12px;margin:3px 0;padding:10px 12px;min-height:44px;border-radius:8px;color:var(--text);font-size:15px;font-weight:400;cursor:pointer}
.color-choice:has(input:checked){background:var(--raised)}.color-choice:has(input:disabled){opacity:.5;cursor:default}
.color-menu input[type=radio]{flex:none;width:20px;height:20px;min-height:20px;margin:0;accent-color:var(--accent)}
.color-menu strong{font-weight:550}.color-menu small{display:block;font-size:12px;color:var(--muted);margin-top:4px}
#color-menu-feedback:not(:empty){padding:12px;border:1px solid var(--error);color:var(--error);border-radius:6px}

.update-status{position:fixed;left:50%;bottom:8px;transform:translateX(-50%);z-index:10000;max-width:min(90vw,550px);font-size:12px;text-align:center;pointer-events:none;background:var(--panel);color:var(--text);border-radius:6px;padding:4px 8px}.update-status:empty{display:none}html[data-update-frozen]{cursor:progress}html[data-update-frozen] body{pointer-events:none}

/* Reserve a measured status row instead of covering mobile navigation or playback. */
@media(max-width:850px){
 body{--mobile-topbar-height:60px}
 .update-status{left:0;right:0;bottom:0;max-width:none;transform:none;border-radius:0;padding:6px 12px;font-size:12px;line-height:18px;border-top:1px solid var(--line)}
 body[data-view=map]:not(.focus) .update-status{bottom:var(--mobile-nav-height)}
 body[data-view=map] #map-workspace{height:calc(100dvh - var(--mobile-topbar-height) - var(--mobile-nav-height) - var(--update-status-height,0px))}
 body[data-view=map].focus #map-workspace{height:calc(100dvh - var(--update-status-height,0px))}
 .workspace-page{padding-bottom:calc(80px + var(--update-status-height,0px) + env(safe-area-inset-bottom))}
}
@media(min-width:500px) and (max-width:850px) and (max-height:520px){body{--mobile-topbar-height:44px}}

/* Short landscape keeps 44px targets while the legend sits beside its menu. */
@media(min-width:500px) and (max-width:850px) and (max-height:360px){
 body,body[data-playback-options=open]{--timeline-height:44px}
 .timeline{padding:0 8px}
 #legend.range-legend.expanded{height:88px;padding:0;grid-template-columns:minmax(0,1fr) 44px 44px;grid-template-rows:44px 44px}
 #legend.range-legend.expanded #color-menu-button{grid-column:2 / span 2;grid-row:1;font-size:11px}
 #legend.range-legend.expanded #range-control,#legend.range-legend.expanded #unlimited-scale{grid-column:1;grid-row:1 / span 2}
 #legend.range-legend.expanded #range-rail{top:44px}
 #legend.range-legend.expanded #range-unlock{grid-column:2;grid-row:2}
 #legend.range-legend.expanded #legend-toggle{grid-column:3;grid-row:2}
 #legend.range-legend.expanded #legend-description{bottom:0}

 .map-stage:has(#clear-extent:not([hidden]),#finish-area) #legend.range-legend.expanded{width:min(300px,calc(100% - 280px))}
 .map-stage:has(#legend.expanded) .map-tools #clear-extent,.map-stage:has(#legend.expanded) .map-tools #finish-area{grid-column:1 / -1;grid-row:2;justify-self:start;width:128px}
 .map-stage:has(#legend.expanded) .map-tools #finish-area{margin-left:132px}

 #legend.range-legend.expanded .range-low{top:0!important}
}
