/* Cap Météo — tableau de bord de sortie.
   Concept : la carte est le pare-brise ; les colonnes latérales sont les cadrans
   d'un compteur de vélo (chiffres condensés, codes couleur face/dos constants). */

@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/barlow-condensed-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #e9eeec;
  --surface: #fbfcfb;
  --surface-2: #f1f5f3;
  --ink: #13211e;
  --ink-2: #3a4b47;
  --muted: #61716c;
  --line: #d4ddd9;
  --brand: #0e4f7a;
  --brand-arrow: #f28c3a;
  --accent: #0e5f92;
  --accent-ink: #ffffff;
  --accent-soft: #dbe9f2;
  --face: #c4461f;
  --face-soft: #f7e0d5;
  --dos: #11738a;
  --dos-soft: #d4ebee;
  --cross: #b07f12;
  --calm: #b9c2be;
  --rain: #2d68cc;
  --temp: #b5482a;
  --comfort: rgba(56, 142, 92, 0.12);
  --night: rgba(19, 33, 30, 0.09);
  --g4: #24804f;
  --g3: #5e9b45;
  --g2: #c39417;
  --g1: #d5702b;
  --g0: #be3e2c;
  --warn-soft: #fbefd6;
  --bad-soft: #f8ddd8;
  --info-soft: #e2ebf3;
  --good-soft: #dcefe2;
  --t-paved: #5f6b72;
  --t-track: #c08524;
  --t-path: #5e8720;
  --t-unk: #9a8ecf;
  --t-none: #b9b19b;
  --t-mud: #5a3215;
  --t-snow: #6f9fd8;
  --snow: #8a63d2;
  --cloud: #6f7c7f;
  --backdrop: rgba(12, 22, 20, 0.45);
  --map-bg: #f2f0eb;
  --shadow: 0 1px 2px rgba(19, 33, 30, 0.06), 0 8px 24px -14px rgba(19, 33, 30, 0.28);
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1412;
    --surface: #121c1a;
    --surface-2: #192522;
    --ink: #e3ece8;
    --ink-2: #bccac5;
    --muted: #8b9c96;
    --line: #26332f;
    --brand: #1c6a9c;
    --brand-arrow: #f39a52;
    --accent: #62b1e4;
    --accent-ink: #06202f;
    --accent-soft: #14303f;
    --face: #f07b52;
    --face-soft: #3b2219;
    --dos: #43bcce;
    --dos-soft: #12323a;
    --cross: #e0b13e;
    --calm: #4a5753;
    --rain: #73a2f2;
    --temp: #f0896a;
    --comfort: rgba(90, 190, 130, 0.13);
    --night: rgba(0, 0, 0, 0.32);
    --g4: #3fb873;
    --g3: #83c062;
    --g2: #dcb23a;
    --g1: #ee8f4c;
    --g0: #ec6450;
    --warn-soft: #3a3016;
    --bad-soft: #3d1f1a;
    --info-soft: #182a38;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
    --good-soft: #163325;
    --t-paved: #a3afb6;
    --t-track: #dca447;
    --t-path: #93b84a;
    --t-unk: #ab9fe0;
    --t-none: #6a6656;
    --t-mud: #b07445;
    --t-snow: #8fb8ea;
    --snow: #b393f0;
    --cloud: #c9d3d4;
    --backdrop: rgba(0, 0, 0, 0.6);
    --map-bg: #191e1d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1412; --surface: #121c1a; --surface-2: #192522; --ink: #e3ece8; --ink-2: #bccac5; --muted: #8b9c96; --line: #26332f;
  --brand: #1c6a9c; --brand-arrow: #f39a52; --accent: #62b1e4; --accent-ink: #06202f; --accent-soft: #14303f;
  --face: #f07b52; --face-soft: #3b2219; --dos: #43bcce; --dos-soft: #12323a; --cross: #e0b13e; --calm: #4a5753;
  --rain: #73a2f2; --temp: #f0896a; --comfort: rgba(90, 190, 130, 0.13); --night: rgba(0, 0, 0, 0.32);
  --g4: #3fb873; --g3: #83c062; --g2: #dcb23a; --g1: #ee8f4c; --g0: #ec6450;
  --warn-soft: #3a3016; --bad-soft: #3d1f1a; --info-soft: #182a38;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
  --good-soft: #163325; --t-paved: #a3afb6; --t-track: #dca447; --t-path: #93b84a; --t-unk: #ab9fe0; --t-none: #6a6656; --t-mud: #b07445; --t-snow: #8fb8ea; --snow: #b393f0; --cloud: #c9d3d4;
  --backdrop: rgba(0, 0, 0, 0.6); --map-bg: #191e1d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--font-body);
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-xs { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 18px; line-height: 1; }

/* Contrôle segmenté */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; border-radius: 7px; min-height: 34px; padding: 0 8px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--line); }
.seg-sm button { min-height: 30px; font-size: 12.5px; padding: 0 9px; }

