/* ==========================================================================
   Data Market Pro — Design System
   Palette: blue data-brand + amber accent, light-first with dark support.
   Typography: system UI stack (no external font hosts — CSP is default-src 'self').
   ========================================================================== */

/* ==========================================================================
   Emerald "market-intelligence" design system.
   DEFAULT = dark (emerald on near-black green). A refined light variant is
   opt-in via the toggle (data-theme="light"). The whole app is token-driven,
   so this palette re-skins every component; targeted flourishes live at the
   end of the file.
   ========================================================================== */
:root {
  /* Brand — emerald ramp. brand-700 is ONLY ever used as text-on-tint, so in
     dark it is a LIGHT emerald; tint tokens (50/100/200) are translucent. */
  --brand-50:  rgba(32, 179, 108, 0.12);
  --brand-100: rgba(32, 179, 108, 0.20);
  --brand-200: rgba(32, 179, 108, 0.30);
  --brand-500: #2bd07f;
  --brand-600: #20b36c;
  --brand-700: #86e5ad;
  --brand-800: #0d7a50;
  --brand-900: #0a5c3c;

  --accent-400: #f6d17a;
  --accent-500: #f2c45b;
  --accent-600: #d9a53f;

  --success-500: #34c77b;
  --success-100: rgba(32, 179, 108, 0.18);
  --success-text: #7fe0aa;
  --danger-500: #ef7272;
  --danger-600: #d94f4f;
  --danger-100: rgba(239, 114, 114, 0.16);
  --danger-text: #ff9a9a;
  --warn-500: #f2c45b;
  --warn-100: rgba(242, 196, 91, 0.16);
  --warn-text: #f2c45b;

  /* Surfaces — near-black green */
  --bg: #08110d;
  --surface: #11231b;
  --surface-raised: #173025;
  --border: #29463a;
  --border-strong: #35594a;

  /* Text */
  --text-900: #eef8f2;
  --text-700: #d6e6dd;
  --text-600: #9db4a8;
  --text-400: #6f8c7e;
  --text-on-brand: #04150d;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Elevation + emerald glow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.55);
  --shadow-focus: 0 0 0 3px rgba(32, 179, 108, 0.35);
  --glow: 0 0 22px rgba(32, 179, 108, 0.35);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Segoe UI Variable", "Inter", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", "Consolas", "Roboto Mono", monospace;

  --transition-fast: 140ms ease;
  --transition-base: 200ms ease;

  color-scheme: dark;
}

/* Refined emerald LIGHT variant (opt-in via toggle). */
:root[data-theme="light"] {
  --brand-50:  #e8f7ef;
  --brand-100: #cdeedd;
  --brand-200: #a6e0c3;
  --brand-500: #17a862;
  --brand-600: #0f9457;
  --brand-700: #0b7344;
  --brand-800: #0a5c3c;
  --brand-900: #08492f;

  --success-100: #dcfce7;
  --success-text: #157347;
  --danger-500: #e5484d;
  --danger-600: #c33a3e;
  --danger-100: #fdecec;
  --danger-text: #b3282c;
  --warn-100: #fdf1d6;
  --warn-text: #a1701a;

  --bg: #f2f7f4;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #dbe7e0;
  --border-strong: #c1d4c9;
  --text-900: #0c1f16;
  --text-700: #1c3a2c;
  --text-600: #4b6659;
  --text-400: #8aa398;
  --text-on-brand: #ffffff;

  --shadow-sm: 0 1px 2px rgba(12, 31, 22, 0.06);
  --shadow-md: 0 6px 20px rgba(12, 31, 22, 0.08);
  --shadow-lg: 0 16px 40px rgba(12, 31, 22, 0.14);
  --shadow-focus: 0 0 0 3px rgba(15, 148, 87, 0.28);
  --glow: 0 8px 24px rgba(15, 148, 87, 0.22);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-700);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; color: var(--text-900); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

