html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  font-family: var(--font-ui);
  background: #0c1824;
  overflow: hidden;
  overscroll-behavior: none;
}

:root {
  color-scheme: dark;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --app-header-content-height: clamp(50px, 6vh, 64px);
  --app-header-height: calc(var(--app-header-content-height) + var(--safe-area-top));
  --ui-density-scale: 1;
  --ui-viewport-scale: 1;
  --ui-scale: calc(var(--ui-density-scale) * var(--ui-viewport-scale));

  /* Typography */
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', 'Monaco', monospace;

  /* Glassmorphism - very transparent for maximum map visibility */
  --glass-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.05));
  --glass-surface-strong: linear-gradient(160deg, rgba(12, 24, 36, 0.85), rgba(12, 24, 36, 0.68));
  --glass-border: rgba(255, 255, 255, 0.28);
  --glass-border-strong: rgba(255, 255, 255, 0.38);
  --glass-highlight: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 22px 52px rgba(6, 12, 20, 0.48);
  --glass-blur: clamp(14px, 1.8vw, 22px);
  --glass-radius: clamp(14px, 1.5vw, 22px);

  /* Text shadows for readability */
  --text-shadow-subtle: 0 1px 2px rgba(255, 255, 255, 0.5);
}

@supports (height: 100dvh) {
  body {
    height: 100dvh;
    min-height: 100dvh;
  }
}

/* Installed iOS web apps can expose a layout viewport that stops above the
   Home indicator while the large viewport still covers the physical display.
   The document and the fixed map must use the same surface: sizing only the
   map to 100lvh leaves it clipped by the shorter root and reveals a bottom
   strip. This is the edge-to-edge strategy used by the known-good build. */
@supports (height: 100lvh) {
  html,
  body {
    height: 100lvh;
    min-height: 100lvh;
  }
}

@media (max-resolution: 1dppx) {
  :root {
    --ui-density-scale: 0.95;
    --glass-blur: clamp(12px, 1.6vw, 18px);
    --glass-shadow: 0 18px 44px rgba(6, 12, 20, 0.42);
  }
}

@media (min-resolution: 1.5dppx) {
  :root {
    --ui-density-scale: 1.1;
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-border-strong: rgba(255, 255, 255, 0.42);
    --glass-shadow: 0 26px 60px rgba(6, 12, 20, 0.52);
  }
}

@media (min-resolution: 2.5dppx) {
  :root {
    --ui-density-scale: 1.25;
    --glass-blur: clamp(16px, 2vw, 26px);
  }
}

@media (max-width: 640px) {
  :root {
    --glass-radius: clamp(12px, 4vw, 18px);
  }
}

@media (max-width: 1440px) {
  :root {
    --ui-viewport-scale: 0.98;
  }
}

@media (max-width: 1200px) {
  :root {
    --ui-viewport-scale: 0.94;
  }
}

@media (max-width: 1024px) {
  :root {
    --ui-viewport-scale: 0.9;
  }
}

@media (max-width: 900px) {
  :root {
    --ui-viewport-scale: 0.86;
  }
}

@media (max-width: 720px) {
  :root {
    --ui-viewport-scale: 0.82;
  }
}

@media (max-width: 540px) {
  :root {
    --ui-viewport-scale: 0.78;
  }
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

@supports (height: 100lvh) {
  #map {
    height: 100lvh;
  }
}

.maplibregl-canvas.xplore-freehand-drawing {
  cursor: crosshair !important;
}

.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;
}

.maplibre-preload {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c1824;
  color: #728c6c;
  font: 600 18px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  letter-spacing: 0.04em;
  text-transform: none;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.maplibre-preload__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 0;
  border-radius: 32px;
  background: none;
  box-shadow: none;
  pointer-events: auto;
}

/* App Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  height: var(--app-header-height);
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--safe-area-top) calc(32px + var(--safe-area-right)) 0 calc(32px + var(--safe-area-left));
  background: var(--glass-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

.app-header__left,
.app-header__right {
  flex: 1;
}

.app-header__right {
  display: flex;
  justify-content: flex-end;
}

.app-header__center {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 600px;
  min-width: 280px;
  margin: 0 auto;
}

.header-geocoder {
  width: 100%;
  max-width: 400px;
  pointer-events: auto;
}

.header-geocoder .maplibregl-ctrl-geocoder {
  margin: 0 auto;
  max-width: 100%;
}

.app-header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  cursor: pointer;
}

.app-header__logo-img {
  height: clamp(28px, 3.8vh, 36px);
  width: auto;
}

.app-header__logo-text {
  font-size: clamp(18px, 2.4vh, 22px);
  font-weight: 700;
  color: #728c6c;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}


/* Directions Actions Bar (Sidebar) */
.ui__row--directions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.directions-actions-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--glass-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 110;
  pointer-events: auto;

  /* Animation properties - Slower for a more premium feel */
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  padding: 0 4px;
  overflow: hidden;
  transform: scale(0.95) translateY(-10px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.6s;
}

.directions-actions-bar.visible {
  opacity: 1;
  visibility: visible;
  max-height: 800px;
  padding: 8px 4px;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* The mobile presentation groups the existing controls without cloning them.
   `display: contents` keeps the original desktop rail byte-for-byte in layout. */
.routing-tools-group {
  display: contents;
}

.routing-tools-mobile-header,
.routing-tools-group__title,
.routing-tool-label,
.mobile-sheet-handle,
.directions-control > .directions-header {
  display: none;
}

.library-close {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.library-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Terrain Toolbox (Right Sidebar) */
.imagery-panel__control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.terrain-toolbox,
.snow-toolbox,
.shadow-toolbox,
.pathway-toolbox,
.basemap-toolbox,
.photos-toolbox {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) scale(0.95) translateY(-10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--glass-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  z-index: 100;

  /* Animation properties matched with directions-actions-bar */
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  padding: 0 4px;
  overflow: hidden;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.6s;
}

.terrain-toolbox.visible,
.snow-toolbox.visible,
.shadow-toolbox.visible,
.pathway-toolbox.visible,
.basemap-toolbox.visible,
.photos-toolbox.visible {
  opacity: 1;
  visibility: visible;
  max-height: 800px;
  padding: 10px 4px;
  overflow: visible;
  transform: translateX(-50%) scale(1) translateY(0);
}

/* Toolbox Active States - Standardized Glow */
.terrain-toolbox-toggle.active,
.snow-toolbox-toggle.active,
.shadow-toolbox-toggle.active,
.pathway-toolbox-toggle.active,
.basemap-toolbox-toggle.active,
.photos-toolbox-toggle.active {
  background: var(--glass-surface-strong) !important;
  border-color: rgba(39, 174, 96, 0.6) !important;
  box-shadow: 0 0 15px rgba(39, 174, 96, 0.35), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

/* Terrain Toggle with selected layer thumbnail */
.terrain-toolbox-toggle {
  position: relative;
  overflow: hidden;
  border-radius: 50% !important;
}

.map-action-btn__thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
  border-radius: 50%;
  filter: brightness(0.7);
}

.map-action-btn__thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
}

.map-action-btn.has-active-layer .map-action-btn__thumb {
  opacity: 1;
}

.map-action-btn.has-active-layer img {
  position: relative;
  z-index: 1;
  filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) !important;
}


.terrain-toolbox-toggle.has-active-layer {
  border-color: #2ecc71 !important;
  box-shadow: 0 0 15px rgba(39, 174, 96, 0.5), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

.shadow-toolbox-toggle.has-active-layer {
  border-color: #f39c12 !important;
  box-shadow: 0 0 15px rgba(243, 156, 18, 0.5), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

.snow-toolbox-toggle.has-active-layer {
  border-color: #3498db !important;
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.5), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

.pathway-toolbox-toggle.has-active-layer {
  border-color: #e67e22 !important;
  box-shadow: 0 0 15px rgba(230, 126, 34, 0.5), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

.basemap-toolbox-toggle.has-active-layer {
  border-color: #3498db !important;
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.5), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

.photos-toolbox-toggle.has-active-layer {
  border-color: #9b59b6 !important;
  box-shadow: 0 0 15px rgba(155, 89, 182, 0.5), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}


.terrain-toolbox .btn.terrain-toolbox__toggle,
.snow-toolbox .btn.snow-toolbox__toggle,
.shadow-toolbox .btn.shadow-toolbox__toggle,
.pathway-toolbox .btn.pathway-toolbox__toggle,
.basemap-toolbox .btn.basemap-toolbox__toggle,
.photos-toolbox .btn.photos-toolbox__toggle {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  margin: 2px 0 !important;
  background: var(--glass-surface-strong) !important;
  border: 1px solid var(--glass-border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, background 0.2s ease !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

/* Allow badge to overflow on heatmap button */
.pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="heatmap"] {
  overflow: visible !important;
}

.terrain-toolbox .btn.terrain-toolbox__toggle:hover,
.snow-toolbox .btn.snow-toolbox__toggle:hover,
.shadow-toolbox .btn.shadow-toolbox__toggle:hover,
.pathway-toolbox .btn.pathway-toolbox__toggle:hover,
.basemap-toolbox .btn.basemap-toolbox__toggle:hover,
.photos-toolbox .btn.photos-toolbox__toggle:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.08) !important;
}

.terrain-toolbox .btn.terrain-toolbox__toggle.active,
.snow-toolbox .btn.snow-toolbox__toggle.active,
.shadow-toolbox .btn.shadow-toolbox__toggle.active,
.pathway-toolbox .btn.pathway-toolbox__toggle.active,
.basemap-toolbox .btn.basemap-toolbox__toggle.active,
.photos-toolbox .btn.photos-toolbox__toggle.active {
  background: rgba(39, 174, 96, 0.25) !important;
  border-color: rgba(39, 174, 96, 0.6) !important;
  box-shadow: 0 0 12px rgba(39, 174, 96, 0.4) !important;
}

/* Heatmap active state: red instead of green with bloom effect */
.pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="heatmap"].active {
  background: rgba(220, 50, 30, 0.45) !important;
  border-color: rgba(255, 100, 50, 0.8) !important;
  box-shadow: 0 0 15px rgba(220, 50, 30, 0.7), 0 0 30px rgba(220, 50, 30, 0.3) !important;
  animation: heatmap-pulse 2s infinite ease-in-out;
}

@keyframes heatmap-pulse {
  0% {
    box-shadow: 0 0 15px rgba(220, 50, 30, 0.7), 0 0 30px rgba(220, 50, 30, 0.3);
  }

  50% {
    box-shadow: 0 0 25px rgba(255, 100, 50, 0.9), 0 0 45px rgba(220, 50, 30, 0.5);
  }

  100% {
    box-shadow: 0 0 15px rgba(220, 50, 30, 0.7), 0 0 30px rgba(220, 50, 30, 0.3);
  }
}

.terrain-toolbox .btn.terrain-toolbox__toggle img,
.snow-toolbox .btn.snow-toolbox__toggle img,
.shadow-toolbox .btn.shadow-toolbox__toggle img,
.pathway-toolbox .btn.pathway-toolbox__toggle img:not(.pathway-badge),
.basemap-toolbox .btn.basemap-toolbox__toggle img:not(.basemap-badge),
.photos-toolbox .btn.photos-toolbox__toggle img {
  width: 100% !important;
  height: 100% !important;
  filter: none !important;
  object-fit: cover !important;
  display: block !important;
}

/* Icon-style pathway buttons (non-tile previews) */
.pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="heatmap"] img:not(.pathway-badge) {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
  filter: invert(1) drop-shadow(0 0 2px rgba(255, 255, 255, 0.5)) !important;
}

.pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="routes"] img:not(.pathway-badge) {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
  filter: invert(1) !important;
}

.pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="ski-rando"] img:not(.pathway-badge) {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
  filter: invert(1) !important;
}

/* Badge overlay showing active sub-category on pathway buttons */
.pathway-badge {
  position: absolute !important;
  bottom: -2px !important;
  left: -2px !important;
  width: 14px !important;
  height: 14px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  object-fit: contain !important;
  filter: invert(1) !important;
  z-index: 10 !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

/* Badge overlay showing active sub-category on basemap buttons */
.basemap-badge {
  position: absolute !important;
  top: -2px !important;
  right: -2px !important;
  width: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 50% !important;
  background: rgba(30, 30, 30, 0.7) !important;
  object-fit: contain !important;
  filter: none !important;
  z-index: 20 !important;
  pointer-events: none !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) !important;
}

/* Option row: positioning context for fly-out sub-menus */
.toolbox-option-row {
  position: relative;
  display: flex;
  justify-content: center;
}

/* Sub-menu containers — fly out horizontally to the right */
.basemap-sub-menu,
.pathway-sub-menu,
.shadow-sub-menu {
  display: none !important;
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--glass-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  z-index: 110;
}

.basemap-sub-menu.visible,
.pathway-sub-menu.visible,
.shadow-sub-menu.visible {
  display: flex !important;
}

/* Sub-option thumbnail buttons — matching main toolbox button style */
.sub-thumb-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--glass-surface-strong);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sub-thumb-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.sub-thumb-btn span {
  font-size: 9px;
  font-weight: 700;
  color: #ccc;
  text-align: center;
  line-height: 1;
}

.sub-thumb-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.sub-thumb-btn.active {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.shadow-sub-option.active {
  border-color: rgba(243, 156, 18, 0.75);
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.28);
}

/* Lidar HD action icon buttons (tree / leaf) */
.lidar-action-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  padding: 0 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: var(--glass-surface-strong);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lidar-action-btn img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1) opacity(0.85);
  pointer-events: none;
}

.lidar-action-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

.lidar-action-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
}

.lidar-action-btn.active img {
  filter: brightness(0) invert(1) opacity(1);
}

