@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700;800&display=swap');

:root {
    --bg: #050811;
    --bg-grid: rgba(0, 243, 255, 0.035);
    --surface: rgba(13, 22, 38, 0.88);
    --surface-solid: #0d1626;
    --surface-2: rgba(20, 33, 56, 0.9);
    --surface-3: rgba(27, 43, 70, 0.78);
    --text: #f0f6fc;
    --muted: #8b9bb4;
    --line: rgba(0, 243, 255, 0.17);
    --line-strong: rgba(0, 243, 255, 0.32);
    --brand: #00f3ff;
    --brand-2: #ff007f;
    --brand-soft: rgba(0, 243, 255, 0.11);
    --success: #00ff88;
    --warning: #ffb703;
    --danger: #ff2a6d;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
    --glow-cyan: 0 0 18px rgba(0, 243, 255, 0.22);
    --glow-success: 0 0 18px rgba(0, 255, 136, 0.22);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --font-mono: 'JetBrains Mono', monospace;
    --mobile-nav-height: 72px;
}

html[data-theme="light"] {
    --bg: #f0f4f9;
    --bg-grid: rgba(11, 99, 206, 0.04);
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --surface-2: #f5f8fc;
    --surface-3: #eaf0f8;
    --text: #0b1324;
    --muted: #5a6e85;
    --line: rgba(11, 99, 206, 0.18);
    --line-strong: rgba(11, 99, 206, 0.34);
    --brand: #0b63ce;
    --brand-2: #d90429;
    --brand-soft: rgba(11, 99, 206, 0.1);
    --shadow: 0 14px 36px rgba(11, 25, 50, 0.1);
    --glow-cyan: 0 0 16px rgba(11, 99, 206, 0.16);
    --glow-success: 0 0 16px rgba(0, 145, 82, 0.15);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 10%, rgba(0, 243, 255, 0.045), transparent 34%),
        radial-gradient(circle at 88% 82%, rgba(255, 0, 127, 0.045), transparent 30%),
        linear-gradient(to right, var(--bg-grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px),
        var(--bg);
    background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px, auto;
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body, button, input, select, textarea { font-size: 14px; }
button, input, select, textarea { font-family: inherit; color: var(--text); }
input, select, textarea { font-size: 16px !important; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.d-none { display: none !important; }

/* ---------- header ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1800;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.topbar-inner { min-height: 68px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.brand-mark {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
    color: #fff; font-family: var(--font-mono); font-weight: 800; letter-spacing: -.04em;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: var(--glow-cyan);
}
.brand strong { display: block; line-height: 1; font-size: 15px; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.topnav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.topnav a {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
    border: 1px solid transparent; border-radius: 12px; color: var(--muted); font-weight: 700;
}
.topnav a:hover, .topnav a.active { color: var(--brand); background: var(--brand-soft); border-color: var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: 0; }
.status-pill {
    display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 11px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
    color: var(--muted); font: 700 11px/1 var(--font-mono); white-space: nowrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.status-pill.ok { color: var(--text); }
.status-pill.ok .status-dot { background: var(--success); box-shadow: 0 0 9px var(--success); }
.status-pill.bad .status-dot { background: var(--danger); box-shadow: 0 0 9px var(--danger); }

.icon-btn, .ghost-btn, .primary-btn {
    min-height: 42px; border-radius: 12px; border: 1px solid var(--line); padding: 0 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
    font-weight: 700; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.icon-btn, .ghost-btn { background: var(--surface); color: var(--text); }
.icon-btn { width: 42px; padding: 0; }
.ghost-btn:hover, .icon-btn:hover { border-color: var(--line-strong); color: var(--brand); box-shadow: var(--glow-cyan); transform: translateY(-1px); }
.ghost-btn.is-loading { opacity: .62; cursor: progress; }
.primary-btn {
    border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: var(--glow-cyan);
}
.primary-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 0 24px rgba(0,243,255,.28); }
.primary-btn:disabled, .ghost-btn:disabled, .icon-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- common layout ---------- */
main { padding-bottom: 24px; }
.view-section > .container-fluid { max-width: 1700px; margin-inline: auto; }
.eyebrow { display: inline-flex; color: var(--brand); font: 800 10px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.muted-copy { margin: 4px 0 0; color: var(--muted); }
.section-heading, .card-heading, .traveller-tools-head, .legend-head {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 18px;
}
.section-heading h2, .card-heading h2, .traveller-tools-head h2 { margin: 4px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.section-heading p, .traveller-tools-head p { margin: 5px 0 0; color: var(--muted); }
.section-link, .back-link { border: 0; background: transparent; color: var(--brand); font-weight: 800; font-size: 13px; cursor: pointer; padding: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.back-link:hover, .section-link:hover { text-shadow: 0 0 10px rgba(0,243,255,.25); }

/* ---------- home / hero ---------- */
.hero {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
    padding-top: clamp(24px, 5vw, 54px); padding-bottom: 28px;
}
.hero-copy { max-width: 820px; }
.hero h1 { margin: 8px 0 12px; font-size: clamp(30px, 4.7vw, 56px); line-height: 1.02; font-weight: 800; letter-spacing: -.04em; }
.hero h1 span { color: var(--brand); text-shadow: var(--glow-cyan); }
.hero p { max-width: 720px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.hero-clock {
    flex: 0 0 auto; min-width: 205px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 18px;
    background: var(--surface); box-shadow: var(--shadow); text-align: right;
}
.hero-clock span { display: block; color: var(--brand); font: 800 clamp(30px,4vw,48px)/1 var(--font-mono); text-shadow: var(--glow-cyan); }
.hero-clock small { color: var(--muted); font-size: 11px; text-transform: uppercase; }

.traveller-tools, .itinerary-tools, .timeline-card, .schedule-card, .mini-map-card, .map-page-shell {
    border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow);
}
.traveller-tools, .itinerary-tools, .timeline-card, .schedule-card { padding: 20px; }
.traveller-tools { position: relative; }
.itinerary-tools-head, .traveller-tools-head { align-items: center; }
.traveller-tools-head { margin-bottom: 16px; }

/* ---------- stop search ---------- */
.stop-search-shell { position: relative; }
.stop-search-row { display: flex; gap: 10px; }
.stop-search-row .form-control { flex: 1; }
.form-control, .form-select {
    min-height: 46px; width: 100%; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
    color: var(--text) !important; background: var(--surface-2) !important; box-shadow: none;
}
.form-control::placeholder { color: var(--muted) !important; opacity: .9; }
.form-control:focus, .form-select:focus { border-color: var(--brand); background: var(--surface-solid) !important; box-shadow: 0 0 0 3px var(--brand-soft), var(--glow-cyan); }
.form-select option { background: var(--surface-solid); color: var(--text); }
.favorite-stops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.favorite-stop {
    display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text); cursor: pointer;
}
.favorite-stop:hover { border-color: var(--line-strong); color: var(--brand); }
.favorite-stop span { color: var(--warning); }
.favorites-empty { width: 100%; padding: 6px 2px 0; color: var(--muted); font-size: 12px; }
.stop-results {
    display: grid; gap: 8px; margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 16px;
    background: color-mix(in srgb, var(--surface-solid) 86%, transparent); box-shadow: var(--shadow); max-height: 360px; overflow-y: auto;
}
.stop-results:empty { display: none; }
.stop-results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 6px; color: var(--muted); font: 700 10px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.stop-result {
    display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 54px;
    padding: 4px; border: 1px solid transparent; border-radius: 13px; background: var(--surface-2);
}
.stop-result:hover { border-color: var(--line); background: var(--surface-3); }
.stop-result-main {
    min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px;
    width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer;
}
.stop-result-main strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.stop-result-main span { color: var(--muted); font: 700 11px/1 var(--font-mono); white-space: nowrap; }
.stop-favorite-btn { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.stop-favorite-btn:hover, .stop-favorite-btn.is-favorite { color: var(--warning); background: rgba(255,183,3,.08); }
.stop-empty, .stop-loading, .itinerary-empty {
    padding: 18px 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-2); font-size: 13px;
}
.stop-empty.error, .itinerary-empty.error, .alert-inline.error { border-color: rgba(255,42,109,.4); color: #ff88ad; background: rgba(255,42,109,.07); }

/* ---------- route cards ---------- */
.routes-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 14px; }
.route-card {
    position: relative; min-height: 154px; padding: 15px; border: 1px solid var(--line); border-radius: 15px;
    background: var(--surface); color: var(--text); cursor: pointer; text-align: left; transition: .18s ease;
    overflow: hidden;
}
.route-card::after { content: ''; position: absolute; inset: auto -35% -40% auto; width: 120px; height: 120px; border-radius: 50%; background: var(--route-color, var(--brand)); opacity: .08; filter: blur(4px); }
.route-card:hover { transform: translateY(-2px); border-color: var(--route-color, var(--brand)); box-shadow: var(--shadow), 0 0 18px color-mix(in srgb, var(--route-color, var(--brand)) 22%, transparent); }
.route-number { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; margin-bottom: 14px; color: #fff; font: 800 20px/1 var(--font-mono); }
.route-card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 800; }
.route-dests { color: var(--muted); font-size: 11px; line-height: 1.45; }
.route-open { position: absolute; right: 12px; bottom: 11px; color: var(--brand); font: 800 18px/1 var(--font-mono); }
.skeleton-card { min-height: 154px; border-radius: 15px; border: 1px solid var(--line); background: linear-gradient(110deg,var(--surface-2) 30%, var(--surface-3) 48%, var(--surface-2) 66%); background-size: 220% 100%; animation: skeleton 1.4s infinite linear; }
@keyframes skeleton { to { background-position-x: -220%; } }

.info-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 8px; }
.info-item { display:flex; align-items:center; gap:12px; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.info-icon { display:grid; place-items:center; width:38px; height:38px; flex:0 0 auto; border:1px solid var(--line); border-radius:11px; background:var(--brand-soft); color:var(--brand); font-weight:800; }
.info-item strong { display:block; font-size:13px; } .info-item small { color:var(--muted); font-size:11px; }

/* ---------- line view ---------- */
.line-header { display:flex; align-items:center; min-height:72px; padding:16px 18px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); }
.line-header .route-number { margin:0; flex:0 0 auto; }
.line-header h1 { font-size:clamp(24px,3.6vw,40px) !important; }
.control-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(180px,260px); gap:12px; padding:14px; border:1px solid var(--line); border-radius:15px; background:var(--surface); }
.control-group label { display:block; margin-bottom:5px; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.route-dashboard { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(300px,.8fr); gap:14px; }
.card-heading { align-items:flex-start; }
.card-heading .eyebrow { margin-top:3px; }
.timeline-card { min-width:0; }
.source-badge { display:inline-flex; align-items:center; min-height:32px; padding:0 10px; border-radius:999px; font:800 10px/1 var(--font-mono); text-align:center; }
.source-gps { color:var(--success); border:1px solid rgba(0,255,136,.42); background:rgba(0,255,136,.08); }
.source-projected { color:var(--brand); border:1px solid var(--line-strong); background:var(--brand-soft); }
.source-theoretical, .source-none { color:var(--warning); border:1px solid rgba(255,183,3,.38); background:rgba(255,183,3,.08); }
.selected-trip-hero { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px 0 18px; border-bottom:1px solid var(--line); }
.big-trip-time { color:var(--brand); font:800 42px/1 var(--font-mono); text-shadow:var(--glow-cyan); }
.big-trip-time small { display:block; margin-top:4px; color:var(--muted); font:700 10px/1.3 'Plus Jakarta Sans',system-ui,sans-serif; text-transform:uppercase; letter-spacing:.08em; }
.trip-meta { max-width:280px; color:var(--muted); font-size:12px; line-height:1.45; text-align:right; }
.schedule-updated-at { display:block; margin-top:6px; color:var(--muted); font:700 10px/1.3 var(--font-mono); }
.alert-inline { padding:11px 13px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); color:var(--muted); font-size:12px; }
.stop-timeline { padding-top:16px; }
.route-progress-shell { position:relative; --timeline-rail-x:14px; --timeline-cap:29px; }
.route-progress-shell::before { content:''; position:absolute; z-index:1; left:var(--timeline-rail-x); top:var(--timeline-cap); bottom:var(--timeline-cap); width:3px; transform:translateX(-50%); border-radius:999px; background:linear-gradient(to bottom, var(--line-strong), var(--line), var(--line-strong)); box-shadow:0 0 8px rgba(0,243,255,.06); }
.stop-timeline-rows { position:relative; z-index:2; }
.stop-row { position:relative; display:grid; grid-template-columns:28px minmax(0,1fr) auto; align-items:center; gap:12px; min-height:58px; border-radius:12px; transition:opacity .2s ease, background .2s ease, transform .2s ease; }
.stop-row .rail { position:relative; display:flex; justify-content:center; align-self:stretch; z-index:2; }
.stop-row .rail::before { display:none; }
.stop-row .dot { position:relative; z-index:3; width:12px; height:12px; margin-top:23px; border:3px solid var(--muted); border-radius:50%; background:var(--surface-solid); box-shadow:0 0 0 3px color-mix(in srgb,var(--surface-solid) 85%,transparent); }
.stop-row.passed { opacity:.58; }
.stop-row.passed .stop-name, .stop-row.passed .stop-sub { text-decoration:line-through; text-decoration-thickness:1px; }
.stop-row.passed .stop-name, .stop-row.passed .stop-time, .stop-row.passed .stop-time-container { color:var(--muted); }
.stop-row.passed .dot { border-color:var(--muted); background:var(--muted); box-shadow:none; }
.stop-row.current .dot, .stop-row.bus-near .dot { border-color:var(--brand); background:var(--brand); box-shadow:var(--glow-cyan), 0 0 0 4px var(--brand-soft); }
.stop-row.current { background:linear-gradient(90deg, var(--brand-soft), transparent 65%); }
.stop-row.bus-near { padding-block:2px; }
.stop-row.bus-near > div:nth-child(2) { padding:7px 9px; border:1px solid rgba(0,255,136,.25); border-radius:10px; background:rgba(0,255,136,.05); }
.stop-name { font-weight:800; font-size:13px; }
.stop-sub { margin-top:2px; color:var(--muted); font:700 10px/1.3 var(--font-mono); }
.stop-time { min-width:78px; color:var(--text); font:800 13px/1 var(--font-mono); text-align:right; }
.stop-time-container { min-width:120px; text-align:right; }
.stop-time-container .rt-late { color:var(--danger); font:800 12px/1.35 var(--font-mono); }
.stop-time-container .rt-early { color:var(--warning); font:800 12px/1.35 var(--font-mono); }
.stop-time-container .rt-ontime { color:var(--success); font:800 12px/1.35 var(--font-mono); }
.rt-status-text { font:700 10px/1.2 'Plus Jakarta Sans',system-ui,sans-serif; }
.scheduled-base { margin-top:2px; color:var(--muted); font:500 10px/1.2 var(--font-mono); text-decoration:line-through; }
.timeline-bus-marker {
    pointer-events:none;
    position:absolute; left:var(--timeline-rail-x); z-index:4; display:grid; place-items:center; width:34px; height:34px;
    border:2px solid var(--success); border-radius:50%; background:var(--surface-solid); color:var(--success);
    box-shadow:var(--glow-success), 0 0 0 4px color-mix(in srgb,var(--surface-solid) 86%,transparent);
    transform:translate(-50%,-50%); transition:top .55s cubic-bezier(.2,.85,.25,1), color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.timeline-bus-marker.projected { color:var(--brand); border-color:var(--brand); box-shadow:var(--glow-cyan), 0 0 0 4px color-mix(in srgb,var(--surface-solid) 86%,transparent); }
.timeline-bus-marker.theoretical { color:var(--warning); border-color:var(--warning); box-shadow:0 0 16px rgba(255,183,3,.18), 0 0 0 4px color-mix(in srgb,var(--surface-solid) 86%,transparent); }
.timeline-bus-icon { width:20px; height:20px; display:block; }
.route-side { min-width:0; display:grid; align-content:start; gap:14px; }
.mini-map-card { position:relative; height:320px; overflow:hidden; padding:0; }
.line-map { width:100%; height:100%; min-height:320px; }
.map-overlay-label { position:absolute; left:12px; top:12px; z-index:500; padding:6px 9px; border:1px solid var(--line); border-radius:999px; background:color-mix(in srgb,var(--surface-solid) 88%,transparent); color:var(--muted); font:800 10px/1 var(--font-mono); backdrop-filter:blur(8px); }
.trip-nav-card { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:8px; padding:10px; border:1px solid var(--line); border-radius:15px; background:var(--surface); }
.trip-nav-btn { min-height:44px; padding:0 12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); color:var(--text); font-size:12px; font-weight:800; cursor:pointer; }
.trip-nav-btn:hover:not(:disabled) { border-color:var(--brand); color:var(--brand); }
.trip-nav-btn:disabled { opacity:.36; cursor:not-allowed; }
#tripCounter { min-width:65px; text-align:center; color:var(--muted); font:800 11px/1 var(--font-mono); }
.schedule-card { overflow:hidden; }
.muted-count { color:var(--muted); font:700 11px/1 var(--font-mono); }
.trip-strip { display:flex; gap:8px; overflow-x:auto; padding:8px 2px 4px; scrollbar-width:thin; }
.trip-chip { flex:0 0 auto; min-width:108px; padding:10px 11px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); color:var(--text); text-align:left; cursor:pointer; }
.trip-chip:hover { border-color:var(--brand); }
.trip-chip strong { display:block; font:800 15px/1 var(--font-mono); }
.trip-chip small { display:block; margin-top:5px; color:var(--muted); font-size:10px; line-height:1.3; }
.trip-chip.active { border-color:var(--brand); background:var(--brand-soft); box-shadow:var(--glow-cyan); }
.trip-chip.current { box-shadow:inset 0 0 0 2px var(--success); }

/* ---------- itinerary ---------- */
.itinerary-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; }
.itinerary-field { position:relative; min-width:0; }
.itinerary-field label { display:block; margin-bottom:6px; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.itinerary-actions { grid-column:1 / -1; display:grid; grid-template-columns:minmax(150px,1fr) minmax(130px,170px) auto 48px; gap:10px; align-items:end; padding-top:2px; }
.itinerary-swap { width:48px; padding:0; }
.itinerary-stop-picker { position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:1600; display:grid; gap:5px; max-height:280px; overflow:auto; padding:7px; border:1px solid var(--line-strong); border-radius:14px; background:var(--surface-solid); box-shadow:var(--shadow),var(--glow-cyan); }
.itinerary-stop-option { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; width:100%; padding:10px 11px; border:1px solid transparent; border-radius:10px; background:var(--surface-2); color:var(--text); text-align:left; cursor:pointer; }
.itinerary-stop-option:hover { border-color:var(--brand); background:var(--brand-soft); }
.itinerary-stop-option strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.itinerary-stop-option span { color:var(--muted); font:700 10px/1 var(--font-mono); white-space:nowrap; }
.itinerary-results { display:grid; gap:12px; margin-top:16px; }
.itinerary-result {
    overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--surface-2); box-shadow:0 10px 24px rgba(0,0,0,.16);
}
.itinerary-result:hover { border-color:var(--line-strong); }
.itinerary-result-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 16px; border-bottom:1px solid var(--line); background:color-mix(in srgb,var(--surface-solid) 28%,transparent); }
.itinerary-result-time { display:flex; align-items:baseline; gap:7px; color:var(--brand); font:800 20px/1.1 var(--font-mono); }
.itinerary-result-meta { color:var(--muted); font-size:11px; font-weight:800; text-align:right; }
.itinerary-legs { display:grid; gap:0; padding:8px 16px 12px; }
.itinerary-leg { display:grid; grid-template-columns:46px minmax(0,1fr); gap:12px; align-items:center; padding:12px 0; }
.itinerary-leg + .itinerary-leg { border-top:1px dashed var(--line); }
.itinerary-line { display:grid; place-items:center; min-height:34px; padding:0 8px; border-radius:9px; background:var(--line-color,var(--brand)); color:#fff; font:800 12px/1 var(--font-mono); box-shadow:0 4px 12px rgba(0,0,0,.14); }
.itinerary-leg-main { min-width:0; }
.itinerary-leg-stops { display:flex; flex-wrap:wrap; align-items:center; gap:5px; font-size:12px; font-weight:800; }
.itinerary-leg-stops span { color:var(--muted); }
.itinerary-leg-meta { margin-top:5px; color:var(--muted); font-size:10px; line-height:1.35; }
.itinerary-transfer { margin:2px 0 2px 58px; padding:7px 9px; border:1px dashed var(--line-strong); border-radius:9px; background:var(--brand-soft); color:var(--brand); font-size:10px; font-weight:800; }

/* ---------- map ---------- */
.map-page-shell { position:relative; min-height:calc(100vh - 160px); overflow:hidden; }
.network-map { width:100%; height:100%; min-height:calc(100vh - 160px); }
.map-legend-card { position:absolute; left:16px; bottom:16px; z-index:700; width:min(330px,calc(100% - 32px)); padding:14px; border:1px solid var(--line); border-radius:14px; background:color-mix(in srgb,var(--surface-solid) 90%,transparent); backdrop-filter:blur(12px); box-shadow:var(--shadow); }
.legend-head { align-items:center; }
.legend-list { display:grid; gap:8px; margin-top:10px; color:var(--muted); font-size:11px; }
.legend-list > div { display:flex; align-items:center; gap:8px; }
.legend-marker { width:11px; height:11px; border-radius:4px; }
.bus-real { background:var(--success); box-shadow:var(--glow-success); } .bus-projected { background:var(--brand); } .bus-theoretical { background:var(--warning); }
.legend-stop { width:10px; height:10px; border:2px solid var(--brand); border-radius:50%; }
.map-stats { margin-top:12px; padding-top:10px; border-top:1px solid var(--line); color:var(--muted); font-size:10px; line-height:1.5; }
.bus-marker { width:36px; height:36px; display:grid; place-items:center; border:2px solid #fff; border-radius:11px; color:#fff; font-weight:800; box-shadow:0 6px 16px rgba(0,0,0,.45); }
.bus-marker.gps { background:var(--success); } .bus-marker.projected { background:var(--brand); } .bus-marker.theoretical { background:var(--warning); }
.leaflet-control-zoom a, .leaflet-bar a { background:var(--surface-solid) !important; color:var(--text) !important; border-color:var(--line) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background:var(--surface-solid); color:var(--text); }

/* ---------- stop detail / toast ---------- */
.stop-panel { position:fixed; inset:0; z-index:6000; display:grid; place-items:center; padding:16px; background:rgba(5,8,17,.74); backdrop-filter:blur(8px); }
.stop-panel-card { width:min(580px,100%); max-height:min(720px,88vh); overflow:auto; padding:20px; border:1px solid var(--line-strong); border-radius:18px; background:var(--surface-solid); box-shadow:var(--shadow),var(--glow-cyan); }
.stop-panel-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:16px; }
.stop-panel-head h2 { margin:4px 0 0; font-size:22px; }
.stop-next-list { display:grid; gap:8px; }
.stop-departure { display:flex; align-items:center; gap:12px; padding:11px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.stop-line-badge { min-width:44px; height:36px; padding:0 8px; display:grid; place-items:center; flex:0 0 auto; border-radius:10px; background:var(--line-color,var(--brand)); color:#fff; font:800 13px/1 var(--font-mono); }
.stop-departure-main { min-width:0; display:grid; gap:3px; }
.stop-departure-main strong { color:var(--brand); font:800 16px/1 var(--font-mono); }
.stop-departure-main span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:11px; }
.toast-host { position:fixed; right:16px; bottom:calc(var(--bottom-nav-height) + 12px); z-index:5600; display:grid; gap:8px; width:min(360px,calc(100vw - 32px)); }
.toast { padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-solid); color:var(--text); box-shadow:var(--shadow); }

/* ---------- navigation basse universelle ---------- */
:root { --bottom-nav-height:78px; }
.mobile-bottom-nav {
    display:flex !important;
    flex-flow:row nowrap;
    position:fixed; left:0; right:0; bottom:0; z-index:5000;
    align-items:stretch; justify-content:center; gap:6px;
    width:100%;
    min-height:var(--bottom-nav-height);
    padding:8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    overflow-x:auto; overflow-y:hidden;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    border-top:1px solid var(--line);
    background:color-mix(in srgb,var(--surface-solid) 94%,transparent);
    backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
    box-shadow:0 -10px 30px rgba(0,0,0,.08);
    isolation:isolate;
}
.mobile-bottom-nav::-webkit-scrollbar { display:none; width:0; height:0; }
.mobile-bottom-nav a {
    flex:0 0 118px;
    min-width:118px;
    display:grid; place-items:center; align-content:center; gap:3px;
    min-height:54px; padding:6px 8px;
    border:1px solid transparent; border-radius:12px;
    color:var(--muted); font-size:10px; font-weight:800;
    text-decoration:none; white-space:nowrap;
}
.mobile-bottom-nav a .nav-icon { font-size:18px; line-height:1; }
.mobile-bottom-nav a span:last-child { overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.mobile-bottom-nav a.active { color:var(--brand); border-color:var(--line); background:var(--brand-soft); }
.mobile-bottom-nav a:hover { color:var(--text); border-color:var(--line); }
body { padding-bottom:calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
@media (min-width:768px) {
    .mobile-bottom-nav { overflow-x:auto; padding-inline:max(18px, env(safe-area-inset-left)); }
    .mobile-bottom-nav a { flex-basis:126px; min-width:126px; min-height:58px; font-size:10px; }
    .mobile-bottom-nav a .nav-icon { font-size:17px; }
}
@media (max-width:767.98px) {
    :root { --bottom-nav-height:76px; }
    .mobile-bottom-nav { justify-content:flex-start; gap:5px; padding-top:7px; padding-bottom:max(7px, env(safe-area-inset-bottom)); }
    .mobile-bottom-nav a { flex:0 0 96px; min-width:96px; min-height:58px; padding-inline:6px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
    .routes-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .route-dashboard { grid-template-columns:minmax(0,1fr); }
    .route-side { grid-template-columns:minmax(0,1fr); }
    .mini-map-card { min-height:280px; }
}
@media (max-width: 900px) {
    .brand { min-width:0; }
    .topbar-inner { gap:10px; }
    .topnav { margin-left:auto; }
    .routes-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .info-strip { grid-template-columns:1fr; }
}
@media (max-width: 767.98px) {
    :root { --bottom-nav-height:78px; --mobile-nav-height:78px; }
    main { padding-bottom:16px; }
    .topbar-inner { min-height:60px; }
    .brand { gap:9px; }
    .brand-mark { width:38px; height:38px; border-radius:11px; }
    .brand strong { font-size:14px; }
    .brand small, .status-text { display:none; }
    .topbar-actions { margin-left:auto; }
    .status-pill { min-height:34px; padding-inline:9px; }
    .hero { flex-direction:column; align-items:stretch; padding-top:20px; padding-bottom:20px; gap:16px; }
    .hero h1 { font-size:clamp(28px,8vw,38px); }
    .hero p { font-size:13px; }
    .hero-clock { width:100%; min-width:0; padding:13px 15px; text-align:left; }
    .hero-clock span { font-size:34px; }
    .traveller-tools, .itinerary-tools, .timeline-card, .schedule-card { padding:15px; border-radius:15px; }
    .traveller-tools-head, .section-heading, .card-heading { align-items:flex-start; flex-direction:column; gap:10px; }
    .traveller-tools-head .ghost-btn, .section-heading .section-link { width:100%; }
    .traveller-tools-head .ghost-btn { justify-content:center; }
    .routes-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
    .route-card { min-height:138px; padding:12px; }
    .route-number { width:42px; height:42px; }
    .route-card h3 { font-size:13px; }
    .route-dests { font-size:10px; }
    .stop-results { max-height:330px; }
    .stop-result-main { grid-template-columns:1fr; gap:5px; }
    .stop-result-main span { justify-self:start; }
    .control-panel { grid-template-columns:1fr; }
    .selected-trip-hero { align-items:flex-start; flex-direction:column; }
    .big-trip-time { font-size:34px; }
    .trip-meta { max-width:none; text-align:left; }
    .route-progress-shell { --timeline-rail-x:12px; --timeline-cap:31px; }
    .stop-row { grid-template-columns:24px minmax(0,1fr); gap:10px; min-height:62px; }
    .stop-time, .stop-time-container { grid-column:2; min-width:0; text-align:left; padding-bottom:7px; }
    .stop-row .dot { margin-top:25px; }
    .timeline-bus-marker { width:32px; height:32px; }
    .timeline-bus-icon { width:18px; height:18px; }
    .trip-nav-card {
        position:fixed;
        left:10px;
        right:10px;
        bottom:calc(var(--bottom-nav-height) + var(--quick-route-nav-height) + 10px + env(safe-area-inset-bottom));
        z-index:1900;
        width:auto;
        margin:0;
        padding:0;
        border:0;
        background:transparent;
        box-shadow:none;
        grid-template-columns:minmax(0,1fr) 48px minmax(0,1fr);
        pointer-events:none;
    }
    .trip-nav-btn {
        min-height:44px;
        padding-inline:9px;
        font-size:10px;
        box-shadow:0 8px 24px rgba(0,0,0,.28);
        pointer-events:auto;
        backdrop-filter:blur(12px);
        -webkit-backdrop-filter:blur(12px);
    }
    #tripCounter {
        min-width:0;
        color:var(--muted);
        text-shadow:0 1px 8px rgba(0,0,0,.45);
    }
    .itinerary-grid { grid-template-columns:1fr; }
    .itinerary-actions { grid-column:auto; grid-template-columns:1fr 1fr; }
    .itinerary-actions .primary-btn { grid-column:1 / -1; order:3; width:100%; }
    .itinerary-swap { width:100%; }
    .itinerary-result-head { align-items:flex-start; flex-direction:column; gap:7px; }
    .itinerary-result-meta { text-align:left; }
    .itinerary-leg { grid-template-columns:42px minmax(0,1fr); gap:10px; }
    .itinerary-transfer { margin-left:52px; }
    .map-page-shell { min-height:calc(100vh - 190px); border-radius:15px; }
    .network-map { min-height:calc(100vh - 190px); }
    .map-legend-card { left:10px; right:10px; bottom:calc(var(--bottom-nav-height) + 10px); width:auto; max-height:42vh; overflow:auto; }
    .mini-map-card, .line-map { min-height:240px; height:240px; }
    .mobile-bottom-nav { display:flex !important; }
}
@media (max-width: 480px) {
    .routes-grid { grid-template-columns:1fr 1fr; }
    .topbar-inner { padding-inline:10px !important; }
    .brand strong { font-size:13px; }
    .hero h1 { font-size:27px; }
    .route-card { min-height:132px; }
    .route-open { right:9px; bottom:9px; }
    .info-item { padding:12px; }
    .itinerary-result-time { font-size:18px; }
    .itinerary-actions { grid-template-columns:1fr 48px; }
    .itinerary-actions .form-control:first-child { grid-column:1 / -1; }
    .itinerary-actions .primary-btn { grid-column:1 / -1; }
    .itinerary-swap { width:48px; justify-self:end; }
    .stop-panel { padding:10px; align-items:end; }
    .stop-panel-card { max-height:86vh; border-radius:18px 18px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior:auto !important; animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
/* ---------- perturbations / informations trafic ---------- */
.alerts-home-panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.alerts-home-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}
.alerts-home-head h2 { margin: 4px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.alerts-home-head p { margin: 5px 0 0; color: var(--muted); }
.alerts-home-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.alerts-source-status { color: var(--muted); font: 700 10px/1.2 var(--font-mono); white-space: nowrap; }
.alerts-count {
    display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 8px;
    border-radius: 999px; background: var(--danger); color: #fff; font: 800 11px/1 var(--font-mono); box-shadow: 0 0 16px rgba(255,42,109,.2);
}
.global-alerts-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.alerts-loading,
.alerts-empty {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 12px; min-height: 74px; padding: 13px 15px;
    border: 1px dashed var(--line-strong); border-radius: 14px; background: color-mix(in srgb,var(--surface-2) 72%,transparent);
    color: var(--muted);
}
.alerts-empty strong, .alerts-empty small { display:block; }
.alerts-empty strong { color: var(--text); font-size: 12px; }
.alerts-empty small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.alerts-empty-icon { display:grid; place-items:center; flex:0 0 auto; width:32px; height:32px; border-radius:10px; background:var(--brand-soft); color:var(--brand); font:800 15px/1 var(--font-mono); }
.alerts-empty-error { border-color: rgba(255,42,109,.38); background:rgba(255,42,109,.06); }
.alerts-empty-error .alerts-empty-icon { color:var(--danger); background:rgba(255,42,109,.1); }
.alerts-spinner { width:14px; height:14px; border:2px solid var(--line); border-top-color:var(--brand); border-radius:50%; animation:tic-spin .8s linear infinite; }
@keyframes tic-spin { to { transform:rotate(360deg); } }
.alert-card {
    display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; padding: 13px 14px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
}
.alert-card-danger { border-color: rgba(255,42,109,.36); background: rgba(255,42,109,.055); }
.alert-card-warning { border-color: rgba(255,183,3,.34); background: rgba(255,183,3,.045); }
.alert-card-info { border-color: var(--line); }
.alert-card-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:11px; background:var(--brand-soft); color:var(--brand); font:900 15px/1 var(--font-mono); }
.alert-card-danger .alert-card-icon { color:var(--danger); background:rgba(255,42,109,.1); }
.alert-card-warning .alert-card-icon { color:var(--warning); background:rgba(255,183,3,.1); }
.alert-card-topline { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px; }
.alert-severity-label { color:var(--muted); font:800 9px/1.1 var(--font-mono); letter-spacing:.08em; text-transform:uppercase; }
.alert-card-scope { color:var(--muted); font-size:10px; font-weight:700; text-align:right; }
.alert-card h3 { margin:0; font-size:13px; line-height:1.35; }
.alert-card p { margin:5px 0 0; color:var(--muted); font-size:11px; line-height:1.45; }
.alert-card-footer { display:flex; align-items:flex-end; justify-content:space-between; gap:10px; margin-top:8px; }
.alert-card-footer time { flex:0 0 auto; color:var(--muted); font:600 9px/1.3 var(--font-mono); text-align:right; }
.alert-line-tags { display:flex; flex-wrap:wrap; gap:5px; }
.alert-line-tag { display:inline-flex; align-items:center; min-height:22px; padding:0 7px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--text); font:800 9px/1 var(--font-mono); }
.alert-line-tag-network { border-color:var(--line-strong); color:var(--brand); }

/* Ligne : bouton et panneau de perturbations */
.line-header { position:relative; }
.line-header-main { width:100%; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.line-header-main h1 { font-size:clamp(24px,3.6vw,40px); letter-spacing:-.04em; }
.line-alerts-wrap { position:relative; flex:0 0 auto; }
.line-alerts-trigger {
    min-height:42px; display:inline-flex; align-items:center; gap:7px; padding:0 11px;
    border:1px solid var(--line); border-radius:12px; background:var(--surface-2); color:var(--text);
    font-size:11px; font-weight:800; cursor:pointer; transition:.18s ease;
}
.line-alerts-trigger:hover, .line-alerts-trigger.has-alerts { border-color:rgba(255,42,109,.38); color:var(--danger); box-shadow:0 0 16px rgba(255,42,109,.12); }
.line-alerts-trigger:disabled { opacity:.58; cursor:progress; }
.line-alerts-icon { display:grid; place-items:center; width:19px; height:19px; border-radius:6px; background:var(--brand-soft); color:var(--brand); font:900 11px/1 var(--font-mono); }
.line-alerts-trigger.has-alerts .line-alerts-icon { background:rgba(255,42,109,.1); color:var(--danger); }
.line-alert-count {
    display:grid; place-items:center; min-width:20px; height:20px; padding:0 5px; border-radius:999px;
    background:var(--danger); color:#fff; font:800 9px/1 var(--font-mono);
}
.line-alerts-menu {
    position:absolute; top:calc(100% + 9px); right:0; z-index:5600; width:min(440px,calc(100vw - 34px));
    padding:12px; border:1px solid var(--line-strong); border-radius:16px; background:var(--surface-solid);
    box-shadow:var(--shadow),0 0 24px rgba(0,243,255,.08); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
}
.line-alerts-menu-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:3px 2px 10px; border-bottom:1px solid var(--line); }
.line-alerts-menu-head strong { display:block; margin-top:3px; font-size:12px; }
.line-alerts-refresh { width:30px; height:30px; border:1px solid var(--line); border-radius:9px; background:var(--surface-2); color:var(--muted); cursor:pointer; }
.line-alerts-refresh:hover { color:var(--brand); border-color:var(--line-strong); }
.line-alerts-list { display:grid; gap:8px; max-height:min(62vh,520px); overflow:auto; padding-top:10px; }
.line-alerts-list .alerts-empty { min-height:66px; }
.line-alerts-list .alert-card { grid-template-columns:30px minmax(0,1fr); padding:10px; }
.line-alerts-list .alert-card-icon { width:30px; height:30px; border-radius:9px; }
.line-alerts-list .alert-card h3 { font-size:12px; }
.line-alerts-list .alert-card p { font-size:10px; }
.line-alerts-list .alert-card-footer { align-items:flex-start; flex-direction:column; }
.line-alerts-list .alert-card-footer time { text-align:left; }
.line-alerts-source { margin-top:9px; padding-top:8px; border-top:1px solid var(--line); color:var(--muted); font:600 9px/1.35 var(--font-mono); }

@media (max-width: 760px) {
    .alerts-home-head { align-items:flex-start; flex-direction:column; gap:10px; }
    .alerts-home-meta { width:100%; justify-content:flex-start; }
    .alerts-home-meta .ghost-btn { flex:1 1 auto; }
    .global-alerts-list { grid-template-columns:1fr; }
    .alert-card-footer { align-items:flex-start; flex-direction:column; }
    .alert-card-footer time { text-align:left; }
    .line-header-main { align-items:flex-start; flex-direction:column; }
    .line-alerts-wrap { width:100%; }
    .line-alerts-trigger { width:100%; justify-content:center; }
    .line-alerts-menu { left:0; right:auto; width:100%; max-width:none; }
}

/* ========================================================================
   ---------- COMPTE MEMBRE / PROFIL (MODALE OPTIMISÉE PC & MOBILE) ----------
   ======================================================================== */

/* --- 1. FIX Z-INDEX GLOBAL (Passe au-dessus des bannières et navs) --- */
#accountModal {
    z-index: 6000 !important;
}
body:has(#accountModal.show) .modal-backdrop.show {
    z-index: 5990 !important;
}

/* --- 2. STYLES COMMUNS DE BASE --- */
.account-header-btn { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px 3px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 800; cursor: pointer; text-decoration: none; transition: .18s ease; }
.account-header-btn:hover { color: var(--brand); border-color: var(--line-strong); box-shadow: var(--glow-cyan); }
.account-header-avatar { width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font: 800 11px/1 var(--font-mono); flex: 0 0 auto; }
.account-header-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.account-header-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }

.account-modal { border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow), var(--glow-cyan); }
.account-modal .modal-header { border-bottom: 1px solid var(--line); padding: 18px 22px; flex: 0 0 auto; }
.account-modal .btn-close { filter: invert(1); opacity: .8; }
html[data-theme="light"] .account-modal .btn-close { filter: none; }

