/* ═══════════════════════════════════════════════════════════════════
   GIS Abyss — Workspace  |  "MISSION CONTROL"
   The map runs edge to edge; every tool floats over it as glass.
   This sheet sits on top of the dashboard's own styles: it remaps the
   design tokens to the site's two themes and re-lays the shell, so no
   id, class or script changes.
     Day   "Survey" — warm paper glass, ink, copper, deep teal
     Night "Abyss"  — abyssal glass, bone, glowing copper, teal
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens: the site palette, both themes ── */
html body {
  --cream:#F7F3EA; --paper:#EFE9DD; --paper2:#E5DDCD;
  --ink:#15130F; --ink2:#2C2822; --muted:#72695A; --muted2:#5B5347;
  --accent:#B5501C; --accent-hover:#C9612A; --accent-glow:rgba(181,80,28,.35); --accent-soft:rgba(181,80,28,.10);
  --teal:#1F5D59;
  --border:rgba(21,19,15,.09); --border-strong:rgba(21,19,15,.16); --border-accent:rgba(181,80,28,.32);
  --glass:rgba(247,243,234,.78); --glass-2:rgba(247,243,234,.92); --glass-line:rgba(21,19,15,.09); --glass-rim:rgba(255,255,255,.55);
  --glass-bg:var(--glass); --glass-bg-dark:rgba(16,18,18,.86);
  --float:0 1px 0 var(--glass-rim) inset, 0 18px 50px -18px rgba(21,19,15,.32), 0 2px 8px rgba(21,19,15,.06);
  --radius:10px; --r-lg:18px;
  --header-h:70px; --bottombar-h:56px; --sidebar-w:292px; --sidebar-collapsed-w:58px; --rightpanel-w:clamp(360px, 24vw, 460px);
  --gap:12px;
  --mono:'DM Mono','JetBrains Mono',ui-monospace,monospace;
  --serif:'Cormorant Garamond',Georgia,serif;
  --ease:cubic-bezier(.16,1,.3,1);
  --shadow-sm:0 1px 2px rgba(21,19,15,.05);
  --shadow-md:0 8px 24px -10px rgba(21,19,15,.22);
  --shadow-lg:0 18px 50px -18px rgba(21,19,15,.32);
  --shadow-xl:0 30px 80px -24px rgba(21,19,15,.45);
}
html body.dark-theme {
  --cream:#0B1214; --paper:#101A1C; --paper2:#162326;
  --ink:#ECE5D5; --ink2:#D8D1C1; --muted:#8A938E; --muted2:#A3ABA6;
  --accent:#E27A3F; --accent-hover:#F08D52; --accent-glow:rgba(226,122,63,.42); --accent-soft:rgba(226,122,63,.13);
  --teal:#74D3C3;
  --border:rgba(236,229,213,.08); --border-strong:rgba(236,229,213,.14); --border-accent:rgba(226,122,63,.38);
  --glass:rgba(8,13,15,.72); --glass-2:rgba(10,16,18,.9); --glass-line:rgba(236,229,213,.09); --glass-rim:rgba(236,229,213,.07);
  --glass-bg-dark:rgba(4,8,9,.9);
  --float:0 1px 0 var(--glass-rim) inset, 0 22px 60px -20px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.2);
  --shadow-md:0 8px 24px -10px rgba(0,0,0,.6);
  --shadow-lg:0 18px 50px -18px rgba(0,0,0,.7);
  --shadow-xl:0 30px 80px -24px rgba(0,0,0,.85);
}
html body { background:#05090A; font-family:'DM Sans',system-ui,sans-serif; }
html body ::selection { background:var(--accent); color:#fff; }
html body ::-webkit-scrollbar { width:6px; height:6px; }
html body ::-webkit-scrollbar-thumb { background:var(--border-strong); border-radius:6px; }
html body ::-webkit-scrollbar-thumb:hover { background:var(--accent); }
html body :focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* glass, used by every floating surface */
html body #dash-header, html body #left-panel, html body #right-panel.open, html body #bottom-bar,
html body #map-tabs, html body .icon-flyout, html body #tabs-menu, html body #coverage-notice,
html body #aoi-context-menu {
  background:var(--glass) !important;
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  border:1px solid var(--glass-line) !important;
  box-shadow:var(--float) !important;
}

html body { --glass-solid:rgba(246,242,233,.96); }
html body.dark-theme { --glass-solid:rgba(9,14,16,.95); }
html body #bottom-bar, html body #right-panel.open { background:var(--glass-solid) !important; -webkit-backdrop-filter:none; backdrop-filter:none; }

/* ── 2. The shell: full-bleed map, floating panels ── */
html body #dash-shell { top:0 !important; }
html body #map-wrapper { background:#05090A; }
/* a soft vignette so glass reads over any imagery */
html body #map-wrapper::after { content:''; position:absolute; inset:0; z-index:5; pointer-events:none;
  background:linear-gradient(180deg, rgba(3,6,7,.42) 0%, rgba(3,6,7,0) 16%, rgba(3,6,7,0) 76%, rgba(3,6,7,.38) 100%); }
