/* ScoutTract map-first layout (body.st-wm, desktop/tablet > 760px). Pairs with window-manager.js.
   Brand: navy #1F2A44, copper #B87333. Phones (body.ga-mobile) are left to mobile-map.css. */
:root{--st-navy:#1F2A44;--st-navy2:#283654;--st-navy3:#33446a;--st-copper:#B87333;--st-copper2:#d08a4a;--st-ink:#eef2f8;--st-mute:#b3bfd3}
body.st-wm{--stw-top:48px;--stw-rail:60px;--stw-inset-l:0px;--stw-inset-r:0px;overflow:hidden}

/* ---- slim brand top bar ---- */
body.st-wm .topbar{height:var(--stw-top);padding:0 12px 0 10px;gap:14px;background:var(--st-navy);border-bottom:2px solid var(--st-copper);position:relative;z-index:30}
body.st-wm .brand{min-width:0;gap:8px}
body.st-wm .brand img,body.st-wm .brand svg{max-height:30px;width:auto}
body.st-wm .brand b{font-size:16px;letter-spacing:.2px}
body.st-wm .brand span{display:none}
body.st-wm .region-pill{padding:5px 11px;font-size:11.5px;border-color:#4a5b80;background:#ffffff0d}
body.st-wm .top-actions{gap:8px;font-size:11.5px}
body.st-wm .top-actions button,body.st-wm .topbar .ga-top-btn{min-height:34px;padding:5px 11px;font-size:12px;border-radius:8px}
body.st-wm .top-actions a{color:var(--st-copper2)}
.stw-layout-toggle{background:transparent;border:1px solid var(--st-copper);color:#f4d9bf;border-radius:8px;min-height:34px;padding:5px 11px;font-size:12px;cursor:pointer}
.stw-layout-toggle:hover{background:#b8733326}
body.st-wm .main-shell{height:calc(100vh - var(--stw-top));height:calc(100dvh - var(--stw-top))}

/* ---- slim icon rail with tooltips ---- */
body.st-wm .rail{width:var(--stw-rail);min-width:var(--stw-rail);padding:8px 4px;gap:4px;background:var(--st-navy);border-right:1px solid #34456b;position:relative;z-index:30;scrollbar-width:thin}
body.st-wm .rail-tab{width:52px;min-height:48px;border-radius:10px;gap:1px;color:var(--st-mute);position:relative}
body.st-wm .rail-tab span{font-size:19px;line-height:1}
body.st-wm .rail-tab small{font-size:9px;font-weight:600;letter-spacing:.1px;max-width:50px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.st-wm .rail-tab:hover{background:var(--st-navy2);color:#fff}
body.st-wm .rail-tab.active{background:var(--st-navy3);color:#fff}
body.st-wm .rail-tab.active::before{content:"";position:absolute;left:-4px;top:9px;bottom:9px;width:3px;border-radius:2px;background:var(--st-copper)}
body.st-wm .rail-tab.active span{color:var(--st-copper2)}
body.st-wm .rail-tab:focus-visible,.stw-b:focus-visible,.stw-mb:focus-visible,.stw-title:focus-visible{outline:2px solid var(--st-copper2);outline-offset:2px}
.stw-tip{position:fixed;z-index:1200;transform:translateY(-50%);background:#0f1729;color:#fff;font:600 12px/1.2 Inter,system-ui,sans-serif;padding:6px 9px;border-radius:6px;border:1px solid var(--st-copper);pointer-events:none;white-space:nowrap;box-shadow:0 6px 20px #0007}
body:not(.st-wm) .stw-tip{display:none}

/* ---- remove page chrome that pushed the map down ---- */
body.st-wm .workspace-head,body.st-wm #gaLayoutBar,body.st-wm .ga-layout-bar,body.st-wm .ga-panel-manager,
body.st-wm .map-resize-handle,body.st-wm #mapPopoutBtn,body.st-wm .map-popout-placeholder,body.st-wm #explorePane .map-top{display:none!important}
body.st-wm .workspace{overflow:hidden}
body.st-wm .ga-managed-panel{resize:none;min-height:0;min-width:0}

/* ---- full-bleed map ---- */
body.st-wm #explorePane{display:block!important}
body.st-wm #explorePane .map-layout{display:block;padding:0;height:0;min-height:0}
body.st-wm #explorePane .map-card,body.st-wm #explorePane .map-card.ga-popout{position:fixed!important;left:var(--stw-rail)!important;top:var(--stw-top)!important;right:0!important;bottom:var(--stw-foot,22px)!important;width:auto!important;height:auto!important;min-height:0!important;border:0;border-radius:0;box-shadow:none;padding:0;resize:none;z-index:0;background:#dfe5ea}
body.st-wm #explorePane #map{position:absolute;inset:0;height:auto!important;min-height:0!important;flex:none}
body.st-wm #explorePane .map-foot{position:absolute;left:50%;transform:translateX(-50%);bottom:8px;z-index:6;display:flex;gap:14px;background:#1f2a44e6;color:#e6ecf5;padding:5px 12px;border-radius:999px;font-size:11px;white-space:nowrap;box-shadow:0 2px 10px #0004;pointer-events:none}
body.st-wm #explorePane .ga-coordinate-foot{display:none}
/* map overlays move out from under docked windows */
body.st-wm #map .map-zoom-badge{left:calc(var(--stw-inset-l) + 10px)!important;top:62px!important}
body.st-wm #map .map-hint{left:calc(var(--stw-inset-l) + 82px)!important;top:62px!important;opacity:.92}
body.st-wm #map .map-scale{left:calc(var(--stw-inset-l) + 10px)!important}
body.st-wm #map .map-zoom{right:calc(var(--stw-inset-r) + 10px)!important;top:10px!important}
body.st-wm #map .ga-map-fab{right:calc(var(--stw-inset-r) + 10px)!important}
body.st-wm #map .maplibregl-ctrl-bottom-right{right:var(--stw-inset-r)}
body.st-wm #map .map-zoom button{width:40px;height:40px}
@media (pointer:coarse){body.st-wm #map .map-zoom button{width:44px;height:44px}}
body.st-wm .app-footer{left:var(--stw-rail);height:22px;padding:3px 10px;background:#1f2a44f2;border-top:1px solid #34456b;z-index:25;font-size:10.5px}
body.st-wm .app-footer a{color:#f0c79f}

/* ---- map tool bar (opens the explore tool windows) ---- */
.stw-mapbar{display:none}
body.st-wm .stw-mapbar{display:flex;position:fixed;z-index:15;top:calc(var(--stw-top) + 8px);left:calc(var(--stw-rail) + var(--stw-inset-l) + 10px);gap:2px;padding:3px;background:#1f2a44f2;border:1px solid #3c4d74;border-radius:12px;box-shadow:0 4px 18px #0005;transition:left .15s}
.stw-mb{display:flex;align-items:center;gap:6px;min-height:40px;min-width:44px;padding:4px 11px;background:transparent;border:0;border-radius:9px;color:#dfe6f2;font-size:12.5px;font-weight:600;cursor:pointer}
.stw-mb span{font-size:15px}
.stw-mb:hover{background:var(--st-navy3)}
.stw-mb[aria-pressed=true]{background:var(--st-copper);color:#fff}
@media (pointer:coarse){.stw-mb{min-height:44px}}
@media (max-width:1180px){.stw-mb small{display:none}.stw-mb{padding:4px 10px}}

/* ---- windows ---- */
.stw-tool{display:none}
body.st-wm .stw-win{position:fixed;z-index:20;display:flex;flex-direction:column;background:var(--panel,#101f2e);border:1px solid #3c4d74;border-radius:12px;box-shadow:0 18px 50px #0009,0 0 0 1px #0003;overflow:hidden;resize:both;min-width:260px;min-height:44px;max-width:calc(100vw - var(--stw-rail) - 8px);max-height:calc(100vh - var(--stw-top) - 8px);margin:0;padding:0}
body.st-wm .stw-tool.stw-win:not(.stw-open),body.st-wm .stw-tool.stw-empty{display:none!important}
body.st-wm .stw-pane.stw-win{display:none;overflow:auto;padding:0 0 14px;flex:none}
body.st-wm .stw-pane.stw-win.active{display:block!important}
body.st-wm .stw-win[data-mode=left],body.st-wm .stw-win[data-mode=right]{resize:horizontal}
body.st-wm .stw-win[data-mode=max]{resize:none;border-radius:10px}
body.st-wm .stw-win.stw-dragging{opacity:.94;box-shadow:0 24px 70px #000b;user-select:none}
.stw-head{display:none}
body.st-wm .stw-head{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 4px 0 12px;background:var(--st-navy);border-bottom:2px solid var(--st-copper);cursor:grab;user-select:none;touch-action:none;flex:none}
body.st-wm .stw-pane > .stw-head{position:sticky;top:0;z-index:5;margin-bottom:12px}
body.st-wm .stw-dragging .stw-head{cursor:grabbing}
.stw-ico{color:var(--st-copper2);font-size:15px;width:18px;text-align:center}
.stw-title{margin:0;font-size:14px;font-weight:700;color:#fff;letter-spacing:.1px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:4px}
body.st-wm .stw-pane > .stw-head[data-eyebrow]:not([data-eyebrow=""])::after{content:attr(data-eyebrow);order:-1;display:none}
.stw-btns{display:flex;gap:2px}
.stw-b{width:36px;height:36px;min-height:36px;padding:0;display:grid;place-items:center;background:transparent;border:0;border-radius:8px;color:#cfd8e8;font-size:14px;cursor:pointer}
.stw-b:hover{background:var(--st-navy3);color:#fff}.stw-x:hover{background:#9b3b3b}
@media (pointer:coarse){.stw-b{width:44px;height:44px}}
body.st-wm .stw-body{flex:1;min-height:0;overflow:auto;padding:12px 14px 16px;overscroll-behavior:contain}
body.st-wm .stw-collapsed{height:auto!important;min-height:0!important;resize:none!important}
body.st-wm .stw-collapsed > :not(.stw-head){display:none!important}
body.st-wm .stw-collapsed > .stw-head{border-bottom-color:transparent;margin-bottom:0}
/* adopted content: let the window own scrolling and spacing */
body.st-wm .stw-body > .control-card{border:0;background:transparent;padding:0;overflow:visible;max-height:none;height:auto;width:auto!important;border-radius:0}
body.st-wm .stw-body > details.research-collapsible{border:0;margin:0}
body.st-wm .stw-body > details.research-collapsible > summary{display:none}
body.st-wm .stw-body > details > .research-map-tools,body.st-wm .stw-body > details > .research-lookup{border:0;padding:0;margin:0;background:transparent}
body.st-wm .stw-body .map-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
body.st-wm .stw-body .ga-map-controls{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:0;border:0;background:transparent}
body.st-wm .stw-body .ga-fema-panel{margin-top:12px}
body.st-wm .stw-body .layer-picker{margin:0;border:0;padding:0;background:transparent}
body.st-wm .stw-win button.small,body.st-wm .stw-win .secondary.small{min-height:34px}
@media (pointer:coarse){body.st-wm .stw-win button,body.st-wm .stw-win select,body.st-wm .stw-win input:not([type=checkbox]):not([type=radio]){min-height:44px}}
/* panes inside windows: tighter page padding */
body.st-wm .stw-pane > :not(.stw-head){margin-left:14px;margin-right:14px}
body.st-wm .stw-pane .wide-shell{padding:0}
/* snap preview while dragging */
.stw-snap{position:fixed;z-index:19;pointer-events:none;background:#b873332e;border:2px dashed var(--st-copper);border-radius:12px;top:calc(var(--stw-top,48px) + 8px);bottom:30px}
.stw-snap[data-zone=left]{left:calc(var(--stw-rail,60px) + 8px);width:360px}
.stw-snap[data-zone=right]{right:8px;width:360px}
.stw-snap[data-zone=max]{left:calc(var(--stw-rail,60px) + 8px);right:8px}
body:not(.st-wm) .stw-snap{display:none}

/* ---- feature details as a non-modal drawer (map stays usable) ---- */
body.st-wm dialog.stw-drawer[open]{position:fixed;z-index:1000;inset:calc(var(--stw-top) + 58px) calc(var(--stw-inset-r) + 64px) auto auto;margin:0;width:min(440px,42vw);max-width:none;max-height:calc(100vh - var(--stw-top) - 94px);overflow:auto;border:1px solid #3c4d74;border-top:3px solid var(--st-copper);border-radius:12px;box-shadow:0 18px 50px #0009;padding:14px 16px}
body.st-wm dialog.stw-drawer .v6-modal-head{position:sticky;top:-14px;background:inherit;z-index:2;margin:-14px -16px 10px;padding:10px 12px 8px 16px;border-bottom:1px solid #34456b}

/* ---- phones: record/parcel dialogs become bottom sheets (complements mobile-map.css) ---- */
@media (max-width:760px){
  body.ga-mobile dialog.v6-record-modal[open]{inset:auto 0 0 0;top:auto;margin:0;width:100vw;max-width:100vw;max-height:78dvh;border-radius:18px 18px 0 0;border-bottom:0;padding:8px 14px calc(14px + env(safe-area-inset-bottom,0px));overflow:auto}
  body.ga-mobile dialog.v6-record-modal[open]::before{content:"";display:block;width:42px;height:5px;border-radius:3px;background:#ffffff44;margin:2px auto 8px}
}
@media print{body.st-wm .stw-mapbar,body.st-wm .stw-tool,body.st-wm .stw-head,.stw-tip,.stw-snap{display:none!important}body.st-wm #explorePane .map-card{position:static!important}}
@media (prefers-reduced-motion:reduce){body.st-wm .stw-mapbar{transition:none}}
/* compact top bar + scrollable rail on tablets / short screens */
body.st-wm .topbar *{white-space:nowrap}
body.st-wm .region-pill{max-width:240px;overflow:hidden;text-overflow:ellipsis}
body.st-wm .rail{overflow-y:auto;overflow-x:hidden}
@media (max-width:1180px){
  body.st-wm .topbar{gap:8px}
  body.st-wm .region-pill{max-width:150px}
  body.st-wm .ga-pwa-actions button,body.st-wm .ga-pwa-actions a{padding:5px 8px;font-size:11.5px}
  body.st-wm .top-actions{gap:6px}
}
@media (max-height:820px){body.st-wm .rail-tab{min-height:44px}body.st-wm .rail{gap:2px}}