.account-modal-profile { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.account-modal-profile strong, .account-modal-profile span, .account-modal-profile small { display: block; }
.account-modal-profile strong { font-size: 15px; }
.account-modal-profile span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.account-admin-label { margin-top: 5px; color: var(--brand); font: 800 9px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }

.account-modal-form { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.account-modal-form label { font-size: 11px; font-weight: 800; }
.account-modal-form small { color: var(--muted); font-size: 10px; }
.account-file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.account-file-row .form-control { padding: 8px 10px; }

.account-admin-link, .account-logout-link { display: flex; align-items: center; justify-content: center; min-height: 42px; margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; font-weight: 800; text-decoration: none; cursor: pointer; background: transparent; }
.account-admin-link { color: var(--brand); background: var(--brand-soft); }
.account-logout-link { color: var(--danger); border-color: rgba(255, 42, 109, 0.3); background: rgba(255, 42, 109, 0.05); }
.account-logout-link:hover { background: rgba(255, 42, 109, 0.12); border-color: var(--danger); }

.account-modal-status { min-height: 18px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.account-modal-status.success { color: var(--success); }
.account-modal-status.error { color: var(--danger); }

/* --- STYLES DES PARAMÈTRES / SETTINGS --- */
.account-member-settings { display: grid; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.account-member-setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); min-width: 0; overflow: hidden; }
.account-member-setting > div:first-child { min-width: 0; flex: 1 1 auto; }
.account-member-setting strong { display: block; font-size: 13px; color: var(--text); }
.account-member-setting small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.account-member-setting-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; max-width: 60%; }
.account-member-setting-actions .ghost-btn { min-height: 34px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
.member-setting-select { min-height: 36px; padding-inline: 10px; font-size: 12px !important; }
.member-quiet-hours { display: flex; align-items: center; gap: 6px; }
.member-quiet-hours .form-control { min-height: 34px; padding: 0 6px; font-size: 12px !important; width: 85px; }
.member-inline-check { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); cursor: pointer; }

/* --- 3. MISE EN PAGE OPTIMISÉE POUR PC (DESKTOP) --- */
@media (min-width: 768px) {
    #accountModal .modal-dialog {
        max-width: 920px;
        margin: 32px auto;
    }
    #accountModal .modal-content {
        max-height: calc(100vh - 64px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 22px;
    }
    #accountModal .modal-body {
        display: grid;
        grid-template-columns: 330px 1fr;
        gap: 24px;
        padding: 24px;
        overflow-y: auto;
        align-items: start;
    }

    /* Colonne de Gauche : Profil, Avatar, Mot de passe, Déconnexion */
    .account-modal-profile { grid-column: 1; }
    #avatarForm { grid-column: 1; margin-top: 0; }
    #passwordForm { grid-column: 1; margin-top: 0; }
    #accountAdminLink { grid-column: 1; margin-top: 0; }
    #accountLogoutBtn { grid-column: 1; margin-top: 0; }

    /* Colonne de Droite : Paramètres membre & Réseau */
    .account-member-settings {
        grid-column: 2;
        grid-row: 1 / span 6;
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
        border-left: 1px solid var(--line);
        padding-left: 24px;
        gap: 12px;
    }

    /* Message de statut global en bas */
    #accountModalStatus {
        grid-column: 1 / -1;
        margin-top: 0;
    }
}

