/* ==========================================================================
   TEC LIVE - DESIGN OFFICIEL LIGHT MODE (INSPIRATION APPLICATION WEB TEC)
   Minimaliste, lumineux, ultra-lisible et performant sur smartphone
   ========================================================================== */

:root {
  /* Arrière-plans & Surfaces */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-glass: #e2e8f0;
  --border-focus: #f59e0b;
  
  /* Palette Officielle TEC */
  --tec-yellow: #FFCC00;
  --tec-yellow-dark: #E5B800;
  --tec-yellow-rgb: 255, 204, 0;
  --tec-yellow-glow: rgba(255, 204, 0, 0.25);
  --tec-red: #EF4444;
  
  /* Statuts de Ponctualité */
  --status-ontime: #059669;
  --status-ontime-bg: #ecfdf5;
  --status-delayed: #DC2626;
  --status-delayed-bg: #fef2f2;
  --status-early: #2563EB;
  --status-early-bg: #eff6ff;
  --status-cancelled: #6B7280;
  --status-cancelled-bg: #f3f4f6;

  /* Typographie & Couleurs Riches */
  --ink: #0e1118;
  --ink-2: #334155;
  --ink-3: #64748B;
  --text-primary: #0e1118;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-on-accent: #000000;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Rayons, Transitions & Ombres */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.10), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  font-family: var(--font-main);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* ==========================================================================
   CARTE LEAFLET
   ========================================================================== */
#map {
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #e2e8f0;
}


.leaflet-bar {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
}

.leaflet-bar a {
  background-color: #ffffff !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-glass) !important;
  transition: all 0.2s ease;
}

.leaflet-bar a:hover {
  background-color: #f8fafc !important;
  color: var(--tec-yellow-dark) !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.85) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
  backdrop-filter: blur(4px);
  border-radius: 4px;
  padding: 2px 6px !important;
}

.leaflet-control-attribution a {
  color: var(--text-secondary) !important;
  text-decoration: none;
}

/* ==========================================================================
   BARRE SUPÉRIEURE FLOTTANTE
   ========================================================================== */
/* ==========================================================================
   BARRE SUPÉRIEURE FLOTTANTE / ÎLOT STYLE APPLE MAPS & TRANSIT
   ========================================================================== */
#top-bar.search-island {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}

body.tracking-active #top-bar,
body.tracking-active #zoom-hint {
  display: none !important;
}

/* Badge Brand (Visible sur desktop) */
.brand-badge {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  user-select: none;
  flex-shrink: 0;
}

.brand-tec {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #000000;
  background: var(--tec-yellow);
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.brand-live {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-ontime);
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.4);
  animation: pulse-live 2s infinite ease-in-out;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Carte Îlot Unique (Island Card) */
.island-card {
  pointer-events: auto;
  position: relative;
  flex: 1;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.island-card:focus-within {
  border-color: rgba(255, 204, 0, 0.8);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(255, 204, 0, 0.25);
}

/* Ligne principale : Province + Separator + Input + Fleet */
.island-main-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 4px;
}

/* Sélecteur de Province */
.province-dropdown-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 1300;
}

.province-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 9px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.province-badge-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.province-badge-btn .province-name {
  max-width: 65px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.province-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #eab308;
  flex-shrink: 0;
}

.province-arrow {
  color: #64748b;
  transition: transform 0.2s ease;
}

.province-dropdown-wrap.open .province-arrow {
  transform: rotate(180deg);
}

.province-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 220px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.18), 0 8px 16px -4px rgba(0, 0, 0, 0.08);
  padding: 6px;
  z-index: 2000;
  animation: dropdownFadeIn 0.18s ease-out;
}

.province-dropdown-header {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  padding: 6px 10px 4px;
}

.province-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.province-option:hover {
  background: #f8fafc;
}

.province-option.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.prov-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  background: #e2e8f0;
  color: #334155;
  flex-shrink: 0;
}

