/* ========================================
   GreenLanes — Design System & Styles
   V2 — With sidebar, hotspots, length filters
   ======================================== */

:root {
  /* Colors */
  --bg-primary: #080d0b;
  --bg-secondary: #101815;
  --bg-tertiary: #17221d;
  --bg-glass: rgba(13, 20, 17, 0.82);
  --bg-glass-light: rgba(22, 32, 27, 0.88);
  --surface: #1c2b25;
  --surface-hover: #24362e;
  --border: rgba(134, 239, 172, 0.12);
  --border-strong: rgba(134, 239, 172, 0.28);

  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  --accent: #4ade80;
  --accent-glow: rgba(74, 222, 128, 0.25);
  --accent-soft: rgba(74, 222, 128, 0.1);
  --accent-secondary: #2dd4bf;
  --accent-warm: #fbbf24;

  --text-primary: #f0fdf4;
  --text-secondary: #a7c4b8;
  --text-muted: #6b8f7e;
  --text-accent: #4ade80;

  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Safe areas (iPhone notch / Dynamic Island / home indicator) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Sizing */
  --header-height: 64px;
  --info-bar-height: 44px;
  --panel-width: 360px;
  --sidebar-width: 380px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md: 0 2px 6px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4), 0 16px 48px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --grad-primary: linear-gradient(135deg, var(--green-600), var(--green-500));

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none; /* stop iOS rubber-band scroll fighting the map */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, button, select {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation; /* kills the 300ms tap delay + double-tap zoom */
}

a {
  touch-action: manipulation;
}

/* ========== Loading Overlay ========== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.loading-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ========== App Container ========== */
.app {
  position: relative;
  height: 100%;
  width: 100%;
}

/* Dynamic viewport unit where supported — fixes iOS Safari/PWA where
   100% can end up taller or shorter than the actual visible area */
@supports (height: 100dvh) {
  html, body, .app {
    height: 100dvh;
  }
}

/* ========== Top Bar ========== */
.top-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: var(--transition-normal);
}

.top-bar-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-toggle {
  display: flex;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.top-bar-center {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 42px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm);
  background: var(--surface);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.search-clear:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.search-clear svg {
  width: 16px;
  height: 16px;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-glass-light);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}

.search-results.hidden {
  display: none;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 1px solid var(--border);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--accent-soft);
}

.search-result-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.search-result-icon svg {
  width: 18px;
  height: 18px;
}

.search-result-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.search-result-text p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.search-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Top Bar Right */
.top-bar-right {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.toolbar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
}

.toolbar-btn svg {
  width: 20px;
  height: 20px;
}

.toolbar-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.toolbar-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* Live-tracking state on the locate button — gentle pulse */
.toolbar-btn.tracking {
  animation: trackingPulse 2s ease-in-out infinite;
}

@keyframes trackingPulse {
  0%, 100% { box-shadow: inset 0 0 0 1px var(--border-strong), 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: inset 0 0 0 1px var(--border-strong), 0 0 12px 2px var(--accent-glow); }
}


/* =============================================
   FLOATING SIDEBAR FAB
   ============================================= */
.sidebar-fab {
  position: absolute;
  top: calc(var(--header-height) + 48px);
  left: 16px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  cursor: pointer;
  transition: left var(--transition-normal), background var(--transition-fast), transform var(--transition-fast);
}