/* --- 4. PRÉSERVATION STRICTE DES STYLES MOBILE (INCHANGÉ) --- */
@media (max-width: 767.98px) {
    .account-header-name { display: none; }
    .account-header-btn { padding-right: 4px; }
    .account-file-row { grid-template-columns: 1fr; }
    .account-file-row .ghost-btn { width: 100%; }

    #accountModal .modal-dialog {
        width: 100%;
        max-width: none;
        min-height: 100%;
        margin: 0;
        padding: 50px 10px calc(var(--bottom-nav-height) + var(--quick-route-nav-height) + 12px + env(safe-area-inset-bottom));
        align-items: center;
    }
    #accountModal .modal-content {
        width: 100%;
        max-height: calc(100dvh - var(--bottom-nav-height) - var(--quick-route-nav-height) - 65px - env(safe-area-inset-bottom));
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 18px;
    }
    #accountModal .modal-header {
        padding: 14px 16px;
        flex: 0 0 auto;
    }
    #accountModal .modal-body {
        padding: 16px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}

.site-footer{padding:22px 16px calc(var(--bottom-nav-height) + 28px);border-top:1px solid var(--line);background:var(--surface-2);color:var(--muted)}
.site-footer-inner{width:min(1200px,100%);margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:20px}
.site-footer-inner>div{display:grid;gap:3px}.site-footer-inner strong{font-size:12px;color:var(--text)}.site-footer-inner span{font-size:10px}.site-footer nav{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px}.site-footer a{color:var(--muted);font-size:10px;font-weight:800;text-decoration:none}.site-footer a:hover{color:var(--brand)}
@media(max-width:767.98px){.site-footer{padding-bottom:calc(var(--bottom-nav-height) + 28px)}.site-footer-inner{display:grid;gap:12px}.site-footer nav{justify-content:flex-start}}

