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

:root {
  --bg-base: #0b0f1a;
  --bg-card: #131929;
  --bg-card2: #1a2235;
  --bg-surface: #1e2d45;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --text-primary: #f0f4ff;
  --text-secondary: #8b97b8;
  --text-muted: #4d5d82;
  --accent-purple: #6366f1;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --lowfloor-color: #10b981;
  --lowfloor-bg: rgba(16,185,129,0.12);
  --wheelchair-color: #6366f1;
  --wheelchair-bg: rgba(99,102,241,0.12);
  --normal-color: #4d5d82;
  --normal-bg: rgba(77,93,130,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --font-size-base: 15px;
}

.large-text {
  --font-size-base: 18px;
}

.high-contrast {
  --bg-base: #000;
  --bg-card: #111;
  --bg-card2: #1a1a1a;
  --text-primary: #fff;
  --text-secondary: #ccc;
  --border: rgba(255,255,255,0.2);
}

html { height: 100%; }
body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  overflow: hidden;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }

/* ── SPLASH SCREEN ── */
.splash {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.splash.fade-out { opacity: 0; transform: scale(1.05); pointer-events: none; }
.splash-inner {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  animation: splashIn 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes splashIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.splash-icon { margin-bottom: 4px; filter: drop-shadow(0 8px 24px rgba(99,102,241,0.5)); }
.splash-title {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.splash-subtitle { color: var(--text-secondary); font-size: 14px; }
.splash-loader {
  width: 120px; height: 3px;
  background: var(--bg-card2); border-radius: 99px; overflow: hidden;
  margin-top: 24px;
}
.splash-loader-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #6366f1, #3b82f6);
  border-radius: 99px;
  animation: loadBar 1.8s ease forwards;
}
@keyframes loadBar { to { width: 100%; } }

/* ── APP WRAPPER ── */
.app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg-base);
}
.hidden { display: none !important; }

