/* ---------- Reset & Base ---------- */
*{box-sizing:border-box;margin:0;padding:0}
html,body,#app{height:100%}
body{font-family:Inter, Roboto, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; background:linear-gradient(135deg,#eef2f7 0%,#e4e9f2 100%); color:#0f172a}
#app{max-width:980px;margin:18px auto;padding:12px}

/* ---------- Header ---------- */
.card{background:linear-gradient(135deg,#2c4a8f 0%,#3b5db0 100%);color:#fff;border-radius:16px;padding:20px;box-shadow:0 4px 18px rgba(30,58,138,0.18)}
.title{display:flex;align-items:center;gap:12px}
.title h1{font-size:20px;font-weight:600;letter-spacing:-0.2px}
.station-row{display:flex;gap:10px;align-items:center;margin-top:12px;flex-wrap:wrap}

.station-name{
  flex:1 1 160px;
  min-width:0;
  font-weight:600;
  background:rgba(255,255,255,0.1);
  padding:10px;
  border-radius:10px;
  display:flex;
  align-items:center;
  gap:8px;
  overflow:hidden;
}
.station-name span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.controls{display:flex;gap:8px;flex-shrink:0}
/* ---------- Buttons ---------- */
button, .btn{
  background: #ffffff;
  color: #2c4a8f;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(15,23,42,0.08);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button:hover, .btn:hover{
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,23,42,0.12);
}

button:active, .btn:active{
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(15,23,42,0.08);
}

button[disabled], .btn[disabled]{
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Boutons icône seule (ex: 🔄 Actualiser) — carrés, compacts, ne débordent jamais */
.btn-icon-only{
  padding: 10px 12px;
  font-size: 17px;
  line-height: 1;
  min-width: 40px;
  justify-content: center;
}

.btn-locate .btn-icon{ line-height: 1; }
.btn-locate .btn-label{ white-space: nowrap; }

/* Sur petit écran, "Localiser" perd son libellé texte pour laisser toute la place
   au nom de la gare, même très long, sans jamais faire déborder la ligne */
@media (max-width: 420px){
  .btn-locate .btn-label{ display:none; }
  .btn-locate{ padding: 10px 12px; min-width: 40px; justify-content: center; }
}

#refreshBtn{
  background: #34a980;
  color: white;
  border-color: rgba(255,255,255,0.15);
}

#refreshBtn:hover{
  background: #2f9873;
  box-shadow: 0 4px 12px rgba(52,169,128,0.25);
}

#locateBtn{
  background: #4a7fe0;
  color: white;
  border-color: rgba(255,255,255,0.15);
}

#locateBtn:hover{
  background: #3f6fd0;
  box-shadow: 0 4px 12px rgba(74,127,224,0.25);
}

.search{width:100%;padding:10px;border-radius:10px;border:none;font-size:14px}

/* ---------- Groupe recherche (champ + loupe intégrée) ---------- */
.search-group{position:relative;margin-top:12px}
.search-group .search{width:100%;padding-right:42px}
.search-btn{
  position:absolute;
  top:50%;
  right:5px;
  transform:translateY(-50%);
  background:transparent;
  border:none;
  box-shadow:none;
  color:#3b5db0;
  font-size:17px;
  line-height:1;
  padding:7px 8px;
  border-radius:8px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .15s ease;
}
.search-btn:hover{
  background:rgba(59,93,176,0.1);
  transform:translateY(-50%);
  box-shadow:none;
}
.search-btn:active{
  transform:translateY(-50%) scale(0.92);
  box-shadow:none;
}

