/* dock (declutter v1): the map stays clear. One compact bottom icon bar (Layers, Search, Pin, Plan, Me, Menu).
   Every old top-bar / floating button is still there, hidden, and run from the dock sheets. Stand Plan mode (spd-on)
   keeps its own five-button row: the dock and these rules switch off while a plan is shown. */
#dk{display:none}
body.dk-on.dk-map:not(.spd-on):not(.pn-open) #dk{display:grid}
#dk{position:fixed;left:0;right:0;bottom:0;z-index:780;grid-template-columns:repeat(var(--dkn,6),1fr);gap:2px;padding:4px 4px calc(4px + env(safe-area-inset-bottom,0px));background:linear-gradient(180deg,#0b130de6,#060a07f7);border-top:1px solid #9ccc6544;font-family:var(--cond,system-ui)}
body.v3-open #dk{z-index:2060}
#dk button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-height:48px;border:0;border-radius:10px;background:transparent;color:#e8f5c8;padding:2px 0;-webkit-tap-highlight-color:transparent}
#dk button:active,#dk button.on{background:#9ccc6522;color:#ffd23f}
#dk svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#dk small{font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;line-height:1.1}
/* hide the old clutter (still in the DOM, run from the dock) */
body.dk-on.spd-on #view3d .v3bar{display:none!important}
body.dk-on:not(.spd-on) #view3d .v3bar,
body.dk-on:not(.spd-on) #mapbtns,
body.dk-on:not(.spd-on) #quick,
body.dk-on:not(.spd-on) #t3d,
body.dk-on:not(.spd-on) #pn-menu,
body.dk-on:not(.spd-on) #spchip,
body.dk-on:not(.spd-on) #v3me,
body.dk-on:not(.spd-on) .leaflet-control-zoom,
body.dk-on:not(.spd-on) .fk-mgrs:not(.dk-keep){display:none!important}
body.dk-on:not(.spd-on):not(.dk-search) #mapsearch{display:none!important}
/* nothing slides down under a top bar any more */
body.dk-on:not(.spd-on) #mapsearch,body.dk-on:not(.spd-on) #mapbtns,body.dk-on:not(.spd-on) #windchip,body.dk-on:not(.spd-on) #rutchip,body.dk-on:not(.spd-on) #spchip,body.dk-on:not(.spd-on) .fk-mgrs,body.dk-on:not(.spd-on) #rotcomp,body.dk-on:not(.spd-on) #parcelstatus{transform:none!important}
body.dk-on.dk-search:not(.spd-on) #mapsearch{top:calc(8px + env(safe-area-inset-top,0px))!important;left:8px!important;right:8px!important;width:auto!important;z-index:2070!important;visibility:visible!important}
/* compass (wind chip) small, top-left; one zoom set (+ / - / north) small, bottom-right above the dock */
body.dk-on:not(.spd-on) #windchip,body.dk-on:not(.spd-on) #v3chip.wc-min{top:calc(10px + env(safe-area-inset-top,0px))!important;left:10px!important}
body.dk-on:not(.spd-on) #att2d,body.dk-on:not(.spd-on) #view3d .maplibregl-ctrl-bottom-right{bottom:calc(62px + env(safe-area-inset-bottom,0px))!important}
body.dk-on:not(.spd-on) #att2d .maplibregl-ctrl-group,body.dk-on:not(.spd-on) #view3d .maplibregl-ctrl-group{transform:scale(.82);transform-origin:right bottom}
body.dk-on:not(.spd-on) .leaflet-bottom.leaflet-left{bottom:calc(60px + env(safe-area-inset-bottom,0px))!important}
body.dk-on:not(.spd-on) #view3d .v3note{display:none!important}
body.dk-on:not(.spd-on) #toast{bottom:calc(76px + env(safe-area-inset-bottom,0px))}
body.dk-on:not(.spd-on) #drawbar{bottom:calc(62px + env(safe-area-inset-bottom,0px))!important}
/* dock sheet */
#dk-scrim{position:fixed;inset:0;z-index:2080;background:#0007;display:none}
#dk-sheet{position:fixed;left:0;right:0;bottom:0;z-index:2090;max-height:72vh;overflow:auto;background:#0d160ff7;border-top:2px solid #9ccc65;border-radius:16px 16px 0 0;padding:10px 12px calc(14px + env(safe-area-inset-bottom,0px));color:#eef1e4;font-family:var(--cond,system-ui);display:none;box-shadow:0 -10px 30px #000c}
body.dk-sheet #dk-scrim,body.dk-sheet #dk-sheet{display:block}
#dk-sheet h3{margin:2px 4px 8px;font-size:14px;letter-spacing:.16em;color:#c5e1a5;display:flex;justify-content:space-between;align-items:center}
#dk-sheet h3 button{background:none;border:0;color:#eef1e4;font-size:26px;line-height:1;padding:0 6px}
#dk-sheet h4{margin:10px 4px 6px;font:600 11px/1 var(--mono,monospace);letter-spacing:.14em;color:#9aa58f}
#dk-sheet .dk-g{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#dk-sheet .dk-g button{display:flex;align-items:center;gap:8px;min-height:46px;text-align:left;background:#18200f;border:1.5px solid #9ccc6566;border-radius:10px;color:#eef1e4;padding:6px 10px;font-size:14px;font-family:inherit}
#dk-sheet .dk-g button.on{border-color:#ffd23f;background:#2a2a10}
#dk-sheet .dk-g button .pro{margin-left:auto}
body.dk-on:not(.spd-on) #att2d .maplibregl-ctrl-attrib.maplibregl-compact-show,body.dk-on:not(.spd-on) #view3d .maplibregl-ctrl-attrib.maplibregl-compact-show{font-size:10px;line-height:14px;max-width:calc(100% - 60px)}
body.dk-on:not(.spd-on) #att2d .maplibregl-ctrl-attrib-inner,body.dk-on:not(.spd-on) #view3d .maplibregl-ctrl-attrib-inner{font-size:9.5px!important;line-height:13px!important}
body.hc-off #dk,body.hc-fade #dk{display:none!important}
/* 3D only (Pro): no 2D/3D toggles */
body.only3d #t3d,body.only3d #v3close,body.only3d #b-3d,body.only3d #t2plan{display:none!important}
/* attribution + scale clear of the dock: credit box on the right (its (i) fully on screen), scale bar on the left, same row */
body.dk-on:not(.spd-on) #att2d,body.dk-on:not(.spd-on) #view3d .maplibregl-ctrl-bottom-right{left:auto!important;right:0!important;bottom:calc(64px + env(safe-area-inset-bottom,0px))!important;max-width:100vw}
body.dk-on:not(.spd-on) #att2d .maplibregl-ctrl-attrib,body.dk-on:not(.spd-on) #view3d .maplibregl-ctrl-attrib{margin:0 8px 0 0!important;max-width:calc(100vw - 118px)!important;box-sizing:border-box}
body.dk-on:not(.spd-on) .leaflet-bottom.leaflet-left{bottom:calc(64px + env(safe-area-inset-bottom,0px))!important}
body.dk-on:not(.spd-on) .leaflet-bottom.leaflet-left .leaflet-control{margin:0 0 0 8px!important}
/* grid coordinates: off the map unless switched on from Layers */
body.dk-on.dk-grid:not(.spd-on) .fk-mgrs{display:block!important;top:calc(14px + env(safe-area-inset-top,0px))!important;left:60px!important;right:auto!important;transform:none!important;font-size:11px!important;padding:2px 6px!important}

