/* =====================================================================
   MÉTÉO RALLYE — STYLES
   1. Polices & variables      6. Panneau coulissant
   2. Base                     7. Contenus des panneaux
   3. Structure (grille)       8. Marqueurs de carte
   4. En-tête & navigation     9. Écran de lancement, toasts
   5. Carte, commandes,       10. Formats d'écran
      timeline                12. Mode plein soleil, accessibilité
                              13. Écrans tactiles
   ===================================================================== */

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

:root {
  /* Fonds (bleu nuit) */
  --bg-0: #07111d;
  --bg-1: #0c1928;
  --bg-2: #122a3f;
  --card: #10243a;
  --raised: #193450;
  --raised-2: #203e58;
  --panel-solid: #0f2235;
  --glass: rgba(12, 28, 44, 0.86);
  --line: #2c4963;
  --line-soft: rgba(122, 170, 214, 0.16);

  /* Textes */
  --text: #eaf3fa;
  --text-2: #adc3d5;
  --text-3: #7f99ae;

  /* Accent (logo) — réservé aux éléments interactifs */
  --accent: #57bfff;
  --accent-2: #1e9bff;
  --accent-ink: #04121f;

  /* Niveaux de risque — réservés aux informations météo */
  --lvl-green: #3ddc84;
  --lvl-yellow: #ffd23f;
  --lvl-orange: #ff9233;
  --lvl-red: #ff4f5e;
  --lvl-unknown: #7f99ae;
  --ink-on-lvl: #06121e;

  --font: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-cond: 'Barlow Condensed', 'Barlow', 'Arial Narrow', sans-serif;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --panel-w: min(400px, 46vw);
}

.lvl-green   { --lvl: var(--lvl-green); }
.lvl-yellow  { --lvl: var(--lvl-yellow); }
.lvl-orange  { --lvl: var(--lvl-orange); }
.lvl-red     { --lvl: var(--lvl-red); }
.lvl-unknown { --lvl: var(--lvl-unknown); }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%; margin: 0;
  background: var(--bg-1); color: var(--text);
  font: 500 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: var(--accent); }
h2, h3 { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.brand { font-family: var(--font-cond); font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: 0.01em; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 700; }

/* ---------- 3. Structure ---------- */
.app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "top" "stage" "timeline" "nav";
}
.topbar   { grid-area: top; }
.stage    { grid-area: stage; position: relative; overflow: hidden; overflow: clip; min-height: 0; }
.timeline { grid-area: timeline; }
.nav      { grid-area: nav; }

/* ---------- 4. En-tête & navigation ---------- */
.topbar {
  display: flex; align-items: center; gap: 6px;
  min-height: 56px;
  padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) 6px calc(10px + var(--safe-l));
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}
.topbar__brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.topbar__logo { width: 36px; height: 36px; flex: none; }
.topbar__titles { display: flex; flex-direction: column; min-width: 0; line-height: 1.12; }
.brand--sm { font-size: 18px; }
.topbar__rally { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__clock { display: none; font: 700 22px var(--font-cond); font-variant-numeric: tabular-nums; color: var(--text); margin-right: 8px; letter-spacing: 0.02em; }

.state-pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 30px; padding: 0 9px; border-radius: 15px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
  color: var(--text);
  background: color-mix(in srgb, var(--lvl) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--lvl) 60%, transparent);
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lvl); flex: none; }
.state-pill .dot { position: relative; box-shadow: 0 0 0 3px color-mix(in srgb, var(--lvl) 25%, transparent); }
/* Pulsation : uniquement transform + opacity (animée par le GPU, sans repeindre) */
.state-pill.lvl-orange .dot::after, .state-pill.lvl-red .dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--lvl);
  animation: beacon 2.2s ease-out infinite;
}
@keyframes beacon { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.8); opacity: 0; } }

.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--text); flex: none; }
.icon-btn .ic { width: 22px; height: 22px; }
.icon-btn--sm { width: 36px; height: 36px; }
.icon-btn--sm .ic { width: 20px; height: 20px; }

.badge {
  position: absolute; top: 3px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font: 800 11px/18px var(--font); text-align: center;
  color: var(--ink-on-lvl); background: var(--lvl, var(--accent));
  box-shadow: 0 0 0 2px var(--bg-2);
}
.badge.lvl-unknown { background: var(--accent); }

.nav {
  display: flex;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  z-index: 30;
}
.nav__btn {
  position: relative; flex: 1;
  height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 12px; font-weight: 600;
}
.nav__btn .ic { width: 23px; height: 23px; }
.nav__btn.is-active { color: var(--text); }
.nav__btn.is-active .ic { color: var(--accent); }
.nav__btn.is-active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.badge--nav { top: 5px; right: calc(50% - 24px); }

/* ---------- 5. Carte ---------- */
.map { position: absolute; inset: 0; z-index: 0; background: var(--bg-0); }
.leaflet-container { background: var(--bg-0); font-family: var(--font); }
.leaflet-container a { color: var(--text-2); }
.leaflet-control-attribution {
  background: rgba(7, 17, 29, 0.72) !important; color: var(--text-3);
  font-size: 10px; padding: 1px 6px; border-radius: 6px 0 0 0;
}
.leaflet-control-attribution a { color: var(--text-2); }
.leaflet-bottom.leaflet-right { transition: right 0.28s var(--ease); }

/* Fonds de carte : assombris pour laisser la météo dominer */
.tiles-dark  { filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9) saturate(0.45); }
.tiles-plain { filter: saturate(0.85); }
.tiles-sat   { filter: brightness(0.72) saturate(0.85) contrast(1.05); }
.tiles-topo  { filter: brightness(0.92) saturate(0.7); }
.tiles-shade { mix-blend-mode: multiply; }
.wx-img { image-rendering: auto; }