/* ---------- fluidite / interactions v6.1 ---------- */
.desktop-network-nav-slot { display: contents; }
.stop-search-row { position: relative; align-items: center; }
.stop-search-row .form-control { padding-right: 52px; min-width: 0; }
.stop-search-clear { position: absolute; right: 6px; width: 38px; min-height: 38px; border: 0; background: transparent; color: var(--muted); z-index: 2; }
.stop-search-clear:hover { background: var(--brand-soft); color: var(--brand); box-shadow: none; transform: none; }
.stop-search-hint { border-style: dashed; }
.stop-empty { min-width: 0; overflow-wrap: anywhere; }
.stop-empty strong, .stop-empty span, .stop-empty small { display: block; }
.stop-empty strong { margin-bottom: 4px; color: var(--text); }
.stop-empty small { margin-top: 6px; color: var(--muted); }
.stop-result-direction { color: var(--muted); font-weight: 600; }
.stop-result-main { min-width: 0; overflow: hidden; }
.stop-result-main strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop-next-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 10px; color:var(--muted); font:700 9px/1.2 var(--font-mono); text-transform:uppercase; letter-spacing:.05em; }
.stop-panel-open { overflow:hidden; }
.app-toast {
    display:grid; grid-template-columns:24px minmax(0,1fr) 26px; align-items:center; gap:8px;
    min-width:0; padding:10px 10px; border:1px solid var(--line-strong); border-radius:14px;
    background:color-mix(in srgb,var(--surface-solid) 94%,transparent); color:var(--text); box-shadow:var(--shadow),var(--glow-cyan);
    backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
    animation:appToastIn .18s ease both;
}
.app-toast.is-closing { animation:appToastOut .18s ease both; }
.app-toast-icon { display:grid; place-items:center; width:24px; height:24px; border-radius:8px; background:var(--brand-soft); color:var(--brand); font:800 12px/1 var(--font-mono); }
.app-toast-success .app-toast-icon { background:rgba(0,255,136,.11); color:var(--success); }
.app-toast-error .app-toast-icon { background:rgba(255,42,109,.11); color:var(--danger); }
.app-toast-warning .app-toast-icon { background:rgba(255,183,3,.12); color:var(--warning); }
.app-toast-message { min-width:0; font-size:11px; font-weight:700; line-height:1.4; overflow-wrap:anywhere; }
.app-toast-close { width:26px; height:26px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; font-size:16px; }
.app-toast-close:hover { background:var(--brand-soft); color:var(--brand); }
@keyframes appToastIn { from { opacity:0; transform:translate3d(0,8px,0) scale(.98); } to { opacity:1; transform:none; } }
@keyframes appToastOut { from { opacity:1; transform:none; } to { opacity:0; transform:translate3d(0,8px,0) scale(.98); } }
.quick-auth-modal .modal-body { padding-top:14px; }
.quick-auth-tabs { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:8px 20px 0; }
.quick-auth-tab { min-height:38px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); color:var(--muted); font-weight:800; cursor:pointer; }
.quick-auth-tab.is-active { color:var(--brand); background:var(--brand-soft); border-color:var(--line-strong); }
.quick-auth-foot { margin:12px 0 0; color:var(--muted); font-size:10px; line-height:1.45; }
.quick-auth-foot a { color:var(--brand); font-weight:800; }
.member-gate-actions .primary-btn, .member-gate-actions .ghost-btn { flex:1 1 180px; }
[aria-busy="true"] { cursor:progress !important; }