/* The HTML `hidden` attribute must always win over a class's own `display`
   declaration (author rules otherwise beat the UA default at equal
   specificity). Every show/hide toggle in map.js / admin-*.js relies on
   this. */
[hidden] { display: none !important; }

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }

::selection { background: var(--brand-200); }

*:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                  */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-700);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg); border-color: var(--brand-500); color: var(--brand-700); }

.btn-ghost {
  background: transparent;
  color: var(--text-600);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text-900); }

.btn-danger {
  background: var(--danger-500);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: var(--danger-600); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; }

.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.7; }

/* ---------------------------------------------------------------------- */
/* Inputs                                                                   */
/* ---------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-600); }

/* Per-user login-security toggles (admin user form). */
.security-toggles { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px; gap: 10px; }
.security-toggles legend { font-size: 13px; font-weight: 600; color: var(--text-600); padding: 0 6px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; font-weight: 500; color: var(--text-900); cursor: pointer; }
.check-row input[type="checkbox"] { margin-top: 2px; flex: 0 0 auto; }

.input, select.input, textarea.input {
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-900);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--shadow-focus);
}
textarea.input { height: auto; padding: 10px 12px; }

.input-search {
  position: relative;
}
.input-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-400);
  pointer-events: none;
}
.input-search .input { padding-left: 36px; }

/* ---------------------------------------------------------------------- */
/* Chips / Badges                                                          */
/* ---------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: var(--success-100); color: var(--success-text); }
.badge-danger  { background: var(--danger-100); color: var(--danger-text); }
.badge-warn    { background: var(--warn-100); color: var(--warn-text); }
.badge-neutral { background: var(--bg); color: var(--text-600); border: 1px solid var(--border); }
.badge-brand   { background: var(--brand-50); color: var(--brand-700); }
.badge-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* Security column: left-aligned, wraps to new rows (not squeezed like the
   right-aligned action buttons), and each badge stays on one line. */
.measure { max-width: 640px; }
.security-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.security-badges .badge { white-space: nowrap; flex: none; }

/* ---------------------------------------------------------------------- */
/* Cards                                                                    */
/* ---------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { font-size: 15px; }
.card-body { padding: 20px 22px; }

/* ---------------------------------------------------------------------- */
/* Login page                                                              */
/* ---------------------------------------------------------------------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 24%, rgba(32, 179, 108, 0.18), transparent 46%),
    radial-gradient(circle at 84% 80%, rgba(242, 196, 91, 0.10), transparent 46%),
    var(--bg);
}
:root[data-theme="light"] .login-page {
  background:
    radial-gradient(circle at 18% 22%, rgba(15, 148, 87, 0.12), transparent 48%),
    radial-gradient(circle at 85% 82%, rgba(242, 196, 91, 0.16), transparent 46%),
    linear-gradient(135deg, #eef4f0, #f5f2ea);
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(134, 229, 173, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(134, 229, 173, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 72%);
  pointer-events: none;
}
:root[data-theme="light"] .login-page::before {
  background-image:
    linear-gradient(rgba(12, 31, 22, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 31, 22, 0.05) 1px, transparent 1px);
}

/* Animated outlet-pin field (populated by login.js) */
.login-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.login-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  opacity: 0;
  animation-name: dmpPinPop;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
.login-pin svg { display: block; }
.login-pin-ripple {
  position: absolute;
  left: 50%;
  top: 100%;
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation-name: dmpDrop;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes dmpPinPop {
  0%   { opacity: 0; transform: translate(-50%, -100%) scale(0.2); }
  10%  { opacity: 1; transform: translate(-50%, -100%) scale(1.18); }
  18%  { transform: translate(-50%, -100%) scale(0.94); }
  24%  { transform: translate(-50%, -100%) scale(1); }
  74%  { opacity: 1; transform: translate(-50%, -100%) scale(1); }
  92%, 100% { opacity: 0; transform: translate(-50%, -100%) scale(1); }
}
@keyframes dmpDrop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0); }
  12%  { opacity: 0.7; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.4); }
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 392px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 38px 34px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  text-align: center;
}