/* Commandes flottantes */
.mapctl { position: absolute; z-index: 10; pointer-events: none; }
.mapctl > * { pointer-events: auto; }
.mapctl--tl { top: 10px; left: calc(10px + var(--safe-l)); display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.mapctl--tr { top: 10px; right: calc(10px + var(--safe-r)); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; transition: right 0.28s var(--ease); }
.mapctl--bl { left: calc(10px + var(--safe-l)); bottom: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; transition: opacity 0.2s; }
.ctl-row { position: relative; display: flex; gap: 7px; }
.dropdown { position: static; }

.pill {
  height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px;
  border-radius: 11px; background: var(--glass); border: 1px solid var(--line);
  color: var(--text); font-weight: 700; font-size: 14px; white-space: nowrap;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.pill .ic { width: 18px; height: 18px; color: var(--accent); }
.pill .ic--caret { width: 16px; height: 16px; color: var(--text-2); margin-left: -2px; transition: transform 0.2s; }
.pill--strong { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.pill[aria-expanded="true"] { background: var(--raised-2); }
.pill[aria-expanded="true"] .ic--caret { transform: rotate(180deg); }

.map-status { display: flex; gap: 5px; flex-wrap: wrap; font-size: 10px; font-weight: 800; letter-spacing: 0.07em; }
.map-status > span { padding: 3px 7px; border-radius: 6px; background: var(--glass); border: 1px solid var(--line); color: var(--text-2); }
.map-status__demo { color: var(--accent) !important; border-style: dashed !important; border-color: color-mix(in srgb, var(--accent) 60%, transparent) !important; }
.map-status__age.is-stale { color: var(--lvl-orange); border-color: color-mix(in srgb, var(--lvl-orange) 60%, transparent); }

.btn-stack { display: flex; flex-direction: column; border-radius: 11px; overflow: hidden; box-shadow: var(--shadow-sm); }
.btn-stack .map-btn { border-radius: 0; box-shadow: none; }
.btn-stack .map-btn + .map-btn { border-top: 0; }
.map-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--line); border-radius: 11px; color: var(--text);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.map-btn.is-on { color: var(--accent); border-color: var(--accent); }

.legend {
  display: block; text-align: left; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 7px; font: 500 10.5px/1.2 var(--font); color: var(--text-2); min-width: 44px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.legend__title { display: flex; flex-direction: column; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; line-height: 1.15; }
/* Légende repliée : barre de couleurs seule (toucher pour déplier) */
.legend.is-collapsed { min-width: 0; padding: 6px 6px 7px; }
.legend.is-collapsed .legend__title { font-size: 9.5px; align-items: center; }
.legend.is-collapsed .legend__title small, .legend.is-collapsed .legend__row span { display: none; }
.legend.is-collapsed .legend__row { height: 9px; justify-content: center; }
.legend.is-collapsed .legend__row i { width: 16px; height: 9px; border-radius: 0; }
.legend.is-collapsed .legend__row:nth-child(2) i { border-radius: 3px 3px 0 0; }
.legend.is-collapsed .legend__row:last-child i { border-radius: 0 0 3px 3px; }
.legend__title small { font-weight: 600; color: var(--text-3); text-transform: none; letter-spacing: 0; }
.legend__row { display: flex; align-items: center; gap: 6px; height: 15px; white-space: nowrap; }
.legend__row i { width: 10px; height: 13px; border-radius: 2px; flex: none; }

.frame-tag {
  font: 800 10.5px/1 var(--font); letter-spacing: 0.06em; padding: 7px 9px; border-radius: 7px;
  background: var(--glass); border: 1px solid var(--line); color: var(--text);
}
.frame-tag[data-kind="observed"] { color: var(--text-2); }
.frame-tag[data-kind="forecast"] {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: repeating-linear-gradient(135deg, rgba(87, 191, 255, 0.14) 0 5px, rgba(12, 28, 44, 0.92) 5px 10px);
}
.map-hint {
  max-width: 270px; font-size: 12.5px; line-height: 1.35; padding: 8px 10px; border-radius: 9px;
  background: var(--glass); border: 1px solid var(--line); border-left: 3px solid var(--accent); color: var(--text);
}

/* Popovers (sélecteur de couche, Couches) */
.popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  width: 280px; max-width: calc(100vw - 20px);
  max-height: min(70vh, 460px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px;
  animation: pop 0.16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.pop-title { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 5px; }
.pop-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; text-align: left; color: var(--text); font-size: 14.5px; font-weight: 700; }
.pop-item .ic { color: var(--accent); }
.pop-item[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.pop-item__txt { flex: 1; min-width: 0; }
.pop-item__txt small { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.pop-item__check { opacity: 0; }
.pop-item[aria-checked="true"] .pop-item__check { opacity: 1; }
.pop-item.is-disabled { opacity: 0.5; cursor: default; }
.pop-item.is-disabled .ic { color: var(--text-3); }
.soon { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; color: var(--text-3); }
.pop-toggle { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 600; }
.pop-toggle > .ic { color: var(--accent); }
.pop-toggle > span:first-of-type { flex: 1; }
.pop-range { width: calc(100% - 20px); margin: 4px 10px 10px; accent-color: var(--accent); }

/* Interrupteurs */
.pop-toggle input, .switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch { position: relative; width: 42px; height: 24px; border-radius: 12px; background: var(--raised-2); border: 1px solid var(--line); flex: none; transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform 0.2s var(--ease), background 0.2s; }
input:checked + .switch, .switch.is-on { background: var(--accent-2); border-color: var(--accent-2); }
input:checked + .switch::after, .switch.is-on::after { transform: translateX(18px); background: #fff; }
input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Timeline ---------- */
.timeline {
  --thumb: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "ctrl readout" "main main";
  align-items: center;
  gap: 4px 10px;
  padding: 8px calc(12px + var(--safe-r)) 4px calc(12px + var(--safe-l));
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  z-index: 25;
}
.tl-ctrl { grid-area: ctrl; display: flex; align-items: center; gap: 4px; }
.tl-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text); }
.tl-btn .ic { width: 18px; height: 18px; }
.tl-btn--play { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.tl-btn--play .ic { width: 20px; height: 20px; }
.timeline.is-playing .tl-btn--play { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }

.tl-readout { grid-area: readout; justify-self: end; display: flex; align-items: center; gap: 10px; min-width: 0; }
.tl-stamp { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.tl-time { display: flex; align-items: baseline; gap: 6px; font: 700 24px/1 var(--font-cond); font-variant-numeric: tabular-nums; }
.tl-date { font: 600 11.5px var(--font); color: var(--text-3); }
.tl-rel { font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--text-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.timeline[data-kind="forecast"] .tl-rel { color: var(--accent); }
.timeline[data-kind="now"] .tl-rel { color: var(--text); }
.tl-now-btn { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }

.tl-main { grid-area: main; min-width: 0; }
.tl-track-wrap { position: relative; height: 34px; }
.tl-track {
  position: absolute; top: 5px; bottom: 5px;
  left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2);
  border-radius: 7px; overflow: hidden;
  background-color: var(--bg-0);
  background-image: repeating-linear-gradient(90deg, rgba(234, 243, 250, 0.08) 0 1px, transparent 1px calc(100% / var(--tl-steps, 42)));
  border: 1px solid var(--line);
}
.tl-zone { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em; white-space: nowrap; overflow: hidden; }
.tl-zone--obs { left: 0; background: rgba(87, 191, 255, 0.10); color: var(--text-3); }
.tl-zone--obs span { padding-left: 8px; }
.tl-zone--fc { right: 0; justify-content: flex-end; color: var(--accent); background: repeating-linear-gradient(135deg, rgba(87, 191, 255, 0.17) 0 5px, rgba(87, 191, 255, 0.05) 5px 10px); }
.tl-zone--fc span { padding-right: 8px; }
.tl-now-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); box-shadow: 0 0 6px rgba(255, 255, 255, 0.6); }
.tl-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-y;
}
.tl-range::-webkit-slider-runnable-track { height: 34px; background: transparent; }
.tl-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: var(--thumb); height: 32px; margin-top: 1px;
  border-radius: 7px; background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.tl-range::-moz-range-track { height: 34px; background: transparent; }
.tl-range::-moz-range-thumb { width: 12px; height: 26px; border-radius: 7px; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); }
.timeline[data-kind="forecast"] .tl-range::-webkit-slider-thumb { border-color: #fff; background: var(--accent); }
.timeline[data-kind="forecast"] .tl-range::-moz-range-thumb { border-color: #fff; background: var(--accent); }
.tl-range:focus-visible { outline: none; }
.tl-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent); }

.tl-ticks { position: relative; height: 18px; margin: 0 calc(var(--thumb) / 2); }
.tl-tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; color: var(--text-3); padding: 1px 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-tick--fc { color: color-mix(in srgb, var(--accent) 75%, var(--text-3)); }
.tl-tick--now { color: var(--text); font-weight: 800; }
.tl-tick--minor { display: none; }
/* graduations secondaires seulement si la timeline est assez large */
.tl-main { container-type: inline-size; }
@container (min-width: 520px) { .tl-tick--minor { display: block; } }

/* ---------- 6. Panneau coulissant ----------
   Téléphone : hauteur fixe, positions (aperçu / moitié / plein) obtenues
   par translation verticale → animation fluide, sans recalcul de mise en page.
   --sheet-y      : décalage vers le bas (piloté par js/sheet.js)
   --sheet-hidden : partie cachée sous l'écran, ajoutée en marge basse du contenu */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(100% - 8px);
  display: flex; flex-direction: column;
  background: var(--panel-solid);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.5);
  transform: translate3d(0, calc(100% + 24px), 0);
  visibility: hidden;
  will-change: transform;
  transition: transform 0.32s var(--ease), visibility 0s linear 0.32s;
}
.sheet.is-open { transform: translate3d(0, var(--sheet-y, 40%), 0); visibility: visible; transition: transform 0.32s var(--ease), visibility 0s; }
.sheet.is-dragging { transition: none; }
.sheet__grab { flex: none; height: 24px; display: flex; justify-content: center; align-items: center; cursor: grab; touch-action: none; }
.sheet__grab span { width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet__head { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px 10px 16px; border-bottom: 1px solid var(--line-soft); touch-action: none; }
.sheet__back { margin-left: -8px; }
.sheet__titles { flex: 1; min-width: 0; }
.sheet__kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet__title { font: 700 25px/1.08 var(--font-cond); letter-spacing: 0.01em; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet__badge { flex: none; }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(24px + var(--safe-b) + var(--sheet-hidden, 0px)); scroll-padding-top: 8px; }
.stage.has-sheet .mapctl--bl { opacity: 0; pointer-events: none; }

/* ---------- 7. Contenus des panneaux ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; white-space: nowrap;
  color: var(--text);
  background: color-mix(in srgb, var(--lvl, var(--lvl-unknown)) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--lvl, var(--lvl-unknown)) 60%, transparent);
}
.chip .dot { width: 8px; height: 8px; }

.sec-title { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font: 800 12.5px var(--font); text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-2); margin: 20px 0 9px; scroll-margin-top: 8px; }
.sec-title small { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-3); font-size: 12px; }
.sub { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; margin: -2px 0 8px; }
.sub .ic { width: 15px; height: 15px; color: var(--accent); }
.lead { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.hint { font-size: 12.5px; color: var(--text-3); margin: 8px 0; }
.empty { color: var(--text-3); font-size: 13.5px; padding: 14px; text-align: center; background: var(--card); border-radius: 10px; margin: 0; }
.count { font: 800 11px/1 var(--font); background: var(--raised-2); color: var(--text); padding: 3px 7px; border-radius: 9px; }
.foot { font-size: 11.5px; color: var(--text-3); margin: 14px 0 0; line-height: 1.45; }
.demo-word { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.demo-note { font-size: 12px; color: var(--accent); border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); padding: 7px 10px; border-radius: 8px; margin: 10px 0 0; }

/* Impact ES */
.impact {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 10px;
  background: color-mix(in srgb, var(--lvl) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--lvl) 40%, transparent);
  border-left: 4px solid var(--lvl);
}
.impact--none { --lvl: var(--lvl-green); }
.impact__label { font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.impact__value { font: 700 34px/1.05 var(--font-cond); font-variant-numeric: tabular-nums; margin: 3px 0 2px; }
.impact--none .impact__value { font-size: 26px; }
.impact__rel { font-size: 13px; color: var(--text-2); }

/* Valeurs clés */
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.kv-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv { background: var(--card); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.kv > span { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv > span .ic { width: 13px; height: 13px; color: var(--accent); }
.kv > b { display: flex; align-items: baseline; gap: 3px; flex-wrap: wrap; font: 700 22px/1.15 var(--font-cond); margin-top: 3px; font-variant-numeric: tabular-nums; }
.kv > b small { font: 600 12px var(--font); color: var(--text-2); }
.kv > b.normal { font: 600 15px/1.35 var(--font); }
.kv > small { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.kv--wide { grid-column: 1 / -1; }
.kv--warn { border-color: color-mix(in srgb, var(--lvl-yellow) 55%, transparent); }
.kv--warn > small { color: var(--lvl-yellow); }

/* Probabilités */
.probs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.prob { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 4px 8px; background: var(--card); border-radius: 10px; border: 1px solid var(--line-soft); }
.prob__bar { position: relative; width: 16px; height: 56px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.prob__bar i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--lvl); border-radius: 4px 4px 0 0; transition: height 0.4s var(--ease); }
.prob b { font: 700 21px/1 var(--font-cond); font-variant-numeric: tabular-nums; }
.prob span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.conf { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.conf__bar { flex: 1; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.conf__bar i { display: block; height: 100%; background: var(--text-2); border-radius: 3px; }
.conf b { font: 700 18px var(--font-cond); color: var(--text); }

/* Contrôle segmenté */
.seg { display: flex; gap: 3px; padding: 3px; background: var(--bg-0); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.seg__btn { flex: 1; height: 34px; border-radius: 7px; font-weight: 700; font-size: 13px; color: var(--text-2); white-space: nowrap; padding: 0 6px; }
.seg__btn.is-on { background: var(--raised-2); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.seg--sm .seg__btn { height: 30px; font-size: 12.5px; }
.seg--wrap { flex-wrap: wrap; margin: 0 6px 6px; }
.seg--wrap .seg__btn { flex: 1 1 40%; }

/* Profil PK d'une ES */
.pk-strip { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; }
.pk-cell {
  height: 40px; border-radius: 5px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px;
  font: 700 12.5px var(--font-cond); color: var(--ink-on-lvl);
  background: color-mix(in srgb, var(--lvl) 85%, var(--bg-0));
}
.pk-cell.lvl-green { background: color-mix(in srgb, var(--lvl) 30%, var(--bg-0)); color: var(--text); }
.pk-strip--dense { gap: 2px; }
.pk-strip--dense .pk-cell { height: 30px; border-radius: 3px; }
.pk-strip--dense .pk-cell span { display: none; }
.pkm__km { white-space: nowrap; overflow: visible; }
.pk-strip__ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.key-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text-2); margin-top: 8px; }
.key-legend span { display: inline-flex; align-items: center; gap: 5px; }
.key-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--lvl); }
.key-legend i.lvl-green { background: color-mix(in srgb, var(--lvl) 45%, var(--bg-0)); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 46px; padding: 0 14px; border-radius: 11px;
  background: var(--raised); border: 1px solid var(--line); color: var(--text);
  font-weight: 700; font-size: 14.5px; white-space: nowrap;
}
.btn .ic { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--block { width: 100%; }
.btn--lg { height: 54px; font-size: 16px; }
.btn:disabled { opacity: 0.38; }
.btn.is-busy { opacity: 0.6; pointer-events: none; }
.actions { display: flex; gap: 8px; margin: 16px 0 4px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 0; min-width: 0; }
.actions--3 .btn { padding: 0 8px; }

/* État route */
.road {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--lvl) 65%, transparent);
  background: color-mix(in srgb, var(--lvl) 8%, transparent);
}
.road__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.tag-est { font-size: 10px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--text-3); color: var(--text); letter-spacing: 0.08em; }
.road__value { display: flex; align-items: center; gap: 9px; font: 700 30px/1.1 var(--font-cond); letter-spacing: 0.04em; margin: 4px 0 5px; }
.road__value::before { content: ''; width: 13px; height: 13px; border-radius: 50%; background: var(--lvl); flex: none; }
.road p { font-size: 12.5px; color: var(--text-2); margin: 0; }

/* Tableau des PK */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.pk-table { width: 100%; border-collapse: separate; border-spacing: 0 3px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pk-table th, .pk-table td { padding: 9px 6px; text-align: center; }
.pk-table thead th { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; font-weight: 800; letter-spacing: 0.05em; padding-top: 0; padding-bottom: 2px; }
.pk-table tbody tr { background: var(--card); cursor: pointer; }
.pk-table tbody tr:hover, .pk-table tbody tr:focus-visible { background: var(--raised); outline: none; }
.pk-table tbody th { text-align: left; font-weight: 800; white-space: nowrap; border-radius: 8px 0 0 8px; }
.pk-table tbody td:last-child { border-radius: 0 8px 8px 0; }
.pk-table td.p { font-weight: 800; box-shadow: inset 0 -4px 0 -1px var(--lvl); }
.pk-table td.p.lvl-green { box-shadow: none; color: var(--text-2); font-weight: 600; }
.pk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lvl); margin-right: 6px; vertical-align: 1px; }
.road-cell { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px;
  padding: 10px 12px; border-radius: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line-soft); color: var(--text);
}
.row--static { cursor: default; }
.row__icon { width: 38px; height: 38px; border-radius: 10px; background: var(--raised); display: grid; place-items: center; flex: none; color: var(--accent); }
.row__icon .ic { width: 19px; height: 19px; }
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__main b { font-size: 15px; font-weight: 700; }
.row__main small { font-size: 12.5px; color: var(--text-2); }
.row__main em { font-size: 13px; font-style: italic; color: var(--text); }
.row__side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.row__side small { font-size: 11.5px; color: var(--text-3); }
.row__side small.is-stale { color: var(--lvl-orange); }
.row__go { color: var(--text-3); margin-left: auto; }
.big { font: 700 23px/1 var(--font-cond); font-variant-numeric: tabular-nums; }
.obs-ic { color: var(--lvl); background: color-mix(in srgb, var(--lvl) 16%, transparent); }
.es-ic { font: 700 14px var(--font-cond); color: var(--ink-on-lvl); background: var(--lvl); }
.validity { font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 10px; background: var(--raised-2); white-space: nowrap; }
.list--past .row { opacity: 0.62; }

