﻿
/* Définition des variables CSS globales pour la charte graphique */
:root {
    --bg-main: #fbf7fa; /* Couleur de fond principale */
    --bg-alt: #f4ecf3; /* Couleur de fond alternative */
    --text-main: #231622; /* Couleur principale du texte */
    --text-soft: #6a5567; /* Couleur secondaire du texte */
    --brand: #cf1678; /* Couleur de la marque */
    --brand-dark: #8d0d52; /* Variante foncée de la marque */
    --accent: #1e1a1d; /* Couleur d'accentuation */
    --card: #ffffff; /* Couleur de fond des cartes */
    --line: #e5c8da; /* Couleur des lignes de séparation */
    --shadow: 0 14px 30px rgba(80, 24, 58, 0.12); /* Ombre portée */
    --radius: 16px; /* Rayon de bordure */
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Manrope", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 18% 0%, rgba(207, 22, 120, 0.16), transparent 30%),
        radial-gradient(circle at 95% 15%, rgba(37, 25, 37, 0.08), transparent 28%),
        var(--bg-main);
    line-height: 1.55;
}

h1,
h2,
h3 {
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.2;
    margin-top: 0;
}

a {
    color: var(--brand-dark);
}

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    background:
        radial-gradient(circle at 14% 18%, rgba(255, 219, 238, 0.2), transparent 24%),
        linear-gradient(135deg, #5e1037 0%, #8d0d52 48%, #cf1678 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 221, 238, 0.22);
    box-shadow: 0 14px 28px rgba(92, 9, 49, 0.24);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    gap: 16px;
}

.brand {
    display: inline-block;
    text-decoration: none;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 900;
    font-size: clamp(1.02rem, 2.1vw, 1.42rem);
    line-height: 1.05;
    color: #fff9fd;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    -webkit-text-stroke: 0.65px rgba(79, 8, 45, 0.55);
    text-shadow:
        0 2px 0 rgba(255, 255, 255, 0.16),
        0 10px 24px rgba(55, 8, 30, 0.36),
        0 0 18px rgba(255, 173, 220, 0.32);
}

.site-nav {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 226, 239, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-nav a {
    text-decoration: none;
    color: #fff1f8;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 999px;
    letter-spacing: 0.01em;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.site-nav a:hover,
.site-nav a.active {
    background: #fff7fb;
    color: var(--brand-dark);
    box-shadow: 0 8px 20px rgba(57, 7, 30, 0.16);
}

.menu-toggle {
    display: none;
    border: 1px solid rgba(255, 226, 239, 0.26);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff7fb;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
}

.hero {
    padding: 64px 0 38px;
}

.hero-landing {
    position: relative;
    overflow: hidden;
    padding-top: 82px;
    padding-bottom: 52px;
    min-height: 72vh;
    display: grid;
    align-content: center;
}

.hero-video-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url("../img/couverture/Poitiers_panorama_01.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.hero-landing::after {
    display: none;
}

.hero-single {
    position: relative;
    z-index: 2;
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 8px;
}

.hero-typed-line {
    margin: 0;
    min-height: 42px;
}

#hero-word {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    font-weight: 700;
    color: #ffd3ea;
}

.hero-landing .hero-lead-landing {
    max-width: 52ch;
    color: #ffffff;
    font-size: clamp(1.35rem, 3.5vw, 2.2rem);
    font-weight: 900;
    line-height: 1.42;
    letter-spacing: 0.01em;
    padding: 16px 28px;
    border: 2px solid rgba(255, 255, 255, 0.80);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.28);
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.10),
        0 8px 28px rgba(0, 0, 0, 0.40);
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.70),
        0 0 32px rgba(255, 210, 234, 0.40);
    animation: heroLeadReveal 1s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.35s;
}

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

.hero-actions-landing {
    margin-top: 12px;
}

.btn-start {
    padding: 13px 24px;
    letter-spacing: 0.04em;
}

.hero-rail {
    position: relative;
    z-index: 2;
    margin: 28px 0;
    border-top: 1px solid rgba(255, 220, 239, 0.42);
    border-bottom: 1px solid rgba(255, 220, 239, 0.42);
    padding: 10px 0;
    overflow: hidden;
    white-space: nowrap;
    background: linear-gradient(90deg, rgba(66, 18, 47, 0.45), rgba(28, 22, 31, 0.48));
}

.hero-rail span {
    display: inline-block;
    margin-right: 28px;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    color: #ffe6f3;
    animation: railSlide 11s linear infinite;
}

.hero-context-card-wrap {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
}

.hero-card-landing {
    max-width: 780px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-landing .eyebrow {
    color: #f4fffc;
}

.hero-landing h1 {
    color: #ffffff;
    display: inline-block;
    padding: 14px 36px;
    border: 3px solid #ffffff;
    border-radius: 16px;
    background: rgba(207, 22, 120, 0.22);
    box-shadow:
        0 0 0 5px rgba(255, 255, 255, 0.12),
        0 0 40px rgba(207, 22, 120, 0.45),
        0 8px 24px rgba(0, 0, 0, 0.45);
    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.65),
        0 0 24px rgba(255, 200, 230, 0.5);
    animation: h1FramePulse 3s ease-in-out infinite;
}

@keyframes h1FramePulse {
    0%, 100% {
        box-shadow:
            0 0 0 5px rgba(255, 255, 255, 0.12),
            0 0 40px rgba(207, 22, 120, 0.45),
            0 8px 24px rgba(0, 0, 0, 0.45);
    }
    50% {
        box-shadow:
            0 0 0 8px rgba(255, 255, 255, 0.20),
            0 0 64px rgba(207, 22, 120, 0.70),
            0 8px 28px rgba(0, 0, 0, 0.50);
    }
}

@keyframes railSlide {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-220px);
    }
}