.lidar-actions {
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

.analytical-legend-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: fixed;
  top: 50%;
  right: calc(20px + env(safe-area-inset-right, 0px));
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1000;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* The analysis legends live in the same control rail as the camera controls.
   Appending the container after #toggle3D keeps them directly below 2D/3D. */
.maplibregl-ctrl-top-right > .analytical-legend-container {
  position: static;
  top: auto;
  right: auto;
  max-width: 118px;
  align-items: flex-end;
  gap: 7px;
  transform: none;
}

body.layer-panel-ui-v2 .maplibregl-ctrl-top-right > .analytical-legend-container > .analytical-legend {
  padding: 5px 7px;
  background: rgba(4, 10, 14, 0.58);
  border: 1px solid rgba(0, 0, 0, 0.82);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 3px 13px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

body.layer-panel-ui-v2 .maplibregl-ctrl-top-right > .analytical-legend-container > .analytical-legend--aspect {
  padding: 2px;
  border-radius: 50%;
}

body.layer-panel-ui-v2 .maplibregl-ctrl-top-right > .analytical-legend-container > .analytical-legend--slope,
body.layer-panel-ui-v2 .maplibregl-ctrl-top-right > .analytical-legend-container > .analytical-legend--snow {
  padding-left: 27px;
}

body.layer-panel-ui-v2 .maplibregl-ctrl-top-right > .analytical-legend-container .slope-labels,
body.layer-panel-ui-v2 .maplibregl-ctrl-top-right > .analytical-legend-container .snow-labels,
body.layer-panel-ui-v2 .maplibregl-ctrl-top-right > .analytical-legend-container .avalanche-labels,
body.layer-panel-ui-v2 .maplibregl-ctrl-top-right > .analytical-legend-container .snow-depth-labels {
  color: #fff;
  font-weight: 750;
  text-align: right;
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.95),
    1px -1px 0 rgba(0, 0, 0, 0.95),
    -1px 1px 0 rgba(0, 0, 0, 0.95),
    1px 1px 0 rgba(0, 0, 0, 0.95),
    0 2px 4px rgba(0, 0, 0, 0.95);
}

body.layer-panel-ui-v2 .maplibregl-ctrl-top-right > .analytical-legend-container .analytical-legend--aspect text {
  stroke: rgba(0, 0, 0, 0.92);
  stroke-width: 2px;
  paint-order: stroke fill;
}

.analytical-legend {
  background: var(--glass-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-family: var(--font-ui);
  pointer-events: auto;
  min-width: 50px;
  /* Reduced further */
  animation: legend-in-right 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.analytical-legend__title {
  display: none;
}

@keyframes legend-in-right {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.analytical-legend__content {
  position: relative;
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analytical-legend--aspect .analytical-legend__content svg {
  width: 82px;
  height: 82px;
}

body.layer-panel-ui-legacy .maplibregl-ctrl-top-right > .analytical-legend-container > .analytical-legend--shadow {
  box-sizing: border-box;
  width: min(330px, calc(100vw - 40px));
  max-width: none;
  align-items: stretch;
  padding: 12px;
}

/* Orientation List */
.orientation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.orientation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
}

.orientation-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

/* Slope Bar & Handles */
.slope-legend__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.slope-bar-wrapper {
  position: relative;
  height: 112px;
  width: 34px;
  margin: 0 auto;
}

.slope-gradient-bar {
  position: absolute;
  inset: 0 12px;
  border-radius: 5px;
  background: linear-gradient(to top,
      #2ecc71 0%,
      #f1c40f 33%,
      #e67e22 50%,
      #e74c3c 66%,
      #8e44ad 100%);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.slope-labels {
  position: absolute;
  right: 24px;
  width: 31px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  font-size: 8px;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.slope-legend__value {
  display: none;
}

/* Snow Bar & Handles */
.snow-legend__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.snow-bar-wrapper {
  position: relative;
  height: 112px;
  width: 34px;
  margin: 0 auto;
}

.snow-gradient-bar {
  position: absolute;
  inset: 0 12px;
  border-radius: 5px;
  background: linear-gradient(to top,
      #1a365d 0%,
      #3182ce 50%,
      #ffffff 100%);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.snow-labels {
  position: absolute;
  right: 24px;
  width: 40px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  font-size: 7px;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

/* Panel-hosted analysis settings */
.analysis-settings {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: rgba(255, 255, 255, 0.84);
  font-family: var(--font-ui);
}

.analysis-settings__header,
.sun-controls__section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  font-size: 11px;
  font-weight: 700;
}

.analysis-settings__header output,
.sun-controls__section-header output {
  margin-left: auto;
  color: #8fc59a;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
}

.analysis-settings__ticks,
.sun-controls__ticks,
.sun-controls__solar-times {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.46);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
}

.analysis-settings--slope .analysis-settings__ticks {
  position: relative;
  display: block;
  height: 8px;
}

.analysis-settings--slope .analysis-settings__ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.analysis-settings--slope .analysis-settings__ticks span:nth-child(1) {
  left: 0;
  transform: none;
}

.analysis-settings--slope .analysis-settings__ticks span:nth-child(2) {
  left: 33.333%;
}

.analysis-settings--slope .analysis-settings__ticks span:nth-child(3) {
  left: 50%;
}

.analysis-settings--slope .analysis-settings__ticks span:nth-child(4) {
  right: 0;
  transform: none;
}

.analysis-dual-range {
  --range-start: 0%;
  --range-end: 100%;
  position: relative;
  height: 24px;
  margin: 0 7px;
}

.analysis-dual-range__track,
.analysis-dual-range__selection {
  position: absolute;
  top: 9px;
  right: 0;
  left: 0;
  height: 6px;
  border-radius: 999px;
}

.analysis-dual-range__track {
  background: linear-gradient(90deg, #2ecc71 0%, #f1c40f 33%, #e67e22 50%, #e74c3c 66%, #8e44ad 100%);
  opacity: 0.45;
}

.analysis-dual-range__selection {
  right: calc(100% - var(--range-end));
  left: var(--range-start);
  background: linear-gradient(90deg, #78d990, #f1c40f 35%, #e67e22 58%, #df6060 78%, #a65fb8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.analysis-dual-range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 24px;
  padding: 0;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.analysis-dual-range input[type="range"]::-webkit-slider-thumb,
.analysis-settings__range::-webkit-slider-thumb,
.sun-controls__range::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  appearance: none;
  background: #f7faf8;
  border: 1px solid rgba(4, 10, 14, 0.75);
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.48);
  cursor: pointer;
  pointer-events: auto;
}

.analysis-dual-range input[type="range"]::-moz-range-thumb,
.analysis-settings__range::-moz-range-thumb,
.sun-controls__range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #f7faf8;
  border: 1px solid rgba(4, 10, 14, 0.75);
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.48);
  cursor: pointer;
  pointer-events: auto;
}

.analysis-settings__range,
.sun-controls__range {
  width: 100%;
  height: 6px;
  appearance: none;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  cursor: pointer;
}

.analysis-settings__range--snow {
  background: linear-gradient(90deg, #1a365d 0%, #3182ce 50%, #f2f8f6 100%);
}

/* Sun date and time controls */
.shadow-legend__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 0;
}

.sun-controls__direct {
  display: flex;
  align-items: end;
  gap: 7px;
}

.sun-controls__field {
  display: flex;
  flex: 1 1 120px;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sun-controls__field--time {
  flex-basis: 80px;
}

.sun-controls__field input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 7px;
  color: rgba(255, 255, 255, 0.94);
  color-scheme: dark;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: rgba(3, 9, 13, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
}

.sun-controls__now,
.sun-controls__nudge,
.sun-controls__play,
.sun-controls__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 30px;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  cursor: pointer;
}

.sun-controls__now {
  flex: 0 0 auto;
  padding: 0 9px;
  color: #8fc59a;
}

.sun-controls__section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.sun-controls__slider-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 7px;
}

.sun-controls__nudge {
  width: 32px;
  height: 27px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 8px;
}

.sun-controls__play,
.sun-controls__icon-btn {
  width: 26px;
  height: 26px;
  padding: 5px;
}

.sun-controls__play {
  margin-left: 2px;
}

.sun-controls__play[data-playing="true"] {
  color: #8fc59a;
  background: rgba(120, 217, 144, 0.13);
  border-color: rgba(120, 217, 144, 0.38);
}

.sun-controls__play svg,
.sun-controls__icon-btn svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.sun-controls__ticks,
.sun-controls__solar-times {
  margin: 0 39px;
}

.sun-controls__solar-times {
  gap: 5px;
  font-size: 7px;
}

.sun-controls__solar-times span:nth-child(2) {
  text-align: center;
}

.sun-controls__solar-times span:last-child {
  text-align: right;
}

.sun-controls button:hover,
.sun-controls button:focus-visible,
.sun-controls__field input:focus-visible {
  color: #a8ddb2;
  border-color: rgba(120, 217, 144, 0.48);
  outline: none;
}

.shadow-legend__debug-menu {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.shadow-legend__btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 11px;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.shadow-legend__btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.shadow-legend__btn--sky[data-off="false"] {
  background: #e67e22;
  border-color: #f39c12;
}

.shadow-legend__btn--debug[data-off="false"] {
  background: #e74c3c;
  border-color: #c0392b;
}

.shadow-legend__fog-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shadow-legend__fog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  gap: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.shadow-legend__fog-row input {
  flex: 1;
}


/* Avalanche Legend - Shader Aligned */
.avalanche-legend-content {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  padding: 2px 0;
}

.avalanche-bar {
  display: flex;
  flex-direction: column-reverse;
  /* 30 at bottom, 45+ at top */
  width: 9px;
  height: 82px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.avalanche-bar__segment {
  width: 100%;
  flex: 1;
}

.avalanche-labels {
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  height: 82px;
  font-size: 8px;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.8);
  padding: 2px 0;
  line-height: 1;
  align-items: flex-end;
}

.avalanche-labels span {
  display: flex;
  align-items: center;
}

/* Snow Depth Legend (Alps) */
.snow-depth-legend__content {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  padding: 2px 0;
}

.snow-depth-bar {
  width: 9px;
  height: 132px;
  border-radius: 4px;
  background: linear-gradient(to bottom,
      #ffffff 0%,
      #ccffff 10%,
      #99ccff 20%,
      #3366ff 30%,
      #0000ff 40%,
      #6633ff 50%,
      #9933ff 60%,
      #996699 70%,
      #ffcc66 80%,
      #cc3333 90%,
      #000000 100%);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
}

.snow-depth-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 7px;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  align-items: flex-end;
}


/* Terrain Hover Info */
.terrain-hover-info {
  position: fixed;
  display: none;
  pointer-events: none;
  background: rgba(12, 24, 36, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  z-index: 10000;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transform: translate(-50%, calc(-100% - 16px));
}

.terrain-hover__sep {
  opacity: 0.4;
}

.terrain-hover__risk {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.risk-low {
  color: #4ade80;
}

.risk-moderate {
  color: #facc15;
}

.risk-considerable {
  color: #fb923c;
}

.risk-high {
  color: #f87171;
}

.risk-very-high {
  color: #ef4444;
}

.risk-extreme {
  color: #dc2626;
}

.terrain-hover-info::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(12, 24, 36, 0.9);
}

/* Toolbox Toggles handled in Premium Map Controls section */

.directions-actions-bar__separator {
  width: 24px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--glass-border), transparent);
  margin: 4px 0;
}

.directions-actions-bar .btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  background: var(--glass-surface-strong) !important;
  border: 1px solid var(--glass-border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, background 0.2s ease !important;
  cursor: pointer !important;
}

.directions-actions-bar .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.08) !important;
}

.directions-actions-bar .btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.directions-actions-bar .btn img {
  width: 20px !important;
  height: 20px !important;
  filter: brightness(0) invert(1) !important;
}

.directions-actions-bar .btn svg {
  width: 20px !important;
  height: 20px !important;
  color: #fff !important;
  fill: currentColor !important;
}

.directions-actions-bar .route-mode-btn.active {
  background: rgba(39, 174, 96, 0.25);
  border-color: #27ae60;
  box-shadow: 0 0 8px rgba(39, 174, 96, 0.3);
}

.directions-actions-bar .debug-network-control {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.directions-actions-bar .debug-network-control img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.header-geocoder .mapboxgl-ctrl-geocoder,
.header-geocoder .maplibregl-ctrl-geocoder {
  width: 100%;
  max-width: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.header-geocoder .mapboxgl-ctrl-geocoder:focus-within,
.header-geocoder .maplibregl-ctrl-geocoder:focus-within {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-border-strong);
}

/* Remove hover effect on search input area */
.header-geocoder .mapboxgl-ctrl-geocoder--input:hover,
.header-geocoder .maplibregl-ctrl-geocoder--input:hover {
  background: transparent !important;
}

.header-geocoder .mapboxgl-ctrl-geocoder--input,
.header-geocoder .maplibregl-ctrl-geocoder--input {
  color: rgba(255, 255, 255, 0.96) !important;
  font-family: var(--font-ui) !important;
  font-size: 14px !important;
  height: 38px !important;
  padding-left: 40px !important;
}

.header-geocoder .mapboxgl-ctrl-geocoder--input::placeholder,
.header-geocoder .maplibregl-ctrl-geocoder--input::placeholder {
  color: rgba(255, 255, 255, 0.68) !important;
  opacity: 1;
}

.header-geocoder .mapboxgl-ctrl-geocoder--icon-search,
.header-geocoder .maplibregl-ctrl-geocoder--icon-search {
  top: 50% !important;
  left: 14px !important;
  transform: translateY(-50%) !important;
  fill: #fff !important;
  opacity: 0.85;
}

.header-geocoder .mapboxgl-ctrl-geocoder .suggestions {
  background: var(--glass-surface-strong) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 12px !important;
  margin-top: 8px !important;
  max-height: 384px !important;
  overflow-y: auto !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

.header-geocoder .suggestions>li>a {
  color: rgba(255, 255, 255, 0.9) !important;
  padding: 10px 16px !important;
}

.header-geocoder .suggestions>li.active>a,
.header-geocoder .suggestions>li>a:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

.header-geocoder .xplore-search-result {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  width: 100%;
}

.header-geocoder .xplore-search-result__icon {
  width: 18px;
  height: 18px;
  background: var(--xplore-search-icon-color, #7bb7ff);
  -webkit-mask-image: var(--xplore-search-icon-url);
  mask-image: var(--xplore-search-icon-url);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.header-geocoder .xplore-search-result__body {
  min-width: 0;
}

.header-geocoder .xplore-search-result__title {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-geocoder .xplore-search-result__title strong {
  color: #fff;
  font-weight: 800;
}

.header-geocoder .xplore-search-result__meta {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-geocoder .xplore-search-result__meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-geocoder .xplore-search-result__elevation {
  color: rgba(132, 190, 255, 0.95);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.maplibre-preload__logo {
  width: clamp(235px, 40vw, 365px);
}

.maplibre-preload__logo img,
.maplibre-preload__logo video {
  display: block;
  width: 100%;
  height: auto;
}

.maplibre-preload__text {
  font-weight: 600;
  font-size: clamp(32px, 5vw, 42px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.maplibre-preload--hidden {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .maplibre-preload {
    transition: none;
  }
}

.ui {
  position: absolute;
  top: clamp(66px, 8vh, 80px);
  left: calc(16px + env(safe-area-inset-left, 0px));
  bottom: auto;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  font: 13px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  gap: 12px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  pointer-events: auto;
}

.app-logo__img {
  height: clamp(24px, 3.5vh, 32px);
  width: auto;
}

.app-logo__text {
  font-size: clamp(16px, 2.2vh, 20px);
  font-weight: 700;
  color: #728c6c;
  /* Vibrant green */
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.geocoder-container--top-center {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(500px, 80vw);
  pointer-events: auto;
}

.ui__row {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* UI Row Directions specifically centers and spaces toggles */
.ui__row--directions {
  gap: 12px;
}

/* Shared Active State for Primary Toggles */
/* Shared Active State for Primary Toggles */
.map-action-btn.active,
.toggle-3d.active {
  background: rgba(39, 174, 96, 0.4) !important;
  border-color: rgba(39, 174, 96, 0.7) !important;
  box-shadow: 0 0 15px rgba(39, 174, 96, 0.4), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

.directions-toggle__icon {
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0 !important;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(0.9) !important;
}


.ui .btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.btn--primary {
  background: linear-gradient(135deg, rgba(17, 34, 48, 0.92), rgba(32, 68, 102, 0.92));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 32px rgba(17, 34, 48, 0.26);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: linear-gradient(135deg, rgba(17, 34, 48, 1), rgba(36, 78, 120, 1));
  border-color: transparent;
}

.profile-mode-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  position: relative;
}

.profile-mode-menu {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.profile-mode-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--glass-radius);
  border: 1px solid var(--glass-border-strong);
  background: var(--glass-surface-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: #fff;
  font: 13px/1.3 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(var(--glass-blur));
  min-height: 44px;
}

.profile-mode-button__icon img {
  width: 100%;
  height: 100%;
  filter: brightness(0) invert(1);
}

.profile-mode-button:hover,
.profile-mode-button:focus-visible {
  outline: none;
  border-color: var(--glass-border-strong);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.profile-mode-button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.profile-mode-button__icon img,
.profile-mode-menu__item img,
.profile-mode-sidebar__item img {
  filter: brightness(0) invert(1) brightness(2) !important;
}

.profile-mode-button__label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile-mode-menu__list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: var(--glass-radius);
  background: var(--glass-surface-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(12px);
  z-index: 100;
  min-width: 100%;
}

.profile-mode-menu__list--open {
  display: flex;
}

.profile-mode-menu__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: 12px/1.3 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.profile-mode-menu__item img {
  filter: brightness(0) invert(1) brightness(5);
}

.profile-mode-menu__item:hover,
.profile-mode-menu__item:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.profile-mode-menu__item.active {
  background: rgba(39, 174, 96, 0.3);
  color: #fff;
  font-weight: 600;
}

.profile-mode-menu__text {
  pointer-events: none;
}

.profile-mode-menu__item .profile-mode-menu__text {
  font-weight: 500;
}


.debug-network-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--glass-radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(var(--glass-blur));
}

.debug-network-control img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.debug-network-control:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));
}

.debug-network-control.is-active {
  background: var(--glass-surface-strong);
  border-color: var(--glass-border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 16px 36px rgba(5, 10, 18, 0.48);
}

.debug-network-control.is-active img {
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.debug-network-control:focus-within {
  outline: 2px solid rgba(17, 98, 128, 0.45);
  outline-offset: 2px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  background: var(--glass-surface);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  color: rgba(12, 24, 36, 0.92);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(var(--glass-blur));
}

.icon-button:hover,
.icon-button:focus-visible {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));
}

.icon-button:focus-visible {
  outline: 2px solid rgba(17, 98, 128, 0.45);
  outline-offset: 2px;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.directions-dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  padding: 8px calc(10px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(10px + env(safe-area-inset-left, 0px));
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  /* Let map interactions pass through empty areas of the dock */
  pointer-events: none;
  width: 100%;
  box-sizing: border-box;
  /* Prevent accidental text/image selection during drag operations */
  user-select: none;
  -webkit-user-select: none;
}

.directions-dock[aria-hidden="true"] {
  pointer-events: none;
}

.directions-dock[aria-hidden="true"] .directions-control {
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
  overflow: hidden;
}

.directions-control {
  /* Modified to support animation */
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    margin 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  width: 100%;
  max-width: min(1600px, calc(100vw - 32px));
  margin-inline: auto;
  background: var(--glass-surface-strong);
  border-radius: 24px;
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(var(--glass-blur));
  color: #fff;
  box-sizing: border-box;
  position: relative;
}

.directions-control img,
.directions-control .btn img,
.chart-card img,
.chart-card .btn img {
  filter: brightness(0) invert(1);
}

.directions-control.visible {
  opacity: 1;
  visibility: visible;
  max-height: 65vh;
  transform: translateY(0);
  padding: 12px 0 0;
  /* Removed 14px bottom padding to allow flush button alignment */
  margin-bottom: 12px;
  pointer-events: auto;
  overflow: visible;
  gap: 10px;
}

.directions-swipe-handle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  padding: 10px 0 6px;
  touch-action: none;
}

.directions-dock[aria-hidden="false"] .directions-swipe-handle {
  padding-bottom: 0;
}

.directions-swipe-handle__bar {
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Routing start tooltip - shown when dock opens with no waypoints */
.routing-start-tooltip {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

.routing-start-tooltip[aria-hidden="false"] {
  display: flex;
}

.routing-start-tooltip__text {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(160deg, rgba(12, 24, 36, 0.85), rgba(12, 24, 36, 0.75));
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.95);
  font: 500 13px/1.4 var(--font-ui);
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: routing-tooltip-pulse 2s ease-in-out infinite;
}

@keyframes routing-tooltip-pulse {

  0%,
  100% {
    opacity: 0.95;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

.directions-header {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.directions-control .btn {
  width: auto;
}

.transport-modes {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
}

.transport-modes .btn {
  flex: 0 0 auto;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  padding: 8px !important;
}

.transport-modes .btn img {
  width: 18px !important;
  height: 18px !important;
  filter: brightness(0) invert(1);
}

.route-mode-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.route-mode-btn:hover {
  background: var(--glass-surface-strong);
}

.route-mode-btn.active {
  background: rgba(248, 180, 11, 0.25);
  border-color: #f8b40b;
  box-shadow: 0 0 8px rgba(248, 180, 11, 0.3);
}

.route-mode-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.directions-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.directions-actions .btn,
.directions-actions .icon-button,
.directions-actions>button {
  flex: 0 0 auto;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  padding: 8px !important;
}

.directions-actions .btn img,
.directions-actions .btn svg,
.directions-actions .icon-button img,
.directions-actions .icon-button svg,
.directions-actions>button img,
.directions-actions>button svg {
  width: 18px !important;
  height: 18px !important;
}

.directions-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Elevation section - integrated into main panel */
.elevation-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  order: -1;
  /* Ensure it stays at the top */
}

.elevation-section--collapsed {
  display: none;
}

.elevation-section__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 24px;
}

.elevation-section__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.elevation-section__chart-wrapper {
  display: flex;
  align-items: stretch;
  gap: 8px;
  /* Increased side gutters to prevent overlap with sidebar buttons */
  padding-top: 50px;
  padding-left: 32px;
  padding-right: 32px;
  gap: 4px;
  box-sizing: border-box;
}

/* Profile mode sidebar - vertical button group on the right of the chart */
.profile-mode-sidebar {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 5;
}

.profile-mode-sidebar__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(17, 34, 48, 0.55);
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-mode-sidebar__item svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.profile-mode-sidebar__item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.45;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.profile-mode-sidebar__item:hover {
  background: rgba(17, 34, 48, 0.08);
  color: rgba(17, 34, 48, 0.85);
}

.profile-mode-sidebar__item:hover img {
  opacity: 0.75;
}

.profile-mode-sidebar__item:focus-visible {
  outline: 2px solid rgba(114, 140, 108, 0.5);
  outline-offset: 1px;
}

.profile-mode-sidebar__item.active {
  background: rgba(114, 140, 108, 0.4);
  color: #0a6b7a;
}

.profile-mode-sidebar__item.active img {
  opacity: 1;
}

.profile-mode-sidebar__item.active:hover {
  background: rgba(255, 255, 255, 0.15);
}

.profile-mode-sidebar__item img {
  filter: brightness(0) invert(1);
}

.elevation-section__y-axis {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 2px 0;
  /* Adding gap here */
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.6);
  width: 32px;
  min-width: 32px;
  flex-shrink: 0;
}

/* Legacy chart-card styles kept for compatibility */
.chart-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 20px 18px;
  border-radius: var(--glass-radius);
  background: var(--glass-surface-strong);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(var(--glass-blur));
  position: relative;
  color: #fff;
}

.chart-card__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.chart-card__chart-wrapper {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.chart-card__y-axis {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 2px 0;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  min-width: 48px;
  flex-shrink: 0;
}

.chart-card__y-max,
.chart-card__y-min,
.chart-card__y-mid {
  position: absolute;
  right: 0;
  white-space: nowrap;
  line-height: 1;
}

.chart-card__y-max {
  /* Position from top, centered vertically */
  transform: translateY(-50%);
}

.chart-card__y-min {
  /* Ensure min label doesn't go below the chart area (above X-axis) */
  bottom: 18px !important;
  transform: none;
}

.chart-card__y-mid {
  /* Center vertically on the grid line - move up by half height */
  transform: translateY(-50%);
  opacity: 0.7;
}

.chart-card__y-max::after,
.chart-card__y-min::after,
.chart-card__y-mid::after {
  content: ' m';
  font-weight: 500;
  opacity: 0.7;
}

.chart-card__y-max:empty::after,
.chart-card__y-min:empty::after,
.chart-card__y-mid:empty::after {
  content: none;
}

.chart-card__collapse {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.chart-card__collapse:hover,
.chart-card__collapse:focus-visible {
  background: rgba(255, 255, 255, 0.9);
  color: rgba(17, 34, 48, 0.8);
  border-color: rgba(17, 34, 48, 0.2);
  outline: none;
}

.chart-card__collapse:active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.chart-card__collapse-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.chart-card--collapsed .chart-card__collapse-icon {
  transform: rotate(180deg);
}

.chart-card--collapsed {
  display: none;
}

/* Chart card header with profile mode controls */
.chart-card__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-card__header .profile-mode-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Elevation toggle button in header actions */
.elevation-toggle {
  position: relative;
}

.elevation-toggle__icon {
  width: 20px;
  height: 20px;
}

.elevation-toggle[aria-expanded="false"] {
  opacity: 0.6;
}

.elevation-toggle[aria-expanded="false"]:hover {
  opacity: 1;
}

/* Compact profile mode button on chart */
.profile-mode-button--compact {
  padding: 6px 10px;
  font-size: 11px;
  gap: 5px;
}

.profile-mode-button--compact .profile-mode-button__icon {
  width: 16px;
  height: 16px;
}

.profile-mode-button--compact .profile-mode-button__icon img {
  width: 14px;
  height: 14px;
}

.chart-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
}

.chart-card__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.chart-card__title img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.route-timeline {
  width: 100%;
  margin-bottom: 0;
  empty-cells: hide;
}

.route-timeline:empty {
  display: none;
}

.route-stats-container {
  display: none;
}

.route-stats {
  flex: 1;
  color: #fff;
  font-size: 14px;
}

.route-stats-container .elevation-toggle {
  flex: 0 0 180px;
  min-height: 48px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.route-stats-container .elevation-toggle:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.route-stats-container .elevation-toggle--empty {
  opacity: 0.3;
  pointer-events: none;
}

.elevation-sparkline {
  width: 100%;
  height: 100%;
  display: block;
}

.elevation-sparkline__path {
  stroke: #f8b40b;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.elevation-sparkline__area {
  fill: rgba(248, 180, 11, 0.2);
}

.weather-widget {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff !important;
}

.weather-temp {
  font-weight: 700;
  color: #fff !important;
}

.weather-icon,
.weather-rain-icon {
  filter: brightness(0) invert(1) brightness(2);
}

.route-stats {
  display: none;
  width: 100%;
  margin-inline: auto;
  box-sizing: border-box;
  position: relative;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0 0 24px 24px;
  /* Removed overflow: hidden to allow button to be flush with bottom border */
  box-shadow: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.route-stats.has-stats {
  display: flex;
}

.route-stats__sparkline {
  position: absolute;
  inset: 0 32px;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black 20%, transparent 95%);
  -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 95%);
  transition: opacity 0.3s ease;
}

.route-stats.is-expanded .route-stats__sparkline {
  opacity: 0;
  visibility: hidden;
}

.route-stats__content {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 8px 32px 14px 32px;
  /* Moved bottom padding here */
}

.route-stats__toggle {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.route-stats__toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.route-stats__toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.route-stats__toggle.is-active svg {
  transform: rotate(180deg);
}

/* Multi-day timeline styles */
.route-stats__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.route-stats__title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex: 1 1 auto;
}

.route-stats__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.route-stats__summary-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.route-stats__summary-item svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0.65;
  flex-shrink: 0;
}

.route-stats__summary-value {
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
}

/* Day timeline tabs - Arrow/chevron style */
.day-timeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 8px 32px 4px;
  /* Align with content gutters */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  width: 100%;
  box-sizing: border-box;
}

.day-timeline::-webkit-scrollbar {
  height: 4px;
}

.day-timeline::-webkit-scrollbar-track {
  background: transparent;
}

.day-timeline::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.day-timeline::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

.day-tab-wrapper {
  display: flex;
  align-items: stretch;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.day-tab-wrapper:not(:first-child) {
  margin-left: -10px;
}

/* Mute non-selected days when a day is selected */
.day-timeline.has-selection .day-tab-wrapper:not(.is-selected) {
  opacity: 0.55;
  filter: saturate(0.6);
}

.day-timeline.has-selection .day-tab-wrapper:not(.is-selected):hover {
  opacity: 0.8;
  filter: saturate(0.8);
}

.day-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px 10px 22px;
  background: var(--day-color, #8fa583);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  min-width: 0;
  position: relative;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  z-index: 1;
}

.day-tab-wrapper:first-child .day-tab {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
  padding-left: 16px;
  border-radius: 12px 0 0 12px;
}

.day-tab-wrapper.is-last .day-tab {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
  padding-right: 16px;
  border-radius: 0 12px 12px 0;
}

.day-tab-wrapper:first-child.is-last .day-tab {
  clip-path: none;
  border-radius: 12px;
  padding: 10px 16px;
}

.day-tab__arrow {
  display: none;
}

.day-tab:hover {
  filter: brightness(1.08);
  z-index: 2;
}

.day-tab-wrapper.is-selected .day-tab {
  filter: brightness(1.12) saturate(1.1);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
  z-index: 3;
}

.day-tab__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

.day-tab__title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.day-tab__stats {
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  opacity: 0.95;
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.day-tab__divider {
  opacity: 0.6;
  font-size: 9px;
}

/* Arrow separator between day tabs - kept for compatibility */
.day-arrow {
  display: none;
}

/* Selected day details */
.day-details {
  display: none;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideDown 0.2s ease;
}

.day-details.is-visible {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.day-details.is-compact {
  padding-top: 0;
  border-top: none;
}

.day-details__metrics,
.day-details__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 16px;
  align-items: center;
}

.day-details__metric,
.day-details__item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  min-width: 0;
}

.day-details__metric-label,
.day-details__item-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}

.day-details__metric-value,
.day-details__item-value {
  color: #fff;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-details__poi-row {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  line-height: 1.4;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  position: relative;
  padding-right: 0;
}

.day-details__item-label {
  color: rgba(255, 255, 255, 0.7);
  margin-right: 4px;
  font-size: 12px;
  font-weight: 500;
}

.day-details__item-value {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}


/* Difficulty indicator bars */
.difficulty-indicator {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  margin-right: 4px;
}

.difficulty-bar {
  width: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
  transition: background 0.2s ease;
}

.difficulty-bar:nth-child(1) {
  height: 4px;
}

.difficulty-bar:nth-child(2) {
  height: 6px;
}

.difficulty-bar:nth-child(3) {
  height: 8px;
}

.difficulty-bar:nth-child(4) {
  height: 10px;
}

.difficulty-bar:nth-child(5) {
  height: 12px;
}

.difficulty-bar.filled {
  background: #e67e22;
}

/* Responsive adjustments */
@media (max-width: 600px) {

  .day-details__metrics,
  .day-details__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {

  .day-details__metrics,
  .day-details__grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Bivouac hover popup */
.bivouac-popup-container {
  z-index: 100;
}

.bivouac-popup-container .maplibregl-popup-content {
  padding: 0;
  background: var(--glass-surface-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 0 1px var(--glass-border);
  overflow: hidden;
  color: #fff;
}

.bivouac-popup-container .maplibregl-popup-tip {
  border-top-color: var(--glass-surface-strong);
}

.bivouac-popup {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 200px;
}

.bivouac-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: var(--day-color, #8fa583);
  border-radius: 0;
  margin: 0;
}

.bivouac-popup__title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.bivouac-popup__delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: rgba(255, 255, 255, 0.9);
}

.bivouac-popup__delete svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.bivouac-popup__delete:hover {
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
}

.bivouac-popup__stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
}

.bivouac-popup__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bivouac-popup__stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}

.bivouac-popup__stat-value {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.bivouac-popup-container .maplibregl-popup-close-button {
  display: none;
}

/* Stat icons in popup labels */
.bivouac-popup__stat-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  vertical-align: -2px;
  margin-right: 4px;
  fill: currentColor;
  opacity: 0.7;
}

.bivouac-popup__stat--sun .bivouac-popup__stat-icon {
  color: #f59e0b;
  opacity: 1;
}

.bivouac-popup__sun-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
  margin-top: 2px;
}

.bivouac-popup__sun-period {
  min-width: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.25;
}

.bivouac-popup__sun-value {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.25;
  text-align: right;
}

.bivouac-popup__sun-status {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  line-height: 1.3;
}

.bivouac-popup__sun-status[data-state="loading"]::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: #f59e0b;
  content: '';
  vertical-align: 1px;
  animation: bivouac-sun-pulse 1.1s ease-in-out infinite;
}

.bivouac-popup__sun-status[data-state="terrain"] {
  color: rgba(167, 243, 208, 0.78);
}

.bivouac-popup__sun-status[data-state="fallback"] {
  color: rgba(253, 230, 138, 0.72);
}

@keyframes bivouac-sun-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.bivouac-popup__stat--water .bivouac-popup__stat-icon {
  color: #3b82f6;
  opacity: 1;
}

.bivouac-popup__stat--weather .bivouac-popup__stat-icon {
  color: #fff;
  opacity: 0.9;
}

.weather-loading {
  color: #fff !important;
}

.bivouac-popup img {
  filter: brightness(0) invert(1) brightness(2) !important;
}

/* Water options list */
.bivouac-popup__water-options {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bivouac-popup__water-option {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bivouac-popup__water-option::before {
  content: '💧';
  font-size: 10px;
}

.profile-legend {
  position: absolute;
  /* Position to the left of the sidebar, overlapping the chart */
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(245, 248, 252, 0.94);
  box-shadow: inset 0 0 0 1px rgba(17, 34, 48, 0.08), 0 8px 24px rgba(13, 30, 45, 0.18);
  color: #0c3d4b;
  font: 12px/1.3 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  max-width: min(280px, calc(100vw - 80px));
  width: max-content;
  min-width: min(160px, calc(100vw - 80px));
  opacity: 0;
  visibility: hidden;
  transform-origin: center right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  pointer-events: none;
  z-index: 100;
}

.profile-legend[data-ready="false"] {
  display: none;
}

.profile-legend[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.profile-legend--gradient {
  padding: 14px 16px 12px;
  min-width: 260px;
}

.profile-legend__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.profile-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  text-align: center;
}

.profile-legend__swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--legend-color, #3ab7c6);
  box-shadow: 0 0 0 1px rgba(17, 34, 48, 0.12);
  flex: 0 0 auto;
}

.profile-legend__label {
  line-height: 1.3;
  color: inherit;
  font-weight: 500;
  text-align: center;
}

.profile-legend__gradient-bar {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: rgba(17, 34, 48, 0.06);
  box-shadow: inset 0 0 0 1px rgba(17, 34, 48, 0.12);
  overflow: hidden;
}

.profile-legend__gradient-track {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--profile-gradient, linear-gradient(90deg, #0b3d91, #c0392b));
}

.profile-legend__gradient-labels {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 0;
  font-size: 12px;
  color: rgba(12, 61, 75, 0.88);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.profile-legend__gradient-label {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.route-stats-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  width: 100%;
  justify-content: flex-start;
}

.route-stats .summary-item span {
  font-weight: 600;
}

.route-stats .summary-item.trace {
  flex: 1 1 100%;
  white-space: normal;
  align-items: flex-start;
}

.summary-item.trace span {
  white-space: normal;
}


.elevation-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
}

.summary-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.summary-item span {
  font-weight: 600;
  color: inherit;
}

.summary-item svg,
.summary-item img {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.summary-item svg {
  fill: currentColor;
  opacity: 0.85;
}

.summary-item.ascent,
.summary-item.descent,
.summary-item.distance {
  color: inherit;
}

.elevation-plot {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  min-width: 0;
}

.elevation-x-axis span {
  white-space: nowrap;
}

.elevation-plot-area {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.elevation-chart-container {
  position: relative;
  min-height: 120px;
  overflow: visible;
  /* Allow icons to overflow */
  touch-action: none;
  cursor: crosshair;
  width: 100%;
  padding: 0;
}

.elevation-area {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.elevation-grid-line {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 0.5;
  stroke-dasharray: 2 2;
  vector-effect: non-scaling-stroke;
}

.elevation-area-fill {
  fill-opacity: 0.78;
}

.elevation-area-stroke {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.elevation-hit-targets {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  gap: 1px;
  padding-bottom: 0;
  z-index: 2;
}

.elevation-hover-indicator {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 3;
}

.elevation-hover-indicator[aria-hidden="false"] {
  opacity: 1;
}

.elevation-hover-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(0, 0, 0, 0.82);
  left: 0;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65);
}

/* Elevation chart tooltip - shown on hover */
.elevation-chart-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: rgba(17, 34, 48, 0.92);
  color: #f6fbff;
  font: 11px/1.35 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.elevation-chart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(17, 34, 48, 0.92) transparent transparent transparent;
}

.elevation-chart-tooltip__distance {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.elevation-chart-tooltip__details {
  display: flex;
  gap: 8px;
  font-size: 11px;
  opacity: 0.9;
  font-family: var(--font-mono);
}

.elevation-chart-tooltip__elevation,
.elevation-chart-tooltip__grade,
.elevation-chart-tooltip__duration,
.elevation-chart-tooltip__ascent {
  font-variant-numeric: tabular-nums;
}

.elevation-chart-tooltip__bivouac {
  display: none;
}

/* POI info section in tooltip */
.elevation-chart-tooltip__poi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.elevation-chart-tooltip__poi strong {
  font-size: 12px;
  font-weight: 600;
  color: inherit;
}

.elevation-chart-tooltip__poi-category {
  display: none;
}

.elevation-chart-tooltip__poi-elev {
  display: none;
}

.elevation-bar {
  position: relative;
  flex-grow: var(--bar-flex-grow, 1);
  flex-shrink: 0;
  flex-basis: 0;
  min-width: 1px;
  cursor: crosshair;
}

.elevation-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px 4px 0 0;
  background: transparent;
  opacity: 0;
  transition: opacity 120ms ease;
}

.elevation-bar.highlighted::after {
  opacity: 1;
  background: rgba(255, 255, 255, 0.28);
}

.elevation-marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.elevation-marker {
  position: absolute;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--elevation-marker-gap, 4px);
  min-width: 22px;
  min-height: 22px;
  color: #2d7bd6;
  transform: translate(-50%, 50%);
  filter: drop-shadow(0 1px 2px rgba(17, 34, 48, 0.35));
}

.elevation-marker svg {
  width: var(--elevation-marker-icon-width, 22px);
  height: var(--elevation-marker-icon-height, 22px);
  display: block;
  fill: currentColor;
}

.elevation-marker img,
.elevation-marker__icon {
  width: var(--elevation-marker-icon-width, 22px);
  height: var(--elevation-marker-icon-height, 22px);
  display: block;
}

.elevation-marker.bivouac {
  min-width: 26px;
  min-height: 26px;
  color: var(--bivouac-marker-color, #2d7bd6);
  z-index: 3;
}

.elevation-marker.bivouac .elevation-marker__icon {
  --elevation-marker-icon-width: 26px;
  --elevation-marker-icon-height: 26px;
}

/* Hide title label above bivouac markers in elevation chart */
.elevation-marker.bivouac .elevation-marker__label {
  display: none;
}

/* Dashed vertical line below bivouac markers to mark position on chart */
.elevation-marker.bivouac::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  /* Height is set via CSS variable from JavaScript, based on marker position */
  height: var(--bivouac-line-height, 0px);
  background: repeating-linear-gradient(to bottom,
      rgba(17, 34, 48, 0.45) 0px,
      rgba(17, 34, 48, 0.45) 4px,
      transparent 4px,
      transparent 8px);
  pointer-events: none;
}

.elevation-marker.poi {
  min-width: 16px;
  min-height: 16px;
  color: var(--poi-marker-color, #2d7bd6);
  z-index: 2;
  cursor: pointer;
}

/* POI icons have a subtle glow for visibility */
.elevation-marker.poi .elevation-marker__icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.elevation-marker__icon--mask {
  width: var(--elevation-marker-icon-width, 16px);
  height: var(--elevation-marker-icon-height, 16px);
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.elevation-marker__icon--svg {
  width: var(--elevation-marker-icon-width, 16px);
  height: var(--elevation-marker-icon-height, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.elevation-marker__icon--svg svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Force variable application on SVG elements */
.elevation-marker__icon--svg svg path,
.elevation-marker__icon--svg svg circle,
.elevation-marker__icon--svg svg rect,
.elevation-marker__icon--svg svg polygon,
.elevation-marker__icon--svg svg polyline,
.elevation-marker__icon--svg svg ellipse,
.elevation-marker__icon--svg svg line,
.elevation-marker__icon--svg svg text,
.elevation-marker__icon--svg svg use,
.elevation-marker__icon--svg svg *,
.elevation-marker__icon--svg .icon {
  fill: var(--icon-fill) !important;
  stroke: var(--icon-stroke, #ffffff) !important;
  stroke-width: 6px;
}

/* Generic label base styles (for bivouacs if needed) */
.elevation-marker__label {
  font-size: 10px;
  font-weight: 600;
  color: currentColor;
  white-space: nowrap;
  line-height: 1.2;
}

.elevation-marker__icon--fallback {
  border-radius: 999px;
  background: currentColor;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 1px rgba(17, 34, 48, 0.2);
}

.elevation-marker.poi .elevation-marker__icon--fallback {
  --elevation-marker-icon-width: 10px;
  --elevation-marker-icon-height: 10px;
}

/* Water indicator for POIs with nearby water source */
.elevation-marker__water-indicator {
  position: absolute;
  bottom: -2px;
  right: -6px;
  width: 12px;
  height: 12px;
  color: #3b82f6;
  filter: drop-shadow(0 1px 1px rgba(17, 34, 48, 0.4));
  z-index: 1;
}

.elevation-marker__water-indicator svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.elevation-marker.photo {
  /* Allow natural aspect ratio with consistent width */
  width: var(--elevation-marker-icon-width, 40px);
  height: auto;
  min-width: 40px;
  z-index: 5;
  cursor: pointer;
  pointer-events: auto;
  position: absolute;
}

.elevation-marker.photo .elevation-marker__icon {
  width: 100%;
  height: 35px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  background-color: #eee;
  display: block;
  position: relative;
  border: 2px solid #ffffff;
}

/* Stacked photos also need the border and styling */
.elevation-marker.photo .elevation-marker__icon--photo-stack {
  width: 100%;
  height: 35px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  background-color: #ddd;
  border: 2px solid #ffffff;
}

.elevation-marker.photo .elevation-marker__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.elevation-marker__icon--photo,
.elevation-marker__icon--photo-stack {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.elevation-x-axis {
  position: relative;
  min-height: 16px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
}

.elevation-x-axis span {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
}

.elevation-x-axis span:first-child {
  transform: none !important;
}

.elevation-x-axis span:last-child {
  transform: translateX(-100%) !important;
}

.icon-button.has-tooltip {
  position: relative;
}

.icon-button.has-tooltip .directions-hint {
  position: absolute;
  inset-inline-start: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  opacity: 0;
  pointer-events: none;
  display: block;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #f6fbff;
  background: rgba(17, 34, 48, 0.92);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  min-width: 220px;
  max-width: min(320px, 80vw);
  width: max-content;
  text-align: start;
  z-index: 100;
  transition: opacity 160ms ease, transform 160ms ease;
}

.icon-button.has-tooltip .directions-hint::after {
  content: '';
  position: absolute;
  inset-inline-start: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: rgba(17, 34, 48, 0.92) transparent transparent transparent;
}

.icon-button.has-tooltip.show-tooltip .directions-hint,
.icon-button.has-tooltip:hover .directions-hint,
.icon-button.has-tooltip:focus-visible .directions-hint {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.directions-route-tooltip {
  position: absolute;
  background: rgba(17, 34, 48, 0.92);
  color: #f6fbff;
  font: 12px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  display: none;
  z-index: 2;
  /* Keep below directions dock (z-index: 3) */
  min-width: 120px;
}

.directions-route-tooltip .tooltip-distance {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.directions-route-tooltip .tooltip-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 11px;
  opacity: 0.9;
}

.directions-route-tooltip .tooltip-altitude,
.directions-route-tooltip .tooltip-grade {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .directions-control.visible {
    gap: 28px;
  }

  .directions-header {
    align-items: center;
    justify-content: space-between;
  }

  .transport-modes {
    flex: 1 1 auto;
  }

  .directions-actions {
    margin-inline-start: auto;
    justify-content: flex-end;
  }

  .chart-card {
    padding: 24px 28px 26px;
  }

  .elevation-chart {
    min-height: 160px;
  }

  .elevation-chart-container {
    min-height: 150px;
  }
}

@media (max-width: 640px) {
  .directions-control {
    border-radius: 16px 16px 0 0;
    padding: 16px;
  }

  .transport-modes,
  .directions-actions {
    width: 100%;
  }

  .btn--icon {
    width: 100%;
  }

  .btn--icon.btn--icon-only {
    width: 44px;
  }

  .directions-swipe-handle {
    padding: 12px 0 6px;
  }

  .route-stats.has-stats {
    padding: 12px;
  }

  .route-stats.has-stats .route-stats-list {
    flex-direction: column;
    align-items: flex-start;
  }

  .icon-button.has-tooltip .directions-hint {
    inset-inline-start: auto;
    inset-inline-end: 0;
    transform: translateY(6px);
    min-width: min(220px, 80vw);
    max-width: min(280px, 90vw);
  }

  .icon-button.has-tooltip.show-tooltip .directions-hint,
  .icon-button.has-tooltip:hover .directions-hint,
  .icon-button.has-tooltip:focus-visible .directions-hint {
    transform: translateY(0);
  }

  .icon-button.has-tooltip .directions-hint::after {
    inset-inline-start: auto;
    inset-inline-end: 18px;
    transform: none;
  }
}

#gpxFileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.terrain-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}


/* Terrain Overlay Controls */
.terrain-overlay-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.terrain-overlay-button {
  flex: 1;
  min-width: 80px;
  height: 36px;
  font-size: 11px;
}

.terrain-overlay-button[aria-pressed="true"] {
  background: var(--glass-surface-strong);
  color: #e9f1ff;
  border-color: var(--glass-border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 16px 36px rgba(5, 10, 18, 0.5);
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--glass-radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  color: rgba(12, 24, 36, 0.92);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
}

.btn:hover,
.btn:focus-visible {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.14));
  border-color: var(--glass-border-strong);
  outline: none;
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 12px 28px rgba(6, 12, 20, 0.36);
}

.btn.active {
  background: var(--glass-surface-strong);
  color: #e9f1ff;
  border-color: var(--glass-border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 16px 36px rgba(5, 10, 18, 0.5);
}

.btn:disabled,
.btn.mode-disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.65);
  color: rgba(17, 34, 48, 0.45);
  border-color: rgba(17, 34, 48, 0.18);
}

.btn:disabled.btn.active,
.btn.mode-disabled.btn.active {
  background: #f1f3f5;
  color: rgba(17, 34, 48, 0.45);
  border-color: rgba(17, 34, 48, 0.18);
}

.btn--sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 8px;
}

/* Hidden file inputs - safer than display:none for programmatic triggering */
input[type="file"].hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  visibility: hidden;
  pointer-events: none;
}

.btn--icon {
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding-inline: 16px;
}

.btn--icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.btn--icon.btn.active img {
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.btn.toggle-3d.active {
  background: rgba(17, 34, 48, 0.92);
  color: #fff;
  border-color: rgba(17, 34, 48, 0.92);
  box-shadow: 0 10px 24px rgba(17, 34, 48, 0.24);
}

.btn--icon-only {
  padding: 8px;
  width: 36px;
  height: 36px;
  border-radius: var(--glass-radius);
  gap: 0;
}

.btn--icon-only img {
  width: 18px;
  height: 18px;
}

.terrain-controls .btn {
  width: 100%;
  height: 44px;
  font-size: 12px;
}

/* Waypoint right-click context menu */
.waypoint-context-popup .maplibregl-popup-content {
  background: rgba(12, 24, 36, 0.92);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.waypoint-context-popup .maplibregl-popup-close-button {
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  padding: 4px 8px;
}

.waypoint-context-popup .maplibregl-popup-close-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.waypoint-context-popup .maplibregl-popup-tip {
  border-top-color: rgba(12, 24, 36, 0.92);
}

.waypoint-context-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}

.waypoint-context-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  font: 500 13px/1.3 var(--font-ui);
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.waypoint-context-menu__item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.waypoint-context-menu__item svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.waypoint-context-menu__item--remove:hover {
  background: rgba(214, 69, 69, 0.25);
  color: #ff8a8a;
}

.imagery-panel__terrain {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 34, 48, 0.12);
}

.imagery-panel__terrain-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(17, 34, 48, 0.75);
}

.imagery-panel {
  position: absolute;
  top: clamp(66px, 8vh, 80px);
  /* Just below the header (64px max) */
  right: calc(16px + env(safe-area-inset-right, 0px));
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.imagery-panel[hidden] {
  display: none !important;
}

.imagery-panel__buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.imagery-panel__buttons .toggle-3d img {
  width: 22px !important;
  height: 22px !important;
}

.imagery-panel__toggle:hover,
.imagery-panel__toggle:focus-visible {
  background: rgba(17, 34, 48, 0.08);
  border-color: rgba(17, 34, 48, 0.28);
  outline: none;
}

.imagery-panel__toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(114, 140, 108, 0.55), inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
}

.imagery-panel__toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.imagery-panel__toggle.active {
  background: #27ae60;
  border-color: #2ecc71;
  box-shadow: 0 0 12px rgba(39, 174, 96, 0.4);
}

.imagery-panel__toggle-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.imagery-panel__drawer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(20, 25, 30, 0.95);
  border-radius: var(--glass-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 220px;
  max-width: 280px;
  overflow: visible;
}

.imagery-panel__drawer[hidden] {
  display: none !important;
}

.imagery-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.imagery-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(114, 140, 108, 0.08);
  transition: background 0.15s ease;
}

.imagery-option:hover {
  background: rgba(114, 140, 108, 0.15);
}

.imagery-option.active {
  background: rgba(114, 140, 108, 0.35);
}

.imagery-option__row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.imagery-option__preview {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.imagery-option__label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  text-align: right;
}

.imagery-option__toggle {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid transparent;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  outline: none;
  overflow: hidden;
  flex: 0 0 auto;
}

.imagery-option__toggle:hover {
  transform: scale(0.96);
}

.imagery-option__toggle:focus-visible {
  border-color: rgba(114, 140, 108, 0.9);
  box-shadow: 0 0 0 2px rgba(114, 140, 108, 0.45);
}

.imagery-option.active .imagery-option__toggle {
  border-color: rgba(114, 140, 108, 0.9);
  box-shadow: 0 0 0 2px rgba(114, 140, 108, 0.45);
}

.imagery-option__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.imagery-option__opacity-wrapper {
  width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
}

.imagery-option__opacity {
  width: 100%;
  cursor: pointer;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(17, 34, 48, 0.12);
  margin: 0;
  transition: background 0.15s ease;
}

.imagery-option:hover .imagery-option__opacity,
.imagery-option.active .imagery-option__opacity {
  background: rgba(114, 140, 108, 0.5);
}

.imagery-option__opacity:focus-visible {
  outline: none;
}

.imagery-option__opacity::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.imagery-option__opacity::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.imagery-option__opacity::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(114, 140, 108, 0.9);
  box-shadow: 0 1px 4px rgba(17, 34, 48, 0.25);
  margin-top: -6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.imagery-option__opacity::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(114, 140, 108, 0.4);
}

.imagery-option__opacity::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(114, 140, 108, 0.9);
  box-shadow: 0 1px 4px rgba(17, 34, 48, 0.25);
}

.imagery-option--dragging {
  opacity: 0.6;
  transform: scale(0.97);
}

.imagery-option--drag-over-before::before,
.imagery-option--drag-over-after::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  height: 0;
  border-top: 2px solid rgba(114, 140, 108, 0.95);
  box-shadow: 0 0 6px rgba(114, 140, 108, 0.45);
}

.imagery-option--drag-over-before::before {
  top: -4px;
}

.imagery-option--drag-over-after::before {
  bottom: -4px;
}

/* Grouped layers - thumbnails side by side */
.imagery-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(114, 140, 108, 0.08);
  transition: background 0.15s ease;
}

.imagery-group:hover {
  background: rgba(114, 140, 108, 0.18);
}

.imagery-group.active {
  background: rgba(114, 140, 108, 0.35);
}

.imagery-group__row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.imagery-group__preview {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.imagery-group__label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  text-align: right;
}

.imagery-group__toggle {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid transparent;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  outline: none;
  overflow: hidden;
  flex: 0 0 auto;
}

.imagery-group__toggle:hover {
  transform: scale(0.96);
}

.imagery-group__toggle:focus-visible {
  border-color: rgba(114, 140, 108, 0.9);
  box-shadow: 0 0 0 2px rgba(114, 140, 108, 0.45);
}

.imagery-group__toggle.active {
  border-color: rgba(114, 140, 108, 0.9);
  box-shadow: 0 0 0 2px rgba(114, 140, 108, 0.45);
}

.imagery-group__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.imagery-group__opacity-wrapper {
  width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
}

.imagery-group__opacity {
  width: 100%;
  cursor: pointer;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(114, 140, 108, 0.45);
  margin: 0;
  transition: background 0.15s ease;
}

.imagery-group__opacity::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(114, 140, 108, 0.9);
  box-shadow: 0 1px 4px rgba(17, 34, 48, 0.25);
  margin-top: -6px;
  transition: transform 0.15s ease;
}

.imagery-group__opacity::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.imagery-group__opacity::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(114, 140, 108, 0.9);
  box-shadow: 0 1px 4px rgba(17, 34, 48, 0.25);
}

.imagery-group--dragging {
  opacity: 0.6;
  transform: scale(0.97);
}

.imagery-group--drag-over-before::before,
.imagery-group--drag-over-after::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  height: 0;
  border-top: 2px solid rgba(114, 140, 108, 0.95);
  box-shadow: 0 0 6px rgba(114, 140, 108, 0.45);
}

.imagery-group--drag-over-before::before {
  top: -4px;
}

.imagery-group--drag-over-after::before {
  bottom: -4px;
}

@media (max-width: 900px) {
  .ui {
    width: auto;
  }

  .hs-panel {
    top: calc((16px + env(safe-area-inset-top, 0px)) + (120px * var(--ui-scale)));
    right: calc(16px + env(safe-area-inset-right, 0px));
    max-width: min(260px, calc(100vw - 32px));
  }
}

@media (max-width: 720px) {

  .hs-panel {
    max-width: min(320px, calc(100vw - 32px));
  }

  .imagery-panel__drawer {
    max-height: 60vh;
    overflow-y: auto;
    min-width: 156px;
  }
}

@media (max-width: 540px) {
  .ui {
    width: auto;
    top: calc((24px + env(safe-area-inset-top, 0px)) / var(--ui-scale));
    left: calc((20px + env(safe-area-inset-left, 0px)) / var(--ui-scale));
  }

  .hs-panel {
    top: calc((16px + env(safe-area-inset-top, 0px)) + (136px * var(--ui-scale)));
  }
}

.vignette {
  display: none;
}

/* Fog overlay - CSS gradient that sits on top of everything */
.fog-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  /* Above map canvas but below UI */
  opacity: 0;
  transition: opacity 0.3s ease;
  /* Gradient from transparent at bottom to fog color at top (horizon) */
  background: linear-gradient(to top,
      transparent 0%,
      transparent 35%,
      rgba(232, 232, 224, 0.3) 55%,
      rgba(232, 232, 224, 0.7) 75%,
      rgba(232, 232, 224, 0.95) 100%);
}

/* Only show fog overlay in 3D mode */
.fog-overlay--active {
  opacity: 1;
}

/* Météo widget styles */
.weather-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.weather-icon {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  padding: 2px;
  filter: brightness(2.0);
  font-size: 0.85em;
  font-style: italic;
}

.weather-unavailable {
  color: #999;
  font-size: 0.85em;
}

/* =============================================================================
   GEOCODER STYLING - Glassmorphism Design
   ============================================================================= */

/* Geocoder container for custom positioning */
.geocoder-container {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
}

.geocoder-container--top-center {
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
}

@media (max-width: 640px) {
  .geocoder-container--top-center {
    top: calc(12px + env(safe-area-inset-top, 0px));
  }
}

/* Align MapLibre controls (geolocation, compass, 3D) parallel with imagery panel buttons */
/* Premium Circular Map Controls - Robust Implementation */
.maplibregl-ctrl-top-right {
  top: 148px !important;
  right: calc(16px + env(safe-area-inset-right, 0px)) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 12px !important;
  pointer-events: none !important;
}

.maplibregl-ctrl-top-right>*,
.imagery-panel__buttons {
  pointer-events: auto !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  margin: 0 !important;
}

/* Base style for all circular map buttons */
.map-action-btn,
.maplibregl-ctrl-top-right button {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  flex: 0 0 44px !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  margin: 0 !important;
  background: var(--glass-surface-strong) !important;
  backdrop-filter: blur(var(--glass-blur)) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, background 0.2s ease !important;
  overflow: visible !important;
}

.map-action-btn:hover,
.maplibregl-ctrl-top-right button:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5) !important;
  z-index: 10 !important;
}

