.map-page-body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
}

.map-page-body .tab-bar {
  max-width: none;
  z-index: 800;
  isolation: isolate;
}

.map-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 500;
}

.map-back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  align-self: center;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--primary);
  text-decoration: none;
  padding: 6px 0;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

/* style.css global button (mor gradyan) — toolbar geri butonunu link gibi göster */
button.map-back {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  filter: none;
  font-size: 0.875rem;
  font-weight: 600;
}

button.map-back:hover,
button.map-back:active {
  background: transparent;
  box-shadow: none;
  transform: none;
  filter: none;
  color: var(--primary);
  text-decoration: underline;
}

.map-toolbar-main {
  min-width: 0;
  flex: 1;
}

.map-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.map-subtitle {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.35;
}

.map-picker {
  flex-shrink: 0;
  margin: 0 12px 8px;
  max-height: 42vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.map-picker.is-route-picked {
  max-height: none;
  overflow: visible;
}

.map-picker.is-route-picked .map-picker-intro {
  display: none;
}

.map-route-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.map-route-compact-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-route-compact-code {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.map-route-compact-hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.3;
}

.map-route-change-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.map-picker.is-route-picked #mapDirectionSection {
  margin-top: 0;
}

.map-picker.is-route-picked #mapDirectionSection .field-label {
  margin-bottom: 6px;
}

.route-kind-filter {
  margin-bottom: 10px;
}

.map-picker-intro {
  margin: 0 0 14px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.map-route-list {
  max-height: 160px;
}

.map-direction-chips {
  flex-wrap: wrap;
}

.map-page-body.map-route-active .map-toolbar {
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-bottom: 8px;
}

.map-page-body.map-route-active .map-subtitle {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .map-route-list {
    max-height: 120px;
  }

  .map-picker.is-route-picked {
    margin-bottom: 4px;
    padding: 10px 12px;
  }

}

.map-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.map-canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  z-index: 1;
}

.map-loading {
  position: absolute;
  inset: 0;
  margin: auto;
  width: fit-content;
  height: fit-content;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--muted);
}

.map-error {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 600;
  padding: 12px 14px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

:root[data-theme="dark"] .map-error {
  background: rgba(127, 29, 29, 0.35);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

/* Leaflet durak iğnesi */
.map-stop-icon {
  background: transparent;
  border: none;
}

.map-stop-pin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.28));
}

.map-stop-pin-head {
  position: relative;
  z-index: 2;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px 8px 8px 2px;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}

