/* Rendero Map Engine viewer. Brand: civil, crisp, minimal. White base, ink
   text, purple only as the accent (focus, the proposal). No font files are
   bundled: Inter and Britti Sans are used when installed, system UI fonts
   otherwise.

   Layout (README "Layout"): map first. The canvas is the whole viewport at
   every width and never resizes when chrome changes; every control floats
   over it (class `chrome`). JS writes --chrome-top / --chrome-bottom (the
   band of the floating rows), --credits-h and --drawer-space; the drawer,
   popovers, toast and measure chip sit between them. Floating surfaces are
   opaque white at 96 % with a hairline: no backdrop-filter (it re-composites
   over the WebGL canvas every frame while orbiting). */
:root {
  --white: #ffffff;
  --ink: #0d0d0d;
  --ink-hover: #1a1a1a;
  --muted: #7f7e8e;        /* icons, borders, text of 18 px or more */
  --muted-text: #5f5e6b;   /* small text: 6.4:1 on white, 5.9:1 on --soft, 5.2:1 on --purple-tint */
  --hair: #f1f1f1;
  --hair-strong: #e6e6e9;  /* existing rules only; new components use --hair / --line */
  --line: rgba(13, 13, 13, 0.10);
  --line-2: rgba(13, 13, 13, 0.16);
  --soft: #f6f7f3;
  --soft-2: #edefe7;
  --purple: #5f4cec;
  --purple-ink: #3b2db8;
  --purple-light: #c6b2ff;
  --purple-tint: #ece5ff;
  --ok: #2f7d55;
  --ok-tint: #e3f2ea;
  --bad: #b5402e;
  --bad-tint: #f8e6e2;
  --na: #7f7e8e;
  --na-tint: #f1f1f3;
  --glass: rgba(255, 255, 255, 0.96);
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 5px 24px rgba(0, 0, 0, 0.03);
  --shadow-float: 0 5px 24px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --lift: 0 6px 20px rgba(0, 0, 0, 0.09), 0 1px 2px rgba(0, 0, 0, 0.07);
  --lift-strong: 0 14px 36px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Britti Sans', 'Inter', ui-sans-serif, system-ui, sans-serif;
  /* layout */
  --gap: 12px;
  --row1: var(--gap);                         /* row 1 top */
  --h1: 40px;                                 /* row 1 height */
  --row2: calc(var(--row1) + var(--h1) + 8px); /* row 2 top */
  --h2: 32px;                                 /* row 2 height */
  --layers-w: 110px;
  --drawer-w: 372px;
  --drawer-space: 0px;                        /* drawer width + gap while it is open (JS) */
  --tb-shift: 0px;                            /* the time pill centres left of the drawer when there is room (JS) */
  --chrome-top: 104px;                        /* measured by JS */
  --chrome-bottom: 92px;                      /* measured by JS */
  --credits-h: 26px;                          /* measured by JS */
  --band: calc(var(--credits-h) + 10px);      /* bottom of the floating bottom band */
  --tb-w: 480px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  background: #eef0ec;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--purple); }
.muted { color: var(--muted); }
.muted-text { color: var(--muted-text); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.small.muted, .tiny.muted, .muted.small, .muted.tiny { color: var(--muted-text); }
.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; }
.skips { position: fixed; left: 8px; top: 8px; z-index: 100; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--radius-s); white-space: nowrap; text-decoration: none; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: #fff; color: var(--ink); }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.caret { width: 14px; height: 14px; opacity: 0.6; }

/* ------------------------------------------------------------- buttons, badges */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-s); border: 1px solid transparent;
  padding: 7px 12px; cursor: pointer; background: transparent; line-height: 1.1; white-space: nowrap;
}
.btn.primary { background: var(--ink); color: var(--white); font-weight: 500; }
.btn.primary:hover { background: var(--ink-hover); }
.btn.primary:disabled { background: var(--muted); cursor: progress; }
.btn.ghost { color: var(--ink); }
.btn.ghost:hover { background: var(--soft); }
.btn.outline { border-color: var(--hair-strong); background: var(--white); }
.btn.outline:hover { border-color: var(--purple-light); }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.accent { background: var(--purple); color: #fff; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hair-strong); background: var(--white);
  display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn .ico { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.icon-btn .pause { display: none; }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.icon-btn[aria-pressed="true"] .pause { display: block; }
.icon-btn[aria-pressed="true"] .play { display: none; }
.link-btn { border: 0; background: transparent; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-color: var(--purple-light); text-underline-offset: 2px; }
.link-btn:hover { text-decoration-color: var(--purple); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; background: var(--soft-2); color: var(--ink); white-space: nowrap;
}
.badge.accent { background: var(--purple-tint); color: var(--purple-ink); }
.badge.outline { background: var(--white); border: 1px solid var(--hair-strong); color: var(--muted-text); }
.badge.ok { background: var(--ok-tint); color: var(--ok); }
.badge.bad { background: var(--bad-tint); color: var(--bad); }
.badge.na { background: var(--na-tint); color: var(--muted-text); }
.badge.caution { background: #fff6dd; color: #6b4a00; }
.badge.measured { background: #2b2b31; color: #fff; }
.badge.measured.lidar { background: #2f5d78; } /* same hue as the lidar class in Height provenance */
.badge.measured.city { background: #3f6f52; } /* same hue as the city 3D model class in Height provenance */
.badge.estimate { background: #e3e3e8; color: #33333a; }
.badge.default { background: var(--white); color: #33333a; border: 1px dashed #9c9ca6; }
.tip { position: relative; cursor: help; }
.tooltip {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 280px; z-index: 40;
  padding: 10px 12px; background: var(--ink); color: #fff; border-radius: var(--radius-s); font-weight: 400; font-size: 12px;
  line-height: 1.45; white-space: normal; opacity: 0; pointer-events: none; transition: opacity .15s;
}
.tip:hover .tooltip, .tip:focus .tooltip, .tip:focus-within .tooltip, .tip.show .tooltip { opacity: 1; }

/* ------------------------------------------------------------- stage: the canvas is the whole viewport */
/* The stage is not positioned: a fixed (or z-indexed) stage would be a stacking context of its own, and the drawer,
   the toast and the loading veil inside it could then never rise above the chrome outside it (a phone's Site sheet
   was painted under the bottom bar's Layers and Site buttons). Every part of the stage is position: fixed itself, so
   all the chrome's z-indices compete in one context (README "Layout"). */
.stage { position: static; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#view:focus-visible { outline: 2px solid var(--purple); outline-offset: -2px; border-radius: 0; }
.stage.measuring #view { cursor: crosshair; }

/* ------------------------------------------------------------- floating chrome: shared */
.chrome { z-index: 20; }
.site-pill, .viewbar, .actions, .layers-btn, .chip, .seg-ctl, .proposal-chip, .tb-pill, .tool-pill, .compass, .scalebar, .readout, .exit-max, .max-dock {
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--lift);
}
.pop {
  position: fixed; z-index: 30; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--lift-strong); overflow: auto; overscroll-behavior: contain; padding: 0;
}
.pop-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px 16px; }
.pop-head h2 { font-size: 15px; flex: 1; outline: none; }
.xbtn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.xbtn:hover { background: var(--soft); }
.grip { display: none; }
.eyebrow { font-family: var(--font); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-text); margin-bottom: 8px; }

/* ------------------------------------------------------------- row 1: site pill */
.site-pill {
  position: fixed; top: var(--row1); left: var(--gap); height: var(--h1); border-radius: var(--radius);
  display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; max-width: calc(50% - var(--vb-w, 528px) / 2 - var(--gap) - 8px); min-width: 0;
}
.brand { display: flex; align-items: center; flex: none; color: var(--ink); }
.brand .logo { height: 21px; width: auto; display: block; }
.brand .symbol { display: none; height: 24px; width: 24px; }
.site-id { display: flex; align-items: center; gap: 6px; min-width: 0; }
.site-id .sep { width: 1px; height: 20px; background: var(--line-2); flex: none; margin-right: 2px; }
.site-label {
  display: block; min-width: 0; max-width: none; height: 32px; padding: 0 5px; border: 0; border-radius: var(--radius-s); background: transparent;
  font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-variant-numeric: tabular-nums;
  text-align: left;
}
.site-label:hover, .site-label[aria-expanded="true"] { background: var(--soft); }
.vs-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 5px 0 8px; border-radius: 6px; flex: none; cursor: pointer;
  background: var(--soft-2); color: var(--ink); font-size: 12px; font-weight: 500; white-space: nowrap; border: 0;
}
.vs-badge .ico { width: 15px; height: 15px; }
.vs-badge .short { display: none; }
.vs-badge[aria-expanded="true"] { background: var(--ink); color: #fff; }
/* the label in full first: the short badge, then the symbol, when it would be cut (chrome.fitSitePill) */
.site-pill.fit-short .vs-badge .long { display: none; }
.site-pill.fit-short .vs-badge .short { display: inline; }
.site-pill.fit-symbol .brand .logo { display: none; }
.site-pill.fit-symbol .brand .symbol { display: block; }
.site-pill.fit-two .site-label {
  white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 12px; line-height: 1.2;
  height: auto; max-height: 34px; padding-top: 2px; padding-bottom: 2px; overflow-wrap: anywhere;
}
/* last step (the narrowest phones): the badge as its ⓘ (its name and note unchanged; the credits keep the words) */
.site-pill.fit-icon .vs-badge .long, .site-pill.fit-icon .vs-badge .short { display: none !important; }
.site-pill.fit-icon .vs-badge { padding: 0 5px; }

/* ------------------------------------------------------------- row 1: the view switcher */
.viewbar { position: fixed; top: var(--row1); left: 50%; transform: translateX(-50%); height: var(--h1); border-radius: var(--radius); padding: 1px; display: flex; }
.modes { display: flex; align-items: center; gap: 2px; }
.mode {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px 0 9px; border: 0; border-radius: 10px; background: transparent;
  cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.mode:hover { background: var(--soft); }
.mode[aria-checked="true"], .mode[aria-checked="true"]:hover { background: var(--ink); color: #fff; }
.mode .sw { width: 18px; height: 18px; border-radius: 5px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.mode[aria-checked="true"] .sw { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
.mode .l-compact, .mode .l-tiny { display: none; }

/* ------------------------------------------------------------- row 1: actions */
.actions { position: fixed; top: var(--row1); right: var(--gap); height: var(--h1); border-radius: var(--radius); display: flex; align-items: center; gap: 2px; padding: 0 4px; }
.act { height: 32px; min-width: 32px; padding: 0 8px; font-size: 13px; font-weight: 500; justify-content: center; }
.btn.act[aria-expanded="true"], .btn.act[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn.act[aria-expanded="true"]:hover, .btn.act[aria-pressed="true"]:hover { background: var(--ink-hover); }
.act kbd { margin-left: 2px; }
.act[aria-pressed="true"] kbd { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.actions .div { width: 1px; height: 20px; background: var(--line-2); margin: 0 2px; }

/* ------------------------------------------------------------- row 2: Layers and the chips */
.layers-btn {
  position: fixed; top: var(--row2); left: var(--gap); height: var(--h2); border-radius: 10px; padding: 0 10px 0 9px; gap: 7px;
  font-size: 13px; font-weight: 500;
}
.layers-btn:hover { background: #fff; border-color: var(--line-2); }
.layers-btn[aria-expanded="true"], .layers-btn[aria-expanded="true"]:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.chipbar {
  position: fixed; top: var(--row2); left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap; row-gap: 6px; width: max-content; max-width: calc(100% - 2 * (2 * var(--gap) + var(--layers-w)));
  pointer-events: none;
}
.chipbar > * { pointer-events: auto; }
/* the fit's steps (chrome.fitChipbar): the season chip without its day, the overlay's short name (its qualifier kept),
   then the key words */
.chipbar.tight #seasonDay { display: none; }
#overlayChipText { display: inline-flex; align-items: baseline; min-width: 0; overflow: hidden; }
#overlayChipText .ov-long { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#overlayChipText .ov-short { display: none; min-width: 0; }
.chipbar.tight #overlayChipText .ov-long { display: none; }
.chipbar.tight #overlayChipText .ov-short { display: inline-flex; }
/* only the subject is ever cut, never the qualifier ("Nature · screening") */
.ov-short .subj, .lt-short .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ov-short .subj { max-width: 150px; }
.ov-short .qual, .lt-short .qual { flex: none; white-space: nowrap; }
/* none drawn: "Overlays" with a grid icon (the ramp icon names the overlay on screen) */
.overlay-chip .ov-ico { display: none; }
.overlay-chip.none { border-color: var(--line); }
.overlay-chip.none .ov-ico { display: block; }
.overlay-chip.none .ramp-chip, .overlay-chip.none .k { display: none; }
.overlay-chip.none b { font-weight: 500; }
.chipbar.no-ground #groundChip, .chipbar.no-ground #groundCtl { display: none !important; }
/* the proposal chip's compact label when it shares a tight line (its full label stays its name, title and note) */
.chipbar.pz-compact .proposal-chip .pl-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chipbar.pz-compact .proposal-chip .pl-short { display: inline; }
.chipbar.tighter .chip .k { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: var(--h2); padding: 0 9px; border-radius: 10px; cursor: pointer;
  font-size: 12.5px; color: var(--ink); white-space: nowrap; max-width: 100%; min-width: 0;
}
.chip:hover { background: #fff; border-color: var(--line-2); }
.chip .k { color: var(--muted-text); font-weight: 500; }
.chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chip .ico { width: 16px; height: 16px; }
.chip[aria-expanded="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--lift); }
.chip.dim b { color: var(--muted-text); font-weight: 500; }
.overlay-chip .ramp-chip { width: 22px; height: 8px; border-radius: 2px; flex: none; background: var(--soft-2); }
.overlay-chip { border-color: rgba(95, 76, 236, 0.45); }
.chip.chip-x { width: var(--h2); padding: 0; justify-content: center; margin-left: -4px; border-color: rgba(95, 76, 236, 0.45); }
.chip.chip-x .ico { width: 15px; height: 15px; }
.chip .sfx { color: var(--muted-text); font-weight: 400; }
.chipbar.ground-compact #groundCtl { display: none !important; }
.chipbar:not(.ground-compact) #groundChip { display: none !important; }

/* segmented control (ground inline; the proposal's Before | After) */
.seg-ctl { display: inline-flex; align-items: center; gap: 2px; height: var(--h2); padding: 2px; border-radius: 10px; }
.seg-ctl .seg-lead { display: inline-flex; align-items: center; gap: 5px; padding: 0 6px 0 6px; color: var(--muted-text); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.seg-ctl .seg-lead .ico { width: 16px; height: 16px; }
.seg-ctl button {
  height: 26px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; color: var(--ink);
}
.seg-ctl button:hover { background: var(--soft); }
.seg-ctl button[aria-checked="true"], .seg-ctl button[aria-checked="true"]:hover { background: var(--ink); color: #fff; }
.seg-ctl button:disabled { color: #a9a8b3; cursor: default; background: transparent; }
.seg-ctl .hint, .ground-list .hint { font-size: 11.5px; color: var(--muted-text); padding: 0 6px; white-space: nowrap; }
.seg-ctl button .suffix { font-weight: 400; opacity: 0.75; }
.seg-ctl[aria-busy="true"] { opacity: 0.85; }

/* the proposal chip: the required label + the before / after switch, one control */
.proposal-chip {
  display: inline-flex; align-items: center; gap: 7px; height: var(--h2); padding: 0 2px 0 10px; border-radius: 10px;
  border: 1.5px solid var(--purple); font-size: 12.5px; max-width: 100%; min-width: 0;
}
.proposal-chip .pdot { width: 10px; height: 10px; border-radius: 3px; background: var(--purple); flex: none; }
.proposal-chip.before { border-style: dashed; border-color: #9c9ca6; }
.proposal-chip.before .pdot { background: transparent; border: 1.5px dashed var(--muted-text); }
.proposal-chip .plabel { color: var(--purple-ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.proposal-chip .syn { background: #fff6dd; color: #6b4a00; border-radius: 4px; padding: 2px 6px; font-weight: 600; font-size: 11px; white-space: nowrap; flex: none; }
.info-btn {
  width: 24px; height: 24px; border-radius: 6px; border: 0; background: transparent; display: inline-grid; place-items: center; cursor: pointer; padding: 0;
  color: var(--purple-ink); flex: none;
}
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--purple-tint); }
.info-btn .ico { width: 16px; height: 16px; }
.proposal-chip .lock { display: inline-flex; flex: none; color: var(--muted-text); }
.proposal-chip .lock .ico { width: 15px; height: 15px; }
.proposal-chip .pl-short { display: none; }
.seg2 { display: inline-flex; background: var(--soft); border-radius: 8px; padding: 2px; gap: 2px; flex: none; }
.seg2 button { border: 0; background: transparent; height: 26px; min-width: 24px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--ink); }
.seg2 button:hover { background: #fff; }
.seg2 button[aria-checked="true"], .seg2 button[aria-checked="true"]:hover { background: var(--ink); color: #fff; }

/* ------------------------------------------------------------- popovers, menus, cards */
.pop.menu { width: 340px; padding: 6px; }
.mh { font-family: var(--font); font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-text); padding: 8px 10px 4px; margin: 0; outline: none; }
.mfoot { font-size: 12px; color: var(--muted-text); padding: 8px 10px 6px; border-top: 1px solid var(--hair); margin-top: 4px; line-height: 1.45; }
.mfoot .link-btn { color: var(--ink); }
.overlay-list { display: grid; gap: 1px; }
.overlay-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border-radius: var(--radius-s);
  border: 0; background: transparent; cursor: pointer; font-size: 13px; color: var(--ink);
}
.overlay-btn:hover { background: var(--soft); }
.overlay-btn[aria-checked="true"] { background: var(--purple-tint); font-weight: 600; }
.overlay-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.overlay-btn[aria-checked="true"] .dot { background: var(--purple); }
.overlay-btn .tag { margin-left: auto; padding-left: 8px; font-size: 11.5px; color: var(--muted-text); font-weight: 400; white-space: nowrap; }
#overlayMenu { width: 380px; }
.ground-list { display: grid; gap: 2px; }
.g-opt {
  display: grid; grid-template-columns: 18px 1fr auto; column-gap: 9px; align-items: center; width: 100%; text-align: left; padding: 7px 8px;
  border: 0; border-radius: var(--radius-s); background: transparent; cursor: pointer; color: var(--ink); font-size: 13px;
}
.g-opt:hover { background: var(--soft); }
.g-opt[aria-checked="true"] { background: var(--purple-tint); }
.g-opt:disabled { cursor: default; opacity: 0.55; }
.g-opt .radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; background: #fff; }
.g-opt[aria-checked="true"] .radio { border-color: var(--purple); }
.g-opt[aria-checked="true"] .radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
.g-opt .t { font-weight: 600; }
.g-opt .s { grid-column: 2 / 4; font-size: 12px; color: var(--muted-text); line-height: 1.35; }
.g-opt .n { font-size: 11.5px; color: var(--muted-text); }
.g-more { margin: 0 8px 4px 35px; }
.key-dates { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.key-dates button {
  display: grid; justify-items: center; gap: 0; border: 1px solid var(--line-2); background: #fff; border-radius: var(--radius-s); padding: 4px 10px;
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.25;
}
.key-dates button small { font-size: 11px; font-weight: 500; color: var(--muted-text); }
.key-dates button:hover { border-color: var(--ink); }
.key-dates button[aria-pressed="true"], .key-dates button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.key-dates button[aria-pressed="true"] small, .key-dates button[aria-checked="true"] small { color: rgba(255, 255, 255, 0.82); }
#seasonMenu.pop { width: 320px; padding: 6px 6px 10px; }
#seasonMenu .key-dates { padding: 4px 8px 0; display: flex; }
.tc-note { font-size: 12px; color: var(--muted-text); line-height: 1.45; margin: 4px 8px 6px; }
.tc-note.strong { color: var(--ink); background: var(--soft); border-radius: var(--radius-s); padding: 7px 10px; }

/* the Layers card (left) */
.layers-card { width: 312px; max-height: calc(100% - var(--chrome-top) - var(--chrome-bottom)); left: var(--gap); top: var(--chrome-top); padding-bottom: 0; }
.grp { padding: 6px 14px 10px; }
.grp + .grp { border-top: 1px solid var(--hair); padding-top: 10px; }
.grp-t { font-family: var(--font); font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-text); margin: 2px 2px 6px; }
.wys-text { margin: 0 2px; font-size: 12.5px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.wys.open .wys-text { -webkit-line-clamp: unset; display: block; }
.wys .link-btn { font-size: 12px; margin: 2px 2px 0; }
.layers { display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 9px; padding: 5px 4px; border-radius: 6px; cursor: pointer; user-select: none; }
.check:hover { background: var(--soft); }
.check input { accent-color: var(--purple); width: 15px; height: 15px; margin: 0; }
.check .count { margin-left: auto; color: var(--muted-text); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.check .tagline { margin-left: auto; color: var(--muted-text); font-size: 11.5px; }
.layer-note { margin: -3px 0 3px 28px; line-height: 1.35; color: var(--muted-text); font-size: 11.5px; }
.layer-more { margin: -2px 0 4px 28px; font-size: 12px; }
.layer-more > summary { cursor: pointer; color: var(--purple-ink); font-weight: 500; list-style: none; }
.layer-more > summary::-webkit-details-marker { display: none; }
.layer-more > summary::after { content: ' +'; }
.layer-more[open] > summary::after { content: ' \2212'; }
.layer-more > p { margin: 4px 0 2px; padding: 7px 9px; background: var(--soft); border-radius: var(--radius-s); color: var(--ink); line-height: 1.45; font-size: 12px; }
.pop-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--hair); font-size: 12.5px; position: sticky; bottom: 0; background: #fff; }
.pop-foot label { flex: 1; }
.quality-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.select { border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--white); padding: 4px 6px; }
.keys-inline { display: none; }

/* the Location card, the keyboard card, the info note */
.pop.loc-pop { width: 380px; padding-bottom: 12px; }
.loc-kv { margin: 0 16px 8px; font-size: 12.5px; }
.loc-note { margin: 4px 16px 8px; font-size: 12px; line-height: 1.45; background: var(--soft); border-radius: var(--radius-s); padding: 8px 10px; }
.loc-server { margin: 6px 16px 0; }
.loc-server .eyebrow { margin: 6px 0 6px; }
.pop.keys-card { width: 330px; padding-bottom: 12px; }
.keys-note { margin: 0 16px 8px; font-size: 12px; line-height: 1.45; color: var(--muted-text); }
.keys-switch { margin: 0 16px 10px; font-size: 12.5px; font-weight: 500; }
.keys-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 16px; font-size: 12.5px; }
.keys-list dt { white-space: nowrap; }
.keys-list dd { margin: 0; }
.pop.info-pop { width: 320px; padding: 12px 14px; z-index: 34; font-size: 12.5px; line-height: 1.45; }
.info-pop h2 { font-size: 14px; margin-bottom: 6px; outline: none; }
.info-pop p { margin: 6px 0; }

/* ------------------------------------------------------------- the site drawer (right) */
.drawer {
  position: fixed; z-index: 25; right: var(--gap); top: var(--chrome-top); bottom: var(--chrome-bottom); width: var(--drawer-w);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift-strong);
  display: flex; flex-direction: column; overflow: hidden; outline: none;
}
.dhead { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 6px; border-bottom: 1px solid var(--hair); flex: none; }
.tabs { display: flex; flex: 1; flex-wrap: nowrap; gap: 2px; min-width: 0; }
.tabs button {
  border: 0; background: transparent; padding: 7px 8px; border-radius: var(--radius-s); cursor: pointer; color: var(--muted-text);
  white-space: nowrap; font-weight: 500;
}
.tabs button:hover { color: var(--ink); background: var(--soft); }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--soft-2); }
.tabs .long { display: none; } /* "Data" in the drawer (its title says Data & sources) */
.pane { padding: 14px 16px 18px; overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.pane h3 { font-size: 15px; margin-bottom: 4px; }
.pane h4 { font-size: 13px; margin: 14px 0 6px; }
.pane p { margin: 6px 0; }
.empty { padding: 18px 4px; color: var(--muted-text); }
.empty strong { color: var(--ink); display: block; margin-bottom: 4px; }

/* The label column never gets narrower than its longest word, so a long value wraps instead of overlapping it. */
.kv { display: grid; grid-template-columns: minmax(min-content, 1fr) auto; gap: 6px 12px; margin: 8px 0; }
.kv dd.sub { grid-column: 1 / -1; text-align: left; color: var(--muted-text); font-size: 11.5px; margin: -4px 0 2px; }
.kv dt { color: var(--muted-text); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kv dd .badge { margin-left: 4px; }
.loc-kv dd { text-align: left; }
.loc-kv { grid-template-columns: auto 1fr; margin: 0 16px 8px; }
.card-block { border: 1px solid var(--hair); border-radius: var(--radius); padding: 12px; margin: 10px 0; background: var(--white); }
.card-block.soft { background: var(--soft); border-color: transparent; }
.note { font-size: 12px; color: var(--muted-text); border-left: 2px solid var(--purple-light); padding-left: 8px; margin: 8px 0; }
.warn { font-size: 12px; color: #6b4a00; background: #fff6dd; border-radius: var(--radius-s); padding: 7px 9px; margin: 6px 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 5px 6px; border-bottom: 1px solid var(--hair); text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl.wrap-first td:first-child { white-space: normal; }
.tbl th { color: var(--muted-text); font-weight: 500; position: sticky; top: 0; background: var(--white); }
.tbl-wrap { overflow-x: auto; max-height: 260px; overflow-y: auto; border: 1px solid var(--hair); border-radius: var(--radius-s); margin: 6px 0; }
.chk { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--hair); align-items: start; }
.chk:last-child { border-bottom: 0; }
.chk .crit { grid-column: 2; font-size: 11.5px; color: var(--muted-text); }
.chk .val { font-variant-numeric: tabular-nums; }
.an { border: 1px solid var(--hair); border-radius: var(--radius); margin: 10px 0; overflow: hidden; }
.an > summary { list-style: none; cursor: pointer; padding: 11px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.an > summary::-webkit-details-marker { display: none; }
.an > summary:hover { background: var(--soft); }
.an > summary .title { font-weight: 600; flex: 1 1 150px; min-width: 0; }
.an > summary .chev { transition: transform .15s; color: var(--muted); }
.an[open] > summary .chev { transform: rotate(90deg); }
.an .body { padding: 2px 12px 12px; }
.an .method { font-size: 11.5px; color: var(--muted-text); margin-top: 8px; }
.an .actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.pill { border: 1px solid var(--hair-strong); border-radius: 999px; background: var(--white); padding: 4px 10px; font-size: 12px; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.dl-group { margin: 10px 0 16px; }
.dl-group h4 { margin: 0 0 4px; }
.dl-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); }
.dl-item:hover { background: var(--soft); }
.dl-item .path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; }
.dl-item .size { color: var(--muted-text); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.dl-item.off { opacity: 0.5; pointer-events: none; }
.src { padding: 9px 0; border-bottom: 1px solid var(--hair); }
.src:last-child { border-bottom: 0; }
.src .name { font-weight: 600; }
.src-links { margin: 4px 0 0; padding-left: 16px; }
.src-links li { margin: 2px 0; }
.src-links a { color: var(--ink); text-decoration-color: var(--purple-light); }
.lidar .lidar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lidar .lidar-head h4 { margin: 0; }
.lidar .lidar-value { font-size: 20px; font-weight: 600; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
/* Short sentences: label above the value, both left-aligned. */
.kv.stack { grid-template-columns: minmax(0, 1fr); gap: 0; }
.kv.stack dt { font-size: 11.5px; }
.kv.stack dd { text-align: left; margin-bottom: 7px; }
.kv.stack dd:last-child { margin-bottom: 0; }
.lidar-flags { margin: 6px 0; padding-left: 16px; color: #6b4a00; }
.lidar-flags li { margin: 2px 0; }
details.more { margin-top: 6px; }
details.more > summary { cursor: pointer; font-size: 12px; font-weight: 500; color: var(--ink); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: ' +'; color: var(--muted); }
details.more[open] > summary::after { content: ' \2212'; }
details.more > p, details.more > .kv { font-size: 12px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); font-size: 10px; fill: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }

/* ------------------------------------------------------------- bottom band: legend and scale (left) */
.hud { position: fixed; z-index: 15; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud.bl { left: var(--gap); bottom: var(--band); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.scale-row { display: flex; align-items: stretch; gap: 6px; }
.legend {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift); padding: 8px 12px 10px;
  width: 280px; max-width: calc(100vw - 32px); max-height: min(45vh, calc(var(--clear-h, 600px) - 24px - var(--legend-lift, 0px)));
  overflow: auto; overscroll-behavior: contain; margin-bottom: var(--legend-lift, 0px);
}
.legend .lt { font-weight: 600; font-size: 12.5px; }
.legend-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 2px 0; border: 0; background: transparent; cursor: pointer; text-align: left; color: var(--ink); font-family: var(--font); }
.legend-toggle .lt-text { flex: 1; min-width: 0; }
.legend-toggle .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.legend.collapsed { width: auto; max-width: min(280px, calc(100vw - 32px)); padding: 6px 10px; overflow: hidden; }
.legend.collapsed .legend-body { display: none; }
.legend.collapsed .legend-toggle .chev { transform: rotate(180deg); }
.legend.collapsed .lt-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend .lt-short { display: none; }
.chip-ramp { display: none; width: 28px; height: 8px; border-radius: 2px; flex: none; }
.legend.collapsed .chip-ramp { display: block; }
.legend .ramp { height: 10px; border-radius: 3px; margin: 7px 0 3px; }
.legend .lticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-text); font-variant-numeric: tabular-nums; }
.legend .items { display: grid; gap: 3px; margin-top: 6px; font-size: 11.5px; }
.legend .meta { font-size: 11px; color: var(--muted-text); margin-top: 6px; line-height: 1.35; }
.legend-more summary { cursor: pointer; color: var(--ink); font-weight: 500; list-style: none; }
.legend-more summary::-webkit-details-marker { display: none; }
.legend-more summary::after { content: ' +'; color: var(--muted); }
.legend-more[open] summary::after { content: ' \2212'; }
.legend-more > div { margin-top: 4px; }
.hatch { background-image: repeating-linear-gradient(-45deg, rgba(95, 76, 236, 0.8) 0 1.6px, transparent 1.6px 5px); }
.readout { font-size: 11.5px; border-radius: var(--radius-s); padding: 0 9px; display: flex; align-items: center; font-variant-numeric: tabular-nums; color: var(--ink); min-height: 28px; white-space: nowrap; }
.readout:empty { display: none; }
.scalebar { display: flex; align-items: center; gap: 7px; border-radius: var(--radius-s); padding: 0 9px; min-height: 28px; }
.scalebar .bar { height: 6px; border: 1.5px solid var(--ink); border-top: 0; }
.scalebar .lbl { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.crosshair { position: fixed; z-index: 6; left: var(--cx, 50%); top: var(--cy, 50%); width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none;
  background: linear-gradient(var(--purple), var(--purple)) center / 2px 100% no-repeat, linear-gradient(var(--purple), var(--purple)) center / 100% 2px no-repeat;
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1px #fff); }
.measure-chip {
  position: fixed; top: var(--chrome-top); left: var(--cx, 50%); transform: translateX(-50%); z-index: 22; background: var(--ink); color: #fff;
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; box-shadow: var(--shadow-float); font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ------------------------------------------------------------- bottom band: the time pill (centre) and its card */
.timebar {
  position: fixed; z-index: 21; bottom: var(--band); width: var(--tb-w); transform: translateX(-50%);
  left: max(calc(var(--gap) + var(--tb-w) / 2), calc((100% - var(--tb-shift)) / 2));
}
.tb-pill { height: 44px; border-radius: var(--radius); display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.play-btn { width: 32px; height: 32px; border: 0; background: var(--ink); color: #fff; }
.play-btn:hover { background: var(--ink-hover); }
.play-btn .ico { width: 14px; height: 14px; }
.play-btn[aria-pressed="true"] { background: var(--purple); }
.slider-wrap { position: relative; flex: 1; min-width: 60px; height: 32px; display: flex; align-items: center; }
.slider-wrap input[type=range] { width: 100%; accent-color: var(--purple); margin: 0; height: 22px; }
.ticks { position: absolute; left: 0; right: 0; top: 23px; height: 9px; pointer-events: none; font-size: 9.5px; line-height: 9px; color: var(--muted-text); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.slider-wrap::after { content: ''; }
.time-label { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 44px; text-align: center; font-size: 15px; }
.date-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 9px; border-radius: var(--radius-s); border: 0; background: var(--soft);
  cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap; flex: none;
}
.date-btn:hover { background: var(--soft-2); }
.date-btn[aria-expanded="true"] { background: var(--ink); color: #fff; }
.date-btn .leaf { width: 16px; height: 16px; }
.date-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.timebar.narrow .ticks span { display: none; }
.timebar.expanded { z-index: 31; }
.tb-card {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 560px; max-width: calc(100vw - 2 * var(--gap));
  padding: 14px 16px 12px; display: grid; gap: 10px; background: var(--white); border-radius: var(--radius); box-shadow: var(--lift-strong); border: 1px solid var(--line);
}
.tc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tc-row .lab { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-text); min-width: 42px; }
.tc-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; color: var(--muted-text); }
.tc-meta .switch { margin-left: auto; }
.tb-card .tc-note { margin: 0; background: var(--soft); border-radius: var(--radius-s); padding: 7px 10px; }
#tzLabel { cursor: help; }
.date { border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 5px 6px; background: var(--white); max-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-s); overflow: hidden; flex: none; }
.seg button { border: 0; background: var(--white); padding: 5px 10px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button:hover { background: var(--soft); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ink); }
.switch input { accent-color: var(--purple); margin: 0; }
.dot { color: var(--hair-strong); }

/* ------------------------------------------------------------- bottom band: map tools and compass (right) */
.tools { position: fixed; right: var(--gap); bottom: var(--band); display: flex; align-items: flex-end; gap: 8px; z-index: 21; }
.tool-pill { display: flex; align-items: center; gap: 2px; padding: 4px; height: 44px; border-radius: var(--radius); }
.tool-pill .act { height: 34px; }
.compass { width: 44px; height: 44px; border-radius: 50%; padding: 4px; cursor: pointer; flex: none; }
.compass svg { width: 100%; height: 100%; display: block; overflow: visible; }
.c-ring { fill: none; stroke: var(--hair-strong); stroke-width: 1.5; }
.c-north { fill: var(--purple); }
.c-south { fill: #c9c9cf; }
.c-n { font-size: 9px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.windrose-widget {
  position: fixed; z-index: 15; right: calc(var(--drawer-space) + var(--gap)); bottom: calc(var(--band) + 52px);
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift); padding: 8px; width: 168px;
}
.windrose-widget svg { display: block; width: 100%; height: auto; }

/* ------------------------------------------------------------- full map (maximized) */
.exit-max {
  position: fixed; z-index: 36; top: var(--gap); right: var(--gap); height: 36px; border-radius: 10px; padding: 0 10px; gap: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--ink);
}
.exit-max:hover { background: #fff; }
.exit-max .xs { display: none; }
.max-dock {
  position: fixed; z-index: 36; left: 50%; transform: translateX(-50%); bottom: calc(var(--credits-h) + 8px); height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 4px; padding: 0 4px;
}
.max-dock .btn { height: 32px; padding: 0 9px; font-size: 12.5px; font-weight: 500; }
.max-dock .sw { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); flex: none; }
.max-dock .btn[aria-expanded="true"], .max-dock .btn[aria-expanded="true"]:hover { background: var(--ink); color: #fff; }
.max-dock .play-btn { width: 30px; height: 30px; }
.dock-time { font-variant-numeric: tabular-nums; }
.dock-time .short { display: none; }
.max-view-menu { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 8px); width: 320px; max-height: 70vh; }
.mode-list { display: grid; gap: 1px; }
.mode-item {
  display: grid; grid-template-columns: 18px 1fr auto; column-gap: 10px; align-items: center; text-align: left; width: 100%; padding: 7px 10px;
  border: 0; border-radius: var(--radius-s); background: transparent; cursor: pointer; color: var(--ink); font-size: 13px;
}
.mode-item:hover { background: var(--soft); }
.mode-item[aria-checked="true"] { background: var(--ink); color: #fff; }
.mode-item .sw { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.mode-item .t { font-weight: 600; }
.mode-item .s { grid-column: 2 / 4; font-size: 12px; color: var(--muted-text); }
.mode-item[aria-checked="true"] .s { color: rgba(255, 255, 255, 0.8); }
.mode-item kbd { justify-self: end; }
body.maximized .site-pill, body.maximized .viewbar, body.maximized .actions, body.maximized .layers-btn,
body.maximized .chipbar > :not(#hudProposal), body.maximized .tool-pill, body.maximized .readout,
body.maximized .drawer, body.maximized .layers-card, body.maximized .menu:not(.max-view-menu), body.maximized .loc-pop,
body.maximized .keys-card, body.maximized #timebar:not(.expanded), body.maximized .measure-chip { display: none !important; }
body.maximized .chipbar { top: var(--gap); }
body.maximized .chipbar::after { display: none; }
body.maximized #timebar.expanded {
  bottom: calc(var(--credits-h) + 56px); left: 50%; width: min(560px, calc(100vw - 2 * var(--gap))); display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift-strong);
}
body.maximized #timebar.expanded .tb-card { position: static; order: -1; transform: none; width: auto; max-width: none; border: 0; box-shadow: none; padding-bottom: 4px; }
body.maximized #timebar.expanded .tb-pill { background: transparent; border: 0; box-shadow: none; height: 40px; padding: 0 16px 4px; }
body.maximized #timebar.expanded .tb-pill > :not(.slider-wrap) { display: none; }
body.maximized .hud.bl { bottom: calc(var(--credits-h) + 8px); }
body.maximized .tools { bottom: calc(var(--credits-h) + 8px); }
body.maximized .toast { top: calc(var(--gap) + 48px); bottom: auto; }
body.maximized .windrose-widget { right: var(--gap); bottom: calc(var(--credits-h) + 60px); }

/* ------------------------------------------------------------- loading, welcome, toast */
.loading, .welcome { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(246, 247, 243, 0.72); }
.welcome { background: rgba(246, 247, 243, 0.94); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-float); padding: 18px 20px; }
/* popovers set their own padding (.pop.menu, .pop.info-pop, ...): no card padding (zero-specificity :where) */
.card:where(.pop) { padding: 0; }
.tb-card.card { padding: 14px 16px 12px; }
.loading .card { width: min(380px, calc(100vw - 32px)); display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 18px 20px; }
.loading-text { display: flex; flex-direction: column; min-width: 0; }
.loading-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { grid-column: 1 / -1; height: 4px; background: var(--soft-2); border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--purple); transition: width .3s; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--purple-tint); border-top-color: var(--purple); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.welcome-card { width: min(520px, calc(100vw - 32px)); padding: 28px; }
.welcome-card h1 { font-size: 24px; margin: 14px 0 6px; }
#welcomeSearch { margin-top: 14px; }
.search {
  position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap;
  background: var(--soft); border: 1px solid var(--hair); border-radius: 10px; padding: 4px 4px 4px 10px;
}
.search:focus-within { border-color: var(--purple-light); background: var(--white); }
.search .ico { color: var(--muted); width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 6px 2px; }
.search input::placeholder { color: var(--muted-text); }
.recent { margin-top: 12px; display: grid; gap: 4px; }
.recent button { display: flex; justify-content: space-between; gap: 8px; text-align: left; padding: 9px 10px; border-radius: var(--radius-s); border: 1px solid var(--hair); background: var(--white); cursor: pointer; }
.recent button:hover { border-color: var(--purple-light); background: var(--soft); }
.build-error { margin-top: 14px; border: 1px solid #efc9c1; background: var(--bad-tint); color: #6a2418; border-radius: var(--radius-s); padding: 10px 12px; font-size: 12.5px; }
.build-error strong { display: block; margin-bottom: 2px; }
.build-error .actions { display: flex; gap: 6px; margin-top: 8px; }
.geo-pop { flex: 1 1 100%; display: grid; gap: 8px; padding: 8px 2px 4px; }
.geo-pop h3 { font-size: 13px; }
.geo-pop .cand { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; border: 1px solid var(--hair); border-radius: var(--radius-s); background: var(--white); cursor: pointer; width: 100%; }
.geo-pop .cand:hover, .geo-pop .cand:focus-visible { border-color: var(--purple-light); background: var(--soft); }
.geo-pop .cand .lbl { flex: 1; min-width: 0; }
.geo-pop .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.blist { margin-top: 6px; }
.blist-search { width: 100%; border: 1px solid var(--hair-strong); border-radius: var(--radius-s); padding: 7px 9px; background: var(--white); margin: 2px 0 4px; }
.blist-search:focus { outline: none; border-color: var(--purple-light); }
.blist-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; max-height: 340px; overflow: auto; margin-top: 4px; }
.blist-rows > div { min-width: 0; }
.blist-row .badge { flex: none; }
.blist-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-s); background: transparent; cursor: pointer; }
.blist-row:hover { background: var(--soft); }
.blist-row .bn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blist-row .bh { flex: none; white-space: nowrap; color: var(--muted-text); font-variant-numeric: tabular-nums; font-size: 12px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--chrome-bottom) + 4px); transform: translateX(-50%); z-index: 40; background: var(--ink); color: #fff;
  padding: 9px 14px; border-radius: 999px; font-size: 12.5px; box-shadow: var(--shadow-float); max-width: calc(100vw - 32px);
}

/* ------------------------------------------------------------- the credits strip (always on, also on the full map) */
.attribution {
  position: fixed; left: 0; right: 0; bottom: 0; min-height: 24px; z-index: 19; display: flex; align-items: center; gap: 2px 12px;
  padding: 2px 12px; background: rgba(255, 255, 255, 0.88); border-top: 1px solid var(--line); font-size: 11.5px; color: #2a2a30;
  white-space: nowrap; overflow: hidden;
}
/* Never clipped: when even the core line does not fit, the strip wraps. */
.attribution.wrap { flex-wrap: wrap; white-space: normal; }
.attribution .credits { display: flex; flex: none; flex-wrap: nowrap; gap: 0; }
.attribution.wrap .credits { flex: 1 1 100%; flex-wrap: wrap; }
.attribution .credits span + span::before { content: ' · '; white-space: pre; color: var(--muted-text); }
.attribution .more {
  border: 0; background: transparent; color: var(--purple-ink); cursor: pointer; padding: 0 4px; min-height: 24px; font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; white-space: nowrap;
}
.attribution a { color: var(--muted-text); }
.attribution .honest { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--muted-text); white-space: nowrap; }
.attribution .honest button { border: 0; background: transparent; font: inherit; color: #2a2a30; cursor: pointer; padding: 0; min-height: 24px; text-decoration: underline dotted; text-underline-offset: 2px; }
.attribution .honest .short { display: none; }
/* the credits of what is on screen come first: the tail gives way before the strip wraps (fitAttribution) */
.attribution.no-tail .honest .tail { display: none; }

/* ------------------------------------------------------------- not loaded (welcome, building) */
body:not(.has-site) .viewbar, body:not(.has-site) .actions, body:not(.has-site) .layers-btn, body:not(.has-site) .chipbar,
body:not(.has-site) .tools, body:not(.has-site) #timebar, body:not(.has-site) .hud.bl, body:not(.has-site) .drawer { display: none !important; }

/* ------------------------------------------------------------- laptop (< 1360 px): symbol logo, compact labels */
@media (max-width: 1359px) {
  .brand .logo { display: none; }
  .brand .symbol { display: block; }
  .mode .l-full.has-compact { display: none; }
  .mode .l-compact { display: inline; }
  .vs-badge .long { display: none; }
  .vs-badge .short { display: inline; }
  #maxBtn .lbl { display: none; }
  .tabs .long { display: none; }
  .attribution .honest .tail { display: none; }
}
@media (max-width: 1279px) {
  :root { --tb-w: 440px; }
  #shareBtn .lbl { display: none; }
  /* credits: up to two lines below 1280 px (three on a phone), the on-screen ones always shown; never clipped */
  .attribution { display: block; white-space: normal; padding: 3px 12px 4px; line-height: 1.45; }
  .attribution .credits { display: inline; }
  .attribution .credits > span { display: inline; }
  .attribution .honest { display: inline; margin: 0; }
  .attribution .honest::before { content: ' · '; white-space: pre; }
  .attribution .honest .tail { display: none; }
  .attribution .honest > * + * { margin-left: 4px; }
  /* 24 px targets that do not grow their line (the fit counts lines) */
  .attribution .more { display: inline-block; min-height: 0; padding: 5px 3px; margin: -5px 0; line-height: inherit; }
  .attribution .honest button { display: inline-block; min-height: 0; padding: 4.5px 0; margin-top: -4.5px; margin-bottom: -4.5px; line-height: inherit; }
}
@media (max-width: 1179px) {
  :root { --drawer-w: 340px; }
}
@media (max-width: 1099px) {
  .timebar .ticks span { display: none; }
}

/* ------------------------------------------------------------- tablet and narrow windows (641-1023 px) */
@media (max-width: 1023px) {
  :root { --drawer-w: min(360px, calc(100vw - 24px)); --row3: calc(var(--row2) + var(--h1) + 8px); }
  .site-pill { max-width: none; right: calc(var(--gap) + 8px + var(--actions-w, 140px)); }
  .site-label { max-width: none; flex: 1 1 auto; }
  .site-id { flex: 1 1 auto; }
  .act .lbl { display: none; }
  .viewbar { top: var(--row2); left: var(--gap); right: var(--gap); margin: 0 auto; max-width: 560px; transform: none; }
  .modes { flex: 1; }
  .mode { flex: 1 1 0; justify-content: center; padding: 0 6px; min-width: 0; }
  .layers-btn { top: var(--row3); }
  .chipbar { top: var(--row3); }
  /* the overlay, ground and season chips share one line (chrome.fitChipbar); the proposal chip takes the next
     (order 9: not counted by the fit) */
  .chipbar::after { content: ''; order: 8; flex: 0 0 100%; height: 0; margin-top: -6px; }
  .proposal-chip { order: 9; }
  .readout { display: none; }
  .timebar { --tb-w: min(440px, calc(100vw - 2 * var(--gap) - 300px)); }
}

/* ------------------------------------------------------------- phone (<= 640 px) */
@media (max-width: 640px) {
  :root { --gap: 8px; --h2: 30px; --row3: calc(var(--row2) + 48px + 8px); --band: calc(var(--credits-h) + 8px); }
  body { font-size: 13px; }
  .site-pill { padding: 0 4px 0 10px; gap: 6px; }
  .brand .symbol { height: 22px; width: 22px; }
  .site-id .sep { display: none; }
  .site-label { font-size: 12.5px; padding: 0 4px; }
  .vs-badge { height: 24px; padding: 0 5px 0 7px; }
  #searchBtn, #rightToggle .lbl, .actions .div { display: none !important; }
  /* row 2: the view switcher across the width, icon over label */
  .viewbar { height: 48px; max-width: none; padding: 2px; }
  .mode { flex-direction: column; justify-content: center; gap: 3px; height: 42px; padding: 0 2px; font-size: 12px; }
  .mode .l-full, .mode .l-compact { display: none !important; }
  .mode .l-tiny { display: inline; }
  .mode .sw { width: 16px; height: 16px; }
  /* rows 3 and 4: ground and season chips, then the proposal chip across the width */
  .chipbar { left: var(--gap); right: var(--gap); transform: none; width: auto; max-width: none; justify-content: center; gap: 6px; }
  .chipbar #groundCtl { display: none !important; }
  .chipbar #groundChip { display: inline-flex !important; }
  .chipbar #groundChip[hidden] { display: none !important; }
  .chipbar::after { display: none; }
  body.mode-analysis .chipbar #groundChip { display: none !important; }
  .chip.chip-x { width: 30px; }
  .chip { height: 30px; padding: 0 8px; }
  .ov-short .subj { max-width: 110px; }
  .proposal-chip { order: 9; flex: 1 1 100%; height: auto; min-height: 32px; padding-top: 2px; padding-bottom: 2px; font-size: 12px; gap: 6px; }
  .proposal-chip .plabel { flex: 1; white-space: normal; line-height: 1.2; }
  /* bottom bar: Layers, the time pill, Site */
  .layers-btn, #rightToggle {
    position: fixed; top: auto; bottom: var(--band); width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: var(--radius);
  }
  .layers-btn .lbl, .layers-btn .caret { display: none; }
  #rightToggle { right: var(--gap); background: var(--glass); border: 1px solid var(--line); box-shadow: var(--lift); z-index: 21; }
  #rightToggle[aria-expanded="true"] { background: var(--ink); color: #fff; }
  .timebar { left: calc(var(--gap) + 52px); right: calc(var(--gap) + 52px); width: auto; transform: none; }
  .tb-pill { gap: 6px; padding: 0 4px; }
  .time-label { font-size: 14px; min-width: 40px; }
  .date-btn { padding: 0 6px; }
  .date-btn .dtxt { display: none; }
  .ticks span { display: none; }
  .tb-card { position: fixed; left: var(--gap); right: var(--gap); width: auto; transform: none; bottom: calc(var(--band) + 52px); padding: 12px; }
  .tc-row .lab { min-width: 0; width: 100%; }
  .tools { flex-direction: column; align-items: flex-end; bottom: calc(var(--band) + 52px); }
  .tool-pill { height: auto; padding: 3px; }
  .tool-pill .act { width: 36px; height: 36px; padding: 0; }
  .tool-pill .lbl, #keysBtn { display: none !important; }
  .compass { width: 42px; height: 42px; }
  .hud.bl { bottom: calc(var(--band) + 52px); max-width: calc(100vw - 2 * var(--gap) - 52px); }
  .readout { display: none; }
  /* the legend (also as its chip) ends left of the tools column (Measure, compass) it shares rows with */
  .legend, .legend.collapsed { width: auto; max-width: min(280px, calc(100vw - 2 * var(--gap) - 52px)); }
  .legend:not(.collapsed) { width: min(280px, calc(100vw - 2 * var(--gap) - 52px)); }
  .windrose-widget { width: 128px; bottom: calc(var(--band) + 150px); right: var(--gap); }
  .keys-inline { display: inline-flex; }
  /* sheets: Layers and Site open from the bottom, end at the credits; the map above stays live */
  .drawer, .layers-card {
    left: 0; right: 0; top: auto; bottom: var(--credits-h); width: auto; height: 46%; max-height: none; border-radius: 16px 16px 0 0; z-index: 26;
  }
  .grip { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 8px auto 0; flex: none; }
  .tabs button { padding: 7px 7px; font-size: 12.5px; }
  .tabs .long { display: none; }
  .menu, #overlayMenu, #seasonMenu, .loc-pop, .keys-card, .info-pop { left: var(--gap) !important; right: var(--gap) !important; width: auto; }
  .measure-chip { top: auto; bottom: calc(var(--chrome-bottom) + 4px); }
  /* credits: three lines here (the tablet rules above), the licensed sources first, then the honesty words */
  .attribution { padding: 3px 10px 4px; font-size: 11px; line-height: 1.4; }
  .attribution .honest .long { display: none; }
  .attribution .honest .short { display: inline; }
  .exit-max .xl, .exit-max kbd { display: none; }
  .exit-max .xs { display: inline; }
  .max-dock .dock-view .lbl, .dock-time .long { display: none; }
  .dock-time .short { display: inline; }
  body.maximized .chipbar { left: var(--gap); right: calc(var(--gap) + 80px); }
  /* the full map keeps the proposal chip on one line: the label's compact form (the full one stays its name, its
     title and its note), the state in the switch and the chip's border */
  body.maximized .proposal-chip { font-size: 11.5px; gap: 5px; height: 32px; min-height: 0; padding: 0 2px 0 8px; }
  body.maximized .proposal-chip .pdot { display: none; }
  body.maximized .proposal-chip .plabel { white-space: nowrap; }
  body.maximized .proposal-chip .pl-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.maximized .proposal-chip .pl-short { display: inline; }
  body.maximized .seg2 button { padding: 0 7px; height: 24px; }
  /* the full map's legend chip: the ramp and the overlay's short name with its qualifier (the title stays the toggle's
     name) */
  body.maximized .legend.collapsed { max-width: min(250px, calc(100vw - 2 * var(--gap) - 52px)); padding: 4px 8px; }
  body.maximized .legend.collapsed .lt-short { display: inline-flex; min-width: 0; max-width: 100%; }
  body.maximized .legend.collapsed .lt-long:not(:only-child) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.maximized #timebar.expanded { left: var(--gap); right: var(--gap); width: auto; transform: none; }
  .max-dock { left: auto; right: calc(var(--gap) + 52px); transform: none; }
  body.maximized .hud.bl { bottom: calc(var(--credits-h) + 56px); }
  .max-view-menu { position: fixed; left: var(--gap); right: var(--gap); width: auto; transform: none; bottom: calc(var(--credits-h) + 56px); }
}

/* ------------------------------------------------------------- short windows (a landscape phone, a laptop at 200 %) */
/* Height 500 px or less, wider than a phone: one row of chrome above the map instead of three. The view switcher
   returns to row 1 (icon and short label), the chips share row 2 with Layers, the proposal chip on the same line in
   its compact form (the full label stays its name, title and note); the ground and season chips leave the row (the
   ground choice stays in Layers, the season in the time card and in Layers › Trees). */
@media (max-height: 500px) and (min-width: 641px) {
  .viewbar { top: var(--row1); left: 50%; right: auto; transform: translateX(-50%); max-width: none; margin: 0; }
  .modes { flex: none; }
  .mode { flex: none; padding: 0 7px 0 5px; gap: 4px; font-size: 12.5px; }
  .mode .l-full, .mode .l-compact { display: none !important; }
  .mode .l-tiny { display: inline; }
  .mode .sw { width: 14px; height: 14px; }
  .site-pill { right: auto; max-width: calc(50% - var(--vb-w, 400px) / 2 - var(--gap) - 8px); }
  .layers-btn, .chipbar { top: var(--row2); }
  .chipbar { max-width: calc(100% - 2 * (2 * var(--gap) + 44px)); }
  .layers-btn .lbl, .layers-btn .caret { display: none; }
  .chipbar::after { display: none; }
  .chipbar #groundCtl, .chipbar #groundChip, .chipbar #seasonChip { display: none !important; }
  .proposal-chip { order: 0; }
  .proposal-chip .pl-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .proposal-chip .pl-short { display: inline; }
  .proposal-chip .pdot { display: none; }
}
/* the narrowest short windows (a laptop at 200 %): the view switcher's words only, so it stays clear of the actions */
@media (max-height: 500px) and (min-width: 641px) and (max-width: 779px) {
  .mode { padding: 0 8px; }
  .mode .sw { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0.01ms !important; }
}
.tbl td:first-child { overflow-wrap: anywhere; }

/* ------------------------------------------------------------- proposal (architect's model; docs/PROPOSAL.md 6) */
.legend .legend-state { font-size: 11.5px; font-weight: 500; color: var(--purple-ink); background: var(--purple-tint); border-radius: 6px; padding: 3px 7px; margin-top: 6px; }
.legend .ramp.diverging { position: relative; }
.legend .ramp.diverging .zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.legend .lticks.ends { margin-top: 1px; color: var(--ink); }
.check .prop-swatch { width: 11px; height: 11px; border-radius: 3px; background: var(--purple); flex: none; }
.seg-row { display: inline-flex; border: 1px solid var(--hair-strong); border-radius: 999px; overflow: hidden; margin: 4px 0; }
.seg-row button { border: 0; background: var(--white); padding: 5px 12px; font-size: 12px; cursor: pointer; font-family: var(--font); color: var(--ink); }
.seg-row button + button { border-left: 1px solid var(--hair-strong); }
.seg-row button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg-row button:disabled { color: #c3c3c9; cursor: default; }
.impact-lead { font-size: 12.5px; margin: 6px 0; line-height: 1.45; }
.impact-block { border-top: 1px solid var(--hair); padding-top: 8px; margin-top: 10px; }
.impact-block h4 { margin-top: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--soft); }
.badge.proposal { background: var(--purple); color: #fff; }
/* ------------------------------------------------------------- Prague (IPR Praha city data) */
.pl-banner { font-size: 12px; line-height: 1.45; background: var(--purple-tint); color: #2f2478; border-radius: var(--radius-s); padding: 8px 10px; margin: 8px 0; }
.pl-banner strong { font-weight: 600; }
.pl-banner a { color: #2f2478; }
.pl-sec { border-top: 1px solid var(--hair); padding-top: 8px; margin-top: 8px; }
.pl-list { list-style: none; margin: 6px 0 0; padding: 0; }
.pl-row { padding: 6px 0; border-bottom: 1px solid var(--hair); }
.pl-row:last-child { border-bottom: 0; }
.pl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: 12.5px; line-height: 1.4; }
.pl-head .pl-text { min-width: 0; overflow-wrap: anywhere; }
.pl-head .pl-text a { color: var(--ink); text-decoration-color: var(--purple-light); }
.pl-head .badge { flex: none; white-space: nowrap; }
.pl-meta { margin-top: 2px; }
.kv.stack dd .badge { margin-left: 4px; }
.city-block h4 + .kv { margin-top: 4px; }
.city-block code.tiny { font-size: 10px; }