/* Compact bearing + camera-inclination compass */
.maplibregl-ctrl-top-right .xplore-camera-control {
  width: 44px;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  overflow: visible !important;
}

.maplibregl-ctrl-top-right .xplore-camera-control .xplore-camera-compass {
  position: relative !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  flex-basis: 44px !important;
  color: #f3f7f4 !important;
  background: var(--glass-surface-strong) !important;
  backdrop-filter: blur(var(--glass-blur)) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 5px 18px rgba(4, 12, 9, 0.34), 0 1px 3px rgba(4, 12, 9, 0.2) !important;
  touch-action: none;
  overflow: visible !important;
}

.maplibregl-ctrl-top-right .xplore-camera-control .xplore-camera-compass:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(4, 12, 9, 0.4), 0 1px 4px rgba(4, 12, 9, 0.22) !important;
}

.xplore-camera-compass:focus-visible,
.toggle-3d:focus-visible {
  outline: 3px solid rgba(119, 199, 142, 0.72) !important;
  outline-offset: 3px;
}

.xplore-camera-compass .xplore-camera-compass__icon {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  background: none !important;
  transform: none !important;
  pointer-events: none;
}

.xplore-camera-compass__face,
.xplore-camera-compass__dial,
.xplore-camera-compass__ticks {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 50%;
}