.hero-bus {
    position: absolute;
    bottom: 52px;
    left: 0;
    width: 100%;
    height: 66px;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.hero-bus svg {
    position: absolute;
    bottom: 0;
    width: 110px;
    height: 46px;
    filter: drop-shadow(0 3px 10px rgba(0,0,0,0.6));
    animation: busRide 22s linear infinite;
}

.hero-bus svg:nth-child(1) { animation-delay:   0s; }
.hero-bus svg:nth-child(2) { animation-delay:  -5.5s; }
.hero-bus svg:nth-child(3) { animation-delay: -11s; }
.hero-bus svg:nth-child(4) { animation-delay: -16.5s; }

@keyframes busRide {
    from { transform: translateX(105vw); }
    to   { transform: translateX(-140px); }

/* ── Stats ─────────────────────────────────── */
}

/* ── Stats ─────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 26px;
}
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px 20px;
    text-align: center;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}
.stat-value {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 700;
    color: var(--brand);
    line-height: 1;
    margin-bottom: 10px;
}
.stat span:last-child {
    font-size: 0.92rem;
    line-height: 1.35;
    color: var(--text-muted);
}

/* ── CO2 Calculator ─────────────────────────── */
.co2-calc {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 620px;
}
.co2-row {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.co2-row label {
    font-weight: 600;
    font-size: 0.9rem;
}
.co2-slider-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}
.co2-slider-wrap input[type="range"] {
    flex: 1;
    accent-color: var(--brand);
    height: 4px;
    cursor: pointer;
}
.co2-slider-wrap span {
    min-width: 60px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
}
.co2-result {
    background: var(--brand);
    color: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    text-align: center;
    margin-top: 2px;
}
.co2-result p { margin: 0 0 4px; font-size: 0.95rem; opacity: 0.9; }
.co2-result strong {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 700;
    line-height: 1.1;
    transform-origin: 50% 55%;
}
.co2-result strong.is-updating {
    animation: co2Pulse 280ms ease-out;
}
.co2-result > span { font-size: 0.85rem; opacity: 0.85; }
.co2-note {
    margin: 14px 0 0 !important;
    font-size: 0.75rem !important;
    opacity: 0.65 !important;
}

@keyframes co2Pulse {
    0% { transform: scale(0.97); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 640px) {
    .co2-slider-wrap {
        gap: 10px;
    }
    .co2-slider-wrap span {
        min-width: 54px;
        font-size: 0.8rem;
    }
}

/* ── Freshness badge (carte) ────────────────── */
.freshness-badge {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin: 8px 0 0;
    padding: 4px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.realtime-health {
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 8px 10px;
    display: grid;
    gap: 4px;
}

.realtime-health-row {
    margin: 0;
    font-size: 0.74rem;
    color: var(--text-soft);
    line-height: 1.25;
}

.realtime-health-row strong {
    color: var(--text-main);
}

#realtime-status.ok {
    color: #1f7a43;
}

#realtime-status.warn {
    color: #b45309;
}

#realtime-status.offline {
    color: #be123c;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin-bottom: 14px;
}

.lead {
    color: var(--text-soft);
    max-width: 66ch;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
    border-radius: 999px;
    padding: 11px 18px;
    border: 2px solid transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--brand);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(207, 22, 120, 0.22);
}

.btn-ghost {
    border-color: var(--brand);
    color: var(--brand-dark);
    background: #fff7fb;
}

.hero-card {
    background: linear-gradient(145deg, #d21d7c, #8d0d52);
    color: #ffffff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.section {
    padding: 40px 0;
}

.section-alt {
    background: linear-gradient(180deg, rgba(244, 236, 243, 0.95), rgba(249, 242, 247, 0.95));
}

.section-contact-photo {
    position: relative;
    background-image:
        linear-gradient(180deg, rgba(34, 21, 34, 0.54), rgba(34, 21, 34, 0.46)),
        url("../img/couverture/Poitiers_panorama_01.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.section-contact-photo .contact-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: none;
}

.cards-grid,
.themes-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.card,
.theme-card,
.stat,
.contact-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 18px;
}

.card,
.theme-card,
.contact-card {
    background: linear-gradient(180deg, #ffffff 0%, #fff8fc 100%);
}

.card h3,
.theme-card h2,
.contact-card h2 {
    color: var(--brand-dark);
}

.text-link {
    font-weight: 700;
    color: var(--brand);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    color: var(--brand);
    font-family: "Space Grotesk", sans-serif;
}

.link-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-soft);
}

.link-list li {
    margin: 6px 0;
}

.about-cta {
    margin-top: 16px;
}

/* ─── Carte À propos ───────────────────────────────── */
.about-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 0;
    border: none !important;
    box-shadow: 0 20px 60px rgba(141,13,82,0.18), 0 4px 16px rgba(0,0,0,0.08) !important;
    background: #fff !important;
}

.about-card-header {
    background: linear-gradient(135deg, #8d0d52 0%, #cf1678 60%, #e8409a 100%);
    padding: 28px 28px 24px;
    position: relative;
    overflow: hidden;
}

.about-card-header::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.about-card-header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.about-card-badge {
    display: inline-block;
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.35);
    margin-bottom: 12px;
}

.about-card-header h2 {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.about-card-desc {
    color: rgba(255,255,255,0.88);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.about-meta {
    list-style: none;
    padding: 20px 24px 24px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
}

.about-meta li {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(90deg, #fff5fb 0%, #fff 100%);
    border: 1px solid #f0d0e4;
    border-radius: 12px;
    padding: 12px 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.about-meta li:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(207,22,120,0.12);
}

.about-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #fce4f3, #ffd6ee);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.about-item-content > span:last-child {
    font-size: 0.92rem;
    color: #3a1a2e;
}

.about-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #cf1678;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ─── Carte Découvrir ──────────────────────────────── */
.discover-card {
    box-shadow: 0 20px 60px rgba(141,13,82,0.18), 0 4px 16px rgba(0,0,0,0.08) !important;
}

.discover-card .about-card-header {
    background: linear-gradient(135deg, #3b0f27 0%, #8d0d52 55%, #cf1678 100%);
}

.discover-card .cover-grid {
    padding: 20px 24px 24px;
    background: #fff;
}

.site-footer {
    border-top: none;
    padding: 24px 0 28px;
    color: #fff6fb;
    font-size: 0.95rem;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 214, 235, 0.18), transparent 28%),
        linear-gradient(135deg, #3b0f27 0%, #8d0d52 58%, #cf1678 100%);
}

.footer-credit {
    display: grid;
    gap: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.footer-links a {
    text-decoration: none;
    color: #fff6fb;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 223, 239, 0.34);
    background: rgba(255, 255, 255, 0.1);
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.legal-mini {
    padding: 10px 16px 14px;
    border-top: 1px solid #f0d0e4;
    background: #fffdfd;
}

.legal-mini p {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #6a5567;
}

.legal-mini h3 {
    margin: 8px 0 4px;
    font-size: 0.76rem;
    line-height: 1.2;
    color: #5e1037;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.legal-mini-marquee {
    overflow: hidden;
    margin-top: 8px;
    border-top: 1px dashed rgba(141, 13, 82, 0.26);
    border-bottom: 1px dashed rgba(141, 13, 82, 0.26);
    background: rgba(255, 239, 248, 0.58);
    padding: 4px 0;
}

.legal-mini-track {
    display: flex;
    width: max-content;
    animation: legalMiniSlide 24s linear infinite;
}

.legal-mini-track span {
    display: inline-block;
    white-space: nowrap;
    padding-right: 20px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #8d0d52;
}

.credit-marquee {
    overflow: hidden;
    border-top: 1px solid rgba(255, 223, 239, 0.32);
    border-bottom: 1px solid rgba(255, 223, 239, 0.32);
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.08);
}

.credit-track {
    display: flex;
    width: max-content;
    animation: creditSlide 26s linear infinite;
}

.credit-track span {
    display: inline-block;
    padding-right: 28px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #ffe6f3;
    white-space: nowrap;
}

.credit-signature {
    margin: 0;
    text-align: center;
    font-size: clamp(1rem, 1.8vw, 1.18rem);
    color: #fff3f9;
}

.credit-signature strong {
    display: inline-block;
    margin: 0 6px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-shadow: 0 6px 18px rgba(45, 7, 27, 0.35);
}

@keyframes creditSlide {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@keyframes legalMiniSlide {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.page-intro {
    padding: 34px 0 10px;
}

.routes-summary-card,
.routes-card {
    background: linear-gradient(180deg, #ffffff 0%, #fff8fc 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.routes-summary-card {
    display: inline-grid;
    gap: 6px;
    margin-top: 20px;
    padding: 16px 20px;
    min-width: 220px;
}

.routes-summary-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.routes-summary-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1;
    color: var(--brand-dark);
}

.routes-card {
    padding: 24px;
}

.routes-card-head {
    margin-bottom: 18px;
}

.routes-card-text {
    margin: 10px 0 0;
    color: var(--text-soft);
}

.routes-state {
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff7fb;
    border: 1px solid var(--line);
    color: var(--text-soft);
}

.routes-state-error {
    background: #fff2f4;
    border-color: #efb7c4;
    color: #9f1239;
}

.routes-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
}

.routes-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.routes-table thead {
    background: linear-gradient(135deg, #8d0d52 0%, #cf1678 100%);
    color: #ffffff;
}

.routes-table th,
.routes-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(229, 200, 218, 0.9);
}

.routes-table th {
    padding: 0;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.routes-sort-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.routes-sort-btn::after {
    content: "↕";
    font-size: 0.88rem;
    opacity: 0.72;
}

.routes-table th[aria-sort="ascending"] .routes-sort-btn::after {
    content: "▲";
    opacity: 1;
}

.routes-table th[aria-sort="descending"] .routes-sort-btn::after {
    content: "▼";
    opacity: 1;
}

.routes-sort-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.92);
    outline-offset: -2px;
}

.routes-table tbody tr:nth-child(even) {
    background: #fff7fb;
}

.routes-table tbody tr:hover {
    background: #fdebf5;
}

.routes-table tbody tr:last-child td {
    border-bottom: none;
}

.route-long-name {
    font-weight: 700;
    color: var(--brand-dark);
}

.route-line-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: 1px solid rgba(0, 0, 0, 0.14);
}

@media (max-width: 640px) {
    .routes-card {
        padding: 18px;
    }

    .routes-summary-card {
        width: 100%;
    }
}

.theme-card p {
    color: var(--text-soft);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 18px;
}

.cover-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
    perspective: 900px;
}

.cover-item {
    display: grid;
    text-decoration: none;
    color: inherit;
    margin: 0;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(141, 13, 82, 0.14);
    box-shadow: 0 12px 22px rgba(20, 43, 78, 0.13);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    opacity: 0;
    transform: translateY(10px) rotateX(2deg);
    animation: coverReveal 0.55s ease forwards;
}

.cover-item:nth-child(2) {
    animation-delay: 0.08s;
}

.cover-item:nth-child(3) {
    animation-delay: 0.16s;
}

.hero-grid {
    color: #ffffff;
    display: block;
    isolation: isolate;
}

.cover-linkedin {
    --cover-ratio: 1207 / 601;
}

.cover-storymap {
    --cover-ratio: 1819 / 864;
}

.cover-portfolio {
    --cover-ratio: 16 / 9;
}

.cover-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 30px rgba(20, 43, 78, 0.2);
}