@media (max-width:767.98px) {
    .toast-host { right:10px; left:10px; bottom:calc(var(--bottom-nav-height) + 10px + env(safe-area-inset-bottom)); width:auto; z-index:4100; }
    .app-toast { grid-template-columns:22px minmax(0,1fr) 24px; }
    .quick-auth-tabs { padding-inline:15px; }
    #quickAuthModal .modal-dialog, #memberGateModal .modal-dialog { width:100%; max-width:none; margin:0; min-height:100%; padding:54px 10px calc(var(--mobile-nav-height) + 10px + env(safe-area-inset-bottom)); align-items:center; }
    #quickAuthModal .modal-content, #memberGateModal .modal-content { width:100%; max-height:calc(100dvh - 126px - env(safe-area-inset-bottom)); overflow:hidden; border-radius:18px; }
    #quickAuthModal .modal-body, #memberGateModal .modal-body { overflow:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
    .stop-search-row { width:100%; }
    .stop-results { max-width:100%; overflow-x:hidden; }
    .stop-result { min-width:0; }
    .stop-result-main strong { white-space:normal; line-height:1.35; }
    .stop-panel { padding:0 10px calc(var(--mobile-nav-height) + 10px + env(safe-area-inset-bottom)); }
    .stop-panel-card { width:100%; max-height:calc(100dvh - var(--mobile-nav-height) - 18px); padding:16px; }
    .stop-next-meta { flex-wrap:wrap; }
}
@media (max-width:380px) {
    .account-header-btn { min-width:34px; }
    .status-pill { padding-inline:7px; }
    .topbar-actions { gap:4px; }
}


/* ===== Community/menu final correction ===== */
.mobile-bottom-nav{
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:stretch !important;
    justify-content:flex-start !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    white-space:nowrap !important;
    touch-action:pan-x;
}
.mobile-bottom-nav a{
    flex:0 1 150px !important;
    min-width:0 !important;
    white-space:nowrap !important;
}
@media (min-width:768px){
    .mobile-bottom-nav a{ flex:1 1 0 !important; }
}
@media (max-width:767.98px){
    .mobile-bottom-nav{
        justify-content:flex-start !important;
        gap:6px !important;
        padding-inline:10px !important;
    }
    .mobile-bottom-nav a{
        flex:0 0 94px !important;
        min-width:94px !important;
        max-width:94px !important;
    }
}

/* ========================================================================
   BLOC A — FINITION VOYAGEUR / RESPONSIVE
   ======================================================================== */
