/* Palette : encre presque noire, blanc, et quatre couleurs pleines réservées au sens
   (bleu = action, vert = éligible, violet = ensemble régional, orange et rouge = urgence). */
:root {
  color-scheme: light;
  --barre: #1c1b22;
  --barre-survol: #2b2a33;
  --barre-texte: #fbfbfe;
  --barre-texte-2: #a9a9b6;
  --barre-actif: #fbfbfe;
  --barre-sur-actif: #15141a;

  --fond: #f9f9fb;
  --surface: #ffffff;
  --creux: #f0f0f4;
  --selection: #e7e7ee;
  --trait: #e0e0e6;
  --trait-fort: #cfcfd8;
  --texte: #15141a;
  --texte-2: #5b5b66;
  --texte-3: #80808e;

  --accent: #0060df;
  --accent-survol: #0250bb;
  --sur-accent: #ffffff;
  --accent-doux: #dbe8fc;

  --vert: #2ac3a2;
  --violet: #7542e5;
  --jaune: #ffd567;
  --orange: #ff7139;
  --rouge: #e22850;
  --encre: #15141a;

  --police: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --barre: #0f0e14;
  --barre-survol: #23222b;
  --fond: #1c1b22;
  --surface: #2b2a33;
  --creux: #23222b;
  --selection: #3a3944;
  --trait: #3a3944;
  --trait-fort: #52525e;
  --texte: #fbfbfe;
  --texte-2: #bfbfc9;
  --texte-3: #9494a1;
  --accent: #00ddff;
  --accent-survol: #80ebff;
  --sur-accent: #15141a;
  --accent-doux: #0d3f4d;
  --violet: #9a73f2;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --barre: #0f0e14;
    --barre-survol: #23222b;
    --fond: #1c1b22;
    --surface: #2b2a33;
    --creux: #23222b;
    --selection: #3a3944;
    --trait: #3a3944;
    --trait-fort: #52525e;
    --texte: #fbfbfe;
    --texte-2: #bfbfc9;
    --texte-3: #9494a1;
    --accent: #00ddff;
    --accent-survol: #80ebff;
    --sur-accent: #15141a;
    --accent-doux: #0d3f4d;
    --violet: #9a73f2;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 var(--police);
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Sans cette règle, un « display » posé sur un élément l'emporte sur l'attribut hidden. */
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico.petit { width: 15px; height: 15px; stroke-width: 2; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100dvh; }

.barre { background: var(--barre); color: var(--barre-texte); display: flex; flex-direction: column; gap: 24px; padding: 20px 12px 14px; min-height: 0; }
.marque { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.marque svg { width: 28px; height: 28px; color: var(--orange); flex: none; }
.marque b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.015em; line-height: 1.1; }
.marque span { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--barre-texte-2); }

.menu { display: flex; flex-direction: column; gap: 2px; }
.menu button { width: 100%; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--barre-texte-2); font-weight: 500; text-align: left; }
.menu button:hover { background: var(--barre-survol); color: var(--barre-texte); }
.menu button[aria-current="page"] { background: var(--barre-actif); color: var(--barre-sur-actif); font-weight: 600; }
.menu .court { display: none; }
.compteur { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.compteur.alerte { background: var(--orange); color: var(--encre); }

.pied { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.maj { padding: 0 10px 6px; font-size: 12px; line-height: 1.4; color: var(--barre-texte-2); }
.btn-barre { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px; border: 1px solid #42414d; border-radius: 8px; background: none; color: var(--barre-texte); font-weight: 600; }
.btn-barre:hover { background: var(--barre-survol); }
.btn-barre.discret { border-color: transparent; color: var(--barre-texte-2); font-weight: 500; }
.btn-barre[disabled] { opacity: .65; cursor: progress; }
.btn-barre[disabled] .ico { animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

.contenu { display: flex; flex-direction: column; min-width: 0; min-height: 0; outline: none; }

.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 24px 28px 16px; }
.entete h1 { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.022em; }
.entete p { margin-top: 5px; font-size: 13px; color: var(--texte-2); max-width: 62ch; }
.chiffres { display: flex; gap: 30px; }
.chiffre b { display: block; font-size: 26px; line-height: 1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chiffre span { display: block; margin-top: 5px; font-size: 11.5px; color: var(--texte-2); white-space: nowrap; }
.chiffre.urgent b { color: var(--rouge); }

/* ---------- Barre d'outils ---------- */
.outils { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 28px 12px; border-bottom: 1px solid var(--trait); }
.champ { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; flex: 1 1 200px; max-width: 320px; background: var(--creux); border: 1px solid transparent; border-radius: 8px; color: var(--texte-2); }
.champ input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--texte); }
.champ input::placeholder { color: var(--texte-3); }
.champ:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }

.segments { display: inline-flex; padding: 2px; background: var(--creux); border-radius: 8px; }
.segments button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--texte-2); font-weight: 500; white-space: nowrap; }
.segments button[aria-pressed="true"] { background: var(--surface); color: var(--texte); font-weight: 600; box-shadow: 0 0 0 1px var(--trait), 0 1px 2px rgba(0, 0, 0, .1); }