.cover-item:focus-visible {
    outline: 3px solid rgba(207, 22, 120, 0.35);
    outline-offset: 2px;
}

.cover-thumb {
    position: relative;
    aspect-ratio: var(--cover-ratio, 16 / 9);
    display: block;
    overflow: hidden;
}

.cover-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.28) 50%, transparent 80%);
    transform: translateX(-120%);
    transition: transform 0.55s ease;
    pointer-events: none;
}

.cover-item:hover .cover-thumb::after {
    transform: translateX(120%);
}

.cover-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.45s ease;
}

.cover-item:hover img {
    transform: scale(1.045);
}

.cover-meta {
    display: grid;
    gap: 4px;
    padding: 12px 14px 14px;
    background: linear-gradient(180deg, #fff9fd 0%, #fff2f9 100%);
    border-top: 1px solid rgba(141, 13, 82, 0.12);
}

.cover-meta strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    color: var(--brand-dark);
}

.cover-meta span {
    font-size: 0.88rem;
    color: var(--text-soft);
}

@keyframes coverReveal {
    from {
        opacity: 0;
        transform: translateY(10px) rotateX(2deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cover-item,
    .cover-item img,
    .cover-thumb::after {
        animation: none;
        transition: none;
    }

    .cover-item {
        opacity: 1;
        transform: none;
    }
}

.cover-help {
    margin-top: 10px;
}

.map-preview-card {
    background: linear-gradient(180deg, #ffffff 0%, #fff8fc 100%);
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 18px;
}

.map-preview-card .muted {
    margin-top: -2px;
    margin-bottom: 12px;
}

.map-preview-frame-wrap {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(141, 13, 82, 0.16);
    box-shadow: 0 14px 28px rgba(20, 43, 78, 0.14);
}

.map-preview-frame {
    display: block;
    width: 100%;
    height: min(78vh, 860px);
    border: 0;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.form-row input,
.form-row textarea,
.sidebar label input {
    font: inherit;
}

.form-row input,
.form-row textarea {
    border: 1px solid #d8b6ca;
    border-radius: 10px;
    padding: 10px 12px;
    background: #ffffff;
}

.form-row input:focus,
.form-row textarea:focus {
    border-color: var(--brand);
    outline: 2px solid rgba(207, 22, 120, 0.15);
}

/* Mise en page carte desktop: sidebar a gauche et carte a droite */
.map-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 14px;
    min-height: calc(100vh - 110px);
    padding: 18px 0 28px;
}

.carte-page {
    height: 100vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-main {
    flex: 1;
    width: 100%;
    padding: 0;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 18%, rgba(207, 22, 120, 0.14), transparent 34%),
        radial-gradient(circle at 88% 82%, rgba(36, 24, 35, 0.1), transparent 34%),
        linear-gradient(135deg, #fcf4f9 0%, #fff9fc 45%, #f5edf3 100%);
}

.geo-consent-banner {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    z-index: 1250;
    width: min(880px, calc(100% - 18px));
    border-radius: 14px;
    border: 1px solid rgba(141, 13, 82, 0.3);
    background: linear-gradient(135deg, rgba(255, 248, 252, 0.98), rgba(255, 239, 248, 0.98));
    box-shadow: 0 12px 30px rgba(41, 17, 35, 0.24);
    padding: 10px 12px;
    display: grid;
    gap: 8px;
}

.geo-consent-banner p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-main);
}

.geo-consent-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.geo-consent-actions a {
    font-size: 0.82rem;
    font-weight: 700;
}

.map-main::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(207, 22, 120, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(207, 22, 120, 0.05) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.55) 42%, rgba(0, 0, 0, 0.95) 100%);
    animation: gridDrift 18s linear infinite;
}

.carte-page .map-layout {
    height: calc(100vh - 72px);
    min-height: 0;
    padding: 8px;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.carte-page .site-footer {
    display: none;
}

.carte-page.map-fullscreen .site-header {
    display: none;
}

.carte-page.map-fullscreen .map-main {
    padding: 0;
    background: #0f172a;
}

.carte-page.map-fullscreen .map-main::after {
    display: none;
}

.carte-page.map-fullscreen .map-layout {
    grid-template-columns: 1fr;
    height: 100vh;
    min-height: 0;
    padding: 0;
    gap: 0;
}

.carte-page.map-fullscreen .sidebar {
    display: none;
}

.carte-page.map-fullscreen .map-panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.carte-page.map-fullscreen .map-panel #map {
    min-height: 100vh;
}

