:root {
  --blue: #0b5fa5;
  --blue-soft: #e7f1fa;
  --ink: #16212c;
  --muted: #5b6b7a;
  --line: #e3e8ee;
  --bg: #ffffff;
  --bg-2: #f5f7fa;
  --ok: #1a8f4c;
  --warn: #b26a00;
  --shadow: 0 8px 30px rgba(16, 33, 52, .16);
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #5aa9e6;
    --blue-soft: #16304a;
    --ink: #e8eef4;
    --muted: #9aabbb;
    --line: #2a3644;
    --bg: #141b23;
    --bg-2: #1b2430;
    --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --blue: #5aa9e6;
  --blue-soft: #16304a;
  --ink: #e8eef4;
  --muted: #9aabbb;
  --line: #2a3644;
  --bg: #141b23;
  --bg-2: #1b2430;
  --shadow: 0 8px 30px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }

#map { position: fixed; inset: 0; z-index: 0; background: #dde3e8; }

/* ---------- Panneau ---------- */
.panel {
  position: fixed; z-index: 500;
  top: 16px; left: 16px; bottom: 16px; width: 360px;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.sheet-handle { display: none; }
.panel-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 19px; margin: 0; letter-spacing: -.01em; }
.install-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 99px; padding: 6px 12px 6px 9px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 600; }
.install-btn[hidden] { display: none; }
.install-btn svg { width: 16px; height: 16px; }
.install-help { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 16, 24, .55); display: grid; place-items: center; padding: 16px; }
.install-help[hidden] { display: none; }
.install-box { background: var(--bg); color: var(--ink); border-radius: 16px; padding: 20px; max-width: 360px; box-shadow: var(--shadow); }
.install-box h2 { margin: 0 0 8px; font-size: 17px; }
.install-box p { margin: 0 0 16px; font-size: 15px; line-height: 1.45; }
.install-ok { width: 100%; border: 0; border-radius: 10px; padding: 11px; background: var(--blue); color: #fff; font-weight: 700; font-size: 15px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.status { margin-top: 6px; font-size: 13px; color: var(--muted); }
.status .tag { display: inline-block; padding: 1px 7px; border-radius: 99px; background: #fff1d6; color: var(--warn); font-weight: 600; font-size: 11px; margin-right: 6px; }
.status.err { color: #c0392b; }

.view { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.view[hidden] { display: none; }

.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 44px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); position: sticky; top: -12px; z-index: 2; box-shadow: 0 -12px 0 0 var(--bg), 0 0 0 10px var(--bg); }
.search:focus-within { border-color: var(--blue); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); min-width: 0; }

.route-list { list-style: none; margin: 10px 0 0; padding: 0; }
.route-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 8px; border: 0; background: none; border-radius: 10px; text-align: left; }
.route-item:hover, .route-item:focus-visible { background: var(--bg-2); outline: none; }
.route-item .name { font-size: 14px; line-height: 1.3; }
.route-item .count { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 28px; padding: 0 8px; border-radius: 7px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; flex: none; }
.all-pill { background: var(--ink); color: var(--bg); }
.all-pill svg { width: 18px; height: 18px; fill: currentColor; }
.route-item .name small { display: block; font-size: 12px; color: var(--muted); }
.all-routes.active { background: var(--blue-soft); }
.all-routes.active .all-pill { background: var(--blue); color: #fff; }
.all-routes { border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; margin-bottom: 4px; }
.pill.sm { min-width: 34px; height: 22px; font-size: 12px; border-radius: 5px; padding: 0 5px; }

.nearby { margin: 12px 0 4px; padding: 12px; border-radius: 12px; background: var(--blue-soft); }
.nearby h2 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); }
.nearby-stop { display: block; width: 100%; padding: 8px 0; border: 0; border-top: 1px solid color-mix(in srgb, var(--blue) 15%, transparent); background: none; text-align: left; }
.nearby-stop:first-of-type { border-top: 0; }
.nearby-stop .sname { font-size: 14px; font-weight: 600; }
.nearby-stop .dist { font-size: 12px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chips button { border: 0; }

.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--blue); padding: 4px 6px 4px 0; font-size: 14px; font-weight: 600; }
.route-head { display: flex; align-items: center; gap: 12px; margin: 12px 0 14px; }
.route-head .pill { min-width: 56px; height: 38px; font-size: 18px; border-radius: 9px; }
.route-head h2 { margin: 0; font-size: 17px; line-height: 1.25; }

.directions { display: flex; gap: 6px; padding: 4px; border-radius: 11px; background: var(--bg-2); }
.directions button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.directions button[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.route-meta { font-size: 13px; color: var(--muted); margin: 12px 4px 4px; }

.stop-list { list-style: none; margin: 4px 0 0; padding: 0 0 0 6px; }
.stop-list li { position: relative; }
.stop-list button { display: block; width: 100%; padding: 8px 8px 8px 26px; border: 0; background: none; text-align: left; font-size: 14px; border-radius: 8px; }
.stop-list button:hover { background: var(--bg-2); }
.stop-list li::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 4px; background: var(--route, var(--blue)); }
.stop-list li:first-child::before { top: 50%; }
.stop-list li:last-child::before { bottom: 50%; }
.stop-list li::after { content: ""; position: absolute; left: 5px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--bg); border: 3px solid var(--route, var(--blue)); box-sizing: border-box; }
.stop-list .code { color: var(--muted); font-size: 12px; margin-left: 6px; }