/* Floating logo with pulsing signal rings */
.login-logo {
  position: relative;
  width: 62px;
  height: 62px;
  margin-bottom: 8px;
  animation: dmpFloat 3.4s ease-in-out infinite;
}
.login-logo-mark { position: relative; z-index: 1; width: 62px; height: 62px; display: block; }
.login-logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 1.5px solid var(--brand-500);
  animation: dmpMarkRing 2s ease-out infinite;
  pointer-events: none;
}
.login-logo-ring--delayed { animation-delay: 1s; }

@keyframes dmpFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes dmpMarkRing { 0% { opacity: 0.5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.75); } }

.login-brand h1 { font-size: 21px; letter-spacing: -0.01em; }
.login-brand p { font-size: 13px; color: var(--text-600); margin-top: 2px; }

/* Gradient tile used by the error page's danger icon (child <svg> centered). */
.login-brand .logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(10, 92, 60, 0.35);
}

/* Self-contained SVG mark image for the verify / device-pending pages. */
.login-brand .auth-mark {
  width: 56px;
  height: 56px;
  display: block;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(10, 92, 60, 0.35);
}

.login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .login-logo, .login-logo-ring, .login-pin, .login-pin-ripple { animation: none; }
  .login-logo-ring { opacity: 0; }
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--danger-100);
  color: var(--danger-600);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.login-error svg { flex: none; }

.login-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--success-100);
  color: var(--success-text);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.login-notice svg { flex: none; }

.login-submit { margin-top: 6px; }
.login-resend-form { margin-top: 8px; }

/* ---------------------------------------------------------------------- */
/* Map page — top bar                                                       */
/* ---------------------------------------------------------------------- */

#app-root { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 30;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text-900);
  font-size: 15px;
  flex: none;
}
.topbar-brand .logo-mark-sm {
  width: 30px; height: 30px; border-radius: 8px;
  display: block; flex: none;
}

.topbar-dataset {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-600);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  flex: none;
  white-space: nowrap;
}
.topbar-dataset.is-ready { display: inline-flex; }

.topbar-search { width: 260px; flex: none; }

.topbar-filters { display: flex; align-items: center; gap: 8px; flex: none; }

.topbar-spacer { flex: 1 1 auto; min-width: 8px; }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--brand-100); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex: none;
}
.topbar-username { font-size: 13px; font-weight: 600; color: var(--text-700); }
.topbar-role { font-size: 11px; color: var(--text-400); text-transform: capitalize; }

/* ---------------------------------------------------------------------- */
/* Filter dropdowns (details/summary — accessible, no extra JS needed)      */
/* ---------------------------------------------------------------------- */

.filter-dd {
  position: relative;
}
.filter-dd summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-700);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}
.filter-dd summary::-webkit-details-marker { display: none; }
.filter-dd summary:hover { border-color: var(--brand-500); }
.filter-dd[open] summary { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }
.filter-dd summary .count { color: var(--text-400); font-weight: 500; }
.filter-dd summary .chevron { transition: transform var(--transition-fast); color: var(--text-400); }
.filter-dd[open] summary .chevron { transform: rotate(180deg); }

.filter-dd-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 40;
}

.filter-actions { display: flex; gap: 6px; padding: 4px 4px 8px; }
.filter-actions button {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-700);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.filter-actions button:hover { border-color: var(--brand-500); color: var(--brand-700); }
.filter-divider { height: 1px; background: var(--border); margin: 4px 0 6px; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-700);
}
.filter-row:hover { background: var(--bg); }
.filter-row input[type="checkbox"] { accent-color: var(--brand-600); width: 15px; height: 15px; }
.filter-color-dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }
.filter-row-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-row-count { color: var(--text-400); font-size: 11.5px; font-variant-numeric: tabular-nums; flex: none; }

