:root {
    --red: #E63946;
    --yellow: #FFB703;
    --blue: #0077B6;
    --green: #2DC653;
    --violet: #7B2FBE;
    --pink: #E91E8C;
    --magenta: #C2185B;
    --bg: #0A0A0F;
    --surface: #12121A;
    --card: #1A1A26;
    --border: rgba(255,255,255,0.07);
    --text: #F0F0F5;
    --muted: #888899;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* Animated background grid */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
      linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
  }

  /* Metro line decorative blobs */
  .blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    animation: drift 12s ease-in-out infinite alternate;
  }
  .blob-1 { width: 500px; height: 500px; background: var(--blue); top: -100px; left: -100px; animation-delay: 0s; }
  .blob-2 { width: 400px; height: 400px; background: var(--red); bottom: -50px; right: -50px; animation-delay: 3s; }
  .blob-3 { width: 300px; height: 300px; background: var(--violet); top: 40%; left: 40%; animation-delay: 6s; }

  @keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(30px, 20px) scale(1.05); }
  }

  .wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 80px;
  }

  /* Header */
  header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeDown 0.7s ease both;
  }

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

  .logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
  }

  .metro-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--blue), var(--violet));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 0 30px rgba(0,119,182,0.4);
  }

  h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(42px, 8vw, 72px);
    letter-spacing: 3px;
    background: linear-gradient(90deg, #fff 0%, #aac4e0 50%, #b8a0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
  }

  .subtitle {
    color: var(--muted);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 6px;
  }

  /* Line pills */
  .lines-strip {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
  }

  .line-pill {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    opacity: 0.85;
  }

  /* Main card */
  .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 580px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    animation: fadeUp 0.7s 0.2s ease both;
  }

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

  .field-group {
    position: relative;
    margin-bottom: 16px;
    z-index: 10;
  }

  .field-group:first-of-type { z-index: 20; }

  .field-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
  }

  .dot-from { background: #4CAF50; box-shadow: 0 0 8px #4CAF50; }
  .dot-to { background: var(--red); box-shadow: 0 0 8px var(--red); }

  .input-wrap {
    position: relative;
  }

  input[type="text"] {
    width: 100%;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px 14px 44px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  input[type="text"]:focus {
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
  }

  input[type="text"]::placeholder { color: rgba(255,255,255,0.2); }

  .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
  }

  /* Dropdown */
  .dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #1E1E2E;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    display: none;
  }

  .dropdown.open { display: block; }

  .dropdown::-webkit-scrollbar { width: 4px; }
  .dropdown::-webkit-scrollbar-track { background: transparent; }
  .dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

  .dropdown-item {
    padding: 11px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }

  .dropdown-item:last-child { border-bottom: none; }
  .dropdown-item:hover, .dropdown-item.active { background: rgba(255,255,255,0.06); }

  .item-dots { display: flex; gap: 3px; align-items: center; flex-shrink: 0; }
  .item-line-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .item-name { flex: 1; }
  .item-line-name { font-size: 11px; color: var(--muted); white-space: nowrap; }

  /* Connector */
  .connector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 0;
    gap: 12px;
  }

  .connector-line {
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  .swap-btn {
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    color: var(--muted);
    flex-shrink: 0;
  }

  .swap-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    transform: rotate(180deg);
  }

  /* CTA Button */
  .find-btn {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--violet) 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,119,182,0.35);
  }

  .find-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
  }

  .find-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(0,119,182,0.5);
  }

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

  .find-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  /* Quick picks */
  .quick-picks {
    margin-top: 28px;
    animation: fadeUp 0.7s 0.4s ease both;
  }

  .quick-label {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
    text-align: center;
  }

  .picks-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .pick-chip {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .pick-chip:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border-color: rgba(255,255,255,0.15);
  }

  /* Stats row */
  .stats-row {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 50px;
    animation: fadeUp 0.7s 0.5s ease both;
  }

  .stat {
    text-align: center;
  }

  .stat-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 36px;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff, #8899cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
  }

  .stat-lbl {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
  }

  .stat-divider {
    width: 1px;
    background: var(--border);
    align-self: stretch;
  }

  /* No results */
  .no-results {
    padding: 14px 16px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
  }