.next-bus-home{
    padding:18px;
    border:1px solid var(--line);
    border-radius:18px;
    background:linear-gradient(135deg,var(--surface),var(--surface-2));
    box-shadow:var(--shadow);
}
.next-bus-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.next-bus-copy{min-width:0}
.next-bus-head h2{margin:4px 0 0;font-size:21px;font-weight:800;letter-spacing:-.02em}
.next-bus-head p{margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.45}
.next-bus-content{margin-top:14px;min-width:0}
.next-bus-loading,.next-bus-empty{display:grid;gap:6px;padding:14px;border:1px dashed var(--line-strong);border-radius:13px;color:var(--muted);font-size:11px;line-height:1.45}
.next-bus-empty strong{color:var(--text);font-size:12px}
.next-bus-empty.error{color:var(--danger);border-color:rgba(255,42,109,.28)}
.next-bus-empty .ghost-btn{width:max-content;max-width:100%;margin-top:2px}
.next-bus-hero{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:13px;padding:13px;border:1px solid var(--line-strong);border-radius:15px;background:var(--surface-solid)}
.next-bus-line,.next-bus-line-mini{display:grid;place-items:center;background:var(--line-color,#0b63ce);color:#fff;font-weight:900;flex:0 0 auto}
.next-bus-line{width:54px;height:54px;border-radius:14px;font:900 18px/1 var(--font-mono)}
.next-bus-hero-copy{min-width:0;display:grid;gap:2px}
.next-bus-hero-label{color:var(--muted);font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}
.next-bus-hero-copy strong{font:900 26px/1.05 var(--font-mono);color:var(--brand)}
.next-bus-hero-copy>span:not(.next-bus-hero-label){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:800}
.next-bus-hero-copy small{color:var(--muted);font-size:9px}
.next-bus-open-btn{white-space:nowrap}
.next-bus-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
.next-bus-row{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;gap:8px;width:100%;min-width:0;padding:9px 10px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--text);text-align:left;cursor:pointer}
.next-bus-row:hover{border-color:var(--line-strong);transform:translateY(-1px)}
.next-bus-line-mini{width:33px;height:27px;border-radius:8px;font:800 10px/1 var(--font-mono)}
.next-bus-row strong{font:800 12px/1 var(--font-mono)}
.next-bus-row>span:last-child{min-width:0;color:var(--muted);font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.stop-panel-actions-primary{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.stop-panel-actions-primary .ghost-btn{flex:1 1 150px;min-width:0}
.stop-panel-info-row{display:flex;justify-content:space-between;gap:10px;margin-bottom:10px;color:var(--muted);font-size:9px;line-height:1.35}
.stop-panel-info-row span:first-child{color:var(--text)}
.stop-departures-table{display:grid;gap:7px}
.stop-departure-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;min-width:0;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.stop-departure-row .stop-departure-main{min-width:0}
.stop-departure-row .stop-departure-main strong{font-size:15px}
.stop-departure-row .stop-departure-main span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stop-departure-row small{font-size:8px;font-weight:800}
.stop-rt-label{color:var(--success)}
.stop-theory-label{color:var(--muted)}
.stop-departure-route{min-height:34px;padding:0 9px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);font-size:9px;font-weight:800;cursor:pointer;white-space:nowrap}
.stop-departure-route:hover:not(:disabled){border-color:var(--brand);color:var(--brand)}
.stop-departure-route:disabled{opacity:.45;cursor:not-allowed}

/* Timeline : 4 colonnes sur desktop, 3 lignes propres sur mobile. */
.stop-row{grid-template-columns:28px minmax(0,1fr) auto auto}
.stop-row .stop-time{grid-column:3}
.stop-row .stop-time-container{grid-column:3}
.stop-row .stop-track-btn{grid-column:4}
.stop-track-btn{position:relative;z-index:5;align-self:center;min-width:110px;min-height:34px;padding:0 9px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--muted);font-size:9px;font-weight:800;cursor:pointer;white-space:nowrap;transition:.18s ease}
.stop-track-btn:hover:not(:disabled){border-color:var(--brand);color:var(--brand);background:var(--brand-soft)}
.stop-track-btn.is-selected{border-color:rgba(0,255,136,.35);background:rgba(0,255,136,.09);color:var(--success)}
.stop-track-btn:disabled{opacity:.42;cursor:not-allowed}
.stop-track-btn:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.stop-track-btn{touch-action:manipulation;-webkit-tap-highlight-color:transparent}

.trip-follow-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px;margin-top:9px}
.trip-follow-actions .primary-btn,.trip-follow-actions .ghost-btn{min-height:36px}

.trip-tracker{
    position:fixed;
    left:50%;
    bottom:calc(var(--bottom-nav-height) + 14px + env(safe-area-inset-bottom));
    z-index:4800;
    width:min(520px,calc(100vw - 28px));
    transform:translateX(-50%);
    padding:13px 14px;
    border:1px solid var(--line-strong);
    border-radius:16px;
    background:color-mix(in srgb,var(--surface-solid) 95%,transparent);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    box-shadow:var(--shadow),var(--glow-cyan);
    max-height:min(360px,calc(100dvh - var(--bottom-nav-height) - 32px));
    overflow:auto;
    overscroll-behavior:contain;
}
.trip-tracker.is-minimized .trip-tracker-status,
.trip-tracker.is-minimized .trip-tracker-progress,
.trip-tracker.is-minimized .trip-tracker-target,
.trip-tracker.is-minimized #tripTrackerNotificationBtn{display:none}
.trip-tracker-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.trip-tracker-heading{min-width:0}
.trip-tracker-heading strong{display:block;margin-top:3px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.trip-tracker-status{margin-top:9px;color:var(--muted);font-size:10px;line-height:1.4}
.trip-tracker-progress{height:6px;margin-top:10px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.trip-tracker-progress span{display:block;height:100%;width:0;background:var(--brand);transition:width .3s ease}
.trip-tracker-target{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;margin-top:9px;padding-top:9px;border-top:1px solid var(--line);font-size:10px}
.trip-tracker-target span{color:var(--muted)}
.trip-tracker-target strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.trip-tracker-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;margin-top:9px}
.trip-tracker-actions .primary-btn,.trip-tracker-actions .ghost-btn{min-height:36px}

@media (max-width:767.98px){
    .next-bus-home{padding:14px;border-radius:15px}
    .next-bus-head{flex-direction:column;gap:11px}
    .next-bus-head .ghost-btn{width:100%;justify-content:center}
    .next-bus-list{grid-template-columns:1fr}
    .next-bus-hero{grid-template-columns:auto minmax(0,1fr);gap:10px}
    .next-bus-open-btn{grid-column:1 / -1;width:100%;min-height:38px}
    .next-bus-hero-copy strong{font-size:23px}
    .next-bus-row{min-height:38px}

    .stop-panel-actions-primary{display:grid;grid-template-columns:1fr 1fr}
    .stop-panel-actions-primary .ghost-btn{width:100%;min-height:38px}
    .stop-panel-info-row{align-items:flex-start;flex-direction:column;gap:3px}
    .stop-departure-row{grid-template-columns:auto minmax(0,1fr);gap:8px}
    .stop-departure-route{grid-column:1 / -1;width:100%;min-height:38px}

    .stop-row{grid-template-columns:24px minmax(0,1fr);column-gap:9px;row-gap:5px;min-height:0;padding:7px 0}
    .stop-row .rail{grid-column:1;grid-row:1 / span 3}
    .stop-row .stop-row-copy{grid-column:2;grid-row:1;min-width:0}
    .stop-row .stop-time,.stop-row .stop-time-container{grid-column:2;grid-row:2;min-width:0;text-align:left;padding-bottom:0}
    .stop-row .stop-track-btn{grid-column:2;grid-row:3;min-width:0;width:100%;min-height:44px;margin-top:1px;padding-inline:12px;font-size:10px;font-weight:900}
    .stop-row .dot{margin-top:24px}
    .stop-row.bus-near > div:nth-child(2){padding:6px 8px}

    .trip-follow-actions{width:100%;justify-content:stretch}
    .trip-follow-actions .primary-btn,.trip-follow-actions .ghost-btn{flex:1 1 0;min-width:0}

    .trip-tracker{bottom:calc(var(--bottom-nav-height) + 12px + env(safe-area-inset-bottom));width:calc(100vw - 14px);padding:11px 12px;border-radius:14px;z-index:5100;max-height:calc(100dvh - var(--bottom-nav-height) - 28px - env(safe-area-inset-bottom))}
    .trip-tracker-actions{grid-template-columns:minmax(0,1fr) auto}
    .trip-tracker-actions .primary-btn,.trip-tracker-actions .ghost-btn{min-height:38px}
}

@media (max-width:380px){
    .next-bus-home{padding:12px}
    .next-bus-hero{grid-template-columns:1fr 1fr}
    .next-bus-line{width:48px;height:48px}
    .next-bus-hero-copy{grid-column:2}
    .next-bus-hero .next-bus-line{grid-column:1;grid-row:1}
    .next-bus-open-btn{grid-column:1 / -1}
    .stop-panel-actions-primary{grid-template-columns:1fr}
}


/* === Informations voyageurs sur un trajet précis === */
.trip-community-slot{margin:14px 0 0;}
.trip-community-card{border:1px solid var(--line);border-radius:18px;background:var(--surface-2);padding:14px;box-shadow:var(--shadow-sm,0 8px 24px rgba(0,0,0,.08));}
.trip-community-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px;}
.trip-community-head h3{margin:3px 0 4px;font-size:17px;}
.trip-community-head p{margin:0;color:var(--muted);font-size:12px;line-height:1.45;}
.trip-community-scope{flex:0 0 auto;padding:6px 8px;border:1px solid var(--line);border-radius:10px;color:var(--muted);font-size:10px;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.trip-community-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.trip-community-metric{padding:11px 12px;border:1px solid var(--line);border-radius:14px;background:var(--surface-solid);min-width:0;}
.trip-community-metric span,.trip-community-metric small{display:block;color:var(--muted);font-size:11px;}
.trip-community-metric strong{display:block;margin:2px 0;font-size:22px;line-height:1.1;}
.trip-community-badges{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;}
.trip-community-report-badge,.trip-community-neutral{display:inline-flex;align-items:center;gap:5px;padding:6px 9px;border-radius:999px;background:var(--surface-solid);border:1px solid var(--line);font-size:11px;}
.trip-community-report-badge strong{font-size:11px;}
.trip-community-neutral{color:var(--muted);}
.trip-community-recent-list{display:grid;gap:6px;margin-top:10px;}
.trip-community-recent-item{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:8px 10px;border-radius:11px;background:var(--surface-solid);border:1px solid var(--line);font-size:11px;}
.trip-community-recent-main{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.trip-community-recent-main strong{margin-right:4px;}
.trip-community-recent-meta{color:var(--muted);white-space:nowrap;font-size:10px;}
.trip-community-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;}
.trip-community-actions .ghost-btn{min-height:40px;}
.trip-community-compose{margin-top:10px;padding:12px;border:1px solid var(--line-strong);border-radius:14px;background:var(--surface-solid);}
.trip-community-compose-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:10px;}
.trip-community-compose-head strong{font-size:13px;}
.trip-community-compose-head span{font-size:10px;color:var(--muted);text-align:right;}
.trip-community-compose-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.trip-community-compose label{display:grid;gap:5px;font-size:11px;font-weight:700;}
.trip-community-compose label span{color:var(--muted);font-weight:500;}
.trip-community-compose>label{display:grid;gap:5px;margin-top:10px;font-size:11px;font-weight:700;}
.trip-community-form-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px;}
.trip-community-form-hint{margin-right:auto;color:var(--muted);font-size:10px;}
.trip-community-crowd-levels{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-top:10px;}
.trip-community-crowd-btn{min-width:0;min-height:56px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);color:var(--text);display:grid;place-items:center;gap:2px;padding:6px;cursor:pointer;}
.trip-community-crowd-btn strong{font-size:16px;line-height:1;}
.trip-community-crowd-btn span{font-size:9px;color:var(--muted);text-align:center;}
.trip-community-crowd-btn:hover,.trip-community-crowd-btn:focus-visible,.trip-community-crowd-btn.is-active{border-color:var(--accent,#0b63ce);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent,#0b63ce) 14%,transparent);outline:none;}
@media (max-width:767.98px){
  .trip-community-card{padding:12px;border-radius:16px;}
  .trip-community-head{display:block;}
  .trip-community-scope{display:inline-flex;margin-top:8px;max-width:100%;}
  .trip-community-metrics{grid-template-columns:1fr 1fr;gap:7px;}
  .trip-community-metric{padding:10px;}
  .trip-community-metric strong{font-size:20px;}
  .trip-community-actions{display:grid;grid-template-columns:1fr 1fr;}
  .trip-community-actions .ghost-btn{width:100%;font-size:11px;}
  .trip-community-compose-grid{grid-template-columns:1fr;}
  .trip-community-recent-item{align-items:flex-start;flex-direction:column;gap:2px;}
  .trip-community-recent-main{white-space:normal;overflow:visible;}
  .trip-community-crowd-levels{grid-template-columns:repeat(5,1fr);gap:4px;}
  .trip-community-crowd-btn{min-height:54px;padding:4px;}
  .trip-community-crowd-btn span{font-size:8px;line-height:1.05;}
  .trip-community-form-actions{align-items:stretch;flex-wrap:wrap;justify-content:stretch;}
  .trip-community-form-actions>*{flex:1 1 0;}
  .trip-community-form-hint{flex:1 1 100%;order:3;text-align:center;margin:0;}
}

/* Bloc C — infos du départ : mobile/PWA robuste */
#tripCommunity.trip-community-slot{
  position:fixed !important;
  right:calc(10px + env(safe-area-inset-right, 0px));
  top:50%;
  bottom:auto;
  left:auto;
  transform:translate3d(0,-50%,0);
  z-index:5600;
  width:auto;
  margin:0;
  padding:0;
  pointer-events:none;
  contain:layout style;
}

#tripCommunity.trip-community-slot .trip-community-fab{
  pointer-events:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-width:48px;
  min-height:48px;
  padding:0 12px;
  border:1px solid var(--line-strong);
  border-radius:999px;
  background:var(--surface-solid);
  color:var(--text);
  box-shadow:0 12px 30px rgba(0,0,0,.20);
  font:800 10px/1 var(--font-mono);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  user-select:none;
}