@keyframes gridDrift {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-36px);
    }
}

.sidebar {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-height: 0;
}

.sidebar-head {
    display: grid;
    gap: 2px;
}

.traffic-alert {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    background: #ffffff;
    display: grid;
    gap: 3px;
}

.traffic-alert strong {
    font-size: 0.8rem;
    line-height: 1.15;
}

.traffic-alert p {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.25;
}

.traffic-alert--ok {
    border-color: #86efac;
    background: #f0fdf4;
    color: #14532d;
}

.traffic-alert--warn {
    border-color: #fcd34d;
    background: #fffbeb;
    color: #92400e;
}

.traffic-alert--danger {
    border-color: #fca5a5;
    background: #fff1f2;
    color: #9f1239;
}

.traffic-alert--loading {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

.sidebar h2 {
    margin-bottom: 2px;
    font-size: 1.05rem;
    line-height: 1.15;
}

.sidebar p {
    margin: 0 0 6px;
    font-size: 0.9rem;
    line-height: 1.28;
}

.sidebar-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.sidebar-tab {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-main);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.sidebar-tab:hover,
.sidebar-tab:focus-visible {
    border-color: var(--brand);
    outline: none;
}

.sidebar-tab.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.sidebar-panel {
    display: none;
    min-height: 0;
    overflow: auto;
}

.sidebar-panel.is-active {
    display: grid;
    gap: 6px;
}

.legend,
.check-list {
    display: grid;
    gap: 8px;
}

.check-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1.15;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.dot-line {
    width: 20px;
    height: 4px;
    border-radius: 999px;
}

.dot-velo {
    background: #1b9e77;
}

.dot-velib {
    background: #206cc8;
}

.dot-pieton {
    background: #f2c84b;
}

.dot-bus {
    background: #1d4ed8;
}

.dot-boundary {
    background: #111111;
}

.dot-stop {
    background: #2f83ff;
}

.dot-me {
    background: #ef4444;
}

.dot-nearby {
    background: #f59e0b;
}

.sidebar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 8px 0;
}

.sidebar-actions .btn {
    width: 100%;
}

.status-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 7px 9px;
    background: #f8fbff;
    margin-bottom: 6px;
}

.status-card h3 {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 5px 0;
}

@media (max-width: 640px) {
    .fact-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.fact-pill {
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #ffffff;
    padding: 5px 6px;
    min-width: 0;
}

.fact-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-soft);
    margin-bottom: 2px;
    line-height: 1.1;
}

.fact-pill strong {
    display: block;
    font-size: 0.9rem;
    line-height: 1.1;
    color: var(--text-main);
}

.service-window {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-window span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    font-size: 0.76rem;
    color: var(--text-soft);
}

.service-window strong {
    margin-left: 4px;
    color: var(--text-main);
    font-size: 0.8rem;
}

.service-window-note {
    margin: 6px 0 0;
    font-size: 0.72rem;
}

.stop-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 6px 0;
}

.stop-lines-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.stop-line-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.stop-line-chip.imminent {
    border-color: #1f7a43;
    background: #e8f7ee;
    color: #14532d;
}

.stop-line-chip-time {
    margin-left: 6px;
    padding-left: 6px;
    border-left: 1px solid rgba(20, 83, 45, 0.22);
    font-size: 0.72rem;
    font-weight: 800;
}

.stop-line-chip:hover,
.stop-line-chip:focus-visible {
    border-color: var(--brand);
    background: #eef4ff;
    color: var(--brand-dark);
    outline: none;
}

.night-safety-card {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #d8e6ff;
    border-radius: 10px;
    background: linear-gradient(135deg, #f7fbff 0%, #eef4ff 100%);
}

.night-safety-card.level-high {
    border-color: #86efac;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.night-safety-card.level-medium {
    border-color: #fcd34d;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.night-safety-card.level-low {
    border-color: #fca5a5;
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
}

.night-safety-title {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #111827;
    color: #f9fafb;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
}

.night-safety-summary {
    margin: 7px 0 6px;
    font-size: 0.82rem;
    line-height: 1.3;
}

.night-safety-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.night-line-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #b7d1ff;
    background: #ffffff;
    color: #0f2a58;
    font-size: 0.76rem;
    font-weight: 700;
}

.night-request-stop {
    margin: 8px 0 4px;
    font-size: 0.76rem;
    color: #334155;
}

.night-request-link {
    font-size: 0.76rem;
    font-weight: 700;
    color: #1d4ed8;
    text-decoration: none;
}

.night-request-link:hover,
.night-request-link:focus-visible {
    color: var(--brand-dark);
    text-decoration: underline;
    outline: none;
}

.night-data-note {
    margin: 7px 0 0;
    font-size: 0.72rem;
    line-height: 1.25;
    color: #475569;
}

.muted {
    color: var(--text-soft);
}

.realtime-list {
    margin: 8px 0 0;
    padding-left: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.realtime-list li {
    color: var(--text-main);
}

.realtime-group {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 8px 10px;
}

.realtime-group-head {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-bottom: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--brand-dark);
    font-size: 0.8rem;
    font-weight: 800;
}

.realtime-pass-item + .realtime-pass-item {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}

.realtime-toggle {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand-dark);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.realtime-toggle:hover,
.realtime-toggle:focus-visible {
    color: var(--brand);
    text-decoration: underline;
    outline: none;
}

.realtime-meta {
    display: block;
    margin-top: 3px;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.delay-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.delay-badge.on-time {
    background: #e8f7ee;
    color: #1f7a43;
}

.delay-badge.late {
    background: #fff1f2;
    color: #be123c;
}

.delay-badge.early {
    background: #eef4ff;
    color: #1d4ed8;
}

.nearby-list {
    margin: 8px 0 0;
    padding-left: 16px;
    display: grid;
    gap: 5px;
    color: var(--text-main);
}

.search-box input,
.assist-controls input {
    width: 100%;
    border: 1px solid #a7b7d8;
    border-radius: 10px;
    padding: 9px 10px;
    font: inherit;
    background: #ffffff;
}

.search-box {
    position: relative;
    z-index: 20;
}

.search-box input:focus,
.assist-controls input:focus {
    border-color: var(--brand);
    outline: 2px solid rgba(20, 87, 184, 0.18);
}

.search-results {
    position: relative;
    z-index: 24;
    margin: 6px 0 0;
    padding-left: 0;
    list-style: none;
    display: grid;
    gap: 6px;
    max-height: 120px;
    overflow: auto;
}

.search-results button {
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #ffffff;
    padding: 7px 9px;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-results button:hover {
    border-color: var(--brand);
    background: #f3f7ff;
}

.carte-page.address-editing .map-panel,
.carte-page.address-editing #map {
    pointer-events: none;
}

.search-result-main {
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.25;
}

.search-result-meta {
    font-size: 0.73rem;
    color: var(--text-soft);
    line-height: 1.2;
}

.quick-search-nearby {
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 8px;
    display: grid;
    gap: 8px;
}

.quick-search-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-main);
}