.filtre { position: relative; }
.filtre summary { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border: 1px solid var(--trait-fort); border-radius: 8px; background: var(--surface); font-weight: 500; list-style: none; cursor: pointer; user-select: none; white-space: nowrap; }
.filtre summary::-webkit-details-marker { display: none; }
.filtre summary::after { content: ""; width: 6px; height: 6px; margin: -3px 2px 0 2px; border: solid var(--texte-2); border-width: 0 1.75px 1.75px 0; transform: rotate(45deg); }
.filtre.modifie summary { border-color: var(--texte); box-shadow: inset 0 0 0 1px var(--texte); font-weight: 600; }
.filtre[open] summary { background: var(--creux); }
.pop { position: absolute; z-index: 30; top: 38px; left: 0; min-width: 250px; padding: 6px; background: var(--surface); border: 1px solid var(--trait-fort); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.pop label { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: 6px; cursor: pointer; }
.pop label:hover { background: var(--creux); }
.pop input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.pop .c { margin-left: auto; font-size: 12px; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.pop small { display: block; padding: 6px 8px 4px; font-size: 11.5px; color: var(--texte-3); }

.tri { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texte-2); }
.tri select { height: 32px; padding: 0 8px; border: 1px solid var(--trait-fort); border-radius: 8px; background: var(--surface); color: var(--texte); font-weight: 500; }

/* ---------- Liste et fiche ---------- */
.corps { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); }
.liste { overflow: auto; border-right: 1px solid var(--trait); overscroll-behavior: contain; }
.fiche { overflow: auto; background: var(--surface); overscroll-behavior: contain; }

.groupe { position: sticky; top: 0; z-index: 2; padding: 9px 28px 7px 24px; background: var(--fond); border-bottom: 1px solid var(--trait); font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-2); }

/* content-visibility : le navigateur ne met en page que les lignes proches de l'écran. */
.ligne { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; padding: 13px 20px 13px 24px; border-bottom: 1px solid var(--trait); cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 96px; }
.ligne:hover { background: var(--creux); }
.ligne.sel { background: var(--selection); }
.ligne.sel::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }

.date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 10px; background: var(--surface); border: 1px solid var(--trait-fort); line-height: 1; }
.date b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.date span { margin-top: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-2); }
.date.bientot { background: var(--orange); border-color: var(--orange); color: var(--encre); }
.date.imminent { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.date.bientot span, .date.imminent span { color: inherit; }
.date.vide { border-style: dashed; background: none; }
.date.vide b { font-size: 16px; color: var(--texte-3); }
.date.clos { opacity: .55; }

.ligne h3 { font-size: 14.5px; line-height: 1.3; font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ligne.nonlue h3 { font-weight: 700; }
.ligne.nonlue h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.meta { margin-top: 3px; font-size: 12.5px; color: var(--texte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--creux); color: var(--texte-2); }
.tag.e-madagascar { background: var(--vert); color: var(--encre); }
.tag.e-ensemble { background: var(--violet); color: #fff; }
.tag.e-mondial { background: none; color: var(--texte); box-shadow: inset 0 0 0 1.5px var(--texte); }
.tag.e-verifier { background: var(--jaune); color: var(--encre); }
.tag.neutre { font-weight: 500; }
.ligne.sel .tag.neutre, .ligne:hover .tag.neutre { background: var(--surface); }

.cote { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.jours { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--texte-2); white-space: nowrap; }
.etoile { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--texte-3); }
.etoile:hover { background: var(--trait); color: var(--texte); }
.etoile[aria-pressed="true"] { color: var(--orange); }
.etoile[aria-pressed="true"] .ico { fill: currentColor; }

.suite { display: block; width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--trait); background: none; color: var(--accent); font-weight: 600; }
.suite:hover { background: var(--creux); }

.vide-liste { padding: 56px 28px; text-align: center; color: var(--texte-2); }
.vide-liste b { display: block; margin-bottom: 6px; font-size: 16px; color: var(--texte); }

.fiche-contenu { padding: 26px 28px 40px; }
.surtitre { font-size: 12px; color: var(--texte-2); }
.fiche h2 { margin: 6px 0 16px; font-size: 21px; line-height: 1.22; font-weight: 700; letter-spacing: -.015em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid var(--trait-fort); border-radius: 8px; background: var(--surface); color: var(--texte); font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--creux); }
.btn.primaire { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.btn.primaire:hover { background: var(--accent-survol); border-color: var(--accent-survol); }
.btn.actif { background: var(--texte); border-color: var(--texte); color: var(--fond); }
.btn.petit { height: 28px; padding: 0 10px; font-size: 12.5px; }

.elig { margin: 20px 0; padding: 14px 16px; border-radius: 10px; background: var(--creux); border-left: 4px solid var(--trait-fort); }
.elig.e-madagascar { border-left-color: var(--vert); }
.elig.e-ensemble { border-left-color: var(--violet); }
.elig.e-mondial { border-left-color: var(--texte); }
.elig.e-verifier { border-left-color: var(--jaune); }
.elig h4 { font-size: 13px; font-weight: 700; }
.elig blockquote { margin-top: 6px; font-size: 13.5px; line-height: 1.5; }
.elig .note { margin-top: 8px; font-size: 12px; color: var(--texte-2); }
.avis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--texte-2); }