.prov-tag-lg { background: #fef08a; color: #854d0e; }
.prov-tag-na { background: #bae6fd; color: #0369a1; }
.prov-tag-ch { background: #fecdd3; color: #9f1239; }
.prov-tag-bw { background: #e9d5ff; color: #6b21a8; }
.prov-tag-lux { background: #bbf7d0; color: #166534; }
.prov-tag-all { background: #cbd5e1; color: #0f172a; }

.prov-label {
  flex: 1;
}

.prov-check {
  font-size: 12px;
  font-weight: 800;
  color: #2563eb;
}

/* Séparateur vertical fin */
.island-sep {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  flex-shrink: 0;
}

/* Champ de recherche dans l'îlot */
.island-search-field {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.island-search-field .search-icon {
  position: absolute;
  left: 6px;
  width: 15px;
  height: 15px;
  color: #94a3b8;
  pointer-events: none;
  display: block;
}

.island-search-field input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 26px 0 28px;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 500;
  color: #0f172a;
}

.island-search-field input::placeholder {
  color: #94a3b8;
  font-weight: 450;
}

#search-clear-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#search-clear-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

/* Bouton Flotte intégré à l'îlot */
.island-fleet-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9999px;
  background: #0f172a;
  color: #ffffff;
  border: none;
  font-family: var(--font-main);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.island-fleet-btn:hover {
  background: #1e293b;
  transform: scale(1.02);
}

.island-fleet-btn.active {
  background: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.fleet-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: fleetPulse 2s infinite;
}

@keyframes fleetPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Ligne 2 : Filtres de Catégories (Apple Segmented Control) */
.search-category-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 12px;
}

.cat-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.cat-pill:hover {
  color: #0f172a;
}

.cat-pill.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 750;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04);
}

.cat-pill-icon {
  font-size: 12px;
}

/* Bannière de filtrage de ligne active (ex: Ligne 26 filtrée) */
.route-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding: 4px 10px 4px 6px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: filterBannerSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.route-filter-banner.hidden {
  display: none !important;
}

@keyframes filterBannerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.route-filter-badge-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-filter-badge-line {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background-color: #FFCC00;
  color: #000000;
  letter-spacing: -0.2px;
}

.route-filter-badge-text {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: -0.1px;
}

.route-filter-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  border: none;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}

.route-filter-close:hover,
.route-filter-close:active {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

/* En-têtes de groupes dans les résultats de recherche */
.search-group-header {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
  padding: 8px 10px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-group-badge {
  font-size: 10px;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 700;
}

.search-result-item .result-live-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(167, 243, 208, 0.8);
  margin-left: auto;
}

.search-nearby-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #0284c7;
  font-weight: 600;
  margin-top: 2px;
}

/* Menu déroulant des résultats de recherche */
#search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.16), 0 6px 12px -2px rgba(0, 0, 0, 0.06);
  padding: 6px;
  z-index: 1500;
  overscroll-behavior: contain;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover, .search-result-item.selected {
  background: var(--bg-card-hover);
}

.result-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #fefce8;
  border: 1px solid #fef08a;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.result-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.search-lines-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.search-line-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 750;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 6px;
  line-height: 1.3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Sélecteur rapide de villes */
.city-chips {
  pointer-events: auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.city-chips::-webkit-scrollbar {
  display: none;
}

.city-chip {
  padding: 7px 13px;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.city-chip:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.city-chip.active {
  background: var(--tec-yellow);
  color: #000000;
  border-color: var(--tec-yellow-dark);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(255, 204, 0, 0.4);
}

/* Bouton Flotte active */
.icon-action-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 44px;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.icon-action-btn:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.icon-action-btn.active {
  background: var(--tec-yellow);
  color: #000000;
  border-color: var(--tec-yellow-dark);
  box-shadow: 0 2px 8px rgba(255, 204, 0, 0.4);
}

/* Alerte Zoom Hint Flottante & Discrète */
.zoom-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  pointer-events: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.zoom-hint svg {
  width: 15px;
  height: 15px;
  color: var(--tec-yellow);
  flex-shrink: 0;
}

.zoom-hint-text-mobile {
  display: none;
}

body.drawer-open #zoom-hint,
body.tracking-active #zoom-hint {
  display: none !important;
}

/* ==========================================================================
   MAPCN / SHADCN-UI CONTROLS & MAPLIBRE STYLING
   ========================================================================== */
.mapcn-controls {
  position: absolute;
  bottom: 24px;
  right: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mapcn-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.mapcn-btn:hover {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.mapcn-btn:active {
  transform: scale(0.96);
}

/* Groupe de Zoom unifié shadcn/ui */
.mapcn-zoom-group {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.mapcn-zoom-btn {
  width: 42px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mapcn-zoom-btn:hover {
  background: rgba(241, 245, 249, 0.8);
  color: #0f172a;
}

.mapcn-zoom-btn:active {
  background: rgba(226, 232, 240, 0.9);
}

.mapcn-zoom-divider {
  width: 24px;
  height: 1px;
  margin: 0 auto;
  background: rgba(226, 232, 240, 0.9);
}

/* Popover Sélecteur de styles de carte (CARTO) */
.mapcn-popover-wrap {
  position: relative;
}

.mapcn-styles-menu {
  position: absolute;
  bottom: 0;
  right: 52px;
  width: 260px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15), 0 2px 6px rgba(15, 23, 42, 0.05);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1050;
  transform-origin: bottom right;
  animation: mapcnMenuPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mapcnMenuPop {
  from { opacity: 0; transform: scale(0.95) translateX(6px); }
  to { opacity: 1; transform: scale(1) translateX(0); }
}

.mapcn-menu-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 6px 10px 4px 10px;
}

.mapcn-style-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.mapcn-style-opt:hover {
  background: #f1f5f9;
}

.mapcn-style-opt.active {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mapcn-opt-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.mapcn-opt-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mapcn-opt-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.mapcn-opt-sub {
  font-size: 11px;
  color: #64748b;
}

/* Bouton Flotte active shadcn/ui */
.mapcn-fleet-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.mapcn-fleet-pill * {
  pointer-events: none;
}

.mapcn-fleet-pill:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.mapcn-fleet-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.fleet-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: fleetPulse 2s infinite;
}

@keyframes fleetPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}



/* ==========================================================================
   DRAWER / BOTTOM SHEET (LIGHT MODE OFFICIEL)
   ========================================================================== */
.drawer {
  position: absolute;
  z-index: 1020;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Disposition Desktop */
@media (min-width: 768px) {
  .drawer {
    top: 118px;
    left: 16px;
    width: 420px;
    max-height: calc(100vh - 136px);
    max-height: calc(100dvh - 136px);
    border-radius: var(--radius-lg);
    transform: translateX(-120%);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  }

  .drawer.open {
    transform: translateX(0);
  }

  .drawer-handle-bar {
    display: none;
  }
}

/* Disposition Mobile-First Tactile Style Apple Maps & Transit */
@media (max-width: 767px) {
  #top-bar.search-island {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 0;
  }

  .brand-badge {
    display: none !important; /* Aucun encombrement superflu sur smartphone */
  }

  .island-card {
    max-width: 100%;
    border-radius: 18px;
    padding: 5px;
    gap: 5px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  }

  .island-main-row {
    height: 38px;
    gap: 5px;
    padding: 0 2px;
  }

  .province-badge-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 11.5px;
  }

  .province-badge-btn .province-name {
    max-width: 55px;
  }

  .island-search-field input {
    font-size: 13.5px;
    padding: 0 24px 0 24px;
  }

  .island-search-field .search-icon {
    left: 4px;
    width: 15px;
    height: 15px;
  }

  .island-fleet-btn {
    height: 32px;
    padding: 0 9px;
    font-size: 11px;
  }

  .island-fleet-btn .fleet-btn-text {
    display: inline;
  }

  .cat-pill {
    height: 27px;
    font-size: 11px;
    padding: 0 6px;
  }

  .city-chips {
    display: none !important; /* Totalement supprimé sur mobile */
  }

  .zoom-hint-text-desktop {
    display: none;
  }

  .zoom-hint-text-mobile {
    display: inline;
  }

  .zoom-hint {
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11.5px;
    padding: 7px 15px;
    white-space: nowrap;
    max-width: 90vw;
  }

  .mapcn-controls,
  .floating-controls {
    bottom: 24px;
    right: 12px;
    gap: 8px;
  }

  .mapcn-zoom-group {
    display: none !important;
  }

  .mapcn-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  body.drawer-open .mapcn-controls,
  body.drawer-open .floating-controls {
    bottom: calc(50vh + 14px);
    transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Bottom Sheet iOS Mobile */
  .drawer {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 48vh;
    height: 48dvh;
    border-radius: 26px 26px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -8px 36px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: pan-y;
    will-change: height, transform;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
  }

  .drawer.open {
    transform: translateY(0);
  }

  .drawer.snap-peek {
    height: 110px !important;
    overflow: hidden;
  }

  .drawer.snap-half {
    height: 48vh !important;
    height: 48dvh !important;
  }

  .drawer.snap-full {
    height: 88vh !important;
    height: 88dvh !important;
  }

  .drawer.is-dragging {
    transition: none !important;
  }

  .drawer-handle-bar {
    width: 100%;
    padding: 8px 0 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }

  .drawer-handle {
    width: 36px;
    height: 5px;
    border-radius: 9999px;
    background: #cbd5e1;
    transition: background 0.2s, width 0.2s;
  }

  .drawer-handle-bar:active .drawer-handle,
  .drawer.is-dragging .drawer-handle {
    background: #94a3b8;
    width: 44px;
  }
}

/* En-tête du volet */
.drawer-header {
  padding: 12px 18px 10px 18px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
}

.stop-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.stop-title-group > div:last-child {
  min-width: 0;
  flex: 1;
}

.stop-icon-badge {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  border-radius: 12px;
  background: #fef08a;
  color: #854d0e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(234, 179, 8, 0.25);
  overflow: hidden;
}

.stop-icon-badge svg {
  width: 19px !important;
  max-width: 19px !important;
  height: 19px !important;
  max-height: 19px !important;
  flex-shrink: 0;
}

.stop-name {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.stop-id-tag {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 7px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #475569;
}

.stop-distance {
  font-size: 11.5px;
  font-weight: 600;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 6px;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.drawer-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-icon-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.05);
}

.drawer-icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Contenu du Drawer */
.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  background: #f8fafc;
}

.departures-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.refresh-countdown {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Liste des départs */
.departures-list {
  display: flex;
  flex-direction: column;
}

/* Carte de départ - Design haute lisibilité style Apple Maps Transit */
.departure-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  user-select: none;
  transition: transform 0.16s cubic-bezier(0.25, 0.8, 0.25, 1), 
              border-color 0.16s ease, 
              box-shadow 0.16s ease,
              background-color 0.16s ease;
  position: relative;
  overflow: hidden;
}

.departure-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
}

.departure-card:active {
  transform: scale(0.985);
  background-color: #f8fafc;
}

/* Badge Ligne */
.departure-card .dep-badge {
  min-width: 44px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--tec-yellow);
  color: #0e1118;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14.5px;
  border-radius: 9px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  letter-spacing: -0.2px;
}

/* Infos destination */
.departure-card .dep-title {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 14.5px;
  color: #0e1118;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.departure-card .dep-sub {
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Heure de départ planifiée */
.departure-card .time-hero {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 18px;
  color: #0e1118;
  letter-spacing: -0.5px;
}

/* Compte à rebours */
.departure-card .countdown-hero {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
  color: #0e1118;
  letter-spacing: -0.3px;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 9999px;
  background: #f1f5f9;
}

.departure-card .countdown-hero.is-imminent {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  font-size: 13px;
}

/* Puce animée temps réel */
.live-pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: liveDotPulse 1.6s infinite;
  flex-shrink: 0;
}

/* Icône d'ondes radio direct style officiel TEC */
.live-radio-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0284c7;
  flex-shrink: 0;
  animation: liveRadioWave 2s ease-in-out infinite;
}

@keyframes liveRadioWave {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.92);
  }
}

