/* Section /idf/ (Transilien / RER / Tram), en plus de site.css */
h2.section { font-size: 1.1rem; font-weight: 600; color: #fff; margin: 0 0 12px; }
h3.sub { font-size: 0.8rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin: 18px 0 8px; }
.lead { color: #94a3b8; font-size: 0.95rem; line-height: 1.7; }
.lead strong { color: #e2e8f0; }
.mt-4 { margin-top: 18px; }

/* Pictogrammes officiels des lignes (IDFM). Trams : texte noir sur fond transparent -> pastille blanche */
.picto { display: inline-block; vertical-align: middle; border-radius: 4px; }
.picto-tram { background: #fff; padding: 1px; }

/* États */
.st-green { color: #34d399; }
.st-orange { color: #fb923c; }
.st-red { color: #f87171; font-weight: 600; }
.line-state { font-size: 12px; font-weight: 600; }
.line-state.big { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.05); }
.ok-line { color: #34d399; font-size: 0.95rem; }
.intro-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.intro-row h1 { display: flex; align-items: center; gap: 10px; }

/* Recherche « Je pars de / Je vais à » */
.idf-search { border-radius: 0.75rem; padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: end;
    border: 1px solid rgba(59,130,246,0.35); background: linear-gradient(135deg, rgba(37,99,235,0.16), rgba(17,19,28,0.9) 60%); position: relative; z-index: 20; }
@media (min-width: 768px) { .idf-search { grid-template-columns: 1fr 1fr auto; padding: 24px; } }
.idf-field { position: relative; }
.idf-field label { display: block; font-size: 12px; color: #94a3b8; margin-bottom: 4px; }
.idf-field .opt { color: #64748b; }
.idf-search-hint { grid-column: 1 / -1; margin: 0; font-size: 13px; color: #94a3b8; }
.idf-search input { width: 100%; background: rgba(11,13,20,0.9); border: 1px solid rgba(96,165,250,0.3); color: #f1f5f9; font-size: 16px;
    padding: 11px 12px; border-radius: 8px; }
.idf-search input:focus { outline: none; border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
.idf-search button { background: #2563eb; color: #fff; font-weight: 600; font-size: 15px; padding: 12px 22px; border-radius: 8px; border: 0; cursor: pointer; white-space: nowrap; }
.idf-search button:hover { background: #3b82f6; }
.idf-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; list-style: none; margin: 0; padding: 4px;
    background: #11131c; border: 1px solid rgba(148,163,184,0.25); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.5); max-height: 340px; overflow-y: auto; }
.idf-suggest li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.idf-suggest li span { color: #64748b; font-size: 12px; }
.idf-suggest li .sg-lines { margin-left: auto; display: inline-flex; gap: 3px; }
.idf-suggest li.active, .idf-suggest li:hover { background: rgba(59,130,246,0.15); }
.idf-suggest li.none { color: #94a3b8; cursor: default; }

/* Lignes */
.line-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.line-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); }
.line-card:hover { background: rgba(59,130,246,0.1); }
.now-lines { display: flex; flex-direction: column; gap: 6px; }
.now-line { position: relative; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.05); border-radius: 10px; padding: 4px 10px; }
.now-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 22px 6px 0; font-size: 14px; }
.now-head > span:not(.counts) { white-space: nowrap; }
.now-head .counts { color: #94a3b8; }
.now-head .go { position: absolute; top: 8px; right: 10px; color: #64748b; font-size: 18px; }
.now-line .msg { margin: 4px 0 6px; }
details.more { margin-top: 10px; }
details.more > summary { font-weight: 600; }
.line-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid rgba(148,163,184,0.08); }
.line-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.line-filter a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: #cbd5e1;
    background: rgba(148,163,184,0.1); border: 1px solid rgba(148,163,184,0.2); }
.line-filter a.active { background: rgba(59,130,246,0.22); border-color: rgba(96,165,250,0.6); color: #fff; }

/* Perturbations */
.msg { border-left: 3px solid #64748b; background: rgba(255,255,255,0.02); border-radius: 0 8px 8px 0; margin: 8px 0; }
.msg-incident { border-left-color: #f87171; }
.msg-travaux_en_cours, .msg-travaux_a_venir { border-left-color: #fb923c; }
.msg-here { background: rgba(248,113,113,0.08); }
.msg summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-size: 14px; color: #e2e8f0; list-style: none; }
.msg summary::-webkit-details-marker { display: none; }
.msg-pictos { display: inline-flex; gap: 3px; }
.msg-title { flex: 1; min-width: 12rem; }
.msg-title em { color: #fca5a5; font-style: normal; font-weight: 600; }
.msg-when { font-size: 12px; color: #fdba74; white-space: nowrap; }
.msg-text { padding: 0 12px 12px 36px; font-size: 13px; color: #94a3b8; line-height: 1.6; }
details.more > summary { cursor: pointer; color: #94a3b8; font-size: 14px; margin-top: 14px; }

/* Tableau des passages */
.board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.board-head h2 { font-size: 1.05rem; font-weight: 600; color: #fff; margin: 0; flex: 1; }
.dest-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px solid rgba(148,163,184,0.08); }
.dest { color: #e2e8f0; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip-dep { font-family: 'JetBrains Mono', monospace; font-size: 13px; padding: 3px 9px; border-radius: 6px; background: rgba(52,211,153,0.12); color: #a7f3d0; cursor: default; }
.chip-dep.late { background: rgba(251,146,60,0.15); color: #fed7aa; }
.chip-dep.late b { color: #fb923c; }
.chip-dep.theo { background: rgba(148,163,184,0.12); color: #cbd5e1; }
.chip-dep.canceled { background: rgba(248,113,113,0.15); color: #fca5a5; text-decoration: line-through; }
.idf-updated { font-size: 12px; color: #64748b; margin-top: 10px; }
.idf-updated.stale { color: #fb923c; }

/* Tableaux de trains */
.trip { width: 100%; border-collapse: collapse; font-size: 14px; }
.trip th { text-align: left; color: #64748b; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px; border-bottom: 1px solid rgba(148,163,184,0.15); }
.trip td { padding: 9px 8px; border-bottom: 1px solid rgba(148,163,184,0.07); color: #cbd5e1; vertical-align: middle; }
.trip tr.canceled td { color: #64748b; }
.trip .wait { display: block; font-size: 11px; color: #64748b; }
.trip.small td, .trip.small th { padding: 6px; font-size: 13px; }
.station-list { columns: 3 14rem; column-gap: 24px; font-size: 14px; }
.station-list a { display: block; padding: 3px 0; color: #93c5fd; break-inside: avoid; }

/* Favoris */
.title-row { display: flex; align-items: center; gap: 6px; }
.title-row h1 { margin: 0; }
/* Accueil avec favoris : introduction réduite au titre */
.page-intro.intro-compact { padding-top: 16px; padding-bottom: 16px; }
.page-intro.intro-compact p { display: none; }
.page-intro.intro-compact h1 { margin: 0; font-size: 1.25rem; }
/* Favori : étoile vide / pleine */
.fav-btn { background: none; border: 0; padding: 0 4px; font-size: 30px; line-height: 1; color: #64748b; cursor: pointer; transition: color 0.15s, transform 0.15s; }
.fav-btn:hover { color: #fbbf24; transform: scale(1.12); }
.fav-btn[aria-pressed="true"] { color: #fbbf24; }
.fav-btn:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; border-radius: 6px; }
.fav-btn.pop { animation: fav-pop 0.3s ease; }
@keyframes fav-pop { 50% { transform: scale(1.35); } }
.fav-banner { font-size: 1.05rem; font-weight: 700; padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; }
.fav-green { background: rgba(52,211,153,0.12); color: #6ee7b7; }
.fav-orange { background: rgba(251,146,60,0.14); color: #fdba74; }
.fav-red { background: rgba(248,113,113,0.16); color: #fca5a5; }
.fav-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.fav-head .idf-updated { margin: 0 0 12px; }
.fav-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 900px) { .fav-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fav-card { position: relative; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 14px; }
.fav-card h3 { font-size: 1rem; font-weight: 600; margin: 0 170px 8px 0; }
.fav-card h3 a { color: #fff; }
.fav-tools { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 4px; }
.fav-badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; margin-right: 4px; white-space: nowrap; }
.fav-badge.ok { color: #34d399; background: rgba(52,211,153,0.12); }
.fav-badge.orange { color: #fdba74; background: rgba(251,146,60,0.18); }
.fav-badge.red { color: #fca5a5; background: rgba(248,113,113,0.2); }
#fav-disruptions { scroll-margin-top: 16px; }
.fav-tools button { width: 26px; height: 26px; border-radius: 6px; border: 0; background: rgba(148,163,184,0.12); color: #cbd5e1; cursor: pointer; }
.fav-tools button:hover { background: rgba(148,163,184,0.25); }
.fav-share { margin-top: 12px; font-size: 13px; }
.fav-share button { background: transparent; border: 1px solid rgba(148,163,184,0.3); color: #cbd5e1; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.fav-share .copied { color: #34d399; margin-left: 8px; }
.fav-empty p { color: #94a3b8; font-size: 0.95rem; }

/* Détail d'un train (dépliable) */
.clickable { cursor: pointer; }
.trip tr.clickable:hover td { background: rgba(59,130,246,0.06); }
.chip-dep[data-train] { cursor: pointer; }
.chip-dep[data-train]:hover { filter: brightness(1.25); }
.nowrap { white-space: nowrap; }
.mission { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: #cbd5e1; letter-spacing: 0.05em; }
tr.train-detail-wrap > td { padding: 0 0 10px; border-bottom: 1px solid rgba(148,163,184,0.12); }
.train-detail { background: rgba(11,13,20,0.9); border: 1px solid rgba(96,165,250,0.25); border-radius: 10px; padding: 10px 12px; margin-top: 6px; font-size: 13px; color: #94a3b8; }
.td-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #e2e8f0; margin-bottom: 8px; }
.td-stops { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid rgba(96,165,250,0.35); }
.td-stops li { position: relative; display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 8px; padding: 3px 0; color: #cbd5e1; }
.td-stops li::before { content: ''; position: absolute; left: -19px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: #60a5fa; }
.td-stops li.passed { color: #4b5563; }
.td-stops li.passed::before { background: #374151; }
.td-stops li.canceled .td-name { text-decoration: line-through; color: #6b7280; }
.td-stops li.canceled .td-state { color: #f87171; }
.td-stops li.hl { color: #fff; font-weight: 600; }
.td-stops li.hl::before { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,0.25); }
.td-time s { color: #6b7280; font-weight: 400; }
.td-info { display: inline-flex; gap: 8px; white-space: nowrap; font-size: 12px; }
.td-state { color: #fb923c; }
.td-pf { color: #64748b; }
@media (max-width: 520px) {
    .td-stops li { grid-template-columns: 3.1rem 1fr auto; gap: 6px; }
    .td-time s { display: none; }  /* le retard reste indiqué à droite */
}

.trip-warn { color: #fca5a5; background: rgba(248,113,113,0.1); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 0 0 8px; }

/* Bilan des lignes */
.kpi-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); border-radius: 10px; padding: 12px; text-align: center; }
.kpi b { display: block; font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; color: #e2e8f0; }
.kpi span { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-violet { color: #a78bfa !important; }
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart .grid { stroke: rgba(148,163,184,0.12); stroke-width: 1; }
.chart .axis { fill: #64748b; font-size: 11px; font-family: Inter, sans-serif; }
@media (max-width: 640px) { .chart .axis { font-size: 22px; } }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: #94a3b8; margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.line-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.line-yday { font-size: 11px; color: #64748b; }
.line-card .line-state { white-space: nowrap; }

/* Une ligne sur deux légèrement plus claire, comme le tableau des grandes lignes (bg-white/[0.03]) ;
   les détails de train dépliés ne décalent pas l'alternance */
.trip tbody tr:nth-child(even of :not(.train-detail-wrap)) td { background: rgba(255,255,255,0.03); }
.board .dest-row:nth-child(even of .dest-row), .fav-card .dest-row:nth-child(even of .dest-row) { background: rgba(255,255,255,0.03); }
.dest-row { padding-left: 6px; padding-right: 6px; border-radius: 6px; }

.board-msgs { margin-top: 10px; padding-top: 6px; border-top: 1px solid rgba(148,163,184,0.12); }

/* Perturbations repliées par défaut : flèche qui indique qu'on peut déplier */
.msg summary { padding-right: 32px; position: relative; }
.msg summary::after { content: '›'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #64748b; font-size: 20px; transition: transform 0.15s; }
.msg[open] summary::after { transform: translateY(-50%) rotate(90deg); }
.msg summary:hover .msg-title { color: #fff; }

/* Étoile des blocs « Mes trajets » (retirer des favoris) et bandeau d'annulation */
.fav-btn-sm { font-size: 22px; padding: 0 2px; margin-left: 2px; }
.fav-undo { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 10px 14px; border-radius: 10px;
    background: rgba(59,130,246,0.15); border: 1px solid rgba(96,165,250,0.4); color: #dbeafe; font-size: 14px; }
.fav-undo button { background: none; border: 0; color: #93c5fd; font-weight: 700; text-decoration: underline; cursor: pointer; font-size: 14px; }

.idf-about p { color: #94a3b8; font-size: 0.92rem; line-height: 1.7; margin: 0 0 8px; }
.idf-about strong { color: #e2e8f0; }
