/**
 * line-pages.css - Styles pour les pages horaires de lignes P├®ribus
 * Mobile-first, optimis├® CTR et conversion
 * 
 * Copyright (c) 2025-2026 P├®rimap. Tous droits r├®serv├®s.
 */

/* ==========================================================================
   Variables et couleurs des lignes
   ========================================================================== */

:root {
    /* Lignes principales */
    --line-a-color: #fdd003;
    --line-a-text: #000000;
    --line-b-color: #1e91ff;
    --line-b-text: #000000;
    --line-c-color: #dd1b75;
    --line-c-text: #ffffff;
    --line-d-color: #41ae18;
    --line-d-text: #ffffff;
    
    /* Lignes secondaires */
    --line-n-color: #2254b2;
    --line-n-text: #ffffff;
    
    /* UI */
    --pm-green: #22c55e;
    --pm-green-hover: #16a34a;
    --pm-cyan: #00c8ff;
    --quick-menu-bg: rgba(11, 18, 32, 0.94);
    --card-bg: #0f1724;
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #e6eef8;
    --text-secondary: #9fb3c9;
    --text-muted: #6b7c93;
    --cta-green: var(--pm-green);
    --cta-green-hover: var(--pm-green-hover);
    --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-ui: 12px;
    --radius-pill: 999px;
    --transition-fast: 120ms ease-out;
    --transition-normal: 180ms ease-out;
}

/* ==========================================================================
   Quick Lines Menu (Sticky Mobile)
   ========================================================================== */

.quick-lines-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--quick-menu-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--card-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.quick-line-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.quick-line-btn:hover,
.quick-line-btn:focus {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.quick-line-btn.active {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.quick-line-btn.line-a { background: var(--line-a-color); color: var(--line-a-text); }
.quick-line-btn.line-b { background: var(--line-b-color); color: var(--line-b-text); }
.quick-line-btn.line-c { background: var(--line-c-color); color: var(--line-c-text); }
.quick-line-btn.line-d { background: var(--line-d-color); color: var(--line-d-text); }
.quick-line-btn.line-n { background: var(--line-n-color); color: var(--line-n-text); }

.quick-line-btn.home-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.quick-line-btn.home-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Page Layout
   ========================================================================== */

.line-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #0b1220 0%, #111b2b 100%);
    color: var(--text-primary);
    font-family: var(--font-family);
}

.line-page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); /* Espace pour le menu sticky */
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.line-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--line-color) 0%, color-mix(in srgb, var(--line-color) 70%, #000) 100%);
    border-radius: var(--radius-ui);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.line-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    font-size: 32px;
    font-weight: 800;
    color: var(--line-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.line-hero-text h1 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: var(--line-text);
    line-height: 1.2;
}

.line-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--line-text);
    opacity: 0.85;
}

/* ==========================================================================
   CTA Section
   ========================================================================== */

.line-cta-section {
    text-align: center;
    margin-bottom: 28px;
}

.btn-primary-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    padding: 16px 24px;
    background: var(--cta-green);
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-ui);
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.btn-primary-large:hover,
.btn-primary-large:focus {
    background: var(--cta-green-hover);
    transform: translateY(-2px);
}

.btn-primary-large:active {
    transform: translateY(0);
}

.cta-subtext {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ==========================================================================
   Info Cards
   ========================================================================== */

.line-info-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-ui);
    transition: border-color var(--transition-fast);
}

.info-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.info-card-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.info-card h2 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.info-card p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */

.line-faq {
    margin-bottom: 28px;
}

.line-faq > h2 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.faq-item {
    margin-bottom: 10px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-ui);
    overflow: hidden;
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 400;
    color: var(--text-secondary);
    transition: transform var(--transition-normal);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    margin: 0;
    padding: 0 16px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   Other Lines Grid
   ========================================================================== */

.other-lines {
    margin-bottom: 28px;
}

.other-lines > h2 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.lines-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.line-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-ui);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.line-link:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.line-badge-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.line-link.line-a .line-badge-small { background: var(--line-a-color); color: var(--line-a-text); }
.line-link.line-b .line-badge-small { background: var(--line-b-color); color: var(--line-b-text); }
.line-link.line-c .line-badge-small { background: var(--line-c-color); color: var(--line-c-text); }
.line-link.line-d .line-badge-small { background: var(--line-d-color); color: var(--line-d-text); }