/* Cartes ES */
.es-cards { display: flex; flex-direction: column; gap: 8px; }
.es-card {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line-soft); border-left: 4px solid var(--lvl); color: var(--text);
}
.es-card__id { font: 700 24px/1 var(--font-cond); min-width: 40px; }
.es-card__main { flex: 1; min-width: 0; }
.es-card__main b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-card__main small { display: block; font-size: 12.5px; color: var(--text-2); }
.es-card__side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.es-card__side small { font-size: 11.5px; color: var(--text-2); }
.es-card__side small b { color: var(--text); font-size: 13px; }

/* Matrice PK × horizons */
.pkm { margin-bottom: 8px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px; }
.pkm__title { display: flex; align-items: baseline; gap: 7px; font: 700 16px var(--font-cond); color: var(--text); }
.pkm__title .dot { align-self: center; }
.pkm__title small { font: 500 12px var(--font); color: var(--text-3); }
.pkm__grid { display: grid; grid-template-columns: 34px repeat(var(--n), minmax(0, 1fr)); gap: 2px; margin-top: 8px; align-items: center; }
.pkm__km, .pkm__corner { font-size: 10px; color: var(--text-3); text-align: center; font-weight: 700; }
.pkm__h { font-size: 10.5px; color: var(--text-2); font-weight: 800; }
.pkm__c { height: 20px; border-radius: 3px; background: color-mix(in srgb, var(--lvl) 85%, var(--bg-0)); }
.pkm__c.lvl-green { background: color-mix(in srgb, var(--lvl) 28%, var(--bg-0)); }