#tripCommunity.trip-community-slot .trip-community-fab:hover,
#tripCommunity.trip-community-slot .trip-community-fab:focus-visible{
  border-color:var(--accent,#0b63ce);
  outline:none;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent,#0b63ce) 18%,transparent),0 12px 30px rgba(0,0,0,.20);
}

.trip-community-fab-icon{font-size:16px;line-height:1;color:var(--accent,#0b63ce)}
.trip-community-fab-label{white-space:nowrap}
.trip-community-fab-badge{
  display:grid;
  place-items:center;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:var(--accent,#0b63ce);
  color:#fff;
  font-size:9px;
}

#tripCommunity.trip-community-slot .trip-community-panel{
  pointer-events:auto;
  position:fixed !important;
  right:calc(64px + env(safe-area-inset-right, 0px));
  left:auto;
  top:50%;
  bottom:auto;
  width:min(360px,calc(100vw - 88px));
  max-height:min(66svh,560px);
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  box-sizing:border-box;
  transform:translate3d(0,-50%,0);
  padding:12px;
  border:1px solid var(--line-strong);
  border-radius:16px;
  background:var(--surface-solid);
  color:var(--text);
  box-shadow:0 20px 55px rgba(0,0,0,.28);
  isolation:isolate;
  touch-action:pan-y;
}

#tripCommunity.trip-community-slot .trip-community-panel[hidden],
#tripCommunity.trip-community-slot .trip-community-compose[hidden]{display:none !important}

.trip-community-panel-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:8px}
.trip-community-title-wrap{min-width:0}
.trip-community-title-wrap h3{margin:2px 0 2px;font-size:14px;line-height:1.25}
.trip-community-title-wrap p{margin:0;color:var(--muted);font-size:9px;line-height:1.35}
.trip-community-close{
  width:38px;
  height:38px;
  flex:0 0 38px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface-2);
  color:var(--text);
  font-size:20px;
  line-height:1;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
.trip-community-close:hover,.trip-community-close:focus-visible{border-color:var(--accent,#0b63ce);outline:none}

.trip-community-summary{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.trip-community-metric{min-width:0;padding:8px 9px;border:1px solid var(--line);border-radius:11px;background:var(--surface-2)}
.trip-community-metric span,.trip-community-metric small{display:block;color:var(--muted);font-size:9px}
.trip-community-metric strong{display:block;margin:1px 0;font-size:18px;line-height:1.05}
.trip-community-badges{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}
.trip-community-report-badge,.trip-community-neutral{display:inline-flex;align-items:center;gap:4px;padding:4px 7px;border:1px solid var(--line);border-radius:999px;background:var(--surface-2);font-size:9px}
.trip-community-neutral{color:var(--muted)}
.trip-community-recent-list{display:grid;gap:4px;margin-top:7px;max-height:120px;overflow:auto}
.trip-community-recent-item{display:flex;justify-content:space-between;gap:7px;align-items:center;padding:6px 7px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2);font-size:9px}
.trip-community-recent-main{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.trip-community-recent-main strong{margin-right:3px}
.trip-community-recent-meta{color:var(--muted);white-space:nowrap;font-size:8px}
.trip-community-empty{padding:7px;border:1px dashed var(--line);border-radius:9px;color:var(--muted);font-size:9px;text-align:center}
.trip-community-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}
.trip-community-actions button{min-height:38px;font-size:10px;touch-action:manipulation}
.trip-community-compose{margin-top:7px;padding:8px;border:1px solid var(--line-strong);border-radius:11px;background:var(--surface-2)}
.trip-community-compose-head{display:flex;justify-content:space-between;gap:8px;margin-bottom:6px}
.trip-community-compose-head strong{font-size:10px}
.trip-community-compose-head span{color:var(--muted);font-size:8px;text-align:right}
.trip-community-compose-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.trip-community-compose label{display:grid;gap:4px;margin-top:6px;font-size:9px;font-weight:800}
.trip-community-compose label span{font-weight:500;color:var(--muted)}
.trip-community-crowd-levels{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;margin-top:7px}
.trip-community-crowd-btn{min-height:46px;padding:4px;border:1px solid var(--line);border-radius:9px;background:var(--surface-solid);color:var(--text);cursor:pointer;touch-action:manipulation}
.trip-community-crowd-btn strong{display:block;font-size:14px}
.trip-community-crowd-btn span{display:block;color:var(--muted);font-size:7px;line-height:1.05}
.trip-community-crowd-btn.is-active{border-color:var(--accent,#0b63ce);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent,#0b63ce) 14%,transparent)}
.trip-community-form-actions{display:flex;gap:6px;align-items:center;margin-top:7px}
.trip-community-form-actions>*:first-child{margin-right:auto}
.trip-community-form-hint{color:var(--muted);font-size:8px}

@media(max-width:700px){
  #tripCommunity.trip-community-slot{
    right:calc(8px + env(safe-area-inset-right, 0px));
    z-index:5600;
  }
  #tripCommunity.trip-community-slot .trip-community-fab{
    min-width:48px;
    min-height:48px;
    padding:0 10px;
  }
  #tripCommunity.trip-community-slot .trip-community-panel{
    right:calc(60px + env(safe-area-inset-right, 0px));
    width:min(330px,calc(100vw - 76px));
    max-height:min(64svh,520px);
    padding:10px;
    border-radius:15px;
  }
  .trip-community-fab-label{display:none}
  .trip-community-compose-grid{grid-template-columns:1fr}
  .trip-community-recent-item{align-items:flex-start;flex-direction:column;gap:2px}
  .trip-community-recent-meta{white-space:normal}
}

@media(max-width:380px){
  #tripCommunity.trip-community-slot .trip-community-panel{
    right:calc(58px + env(safe-area-inset-right, 0px));
    width:calc(100vw - 70px);
    max-height:min(62svh,480px);
  }
  .trip-community-summary{grid-template-columns:1fr 1fr}
  .trip-community-crowd-levels{gap:3px}
  .trip-community-crowd-btn span{font-size:6.5px}
}


/* ========================================================================
   ACCES RAPIDE LIGNES — barre fixe au-dessus de la navigation principale
   ======================================================================== */
:root { --quick-route-nav-height: 54px; }

.route-quick-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    z-index: 4990;
    height: var(--quick-route-nav-height);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px max(10px, env(safe-area-inset-left)) 7px max(10px, env(safe-area-inset-right));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-solid) 96%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -7px 22px rgba(0,0,0,.06);
}
.route-quick-nav-label {
    flex: 0 0 auto;
    padding: 0 4px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.route-quick-nav-list {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
}
.route-quick-nav-list::-webkit-scrollbar { display: none; }
.route-quick-nav-loading, .route-quick-nav-empty { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.route-quick-item {
    flex: 0 0 auto;
    min-width: 46px;
    height: 37px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text);
    font: 900 12px/1 var(--font-mono);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.route-quick-item:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.route-quick-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.route-quick-item.active {
    border-color: var(--quick-line-color);
    background: color-mix(in srgb, var(--quick-line-color) 14%, var(--surface-2));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--quick-line-color) 35%, transparent);
}
.route-quick-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--quick-line-color); }
.route-quick-code { letter-spacing: -.02em; }

body { padding-bottom: calc(var(--bottom-nav-height) + var(--quick-route-nav-height) + env(safe-area-inset-bottom)); }