.sidebar-fab svg {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

/* When sidebar is open, move FAB to edge of sidebar */
.sidebar-fab.sidebar-open {
  left: calc(var(--sidebar-width) + 20px);
}

.sidebar-fab.sidebar-open .fab-icon-open {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.sidebar-fab.sidebar-open .fab-icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.sidebar-fab:not(.sidebar-open) .fab-icon-open {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.sidebar-fab:not(.sidebar-open) .fab-icon-close {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.sidebar-fab:hover {
  background: var(--surface-hover);
  transform: scale(1.08);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.sidebar-fab:active {
  transform: scale(0.95);
}


/* =============================================
   LEFT SIDEBAR — Byway Results List
   ============================================= */
.left-sidebar {
  position: absolute;
  top: calc(var(--header-height) + 40px);
  left: 16px;
  bottom: calc(var(--info-bar-height) + 24px);
  width: var(--sidebar-width);
  z-index: 999;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-normal), opacity var(--transition-normal), width var(--transition-normal);
}

.left-sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-width) - 20px));
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-title-row h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-title-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-close-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.sidebar-close-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-close-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.sidebar-count {
  background: var(--grad-primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  min-width: 28px;
  text-align: center;
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sort-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sort-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.sort-select {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.sort-select:focus {
  border-color: var(--accent);
}

/* Length filter pills */
.length-filter-pills {
  display: flex;
  gap: 6px;
}

.pill {
  flex: 1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  transition: var(--transition-fast);
  cursor: pointer;
  line-height: 1.3;
}

.pill small {
  display: block;
  font-weight: 400;
  font-size: 10px;
  opacity: 0.7;
}

.pill:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Sidebar results list */
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}

.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 26px;
  text-align: center;
  gap: 12px;
  color: var(--text-muted);
}

.sidebar-empty > svg,
.sidebar-empty > i {
  padding: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-sizing: content-box;
}

.sidebar-empty h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-empty p {
  font-size: 13px;
  line-height: 1.5;
}

/* Individual byway card in sidebar — floating rounded cards */
.byway-card {
  margin: 8px 10px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.byway-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.85;
}

.byway-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.byway-card.active {
  background: rgba(74, 222, 128, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}

.sidebar-list {
  padding: 2px 0 10px;
}

.byway-card-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent-warm);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

/* Detail panel warning banner */
.detail-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent-warm);
  font-size: 13px;
  line-height: 1.4;
}

.detail-warning svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.detail-warning strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
}

.detail-warning p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.byway-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.byway-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.3;
}

.byway-card-type {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.byway-card-type.boat {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green-400);
}

.byway-card-type.ucr {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.byway-card-type.greenLane {
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent-secondary);
}

.byway-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.byway-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.byway-card-meta-item svg {
  width: 13px;
  height: 13px;
}

.byway-card-difficulty {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 2px;
}

.byway-card-difficulty.easy { background: var(--green-400); }
.byway-card-difficulty.moderate { background: var(--accent-warm); }
.byway-card-difficulty.challenging { background: var(--danger); }

.byway-card-surface {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.byway-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.byway-card-btn {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.byway-card-btn svg {
  width: 12px;
  height: 12px;
}

.byway-card-btn.nav-btn {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
}

.byway-card-btn.nav-btn:hover {
  opacity: 0.9;
}

.byway-card-btn.sv-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.byway-card-btn.sv-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.byway-card-btn.share-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.byway-card-btn.share-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ========== Side Panels ========== */
.side-panel {
  position: absolute;
  top: calc(var(--header-height) + 40px);
  right: 16px;
  width: var(--panel-width);
  max-height: calc(100vh - var(--header-height) - var(--info-bar-height) - 80px);
  z-index: 999;
  background: var(--bg-glass);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.04);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
  transform: translateX(0);
  opacity: 1;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.side-panel.hidden {
  transform: translateX(20px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  z-index: 1;
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.panel-close svg {
  width: 18px;
  height: 18px;
}

.panel-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.panel-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-section:last-child {
  border-bottom: none;
}

.panel-section h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ========== Layer Picker ========== */
.layer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 16px 20px;
}

.layer-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: var(--transition-fast);
  cursor: pointer;
}

.layer-option:hover {
  background: var(--surface-hover);
}

.layer-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.layer-option span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.layer-option.active span {
  color: var(--accent);
}

.layer-preview {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.layer-preview {
  position: relative;
}

.layer-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 42%, rgba(74, 222, 128, 0.85) 42%, rgba(74, 222, 128, 0.85) 48%, transparent 48%),
    linear-gradient(25deg, transparent 62%, rgba(255,255,255,0.25) 62%, rgba(255,255,255,0.25) 66%, transparent 66%);
}

.layer-preview-standard {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%);
}