.quick-reco {
    font-size: 0.8rem;
    line-height: 1.35;
    color: #0f2a58;
    background: #eef4ff;
    border: 1px solid #c7d9ff;
    border-radius: 9px;
    padding: 6px 8px;
}

.quick-stops-grid {
    display: grid;
    gap: 7px;
}

.quick-stop-card {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 7px 8px;
    background: #ffffff;
    cursor: pointer;
}

.quick-stop-card:hover,
.quick-stop-card:focus-visible {
    border-color: var(--brand);
    background: #f8fbff;
    outline: none;
}

.quick-stop-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.quick-stop-head strong {
    font-size: 0.82rem;
}

.quick-stop-head span {
    font-size: 0.73rem;
    color: var(--text-soft);
}

    .address-chosen-chip {
        list-style: none;
    }

    .address-chosen-chip span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 12px;
        border-radius: 999px;
        background: #dcfce7;
        border: 1px solid #86efac;
        color: #14532d;
        font-size: 0.8rem;
        font-weight: 700;
    }

    /* ── Journey Planner ─────────────────────── */
    .btn-xs {
        padding: 4px 8px;
        font-size: 0.74rem;
    }

    .journey-planner-card {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .journey-planner-card h3 {
        margin-bottom: 0;
        font-size: 0.88rem;
    }

    .journey-planner-card > .muted {
        margin-bottom: 2px;
        font-size: 0.76rem;
        line-height: 1.25;
    }

    .journey-field-group {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 4px 6px;
        border: 1px solid #e6edf9;
        border-radius: 10px;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    }

    .journey-label-row {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 0.76rem;
        font-weight: 700;
        color: var(--text-soft);
    }

    .journey-planner-card .search-box input {
        padding: 6px 8px;
        font-size: 0.82rem;
        border-radius: 9px;
    }

    #btn-locate {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        align-self: flex-start;
        min-height: 30px;
        padding: 3px 10px;
        border-radius: 999px;
        border: 1px solid #c7d6f8;
        background: #f4f8ff;
        color: #1e3a8a;
        font-size: 0.72rem;
        font-weight: 800;
    }

    .locate-glyph {
        position: relative;
        width: 13px;
        height: 13px;
        border-radius: 50%;
        border: 1.6px solid #1e3a8a;
        background: radial-gradient(circle at center, #1e3a8a 0 2.2px, transparent 2.3px 100%);
        box-shadow: 0 0 0 1.5px rgba(30, 58, 138, 0.14);
        flex: 0 0 auto;
    }

    .locate-glyph::before,
    .locate-glyph::after {
        content: '';
        position: absolute;
        background: #1e3a8a;
        opacity: 0.9;
    }

    .locate-glyph::before {
        left: 50%;
        top: -3px;
        width: 1.4px;
        height: 3px;
        transform: translateX(-50%);
    }

    .locate-glyph::after {
        top: 50%;
        right: -3px;
        width: 3px;
        height: 1.4px;
        transform: translateY(-50%);
    }

    #btn-locate:hover,
    #btn-locate:focus-visible {
        border-color: #9fb7eb;
        background: #edf4ff;
        outline: none;
    }

    .journey-planner-card .search-results {
        margin-top: 3px;
        max-height: 74px;
        gap: 4px;
    }

    .journey-planner-card .search-results button {
        padding: 5px 7px;
    }

    .journey-pin {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 22px;
        height: 22px;
        border-radius: 8px;
        font-size: 0.7rem;
        font-weight: 900;
        letter-spacing: 0.01em;
        color: #fff;
        flex-shrink: 0;
        box-shadow: 0 3px 10px rgba(15, 23, 42, 0.22);
        border: 1px solid rgba(255, 255, 255, 0.9);
    }

    .journey-pin::after {
        content: '';
        position: absolute;
        inset: 1px;
        border-radius: 6px;
        border: 1px solid rgba(255, 255, 255, 0.35);
        pointer-events: none;
    }

    .journey-pin--depart {
        background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 52%, #1e3a8a 100%);
    }

    .journey-pin--dest {
        background: linear-gradient(145deg, #e11d48 0%, #be123c 52%, #881337 100%);
    }

    .journey-separator {
        text-align: center;
        color: var(--text-soft);
        font-size: 0.8rem;
        line-height: 1;
        margin: 0;
    }

    .journey-result {
        margin-top: 1px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .journey-result-title {
        margin: 0;
        font-size: 0.78rem;
        font-weight: 800;
        color: var(--text-main);
    }

    .journey-route-card {
        border: 1px solid var(--line);
        border-radius: 9px;
        background: #ffffff;
        padding: 5px 7px;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .journey-passages-card {
        border-color: #c7d9ff;
        background: #f8fbff;
    }

    .journey-route-head {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: wrap;
    }

    .journey-line-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 34px;
        padding: 2px 8px;
        border-radius: 999px;
        font-size: 0.78rem;
        font-weight: 900;
        letter-spacing: 0.02em;
        border: 1px solid rgba(255, 255, 255, 0.92);
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
    }

    .journey-route-name {
        font-size: 0.72rem;
        color: var(--text-soft);
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .journey-type-badge {
        display: inline-flex;
        align-items: center;
        padding: 1px 6px;
        border-radius: 999px;
        font-size: 0.68rem;
        font-weight: 800;
    }

    .journey-type-direct {
        background: #dcfce7;
        color: #14532d;
        border: 1px solid #86efac;
    }

    .journey-type-transfer {
        background: #fef3c7;
        color: #78350f;
        border: 1px solid #fcd34d;
    }

    .journey-stops {
        margin: 0;
        font-size: 0.73rem;
        line-height: 1.2;
    }

    .journey-times {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
        margin-top: 0;
    }

    .journey-time-chip {
        display: inline-flex;
        align-items: center;
        padding: 1px 6px;
        border-radius: 999px;
        background: #eef4ff;
        border: 1px solid #c7d9ff;
        color: #1457b8;
        font-size: 0.68rem;
        font-weight: 700;
    }

    .journey-show-route {
        align-self: flex-start;
        padding: 2px 8px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #ffffff;
        color: var(--brand-dark);
        font: inherit;
        font-size: 0.7rem;
        font-weight: 700;
        cursor: pointer;
        transition: border-color 0.18s ease, background 0.18s ease;
    }

    .journey-show-route:hover,
    .journey-show-route:focus-visible {
        border-color: var(--brand);
        background: #f3f7ff;
        outline: none;
    }

    .journey-leg {
        display: flex;
        gap: 6px;
        align-items: flex-start;
    }

    .journey-leg-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--text-main);
        color: #fff;
        font-size: 0.66rem;
        font-weight: 800;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .journey-leg-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }

    .journey-connector {
        padding: 2px 6px;
        margin: 0 0 0 8px;
        border-left: 2px dashed var(--line);
        font-size: 0.7rem;
        color: var(--text-soft);
    }

    .small {
        font-size: 0.76rem !important;
    }

.national-results {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.favorites-label {
    margin: 0 0 6px;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--text-soft);
}

.favorites-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.favorite-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px;
    align-items: center;
}

.favorite-item button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-main);
    font: inherit;
    font-size: 0.77rem;
    line-height: 1.2;
    padding: 5px 7px;
    cursor: pointer;
    text-align: left;
}