.line-link.all-lines .line-badge-small {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.line-footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--card-border);
}

.line-footer p {
    margin: 0 0 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.line-footer a {
    color: var(--text-primary);
    text-decoration: none;
}

.line-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Tablet+ Responsive
   ========================================================================== */

@media (min-width: 600px) {
    .line-page-content {
        padding: 24px;
    }

    .line-hero {
        padding: 32px 28px;
    }

    .line-badge {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .line-hero-text h1 {
        font-size: 28px;
    }

    .line-info-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .lines-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .quick-lines-menu {
        gap: 12px;
    }

    .quick-line-btn {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
}

/* Desktop: Menu lat├®ral optionnel */
@media (min-width: 1024px) {
    .quick-lines-menu {
        position: fixed;
        top: 50%;
        left: 16px;
        right: auto;
        bottom: auto;
        transform: translateY(-50%);
        flex-direction: column;
        padding: 12px;
        border-radius: var(--radius-ui);
        border: 1px solid var(--card-border);
        border-top: 1px solid var(--card-border);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .line-page-content {
        padding-left: 100px;
        padding-bottom: 24px;
    }
}

/* ==========================================================================
   NOUVELLE ARCHITECTURE — HORAIRES (2 ÉTATS)
   État 1: Vue Ligne (sélection direction + liste arrêts)
   État 2: Vue Arrêt (prochains passages)
   ========================================================================== */

/* Conteneurs principaux */
.horaires-view-line {
    display: block;
}

.horaires-view-line.hidden {
    display: none;
}

.horaires-view-stop {
    display: none;
}

.horaires-view-stop.visible {
    display: block;
}

/* État 1: Sélection direction */
.horaires-line-header {
    margin-bottom: 24px;
    text-align: center;
}

.horaires-line-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

.horaires-line-destinations {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Sélecteur de direction */
.horaires-direction-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
}

.horaires-direction-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--card-border);
    border-radius: var(--radius-ui);
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.horaires-direction-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.horaires-direction-btn.is-active {
    background: var(--line-btn-color, #22c55e);
    border-color: var(--line-btn-color, #22c55e);
    color: #ffffff;
}

/* Sélecteur de branches (ex: K1A) */
.horaires-branch-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0;
}

.horaires-branch-btn {
    padding: 8px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.horaires-branch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.horaires-branch-btn.is-active {
    background: var(--line-btn-color, #22c55e);
    border-color: var(--line-btn-color, #22c55e);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* État 1: Liste des arrêts avec tracé */
.horaires-stops-container {
    position: relative;
    padding-left: 48px;
    margin-bottom: 24px;
}

/* Tracé vertical - Ligne continue (pas SVG) */
.horaires-stops-trace {
    position: absolute;
    left: 18px;
    top: 24px;
    bottom: 24px;
    width: 4px;
    background: var(--line-btn-color, #22c55e);
    border-radius: 2px;
    z-index: 1;
}

/* Liste des arrêts */
.horaires-stops-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
}

.horaires-stop-item {
    position: relative;
    padding-left: 0;
    padding-right: 12px;
}

/* Rond de l'arrêt (élément visuel) - ARRÊTS INTERMÉDIAIRES */
.horaires-stop-dot {
    position: absolute;
    left: -28px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--line-btn-color, #22c55e);
    border: none;
    z-index: 2;
}

/* Terminus = rond BEAUCOUP PLUS GROS */
.horaires-stop-item.is-terminus .horaires-stop-dot {
    width: 20px;
    height: 20px;
    left: -32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.horaires-stop-item.is-blocked .horaires-stop-dot {
    background: #dc2626;
}

/* ==========================================================================
   OVERRIDE DES STYLES INLINE DES FICHIERS HTML (36 fichiers)
   Ces règles forcent le nouveau design TBM sur les anciennes structures
   ========================================================================== */

/* Tracé vertical - OVERRIDE */
.stops-list::before {
    width: 4px !important;
    background: var(--line-color) !important;
    opacity: 1 !important;
    left: 8px !important;
}

/* Ronds PLEINS (pas creux) - OVERRIDE */
.stops-list li::before {
    background: var(--line-color) !important;
    border: none !important;
    width: 12px !important;
    height: 12px !important;
    left: -20px !important;
}

/* Premier arrêt = TERMINUS = rond plus gros */
.stops-list li:first-child::before {
    width: 20px !important;
    height: 20px !important;
    left: -24px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Dernier arrêt = TERMINUS = rond plus gros */
.stops-list li:last-child::before {
    width: 20px !important;
    height: 20px !important;
    left: -24px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Bouton de l'arrêt */
.horaires-stop-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-ui);
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-normal);
    margin-bottom: 8px;
}

.horaires-stop-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.horaires-stop-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

.horaires-stop-item.is-blocked .horaires-stop-btn,
.horaires-stop-btn[data-blocked="true"],
.stop-row.is-blocked {
    border-color: rgba(220, 38, 38, 0.45);
    background: rgba(220, 38, 38, 0.12);
    color: #fecaca;
    cursor: not-allowed;
}

.horaires-stop-btn[data-blocked="true"]:hover,
.horaires-stop-btn[data-blocked="true"]:active,
.stop-row.is-blocked:hover,
.stop-row.is-blocked:active {
    background: rgba(220, 38, 38, 0.14);
    border-color: rgba(220, 38, 38, 0.5);
}

.horaires-stop-btn[data-blocked="true"] .horaires-stop-arrow {
    color: #fecaca;
}

.horaires-stop-blocked-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fee2e2;
    background: rgba(220, 38, 38, 0.25);
    border: 1px solid rgba(248, 113, 113, 0.5);
}

.horaires-stop-name {
    flex: 1;
    font-weight: 500;
}

.horaires-stop-arrow {
    margin-left: 12px;
    color: var(--text-secondary);
    font-size: 18px;
}

/* État 2: Vue Arrêt - Header */
.horaires-stop-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.horaires-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-ui);
    transition: all var(--transition-normal);
    flex-shrink: 0;
    touch-action: manipulation;
}

.horaires-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.horaires-stop-info h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.horaires-stop-direction {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* État 2: Section des prochains passages */
.horaires-departures {
    margin-bottom: 24px;
}

.horaires-departures-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 🎨 Badge temps réel (aligné sur le bottom sheet carte) */
.horaires-realtime-badge,
.stop-next-realtime-badge,
.realtime-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill, 999px);
    font-size: 11px;
    font-weight: 700;
    color: #16794b;
    background: #e4f6ea;
    border: 1px solid #b5e4c8;
}

/* 🎨 Icône WiFi temps réel */
.realtime-icon {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    position: relative;
    top: -1px;
}

.realtime-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes realtimePulse {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.06);
    }
    100% {
        opacity: 0.4;
        transform: scale(1);
    }
}

.realtime-icon--animated {
    /* Animation intentionally disabled to avoid ambiguous pulsing near times.
       The realtime badge remains (static Wi‑Fi icon). */
    animation: none !important;
}

/* Transient pop animation for wifi icon when an update occurs (non-pulsing) */
@keyframes realtimePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.realtime-icon--updated {
    animation: realtimePop 380ms ease-in-out;
}

.realtime-badge .wifi-indicator,
.departure-realtime-badge .wifi-indicator {
    width: 15px;
    height: 15px;
    display: inline-block;
    position: relative;
    top: -1px;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Cpath d='M10 13.25c.69 0 1.25-.56 1.25-1.25S10.69 10.75 10 10.75 8.75 11.31 8.75 12s.56 1.25 1.25 1.25Z' fill='%23000'/%3E%3Cpath d='M4.93 8.18a6.38 6.38 0 0 1 10.14 0 .75.75 0 1 0 1.2-.9 7.88 7.88 0 0 0-12.54 0 .75.75 0 1 0 1.2.9Z' fill='%23000' opacity='.85'/%3E%3Cpath d='M7.48 9.87a3.7 3.7 0 0 1 5.04 0 .75.75 0 1 0 1.04-1.08 5.2 5.2 0 0 0-7.12 0 .75.75 0 0 0 1.04 1.08Z' fill='%23000' opacity='.7'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Cpath d='M10 13.25c.69 0 1.25-.56 1.25-1.25S10.69 10.75 10 10.75 8.75 11.31 8.75 12s.56 1.25 1.25 1.25Z' fill='%23000'/%3E%3Cpath d='M4.93 8.18a6.38 6.38 0 0 1 10.14 0 .75.75 0 1 0 1.2-.9 7.88 7.88 0 0 0-12.54 0 .75.75 0 1 0 1.2.9Z' fill='%23000' opacity='.85'/%3E%3Cpath d='M7.48 9.87a3.7 3.7 0 0 1 5.04 0 .75.75 0 1 0 1.04-1.08 5.2 5.2 0 0 0-7.12 0 .75.75 0 0 0 1.04 1.08Z' fill='%23000' opacity='.7'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    animation: realtimePulse 1.6s ease-in-out infinite;
}

.realtime-badge .wifi-indicator::before,
.realtime-badge .wifi-indicator::after,
.departure-realtime-badge .wifi-indicator::before,
.departure-realtime-badge .wifi-indicator::after {
    display: none;
}

/* Legacy (SEO) pages: aligne .wifi-indicator sur l'icône temps réel de la carte */
@supports ((-webkit-mask-image: linear-gradient(#000, #000)) or (mask-image: linear-gradient(#000, #000))) {
    /* Badge "Temps réel" (header) : remplace le point par l'icône WiFi de la carte */
    .realtime-badge .wifi-indicator {
        width: 15px !important;
        height: 15px !important;
        display: inline-block !important;
        background: currentColor !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2020%2014%22%3E%3Cpath%20d%3D%22M10%2013.25c.69%200%201.25-.56%201.25-1.25S10.69%2010.75%2010%2010.75%208.75%2011.31%208.75%2012s.56%201.25%201.25%201.25Z%22%20fill%3D%22%23000%22/%3E%3Cpath%20d%3D%22M4.93%208.18a6.38%206.38%200%200%201%2010.14%200%20.75.75%200%201%200%201.2-.9%207.88%207.88%200%200%200-12.54%200%20.75.75%200%201%200%201.2.9Z%22%20fill%3D%22%23000%22%20opacity%3D%22.85%22/%3E%3Cpath%20d%3D%22M7.48%209.87a3.7%203.7%200%200%201%205.04%200%20.75.75%200%201%200%201.04-1.08%205.2%205.2%200%200%200-7.12%200%20.75.75%200%200%200%201.04%201.08Z%22%20fill%3D%22%23000%22%20opacity%3D%22.7%22/%3E%3C/svg%3E") !important;
        mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2020%2014%22%3E%3Cpath%20d%3D%22M10%2013.25c.69%200%201.25-.56%201.25-1.25S10.69%2010.75%2010%2010.75%208.75%2011.31%208.75%2012s.56%201.25%201.25%201.25Z%22%20fill%3D%22%23000%22/%3E%3Cpath%20d%3D%22M4.93%208.18a6.38%206.38%200%200%201%2010.14%200%20.75.75%200%201%200%201.2-.9%207.88%207.88%200%200%200-12.54%200%20.75.75%200%201%200%201.2.9Z%22%20fill%3D%22%23000%22%20opacity%3D%22.85%22/%3E%3Cpath%20d%3D%22M7.48%209.87a3.7%203.7%200%200%201%205.04%200%20.75.75%200%201%200%201.04-1.08%205.2%205.2%200%200%200-7.12%200%20.75.75%200%200%200%201.04%201.08Z%22%20fill%3D%22%23000%22%20opacity%3D%22.7%22/%3E%3C/svg%3E") !important;
        -webkit-mask-repeat: no-repeat !important;
        mask-repeat: no-repeat !important;
        -webkit-mask-size: contain !important;
        mask-size: contain !important;
        -webkit-mask-position: center !important;
        mask-position: center !important;
        animation: realtimePulse 1.6s ease-in-out infinite !important;
    }

    .departure-realtime-badge .wifi-indicator {
        width: 15px !important;
        height: 15px !important;
        display: inline-block !important;
        position: relative !important;
        top: -1px !important;
        background-color: currentColor !important;
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2020%2014%22%3E%3Cpath%20d%3D%22M10%2013.25c.69%200%201.25-.56%201.25-1.25S10.69%2010.75%2010%2010.75%208.75%2011.31%208.75%2012s.56%201.25%201.25%201.25Z%22%20fill%3D%22%23000%22/%3E%3Cpath%20d%3D%22M4.93%208.18a6.38%206.38%200%200%201%2010.14%200%20.75.75%200%201%200%201.2-.9%207.88%207.88%200%200%200-12.54%200%20.75.75%200%201%200%201.2.9Z%22%20fill%3D%22%23000%22%20opacity%3D%22.85%22/%3E%3Cpath%20d%3D%22M7.48%209.87a3.7%203.7%200%200%201%205.04%200%20.75.75%200%201%200%201.04-1.08%205.2%205.2%200%200%200-7.12%200%20.75.75%200%200%200%201.04%201.08Z%22%20fill%3D%22%23000%22%20opacity%3D%22.7%22/%3E%3C/svg%3E") !important;
        mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2020%2014%22%3E%3Cpath%20d%3D%22M10%2013.25c.69%200%201.25-.56%201.25-1.25S10.69%2010.75%2010%2010.75%208.75%2011.31%208.75%2012s.56%201.25%201.25%201.25Z%22%20fill%3D%22%23000%22/%3E%3Cpath%20d%3D%22M4.93%208.18a6.38%206.38%200%200%201%2010.14%200%20.75.75%200%201%200%201.2-.9%207.88%207.88%200%200%200-12.54%200%20.75.75%200%201%200%201.2.9Z%22%20fill%3D%22%23000%22%20opacity%3D%22.85%22/%3E%3Cpath%20d%3D%22M7.48%209.87a3.7%203.7%200%200%201%205.04%200%20.75.75%200%201%200%201.04-1.08%205.2%205.2%200%200%200-7.12%200%20.75.75%200%200%200%201.04%201.08Z%22%20fill%3D%22%23000%22%20opacity%3D%22.7%22/%3E%3C/svg%3E") !important;
        -webkit-mask-repeat: no-repeat !important;
        mask-repeat: no-repeat !important;
        -webkit-mask-size: contain !important;
        mask-size: contain !important;
        -webkit-mask-position: center !important;
        mask-position: center !important;
        animation: realtimePulse 1.6s ease-in-out infinite !important;
    }

    .departure-realtime-badge .wifi-indicator::before,
    .departure-realtime-badge .wifi-indicator::after {
        content: "" !important;
        display: none !important;
        animation: none !important;
        border: 0 !important;
    }
}

.horaires-departures-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.horaires-departure-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-ui);
    background: rgba(255, 255, 255, 0.02);
    transition: all var(--transition-normal);
}

.horaires-departure-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

/* 🎨 Style pour l'item principal (premier départ) */
.horaires-departure-item.is-primary {
    border-width: 2px;
    background: rgba(var(--line-color-rgb, 255, 255, 255), 0.05);
}

.horaires-departure-item.is-primary .horaires-time-main {
    font-size: 20px;
    font-weight: 700;
}

/* 🎨 Bloc de temps (avec horaire barré si retard) */
.horaires-departure-time-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.horaires-time-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.horaires-time-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: var(--radius-pill, 999px);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary, #9ca3af);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.horaires-time-chip--cancelled {
    color: #fee2e2;
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(248, 113, 113, 0.34);
}

/* 🎨 Horaire précédent barré (quand il y a un retard) */
.horaires-time-previous {
    font-size: 12px;
    opacity: 0.6;
    text-decoration: line-through;
    color: var(--text-secondary);
}

.horaires-time-main {
    font-size: 18px;
    font-weight: 700;
    color: var(--line-color);
}

.horaires-time-main--cancelled {
    color: #fca5a5;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(248, 113, 113, 0.9);
}

.horaires-departure-item.is-cancelled {
    border-color: rgba(248, 113, 113, 0.28);
    background: rgba(127, 29, 29, 0.12);
}

/* 🎨 Temps d'attente relatif (dans X min) */
.horaires-time-relative {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.85;
    color: var(--text-secondary);
}

.horaires-departure-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.horaires-departure-meta .departure-direction {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.horaires-departure-meta .departure-direction-arrow {
    color: var(--text-muted);
    opacity: 0.85;
    font-weight: 700;
}

/* État 2: Placeholder */
.horaires-departures-placeholder {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* État 2: Footer avec action secondaire */
.horaires-stop-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}

.horaires-footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-ui);
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.horaires-footer-btn:hover:not(.is-disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.horaires-footer-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Animation d'entr├®e
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.line-hero {
    animation: fadeInUp 0.4s ease-out;
}

.line-cta-section {
    animation: fadeInUp 0.4s ease-out 0.1s both;
}

.line-info-cards {
    animation: fadeInUp 0.4s ease-out 0.2s both;
}

.line-faq {
    animation: fadeInUp 0.4s ease-out 0.3s both;
}

/* ==========================================================================
   Prefers Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .line-hero,
    .line-cta-section,
    .line-info-cards,
    .line-faq {
        animation: none;
    }
    
    .quick-line-btn,
    .btn-primary-large,
    .line-link {
        transition: none;
    }
}

/* ==========================================================================
   STYLE TBM : Tracé vertical + arrêts (Liste des arrêts)
   ========================================================================== */

.stops-trace { 
    position: relative; 
    padding-left: 36px; 
}

/* Tracé vertical : commence au centre du 1er arrêt, finit au centre du dernier */
.stops-trace::before { 
    content: ''; 
    position: absolute; 
    left: 13px; 
    top: 22px; 
    bottom: 22px; 
    width: 3px; 
    background: var(--line-color); 
    border-radius: 2px; 
}

.stops-list { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
}

.stops-list li { 
    position: relative; 
    padding: 14px 12px 14px 8px; 
    border-bottom: 1px solid rgba(255,255,255,0.06); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    cursor: pointer; 
    transition: background 0.12s ease; 
    border-radius: var(--radius-ui); 
}

.stops-list li:hover { 
    background: rgba(255,255,255,0.05); 
}

.stops-list li:last-child { 
    border-bottom: none; 
}

/* Rond de l'arrêt - CENTRÉ sur le tracé et verticalement sur le texte */
.stops-list li::before { 
    content: ''; 
    position: absolute; 
    left: -27.5px; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 12px; 
    height: 12px; 
    border-radius: 50%; 
    background: var(--line-color); 
    border: none; 
    z-index: 2; 
}

/* Terminus : ronds plus gros avec halo */
.stops-list li:first-child::before,
.stops-list li:last-child::before { 
    width: 18px; 
    height: 18px; 
    left: -30.5px; 
    box-shadow: 0 0 0 4px var(--line-color-glow, rgba(255,255,255,0.15)); 
}

.stop-name { 
    font-weight: 600; 
    color: var(--text-primary); 
    font-size: 0.95rem; 
}

.stop-arrow { 
    color: var(--text-muted, rgba(255,255,255,0.4)); 
    font-size: 1.1rem; 
}

.stops-list li.is-selected { 
    background: rgba(255,255,255,0.1); 
}

.stops-list li.is-selected .stop-name { 
    color: var(--line-color); 
}

/* ==========================================================================
   STYLE TBM : Toggle direction
   ========================================================================== */

.direction-toggle { 
    display: flex; 
    gap: 8px; 
    margin-bottom: 16px; 
}

.direction-btn { 
    flex: 1; 
    padding: 12px 16px; 
    border-radius: var(--radius-ui); 
    border: 1px solid var(--border, rgba(255,255,255,0.08)); 
    background: var(--bg-elevated, #151d2b); 
    color: var(--text-secondary, rgba(255,255,255,0.7)); 
    font-weight: 600; 
    font-size: 0.9rem; 
    cursor: pointer; 
    transition: all var(--transition-fast); 
    text-align: center; 
}

.direction-btn.is-active { 
    background: var(--line-color); 
    color: var(--line-text, #000); 
    border-color: var(--line-color); 
}

/* ==========================================================================
   STYLE TBM : Recherche arrêt
   ========================================================================== */

.stop-search-row { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 16px; 
}

.stop-search-input { 
    flex: 1; 
    padding: 12px 16px; 
    border-radius: var(--radius-ui); 
    border: 1px solid var(--border, rgba(255,255,255,0.08)); 
    background: var(--bg-elevated, #151d2b); 
    color: var(--text-primary, #fff); 
    font-size: 0.95rem; 
    font-family: inherit;
}

.stop-search-input::placeholder { 
    color: var(--text-muted, rgba(255,255,255,0.4)); 
}

.stop-search-input:focus { 
    outline: none; 
    border-color: var(--line-color); 
}

/* ==========================================================================
   ARCHITECTURE 2 ÉTATS : Vue Ligne / Vue Arrêt
   ========================================================================== */

.state-line, .state-stop { 
    max-width: 560px; 
    margin: 0 auto; 
}

.state-stop { 
    display: none; 
}

.state-stop.is-visible { 
    display: block; 
}

body.line-page.line-runtime-web #line-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    margin: 0 0 18px;
}

body.line-page.line-runtime-web #line-title {
    display: none;
}

body.line-page.line-runtime-web .line-info {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 0;
    text-align: center;
}

body.line-page.line-runtime-web .line-badge {
    margin: 0 auto;
}

body.line-page.line-runtime-web .line-direction {
    max-width: 18ch;
    margin: 0;
    font-size: clamp(1.1rem, 3vw, 1.45rem);
    font-weight: 800;
    line-height: 1.16;
    text-align: center;
    color: var(--text-primary, #ffffff);
    opacity: 1;
    text-wrap: balance;
}

.state-line.is-hidden { 
    display: none; 
}

/* ==========================================================================
   SEO line pages: harmonisation largeur + hiérarchie visuelle
   (vue arrêt : blocs / prochains passages / tous les horaires)
   ========================================================================== */

/* Aligner la largeur des blocs sur "Plans et horaires à télécharger" */
.state-stop .block-stop-context,
.state-stop .block-next-departures,
.state-stop .block-all-schedules {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Flèche + hiérarchie : listes horaires (Tous les horaires) */
.schedule-destination {
    font-weight: 500 !important; /* override inline style="font-weight:700" */
    font-size: 0.8rem !important;
}

.schedule-destination::before {
    content: "→ ";
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
    font-weight: 700;
}

/* Flèche + hiérarchie : prochains passages (pages SEO legacy) */
.departure-destination {
    font-weight: 500 !important;
    font-size: 0.85rem !important;
}

.departure-destination::before {
    content: "→ ";
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
    font-weight: 700;
}

/* === ÉTAT 2 : Vue Arrêt === */
.stop-view-header { 
    margin-bottom: 20px; 
}

.back-btn { 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    background: none; 
    border: none; 
    color: var(--text-secondary, rgba(255,255,255,0.7)); 
    font-size: 0.9rem; 
    font-weight: 600; 
    cursor: pointer; 
    padding: 8px 0; 
    margin-bottom: 12px; 
    font-family: inherit;
    touch-action: manipulation;
}

.back-btn:hover { 
    color: var(--line-color); 
}

.back-btn svg { 
    width: 18px; 
    height: 18px; 
}

.topbar-pill {
    touch-action: manipulation;
}

.stop-view-title { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--text-primary, #fff); 
    margin-bottom: 4px; 
}

.stop-view-direction { 
    font-size: 0.9rem; 
    color: var(--text-secondary, rgba(255,255,255,0.7)); 
}

/* === Prochains passages === */
.departures-card { 
    background: var(--bg-card, #0f1724); 
    border-radius: var(--radius-ui); 
    border: 1px solid var(--border, rgba(255,255,255,0.08)); 
    padding: 20px; 
    margin-bottom: 16px; 
}

.departures-card h3 { 
    font-size: 1rem; 
    font-weight: 700; 
    margin-bottom: 16px; 
    color: var(--text-primary, #fff); 
}

.departure-item { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 12px 0; 
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08)); 
}

.departure-item:last-child { 
    border-bottom: none; 
}

.departure-item.is-cancelled {
    opacity: 0.98;
}

.departure-time { 
    font-size: 1.2rem; 
    font-weight: 700; 
    color: var(--text-primary, #fff); 
}

.departure-time-main--cancelled {
    color: #fca5a5;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(248, 113, 113, 0.9);
}

.departure-time.is-realtime { 
    color: var(--pm-green, #22c55e); 
}

.departure-delay { 
    font-size: 0.8rem; 
    color: var(--text-muted, rgba(255,255,255,0.4)); 
    margin-left: 8px; 
}

.departure-meta { 
    font-size: 0.85rem; 
    color: var(--text-secondary, rgba(255,255,255,0.7)); 
}

.departure-delay-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    border: 1px solid rgba(96, 165, 250, 0.24);
}

.departure-delay-badge.is-early {
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.24);
}

.departure-delay-badge--cancelled {
    background: rgba(220, 38, 38, 0.16);
    color: #fee2e2;
    border-color: rgba(248, 113, 113, 0.34);
}

.disruption-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 16px;
    border: 1px solid rgba(248, 250, 252, 0.08);
    background: rgba(15, 23, 42, 0.78);
}

.disruption-banner--info {
    background: rgba(30, 64, 175, 0.18);
    border-color: rgba(96, 165, 250, 0.24);
    color: #dbeafe;
}

.disruption-banner--warning {
    background: rgba(217, 119, 6, 0.18);
    border-color: rgba(251, 191, 36, 0.24);
    color: #fef3c7;
}

.disruption-banner--major {
    background: rgba(185, 28, 28, 0.18);
    border-color: rgba(248, 113, 113, 0.28);
    color: #fee2e2;
}

.disruption-banner-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.disruption-banner-phase {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    background: rgba(255, 255, 255, 0.14);
    color: currentColor;
}

.disruption-banner-text {
    line-height: 1.45;
}

.no-departures { 
    text-align: center; 
    padding: 24px; 
    color: var(--text-muted, rgba(255,255,255,0.4)); 
    font-style: italic; 
}

/* === Bloc PDF === */
.pdf-block { 
    background: var(--bg-card, #0f1724); 
    border-radius: var(--radius-ui); 
    border: 1px solid var(--border, rgba(255,255,255,0.08)); 
    padding: 20px; 
}

.pdf-block h3 { 
    font-size: 0.95rem; 
    font-weight: 600; 
    margin-bottom: 8px; 
    color: var(--text-primary, #fff); 
}

.pdf-block p { 
    font-size: 0.85rem; 
    color: var(--text-secondary, rgba(255,255,255,0.7)); 
    margin-bottom: 12px; 
}

.pdf-link { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    color: var(--line-color); 
    font-weight: 600; 
    text-decoration: none; 
    font-size: 0.95rem; 
}

.pdf-link:hover { 
    text-decoration: underline; 
}

.pdf-link svg { 
    width: 18px; 
    height: 18px; 
}

.trip-detail-trigger {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.trip-detail-trigger:hover {
    transform: translateX(1px);
    border-color: rgba(var(--line-color-rgb, 59, 130, 246), 0.38);
    background: rgba(var(--line-color-rgb, 59, 130, 246), 0.1);
    color: var(--line-color, #2563eb);
}

.trip-detail-trigger.is-disabled,
.trip-detail-trigger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.trip-detail-trigger-icon {
    font-size: 26px;
    line-height: 1;
    transform: translateX(1px);
}

.trip-detail-modal .line-detail-content.trip-detail-modal-content {
    width: min(92vw, 640px);
    max-width: 640px;
    max-height: min(88vh, 920px);
    padding: 18px 18px 20px;
    border-radius: 28px;
    overflow: auto;
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.24);
}

.trip-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin: 0 0 12px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
}

.trip-detail-card {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trip-detail-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.trip-detail-badge {
    min-width: 64px;
    min-height: 64px;
    width: 64px;
    height: 64px;
    font-size: 1.75rem;
    border-radius: 20px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.trip-detail-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trip-detail-label {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.trip-detail-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.08;
    font-weight: 820;
}

.trip-detail-line-name {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.4;
}

.trip-detail-summary {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.05);
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.45;
}

.trip-detail-stop-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trip-detail-stop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: #ffffff;
}

.trip-detail-stop-item.is-current-stop {
    border-color: rgba(var(--line-color-rgb, 59, 130, 246), 0.42);
    background: rgba(var(--line-color-rgb, 59, 130, 246), 0.08);
    box-shadow: 0 10px 22px rgba(var(--line-color-rgb, 59, 130, 246), 0.12);
}

.trip-detail-stop-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trip-detail-stop-seq {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    font-size: 0.82rem;
    font-weight: 800;
}

.trip-detail-stop-copy {
    min-width: 0;
}

.trip-detail-stop-name {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 700;
}

.trip-detail-stop-note {
    margin: 4px 0 0;
    color: #475569;
    font-size: 0.82rem;
}

.trip-detail-stop-times {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.trip-detail-stop-time {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
}

.trip-detail-stop-time--scheduled {
    color: #94a3b8;
    font-size: 0.88rem;
    text-decoration: line-through;
}

.trip-detail-stop-time--realtime {
    color: var(--line-color, #2563eb);
}

.trip-detail-empty {
    padding: 22px 18px;
    border-radius: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    background: #f8fafc;
}

.trip-detail-empty h4 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
}

.trip-detail-empty p {
    margin: 0;
    color: #475569;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .trip-detail-modal .line-detail-content.trip-detail-modal-content {
        width: 100vw;
        max-width: none;
        max-height: none;
        height: 100dvh;
        border-radius: 0;
        padding: max(12px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    }

    .trip-detail-card {
        min-height: calc(100dvh - 96px);
        border-radius: 22px;
    }

    .trip-detail-head {
        align-items: flex-start;
    }

    .trip-detail-stop-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .trip-detail-stop-times {
        width: 100%;
        justify-content: flex-end;
    }
}