/* ---------------------------------------------------------------------- */
/* Map layout: map canvas + legend + detail panel                            */
/* ---------------------------------------------------------------------- */

.map-shell {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  /* Establishes its own stacking context (flex item + non-auto z-index) so
     Leaflet's internal panes/controls (z-index up to 1000) stay contained
     here instead of leaking out to compete with the topbar (z-index 30)
     at the document root. */
  z-index: 0;
}

#map {
  position: absolute;
  inset: 0;
}

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: 260px;
  max-height: 45vh;
  overflow-y: auto;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 10px 12px;
  z-index: 1200;
  font-size: 12px;
}
.map-legend-title { font-weight: 700; color: var(--text-900); margin-bottom: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-400); }
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 6px;
  margin: 0 -6px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-700);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast), opacity var(--transition-fast);
}
.legend-item:hover { background: var(--bg); }
.legend-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; }
.legend-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-count { color: var(--text-400); font-size: 11px; font-variant-numeric: tabular-nums; flex: none; }
.legend-item.is-off { opacity: 0.45; }
.legend-item.is-off .legend-label { text-decoration: line-through; }

/* ---------------------------------------------------------------------- */
/* View-mode segmented control (Pins / Clusters / Heatmap)                 */
/* ---------------------------------------------------------------------- */

.view-mode-control {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  gap: 2px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  padding: 4px;
}
.view-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-600);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.view-mode-btn:hover { background: var(--bg); color: var(--text-900); }
.view-mode-btn.is-active { background: var(--brand-600); color: #fff; }
.view-mode-btn.is-active:hover { background: var(--brand-700); }

/* Cluster leaf markers (Leaflet.markercluster individual, non-clustered
   points) — plain colored dot via a divIcon; color is set with the JS
   .style CSSOM API (see map.js) rather than an inline style attribute. */
.cluster-outlet-icon { background: transparent; border: none; }
.cluster-outlet-dot {
  display: block;
  width: 10px;
  height: 10px;
  margin: 1px;
  border-radius: 999px;
  border: 1px solid #ffffff;
  background: var(--brand-600);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25);
}
.is-highlighted-marker .cluster-outlet-dot {
  width: 16px;
  height: 16px;
  margin: -2px;
  border-color: #ca8a04;
  background: #facc15 !important;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.map-status-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1200;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-600);
  box-shadow: var(--shadow-sm);
}

.detail-panel {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: 340px;
  max-width: calc(100vw - 28px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1300;
  display: flex;
  flex-direction: column;
  transform: translateX(120%);
  opacity: 0;
  transition: transform var(--transition-base), opacity var(--transition-base);
  pointer-events: none;
}
.detail-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.detail-panel-accent { height: 5px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; flex: none; }

.detail-panel-header {
  padding: 18px 20px 12px;
  flex: none;
  position: relative;
}
.detail-panel-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 999px;
  border: none;
  background: var(--bg);
  color: var(--text-600);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.detail-panel-close:hover { background: var(--border); color: var(--text-900); }

.detail-panel-title { font-size: 17px; padding-right: 30px; margin-bottom: 8px; word-break: break-word; }
.detail-panel-code { font-family: var(--font-mono); }

.detail-panel-body {
  padding: 4px 20px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin: 2px 0 16px;
  flex-wrap: wrap;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-700);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.action-btn:hover { background: var(--bg); border-color: var(--brand-500); color: var(--brand-700); text-decoration: none; }
.action-btn svg { flex: none; }
.action-btn-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.action-btn.is-copied { border-color: var(--success-500); color: #15803d; background: var(--success-100); }
.action-btn.is-copy-failed { border-color: var(--danger-500); color: var(--danger-600); background: var(--danger-100); }

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--text-400); font-weight: 600; flex: none; }
.detail-row .value { color: var(--text-900); text-align: right; word-break: break-word; }
.detail-loading, .detail-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-400);
  font-size: 13px;
}