.favorite-item button:hover,
.favorite-item button:focus-visible {
    border-color: var(--brand);
    outline: none;
}

.favorite-remove {
    width: 28px;
    text-align: center !important;
    padding: 5px 0 !important;
    font-weight: 900;
    color: #8d0d52;
}

.favorite-route-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.national-stop-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 8px 9px;
    display: grid;
    gap: 5px;
}

.national-stop-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.national-stop-head strong {
    font-size: 0.83rem;
}

.national-distance {
    font-size: 0.74rem;
    color: var(--text-soft);
}

.national-departure-list {
    margin: 0;
    padding-left: 16px;
    display: grid;
    gap: 2px;
    font-size: 0.76rem;
    color: var(--text-main);
}

.assist-controls {
    display: grid;
    gap: 8px;
}

.assist-result {
    margin-top: 10px;
    border: 1px dashed #9bb3dd;
    border-radius: 10px;
    padding: 10px;
    background: #f7fbff;
    color: var(--text-main);
}

.chat-window {
    border: 1px solid #b8c7e3;
    border-radius: 10px;
    background: #ffffff;
    padding: 8px;
    min-height: 140px;
    max-height: 260px;
    overflow: auto;
    display: grid;
    gap: 6px;
}

.chat-msg {
    font-size: 0.9rem;
    line-height: 1.35;
    padding: 7px 9px;
    border-radius: 10px;
    max-width: 96%;
    white-space: pre-wrap;
}

.chat-msg.user {
    justify-self: end;
    background: #1457b8;
    color: #ffffff;
}

.chat-msg.bot {
    justify-self: start;
    background: #eef4ff;
    color: #1a2c46;
    border: 1px solid #d3dff3;
}

.line-legend-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    max-height: calc(100vh - 320px);
    overflow: auto;
    display: grid;
    gap: 8px;
}

.legend-card {
    margin-top: 4px;
}

.line-tools {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.line-tools label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-soft);
}

.line-tools select {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-main);
    font: inherit;
    font-size: 0.8rem;
    padding: 5px 8px;
}

.line-legend-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: stretch;
}

.line-legend-main {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #ffffff;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
}

.line-legend-main:hover {
    border-color: var(--brand);
}

.line-legend-main.active {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand);
    background: #eef4ff;
}

.line-favorite-toggle {
    width: 42px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #ffffff;
    color: #8d0d52;
    font: inherit;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
}

.line-favorite-toggle:hover,
.line-favorite-toggle:focus-visible {
    border-color: var(--brand);
    outline: none;
}

.line-favorite-toggle.is-active {
    background: #fff1f8;
    border-color: #f3b8d8;
}

.line-swatch {
    width: 18px;
    height: 6px;
    border-radius: 999px;
    display: inline-block;
}

.line-chip {
    min-width: 30px;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
}

.btn-reset-lines {
    width: 100%;
    margin-top: 8px;
}

.user-position-icon {
    position: relative;
    width: 18px;
    height: 18px;
}

.user-position-icon .core {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 0 1.5px rgba(239, 68, 68, 0.28);
}

.user-position-icon .pulse {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid rgba(239, 68, 68, 0.72);
    animation: pulse-ring 1.8s ease-out infinite;
}

.bus-stop-marker {
    background: transparent;
    border: none;
}

.bus-stop-icon {
    --stop-accent: #cf1678;
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 32px;
    height: 48px;
}

.bus-stop-icon::after {
    content: none;
}

.bus-stop-panel {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 30px;
    border-radius: 9px;
    border: 2px solid var(--stop-accent);
    background: #ffffff;
}

.bus-stop-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 6px 6px 0 0;
    background: var(--stop-accent);
}

.bus-stop-icon--route {
    --stop-accent: #8d0d52;
}

.bus-stop-icon--nearby {
    --stop-accent: #d97706;
}

.bus-stop-pole {
    width: 4px;
    height: 13px;
    margin-top: -2px;
    border-radius: 999px;
    background: #475569;
}

.bus-stop-base {
    width: 12px;
    height: 3px;
    margin-top: 1px;
    border-radius: 999px;
    background: #334155;
}

.bus-stop-svg {
    position: relative;
    z-index: 1;
    width: 17px;
    height: 17px;
    display: block;
}

.leaflet-tooltip.stop-label {
    background: rgba(8, 34, 74, 0.9);
    border: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(8, 34, 74, 0.25);
}

.leaflet-tooltip.nearby-stop-label {
    background: rgba(245, 158, 11, 0.95);
    border: none;
    color: #1f2937;
    font-weight: 700;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 999px;
}

.leaflet-tooltip.route-stop-label {
    background: rgba(17, 24, 39, 0.95);
    border: none;
    color: #f9fafb;
    font-weight: 700;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(17, 24, 39, 0.28);
}

.stop-popup {
    min-width: min(280px, 72vw);
    max-width: min(340px, 82vw);
    color: #172033;
    font-size: 0.84rem;
    line-height: 1.35;
}

.stop-popup h4 {
    margin: 0;
    font-size: 0.98rem;
}

.stop-popup-meta {
    margin: 3px 0 0;
    color: #5b667c;
    font-size: 0.76rem;
}

.stop-popup-block {
    margin-top: 9px;
}

.stop-popup-block strong {
    display: block;
    margin-bottom: 5px;
    font-size: 0.78rem;
    color: #263048;
}

.stop-popup-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.stop-popup-chip {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #c8d3e6;
    background: #f8fbff;
    color: #20314f;
    font-size: 0.74rem;
    font-weight: 700;
}

.stop-popup-grid {
    margin-top: 9px;
    display: grid;
    gap: 4px;
}

.stop-popup-grid p {
    margin: 0;
    font-size: 0.78rem;
    color: #334155;
}

.stop-popup ul {
    margin: 0;
    padding-left: 16px;
    display: grid;
    gap: 6px;
}

.stop-popup li {
    color: #172033;
}

.stop-popup .muted {
    color: #64748b;
}

.stop-popup--route {
    border-left: 3px solid #f59e0b;
    padding-left: 8px;
}

@keyframes pulse-ring {
    0% {
        width: 12px;
        height: 12px;
        opacity: 0.9;
    }
    80% {
        width: 34px;
        height: 34px;
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

.map-panel {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-panel #map {
    width: 100%;
    min-height: 82vh;
}

.leaflet-control-layers {
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(20, 43, 78, 0.14);
    overflow: hidden;
}

.leaflet-control-layers-toggle {
    width: 34px;
    height: 34px;
    background-size: 18px 18px;
}

.leaflet-control-layers-expanded {
    padding: 8px 10px;
    min-width: 150px;
    max-width: 190px;
    font-size: 0.85rem;
}

.leaflet-control-layers label {
    margin-bottom: 4px;
}

.leaflet-interactive.bus-line-effect {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.45));
    animation: busLineFlow 1.6s linear infinite;
}

@keyframes busLineFlow {
    from {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -24;
    }
}

