/* ============================================================
   MOT Mobility · Web App — UI
   ============================================================ */
:root {
  --brand: #1d4ed8;
  --brand-2: #06b6d4;
  --ink: #0a1628;
  --ink-2: #1e293b;
  --muted: #475569;
  --line: rgba(10, 22, 40, .08);
  --paper: #ffffff;
  --paper-2: #f8fafc;
  --paper-3: #eef2f7;
  --success: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Prompt', system-ui, sans-serif;
  background: var(--paper-2);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   App bar
   ============================================================ */
.app-bar {
  height: 64px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  box-shadow: 0 2px 12px rgba(10, 22, 40, .04);
  position: relative;
  z-index: 100;
}
.app-bar-brand { display: flex; align-items: center; gap: 12px; }
.back-link {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--paper-3);
  display: grid; place-items: center;
  color: var(--ink);
  text-decoration: none;
  transition: all .2s ease;
}
.back-link:hover { background: var(--ink); color: white; }
.app-logo {
  line-height: 0;
  filter: drop-shadow(0 3px 10px rgba(29, 78, 216, 0.28));
  transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-bar-brand:hover .app-logo { transform: rotate(45deg) scale(1.06); }
.app-title { font-weight: 800; font-size: 16px; color: var(--ink); letter-spacing: -0.3px; }
.app-tag { font-size: 11px; color: var(--muted); margin-top: 1px; }

.app-bar-right { display: flex; align-items: center; gap: 10px; }
.badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, .12);
  color: var(--success);
}
.badge-info {
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
}

/* ============================================================
   Main layout
   ============================================================ */
.app-main {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: calc(100vh - 64px);
}
@media (max-width: 880px) {
  .app-main { grid-template-columns: 1fr; }
  .sidebar { max-height: 50vh; }
  .map-wrap { min-height: 50vh; }
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  background: white;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 18px;
}