/* ---------------------------------------------------------------------- */
/* Staged banner                                                            */
/* ---------------------------------------------------------------------- */

.staged-banner {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  border-bottom: 1px solid #f59e0b;
  color: #78350f;
  font-size: 13px;
  font-weight: 600;
  z-index: 30;
}
.staged-banner svg { flex: none; color: #b45309; }
.staged-banner-text { flex: 1 1 auto; }
.staged-banner-actions { display: flex; gap: 8px; }

/* ---------------------------------------------------------------------- */
/* Empty state                                                             */
/* ---------------------------------------------------------------------- */

.empty-state {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 40px;
}
.empty-state .empty-icon {
  width: 64px; height: 64px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.empty-state h2 { font-size: 18px; }
.empty-state p { color: var(--text-600); font-size: 14px; max-width: 360px; }

/* ---------------------------------------------------------------------- */
/* Modal                                                                    */
/* ---------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 16px; }
.modal-close {
  width: 30px; height: 30px; border-radius: 999px;
  border: none; background: transparent; color: var(--text-400);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.modal-close:hover { background: var(--bg); color: var(--text-900); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--border);
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 10px;
}
.radio-card:hover { border-color: var(--brand-500); }
.radio-card.is-checked { border-color: var(--brand-600); background: var(--brand-50); }
.radio-card input { margin-top: 2px; accent-color: var(--brand-600); }
.radio-card-title { font-weight: 600; font-size: 14px; color: var(--text-900); }
.radio-card-sub { font-size: 12px; color: var(--text-600); margin-top: 2px; }

/* ---------------------------------------------------------------------- */
/* Toasts                                                                   */
/* ---------------------------------------------------------------------- */

.toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text-700);
  animation: toast-in var(--transition-base);
}
.toast-success { border-left: 3px solid var(--success-500); }
.toast-error { border-left: 3px solid var(--danger-500); }
.toast-info { border-left: 3px solid var(--brand-500); }
.toast svg { flex: none; margin-top: 1px; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------- */
/* Admin shell                                                              */
/* ---------------------------------------------------------------------- */

.admin-shell {
  min-height: 100vh;
  display: flex;
}

.admin-sidebar {
  width: 240px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

/* On narrow screens the fixed 240px sidebar is stacked above the content and
   scrolls with the page, so admin views stay usable on phones/tablets. */
@media (max-width: 760px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
  }
  .admin-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .admin-nav-divider { display: none; }
  .admin-sidebar-footer { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .admin-header { padding: 0 16px; }
  .admin-content { padding: 16px; }
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
  font-weight: 700;
  color: var(--text-900);
  font-size: 14px;
}
.admin-sidebar-brand .logo-mark-sm {
  width: 28px; height: 28px; border-radius: 8px;
  display: block; flex: none;
}

.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-600);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.admin-nav-link svg { flex: none; opacity: 0.8; }
.admin-nav-link:hover { background: var(--bg); color: var(--text-900); text-decoration: none; }
.admin-nav-link.active { background: var(--brand-50); color: var(--brand-700); }
.admin-nav-link.active svg { opacity: 1; }
.admin-nav-divider { height: 1px; background: var(--border); margin: 10px 4px; }

.admin-sidebar-footer { flex: none; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.admin-user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg);
}
.admin-user-avatar {
  width: 32px; height: 32px; border-radius: 999px;
  background: var(--brand-100); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex: none;
}
.admin-user-name { font-size: 13px; font-weight: 600; color: var(--text-900); }
.admin-user-role { font-size: 11px; color: var(--text-400); text-transform: capitalize; }

