/* ==========================================
   ZgzMov — Transporte Zaragoza PWA
   ========================================== */

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

/* Variables — Light theme (default) */
:root {
  --bg: #f8f8f8;
  --surface: #ffffff;
  --card: #ffffff;
  --card-active: #f0f0f0;
  --border: #e5e5e5;
  --border-light: #d4d4d4;
  --primary: #2563eb;
  --primary-dim: rgba(37,99,235,.1);
  --text: #111111;
  --text-secondary: #525252;
  --text-muted: #a3a3a3;
  --green: #16a34a;
  --green-dim: rgba(22,163,74,.1);
  --yellow: #ca8a04;
  --yellow-dim: rgba(202,138,4,.1);
  --red: #dc2626;
  --red-dim: rgba(220,38,38,.1);
  --purple: #9333ea;
  --purple-dim: rgba(147,51,234,.1);
  --bus-color: #711D69;
  --bus-dim: rgba(113,29,105,.1);
  --tram-color: #DB0C1D;
  --tram-dim: rgba(219,12,29,.1);
  --bizi-color: #54A097;
  --bizi-dim: rgba(84,160,151,.1);
  --shadow: rgba(0,0,0,.06);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --header-h: 56px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #141414;
  --card: #1a1a1a;
  --card-active: #222;
  --border: #262626;
  --border-light: #333;
  --primary: #3b82f6;
  --primary-dim: rgba(59,130,246,.12);
  --text: #f0f0f0;
  --text-secondary: #999;
  --text-muted: #666;
  --green: #22c55e;
  --green-dim: rgba(34,197,94,.12);
  --yellow: #eab308;
  --yellow-dim: rgba(234,179,8,.12);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,.12);
  --purple: #a855f7;
  --purple-dim: rgba(168,85,247,.12);
  --bus-color: #8B3583;
  --bus-dim: rgba(139,53,131,.12);
  --tram-color: #EF4444;
  --tram-dim: rgba(239,68,68,.12);
  --bizi-color: #6BBAB2;
  --bizi-dim: rgba(107,186,178,.12);
  --shadow: rgba(0,0,0,.3);
}

/* App layout */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Header */
#app-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
  gap: 12px;
}
#app-header .logo {
  height: 30px;
  width: auto;
  object-fit: contain;
}
#app-header .header-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
#app-header .header-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.header-btn:active {
  background: var(--card);
  color: var(--text);
}

/* Main */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Views */
.view {
  display: none;
  padding: 16px 16px calc(16px + var(--safe-b));
  min-height: 100%;
  animation: viewIn .2s ease;
}
.view.active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bottom Nav */
#bottom-nav {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
  flex-shrink: 0;
  z-index: 100;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.nav-btn svg { width: 22px; height: 22px; transition: color .15s; }
.nav-btn.active {
  color: var(--primary);
}
.nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--primary);
  border-radius: 0 0 2px 2px;
}

/* Section headers */
.section-title {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
  padding: 0 2px;
}
.view-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 16px;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}
.card:active { background: var(--card-active); }
.card-clickable { cursor: pointer; }

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.card-header .card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-icon svg { width: 18px; height: 18px; }
.card-icon.bus { background: var(--bus-dim); color: var(--bus-color); }
.card-icon.tram { background: var(--tram-dim); color: var(--tram-color); }
.card-icon.bizi { background: var(--bizi-dim); color: var(--bizi-color); }

.card-title {
  font-size: .9rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-subtitle {
  font-size: .75rem;
  color: var(--text-secondary);
}

.fav-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color .15s, transform .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.fav-btn:active { transform: scale(.85); }
.fav-btn.is-fav { color: var(--yellow); }
.fav-btn svg { width: 20px; height: 20px; }

/* Share button */
.share-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color .15s, transform .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.share-btn:active { transform: scale(.85); color: var(--accent); }

/* Arrival times */
.arrivals {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.arrival-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface);
}
.arrival-line {
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  min-width: 40px;
  text-align: center;
  white-space: nowrap;
}
.arrival-line.bus-line { background: var(--bus-dim); color: var(--bus-color); }
.arrival-line.tram-line { background: var(--tram-dim); color: var(--tram-color); }

.arrival-dest {
  flex: 1;
  font-size: .8rem;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arrival-times {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.arrival-time {
  font-size: .8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--card);
  white-space: nowrap;
}
.arrival-time.imminent {
  background: var(--green-dim);
  color: var(--green);
}

/* Bizi availability */
.bizi-stats {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.bizi-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  flex: 1;
}
.bizi-stat svg { width: 18px; height: 18px; }
.bizi-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
}
.bizi-stat-label {
  font-size: .7rem;
  color: var(--text-secondary);
}
.bizi-stat.bikes { color: var(--bizi-color); }
.bizi-stat.docks { color: var(--bizi-color); }
.bizi-stat.bikes .bizi-stat-value { color: var(--bizi-color); }
.bizi-stat.docks .bizi-stat-value { color: var(--bizi-color); }
.bizi-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 8px;
  overflow: hidden;
}
.bizi-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s ease;
}

/* Search */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.search-input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  font-size: .9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--text-muted); }