html body:not(.dark-theme) #map-wrapper::after { background:linear-gradient(180deg, rgba(21,19,15,.22) 0%, rgba(21,19,15,0) 15%, rgba(21,19,15,0) 80%, rgba(21,19,15,.2) 100%); }

/* header → a floating command bar */
html body #dash-header {
  top:var(--gap); left:var(--gap); right:var(--gap); height:58px; border-radius:var(--r-lg);
  padding:0 10px 0 8px; z-index:320; animation:wsDrop .9s var(--ease) both;
}
html body #dash-header::after { display:none; }
@keyframes wsDrop { from { opacity:0; } to { opacity:1; } }
html body .header-left { gap:10px; }
html body .back-btn { width:40px; height:40px; padding:0; justify-content:center; border-radius:12px; border-color:var(--glass-line); }
html body .back-btn span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
html body .back-btn::before { border-radius:inherit; }
html body .header-brand { border-left:0; padding-left:2px; gap:10px; }
html body .hdr-mark { width:34px; height:34px; border-radius:50%; display:block; box-shadow:0 0 0 1px var(--glass-line); transition:transform .9s var(--ease); }
html body .header-brand:hover .hdr-mark { transform:rotate(-24deg); }
html body .header-logo { font-family:var(--serif); font-size:19px; letter-spacing:.06em; }
html body .header-sep { color:var(--muted); opacity:.5; }
html body .header-title { font-family:var(--mono); font-size:10px; letter-spacing:.24em; color:var(--muted); }
/* left · centre · right in normal flow — the centre takes only the room between, so nothing overlaps */
html body .header-center { position:static !important; left:auto !important; transform:none !important; flex:1 1 auto; min-width:0; justify-content:center; gap:12px !important; padding:0 12px; }
html body .header-left, html body .header-right { flex-shrink:0; }
html body #hdr-coord-display { font-family:var(--mono) !important; font-size:10.5px !important; padding:7px 12px; border-radius:999px; background:var(--accent-soft); color:var(--ink) !important; }
html body .header-right { gap:8px !important; }
html body .header-right > div:first-child { font-family:var(--mono); font-size:9.5px !important; letter-spacing:.2em !important; background:transparent !important; border-color:var(--glass-line) !important; padding:7px 12px !important; }
html body #theme-toggle-btn { width:40px; height:40px; border-radius:12px; border-color:var(--glass-line); }
html body #theme-toggle-btn::before { border-radius:inherit; }

/* the command search */
html body #ws-search { display:flex; align-items:center; gap:10px; height:40px; min-width:min(380px,32vw); padding:0 8px 0 14px; border-radius:12px; cursor:pointer;
  border:1px solid var(--glass-line); background:rgba(127,127,127,.06); color:var(--muted); font:400 12.5px 'DM Sans',sans-serif; transition:border-color .25s, background .25s, color .25s; }
html body #ws-search:hover { border-color:var(--border-accent); color:var(--ink); background:var(--accent-soft); }
html body #ws-search svg { width:15px; height:15px; stroke:currentColor; fill:none; flex-shrink:0; }
html body #ws-search span { flex:1; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html body #ws-search kbd { font:500 9.5px var(--mono); letter-spacing:.08em; padding:4px 7px; border-radius:7px; border:1px solid var(--glass-line); color:var(--muted); background:var(--glass-2); }

/* profile pill */
html body #user-profile-pill { border-radius:999px !important; border-color:var(--glass-line) !important; background:transparent !important; height:40px; }
html body .up-dropdown { border-radius:16px !important; background:var(--glass-2) !important; -webkit-backdrop-filter:blur(22px); backdrop-filter:blur(22px); border:1px solid var(--glass-line) !important; box-shadow:var(--shadow-xl) !important; overflow:hidden; }
html body .up-dd-item { border-radius:10px; margin:0 6px; }