.admin-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.admin-header {
  height: 68px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-header h1 { font-size: 18px; }
.admin-header-actions { display: flex; gap: 10px; align-items: center; }

.admin-content { flex: 1 1 auto; padding: 28px; max-width: 1200px; width: 100%; }

/* ---------------------------------------------------------------------- */
/* Stat cards                                                               */
/* ---------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card-label {
  font-size: 12px; font-weight: 600; color: var(--text-400);
  text-transform: uppercase; letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.stat-card-icon {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--brand-50); color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
}
.stat-card-value { font-size: 26px; font-weight: 700; color: var(--text-900); }
.stat-card-sub { font-size: 12px; color: var(--text-600); margin-top: 4px; }

/* ---------------------------------------------------------------------- */
/* Tables                                                                   */
/* ---------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-400);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-700);
  vertical-align: middle;
}
table.data-table tbody tr:hover { background: var(--bg); }
table.data-table tbody tr:last-child td { border-bottom: none; }
.table-empty { padding: 40px; text-align: center; color: var(--text-400); font-size: 13px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------------------------------------------------------------------- */
/* Datasets page                                                           */
/* ---------------------------------------------------------------------- */

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-600);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand-500); background: var(--brand-50); }
.dropzone svg { color: var(--brand-500); margin-bottom: 10px; }
.dropzone .dz-title { font-weight: 600; color: var(--text-900); font-size: 14px; }
.dropzone .dz-sub { font-size: 12px; margin-top: 4px; }