.route-view {
  position: fixed;
  inset: 0;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 20% 20%, rgba(91,192,255,0.06) 0%, transparent 60%), radial-gradient(ellipse at 80% 80%, rgba(180,110,255,0.06) 0%, transparent 60%);
  z-index: 999;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.route-view.open {
  transform: translateY(0);
}

.wrapper.hidden {
  visibility: hidden;
  pointer-events: none;
}

.route-view-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  min-height: 100vh;
}

/* Back button replaces close button */
.popup-close {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  transition: background 0.2s;
}
.popup-close:hover { background: rgba(255,255,255,0.12); }

.popup-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  margin-bottom: 4px;
}


/* ═══════════════════════════════
   ROUTE RESULT POPUP EXTRAS
═══════════════════════════════ */

.popup-box {
  max-height: 88vh;
  overflow-y: auto;
  scrollbar-width: thin;
}
.popup-box::-webkit-scrollbar { width: 4px; }
.popup-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Loading */
.popup-loading {
  text-align: center;
  padding: 30px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}

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

/* Stats row */
.route-stats {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.route-stat {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
  min-width: 70px;
}

.rs-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1;
}

.rs-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
}

/* Segment info */
.route-segment {
  font-size: 13px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.route-segment strong { color: #fff; }

/* Station list */
.station-list-wrap {
  margin: 14px 0 18px;
}

.station-list-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.station-list {
  max-height: 200px;
  overflow-y: auto;
  padding-left: 8px;
  scrollbar-width: thin;
}
.station-list::-webkit-scrollbar { width: 3px; }
.station-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.station-stop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--muted);
  position: relative;
}

.station-stop::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 18px;
  bottom: -6px;
  width: 2px;
  background: rgba(255,255,255,0.1);
}
.station-stop:last-child::before { display: none; }

.stop-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  z-index: 1;
}

.stop-first .stop-dot { background: #4CAF50; border-color: #4CAF50; box-shadow: 0 0 8px #4CAF5088; }
.stop-last  .stop-dot { background: var(--red); border-color: var(--red); box-shadow: 0 0 8px #E6394688; }
.stop-first .stop-name,
.stop-last  .stop-name { color: #fff; font-weight: 600; }

.stop-name { flex: 1; }

/* Actions at bottom of popup */
.popup-actions {
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 16px;
}

/* ═══════════════════════════════
   VISUAL ROUTE MAP
═══════════════════════════════ */

.route-map { margin: 16px 0; }

.popup-route {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}
.route-arrow { color: var(--muted); font-size: 16px; margin: 2px 0; }

/* Two-column row: card left, stations right */
.seg-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 0;
}

.seg-card {
  flex-shrink: 0;
  width: 130px;
  background: rgba(255,255,255,0.04);
  border-radius: 0 10px 10px 0;
  padding: 8px 10px;
  margin-top: 10px;
  font-size: 11px;
}
.seg-line-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.seg-towards { color: var(--muted); font-size: 10px; margin-bottom: 2px; }
.seg-platform { color: var(--muted); font-size: 10px; font-weight: 700; }

/* Stations column */
.seg-stations { flex: 1; }

.route-stop {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  font-size: 13px;
}

.stop-line-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
  align-self: stretch;
}
.stop-line { flex: 1; width: 2px; min-height: 6px; }
.route-stop.stop-first .stop-line.top    { background: transparent !important; }
.route-stop.stop-last  .stop-line.bottom { background: transparent !important; }

.stop-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
  z-index: 1;
}
.stop-circle-big {
  width: 15px !important;
  height: 15px !important;
}