/* left tool dock */
html body #left-panel {
  position:absolute !important; top:calc(var(--gap) + 58px + var(--gap)); left:var(--gap); bottom:auto;
  max-height:calc(100% - 58px - 3 * var(--gap) - var(--bottombar-h) - var(--gap)); z-index:60;
  border-radius:var(--r-lg); transition:width .5s var(--ease), max-height .5s var(--ease);
  animation:wsSlideL 1s .1s var(--ease) both;
}
@keyframes wsSlideL { from { opacity:0; transform:translate3d(-18px,0,0); } to { opacity:1; transform:none; } }
html body #left-panel::before { display:none; }
html body #left-panel .panel-header { border-bottom:1px solid var(--glass-line); background:transparent !important; }
html body #left-panel .panel-title { font-family:var(--mono); font-size:9.5px; letter-spacing:.24em; }
html body #left-panel .panel-body { padding-bottom:8px; }
html body .tool-section-label { font-family:var(--mono); font-size:9px !important; letter-spacing:.22em !important; color:var(--muted) !important; }
html body .tool-btn { border-radius:12px; margin:2px 6px; width:calc(100% - 12px); transition:background .25s, color .25s, transform .35s var(--ease); }
html body .tool-btn:hover { background:var(--accent-soft) !important; color:var(--ink) !important; transform:translateX(2px); }
html body .tool-btn.active, html body .tool-btn[aria-pressed="true"] { background:var(--ink) !important; color:var(--cream) !important; }
html body .tool-btn .tool-icon { transition:transform .5s var(--ease); }
html body .tool-btn:hover .tool-icon { transform:scale(1.12); }
html body #left-panel.collapsed .tool-btn::after { border-radius:8px; background:var(--glass-2) !important; color:var(--ink) !important; border:1px solid var(--glass-line); border-left:2px solid var(--accent); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); box-shadow:var(--shadow-md); }
html body #drop-zone { border-radius:14px !important; border-style:dashed !important; border-color:var(--border-strong) !important; background:rgba(127,127,127,.05) !important; transition:border-color .3s, background .3s; }
html body #drop-zone:hover { border-color:var(--accent) !important; background:var(--accent-soft) !important; }
html body .tool-divider { background:var(--glass-line) !important; }
html body #legend-box { border-radius:12px; }
html body .legend-bar { border-radius:6px; height:10px; }

/* right analysis sheet */
html body #map-row { position:relative; }
html body #right-panel { position:absolute !important; top:calc(var(--gap) + 58px + var(--gap)); right:var(--gap); bottom:calc(var(--bottombar-h) + 2 * var(--gap));
  z-index:55; border-radius:var(--r-lg); transition:width .55s var(--ease), opacity .4s; }
html body #right-panel:not(.open) { opacity:0; pointer-events:none; border:0 !important; }
html body #right-panel.open { width:var(--rightpanel-w); }
html body .right-panel-header { background:transparent !important; border-bottom:1px solid var(--glass-line) !important; padding:8px !important; height:auto !important; gap:4px !important; }
html body .right-panel-header::after { display:none; }
html body .rp-tab-btn { border:0 !important; border-radius:10px; padding:9px 10px !important; font-family:var(--mono); font-size:9px !important; letter-spacing:.14em !important; transition:background .25s, color .25s; }
html body .rp-tab-btn:hover { background:var(--accent-soft); color:var(--ink); }
html body .rp-tab-btn.active { background:var(--ink) !important; color:var(--cream) !important; }
html body .rp-tab-btn.active svg { stroke:var(--cream); }
html body #right-close-btn { border-radius:10px; }
html body .rp-layer-badge, html body .dl-layer-strip { background:transparent !important; border-radius:14px; margin:10px; border:1px solid var(--glass-line); }
html body .rp-badge-name, html body .dl-strip-name { font-family:var(--serif); font-size:20px !important; font-weight:400 !important; }
html body .rp-stat-cell { border-radius:12px; background:rgba(127,127,127,.06) !important; border:1px solid var(--glass-line) !important; }
html body .rp-stat-cell-value { font-family:var(--serif); }
html body .rp-section-title { font-family:var(--mono); letter-spacing:.2em !important; }
html body .rp-chart-wrap { border-radius:12px; }
html body .dl-option-card { border-radius:14px !important; background:rgba(127,127,127,.05) !important; border:1px solid var(--glass-line) !important; transition:border-color .3s, transform .45s var(--ease), background .3s; }
html body .dl-option-card:hover { border-color:var(--border-accent) !important; transform:translateY(-2px); background:var(--accent-soft) !important; }
html body .dl-go-btn { border-radius:10px !important; }
html body .code-pre { border-radius:12px; }
html body .code-act { border-radius:8px; }

/* bottom layers dock */
html body #bottom-bar { position:absolute !important; left:var(--gap); right:var(--gap); bottom:var(--gap); z-index:65; border-radius:20px; overflow:hidden;
  animation:wsRise 1s .15s var(--ease) both; transition:box-shadow .4s; }