.filter-input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  font-size: .85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.filter-input:focus { border-color: var(--primary); }
.filter-input::placeholder { color: var(--text-muted); }
.filter-wrap {
  position: relative;
  margin-bottom: 16px;
}
.filter-wrap svg {
  position: absolute;
  left: 14px;
  top: 22px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Buttons */
.btn {
  height: 48px;
  padding: 0 24px;
  font-size: .9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .12s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { opacity: .85; transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: .8rem;
  border-radius: var(--radius-sm);
}
.btn-icon {
  width: 48px;
  padding: 0;
}
.btn svg { width: 20px; height: 20px; }

/* Type badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-bus { background: var(--bus-dim); color: var(--bus-color); }
.badge-tram { background: var(--tram-dim); color: var(--tram-color); }
.badge-bizi { background: var(--bizi-dim); color: var(--bizi-color); }

/* Map */
#map-container {
  width: 100%;
  height: calc(100dvh - var(--header-h) - var(--nav-h));
  border-radius: 0;
}
.view-map {
  padding: 0 !important;
  position: relative;
}
.map-controls {
  position: absolute;
  bottom: 24px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background .12s;
}
.map-btn:active { background: var(--card-active); }
.map-btn svg { width: 20px; height: 20px; }

.map-legend {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .7rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  background: var(--card) !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 4px 16px var(--shadow) !important;
}
.leaflet-popup-content {
  margin: 12px 14px !important;
  font-size: .8rem !important;
  line-height: 1.4 !important;
}
.leaflet-popup-content b { font-weight: 600; }
.leaflet-popup-tip {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
}
.leaflet-popup-close-button {
  color: var(--text-secondary) !important;
}

/* Loading & empty states */
.state-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.state-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: .4;
}
.state-empty p {
  font-size: .85rem;
  line-height: 1.6;
}
.state-empty .state-title {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: var(--text-muted);
  gap: 10px;
  font-size: .85rem;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: var(--border);
  border-radius: var(--radius-xs);
  animation: pulse 1.5s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .5; }
  50% { opacity: .2; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  pointer-events: none;
  text-align: center;
  max-width: calc(100vw - 32px);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Error inline */
.error-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: .85rem;
  margin-bottom: 12px;
}
.error-msg svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Updated time label */
.updated-label {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.updated-label svg { width: 12px; height: 12px; }

/* Welcome card */
.welcome-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.welcome-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.welcome-card p {
  font-size: .85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.welcome-tips {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.welcome-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--text-secondary);
}
.welcome-tip .tip-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.welcome-tip .tip-icon svg { width: 16px; height: 16px; }
.welcome-tip .tip-icon.bus { background: var(--bus-dim); color: var(--bus-color); }
.welcome-tip .tip-icon.tram { background: var(--tram-dim); color: var(--tram-color); }
.welcome-tip .tip-icon.bizi { background: var(--bizi-dim); color: var(--bizi-color); }

/* Install card */
.install-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.install-card-inner {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.install-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.install-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.install-card-text strong {
  font-size: .88rem;
  font-weight: 600;
}
.install-card-text span {
  font-size: .78rem;
  color: var(--text-secondary);
}
.install-card .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Stop list items */
.stop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}
.stop-item.expanded {
  margin-bottom: 0;
  border-bottom-left-radius: 0;
}
.stop-item:active { background: var(--card-active); }
.stop-item .stop-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stop-item .stop-icon svg { width: 18px; height: 18px; }
.stop-item .stop-name {
  flex: 1;
  font-size: .85rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stop-item .stop-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s ease;
}
.stop-item .stop-arrow.open {
  transform: rotate(90deg);
}
.stop-item .stop-arrow svg { width: 16px; height: 16px; }

/* Expanded stop detail — threaded replies */
.stop-detail {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .35s ease, opacity .25s ease;
  margin-left: 18px;
  padding-left: 18px;
  border-left: 2px solid var(--border);
}
.stop-detail.open {
  max-height: 1200px;
  opacity: 1;
  padding-top: 4px;
  padding-bottom: 4px;
}

.tram-direction-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  position: relative;
}
.tram-direction-card:last-child {
  margin-bottom: 0;
}
.tram-direction-card::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 18px;
  width: 16px;
  height: 2px;
  background: var(--border);
}
.tram-direction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.direction-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--tram-color);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 12px;
  margin-bottom: 6px;
}
.direction-label:first-child { margin-top: 0; }

/* Refresh indicator */
.refresh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .75rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  transition: background .12s, color .12s;
}
.refresh-btn:active { background: var(--card); color: var(--text); }
.refresh-btn svg { width: 14px; height: 14px; }
.refresh-btn.refreshing svg { animation: spin .6s linear infinite; }

/* Helper */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }

/* Scrollbar */
#main-content::-webkit-scrollbar { width: 0; }

/* Settings */
.settings-section {
  margin-bottom: 20px;
}
.settings-section-title {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
  padding: 0 2px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.settings-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-row-left svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}
.settings-label {
  font-size: .9rem;
  font-weight: 500;
}
.settings-desc {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle input:checked + .toggle-track {
  background: var(--primary);
}
.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* Theme select buttons */
.theme-options {
  display: flex;
  gap: 8px;
}
.theme-option {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.theme-option:active { background: var(--card-active); }
.theme-option.active {
  border-color: var(--primary);
  background: var(--primary-dim);
  color: var(--primary);
}
.theme-option svg {
  width: 18px;
  height: 18px;
  margin-bottom: 4px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.settings-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.settings-footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Desktop tweaks */
@media (min-width: 601px) {
  #app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* Bus search mode tabs */
.bus-mode-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 16px 12px;
}
.mode-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: var(--card);
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.mode-tab + .mode-tab {
  border-left: 1px solid var(--border);
}
.mode-tab.active {
  background: var(--bus-color);
  color: #fff;
}

/* Street search results list */
.street-result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.street-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.street-result-item:active {
  background: var(--bg-secondary);
}
.street-result-id {
  min-width: 44px;
  text-align: center;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
  background: var(--bus-color);
  padding: 4px 8px;
  border-radius: 6px;
}
.street-result-info {
  flex: 1;
  min-width: 0;
}
.street-result-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.street-result-lines {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