.stop-label { flex: 1; padding: 8px 0; line-height: 1.3; }
.stop-label-bold { font-weight: 700; color: #fff; font-size: 14px; }

/* Interchange badge */
.interchange-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,200,50,0.08);
  border: 1px solid rgba(255,200,50,0.2);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 6px 0;
  font-size: 13px;
}
.interchange-icon { font-size: 18px; flex-shrink: 0; }
.interchange-text { flex: 1; }
.interchange-text strong { color: #FFD700; font-size: 13px; display: block; }
.interchange-text span   { color: var(--muted); font-size: 11px; }
.interchange-arrow { font-size: 11px; font-weight: 700; white-space: nowrap; }

/* Bigger circles for overall first/last station */
.stop-route-first .stop-circle,
.stop-route-last  .stop-circle { width: 16px !important; height: 16px !important; }

/* Route options picker */
.route-options { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.route-option-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  color: var(--text);
  width: 100%;
}
.route-option-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
}
.ro-num { font-size: 10px; color: var(--muted); letter-spacing: 1px; margin-bottom: 6px; font-family: 'Bebas Neue', sans-serif; }
.ro-lines { font-size: 13px; margin-bottom: 8px; }
.ro-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.ro-meta span { background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 20px; }

/* Route tabs */
.route-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 4px;
}

.route-tab {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  color: var(--text);
  text-align: center;
  transition: all 0.2s;
}
.route-tab:hover { background: rgba(255,255,255,0.08); }
.route-tab.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.35);
}
.tab-dots { display: flex; gap: 4px; justify-content: center; margin-bottom: 5px; }
.tab-dot  { width: 10px; height: 10px; border-radius: 50%; }
.tab-label { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.tab-meta  { font-size: 10px; color: var(--muted); }

/* Share icon button */
.popup-share-icon {
  position: absolute;
  top: 16px;
  right: 52px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.popup-share-icon:hover { background: rgba(255,255,255,0.14); }

/* Recent + Saved routes */
#saved-routes,
#recent-routes {
  margin: 0;
  padding: 0 4px;
}

#saved-routes { margin-top: 28px; }
#recent-routes { margin-top: 20px; }
.recent-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1.5px;
  font-family: 'Bebas Neue', sans-serif;
  margin-bottom: 8px;
}
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recent-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  transition: background 0.15s;
  width: 100%;
}
.recent-chip:hover { background: rgba(255,255,255,0.08); }
.rc-from { font-weight: 600; }
.rc-arrow { color: var(--muted); font-size: 11px; }
.rc-to   { color: var(--muted); }

/* Field clear button */
.field-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, background 0.15s;
  z-index: 5;
}
.field-clear:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Route view nav bar */
.route-view-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  height: 36px;
}

.popup-close {
  height: 36px;
  padding: 0 14px;
}

.popup-share-icon {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  position: static;
  transform: none;
  top: auto;
  right: auto;
}
.popup-share-icon:hover { background: rgba(255,255,255,0.14); }

/* Action buttons */
.popup-actions {
  margin-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: background 0.2s;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
}
.popup-btn:hover { background: rgba(255,255,255,0.08); }

.popup-btn-icon { font-size: 22px; flex-shrink: 0; }

.popup-btn-text {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 600;
}
.popup-btn-text span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

.btn-dmrc   { border-color: rgba(91,192,255,0.3); }
.btn-dmrc:hover { background: rgba(91,192,255,0.08); }
.btn-whatsapp { border-color: rgba(37,211,102,0.3); }
.btn-whatsapp:hover { background: rgba(37,211,102,0.08); }
.btn-google { border-color: rgba(66,133,244,0.3); }
.btn-google:hover { background: rgba(66,133,244,0.08); }
.btn-maps   { border-color: rgba(52,168,83,0.3); }
.btn-maps:hover { background: rgba(52,168,83,0.08); }

/* Popular route pick chips */
.picks-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pick-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  text-align: left;
  transition: background 0.2s;
  width: 100%;
}
.pick-chip:hover { background: rgba(255,255,255,0.07); }
.pick-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pick-from { font-weight: 600; }
.pick-arrow { color: var(--muted); font-size: 12px; }
.pick-to { color: var(--muted); }

