@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/source-sans-3-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/source-sans-3-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* manifsendirect.fr : carte en direct. Mobile d'abord. */

:root {
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;

  --l0: #3BA55C;
  --l1: #FFE600;
  --l2: #FF8C00;
  --l3: #E3000F;
  --on-l0: #1E1E1E;
  --on-l1: #1E1E1E;
  --on-l2: #1E1E1E;
  --on-l3: #FFFFFF;

  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F3F5F8;
  --line: #DCE1E8;
  --ink: #1E1E1E;
  --muted: #55606E;
  --link: #0B5CAD;
  --focus: #0B5CAD;
  --danger: #B3000C;
  --mk-stroke: #1E1E1E;
  --ring: #1E1E1E;
  --scroll: #B9C1CC;
  --sel-bg: #FFE600;
  --sel-fg: #1E1E1E;

  --fs-xs: 0.8rem;
  --fs-s: 0.9375rem;
  --fs-m: 1rem;
  --fs-l: 1.25rem;
  --fs-xl: 1.5625rem;
  --fs-brand: 1.375rem;

  --top-pad: max(12px, env(safe-area-inset-left, 0px));
  --pad: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
  --logo-light: block;
  --logo-dark: none;
  --map-water: #BFD3E6;
  --city-label: #3A4250;
  --water-text: #4F6F94;
  --halo: #F8F9FB;
  --top-bg: #FFFFFF;
  --chip-bg: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --dark: 1; }
}
:root[data-theme="dark"] { --dark: 1; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #001D3B; --surface: #062849; --surface-2: #0B3157; --line: #1A4470;
    --ink: #E8EEF6; --muted: #A9BCD3; --link: #8CC4FF; --focus: #FFE600;
    --danger: #FF8F98; --mk-stroke: #00142A; --ring: #FFFFFF; --scroll: #2F5E8E;
    --top-bg: #001D3B; --chip-bg: #0B3157;
    color-scheme: dark; --logo-light: none; --logo-dark: block; --map-water: #00142A; --city-label: #A9BCD3; --water-text: #6E8FB5; --halo: #04223F;
  }
}
:root[data-theme="dark"] {
  --bg: #001D3B; --surface: #062849; --surface-2: #0B3157; --line: #1A4470;
    --ink: #E8EEF6; --muted: #A9BCD3; --link: #8CC4FF; --focus: #FFE600;
    --danger: #FF8F98; --mk-stroke: #00142A; --ring: #FFFFFF; --scroll: #2F5E8E;
    --top-bg: #001D3B; --chip-bg: #0B3157;
  color-scheme: dark; --logo-light: none; --logo-dark: block; --map-water: #00142A; --city-label: #A9BCD3; --water-text: #6E8FB5; --halo: #04223F;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-m)/1.4 var(--font);
  -webkit-text-size-adjust: 100%;
  caret-color: var(--focus);
  padding-top: env(safe-area-inset-top, 0px);
}

::selection { background: var(--sel-bg); color: var(--sel-fg); }

* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg);
  padding: 8px 12px; border-radius: 2px;
}
.skip:focus { top: 8px; }

/* Niveaux */
.sq { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--mk-stroke); flex: none; }
[data-level="0"] > .sq, .sq[data-level="0"] { background: var(--l0); }
.sq[data-level="1"] { background: var(--l1); }
.sq[data-level="2"] { background: var(--l2); }
.sq[data-level="3"] { background: var(--l3); }

