/* Across Andes 2026 roadbook — mobile-first "race app".
   Five tabs (Maintenant / Carte / Roadbook / Profil / Infos) switched by JS, bottom tab bar for the
   thumb, large tap targets, big numbers. Tokens for light + dark; "big" mode zooms everything. */
:root {
  --bg: #f1f2ee; --fg: #1b211d; --muted: #5a6560; --card: #ffffff; --line: #d3d9d1; --soft: #e7eae4;
  --accent: #9a3b22; --accent-ink: #ffffff; --accent-soft: #f5e4dc;
  --warn-bg: #fff6e3; --warn-line: #e8c98a;
  --ok: #1a8a4a; --bad: #c0392b; --warnc: #c77d0a;
  --d1: #2a78d6; --d2: #eb6834; --d3: #1baf7a; --d4: #4a3aa7;
  --paved: #6b7780; --gravel: #c99a55; --unknown: #b7bdb6;
  --night: #2f3542; --dusk: #aab0c4; --day: #f7e39c;
  --geo: #1a73e8; --booking: #0a3a86;
  --display: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --body: 'Source Sans 3', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --top: 52px; --tabs: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181a; --fg: #e7eae6; --muted: #9aa49d; --card: #1e2326; --line: #30383c; --soft: #262c30;
    --accent: #f08a6a; --accent-ink: #1b1210; --accent-soft: #3a2520;
    --warn-bg: #2f2816; --warn-line: #6c5a2a;
    --ok: #3ccf7a; --bad: #ff6b5b; --warnc: #f0b545;
    --d1: #3987e5; --d2: #d95926; --d3: #199e70; --d4: #9085e9;
    --paved: #8e9ba5; --gravel: #d9a85f; --unknown: #5b6361;
    --night: #0b0e11; --dusk: #3f4658; --day: #b99a3c;
    --geo: #7fb2ff; --booking: #8fb4ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15181a; --fg: #e7eae6; --muted: #9aa49d; --card: #1e2326; --line: #30383c; --soft: #262c30;
  --accent: #f08a6a; --accent-ink: #1b1210; --accent-soft: #3a2520;
  --warn-bg: #2f2816; --warn-line: #6c5a2a;
  --ok: #3ccf7a; --bad: #ff6b5b; --warnc: #f0b545;
  --d1: #3987e5; --d2: #d95926; --d3: #199e70; --d4: #9085e9;
  --paved: #8e9ba5; --gravel: #d9a85f; --unknown: #5b6361;
  --night: #0b0e11; --dusk: #3f4658; --day: #b99a3c;
  --geo: #7fb2ff; --booking: #8fb4ff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 10px + env(safe-area-inset-top, 0px)); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--body); font-size: 17px; line-height: 1.45;
  padding-bottom: calc(var(--tabs) + 16px + env(safe-area-inset-bottom, 0px));
}
body.big { zoom: 1.15; }
.wrap { max-width: 1140px; margin: 0 auto; padding-inline: max(14px, env(safe-area-inset-left, 0px)) max(14px, env(safe-area-inset-right, 0px)); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.05; margin: 0; text-wrap: balance; font-weight: 700; }
h1 { font-size: clamp(34px, 8vw, 60px); letter-spacing: -.01em; }
h2 { font-size: clamp(26px, 6vw, 36px); margin: 18px 0 10px; }
h3 { font-size: 20px; margin: 22px 0 8px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
h3 .h3sub { display: block; font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
h4 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 12px; max-width: 72ch; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.eyebrow { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
b { font-weight: 600; }
ul, ol { padding-left: 20px; margin: 0; }
li { margin: 0 0 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--geo); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- pictograms ---------- */
.ic { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }
.sv { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; line-height: 1.2; color: var(--muted); padding: 3px 8px 3px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); white-space: nowrap; }
.sv .ic { width: 16px; height: 16px; color: var(--fg); }
.sv i { font-style: normal; }
.legend-icons { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.legend-box { margin: 12px 0 4px; }
.legend-box summary { cursor: pointer; font: 600 15px var(--display); text-transform: uppercase; letter-spacing: .06em; padding: 8px 0; }
.mk { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; margin-right: 2px; }
.mk .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.mk.cp { background: #9a3b22; } .mk.night { background: #1b211d; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); text-decoration: none; font-family: var(--display); font-size: 16px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; cursor: pointer; line-height: 1.1; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.on { background: var(--geo); color: #fff; border-color: var(--geo); }
.btn.tel { font-family: var(--body); text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.btn.tel .ic { color: var(--ok); }
.bk { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; font-size: 14px; font-weight: 700; text-decoration: none; padding: 6px 12px; border: 1px solid var(--booking); border-radius: 10px; background: var(--card); color: var(--booking); line-height: 1.15; }
.bk .bkd { font-weight: 400; color: var(--muted); }
.ib { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 700 15px var(--display); display: grid; place-items: center; cursor: pointer; padding: 0; }
.ib .ic { width: 20px; height: 20px; }

/* ---------- top bar + tabs ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: calc(var(--top) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 14px 0; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { flex: 1; min-width: 0; font-family: var(--display); font-size: 21px; text-decoration: none; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand b { color: var(--accent); font-weight: 700; margin-right: 6px; }
.net { font-size: 12px; color: var(--muted); display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.net i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.net.off i { background: var(--bad); }
.tab { display: none; padding-block: 12px 24px; }
.tab.on { display: block; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
nav.tabs a { display: grid; justify-items: center; gap: 3px; padding: 8px 4px 7px; min-height: var(--tabs); text-decoration: none; color: var(--muted); font: 600 12px var(--display); letter-spacing: .06em; text-transform: uppercase; }
nav.tabs a .ic { width: 24px; height: 24px; }
nav.tabs a.on { color: var(--accent); }
nav.tabs a.on .ic { stroke-width: 2.4; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + 14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 15px; max-width: 90vw; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

/* ---------- Maintenant ---------- */
.now-head { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.posmain { display: flex; align-items: center; gap: 14px; min-width: 0; }
.posmain .km { display: grid; font-family: var(--display); line-height: 1; flex: none; }
.posmain .km small { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.posmain .km b { font-size: 54px; font-weight: 700; font-variant-numeric: tabular-nums; }
.posmain .where { display: grid; gap: 2px; min-width: 0; }
.posmain .where b { font-size: 21px; font-family: var(--display); line-height: 1.1; font-weight: 700; }
.posmain .where span { font-size: 14px; }
.posctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kmlab { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-family: var(--display); font-size: 16px; text-transform: uppercase; letter-spacing: .04em; }
.kmlab input { width: 88px; font: 700 22px var(--display); padding: 5px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); }
.nowtime { font-size: 14.5px; color: var(--muted); }
.nowtime b { color: var(--fg); }
.cards { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.card { display: grid; grid-template-columns: 46px 1fr; gap: 3px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; align-content: start; min-width: 0; }
.card .cic { grid-row: 1 / 6; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--fg); }
.card .cic .ic { width: 27px; height: 27px; }
.card.ok .cic { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.card.bad .cic { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.card.warn .cic { background: color-mix(in srgb, var(--warnc) 22%, transparent); color: var(--warnc); }
.card .cl { font: 600 12px var(--display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.card .cv { font: 700 23px var(--display); line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.card .cv a { color: inherit; text-decoration: none; border-bottom: 2px solid var(--accent); }
.card .cs { font-size: 14.5px; color: var(--muted); }
.card .cs b { color: var(--fg); }
.card .csv { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.card .csv .ic { width: 15px; height: 15px; padding: 4px; box-sizing: content-box; border-radius: 6px; background: var(--soft); color: var(--fg); }
.card .ca { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nextsteps { list-style: none; padding: 0; display: grid; gap: 6px; }
.nextsteps li { display: grid; grid-template-columns: 64px 1fr; gap: 1px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0; }
.nextsteps li.warn { background: var(--warn-bg); }
.nextsteps .k { grid-row: 1 / 3; font: 700 22px var(--display); line-height: 1; align-self: center; }
.nextsteps .k small { display: block; font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.nextsteps .t { font-weight: 600; line-height: 1.25; }
.nextsteps .d { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.nextsteps .d .sv { font-size: 11.5px; padding: 1px 6px 1px 3px; }
.nowfoot { margin-top: 16px; display: grid; gap: 8px; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; min-height: 42px; }
.chk input { width: 22px; height: 22px; }

/* ---------- Carte (Leaflet) ---------- */
.mapwrap { position: relative; height: calc(100dvh - var(--top) - var(--tabs) - 10px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); min-height: 420px; margin-inline: -14px; border-block: 1px solid var(--line); }
#leaflet { position: absolute; inset: 0; background: var(--soft); font-family: var(--body); }
.mapui { position: absolute; left: 0; right: 0; z-index: 500; pointer-events: none; display: grid; gap: 6px; padding: 8px 8px 0; }
.mapui .row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; pointer-events: auto; padding: 2px 2px 4px; }
.mapui .row::-webkit-scrollbar { display: none; }
.mtop { top: 0; }
.mbot { bottom: 20px; }
.chipb { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: 600 13px var(--body); box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; min-height: 36px; white-space: nowrap; }
.chipb.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chipb .ic { width: 16px; height: 16px; }
.chipb .n { font-weight: 400; opacity: .75; }
.mebtn { position: absolute; right: 10px; bottom: 118px; z-index: 500; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--geo); box-shadow: 0 2px 8px rgba(0,0,0,.25); display: grid; place-items: center; cursor: pointer; }
.mebtn .ic { width: 24px; height: 24px; }
.mapnote { margin: 10px 0 0; }
.leaflet-container { font-family: var(--body); }
.leaflet-bottom.leaflet-right { margin-bottom: 66px; }
.leaflet-touch .leaflet-bar a { width: 38px; height: 38px; line-height: 38px; font-size: 20px; }
.leaflet-control-attribution { font-size: 10px; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #1b211d; color: #1b211d; box-shadow: 0 1px 4px rgba(0,0,0,.35); position: relative; }
.lm .ic { width: 17px; height: 17px; stroke-width: 2.3; }
.lm.food { border-color: #c2410c; color: #c2410c; } .lm.shop { border-color: #a16207; color: #a16207; } .lm.bed { border-color: #1d4ed8; color: #1d4ed8; }
.lm.serv { border-color: #6b21a8; color: #6b21a8; } .lm.water { border-color: #0e7490; color: #0e7490; } .lm.steps { border-color: #334155; color: #334155; }
.lm.steps.warn { border-color: #b91c1c; color: #b91c1c; background: #fff1f0; }
.lm.cp { background: #9a3b22; border-color: #fff; color: #fff; } .lm.night { background: #1b211d; color: #fff; border-color: #fff; }
.lm.top { background: #5b4636; color: #fff; border-color: #fff; width: 26px; height: 26px; } .lm.start { background: #2a78d6; color: #fff; border-color: #fff; }
.lm.volc { background: transparent; border: 0; box-shadow: none; color: #5b4636; width: 26px; height: 26px; }
.lm.volc .ic { width: 24px; height: 24px; }
.lm.me { background: #1a73e8; border: 3px solid #fff; width: 20px; height: 20px; box-shadow: 0 0 0 2px #1a73e8, 0 1px 6px rgba(0,0,0,.4); }
.lm.me .ic { display: none; }
.lmlbl { position: absolute; left: 32px; top: 6px; font: 600 12px var(--body); color: #1b211d; white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 4px #fff, 0 0 4px #fff; pointer-events: none; }
.lm.me .lmlbl { left: 22px; top: 0; color: #1a73e8; font-weight: 700; }
.lm.top .lmlbl { left: 28px; top: 4px; color: #5b4636; }
.lm.volc .lmlbl { left: 26px; top: 4px; font-style: italic; font-weight: 500; color: #5b4636; }
.kmk { background: #fff; border: 1.5px solid #1b211d; border-radius: 6px; font: 700 11px var(--body); color: #1b211d; padding: 1px 4px; white-space: nowrap; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); line-height: 1.3; }
.clz { display: inline-grid; grid-auto-flow: column; align-items: center; gap: 3px; padding: 3px 8px 3px 5px; border-radius: 999px; background: #fff; border: 2px solid currentColor; font: 700 13px var(--body); box-shadow: 0 1px 4px rgba(0,0,0,.3); white-space: nowrap; }
.clz .ic { width: 16px; height: 16px; stroke-width: 2.3; }
.clz.food { color: #c2410c; } .clz.shop { color: #a16207; } .clz.bed { color: #1d4ed8; } .clz.serv { color: #6b21a8; } .clz.water { color: #0e7490; } .clz.steps { color: #334155; }
.leaflet-popup-content-wrapper { color: #1b211d; border-radius: 10px; }
.leaflet-popup-content { font: 15px/1.4 var(--body); margin: 12px 14px; min-width: 200px; }
.pp h4 { margin: 0 0 3px; font: 700 18px var(--display); color: #1b211d; }
.pp .pm { color: #5a6560; font-size: 13.5px; }
.pp .csv { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pp .csv .ic { width: 15px; height: 15px; padding: 3px; box-sizing: content-box; border-radius: 6px; background: #e7eae4; color: #1b211d; }
.pp .ca { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pp .ca .btn, .pp .ca .bk { min-height: 36px; font-size: 14px; padding: 5px 10px; background: #fff; color: #1b211d; border-color: #d3d9d1; }
.pp .ca .bk { color: #0a3a86; border-color: #0a3a86; }
.pp .ca .btn.tel .ic { color: #1a8a4a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile { filter: brightness(.86); } }
:root[data-theme="dark"] .leaflet-tile { filter: brightness(.86); }

/* ---------- Roadbook: overview cards ---------- */
.stage-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.scard { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; gap: 2px 12px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 12px; padding: 10px 12px; color: inherit; text-decoration: none; min-width: 0; }
.scard .sn { grid-row: 1 / 4; font-family: var(--display); font-size: 40px; font-weight: 700; color: var(--c); line-height: 1; align-self: start; }
.scard .sd { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-family: var(--display); }
.scard .st { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.1; }
.scard .sv { font-size: 14.5px; display: block; border: 0; padding: 0; background: none; color: var(--fg); white-space: normal; }
.scard .sv b { font-family: var(--display); font-size: 17px; }
.scard .sh { font-size: 14px; color: var(--muted); grid-column: 2; }
.scard .snight { font-size: 14px; grid-column: 2; display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Roadbook: stage accordion ---------- */
.stage { border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 12px; margin-top: 12px; background: var(--card); overflow: hidden; }
.stage-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border: 0; background: transparent; color: var(--fg); font: inherit; cursor: pointer; }
.stage-num { font: 700 46px var(--display); color: var(--c); line-height: .9; }
.stage-title { display: grid; gap: 2px; min-width: 0; }
.stage-title .h { font: 700 22px var(--display); line-height: 1.05; text-wrap: balance; }
.stage-stats { font-size: 14px; color: var(--muted); }
.stage-stats b { color: var(--fg); font-family: var(--display); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chev { font-size: 24px; color: var(--muted); transition: transform .2s; }
.stage-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.stage-body { padding: 0 14px 16px; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.daybar { margin: 6px 0 10px; }
.daybar svg { width: 100%; height: auto; display: block; }
.dayleg { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.why { font-size: 16.5px; max-width: 76ch; border-left: 3px solid var(--c); padding-left: 12px; margin: 0 0 14px; }

.steps-head { display: none; }
.steps { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.step { display: grid; grid-template-columns: 58px 1fr; grid-template-areas: "km lieu" "km meta" "km srv" "km dist"; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); margin: 0; }
.step:last-child { border-bottom: 0; }
.step.warn { background: var(--warn-bg); }
.step.now { box-shadow: inset 4px 0 0 var(--geo); }
.step.past { opacity: .5; }
.step .km { grid-area: km; font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.step .km::before { content: 'km'; display: block; font-size: 10px; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.step .lieu { grid-area: lieu; min-width: 0; }
.step .lieu > b { display: block; font-size: 16.5px; font-weight: 700; line-height: 1.25; }
.step .lieu .sub { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.step .alt, .step .eta, .step .sfc { grid-area: meta; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.step .alt { justify-self: start; }
.step .eta { margin-left: 68px; }
.step .sfc { margin-left: 128px; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; font-weight: 600; }
.step .eta::before { content: '⏱ '; }
.step .sfc.p { color: var(--paved); } .step .sfc.g { color: var(--gravel); }
.step .srv { grid-area: srv; display: flex; flex-wrap: wrap; gap: 4px; }
.step .srv:empty { display: none; }
.step .dist { grid-area: dist; font-size: 13.5px; font-weight: 700; color: var(--geo); }
.step .dist:empty { display: none; }

.places { display: grid; grid-template-columns: 1fr; gap: 10px; }
.place { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.place.primary { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.place.early { border-style: dashed; }
.place-head { display: flex; justify-content: space-between; gap: 8px; font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); font-weight: 600; }
.place-head .role { display: inline-flex; align-items: center; gap: 5px; }
.place.primary .role { color: var(--accent); }
.place .meta { font-size: 13.5px; color: var(--muted); }
.place .note { font-size: 14.5px; margin: 0; }
.place .actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.place .actions .btn { min-height: 38px; font-size: 14px; padding: 6px 10px; }
.tel2 { font-size: 13px; color: var(--muted); }
.bkline { font-size: 14.5px; margin-top: 12px; }

/* ---------- village clusters ---------- */
.clusters { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cluster { background: var(--bg); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 10px; padding: 12px 14px; min-width: 0; display: grid; gap: 8px; align-content: start; }
.cluster header { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; }
.cluster .ck { grid-row: 1 / 4; display: grid; justify-items: center; min-width: 56px; padding-top: 2px; }
.cluster .ckm { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1; white-space: nowrap; }
.cluster .calt { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cluster h4 { font-size: 21px; line-height: 1.1; }
.cluster .csv { display: flex; flex-wrap: wrap; gap: 4px; }
.cluster .csv .ic { width: 17px; height: 17px; padding: 5px; box-sizing: content-box; border-radius: 7px; background: var(--soft); color: var(--fg); }
.cluster .dist { font-size: 13.5px; font-weight: 700; color: var(--geo); }
.cluster .dist:empty { display: none; }
.cluster .note { font-size: 14.5px; margin: 0; }
.addr summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--accent); }
.grps { display: grid; gap: 8px; padding-top: 4px; }
.grp .gh { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.grp .gh .ic { width: 15px; height: 15px; color: var(--fg); }
.grp ul { list-style: none; padding: 0; margin: 0; }
.pl { font-size: 14.5px; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; line-height: 1.35; }
.pl .nm { font-weight: 600; }
.pl.pin .nm { color: var(--accent); }
.pl .pm { color: var(--muted); font-size: 13px; }
.pl .tel { font-variant-numeric: tabular-nums; font-size: 13.5px; }
.cfoot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.cfoot .btn { min-height: 38px; font-size: 14px; padding: 6px 10px; text-transform: none; letter-spacing: 0; font-family: var(--body); }
.cfoot .bk { min-height: 38px; }
body.near .far { display: none !important; }

/* ---------- profile ---------- */
.profile, .sprof { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px 4px; position: relative; }
.profile .scroll, .sprof .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.profile svg { width: 100%; min-width: 820px; height: auto; display: block; }
.sprof { margin: 0 0 14px; padding: 6px 4px 2px; background: var(--bg); }
.sprof svg { width: 100%; min-width: 900px; height: auto; display: block; }
.tip { position: absolute; pointer-events: none; background: var(--fg); color: var(--bg); font-size: 13px; padding: 6px 9px; border-radius: 6px; transform: translate(-50%, -115%); white-space: nowrap; display: none; z-index: 3; font-variant-numeric: tabular-nums; }
.axis { font-size: 11px; fill: var(--muted); font-family: var(--body); }
.lbl { font-size: 11px; fill: var(--fg); font-family: var(--body); }
.stg { font-family: var(--display); font-size: 14px; font-weight: 700; fill: var(--fg); }
.grid { stroke: var(--line); stroke-width: 1; }
.pico { stroke: var(--fg); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pico.w { stroke: #0e7490; }
.surf-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); padding: 6px 6px 0; align-items: center; }
.surf-legend i { display: inline-block; width: 18px; height: 8px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; }
.hint { font-size: 12.5px; color: var(--muted); padding: 2px 6px 0; }

/* ---------- Infos ---------- */
.hero { padding-block: 8px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 14px; }
.hero .lead { font-size: 17px; max-width: 64ch; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; min-width: 0; }
.tile .v { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.two { display: grid; grid-template-columns: 1fr; gap: 20px; }
.two > div { min-width: 0; }
.grid3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid3 > div { min-width: 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 2px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td .ic { margin-right: 5px; color: var(--accent); }
.resa li { margin-bottom: 12px; }
.resa .btn { vertical-align: middle; }
.sos { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.src { font-size: 14px; color: var(--muted); }
.src li { margin-bottom: 4px; }
footer { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pwa { display: none; font-size: 13px; color: var(--muted); }
.pwa.show { display: block; }

/* ---------- ≥ 560px ---------- */
@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .places { grid-template-columns: repeat(2, 1fr); }
  .stage-cards { grid-template-columns: repeat(2, 1fr); }
  .clusters { grid-template-columns: repeat(2, 1fr); }
}
/* ---------- ≥ 720px ---------- */
@media (min-width: 720px) {
  .wrap { padding-inline: 24px; }
  .mapwrap { margin-inline: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .two { grid-template-columns: 1fr 1fr; gap: 28px; }
  .stage-num { font-size: 56px; }
  nav.tabs { max-width: 720px; left: 50%; transform: translateX(-50%); border-inline: 1px solid var(--line); border-radius: 14px 14px 0 0; }
}
/* ---------- ≥ 960px ---------- */
@media (min-width: 960px) {
  .tiles { grid-template-columns: repeat(6, 1fr); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .stage-cards { grid-template-columns: repeat(4, 1fr); }
  .clusters { grid-template-columns: repeat(3, 1fr); }
  .profile svg, .sprof svg { min-width: 0; }
  .steps-head, .step { display: grid; grid-template-columns: 56px 60px 56px minmax(0, 1fr) 180px 64px; grid-template-areas: "km alt eta lieu srv sfc" "km alt eta dist srv sfc"; gap: 0 10px; align-items: start; }
  .steps-head { padding: 8px 12px; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--line); }
  .steps { border: 0; background: transparent; }
  .step { background: var(--bg); border: 1px solid var(--line); border-top: 0; }
  .step:first-child { border-top: 1px solid var(--line); border-radius: 10px 10px 0 0; }
  .step:last-child { border-radius: 0 0 10px 10px; }
  .step .km::before { display: none; }
  .step .km { font-size: 18px; font-weight: 600; }
  .step .alt, .step .eta, .step .sfc { margin: 0; font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--fg); }
  .step .eta::before { content: ''; }
  .step .alt { grid-area: alt; } .step .eta { grid-area: eta; } .step .sfc { grid-area: sfc; font-size: 12px; font-family: var(--body); }
  .step .srv { grid-area: srv; }
  .step .srv:empty { display: block; }
  .grid3 { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
@media (prefers-reduced-motion: no-preference) { a { transition: color .15s; } }
@media print { nav.tabs, .top, .mapwrap, .toast { display: none !important; } .tab { display: block !important; } .stage-body { display: block !important; } .tip { display: none !important; } }