/* ═══════════════════════════════
   GATES + ROUTE BODY LAYOUT
═══════════════════════════════ */

/* Mobile: route map on top, gates below */
.route-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Gates section */
.gates-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gates-station-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 11px;
}

.gates-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gate-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}

.gate-num {
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  font-size: 11px;
  min-width: 44px;
}

.gate-desc {
  color: var(--muted);
  line-height: 1.3;
}

/* Landscape / wide screen: side by side */
@media (min-width: 700px), (orientation: landscape) and (max-height: 500px) {
  .route-view-inner {
    max-width: 860px;
    padding: 24px 32px 60px;
  }

  .route-body {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

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

  .gates-side {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
  }

  .popup-actions {
    max-width: 480px;
  }

  .route-tabs {
    max-width: 480px;
  }

  .route-stats {
    justify-content: flex-start;
  }
}

/* Save button + nav right group */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  height: 36px;
  padding: 0 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.save-btn:hover { background: rgba(255,200,0,0.1); border-color: rgba(255,200,0,0.3); color: #FFD700; }
.save-btn.saved { background: rgba(255,200,0,0.12); border-color: rgba(255,200,0,0.4); color: #FFD700; }

/* Saved chips (gold tint) */
.saved-chip {
  border-color: rgba(255,200,0,0.2) !important;
}
.saved-chip:hover {
  background: rgba(255,200,0,0.08) !important;
}
.rc-star {
  color: #FFD700;
  font-size: 11px;
}

/* ═══════════════════════════════
   NEAR ME ICON BUTTON
═══════════════════════════════ */
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nearby-icon-btn {
  margin-left: auto;
  background: rgba(91,192,255,0.1);
  border: 1px solid rgba(91,192,255,0.25);
  border-radius: 7px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5BC0FF;
  cursor: pointer;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.nearby-icon-btn:hover {
  background: rgba(91,192,255,0.2);
  border-color: rgba(91,192,255,0.5);
}
.nearby-icon-btn:hover .nearby-tooltip { opacity: 1; transform: translateY(0); pointer-events: none; }

.nearby-tooltip {
  position: absolute;
  right: 0;
  top: 32px;
  background: #1a1a2e;
  border: 1px solid rgba(91,192,255,0.3);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  color: #5BC0FF;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 10;
  pointer-events: none;
  font-family: 'DM Sans', sans-serif;
}

/* ═══════════════════════════════
   NEARBY POPUP
═══════════════════════════════ */
.nearby-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.nearby-popup-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.nearby-popup-overlay.open .nearby-popup {
  transform: translateY(0);
}

.nearby-popup {
  background: #111118;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px 20px 40px;
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}

#nearby-results {
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}

/* On desktop — centered card */
@media (min-width: 600px) {
  .nearby-popup-overlay {
    align-items: center;
  }
  .nearby-popup {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
    max-height: 80vh;
  }
  .nearby-popup-overlay.open .nearby-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.nearby-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.nearby-popup-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 1.5px;
  color: #fff;
}

.nearby-popup-close {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.nearby-popup-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Walk / Drive tabs */
.nearby-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 4px;
}

.nearby-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nearby-tab.active {
  background: rgba(91,192,255,0.15);
  color: #5BC0FF;
}
.nearby-tab:hover:not(.active) { background: rgba(255,255,255,0.06); color: #fff; }

/* Results */
.nearby-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0;
  justify-content: center;
}

.nearby-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #5BC0FF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.nearby-stations { display: flex; flex-direction: column; gap: 6px; }

/* Station items — no animations, just clean display */
.nearby-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 11px;
  padding: 11px 14px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
}
.nearby-item:hover { background: rgba(255,255,255,0.08); }
.nearby-item.nearest {
  border-color: rgba(91,192,255,0.3);
  background: rgba(91,192,255,0.06);
}

.nearby-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nearby-name { flex: 1; font-size: 13px; font-weight: 500; }

.nearby-dist {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  gap: 2px;
}

.nearby-mins {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.nearby-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
}