/* ---------- En-tête ---------- */
.top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 12px;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px var(--top-pad);
  background: var(--top-bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.brandmark { margin: 0; line-height: 0; }
.logo-link { display: block; }
.logo { flex: none; }
.logo-light { display: var(--logo-light); }
.logo-dark { display: var(--logo-dark); }
.logo img { display: block; height: 36px; width: auto; }
@media (min-width: 900px) {
  .brand { flex-direction: row; align-items: center; gap: 14px; }
  .logo img { height: 48px; }
}
.edition { font-weight: 600; font-size: var(--fs-s); line-height: 1.2; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 2px; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }

.level { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); }
.status { grid-column: 2; grid-row: 2; font-size: var(--fs-xs); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: baseline; justify-content: flex-end; }
.status[data-state="error"] .status-text, .status[data-state="offline"] .status-text { color: var(--danger); font-weight: 600; }
.stats { grid-column: 1 / -1; grid-row: 3; display: flex; flex-wrap: wrap; gap: 0 14px; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.stats b { color: var(--ink); font-weight: 700; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 3px 10px 3px 8px;
  border-radius: 2px; border: 1px solid var(--mk-stroke); font-weight: 700; font-size: var(--fs-s); line-height: 1.1;
  background: var(--surface-2); color: var(--ink);
}
.pill[data-level="1"] { background: var(--l1); color: var(--on-l1); }
.pill[data-level="2"] { background: var(--l2); color: var(--on-l2); }
.pill[data-level="3"] { background: var(--l3); color: var(--on-l3); }
.meter { display: inline-flex; gap: 2px; }
.meter i { width: 6px; height: 12px; border: 1px solid currentColor; border-radius: 1px; }
.meter i.on { background: currentColor; }

.link-btn { background: none; border: 0; padding: 4px 0; color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.link-btn:hover { text-decoration-thickness: 2px; }

.demo {
  margin: 0; padding: 5px var(--top-pad); background: var(--l1); color: #1E1E1E;
  font-size: var(--fs-xs); font-weight: 600; text-align: center; border-bottom: 1px solid #1E1E1E33;
}

/* ---------- Mise en page ---------- */
.layout {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 42fr) minmax(0, 58fr);
  transition: grid-template-rows 0.3s var(--ease);
}
.layout[data-panel="full"] { grid-template-rows: minmax(0, 0fr) minmax(0, 1fr); }
.layout[data-panel="full"] .map-wrap { visibility: hidden; }

.map-wrap { position: relative; min-height: 0; background: var(--map-water); overflow: hidden; }
#map { position: absolute; inset: 0; }

.panel {
  padding-inline: var(--pad);
  min-height: 0; display: flex; flex-direction: column; background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.handle {
  flex: none; height: 24px; width: 100%; background: transparent; border: 0; display: grid; place-items: center; touch-action: none;
}
.handle span { width: 40px; height: 4px; border-radius: 2px; background: var(--scroll); }
.handle:hover span { background: var(--muted); }

.controls { flex: none; padding: 0 0 12px; display: grid; gap: 8px; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 10px 0 34px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--muted); border-radius: 2px; caret-color: var(--focus);
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 9px;
  font-size: var(--fs-s); font-weight: 600; background: var(--chip-bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 2px;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .n { font-weight: 400; font-variant-numeric: tabular-nums; opacity: 0.85; }
.chip:disabled { opacity: 0.55; cursor: default; }

.filterbar { display: flex; }
.city-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px 0 10px;
  background: var(--surface-2); border: 1px solid var(--ink); border-radius: 2px; font-weight: 700; font-size: var(--fs-s);
}
.city-chip svg { flex: none; }

.scroll { flex: 1; min-height: 0; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.view { padding-bottom: 12px; }

.list-title { padding: 12px 0 4px; font-size: var(--fs-l); line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.list-title:focus { outline: none; }
.list-sub { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }

/* Lignes de la liste (reprise de la maquette vigilance) */
.row { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 10px; margin-inline: calc(var(--pad) * -1); padding: 10px var(--pad); border-bottom: 1px solid var(--line); }
.row:hover { background: var(--surface-2); }
.row[aria-current="true"] { background: var(--surface-2); }
.row > .sq { margin-top: 5px; }
.row-main { min-width: 0; }
.row-open { all: unset; display: block; cursor: pointer; font-size: var(--fs-m); line-height: 1.3; }
.row-open::after { content: ""; position: absolute; inset: 0; }
.row-open:focus-visible { outline: none; }
.row:has(.row-open:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.row-open b { font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 2px; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.meta a { position: relative; z-index: 1; }
.tag { display: inline-flex; align-items: center; gap: 3px; color: var(--ink); font-weight: 600; }
.row[data-fresh="recent"] > .sq { opacity: 0.85; }
.row[data-fresh="stale"] > .sq { opacity: 0.6; filter: saturate(0.8); }
.row[data-fresh="fading"] > .sq { opacity: 0.35; filter: saturate(0.3); }
.row[data-fresh="stale"] .row-open, .row[data-fresh="fading"] .row-open { color: var(--muted); }
.row[data-fresh="fading"] .tag { color: var(--muted); }
.tag svg { width: 14px; height: 14px; color: var(--ink); --mk-stroke: currentColor; }

.empty { padding: 18px 0; color: var(--muted); display: grid; gap: 8px; justify-items: start; max-width: 46ch; }
.empty b { color: var(--ink); }

.foot { padding: 12px 0 4px; font-size: var(--fs-xs); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
.foot .copy { color: var(--muted); }
.foot .copy a { color: inherit; }

/* Publicité */
.ad { padding: 12px 0; text-align: center; }
.ad-row { margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); border-bottom: 1px solid var(--line); }
.ad-row { display: block; }
.ad-label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 2px; }
.ad-slot { margin: 0 auto; width: 100%; max-width: 320px; min-height: 50px; background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.ad-desktop { display: none; border-bottom: 0; }
.ad-desktop .ad-slot { max-width: 300px; min-height: 250px; }

/* Fiche événement */
.detail { padding: 12px 0 16px; display: grid; gap: 12px; }
.back {
  display: inline-flex; align-items: center; gap: 4px; justify-self: start; min-height: 40px; padding: 0 10px 0 4px;
  background: none; border: 0; color: var(--link); font-weight: 600;
}
.back:hover { text-decoration: underline; }
.detail h2, .about h2 { font-size: var(--fs-xl); line-height: 1.15; font-weight: 700; text-wrap: balance; }
.detail h2:focus, .about h2:focus { outline: none; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 9px; font-size: var(--fs-s); font-weight: 600;
  border: 1px solid var(--ink); border-radius: 2px; background: var(--surface);
}
.badge.lvl[data-level="1"] { background: var(--l1); color: var(--on-l1); }
.badge.lvl[data-level="2"] { background: var(--l2); color: var(--on-l2); }
.badge.lvl[data-level="3"] { background: var(--l3); color: var(--on-l3); }
.badge.lvl[data-level="0"] { background: var(--l0); color: var(--on-l0); }
.badge.lvl { border-color: var(--mk-stroke); }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-variant-numeric: tabular-nums; }
.detail dt { color: var(--muted); font-size: var(--fs-s); }
.detail dd { min-width: 0; }
.detail .summary { max-width: 65ch; font-size: var(--fs-m); }
.sources h3 { font-size: var(--fs-s); margin-bottom: 4px; }
.sources li { padding: 8px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.sources .src-meta { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.militante { display: inline-block; font-size: var(--fs-xs); font-weight: 600; color: var(--ink); border: 1px solid var(--ink); border-radius: 2px; padding: 0 5px; margin-left: 6px; }
.btn {
  justify-self: start; min-height: 40px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--surface); font-weight: 600;
}
.btn:hover { background: var(--surface); color: var(--ink); }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }

/* À propos et légende */
.about { padding: 12px 0 24px; display: grid; gap: 10px; align-content: start; }
.about h3 { font-size: var(--fs-l); margin-top: 10px; }
.about p, .about li { max-width: 65ch; }
.about ul.plain { list-style: disc; padding-left: 18px; display: grid; gap: 4px; }
.legend-list { display: grid; gap: 6px; margin: 4px 0 8px; }
.legend-list li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: start; }
.legend-list .sq { margin-top: 5px; }
.legend-shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 12px; margin: 4px 0 8px; }
.legend-shapes li { display: flex; align-items: center; gap: 6px; }
.how h4, .about h4 { font-size: var(--fs-s); margin: 10px 0 4px; }
.how p, .about #aboutHow p { margin: 4px 0; max-width: 62ch; }

/* ---------- Carte ---------- */
.map-btn {
  position: absolute; z-index: 3; top: 8px; left: 8px; min-height: 36px; padding: 0 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--ink); border-radius: 2px; font-weight: 600; font-size: var(--fs-s);
}
.map-btn:hover { background: var(--surface-2); }

.how {
  position: absolute; z-index: 3; left: 8px; bottom: 26px; width: min(360px, calc(100% - 16px));
  background: var(--surface); border: 1px solid var(--ink); border-radius: 2px; font-size: var(--fs-s);
}
.how summary { list-style: none; cursor: pointer; padding: 0 12px; min-height: 36px; display: flex; align-items: center; font-weight: 600; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: ""; margin-left: 8px; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -2px; }
.how[open] summary::after { rotate: -135deg; translate: 0 2px; }
.how[open] summary { border-bottom: 1px solid var(--line); }
.how-body { padding: 4px 12px 10px; max-height: min(52vh, 420px); overflow-y: auto; }
.how:not([open]) { width: auto; }

.map-msg {
  position: absolute; z-index: 4; inset: 50% 16px auto; translate: 0 -50%; text-align: center; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--ink); border-radius: 2px; max-width: 420px; margin-inline: auto;
}

.maplibregl-map { font-family: var(--font); background: var(--map-water); }
.maplibregl-ctrl-attrib {
  font-size: 0.7rem; background: color-mix(in srgb, var(--surface) 82%, transparent) !important; color: var(--muted);
}
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-group { border-radius: 2px !important; box-shadow: none !important; border: 1px solid var(--ink); background: var(--surface); }
.maplibregl-ctrl-group button { width: 36px; height: 36px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
:root[data-theme="dark"] .maplibregl-ctrl-icon { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .maplibregl-ctrl-icon { filter: invert(1); } }

/* Marqueurs */
.mk {
  position: absolute; display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0;
  background: none; border: 0; border-radius: 4px;
}
.mk-body { display: grid; place-items: center; transition: transform 0.15s var(--ease); }
.mk:hover .mk-body { transform: scale(1.1); }
.mk:focus-visible { outline: none; }
.mk:focus-visible .mk-body, .mk[aria-current="true"] .mk-body { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.mk-city .mk-body {
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 2px; border: 1px solid var(--mk-stroke);
  font-weight: 700; font-size: var(--fs-s); line-height: 1; font-variant-numeric: tabular-nums;
}
.mk-city[data-level="0"] .mk-body { background: var(--l0); color: var(--on-l0); }
.mk-city[data-level="1"] .mk-body { background: var(--l1); color: var(--on-l1); }
.mk-city[data-level="2"] .mk-body { background: var(--l2); color: var(--on-l2); }
.mk-city[data-level="3"] .mk-body { background: var(--l3); color: var(--on-l3); }
.mk-ev .mk-body { width: 26px; height: 26px; }
.mk-ev svg { width: 24px; height: 24px; }
.mk-body { opacity: calc(var(--fo, 1) * var(--dim, 1)); }
.mk[data-fresh="recent"] { --fo: 0.85; }
.mk[data-fresh="stale"] { --fo: 0.6; }
.mk[data-fresh="fading"] { --fo: 0.35; }
.mk[data-fresh="stale"] .mk-body { filter: saturate(0.8); }
.mk[data-fresh="fading"] .mk-body { filter: saturate(0.3); }
.mk[data-dim] { --dim: 0.6; }

/* L'anneau pulse une seule fois à l'arrivée */
.mk.pulse::after {
  content: ""; position: absolute; inset: 5px; border: 2px solid var(--ring); border-radius: 4px; pointer-events: none;
  animation: ring 1.6s var(--ease) 1 both;
}
@keyframes ring {
  from { transform: scale(0.95); opacity: 0.9; }
  to { transform: scale(2); opacity: 0; }
}

/* ---------- Ordinateur ---------- */
@media (min-width: 900px) {
  .top {
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-areas: "brand level stats status tools";
    gap: 8px 20px; padding-block: 8px;
  }
  .brand { grid-area: brand; }
  .level { grid-area: level; }
  .stats { grid-area: stats; grid-column: auto; font-size: var(--fs-s); gap: 0 18px; }
  .status { grid-area: status; grid-column: auto; grid-row: auto; font-size: var(--fs-s); }
  .tools { grid-area: tools; }
  .edition { max-width: none; }

  .layout, .layout[data-panel="full"] { grid-template-rows: minmax(0, 1fr); grid-template-columns: 400px minmax(0, 1fr); transition: none; }
  .layout[data-panel="full"] .map-wrap { visibility: visible; }
  .map-wrap { order: 2; }
  .panel { order: 1; border-top: 0; border-right: 1px solid var(--line); padding-top: 8px; }
  .handle { display: none; }
  .chips { flex-wrap: wrap; overflow: visible; }
  .ad-desktop { display: block; }
  .ad-row { display: none; }
  .how { bottom: 26px; }
}

@media (max-width: 899px) {
  .top { padding-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .mk.pulse::after { animation: none; transform: scale(1.5); opacity: 0.55; }
}

@media (max-width: 899px) {
  .level-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.pill { white-space: nowrap; }

.om { position: absolute; z-index: 3; top: 52px; left: 8px; }
.om select {
  min-height: 36px; padding: 0 28px 0 10px; font: inherit; font-size: var(--fs-s); font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--ink); border-radius: 2px;
}
.om select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (min-width: 900px) { .panel { padding-top: 12px; } }

@media (max-width: 599px) {
  .mk { min-width: 30px; height: 30px; }
  .mk-city .mk-body { min-width: 22px; height: 22px; padding: 0 4px; font-size: 0.75rem; }
  .mk-ev .mk-body { width: 22px; height: 22px; }
  .mk-ev svg { width: 20px; height: 20px; }
}

/* Volet : rangée d'outils, intertitres */
.tools-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.tools-row .chips { flex: 1; min-width: 0; }
.chip.icon { padding: 0; width: 36px; justify-content: center; }
.chips { scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.sep { list-style: none; padding: 14px 0 4px; }
.sep h3 { font-size: var(--fs-s); font-weight: 700; color: var(--muted); }
@media (max-width: 899px) {
  .controls { padding-bottom: 8px; }
  .tools-row { order: 0; }
  .search { order: 1; }
  .filterbar { order: 2; }
  .controls[data-search=""] .search { display: none; }
}
@media (min-width: 900px) {
  .chip.icon { display: none; }
  .search { order: 0; }
  .tools-row { order: 1; }
}

/* Fiabilité */
.conf { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.conf svg { flex: none; color: var(--ink); }
.conf[data-conf-level="confirme"], .conf[data-conf-level="officielle"] { color: var(--ink); font-weight: 600; }
.reliab h3 { font-size: var(--fs-s); margin-bottom: 4px; }
.reliab p { max-width: 65ch; }

/* Phases */
.row[data-fresh="ghost"] > .sq { opacity: 0.45; filter: saturate(0.4); }
.row[data-fresh="ghost"] .row-open, .row[data-fresh="ghost"] .tag { color: var(--muted); }
.mk[data-fresh="ghost"] { --fo: 0.45; }
.dur { color: var(--muted); font-variant-numeric: tabular-nums; }
.dur[data-ph="termine"], .dur[data-ph="probablement_termine"] { color: var(--ink); font-weight: 600; }
.row[data-fresh="ghost"] .dur { color: var(--muted); }
.hours h3 { font-size: var(--fs-s); margin-bottom: 4px; }

/* Mode permanent : jour calme, à venir par jour, bandeau */
.dateline { font-weight: 400; margin-left: 6px; }
.special { margin: 0; padding: 5px var(--top-pad); background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: var(--fs-xs); font-weight: 600; text-align: center; }
.calm { list-style: none; padding: 14px 0 6px; max-width: 46ch; color: var(--muted); }
.calm b { color: var(--ink); }
.day { list-style: none; border-bottom: 1px solid var(--line); margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); }
.day-sum { display: grid; gap: 1px; padding: 9px 0; }
summary.day-sum { cursor: pointer; list-style: none; position: relative; padding-right: 24px; }
summary.day-sum::-webkit-details-marker { display: none; }
summary.day-sum::after { content: ""; position: absolute; right: 6px; top: 16px; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; }
details[open] > summary.day-sum::after { rotate: -135deg; top: 19px; }
summary.day-sum:hover b { text-decoration: underline; }
.day-sum span { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.day-sum .day-cities { color: var(--ink); }
.day .rows.sub .row:last-child { border-bottom: 0; }
@media (max-width: 599px) { .dateline { display: none; } }

.sep-n { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* Libellés de la vue nationale */
.nat-label { pointer-events: none; white-space: nowrap; font-weight: 600; font-size: 0.8rem; line-height: 1; transition: opacity 0.35s; text-shadow: 0 0 3px var(--halo), 0 0 3px var(--halo); }
.nat-label.country { color: var(--muted); font-size: 0.9rem; }
.nat-label.country.fr { color: var(--ink); font-size: 1.1rem; opacity: 0.7; }
.nat-label.water { color: var(--water-text); font-style: italic; font-weight: 400; }
.nat-label.city { color: var(--city-label, var(--ink)); }
.nat-label.off, .nat-label.hit { opacity: 0 !important; }
.more { list-style: none; padding: 12px 0; }
@media (max-width: 599px) { .nat-label.city { display: none; } }


/* Sombre : boutons de zoom */
:root[data-theme="dark"] .maplibregl-ctrl-group { background: var(--surface-2); border-color: var(--line); }
:root[data-theme="dark"] .maplibregl-ctrl-icon { filter: invert(1) brightness(1.14); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .maplibregl-ctrl-group { background: var(--surface-2); border-color: var(--line); }
  :root:not([data-theme="light"]) .maplibregl-ctrl-icon { filter: invert(1) brightness(1.14); }
}
/* Mobile : en-tête plus bas */
@media (max-width: 599px) {
  .status-text .lag { display: none; }
  .special { padding-block: 3px; }
}

/* Bloc de présentation (titre de page, introduction) */
.seo-h1 { margin: 0; padding: 4px 0 0; font-size: var(--fs-l); line-height: 1.2; font-weight: 700; text-wrap: balance; }
.seo-intro { margin: 4px 0 0; font-size: var(--fs-s); line-height: 1.4; color: var(--muted); max-width: 65ch; }
.seo-more { align-self: flex-start; padding: 2px 0 6px; font-size: var(--fs-s); }
.seo { display: contents; }
@media (max-width: 899px) {
  .seo-intro:not(.open) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (min-width: 900px) { .seo-more { display: none; } }
.seo-h1 + .seo-intro { margin-bottom: 4px; }
#ssr-list .row-open { cursor: default; }
#ssr-list .row-open::after { content: none; }
.city-chip { text-decoration: none; color: var(--ink); }
.seo-cities { padding: 8px 0 4px; }
.seo-cities h2 { font-size: var(--fs-s); font-weight: 700; margin: 0 0 4px; }
.seo-cities-list { margin: 0; font-size: var(--fs-s); line-height: 1.6; }
.seo-cities-list a { margin-right: 12px; white-space: nowrap; }