@keyframes wsRise { from { opacity:0; transform:translate3d(0,18px,0); } to { opacity:1; transform:none; } }
html body #bottom-collapsed { padding:0 10px; gap:10px; }
html body #layers-trigger-card { border-radius:14px; background:var(--ink) !important; color:var(--cream); border:0; padding:9px 16px 9px 9px; box-shadow:0 10px 26px -12px rgba(0,0,0,.6); }
html body #layers-trigger-card .ltc-label, html body #layers-trigger-card .ltc-icon { color:var(--cream); stroke:var(--cream); }
html body #layers-trigger-card .ltc-chevron { stroke:var(--cream); }
html body #layers-trigger-card:hover { transform:translateY(-1px); box-shadow:0 14px 30px -12px var(--accent-glow); }
html body #layers-trigger-card::before { background:var(--accent); }
html body #layers-trigger-card:hover::before { opacity:.25; }
html body .ltc-thumb { border-radius:6px; width:40px; height:26px; }
html body #bottom-bar.aoi-locked #layers-trigger-card { opacity:.8; }
html body #bottom-bar.aoi-locked #layers-trigger-card:hover { background:var(--ink) !important; }
html body .ltc-lock { background:rgba(255,255,255,.12) !important; border-color:rgba(255,255,255,.18) !important; color:var(--cream) !important; }
html body .ltc-lock svg { stroke:var(--cream) !important; }
html body .tpp-value { border-radius:999px !important; font-family:var(--mono); }
html body .tpp-label { font-family:var(--mono); }
html body #bottom-bar.open #layers-expanded { height:330px; }
html body #layers-panel-header { background:transparent !important; border-bottom:1px solid var(--glass-line) !important; padding:6px 6px 6px 4px; min-height:50px; }
html body #sat-tabs { gap:6px; padding:2px 4px; scrollbar-width:none; }
html body #sat-tabs::-webkit-scrollbar { display:none; }
html body .tabs-nav { border:0 !important; border-radius:10px; width:34px; }
html body .sat-tab { border:1px solid var(--glass-line) !important; border-radius:999px; padding:0 14px !important; height:34px; align-self:center; font-size:10px !important; letter-spacing:.06em !important; background:transparent !important; color:var(--muted) !important; transition:background .25s, color .25s, border-color .25s, transform .35s var(--ease); }
html body .sat-tab::before { display:none; }
html body .sat-tab:hover { color:var(--ink) !important; border-color:var(--border-strong) !important; transform:translateY(-1px); }
html body .sat-tab.active { background:var(--ink) !important; color:var(--cream) !important; border-color:var(--ink) !important; font-weight:600 !important; }
html body .sat-tab.active .sat-tab-n { background:rgba(255,255,255,.18); color:var(--cream); }
html body .lph-controls { border-left:0 !important; }
html body #layers-hide-btn { border-radius:10px; font-family:var(--mono); }
html body #time-bar { border-bottom:1px solid var(--glass-line) !important; background:transparent !important; gap:6px; padding:6px 10px; min-height:48px; }
html body #time-mode-tabs { border:1px solid var(--glass-line) !important; border-radius:12px; padding:3px; gap:2px; background:rgba(127,127,127,.06); }
html body .time-mode-btn { border-radius:9px !important; border:0 !important; font-family:var(--mono); font-size:9px !important; letter-spacing:.16em !important; padding:0 14px !important; height:30px; transition:background .25s, color .25s; }
html body .time-mode-btn.active { background:var(--ink) !important; color:var(--cream) !important; }
html body .tp-select, html body .tp-input { border-radius:10px !important; border-color:var(--glass-line) !important; background:var(--glass-2) !important; height:32px; font-family:var(--mono); }
html body #time-apply-btn, html body .time-apply-btn-shared { border-radius:10px !important; background:var(--accent) !important; height:32px; box-shadow:0 8px 20px -10px var(--accent-glow); }
html body .month-chip { border-radius:999px !important; }
html body .month-chip.active { background:var(--ink) !important; color:var(--cream) !important; border-color:var(--ink) !important; }
html body .xbar { background:transparent !important; border-bottom:1px solid var(--glass-line) !important; padding:8px 12px !important; gap:8px !important; }
html body #cat-search { border-radius:12px !important; border:1px solid var(--glass-line) !important; background:var(--glass-2) !important; height:36px; padding:0 14px 0 38px !important; font-size:12.5px !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.8'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important; background-size:15px !important; background-position:13px 50% !important; transition:border-color .25s, box-shadow .25s; }
html body #cat-search:focus { border-color:var(--accent) !important; box-shadow:0 0 0 4px var(--accent-soft) !important; outline:none; }
html body .xbar select { border-radius:10px; }
html body .lscroll-btn { background:transparent !important; border:0 !important; }
html body .lscroll-btn:hover { background:var(--accent-soft) !important; }
html body #layers-scroll-inner { padding:14px 14px 16px !important; }
html body #layer-cards-track { gap:14px !important; }
html body #layers-lock-overlay { background:rgba(var(--lock-rgb,247,243,234),.72) !important; -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
html body.dark-theme #layers-lock-overlay { --lock-rgb:8,13,15; }
html body .lock-overlay-btn { border-radius:12px !important; padding:10px 18px !important; }