/* Synthèse & bannières */
.summary {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--lvl) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--lvl) 45%, transparent);
}
.summary > .ic { color: var(--lvl); width: 22px; height: 22px; }
.summary b { display: block; font-size: 15px; }
.summary span { font-size: 13px; color: var(--text-2); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); margin: 0 0 12px; }
.banner .ic { color: var(--accent); }
.banner--warn { border-color: color-mix(in srgb, var(--lvl-orange) 60%, transparent); color: var(--text); }
.banner--warn .ic { color: var(--lvl-orange); }
.jump { display: flex; gap: 6px; overflow-x: auto; margin: -4px -16px 12px; padding: 0 16px 2px; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; padding: 6px 12px; border-radius: 15px; background: var(--raised); color: var(--text-2); font-size: 12.5px; font-weight: 700; text-decoration: none; border: 1px solid var(--line); }

/* Parc / Point Météo */
.hero-wx { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; margin: 4px 0 10px; }
.hero-wx__t { font: 700 66px/0.9 var(--font-cond); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-wx__t small { font-size: 22px; color: var(--text-2); margin-left: 2px; vertical-align: top; }
.hero-wx__side { display: grid; gap: 6px; }
.hero-wx__side .kv { padding: 7px 10px; }
.hero-wx__side .kv > b { font-size: 19px; }
.situation { display: flex; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-soft); }
.situation > .ic { color: var(--accent); margin-top: 1px; }
.situation span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.situation b { display: block; font-size: 15px; font-weight: 600; margin-top: 2px; }
.wind-arrow { width: 16px; height: 16px; color: var(--accent); align-self: center; margin-right: 1px; }
.obs-age { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line-soft); font-size: 13.5px; color: var(--text-2); }
.obs-age b { color: var(--text); }
.obs-age .ic { color: var(--accent); }
.obs-age.is-stale { border-color: color-mix(in srgb, var(--lvl-orange) 60%, transparent); }
.obs-age.is-stale .ic { color: var(--lvl-orange); }