.xplore-camera-compass__face {
  --camera-pitch-offset: 0%;
  inset: 3px;
  background:
    radial-gradient(circle at 50% calc(46% + var(--camera-pitch-offset)),
      rgba(41, 56, 48, 0.98) 0 46%, rgba(25, 40, 33, 0.96) 76%, rgba(13, 27, 22, 0.98) 100%);
  box-shadow: inset 0 0 0 1px rgba(232, 242, 235, 0.12);
}

.xplore-camera-compass__dial {
  transition: transform 50ms linear;
  will-change: transform;
}

.xplore-camera-compass__tick {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 4px;
  margin-top: -16px;
  margin-left: -1px;
  border-radius: 2px;
  background: rgba(232, 241, 235, 0.5);
  transform: rotate(var(--compass-tick-angle));
  transform-origin: 1px 16px;
}

.xplore-camera-compass__tick.is-major {
  width: 2.5px;
  height: 6px;
  margin-left: -1.25px;
  background: #f2f7f3;
  transform-origin: 1.25px 16px;
}

.xplore-camera-compass__north {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 7px;
  height: 8px;
  background: #e3413d;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: translateX(-50%);
  filter: drop-shadow(0 1px 0 rgba(106, 20, 19, 0.28));
}

.xplore-camera-compass__heading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1px;
  color: #f4f8f5;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
}