@media (min-width: 768px) {
    :root { --quick-route-nav-height: 56px; }
    .route-quick-nav { padding-inline: max(18px, env(safe-area-inset-left)); }
    .route-quick-nav-list { justify-content: center; }
}
@media (max-width: 767.98px) {
    :root { --quick-route-nav-height: 52px; }
    .route-quick-nav { gap: 7px; padding-inline: 8px; }
    .route-quick-nav-item { min-width: 44px; }
    .route-quick-nav-label { padding: 0 2px; }
}
@media (max-width: 380px) {
    .route-quick-nav-label { display: none; }
    .route-quick-item { min-width: 43px; padding-inline: 9px; }
}

/* ========================================================================
   BARRE INFO FIXE — météo + perturbations globales
   ======================================================================== */
:root { --topbar-height: 68px; --network-info-height: 58px; }
.topbar { top: 0; }
.network-info-banner {
    position: sticky;
    top: var(--topbar-height);
    z-index: 1750;
    display: grid;
    grid-template-columns: minmax(280px,.9fr) minmax(360px,1.4fr);
    width: 100%;
    min-height: var(--network-info-height);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 5px 18px rgba(0,0,0,.10);
}
.network-info-weather,
.network-info-alerts {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
}
.network-info-weather {
    border-right: 1px solid var(--line);
}
.network-info-alerts {
    appearance: none;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.network-info-alerts:hover { background: var(--brand-soft); }
.network-info-weather-icon,
.network-info-alert-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 18px;
}
.network-info-alert-icon { color: var(--warning); }
.network-info-alert-count {
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-2);
    font: 900 10px/1 var(--font-mono);
}
.network-info-alert-count.has-alerts { color: var(--danger); border-color: rgba(255,42,109,.3); background: rgba(255,42,109,.07); }
.network-info-weather-main,
.network-info-alert-main { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.network-info-kicker {
    margin-bottom: 2px;
    color: var(--brand);
    font: 800 8px/1.2 var(--font-mono);
    letter-spacing: .10em;
    text-transform: uppercase;
}
.network-info-weather-line {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}
.network-info-weather-line strong {
    flex: 0 0 auto;
    font: 900 18px/1 var(--font-mono);
    letter-spacing: -.04em;
}
.network-info-weather-line span,
.network-info-alert-main strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.network-info-weather-line span { color: var(--text); font-size: 11px; font-weight: 700; }
.network-info-weather-main small,
.network-info-alert-main small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 9px;
}
.network-info-alert-main strong { display: block; font-size: 11px; line-height: 1.25; }
.network-info-source {
    flex: 0 0 auto;
    align-self: flex-end;
    margin-bottom: 1px;
    color: var(--muted);
    font: 700 8px/1.2 var(--font-mono);
}
.network-info-source.is-stale { color: var(--warning); }
.network-info-alert-arrow { color: var(--brand); font: 900 16px/1 var(--font-mono); }

@media (max-width: 767.98px) {
    :root { --topbar-height: 60px; --network-info-height: 44px; }
    .network-info-banner {
        grid-template-columns: minmax(74px,.38fr) minmax(0,1.62fr);
        min-height: var(--network-info-height);
    }
    .network-info-weather,
    .network-info-alerts { padding: 4px 8px; gap: 6px; }
    .network-info-weather { justify-content: center; }
    .network-info-weather-icon,
    .network-info-alert-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; font-size: 15px; }
    .network-info-kicker,
    #networkWeatherDesc,
    #networkWeatherMeta,
    #networkWeatherSource { display: none !important; }
    .network-info-weather-main { flex: 0 0 auto; }
    .network-info-weather-line { gap: 0; }
    .network-info-weather-line strong { font-size: 15px; }
    .network-info-source { display: none; }
    .network-info-alert-main strong { font-size: 10px; line-height: 1.15; }
    .network-info-alert-main small { font-size: 7px; margin-top: 1px; }
    .network-info-alert-count { min-width: 23px; height: 23px; padding: 0 5px; }
    .network-info-alert-arrow { font-size: 13px; }
}
@media (max-width: 420px) {
    .network-info-weather { min-width: 0; }
    .network-info-weather-icon { width: 26px; height: 26px; flex-basis: 26px; font-size: 14px; }
    .network-info-weather-line strong { font-size: 14px; }
    .network-info-alert-main small { display: none; }
    .network-info-alert-main strong { font-size: 9.5px; }
    .network-info-alert-count { min-width: 22px; height: 22px; }
}

/* Google Play / statut indépendant : information visible dès l'accueil. */
.compliance-notice{position:relative}
.compliance-notice-card{padding:18px 20px;border:1px solid color-mix(in srgb,var(--brand) 30%,var(--line));border-radius:18px;background:linear-gradient(180deg,color-mix(in srgb,var(--brand) 7%,var(--surface-solid)),var(--surface-solid));box-shadow:var(--shadow);}
.compliance-notice-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.compliance-notice-head h2{margin:3px 0 0;font-size:clamp(17px,2.4vw,22px)}
.compliance-notice-badge{display:grid;place-items:center;min-width:34px;height:34px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);font-size:17px}
.compliance-notice-card p{margin:12px 0 0;color:var(--muted);font-size:12px;line-height:1.65}
.compliance-notice-card p strong{color:var(--text)}
.compliance-notice-source-intro{margin-top:8px!important}
.compliance-notice-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
.compliance-notice-links a{display:flex;flex-direction:column;gap:4px;padding:11px 12px;border:1px solid var(--line);border-radius:13px;background:var(--surface-2);color:var(--text);text-decoration:none;transition:transform .15s ease,border-color .15s ease,background .15s ease}
.compliance-notice-links a:hover{transform:translateY(-1px);border-color:var(--line-strong);background:var(--surface-solid)}
.compliance-notice-links a span{font-size:12px;font-weight:800}
.compliance-notice-links a small{color:var(--muted);font-size:10px}
@media(max-width:767.98px){
  .compliance-notice-card{padding:15px 14px;border-radius:16px}
  .compliance-notice-links{grid-template-columns:1fr}
}


/* ========================================================================
   CORRECTION PC + MOBILE — BARRES FIXES / NOTIFICATIONS / CARTES
   ======================================================================== */
:root { --desktop-quick-nav-height: 56px; }

/* La navigation principale reste fixe en bas ; la barre des lignes se place juste au-dessus. */
@media (min-width: 768px) {
    .mobile-bottom-nav { display:flex !important; }
    .route-quick-nav {
        bottom: var(--bottom-nav-height);
        height: var(--desktop-quick-nav-height);
    }
    body {
        padding-bottom: calc(var(--bottom-nav-height) + var(--desktop-quick-nav-height));
    }
    .toast-host {
        bottom: calc(var(--bottom-nav-height) + var(--desktop-quick-nav-height) + 14px);
        z-index: 6200;
    }
    .map-legend-card {
        bottom: calc(var(--bottom-nav-height) + var(--desktop-quick-nav-height) + 14px);
    }
}

@media (max-width: 767.98px) {
    .route-quick-nav {
        bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        z-index: 4990;
    }
    .mobile-bottom-nav {
        display:flex !important;
        flex-flow:row nowrap !important;
        bottom: 0;
        z-index: 5000;
    }
    body {
        padding-bottom: calc(var(--bottom-nav-height) + var(--quick-route-nav-height) + env(safe-area-inset-bottom));
    }
    .toast-host {
        bottom: calc(var(--bottom-nav-height) + var(--quick-route-nav-height) + 12px + env(safe-area-inset-bottom));
        z-index: 6200;
    }
    .map-legend-card {
        bottom: calc(var(--bottom-nav-height) + var(--quick-route-nav-height) + 10px + env(safe-area-inset-bottom));
    }
    .trip-tracker {
        bottom: calc(var(--bottom-nav-height) + var(--quick-route-nav-height) + 12px + env(safe-area-inset-bottom));
        max-height: calc(100dvh - var(--bottom-nav-height) - var(--quick-route-nav-height) - 28px - env(safe-area-inset-bottom));
    }
}

/* Les actions d'une ligne restent utilisables même sur les écrans PC moyens. */
.line-member-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}
.line-member-actions .line-member-btn,
.line-member-actions .line-alerts-wrap { flex: 0 0 auto; }

@media (max-width: 1100px) and (min-width: 761px) {
    .line-header-main { align-items: flex-start; flex-direction: column; }
    .line-member-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 760px) {
    .line-member-actions { width: 100%; justify-content: stretch; }
    .line-member-actions .line-member-btn { flex: 1 1 calc(50% - 7px); min-width: 0; }
    .line-member-actions .line-alerts-wrap { flex: 1 1 100%; }
}

/* Popups véhicules / tracés : lisibles sur PC comme sur mobile. */
.bus-popup { display: grid; gap: 5px; min-width: 190px; }
.bus-popup-line { color: var(--bus-line-color, var(--brand)); font: 900 12px/1.2 var(--font-mono); }
.bus-popup-meta { color: var(--muted); font-size: 10px; line-height: 1.35; }
.bus-popup-delay { color: var(--danger); font: 800 10px/1.35 var(--font-mono); }
.bus-popup-link { margin-top: 3px; color: var(--brand); font-size: 10px; font-weight: 800; }
.map-shape-popup-list { display: grid; gap: 4px; margin-top: 6px; font-size: 10px; line-height: 1.35; }
.bus-marker { filter: drop-shadow(0 4px 7px rgba(0,0,0,.28)); }

/* Annonce Google Play, créée uniquement sur Android. */
#androidStoreModal { z-index: 7000; }
body:has(#androidStoreModal.show) .modal-backdrop { z-index: 6990; }
.android-store-card {
    background: var(--surface-solid);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}
.android-store-card .modal-header { border: 0; padding: 20px 22px 0; }
.android-store-card .btn-close { filter: invert(1); }
html[data-theme="light"] .android-store-card .btn-close { filter: none; }
.android-store-card .modal-body { padding: 20px 24px 26px; text-align: center; }
.android-store-icon { border-radius: 18px; margin-bottom: 18px; }
.android-store-card h2 { font-size: 25px; font-weight: 800; line-height: 1.25; margin: 0 0 12px; }
.android-store-card p { color: var(--muted); line-height: 1.65; margin: 0 0 24px; }
.android-store-download, .android-store-later { display: flex; width: 100%; justify-content: center; gap: 8px; }
.android-store-later { margin-top: 10px; }
.android-store-remember { display: flex; justify-content: center; align-items: flex-start; gap: 10px; margin-top: 22px; color: var(--muted); font-size: 12px; cursor: pointer; }
.android-store-remember input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand); }