/* Prévisions horaires */
.fc-row { display: grid; grid-auto-flow: column; grid-auto-columns: 76px; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.fc-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px; border-radius: 11px; background: var(--card); border: 1px solid var(--line-soft); font-size: 11.5px; color: var(--text-2); }
.fc-card.is-wet { border-color: rgba(54, 170, 255, 0.55); background: color-mix(in srgb, #36aaff 10%, var(--card)); }
.fc-card__t { font-weight: 800; color: var(--text); font-size: 12px; }
.fc-card__ic { width: 22px; height: 22px; color: var(--accent); }
.fc-card b { font: 700 21px/1 var(--font-cond); color: var(--text); }
.fc-card__p { font-weight: 700; color: var(--text); }
.skeleton { height: 100px; border-radius: 12px; background: linear-gradient(90deg, var(--card) 0%, var(--raised) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton--tall { height: 230px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Historique 48 h */
.hc { position: relative; margin-top: 10px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 6px 4px; }
.hc-svg { width: 100%; height: auto; display: block; overflow: visible; }
.hc-grid { stroke: var(--line-soft); stroke-width: 1; }
.hc-base { stroke: var(--line); stroke-width: 1; }
.hc-day { stroke: var(--line); stroke-dasharray: 3 3; }
.hc-ylab, .hc-xlab, .hc-daylab, .hc-unit-t { fill: var(--text-3); font: 600 11px var(--font); }
.hc-ylab { text-anchor: end; }
.hc-xlab { text-anchor: middle; }
.hc-daylab { fill: var(--text-2); font-weight: 800; }
.hc-bar { fill: #36aaff; }
.hc-hit { fill: transparent; cursor: pointer; }
.hc-hit.is-on { fill: rgba(234, 243, 250, 0.08); }
.hc-tip { position: absolute; top: 2px; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-sm); color: var(--text-2); text-align: center; }
.hc-tip b { display: block; font-size: 15px; color: var(--text); }
.details { margin-top: 10px; font-size: 13px; }
.details summary { cursor: pointer; color: var(--accent); font-weight: 700; padding: 6px 0; }
.mini-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mini-table th, .mini-table td { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.mini-table th { font-size: 11px; color: var(--text-3); text-transform: uppercase; }

/* Alertes */
.alert-row {
  display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px; border-radius: 12px; text-align: left; color: var(--text);
  background: color-mix(in srgb, var(--lvl) 11%, var(--card));
  border: 1px solid color-mix(in srgb, var(--lvl) 45%, transparent);
  border-left: 4px solid var(--lvl);
}
.alert-row__ic { width: 22px; height: 22px; color: var(--lvl); }
.alert-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-row__main b { font-size: 15px; }
.alert-row__main span { font-size: 13.5px; }
.alert-row__main small { font-size: 11.5px; color: var(--text-3); }
.alert-row__go { color: var(--text-3); }

/* Rallye */
.info-card { padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-soft); }
.info-card > div { display: flex; gap: 10px; align-items: center; }
.info-card > div > .ic { color: var(--accent); }
.info-card b { display: block; font-size: 15px; }
.info-card small { font-size: 12.5px; color: var(--text-2); }
.sched { list-style: none; margin: 0 0 0 6px; padding: 0; border-left: 2px solid var(--line); }
.sched li { position: relative; display: flex; gap: 12px; align-items: baseline; padding: 7px 0 7px 16px; font-size: 14px; }
.sched li::before { content: ''; position: absolute; left: -7px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-1); border: 2px solid var(--line); }
.sched time { font: 700 17px var(--font-cond); min-width: 44px; font-variant-numeric: tabular-nums; }
.sched .is-past { color: var(--text-3); }
.sched .is-next { font-weight: 700; }
.sched .is-next::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.sched em { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 2px 6px; border-radius: 5px; margin-left: auto; }
.safety { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.safety li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line-soft); font-size: 14px; }
.safety .ic { color: var(--accent); width: 19px; height: 19px; margin-top: 1px; }

/* Partenaires */
.partner-grid { display: grid; gap: 8px; }
.partner-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-soft); color: var(--text); text-decoration: none; }
.partner-card__logo { width: 96px; height: 54px; border-radius: 8px; background: #fff; display: grid; place-items: center; flex: none; padding: 6px; overflow: hidden; }
.partner-logo { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.partner-logo--text { font: 700 12px/1.1 var(--font-cond); color: #10243a; text-align: center; }
.partner-card__txt { flex: 1; min-width: 0; }
.partner-card__txt b { display: block; font-size: 14.5px; }
.partner-card__txt small { font-size: 12px; color: var(--text-2); }
.partner-card__ext { color: var(--text-3); width: 16px; height: 16px; }
.pm-partner { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--line); }
.pm-partner__label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.pm-partner__body { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-2); }
.pm-partner__logo { height: 42px; width: auto; max-width: 150px; background: #fff; border-radius: 6px; padding: 4px 8px; object-fit: contain; display: grid; place-items: center; }
.pm-partner__name { font-size: 13.5px; font-weight: 700; }
.pm-partner__note { font-size: 11px; color: var(--text-3); margin: 6px 0 0; }

/* Observations : formulaire */
.obs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.obs-type {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 12px; border-radius: 12px; text-align: left;
  background: var(--card); border: 1.5px solid var(--line); color: var(--text); font-weight: 700; font-size: 14.5px;
}
.obs-type .ic { width: 22px; height: 22px; color: var(--lvl); }
.obs-type[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--card)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.field small { font-weight: 500; color: var(--text-3); }
.field input { height: 48px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-0); color: var(--text); padding: 0 12px; font: 500 16px var(--font); }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.switch-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-soft); margin-bottom: 12px; cursor: pointer; }
.switch-row__txt { flex: 1; font-weight: 700; font-size: 14.5px; }
.switch-row__txt small { display: block; font-weight: 500; font-size: 12px; color: var(--text-3); }
.obs-meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.obs-meta .ic { width: 16px; height: 16px; color: var(--accent); }