/* ---------- Tabs ---------- */
.tabs{display:flex;margin-top:12px;gap:8px}
.tab{flex:1;padding:10px;border-radius:12px;background:rgba(255,255,255,0.1);text-align:center;cursor:pointer;font-weight:600}
.tab.active{background:#fff;color:#0f172a;box-shadow:0 4px 12px rgba(2,6,23,0.12);transform:scale(1.01)}

/* ---------- Trains list ---------- */
.panel{background:#fff;border-radius:16px;margin-top:14px;overflow:hidden;box-shadow:0 4px 20px rgba(2,6,23,0.06)}
.list{padding:8px}
.train{display:flex;justify-content:space-between;align-items:center;padding:14px 12px;border-radius:12px;gap:10px;cursor:pointer;transition:background .18s,transform .18s}
.train:hover{background:#f8fafc;transform:translateY(-1px)}
.train.cancelled{background:#fef6f6;box-shadow:inset 4px 0 0 #dc2626}
.train.cancelled:hover{background:#fdeeee}

.left{flex:1}
.train-number{font-weight:700;color:#1e3a8a}
.route{color:#64748b;font-size:13px;margin-top:6px}
.platform{
  font-size:13px;
  color:#92400e;
  margin-top:8px;
  background:#fef3c7;
  display:inline-block;
  padding:4px 11px;
  border-radius:8px;
  font-weight:600;
  letter-spacing:0.3px;
  border:1px solid #fde68a;
}
.stop-platform{
  background:#f0f9ff;
  color:#0369a1;
  padding:2px 6px;
  border-radius:4px;
  font-size:10px;
  font-weight:600;
  margin-left:6px;
  border:1px solid #e0f2fe;
}
.time{font-weight:700;font-size:19px;text-align:right;min-width:72px;color:#1e293b}
.delay{font-size:12px;margin-top:6px;text-align:right;font-weight:600;padding:4px 8px;border-radius:6px;display:inline-block}
.delay.on-time{background:#e6f7ee;color:#15803d;border:1px solid #bbf0d3}
.delay.delayed{background:#fdeded;color:#b91c1c;border:1px solid #f5c2c2}

/* ---------- Affluence (3 pictos) ---------- */
.occupancy{display:inline-flex;align-items:center;gap:1px;margin-left:8px;vertical-align:middle;line-height:1}
.occ-p{font-size:9px;color:#d5dbe5}
.occ-low .occ-p.on{color:#34d399}
.occ-medium .occ-p.on{color:#fbc94a}
.occ-high .occ-p.on{color:#f47272}
.occ-label{margin-left:6px;font-size:11px;font-weight:600;color:#64748b}
.metro-time .occupancy{margin-left:10px}

/* ---------- Changement de voie ---------- */
.platform.platform-changed{
  background:#fee2e2;
  color:#991b1b;
  border-color:#fca5a5;
  animation:platformPulse 1.6s ease-in-out 3;
}
.platform-was{font-weight:500;font-size:12px;opacity:.85}
.stop-platform.stop-platform-changed{background:#fee2e2;color:#991b1b;font-weight:700}
@keyframes platformPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,0)}
  50%{box-shadow:0 0 0 4px rgba(220,38,38,.22)}
}
@media (prefers-reduced-motion: reduce){
  .platform.platform-changed{animation:none}
}

/* ---------- Details (collapsible) ---------- */
.details{
  padding:0;
  border-top:0 solid #eef2ff;
  background:#fbfcfe;
  max-height:0;
  overflow:hidden;
  transition:max-height .35s ease, padding .35s ease;
}
.train.expanded + .details{
  max-height:1200px;
  padding:12px;
  border-top:1px solid #f1f5f9;
}
/* ---------- Metro-style stops ---------- */
.metro-line{
  display:flex;
  flex-direction:column;
  padding:16px 0;
  position:relative;
}

.metro-stop{
  display:flex;
  align-items:flex-start;
  gap:16px;
  position:relative;
  padding:12px 0;
  opacity:1;
  transition:opacity .3s ease;
}

.metro-stop.canceled{
  opacity:0.5;
  text-decoration:line-through;
}

.metro-stop::before{
  content:'';
  position:absolute;
  left:12px;
  top:32px;
  bottom:-12px;
  width:2px;
  background:#bfd4f5;
  border-radius:2px;
}

.metro-stop.last::before{
  display:none;
}

.metro-stop.has-delay::before{
  background:#f2b8b8;
}

.metro-dot{
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  border:3px solid #6b93de;
  flex-shrink:0;
  z-index:1;
  box-shadow:0 1px 4px rgba(59,130,246,0.15);
  transition:all .3s ease;
}

.metro-stop.first .metro-dot{
  border-color:#34a980;
  box-shadow:0 1px 4px rgba(16,185,129,0.15);
}

.metro-stop.last .metro-dot{
  border-color:#e08585;
  box-shadow:0 1px 4px rgba(239,68,68,0.15);
}

.metro-stop.current .metro-dot{
  width:26px;
  height:26px;
  border-width:4px;
  border-color:#c99a1f;
  background:#fbbf24;
  box-shadow:0 2px 10px rgba(251,191,36,0.35);
  animation:pulse 2s ease-in-out infinite;
}

.metro-stop.has-delay .metro-dot{
  border-color:#e08585;
  box-shadow:0 1px 4px rgba(239,68,68,0.2);
}

@keyframes pulse{
  0%, 100%{
    transform:scale(1);
  }
  50%{
    transform:scale(1.06);
  }
}

.metro-info{
  flex:1;
  padding-top:2px;
}

.metro-station{
  font-weight:600;
  color:#1e293b;
  font-size:15px;
  margin-bottom:4px;
}

.metro-stop.current .metro-station{
  color:#92650f;
  font-size:15px;
}

.metro-time{
  font-size:13px;
  color:#94a3b8;
  font-weight:500;
}

.metro-stop.current .metro-time{
  color:#92650f;
  font-weight:600;
}

.stop-delay{
  background:#fdeded;
  color:#b91c1c;
  padding:2px 6px;
  border-radius:4px;
  font-size:11px;
  font-weight:600;
  margin-left:6px;
}

.stop-canceled{
  background:#fef2f2;
  color:#dc2626;
  padding:2px 6px;
  border-radius:4px;
  font-size:11px;
  font-weight:600;
  margin-left:6px;
}

.details h4{
  font-size:13px;
  color:#94a3b8;
  letter-spacing:0.3px;
  margin-bottom:12px;
  font-weight:600;
}
.metro-stop.train-position .metro-dot{
  width:30px;
  height:30px;
  border-width:0;
  background:#34a980;
  box-shadow:0 2px 12px rgba(16,185,129,0.4);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
  animation:trainPulse 1.5s ease-in-out infinite;
}

@keyframes trainPulse{
  0%, 100%{
    transform:scale(1);
    box-shadow:0 2px 12px rgba(16,185,129,0.4);
  }
  50%{
    transform:scale(1.06);
    box-shadow:0 3px 16px rgba(16,185,129,0.5);
  }
}

.metro-stop.passed{
  opacity:0.55;
}

.metro-stop.passed::before{
  background:#e2e8f0;
}

.metro-stop.passed .metro-dot{
  border-color:#cbd5e1;
  box-shadow:none;
}

/* Indicateur "train en transit entre deux gares" */
.metro-transit{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:12px;
  padding:8px 0 8px 20px;
  position:relative;
}

.metro-transit-icon{
  font-size:14px;
  animation:trainMove 1.4s ease-in-out infinite;
}

@keyframes trainMove{
  0%, 100%{ transform:translateX(0); }
  50%{ transform:translateX(4px); }
}

.metro-transit-text{
  font-size:12px;
  font-weight:500;
  color:#3b6fd0;
  background:#f1f6fe;
  padding:4px 10px;
  border-radius:8px;
  border:1px dashed #c9dcf7;
}

.next-stop-badge{
  background:#eaf1fd;
  color:#2c4a8f;
  padding:2px 6px;
  border-radius:4px;
  font-size:11px;
  font-weight:600;
  margin-left:6px;
}

.train-here{
  background:#e6f7ee;
  color:#15803d;
  padding:2px 8px;
  border-radius:6px;
  font-size:11px;
  font-weight:600;
  margin-left:6px;
  border:1px solid #bbf0d3;
}
.train-passed {
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 4px;
}


/* ---------- Composition (vue train horizontal) ---------- */
.train-composition{
  display:flex;
  gap:4px;
  padding:12px;
  background:#fbfcfe;
  border-radius:10px;
  overflow-x:auto;
  margin-top:8px;
  border:1px solid #eef2f7;
  justify-content:flex-start;
  align-items:center;
}

.train-unit{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:8px 10px;
  border-radius:8px;
  min-width:50px;
  box-shadow:0 1px 3px rgba(0,0,0,0.06);
  transition:transform .2s ease;
  flex-shrink:0;
}

.train-unit:hover{
  transform:translateY(-1px);
  box-shadow:0 2px 6px rgba(0,0,0,0.1);
}

.train-unit.loco{
  background:#e0685f;
  color:#fff;
}

.train-unit.pilot{
  background:#fbbf24;
  color:#78350f;
  font-weight:700;
}

.train-unit.wagon{
  background:#5b85d6;
  color:#fff;
}

.train-unit.emu{
  background:#34a980;
  color:#fff;
}

.unit-icon{
  font-size:19px;
}

.unit-type{
  font-size:9px;
  font-weight:600;
  text-align:center;
  letter-spacing:0.2px;
  white-space:nowrap;
}
/* ---------- Banners & messages ---------- */
.banner{padding:12px;border-radius:10px;margin:12px;background:#fffaeb;border-left:3px solid #f2c94c;color:#8a6d1e}
.info, .error, .success{padding:12px;border-radius:10px;margin:12px}
.error{background:#fdf1f2;color:#b91c1c}
.success{background:#f2fbf6;color:#166534}
.loading{display:flex;flex-direction:column;align-items:center;padding:24px}
.spinner{width:34px;height:34px;border-radius:50%;border:3px solid rgba(2,6,23,0.06);border-top-color:#3b5db0;animation:spin .8s linear infinite}
.spinner.small{width:18px;height:18px;border-width:2px}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- Charger plus de trains (scroll infini) ---------- */
.load-more-zone{min-height:1px}
.load-more-spinner{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:16px;
  color:#64748b;
  font-size:13px;
}
.load-more-end{
  text-align:center;
  padding:16px;
  color:#94a3b8;
  font-size:13px;
}

/* ---------- Perturbations ---------- */
.disturbance-banner, .disturbance-fallback-card{
  padding:14px;
}

.disturbance-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.disturbance-close{
  flex-shrink:0;
  background:transparent;
  border:none;
  box-shadow:none;
  color:#a68a3d;
  font-size:14px;
  font-weight:700;
  padding:2px 6px;
  border-radius:6px;
  line-height:1;
  cursor:pointer;
}
.disturbance-close:hover{
  background:rgba(138,109,30,0.12);
  transform:none;
  box-shadow:none;
}

.disturbance-list{
  margin-top:10px;
}
.disturbance-list-collapsed{
  display:none;
}

.disturbance-item{
  padding:8px 0;
  border-top:1px solid rgba(138,109,30,0.12);
}
.disturbance-item:first-child{
  border-top:none;
  padding-top:0;
}
.disturbance-badge{
  display:inline-block;
  font-size:11px;
  font-weight:600;
  padding:2px 8px;
  border-radius:6px;
  background:#fdecc8;
  color:#8a6d1e;
  margin-bottom:4px;
}
.disturbance-item.planned .disturbance-badge{
  background:#e6f7ee;
  color:#166534;
}
.disturbance-title{
  font-size:13px;
  line-height:1.4;
}
.disturbance-link{
  display:inline-block;
  font-size:12px;
  font-weight:600;
  color:#8a6d1e;
  margin-top:4px;
  text-decoration:underline;
}

/* Repli "aucune perturbation pour cette gare" — bascule maison (pas <details>)
   pour garder le bouton "masquer" toujours accessible, même replié. */
.disturbance-summary-toggle{
  background:transparent;
  border:none;
  box-shadow:none;
  padding:0;
  margin:0;
  color:#8a6d1e;
  font-weight:600;
  font-size:13px;
  text-align:left;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:6px;
  flex:1;
}
.disturbance-summary-toggle:hover{
  background:transparent;
  transform:none;
  box-shadow:none;
  text-decoration:underline;
}
.toggle-caret{
  display:inline-block;
  transition:transform .2s ease;
  font-size:11px;
}
.disturbance-summary-toggle.open .toggle-caret{
  transform:rotate(90deg);
}

/* Pastille discrète quand les perturbations sont masquées */
.disturbance-muted{
  margin:12px;
  padding:8px 12px;
  border-radius:20px;
  background:#f1f5f9;
  color:#64748b;
  font-size:12px;
  font-weight:600;
  display:inline-flex;
  align-items:center;
  gap:4px;
  cursor:pointer;
  transition:background .18s ease;
}
.disturbance-muted:hover{
  background:#e2e8f0;
}
.disturbance-unmute-link{
  text-decoration:underline;
  font-weight:700;
}

/* ---------- Footer ---------- */
footer{margin-top:12px;color:#94a3b8;text-align:center;font-size:13px}

/* Responsive */
@media(max-width:700px){.title h1{font-size:18px}.time{font-size:17px}}

/* ---------- Style du Logo ---------- */
.app-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Assurer l'alignement vertical parfait dans la barre de titre */
.title {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* ====== Autocomplete maison (div + surlignage <mark>, remplace le <select> natif) ====== */
.station-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;

  width: 100%;
  max-height: 280px;
  overflow-y: auto;

  background: #ffffff;
  color: #0f172a;

  border: 1px solid #e2e8f0;
  border-radius: 12px;

  padding: 4px 0;
  margin-top: 6px;

  font-size: 15px;
  z-index: 1000;

  box-shadow: 0 8px 20px rgba(15,23,42,0.1);
}

.station-option {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}

.station-option:last-child {
  border-bottom: none;
}

.station-option:hover,
.station-option.active {
  background: #eef2f7;
}

.station-option mark {
  background: #fde68a;
  color: #78350f;
  border-radius: 3px;
  padding: 0 1px;
  font-weight: 700;
}

.station-option.disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: default;
}

/* Scrollbar Android / Chrome */
.station-dropdown::-webkit-scrollbar {
  width: 6px;
}

.station-dropdown::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 3px;
}

/* ====== Itinéraire : gare cliquable ====== */
.goto-station {
  color: #3b6fd0;
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #c9dcf7;
}

.goto-station:hover {
  color: #2c4a8f;
}

/* ====== Badge correspondances ====== */
.stop-connection {
  display: inline-block;
  background: #eaf1fd;
  color: #2c4a8f;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
  font-weight: 600;
}

/* ====== Plateforme dans l'itinéraire ====== */
.stop-platform {
  font-size: 11px;
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 6px;
  margin-left: 6px;
}

/* ====== Itinéraire : annulation ====== */
.stop-canceled {
  color: #dc2626;
  font-weight: 500;
}
.goto-station {
  pointer-events: auto !important;
}
.metro-station, .metro-info, .metro-stop {
  pointer-events: auto;
}
.train .date {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}


/* ====== Bouton favori (étoile) ====== */
.favBtn {
  font-size: 18px;
  padding: 10px 12px;
  line-height: 1;
}
.favBtn.active {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

/* ====== Barre des gares favorites ====== */
.favorites-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.favorites-bar:empty {
  display: none;
  margin-top: 0;
}
.fav-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease;
  white-space: nowrap;
}
.fav-chip:hover {
  background: rgba(255,255,255,0.18);
}
.fav-chip.active-station {
  background: #fbbf24;
  color: #78350f;
  border-color: transparent;
}
.fav-chip .fav-remove {
  opacity: 0.7;
  font-size: 12px;
  padding-left: 2px;
}
.fav-chip .fav-remove:hover {
  opacity: 1;
}

/* ====== Compte à rebours relatif ("dans X min") ====== */
.relative-time {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 10px;
}
.relative-time.relative-normal {
  color: #64748b;
  background: #f1f5f9;
}
.relative-time.relative-soon {
  color: #c2650c;
  background: #fdf1e0;
}
.relative-time.relative-now {
  color: #fff;
  background: #e0554f;
  animation: relativePulse 1.4s ease-in-out infinite;
}
.relative-time.relative-past {
  color: #94a3b8;
  background: #f8fafc;
  font-style: italic;
  font-weight: 500;
}
@keyframes relativePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}


/* ====== Train supprimé ====== */
.train.cancelled .train-number,
.train.cancelled .route{opacity:.6}
.train.cancelled .train-number{color:#7f1d1d}
.time.time-cancelled{
  color:#94a3b8;
  font-weight:600;
  text-decoration:line-through;
  text-decoration-color:#dc2626;
  text-decoration-thickness:2px;
}
.delay.cancelled-badge{
  background:#dc2626;
  color:#fff;
  border:1px solid #b91c1c;
  letter-spacing:.2px;
}
.train.cancelled .date{opacity:.7}

.cancel-banner{
  display:flex;
  gap:10px;
  align-items:flex-start;
  background:#fef2f2;
  border:1px solid #fecaca;
  border-left:4px solid #dc2626;
  color:#7f1d1d;
  padding:10px 12px;
  border-radius:10px;
  margin-bottom:12px;
  font-size:13px;
}
.cancel-banner strong{font-size:14px}
.cancel-banner-icon{font-size:18px;line-height:1.2}
.cancel-banner-sub{margin-top:2px;color:#991b1b;font-size:12px;line-height:1.4}
.cancel-banner.partial{
  background:#fff7ed;
  border-color:#fed7aa;
  border-left-color:#ea580c;
  color:#7c2d12;
}
.cancel-banner.partial .cancel-banner-sub{color:#9a3412}

/* Arrêt supprimé (le train ne s'y arrête pas) : gare barrée en rouge, badge lisible */
.metro-stop.canceled{opacity:1;text-decoration:none}
.metro-stop.canceled .metro-station a,
.metro-stop.canceled .metro-station a:hover{
  color:#dc2626;
  font-weight:600;
  text-decoration:line-through;
  text-decoration-color:#dc2626;
  text-decoration-thickness:2px;
}
.metro-stop.canceled .metro-time{
  color:#f87171;
  text-decoration:line-through;
  text-decoration-color:#dc2626;
}
.metro-stop.canceled .metro-dot{border-color:#fca5a5;background:#fef2f2;box-shadow:none}
.stop-canceled{
  display:inline-block;
  background:#fef2f2;
  border:1px solid #fecaca;
  color:#dc2626;
  font-weight:600;
}

/* ====== Train à parcours modifié (circule, mais ne dessert pas tous les arrêts) ====== */
.train.modified{background:#fffaf5;box-shadow:inset 4px 0 0 #ea580c}
.train.modified:hover{background:#fff4e8}
.delay.modified-badge{
  background:#fff7ed;
  color:#9a3412;
  border:1px solid #fed7aa;
}

.stop-terminus{
  display:inline-block;
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
  padding:2px 6px;
  border-radius:4px;
  font-size:11px;
  font-weight:600;
  margin-left:6px;
}

.debug-raw{margin-top:10px;font-size:11px;color:#64748b}
.debug-raw summary{cursor:pointer}
.debug-raw pre{margin-top:6px;padding:8px;background:#f1f5f9;border-radius:8px;overflow-x:auto;white-space:pre;font-size:11px;line-height:1.5}


/* ======================================================================
   THÈME SOMBRE  (activé via <html data-theme="dark">, voir index.html)
   ====================================================================== */
#themeBtn{
  padding:6px 10px;font-size:16px;line-height:1;
  background:rgba(255,255,255,0.15);color:#fff;
  border:1px solid rgba(255,255,255,0.25);box-shadow:none;
}
#themeBtn:hover{background:rgba(255,255,255,0.28);box-shadow:none}

:root[data-theme="dark"]{color-scheme:dark}
[data-theme="dark"] body{background:linear-gradient(135deg,#0b1220 0%,#0f172a 100%);color:#e2e8f0}

/* En-tête */
[data-theme="dark"] .card{background:linear-gradient(135deg,#1e3566 0%,#2a4684 100%);box-shadow:0 4px 18px rgba(0,0,0,0.45)}
[data-theme="dark"] .controls .btn{background:#1e293b;color:#cbd5e1;border-color:rgba(255,255,255,0.14);box-shadow:0 2px 6px rgba(0,0,0,0.3)}
[data-theme="dark"] .controls .btn:hover{background:#273449}
[data-theme="dark"] .controls .favBtn.active{background:#3a2f0b;color:#fde68a;border-color:#5c4a12}
[data-theme="dark"] .search{background:#1e293b;color:#e2e8f0}
[data-theme="dark"] .search::placeholder{color:#94a3b8}
[data-theme="dark"] .search-btn{color:#93b4ef}
[data-theme="dark"] .search-btn:hover{background:rgba(147,180,239,0.15)}
[data-theme="dark"] .tab{background:rgba(255,255,255,0.08)}
[data-theme="dark"] .tab.active{background:#1e293b;color:#e2e8f0;box-shadow:0 4px 12px rgba(0,0,0,0.35)}

/* Liste des trains */
[data-theme="dark"] .panel{background:#111827;box-shadow:0 4px 20px rgba(0,0,0,0.35)}
[data-theme="dark"] .train:hover{background:#1a2333}
[data-theme="dark"] .train.cancelled{background:#2a1517}
[data-theme="dark"] .train.cancelled:hover{background:#331a1d}
[data-theme="dark"] .train.modified{background:#2a1f14}
[data-theme="dark"] .train.modified:hover{background:#33261a}
[data-theme="dark"] .train-number{color:#93b4ef}
[data-theme="dark"] .train.cancelled .train-number{color:#fca5a5}
[data-theme="dark"] .route{color:#94a3b8}
[data-theme="dark"] .time{color:#f1f5f9}
[data-theme="dark"] .time.time-cancelled{color:#64748b}
[data-theme="dark"] .train .date{color:#64748b}
[data-theme="dark"] .platform{color:#fde68a;background:#3a2f0b;border-color:#5c4a12}
[data-theme="dark"] .platform.platform-changed{background:#4c1d1d;color:#fecaca;border-color:#b91c1c}
[data-theme="dark"] .stop-platform{background:#16293f;color:#7dd3fc;border-color:#1e3a5f}
[data-theme="dark"] .stop-platform.stop-platform-changed{background:#4c1d1d;color:#fecaca;border-color:#b91c1c}
[data-theme="dark"] .delay.on-time{background:#0f2e22;color:#6ee7b7;border-color:#14532d}
[data-theme="dark"] .delay.delayed{background:#3b1519;color:#fca5a5;border-color:#7f1d1d}
[data-theme="dark"] .delay.modified-badge{background:#33200f;color:#fdba74;border-color:#7c2d12}
[data-theme="dark"] .relative-time.relative-normal{color:#94a3b8;background:#1e293b}
[data-theme="dark"] .relative-time.relative-soon{color:#fdba74;background:#33200f}
[data-theme="dark"] .relative-time.relative-past{color:#64748b;background:#151e2e}
[data-theme="dark"] .occ-p{color:#334155}
[data-theme="dark"] .occ-low .occ-p.on{color:#34d399}
[data-theme="dark"] .occ-medium .occ-p.on{color:#fbc94a}
[data-theme="dark"] .occ-high .occ-p.on{color:#f47272}
[data-theme="dark"] .occ-label{color:#94a3b8}

/* Détail du train / itinéraire */
[data-theme="dark"] .details{background:#0f1726}
[data-theme="dark"] .train.expanded + .details{border-top-color:#1f2937}
[data-theme="dark"] .details h4{color:#94a3b8}
[data-theme="dark"] .metro-stop::before{background:#2b4a85}
[data-theme="dark"] .metro-stop.has-delay::before{background:#7f3a3a}
[data-theme="dark"] .metro-stop.passed::before{background:#334155}
[data-theme="dark"] .metro-dot{background:#0f1726;border-color:#6b93de}
[data-theme="dark"] .metro-stop.passed .metro-dot{border-color:#475569}
[data-theme="dark"] .metro-stop.canceled .metro-dot{background:#2a1517;border-color:#b91c1c}
[data-theme="dark"] .metro-station{color:#e2e8f0}
[data-theme="dark"] .metro-time{color:#94a3b8}
[data-theme="dark"] .metro-stop.current .metro-station,
[data-theme="dark"] .metro-stop.current .metro-time{color:#fcd34d}
[data-theme="dark"] .metro-stop.canceled .metro-station a,
[data-theme="dark"] .metro-stop.canceled .metro-station a:hover{color:#f87171}
[data-theme="dark"] .goto-station{color:#7fa6ee}
[data-theme="dark"] .goto-station:hover{color:#a9c4f5}
[data-theme="dark"] .stop-delay{background:#3b1519;color:#fca5a5}
[data-theme="dark"] .stop-canceled{background:#3b1519;color:#fca5a5;border-color:#7f1d1d}
[data-theme="dark"] .stop-terminus{background:#33200f;border-color:#7c2d12;color:#fdba74}
[data-theme="dark"] .stop-connection,
[data-theme="dark"] .next-stop-badge{background:#182a4d;color:#93b4ef}
[data-theme="dark"] .train-here{background:#0f2e22;color:#6ee7b7;border-color:#14532d}
[data-theme="dark"] .train-passed{background:#1e293b;color:#94a3b8}
[data-theme="dark"] .metro-transit-text{color:#93b4ef;background:#142039;border-color:#2b4a85}
[data-theme="dark"] .train-composition{background:#0f1726;border-color:#1f2937}

/* Bandeaux, perturbations, messages */
[data-theme="dark"] .banner{background:#2a2410;border-left-color:#b8902a;color:#e8cf8a}
[data-theme="dark"] .error{background:#3b1519;color:#fca5a5}
[data-theme="dark"] .success{background:#0f2e22;color:#86efac}
[data-theme="dark"] .spinner{border-color:rgba(255,255,255,0.1);border-top-color:#6b93de}
[data-theme="dark"] .load-more-spinner{color:#94a3b8}
[data-theme="dark"] .load-more-end{color:#64748b}
[data-theme="dark"] .disturbance-close{color:#d4b25a}
[data-theme="dark"] .disturbance-close:hover{background:rgba(212,178,90,0.15)}
[data-theme="dark"] .disturbance-item{border-top-color:rgba(212,178,90,0.18)}
[data-theme="dark"] .disturbance-badge{background:#3d3112;color:#e8cf8a}
[data-theme="dark"] .disturbance-item.planned .disturbance-badge{background:#0f2e22;color:#86efac}
[data-theme="dark"] .disturbance-link,
[data-theme="dark"] .disturbance-summary-toggle{color:#e8cf8a}
[data-theme="dark"] .disturbance-muted{background:#1e293b;color:#94a3b8}
[data-theme="dark"] .disturbance-muted:hover{background:#273449}
[data-theme="dark"] .cancel-banner{background:#2a1517;border-color:#7f1d1d;border-left-color:#dc2626;color:#fecaca}
[data-theme="dark"] .cancel-banner-sub{color:#fca5a5}
[data-theme="dark"] .cancel-banner.partial{background:#2a1f14;border-color:#7c2d12;border-left-color:#ea580c;color:#fed7aa}
[data-theme="dark"] .cancel-banner.partial .cancel-banner-sub{color:#fdba74}
[data-theme="dark"] .debug-raw{color:#94a3b8}
[data-theme="dark"] .debug-raw pre{background:#1e293b}
[data-theme="dark"] footer{color:#64748b}

/* Liste déroulante des gares */
[data-theme="dark"] .station-dropdown{background:#1e293b;color:#e2e8f0;border-color:#334155;box-shadow:0 8px 20px rgba(0,0,0,0.5)}
[data-theme="dark"] .station-option{border-bottom-color:#273449}
[data-theme="dark"] .station-option:hover,
[data-theme="dark"] .station-option.active{background:#273449}
[data-theme="dark"] .station-option mark{background:#854d0e;color:#fef3c7}
[data-theme="dark"] .station-option.disabled{background:#172033;color:#64748b}
[data-theme="dark"] .station-dropdown::-webkit-scrollbar-thumb{background:#334155}