.xplore-camera-compass__view-pointer {
  position: absolute;
  z-index: 2;
  top: -5px;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 6px solid #edf5ef;
  transform: translateX(-50%);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.22));
}

.toggle-3d__label {
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1;
  user-select: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.48);
}

/* Standardize icons (Imagery panel) - Inverted for dark theme */
.imagery-panel__toggle-icon img,
.imagery-panel__buttons .toggle-3d img,
.terrain-toolbox-toggle img,
.snow-toolbox-toggle img,
.shadow-toolbox-toggle img,
.pathway-toolbox-toggle img,
.basemap-toolbox-toggle img,
.photos-toolbox-toggle img {
  width: 22px !important;
  height: 22px !important;
  filter: brightness(0) invert(1) opacity(0.9) !important;
}

/* Robust Geolocate Icon (Blue target with better dark mode contrast) */
.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8' fill='%2300d2ff' fill-opacity='0.2'/%3E%3Ccircle cx='12' cy='12' r='4' fill='%2300d2ff'/%3E%3Cpath d='M12 2L15 6H9L12 2Z' fill='%23ffffff'/%3E%3C/svg%3E") !important;
  background-size: 30px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  width: 32px !important;
  height: 32px !important;
  display: block !important;
}

.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {
  filter: drop-shadow(0 0 6px rgba(0, 210, 255, 0.6)) !important;
}

.maplibregl-ctrl-geocoder {
  font-family: var(--font-ui);
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  min-width: 46px;
  max-width: 360px;
  transition: all 0.3s ease;
}

.maplibregl-ctrl-geocoder--collapsed {
  min-width: 46px;
  width: 46px;
}

.maplibregl-ctrl-geocoder--collapsed .maplibregl-ctrl-geocoder--input {
  padding: 0;
  width: 0;
}

.maplibregl-ctrl-geocoder--collapsed .maplibregl-ctrl-geocoder--icon-search {
  left: 50%;
  transform: translateX(-50%);
}

.maplibregl-ctrl-geocoder:not(.maplibregl-ctrl-geocoder--collapsed) {
  width: 280px;
}

@media (min-width: 640px) {
  .maplibregl-ctrl-geocoder:not(.maplibregl-ctrl-geocoder--collapsed) {
    width: 320px;
  }
}

.maplibregl-ctrl-geocoder--input {
  font: 14px/1.4 var(--font-ui);
  color: rgba(12, 24, 36, 0.92);
  background: transparent;
  height: 44px;
  padding: 8px 36px 8px 44px;
}

.maplibregl-ctrl-geocoder--input::placeholder {
  color: rgba(12, 24, 36, 0.5);
}

.maplibregl-ctrl-geocoder--input:focus {
  outline: none;
  box-shadow: none;
}

.maplibregl-ctrl-geocoder:focus-within {
  border-color: var(--glass-border-strong);
  box-shadow: 0 0 0 3px rgba(114, 140, 108, 0.45), inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
}

.maplibregl-ctrl-geocoder--icon {
  fill: rgba(12, 24, 36, 0.6);
  transition: fill 0.2s ease;
}

.maplibregl-ctrl-geocoder--icon-search {
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
}

.maplibregl-ctrl-geocoder--button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.maplibregl-ctrl-geocoder--button:hover {
  background: rgba(12, 24, 36, 0.08);
}

.maplibregl-ctrl-geocoder--icon-close {
  width: 14px;
  height: 14px;
}

.maplibregl-ctrl-geocoder .suggestions-wrapper {
  margin-top: 4px;
}

.maplibregl-ctrl-geocoder .suggestions {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--glass-radius) - 2px);
  box-shadow: 0 12px 32px rgba(6, 12, 20, 0.18);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.maplibregl-ctrl-geocoder .suggestions>li {
  border-bottom: 1px solid rgba(12, 24, 36, 0.06);
}

.maplibregl-ctrl-geocoder .suggestions>li:last-child {
  border-bottom: none;
}