/* Skeleton Shimmer pour le chargement des départs */
.skeleton-card {
  height: 68px;
  border-radius: 14px;
  background: linear-gradient(90deg, #f8fafc 25%, #e2e8f0 50%, #f8fafc 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  margin-bottom: 9px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Badges doux de ponctualité (Style Citymapper) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  padding: 2px 7.5px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.status-pill-ontime {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(167, 243, 208, 0.85);
}

.status-pill-delay {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid rgba(254, 205, 211, 0.85);
}

.status-pill-early {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid rgba(186, 230, 253, 0.85);
}

.status-pill-scheduled {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

.status-pill-tomorrow {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  font-weight: 750;
}

/* Lignes régulières théoriques */
.serving-routes-section {
  margin-top: 14px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.serving-routes-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.serving-routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.serving-route-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  cursor: default;
}

.serving-route-pill {
  min-width: 32px;
  height: 24px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.serving-route-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Message aucun bus */
.empty-departures {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.empty-icon svg {
  width: 24px;
  height: 24px;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
}

/* ==========================================================================
   HUD FLOTTANT ULTRA-FIN (PILULE HAUTE LISIBILITÉ)
   ========================================================================== */
.vehicle-hud-pill-container {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1040;
  pointer-events: none;
  padding: 0 12px;
}

.vehicle-hud-pill-container.hidden {
  display: none !important;
}

.vehicle-hud-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 5px 8px 5px 5px;
  max-width: 96vw;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.12);
  animation: slideDownPill 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
}

@keyframes slideDownPill {
  from { transform: translateY(-14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.hud-pill-btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  color: #ffffff;
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.hud-pill-btn-back:hover {
  background: rgba(255, 255, 255, 0.24);
}

.hud-pill-btn-back:active {
  transform: scale(0.92);
}

.hud-pill-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.hud-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border-radius: 7px;
  background-color: var(--tec-yellow);
  color: #0e1118;
  font-weight: 800;
  font-size: 13px;
  font-family: var(--font-mono);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.hud-pill-arrow {
  color: #64748b;
  font-size: 11px;
  flex-shrink: 0;
}

.hud-pill-dest {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.hud-pill-bullet {
  color: #475569;
  font-size: 11px;
  flex-shrink: 0;
}

.hud-pill-next {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.hud-speed-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 8px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  color: #38bdf8;
  letter-spacing: -0.2px;
  flex-shrink: 0;
}

.hud-speed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.hud-pill-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hud-pill-btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  color: #ffffff;
  transition: all 0.15s ease;
}

.hud-pill-btn-action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hud-pill-btn-action:active {
  transform: scale(0.92);
}

@media (max-width: 480px) {
  .hud-pill-dest {
    max-width: 95px;
  }
  .hud-pill-next {
    max-width: 110px;
  }
}

/* ==========================================================================
   TRACÉ INTELLIGENT (PASSÉ vs FUTUR & FLÈCHES DE SENS)
   ========================================================================== */
.route-polyline-past {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-polyline-future {
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(255, 204, 0, 0.4));
}

.line-direction-arrow-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
}

/* ==========================================================================
   RESET LEAFLET DIVICON & MARQUEURS VECTORIELS (100% TRANSPARENT SANS FOND)
   ========================================================================== */
.leaflet-div-icon,
.custom-stop-marker-icon,
.custom-isolated-stop-marker,
.custom-trip-stop-icon,
.bus-tracking-leaflet-icon,
.custom-bus-marker,
.custom-fleet-icon,
.user-loc-wrapper {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Arrêt de Bus Individuel : Carré jaune arrondi avec icône bus noire */
.custom-stop-marker-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.stop-pin-box {
  width: 24px;
  height: 24px;
  background-color: var(--tec-yellow);
  border: 1.5px solid var(--tec-yellow-dark);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stop-pin-box svg {
  width: 14px;
  height: 14px;
}

.stop-pin-box:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.stop-pin-box.is-selected {
  transform: scale(1.25);
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Arrêt Isolé Unique (Mode consultation arrêt : un seul arrêt affiché) */
.custom-isolated-stop-marker {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.isolated-stop-pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
}

.isolated-stop-pulse {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 204, 0, 0.38);
  animation: isolatedPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes isolatedPulse {
  0% {
    transform: scale(0.85);
    opacity: 0.85;
  }
  70% {
    transform: scale(1.65);
    opacity: 0;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

.isolated-stop-icon-box {
  width: 30px;
  height: 30px;
  background-color: var(--tec-yellow);
  border: 2.5px solid #0f172a;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  z-index: 2;
  transition: transform 0.2s ease;
}

.isolated-stop-icon-box svg {
  width: 16px;
  height: 16px;
}

/* Puces d'arrêt sur la ligne suivie (blanc au centre, bordure jaune) */
.custom-trip-stop-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.trip-stop-pin {
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2.5px solid var(--tec-yellow-dark);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.trip-stop-pin:hover {
  transform: scale(1.3);
}

/* Marqueur Bus en direct */
.bus-tracking-leaflet-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.bus-live-marker {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bus-radar-pulse {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 204, 0, 0.45);
  animation: busPulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  pointer-events: none;
  z-index: 1;
}

.bus-live-icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #0e1118;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.bus-live-icon img,
.bus-live-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

.bus-live-tag {
  position: absolute;
  top: -14px;
  background: #0e1118;
  color: #FFCC00;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  padding: 1.5px 7px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  z-index: 4;
}

.bus-speed-tag {
  position: absolute;
  bottom: -11px;
  background: rgba(14, 17, 24, 0.92);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 5px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  z-index: 4;
}

@keyframes busPulseRing {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Flotte active globale */
.custom-fleet-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.bus-fleet-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.16s var(--ease-spring);
  will-change: transform;
}

.bus-fleet-pin:hover {
  transform: scale(1.22) translateY(-3px);
  z-index: 1000 !important;
}

/* Flotte active compacte (pour zooms moyens et dézoomés) */
.custom-fleet-icon-mini {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.bus-fleet-mini-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
  will-change: transform;
}

.bus-fleet-mini-pin:hover,
.bus-fleet-mini-pin:active {
  transform: scale(1.25);
  z-index: 1000 !important;
}

.bus-fleet-mini-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  color: #0e1118;
  padding: 1.5px 5px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  border: 1.5px solid #0f172a;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.bus-fleet-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  color: #0e1118;
  padding: 1.5px 6px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}

.bus-fleet-icon-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
  border: 1.5px solid #FFCC00;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.bus-fleet-svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Position utilisateur */
.user-loc-wrapper {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.user-location-marker {
  width: 16px;
  height: 16px;
  background: #2563eb;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

.user-location-pulse {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.35);
  animation: busPulseRing 2s ease-out infinite;
}

/* Tracé d'itinéraire */
.route-polyline {
  stroke: var(--tec-yellow-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   TIMELINE OFFICIELLE TEC (LIGHT MODE)
   ========================================================================== */
.tec-official-timeline {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-top: 6px;
}

.tec-timeline-header-card {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tec-timeline-line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #000000;
  background-color: var(--tec-yellow);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.tec-timeline-dest-box {
  flex: 1;
  min-width: 0;
}

.tec-timeline-dest-prefix {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
}

.tec-timeline-dest-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tec-timeline-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.tec-timeline-status-badge.is-live {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.tec-timeline-status-badge.is-scheduled {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.tec-timeline-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #059669;
  animation: radarPulse 1.8s infinite;
}

@keyframes radarPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.tec-timeline-scroll-wrap {
  position: relative;
  max-height: 460px;
  overflow-y: auto;
  padding: 14px 12px 18px 16px;
  background: #ffffff;
}

.tec-timeline-track {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Ligne continue jaune verticale (Rail en CSS pur via pseudo-élément) */
.tec-timeline-track::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 20px;
  left: 8px;
  width: 3px;
  background: var(--tec-yellow);
  border-radius: 2px;
  z-index: 1;
}


/* Ligne d'arrêt */
.tec-stop-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 6px 8px 28px;
  cursor: pointer;
  border-radius: 6px;
  z-index: 2;
}

.tec-stop-row:hover {
  background: #f8fafc;
}

/* Puce ronde sur la ligne (bordure jaune, centre blanc) */
.tec-stop-bullet {
  position: absolute;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--tec-yellow-dark);
  box-shadow: 0 0 0 2px #ffffff;
  z-index: 3;
}

.tec-stop-row.is-current {
  background: #fefce8;
  border: 1px solid #fef08a;
}

.tec-stop-row.is-current .tec-stop-bullet {
  background: var(--tec-yellow);
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.4);
  transform: scale(1.2);
}

.tec-stop-row.is-passed {
  opacity: 0.55;
}

.tec-stop-main {
  flex: 1;
  min-width: 0;
}

.tec-stop-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.toast-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (max-width: 767px) {
  .toast-container {
    top: auto;
    bottom: 85px;
    left: 12px;
    right: 12px;
    align-items: center;
  }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 360px;
  animation: toastIn 0.25s ease;
}

.toast.toast-error {
  border-color: #fca5a5;
  background: #fff5f5;
  color: #b91c1c;
}

.toast.toast-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.toast.toast-info {
  border-color: #fde047;
  background: #fefce8;
  color: #854d0e;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none !important;
}

/* =============================================================
   MODAL RÉGLAGES & STATISTIQUES EN DIRECT (STYLE TEC-FINDER)
   ============================================================= */

.settings-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInModal 0.25s ease;
}

.settings-modal-content {
  background: #0d0f15;
  color: #f1f5f9;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #12151e;
}

.settings-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 204, 0, 0.15);
  color: #FFCC00;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-header-icon svg {
  width: 22px;
  height: 22px;
}

.settings-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.settings-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin: 2px 0 0 0;
}

.settings-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.settings-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.settings-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section-header.between {
  justify-content: space-between;
}

.settings-section-icon {
  font-size: 18px;
}

.settings-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.settings-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.settings-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulseLiveDot 1.6s ease-in-out infinite;
}

@keyframes pulseLiveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.75); }
}

/* Grille Sélecteur de Thèmes */
.settings-styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.settings-style-card {
  background: #151822;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.settings-style-card:hover {
  background: #1c202d;
  border-color: rgba(255, 204, 0, 0.4);
  transform: translateY(-2px);
}

.settings-style-card.active {
  background: #1b1f2b;
  border-color: #FFCC00;
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.18);
}

.settings-card-icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.settings-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.settings-card-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.3;
}

.settings-cookie-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.18);
  font-size: 11.5px;
  color: #fcd34d;
}