/* Menu */
.menu-list .row { min-height: 60px; }
.about { display: flex; gap: 12px; align-items: center; margin-top: 18px; padding: 12px; border-radius: 12px; background: var(--card); }
.about b { display: block; font-family: var(--font-cond); font-size: 19px; font-style: italic; text-transform: uppercase; }
.about small { display: block; font-size: 12px; color: var(--text-2); }
.src-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.src-list li { padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line-soft); }
.src-list b { display: block; font-size: 14px; }
.src-list span { font-size: 12.5px; color: var(--text-2); }

/* ---------- 8. Marqueurs de carte ---------- */
.mk { background: none; border: 0; display: flex; align-items: center; justify-content: center; }
.mk-es { justify-content: flex-start; }
.es-start { display: inline-flex; align-items: center; gap: 0; cursor: pointer; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.es-start__dot { width: 24px; height: 24px; border-radius: 50%; background: var(--lvl); border: 3px solid #fff; display: grid; place-items: center; position: relative; z-index: 1; }
.es-start__dot::after { content: ''; border-left: 7px solid var(--ink-on-lvl); border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-left: 2px; }
.es-start__tag {
  margin-left: -6px; padding: 2px 8px 2px 10px; border-radius: 0 8px 8px 0;
  background: var(--panel-solid); border: 2px solid var(--lvl); border-left: 0;
  font: 700 14px/1.15 var(--font-cond); color: var(--text); letter-spacing: 0.02em; white-space: nowrap;
}
.leaflet-marker-icon.is-selected .es-start__tag { background: var(--lvl); color: var(--ink-on-lvl); }
.es-finish {
  display: block; width: 16px; height: 16px; border-radius: 3px; border: 2px solid #fff;
  background: conic-gradient(#fff 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / 7px 7px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.pk-chip {
  display: inline-flex; align-items: center; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--panel-solid); border: 2px solid var(--lvl); color: var(--text);
  font: 700 11px/1 var(--font); white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.pk-chip.lvl-green { border-color: color-mix(in srgb, var(--lvl) 70%, var(--panel-solid)); }
.st-mk {
  display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 6px 0 4px; border-radius: 6px;
  background: rgba(7, 17, 29, 0.88); border: 1px solid var(--line); color: var(--text);
  font: 700 12px/1 var(--font); cursor: pointer; white-space: nowrap;
}
.st-mk .ic { width: 13px; height: 13px; color: var(--text-3); }
.st-mk.is-stale { opacity: 0.6; border-style: dashed; }
.park-mk {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--raised-2); border: 2px solid var(--accent); color: #fff; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.park-mk .ic { width: 18px; height: 18px; }
.park-mk--regroupement { border-color: var(--text-2); }
.obs-mk {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel-solid); border: 2px solid var(--lvl); color: var(--lvl); cursor: pointer;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
}
.obs-mk .ic { width: 15px; height: 15px; }
.user-dot { position: relative; display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-2); border: 3px solid #fff; }
.user-dot::after { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: 50%; background: rgba(30, 155, 255, 0.5); animation: userPulse 2s ease-out infinite; }
@keyframes userPulse { from { transform: scale(1); opacity: 0.8; } to { transform: scale(2.6); opacity: 0; } }
.user-acc { fill: var(--accent); fill-opacity: 0.1; stroke: var(--accent); stroke-opacity: 0.5; }
.focus-ring { display: block; width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(87, 191, 255, 0.5); animation: ring 1.6s var(--ease) infinite; }
@keyframes ring { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.15); opacity: 0.2; } }
.leaflet-marker-icon:focus-visible { outline: none; }
.leaflet-marker-icon:focus-visible > * { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Infobulles au survol (PC) */
.leaflet-tooltip.mr-tip {
  background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm); padding: 7px 10px; font: 500 12.5px/1.4 var(--font); white-space: nowrap;
}
.mr-tip > b:first-child { display: block; font-size: 13.5px; }
.mr-tip > span, .mr-tip > small { display: block; }
.mr-tip small { color: var(--text-3); font-size: 11px; margin-top: 2px; }
.mr-tip__lvl { display: flex !important; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; margin: 2px 0; }
.leaflet-tooltip-top.mr-tip::before { border-top-color: var(--line); }
.leaflet-tooltip-right.mr-tip::before { border-right-color: var(--line); }
.leaflet-tooltip-left.mr-tip::before { border-left-color: var(--line); }
.leaflet-tooltip-bottom.mr-tip::before { border-bottom-color: var(--line); }

