/* ==========================================
   CSS ZONE 1: VARIABLES & RESET
   Build Version: 2026.10.17.2300
   ========================================== */
:root {
  --theme-color: #059669;
  --theme-hover: #10b981;
  --bg-light: #121212;
  --bg-white: #1c1c1e;
  --bg-surface: #1c1c1e;
  --text-main: #ffffff;
  --text-sub: #98989d;
  --border-color: #2c2c2e;
  --accent-blue: #0a84ff;
  --accent-green: #30d158;
  --accent-orange: #ff9f0a;
  --accent-red: #ff453a;
  color-scheme: dark;
}

:root.light-mode {
  --bg-light: #f3f4f6;
  --bg-white: #ffffff;
  --bg-surface: #ffffff;
  --text-main: #0f172a;
  --text-sub: #64748b;
  --border-color: #e2e8f0;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  transition: font-size 0.2s ease-in-out;
  width: 100%;
  height: 100%;
}
html.text-sm { font-size: 14px; }
html.text-xs { font-size: 12px; }

.leaflet-container *, .leaflet-pane img, .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow {
  box-sizing: content-box !important;
}
.leaflet-container { background-color: var(--bg-light) !important; }
.leaflet-tile-container, .leaflet-tile { background-color: transparent !important; }

html, body {
  background-color: var(--bg-light) !important;
  overscroll-behavior-y: contain;
}

body {
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ==========================================
   CSS ZONE 2: TOP BAR & NAVIGATION
   ========================================== */
.app-switcher {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  height: calc(48px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  flex-shrink: 0;
  z-index: 2000;
}
.app-switcher-item {
  flex: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  color: var(--text-sub);
  font-size: 0.92rem;
  font-weight: 800;
  border-right: 1px solid var(--border-color);
  border-bottom: 2px solid transparent;
  transition: background 0.2s, color 0.2s;
  touch-action: manipulation;
}
.app-switcher-item.logo-only {
  flex: 0.75;
  font-size: 1.25rem;
}
.app-switcher-item.active {
  color: var(--theme-color);
  border-bottom: 2px solid var(--theme-color);
  background: rgba(5, 150, 105, 0.08);
}
.app-switcher-item:active:not(.active) { background: var(--bg-light); }

.utility-btn {
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-left: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s ease;
  touch-action: manipulation;
  position: relative;
}
.utility-btn:active { background: var(--bg-light); transform: scale(0.92); }
.utility-sub-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 0.52rem;
  font-weight: 900;
  color: var(--accent-blue);
  line-height: 1;
  letter-spacing: -0.2px;
}
#backBtn {
  border-left: none;
  border-right: 1px solid var(--border-color);
  font-size: 2rem;
  display: none;
  line-height: 1;
}
#langToggleBtn { font-size: 0.95rem; }

.alert-banner, .offline-banner {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  flex-shrink: 0;
}
.alert-banner {
  background: rgba(255, 69, 58, 0.18);
  border-bottom: 1px solid rgba(255, 69, 58, 0.4);
  color: #ff6961;
  z-index: 1999;
}
.offline-banner {
  background: rgba(255, 159, 10, 0.18);
  border-bottom: 1px solid rgba(255, 159, 10, 0.4);
  color: var(--accent-orange);
  font-size: 0.76rem;
  z-index: 1998;
  display: none;
}

.view-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: none;
  flex-direction: column;
  background: var(--bg-light);
  min-height: 0;
}
.view-container.active { display: flex; }

.bottom-tabs {
  background-color: var(--bg-white);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  flex-shrink: 0;
  z-index: 1001;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  flex: 1;
  height: 100%;
  cursor: pointer;
  font-size: 0.75rem;
  gap: 3px;
  transition: color 0.2s;
  touch-action: manipulation;
}
.tab.active { color: var(--theme-color); font-weight: 700; }
.tab-icon { font-size: 1.4rem; margin-bottom: 1px; }

/* ==========================================
   CSS ZONE 3: MOBILE-FIRST HEADER & ETAs
   ========================================== */
.location-header {
  background: var(--bg-white);
  padding: 10px 14px 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 6px;
  flex-shrink: 0;
}
.location-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.location-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}
.location-text {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.location-dist-pill {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--theme-hover);
  background: rgba(5, 150, 105, 0.14);
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}
.stop-dir-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 22px;
}
.stop-dir-subtitle {
  font-size: 0.78rem;
  color: var(--accent-blue);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.header-map-jump-btn {
  background: rgba(10, 132, 255, 0.14);
  border: 1px solid rgba(10, 132, 255, 0.38);
  color: var(--accent-blue);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  touch-action: manipulation;
}
.header-map-jump-btn:active { transform: scale(0.94); }

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
  opacity: 0.8;
  transition: transform 0.25s, background 0.25s, opacity 0.25s;
  cursor: pointer;
  flex-shrink: 0;
}
.sync-dot.syncing {
  background: var(--accent-blue);
  transform: scale(1.35);
  opacity: 1;
}