/* declutter v3: Menu drawer removed; one Settings screen from the bar's gear */
#pane,#pane-edge,#pane-scrim,#pn-menu,#pane-handle{display:none!important}
#dk-set{position:fixed;inset:0;bottom:calc(58px + env(safe-area-inset-bottom));z-index:2100;background:#101410;color:#eef1e4;display:flex;flex-direction:column}
#dk-set[hidden]{display:none}
#dk-set .ds-head{display:flex;align-items:center;justify-content:space-between;padding:calc(10px + env(safe-area-inset-top)) 14px 10px;border-bottom:1px solid #2f3a2a;font-family:var(--cond,system-ui);letter-spacing:.08em;color:#a6e05a}
#dk-set .ds-head button{background:none;border:0;color:#eef1e4;font-size:30px;line-height:1;padding:0 6px}
#dk-set .ds-body{flex:1;overflow:auto;padding:4px 12px 20px;-webkit-overflow-scrolling:touch}
#dk-set h4{margin:14px 2px 6px;font:700 11px var(--cond,system-ui);letter-spacing:.12em;color:#8fa17f;text-transform:uppercase}
#dk-set .ds-list{display:flex;flex-direction:column;gap:6px}
#dk-set .ds-list>*{display:flex!important;width:100%;position:static!important;transform:none!important}
#dk-set .ds-list>button{align-items:center;gap:10px;text-align:left;background:#1a2118;color:#eef1e4;border:1px solid #2f3a2a;border-radius:6px;padding:11px 12px;font-size:15px;min-height:46px}
#dk-set .ds-list>button small{font-size:15px;position:static;display:inline}
#dk-set .ds-ver{margin:18px 2px 0;font-size:12px;color:#8fa17f}
body.dk-setopen #dk{display:grid!important;z-index:2150}