/* ---------- Prochains passages ---------- */
.next-card { position: fixed; z-index: 600; top: 16px; left: 392px; width: 380px; max-width: calc(100vw - 408px); }
.next-find { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 16px; border: 0; border-radius: 99px; background: var(--bg); color: var(--blue); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); text-align: left; }
.next-find[hidden] { display: none; }
#next-body { background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px 8px; }
.next-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.next-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.next-stop { display: block; font-size: 15px; margin-top: 2px; }
.next-code { font-size: 12px; color: var(--muted); }
.next-close { border: 0; background: var(--bg-2); width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--muted); flex: none; }
.next-list { list-style: none; margin: 8px 0 0; padding: 0; }
.next-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; width: 100%; padding: 7px 4px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; border-radius: 0; }
.next-row:hover { background: var(--bg-2); }
.next-dest { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
.wait { min-width: 56px; text-align: right; font-size: 12px; color: var(--muted); }
.wait b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.wait.now { color: var(--ok); font-weight: 700; }
.next-empty { font-size: 13px; color: var(--muted); margin: 8px 0 6px; }
.sname-btn { border: 0; background: none; padding: 0; text-align: left; color: inherit; }

/* ---------- Favoris, recherche d'arrêts ---------- */
.favs, .stop-results { margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); }
.favs h2, .stop-results h2 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); }
.favs[hidden], .stop-results[hidden] { display: none; }
.stop-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; padding: 8px 2px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.stop-row:first-of-type { border-top: 0; }
.stop-row .sname { font-size: 14px; font-weight: 600; }
.stop-row .scode { font-size: 12px; color: var(--muted); align-self: center; }
.stop-row .chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.fav-next { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.fav-soon { display: inline-flex; align-items: center; gap: 5px; }
.muted { color: var(--muted); font-size: 12px; }
.next-actions { display: flex; gap: 6px; flex: none; }
.fav-btn { border: 0; background: var(--bg-2); width: 28px; height: 28px; border-radius: 50%; font-size: 17px; line-height: 1; color: var(--muted); }
.fav-btn.on { color: #e8a200; }

/* ---------- Avis de service ---------- */
.warn { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; background: #e8a200; color: #fff; font: 800 11px/1 system-ui, sans-serif; vertical-align: 1px; flex: none; }
.alerts { margin: 0 0 12px; display: grid; gap: 6px; }
.alerts[hidden] { display: none; }
.alerts.in-card { margin: 8px 0 0; }
.alert { border-radius: 10px; background: color-mix(in srgb, #e8a200 14%, var(--bg)); border: 1px solid color-mix(in srgb, #e8a200 40%, transparent); padding: 8px 10px; font-size: 13px; }
.alert summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; list-style: none; }
.alert summary::-webkit-details-marker { display: none; }
.alert summary .warn { margin-left: 0; }
.alert p { margin: 6px 0 0; color: var(--ink); line-height: 1.4; white-space: pre-line; }
.alert .alert-stops { color: var(--muted); font-size: 12px; }
.stop-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 18px; vertical-align: 1px; }
.stop-tag.moved { background: #fbe9c2; color: #8a5a00; }
.stop-tag.cancel { background: #f6d5d2; color: #a3241b; }
.stop-list li.cancel button { text-decoration: line-through; text-decoration-color: #d0352b; }
.stop-list li.cancel::after { border-color: #d0352b !important; }
.stop-list li.moved::after { border-color: #e8a200 !important; }

/* ---------- Achalandage, suivi ---------- */
.occ { display: inline-flex; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--muted); }
.occ i { width: 4px; border-radius: 1px; background: var(--line); }
.occ i:nth-child(1) { height: 6px; } .occ i:nth-child(2) { height: 9px; } .occ i:nth-child(3) { height: 12px; margin-right: 5px; }
.occ-1 i.on { background: var(--ok); } .occ-2 i.on { background: #e8a200; } .occ-3 i.on { background: #d0352b; }
.follow-chip { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 8px 8px 12px; border-radius: 99px; background: var(--bg); box-shadow: var(--shadow); font-size: 13px; }
.follow-chip[hidden] { display: none; }
.follow-chip > span:not(.pill):not(.occ) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-chip button { border: 0; background: var(--bg-2); width: 26px; height: 26px; border-radius: 50%; font-size: 16px; line-height: 1; color: var(--muted); flex: none; }

/* ---------- Boutons carte ---------- */
.map-buttons { position: fixed; right: 16px; bottom: 32px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.fab { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--bg); color: var(--blue); box-shadow: var(--shadow); display: grid; place-items: center; }
.fab svg { width: 24px; height: 24px; }
.fab.active { background: var(--blue); color: #fff; }

/* ---------- Marqueurs ---------- */
.bus-icon { background: none; border: 0; }
.bus-marker { position: relative; }
.bus-marker .pill-bus { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: 21px; border-radius: 11px; background: var(--c); color: var(--t); border: 2px solid #fff; box-sizing: border-box; font: 800 11.5px/17px system-ui, sans-serif; text-align: center; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.bus-marker .tip { position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -5px 0 0 -5px; border: 5px solid transparent; border-bottom: 7px solid var(--c); border-top: 0; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); transition: transform .8s; }
.bus-marker.small .pill-bus { height: 17px; font-size: 10px; line-height: 13px; border-width: 1.5px; }
.bus-marker.small .tip { margin: -4px 0 0 -4px; border-width: 0 4px 6px; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #1e88e5; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(30,136,229,.25); }

.leaflet-popup-content { font-size: 13px; line-height: 1.45; margin: 10px 14px; }
.leaflet-popup-content strong { font-size: 14px; }
.popup-link { border: 0; background: none; color: var(--blue); padding: 0; margin-top: 4px; font-weight: 600; }
.leaflet-control-zoom { display: none; }

/* ---------- Mobile : panneau en feuille du bas ---------- */
@media (max-width: 720px) {
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: min(46vh, var(--sheet-max, 46vh)); border-radius: 18px 18px 0 0; transition: height .25s ease; padding-bottom: env(safe-area-inset-bottom); }
  .panel.collapsed { height: 132px; }
  .panel.expanded { height: var(--sheet-max, 88vh); }
  .sheet-handle { display: block; flex: none; width: 100%; height: 22px; border: 0; background: none; position: relative; }
  .sheet-handle::after { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line); }
  .panel-head { padding: 0 16px 10px; touch-action: none; cursor: grab; user-select: none; }
  .sheet-handle { touch-action: none; cursor: grab; }
  .next-card { top: 10px; left: 10px; right: 10px; width: auto; max-width: none; }
  .map-buttons { bottom: calc(46vh + 14px); right: 12px; transition: bottom .25s ease; }
  body.sheet-collapsed .map-buttons { bottom: 146px; }
  body.sheet-expanded .map-buttons { display: none; }
}


/* ======================================================================
   Nouveautés : retards, horaires, alertes, itinéraire, métro, réglages
   ====================================================================== */

/* Fond de carte : « sobre » (gris clair, pour que les lignes ressortent) ou « standard » */
:root { --tile-filter: grayscale(.85) brightness(1.07) contrast(.82); }
:root[data-map="standard"] { --tile-filter: saturate(.85); }
.leaflet-tile-pane { filter: var(--tile-filter); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tile-filter: invert(1) hue-rotate(180deg) grayscale(.75) brightness(.8) contrast(.92); }
  :root[data-map="standard"]:not([data-theme="light"]) { --tile-filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }
  :root:not([data-theme="light"]) #map { background: #1a2028; }
}
:root[data-theme="dark"] { --tile-filter: invert(1) hue-rotate(180deg) grayscale(.75) brightness(.8) contrast(.92); }
:root[data-theme="dark"][data-map="standard"] { --tile-filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }
:root[data-theme="dark"] #map { background: #1a2028; }

/* Accessibilité */
.skip-link { position: fixed; left: 8px; top: -60px; z-index: 3000; background: var(--blue); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pill:focus-visible, .route-item:focus-visible { outline-offset: -3px; }
:root[data-text="large"] .panel, :root[data-text="large"] .next-card, :root[data-text="large"] .install-box { zoom: 1.15; }
:root[data-text="xlarge"] .panel, :root[data-text="xlarge"] .next-card, :root[data-text="xlarge"] .install-box { zoom: 1.3; }
:root[data-contrast="high"] { --ink: #000; --muted: #2b3540; --line: #6b7785; --blue: #00478a; --bg-2: #eef1f4; }
@media (prefers-color-scheme: dark) { :root[data-contrast="high"]:not([data-theme="light"]) { --ink: #fff; --muted: #d5dde6; --line: #8a97a6; --blue: #8cc4ff; --bg-2: #232e3b; } }
:root[data-contrast="high"][data-theme="dark"] { --ink: #fff; --muted: #d5dde6; --line: #8a97a6; --blue: #8cc4ff; --bg-2: #232e3b; }
:root[data-contrast="high"] .pill, :root[data-contrast="high"] .pill-bus { outline: 2px solid #000; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Retards */
.delay { font-weight: 700; font-size: 12px; }
.delay.late { color: #c62828; } .delay.early { color: #b26a00; } .delay.ontime { color: var(--ok); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .delay.late { color: #ff7b72; } :root:not([data-theme="light"]) .delay.early { color: #f0b44c; } }
:root[data-theme="dark"] .delay.late { color: #ff7b72; } :root[data-theme="dark"] .delay.early { color: #f0b44c; }
.leaflet-popup-content .delay.late { color: #c62828; } .leaflet-popup-content .delay.early { color: #b26a00; } .leaflet-popup-content .delay.ontime { color: #1a8f4c; }
.next-time { flex-wrap: wrap; justify-content: flex-end; }
.next-time small { flex-basis: 100%; text-align: right; font-size: 11px; line-height: 1.1; }
.next-item { display: flex; align-items: center; list-style: none; }
.next-item .next-row { flex: 1; min-width: 0; }
.next-item.sched .next-row { opacity: .72; }
.next-item.sched .next-time small { font-style: italic; }
.next-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.next-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.link-btn { border: 0; background: none; padding: 2px 0; color: var(--blue); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.detour-note { margin: -4px 0 10px; padding: 6px 10px; border-left: 4px solid #ffb300; background: color-mix(in srgb, #ffb300 14%, transparent); font-size: 12.5px; border-radius: 4px; }
.detour-note[hidden] { display: none; }

/* Boutons ronds (partager, cloche, outils) */
.icon-btn { border: 0; background: var(--bg-2); width: 28px; height: 28px; border-radius: 50%; color: var(--muted); display: inline-grid; place-items: center; flex: none; padding: 0; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--blue); }
.route-head .icon-btn { margin-left: auto; }
.bell { border: 0; background: none; color: var(--muted); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; flex: none; padding: 0; }
.bell svg { width: 17px; height: 17px; }
.bell.on { color: #fff; background: var(--blue); }

/* Tri des favoris */
.favs h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fav-sort { font-size: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 2px 4px; text-transform: none; letter-spacing: 0; max-width: 55%; }

/* Message temporaire */
.toast { position: fixed; z-index: 2500; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(92vw, 460px); background: #16212c; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; line-height: 1.35; box-shadow: var(--shadow); text-align: center; }
.toast[hidden] { display: none; }
@media (max-width: 720px) { .toast { bottom: auto; top: calc(env(safe-area-inset-top) + 12px); } }

/* Boutons de carte : réglages, métro */
.fab-metro span { font: 800 20px/1 system-ui, sans-serif; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; }
.fab-metro.active { background: var(--blue); }
.fab-metro.active span { background: #fff; color: var(--blue); }

/* Réglages */
.settings-box { width: min(92vw, 380px); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; font-size: 15px; }
.set-row select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); max-width: 55%; }
.set-row.check { justify-content: flex-start; }
.set-row.check input { width: 20px; height: 20px; }

/* Itinéraire */
.plan-open { display: flex; align-items: center; gap: 8px; width: 100%; margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--blue); font-weight: 700; font-size: 14px; text-align: left; }
.plan-open svg { width: 18px; height: 18px; }
.plan-title { margin: 8px 0 10px; font-size: 18px; }
.plan-form { display: grid; gap: 8px; }
.plan-field { display: flex; align-items: center; gap: 8px; padding: 0 8px; height: 44px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.plan-field:focus-within { border-color: var(--blue); }
.plan-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); }
.plan-dot, .plan-pin { display: grid; place-items: center; font-weight: 800; color: #fff; border-radius: 50%; flex: none; }
.plan-dot { width: 22px; height: 22px; font-size: 12px; }
.plan-dot.a, .plan-pin.a { background: #1a8f4c; } .plan-dot.b, .plan-pin.b { background: #c62828; }
.plan-pin { width: 28px; height: 28px; font-size: 14px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
#plan-pick { justify-self: start; }
.plan-results { margin-top: 12px; display: grid; gap: 10px; }
.plan-opt { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); }
.plan-opt.sel { border-color: var(--blue); background: var(--blue-soft); }
.plan-opt-head { display: flex; align-items: center; gap: 10px; }
.plan-opt-dest { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-opt-total { font-size: 13px; color: var(--muted); } .plan-opt-total b { font-size: 20px; color: var(--ink); }
.plan-steps { list-style: none; margin: 8px 0 4px; padding: 0; font-size: 13px; display: grid; gap: 4px; }
.plan-steps li, .plan-walk { display: flex; gap: 8px; align-items: baseline; }
.plan-steps em, .plan-walk em { flex: none; min-width: 66px; font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--blue); }
.plan-arrive { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.plan-walk { padding: 8px 12px; border-radius: 12px; background: var(--bg-2); font-size: 13px; }

.brand-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.brand-tools .install-btn { margin-left: 0; }
.head-gear { border: 0; background: var(--bg-2); color: var(--muted); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.head-gear svg { width: 18px; height: 18px; }
.head-gear:hover { color: var(--blue); }

/* Lignes favorites */
.route-li { display: flex; align-items: center; gap: 2px; }
.route-li .route-item { flex: 1; min-width: 0; }
.route-star, .route-star-head { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; padding: 0; }
.route-star:hover { background: var(--bg-2); }
.route-star.on, .route-star-head.on { color: #e8a200; }
.route-star-head { font-size: 18px; width: 28px; height: 28px; background: var(--bg-2); margin-left: auto; }
.route-head .route-star-head + .icon-btn { margin-left: 0; }
.fav-toggle { list-style: none; margin: 0 0 4px; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.fav-toggle label { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.fav-toggle label:hover { background: var(--bg-2); }
.fav-toggle-text { font-weight: 700; font-size: 14px; }
.fav-toggle-text small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
.fav-toggle-star { color: #e8a200; margin-right: 8px; font-size: 18px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 13px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .2s; }
.switch:checked { background: var(--blue); }
.switch:checked::after { transform: translateX(20px); }

/* Étiquette de numéro de ligne sur le tracé */
.line-label { background: none; border: 0; }
.line-label span { display: inline-block; transform: translate(-50%, -50%); min-width: 30px; padding: 2px 7px; border-radius: 11px; border: 2px solid #fff; background: var(--c); color: var(--t); font: 800 13px/1.2 system-ui, sans-serif; text-align: center; box-shadow: 0 1px 5px rgba(0,0,0,.45); white-space: nowrap; }

/* ======================================================================
   Pastilles d'autobus plus grosses, prochain bus, avis repliés, mobile
   ====================================================================== */
.bus-marker .pill-bus { height: 27px; border-radius: 14px; border-width: 2.5px; font: 800 14px/22px system-ui, sans-serif; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.bus-marker .tip { margin: -6px 0 0 -6.5px; border: 6.5px solid transparent; border-bottom: 9px solid var(--c); border-top: 0; }
.bus-marker.small .pill-bus { height: 23px; font-size: 12.5px; line-height: 19px; border-width: 2px; }
.bus-marker.small .tip { margin: -5px 0 0 -5.5px; border-width: 0 5.5px 8px; }

/* Anneau qui pulse autour du prochain bus attendu à l'arrêt */
.next-ring { background: none; border: 0; }
.next-ring i { position: absolute; left: -27px; top: -27px; width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); animation: ring 1.8s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.55); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

/* Prochain bus (en gros dans la carte de l'arrêt) */
.pill.lg { min-width: 54px; height: 36px; font-size: 18px; border-radius: 9px; }
.next-hero { margin-top: 10px; padding: 8px 10px 6px; border-radius: 12px; background: color-mix(in srgb, var(--c) 9%, var(--bg-2)); border-left: 5px solid var(--c); }
.next-hero.sched { border-left-style: dashed; }
.hero-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.hero-line { display: flex; align-items: center; gap: 8px; }
.hero-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.hero-txt { min-width: 0; display: grid; }
.hero-txt b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-txt small { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hero-txt .live { display: inline-block; margin-left: 4px; }
.hero-wait { min-width: 0; flex: none; font-size: 13px; }
.hero-wait b { font-size: 30px; line-height: 1; }
.hero-wait.now { font-size: 15px; }
.hero-foot { display: flex; align-items: center; gap: 8px; min-height: 34px; margin-top: 2px; }
.hero-sp { flex: 1; }
.hero-follow { border: 0; border-radius: 99px; background: var(--blue); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 14px; }

/* Sections repliables */
.chev { width: 18px; height: 18px; fill: currentColor; flex: none; transition: transform .2s; margin-left: auto; }
details[open] > summary .chev { transform: rotate(180deg); }
.next-more { margin-top: 6px; }
.next-more > summary { display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; padding: 8px 2px; font-size: 13px; font-weight: 600; color: var(--blue); }
.next-more > summary::-webkit-details-marker, .avis > summary::-webkit-details-marker { display: none; }
.next-more .next-list { margin-top: 0; }

/* Avis et travaux : bouton « cône orange » */
.avis > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; min-height: 42px; padding: 4px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; color: var(--ink); background: color-mix(in srgb, #f47b20 13%, var(--bg)); border: 1px solid color-mix(in srgb, #f47b20 45%, transparent); user-select: none; }
.avis .cone { width: 24px; height: 24px; flex: none; }
.avis-n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #f47b20; color: #fff; font-size: 12.5px; display: inline-grid; place-items: center; }
.avis-body { display: grid; gap: 6px; margin-top: 6px; }
.avis-body .detour-note { margin: 0; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .next-card { top: calc(env(safe-area-inset-top) + 8px); left: 8px; right: 8px; }
  #next-body { padding: 10px 12px 6px; max-height: 62vh; overflow-y: auto; overscroll-behavior: contain; }
  .next-find { padding: 13px 16px; font-size: 15px; }
  /* Cibles tactiles plus grandes */
  .icon-btn, .fav-btn, .next-close, .route-star-head { width: 38px; height: 38px; }
  .icon-btn svg { width: 19px; height: 19px; }
  .fav-btn, .route-star-head { font-size: 21px; }
  .next-close { font-size: 22px; }
  .bell { width: 40px; height: 40px; } .bell svg { width: 20px; height: 20px; }
  .back { padding: 9px 10px 9px 0; font-size: 15px; }
  .next-row { padding: 10px 4px; }
  .popup-link { padding: 7px 0; font-size: 15px; display: inline-block; }
  .leaflet-popup-content { font-size: 14px; }
  .link-btn { padding: 8px 0; }
  .fab { width: 52px; height: 52px; }
  .route-star { width: 46px; height: 46px; font-size: 24px; }
  .stop-list li { min-height: 44px; }
  /* 16 px : sinon l'iPhone zoome dans la page quand on tape dans un champ */
  .search input, .plan-field input, select, input[type="search"] { font-size: 16px; }
  /* Vue d'une ligne : l'en-tête « Bus en direct » laisse la place au nom de la ligne */
  .panel:has(#view-route:not([hidden])) .panel-head, .panel:has(#view-plan:not([hidden])) .panel-head { display: none; }
  .panel:has(#view-route:not([hidden])) .sheet-handle, .panel:has(#view-plan:not([hidden])) .sheet-handle { height: 26px; }
  #view-plan { padding-top: 0; }
  .plan-results { scroll-margin-top: 6px; }
  #view-route { padding-top: 0; }
  #view-route .back { position: relative; }
  .route-head { margin: 2px 0 10px; touch-action: none; user-select: none; }
  .sheet-handle::after { width: 44px; }
  .panel.collapsed { height: 124px; }
  body.sheet-collapsed .map-buttons { bottom: 138px; }
}

/* ---------- Itinéraire : étapes détaillées ---------- */
.plan-opt { cursor: pointer; }
.plan-chain { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.plan-chain .pill.sm, .leg .pill.sm { min-width: 40px; height: 26px; font-size: 14px; border-radius: 7px; }
.pill.metro { border-radius: 99px !important; }
.chain-sep { color: var(--muted); font-weight: 700; }
.plan-opt .plan-arrive { border-top: 0; padding-top: 2px; margin-top: 2px; }
.plan-legs { list-style: none; margin: 10px 0 2px; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; }
.leg { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: start; }
.leg > em { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding-top: 3px; overflow-wrap: anywhere; }
.leg.ride > div { border-left: 4px solid var(--c); padding-left: 10px; }
.leg-title { font-weight: 700; }
.leg-row { margin-top: 4px; }
.leg-row i { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--blue); margin-right: 4px; }
.leg-row .code { color: var(--muted); font-size: 12px; }
.leg-sub { font-size: 12.5px; color: var(--muted); }
.leg-stop { border: 0; background: none; padding: 0; color: inherit; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.plan-tip { font-size: 12px; line-height: 1.25; padding: 3px 7px; border-radius: 8px; border: 0; box-shadow: 0 1px 6px rgba(0,0,0,.35); text-align: center; white-space: nowrap; }

/* Autobus : pictogramme + numéro de ligne */
.bus-marker .pill-bus { display: flex; align-items: center; justify-content: center; gap: 3px; line-height: 1; padding: 0 6px 0 5px; }
.bus-marker .pill-bus > span { line-height: 1; }
.bus-glyph { width: 18px; height: 18px; flex: none; fill: currentColor; }
.bus-marker.small .bus-glyph { width: 15px; height: 15px; }

/* Autobus vu de face : numéro dans le pare-brise */
.bus-marker .bus-front { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.bus-front .bus-body { display: block; width: 100%; height: 100%; overflow: visible; }
.bus-front b { position: absolute; left: 20%; right: 20%; top: 24.5%; height: 31%; padding-top: 1px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; font: 800 14px/1 system-ui, sans-serif; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bus-marker .tip { margin: -6px 0 0 -7px; border: 7px solid transparent; border-bottom: 10px solid var(--c); border-top: 0; }
:root[data-contrast="high"] .bus-front .bus-body rect:nth-of-type(5) { stroke: #000; }

/* Plein écran */
.fab-full { display: none; }
.fab-full .fs-out, .fab-full[aria-pressed="true"] .fs-in { display: none; }
.fab-full[aria-pressed="true"] .fs-out { display: block; }
@media (max-width: 720px) {
  .fab-full:not([hidden]) { display: grid; }
}
/* Hauteur visible réelle quand les barres du navigateur apparaissent ou disparaissent */
@supports (height: 100dvh) {
  @media (max-width: 720px) {
    .panel { height: min(46dvh, var(--sheet-max, 46dvh)); }
    .panel.collapsed { height: 124px; }
    .panel.expanded { height: var(--sheet-max, 88dvh); }
    .map-buttons { bottom: calc(46dvh + 14px); }
    body.sheet-collapsed .map-buttons { bottom: 138px; }
    #next-body { max-height: 62dvh; }
  }
}

/* Grande taille de texte : les boîtes de dialogue restent dans l'écran (zoom compensé) */
:root { --z: 1; }
:root[data-text="large"] { --z: 1.15; }
:root[data-text="xlarge"] { --z: 1.3; }
.install-box { max-width: min(360px, calc(92vw / var(--z))); max-height: calc(88vh / var(--z)); overflow-y: auto; box-sizing: border-box; }
.settings-box { width: min(calc(92vw / var(--z)), 380px); }
@supports (height: 100dvh) { .install-box { max-height: calc(88dvh / var(--z)); } }
.set-row > span { min-width: 0; overflow-wrap: anywhere; }
.set-row select { min-width: 0; flex: 0 1 58%; max-width: 58%; text-overflow: ellipsis; }

/* Fond « Mes tuiles » : carte vectorielle déjà claire ou sombre, pas de filtre */
:root[data-map="local"] { --tile-filter: none; }
@media (prefers-color-scheme: dark) { :root[data-map="local"]:not([data-theme="light"]) { --tile-filter: none; } }
:root[data-theme="dark"][data-map="local"] { --tile-filter: none; }
.leaflet-tile-pane canvas { image-rendering: auto; }

/* Le site gère lui-même clair et sombre : on le déclare pour que le navigateur n'impose pas son « mode nuit »
   (qui change les couleurs des lignes et des autobus). */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.leaflet-marker-icon, .bus-marker, .bus-front { forced-color-adjust: none; }

/* ---------- Liserés adoucis en thème sombre ---------- */
:root { --casing: #fff; --glass: #fff; --mirror: #2b3440; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --casing: #0b1118; --glass: #c9d3dd; --mirror: #121a23; } }
:root[data-theme="dark"] { --casing: #0b1118; --glass: #c9d3dd; --mirror: #121a23; }
.bus-front .b-body { fill: var(--c); stroke: var(--casing); stroke-width: 2.5; }
.bus-front .b-mir { fill: var(--mirror); stroke: var(--casing); stroke-width: 1.5; }
.bus-front .b-glass { fill: var(--glass); }
.bus-front .b-lamp { fill: var(--glass); }
.bus-front .b-sign { fill: var(--glass); opacity: .75; }
.bus-marker .tip { filter: drop-shadow(0 0 1px var(--casing)) drop-shadow(0 0 1px var(--casing)); }
.bus-front { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.line-label span { border-color: var(--casing); }
.plan-pin { border-color: var(--casing); }
.me-dot { border-color: var(--casing); }

/* Recherche masquée par défaut (bouton loupe sur la carte) */
.search[hidden] { display: none; }
.search .icon-btn { flex: none; }
.fab[aria-pressed="true"]#search-btn { background: var(--blue); color: #fff; }

/* Lignes en grille de cases */
.fav-toggle { display: flex; align-items: center; gap: 6px; }
.fav-toggle label { flex: 1; min-width: 0; }
.view-switch { flex: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--blue); display: grid; place-items: center; padding: 0; }
.view-switch svg { width: 22px; height: 22px; fill: currentColor; }
.route-grid-wrap { list-style: none; }
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; padding: 8px 2px 10px; }
.rg-cell { position: relative; }
.rg-btn { width: 100%; aspect-ratio: 1 / 1; border: 0; border-radius: 14px; font: 800 24px/1 system-ui, sans-serif; display: grid; place-items: center; align-content: center; gap: 3px; padding: 0; }
.rg-btn small { font-size: 11px; font-weight: 700; opacity: .85; }
.rg-star { position: absolute; top: -6px; right: -6px; width: 30px; height: 30px; font-size: 16px; background: var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,.35); border-radius: 50%; }
.rg-star.on { color: #e8a200; }
.rg-warn { position: absolute; top: -4px; left: -4px; margin: 0; width: 18px; height: 18px; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
#search::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.install-btn.set-install { margin: 10px 0 8px; width: 100%; justify-content: center; padding: 11px 14px; font-size: 14px; }

/* Autobus en blocs de couleur */
.bus-front .bf { position: absolute; display: block; box-sizing: border-box; }
.bus-front .bf-body { background: var(--c); border: calc(var(--u) * 2.5) solid var(--casing); }
.bus-front .bf-mir { background: var(--mirror); border: calc(var(--u) * 1.2) solid var(--casing); }
.bus-front .bf-glass { background: #0b1118; border: 0; }
.bus-front .bf-lamp { background: var(--glass); }
.bus-front .bf-sign { background: var(--glass); opacity: .75; }
.bus-front .bf-glass b { position: static; width: 100%; height: 100%; padding: 0; color: #fff; text-shadow: none; }
:root[data-contrast="high"] .bus-front .bf-body { border-color: #000; }

/* Flèche de direction plus grande */
.bus-marker .tip { margin: -9px 0 0 -11px; border: 11px solid transparent; border-bottom: 18px solid var(--c); border-top: 0; filter: drop-shadow(0 0 1.5px var(--casing)) drop-shadow(0 0 1.5px var(--casing)) drop-shadow(0 1px 2px rgba(0,0,0,.35)); }

/* Texte agrandi : le panneau est zoomé, donc ses hauteurs doivent être divisées par le zoom pour ne pas déborder sur la carte du haut */
@media (max-width: 720px) {
  .panel { height: calc(min(46vh, var(--sheet-max, 46vh)) / var(--z)); }
  .panel.collapsed { height: calc(124px / var(--z)); }
  .panel.expanded { height: calc(var(--sheet-max, 88vh) / var(--z)); }
  @supports (height: 100dvh) {
    .panel { height: calc(min(46dvh, var(--sheet-max, 46dvh)) / var(--z)); }
    .panel.collapsed { height: calc(124px / var(--z)); }
    .panel.expanded { height: calc(var(--sheet-max, 88dvh) / var(--z)); }
  }
}

.set-legal { margin: 6px 0 12px; font-size: 11.5px; line-height: 1.45; color: var(--muted); text-align: center; }

/* ================= Finition professionnelle ================= */
/* Logo et pastille « en direct » */
.brand-logo { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(145deg, #1380d6, #0b4f8a); color: #fff; box-shadow: 0 2px 6px rgba(11, 95, 165, .35), inset 0 1px 0 rgba(255,255,255,.25); }
.brand-logo svg { width: 20px; height: 20px; }
.brand h1 { font-weight: 800; letter-spacing: -.02em; }
.live-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; }
.live-badge .brand-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
:root[data-theme="dark"] .live-badge { color: #4fd08a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .live-badge { color: #4fd08a; } }
.is-offline .live-badge { background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); }
.is-offline .live-badge .brand-dot { background: var(--muted); box-shadow: none; animation: none; }

/* Chargement en squelette */
.sk-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; list-style: none; }
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--bg-2) 25%, color-mix(in srgb, var(--line) 80%, var(--bg-2)) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; }
.sk-pill { width: 46px; height: 28px; flex: none; }
.sk-line { height: 12px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Retours tactiles et survols */
.fab, .route-item, .rg-btn, .plan-open, .install-ok, .view-switch, .icon-btn, .next-row, .hero-main, .install-btn, .set-link { transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease; -webkit-tap-highlight-color: transparent; }
.fab:active, .rg-btn:active, .install-ok:active, .view-switch:active, .icon-btn:active, .install-btn:active { transform: scale(.93); }
.route-item:active, .plan-open:active, .next-row:active, .hero-main:active { transform: scale(.985); }
@media (hover: hover) {
  .fab:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(16, 33, 52, .24); }
  .rg-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 33, 52, .22); }
  .route-star:hover, .icon-btn:hover { color: #e8a200; }
}
.fab { background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.fab.active, .fab[aria-pressed="true"]#search-btn { border-color: transparent; }
.pill, .rg-btn { box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }

/* Transitions d'affichage */
.view:not([hidden]) { animation: viewIn .22s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.install-help:not([hidden]) { animation: fadeIn .18s ease both; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.install-help:not([hidden]) .install-box { animation: popIn .22s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.toast:not([hidden]) { animation: toastIn .25s cubic-bezier(.2, .9, .3, 1.2) both; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
@keyframes toastIn { from { opacity: 0; margin-top: -10px; } to { opacity: 1; margin-top: 0; } }
details.avis[open] .avis-body, details.next-more[open] > :not(summary) { animation: viewIn .2s ease both; }

/* Barres de défilement discrètes */
.view { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.view::-webkit-scrollbar { width: 6px; }
.view::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::selection { background: color-mix(in srgb, var(--blue) 30%, transparent); }

/* Bandeau hors connexion */
.offline-bar { position: fixed; z-index: 2400; left: 50%; top: calc(env(safe-area-inset-top) + 10px); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: 92vw; padding: 9px 14px; border-radius: 99px; background: #7a1f17; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: toastIn .25s ease both; }
.offline-bar[hidden] { display: none; }
.offline-bar svg { width: 18px; height: 18px; }

/* À propos */
.set-link { display: block; width: 100%; margin: 4px 0 0; padding: 8px; border: 0; background: none; color: var(--blue); font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: 8px; }
.about-box { max-width: min(420px, calc(92vw / var(--z))); }
.about-box p { font-size: 14px; line-height: 1.5; margin: 8px 0; }
.about-box h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; }
.about-box ul { margin: 0 0 8px; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.about-box li { margin: 5px 0; }
@media (max-width: 720px) { .offline-bar { top: calc(env(safe-area-inset-top) + 64px); width: max-content; } }

/* Visite guidée */
.tour-box { text-align: center; max-width: min(360px, calc(92vw / var(--z))); }
.tour-art { color: var(--blue); height: 110px; display: grid; place-items: center; margin: 2px 0 8px; border-radius: 14px; background: color-mix(in srgb, var(--blue) 9%, var(--bg-2)); }
.tour-art svg { width: 150px; height: 100px; fill: none; }
.tour-box h2 { margin: 6px 0 6px; font-size: 20px; letter-spacing: -.01em; }
.tour-box p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--muted); min-height: 5.6em; }
.tour-dots { display: flex; justify-content: center; gap: 7px; margin-bottom: 14px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: width .2s, background-color .2s; }
.tour-dots i.on { width: 22px; border-radius: 4px; background: var(--blue); }
.tour-actions { display: flex; gap: 10px; align-items: center; }
.tour-actions .install-ok { flex: 1; margin: 0; }
.tour-skip { border: 0; background: none; color: var(--muted); font-weight: 600; padding: 10px 12px; border-radius: 10px; }
.tour-skip[hidden] { display: none; }

/* État du métro */
.metro-status { margin-top: 8px; }
.metro-status[hidden] { display: none; }
.ms-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.ms-row::-webkit-scrollbar { display: none; }
.ms-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px 6px 7px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); box-shadow: 0 2px 8px rgba(16, 33, 52, .14); font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ms-chip i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.ms-chip b { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; line-height: 1; color: #fff; background: var(--ok); }
.ms-chip.ms-alert { border-color: #e8a200; background: color-mix(in srgb, #e8a200 14%, var(--bg)); }
.ms-chip.ms-alert b { background: #d0352b; }
.ms-chip.ms-unknown b { background: var(--muted); }
.ms-chip.ms-normal, .ms-chip.ms-unknown { cursor: default; }
.ms-msg { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border-left: 5px solid var(--c); box-shadow: var(--shadow); font-size: 13px; line-height: 1.4; max-height: 34vh; overflow-y: auto; }
.ms-msg p { margin: 5px 0 0; }
.ms-pop { font-weight: 700; }
.ms-pop.ms-normal { color: var(--ok); }
.ms-pop.ms-alert { color: #d0352b; }
.leg-warn { display: flex; align-items: center; gap: 6px; margin: 4px 0; padding: 5px 8px; border-radius: 8px; background: color-mix(in srgb, #e8a200 16%, transparent); font-size: 12.5px; font-weight: 600; }
.leg-warn .warn { margin-left: 0; }

/* Choix de la direction sur la carte */
.map-dirs { display: flex; gap: 4px; margin-top: 8px; padding: 4px; border-radius: 99px; background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow); }
.map-dirs[hidden] { display: none; }
.map-dirs button { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 10px; border-radius: 99px; font-size: 13.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color .15s, color .15s; }
.map-dirs button[aria-selected="true"] { background: var(--route, var(--blue)); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* Bulles d'itinéraire : une seule bulle par correspondance, sans chevauchement */
.plan-tip hr { border: 0; border-top: 1px solid rgba(255,255,255,.25); margin: 3px -3px; }
.plan-tip { width: max-content; max-width: 62vw; white-space: normal; }

/* ---------- Guidage « Démarrer » ---------- */
.nav-card { margin-top: 0; padding: 12px; border-radius: 18px; background: var(--bg); color: var(--ink); box-shadow: var(--shadow); border-left: 6px solid var(--c, var(--blue)); animation: viewIn .2s ease both; }
.nav-card[hidden] { display: none; }
.nav-card.alert { border-left-color: #e8a200; background: color-mix(in srgb, #e8a200 16%, var(--bg)); animation: navPulse 1s ease 3; }
.nav-card.done { border-left-color: var(--ok); }
@keyframes navPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #e8a200 45%, transparent), var(--shadow); } }
.nav-top { display: flex; align-items: center; gap: 12px; }
.nav-top .pill { flex: none; font-size: 17px; padding: 6px 10px; min-width: 46px; text-align: center; }
.nav-ico { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 24px; font-weight: 800; }
.nav-ico svg { width: 26px; height: 26px; }
.nav-ico.done { background: var(--ok); color: #fff; }
.nav-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-txt b { font-size: 17px; line-height: 1.2; letter-spacing: -.01em; }
.nav-txt span { font-size: 14px; color: var(--muted); font-weight: 600; }
.nav-then { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.nav-bar { height: 4px; border-radius: 2px; background: var(--line); margin: 10px 0; overflow: hidden; }
.nav-bar i { display: block; height: 100%; background: var(--c, var(--blue)); border-radius: 2px; transition: width .4s ease; }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-main { flex: 1; min-width: 0; border: 0; border-radius: 12px; padding: 11px 12px; background: var(--blue); color: #fff; font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="dark"] .nav-main, :root[data-theme="dark"] .nav-start { color: #06121d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav-main, :root:not([data-theme="light"]) .nav-start { color: #06121d; } }
.nav-sm { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--blue); display: grid; place-items: center; padding: 0; font-size: 22px; line-height: 1; }
.nav-sm svg { width: 20px; height: 20px; }
.nav-sm[aria-pressed="false"] { color: var(--muted); }
.nav-sm.stop { color: #d0352b; }
.nav-main:active, .nav-sm:active, .nav-start:active { transform: scale(.96); }
/* Pendant le guidage : la carte d'instruction remplace le bandeau des prochains passages */
body.nav-on #next-find, body.nav-on #next-body, body.nav-on #map-dirs, body.nav-on #metro-status { display: none !important; }
/* Boutons sous le trajet choisi */
.plan-leave { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); font-size: 13.5px; font-weight: 700; }
.plan-leave > span { flex: 1; min-width: 0; }
.plan-leave-btn { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--bg); color: var(--blue); border-radius: 99px; padding: 6px 11px 6px 8px; font-size: 12.5px; font-weight: 700; }
.plan-leave-btn svg { width: 16px; height: 16px; }
.plan-leave-btn.on { background: #e8a200; border-color: #e8a200; color: #1c1300; }
.plan-go { display: flex; gap: 8px; margin-top: 10px; }
.nav-start { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 13px 16px; background: var(--blue); color: #fff; font-size: 16px; font-weight: 800; box-shadow: 0 6px 16px color-mix(in srgb, var(--blue) 35%, transparent); transition: transform .12s; }
.nav-start svg { width: 20px; height: 20px; }
.plan-share { flex: none; width: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); color: var(--blue); display: grid; place-items: center; padding: 0; }
/* Cône de direction du point bleu */
.me-cone { display: none; position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; pointer-events: none; background: conic-gradient(from -32deg, rgba(30,136,229,.55) 0deg, rgba(30,136,229,.55) 64deg, transparent 64deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); transform: rotate(var(--heading, 0deg)); }
.has-heading .me-cone { display: block; }
.me-dot { position: relative; }
@media (max-width: 720px) { body.nav-on .toast { top: auto; bottom: 150px; } }
.leg > em { -webkit-hyphens: auto; hyphens: auto; overflow-wrap: normal; }

/* Étapes cochées du guidage */
.nav-bar { display: none; }
.nav-steps { display: flex; align-items: center; gap: 4px; margin: 10px 0; }
.nav-steps > i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); min-width: 6px; }
.nav-step { flex: none; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; background: var(--bg-2); color: var(--muted); border: 2px solid var(--line); }
.nav-step svg { width: 16px; height: 16px; }
.nav-step.cur { background: var(--c, var(--blue)); border-color: var(--c, var(--blue)); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--blue)) 30%, transparent); }
.nav-step.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.nav-step.end { border-radius: 50%; padding: 0; }

/* Le temps en gros dans le guidage */
.nav-txt { flex: 1; }
.nav-big { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; padding: 4px 8px; border-radius: 14px; background: color-mix(in srgb, var(--c, var(--blue)) 16%, var(--bg-2)); color: var(--ink); line-height: 1; }
.nav-big b { font-size: 38px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.nav-big span { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .05em; }
.nav-card.alert .nav-big { background: #e8a200; color: #1c1300; }
.nav-card.alert .nav-big span { color: #1c1300; }

/* Infos en direct sur ton bus, dans le guidage */
.nav-bus { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; width: 100%; margin-top: 8px; padding: 8px 10px; border: 0; border-radius: 10px; background: var(--bg-2); color: var(--ink); font-size: 13px; font-weight: 600; text-align: left; }
.nav-bus.none { color: var(--muted); font-weight: 500; }
.nav-bus-t { flex: 1 1 auto; min-width: 0; }

/* ---------- Itinéraire : formulaire plus clair ---------- */
.plan-form { position: relative; display: grid; gap: 10px; }
.plan-row { display: grid; gap: 4px; }
.plan-lab { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }
.plan-field { height: 50px; border-radius: 12px; border-width: 2px; padding: 0 6px 0 10px; }
.plan-field:focus-within { border-color: var(--blue); background: var(--bg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.plan-field input { font-size: 16px; font-weight: 600; text-overflow: ellipsis; }
.plan-field input::placeholder { font-weight: 400; color: var(--muted); }
.plan-dot { width: 26px; height: 26px; font-size: 13px; }
.plan-clear { flex: none; width: 34px; height: 34px; font-size: 20px; line-height: 1; color: var(--muted); }
.plan-clear[hidden] { display: none; }
.plan-swap { justify-self: start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--blue); font-size: 13px; font-weight: 700; padding: 4px 2px; }
.plan-swap svg { width: 18px; height: 18px; }
.plan-sugg { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 8px 24px rgba(16, 33, 52, .16); padding: 6px; animation: viewIn .16s ease both; }
.plan-sugg[hidden] { display: none; }
.ps-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px 8px; font-size: 14px; }
.ps-close { border: 0; background: var(--bg-2); width: 28px; height: 28px; border-radius: 50%; font-size: 17px; line-height: 1; color: var(--muted); }
.plan-sugg h3 { margin: 8px 8px 2px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ps-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; background: none; border-radius: 10px; text-align: left; color: var(--ink); }
.ps-row:hover, .ps-row:focus-visible { background: var(--bg-2); outline: none; }
.ps-row:active { transform: scale(.985); }
.ps-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.ps-ico svg { width: 18px; height: 18px; }
.ps-txt { min-width: 0; display: flex; flex-direction: column; }
.ps-txt b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-busy { margin: 6px 8px; font-size: 13px; color: var(--muted); }
/* Placement d'un point : épingle fixe + barre de confirmation */
.pick-pin { position: fixed; z-index: 700; transform: translate(-50%, -100%); pointer-events: none; display: grid; justify-items: center; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.pick-pin[hidden] { display: none; }
.pick-pin b { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 17px/1 system-ui, sans-serif; border: 3px solid #fff; background: #1a8f4c; }
.pick-pin.b b { background: #c62828; }
.pick-pin i { width: 4px; height: 16px; background: #fff; border-radius: 0 0 2px 2px; margin-top: -2px; }
.pick-bar { position: fixed; z-index: 2300; left: 0; right: 0; margin: 0 auto; bottom: 24px; width: min(92vw, 420px); padding: 12px; border-radius: 16px; background: var(--bg); color: var(--ink); box-shadow: var(--shadow); display: grid; gap: 10px; font-size: 14.5px; font-weight: 600; text-align: center; animation: viewIn .2s ease both; }
.pick-bar[hidden] { display: none; }
.pick-bar div { display: flex; gap: 8px; }
.pick-cancel, .pick-ok { flex: 1; border: 0; border-radius: 12px; padding: 12px; font-weight: 700; font-size: 15px; }
.pick-cancel { background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); }
.pick-ok { flex: 1.6; background: var(--blue); color: #fff; }
:root[data-theme="dark"] .pick-ok { color: #06121d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pick-ok { color: #06121d; } }
body.picking #next-card, body.picking .map-buttons { display: none; }
@media (max-width: 720px) { .pick-bar { bottom: calc(env(safe-area-inset-bottom) + 12px); } body.picking .panel { display: none; } }
/* Bouton Démarrer en haut du trajet choisi */
.plan-opt .plan-go { margin: 10px 0 2px; }
.plan-opt .plan-leave { margin-top: 10px; }

/* Itinéraire : inclure ou non le métro */
.plan-form { grid-template-columns: 1fr auto; align-items: center; }
.plan-form > .plan-row, .plan-form > .plan-sugg { grid-column: 1 / -1; }
.plan-metro { justify-self: end; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; padding: 4px 2px; }
.plan-metro input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pm-m { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font: 800 13px/1 system-ui, sans-serif; }
.pm-sw { position: relative; width: 42px; height: 24px; border-radius: 99px; background: var(--line); transition: background-color .15s; flex: none; }
.pm-sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.plan-metro input:checked ~ .pm-sw { background: var(--blue); }
.plan-metro input:checked ~ .pm-sw::after { transform: translateX(18px); }
.plan-metro input:focus-visible ~ .pm-sw { outline: 2px solid var(--blue); outline-offset: 2px; }

.leg-net { font-weight: 500; color: var(--muted, #5b6b7a); font-size: .85em; }
.ox-dep { margin-top: 6px; } .ox-table { border-collapse: collapse; width: 100%; } .ox-table td { padding: 2px 6px 2px 0; vertical-align: middle; font-size: .9em; }
.set-group { margin: 6px 0; } .set-group-title { display: block; font-weight: 700; font-size: .85em; opacity: .8; margin: 4px 0 2px; }

.co-chips { display: flex; gap: 6px; padding: 6px 2px 8px; list-style: none; }
.co-chip { flex: 1; border: 1px solid var(--border, #cbd5e1); background: transparent; color: inherit; border-radius: 999px; padding: 6px 10px; font: 600 .9em system-ui, sans-serif; }
.co-chip.on { background: var(--accent, #0b5fa5); border-color: var(--accent, #0b5fa5); color: #fff; }
.net-head { font-weight: 700; margin-top: 6px; }
.route-net { display: block; font-weight: 500; font-size: .6em; opacity: .7; }
.ox-table .ox-t, .ox-table .ox-w { white-space: nowrap; text-align: right; }
.ox-line { border: 0; background: none; padding: 0; cursor: pointer; }
.ox-add { border: 1px solid #94a3b8; background: transparent; color: inherit; border-radius: 999px; width: 24px; height: 24px; font: 700 14px/1 system-ui, sans-serif; cursor: pointer; } .ox-add.on { background: #0b5fa5; border-color: #0b5fa5; color: #fff; }
.ox-add { border-color: #0b5fa5; color: #0b5fa5; } .ox-add:hover { background: #e6f1fb; } .ox-add.on { background: #0b5fa5; border-color: #0b5fa5; color: #fff; }

/* Téléphone : en-tête compact pour laisser plus de place à la liste */
@media (max-width: 720px) {
  .panel-head { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; }
  .panel-head .brand { flex: none; gap: 7px; }
  .brand-logo { width: 22px; height: 22px; border-radius: 7px; }
  .brand-logo svg { width: 14px; height: 14px; }
  .brand h1 { font-size: 15px; }
  .live-badge { margin-left: 0; padding: 0; background: none; }
  .live-badge > span:last-child { display: none; }
  .panel-head .status { flex: 1; min-width: 0; margin: 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
  .plan-open { margin-top: 6px; padding: 7px 10px; font-size: 13px; }
  .fav-toggle { margin: 0; padding-bottom: 2px; }
  .fav-toggle label { padding: 5px 8px; }
  .fav-toggle small { display: none; }
}

/* Panneau d'arrêt (zoom rapproché) : plaque blanche, bandeau bleu, pastilles des lignes */
.sg-icon { background: none; border: 0; }
.sgw { position: relative; width: 38px; }
.sgw::after { content: ''; position: absolute; left: 50%; bottom: -10px; width: 3px; height: 10px; margin-left: -1.5px; background: #8a949e; }
.sg { width: 38px; background: #fff; border: 1.5px solid #c3ccd6; border-radius: 6px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); overflow: hidden; padding-bottom: 2px; font: 800 12px/1 system-ui, sans-serif; }
.sg i { display: block; height: 6px; background: #1b6fc2; margin-bottom: 2px; }
.sg b { display: block; margin: 2px 3px 0; padding: 4px 0; text-align: center; border-radius: 3px; font-size: 12px; line-height: 12px; }
.sg em { display: block; text-align: center; color: #445; font: 700 10px/12px system-ui, sans-serif; }

.h1-bus { font-size: 1.3em; font-weight: 900; letter-spacing: -.03em; }
/* La pancarte qui s'ouvre : bandeau bleu, plaque blanche, poteau */
.sg-pop .leaflet-popup-content-wrapper { border-top: 9px solid #1b6fc2; border-radius: 9px; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.sg-pop .leaflet-popup-tip-container { width: 3px; height: 10px; margin-left: -1.5px; overflow: visible; }
.sg-pop .leaflet-popup-tip { width: 3px; height: 10px; margin: 0; padding: 0; border-radius: 0; transform: none; background: #8a949e; box-shadow: none; }

/* Bulles d'arrêt compactes : texte toujours foncé (la bulle est blanche, même en thème sombre) */
.sg-pop .leaflet-popup-content, .leaflet-popup-content .ox-table { color: #0b1b2b; }
.sg-pop .leaflet-popup-content { margin: 8px 10px 6px; line-height: 1.25; }
.sg-title { display: flex; align-items: baseline; gap: 6px; padding-right: 16px; font-size: 14px; }
.sg-title small { color: #5b6b7a; font-size: 11px; }
.ox-full { margin-left: auto; border: 0; background: none; color: #0b5fa5; font: 700 20px/1 system-ui, sans-serif; cursor: pointer; padding: 0 2px; }
.ox-dep { margin-top: 4px; }
.leaflet-popup-content .ox-table td { padding: 2px 4px 2px 0; font-size: 13px; }
.ox-dir { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; background: #e7edf3; color: #0b1b2b; font: 800 12px/1 system-ui, sans-serif; }
.ox-dir-txt { border-radius: 8px; padding: 0 5px; font-weight: 600; font-size: 11px; }
.leaflet-popup-content .wait { min-width: 0; color: #3b4b5c; font-size: 12px; font-weight: 600; }
.leaflet-popup-content .wait b { font-size: 16px; color: #0b1b2b; }
.leaflet-popup-content .wait.now { color: #0f8a4a; }
.leaflet-popup-content .ox-t b { color: #0b1b2b; }
.ox-chev { display: block; width: 100%; border: 0; background: none; color: #0b5fa5; font-size: 16px; line-height: 1; padding: 2px 0 0; cursor: pointer; }
.ox-add { width: 26px; height: 26px; }

/* Plus étroit */
.leaflet-popup-content .ox-table td { padding: 1px 3px 1px 0; font-size: 12.5px; }
.leaflet-popup-content .ox-table .pill { min-width: 0; padding: 2px 6px; font-size: 12px; border-radius: 6px; }
.ox-dir { min-width: 19px; height: 19px; font-size: 11px; }
.ox-add { width: 22px; height: 22px; font-size: 13px; }
.leaflet-popup-content .wait b { font-size: 14px; }
.leaflet-popup-content .wait { font-size: 11px; }
.sg b u { text-decoration: none; font-size: 9px; font-weight: 900; margin-left: 2px; opacity: .9; vertical-align: 1px; }

.h1-com { font-weight: 600; font-size: .75em; color: var(--muted); margin-left: 1px; }
/* Téléphone : l'heure de mise à jour reste visible, sur sa propre ligne sous le titre */
@media (max-width: 720px) {
  .panel-head { flex-wrap: wrap; row-gap: 1px; }
  .panel-head .brand { flex: 1; }
  .panel-head .status { flex: 0 0 100%; text-align: left; white-space: normal; overflow: visible; text-overflow: clip; font-size: 11px; line-height: 1.25; }
}
.ms-msg { overflow-wrap: anywhere; } .ms-msg a, .alert-item a { color: var(--blue); text-decoration: underline; }