.layer-preview-satellite {
  background: linear-gradient(135deg, #1a3a1a 0%, #2d5a2d 50%, #1e4d2b 100%);
}

.layer-preview-terrain {
  background: linear-gradient(135deg, #d7ccc8 0%, #a1887f 30%, #6d4c41 60%, #4e342e 100%);
}

.layer-preview-dark {
  background: linear-gradient(135deg, #10141c 0%, #131a26 50%, #0d1b2e 100%);
}

/* ========== Toggle Switches ========== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.toggle-row input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--surface);
  border-radius: 12px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-row input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-row input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: white;
}

/* ========== Checkboxes & Radios ========== */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"] {
  display: none;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  flex-shrink: 0;
  position: relative;
  transition: var(--transition-fast);
}

.checkbox-row input:checked + .custom-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-row input:checked + .custom-checkbox::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: var(--transition-fast);
}

.checkbox-row input:checked + .custom-radio {
  border-color: var(--accent);
}

.checkbox-row input:checked + .custom-radio::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* Difficulty Badges */
.difficulty-badge {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.difficulty-badge.easy {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green-400);
}

.difficulty-badge.moderate {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-warm);
}

.difficulty-badge.challenging {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Range Slider */
.range-container {
  padding: 4px 0;
}

.range-container input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface);
  border-radius: 3px;
  outline: none;
}

.range-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.range-value {
  color: var(--accent);
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  margin: 16px 20px;
  width: calc(100% - 40px);
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ========== Hotspots Panel ========== */
.hotspots-list {
  padding: 8px 0;
}

.hotspot-card {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.hotspot-card:last-child {
  border-bottom: none;
}

.hotspot-card:hover {
  background: var(--accent-soft);
}

.hotspot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.hotspot-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-warm), #f97316);
  color: #1a1205;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hotspot-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.hotspot-region {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.hotspot-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.hotspot-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.hotspot-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hotspot-stat svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.hotspot-btn {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.hotspot-btn:hover {
  opacity: 0.9;
}

.hotspot-btn svg {
  width: 13px;
  height: 13px;
}

/* ========== Detail Panel ========== */
.detail-content {
  padding: 16px 20px;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.detail-row-icon svg {
  width: 18px;
  height: 18px;
}

.detail-row-content {
  flex: 1;
}

.detail-row-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.detail-row-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.detail-tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-action-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.detail-action-btn svg {
  width: 16px;
  height: 16px;
}

.detail-action-btn.primary {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
}

.detail-action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.detail-action-btn.secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.detail-action-btn.secondary:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ========== Detail Section Titles ========== */
.detail-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.detail-section-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* ========== Weather Widget ========== */
.detail-weather-widget {
  margin-bottom: 4px;
}

.weather-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 0;
}