/* layer cards — larger, image-led, with depth */
html body .layer-card { min-width:168px !important; max-width:168px !important; border-radius:16px !important; border:1px solid var(--glass-line) !important; background:var(--glass-2) !important;
  box-shadow:0 10px 26px -16px rgba(0,0,0,.45) !important; transition:transform .55s var(--ease), box-shadow .4s, border-color .3s !important; transform-origin:50% 100%; }
html body .layer-card:hover { transform:translate3d(0,-6px,0) scale(1.03) !important; border-color:var(--border-accent) !important; box-shadow:0 26px 40px -22px rgba(0,0,0,.6), 0 0 0 1px var(--border-accent) !important; }
html body .layer-card.selected { border-color:var(--accent) !important; box-shadow:0 0 0 2px var(--accent), 0 22px 40px -18px var(--accent-glow) !important; }
html body .layer-card .lc-thumb { aspect-ratio:16/10; }
html body .layer-card .lc-thumb::after { content:''; position:absolute; inset:0; background:linear-gradient(180deg, transparent 45%, rgba(0,0,0,.55)); pointer-events:none; }
html body .layer-card .lc-thumb-img { transition:transform .9s var(--ease), filter .4s !important; }
html body .layer-card:hover .lc-thumb-img { transform:scale(1.12) !important; }
html body .lc-thumb-label { z-index:2; font-family:var(--serif) !important; font-size:16px !important; font-weight:500 !important; }
html body .lc-name { font-size:11.5px !important; }
html body .cat-divider { border-left:2px solid var(--accent); border-radius:2px; }
html body .cat-divider b { font-family:var(--serif); font-size:17px; font-weight:400; }
html body .cat-more { border-radius:16px !important; }
html body:has(#bottom-bar.open) #right-panel { bottom:calc(var(--bottombar-h) + 330px + var(--gap)); }
html body:has(#bottom-bar.open) #left-panel { max-height:calc(100% - 58px - 3 * var(--gap) - 330px - var(--gap)); }

/* layers open on the map: floating tabs under the command bar */
html body #map-tabs { top:calc(var(--gap) + 58px + var(--gap)) !important; left:calc(var(--gap) + var(--sidebar-collapsed-w) + var(--gap)) !important; right:auto !important;
  max-width:calc(100% - var(--sidebar-collapsed-w) - var(--rightpanel-w) - 5 * var(--gap)); height:44px !important; border-radius:14px; padding:0 0 0 6px !important; align-items:center !important; }
html body #map-tabs-tools { border-left:1px solid var(--glass-line) !important; }
html body #map-tabs { transition:left .5s var(--ease), max-width .5s var(--ease); }
html body:has(#left-panel:not(.collapsed)) #map-tabs { left:calc(var(--gap) + var(--sidebar-w) + var(--gap)) !important; max-width:calc(100% - var(--sidebar-w) - var(--rightpanel-w) - 5 * var(--gap)); }
html body:has(#right-panel:not(.open)) #map-tabs { max-width:calc(100% - var(--sidebar-collapsed-w) - 4 * var(--gap)); }

/* floating toasts and notices */
html body #processing-toast { top:calc(var(--gap) + 58px + var(--gap) + 6px) !important; background:var(--glass-2) !important; color:var(--ink) !important; border:1px solid var(--glass-line) !important; border-left:0 !important;
  -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px); padding:10px 18px 10px 14px !important; box-shadow:var(--shadow-lg) !important; }
html body .toast-spinner { border-color:var(--border-strong) !important; border-top-color:var(--accent) !important; }
html body #notify { top:calc(var(--gap) + 58px + var(--gap)) !important; right:var(--gap) !important; border-radius:14px !important; border-left:0 !important; padding:13px 16px 13px 18px !important;
  background:var(--glass-2) !important; color:var(--ink) !important; -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px); border:1px solid var(--glass-line) !important; box-shadow:var(--shadow-xl) !important; }
