/* ── 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;
}
html {
  height: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
}
body {
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
  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;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}

/* ── DESKTOP: 폰 프레임 레이아웃 ── */
@media (min-width: 600px) {
  body {
    position: static;
    overflow: auto;
    height: auto;
    min-height: 100vh;
    background: #050810;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 32px 0 48px;
    /* 배경 그리드 패턴 */
    background-image:
      radial-gradient(ellipse 60% 40% at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 70%),
      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: 100% 100%, 40px 40px, 40px 40px;
  }

  /* 상단 워드마크 배너 */
  body::before {
    content: 'wheeling-guide';
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.25);
    margin-bottom: 20px;
    text-transform: lowercase;
    font-family: 'Pretendard', -apple-system, sans-serif;
  }

  .splash {
    position: relative;
    inset: auto;
    width: 390px;
    height: 844px;
    border-radius: 44px;
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.08),
      0 32px 80px rgba(0,0,0,0.7),
      inset 0 1px 0 rgba(255,255,255,0.06);
    flex-shrink: 0;
  }

  .app {
    position: relative;
    inset: auto;
    width: 390px;
    height: 844px;
    border-radius: 44px;
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.08),
      0 32px 80px rgba(0,0,0,0.7),
      inset 0 1px 0 rgba(255,255,255,0.06);
    flex-shrink: 0;
    /* 폰 노치 효과 */
    background-clip: padding-box;
  }

  /* 폰 프레임 하단 안내 */
  body::after {
    content: '모바일 앱 미리보기 — 실제 기기에서는 전체 화면으로 표시됩니다';
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    margin-top: 20px;
    font-family: 'Pretendard', -apple-system, sans-serif;
    text-align: center;
  }

  /* 데스크탑에서 모달은 앱 내부에서 표시 */
  .modal-overlay {
    position: absolute;
    border-radius: 44px;
  }

  /* 토스트도 앱 기준 */
  .toast {
    position: absolute;
    bottom: 90px;
  }
}

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);
  /* 데스크탑 override는 위 @media에서 처리 */
}
.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: 16px 20px 10px;
  background: linear-gradient(180deg, rgba(99,102,241,0.1) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.hero-text { margin-bottom: 10px; }
.hero-title {
  font-size: 18px; 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: 11px; margin-top: 2px; }

/* ── 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);
}
.city-select {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
  height: 48px;
}
.city-select option {
  background: var(--bg-card2);
  color: var(--text-primary);
}
.search-divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
  flex-shrink: 0;
  margin: 0 4px;
}
.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: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 0;
  overflow: hidden;
}
.stat-card {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; min-width: 0;
  justify-content: center;
}
.stat-icon { font-size: 18px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-num { font-size: 15px; font-weight: 800; color: var(--text-primary); text-align: center; }
.stat-label { font-size: 9px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.stat-divider { width: 1px; height: 26px; background: var(--border); flex-shrink: 0; }

/* ── SECTIONS ── */
.stops-section { padding: 4px 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 6px;
}
.section-title { font-size: 13px; font-weight: 700; }
.section-action {
  font-size: 11px; color: var(--text-secondary);
  padding: 2px 6px; border-radius: 4px;
  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: 6px; padding: 0 20px; }
.stop-list.padded { padding: 12px 20px; }
.stop-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  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: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #1e2d45, #2d3f5f);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.stop-chip-body { flex: 1; min-width: 0; }
.stop-chip-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-chip-sub { color: var(--text-secondary); font-size: 11px; margin-top: 1px; }
.stop-chip-arrow { color: var(--text-muted); flex-shrink: 0; width: 14px; height: 14px; }
.empty-state-small {
  padding: 8px 0; text-align: center;
  color: var(--text-muted); font-size: 12px;
}

/* ── INFO SECTION ── */
.info-section { padding: 8px 0 16px; }
.info-cards-row {
  display: flex; gap: 8px;
  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: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
}
.info-card-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 6px;
}
.info-card h4 { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.info-card p { font-size: 10px; color: var(--text-secondary); line-height: 1.4; }

/* ── 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);} }

/* ── STOP ACCESSIBILITY CARD ── */
.accessibility-card {
  margin: 10px 20px 2px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.access-metrics {
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 12px;
}
.metric-item {
  color: var(--text-secondary);
}
.metric-item strong {
  color: var(--text-primary);
  font-weight: 600;
  margin-left: 4px;
}
.metric-divider {
  width: 1px;
  height: 12px;
  background: var(--border);
}
.danger-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
}
.danger-icon {
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.danger-text {
  font-size: 11px;
  color: #f87171;
  line-height: 1.4;
}

/* ── SAFETY & SOS ACTION BAR ── */
.arrival-action-bar {
  padding: 6px 20px;
  display: flex;
  justify-content: stretch;
}
.action-btn {
  flex: 1;
  height: 40px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.safety-sos-btn {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
}
.safety-sos-btn:active {
  transform: scale(0.98);
}

/* ── ALTERNATIVE TRANSPORT BANNER ── */
.alt-transport-banner {
  margin: 10px 20px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alt-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.alt-icon {
  font-size: 15px;
}
.alt-transport-banner h4 {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
}
.alt-transport-banner p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.alt-btn-group {
  display: flex;
  gap: 8px;
}
.alt-btn {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: filter var(--transition);
}
.alt-btn:active {
  filter: brightness(0.9);
}
.tel-btn {
  background: #f59e0b;
  color: #0f172a;
}
.link-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

/* ── BOTTOM SHEET OVERLAY ── */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.25s ease;
}
@media (min-width: 600px) {
  .bottom-sheet-overlay {
    position: absolute;
    border-radius: 44px;
    overflow: hidden;
  }
}
.bottom-sheet-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.bottom-sheet-overlay.hidden .bottom-sheet {
  transform: translateY(100%);
}
.bottom-sheet {
  width: 100%;
  max-width: 390px;
  background: #0f172a;
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  box-sizing: border-box;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}
@media (min-width: 600px) {
  .bottom-sheet {
    border-radius: 20px 20px 44px 44px;
  }
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sheet-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}
.sheet-close {
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
}
.sheet-close:hover {
  background: var(--bg-card2);
}
.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* CHECKLIST STYLE */
.checklist-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.check-item input[type="checkbox"] {
  display: none;
}
.check-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
}
.check-item input[type="checkbox"]:checked + .check-box {
  background: #6366f1;
  border-color: #6366f1;
}
.check-item input[type="checkbox"]:checked + .check-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check-label {
  font-size: 12px;
  color: var(--text-primary);
  user-select: none;
}
.check-item input[type="checkbox"]:checked ~ .check-label {
  color: var(--text-secondary);
  text-decoration: line-through;
  opacity: 0.8;
}

.sheet-divider {
  height: 1px;
  background: var(--border);
}
.sos-form p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
}

/* ── REAL-TIME MAP STYLING ── */
.map-container {
  height: 250px;
  margin: 10px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  z-index: 10;
}
.map-custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}
.marker-pin {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  border: 1.5px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  animation: markerBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.2s;
}
.marker-pin:active {
  transform: scale(0.9);
}
@keyframes markerBounce {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* LEAFLET TOOLTIP CUSTOMIZATION */
.leaflet-tooltip {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 6px !important;
  font-family: 'Pretendard', sans-serif !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 4px 8px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}
.leaflet-tooltip-top::before {
  border-top-color: #0f172a !important;
}

/* LEAFLET BRANDING HIDER */
.leaflet-control-attribution {
  display: none !important;
}
