:root {
  color-scheme: light;
  --brand-paper: 250 248 244;
  --brand-surface: 255 255 255;
  --brand-ink: 24 54 56;
  --brand-muted: 82 105 107;
  --brand-border: 220 229 226;
  --brand-softTeal: 228 243 241;
  --brand-link: 40 125 131;
  /* UIX 2026-11: layered, petrol-tinted elevation */
  --shadow-card: 0 1px 2px rgb(24 54 56 / .05), 0 2px 6px -2px rgb(24 54 56 / .06);
  --shadow-raise: 0 2px 4px rgb(24 54 56 / .04), 0 12px 28px -10px rgb(24 54 56 / .16);
  --shadow-pop: 0 4px 10px rgb(24 54 56 / .06), 0 24px 48px -16px rgb(24 54 56 / .28);
  --ring-focus: 0 0 0 3px rgb(40 125 131 / .28);
  /* Design overhaul 2026-11: text and icons on orange fills are always ink (5.5:1). */
  --brand-onAccent: 255 255 255;
  /* Semantic states: text (AA on surface and paper), soft background, line (border).
     Values match frontend/lib/core/palette.dart; info uses the petrol hover shade #20666B (AA on soft teal). */
  --sem-success: 46 125 50;   --sem-success-soft: 232 245 233; --sem-success-line: 165 214 167;
  --sem-warning: 164 67 0;    --sem-warning-soft: 255 243 224; --sem-warning-line: 255 204 128;
  --sem-danger: 198 40 40;    --sem-danger-soft: 255 235 238;  --sem-danger-line: 239 154 154;
  --sem-info: 32 102 107;     --sem-info-soft: 228 243 241;    --sem-info-line: 169 213 211;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-paper: 16 27 29;
  --brand-surface: 25 42 45;
  --brand-ink: 233 242 241;
  --brand-muted: 174 194 194;
  --brand-border: 54 81 86;
  --brand-softTeal: 36 63 66;
  --brand-link: 115 201 204;
  --shadow-card: 0 1px 2px rgb(0 0 0 / .25), 0 2px 8px -2px rgb(0 0 0 / .3);
  --shadow-raise: 0 2px 4px rgb(0 0 0 / .25), 0 14px 30px -10px rgb(0 0 0 / .5);
  --shadow-pop: 0 4px 12px rgb(0 0 0 / .3), 0 26px 50px -16px rgb(0 0 0 / .6);
  --ring-focus: 0 0 0 3px rgb(115 201 204 / .35);
  --brand-onAccent: 255 255 255;
  --sem-success: 147 223 192; --sem-success-soft: 24 60 52;    --sem-success-line: 57 105 90;
  --sem-warning: 255 213 144; --sem-warning-soft: 60 50 30;    --sem-warning-line: 121 96 58;
  --sem-danger: 255 180 171;  --sem-danger-soft: 64 35 38;     --sem-danger-line: 135 68 75;
  --sem-info: 115 201 204;    --sem-info-soft: 36 63 66;       --sem-info-line: 62 107 111;
}
.theme-menu summary { list-style: none; }
.theme-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary { list-style: none; cursor: pointer; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu :focus-visible { outline: 2px solid rgb(var(--brand-link)); outline-offset: 2px; }
.theme-menu button { display: flex; align-items: center; width: 100%; padding: .5rem .75rem; text-align: start; border-radius: .5rem; gap: .5rem; }
.theme-menu button:hover, .theme-menu button[aria-pressed="true"] { background: rgb(var(--brand-softTeal)); color: rgb(var(--brand-link)); }
.theme-menu button[aria-pressed="true"]::after { content: '✓'; margin-inline-start: auto; font-weight: bold; }
.theme-menu :focus-visible { outline: 2px solid rgb(var(--brand-link)); outline-offset: 2px; }

/* Mobile Navigation Drawer & Backdrop */
.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  inset-inline-start: 0;
  width: 310px;
  max-width: 86vw;
  background: rgb(var(--brand-surface));
  z-index: 100;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(100%);
  border-inline-end: 1px solid rgb(var(--brand-border));
}
[dir="ltr"] .mobile-drawer {
  transform: translateX(-100%);
}
.mobile-drawer.is-open {
  transform: translateX(0) !important;
}
.mobile-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(24, 54, 56, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}
.mobile-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
/* Map imagery retains its source colors; only the surrounding controls change. */
.leaflet-popup-content-wrapper, .leaflet-popup-tip, .leaflet-bar a, .leaflet-control-attribution {
  background: rgb(var(--brand-surface)) !important;
  color: rgb(var(--brand-ink)) !important;
}
.leaflet-bar a:hover { background: rgb(var(--brand-softTeal)) !important; }
.leaflet-container a { color: rgb(var(--brand-link)); }