html body #notify::before { content:''; position:absolute; left:6px; top:12px; bottom:12px; width:3px; border-radius:3px; background:var(--accent); }
html body #notify.error::before { background:#E2554A; }
html body #coverage-notice { border-radius:16px !important; border-left:0 !important; }
html body #draw-status-bar { border-radius:999px !important; border-left:0 !important; background:var(--glass-2) !important; color:var(--ink) !important; border:1px solid var(--glass-line) !important; }
html body .icon-flyout { border-radius:14px !important; padding:6px !important; }
html body .flyout-item { border-radius:10px; }
html body #tabs-menu { border-radius:18px !important; padding:10px !important; }
html body #tabs-menu button { border-radius:10px; }

/* modals */
html body #param-info-modal, html body #aoi-props-modal, html body .ak-modal { border-radius:22px !important; overflow:hidden; border:1px solid var(--glass-line) !important; box-shadow:var(--shadow-xl) !important; }
html body #param-info-overlay, html body #aoi-props-backdrop, html body .ak-overlay { -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); }
html body #dl-modal { border-radius:24px !important; background:linear-gradient(160deg, #10191B, #070C0D) !important; }
html body .dl-modal-logo span, html body .loading-logo span { color:#E27A3F; }

/* ── 2b. The analysis sheet: full height, resizable, two columns when wide ── */
/* beside the dock rather than above it, so the sheet keeps the whole height */
@media (min-width:769px) {
  html body #right-panel, html body:has(#bottom-bar.open) #right-panel { bottom:var(--gap); }
  html body:has(#right-panel.open) #bottom-bar { right:calc(var(--rightpanel-w) + 2 * var(--gap)); }
}
html body #bottom-bar { transition:box-shadow .4s, right .55s var(--ease); }
html body.rp-dragging #right-panel, html body.rp-dragging #bottom-bar, html body.rp-dragging #map-tabs { transition:none !important; }
html body.rp-dragging { cursor:ew-resize; user-select:none; }
html body.rp-dragging #right-panel .rp-chart-wrap { pointer-events:none; }

/* resize grip on the left edge */
html body #rp-resize { position:absolute; left:0; top:0; bottom:0; width:10px; cursor:ew-resize; z-index:6; touch-action:none; }
html body #rp-resize::after { content:''; position:absolute; left:3px; top:50%; width:4px; height:44px; margin-top:-22px; border-radius:4px;
  background:var(--border-strong); opacity:0; transition:opacity .25s, background .25s, height .35s var(--ease), margin-top .35s var(--ease); }
html body #right-panel:hover #rp-resize::after { opacity:1; }
html body #rp-resize:hover::after, html body.rp-dragging #rp-resize::after { background:var(--accent); height:80px; margin-top:-40px; opacity:1; }
@media (max-width:768px) { html body #rp-resize { display:none; } }

/* header: tabs scroll if they must, expand + close stay put */
html body .right-panel-header { overflow-x:auto; scrollbar-width:none; }
html body .right-panel-header::-webkit-scrollbar { display:none; }
html body .rp-tab-btn { flex-shrink:0; }
html body #right-panel:not(.rp-2col) .rp-tab-btn { padding:9px 8px !important; letter-spacing:.1em !important; }
html body #right-panel:not(.rp-2col) .rp-tab-btn:not(.active) svg { display:none; }
html body #rp-wide-btn { width:30px; height:30px; margin:auto 0 auto auto; flex-shrink:0; display:flex; align-items:center; justify-content:center; cursor:pointer;
  border:1px solid var(--glass-line); border-radius:10px; background:transparent; color:var(--muted); transition:color .25s, border-color .25s, background .25s; }
html body #rp-wide-btn:hover { color:var(--ink); border-color:var(--border-accent); background:var(--accent-soft); }
html body #rp-wide-btn svg { width:13px; height:13px; }
html body #rp-wide-btn .i-in, html body #rp-wide-btn.is-wide .i-out { display:none; }
html body #rp-wide-btn.is-wide .i-in { display:inline; }
html body #right-close-btn { width:30px; height:30px; margin:auto 0 auto 4px; border-color:var(--glass-line); }
@media (max-width:768px) { html body #rp-wide-btn { display:none; } html body #right-close-btn { margin-left:auto; } }

/* columns: stacked in a compact sheet, side by side in a wide one */
html body .rpc { display:contents; }
html body #stats-content .rp-info-table { order:9; }
html body #right-panel.rp-2col #stats-content.show { display:grid; grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr); align-items:start; gap:0 4px; padding:0 4px 10px; }
html body #right-panel.rp-2col .rpc { display:flex; flex-direction:column; min-width:0; }
html body #right-panel.rp-2col .rpc-b { border-left:1px solid var(--glass-line); padding-left:4px; }

/* bigger, calmer type */
html body .rp-section-head { padding:16px 14px 8px; }
html body .rp-section-title { font-size:9.5px !important; }
html body .rp-section-meta { font-size:10.5px; }
html body .rp-badge-meta { font-size:10.5px; }
html body .rp-scale-labels { font-size:10.5px; }
html body .rp-stat-row { background:transparent; border:0; gap:8px; padding:0 10px 4px; }
html body .rp-stat-cell-label { font-size:9px; }
html body .rp-stat-cell-unit { font-size:10.5px; }
html body .rp-aoistats { gap:8px; background:transparent; border:0; padding:0 10px 2px; }
html body .rp-aoistats .st, html body.dark-theme .rp-aoistats .st { background:rgba(127,127,127,.06); border:1px solid var(--glass-line); border-radius:12px; padding:10px 12px 11px; transition:border-color .25s, background .25s; }
html body .rp-aoistats .st:hover { border-color:var(--border-accent); background:var(--accent-soft); }
html body .rp-aoistats .st:first-child { border-color:var(--border-accent); background:var(--accent-soft); }
html body .rp-aoistats .st-k { font:500 9px var(--mono); letter-spacing:.16em; }
html body .rp-aoistats .st-v { font-family:var(--serif); font-size:22px; font-weight:500; line-height:1.1; margin-top:5px; font-variant-numeric:lining-nums tabular-nums; }
html body .rp-aoistats .st-msg, html body.dark-theme .rp-aoistats .st-msg { background:transparent; border:1px dashed var(--glass-line); border-radius:12px; font-size:11.5px; line-height:1.5; padding:12px 14px; }
html body .rp-chart-wrap { padding:0 12px 12px; }
/* distribution · time series (2nd child) · annual trend (4th child) */
html body #rp-hist-wrap, html body #rp-time-sections > .rp-chart-wrap:nth-child(2) { height:210px !important; }
html body #rp-time-sections > .rp-chart-wrap:nth-child(4) { height:180px !important; }
html body #right-panel.rp-2col #rp-hist-wrap { height:270px !important; }
html body #right-panel.rp-2col #rp-time-sections > .rp-chart-wrap:nth-child(2) { height:260px !important; }
html body #right-panel.rp-2col #rp-time-sections > .rp-chart-wrap:nth-child(4) { height:220px !important; }
html body .rp-chart-msg { font-size:11px; }
html body .rp-class-row { font-size:11.5px; padding:6px 14px; grid-template-columns:12px 1fr auto auto; gap:8px; }
html body .rp-class-row .sw { width:12px; height:12px; border-radius:3px; }
html body .rp-info-table { font-size:11.5px; }
html body .rp-about { border-radius:12px; background:rgba(127,127,127,.05); border-color:var(--glass-line); }
html body .rp-about-text { font-size:12.5px; }

/* ── 3. The opening: the logo is scanned in, as on the home page ── */
html body #map-loading { background:radial-gradient(ellipse at 50% 45%, #0B1416, #030607 70%) !important; gap:26px; }
.ws-load-logo { position:relative; width:112px; height:112px; }
.ws-load-logo svg { position:absolute; inset:-16%; width:132%; height:132%; transform:rotate(-90deg); overflow:visible; }
.ws-load-logo circle { fill:none; stroke:rgba(236,229,213,.1); stroke-width:.8; }
.ws-load-logo circle.tk { stroke:#E27A3F; stroke-width:1.4; stroke-linecap:round; stroke-dasharray:610; stroke-dashoffset:610; animation:wsRing 1.4s .1s cubic-bezier(.76,0,.24,1) forwards, wsRingSpin 6s 1.5s linear infinite; transform-origin:50% 50%; filter:drop-shadow(0 0 6px rgba(226,122,63,.7)); }
@keyframes wsRing { to { stroke-dashoffset:200; } }
@keyframes wsRingSpin { to { transform:rotate(360deg); } }
.ws-load-logo .disc { position:absolute; inset:0; border-radius:50%; overflow:hidden; box-shadow:0 0 0 1px rgba(236,229,213,.12), 0 0 80px rgba(226,122,63,.16); }
.ws-load-logo .disc img { position:absolute; inset:0; width:100%; height:100%; }
.ws-load-logo .disc img.ghost { opacity:.14; filter:blur(2px); }
.ws-load-logo .disc img.real { clip-path:inset(0 0 100% 0); animation:wsScan 1.4s .55s cubic-bezier(.45,0,.35,1) forwards; }
.ws-load-logo .disc i { position:absolute; left:-10%; right:-10%; top:0; height:2px; background:#F0A06B; box-shadow:0 0 14px 2px #E27A3F; opacity:0; animation:wsScanL 1.4s .55s cubic-bezier(.45,0,.35,1) forwards; }
@keyframes wsScan { to { clip-path:inset(0 0 0 0); } }
@keyframes wsScanL { 0% { top:0; opacity:1; } 92% { opacity:1; } 100% { top:100%; opacity:0; } }
html body #map-loading .loading-logo { display:none; }
html body #map-loading .loading-sub { font-family:var(--mono); letter-spacing:.34em; color:rgba(236,229,213,.5); }
html body #map-loading .loading-bar { width:180px; background:rgba(236,229,213,.1); }

/* ── 3b. The opening is shared: css/gis-loader.css + js/gis-loader.js. The panels wait for it. ── */
html body #map-loading { display:none !important; }
html.gl-booting body #dash-header, html.gl-booting body #left-panel, html.gl-booting body #bottom-bar { animation-play-state:paused; }

/* ── 4. Responsive ── */
/* the loading toast sits under the layer tabs, never behind them */
html body:has(#map-tabs.show) #processing-toast { top:calc(3 * var(--gap) + 58px + 44px) !important; }
html body #processing-toast { z-index:610 !important; max-width:calc(100% - 2 * var(--sidebar-collapsed-w) - 6 * var(--gap)); }
@media (min-width:769px) {
  html body:has(#right-panel.open) #processing-toast { left:calc(50% + (var(--sidebar-collapsed-w) - var(--rightpanel-w)) / 2) !important;
    max-width:calc(100% - var(--sidebar-collapsed-w) - var(--rightpanel-w) - 6 * var(--gap)); }
}
html body #processing-text { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
/* the dataset search row stays on one line; the count gives way first */
@media (min-width:769px) {
  html body #bottom-bar .xbar { flex-wrap:nowrap; }
  html body #cat-search { flex:1 1 220px !important; min-width:140px !important; }
  html body #bottom-bar .xbar select { flex:0 1 150px; min-width:96px; }
  html body #bottom-bar .xbar-meta { flex:0 1 auto; min-width:0; }
  html body .xbar-chk { flex-shrink:0; }
}
@media (max-width:1280px) { html body #bottom-bar .xbar-meta { display:none; } }
/* cards fill the dock's height: the picture gives way, the name never gets cut */
html body .layer-card .lc-thumb { aspect-ratio:auto !important; flex:1 1 auto !important; min-height:52px; }
html body #layers-scroll-inner { min-height:0; }
@media (max-height:760px) and (min-width:769px) {
  html body #bottom-bar.open #layers-expanded { height:300px; }
  html body:has(#bottom-bar.open) #left-panel { max-height:calc(100% - 58px - 3 * var(--gap) - 300px - var(--gap)); }
  html body #layers-scroll-inner { padding:10px 12px 12px !important; }
}
html body #ws-search { flex:0 1 380px; min-width:0 !important; }
@media (max-width:1250px) { html body #hdr-coord-display { display:none !important; } }
@media (max-width:1100px) { html body .header-sep, html body .header-title { display:none; } }
@media (max-width:960px) {
  html body #ws-search { flex:0 0 40px; width:40px; padding:0; justify-content:center; }
  html body #ws-search span, html body #ws-search kbd { display:none; }
  html body .up-name { display:none; }
}
@media (max-width:768px) {
  html body { --gap:8px; --rightpanel-w:min(340px, calc(100vw - 16px)); }
  html body #dash-header { height:54px; padding:0 6px; }
  html body #left-panel { top:calc(var(--gap) + 54px + var(--gap)); }
  html body #right-panel { top:calc(var(--gap) + 54px + var(--gap)); }
  html body .header-center { display:flex !important; padding:0 6px; justify-content:flex-end; }
  html body #ws-search { width:40px; padding:0; justify-content:center; }
  html body #ws-search kbd { display:none; }
  html body .header-right > div:first-child { display:none !important; }
  html body .layer-card { min-width:140px !important; max-width:140px !important; }
  html body #map-tabs { max-width:calc(100% - var(--sidebar-collapsed-w) - 3 * var(--gap)); }
  html body #bottom-bar.open #layers-expanded { height:410px; }
  html body:has(#bottom-bar.open) #left-panel { max-height:calc(100% - 54px - 3 * var(--gap) - 410px - var(--gap)); }
  /* the analysis sheet: a full sheet under the command bar, over the dock */
  html body #right-panel.open { top:calc(var(--gap) + 54px + var(--gap)) !important; right:var(--gap) !important; bottom:var(--gap) !important;
    width:calc(100vw - 2 * var(--gap)) !important; z-index:650; }
}
@media (prefers-reduced-motion: reduce) {
  html body #dash-header, html body #left-panel, html body #bottom-bar { animation:none; }
}