.carte-page .map-panel #map {
    min-height: calc(100vh - 92px);
}

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .cards-grid,
    .themes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex;
    }

    .nav-wrapper {
        align-items: flex-start;
        padding: 12px 0;
    }

    .site-nav {
        position: absolute;
        top: 74px;
        right: 4%;
        left: 4%;
        background: linear-gradient(180deg, rgba(101, 17, 60, 0.98), rgba(155, 18, 88, 0.98));
        border: 1px solid rgba(255, 223, 239, 0.2);
        border-radius: 18px;
        padding: 10px;
        display: none;
        flex-direction: column;
        box-shadow: 0 18px 32px rgba(70, 8, 38, 0.28);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        color: #fff6fb;
    }

    .hero-grid,
    .contact-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-landing {
        padding-top: 52px;
    }

    .hero-rail span {
        margin-right: 18px;
        animation-duration: 13s;
    }

    .map-layout {
        grid-template-columns: 1fr;
    }

    .carte-page {
        height: auto;
        min-height: 100vh;
        min-height: calc(var(--app-vh, 1vh) * 100);
        overflow-x: hidden;
        overflow-y: auto;
        background: linear-gradient(180deg, #fff9fc 0%, #f7edf4 100%);
    }

    .carte-page .map-main {
        padding: 0 0 10px;
        overflow: visible;
        background:
            radial-gradient(circle at 8% 12%, rgba(207, 22, 120, 0.12), transparent 36%),
            radial-gradient(circle at 90% 84%, rgba(20, 43, 78, 0.12), transparent 38%),
            linear-gradient(150deg, #fff7fb 0%, #fff 42%, #f7eef4 100%);
    }

    .carte-page .map-main::after {
        opacity: 0.45;
        animation-duration: 26s;
    }

    .carte-page .map-layout {
        min-height: calc(var(--app-vh, 1vh) * 100 - 74px);
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    /* ── Sidebar mobile ─────────────────────────── */
    .carte-page .sidebar {
        position: relative;
        z-index: 10;
        height: auto;
        min-height: 0;
        max-height: clamp(380px, 60vh, 620px);
        max-height: clamp(380px, 60dvh, 620px);
        border-radius: 16px;
        padding: 8px 10px 10px;
        gap: 7px;
        overflow: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* Masquer le titre "Réseau Vitalis" sur mobile: les onglets suffisent */
    .carte-page .sidebar-head {
        display: none;
    }

    .carte-page .sidebar-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .carte-page .sidebar-tab {
        min-height: 44px;
        font-size: 0.84rem;
        font-weight: 800;
        border-radius: 12px;
        padding: 8px 4px;
    }

    .carte-page .sidebar-panel {
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .carte-page .status-card {
        border-radius: 12px;
        padding: 10px;
        margin-bottom: 4px;
    }

    /* Trafic: bandeau 1 ligne compact pour libérer de l'espace */
    .carte-page .traffic-alert {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        border-radius: 999px;
        padding: 5px 10px;
        min-height: 0;
    }

    .carte-page .traffic-alert strong {
        font-size: 0.65rem;
        font-weight: 800;
        white-space: nowrap;
        line-height: 1;
    }

    .carte-page .traffic-alert p {
        font-size: 0.65rem;
        line-height: 1;
        margin: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .carte-page .map-panel {
        position: relative;
        z-index: 1;
        flex: 1;
        min-height: clamp(360px, 56vh, 70vh);
        min-height: clamp(360px, 56dvh, 70dvh);
        border-radius: 16px;
    }

    .carte-page .map-panel #map {
        min-height: clamp(360px, 56vh, 70vh);
        min-height: clamp(360px, 56dvh, 70dvh);
    }

    .carte-page .leaflet-control-container .leaflet-top,
    .carte-page .leaflet-control-container .leaflet-bottom {
        z-index: 500;
    }

    .carte-page .leaflet-control-zoom a,
    .carte-page .leaflet-control-layers-toggle {
        width: 38px;
        height: 38px;
        line-height: 38px;
    }
}

@media (max-width: 640px) {
    .stop-actions,
    .favorites-grid {
        grid-template-columns: 1fr;
    }

    .cards-grid,
    .themes-grid {
        grid-template-columns: 1fr;
    }

    .cover-grid {
        grid-template-columns: 1fr;
    }

    .carte-page .map-layout {
        gap: 7px;
        padding: 6px;
        min-height: calc(var(--app-vh, 1vh) * 100 - 70px);
    }

    .carte-page .sidebar {
        max-height: clamp(400px, 62vh, 660px);
        max-height: clamp(400px, 62dvh, 660px);
        border-radius: 14px;
        padding: 8px 9px 10px;
    }

    .carte-page .sidebar-tab {
        min-height: 44px;
        font-size: 0.8rem;
    }

    /* Champs Mon Bus: taille agréable sur téléphone */
    .carte-page .journey-planner-card {
        gap: 8px;
    }

    .carte-page .journey-field-group {
        gap: 5px;
    }

    .carte-page .journey-planner-card h3 {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .carte-page .journey-label-row {
        font-size: 0.8rem;
    }

    .carte-page .journey-planner-card .search-box input,
    .carte-page .search-box input,
    .carte-page .assist-controls input {
        min-height: 48px;
        font-size: 16px;
        padding: 10px 12px;
        border-radius: 12px;
    }

    .carte-page .journey-planner-card .search-results {
        max-height: 160px;
    }

    .carte-page .search-results button {
        min-height: 44px;
        padding: 8px 10px;
        border-radius: 10px;
    }

    .carte-page .journey-separator {
        font-size: 1rem;
        margin: 2px 0;
    }

    .carte-page .btn-xs#btn-locate {
        min-height: 34px;
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .carte-page .map-panel,
    .carte-page .map-panel #map {
        min-height: clamp(300px, 46vh, 60vh);
        min-height: clamp(300px, 46dvh, 60dvh);
    }
}

/* =========================================================
   RESPONSIVE REVISION - Mobile App Standards
   Layer added at the end to keep desktop intact.
   ========================================================= */

@media (max-width: 900px) {
    html {
        font-size: 15.5px;
    }

    body {
        overflow-x: hidden;
    }

    .container {
        width: min(1120px, 94%);
    }

    .site-header {
        backdrop-filter: none;
    }

    .nav-wrapper {
        min-height: 68px;
        gap: 10px;
    }

    .brand {
        font-size: clamp(0.9rem, 3.2vw, 1.08rem);
        line-height: 1.15;
        letter-spacing: 0.04em;
    }

    .site-nav {
        top: 66px;
        right: 3%;
        left: 3%;
        border-radius: 14px;
        padding: 8px;
        max-height: min(70vh, 520px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .site-nav a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .section {
        padding: 28px 0;
    }

    .page-intro {
        padding: 20px 0 8px;
    }

    .hero {
        padding: 32px 0 20px;
    }

    .hero-landing {
        min-height: 64vh;
        padding-top: 42px;
        padding-bottom: 24px;
    }

    .hero-landing h1 {
        padding: 10px 18px;
        border-radius: 12px;
        border-width: 2px;
        font-size: clamp(1.45rem, 6vw, 2rem);
    }

    .hero-landing .hero-lead-landing {
        font-size: clamp(1rem, 3.5vw, 1.28rem);
        padding: 12px 14px;
        border-radius: 12px;
    }

    .hero-rail {
        margin: 14px 0;
    }

    .hero-rail span {
        font-size: 0.76rem;
        margin-right: 14px;
    }

    .hero-bus {
        display: none;
    }

    .hero-card,
    .card,
    .theme-card,
    .contact-card,
    .routes-card,
    .map-preview-card {
        border-radius: 12px;
        padding: 14px;
    }

    .hero-grid,
    .contact-grid,
    .cards-grid,
    .themes-grid,
    .stats-grid,
    .favorites-grid,
    .cover-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat {
        padding: 18px 14px;
    }

    .co2-result {
        padding: 14px;
    }

    .routes-table-wrap {
        -webkit-overflow-scrolling: touch;
    }

    .routes-table {
        min-width: 620px;
    }

    .map-preview-frame {
        height: min(62vh, 540px);
    }

    .about-meta {
        padding: 12px;
    }

    .about-meta li {
        padding: 10px 12px;
    }

    /* Mobile app shell for map page */
    .carte-page {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .carte-page .site-header {
        position: relative;
        top: auto;
        z-index: 30;
    }

    .carte-page .map-layout {
        padding: 6px;
        gap: 6px;
        min-height: calc(var(--app-vh, 1vh) * 100 - 68px);
    }

    .carte-page .sidebar {
        display: flex;
        max-height: clamp(430px, 65vh, 760px);
        max-height: clamp(430px, 65dvh, 760px);
        border-radius: 14px;
        padding: 8px;
        scroll-padding-top: 56px;
    }

    .carte-page .traffic-alert {
        order: 2;
        flex: 0 0 auto;
        min-height: 28px;
    }

    .carte-page .sidebar-tabs {
        order: 1;
        position: sticky;
        top: 0;
        z-index: 20;
        background: #ffffff;
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
        border-radius: 10px;
        padding: 4px;
        margin-bottom: 4px;
    }

    .carte-page .sidebar-tab {
        min-height: 42px;
        font-size: 0.8rem;
    }

    .carte-page .sidebar-panel {
        order: 3;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .carte-page.address-editing .traffic-alert {
        display: none;
    }

    .carte-page.address-editing .map-layout {
        min-height: auto;
    }

    .carte-page.address-editing .sidebar {
        max-height: calc(var(--app-vh, 1vh) * 100 - 12px);
        max-height: calc(100dvh - 12px);
        overflow: auto;
    }

    .carte-page.address-editing .sidebar-tabs {
        top: 0;
        z-index: 42;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    }

    .carte-page.address-editing .search-box,
    .carte-page.address-editing .search-results {
        z-index: 45;
    }

    .carte-page.address-editing .journey-planner-card,
    .carte-page.address-editing .sidebar-panel {
        position: relative;
        z-index: 44;
    }

    .carte-page.address-editing .map-panel {
        display: block;
        min-height: 130px;
        opacity: 0.45;
        pointer-events: none;
    }

    .carte-page.address-editing .journey-result {
        max-height: none;
        overflow: visible;
    }

    .carte-page .journey-planner-card .search-box input,
    .carte-page .search-box input,
    .carte-page .assist-controls input {
        min-height: 48px;
        font-size: 16px;
    }

    .carte-page .search-results {
        max-height: 240px;
        overflow: auto;
    }

    .carte-page .search-results button,
    .carte-page .btn,
    .carte-page .btn-xs,
    .carte-page .line-legend-main,
    .carte-page .line-favorite-toggle {
        min-height: 42px;
    }

    .carte-page .line-legend-list {
        max-height: none;
    }

    .carte-page .map-panel,
    .carte-page .map-panel #map {
        min-height: clamp(280px, 44vh, 56vh);
        min-height: clamp(280px, 44dvh, 56dvh);
    }
}

@media (max-width: 640px) {
    html {
        font-size: 15px;
    }

    .carte-page .site-header,
    .site-header {
        position: relative;
    }

    .brand {
        max-width: min(64vw, 250px);
        word-break: break-word;
    }

    .hero-landing {
        min-height: 58vh;
        padding-top: 32px;
        padding-bottom: 18px;
    }

    #hero-word {
        font-size: clamp(1.08rem, 4.9vw, 1.4rem);
    }

    .hero-landing h1 {
        font-size: clamp(1.2rem, 7.5vw, 1.6rem);
        padding: 8px 12px;
        border-radius: 10px;
    }

    .hero-landing .hero-lead-landing {
        font-size: 0.95rem;
        line-height: 1.45;
        padding: 10px;
    }

    .hero-context-card-wrap {
        width: 100%;
    }

    .hero-card-landing {
        width: 100%;
    }

    .credit-track span {
        font-size: 0.78rem;
        letter-spacing: 0.05em;
    }

    .credit-signature {
        font-size: 0.88rem;
    }

    .credit-signature strong {
        font-size: 1.25rem;
    }

    .footer-links {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-links a {
        text-align: center;
    }

    .legal-mini {
        padding: 9px 12px 12px;
    }

    .legal-mini p {
        font-size: 0.68rem;
    }

    .legal-mini h3 {
        font-size: 0.7rem;
    }

    .legal-mini-track span {
        font-size: 0.58rem;
    }

    .geo-consent-banner {
        top: 6px;
        width: calc(100% - 10px);
        padding: 8px;
    }

    .geo-consent-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .routes-table {
        min-width: 560px;
    }

    .map-preview-frame {
        height: min(54vh, 430px);
    }

    .carte-page .map-layout {
        padding: 5px;
        gap: 5px;
    }

    .carte-page .sidebar {
        max-height: clamp(460px, 68vh, 820px);
        max-height: clamp(460px, 68dvh, 820px);
        padding: 7px;
    }

    .carte-page .traffic-alert {
        padding: 4px 8px;
        gap: 5px;
        margin-bottom: 2px;
    }

    .carte-page .traffic-alert strong,
    .carte-page .traffic-alert p {
        font-size: 0.62rem;
    }

    .carte-page .sidebar-tab {
        min-height: 40px;
        font-size: 0.76rem;
        border-radius: 10px;
    }

    .carte-page.address-editing .sidebar {
        max-height: none;
    }

    .carte-page.address-editing .sidebar-panel {
        overflow: visible;
    }

    .carte-page.address-editing .map-layout {
        padding-bottom: 10px;
    }

    .carte-page .status-card {
        padding: 9px;
    }

    .carte-page .journey-planner-card h3 {
        font-size: 0.95rem;
    }

    .carte-page .journey-label-row {
        font-size: 0.76rem;
    }

    .carte-page .journey-planner-card .search-box input,
    .carte-page .search-box input,
    .carte-page .assist-controls input {
        min-height: 46px;
        padding: 9px 10px;
    }

    .carte-page .journey-planner-card .search-results {
        max-height: 260px;
    }

    .carte-page .line-tools {
        grid-template-columns: 1fr;
    }

    .carte-page .line-tools label {
        font-size: 0.72rem;
    }

    .carte-page .map-panel,
    .carte-page .map-panel #map {
        min-height: clamp(250px, 40vh, 52vh);
        min-height: clamp(250px, 40dvh, 52dvh);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-rail span,
    .hero-bus svg,
    .credit-track,
    .hero-landing h1,
    .hero-landing .hero-lead-landing,
    .leaflet-interactive.bus-line-effect {
        animation: none !important;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