.planner-head h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.4px;
}
.planner-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* Search stack */
.search-stack {
  margin-top: 14px;
  background: var(--paper-2);
  border-radius: 14px;
  padding: 14px;
  position: relative;
}
.search-field {
  display: flex; align-items: center; gap: 10px;
  background: white;
  border-radius: 10px;
  padding: 0 12px;
  border: 1.5px solid transparent;
  transition: border-color .15s ease;
}
.search-field:focus-within { border-color: var(--brand); }
.search-field + .search-field { margin-top: 8px; }
.search-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.search-dot.to { background: var(--success); }
.search-input {
  flex: 1;
  border: 0;
  font-family: inherit;
  font-size: 14px;
  padding: 11px 0;
  background: transparent;
  color: var(--ink);
  outline: 0;
}
.search-input::placeholder { color: #94a3b8; }
.search-mylocation {
  background: var(--paper-3);
  border: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}
.search-mylocation:hover { background: var(--brand); color: white; }
.search-swap {
  position: absolute;
  right: 26px; top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1px solid var(--line);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  z-index: 2;
}
.search-swap:hover { background: var(--ink); color: white; }

/* Autocomplete suggestions */
.suggest {
  position: absolute;
  left: 14px; right: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 4px;
  box-shadow: 0 12px 28px rgba(10, 22, 40, .12);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}
.suggest.open { display: block; }
.suggest-item {
  padding: 10px 14px;
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover { background: var(--paper-2); }
.suggest-ico {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  color: white;
}

/* Mode chips */
.mode-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 14px;
}
.mode-chip {
  background: white;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all .15s ease;
}
.mode-chip input { display: none; }
.mode-chip.on {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

/* Plan button */
.plan-btn {
  margin-top: 14px;
  width: 100%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  border: 0;
  padding: 14px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(29, 78, 216, .3);
  transition: all .25s ease;
}
.plan-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(29, 78, 216, .4);
}

/* Quick places */
.quick-places { padding-top: 4px; }
.quick-places h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.quick-place {
  background: white;
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: all .15s ease;
}
.quick-place:hover {
  border-color: var(--brand);
  background: rgba(29, 78, 216, .04);
  transform: translateX(2px);
}

/* ============================================================
   Routes list
   ============================================================ */
.routes-section h3, .trip-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.routes-list {
  display: flex; flex-direction: column; gap: 10px;
}
.route-card {
  background: white;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all .2s ease;
}
.route-card:hover {
  border-color: var(--brand);
  transform: translateX(3px);
  box-shadow: 0 8px 20px rgba(10, 22, 40, .08);
}
.route-card.selected {
  border-color: var(--brand);
  background: rgba(29, 78, 216, .03);
}
.route-card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.route-modes {
  display: flex; align-items: center; gap: 4px;
}
.route-mode {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 14px;
  background: var(--paper-3);
  color: var(--ink);
}
.route-mode.walk { background: var(--paper-3); color: var(--muted); }
.route-mode.rail.bts-green { background: rgba(22, 163, 74, .15); color: #16a34a; }
.route-mode.rail.mrt-blue  { background: rgba(14, 165, 233, .15); color: #0ea5e9; }
.route-mode.rail.mrt-purple { background: rgba(139, 92, 246, .15); color: #8b5cf6; }
.route-mode.rail.mrt-yellow { background: rgba(234, 179, 8, .15); color: #ca8a04; }
.route-mode.rail.arl { background: rgba(185, 28, 28, .15); color: #b91c1c; }
.route-mode.bus { background: rgba(22, 163, 74, .15); color: #16a34a; }
.route-mode.boat { background: rgba(6, 182, 212, .15); color: #06b6d4; }
.route-mode.taxi { background: rgba(245, 158, 11, .15); color: #f59e0b; }
.route-mode.moto { background: rgba(236, 72, 153, .15); color: #ec4899; }
.route-arrow { color: var(--muted); font-size: 12px; padding: 0 2px; }
.route-tag {
  font-size: 10px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.route-tag.recommended { background: var(--brand); color: white; }
.route-tag.cheapest { background: var(--success); color: white; }
.route-tag.fastest { background: #f59e0b; color: white; }

.route-card-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.route-stats { display: flex; gap: 14px; }
.route-stat { display: inline-flex; gap: 4px; align-items: center; color: var(--ink-2); }
.route-stat b { color: var(--ink); font-weight: 700; }
.route-fare {
  font-weight: 800;
  color: var(--success);
  font-size: 16px;
}

/* Route detail expansion */
.route-detail {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.route-card.selected .route-detail { display: block; }
.route-step {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0;
  font-size: 12.5px;
}
.route-step-ico {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--paper-3);
}
.route-step-body { flex: 1; }
.route-step-name { font-weight: 600; color: var(--ink); }
.route-step-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.route-step-time { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }

.route-action {
  width: 100%;
  background: var(--ink);
  color: white;
  border: 0;
  padding: 12px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  margin-top: 12px;
  cursor: pointer;
}
.route-action:hover { background: var(--brand); }

/* ============================================================
   Trip in progress
   ============================================================ */
.trip-status {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.trip-status-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: .9;
}
.trip-status-h {
  font-size: 17px;
  font-weight: 700;
  margin: 6px 0;
}
.trip-status-time {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
}
.trip-status-time small {
  font-size: 14px;
  font-weight: 500;
  opacity: .85;
  margin-left: 5px;
}

.trip-stations {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.trip-stations-h {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}
.trip-stop {
  position: relative;
  font-size: 13px;
  padding: 5px 0 5px 22px;
  display: flex; justify-content: space-between;
}
.trip-stop::before {
  content: '';
  position: absolute;
  left: 4px; top: 8px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--brand);
}
.trip-stop.passed::before { background: var(--brand); }
.trip-stop.current::before {
  background: #f59e0b;
  border-color: #f59e0b;
  width: 12px; height: 12px;
  left: 3px; top: 7px;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .25);
}
.trip-stop-name { color: var(--ink-2); }
.trip-stop.passed .trip-stop-name { color: var(--muted); }
.trip-stop.current .trip-stop-name { font-weight: 700; color: var(--ink); }

.end-trip-btn {
  margin-top: 14px;
  width: 100%;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.end-trip-btn:hover { background: var(--paper-2); }

/* ============================================================
   Map
   ============================================================ */
.map-wrap {
  position: relative;
  height: 100%;
  background: #d6e6f5;
}
#map {
  width: 100%;
  height: 100%;
}

/* Layer toggle */
.layer-toggle {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 400;
  display: flex;
  background: white;
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(10, 22, 40, .15);
  border: 1px solid var(--line);
}
.layer-btn {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.layer-btn:hover { background: var(--paper-2); }
.layer-btn.active {
  background: var(--ink);
  color: white;
}

/* Click hint */
.click-hint {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  background: rgba(10, 22, 40, .9);
  color: white;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(10, 22, 40, .25);
  max-width: 90%;
  line-height: 1.5;
  pointer-events: none;
  transition: opacity .3s ease;
}
.click-hint.hidden { opacity: 0; pointer-events: none; }
.click-hint b { color: #06b6d4; }

.legend {
  position: absolute;
  bottom: 24px; left: 24px;
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 28px rgba(10, 22, 40, .12);
  font-size: 12px;
  z-index: 400;
  border: 1px solid var(--line);
}
.legend-h {
  font-weight: 700;
  font-size: 11.5px;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.legend-row {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 0;
  color: var(--ink-2);
}
.legend-dot {
  width: 16px; height: 4px;
  border-radius: 2px;
}

/* Custom map markers */
.station-marker {
  background: white;
  border: 3px solid var(--brand);
  width: 14px; height: 14px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.station-marker.from { border-color: var(--brand); }
.station-marker.to { border-color: var(--success); }
.station-marker.current {
  background: #f59e0b;
  border-color: #f59e0b;
  width: 18px; height: 18px;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .3);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ============================================================
   Modal
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 22, 40, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}
.modal-card {
  background: white;
  border-radius: 18px;
  width: 100%;
  max-width: 440px;
  padding: 26px;
  position: relative;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .35);
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--paper-3);
  border: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}
.modal-card h3 {
  font-size: 18px;
  margin-bottom: 14px;
  color: var(--ink);
}
.pay-total {
  text-align: center;
  margin-bottom: 18px;
}
.pay-total-l { font-size: 12px; color: var(--muted); }
.pay-total-n { font-size: 36px; font-weight: 800; color: var(--ink); letter-spacing: -1px; }
.pay-total-n span { font-size: 40px; }

.pay-methods { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.pay-m {
  background: white;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: all .15s ease;
}
.pay-m:has(input:checked) { border-color: var(--brand); background: rgba(29, 78, 216, .04); }
.pay-m input { display: none; }
.pay-m-ico {
  width: 38px; height: 26px;
  border-radius: 5px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.pay-m-n { font-weight: 600; color: var(--ink); font-size: 13px; }
.pay-m-s { font-size: 11px; color: var(--muted); margin-top: 1px; }

.pay-confirm {
  width: 100%;
  background: var(--success);
  color: white;
  border: 0;
  padding: 14px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.pay-confirm:hover { background: #059669; }

/* Scrollbar styling */
.sidebar::-webkit-scrollbar, .suggest::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb, .suggest::-webkit-scrollbar-thumb {
  background: rgba(10, 22, 40, .18);
  border-radius: 3px;
}

/* ========== Samut Prakan badges (v4) ========== */
.pilot-badge {
  display: inline-block;
  background: linear-gradient(135deg, #1d4ed8, #06b6d4);
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
}
.sp-badge {
  display: inline-block;
  background: rgba(29, 78, 216, 0.10);
  color: #1d4ed8;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}


/* ========== Transfer pins on map (v5) ========== */
.transfer-pin {
  width: 40px; height: 40px;
  border-radius: 50% 50% 50% 0;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.1);
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.transfer-pin-ico {
  transform: rotate(45deg);
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

/* legend pin (small) */
.legend-pin {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50% 50% 50% 0;
  border: 1.5px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transform: rotate(-45deg);
  margin-right: 8px;
  vertical-align: middle;
}
.legend-divider {
  height: 1px;
  background: rgba(255,255,255,.18);
  margin: 8px 0 4px 0;
}


/* ========== Samut Prakan capital marker on map ========== */
.sp-capital-pin {
  background: rgba(29, 78, 216, 0.95);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.45);
  border: 2px solid white;
  white-space: nowrap;
}
.sp-capital-pin small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.95;
  margin-top: 2px;
}


/* ========== Floating Route Banner (top of map · v6) ========== */
.route-banner {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 18px;
  box-shadow: 0 14px 50px rgba(10, 22, 40, 0.25), 0 4px 12px rgba(10, 22, 40, 0.10);
  padding: 16px 18px;
  min-width: 540px;
  max-width: 720px;
  border: 1px solid rgba(29, 78, 216, 0.10);
  animation: rb-slide-down 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes rb-slide-down {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.rb-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.rb-tag {
  background: linear-gradient(135deg, #1d4ed8, #06b6d4);
  color: white; font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
}
.rb-modes {
  display: flex; align-items: center; gap: 4px; flex: 1;
  font-size: 18px;
}
.rb-modes .route-mode {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: #f1f5f9;
}
.rb-modes .route-mode.rail.bts-green { background: rgba(22, 163, 74, 0.15); }
.rb-modes .route-mode.rail.mrt-yellow { background: rgba(234, 179, 8, 0.15); }
.rb-modes .route-mode.rail.arl { background: rgba(185, 28, 28, 0.15); }
.rb-modes .route-arrow {
  font-size: 16px; color: #94a3b8; font-weight: 700;
}
.rb-close {
  background: transparent; border: none; font-size: 24px;
  color: #94a3b8; cursor: pointer; padding: 0 4px;
  line-height: 1;
}
.rb-close:hover { color: #0a1628; }

.rb-stats {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 4px;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}
.rb-stat { display: flex; flex-direction: column; align-items: center; }
.rb-stat-n {
  font-size: 28px; font-weight: 800; color: #0a1628; line-height: 1.0;
}
.rb-stat-l {
  font-size: 10px; color: #64748b; font-weight: 500;
  margin-top: 2px;
}
.rb-stat-sep {
  width: 1px; height: 32px; background: #e2e8f0;
}
.rb-route-name {
  flex: 1; flex-direction: row; gap: 8px; font-size: 13px; font-weight: 600;
  align-items: center;
  min-width: 0;
}
.rb-from, .rb-to {
  color: #0a1628;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rb-from { color: #1d4ed8; }
.rb-to { color: #16a34a; }
.rb-arrow { color: #94a3b8; font-weight: 700; }

.rb-steps {
  margin: 12px 0 10px 0;
  display: flex; flex-direction: column; gap: 6px;
  max-height: 180px; overflow-y: auto;
}
.rb-step-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; padding: 6px 8px;
  background: #f8fafc; border-radius: 10px;
}
.rb-step-ico {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: white; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  font-size: 13px;
}
.rb-step-text { flex: 1; color: #1e293b; font-weight: 500; }
.rb-step-meta { color: #64748b; font-size: 10.5px; margin-top: 1px; }
.rb-step-time {
  font-weight: 700; color: #0a1628; font-size: 12px;
  white-space: nowrap;
}

.rb-start {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white; border: none;
  padding: 12px; border-radius: 12px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
  transition: transform .15s, box-shadow .15s;
}
.rb-start:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16, 185, 129, 0.42); }
.rb-start:active { transform: translateY(0); }

/* ========== Floating Trip Banner ========== */
.trip-banner {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: rgba(10, 22, 40, 0.96);
  color: white;
  backdrop-filter: blur(16px);
  border-radius: 18px;
  box-shadow: 0 14px 50px rgba(10, 22, 40, 0.42);
  padding: 14px 18px;
  min-width: 520px;
  max-width: 680px;
  animation: rb-slide-down 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.tb-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.tb-status {
  font-size: 13px; font-weight: 800; color: #34d399;
  display: flex; align-items: center; gap: 6px;
}
.tb-end {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.tb-end:hover { background: rgba(239, 68, 68, 0.28); }

.tb-body { color: #cbd5e1; }
.tb-current {
  font-size: 13px; color: #94a3b8; margin-bottom: 4px;
}
.tb-current-h {
  font-size: 20px; font-weight: 700; color: white;
  margin-bottom: 8px;
}
.tb-eta {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 10px;
}
.tb-eta-n {
  font-size: 36px; font-weight: 800; color: #06b6d4; line-height: 1.0;
}
.tb-eta-l { font-size: 12px; color: #94a3b8; }

.tb-stops {
  display: flex; flex-direction: column; gap: 2px;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,.10);
}
.tb-stop {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 4px 0;
}
.tb-stop-name { color: #cbd5e1; }
.tb-stop-time { color: #64748b; font-size: 11px; }
.tb-stop.passed .tb-stop-name { color: #475569; text-decoration: line-through; }
.tb-stop.current .tb-stop-name {
  color: #06b6d4; font-weight: 800;
  position: relative; padding-left: 14px;
}
.tb-stop.current .tb-stop-name::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: #06b6d4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.32);
  animation: tb-pulse 1.4s infinite;
}
@keyframes tb-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.32); }
  50% { box-shadow: 0 0 0 8px rgba(6, 182, 212, 0.0); }
}

/* Planner ALWAYS visible — ผู้ใช้ค้นหาใหม่ได้ตลอด ทุกขั้น
   เพียงซ่อน routes/trip section เพราะ banner รับหน้าที่แสดงแล้ว */
body.route-banner-active .routes-section,
body.trip-banner-active .trip-section { display: none !important; }
/* Compact planner during banner mode */
body.route-banner-active .planner,
body.trip-banner-active .planner {
  padding-bottom: 12px !important;
}
body.route-banner-active .planner-sub,
body.trip-banner-active .planner-sub { display: none; }
body.route-banner-active .quick-places,
body.trip-banner-active .quick-places {
  padding-top: 8px !important;
}

/* Responsive: shrink banner on small screens */
@media (max-width: 900px) {
  .route-banner, .trip-banner {
    min-width: 0; width: calc(100% - 40px); top: 70px;
    left: 20px; transform: none;
  }
}


/* ========== Trip current pin (animated pulse) ========== */
.trip-current-pin {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.5);
  position: relative;
}
.trip-current-pulse {
  position: absolute; inset: -8px;
  border-radius: 50%; border: 3px solid #06b6d4;
  animation: trip-current-pulse 1.6s infinite ease-out;
  opacity: 0.6;
}
@keyframes trip-current-pulse {
  0%   { transform: scale(0.85); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}


/* ========== Animated Route Flow (v7) ========== */
/* แสดงทิศการเดินทางด้วยเส้นประวิ่ง */
.route-flow-line {
  stroke-dasharray: 14 18;
  animation: route-flow 1s linear infinite;
}
@keyframes route-flow {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -32; }
}

/* Direction arrow markers along route */
.route-arrow-marker {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 11px; font-weight: 800;
  border: 2px solid white;
  box-shadow: 0 2px 5px rgba(0,0,0,.32);
  line-height: 1;
}

/* Station tooltip (smaller, sticky on map for selected route) */
.station-tip.leaflet-tooltip {
  background: rgba(255,255,255,.96) !important;
  color: #0a1628 !important;
  font-weight: 700 !important;
  font-size: 10px !important;
  padding: 3px 7px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(10,22,40,.15) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.18) !important;
  white-space: nowrap !important;
}
.station-tip.leaflet-tooltip::before { display: none !important; }


/* ========== "ค้นหาใหม่" pill on banners ========== */
.rb-newsearch, .tb-newsearch {
  background: rgba(29, 78, 216, 0.10);
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.22);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.rb-newsearch:hover { background: rgba(29, 78, 216, 0.18); transform: translateY(-1px); }
.tb-newsearch {
  background: rgba(6, 182, 212, 0.18);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.32);
}
.tb-newsearch:hover { background: rgba(6, 182, 212, 0.28); }


/* ========== Trip mode switch + prev/next + GPS ========== */
.tb-mode-switch {
  display: flex; gap: 4px;
  background: rgba(255,255,255,.08);
  padding: 3px;
  border-radius: 999px;
  margin: 0 auto;
}
.tb-mode-btn {
  background: transparent; border: none;
  color: #94a3b8; font-size: 10.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.tb-mode-btn:hover { color: white; }
.tb-mode-btn.active {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.32);
}

.tb-controls {
  display: flex; gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
}
.tb-prev, .tb-next {
  flex: 1;
  background: rgba(255,255,255,.08);
  color: white; border: 1px solid rgba(255,255,255,.15);
  padding: 11px; border-radius: 12px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.tb-prev:hover, .tb-next:hover { background: rgba(255,255,255,.16); }
.tb-prev:disabled, .tb-next:disabled {
  opacity: 0.35; cursor: not-allowed;
}
.tb-next {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
  flex: 2;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.32);
}
.tb-next:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.42);
}

.tb-gps-status {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 10px;
  font-size: 11.5px; color: #67e8f9;
}
.tb-gps-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.55);
  animation: gps-pulse 1.6s infinite;
}
@keyframes gps-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