/* ── TOP NAV ── */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(11,15,26,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  flex-shrink: 0;
}
.nav-left { display: flex; align-items: center; gap: 8px; }
.nav-right { display: flex; align-items: center; gap: 4px; }
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700;
  background: linear-gradient(135deg, #a5b4fc, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.nav-icon-btn:hover { background: var(--bg-card2); color: var(--text-primary); }
.nav-back {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.nav-back:hover { background: var(--bg-card2); color: var(--text-primary); }

/* ── PAGES ── */
.page {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.page.active { display: flex; flex-direction: column; }

/* ── HERO SECTION ── */
.hero-section {
  padding: 24px 20px 16px;
  background: linear-gradient(180deg, rgba(99,102,241,0.1) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.hero-text { margin-bottom: 16px; }
.hero-title {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, #f0f4ff, #a5b4fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.2;
}
.hero-desc { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* ── SEARCH ── */
.search-container { position: relative; }
.search-bar {
  display: flex; align-items: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0 12px;
  gap: 8px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.search-icon { color: var(--text-muted); flex-shrink: 0; }
.search-input {
  flex: 1; height: 48px;
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 15px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg-surface);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background var(--transition);
}
.search-clear:hover { background: var(--border-strong); }
.search-gps-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: white; flex-shrink: 0;
  transition: opacity var(--transition), transform var(--transition);
}
.search-gps-btn:hover { opacity: 0.85; transform: scale(1.05); }
.search-gps-btn:active { transform: scale(0.95); }

/* SEARCH DROPDOWN */
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: dropIn 0.15s ease;
}
@keyframes dropIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.search-dropdown-inner { max-height: 280px; overflow-y: auto; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:active { background: var(--bg-card2); }
.search-result-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #1e2d45, #2d3f5f);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.search-result-body { flex: 1; min-width: 0; }
.search-result-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-sub { color: var(--text-secondary); font-size: 12px; margin-top: 1px; }
.search-result-badge {
  font-size: 11px; font-weight: 600; padding: 2px 7px;
  border-radius: 99px; flex-shrink: 0;
}
.badge-lowfloor { background: var(--lowfloor-bg); color: var(--lowfloor-color); }
.badge-wheelchair { background: var(--wheelchair-bg); color: var(--wheelchair-color); }
.search-no-result {
  padding: 24px 16px; text-align: center;
  color: var(--text-secondary); font-size: 14px;
}

/* ── STATS BANNER ── */
.stats-banner {
  display: flex; align-items: center;
  margin: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 0;
  overflow: hidden;
}
.stat-card {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; min-width: 0;
}
.stat-icon { font-size: 22px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-num { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.stat-label { font-size: 10px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-divider { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

/* ── SECTIONS ── */
.stops-section { padding: 8px 0 4px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 10px;
}
.section-title { font-size: 15px; font-weight: 700; }
.section-action {
  font-size: 12px; color: var(--text-secondary);
  padding: 4px 8px; border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.section-action:hover { background: var(--bg-card2); color: var(--text-primary); }

/* STOP LIST */
.stop-list { display: flex; flex-direction: column; gap: 8px; padding: 0 20px; }
.stop-list.padded { padding: 20px; }
.stop-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  position: relative; overflow: hidden;
}
.stop-chip::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent, rgba(99,102,241,0.04));
  pointer-events: none;
}
.stop-chip:hover { background: var(--bg-card2); border-color: var(--border-strong); transform: translateX(2px); }
.stop-chip:active { transform: scale(0.99); }
.stop-chip-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #1e2d45, #2d3f5f);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.stop-chip-body { flex: 1; min-width: 0; }
.stop-chip-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-chip-sub { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.stop-chip-arrow { color: var(--text-muted); flex-shrink: 0; }
.empty-state-small {
  padding: 16px 0; text-align: center;
  color: var(--text-muted); font-size: 13px;
}

/* ── INFO SECTION ── */
.info-section { padding: 16px 0 24px; }
.info-cards-row {
  display: flex; gap: 12px;
  padding: 0 20px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.info-cards-row::-webkit-scrollbar { display: none; }
.info-card {
  flex-shrink: 0; width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.info-card-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 10px;
}
.info-card h4 { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.info-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ── STOP HEADER ── */
.stop-header {
  background: linear-gradient(180deg, #131929, #0f1928);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px 0;
  flex-shrink: 0;
}
.stop-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stop-name-wrap { flex: 1; min-width: 0; }
.stop-name { font-size: 20px; font-weight: 800; line-height: 1.2; }
.stop-id {
  display: inline-block; margin-top: 4px;
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px 8px; border-radius: 99px;
}
.stop-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.stop-district { font-size: 12px; color: var(--text-secondary); }
.stop-update {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.fav-toggle {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-surface); color: var(--text-secondary);
  transition: background var(--transition), color var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.fav-toggle.active { background: rgba(245,158,11,0.15); color: #f59e0b; }
.fav-toggle:active { transform: scale(0.85); }

/* FILTER TABS */
.filter-tabs {
  display: flex; gap: 8px;
  margin-top: 14px;
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: 14px;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card2);
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.filter-tab.active {
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

/* ── ARRIVAL CONTAINER ── */
.arrival-container {
  flex: 1; overflow-y: auto;
  padding: 12px 16px 0;
  -webkit-overflow-scrolling: touch;
}

/* LOADING */
.loading-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 48px 0;
  color: var(--text-secondary); font-size: 14px;
}
.bus-loader { position: relative; height: 40px; width: 160px; }
.bus-loader-road {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--bg-card2), var(--accent-purple), var(--bg-card2));
  border-radius: 99px;
  animation: roadFlow 1.5s linear infinite;
}
@keyframes roadFlow {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}
.bus-loader-vehicle {
  position: absolute; font-size: 28px; bottom: 4px;
  animation: busMove 2s ease-in-out infinite;
}
@keyframes busMove {
  0%   { left: 0; transform: scaleX(1); }
  45%  { left: calc(100% - 30px); transform: scaleX(1); }
  50%  { left: calc(100% - 30px); transform: scaleX(-1); }
  95%  { left: 0; transform: scaleX(-1); }
  100% { left: 0; transform: scaleX(1); }
}

/* ARRIVAL LIST */
.arrival-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }

/* ARRIVAL CARD */
.arrival-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
  animation: cardIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
  opacity: 0;
}
@keyframes cardIn {
  from { opacity:0; transform:translateY(10px) scale(0.98); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.arrival-card:nth-child(1) { animation-delay: 0.0s; }
.arrival-card:nth-child(2) { animation-delay: 0.05s; }
.arrival-card:nth-child(3) { animation-delay: 0.10s; }
.arrival-card:nth-child(4) { animation-delay: 0.15s; }
.arrival-card:nth-child(5) { animation-delay: 0.20s; }
.arrival-card.lowfloor { border-color: rgba(16,185,129,0.3); }
.arrival-card.wheelchair { border-color: rgba(99,102,241,0.4); }

/* CARD TOP STRIPE */
.card-stripe {
  height: 3px; width: 100%;
  background: var(--normal-bg);
}
.arrival-card.lowfloor .card-stripe { background: linear-gradient(90deg, #10b981, #06b6d4); }
.arrival-card.wheelchair .card-stripe { background: linear-gradient(90deg, #6366f1, #a855f7); }

/* CARD MAIN */
.card-main {
  display: flex; align-items: center; gap: 14px; padding: 14px;
}
.card-route-badge {
  min-width: 60px; height: 60px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 2px;
  flex-shrink: 0;
}
.card-route-badge.type-city { background: rgba(59,130,246,0.15); }
.card-route-badge.type-express { background: rgba(239,68,68,0.12); }
.card-route-badge.type-town { background: rgba(16,185,129,0.12); }
.card-route-badge.type-airport { background: rgba(245,158,11,0.12); }
.badge-route-num { font-size: 18px; font-weight: 800; }
.badge-route-type { font-size: 10px; font-weight: 600; opacity: 0.8; }
.type-city .badge-route-num { color: #60a5fa; }
.type-city .badge-route-type { color: #60a5fa; }
.type-express .badge-route-num { color: #f87171; }
.type-town .badge-route-num { color: #34d399; }
.type-airport .badge-route-num { color: #fbbf24; }

/* CARD BODY */
.card-body { flex: 1; min-width: 0; }
.card-body-top { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.card-dest { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag {
  font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: 99px; display: flex; align-items: center; gap: 3px;
}
.tag-lowfloor { background: var(--lowfloor-bg); color: var(--lowfloor-color); border: 1px solid rgba(16,185,129,0.25); }
.tag-wheelchair { background: var(--wheelchair-bg); color: var(--wheelchair-color); border: 1px solid rgba(99,102,241,0.25); }
.tag-stroller { background: rgba(245,158,11,0.1); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.tag-normal { background: var(--normal-bg); color: var(--text-muted); border: 1px solid rgba(77,93,130,0.2); }
.card-plate { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* CARD RIGHT */
.card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.arrival-time {
  font-size: 22px; font-weight: 800;
  line-height: 1;
}
.arrival-time.soon { color: var(--accent-red); animation: pulse 1.5s ease-in-out infinite; }
.arrival-time.near { color: var(--accent-yellow); }
.arrival-time.far { color: var(--accent-green); }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.6; } }
.arrival-time-unit { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: -2px; text-align: right; }
.arrival-stops { font-size: 11px; color: var(--text-secondary); text-align: right; }

/* CARD SECOND BUS */
.card-second {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border);
}
.card-second-label { font-size: 12px; color: var(--text-muted); }
.card-second-info { display: flex; align-items: center; gap: 8px; }
.card-second-time { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.card-second-tag { font-size: 11px; font-weight: 600; }

/* ── EMPTY STATE ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; padding: 48px 24px;
  text-align: center;
}
.empty-state-icon { font-size: 48px; margin-bottom: 4px; opacity: 0.6; }
.empty-state p { font-size: 16px; font-weight: 600; }
.empty-state span { font-size: 13px; color: var(--text-secondary); }

/* ── REFRESH BAR ── */
.refresh-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(11,15,26,0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.refresh-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--accent-blue);
  padding: 7px 14px; border-radius: 99px;
  background: rgba(59,130,246,0.12);
  border: 1.5px solid rgba(59,130,246,0.2);
  transition: all var(--transition);
}
.refresh-btn:hover { background: rgba(59,130,246,0.2); }
.refresh-btn.spinning svg { animation: spin 0.8s linear; }
@keyframes spin { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
.refresh-countdown { font-size: 12px; color: var(--text-muted); }

/* ── BOTTOM NAV ── */
.bottom-nav {
  display: flex;
  background: rgba(11,15,26,0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 10px 8px;
  color: var(--text-muted); font-size: 10px; font-weight: 500;
  transition: color var(--transition);
  position: relative;
}
.bottom-nav-item::before {
  content: ''; position: absolute;
  top: 0; left: 25%; right: 25%; height: 2px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  border-radius: 0 0 99px 99px;
  opacity: 0; transform: scaleX(0);
  transition: all var(--transition);
}
.bottom-nav-item.active { color: var(--accent-purple); }
.bottom-nav-item.active::before { opacity: 1; transform: scaleX(1); }

/* ── PAGE HEADER PLAIN ── */
.page-header-plain {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.page-header-plain h2 { font-size: 22px; font-weight: 800; }
.page-header-plain p { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* ── SETTINGS ── */
.settings-list { padding: 12px 0; }
.settings-group { margin-bottom: 16px; }
.settings-group-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 0 20px 8px;
}
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.settings-item:first-of-type { border-top: 1px solid var(--border); }
.settings-item.clickable { cursor: pointer; }
.settings-item.clickable:hover { background: var(--bg-card); }
.settings-item-left { display: flex; flex-direction: column; gap: 2px; }
.settings-item-label { font-size: 14px; font-weight: 600; }
.settings-item-desc { font-size: 12px; color: var(--text-secondary); }
.settings-value { font-size: 13px; color: var(--text-muted); }

/* TOGGLE */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--bg-surface); border-radius: 99px;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; left: 3px; top: 3px;
  background: var(--text-muted); border-radius: 50%;
  transition: transform 0.3s, background 0.3s;
}
input:checked + .toggle-slider { background: linear-gradient(135deg, #6366f1, #3b82f6); }
input:checked + .toggle-slider::before { transform: translateX(22px); background: white; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
  animation: overlayIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes overlayIn { from { opacity:0; } to { opacity:1; } }
.modal {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  animation: modalSlide 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalSlide { from { transform:translateY(100%); } to { transform:translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface); color: var(--text-secondary);
  transition: background var(--transition);
}
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-body p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.modal-link { color: var(--accent-blue); font-size: 13px; }
.modal-input {
  width: 100%; padding: 12px 14px;
  background: var(--bg-base);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary); outline: none;
  transition: border-color var(--transition);
}
.modal-input:focus { border-color: var(--accent-purple); }
.modal-footer {
  display: flex; gap: 10px; padding: 16px 20px;
  border-top: 1px solid var(--border);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.btn-primary, .btn-secondary {
  flex: 1; padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-primary { background: linear-gradient(135deg, #6366f1, #3b82f6); color: white; }
.btn-secondary { background: var(--bg-surface); color: var(--text-secondary); }
.btn-primary:active, .btn-secondary:active { transform: scale(0.97); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 900;
  white-space: nowrap;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.toast.hidden { display: none; }
@keyframes toastIn { from { opacity:0; transform:translateX(-50%) translateY(10px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ── GLOW EFFECT for next arriving low-floor ── */
.arrival-card.lowfloor.next-arrival {
  box-shadow: 0 0 0 1px rgba(16,185,129,0.3), 0 4px 20px rgba(16,185,129,0.15);
}
.arrival-card.wheelchair.next-arrival {
  box-shadow: 0 0 0 1px rgba(99,102,241,0.4), 0 4px 20px rgba(99,102,241,0.2);
}
.next-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 99px; background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: white; margin-left: auto;
}

/* ── PULSE DOT (live) ── */
.live-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent-green);
  animation: livePulse 2s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes livePulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.5;transform:scale(0.7);} }