/* Raccourcis clavier */
.kbd-list { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.kbd-list > div { display: flex; align-items: center; gap: 14px; padding: 9px 12px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 10px; }
.kbd-list dt { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 132px; font-size: 12.5px; color: var(--text-2); }
.kbd-list dd { margin: 0; font-size: 13.5px; }
kbd {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 6px;
  background: var(--raised-2); border: 1px solid var(--line); border-bottom-width: 2px;
  font: 700 12px var(--font); color: var(--text);
}
.kbd-or { font-size: 11px; color: var(--text-3); }

/* ---------- 9. Écran de lancement & toasts ---------- */
.splash {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center;
  background: radial-gradient(120% 80% at 50% 30%, #17375a 0%, #0c1928 55%, #07111d 100%);
  transition: opacity 0.4s ease, visibility 0.4s;
  padding: var(--safe-t) 16px var(--safe-b);
}
.splash.is-out { opacity: 0; visibility: hidden; }
.splash__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.splash__logo { width: 168px; height: 168px; filter: drop-shadow(0 14px 34px rgba(30, 155, 255, 0.38)); animation: splashIn 0.7s var(--ease) both; }
@keyframes splashIn { from { opacity: 0; transform: scale(0.86); } }
.splash__title { font-size: 40px; line-height: 1; margin-top: 6px; }
.splash__by { font-size: 14px; color: var(--text-2); }
.splash__by strong { color: var(--text); }
.splash__partner { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
.splash__support { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.splash__logos { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.splash__plogo { height: 48px; width: auto; background: #fff; border-radius: 8px; padding: 6px 10px; }
.splash__tag { margin-top: 18px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); padding: 4px 10px; border-radius: 6px; }

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 2000;
  bottom: calc(176px + var(--safe-b));
  display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none;
}
.toast { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s var(--ease); }
.toast.is-in { opacity: 1; transform: none; }
.toast .ic { color: var(--accent); }
.toast--ok .ic { color: var(--lvl-green); }
.toast--warn .ic, .toast--error .ic { color: var(--lvl-orange); }

/* ---------- 10. Formats d'écran ----------
   Téléphone portrait (< 768 px) ......... panneau du bas (3 positions), navigation en bas
   Tablette portrait (768–1023 px) ....... panneau latéral, navigation en bas
   Tablette paysage, PC (≥ 1024 px) ...... rail de navigation à gauche, panneau latéral
   Téléphone paysage (hauteur ≤ 500 px) .. rail + panneau latéral + timeline sur une ligne
   Grand écran (≥ 1800 px) ............... interface agrandie (la carte reste nette) */

/* Téléphones : écrans courts → bandeaux plus compacts, plus de carte */
@media (max-width: 767px) and (max-height: 720px) {
  .topbar { min-height: 50px; padding-top: calc(4px + var(--safe-t)); padding-bottom: 4px; }
  .topbar__logo { width: 32px; height: 32px; }
  .brand--sm { font-size: 17px; }
  .timeline { padding-top: 6px; padding-bottom: 2px; gap: 2px 10px; }
  .tl-btn--play { width: 40px; height: 40px; }
  .tl-time { font-size: 22px; }
  .tl-ticks { height: 16px; }
  .nav__btn { height: 52px; gap: 2px; font-size: 11.5px; }
  .nav__btn .ic { width: 22px; height: 22px; }
}
@media (max-width: 767px) and (max-height: 600px) {
  .tl-date { display: none; }
  .nav__btn { height: 48px; font-size: 11px; }
  .nav__btn .ic { width: 21px; height: 21px; }
  .mapctl--tr { gap: 6px; }
}
@media (max-width: 380px) {
  .sheet__title { font-size: 23px; }
  .sheet__badge .chip { font-size: 10px; padding: 0 7px; gap: 4px; letter-spacing: 0.04em; }
  .sheet__head { padding-left: 12px; padding-right: 6px; }
}
@media (max-width: 359px) {
  .state-pill__label { display: none; }
  .state-pill { width: 30px; padding: 0; justify-content: center; }
  .brand--sm { font-size: 16px; }
  .pill { padding: 0 10px; font-size: 13px; }
}
/* Téléphones tactiles : le pincement remplace les boutons + / − */
@media (max-width: 767px) and (pointer: coarse) {
  .btn-stack { display: none; }
}

/* Panneau latéral : tablettes, PC, téléphones en paysage */
@media (min-width: 768px), (orientation: landscape) and (max-height: 500px) {
  .sheet {
    top: 12px; right: calc(12px + var(--safe-r)); bottom: 12px; left: auto;
    width: var(--panel-w); height: auto;
    border: 1px solid var(--line); border-radius: 16px;
    transform: translate3d(calc(100% + 28px), 0, 0);
    box-shadow: var(--shadow);
  }
  .sheet.is-open { transform: none; }
  .sheet__grab { display: none; }
  .sheet__head { padding-top: 14px; touch-action: auto; }
  .stage.has-sheet .mapctl--tr { right: calc(var(--panel-w) + 26px + var(--safe-r)); }
  .stage.has-sheet .leaflet-bottom.leaflet-right { right: calc((var(--panel-w) + 24px) * var(--ui-zoom, 1)); }
  .stage.has-sheet .mapctl--bl { opacity: 1; pointer-events: auto; }
  .popover { width: 300px; }
}

/* Tablette et plus */
@media (min-width: 768px) {
  :root { --panel-w: clamp(340px, 42vw, 420px); }
  .topbar { padding-left: calc(16px + var(--safe-l)); padding-right: calc(12px + var(--safe-r)); }
  .brand--sm { font-size: 20px; }
  .topbar__rally { font-size: 13px; }
  .state-pill { height: 32px; padding: 0 12px; font-size: 11.5px; }
  .timeline {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "ctrl main readout";
    gap: 0 16px; padding: 10px calc(16px + var(--safe-r)) 6px calc(16px + var(--safe-l));
  }
  .tl-readout { min-width: 168px; }
  .nav__btn { flex-direction: row; gap: 8px; font-size: 13.5px; height: 56px; }
  .badge--nav { position: static; margin-left: 2px; }
  .toasts { bottom: calc(150px + var(--safe-b)); }
}

/* Tablette paysage et PC : rail de navigation, plus de hauteur pour la carte */
@media (min-width: 1024px) and (min-height: 600px) {
  .app {
    grid-template-columns: calc(88px * var(--ui-zoom, 1)) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "top top" "nav stage" "nav timeline";
  }
  .nav { flex-direction: column; justify-content: flex-start; gap: 6px; padding: 12px 8px; border-top: 0; border-right: 1px solid var(--line); }
  .nav__btn { flex: none; flex-direction: column; height: 70px; border-radius: 12px; gap: 5px; font-size: 11.5px; }
  .nav__btn.is-active { background: var(--raised); }
  .nav__btn.is-active::before { top: 16px; bottom: 16px; left: -8px; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .badge--nav { position: absolute; top: 6px; right: 10px; margin: 0; }
  .sheet { top: 14px; bottom: 14px; right: calc(14px + var(--safe-r)); }
  .sheet__body { padding: 16px 18px 24px; }
  .toasts { bottom: 110px; left: calc(50% + 44px); }
}
@media (min-width: 1200px) {
  .topbar__clock { display: block; }
  .legend { font-size: 11px; }
}
@media (min-width: 1440px) {
  :root { --panel-w: 440px; }
}

/* Grand écran : toute l'interface est agrandie, la carte garde sa résolution */
@media (min-width: 1800px) and (min-height: 950px) { :root { --ui-zoom: 1.15; } }
@media (min-width: 2300px) and (min-height: 1250px) { :root { --ui-zoom: 1.3; } }
.topbar, .nav, .timeline, .sheet, .mapctl, .toasts { zoom: var(--ui-zoom, 1); }

/* Téléphone en paysage : rail à gauche, timeline sur une ligne, panneau latéral étroit */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --panel-w: min(360px, 48vw); }
  .app {
    grid-template-columns: calc(74px + var(--safe-l)) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "top top" "nav stage" "nav timeline";
  }
  .topbar { min-height: 46px; padding-top: calc(3px + var(--safe-t)); padding-bottom: 3px; }
  .topbar__logo { width: 30px; height: 30px; }
  .nav { flex-direction: column; justify-content: center; gap: 2px; padding: 4px 0 calc(4px + var(--safe-b)) var(--safe-l); border-top: 0; border-right: 1px solid var(--line); }
  .nav__btn { flex: 1 1 0; flex-direction: column; height: auto; min-height: 44px; font-size: 10.5px; gap: 2px; border-radius: 0; }
  .nav__btn .ic { width: 21px; height: 21px; }
  .nav__btn.is-active { background: none; }
  .nav__btn.is-active::before { top: 22%; bottom: 22%; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .badge--nav { position: absolute; top: 2px; right: 12px; margin: 0; }
  .timeline { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ctrl main readout"; gap: 0 12px; padding: 4px calc(12px + var(--safe-r)) calc(2px + var(--safe-b)) 12px; }
  .tl-btn--play { width: 38px; height: 38px; }
  .tl-readout { min-width: 0; }
  .tl-date { display: none; }
  .btn-stack { display: none; }
  .sheet { top: 8px; bottom: 8px; right: calc(8px + var(--safe-r)); }
  .toasts { bottom: calc(70px + var(--safe-b)); left: calc(50% + 37px); }
  /* panneau ouvert : carte épurée dans l'espace restant */
  .stage.has-sheet .pill > span, .stage.has-sheet .pill .ic--caret { display: none; }
  .stage.has-sheet .pill { padding: 0 11px; }
  .stage.has-sheet .map-status, .stage.has-sheet .legend { display: none; }
}

/* ---------- 12. Mode plein soleil & accessibilité ---------- */
.sun {
  --panel-solid: #091624;
  --glass: rgba(5, 12, 20, 0.97);
  --card: #0e2034;
  --text-2: #d6e5f1;
  --text-3: #b0c6d8;
  --line: #4d7393;
  --line-soft: rgba(160, 200, 235, 0.3);
}
.sun .tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(1.1) contrast(1.05) saturate(0.55); }
.sun .es-line { stroke-width: 7px; }
.sun .es-casing { stroke-width: 12px; }
.sun .pk-chip, .sun .st-mk { font-size: 12.5px; }
.sun .sheet__body { font-size: 16px; }

/* Survol : seulement sur les appareils qui ont une vraie souris (évite les états « collés » au toucher) */
@media (hover: hover) {
  .icon-btn:hover { background: var(--raised); }
  .map-btn:hover { background: var(--raised-2); }
  .pop-item:hover:not(.is-disabled) { background: var(--raised); }
  .pop-toggle:hover { background: var(--raised); }
  .tl-btn:hover { background: var(--raised); }
  .tl-btn--play:hover { background: #7ccfff; }
  .pk-cell:hover { filter: brightness(1.15); }
  .btn:hover:not(:disabled) { background: var(--raised-2); }
  .btn--primary:hover:not(:disabled) { background: #7ccfff; }
  button.row:hover { background: var(--raised); }
  .es-card:hover { background: var(--raised); }
  .pkm__c:hover { outline: 2px solid var(--text); outline-offset: 0; }
  .jump a:hover { color: var(--text); }
  a.partner-card:hover { background: var(--raised); }
  .nav__btn:hover { color: var(--text); }
  .legend:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
}
@media (hover: hover) and (min-width: 1024px) and (min-height: 600px) {
  .nav__btn:hover { background: var(--raised); }
}

/* ---------- 13. Écrans tactiles ----------
   Cibles d'au moins 44 px, retour visuel immédiat au toucher, pas de flou
   d'arrière-plan (coûteux pendant le déplacement de la carte). */
.topbar, .nav, .timeline, .mapctl, .sheet__head, .leaflet-marker-icon, .legend {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.is-touch .pill, .is-touch .map-btn, .is-touch .legend {
  -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(12, 28, 44, 0.95);
}
.is-touch .timeline { --thumb: 24px; }
.is-touch .tl-track-wrap { height: 40px; }
.is-touch .tl-range::-webkit-slider-runnable-track { height: 40px; }
.is-touch .tl-range::-webkit-slider-thumb { height: 36px; margin-top: 2px; }
.is-touch .tl-btn { width: 44px; height: 44px; }
.is-touch .tl-now-btn { height: 38px; }
.is-touch .map-btn { width: 44px; height: 44px; }
.is-touch .icon-btn--sm { width: 44px; height: 44px; }
.is-touch .pop-item, .is-touch .pop-toggle { min-height: 48px; }
.is-touch .seg__btn { height: 40px; }
.is-touch .seg--sm .seg__btn { height: 38px; }
.is-touch .pkm__grid { gap: 3px; }
.is-touch .pkm__c { height: 26px; }
.is-touch .jump a { padding: 9px 14px; }
.is-touch .pk-table th, .is-touch .pk-table td { padding-top: 12px; padding-bottom: 12px; }
.is-touch button:not(:disabled):active, .is-touch a:active { filter: brightness(1.22); }
.is-touch .tl-btn--play:active { transform: scale(0.94); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (forced-colors: active) {
  .chip, .state-pill, .pk-chip, .obs-mk { border: 2px solid CanvasText; }
}