.map-stop-pin-point {
  position: relative;
  z-index: 1;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid var(--pin-color, #64748b);
}

.map-stop-pin.is-mid .map-stop-pin-head {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
}

.map-stop-pin.is-mid {
  --pin-color: #64748b;
}

.map-stop-pin.is-first .map-stop-pin-head {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
}

.map-stop-pin.is-first {
  --pin-color: #16a34a;
}

.map-stop-pin.is-last .map-stop-pin-head {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

.map-stop-pin.is-last {
  --pin-color: #dc2626;
}

.map-stop-pin.is-target .map-stop-pin-head {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  font-size: 0.6875rem;
  border-radius: 10px 10px 10px 3px;
  background: linear-gradient(180deg, #c084fc 0%, #7c3aed 100%);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.35);
}

.map-stop-pin.is-target {
  --pin-color: #7c3aed;
}

.map-stop-pin-pulse {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  border-radius: 50%;
  border: 2px solid #a855f7;
  animation: map-stop-pulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes map-stop-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.75;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.map-popup-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
}

.map-popup-badge-target {
  background: #ede9fe;
  color: #6d28d9;
}

.map-popup-badge-start {
  background: #dcfce7;
  color: #15803d;
}

.map-popup-badge-end {
  background: #fee2e2;
  color: #b91c1c;
}

.map-popup-id {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Canlı otobüs ikonu */
.map-bus-icon {
  background: transparent;
  border: none;
}

.map-bus-marker {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.map-bus-marker.is-tram {
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
  box-shadow: 0 2px 10px rgba(147, 51, 234, 0.5);
}

.map-bus-marker.is-metro {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.5);
}

.map-bus-marker.is-rail {
  background: linear-gradient(180deg, #22d3ee 0%, #0891b2 100%);
  box-shadow: 0 2px 10px rgba(8, 145, 178, 0.5);
}

.map-bus-marker.is-ferry {
  background: linear-gradient(180deg, #38bdf8 0%, #0369a1 100%);
  box-shadow: 0 2px 10px rgba(3, 105, 161, 0.5);
}

.map-bus-marker.is-funicular {
  background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
  box-shadow: 0 2px 10px rgba(202, 138, 4, 0.5);
}

.map-bus-marker.is-trolleybus {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.5);
}

.map-bus-marker.is-focused {
  width: 44px;
  height: 44px;
  border-width: 3px;
  box-shadow:
    0 0 0 3px color-mix(in srgb, #2563eb 35%, transparent),
    0 4px 14px rgba(37, 99, 235, 0.55);
  transform: scale(1.05);
}

.map-bus-marker-label {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1.1;
  text-align: center;
  word-break: break-all;
}

.map-route-legend {
  position: absolute;
  left: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 450;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--muted);
  max-width: min(280px, calc(100% - 24px));
  line-height: 1.15;
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend-line {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: #2563eb;
}

.map-route-legend.is-tram .map-legend-line.is-route { background: #9333ea; }
.map-route-legend.is-metro .map-legend-line.is-route { background: #dc2626; }
.map-route-legend.is-rail .map-legend-line.is-route { background: #0891b2; }
.map-route-legend.is-ferry .map-legend-line.is-route { background: #0369a1; }
.map-route-legend.is-funicular .map-legend-line.is-route { background: #ca8a04; }
.map-route-legend.is-trolleybus .map-legend-line.is-route { background: #059669; }

.map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  border: 1px solid #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.4);
}

.map-route-legend.is-tram .map-legend-dot.is-vehicle {
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
  box-shadow: 0 1px 3px rgba(147, 51, 234, 0.4);
}

.map-route-legend.is-metro .map-legend-dot.is-vehicle {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
}

.map-route-legend.is-rail .map-legend-dot.is-vehicle {
  background: linear-gradient(180deg, #22d3ee 0%, #0891b2 100%);
  box-shadow: 0 1px 3px rgba(8, 145, 178, 0.4);
}

.map-route-legend.is-ferry .map-legend-dot.is-vehicle {
  background: linear-gradient(180deg, #38bdf8 0%, #0369a1 100%);
  box-shadow: 0 1px 3px rgba(3, 105, 161, 0.4);
}

.map-route-legend.is-funicular .map-legend-dot.is-vehicle {
  background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
  box-shadow: 0 1px 3px rgba(202, 138, 4, 0.4);
}

.map-route-legend.is-trolleybus .map-legend-dot.is-vehicle {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.4);
}

.map-popup-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.leaflet-popup-content-wrapper {
  border-radius: 10px;
  font-family: inherit;
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-size: 0.875rem;
  line-height: 1.4;
}

.map-popup-seq {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.map-popup-name {
  font-weight: 600;
  color: var(--text);
}

/* ===== Birleşik harita (map.html) ===== */

.map-unified-page .map-unified-toolbar {
  align-items: center;
}

.map-mode-back.hidden,
.map-home-back.hidden,
.map-locate-btn.hidden {
  display: none;
}

.map-locate-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.map-unified-page {
  --map-tab-bar-offset: var(--tab-bar-offset, calc(74px + env(safe-area-inset-bottom)));
  --map-stop-card-bottom: 58px;
}

.map-unified-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.map-mode-layer {
  position: absolute;
  inset: 0;
  display: none;
}

.map-mode-layer.is-active {
  display: block;
}

.map-mode-layer.hidden {
  display: none !important;
}

.map-mode-layer .map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-mode-layer .map-loading,
.map-mode-layer .map-error {
  position: absolute;
  z-index: 600;
}

/* Durak popup — harita üstü modal */
.map-unified-stage .nearby-stop-popup {
  position: absolute;
  inset: 0;
  z-index: 750;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding:
    max(12px, env(safe-area-inset-top, 0px))
    max(14px, env(safe-area-inset-right, 0px))
    calc(var(--map-tab-bar-offset, 64px) + 12px)
    max(14px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.map-unified-stage .nearby-stop-popup:not(.hidden) {
  pointer-events: auto;
}

.map-unified-stage .nearby-stop-popup.hidden {
  display: none;
}

.map-unified-stage .nearby-stop-popup-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
  animation: stopPopupFadeIn 0.22s ease;
}

.map-unified-stage .nearby-stop-popup-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  max-height: min(62vh, 420px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.18),
    0 4px 12px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  animation: stopPopupSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.map-unified-stage .nearby-stop-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.map-unified-stage .nearby-stop-popup-close:hover {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-2));
  color: var(--text);
}

.map-unified-stage .nearby-stop-popup-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 48px 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 6%, var(--surface)) 0%, var(--surface) 100%);
}

.map-unified-stage .nearby-stop-popup-pin {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
}

.map-unified-stage .nearby-stop-popup-titles {
  flex: 1;
  min-width: 0;
}

.map-unified-stage .nearby-stop-popup-name {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-unified-stage .nearby-stop-popup-meta {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.map-unified-stage .nearby-stop-popup-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.map-unified-stage .stop-popup-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 16px;
}

.map-unified-stage .stop-popup-empty {
  margin: 0;
  padding: 20px 16px 24px;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.map-unified-stage .stop-popup-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.map-unified-stage .stop-popup-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.map-unified-stage .stop-popup-row[data-route] {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.map-unified-stage .stop-popup-row[data-route]:hover {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.map-unified-stage .stop-popup-row[data-route]:active {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.map-unified-stage .stop-popup-row[data-route]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
  outline-offset: -2px;
}

.map-unified-stage .stop-popup-row:last-child {
  border-bottom: none;
}

.map-unified-stage .stop-popup-row__badge {
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.map-unified-stage .stop-popup-row__sign {
  grid-column: 2;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-unified-stage .stop-popup-row__stats {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.map-unified-stage .stop-popup-stat {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 999px;
}

.map-unified-stage .stop-popup-stat--time {
  color: #15803d;
  background: color-mix(in srgb, #16a34a 14%, transparent);
  border: 1px solid color-mix(in srgb, #16a34a 28%, transparent);
}

.map-unified-stage .stop-popup-stat--stops {
  color: #166534;
  background: color-mix(in srgb, #16a34a 8%, transparent);
  border: 1px solid color-mix(in srgb, #16a34a 18%, transparent);
}

.map-unified-stage .stop-popup-row--idle {
  opacity: 0.72;
  background: color-mix(in srgb, var(--muted) 4%, var(--surface));
}

.map-unified-stage .stop-popup-row--idle[data-route]:hover {
  opacity: 0.88;
  background: color-mix(in srgb, var(--muted) 8%, var(--surface));
}

.map-unified-stage .stop-popup-row--idle .stop-popup-row__badge {
  filter: grayscale(0.35);
  box-shadow: none;
}

.map-unified-stage .stop-popup-row--idle .stop-popup-row__sign {
  grid-column: 2 / span 2;
}

@keyframes stopPopupFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes stopPopupSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.map-unified-stage .nearby-schedule-block {
  min-width: 0;
}

.map-unified-stage .nearby-schedule-line {
  margin: 0 0 6px;
  font-size: 0.75rem;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.map-unified-stage .nearby-schedule-line .schedule-pill {
  white-space: normal;
  max-width: 100%;
}

.map-unified-stage .nearby-stop-card-arrivals .nearby-popup-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

@media (max-width: 480px) {
  .map-unified-stage .nearby-stop-popup {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(var(--map-tab-bar-offset, 64px) + 8px);
  }

  .map-unified-stage .nearby-stop-popup-panel {
    border-radius: 18px;
    max-height: min(68vh, 440px);
  }

  .map-unified-stage .nearby-stop-popup-head {
    padding: 16px 44px 12px 14px;
  }

  .map-unified-stage .stop-popup-row {
    padding: 11px 14px;
    gap: 8px 10px;
  }
}

/* Güzergah seçici FAB — tab bar üstünde, ortada */
.map-route-picker-fab {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: calc(var(--map-tab-bar-offset, 64px) + 10px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}

.map-route-picker-fab.hidden {
  display: none;
}

.map-route-picker-fab svg {
  flex-shrink: 0;
}

body[data-map-mode="route"] .map-route-picker-fab {
  display: none;
}

/* Güzergah seçici sheet */
.map-route-picker-sheet {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.map-route-picker-sheet:not(.hidden) {
  pointer-events: auto;
}

.map-route-picker-sheet.hidden {
  display: none;
}

.map-route-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 45, 0.42);
  backdrop-filter: blur(4px);
}

.map-route-picker-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(78vh, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.map-route-picker-handle {
  width: 36px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: var(--surface-3);
}

.map-route-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
}

.map-route-picker-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}

.map-route-picker-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.map-picker-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.map-unified-page .map-route-legend {
  bottom: calc(var(--map-tab-bar-offset) + 12px);
}

/* Güzergah kapat — harita üstünde cam efektli pill */
.map-route-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 460;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 9px 14px 9px 11px;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 4px 18px rgba(15, 23, 42, 0.14),
    0 1px 3px rgba(15, 23, 42, 0.06);
  transform: none;
  filter: none;
  transition:
    transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.map-route-close-btn.hidden {
  display: none;
}

.map-route-close-btn svg {
  flex-shrink: 0;
  color: var(--muted);
  transition: color 0.16s ease;
}

.map-route-close-btn:hover:not(:disabled),
.map-route-close-btn:focus-visible {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.16),
    0 2px 6px rgba(15, 23, 42, 0.08);
  transform: none;
  filter: none;
}

.map-route-close-btn:hover svg,
.map-route-close-btn:focus-visible svg {
  color: var(--primary);
}

.map-route-close-btn:active:not(:disabled) {
  transform: scale(0.96);
  filter: none;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}

.map-route-close-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
}

body[data-map-mode="route"] .nearby-area-routes {
  display: none !important;
}