/* Section Gestion des Données & Cookies */
.settings-data-card {
  background: #141721;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 640px) {
  .settings-data-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
}

.settings-data-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.settings-data-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.settings-data-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.settings-data-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-data-clear-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.settings-data-clear-btn:active {
  transform: scale(0.98);
}

/* Grille 2 Cartouches KPI */
.settings-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.settings-kpi-card {
  background: #141721;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}

.settings-kpi-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-badge.bus-yellow {
  background: #FFCC00;
  color: #000000;
}

.kpi-icon-badge.bus-yellow svg {
  width: 18px;
  height: 18px;
}

.kpi-icon-badge.finder-tag {
  background: #FFCC00;
  color: #000000;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  width: auto;
  border-radius: 14px;
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.kpi-val {
  font-size: 36px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.kpi-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 8px;
}

/* Grille Inférieure : Agences & Endpoints */
.settings-details-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .settings-details-grid {
    grid-template-columns: 1fr;
  }
}

.settings-block-card {
  background: #141721;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 18px 20px;
}

.block-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 16px 0;
}

/* Répartition par agence */
.agency-bars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.agency-tile {
  background: #10121a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
}

.agency-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.agency-name {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.agency-pct-badge {
  background: rgba(255, 204, 0, 0.15);
  color: #FFCC00;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.agency-val {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.agency-progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.agency-progress-fill {
  height: 100%;
  background: #FFCC00;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Appels par endpoint */
.endpoint-bars-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.endpoint-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.endpoint-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.endpoint-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.endpoint-count-badge {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.endpoint-pct-pill {
  background: #FFCC00;
  color: #000000;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
}

.endpoint-progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.endpoint-progress-fill {
  height: 100%;
  background: #FFCC00;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Animations modale */
@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleInModal {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 640px) {
  .settings-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .settings-modal-content {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 85vh;
  }

  .settings-modal-body {
    padding: 16px;
    gap: 18px;
  }

  .settings-styles-grid {
    grid-template-columns: 1fr 1fr;
  }

  .agency-bars-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Grille Sélecteur Thème Interface (Clair / Sombre / Système) */
.settings-ui-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .settings-ui-theme-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .settings-ui-card {
    padding: 10px 8px !important;
  }
  .settings-ui-card .settings-card-name {
    font-size: 12.5px !important;
  }
  .settings-ui-card .settings-card-desc {
    display: none;
  }
}

.settings-ui-card {
  background: #151822;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.settings-ui-card:hover {
  background: #1c202d;
  border-color: rgba(255, 204, 0, 0.4);
  transform: translateY(-2px);
}

.settings-ui-card.active {
  background: #1b1f2b;
  border-color: #FFCC00;
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.18);
}

/* Carte Légale Open Data (CC BY 4.0) */
.settings-legal-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legal-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.legal-license {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.legal-text {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.legal-text strong {
  color: #e2e8f0;
}

/* Section Fréquence de Rafraîchissement */
.settings-refresh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .settings-refresh-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .settings-refresh-card {
    padding: 10px 8px !important;
  }
  .settings-refresh-card .settings-card-name {
    font-size: 12.5px !important;
  }
  .settings-refresh-card .settings-card-desc {
    display: none;
  }
}

.settings-refresh-card {
  background: #151822;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.settings-refresh-card:hover {
  background: #1c202d;
  border-color: rgba(255, 204, 0, 0.4);
  transform: translateY(-2px);
}

.settings-refresh-card.active {
  background: #1b1f2b;
  border-color: #FFCC00;
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.18);
}

.settings-refresh-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255, 204, 0, 0.15);
  color: #FFCC00;
  border: 1px solid rgba(255, 204, 0, 0.3);
  font-family: var(--font-mono);
}

/* ==========================================================================
   ADAPTATION DU PANNEAU DE RÉGLAGES EN MODE CLAIR (LIGHT MODE)
   Permet d'avoir une modale claire épurée lorsque l'utilisateur est en thème clair !
   ========================================================================== */
html:not([data-ui-theme="dark"]) .settings-modal-content {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

html:not([data-ui-theme="dark"]) .settings-modal-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

html:not([data-ui-theme="dark"]) .settings-title {
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .settings-subtitle {
  color: #64748b;
}

html:not([data-ui-theme="dark"]) .settings-close-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

html:not([data-ui-theme="dark"]) .settings-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .settings-section-title {
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .settings-style-card,
html:not([data-ui-theme="dark"]) .settings-ui-card,
html:not([data-ui-theme="dark"]) .settings-refresh-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html:not([data-ui-theme="dark"]) .settings-style-card:hover,
html:not([data-ui-theme="dark"]) .settings-ui-card:hover,
html:not([data-ui-theme="dark"]) .settings-refresh-card:hover {
  background: #f1f5f9;
  border-color: rgba(255, 204, 0, 0.6);
}

html:not([data-ui-theme="dark"]) .settings-style-card.active,
html:not([data-ui-theme="dark"]) .settings-ui-card.active,
html:not([data-ui-theme="dark"]) .settings-refresh-card.active {
  background: #fffdf0;
  border-color: #FFCC00;
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.25);
}

html:not([data-ui-theme="dark"]) .settings-card-name {
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .settings-card-desc {
  color: #64748b;
}

html:not([data-ui-theme="dark"]) .settings-cookie-pill {
  background: #fffbeb;
  border-color: #fef3c7;
  color: #b45309;
}

html:not([data-ui-theme="dark"]) .settings-refresh-badge {
  background: #fffbeb;
  color: #b45309;
  border-color: #fef3c7;
}

html:not([data-ui-theme="dark"]) .settings-data-card {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

html:not([data-ui-theme="dark"]) .settings-data-title {
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .settings-data-desc {
  color: #64748b;
}

html:not([data-ui-theme="dark"]) .settings-data-clear-btn {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

html:not([data-ui-theme="dark"]) .settings-data-clear-btn:hover {
  background: #fecaca;
  color: #b91c1c;
}

html:not([data-ui-theme="dark"]) .settings-kpi-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html:not([data-ui-theme="dark"]) .kpi-label {
  color: #64748b;
}

html:not([data-ui-theme="dark"]) .kpi-val {
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .kpi-sub {
  color: #94a3b8;
}

html:not([data-ui-theme="dark"]) .settings-block-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html:not([data-ui-theme="dark"]) .block-title {
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .agency-tile {
  background: #ffffff;
  border-color: #e2e8f0;
}

html:not([data-ui-theme="dark"]) .agency-name {
  color: #334155;
}

html:not([data-ui-theme="dark"]) .agency-val {
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .agency-progress-track {
  background: #e2e8f0;
}

html:not([data-ui-theme="dark"]) .endpoint-name {
  color: #334155;
}

html:not([data-ui-theme="dark"]) .endpoint-count-badge {
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .endpoint-progress-track {
  background: #e2e8f0;
}

html:not([data-ui-theme="dark"]) .settings-legal-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html:not([data-ui-theme="dark"]) .legal-text {
  color: #475569;
}

html:not([data-ui-theme="dark"]) .legal-text strong {
  color: #0f172a;
}

html:not([data-ui-theme="dark"]) .legal-license {
  color: #64748b;
}

html:not([data-ui-theme="dark"]) .legal-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   THÈME SOMBRE DE L'INTERFACE (UI DARK MODE INDÉPENDANT DU FOND DE CARTE)
   Permet d'avoir par exemple l'interface sombre tout en gardant une carte claire !
   ========================================================================== */
html[data-ui-theme="dark"] {
  --bg-app: #0b0d13;
  --bg-surface: #141721;
  --bg-surface-elevated: #1a1e2b;
  --bg-card: #151822;
  --bg-card-hover: #1c212f;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: #FFCC00;

  --ink: #f8fafc;
  --ink-2: #cbd5e1;
  --ink-3: #94a3b8;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
}

/* Barre supérieure & Îlot de recherche en Dark UI */
html[data-ui-theme="dark"] .brand-badge {
  background: rgba(20, 23, 33, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

html[data-ui-theme="dark"] .brand-live {
  color: #f8fafc;
}

html[data-ui-theme="dark"] .island-card {
  background: rgba(20, 23, 33, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.5);
}

html[data-ui-theme="dark"] .province-badge-btn {
  background: #181c27;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

html[data-ui-theme="dark"] .province-badge-btn:hover {
  background: #232838;
}

html[data-ui-theme="dark"] .search-input-field {
  color: #f8fafc;
}

html[data-ui-theme="dark"] .search-input-field::placeholder {
  color: #64748b;
}

html[data-ui-theme="dark"] .island-separator {
  background: rgba(255, 255, 255, 0.1);
}

html[data-ui-theme="dark"] .cat-pill {
  background: #151822;
  border-color: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

html[data-ui-theme="dark"] .cat-pill.active {
  background: #FFCC00;
  color: #000000;
  border-color: #FFCC00;
}

html[data-ui-theme="dark"] .city-chip {
  background: #151822;
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

html[data-ui-theme="dark"] .city-chip.active {
  background: #FFCC00;
  color: #000000;
  border-color: #FFCC00;
}

html[data-ui-theme="dark"] .province-dropdown-menu,
html[data-ui-theme="dark"] #search-results-dropdown {
  background: rgba(20, 23, 33, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 20px 48px -4px rgba(0, 0, 0, 0.7), 0 8px 16px -2px rgba(0, 0, 0, 0.5) !important;
  color: #f8fafc;
}

html[data-ui-theme="dark"] .province-option {
  color: #cbd5e1;
}

html[data-ui-theme="dark"] .province-option:hover {
  background: #1e2230;
  color: #ffffff;
}

html[data-ui-theme="dark"] .search-group-header {
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] .search-group-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

html[data-ui-theme="dark"] .search-result-item {
  color: #f8fafc;
}

html[data-ui-theme="dark"] .search-result-item:hover,
html[data-ui-theme="dark"] .search-result-item.selected {
  background: rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="dark"] .result-name {
  color: #f8fafc !important;
}

html[data-ui-theme="dark"] .result-sub {
  color: #94a3b8 !important;
}

html[data-ui-theme="dark"] .search-result-item .result-live-pill {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

html[data-ui-theme="dark"] .result-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

html[data-ui-theme="dark"] .search-item-street .result-icon {
  background: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  color: #f59e0b !important;
}

html[data-ui-theme="dark"] .search-nearby-pill {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 6px;
  border-radius: 6px;
}

html[data-ui-theme="dark"] .search-no-results {
  color: #94a3b8;
}

html[data-ui-theme="dark"] .search-section-header {
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="dark"] .fav-item-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

html[data-ui-theme="dark"] .search-empty-state {
  color: #f8fafc;
}

html[data-ui-theme="dark"] .search-item {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] .search-item:hover {
  background: #1c202c;
}

html[data-ui-theme="dark"] .search-item-title {
  color: #ffffff;
}

html[data-ui-theme="dark"] .search-item-sub {
  color: #94a3b8;
}

/* Rail de contrôles flottants à droite */
html[data-ui-theme="dark"] .mapcn-btn,
html[data-ui-theme="dark"] .mapcn-zoom-btn {
  background: rgba(20, 23, 33, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

html[data-ui-theme="dark"] .mapcn-btn:hover,
html[data-ui-theme="dark"] .mapcn-zoom-btn:hover {
  background: #1e2230;
  color: #ffffff;
}

html[data-ui-theme="dark"] .mapcn-zoom-group {
  background: rgba(20, 23, 33, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

html[data-ui-theme="dark"] .mapcn-zoom-divider {
  background: rgba(255, 255, 255, 0.1);
}

html[data-ui-theme="dark"] .mapcn-styles-menu {
  background: #141721;
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

html[data-ui-theme="dark"] .mapcn-menu-header {
  color: #64748b;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] .mapcn-style-opt:hover {
  background: #1c202d;
}

html[data-ui-theme="dark"] .mapcn-style-opt.active {
  background: #1a1e2b;
  border-color: rgba(255, 204, 0, 0.5);
}

html[data-ui-theme="dark"] .mapcn-opt-title {
  color: #ffffff;
}

html[data-ui-theme="dark"] .mapcn-opt-sub {
  color: #94a3b8;
}

/* ==========================================================================
   VOLET LATÉRAL (DRAWER) & DÉPARTS EN DARK UI
   ========================================================================== */
html[data-ui-theme="dark"] #stop-drawer,
html[data-ui-theme="dark"] .drawer {
  background: #12151e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
  color: #ffffff !important;
}

html[data-ui-theme="dark"] .drawer-handle-bar {
  background: #12151e !important;
}

html[data-ui-theme="dark"] .drawer-handle {
  background: rgba(255, 255, 255, 0.3) !important;
}

html[data-ui-theme="dark"] .drawer-header {
  background: #12151e !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="dark"] .stop-name,
html[data-ui-theme="dark"] #drawer-stop-name {
  color: #ffffff !important;
}

html[data-ui-theme="dark"] .stop-id-tag,
html[data-ui-theme="dark"] #drawer-stop-id {
  background: #1c2130 !important;
  color: #93c5fd !important;
  border: 1px solid rgba(147, 197, 253, 0.2) !important;
}

html[data-ui-theme="dark"] .stop-distance,
html[data-ui-theme="dark"] #drawer-stop-distance {
  background: #1c2130 !important;
  color: #93c5fd !important;
  border: 1px solid rgba(147, 197, 253, 0.2) !important;
}

html[data-ui-theme="dark"] .stop-icon-badge {
  background: rgba(255, 204, 0, 0.15) !important;
  color: #FFCC00 !important;
}

html[data-ui-theme="dark"] .drawer-icon-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
}

html[data-ui-theme="dark"] .drawer-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
}

html[data-ui-theme="dark"] .drawer-content {
  background: #12151e !important;
}

html[data-ui-theme="dark"] .departures-header {
  background: #12151e !important;
}

html[data-ui-theme="dark"] .departures-header .section-title {
  color: #94a3b8 !important;
}

html[data-ui-theme="dark"] #drawer-departures-list,
html[data-ui-theme="dark"] .departures-list {
  background: #12151e !important;
}

html[data-ui-theme="dark"] .departure-card {
  background: #181c28 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

html[data-ui-theme="dark"] .departure-card:hover {
  background: #202636 !important;
  border-color: rgba(255, 204, 0, 0.4) !important;
}

html[data-ui-theme="dark"] .dep-title,
html[data-ui-theme="dark"] .departure-card .dep-title {
  color: #ffffff !important;
}

html[data-ui-theme="dark"] .dep-sub,
html[data-ui-theme="dark"] .departure-card .dep-sub {
  color: #94a3b8 !important;
}

html[data-ui-theme="dark"] .time-hero,
html[data-ui-theme="dark"] .departure-card .time-hero {
  color: #ffffff !important;
}

html[data-ui-theme="dark"] .departure-card .countdown-hero {
  background: #232838 !important;
  color: #ffffff !important;
}

html[data-ui-theme="dark"] .departure-card .countdown-hero.is-imminent {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border: 1px solid rgba(52, 211, 153, 0.3) !important;
}

/* Badges de ponctualité en Dark UI */
html[data-ui-theme="dark"] .status-pill-tomorrow {
  background: #232838 !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

html[data-ui-theme="dark"] .status-pill-scheduled {
  background: #1c2130 !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html[data-ui-theme="dark"] .status-pill-ontime {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(52, 211, 153, 0.3) !important;
}

html[data-ui-theme="dark"] .status-pill-delay {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(248, 113, 113, 0.3) !important;
}

html[data-ui-theme="dark"] .status-pill-early {
  background: rgba(14, 165, 233, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

/* ==========================================================================
   TIMELINE OFFICIELLE DU BUS / TRAM EN DARK UI
   ========================================================================== */
html[data-ui-theme="dark"] .tec-official-timeline {
  background: #151824 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-ui-theme="dark"] .tec-timeline-header-card {
  background: #1a1e2d !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="dark"] .tec-timeline-dest-prefix {
  color: #94a3b8 !important;
}

html[data-ui-theme="dark"] .tec-timeline-dest-title,
html[data-ui-theme="dark"] .tec-timeline-dest-name {
  color: #ffffff !important;
}

html[data-ui-theme="dark"] .tec-timeline-status-badge.is-live {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(52, 211, 153, 0.3) !important;
}

html[data-ui-theme="dark"] .tec-timeline-status-badge.is-scheduled {
  background: #1e2434 !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html[data-ui-theme="dark"] .tec-timeline-status-badge.is-stale {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(251, 191, 36, 0.3) !important;
}

html[data-ui-theme="dark"] .tec-timeline-scroll-wrap {
  background: #151824 !important;
}

html[data-ui-theme="dark"] .tec-stop-title {
  color: #f1f5f9 !important;
}

html[data-ui-theme="dark"] .tec-stop-time {
  color: #e2e8f0 !important;
}

html[data-ui-theme="dark"] .tec-countdown-label {
  color: #94a3b8 !important;
}

html[data-ui-theme="dark"] .tec-wheelchair-icon {
  color: #64748b !important;
}

html[data-ui-theme="dark"] .tec-timeline-track::before {
  background: var(--tec-yellow) !important;
}

html[data-ui-theme="dark"] .tec-stop-row:hover {
  background: #1e2436 !important;
}

html[data-ui-theme="dark"] .tec-stop-title {
  color: #f1f5f9 !important;
}

html[data-ui-theme="dark"] .tec-stop-bullet {
  background: #151824 !important;
  border: 3px solid var(--tec-yellow) !important;
  box-shadow: 0 0 0 2px #151824 !important;
}

html[data-ui-theme="dark"] .tec-stop-row.is-current {
  background: rgba(255, 204, 0, 0.12) !important;
  border: 1px solid rgba(255, 204, 0, 0.3) !important;
}

html[data-ui-theme="dark"] .tec-stop-row.is-current .tec-stop-bullet {
  background: var(--tec-yellow) !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.4) !important;
}

html[data-ui-theme="dark"] .tec-stop-time-badge,
html[data-ui-theme="dark"] .tec-stop-countdown {
  color: #e2e8f0 !important;
}

html[data-ui-theme="dark"] .serving-routes-section {
  background: #181c28 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="dark"] .serving-routes-title {
  color: #94a3b8 !important;
}

html[data-ui-theme="dark"] .serving-route-badge {
  background: #141722 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="dark"] .serving-route-name {
  color: #ffffff !important;
}

html[data-ui-theme="dark"] .empty-departures {
  background: #181c28 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="dark"] .empty-icon {
  background: #232838 !important;
  color: #94a3b8 !important;
}

html[data-ui-theme="dark"] .empty-text {
  color: #94a3b8 !important;
}

/* HUD Flottant de suivi de véhicule */
html[data-ui-theme="dark"] #vehicle-hud {
  background: rgba(18, 21, 30, 0.94);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

html[data-ui-theme="dark"] .hud-dest {
  color: #ffffff;
}

html[data-ui-theme="dark"] .hud-next-stop {
  color: #94a3b8;
}

html[data-ui-theme="dark"] .hud-speed-badge {
  background: #141722;
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-ui-theme="dark"] .hud-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

html[data-ui-theme="dark"] .hud-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* Bannière de filtrage de ligne & Hint Zoom */
html[data-ui-theme="dark"] #route-filter-banner {
  background: rgba(18, 21, 30, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

html[data-ui-theme="dark"] #zoom-hint {
  background: rgba(18, 21, 30, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

/* Leaflet attribution en mode sombre */
html[data-ui-theme="dark"] .leaflet-control-attribution {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #94a3b8 !important;
}

html[data-ui-theme="dark"] .leaflet-control-attribution a {
  color: #cbd5e1 !important;
}

/* ==========================================================================
   FEATURE 1 : ⭐ SYSTÈME DE FAVORIS (ARRÊTS & LIGNES)
   ========================================================================== */
.drawer-icon-btn.is-favorite {
  color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

.drawer-icon-btn.is-favorite svg polygon {
  fill: #f59e0b;
}

html[data-ui-theme="dark"] .drawer-icon-btn.is-favorite {
  color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.4) !important;
}

html[data-ui-theme="dark"] .drawer-icon-btn.is-favorite svg polygon {
  fill: #fbbf24;
}

.fav-item-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

html[data-ui-theme="dark"] .fav-item-badge {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
}

/* ==========================================================================
   FEATURE 2 : 📍 MODE « AUTOUR DE MOI » (ARRÊTS À PROXIMITÉ)
   ========================================================================== */
.nearby-banner {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  width: calc(100% - 32px);
  max-width: 440px;
  animation: slideUpNearby 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpNearby {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.nearby-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.nearby-banner-title {
  font-size: 13px;
  font-weight: 750;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nearby-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}

.nearby-stops-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nearby-stop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nearby-stop-item:hover {
  background: #ffffff;
  border-color: var(--tec-yellow);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nearby-stop-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-primary);
}

.nearby-stop-dist {
  font-size: 11.5px;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

html[data-ui-theme="dark"] .nearby-banner {
  background: rgba(18, 21, 30, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

html[data-ui-theme="dark"] .nearby-banner-title {
  color: #ffffff;
}

html[data-ui-theme="dark"] .nearby-stop-item {
  background: #181c28;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] .nearby-stop-item:hover {
  background: #202636;
  border-color: rgba(255, 204, 0, 0.4);
}

html[data-ui-theme="dark"] .nearby-stop-name {
  color: #ffffff;
}

html[data-ui-theme="dark"] .nearby-stop-dist {
  background: #1c2130;
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.2);
}

/* ==========================================================================
   FEATURE 3 : 🎯 FILTRAGE PAR LIGNE DANS LE VOLET D'ARRÊT
   ========================================================================== */
.stop-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  margin-bottom: 10px;
  background: rgba(255, 204, 0, 0.12);
  border: 1px solid rgba(255, 204, 0, 0.35);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  animation: fadeInModal 0.2s ease;
}

.stop-filter-clear-btn {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.stop-filter-clear-btn:hover {
  background: rgba(0, 0, 0, 0.16);
}

html[data-ui-theme="dark"] .stop-filter-bar {
  background: rgba(255, 204, 0, 0.1);
  border-color: rgba(255, 204, 0, 0.3);
  color: #ffffff;
}

html[data-ui-theme="dark"] .stop-filter-clear-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

html[data-ui-theme="dark"] .stop-filter-clear-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.serving-route-badge {
  cursor: pointer;
  transition: all 0.18s ease;
}

.serving-route-badge:hover {
  transform: scale(1.04);
  border-color: var(--tec-yellow) !important;
}

.serving-route-badge.active-filter {
  border: 2px solid var(--tec-yellow) !important;
  box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.35) !important;
  background: rgba(255, 204, 0, 0.16) !important;
}

/* ==========================================================================
   FEATURE 4 : 🔔 ALERTE D'APPROCHE & DE DESCENTE
   ========================================================================== */
.hud-pill-btn-action.is-alert-active {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #000000 !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5) !important;
}

.hud-pill-btn-action.is-alert-active svg {
  stroke: #000000 !important;
  fill: #000000 !important;
  animation: bellRing 1.5s ease infinite;
}

@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-14deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-8deg); }
  75% { transform: rotate(0); }
}

/* ==========================================================================
   FEATURE 5 : 🔄 BUS EN ROTATION & ANTICIPATION DU TRAJET ENTRANT
   ========================================================================== */
.tec-timeline-status-badge.is-rotation {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

html[data-ui-theme="dark"] .tec-timeline-status-badge.is-rotation {
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}

.tec-rotation-banner {
  margin: 0 12px 10px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1.5px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInModal 0.25s ease;
}

.tec-rotation-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.18);
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  animation: spinRotation 6s linear infinite;
}

@keyframes spinRotation {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tec-rotation-text {
  min-width: 0;
  flex: 1;
}

.tec-rotation-title {
  font-size: 12px;
  font-weight: 750;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tec-rotation-sub {
  font-size: 11px;
  color: #475569;
  margin-top: 2px;
  line-height: 1.35;
}

html[data-ui-theme="dark"] .tec-rotation-banner {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

html[data-ui-theme="dark"] .tec-rotation-icon {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

html[data-ui-theme="dark"] .tec-rotation-title {
  color: #fbbf24;
}

html[data-ui-theme="dark"] .tec-rotation-sub {
  color: #cbd5e1;
}

/* Marqueur de bus en approche (halo pulsant) */
.incoming-bus-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.35);
  animation: incomingPulse 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes incomingPulse {
  0% { transform: scale(0.9); opacity: 0.9; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

.incoming-bus-badge {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #000000;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   PACK 3 : INFO-TRAFIC & PERTURBATIONS OFFICIELLES GTFS-RT
   ========================================================================== */
.tec-disruptions-container {
  margin: 0 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tec-disruption-card {
  background: rgba(239, 68, 68, 0.05);
  border: 1.5px solid rgba(239, 68, 68, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
  animation: fadeInModal 0.25s ease;
  transition: all 0.2s ease;
}

.tec-disruption-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.tec-disruption-badge {
  font-size: 11px;
  font-weight: 800;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tec-disruption-effect {
  font-size: 10px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
  text-transform: uppercase;
}

.tec-disruption-title {
  font-size: 12px;
  font-weight: 750;
  color: #1e293b;
  line-height: 1.35;
  margin-bottom: 4px;
}

.tec-disruption-desc {
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 6px;
}

.tec-disruption-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
  transition: color 0.15s ease;
}

.tec-disruption-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.tec-disruptions-more {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tec-disruptions-toggle-btn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px dashed rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tec-disruptions-toggle-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

html[data-ui-theme="dark"] .tec-disruptions-toggle-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

html[data-ui-theme="dark"] .tec-disruptions-toggle-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

html[data-ui-theme="dark"] .tec-disruption-card {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
}

html[data-ui-theme="dark"] .tec-disruption-badge {
  color: #f87171;
}

html[data-ui-theme="dark"] .tec-disruption-effect {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

html[data-ui-theme="dark"] .tec-disruption-title {
  color: #f8fafc;
}

html[data-ui-theme="dark"] .tec-disruption-desc {
  color: #94a3b8;
}

html[data-ui-theme="dark"] .tec-disruption-link {
  color: #60a5fa;
}

html[data-ui-theme="dark"] .tec-disruption-link:hover {
  color: #93c5fd;
}

/* ==========================================================================
   PACK 3 : AFFLUENCE & TAUX DE REMPLISSAGE (COMMUNAUTAIRE & ESTIMÉ)
   ========================================================================== */
.tec-occupancy-card {
  margin: 0 12px 10px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeInModal 0.25s ease;
}

.tec-occupancy-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tec-occupancy-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tec-occupancy-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 750;
  padding: 3px 9px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.tec-occupancy-pill.tec-occ-low {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.tec-occupancy-pill.tec-occ-medium {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.tec-occupancy-pill.tec-occ-high {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.tec-occ-community-tag {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  background: rgba(100, 116, 139, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
}

.tec-occupancy-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.35;
}

.tec-occupancy-vote-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
}

.tec-occupancy-vote-label {
  font-size: 10.5px;
  font-weight: 650;
  color: #475569;
}

.tec-occupancy-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tec-occ-btn {
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: inherit;
}

.tec-occ-btn:hover {
  background: rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.tec-occ-btn:active {
  transform: scale(0.96);
}

.tec-occ-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.tec-occupancy-vote-msg {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  animation: fadeInModal 0.2s ease;
}

html[data-ui-theme="dark"] .tec-occupancy-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] .tec-occupancy-pill.tec-occ-low {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

html[data-ui-theme="dark"] .tec-occupancy-pill.tec-occ-medium {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

html[data-ui-theme="dark"] .tec-occupancy-pill.tec-occ-high {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

html[data-ui-theme="dark"] .tec-occ-community-tag {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] .tec-occupancy-desc {
  color: #94a3b8;
}

html[data-ui-theme="dark"] .tec-occupancy-vote-box {
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] .tec-occupancy-vote-label {
  color: #94a3b8;
}

html[data-ui-theme="dark"] .tec-occ-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

html[data-ui-theme="dark"] .tec-occ-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

html[data-ui-theme="dark"] .tec-occ-btn.active {
  background: #fbbf24;
  color: #000000;
  border-color: #fbbf24;
}

html[data-ui-theme="dark"] .tec-occupancy-vote-msg {
  color: #34d399;
}
