/* ── Layout ── */
.routes-body {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.routes-body .logo {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #a3e635;
}

.planner-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
.planner-sidebar {
  width: 320px;
  min-width: 320px;
  background: #f8faf5;
  border-right: 1px solid #e2e8da;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 10;
}

/* ── Quick start hero ── */
/* ✨ AI planner */
.ai-planner {
  padding: 18px 20px;
  background: linear-gradient(135deg, #143d2e 0%, #1e4d14 55%, #3a2d6b 100%);
  color: #fff;
  border-bottom: 1px solid #e2e8da;
}
.ai-planner-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ai-planner-spark { font-size: 1.4rem; line-height: 1; }
.ai-planner-title { font-size: 0.98rem; font-weight: 800; letter-spacing: 0.2px; }
.ai-planner-sub { font-size: 0.78rem; opacity: 0.85; margin: 2px 0 0; }

.ai-input-row { display: flex; gap: 8px; }
.ai-input {
  flex: 1;
  padding: 11px 13px;
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}
.ai-input::placeholder { color: rgba(255,255,255,0.6); }
.ai-input:focus { outline: none; border-color: #a3e635; background: rgba(255,255,255,0.18); }
.ai-submit {
  flex: 0 0 auto;
  width: 44px;
  border: none;
  border-radius: 10px;
  background: #a3e635;
  color: #1a2e12;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.ai-submit:hover { background: #b6f04a; transform: translateY(-1px); }
.ai-submit:disabled { opacity: 0.65; cursor: progress; transform: none; }
.ai-submit.loading { color: transparent; position: relative; }
.ai-submit.loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(26,46,18,0.35); border-top-color: #1a2e12;
  animation: ai-spin 0.7s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-chip {
  padding: 6px 11px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ai-chip:hover { background: rgba(255,255,255,0.22); }

.ai-feedback {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}
.ai-feedback-loading { background: rgba(255,255,255,0.14); color: #fff; }
.ai-feedback-ok { background: rgba(163,230,53,0.22); color: #eaffd0; }
.ai-feedback-error { background: rgba(248,113,113,0.2); color: #ffe2e2; }
.ai-feedback-info { background: rgba(96,165,250,0.2); color: #e3effe; }

.quick-start {
  padding: 18px 20px;
  background: linear-gradient(135deg, #1e4d14, #2d6b1f);
  color: #fff;
  border-bottom: 1px solid #e2e8da;
}

.qs-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

.qs-distance-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.qs-chip {
  flex: 1;
  padding: 8px 4px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.qs-chip:hover { background: rgba(255,255,255,0.20); }
.qs-chip.active {
  background: #a3e635;
  border-color: #a3e635;
  color: #1a2e12;
}

.btn-quick-loop {
  width: 100%;
  padding: 13px;
  background: #a3e635;
  color: #1a2e12;
  border: none;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s, background 0.15s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.btn-quick-loop:hover { background: #b6f04a; transform: translateY(-1px); }
.btn-quick-loop:disabled { opacity: 0.7; cursor: progress; transform: none; }

.qs-customize {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.qs-customize:hover { color: #fff; }

/* ── Steps ── */
.step {
  padding: 20px;
  border-bottom: 1px solid #e2e8da;
  transition: opacity 0.2s;
}

/* ── Collapsible step (Préférences) ── */
.step.collapsible .step-header { cursor: pointer; user-select: none; }
.step-collapse-chevron {
  margin-left: auto;
  font-size: 0.85rem;
  color: #6b7280;
  transition: transform 0.2s;
}
.step.collapsible:not(.collapsed) .step-collapse-chevron { transform: rotate(180deg); }
.step.collapsible.collapsed .step2-body { display: none; }
.step.collapsible.collapsed .step-header { margin-bottom: 0; }

.step.locked {
  opacity: 0.4;
  pointer-events: none;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.step-number {
  width: 26px;
  height: 26px;
  background: #1e4d14;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.step-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a2e12;
}

/* ── Mode cards ── */
.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 2px solid #e2e8da;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
  width: 100%;
}

.mode-card:hover { border-color: #1e4d14; background: #f0f7ec; }

.mode-card.active {
  border-color: #1e4d14;
  background: #f0f7ec;
  box-shadow: 0 0 0 3px rgba(30,77,20,0.12);
}

.mode-icon { font-size: 1.4rem; }

.mode-card strong {
  display: block;
  font-size: 0.95rem;
  color: #1a2e12;
}

.mode-card small {
  color: #6b7280;
  font-size: 0.78rem;
}

/* ── Option groups ── */
.option-group {
  margin-bottom: 16px;
}

.option-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b7280;
  margin-bottom: 8px;
}

/* ── Path type 4-button grid ── */
.pathtype-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pathtype-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 2px solid #e2e8da;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 1.3rem;
  color: #374151;
  transition: all 0.15s;
}

.pathtype-btn span {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
}

.pathtype-btn.active {
  border-color: #1e4d14;
  background: #f0f7ec;
  box-shadow: 0 0 0 3px rgba(30,77,20,0.1);
}

.pathtype-btn.active span { color: #1e4d14; }
.pathtype-btn:hover:not(.active) { border-color: #9ca3af; }

/* ── Difficulty ── */
.difficulty-group {
  display: flex;
  gap: 6px;
}

.diff-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border: 2px solid #e2e8da;
  border-radius: 8px;
  background: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: #374151;
  transition: all 0.15s;
}

.diff-btn.active { border-color: #1e4d14; background: #f0f7ec; color: #1e4d14; }
.diff-btn:hover:not(.active) { border-color: #9ca3af; }

.diff-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.diff-dot.easy   { background: #22c55e; }
.diff-dot.medium { background: #f97316; }
.diff-dot.hard   { background: #ef4444; }

/* ── Distance input ── */
.distance-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.distance-input {
  width: 100px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  padding: 8px 12px;
}

.distance-unit {
  font-size: 0.95rem;
  font-weight: 700;
  color: #374151;
}

.distance-hint {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 4px;
}

/* ── Step 3 hints ── */
.step-hint {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 10px;
}

.point-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.point-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.point-tag.set { background: #dcfce7; color: #166534; }
.point-tag.waiting { background: #f3f4f6; color: #6b7280; }

/* ── Option section separator ── */
.option-sep {
  border: none;
  border-top: 1px solid #e2e8da;
  margin: 2px 0 16px;
}

/* ── CTA step (Generate) ── */
.step-cta {
  background: #fff;
  border-bottom: none;
  border-top: 2px solid #1e4d14;
  box-shadow: 0 -2px 12px rgba(30,77,20,0.07);
}

/* Only float the CTA once it's actionable (a point has been placed). While
   locked it stays in normal flow, so it can't overlap the quick-start hero
   when the bottom-sheet sidebar is short. */
.step-cta:not(.locked) {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

@media (max-width: 768px) {
  .step-cta:not(.locked) {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
}

.step-cta .step-number {
  background: #22c55e;
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
}

/* ── Generate button ── */
.btn-generate {
  width: 100%;
  padding: 15px;
  background: #1e4d14;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  letter-spacing: 0.2px;
}

.btn-generate:not(:disabled) {
  box-shadow: 0 4px 16px rgba(30,77,20,0.28);
}

.btn-generate:hover:not(:disabled) { background: #2d6b1f; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(30,77,20,0.35); }
.btn-generate:disabled { background: #9ca3af; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-generate.loading { background: #4b7a3c; }

/* ── Results ── */
.route-result {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-stats {
  display: flex;
  gap: 12px;
}

.stat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid #e2e8da;
  border-radius: 10px;
  padding: 12px;
}

.stat-icon { font-size: 1.4rem; }

.stat strong {
  display: block;
  font-size: 1rem;
  color: #1a2e12;
}

.stat small { color: #6b7280; font-size: 0.75rem; }

.result-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge.easy   { background: #dcfce7; color: #166534; }
.badge.medium { background: #ffedd5; color: #9a3412; }
.badge.hard   { background: #fee2e2; color: #991b1b; }
.badge.foot   { background: #e0f2fe; color: #0369a1; }
.badge.bike   { background: #fef9c3; color: #854d0e; }

.route-resume {
  background: #f0f7ec;
  border: 1px solid #c8e6b0;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #1a2e12;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route-resume p { margin: 0; }
.route-resume p:first-child { color: #1e4d14; font-size: 0.9rem; }

.distance-warning {
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #713f12;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ── Map ── */
.planner-layout #map {
  flex: 1;
  min-width: 0;
  z-index: 1;
  position: relative;
}

/* ── Address search ── */
.search-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.search-wrap {
  flex: 1;
  position: relative;
}

.search-input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 8px;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e2e8da;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 100;
  overflow: hidden;
}

.search-results.hidden { display: none; }

.search-item {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.4;
  transition: background 0.12s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #f0f7ec; color: #1e4d14; }

/* ── Locate button ── */
.btn-locate {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 2px solid #e2e8da;
  border-radius: 10px;
  background: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-locate:hover { border-color: #1e4d14; background: #f0f7ec; }

/* ── Elevation chart ── */
.elevation-chart-wrap {
  background: white;
  border: 1px solid #e2e8da;
  border-radius: 10px;
  padding: 12px;
}
.elevation-chart-wrap.hidden { display: none; }

.elevation-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b7280;
  margin-bottom: 8px;
}

#elevationChart svg { display: block; }

/* ── Result actions ── */
.result-actions {
  display: flex;
  gap: 8px;
  /* GPX / KML / Strava share the first row; the wider "Nouveau trajet" button
     wraps to its own full-width row below. Without this the 4 buttons are
     crammed into the 320px sidebar and the long label gets clipped. */
  flex-wrap: wrap;
}
.result-actions .btn-gpx { flex: 1 1 0; min-width: 64px; }
.result-actions .btn-reset { flex: 1 1 100%; }

.btn-gpx {
  flex: 1;
  padding: 10px;
  background: #1e4d14;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-gpx:hover { background: #2d6b1f; }

.btn-reset {
  flex: 1;
  padding: 10px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-reset:hover { background: #e5e7eb; }

/* ── Save / share row ── */
.result-save-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-save-route,
.btn-share-route {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-save-route  { background: #dbeafe; color: #1d4ed8; }
.btn-save-route:hover  { background: #bfdbfe; }
.btn-share-route { background: #ede9fe; color: #6d28d9; }
.btn-share-route:hover { background: #ddd6fe; }
.btn-save-route:disabled,
.btn-share-route:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Route history panel ── */
.route-history {
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f9fafb;
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #e5e7eb;
}
.history-header:hover { background: #f3f4f6; }
.history-chevron { font-size: 0.75rem; transition: transform 0.2s; }
.history-chevron.open { transform: rotate(180deg); }
.history-body { max-height: 320px; overflow-y: auto; }
.history-loading { padding: 16px; text-align: center; color: #6b7280; font-size: 0.85rem; }
.history-empty  { padding: 16px; text-align: center; color: #9ca3af; font-size: 0.85rem; }

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.85rem;
}
.history-item:last-child { border-bottom: none; }
.history-item-info { flex: 1; min-width: 0; }
.history-item-name {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-meta { color: #6b7280; font-size: 0.78rem; margin-top: 1px; }
.history-item-actions { display: flex; gap: 5px; flex-shrink: 0; }
.btn-history-replay {
  padding: 5px 9px;
  background: #1e4d14;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-history-replay:hover { background: #2d6b1f; }
.btn-history-share {
  padding: 5px 9px;
  background: #ede9fe;
  color: #6d28d9;
  border: none;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-history-share:hover { background: #ddd6fe; }
.btn-history-delete {
  padding: 5px 9px;
  background: #fef2f2;
  color: #dc2626;
  border: none;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-history-delete:hover { background: #fee2e2; }

/* ── Toast notification ── */
.bwr-toast {
  position: fixed;
  bottom: max(80px, calc(70px + env(safe-area-inset-bottom, 0px)));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
.bwr-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Shared-route banner ── */
.shared-route-banner {
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #4c1d95;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Layer switcher overlay ── */
.map-layers {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.92);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  backdrop-filter: blur(4px);
}

.layer-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}
.layer-btn:hover { background: #f3f4f6; }
.layer-btn.active { background: #1e4d14; color: white; }

/* ── Mobile ── */
@media (max-width: 768px) {
  .routes-body { overflow: hidden; }

  .planner-layout {
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: visible; /* allow position:sticky inside .planner-sidebar to work on iOS Safari */
  }

  /* Map takes top portion, with a minimum so it stays usable */
  .planner-layout #map {
    order: 1;
    flex: none;
    min-height: 48vh;
    height: 52vh;
    /* Cancel the global `#map { margin-bottom: 56px }` (style.css) meant for the
       full-screen map page. Here the map sits ABOVE the bottom-sheet sidebar,
       which already pads itself clear of the fixed bottom nav — so that margin
       only leaves a dead 56px gap between the map and the sidebar. */
    margin-bottom: 0;
  }

  /* Sidebar is a scrollable bottom sheet */
  .planner-sidebar {
    order: 2;
    width: 100%;
    min-width: 0;
    flex: 1;
    max-height: 48vh;
    overflow-y: auto;
    border-right: none;
    border-top: 2px solid #e2e8da;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  /* Steps side by side on mobile — horizontal scroll */
  .step {
    padding: 14px 16px;
  }

  /* Mode cards horizontal */
  .mode-cards {
    flex-direction: row;
  }
  .mode-card {
    flex: 1;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 10px 8px;
  }
  .mode-card strong { font-size: 0.85rem; }
  .mode-card small  { font-size: 0.7rem; }

  /* Path type grid stays 2-col but smaller */
  .pathtype-btn { padding: 8px 4px; font-size: 1.1rem; }

  /* Difficulty pills */
  .diff-btn { padding: 8px 4px; font-size: 0.75rem; }

  /* Result stats — vertical stack */
  .result-stats { flex-direction: column; gap: 8px; }

  /* Search dropdown — sidebar overflow: auto clips position:absolute children.
     When results are open, temporarily allow overflow so the dropdown is visible. */
  .planner-sidebar.search-active {
    overflow: visible;
  }

  /* Layer switcher */
  .map-layers {
    top: 8px;
    right: 8px;
  }
  .layer-btn { padding: 5px 9px; font-size: 0.72rem; }

  /* Bigger touch targets */
  .btn-generate {
    padding: 16px;
    font-size: 1rem;
    min-height: 52px;
  }

  .btn-locate {
    width: 44px;
    height: 44px;
  }

  /* Search input — prevent iOS zoom */
  .search-input { font-size: 1rem; }

  /* Elevation chart smaller */
  .elevation-chart-wrap { padding: 8px; }

  /* Drag handle */
  .sheet-handle {
    display: block;
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 99px;
    margin: 10px auto 6px;
    flex-shrink: 0;
  }
}


/* Drag handle hidden on desktop */
.sheet-handle { display: none; }


/* ── GPS Tracker card ─────────────────────────────────────────────────────── */
.gps-tracker-card {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8da;
  background: #f8faf5;
}

.gps-tracker-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.gps-tracker-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.gps-tracker-header strong {
  display: block;
  font-size: 0.95rem;
  color: #1e4d14;
}

.gps-tracker-sub {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0;
}

.gps-tracker-live {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.gps-tracker-live.hidden { display: none; }

.gps-live-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #065f46;
}

.gps-live-row strong {
  margin-left: auto;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.gps-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 #10b981;
  animation: gps-pulse 1.4s infinite;
  flex-shrink: 0;
}

@keyframes gps-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.gps-live-accuracy {
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 3px;
}

.btn-gps-track {
  width: 100%;
  padding: 11px;
  background: #1e4d14;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-gps-track:hover { background: #2d6b1f; }

.btn-gps-track.tracking {
  background: #dc2626;
}

.btn-gps-track.tracking:hover { background: #b91c1c; }

.btn-gps-track:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}