#dk-set .ds-list>.ds-ph{display:block!important;width:100%;max-height:60vh;overflow:auto}
#dk-set .ds-list>.ds-ph[hidden]{display:none!important}
#dk-set .ds-ph *{max-width:100%}
#dk-set #ds-photos{grid-column:1/-1;text-align:left;display:flex;justify-content:space-between;align-items:center}
#dk-set #ds-photos.on .ds-chev{transform:rotate(90deg)}

#aw-lab{position:fixed;left:50%;transform:translateX(-50%);top:calc(10px + env(safe-area-inset-top));white-space:nowrap;z-index:900;background:rgba(14,17,15,.82);color:#eef1e4;border:1px solid #3b4a2a;border-radius:12px;padding:3px 9px;font:600 11px/1.3 var(--cond,system-ui);pointer-events:none;max-width:70vw}
#aw-lab[hidden],body.spd-on #aw-lab,body.dk-setopen #aw-lab{display:none}
#aw-lab[data-src=last]{border-color:#e0a03a;color:#ffd58a}
/* Settings: multi-control blocks (Map rotation etc.) stack vertically, one control per row */
#dk-set .ds-list>div:not(.ds-ph){flex-direction:column!important;align-items:stretch;gap:8px;background:#1a2118;border:1px solid #2f3a2a;border-radius:6px;padding:10px 12px;color:#eef1e4}
#dk-set .ds-list>div:not(.ds-ph) .pn-set{display:flex!important;align-items:center;gap:10px;justify-content:space-between;width:100%;box-sizing:border-box;padding:6px 0;border-top:1px solid #2a3326}
#dk-set .ds-list>div:not(.ds-ph) .pn-set>span{flex:1 1 auto;min-width:0;text-align:left;line-height:1.3}
#dk-set .ds-list>div:not(.ds-ph) .pn-set>input[type=checkbox]{order:2;flex:none;width:22px;height:22px}
#dk-set .ds-list>div:not(.ds-ph) .pn-set>select{flex:none;max-width:45%}
#dk-set .ds-list>div:not(.ds-ph) .pn-set small{font-size:12px;color:#a3ab92}
#dk-set .ds-list>div:not(.ds-ph) .rs-h{font-size:15px}
#dk-set .ds-list>div:not(.ds-ph)>.btn{width:100%}

/* camera facing */
.cf-box{margin:10px 0;padding:10px;border:1px solid #2f3a2a;border-radius:8px;background:#141a12}
.cf-box[hidden]{display:none}
.cf-row{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.cf-dial{position:relative;width:112px;height:112px;border-radius:50%;border:2px solid #3b4a2a;flex:none;background:radial-gradient(#1d2519,#10140e)}
.cf-pt{position:absolute;width:22px;height:22px;margin:-11px 0 0 -11px;border-radius:50%;border:1px solid #3b4a2a;background:#1a2118;color:#eef1e4;font:700 9px/20px system-ui;padding:0;text-align:center}
.cf-pt.on{background:#29b6f6;color:#001;border-color:#fff}
.cf-needle{position:absolute;left:55px;top:16px;width:2px;height:40px;background:#29b6f6;transform-origin:1px 40px;pointer-events:none}
.cf-needle::before{content:'';position:absolute;left:-6px;top:-4px;border:7px solid transparent;border-bottom:10px solid #29b6f6;border-top:0}
.cf-side{display:flex;flex-direction:column;gap:8px;flex:1 1 140px;min-width:140px}
.cf-face{margin:6px 0;color:#29b6f6}
.cf-handle{width:40px;height:40px;border-radius:50%;background:#29b6f6;color:#001;border:3px solid #fff;font:700 22px/34px system-ui;text-align:center;box-shadow:0 2px 8px rgba(0,0,0,.5);cursor:grab;touch-action:none}
.cf-bar{position:fixed;left:8px;right:8px;top:calc(10px + env(safe-area-inset-top));z-index:1200;display:flex;gap:10px;align-items:center;background:rgba(14,17,15,.92);color:#eef1e4;border:1px solid #29b6f6;border-radius:10px;padding:8px 10px;font-size:13px}
.cf-bar b{color:#29b6f6;white-space:nowrap}.cf-bar span{flex:1;min-width:0}

body.has-grp #dk{--dkn:7}
#aw-lab[data-src=manual]{border-color:#4fc3f7;color:#b3e5fc}