.section-bar, .section-banner {
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.section-bar.collapsible { cursor: pointer; }
.section-bar.collapsible:active { background: var(--bg-light); }

.quick-line-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
}
.quick-line-chip {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  touch-action: manipulation;
}
.quick-line-chip:active { transform: scale(0.95); }

.mtr-detail-header {
  background: var(--theme-color);
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  gap: 10px;
}
.mtr-detail-title {
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.mtr-reverse-btn {
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.75);
  color: #ffffff;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  touch-action: manipulation;
}
.mtr-reverse-btn:active { background: rgba(255,255,255,0.35); transform: scale(0.95); }

.detail-live-bar {
  background: var(--bg-white);
  padding: 7px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-sub);
  font-weight: 700;
  flex-shrink: 0;
  gap: 8px;
  flex-wrap: wrap;
}
.live-dot-pulse {
  color: var(--accent-green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 159, 10, 0.16);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 159, 10, 0.4);
}
.late-bus-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 159, 10, 0.18);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 159, 10, 0.45);
}
.closed-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(152, 152, 157, 0.16);
  color: var(--text-sub);
  border: 1px solid var(--border-color);
}

.route-list-item {
  display: flex;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: var(--bg-light);
  transition: background 0.15s;
  touch-action: manipulation;
}
.route-list-item.inactive-route { opacity: 0.82; }
.route-list-item:active { background: var(--bg-white); }

.route-no-col {
  min-width: 74px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.96rem;
  font-weight: 900;
  text-align: center;
  color: white;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.route-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}
.route-dest {
  font-size: 1.06rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}
.route-sub {
  font-size: 0.79rem;
  color: var(--text-sub);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.route-eta-col {
  text-align: right;
  min-width: 74px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}
.eta-time {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--accent-green);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ==========================================
   CSS ZONE 4: STOP TIMELINE, OCCUPANCY & TRANSFERS
   ========================================== */
.eta-expanded-container {
  display: none;
  flex-direction: column;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}
.eta-expanded-container.active { display: flex; }
.eta-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px dashed var(--border-color);
}
.eta-row:last-child { border-bottom: none; }
.eta-row-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.96rem;
  color: var(--text-main);
  font-weight: 700;
}
.eta-row-sub {
  font-size: 0.79rem;
  color: var(--text-sub);
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.eta-row-time {
  font-size: 1.55rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.car-pill {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(152, 152, 157, 0.16);
  color: var(--text-sub);
  border: 1px solid rgba(152, 152, 157, 0.3);
}
.load-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.load-low { background: rgba(48, 209, 88, 0.15); color: var(--accent-green); border: 1px solid rgba(48, 209, 88, 0.35); }
.load-med { background: rgba(255, 159, 10, 0.16); color: var(--accent-orange); border: 1px solid rgba(255, 159, 10, 0.4); }
.load-high { background: rgba(255, 69, 58, 0.18); color: var(--accent-red); border: 1px solid rgba(255, 69, 58, 0.45); }

.car-load-strip {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
  padding: 7px 9px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.car-load-bars { display: flex; gap: 3px; align-items: center; }
.car-load-cell {
  flex: 1;
  text-align: center;
  border-radius: 4px;
  padding: 2px 0;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.car-load-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-sub);
  font-weight: 700;
}
.bunch-tip {
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(10, 132, 255, 0.14);
  border: 1px solid rgba(10, 132, 255, 0.35);
  color: var(--accent-blue);
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.transfer-box {
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.transfer-box-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.transfer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  gap: 10px;
  transition: background 0.15s;
}
.transfer-item:active { background: rgba(10, 132, 255, 0.1); }
.transfer-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  min-width: 48px;
  text-align: center;
  white-space: nowrap;
}

#map-container {
  height: 34vh;
  width: 100%;
  background: var(--bg-light);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}
#stop-list-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
  background: var(--bg-light);
  padding-bottom: 80px;
}

.stop-item {
  position: relative;
  padding: 15px 14px 15px 48px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  background: var(--bg-light);
  transition: background 0.2s;
}
.stop-item.active-stop { background: var(--bg-white); }
.stop-line { position: absolute; left: 26px; top: 0; bottom: 0; width: 4px; z-index: 1; }
.stop-item:first-child .stop-line { top: 24px; }
.stop-item:last-child .stop-line { bottom: auto; height: 24px; }
.stop-dot {
  position: absolute;
  left: 18px;
  top: 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #98989d;
  border: 4px solid var(--bg-light);
  z-index: 2;
  transition: transform 0.2s, background 0.2s;
}
.stop-item.active-stop .stop-dot {
  background: var(--theme-color);
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.35);
  transform: scale(1.12);
}
.stop-header-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stop-name { font-size: 1.03rem; font-weight: 700; color: var(--text-main); line-height: 1.3; }
.stop-meta-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.stop-dist-badge { font-size: 0.74rem; font-weight: 800; color: var(--theme-hover); display: inline-flex; align-items: center; gap: 2px; }
.nearest-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(10,132,255,0.2);
  color: var(--accent-blue);
  border: 1px solid rgba(10,132,255,0.4);
  vertical-align: middle;
  text-transform: uppercase;
}
.interchange-mini-pill {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 900;
  color: #fff;
  vertical-align: middle;
  white-space: nowrap;
}