.maplibregl-ctrl-geocoder .suggestions>li>a {
  display: block;
  padding: 12px 16px;
  color: rgba(12, 24, 36, 0.85);
  font: 13px/1.4 var(--font-ui);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.maplibregl-ctrl-geocoder .suggestions>li>a:hover,
.maplibregl-ctrl-geocoder .suggestions>.active>a {
  background: rgba(114, 140, 108, 0.45);
  color: rgba(12, 24, 36, 0.95);
}

.maplibregl-ctrl-geocoder--powered-by {
  display: none !important;
}

/* Loading indicator */
.maplibregl-ctrl-geocoder--icon-loading {
  animation: geocoder-spin 0.8s linear infinite;
}

@keyframes geocoder-spin {
  from {
    transform: translateY(-50%) rotate(0deg);
  }

  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Responsive adjustments */
@media (max-width: 540px) {
  .maplibregl-ctrl-geocoder:not(.maplibregl-ctrl-geocoder--collapsed) {
    width: calc(100vw - 100px);
    max-width: 280px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Wikimedia Photos Popup - Glassmorphism Design
   ───────────────────────────────────────────────────────────────────────────── */

.wikimedia-photo-popup .maplibregl-popup-content {
  padding: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.15);
  border: none;
  overflow: hidden;
}

.wikimedia-photo-popup .maplibregl-popup-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(12, 24, 36, 0.7), rgba(12, 24, 36, 0.85));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.wikimedia-photo-popup .maplibregl-popup-close-button:hover {
  background: linear-gradient(145deg, rgba(12, 24, 36, 0.85), rgba(12, 24, 36, 0.95));
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.wikimedia-photo-popup .maplibregl-popup-tip {
  display: none;
}

.wikimedia-popup-content {
  display: flex;
  flex-direction: column;
  max-width: 400px;
  min-width: 260px;
}

/* Loading state */
.wikimedia-popup-loading {
  padding: 48px 32px;
  text-align: center;
  background: linear-gradient(160deg, rgba(12, 24, 36, 0.88), rgba(12, 24, 36, 0.92));
  color: rgba(255, 255, 255, 0.7);
  font: 13px/1.5 var(--font-ui);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.wikimedia-popup-loading p {
  margin: 14px 0 0;
}

.wikimedia-popup-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid rgba(114, 140, 108, 0.45);
  border-top-color: rgba(114, 140, 108, 0.95);
  border-radius: 50%;
  animation: wikimedia-spinner 0.8s linear infinite;
}

@keyframes wikimedia-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Image container - respects natural aspect ratio */
.wikimedia-popup-image-container {
  position: relative;
  width: 100%;
  max-height: 420px;
  min-height: 180px;
  overflow: hidden;
  background: #0a1520;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Loading overlay for image */
.wikimedia-popup-image-container::before {
  display: none;
}

/* Hide loading spinner when image is loaded */
.wikimedia-popup-image-container--loaded::before {
  opacity: 0;
  pointer-events: none;
}

/* Image - natural aspect ratio, no cropping */
.wikimedia-popup-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.wikimedia-popup-image--error {
  width: 200px;
  height: 150px;
  object-fit: contain;
  opacity: 0.6;
}

/* Floating action buttons */
.wikimedia-popup-info-btn,
.wikimedia-popup-external-btn {
  position: absolute;
  bottom: 14px;
  z-index: 15;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(12, 24, 36, 0.75), rgba(12, 24, 36, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.wikimedia-popup-info-btn {
  right: 14px;
}

.wikimedia-popup-external-btn {
  left: 14px;
  text-decoration: none;
}

.wikimedia-popup-info-btn svg,
.wikimedia-popup-external-btn svg {
  width: 18px;
  height: 18px;
}

.wikimedia-popup-info-btn:hover,
.wikimedia-popup-external-btn:hover {
  background: linear-gradient(145deg, rgba(114, 140, 108, 0.8), rgba(45, 160, 175, 0.9));
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(114, 140, 108, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.wikimedia-popup-info-btn.active {
  background: linear-gradient(145deg, rgba(114, 140, 108, 0.9), rgba(45, 160, 175, 1));
  border-color: rgba(255, 255, 255, 0.3);
}

/* Glassmorphism info overlay */
.wikimedia-popup-info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70%;
  background: linear-gradient(180deg, rgba(12, 24, 36, 0.75) 0%, rgba(12, 24, 36, 0.92) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.wikimedia-popup-info-overlay[aria-hidden="false"] {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.wikimedia-popup-info-content {
  padding: 18px 20px 68px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

/* Description text */
.wikimedia-popup-description {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font: 13px/1.6 var(--font-ui);
  letter-spacing: -0.01em;
}

/* Metadata row */
.wikimedia-popup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font: 12px/1.4 var(--font-ui);
  color: rgba(255, 255, 255, 0.65);
}

.wikimedia-popup-author,
.wikimedia-popup-license {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.wikimedia-popup-author svg,
.wikimedia-popup-license svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.wikimedia-popup-meta-loading {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  font-size: 12px;
}

.wikimedia-popup-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .wikimedia-popup-content {
    max-width: calc(100vw - 40px);
    min-width: 220px;
  }

  .wikimedia-popup-image {
    max-height: 320px;
  }

  .wikimedia-popup-image-container {
    max-height: 320px;
  }

  .wikimedia-popup-info-content {
    padding: 16px 16px 60px;
  }

  .wikimedia-popup-info-btn,
  .wikimedia-popup-external-btn {
    width: 36px;
    height: 36px;
    bottom: 12px;
  }

  .wikimedia-popup-info-btn svg,
  .wikimedia-popup-external-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Wikimedia Thumbnail Markers (Strava-style photo bubbles)
   ───────────────────────────────────────────────────────────────────────────── */

/* Ensure popup is above all thumbnails */
.wikimedia-photo-popup {
  z-index: 1000 !important;
}

.wikimedia-thumbnail-marker {
  width: 36px;
  height: 36px;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    z-index 0.1s,
    opacity 0.2s ease;
  z-index: 1;
}

/* Hidden state when popup is open for this marker */
.wikimedia-thumbnail-marker--hidden {
  opacity: 0;
  pointer-events: none;
}

.wikimedia-thumbnail-marker:hover {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 100;
}

.wikimedia-thumbnail-marker__inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #1a2832, #0d1a22);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wikimedia-thumbnail-marker:hover .wikimedia-thumbnail-marker__inner {
  border-color: rgba(114, 140, 108, 0.95);
  box-shadow:
    0 8px 24px rgba(114, 140, 108, 0.55),
    0 4px 8px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.wikimedia-thumbnail-marker__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.wikimedia-thumbnail-marker__inner--error {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wikimedia-thumbnail-marker__inner--error .wikimedia-thumbnail-marker__image {
  display: none;
}

.wikimedia-thumbnail-marker__inner--error::after {
  content: '📷';
  font-size: 12px;
  opacity: 0.5;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Cluster Thumbnail Markers (popular spots with multiple photos)
   ───────────────────────────────────────────────────────────────────────────── */
/* Obsolete DOM Marker Styles Removed (Pure GL Strategy Adopted) */

/* Responsive adjustments */
@media (max-width: 480px) {
  .wikimedia-thumbnail-marker {
    width: 32px;
    height: 32px;
  }

  .wikimedia-thumbnail-marker__inner--error::after {
    font-size: 10px;
  }

  .wikimedia-cluster-thumbnail {
    width: 40px;
    height: 40px;
  }

  .wikimedia-cluster-thumbnail__inner {
    border-width: 2px;
  }

  .wikimedia-cluster-thumbnail__badge {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    padding: 0 4px;
  }
}

/* Wikimedia Photo Popup Carousel */
.wikimedia-popup-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.wikimedia-popup-carousel__track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.wikimedia-popup-carousel__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
}



.wikimedia-popup-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  opacity: 0;
}

.wikimedia-popup-content:hover .wikimedia-popup-carousel__nav {
  opacity: 1;
}

.wikimedia-popup-carousel__nav:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.wikimedia-popup-carousel__nav--prev {
  left: 12px;
}

.wikimedia-popup-carousel__nav--next {
  right: 12px;
}

.wikimedia-popup-carousel__dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.wikimedia-popup-carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

.wikimedia-popup-carousel__dot--active {
  background: white;
  transform: scale(1.3);
}

/* Loading Spinner */
.wikimedia-popup-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 26, 34, 0.6);
  backdrop-filter: blur(4px);
  z-index: 5;
  transition: opacity 0.3s ease;
}

.wikimedia-popup-loading--hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.wikimedia-popup-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #3ab7c6;
  border-radius: 50%;
  animation: wikimedia-spin 0.8s linear infinite;
}

@keyframes wikimedia-spin {
  to {
    transform: rotate(360deg);
  }
}

/* SpotAiR webcam popup ---------------------------------------------------- */
.xplore-webcam-popup {
  z-index: 99990;
}

.xplore-webcam-popup .maplibregl-popup-content {
  width: min(340px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(126, 226, 167, 0.24);
  border-radius: 16px;
  background: rgba(15, 31, 38, 0.97);
  color: #f3f7f5;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.xplore-webcam-popup .maplibregl-popup-tip {
  border-top-color: rgba(15, 31, 38, 0.97);
  border-bottom-color: rgba(15, 31, 38, 0.97);
}

.xplore-webcam-popup .maplibregl-popup-close-button {
  z-index: 3;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(8, 20, 25, 0.72);
  color: #fff;
  font-size: 22px;
  line-height: 27px;
}

.xplore-webcam-popup .maplibregl-popup-close-button:hover {
  background: rgba(19, 49, 57, 0.96);
}

.webcam-popup {
  display: flex;
  flex-direction: column;
}

.webcam-popup__header {
  padding: 14px 15px 11px;
}

.webcam-popup__title {
  margin: 0;
  padding-right: 38px;
  color: #f6faf8;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
}

.webcam-popup__choice {
  min-width: 50px;
  min-height: 30px;
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: rgba(231, 240, 236, 0.74);
  background: rgba(255, 255, 255, 0.045);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.webcam-popup__choice:hover,
.webcam-popup__choice.is-selected {
  border-color: rgba(112, 226, 161, 0.72);
  color: #dffbec;
  background: rgba(112, 226, 161, 0.14);
}

.webcam-popup__choice:focus-visible,
.webcam-popup__retry:focus-visible,
.webcam-popup__image-link:focus-visible,
.webcam-popup__info-toggle:focus-visible,
.webcam-popup__provider-link:focus-visible,
.webcam-popup__attribution:focus-visible {
  outline: 2px solid #91f0b8;
  outline-offset: 2px;
}

.webcam-popup__media {
  position: relative;
  display: flex;
  min-height: 190px;
  margin: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(30, 57, 63, 0.9), rgba(8, 20, 25, 0.96));
}

.webcam-popup__media-viewport {
  display: flex;
  width: 100%;
  height: 190px;
  align-items: center;
  overflow: hidden;
}

.webcam-popup__image-link {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.webcam-popup__image-link:hover .webcam-popup__image {
  filter: brightness(1.04);
}

.webcam-popup__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 160ms ease;
}

.webcam-popup__media.is-ready .webcam-popup__image {
  opacity: 1;
}

.webcam-popup__media.is-panorama .webcam-popup__media-viewport {
  justify-content: flex-start;
  overflow: hidden;
}

.webcam-popup__media.is-panorama .webcam-popup__image-link {
  justify-content: flex-start;
}

.webcam-popup__media.is-panorama .webcam-popup__image {
  width: auto;
  max-width: none;
  height: 100%;
  object-fit: contain;
  will-change: transform;
}

.webcam-popup__media.is-ready.is-panorama .webcam-popup__image {
  animation: webcam-panorama-pan var(--webcam-pan-duration, 24s) ease-in-out 80ms infinite alternate both;
}

@keyframes webcam-panorama-pan {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(calc(-100% + min(330px, calc(100vw - 40px))), 0, 0); }
}

.webcam-popup__image-link.is-insecure:focus-visible,
.webcam-popup__media.is-panorama .webcam-popup__image:focus-visible {
  outline: 2px solid #f1c774;
  outline-offset: -3px;
}

.webcam-popup__media-security {
  position: absolute;
  z-index: 3;
  left: 7px;
  bottom: 7px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 221, 151, 0.34);
  border-radius: 6px;
  color: #ffe0a1;
  background: rgba(35, 25, 8, 0.82);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.webcam-popup__media-status {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  padding: 24px;
  align-items: center;
  justify-content: center;
  color: rgba(226, 239, 233, 0.68);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.webcam-popup__media-status[hidden] {
  display: none;
}

.webcam-popup__media.is-loading::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(112, 226, 161, 0.09) 48%, transparent 76%);
  content: '';
  animation: webcam-preview-loading 1.4s linear infinite;
  transform: translateX(-100%);
}

@keyframes webcam-preview-loading {
  to { transform: translateX(100%); }
}

.webcam-popup__retry {
  position: absolute;
  z-index: 3;
  bottom: 18px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(112, 226, 161, 0.65);
  border-radius: 9px;
  color: #cffff0;
  background: rgba(11, 34, 39, 0.9);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.webcam-popup__timestamp {
  position: absolute;
  z-index: 5;
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(5, 16, 20, 0.66);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.webcam-popup__info-toggle {
  position: absolute;
  z-index: 8;
  right: 8px;
  bottom: 8px;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 50%;
  color: #fff;
  background: rgba(5, 16, 20, 0.7);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.34);
  font-family: Georgia, serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 700;
  line-height: 23px;
  cursor: pointer;
}

.webcam-popup__info-toggle:hover,
.webcam-popup__info.is-open .webcam-popup__info-toggle {
  border-color: #9af0bc;
  color: #dffff0;
  background: rgba(19, 55, 60, 0.94);
}

.webcam-popup__info-panel {
  position: absolute;
  z-index: 7;
  right: 6px;
  bottom: 6px;
  left: 6px;
  max-height: 174px;
  padding: 10px 40px 10px 11px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 11px;
  color: #edf7f2;
  background: rgba(6, 20, 25, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  scrollbar-width: thin;
}

.webcam-popup__info-panel[hidden] {
  display: none;
}

.webcam-popup__info-title {
  margin: 0 0 7px;
  color: #f5fbf8;
  font-size: 11px;
  font-weight: 750;
}

.webcam-popup__info-list {
  display: flex;
  margin: 0;
  flex-direction: column;
  gap: 4px;
}

.webcam-popup__info-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  font-size: 9px;
  line-height: 1.3;
}

.webcam-popup__info-label {
  color: rgba(211, 228, 220, 0.56);
}

.webcam-popup__info-value {
  margin: 0;
  color: rgba(241, 249, 245, 0.9);
  font-weight: 650;
  text-align: right;
}

.webcam-popup__info-description {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(231, 240, 236, 0.72);
  font-size: 9px;
  line-height: 1.4;
}

.webcam-popup__info-choices {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  scrollbar-width: thin;
}

.webcam-popup__info-links {
  display: flex;
  margin-top: 8px;
  padding-top: 7px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.webcam-popup__provider-link {
  color: #8cebb3;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
}

.webcam-popup__provider-link.is-insecure {
  color: #f1c774;
}

.webcam-popup__attribution {
  color: rgba(220, 232, 227, 0.54);
  font-size: 8px;
  line-height: 1.3;
  text-align: right;
  text-decoration: none;
}

.webcam-popup__attribution:hover {
  color: rgba(220, 242, 231, 0.86);
}

@media (prefers-reduced-motion: reduce) {
  .webcam-popup__media.is-loading::after {
    animation: none;
  }

  .webcam-popup__image {
    transition: none;
  }

  .webcam-popup__media.is-ready.is-panorama .webcam-popup__image {
    animation: none;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    will-change: auto;
  }
}

/* Layer panel polish: keep options visually open, not framed tiles. */
body.layer-side-panel-enabled {
  --layer-side-panel-width: min(330px, calc(100vw - 12px));
  --layer-side-panel-edge: 4px;
  --layer-side-panel-open-gap: 28px;
  --layer-side-panel-outer-width: calc(var(--layer-side-panel-width) + 30px);
  --layer-side-panel-control-inset: 16px;
  --layer-side-panel-control-shift: calc(var(--layer-side-panel-outer-width) + var(--layer-side-panel-edge) + var(--layer-side-panel-open-gap) - var(--layer-side-panel-control-inset));
  --layer-side-panel-analytics-offset: calc(var(--layer-side-panel-outer-width) + var(--layer-side-panel-edge) + var(--layer-side-panel-open-gap));
  --layer-side-panel-option-width: 68px;
  --layer-side-panel-option-gap-x: 10px;
  --layer-side-panel-option-gap-y: 4px;
}

body.layer-side-panel-enabled .imagery-panel__buttons>.imagery-panel__control-group>#photosToolboxToggle,
body.layer-side-panel-enabled .imagery-panel__buttons>.imagery-panel__control-group>#shadowToolboxToggle,
body.layer-side-panel-enabled .imagery-panel__buttons>.imagery-panel__control-group>#snowToolboxToggle,
body.layer-side-panel-enabled .imagery-panel__buttons>.imagery-panel__control-group>#terrainToolboxToggle,
body.layer-side-panel-enabled .imagery-panel__buttons>.imagery-panel__control-group>#pathwayToolboxToggle,
body.layer-side-panel-enabled .imagery-panel__control-group.layer-side-panel__source-group {
  display: none !important;
}

body.layer-side-panel-enabled .basemap-toolbox.layer-side-panel {
  position: fixed !important;
  top: calc(var(--app-header-height) + var(--layer-side-panel-edge)) !important;
  right: var(--layer-side-panel-edge) !important;
  left: auto !important;
  bottom: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  height: auto !important;
  max-height: calc(100vh - var(--app-header-height) - var(--layer-side-panel-edge) - var(--layer-side-panel-edge)) !important;
  width: var(--layer-side-panel-width) !important;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  opacity: 1 !important;
  visibility: hidden !important;
  overflow: hidden !important;
  z-index: 1200 !important;
  transform: translateX(105%) !important;
  transition: transform 0.28s ease, visibility 0.28s ease !important;
}

body.layer-side-panel-enabled .basemap-toolbox.layer-side-panel.visible {
  transform: translateX(0) !important;
  visibility: visible !important;
}

body.layer-side-panel-enabled .layer-side-panel__header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body.layer-side-panel-enabled .layer-side-panel__title {
  color: rgba(255, 255, 255, 0.94) !important;
  font-family: var(--font-ui) !important;
  font-size: 17px !important;
  font-weight: 700 !important;
}

body.layer-side-panel-enabled .layer-side-panel__close {
  width: 32px !important;
  height: 32px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 24px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

body.layer-side-panel-enabled .layer-side-panel__close:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

body.layer-side-panel-enabled .layer-side-panel__body {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  padding-top: 8px !important;
  overflow: hidden !important;
}

body.layer-side-panel-enabled .layer-side-panel__section,
body.layer-side-panel-enabled .basemap-region-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

body.layer-side-panel-enabled .layer-side-panel__section-header {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

body.layer-side-panel-enabled .layer-side-panel__section-title {
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-family: var(--font-ui) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
}

body.layer-side-panel-enabled .layer-side-panel__section-hint {
  display: none !important;
}

body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}

body.layer-side-panel-enabled .basemap-region-group__title {
  color: rgba(255, 255, 255, 0.5) !important;
  font-family: var(--font-ui) !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
}

body.layer-side-panel-enabled .basemap-placeholder {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: rgba(255, 255, 255, 0.92) !important;
  font-family: var(--font-ui) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

body.layer-side-panel-enabled .basemap-placeholder--none {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.layer-side-panel-enabled .basemap-placeholder--color-relief-only {
  background: linear-gradient(135deg, #31565a 0%, #716d4e 42%, #b59e8a 70%, #d6e8ee 100%) !important;
}

body.layer-side-panel-enabled .layer-side-panel__options,
body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
}

body.layer-side-panel-enabled .layer-side-panel .toolbox-option-row,
body.layer-side-panel-enabled .layer-side-panel .basemap-region-group__grid,
body.layer-side-panel-enabled .layer-side-panel__photo-row {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle,
body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle:hover,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle:hover,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle:hover,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle:hover,
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle:hover,
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle:hover,
body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle:focus-visible,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle:focus-visible,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle:focus-visible,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle:focus-visible,
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle:focus-visible,
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle:focus-visible,
body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="heatmap"].active,
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle.active {
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  outline: 0 !important;
  transform: none !important;
  animation: none !important;
}

body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle>span:not(.sr-only),
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle>span:not(.sr-only),
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle>span:not(.sr-only),
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle>span:not(.sr-only),
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle>span:not(.sr-only):not(.basemap-placeholder),
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle>span:not(.sr-only) {
  display: none !important;
}

body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle {
  height: 68px !important;
  min-height: 68px !important;
  gap: 3px !important;
}

body.layer-side-panel-enabled .layer-side-panel .btn.terrain-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.snow-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.shadow-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.pathway-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.basemap-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.photos-toolbox-toggle::after {
  font-size: 8.5px !important;
  line-height: 0.95 !important;
}

body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle {
  height: 52px !important;
  min-height: 52px !important;
}

body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox,
body.layer-side-panel-enabled .layer-side-panel__photo-row,
body.layer-side-panel-enabled .layer-side-panel .basemap-region-group__grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, var(--layer-side-panel-option-width))) !important;
  column-gap: var(--layer-side-panel-option-gap-x) !important;
  row-gap: var(--layer-side-panel-option-gap-y) !important;
  justify-content: start !important;
  justify-items: stretch !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.layer-side-panel-enabled .layer-side-panel__section-content,
body.layer-side-panel-enabled .layer-side-panel__options,
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options,
body.layer-side-panel-enabled .layer-side-panel .basemap-region-group {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.layer-side-panel-enabled .layer-side-panel .toolbox-option-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle img,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle img,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle img,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle img:not(.pathway-badge),
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle img:not(.basemap-badge),
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle img,
body.layer-side-panel-enabled .layer-side-panel .basemap-placeholder {
  width: 52px !important;
  height: 52px !important;
  flex: 0 0 52px !important;
  border-radius: 9px !important;
}

body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="strava-winter"] img:not(.pathway-badge),
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="strava-backcountry-ski"] img:not(.pathway-badge),
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="strava-cycling"] img:not(.pathway-badge),
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="strava-run"] img:not(.pathway-badge),
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="peaks"] img:not(.pathway-badge),
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle[data-pathway-id="wikimedia-photos"] img:not(.pathway-badge),
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle[data-basemap-id="lidar-forest"] img:not(.basemap-badge) {
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.38)) !important;
  object-fit: contain !important;
  opacity: 0.94 !important;
}

body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle img:not(.pathway-badge) {
  width: 36px !important;
  height: 36px !important;
  flex: 0 0 36px !important;
  object-fit: contain !important;
  border-radius: 7px !important;
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.42)) !important;
  opacity: 0.95 !important;
}

body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle::after {
  content: none !important;
  display: none !important;
}

body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle.active,
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle.active {
  border-radius: 12px !important;
  box-shadow: inset 0 0 0 2px rgba(103, 224, 132, 0.94), 0 0 0 1px rgba(103, 224, 132, 0.2) !important;
}

body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle,
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle {
  position: relative !important;
}

body.layer-side-panel-enabled .layer-side-panel .btn.terrain-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.snow-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.shadow-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.pathway-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.basemap-toolbox__toggle::after,
body.layer-side-panel-enabled .layer-side-panel .btn.photos-toolbox-toggle::after {
  content: attr(data-layer-label) !important;
  position: absolute !important;
  left: 3px !important;
  right: 3px !important;
  top: 4px !important;
  bottom: auto !important;
  z-index: 2 !important;
  display: block !important;
  max-height: 34px !important;
  overflow: hidden !important;
  color: #fff !important;
  font-size: 8.5px !important;
  line-height: 0.95 !important;
  white-space: pre-line !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 4px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.72) !important;
}

body.layer-side-panel-enabled .layer-side-panel .btn.terrain-toolbox__toggle[data-layer-label-placement="center"]::after,
body.layer-side-panel-enabled .layer-side-panel .btn.snow-toolbox__toggle[data-layer-label-placement="center"]::after,
body.layer-side-panel-enabled .layer-side-panel .btn.shadow-toolbox__toggle[data-layer-label-placement="center"]::after,
body.layer-side-panel-enabled .layer-side-panel .btn.pathway-toolbox__toggle[data-layer-label-placement="center"]::after,
body.layer-side-panel-enabled .layer-side-panel .btn.basemap-toolbox__toggle[data-layer-label-placement="center"]::after,
body.layer-side-panel-enabled .layer-side-panel .btn.photos-toolbox-toggle[data-layer-label-placement="center"]::after {
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  max-height: 40px !important;
  padding: 0 2px !important;
}

body.layer-side-panel-enabled .layer-side-panel .terrain-toolbox .btn.terrain-toolbox__toggle.active::after,
body.layer-side-panel-enabled .layer-side-panel .snow-toolbox .btn.snow-toolbox__toggle.active::after,
body.layer-side-panel-enabled .layer-side-panel .shadow-toolbox .btn.shadow-toolbox__toggle.active::after,
body.layer-side-panel-enabled .layer-side-panel .pathway-toolbox .btn.pathway-toolbox__toggle.active::after,
body.layer-side-panel-enabled .layer-side-panel .basemap-toolbox-options .btn.basemap-toolbox__toggle.active::after,
body.layer-side-panel-enabled .layer-side-panel .photos-toolbox-toggle.active::after {
  color: #78d990 !important;
}

body.layer-side-panel-enabled .layer-side-panel .btn.terrain-toolbox__toggle[data-layer-label-placement="center"] img,
body.layer-side-panel-enabled .layer-side-panel .btn.snow-toolbox__toggle[data-layer-label-placement="center"] img,
body.layer-side-panel-enabled .layer-side-panel .btn.shadow-toolbox__toggle[data-layer-label-placement="center"] img,
body.layer-side-panel-enabled .layer-side-panel .btn.basemap-toolbox__toggle[data-layer-label-placement="center"] img:not(.basemap-badge),
body.layer-side-panel-enabled .layer-side-panel .btn.photos-toolbox-toggle[data-layer-label-placement="center"] img,
body.layer-side-panel-enabled .layer-side-panel .btn.basemap-toolbox__toggle[data-layer-label-placement="center"] .basemap-placeholder {
  filter: brightness(0.72) saturate(0.96) contrast(1.04) !important;
}

body.layer-side-panel-enabled .layer-side-panel .btn.terrain-toolbox__toggle.active[data-layer-label-placement="center"] img,
body.layer-side-panel-enabled .layer-side-panel .btn.snow-toolbox__toggle.active[data-layer-label-placement="center"] img,
body.layer-side-panel-enabled .layer-side-panel .btn.shadow-toolbox__toggle.active[data-layer-label-placement="center"] img,
body.layer-side-panel-enabled .layer-side-panel .btn.basemap-toolbox__toggle.active[data-layer-label-placement="center"] img:not(.basemap-badge),
body.layer-side-panel-enabled .layer-side-panel .btn.photos-toolbox-toggle.active[data-layer-label-placement="center"] img,
body.layer-side-panel-enabled .layer-side-panel .btn.basemap-toolbox__toggle.active[data-layer-label-placement="center"] .basemap-placeholder {
  filter: none !important;
}

body.layer-side-panel-enabled .layer-side-panel .heatmap-toolbox .btn.pathway-toolbox__toggle::after {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  margin-top: 2px !important;
}

.basemap-toolbox-toggle {
  isolation: isolate;
  position: relative;
}

.layers-stack-icon {
  --layer-stack-fill: rgba(255, 255, 255, 0.18);
  --layer-stack-stroke: rgba(255, 255, 255, 0.94);
  display: block;
  position: relative;
  width: 27px;
  height: 27px;
}

.layers-stack-icon__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.layers-stack-icon__layer polygon {
  fill: var(--layer-stack-fill);
  stroke: var(--layer-stack-stroke);
  stroke-width: 1.9;
  stroke-linejoin: round;
  stroke-miterlimit: 10;
  vector-effect: non-scaling-stroke;
}

.layers-stack-icon__layer {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.layers-stack-icon__layer--top {
  transform: translateY(0);
}

.layers-stack-icon__layer--middle {
  transform: translateY(0);
}

.layers-stack-icon__layer--bottom {
  transform: translateY(0);
}

.basemap-toolbox-toggle:hover .layers-stack-icon__layer--top,
.basemap-toolbox-toggle:focus-visible .layers-stack-icon__layer--top {
  animation: layer-stack-expand-top 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.basemap-toolbox-toggle:hover .layers-stack-icon__layer--middle,
.basemap-toolbox-toggle:focus-visible .layers-stack-icon__layer--middle {
  animation: layer-stack-expand-middle 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.basemap-toolbox-toggle:hover .layers-stack-icon__layer--bottom,
.basemap-toolbox-toggle:focus-visible .layers-stack-icon__layer--bottom {
  animation: layer-stack-expand-bottom 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes layer-stack-expand-top {
  0%, 100% {
    transform: translateY(0);
  }

  42% {
    transform: translateY(-2.5px);
  }

  72% {
    transform: translateY(-1.3px);
  }
}

@keyframes layer-stack-expand-middle {
  0%, 100% {
    transform: translateY(0) scale(1);
  }

  42% {
    transform: translateY(0) scale(0.98);
  }

  72% {
    transform: translateY(0) scale(1.01);
  }
}

@keyframes layer-stack-expand-bottom {
  0%, 100% {
    transform: translateY(0);
  }

  42% {
    transform: translateY(2.5px);
  }

  72% {
    transform: translateY(1.3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .basemap-toolbox-toggle:hover .layers-stack-icon__layer,
  .basemap-toolbox-toggle:focus-visible .layers-stack-icon__layer {
    animation: none !important;
  }
}

body.layer-side-panel-enabled .imagery-panel,
body.layer-side-panel-enabled .maplibregl-ctrl-top-right,
body.layer-side-panel-enabled .analytical-legend-container {
  transition: right 0.28s ease, transform 0.28s ease, opacity 0.28s ease !important;
}

body.layer-side-panel-enabled .imagery-panel,
body.layer-side-panel-enabled .maplibregl-ctrl-top-right {
  z-index: 1100 !important;
}

@media (min-width: 760px) {
  body.layer-side-panel-open .imagery-panel,
  body.layer-side-panel-open .maplibregl-ctrl-top-right {
    transform: translateX(calc(-1 * var(--layer-side-panel-control-shift))) !important;
  }

  body.layer-side-panel-open .analytical-legend-container {
    right: calc(var(--layer-side-panel-analytics-offset) + env(safe-area-inset-right, 0px)) !important;
  }
}

.wikimedia-photo-popup .maplibregl-popup-content {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.wikimedia-photo-popup .maplibregl-popup-tip {
  border-top-color: rgba(13, 26, 34, 0.9);
}

.wikimedia-popup-content {
  background: rgba(13, 26, 34, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  width: 320px;
}

.wikimedia-popup-image-container {
  position: relative;
  width: 100%;
  min-height: 200px;
  max-height: 400px;
  background: #0d1a22;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.3s ease;
}

.wikimedia-popup-carousel__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Photo Lightbox (Full-screen viewer) - Glassmorphism Theme
   ═══════════════════════════════════════════════════════════════════════════ */

.photo-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.photo-lightbox--open {
  opacity: 1;
}

.photo-lightbox--closing {
  opacity: 0;
}

.photo-lightbox__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.photo-lightbox__container {
  position: relative;
  max-width: 90vw;
  height: 90vh;
  /* Explicit height needed for abs-positioned children */
  max-height: 90vh;
  width: 950px;
  background: var(--glass-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--glass-radius);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.photo-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 100;
  width: 36px;
  height: 36px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  font-size: 24px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--glass-border-strong);
  transform: scale(1.1);
}

.photo-lightbox__content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  /* Center children vertically */
}

.photo-lightbox__carousel {
  position: relative;
  flex: 1;
  min-height: 0;
  max-height: 82vh;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.photo-lightbox__carousel-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-lightbox__slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
}

.photo-lightbox__slide>img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  padding: 24px;
  box-sizing: border-box;
  border-radius: 8px;
}

.photo-lightbox__image {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  z-index: 2;
}

.photo-lightbox__image--placeholder {
  opacity: 1;
  z-index: 1;
  pointer-events: none;
  filter: blur(4px);
  transition: opacity 0.6s ease-in-out;
}

.photo-lightbox__image.loaded {
  opacity: 1;
}

.photo-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--glass-border-strong);
  transform: translateY(-50%) scale(1.08);
}

.photo-lightbox__nav--prev {
  left: 20px;
}

.photo-lightbox__nav--next {
  right: 20px;
}

.photo-lightbox__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 14px 0;
  background: transparent;
}

.photo-lightbox__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.photo-lightbox__dot:hover {
  background: rgba(255, 255, 255, 0.4);
}

.photo-lightbox__dot--active {
  background: #1a73e8;
  border-color: #1a73e8;
  transform: scale(1.3);
}

.photo-lightbox__info {
  background: rgba(0, 0, 0, 0.25);
  padding: 14px 24px;
  border-top: 1px solid var(--glass-border);
  min-height: 24px;
}

.photo-lightbox__meta {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--font-ui);
}

.photo-lightbox__meta-description {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.75);
}

.photo-lightbox__meta-author {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.photo-lightbox__meta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.photo-lightbox__meta-links a {
  color: rgba(180, 218, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.photo-lightbox__loading {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  font-size: 11px;
}

.photo-lightbox__meta-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Shadow Time Control Panel */
.shadow-time-control {
  position: absolute;
  top: calc(170px + env(safe-area-inset-top, 0px));
  left: calc(32px + env(safe-area-inset-left, 0px));
  z-index: 10;
  width: 280px;
  border-radius: var(--glass-radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  font-family: var(--font-ui);
}

#snowControls {
  top: calc(380px + env(safe-area-inset-top, 0px));
}

.shadow-time-control__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shadow-time-control__title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(12, 24, 36, 0.9);
}

.shadow-time-control__close {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: rgba(12, 24, 36, 0.5);
  cursor: pointer;
  transition: color 0.2s ease;
}

.shadow-time-control__close:hover {
  color: rgba(12, 24, 36, 0.9);
}

.shadow-time-control__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shadow-time-control__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shadow-time-control__row label {
  flex: 0 0 50px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(12, 24, 36, 0.7);
}

.shadow-time-control__input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(12, 24, 36, 0.15);
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.6);
  color: rgba(12, 24, 36, 0.9);
}

.shadow-time-control__input:focus {
  outline: none;
  border-color: rgba(114, 140, 108, 0.5);
}

.shadow-time-control__slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(12, 24, 36, 0.12);
  border-radius: 3px;
  outline: none;
}