.weather-error {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.weather-emoji {
  font-size: 32px;
  line-height: 1;
}

.weather-temp {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.weather-desc {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.weather-details {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.weather-detail {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.weather-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--accent-warm);
  font-size: 12px;
  font-weight: 500;
}

/* ========== Elevation Profile ========== */
.detail-elevation-wrap {
  margin-bottom: 4px;
}

.elevation-stats {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.elev-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.elev-stat strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.elev-stat small {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.elevation-canvas {
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ========== Save Offline Button ========== */
.offline-btn {
  width: 100%;
  padding: 12px 16px;
  margin-top: 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.offline-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.offline-btn svg {
  width: 16px;
  height: 16px;
}

.offline-btn.saving {
  opacity: 0.7;
  pointer-events: none;
}

.offline-progress {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--surface);
  margin-top: 8px;
  overflow: hidden;
}

.offline-progress-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transition: width 0.3s ease;
}

/* ========== Street View Panel ========== */
.streetview-panel {
  position: absolute;
  bottom: calc(var(--info-bar-height) + 24px);
  left: calc(var(--sidebar-width) + 32px);
  right: 16px;
  height: 320px;
  z-index: 998;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.streetview-panel.hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.streetview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.streetview-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.streetview-header h3 svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.streetview-container {
  flex: 1;
  position: relative;
}

.streetview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.streetview-hint {
  font-size: 11px;
  opacity: 0.5;
}

.streetview-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.streetview-iframe.hidden {
  display: none;
}

/* ========== Map Container ========== */
.map-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Leaflet overrides */
.leaflet-control-zoom,
.leaflet-control-attribution {
  display: none !important;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-glass-light) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  color: var(--text-primary) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.leaflet-popup-tip {
  background: var(--bg-glass-light) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.leaflet-popup-close-button {
  color: var(--text-muted) !important;
  font-size: 20px !important;
  padding: 4px 8px !important;
}

.leaflet-popup-close-button:hover {
  color: var(--text-primary) !important;
}

/* Custom popup styles */
.popup-content {
  padding: 14px 16px;
}

.popup-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.popup-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.popup-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.popup-tag {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.popup-tag.boat {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green-400);
}

.popup-tag.ucr {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.popup-tag.green-lane {
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent-secondary);
}

.popup-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.popup-btn:hover {
  opacity: 0.9;
}

/* User location marker pulse */
.user-location-pulse {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid white;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ========== Info Bar ========== */
.info-bar {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  height: var(--info-bar-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
}

.info-bar-left,
.info-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.info-badge svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.info-coords {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-weight: 400;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.zoom-btn svg {
  width: 16px;
  height: 16px;
}

.zoom-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ========== Toast Notifications ========== */
.toast-container {
  position: absolute;
  top: calc(var(--header-height) + 40px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: 12px 20px;
  background: var(--bg-glass-light);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease-spring);
}

.toast.toast-exit {
  animation: toastOut 0.25s var(--ease-out) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--info); }
.toast.warning .toast-icon { color: var(--warning); }

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .left-sidebar {
    width: 320px;
    --sidebar-width: 320px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 52px;
    --info-bar-height: 40px;
    --sidebar-width: 100vw;
  }

  /* ---- Top Bar ---- */
  .top-bar {
    top: 0;
    left: 0;
    right: 0;
    /* Extend behind the Dynamic Island / notch, keep content below it */
    padding: var(--safe-top) calc(10px + var(--safe-right)) 0 calc(10px + var(--safe-left));
    height: calc(var(--header-height) + var(--safe-top));
    gap: 6px;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
  }

  .top-bar-left {
    gap: 6px;
  }

  .logo-icon {
    width: 26px;
    height: 26px;
  }

  .logo-text {
    display: none;
  }

  .top-bar-center {
    flex: 1;
    max-width: none;
    margin: 0;
  }

  .search-input {
    height: 40px;
    font-size: 16px; /* <16px makes iOS Safari zoom the whole page on focus */
    padding: 0 34px 0 36px;
    border-radius: var(--radius-full);
  }

  .search-icon {
    left: 10px;
    width: 16px;
    height: 16px;
  }

  .search-results {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-top));
    left: 0;
    right: 0;
    border-radius: 0;
    max-height: 60vh;
    z-index: 1100;
  }

  /* Hide less important toolbar buttons on mobile — show only locate + layers + filter */
  .top-bar-right {
    gap: 4px;
  }

  .toolbar-btn {
    width: 42px;
    height: 42px; /* comfortable thumb target (Apple HIG minimum is 44pt) */
  }

  .toolbar-btn svg {
    width: 20px;
    height: 20px;
  }

  /* Hide street view on very small screens (Best Byways stays visible) */
  #btn-streetview {
    display: none;
  }

  /* ---- Left Sidebar ---- */
  .left-sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--header-height) + var(--safe-top));
    bottom: 0;
    padding-bottom: var(--safe-bottom);
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    z-index: 1001;
  }

  .left-sidebar.collapsed {
    transform: translateY(100%);
    opacity: 1; /* keep opacity so animation looks like slide */
  }

  .sidebar-header {
    padding: 12px 14px;
  }

  .sidebar-title-row h2 {
    font-size: 16px;
  }

  .length-filter-pills {
    gap: 4px;
  }

  .pill {
    padding: 8px 6px;
    font-size: 11px;
  }

  .pill small {
    font-size: 9px;
  }

  .sort-select {
    font-size: 16px; /* prevents iOS focus zoom */
    padding: 8px 10px 8px 30px;
  }

  /* Byway cards — smaller on mobile */
  .byway-card {
    padding: 12px 14px;
  }

  .byway-card-name {
    font-size: 13px;
  }

  .byway-card-meta {
    font-size: 11px;
    gap: 8px;
  }

  .byway-card-actions {
    gap: 4px;
  }

  .byway-card-btn {
    padding: 10px 10px;
    font-size: 12px;
    justify-content: center;
    flex: 1;
  }

  /* ---- Sidebar FAB ---- */
  .sidebar-fab {
    top: auto;
    bottom: calc(var(--info-bar-height) + var(--safe-bottom) + 16px);
    left: calc(12px + var(--safe-left));
    width: 48px;
    height: 48px;
    z-index: 1002;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
  }

  .sidebar-fab.sidebar-open {
    left: calc(12px + var(--safe-left));
    bottom: calc(var(--info-bar-height) + var(--safe-bottom) + 16px);
  }

  /* ---- Side Panels ---- */
  .side-panel {
    position: fixed;
    right: 0;
    left: 0;
    top: calc(var(--header-height) + var(--safe-top));
    bottom: 0;
    padding-bottom: var(--safe-bottom);
    width: 100%;
    border-radius: 0;
    max-height: none;
    z-index: 1003;
  }

  /* ---- Info Bar ---- */
  .info-bar {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    /* Extend behind the home indicator, keep content above it */
    height: calc(var(--info-bar-height) + var(--safe-bottom));
    padding: 0 calc(12px + var(--safe-right)) var(--safe-bottom) calc(12px + var(--safe-left));
  }

  .info-coords {
    display: none;
  }

  .info-badge {
    font-size: 12px;
  }

  .zoom-btn {
    width: 38px;
    height: 38px;
  }

  .zoom-btn svg {
    width: 18px;
    height: 18px;
  }

  /* ---- Street View ---- */
  .streetview-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--info-bar-height) + var(--safe-bottom));
    height: 200px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  /* ---- Toast ---- */
  .toast-container {
    top: calc(var(--header-height) + var(--safe-top) + 8px);
    left: 12px;
    right: 12px;
    transform: none;
  }

  .toast {
    min-width: 0;
    width: 100%;
    font-size: 12px;
    padding: 10px 14px;
  }

  /* ---- Nav Directions Modal ---- */
  .nav-modal {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
  }
}

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-hover);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========== Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
  animation: fadeIn 0.3s var(--ease-out);
}