.validation-report { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.validation-summary { display: flex; gap: 10px; flex-wrap: wrap; }
.validation-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.validation-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12.5px;
}
.validation-item.err { background: var(--danger-100); color: var(--danger-600); }
.validation-item.warn { background: var(--warn-100); color: #92400e; }
.validation-item svg { flex: none; margin-top: 1px; }
.validation-row-num { font-family: var(--font-mono); font-weight: 700; margin-right: 4px; }

.dataset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
@media (max-width: 900px) { .dataset-grid { grid-template-columns: 1fr; } }

.dataset-card-status {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.dataset-meta-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.dataset-meta-row:last-child { border-bottom: none; }
.dataset-meta-row .label { color: var(--text-400); }
.dataset-meta-row .value { color: var(--text-900); font-weight: 600; }
.dataset-card-actions { display: flex; gap: 8px; margin-top: 16px; }
.dataset-empty { color: var(--text-400); font-size: 13px; padding: 12px 0; }

/* ---------------------------------------------------------------------- */
/* Misc utility                                                             */
/* ---------------------------------------------------------------------- */

.muted { color: var(--text-600); }
.small { font-size: 12px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.w-full { width: 100%; }
.text-right { text-align: right; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}
.spinner.spinner-dark {
  border-color: var(--border-strong);
  border-top-color: var(--brand-600);
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* Leaflet control theming touch-ups */
.leaflet-control-layers,
.leaflet-bar {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--border) !important;
}
.leaflet-touch .leaflet-bar a { width: 32px; height: 32px; line-height: 32px; }
.leaflet-popup-content-wrapper { border-radius: var(--radius-md); }

/* --- Utility classes (replace static inline styles so CSP style-src can drop
   'unsafe-inline'; dynamic colors are still set via the CSSOM .style API). --- */
.text-center { text-align: center; }
.ml-6 { margin-left: 6px; }
.mb-4 { margin-bottom: 4px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.mb-24 { margin-bottom: 24px; }
.fs-14 { font-size: 14px; }
.fs-18 { font-size: 18px; }
.w-200 { width: 200px; }
.pad-14-22 { padding: 14px 22px; }
.gap-12-wrap { gap: 12px; flex-wrap: wrap; }
.spinner-28 { width: 28px; height: 28px; border-width: 3px; }
.modal-sm { max-width: 400px; }
.logo-mark-danger { background: linear-gradient(135deg, var(--danger-500), var(--danger-600)); }

/* Theme toggle: show the moon in light mode (click -> dark), the sun in dark. */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .theme-toggle-label::before { content: "Dark mode"; }
:root[data-theme="dark"] .theme-toggle .theme-toggle-label::before { content: "Light mode"; }
.theme-toggle .theme-toggle-label { font-size: 0; }
.theme-toggle .theme-toggle-label::before { font-size: 13px; }

/* ==========================================================================
   Emerald flourishes (v2) — striking-but-tasteful layer over the token system.
   Uses color-mix so every rule adapts to whichever theme is active.
   ========================================================================== */

/* Ambient depth: faint emerald aura behind the whole app. */
body {
  background:
    radial-gradient(1200px 620px at 12% -12%, rgba(32, 179, 108, 0.10), transparent 60%),
    radial-gradient(1000px 560px at 100% -6%, rgba(13, 122, 80, 0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* Primary buttons: emerald gradient + glow. */
.btn-primary {
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  color: var(--text-on-brand);
  font-weight: 700;
  border: 0;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #33dd8a, var(--brand-500));
  box-shadow: var(--glow);
}
.btn-secondary:hover:not(:disabled) { color: var(--brand-700); }

/* Login: emerald spotlight + gradient logo. */
.login-page::before {
  background:
    radial-gradient(620px 420px at 22% 18%, rgba(32, 179, 108, 0.22), transparent 60%),
    radial-gradient(520px 400px at 82% 82%, rgba(242, 196, 91, 0.10), transparent 55%);
}
.login-card {
  background: linear-gradient(160deg, var(--surface-raised), var(--surface));
  box-shadow: var(--shadow-lg);
}
.login-brand .logo-mark {
  background: linear-gradient(145deg, var(--brand-500), var(--brand-800));
  box-shadow: var(--glow);
}

/* Topbar: subtle emerald underline. */
.topbar { box-shadow: 0 1px 0 color-mix(in srgb, var(--brand-500) 20%, transparent), var(--shadow-sm); }

/* Glassmorphic floating map controls. */
.map-legend,
.view-mode-control,
.map-status-pill,
.detail-panel,
.filter-dd-panel {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
}
.detail-panel { box-shadow: var(--shadow-lg); }
.view-mode-btn.is-active {
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  color: var(--text-on-brand);
  box-shadow: var(--glow);
}
.view-mode-btn.is-active:hover { background: linear-gradient(180deg, #33dd8a, var(--brand-500)); }

/* Cards: soft top-lit gradient. */
.card {
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--surface-raised) 65%, var(--surface)), var(--surface));
}

/* Stat cards: emerald top accent + hover lift + glowing icon. */
.stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--surface-raised), var(--surface));
  transition: transform var(--transition-base), border-color var(--transition-base),
    box-shadow var(--transition-base);
}
.stat-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-500), transparent 75%);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand-500) 45%, var(--border));
  box-shadow: var(--glow);
}
.stat-card-icon,
.empty-state .empty-icon,
.dropzone svg { color: var(--brand-500); }

/* Data tables: row-hover highlight (data-dense dashboard pattern). */
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--brand-50); }

/* Admin sidebar: active item gets an emerald edge bar. */
.admin-nav-link { position: relative; }
.admin-nav-link.active::before {
  content: "";
  position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand-500);
}

/* Code / status chip: emerald tint. */
.chip { border-color: color-mix(in srgb, var(--brand-500) 30%, transparent); }

/* Leaflet controls tuned for the dark map. */
.leaflet-bar a,
.leaflet-control-layers,
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 86%, transparent) !important;
  color: var(--text-600) !important;
  border-color: var(--border) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.leaflet-bar a { color: var(--text-700) !important; }
.leaflet-bar a:hover { background: var(--surface-raised) !important; color: var(--text-900) !important; }
.leaflet-control-attribution a { color: var(--brand-700) !important; }
#map { background: var(--bg); }

/* Subtle emerald-tinted scrollbars. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--brand-800); }