/* ------------------------------------------------------------ Barre du haut */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding-block: calc(8px + env(safe-area-inset-top, 0px)) 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font: 700 21px/1 var(--font-display); letter-spacing: .01em; }
.beta-tag { flex: 0 0 auto; margin-left: -2px; padding: 2px 7px 3px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-2); font: 600 11px/1.2 var(--font-body); letter-spacing: .02em; cursor: pointer; }
.beta-tag:hover { border-color: var(--accent); color: var(--accent); }
.feedback-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.feedback-box p { margin: 0; flex: 1 1 220px; font-size: 13px; color: var(--ink-2); }
.export-row { margin: 12px 0 4px; }
.share-link-note { margin: 4px 0 0; }
.share-color { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-color-label { font-size: 14px; color: var(--muted); }
.share-color .seg { flex: 1 1 220px; max-width: 340px; }
.ex-groups { border: 0; margin: 14px 0 6px; padding: 0; min-width: 0; }
.ex-groups legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.ex-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.ex-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; background: var(--surface); }
.ex-opt:has(input:checked) { border-color: var(--accent); }
.ex-opt input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: 0 0 auto; }
.ex-opt span:nth-of-type(1) { flex: 1 1 auto; }
.ex-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: center; }
.ex-preview { margin: 6px 0 12px; }
.ex-preview > summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.ex-formats .ex-fmt { margin-left: 6px; padding: 0 6px; border-radius: 4px; background: rgba(127,127,127,.18); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.btn-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.export-list { margin: 8px 0 14px; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.export-list li { padding: 7px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 13.5px; }
.export-list li.is-danger { border-left-color: var(--g0); }
.export-list .ex-name { font-weight: 600; }
.export-list .ex-text { display: block; color: var(--ink-2); font-size: 12.5px; }
.top-route { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 10px; overflow: hidden; }
.tr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tr-stats { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ------------------------------------------------------------ Panneaux */
.panel { background: var(--surface); }
.panel-pad { padding: 14px 16px; }
.panel-pad.pt0 { padding-top: 0; }
.panel-title { font: 600 13px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.sub-title { font: 600 15px/1.2 var(--font-body); }
#panel-settings .panel-pad + .panel-pad { border-top: 1px solid var(--line); }

/* Parcours */
.route-card { display: grid; gap: 6px; }
.sample-note { display: grid; gap: 9px; background: var(--accent-soft); color: var(--ink); border-radius: 8px; padding: 11px 12px; font-size: 13.5px; margin-bottom: 4px; }
/* Accueil (0.38) : ce que calcule l'appli, exemple par discipline, météo des cols sans fichier. */
.sample-lead { font-weight: 600; font-size: 15px; line-height: 1.35; }
.sample-pick { display: flex; align-items: center; gap: 10px; }
.sample-pick .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sample-pick .seg { flex: 1 1 auto; max-width: 300px; background: var(--surface); }
.sample-pick .seg button[aria-checked="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.sample-cols { padding-top: 9px; border-top: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.route-name { font: 600 22px/1.15 var(--font-display); overflow-wrap: anywhere; }
.route-stats { color: var(--muted); font-size: 14px; }
.route-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* Départ */
.days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.days button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 34px; padding: 0 13px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.days button[aria-checked="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.dep-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dep-row label { font-weight: 600; font-size: 14px; }
input[type="time"] { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: 600 18px var(--font-display); letter-spacing: .02em; }

/* Champs */
.field { display: grid; gap: 6px; margin-top: 12px; }
.field label, .field .label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.stepper { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 40px; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; max-width: 280px; }
.stepper button { height: 44px; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.stepper input { min-width: 0; height: 44px; border: 0; background: transparent; text-align: right; font: 600 24px/1 var(--font-display); padding: 0 6px; }
.stepper input:focus { outline: none; }
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.stepper .unit { color: var(--muted); font-size: 13px; padding-right: 8px; }
.velo-only { margin-bottom: 4px; }
.app:not([data-sport="velo"]) .velo-only { display: none; }
.app:not([data-sport="velo"]):not([data-sport="vtt"]) .bike-only { display: none; }
.app:not([data-sport="trail"]) .trail-only { display: none; }
#sportSeg button { padding: 0 4px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin-top: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); flex: 0 0 auto; }
.check small { display: block; font-size: 12.5px; font-weight: 400; }
.dur { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.dur b { font: 600 18px var(--font-display); color: var(--ink); }

/* Pauses */
.stops { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.stop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stop label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.stop input { width: 62px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: right; padding: 0 8px; font: 600 16px var(--font-display); }

/* Avancé */
.adv summary { cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; align-items: center; gap: 8px; }
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.adv[open] summary::before { transform: rotate(45deg); }
.adv output { font: 600 16px var(--font-display); color: var(--ink); margin-left: 6px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.about { display: grid; gap: 10px; margin-top: 10px; font-size: 14px; color: var(--ink-2); max-width: 62ch; }

/* ------------------------------------------------------------ Carte */
.mapwrap { position: relative; background: var(--surface-2); isolation: isolate; }
#map { position: absolute; inset: 0; background: var(--map-bg); }
#map.map-off { display: grid; place-items: center; }
.map-off-msg { max-width: 34ch; margin: 0; padding: 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.map-ctrl { position: absolute; top: 10px; z-index: 500; }
.map-ctrl-left { left: 10px; }
.map-ctrl-right { right: 10px; }
.seg-map { background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.ctl-3d { font: 700 12.5px/1 var(--font-display); letter-spacing: .02em; }
.ctrl-3d button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.ctrl-3d button[aria-pressed="true"]:hover { background: var(--accent); filter: brightness(1.08); }
.legend { position: absolute; left: 10px; bottom: calc(10px + var(--lift, 0px)); z-index: 500; background: color-mix(in srgb, var(--surface) 94%, transparent); border-radius: 8px; padding: 7px 9px; box-shadow: var(--shadow); font-size: 11.5px; min-width: 170px; pointer-events: none; }
.legend:empty { display: none; }
.legend-title { font-weight: 600; margin-bottom: 4px; color: var(--ink-2); }
.legend-bar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; }
.legend-bar i { flex: 1; }
.legend-labels { display: flex; color: var(--muted); margin-top: 2px; }
.legend-labels span { flex: 1; text-align: center; white-space: nowrap; }
.status { position: absolute; right: 44px; bottom: calc(10px + var(--lift, 0px)); z-index: 500; display: inline-flex; align-items: center; gap: 7px; background: color-mix(in srgb, var(--surface) 94%, transparent); border-radius: 999px; padding: 5px 11px; box-shadow: var(--shadow); font-size: 12.5px; color: var(--ink-2); max-width: calc(100% - 250px); }
.status:empty { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dot-ok { background: var(--g4); }
.dot-warn { background: var(--g2); }
.dot-bad { background: var(--g0); }
.dot-busy { background: var(--accent); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }
.maplibregl-map { font: 12px/1.35 var(--font-body); }
.maplibregl-ctrl-top-right { top: 46px; }
.maplibregl-ctrl-group { background: var(--surface); box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line); }
/* Boutons de zoom de MapLibre (icônes sombres) : éclaircis en thème sombre. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.maplibregl-ctrl-zoom-in, .maplibregl-ctrl-zoom-out, .maplibregl-ctrl-compass) .maplibregl-ctrl-icon { filter: invert(1) brightness(1.6); } }
:root[data-theme="dark"] :is(.maplibregl-ctrl-zoom-in, .maplibregl-ctrl-zoom-out, .maplibregl-ctrl-compass) .maplibregl-ctrl-icon { filter: invert(1) brightness(1.6); }
.maplibregl-ctrl-attrib { font-size: 10px; }
.ctrl-btn button { display: grid; place-items: center; color: var(--ink); }
.maplibregl-ctrl-attrib.maplibregl-compact { background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink-2); }
.maplibregl-ctrl-attrib a { color: inherit; }
.maplibregl-ctrl-attrib.maplibregl-compact-show { max-width: calc(100% - 20px); }
.maplibregl-marker { line-height: 1; }
.pin span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--font-body); color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.maplibregl-marker.pin { z-index: 3; }
.maplibregl-marker.wind-arrow { z-index: 1; }
.pin-start span { background: #13211e; }
.pin-end span { background: #0e5f92; }
.wind-arrow svg { display: block; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.25)); }
.wind-arrow b { position: absolute; left: 50%; top: 27px; transform: translateX(-50%); font: 700 11px/1 var(--font-display); color: #13211e; background: rgba(255,255,255,.88); padding: 1px 3px; border-radius: 3px; white-space: nowrap; }

/* ------------------------------------------------------------ Profil */
#panel-profile { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
/* Tuiles au point survolé : positions et largeurs fixes, chiffres tabulaires. */
.info { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
#panel-profile { container-type: inline-size; container-name: profile; }
@container profile (max-width: 599px) {
  .info { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile:nth-child(3n) { border-right: 0; }
  .tile:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
.tile { display: grid; gap: 1px; min-width: 0; padding: 7px 10px 8px; border-right: 1px solid var(--line); }
.tile:last-child { border-right: 0; }
.tile-k { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-k i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.tile-k i.dot-hollow { border: 1.5px solid var(--muted); background: transparent; }
.tile-v { font: 600 19px/1.15 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-v small { font: 500 12px var(--font-body); color: var(--muted); }
.tile-s { min-width: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-s .link { font-size: 12px; }
.tile.has-act { grid-template-columns: minmax(0, 1fr) auto; padding-right: 6px; container: ptile / inline-size; }
.tile-main { display: grid; gap: 1px; min-width: 0; }
/* Bouton « ajouter une pause » : sa propre zone, à droite dans la tuile du point. */
.tile-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 46px; margin-left: 8px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--accent); font: 600 11px/1 var(--font-body); cursor: pointer; transition: background .15s, border-color .15s; }
.tile-act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.tile-act:hover { background: var(--accent-soft); border-color: var(--accent); }
.tile-act:active { transform: scale(.97); }
.tile-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Tuile étroite (ordinateur portable, petit téléphone) : icône seule, le libellé reste en infobulle. */
@container ptile (max-width: 108px) {
  .tile-act { min-width: 30px; margin-left: 5px; padding: 0; }
  .tile-act span { display: none; }
  .tile-main .tile-k { letter-spacing: .02em; gap: 5px; }
}
.tile-bad { color: var(--g0); font-weight: 600; }
.info[data-empty] .tile-v { color: var(--muted); }
.w-face { color: var(--face); font-weight: 600; }
.w-dos { color: var(--dos); font-weight: 600; }
.profile-canvas { position: relative; flex: 1 1 auto; min-height: 0; padding: 0; }
.profile-canvas canvas { display: block; touch-action: pan-y; cursor: crosshair; }

/* ------------------------------------------------------------ Résumé */
.summary { display: grid; gap: 14px; }
.score-head { display: flex; align-items: center; gap: 14px; }
.dial { position: relative; width: 84px; height: 84px; flex: 0 0 auto; }
.dial svg { width: 100%; height: 100%; }
.dial-track { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.dial-val { fill: none; stroke-width: 7; stroke-linecap: round; }
.dial[data-level="4"] .dial-val { stroke: var(--g4); }
.dial[data-level="3"] .dial-val { stroke: var(--g3); }
.dial[data-level="2"] .dial-val { stroke: var(--g2); }
.dial[data-level="1"] .dial-val { stroke: var(--g1); }
.dial[data-level="0"] .dial-val { stroke: var(--g0); }
.dial-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 32px/1 var(--font-display); }
.dial-num small { font: 600 11px/1 var(--font-body); color: var(--muted); align-self: center; margin: 12px 0 0 1px; }
.grade-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.grade-row .link { font-size: 13px; }
.score-scale { border-collapse: collapse; margin: 4px 0 12px; font-size: 15px; }
.score-scale td { padding: 5px 18px 5px 0; border-bottom: 1px solid var(--line); }
.score-scale b[data-level="4"] { color: var(--g4); }
.score-scale b[data-level="3"] { color: var(--g3); }
.score-scale b[data-level="2"] { color: var(--g2); }
.score-scale b[data-level="1"] { color: var(--g1); }
.score-scale b[data-level="0"] { color: var(--g0); }
/* « Ta sortie » ouverte depuis une page de col : trois allures avec le temps de montée. */
.ts-level button { display: grid; gap: 2px; align-content: center; min-height: 48px; padding: 6px 4px; }
.ts-level .lv-time { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.ts-level button[aria-checked="true"] .lv-time { color: var(--ink-2); }
.ts-watts { display: block; margin-top: 10px; font-size: 14px; text-align: left; }
.score-text { display: grid; gap: 4px; min-width: 0; }
.eyebrow { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.grade { font: 700 30px/1 var(--font-display); letter-spacing: .01em; }
.grade[data-level="4"] { color: var(--g4); }
.grade[data-level="3"] { color: var(--g3); }
.grade[data-level="2"] { color: var(--g2); }
.grade[data-level="1"] { color: var(--g1); }
.grade[data-level="0"] { color: var(--g0); }
.chip { justify-self: start; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.conf-2 { background: var(--surface-2); }
.conf-1 { background: var(--warn-soft); border-color: transparent; }
.conf-0 { background: var(--bad-soft); border-color: transparent; }
.verdict { font-size: 15.5px; line-height: 1.5; max-width: 62ch; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi { background: var(--surface); padding: 10px 12px; display: grid; gap: 1px; min-width: 0; }
.kpi-k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-v { font: 600 25px/1.1 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi.tone-warn { box-shadow: inset 3px 0 0 var(--g2); }
.kpi.tone-bad { box-shadow: inset 3px 0 0 var(--g0); }
.kpi.tone-good { box-shadow: inset 3px 0 0 var(--g4); }
.sectors { display: grid; gap: 6px; }
.sectors-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; }
.sectors-head .muted { font-weight: 400; font-size: 12.5px; }
.sectors-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.sec { flex-basis: 0; }
.sec-face { background: var(--face); }
.sec-cross { background: var(--cross); }
.sec-tail { background: var(--dos); }
.sec-calm { background: var(--calm); }
.sectors-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); }
.sectors-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.sectors-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.alerts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.alert { padding: 8px 11px; border-radius: 8px; font-size: 13.5px; font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.alert > span { flex: 1 1 14em; }
.alert .btn { background: var(--surface); }
.alert-warn { background: var(--warn-soft); }
.alert-bad { background: var(--bad-soft); }
.alert-info { background: var(--info-soft); }
.alert-good { background: var(--good-soft); }
.breakdown summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); }
.parts { list-style: none; padding: 0; margin: 10px 0 8px; display: grid; gap: 4px; }
.parts li { display: flex; justify-content: space-between; font-size: 14px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.parts b { font: 600 16px var(--font-display); color: var(--g0); }
.parts b.pos { color: var(--g4); }
.source { line-height: 1.45; }
.notice { background: var(--surface-2); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; justify-items: start; }
.notice-error { background: var(--bad-soft); }
.skeleton-score { height: 84px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; margin-bottom: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ Créneaux */
#panel-optim, #panel-passages { border-top: 1px solid var(--line); }
.optim-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-end; }
.optim-head .panel-title { margin-bottom: 4px; }
.win { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.win input[type="time"] { min-height: 34px; font-size: 16px; padding: 0 6px; }
.heat-scroll { overflow-x: auto; margin: 0 -4px; padding: 2px 4px 6px; }
.heat { border-collapse: separate; border-spacing: 2px; }
.heat th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap; padding: 0 2px; }
.heat thead th { height: 16px; }
.heat tbody th, .heat thead th:first-child { position: sticky; left: 0; background: var(--surface); padding-right: 8px; z-index: 2; font-size: 12.5px; color: var(--ink-2); box-shadow: -6px 0 0 var(--surface), 2px 0 0 var(--surface); }
.cell { padding: 0; }
.hc { display: grid; place-items: center; width: 28px; height: 26px; border: 0; border-radius: 4px; font: 600 12.5px/1 var(--font-display); color: #fff; cursor: pointer; padding: 0; position: relative; }
.hc.lv4 { background: var(--g4); }
.hc.lv3 { background: var(--g3); }
.hc.lv2 { background: var(--g2); color: #1d1a0e; }
.hc.lv1 { background: var(--g1); }
.hc.lv0 { background: var(--g0); }
.hc.lowc { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.28) 0 3px, transparent 3px 7px); }
.hc.sel { outline: 2.5px solid var(--ink); outline-offset: 1px; z-index: 1; }
.hc.best::after { content: ''; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); border: 1.5px solid var(--surface); }
.cell.past, .cell.na { width: 28px; height: 26px; border-radius: 4px; background: var(--surface-2); }
.cell.na { background-image: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 5px); }
.heat-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.heat-legend span { display: inline-flex; align-items: center; gap: 5px; }
.heat-legend .hc { width: 12px; height: 12px; border-radius: 3px; cursor: default; }
.top { list-style: none; margin: 0; padding: 0 16px 6px; display: grid; gap: 8px; }
.top-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rank { font: 700 22px/1 var(--font-display); color: var(--muted); width: 18px; }
.top-when { font-size: 14.5px; }
.top-main { display: grid; gap: 2px; min-width: 0; }
.badge { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 6px; border-radius: 6px; font: 700 15px/1 var(--font-display); color: #fff; }
.badge.lv4 { background: var(--g4); } .badge.lv3 { background: var(--g3); } .badge.lv2 { background: var(--g2); color: #1d1a0e; } .badge.lv1 { background: var(--g1); } .badge.lv0 { background: var(--g0); }
.cmp-scroll, .pass-scroll { overflow-x: auto; padding: 0 16px 16px; }
.cmp, .pass { width: 100%; border-collapse: collapse; font-size: 13.5px; white-space: nowrap; }
.cmp th, .pass th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.cmp td, .pass td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.cmp tbody tr { cursor: pointer; }
.cmp tbody tr:hover { background: var(--surface-2); }
.cmp tr.sel { background: var(--accent-soft); }
.cmp .badge { min-width: 30px; height: 22px; font-size: 13.5px; }
.pass td.num b { font-weight: 600; }
.pass .wind { display: flex; align-items: center; gap: 4px; }
.pass .rel { fill: currentColor; flex: 0 0 auto; }
.pass .sky { color: var(--muted); }

/* ------------------------------------------------------------ Divers */
.dropzone { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, transparent); backdrop-filter: blur(2px); }
.dropzone div { padding: 28px 36px; border: 2px dashed var(--accent); border-radius: 16px; background: var(--surface); font: 600 24px var(--font-display); }
.toast {
  position: fixed; z-index: 2500; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 32px));
  background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px;
}
.toast .link { color: var(--surface); white-space: nowrap; }
.toast-error { background: var(--g0); color: #fff; }

/* ------------------------------------------------------------ Disposition PC (≥ 1080 px) */
@media (min-width: 1080px) {
  html, body { height: 100%; }
  .app {
    display: grid; height: 100dvh;
    grid-template-columns: 312px minmax(0, 1fr) 392px;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "top top top" "left main right";
  }
  .topbar { grid-area: top; }
  .col-left { grid-area: left; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); }
  .col-main { grid-area: main; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
  .col-right { grid-area: right; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); }
  .mapwrap { flex: 1 1 auto; min-height: 260px; }
  #panel-profile { flex: 0 0 auto; height: clamp(300px, 40%, 420px); }
  .tabbar { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Colonne centrale étroite : tuiles sur deux rangées, on agrandit le panneau du profil. */
@media (min-width: 1080px) and (max-width: 1379px) {
  #panel-profile { height: clamp(380px, 50%, 500px); }
}
@media (min-width: 1440px) {
  .app { grid-template-columns: 340px minmax(0, 1fr) 440px; }
}
/* Carte en grand sur ordinateur et tablette : elle occupe toute la fenêtre (Échap ou le bouton pour revenir). */
@media (min-width: 1080px) {
  .app.map-full .mapwrap { position: fixed; inset: 0; z-index: 1600; min-height: 0; }
}

/* ------------------------------------------------------------ Téléphone et tablette (< 1080 px) */
@media (max-width: 1079px) {
  .app { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .col { display: contents; }
  .topbar { order: 1; gap: 10px; }
  .top-route { display: none; }
  .top-actions { margin-left: auto; }
  .hide-sm { display: none; }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
  .mapwrap { order: 2; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; height: 36dvh; min-height: 220px; border-bottom: 1px solid var(--line); box-shadow: 0 6px 12px -10px rgba(0,0,0,.35); }
  .panel { display: none; order: 3; }
  #panel-passages { order: 4; }
  .app[data-tab="settings"] #panel-settings,
  .app[data-tab="summary"] #panel-summary,
  .app[data-tab="profile"] #panel-profile,
  .app[data-tab="profile"] #panel-passages,
  .app[data-tab="optim"] #panel-optim { display: block; }
  .app[data-tab="profile"] #panel-profile { display: flex; border-top: 0; }
  .app:not([data-tab="profile"]) #panel-profile { display: none; }
  #panel-optim, #panel-passages { border-top: 0; }
  .profile-canvas { flex: 0 0 auto; height: 340px; }
  .tile { padding: 6px 10px 7px; }
  .tile-v { font-size: 18px; }
  .legend { left: 8px; bottom: calc(8px + var(--lift, 0px)); min-width: 150px; }
  .map-ctrl { top: 8px; }
  .maplibregl-ctrl-top-right .maplibregl-ctrl-group:not(.ctrl-btn) { display: none; }
  /* Carte en plein écran */
  .app.map-full .mapwrap { position: fixed; inset: env(safe-area-inset-top, 0px) 0 0 0; height: auto; min-height: 0; z-index: 1600; border-bottom: 0; box-shadow: none; }
  .app.map-full .maplibregl-ctrl-top-right { bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
  .app.map-full .legend { bottom: calc(8px + env(safe-area-inset-bottom, 0px) + var(--lift, 0px)); }
  .app.map-full .maplibregl-ctrl-bottom-right { margin-bottom: env(safe-area-inset-bottom, 0px); }
  .maplibregl-ctrl-top-right { top: auto; bottom: 40px; }
  .map-ctrl-left { left: 8px; } .map-ctrl-right { right: 8px; }
  .tabbar {
    position: fixed; z-index: 1500; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 7px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar button[aria-current="page"] { color: var(--accent); }
  .panel-pad { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .toast { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 640px) and (max-width: 1079px) {
  .mapwrap { height: 42dvh; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .brand-name { font-size: 19px; }
  .top-actions .btn-primary span { display: none; }
  .top-actions .btn-primary { padding: 0 10px; }
  .seg-sm button { padding: 0 7px; font-size: 12px; }
  .legend { min-width: 132px; font-size: 10.5px; }
  .status { max-width: calc(100% - 160px); font-size: 11.5px; }
  .kpi-v { font-size: 22px; }
  .top-card { grid-template-columns: auto minmax(0, 1fr) auto; }
  .top-card .btn { grid-column: 2 / -1; justify-self: start; }
}


/* ------------------------------------------------------------ v2 : terrain, notice, informations */
.btn-icon { padding: 0; width: 34px; }
.btn-danger { background: var(--g0); border-color: var(--g0); color: #fff; }
.l-short { display: none; }

.t-paved { background: var(--t-paved); }
.t-track { background: var(--t-track); }
.t-path { background: var(--t-path); }
.t-unk { background: var(--t-unk); }
.t-none { background: var(--t-none); }
.terrain { display: grid; gap: 6px; }
.terrain .sectors-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
/* Pluie et neige des jours d'avant (0.39), toujours affichées en VTT, trail et rando. */
.before-line { margin: 12px 0 0; color: var(--ink-2); }
.mud { font-size: 14px; font-weight: 500; padding: 7px 10px 7px 12px; border-radius: 8px; box-shadow: inset 3px 0 0 var(--t-mud); background: var(--surface-2); }
.mud-good { box-shadow: inset 3px 0 0 var(--g4); background: var(--good-soft); }
.mud-info { box-shadow: inset 3px 0 0 var(--accent); background: var(--info-soft); }
.mud-warn { background: var(--warn-soft); }
.mud-bad { background: var(--bad-soft); }
.runs { color: var(--ink-2); }
.snow-tag { color: var(--snow); font-weight: 600; }
.pass .terr { color: var(--ink-2); }

.sample-banner {
  display: grid; gap: 9px; margin: 12px 16px 0; padding: 12px 14px;
  border-radius: var(--radius); background: var(--accent-soft); font-size: 14px;
}
.sample-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
/* Suite du bandeau, sous la note et la phrase météo (dans le résumé, déjà en retrait). */
.sample-more { margin: 2px 0 14px; }
.sample-more.sample-more-top { margin: 10px 16px 0; }
@media (min-width: 1080px) { .sample-banner { display: none; } }

.legend-cats { display: grid; grid-template-columns: repeat(2, auto); gap: 3px 12px; color: var(--ink-2); }
.legend-cats span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-cats i { width: 14px; height: 6px; border-radius: 3px; flex: 0 0 auto; }
.legend-note { color: var(--muted); }
.legend-extra { margin-top: 5px; }

.app-footer { display: grid; gap: 6px; padding-block: 18px 22px; }
.footer-title { font: 600 15px var(--font-display); color: var(--ink-2); }
.footer-title .ver { color: var(--muted); font-family: var(--font-body); font-weight: 500; font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }

/* Fenêtres (notice, à propos, mentions, confidentialité) */
dialog.sheet {
  border: 0; padding: 0; margin: auto; color: var(--ink); background: var(--surface);
  width: min(600px, calc(100vw - 32px)); max-height: min(86dvh, 820px);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet::backdrop { background: var(--backdrop); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font: 700 24px/1.1 var(--font-display); }
.sheet-body { overflow-y: auto; padding: 16px 20px 22px; display: grid; gap: 12px; font-size: 15px; overscroll-behavior: contain; }
.sheet-body h3 { font: 600 17px/1.25 var(--font-body); margin-top: 6px; }
.sheet-body .lead { font-size: 16px; color: var(--ink-2); max-width: 60ch; }
.prose p, .prose li { max-width: 64ch; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-tabs { margin-top: 2px; }
.help-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--line); }
.help-pane { display: grid; gap: 10px; }
.help-pick { display: grid; gap: 6px; }
.help-pick .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.help-src { display: grid; gap: 10px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding-left: 38px; min-height: 28px; line-height: 1.45; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px; width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 15px var(--font-display);
}
.tip { font-size: 14px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 9px 12px; }
.help-more { display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; }
.contact { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.contact-addr { font: 600 16px/1.3 var(--font-body); user-select: all; overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Partage de l'analyse en image */
.score-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.btn-share { display: inline-flex; align-items: center; gap: 7px; }
.share-preview { justify-self: center; width: min(100%, 380px); border-radius: 12px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); position: relative; }
.share-preview[data-format="portrait"] { width: min(100%, 330px); }
.share-preview img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: inherit; -webkit-touch-callout: default; }
.share-preview[data-format="portrait"] img { aspect-ratio: 4 / 5; }
.share-preview[aria-busy="true"]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 55%, transparent) 50%, transparent 70%); background-size: 220% 100%; animation: share-wait 1.3s linear infinite; pointer-events: none; }
@keyframes share-wait { from { background-position: 120% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .share-preview[aria-busy="true"]::after { animation: none; } }
.share-status { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); white-space: nowrap; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink-2); box-shadow: var(--shadow); z-index: 1; }
.share-status:empty { display: none; }
.share-note { text-align: center; color: var(--muted); }
.share-actions .btn { flex: 1 1 150px; min-height: 44px; font-size: 15px; }
.share-actions .btn:disabled { opacity: .55; cursor: default; }
.clear-box { padding: 4px 0; }
.sheet-links { font-size: 14px; }

@media (max-width: 1079px) {
  .app-footer { padding-bottom: 28px; }
  dialog.sheet {
    width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0;
  }
  .sheet-body { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
}
@media (max-width: 1079px) {
  .status { top: 50px; bottom: auto; right: 8px; max-width: calc(100% - 16px); }
}
@media (max-width: 640px) {
  .seg-map .l-long { display: none; }
  .seg-map .l-short { display: inline; }
}
@media (max-width: 420px) {
  .l-long { display: none; }
  .l-short { display: inline; }
  .seg-map button { padding: 0 6px; }
  .sample-banner:not(.sample-more) { margin: 10px 12px 0; }
  .sample-more.sample-more-top { margin: 10px 12px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------ v3 : sortie, meilleure heure */
.around-field { margin-top: 12px; }
.around { display: grid; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14.5px; min-width: 0; }
.around-better { background: var(--good-soft); }
.around-suggest { background: var(--warn-soft); }
.around-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0; }
.around-head p { margin: 0; flex: 1 1 15em; }
.around-ok { flex-wrap: nowrap; justify-content: flex-start; align-items: baseline; gap: 8px; color: var(--ink-2); font-size: 14px; }
.around-ok .dot { flex: 0 0 auto; transform: translateY(-1px); }
.slots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(42px, 1fr); gap: 4px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.slot { display: grid; justify-items: center; gap: 3px; min-width: 0; padding: 4px 2px 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); cursor: pointer; font: inherit; }
.slot:hover { border-color: var(--muted); }
.slot-t { font-size: 11.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.slot-v { min-width: 28px; padding: 0 5px; border-radius: 999px; font: 700 14px/1.35 var(--font-display); color: #fff; background: var(--g4); text-align: center; }
.slot-v[data-level="3"] { background: var(--g3); }
.slot-v[data-level="2"] { background: var(--g2); }
.slot-v[data-level="1"] { background: var(--g1); }
.slot-v[data-level="0"] { background: var(--g0); }
.slot.is-cur { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.slot.is-best { border-color: var(--g4); box-shadow: inset 0 0 0 1px var(--g4); }
.around-score { display: inline-grid; place-items: center; min-width: 30px; padding: 1px 6px; border-radius: 999px; font: 700 15px/1.3 var(--font-display); color: #fff; background: var(--g4); }
.around-score[data-level="3"] { background: var(--g3); }
.around-score[data-level="2"] { background: var(--g2); }
.around-score[data-level="1"] { background: var(--g1); }
.around-score[data-level="0"] { background: var(--g0); }
.btn-block { width: 100%; min-height: 46px; font-size: 15.5px; margin-top: 4px; }
/* « Ta sortie » : le bouton de validation reste visible en bas de la fenêtre, même quand le formulaire dépasse l'écran. */
#tripBody { padding-bottom: 0; }
.trip-go { position: sticky; bottom: 0; z-index: 1; margin-top: 2px; padding: 10px 0 calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--surface); box-shadow: 0 -14px 12px -10px var(--surface); }
.trip-go .btn-block { margin-top: 0; }
.trip-route { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 16px; }
.trip-route b { font: 700 19px/1.2 var(--font-display); }
.ts-mode { margin-bottom: 6px; }
.sheet-trip .field > .label, .sheet-trip .field > label { display: block; margin-bottom: 6px; }
.sheet-trip .days { margin-bottom: 0; }

/* Mes parcours */
.route-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.route-list li { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.route-list li.is-current { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.route-open { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.rl-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-meta { font-size: 12.5px; color: var(--muted); }
.route-list .icon-btn { margin-right: 6px; flex: 0 0 auto; }
.undo-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--info-soft); font-size: 14px; margin: 0; }

/* Textes conditionnés à la mesure d'audience (attribut posé au build). */
/* data-analytics-preview : version de test, qui montre les textes de la production sans rien compter. */
html:not([data-analytics]):not([data-analytics-preview]) .if-analytics { display: none; }
html[data-analytics] .if-no-analytics, html[data-analytics-preview] .if-no-analytics { display: none; }
.optout { margin: 10px 0 4px; }
.footer-about { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
h1.brand-name { margin: 0; }
/* Ancienne adresse */
.move-banner { position: fixed; z-index: 2000; left: 0; right: 0; top: 0; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; padding: 8px 14px; background: var(--accent-soft); color: var(--ink); font-size: 14px; text-align: center; }
.move-banner a { font-weight: 700; color: var(--accent); }
.summary > * { min-width: 0; }
.update-bar { position: fixed; z-index: 2600; left: 50%; transform: translateX(-50%); bottom: 18px; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); font-size: 14px; }
.footer-title .build { font-family: var(--font-body); font-weight: 400; }
@media (max-width: 1079px) {
  .update-bar { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}
body.no-scroll { overflow: hidden; }
/* Légende (bas-gauche) et état des prévisions (bas-droite, à côté du bouton « i ») : ils ne remontent
   que s'ils touchent les crédits de la carte, calculé dans src/ui/overlays.js (variable --lift). */

/* Choix du thème en bas de page (0.40.1). */
.footer-theme { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.footer-theme-label { font-size: 14px; color: var(--muted); }
.footer-theme .seg { width: auto; min-width: 230px; }

/* Invitation à installer l'appli (0.40.1). */
.install-card { position: relative; margin: 12px 0; padding: 12px 40px 12px 14px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.install-lead { margin: 0; font-weight: 600; color: var(--ink); line-height: 1.35; }
.install-steps { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); line-height: 1.5; }
p.install-steps { padding-left: 0; }
.install-steps li + li { margin-top: 4px; }
.install-actions { margin-top: 10px; }
.install-close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.install-close:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.ios-ico { vertical-align: -2px; color: var(--accent); }
.ios-dots { display: inline-block; padding: 0 5px; border-radius: 6px; background: var(--surface); color: var(--accent); font-weight: 700; line-height: 1.2; }

/* ---------------------------------------------------------------- Strava (0.41) */
.strava-entry { margin: 12px 0 4px; }
.strava-entry > div { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 12px; }
.strava-entry-text { margin: 0 0 8px; }
.strava-entry .muted { margin: 10px 0 0; }
.strava-connect { margin: 14px 0; }
.strava-connect-btn { display: inline-block; line-height: 0; border-radius: 6px; }
.strava-connect-btn img { height: 48px; width: auto; display: block; }
.strava-rules { padding-left: 18px; margin: 10px 0; }
.strava-rules li { margin: 4px 0; }
.strava-who { margin: 0 0 10px; }
.strava-rows { margin: 12px 0; min-height: 60px; }
.strava-list li { flex-wrap: wrap; }
.strava-list .route-open { flex: 1 1 auto; min-width: 0; }
.strava-view { color: #fc5200; font-weight: 700; font-size: 12px; padding: 0 10px 0 0; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.strava-priv { font-size: 12px; }
.strava-error { color: var(--danger, #b3261e); }
.strava-paste { margin: 16px 0 8px; display: grid; gap: 6px; }
.strava-paste-row { display: flex; gap: 8px; }
.strava-paste-row input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.strava-powered { margin: 16px 0 0; line-height: 0; }
.strava-powered img { height: 16px; width: auto; }
/* Logo orange sur fond sombre : version blanche du kit Strava. */
:root[data-theme="dark"] .strava-powered img { content: url("strava/api_logo_pwrdBy_strava_horiz_white.svg"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .strava-powered img { content: url("strava/api_logo_pwrdBy_strava_horiz_white.svg"); } }
.rl-strava { color: #fc5200; font-weight: 600; }

/* Choix à l'import : Strava ou fichier (0.41) */
.import-choice { display: grid; justify-items: start; gap: 10px; }
.import-choice p { margin: 0; }
.import-or { display: flex; align-items: center; gap: 10px; margin: 18px 0; }
.import-or::before, .import-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