.faits { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 9px 16px; font-size: 13.5px; }
.faits dt { color: var(--texte-2); }
.faits dd { overflow-wrap: anywhere; }
.resume { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--trait); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.resume + .note { margin-top: 10px; font-size: 12px; color: var(--texte-3); }
.fiche-vide { height: 100%; display: grid; place-content: center; gap: 10px; padding: 28px; text-align: center; color: var(--texte-2); }
.fiche-vide b { font-size: 15px; color: var(--texte); }
.touches { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 12px; }
kbd { display: inline-block; min-width: 20px; padding: 1px 5px; border: 1px solid var(--trait-fort); border-bottom-width: 2px; border-radius: 5px; background: var(--fond); font: 600 11px var(--police); text-align: center; color: var(--texte); }
.retour { display: none; }

/* ---------- Pages pleines ---------- */
.page { flex: 1; min-height: 0; overflow: auto; padding: 4px 28px 40px; }
.section-titre { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; }
.section-titre h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.section-titre span { font-size: 12.5px; color: var(--texte-2); }
.note-page { max-width: 78ch; font-size: 13px; color: var(--texte-2); }

/* Calendrier : une ligne par appel, douze colonnes pour les mois. */
.annee { --m: 1; max-width: 1080px; }
.rang, .mois-tete { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); gap: 20px; align-items: center; }
.mois-tete { position: sticky; top: 0; z-index: 2; padding: 8px 0; background: var(--fond); border-bottom: 1px solid var(--trait-fort); }
.mois { display: grid; grid-template-columns: repeat(12, 1fr); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-3); text-align: center; }
.mois .courant { color: var(--accent); font-weight: 700; }
.rang { padding: 9px 0; border-bottom: 1px solid var(--trait); }
.rang-nom a, .rang-nom b { font-size: 13.5px; font-weight: 600; color: var(--texte); text-decoration: none; }
.rang-nom a:hover { color: var(--accent); text-decoration: underline; }
.rang-nom small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--texte-2); }
.piste { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); height: 24px; background-image: linear-gradient(90deg, var(--trait) 1px, transparent 1px); background-size: calc(100% / 12) 100%; border-right: 1px solid var(--trait); }
.piste::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc((var(--m) - 1) * 100% / 12); width: calc(100% / 12); background: var(--accent-doux); }
.fen { position: relative; grid-row: 1; align-self: center; height: 14px; margin: 0 2px; border-radius: 4px; background: var(--texte); }
.fen.incertain { background: repeating-linear-gradient(135deg, var(--texte) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1.5px var(--texte); }
.rang.ouvert .fen { background: var(--orange); box-shadow: none; }
.rang.ouvert .fen.incertain { background: repeating-linear-gradient(135deg, var(--orange) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1.5px var(--orange); }
.legende { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 14px 0 4px; font-size: 12px; color: var(--texte-2); }
.legende i { display: inline-block; width: 26px; height: 10px; margin-right: 7px; border-radius: 3px; background: var(--texte); vertical-align: -1px; }
.legende i.incertain { background: repeating-linear-gradient(135deg, var(--texte) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1.5px var(--texte); }
.legende i.ouvert { background: var(--orange); }

.guichets { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; max-width: 1080px; }

/* Veille manuelle : l'adresse est l'élément le plus visible de chaque fiche. */
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.site { display: flex; flex-direction: column; gap: 9px; padding: 14px 16px 12px; background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; }
.site.du { box-shadow: inset 4px 0 0 var(--orange); }
.site-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.site h3 { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.rythme { font-size: 11.5px; font-weight: 600; color: var(--texte-2); white-space: nowrap; }
.adresse { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; max-width: 100%; padding: 7px 11px; border-radius: 8px; background: var(--texte); color: var(--fond); font: 600 12.5px/1.25 var(--mono); text-decoration: none; }
.adresse span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adresse:hover { background: var(--accent); color: var(--sur-accent); }
.site p { font-size: 13px; line-height: 1.45; }
.site .pourquoi { color: var(--texte-2); font-size: 12.5px; }
.site-pied { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--trait); font-size: 12.5px; color: var(--texte-2); }
.site.du .visite { color: var(--texte); font-weight: 600; }
.site.sans { border-style: dashed; background: none; }

/* Sources */
.table-defilante { overflow-x: auto; max-width: 1080px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--trait-fort); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; text-align: left; color: var(--texte-2); white-space: nowrap; }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--trait); vertical-align: top; }
td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.etat-src { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.etat-src::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--vert); }
.etat-src.erreur::before { background: var(--rouge); }
.etat-src.muet::before { background: var(--jaune); }
code { padding: 1px 5px; border-radius: 5px; background: var(--creux); font: 12.5px var(--mono); }
pre.resume-jour { max-width: 1080px; margin-top: 8px; padding: 16px 18px; border: 1px solid var(--trait); border-radius: 12px; background: var(--surface); font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

.attente { flex: 1; display: grid; place-content: center; gap: 14px; padding: 28px; text-align: center; color: var(--texte-2); }
.attente b { font-size: 18px; color: var(--texte); }
.progres { width: 220px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--creux); overflow: hidden; }
.progres::before { content: ""; display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--accent); animation: glisse 1.2s ease-in-out infinite; }
@keyframes glisse { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); max-width: min(92vw, 520px); padding: 10px 16px; border-radius: 10px; background: var(--texte); color: var(--fond); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Écrans moyens : la fiche passe en volet ---------- */
@media (max-width: 1180px) {
  .corps { grid-template-columns: minmax(0, 1fr); }
  .liste { border-right: 0; }
  .fiche { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(460px, 100%); border-left: 1px solid var(--trait-fort); box-shadow: -18px 0 40px rgba(0, 0, 0, .2); transform: translateX(105%); transition: transform .18s ease; }
  .fiche-ouverte .fiche { transform: none; }
  .fiche-vide { display: none; }
  .retour { display: inline-flex; margin-bottom: 14px; }
  .chiffres { gap: 22px; }
}