.animate-slideUp {
  animation: slideUp 0.3s var(--ease-out);
}

.btn-retry {
  margin-top: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.btn-retry:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Sidebar loading state */
.sidebar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 12px;
}

.sidebar-loading .loading-spinner {
  width: 32px;
  height: 32px;
}

.sidebar-loading p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ========== Navigation Directions Modal ========== */
.nav-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease-out);
}

.nav-modal {
  width: 340px;
  background: var(--bg-glass-light);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp 0.25s var(--ease-out);
}

.nav-modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-modal-header h3 svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.nav-modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  transition: var(--transition-fast);
}

.nav-modal-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ========== Search This Area Button ========== */
.search-area-btn {
  position: absolute;
  bottom: calc(var(--info-bar-height) + 24px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 998;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.search-area-btn:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 28px var(--accent-glow);
}

.search-area-btn.hidden {
  display: none;
}

.search-area-btn svg {
  width: 16px;
  height: 16px;
}

/* ========== Drive Mode HUD ========== */
.nav-hud {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(var(--info-bar-height) + 24px);
  max-width: 400px;
  margin: 0 auto;
  z-index: 1005;
  background: var(--bg-glass-light);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  padding: 14px 16px;
}

.nav-hud.hidden {
  display: none;
}

.nav-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

#nav-hud-name {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-exit-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.nav-exit-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.nav-exit-btn svg {
  width: 13px;
  height: 13px;
}

.nav-hud-main {
  display: flex;
  gap: 22px;
  margin-bottom: 10px;
}