.stop-bm-btn, .del-fav-btn, .bm-move-btn {
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}
.stop-bm-btn {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
  transition: all 0.15s ease;
}
.stop-bm-btn.saved {
  background: rgba(255, 159, 10, 0.16);
  border-color: rgba(255, 159, 10, 0.55);
  color: var(--accent-orange);
}
.stop-bm-btn:active, .bm-move-btn:active, .del-fav-btn:active { transform: scale(0.9); }

.bm-actions-col {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.bm-order-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bm-move-btn {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  width: 28px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 900;
}
.del-fav-btn {
  background: rgba(227, 24, 55, 0.15);
  border: 1px solid rgba(227, 24, 55, 0.32);
  color: #ef4444;
  width: 38px;
  height: 46px;
  font-size: 1.05rem;
}

/* ==========================================
   CSS ZONE 5: BROWSE, MAP LAYER TOGGLES & POPUPS
   ========================================== */
.search-box-container {
  padding: 12px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  font-size: 1.02rem;
  outline: none;
  text-align: center;
  background: var(--bg-light);
  color: var(--text-main);
  font-weight: 700;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--theme-color); }
.region-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.region-filters::-webkit-scrollbar { display: none; }
.region-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-light);
  color: var(--text-sub);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
}
.region-btn.active {
  background: var(--theme-color);
  color: white;
  border-color: var(--theme-color);
}

#global-map-container { flex: 1; width: 100%; background: var(--bg-light); z-index: 1; position: relative; }
.map-filter-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1002;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 70px);
  pointer-events: auto;
}
.map-layer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  background: var(--bg-white);
  color: var(--text-sub);
  border: 1.5px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.map-layer-pill.active-hr {
  background: var(--theme-color);
  color: #fff;
  border-color: #fff;
}
.map-layer-pill.active-lrt {
  background: #eab308;
  color: #111;
  border-color: #fff;
}
.map-layer-pill.active-ferry {
  background: #0077be;
  color: #fff;
  border-color: #fff;
}

.map-bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  max-height: 68vh;
  overflow-y: auto;
  z-index: 1005;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.1, 0.8, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
}
.map-bottom-sheet.active { transform: translateY(0); }
.sheet-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: var(--bg-white);
  z-index: 2;
  gap: 10px;
}
.sheet-title { font-size: 1.18rem; font-weight: 800; }
.sheet-close { font-size: 1.5rem; font-weight: bold; color: var(--text-sub); cursor: pointer; background: none; border: none; line-height: 1; }

.text-center { text-align: center; padding: 40px 20px; color: var(--text-sub); font-size: 1.05rem; }
.init-loader { padding: 70px 20px; text-align: center; }

.leaflet-control-zoom a {
  background-color: var(--bg-surface) !important;
  color: var(--text-main) !important;
  border-bottom: 1px solid var(--border-color) !important;
}
.leaflet-control-layers {
  background-color: var(--bg-surface) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5) !important;
}
.leaflet-control-layers-expanded { padding: 8px 12px !important; font-weight: 700 !important; }
.mtr-map-stop-label {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1.5px solid #222222 !important;
  border-radius: 6px !important;
  padding: 3px 9px !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35) !important;
  white-space: nowrap !important;
}
.leaflet-gps-lock-btn {
  background-color: var(--bg-white) !important;
  width: 36px !important;
  height: 36px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 10px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.65) !important;
  border: 1.5px solid var(--border-color) !important;
  transition: all 0.2s ease !important;
  position: relative !important;
}
.leaflet-gps-lock-btn.locked {
  border-color: var(--accent-blue) !important;
  background-color: rgba(10, 132, 255, 0.14) !important;
  box-shadow: 0 0 12px rgba(10, 132, 255, 0.65) !important;
}
.gps-lock-state-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-sub);
  opacity: 0.45;
  transition: all 0.2s ease;
}
.leaflet-gps-lock-btn.locked .gps-lock-state-dot {
  background: var(--accent-blue);
  opacity: 1;
  box-shadow: 0 0 6px var(--accent-blue);
}

html:not(.light-mode) .dark-tiles { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); }
.custom-user-icon div {
  width: 100% !important;
  height: 100% !important;
  background: #0a84ff !important;
  border-radius: 50% !important;
  border: 3px solid white !important;
  box-shadow: 0 0 12px rgba(0,0,0,0.85) !important;
}

.toast-msg {
  position: fixed;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(28, 28, 30, 0.95);
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 800;
  z-index: 4000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}
.toast-msg.show { opacity: 1; transform: translateX(-50%) translateY(0); }