/* ---------- Téléphone : barre d'onglets en bas ---------- */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .barre { order: 2; flex-direction: row; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid #000; }
  .marque, .pied { display: none; }
  .menu { flex: 1; flex-direction: row; gap: 0; }
  .menu li { flex: 1; min-width: 0; }
  .menu button { position: relative; flex-direction: column; justify-content: center; gap: 3px; height: 50px; padding: 0 2px; font-size: 10.5px; font-weight: 600; }
  .menu button[aria-current="page"] { background: none; color: var(--orange); }
  .menu .long { display: none; }
  .menu .court { display: inline; }
  .compteur { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 0; margin: 0; padding: 0 5px; font-size: 10px; line-height: 15px; background: var(--barre-survol); color: var(--barre-texte); }

  .entete { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 16px 12px; }
  .entete h1 { font-size: 26px; }
  .chiffres { justify-content: space-between; gap: 12px; }
  .chiffre b { font-size: 22px; }
  .outils { padding: 0 16px 10px; gap: 8px; }
  .champ { flex-basis: 100%; max-width: none; }
  .tri { margin-left: 0; }
  .tri span { display: none; }
  .pop { position: fixed; top: auto; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .ligne { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 11px; padding: 12px 10px 12px 16px; }
  .date { width: 46px; height: 46px; }
  .date b { font-size: 18px; }
  .groupe { padding-left: 16px; }
  .fiche { width: 100%; border-left: 0; }
  .fiche-contenu { padding: 16px 16px 40px; }
  .page { padding: 0 16px 32px; }
  .rang, .mois-tete { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .mois-tete > span { display: none; }
  .sites, .guichets { grid-template-columns: minmax(0, 1fr); }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
}

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