.nav-hud-stat span {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.nav-hud-stat.big span {
  font-size: 26px;
  color: var(--accent);
}

.nav-hud-stat small {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.nav-progress-track {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

#nav-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
}

.nav-hud-status {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.nav-hud-status.warn {
  color: var(--accent-warm);
  font-weight: 600;
}

.nav-hud-actions button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.nav-hud-actions button:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.nav-hud-actions button svg {
  width: 15px;
  height: 15px;
}

/* ========== Drive button on byway cards ========== */
.byway-card-btn.drive-btn {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
  border-color: transparent;
  font-weight: 700;
}

.byway-card-btn.drive-btn:hover {
  filter: brightness(1.1);
}

/* ========== Simplified filter panel ========== */
.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.toggle-text small {
  font-size: 11px;
  color: var(--text-muted);
}

.adv-filters {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 4px;
}

.adv-filters summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.adv-filters summary::before {
  content: '▸';
  transition: transform 0.2s;
}

.adv-filters[open] summary::before {
  transform: rotate(90deg);
}

.adv-filters summary:hover {
  color: var(--text-primary);
}

/* ========== Mobile adjustments for new widgets ========== */
@media (max-width: 768px) {
  .search-area-btn {
    bottom: calc(var(--info-bar-height) + var(--safe-bottom) + 18px);
    padding: 12px 20px;
    font-size: 13px;
  }

  .nav-hud {
    left: 10px;
    right: 10px;
    bottom: calc(var(--info-bar-height) + var(--safe-bottom) + 12px);
    max-width: none;
    padding: 12px 14px;
  }

  .nav-hud-stat.big span {
    font-size: 22px;
  }
}

/* ========== Directions Modal (redesigned) ========== */
.nav-modal {
  width: 360px;
  max-width: calc(100vw - 24px);
}

.nav-modal-body {
  padding: 14px;
}

.nav-inapp {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  border-radius: var(--radius-md);
  color: white;
  text-align: left;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.nav-inapp:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.nav-inapp-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-inapp-icon svg {
  width: 22px;
  height: 22px;
}

.nav-inapp-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-inapp-text strong {
  font-size: 14px;
  font-weight: 700;
}

.nav-inapp-text small {
  font-size: 11px;
  opacity: 0.85;
  line-height: 1.35;
}

.nav-inapp-chev {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-divider::before,
.nav-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.nav-apps {
  display: flex;
  gap: 10px;
}

.nav-app {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: var(--transition-fast);
}

.nav-app:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.nav-app-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.nav-app-icon svg {
  width: 20px;
  height: 20px;
}

.nav-app-icon.google { background: linear-gradient(135deg, #4285F4, #34A853); }
.nav-app-icon.apple { background: linear-gradient(135deg, #555, #2c2c2e); }
.nav-app-icon.waze { background: linear-gradient(135deg, #33ccff, #0099cc); }

/* Bottom-sheet style on phones */
@media (max-width: 768px) {
  .nav-modal-overlay {
    align-items: flex-end;
  }

  .nav-modal {
    width: 100%;
    max-width: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    padding-bottom: var(--safe-bottom);
    animation: sheetUp 0.28s var(--ease-out);
  }
}

@keyframes sheetUp {
  from { transform: translateY(40%); opacity: 0.5; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========== Turn-by-turn instruction line ========== */
.nav-instruction {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  margin-bottom: 10px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: #93c5fd;
}

.nav-instruction.hidden {
  display: none;
}

/* ========== Dropped pin ========== */
.dropped-pin {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  animation: pinDrop 0.3s var(--ease-spring);
}

@keyframes pinDrop {
  from { transform: translateY(-14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========== Apple Maps-style Navigation UI ========== */

/* Hide normal chrome while navigating — nav takes over the screen */
.app.navigating .top-bar,
.app.navigating .sidebar-fab,
.app.navigating .info-bar,
.app.navigating .left-sidebar {
  display: none !important;
}

/* Top turn banner */
.nav-banner {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  left: 12px;
  right: 12px;
  max-width: 430px;
  margin: 0 auto;
  z-index: 1006;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: white;
}

.nav-banner.hidden {
  display: none;
}

.nav-banner.warn {
  background: linear-gradient(135deg, #b45309, #d97706);
}

.nav-banner-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-banner-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 2.4;
}

.nav-banner-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.nav-banner-dist {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.nav-banner-dist:empty {
  display: none;
}

.nav-banner-instr {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.95;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Overview / re-centre toggle */
.nav-overview-btn {
  position: absolute;
  right: 12px;
  bottom: calc(var(--info-bar-height) + var(--safe-bottom) + 140px);
  z-index: 1006;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-glass-light);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.nav-overview-btn.hidden {
  display: none;
}

.nav-overview-btn:hover {
  background: var(--surface-hover);
}

.nav-overview-btn svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

/* Bottom ETA card (replaces old HUD layout) */
.nav-hud {
  padding: 0;
  overflow: hidden;
}

.nav-hud .nav-progress-track {
  margin-bottom: 0;
  border-radius: 0;
  height: 4px;
}

.nav-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
}

.nav-hud-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.nav-eta {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.nav-hud-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.nav-hud-name {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-hud-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-mini-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.nav-mini-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.nav-mini-btn svg {
  width: 18px;
  height: 18px;
}

.nav-end-btn {
  padding: 12px 22px;
  border-radius: var(--radius-full);
  background: #dc2626;
  color: white;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.nav-end-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .nav-banner {
    left: 8px;
    right: 8px;
    max-width: none;
    padding: 14px 16px;
  }

  .nav-banner-icon svg {
    width: 34px;
    height: 34px;
  }

  .nav-banner-dist {
    font-size: 21px;
  }

  .nav-overview-btn {
    bottom: calc(var(--safe-bottom) + 120px);
  }

  .nav-hud {
    bottom: calc(var(--safe-bottom) + 10px);
  }
}

/* Voice guidance mute state */
.nav-mini-btn.muted {
  color: var(--text-muted);
  opacity: 0.55;
}

/* ========== MapLibre overrides (dark theme) ========== */
.maplibregl-popup-content {
  background: var(--bg-glass-light);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  padding: 14px;
  font-family: 'Inter', sans-serif;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--bg-glass-light); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--bg-glass-light); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--bg-glass-light); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--bg-glass-light); }

.maplibregl-popup-close-button {
  color: var(--text-muted);
  font-size: 18px;
  padding: 2px 8px;
  right: 2px;
  top: 2px;
  border-radius: var(--radius-sm);
}

.maplibregl-popup-close-button:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.maplibregl-ctrl-attrib {
  background: rgba(10, 15, 13, 0.7) !important;
  color: var(--text-muted);
  font-size: 10px;
  border-radius: 6px 0 0 0;
}

.maplibregl-ctrl-attrib a {
  color: var(--text-secondary);
}

/* Compass reset button */
#btn-compass svg {
  color: var(--accent);
}

/* ========== Mobile bottom sheets ========== */
.sheet-handle {
  display: none;
}

@media (max-width: 768px) {
  .sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 0 6px;
    flex-shrink: 0;
    background: none;
  }

  .sheet-handle {
    padding: 12px 0 8px;
  }

  .sheet-handle span {
    width: 48px;
    height: 5px;
    border-radius: 3px;
    background: var(--border-strong);
  }

  /* Byway list opens half-height — map stays visible above */
  .left-sidebar {
    top: 48%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-top: 1px solid var(--border-strong);
    transition: top 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  }

  .left-sidebar.expanded {
    top: calc(var(--header-height) + var(--safe-top));
  }

  /* Panels too (layers / filters / hotspots / detail) */
  .side-panel {
    top: 42% !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-top: 1px solid var(--border-strong);
    transition: top 0.3s var(--ease-out);
  }

  .side-panel.expanded {
    top: calc(var(--header-height) + var(--safe-top)) !important;
  }

  /* Bigger, easier touch targets */
  .byway-card-btn {
    padding: 10px 10px;
    font-size: 12px;
  }

  .byway-card-btn.drive-btn {
    flex: 1.3;
    font-size: 13px;
  }

  .byway-card {
    padding: 14px;
  }

  .toggle-row,
  .checkbox-row {
    padding: 12px 0;
  }

  .detail-actions {
    flex-wrap: wrap;
  }

  .detail-action-btn {
    padding: 13px 8px;
    min-width: calc(50% - 4px);
  }

  /* Text inputs never below 16px on phones (iOS zoom) */
  .lane-note {
    font-size: 16px;
  }

  .panel-close {
    width: 40px;
    height: 40px;
  }
}

/* Mud risk line in the weather widget */
.weather-mud {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== Favourites, driven log, notes, hazards ========== */
.fav-btn {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0.5;
  padding: 2px 4px;
  transition: var(--transition-fast);
}

.fav-btn:hover {
  opacity: 1;
}

.fav-btn.active {
  color: var(--accent-warm);
  opacity: 1;
}

.pill-star {
  color: var(--accent-warm);
}

.pill-star.active {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

.my-stats {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.my-stats:empty {
  display: none;
}

.detail-action-btn.secondary.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.byway-card-hazards {
  margin-top: 6px;
  font-size: 11px;
  color: var(--accent-warm);
}

.lane-note {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
}

.lane-note:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.lane-note::placeholder {
  color: var(--text-muted);
}

/* Steepness legend under the elevation chart */
.steepness-legend {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