.shadow-time-control__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #e0e8ef);
  border: 1px solid rgba(12, 24, 36, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.shadow-time-control__label {
  flex: 0 0 50px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(12, 24, 36, 0.9);
  text-align: right;
}

.shadow-time-control__btn {
  padding: 8px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-surface);
  font-size: 13px;
  font-weight: 500;
  color: rgba(12, 24, 36, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
}

.shadow-time-control__btn:hover {
  background: rgba(114, 140, 108, 0.5);
  border-color: rgba(114, 140, 108, 0.5);
}

/* Attribution Control - Force Collapsed by Default */
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-bottom-right .maplibregl-ctrl {
  margin: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

.maplibregl-ctrl-attrib {
  background-color: transparent !important;
  border-radius: 50% !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 24px !important;
  min-width: 24px !important;
  position: relative !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Style the button as a clean circular icon */
.maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-button {
  width: 24px !important;
  height: 24px !important;
  background-color: rgba(255, 255, 255, 0.7) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  list-style: none !important;
  outline: none !important;
}

.maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-button::-webkit-details-marker {
  display: none !important;
}

/* Hide the attribution text by default - only show the button */
.maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-inner {
  display: none !important;
}

/* Show content only when clicked (MapLibre toggles compact-show class) */
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {
  display: block !important;
}

.maplibregl-ctrl-attrib.maplibregl-compact-show {
  background-color: rgba(255, 255, 255, 0.85) !important;
  border-radius: 12px !important;
  height: 24px !important;
  line-height: 24px !important;
  padding: 0 28px 0 8px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* Route Library Dock */
.route-library-dock {
  width: 100%;
  max-width: min(1600px, calc(100vw - 32px));
  margin-inline: auto;
  background: var(--glass-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 90;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  margin-bottom: 0;
  overflow: hidden;
  transform: translateY(30px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.5s;
}

.route-library-dock.visible {
  opacity: 1;
  visibility: visible;
  max-height: 60vh;
  margin-bottom: 12px;
  transform: translateY(0);
  pointer-events: auto;
}

.library-header {
  padding: 12px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.library-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.search-container {
  width: 400px;
  max-width: 100%;
  position: relative;
}

#librarySearchInput {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 16px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  text-align: center;
}

#librarySearchInput::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.library-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

#libraryImportBtn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

#libraryImportBtn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

#libraryImportBtn img {
  filter: brightness(0) invert(1);
  opacity: 0.9;
  width: 16px;
  height: 16px;
}

#librarySearchInput:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-border-strong);
}

.library-content {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.route-list {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding-bottom: 12px;
}

.empty-state {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 40px 100px;
  font-size: 14px;
  width: 100%;
}

/* Route Card */
.route-card {
  width: 320px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  background-position: center;
  background-size: cover;
  border: 1px solid var(--glass-border);
  border-left: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.route-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-5px);
  border-color: var(--glass-border-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.route-card__header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.route-header {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.route-title {
  min-width: 0;
  margin: 0;
  flex: 1;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.route-title__rename {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.route-title__rename:hover {
  background: rgba(255, 255, 255, 0.14);
}

.route-title__rename img {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
}

.route-card__day-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.route-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 13px;
}

.route-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.route-stat__label {
  opacity: 0.8;
  font-size: 11px;
}

.route-stat__value {
  font-weight: 500;
}

.route-card__difficulty {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 11px;
  opacity: 0.8;
}

.route-card__difficulty-bars {
  display: flex;
}

.route-card__difficulty .difficulty-bar {
  width: 4px;
  height: 8px;
  margin-right: 1px;
  display: inline-block;
  border-radius: 1px;
}

.route-sparkline-container {
  position: relative;
  height: 50px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 4px;
  background: transparent;
}

.route-sparkline {
  display: block;
}

.route-card__title {
  font-weight: 600;
  color: #fff;
  font-size: 15px;
  margin: 0;
  line-height: 1.3;
}

.route-card__date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.route-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.route-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.route-stat__label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

.route-stat__value {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  font-family: var(--font-mono);
}

.route-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.route-card__btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  padding: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.route-card__btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.route-card__btn--delete {
  flex: 0 0 auto;
  background: rgba(255, 59, 48, 0.2);
  border-color: rgba(255, 59, 48, 0.4);
}

.route-card__btn--delete:hover {
  background: rgba(255, 59, 48, 0.3);
}

/* Sidebar Toggle Icon fixes */
.library-toggle__icon {
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0 !important;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(0.9) !important;
}

@media (max-width: 600px) {
  .route-library-dock {
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    width: auto;
    max-width: none;
    height: 60vh;
  }
}

/* =============================================================================
   SETTINGS PANEL — Cog button + dropdown panel
   ============================================================================= */

/* Cog button icon */
.settings-toggle__icon {
  width: 20px;
  height: 20px;
  stroke: #fff;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.settings-toggle:hover .settings-toggle__icon {
  transform: rotate(45deg);
}

.settings-toggle[aria-expanded="true"] .settings-toggle__icon {
  transform: rotate(90deg);
}

/* Settings panel — positioned from the imagery-panel__buttons container */
.settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: linear-gradient(160deg, rgba(12, 24, 36, 0.92), rgba(12, 24, 36, 0.96));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.settings-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.settings-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-panel__title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
}

.settings-panel__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.settings-panel__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.settings-panel__body {
  padding: 8px 0;
  max-height: 60vh;
  overflow-y: auto;
}

.settings-panel__section {
  padding: 4px 0;
}

.settings-panel__section+.settings-panel__section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-panel__section-title {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(114, 140, 108, 0.9);
  padding: 8px 16px 4px;
}

.settings-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 12px;
  transition: background 0.12s ease;
}

.settings-panel__row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.settings-panel__row label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.settings-panel__slider-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.settings-panel__slider {
  flex: 1;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
  min-width: 60px;
}

.settings-panel__slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(114, 140, 108, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.settings-panel__slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.settings-panel__slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(114, 140, 108, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.settings-panel__slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.settings-panel__value {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Checkbox — custom toggle switch */
.settings-panel__checkbox {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.settings-panel__checkbox::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s ease;
}

.settings-panel__checkbox:checked {
  background: rgba(114, 140, 108, 0.8);
}

.settings-panel__checkbox:checked::before {
  transform: translateX(16px);
  background: #fff;
}

.settings-panel__checkbox:focus-visible {
  outline: 2px solid rgba(114, 140, 108, 0.6);
  outline-offset: 2px;
}

/* Debug sub-options — expandable */
.settings-panel__debug-options {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, padding 0.3s ease;
  padding: 0;
  border-left: 2px solid rgba(114, 140, 108, 0.3);
  margin-left: 16px;
}

.settings-panel__debug-options--open {
  max-height: 360px;
  opacity: 1;
  padding: 4px 0;
}

.settings-panel__debug-options .settings-panel__row {
  padding-left: 12px;
  padding-right: 16px;
}

.settings-panel__row--action {
  align-items: center;
}

.settings-panel__action-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-panel__action-title,
.settings-panel__action-hint {
  font-family: var(--font-ui);
}

.settings-panel__action-title {
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 600;
}

.settings-panel__action-hint {
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
  line-height: 1.25;
}

.settings-panel__action {
  display: inline-grid;
  place-items: center;
  min-width: 70px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(114, 140, 108, 0.55);
  border-radius: 9px;
  background: rgba(114, 140, 108, 0.16);
  color: #aec0a9;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.settings-panel__action:hover {
  border-color: rgba(142, 166, 136, 0.8);
  background: rgba(114, 140, 108, 0.27);
  color: #e5eee2;
}

/* --------------------------------------------------------------------------
   Guided performance diagnostics. This surface stays opaque and avoids blur so
   the measurement UI does not add meaningful GPU work to the map below it.
   -------------------------------------------------------------------------- */
.perfdiag {
  position: fixed;
  top: 84px;
  right: 18px;
  z-index: 2210;
  width: min(430px, calc(100vw - 36px));
  max-height: calc(100dvh - 104px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: #101d27;
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-ui);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(12px, 0, 0) scale(0.985);
  transition: opacity 150ms ease, visibility 150ms ease, transform 180ms ease;
}

.perfdiag--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.perfdiag [hidden] {
  display: none !important;
}

.perfdiag__handle {
  display: none;
}

.perfdiag__header {
  min-height: 66px;
  padding: 11px 12px 11px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.perfdiag__heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.perfdiag__heading-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border: 1px solid rgba(114, 140, 108, 0.48);
  border-radius: 11px;
  background: rgba(114, 140, 108, 0.14);
  color: #93aa8d;
}

.perfdiag svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.perfdiag__heading h2 {
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.95);
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perfdiag__heading p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
}

.perfdiag__close {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.perfdiag__close:disabled {
  opacity: 0.35;
}

.perfdiag__running {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
}

.perfdiag__running strong {
  overflow: hidden;
  color: #dce7d9;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perfdiag__running > span:not(.perfdiag__record-dot) {
  margin-left: auto;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.perfdiag__running button {
  min-height: 36px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(218, 126, 104, 0.42);
  border-radius: 10px;
  background: rgba(146, 66, 51, 0.18);
  color: #e7b1a4;
  font: 700 10px/1 var(--font-ui);
}

.perfdiag__running button svg {
  width: 14px;
  height: 14px;
}

.perfdiag__record-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #c47f6d;
  box-shadow: 0 0 0 4px rgba(196, 127, 109, 0.12);
}

.perfdiag--capturing {
  width: min(390px, calc(100vw - 36px));
}

.perfdiag--capturing .perfdiag__heading,
.perfdiag--capturing .perfdiag__close,
.perfdiag--capturing .perfdiag__body {
  display: none;
}

.perfdiag--capturing .perfdiag__header {
  min-height: 54px;
  border-bottom: 0;
}

.perfdiag__body {
  min-height: 0;
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
}

.perfdiag__intro,
.perfdiag__mode-note,
.perfdiag__feedback {
  margin: 0;
  color: rgba(255, 255, 255, 0.57);
  font-size: 11px;
  line-height: 1.45;
}

.perfdiag__actions {
  display: grid;
  gap: 8px;
}

.perfdiag__actions--primary {
  margin-top: 13px;
  grid-template-columns: 1.35fr 1fr;
}

.perfdiag__actions--primary [data-perf-deep] {
  grid-column: 1 / -1;
}

.perfdiag__button {
  min-height: 42px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.052);
  color: rgba(255, 255, 255, 0.78);
  font: 700 10px/1.15 var(--font-ui);
  cursor: pointer;
}

.perfdiag__button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.perfdiag__button--primary {
  border-color: rgba(114, 140, 108, 0.7);
  background: rgba(114, 140, 108, 0.22);
  color: #e4ede1;
}

.perfdiag__button svg {
  width: 16px;
  height: 16px;
}

.perfdiag__mode-note {
  margin-top: 8px;
  font-size: 9px;
}

.perfdiag__summary {
  margin-top: 14px;
  padding: 11px;
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(4, 10, 15, 0.22);
}

.perfdiag__verdict {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 11px;
  background: rgba(114, 140, 108, 0.15);
  text-align: center;
}

.perfdiag__verdict span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.perfdiag__verdict strong {
  margin-top: 3px;
  color: #c9d8c5;
  font: 700 21px/1 var(--font-mono);
}

.perfdiag__verdict small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 8px;
}

.perfdiag[data-grade="limited"] .perfdiag__verdict {
  background: rgba(172, 134, 74, 0.16);
}

.perfdiag[data-grade="limited"] .perfdiag__verdict strong {
  color: #d8bd8f;
}

.perfdiag[data-grade="critical"] .perfdiag__verdict {
  background: rgba(163, 77, 59, 0.17);
}

.perfdiag[data-grade="critical"] .perfdiag__verdict strong {
  color: #ddb0a4;
}

.perfdiag__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.perfdiag__metrics > div {
  min-width: 0;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.perfdiag__metrics span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.44);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perfdiag__metrics strong {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.88);
  font: 600 13px/1 var(--font-mono);
}

.perfdiag__section {
  margin-top: 15px;
}

.perfdiag__section h3 {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.63);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.perfdiag__findings {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.perfdiag__finding {
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-left: 3px solid rgba(114, 140, 108, 0.72);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.032);
}

.perfdiag__finding--warning {
  border-left-color: #ad8854;
}

.perfdiag__finding--critical {
  border-left-color: #b66d5a;
}

.perfdiag__finding-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.perfdiag__finding-head strong {
  min-width: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
}

.perfdiag__finding-badge {
  padding: 3px 5px;
  flex: 0 0 auto;
  border-radius: 5px;
  background: rgba(114, 140, 108, 0.16);
  color: #b8c8b4;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.perfdiag__finding--warning .perfdiag__finding-badge {
  background: rgba(173, 136, 84, 0.15);
  color: #d5b98f;
}

.perfdiag__finding--critical .perfdiag__finding-badge {
  background: rgba(182, 109, 90, 0.15);
  color: #deb0a4;
}

.perfdiag__finding p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 9px;
  line-height: 1.4;
}

.perfdiag__finding .perfdiag__finding-action {
  color: rgba(190, 207, 185, 0.72);
}

.perfdiag__phases {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
}

.perfdiag__phase-row {
  min-height: 34px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
}

.perfdiag__phase-row + .perfdiag__phase-row {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.perfdiag__phase-row > span:first-child {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  text-transform: capitalize;
}

.perfdiag__phase-row > span:last-child {
  font-family: var(--font-mono);
  text-align: right;
}

.perfdiag__context {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.perfdiag__context span {
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.032);
  color: rgba(255, 255, 255, 0.58);
  font: 500 8px/1 var(--font-mono);
}

.perfdiag__actions--report {
  margin-top: 15px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.perfdiag__feedback {
  min-height: 15px;
  margin-top: 8px;
  color: rgba(164, 188, 157, 0.72);
  font-size: 9px;
}

/* Position the imagery panel buttons as a relative container for the settings dropdown */
.imagery-panel__buttons {
  position: relative;
}

/* Shadow V3 atlas debug */
.shadow-v3-debug {
  position: fixed;
  right: 18px;
  left: auto;
  top: 112px;
  z-index: 1300;
  width: min(800px, calc(100vw - 36px));
  max-height: calc(100vh - 140px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: rgba(17, 22, 29, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  color: #eef4f8;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  user-select: text;
}

.shadow-v3-debug--left {
  left: 18px;
  right: auto;
}

.shadow-v3-debug[aria-hidden="false"] {
  display: flex;
}

.shadow-v3-debug__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shadow-v3-debug__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.shadow-v3-debug__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.shadow-v3-debug__status {
  margin-top: 4px;
  color: rgba(238, 244, 248, 0.72);
  font: 11px/1.4 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.shadow-v3-debug__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.shadow-v3-debug__side {
  height: 28px;
  min-width: 52px;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.shadow-v3-debug__close:hover,
.shadow-v3-debug__side:hover {
  background: rgba(255, 255, 255, 0.16);
}

.shadow-v3-debug__body {
  padding: 12px 14px 14px;
  overflow: auto;
}

.shadow-v3-debug__canvas-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  background: #05080b;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 5px;
}

.shadow-v3-debug canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #070a0d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  touch-action: none;
  cursor: grab;
}

.shadow-v3-debug canvas:active {
  cursor: grabbing;
}

.shadow-v3-debug__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.shadow-v3-debug__actions button {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 7px 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.shadow-v3-debug__actions button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.shadow-v3-debug__actions button[data-active="true"] {
  border-color: rgba(0, 212, 255, 0.68);
  background: rgba(0, 212, 255, 0.22);
  color: #f2fdff;
}

.shadow-v3-debug__zoom {
  margin-top: 0;
  color: rgba(238, 244, 248, 0.68);
  font: 11px/1.4 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.shadow-v3-debug__views {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}

.shadow-v3-debug__view {
  min-width: 0;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  padding: 6px;
}

.shadow-v3-debug__view-title {
  margin-bottom: 5px;
  color: rgba(238, 244, 248, 0.82);
  font-size: 11px;
  font-weight: 700;
}

.shadow-v3-debug__log {
  width: 100%;
  min-height: 168px;
  margin-top: 10px;
  resize: vertical;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 10px;
  background: rgba(2, 5, 8, 0.72);
  color: #dce8ef;
  font: 11px/1.45 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}

/* --- Custom Modal & Toast Styles --- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--glass-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
  width: 90%;
  max-width: 400px;
  padding: 24px;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: white;
}

.modal-overlay.visible .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #728c6c;
}

.modal-body {
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.modal-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: white;
  font-family: var(--font-ui);
  font-size: 14px;
  margin-top: 8px;
  outline: none;
  transition: border-color 0.2s ease;
}

.modal-input:focus {
  border-color: var(--glass-highlight);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.modal-btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.modal-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-btn--primary {
  background: #2ecc71;
  color: white;
}

.modal-btn--primary:hover {
  background: #27ae60;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
}

.modal-btn--danger {
  background: #e74c3c;
  color: white;
}

.modal-btn--danger:hover {
  background: #c0392b;
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.4);
}

/* Toast Styles */
.toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 3000;
  background: var(--glass-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border-strong);
  border-radius: 30px;
  padding: 12px 24px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  pointer-events: none;
}

.toast-container.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Route card actions */
.route-actions {
  position: relative;
  z-index: 1;
  margin-top: auto;
  /* Push to bottom of card regardless of sparkline height */
  display: flex;
  justify-content: center;
  gap: 8px;
}

.route-actions .btn--icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

.route-actions .btn--icon-only:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.route-actions .action-delete {
  border-color: rgba(255, 100, 100, 0.3);
  background: rgba(255, 0, 0, 0.08);
}

.route-actions .action-delete:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 100, 100, 0.5);
}

.route-actions .action-delete img {
  filter: invert(36%) sepia(88%) saturate(1000%) hue-rotate(345deg) brightness(100%) contrast(100%);
}

.route-actions .btn--icon-only img {
  opacity: 0.9;
}

.route-actions .action-show img,
.route-actions .action-play img,
.route-actions .action-load img,
.route-actions .action-export img {
  filter: brightness(0) invert(1);
}

.toast-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
}

.toast--success .toast-icon {
  background: #2ecc71;
}

.toast--error .toast-icon {
  background: #e74c3c;
}

.toast--info .toast-icon {
  background: #3498db;
}

/* Peak label DOM badges. The native layer carries source visibility/density;
   this overlay owns final priority and collision. */
.xplore-peak-marker {
  --peak-label-scale: 1;
  width: 0;
  height: 0;
  pointer-events: none;
}

.xplore-peak-marker__body {
  position: absolute;
  bottom: -3px;
  left: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  transform: translateX(-50%) scale(var(--peak-label-scale));
  transform-origin: 50% 100%;
  will-change: transform;
}

.xplore-peak-marker__row {
  display: flex;
  align-items: center;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.34));
}

.xplore-peak-marker__badge {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  height: 27px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 7px;
  background: rgba(28, 35, 38, 0.22);
  color: #fff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 27px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 3px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
  backdrop-filter: blur(5px);
}

.xplore-peak-marker__name {
  display: block;
  max-width: 165px;
  min-width: 0;
  overflow: hidden;
  padding: 0 9px 0 10px;
  text-overflow: ellipsis;
}

.xplore-peak-marker__elevation {
  display: block;
  min-width: 54px;
  padding: 0 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  text-align: center;
}

.xplore-peak-marker__icon-slot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0;
  height: 29px;
}

.xplore-peak-marker__star,
.xplore-peak-marker__mountain {
  display: none;
  flex: 0 0 auto;
}

.xplore-peak-marker--starred .xplore-peak-marker__star {
  display: block;
  width: 24px;
  height: 24px;
  margin-left: -4px;
  transform: translateY(-10px);
}

.xplore-peak-marker__star svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: #fff;
  stroke: rgba(0, 0, 0, 0.72);
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.xplore-peak-marker--highest .xplore-peak-marker__mountain {
  display: block;
  width: 30px;
  height: 30px;
  margin-left: 3px;
  transform: translateY(-10px);
}

.xplore-peak-marker__mountain svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.xplore-peak-marker__mountain-bg {
  fill: #ff3f55;
  stroke: rgba(255, 255, 255, 0.84);
  stroke-width: 2.6;
}

.xplore-peak-marker__mountain-shape,
.xplore-peak-marker__mountain-star {
  fill: #fff;
}

.xplore-peak-marker__mountain-cut {
  fill: #ff3f55;
}

.xplore-peak-marker__mountain-star {
  stroke: rgba(0, 0, 0, 0.55);
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.xplore-peak-marker__leader {
  display: block;
  width: 1px;
  height: 38px;
  margin-top: -1px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.xplore-peak-marker__dot {
  display: block;
  width: 7px;
  height: 7px;
  margin-top: -1px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: rgba(22, 28, 32, 0.92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.38);
}

/* Optional panoramic peak style. Georgia is deliberately system-local: it is
   close to the reference's editorial serif without adding a font download to
   the map startup or offline bundles. */
.xplore-peak-marker--panoramic .xplore-peak-marker__body {
  bottom: -1px;
}

.xplore-peak-marker--panoramic .xplore-peak-marker__row {
  filter: none;
}

.xplore-peak-marker--panoramic .xplore-peak-marker__badge {
  flex-direction: column;
  align-items: center;
  height: auto;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f7f6ec;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  text-shadow:
    -1px -1px 0 rgba(27, 31, 29, 0.9),
    1px -1px 0 rgba(27, 31, 29, 0.9),
    -1px 1px 0 rgba(27, 31, 29, 0.9),
    1px 1px 0 rgba(27, 31, 29, 0.9),
    0 2px 5px rgba(0, 0, 0, 0.72);
  backdrop-filter: none;
}

.xplore-peak-marker--panoramic .xplore-peak-marker__name {
  max-width: 225px;
  padding: 0 6px;
  overflow: hidden;
  font-size: 18px;
  letter-spacing: 0.13em;
  line-height: 1.12;
  text-overflow: ellipsis;
}

.xplore-peak-marker--panoramic .xplore-peak-marker__elevation {
  min-width: 0;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  letter-spacing: 0.035em;
  line-height: 1;
}

.xplore-peak-marker--panoramic .xplore-peak-marker__icon-slot {
  display: flex;
  height: 38px;
}

.xplore-peak-marker--panoramic.xplore-peak-marker--starred .xplore-peak-marker__icon-slot {
  width: 26px;
  margin-left: 7px;
}

.xplore-peak-marker--panoramic.xplore-peak-marker--highest .xplore-peak-marker__icon-slot {
  width: 32px;
  margin-left: 8px;
}

.xplore-peak-marker--panoramic.xplore-peak-marker--starred .xplore-peak-marker__star,
.xplore-peak-marker--panoramic.xplore-peak-marker--highest .xplore-peak-marker__mountain {
  margin-left: 0;
  transform: translateY(-8px);
}

.xplore-peak-marker--panoramic.xplore-peak-marker--starred .xplore-peak-marker__name {
  font-size: 20px;
}

.xplore-peak-marker--panoramic.xplore-peak-marker--starred .xplore-peak-marker__elevation {
  font-size: 14px;
}

.xplore-peak-marker--panoramic.xplore-peak-marker--highest .xplore-peak-marker__name {
  font-size: 21px;
}

.xplore-peak-marker--panoramic.xplore-peak-marker--highest .xplore-peak-marker__elevation {
  font-size: 15px;
}

.xplore-peak-marker--panoramic .xplore-peak-marker__leader {
  width: 2px;
  height: 50px;
  margin-top: 5px;
  background: rgba(249, 250, 242, 0.82);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.72);
}

.xplore-peak-marker--panoramic .xplore-peak-marker__dot {
  display: none;
}

@media (max-width: 720px) {
  .xplore-peak-marker__badge {
    height: 27px;
    font-size: 12px;
    line-height: 27px;
  }

  .xplore-peak-marker__name {
    max-width: 132px;
    padding-inline: 9px;
  }

  .xplore-peak-marker__elevation {
    min-width: 54px;
    padding-inline: 8px;
  }

  .xplore-peak-marker__leader {
    height: 36px;
  }

  .xplore-peak-marker--panoramic .xplore-peak-marker__name {
    max-width: 176px;
    padding-inline: 5px;
    font-size: 16px;
  }

  .xplore-peak-marker--panoramic .xplore-peak-marker__elevation {
    min-width: 0;
    padding-inline: 0;
    font-size: 12px;
  }

  .xplore-peak-marker--panoramic.xplore-peak-marker--starred .xplore-peak-marker__name {
    font-size: 17.5px;
  }

  .xplore-peak-marker--panoramic.xplore-peak-marker--starred .xplore-peak-marker__elevation {
    font-size: 13px;
  }

  .xplore-peak-marker--panoramic.xplore-peak-marker--highest .xplore-peak-marker__name {
    font-size: 19px;
  }

  .xplore-peak-marker--panoramic.xplore-peak-marker--highest .xplore-peak-marker__elevation {
    font-size: 14px;
  }

  .xplore-peak-marker--panoramic .xplore-peak-marker__leader {
    height: 44px;
  }
}

/* Wikimedia Photo Hover Morph Bubble */
.wikimedia-photo-hover-popup {
  z-index: 99999;
}

.wikimedia-photo-hover-popup .maplibregl-popup-content {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border: none;
}

.wikimedia-photo-hover-popup .maplibregl-popup-tip {
  display: none;
}

.photo-hover-bubble {
  position: relative;
  width: var(--initial-width, 56px);
  height: var(--initial-height, 56px);
  border-radius: var(--initial-radius, 28px);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.95);
  background: #2a2a2a;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  pointer-events: auto;
  cursor: pointer;
}

.photo-hover-bubble.expanded {
  width: var(--expanded-width, 240px);
  height: var(--expanded-height, 180px);
  border-radius: 12px;
  border-width: 2px;
}

.photo-hover-bubble__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-hover-bubble__loader {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wikimedia-spin 1s linear infinite;
}

.photo-hover-bubble__count-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

@keyframes wikimedia-spin {
  to {
    transform: rotate(360deg);
  }
}
