/* ==========================================================================
   Protège Plus — design system
   Vert & blanc, mobile-first, sans dépendance externe (polices facultatives).
   ========================================================================== */

/* ---------- Jetons ---------- */
:root {
  --blanc: #ffffff;
  --brume: #f2f7f4;          /* fonds de section, cartes secondaires */
  --brume-2: #e6f0ea;
  --trait: #d9e5de;          /* bordures */
  --trait-fort: #b9cdc2;
  --foret: #0b5d3b;          /* vert principal : actions, liens */
  --foret-2: #084a2f;        /* survol / pressé */
  --feuille: #12a150;        /* vert de marque : accents, succès */
  --menthe: #d8f3e3;         /* fonds d'accent doux */
  --marine: #0d2b66;         /* couleur du logotype : titres */
  --encre: #17262f;          /* texte courant */
  --gris: #5b6b66;           /* texte secondaire */
  --gris-clair: #8a9994;

  --rouge: #c8102e;          /* BioSecours / urgence */
  --rouge-doux: #fde8eb;
  --ambre: #b45309;          /* attente */
  --ambre-doux: #fef3c7;
  --sarcelle: #0e7c86;       /* annuaire */
  --sarcelle-doux: #dff3f4;
  --info: #1d5fbf;
  --info-doux: #e5efff;

  --police-titre: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --police-texte: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --t-xs: .8125rem;   /* 13 */
  --t-s: .875rem;     /* 14 */
  --t-m: 1rem;        /* 16 */
  --t-l: 1.125rem;    /* 18 */
  --t-xl: 1.375rem;   /* 22 */
  --t-2xl: 1.75rem;   /* 28 */
  --t-3xl: 2.25rem;   /* 36 */
  --t-4xl: clamp(2.25rem, 1.4rem + 3.6vw, 3.6rem);

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --ombre-1: 0 1px 2px rgba(13, 43, 102, .06), 0 1px 1px rgba(13, 43, 102, .04);
  --ombre-2: 0 10px 30px -12px rgba(11, 93, 59, .28);
  --ombre-3: 0 24px 60px -20px rgba(13, 43, 102, .35);

  --marine-fixe: #0d2b66;    /* bandeaux sombres, identiques dans les deux thèmes */
  --fond: #ffffff;           /* fond de page */
  --surface: #ffffff;        /* cartes, champs */
  --surface-verre: rgba(255, 255, 255, .92);
  --survol: #f7faf8;
  --lateral: #f6faf7;        /* barre latérale (ordinateur) */
  color-scheme: light;

  --entete: 64px;
  --onglets: 68px;
  --largeur: 1680px;
  --gouttiere: 16px;
  --lateral-largeur: 272px;
  --duree: .18s;
}

@media (min-width: 768px) {
  :root { --gouttiere: 28px; --entete: 72px; }
}
@media (min-width: 1400px) {
  :root { --gouttiere: 40px; }
}

/* ---------- Mode nuit ---------- */
/* data-theme : "auto" (suit l'appareil), "clair" ou "sombre" */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --fond: #0c1310; --surface: #131d18; --surface-verre: rgba(16, 24, 20, .9); --survol: #18241e; --lateral: #101915;
    --blanc: #131d18; --brume: #172520; --brume-2: #1f2f28; --trait: #263830; --trait-fort: #355045;
    --foret: #34c37a; --foret-2: #5ad696; --feuille: #2fbf71; --menthe: #153a28; --marine: #e3ecfb;
    --encre: #e4ece7; --gris: #a3b5ac; --gris-clair: #7f948a;
    --rouge: #ff5c73; --rouge-doux: #3a1820; --ambre: #f5b04a; --ambre-doux: #3a2a10;
    --sarcelle: #4cc3cc; --sarcelle-doux: #12312f; --info: #7eaaf2; --info-doux: #172540;
    --ombre-1: 0 1px 2px rgba(0, 0, 0, .4); --ombre-2: 0 10px 30px -12px rgba(0, 0, 0, .6); --ombre-3: 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="sombre"] {
  --fond: #0c1310; --surface: #131d18; --surface-verre: rgba(16, 24, 20, .9); --survol: #18241e; --lateral: #101915;
  --blanc: #131d18; --brume: #172520; --brume-2: #1f2f28; --trait: #263830; --trait-fort: #355045;
  --foret: #34c37a; --foret-2: #5ad696; --feuille: #2fbf71; --menthe: #153a28; --marine: #e3ecfb;
  --encre: #e4ece7; --gris: #a3b5ac; --gris-clair: #7f948a;
  --rouge: #ff5c73; --rouge-doux: #3a1820; --ambre: #f5b04a; --ambre-doux: #3a2a10;
  --sarcelle: #4cc3cc; --sarcelle-doux: #12312f; --info: #7eaaf2; --info-doux: #172540;
  --ombre-1: 0 1px 2px rgba(0, 0, 0, .4); --ombre-2: 0 10px 30px -12px rgba(0, 0, 0, .6); --ombre-3: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
/* En mode nuit, les boutons pleins gardent un texte foncé lisible sur le vert clair */
:root[data-theme="sombre"] .btn-primaire, :root[data-theme="sombre"] .puce.actif,
:root[data-theme="sombre"] .plus-modules .bras-intime { --texte: #06210f; color: #06210f; }
:root[data-theme="sombre"] .plus-modules .bras-intime small { color: #0b3a22; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .btn-primaire, :root[data-theme="auto"] .puce.actif,
  :root[data-theme="auto"] .plus-modules .bras-intime { --texte: #06210f; color: #06210f; }
  :root[data-theme="auto"] .plus-modules .bras-intime small { color: #0b3a22; }
}
.logo-sombre { display: none !important; }
:root[data-theme="sombre"] .logo-clair { display: none !important; }
:root[data-theme="sombre"] .logo-sombre { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .logo-clair { display: none !important; }
  :root[data-theme="auto"] .logo-sombre { display: block !important; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--entete) + 12px); }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: var(--t-m);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--foret); text-underline-offset: 3px; }
a:hover { color: var(--foret-2); }
h1, h2, h3, h4 { font-family: var(--police-titre); color: var(--marine); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; font-weight: 700; }
h1 { font-size: var(--t-3xl); letter-spacing: -.02em; }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-l); }
p { margin: 0 0 1em; }
small, .petit { font-size: var(--t-s); }
.discret { color: var(--gris); }
.tres-discret { color: var(--gris-clair); font-size: var(--t-xs); }
hr { border: 0; border-top: 1px solid var(--trait); margin: 24px 0; }
::selection { background: var(--menthe); color: var(--foret-2); }
:focus-visible { outline: 3px solid var(--feuille); outline-offset: 2px; border-radius: 6px; }
.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; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
[hidden] { display: none !important; }
.saut-lien { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--marine-fixe); color: #fff; padding: 10px 14px; border-radius: var(--r-s); }
.saut-lien:focus { top: 8px; color: #fff; }

/* ---------- Mise en page ---------- */
.conteneur { width: 100%; max-width: var(--largeur); margin-inline: auto; padding-inline: var(--gouttiere); }
.conteneur-etroit { max-width: 760px; }
.conteneur-moyen { max-width: 1120px; }
main { flex: 1; padding-bottom: calc(var(--onglets) + 32px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { main { padding-bottom: 48px; } }
.section { padding-block: 40px; }
.section-serree { padding-block: 24px; }
.fond-brume { background: var(--brume); }
.pile > * + * { margin-top: var(--pile, 16px); }
.pile-s { --pile: 8px; }
.pile-l { --pile: 28px; }
.ligne { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ligne-entre { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ligne-fin { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 260px)), 1fr)); }
.grille-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grille-3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grille > *, .grille-2 > *, .grille-3 > *, .colonnes > * { min-width: 0; }
@media (min-width: 720px) { .grille-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grille-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grille-3 { grid-template-columns: repeat(3, 1fr); } }
.colonnes { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  .colonnes { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .colonnes-gauche { grid-template-columns: 300px minmax(0, 1fr); }
  .colle { position: sticky; top: calc(var(--entete) + 16px); }
}
@media (min-width: 720px) { .messages { top: 16px; left: calc(50% + var(--lateral-largeur) / 2); } }
@media (min-width: 1200px) { .colle { top: 16px; } }
.min0 { min-width: 0; }
.centre { text-align: center; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-s { margin-top: 8px; } .mt-m { margin-top: 16px; } .mt-l { margin-top: 28px; }
.mb-s { margin-bottom: 8px; } .mb-m { margin-bottom: 16px; } .mb-l { margin-bottom: 28px; }
.coupe { overflow-wrap: anywhere; }

/* ---------- Coque d'application ---------- */
/* Téléphone (< 720 px) : barre du haut + onglets en bas + menu plein écran.
   Tablette (720–1199 px) : rail d'icônes à gauche + barre du haut (préférences, compte).
   Ordinateur (≥ 1200 px) : barre latérale complète, pas de menu hamburger.
   Grands écrans et TV (≥ 1920 px) : tout est agrandi proportionnellement. */
.app-principal { min-width: 0; min-height: 100dvh; display: flex; flex-direction: column; }
@media (min-width: 720px) {
  .app-principal { margin-left: var(--lateral-largeur); }
}
.entete {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface-verre);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--trait);
  padding-top: env(safe-area-inset-top);
}
/* backdrop-filter crée un bloc conteneur pour les éléments fixes : on le retire quand le menu plein écran est ouvert */
.entete:has(details[open]) { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--fond); }
.entete .conteneur { height: var(--entete); display: flex; align-items: center; gap: 12px; }
@media (min-width: 1200px) { .entete { display: none; } }
.marque { display: flex; align-items: center; flex: none; }
.marque img { height: 34px; width: auto; }
.entete-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.bouton-rond {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--marine); cursor: pointer; text-decoration: none;
}
.bouton-rond:hover { background: var(--brume); color: var(--foret); }
.bouton-rond .ic { width: 22px; height: 22px; }
.compteur {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--feuille); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--surface); box-sizing: content-box;
}
.compteur:empty, .compteur[data-n="0"] { display: none; }

/* Barre latérale (ordinateur) */
.lateral {
  display: none; position: fixed; inset: 0 auto 0 0; width: var(--lateral-largeur); z-index: 70;
  background: var(--lateral); border-right: 1px solid var(--trait);
  flex-direction: column; padding: 20px 14px 14px;
}
@media (min-width: 720px) { .lateral { display: flex; } }
.lateral .marque { padding: 4px 10px 18px; }
.lateral .marque img { height: 40px; }
.lateral-defile { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.nav-lat { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-lat .groupe { padding: 16px 12px 6px; color: var(--gris); font-size: var(--t-xs); font-weight: 700; }
.nav-lat a, .nav-lat button {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r-m);
  color: var(--encre); text-decoration: none; font: inherit; font-weight: 700; font-size: var(--t-s);
  background: none; border: 0; cursor: pointer; text-align: left;
}
.nav-lat a:hover, .nav-lat button:hover { background: var(--brume); color: var(--foret); }
.nav-lat a[aria-current="page"] { background: var(--menthe); color: var(--foret-2); }
.nav-lat .ic { width: 20px; height: 20px; }
.nav-lat .compteur { position: static; margin-left: auto; border: 0; }
.nav-lat .compteur-attente { background: var(--ambre); }
.lateral-pied { border-top: 1px solid var(--trait); padding-top: 12px; margin-top: 8px; display: grid; gap: 8px; }
.compte-lat { display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-width: 0; }
.compte-lat .min0 { flex: 1; }
.compte-lat strong { display: block; font-size: var(--t-s); color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compte-lat small { color: var(--gris); font-size: var(--t-xs); }

/* Préférences : thème et langue */
.preferences { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 4px; }
.bascule-theme {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1.5px solid var(--trait); background: var(--surface); color: var(--encre); font: inherit; font-size: var(--t-xs); font-weight: 700; cursor: pointer;
}
.bascule-theme .ic { width: 18px; height: 18px; }
.langues { display: inline-flex; border: 1.5px solid var(--trait); border-radius: var(--r-pill); overflow: hidden; background: var(--surface); }
.langues a { padding: 8px 9px; font-size: var(--t-xs); font-weight: 700; color: var(--gris); text-decoration: none; line-height: 1; }
.langues a[aria-current="true"] { background: var(--foret); color: #fff; }
:root[data-theme="sombre"] .langues a[aria-current="true"] { color: #06210f; }

/* Menu plein écran (mobile) : details/summary, fonctionne sans JavaScript */
.menu { position: static; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panneau {
  position: fixed; inset: calc(var(--entete) + env(safe-area-inset-top)) 0 0 0; z-index: 80; overflow-y: auto;
  background: var(--fond); padding: 12px var(--gouttiere) calc(var(--onglets) + 24px);
  animation: tiroir .2s ease-out;
}
@keyframes tiroir { from { opacity: 0; transform: translateY(-8px); } }
.menu-panneau .titre-menu { padding: 14px 12px 6px; color: var(--gris); font-size: var(--t-xs); font-weight: 700; }
.menu-panneau hr { margin: 8px 0; }
.menu-panneau .nav-lat a, .menu-panneau .nav-lat button { padding: 13px 12px; font-size: var(--t-m); }

/* Onglets du bas (mobile) */
.onglets-bas {
  position: fixed; inset: auto 0 0 0; z-index: 70;
  background: var(--surface-verre); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--trait);
  padding-bottom: env(safe-area-inset-bottom);
}
.onglets-bas ul { list-style: none; margin: 0; padding: 0 4px; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--onglets); }
.onglets-bas a {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--gris); text-decoration: none; font-size: 11px; font-weight: 700; position: relative;
  -webkit-user-select: none; user-select: none;
}
.onglets-bas a .ic { width: 24px; height: 24px; }
.onglets-bas a[aria-current="page"] { color: var(--foret); }
.onglets-bas a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--feuille);
}
.onglets-bas .compteur { top: 6px; right: calc(50% - 22px); }
@media (min-width: 720px) { .onglets-bas { display: none; } }

/* Barre de progression de navigation (comportement d'application) */
.chargement { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200; background: var(--feuille);
  box-shadow: 0 0 8px var(--feuille); transition: width .3s ease, opacity .3s ease; opacity: 0; pointer-events: none; }
.chargement.actif { opacity: 1; width: 70%; transition: width 8s cubic-bezier(.1, .7, .2, 1); }

/* Pied de page compact */
.pied { background: var(--marine-fixe); color: #c9d6ee; padding-block: 32px calc(var(--onglets) + 32px); margin-top: auto; }
@media (min-width: 720px) { .pied { padding-bottom: 32px; } }
.pied a { color: #fff; text-decoration: none; }
.pied a:hover { text-decoration: underline; color: #fff; }
.pied h4 { color: #fff; font-size: var(--t-m); margin-bottom: 12px; }
.pied ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pied-grille { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .pied-grille { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.pied-grille > :first-child { grid-column: 1 / -1; }
@media (min-width: 900px) { .pied-grille > :first-child { grid-column: auto; } }
.slogan { font-family: var(--police-titre); font-size: var(--t-xl); color: #fff; line-height: 1.25; max-width: 22ch; }
.pied-bas { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.15); font-size: var(--t-s); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.pied-compact { padding-block: 20px calc(var(--onglets) + 20px); font-size: var(--t-s); }
@media (min-width: 720px) { .pied-compact { padding-bottom: 20px; } }
.pied-compact .conteneur { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* Application installée : pas de rebond, sélection de texte limitée aux contenus */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
  .entete, .onglets-bas, .lateral { -webkit-user-select: none; user-select: none; }
}

/* ---------- Boutons ---------- */
.btn {
  --fond: var(--brume); --texte: var(--marine); --bord: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-pill);
  background: var(--fond); color: var(--texte); border: 1.5px solid var(--bord);
  font: inherit; font-weight: 700; font-size: var(--t-m); line-height: 1.1; text-decoration: none; text-align: center;
  cursor: pointer; transition: background var(--duree), color var(--duree), border-color var(--duree), transform .08s;
  -webkit-user-select: none; user-select: none; position: relative;
}
.btn:hover { color: var(--texte); filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-primaire { --fond: var(--foret); --texte: #fff; }
.btn-primaire:hover { --fond: var(--foret-2); filter: none; }
.btn-secondaire { --fond: var(--surface); --texte: var(--foret); --bord: var(--trait-fort); }
.btn-secondaire:hover { --bord: var(--foret); filter: none; }
.btn-fantome { --fond: transparent; --texte: var(--foret); padding-inline: 12px; }
.btn-fantome:hover { --fond: var(--brume); filter: none; }
.btn-danger { --fond: var(--surface); --texte: var(--rouge); --bord: #f1b7c1; }
.btn-urgence { --fond: var(--rouge); --texte: #fff; }
.btn-blanc { --fond: #fff; --texte: var(--foret-2); }
.btn-l { min-height: 56px; font-size: var(--t-l); padding: 0 28px; }
.btn-s { min-height: 38px; padding: 0 14px; font-size: var(--t-s); }
.btn-bloc { width: 100%; }
.btn .ic { width: 20px; height: 20px; }
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: var(--texte) transparent var(--texte) transparent;
  animation: tourne .7s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
.lien-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--foret); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Formulaires ---------- */
.champ { display: grid; gap: 6px; margin-bottom: 18px; }
.champ > label, .etiquette { font-weight: 700; color: var(--marine); font-size: var(--t-s); }
.champ .aide { color: var(--gris); font-size: var(--t-xs); }
.champ .erreur, .erreur-liste { color: var(--rouge); font-size: var(--t-s); font-weight: 600; }
.erreur-liste { list-style: none; padding: 0; margin: 0; }
.requis::after { content: " *"; color: var(--rouge); }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=url], input[type=date], input[type=datetime-local], input[type=time], select, textarea, .saisie {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-m);
  border: 1.5px solid var(--trait-fort); background: var(--surface); color: var(--encre); font: inherit; font-size: 16px;
  transition: border-color var(--duree), box-shadow var(--duree); appearance: none; -webkit-appearance: none;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230b5d3b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 42px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--foret); box-shadow: 0 0 0 4px rgba(18, 161, 80, .16); }
.champ-invalide input, .champ-invalide select, .champ-invalide textarea, [aria-invalid="true"] { border-color: var(--rouge) !important; }
input[type=file] { width: 100%; font: inherit; font-size: var(--t-s); padding: 10px; border: 1.5px dashed var(--trait-fort); border-radius: var(--r-m); background: var(--brume); }
input[type=file]::file-selector-button { font: inherit; font-weight: 700; border: 0; background: var(--foret); color: #fff; padding: 8px 14px; border-radius: var(--r-pill); margin-right: 10px; cursor: pointer; }
.case { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.case input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--foret); flex: none; }
.prefixe { display: flex; align-items: stretch; }
.prefixe span { display: grid; place-items: center; padding: 0 12px; background: var(--brume); border: 1.5px solid var(--trait-fort); border-right: 0; border-radius: var(--r-m) 0 0 var(--r-m); font-weight: 700; color: var(--gris); }
.prefixe input { border-radius: 0 var(--r-m) var(--r-m) 0; }

/* Choix en cartes (radio / case) */
.choix { display: grid; gap: 10px; }
.choix-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.choix label {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-l);
  border: 1.5px solid var(--trait); background: var(--surface); cursor: pointer; transition: border-color var(--duree), background var(--duree);
}
.choix label:hover { border-color: var(--trait-fort); }
.choix input { accent-color: var(--foret); width: 20px; height: 20px; margin-top: 2px; flex: none; }
.choix label:has(input:checked) { border-color: var(--foret); background: var(--menthe); box-shadow: inset 0 0 0 1px var(--foret); }
.choix strong { display: block; color: var(--marine); }
.choix small { color: var(--gris); }

/* Sélecteur de quantité */
.quantite { display: inline-flex; align-items: center; border: 1.5px solid var(--trait-fort); border-radius: var(--r-pill); background: var(--surface); }
.quantite button { width: 44px; height: 44px; border: 0; background: none; color: var(--foret); cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.quantite button:hover { background: var(--brume); }
.quantite input { width: 48px; min-height: 40px; text-align: center; border: 0; padding: 0; font-weight: 700; -moz-appearance: textfield; }
.quantite input::-webkit-outer-spin-button, .quantite input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quantite input:focus { box-shadow: none; }

/* Recherche */
.barre-recherche { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--trait-fort); border-radius: var(--r-pill); padding: 4px 4px 4px 16px; }
.barre-recherche:focus-within { border-color: var(--foret); box-shadow: 0 0 0 4px rgba(18,161,80,.16); }
.barre-recherche input { border: 0; padding: 8px 0; min-height: 44px; box-shadow: none !important; }
.barre-recherche .ic { color: var(--gris); }
.barre-recherche select { border: 0; border-left: 1px solid var(--trait); border-radius: 0; min-height: 40px; width: auto; max-width: 42%; box-shadow: none !important; background-color: transparent; }

/* ---------- Cartes ---------- */
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-l); padding: 20px; }
.carte-l { padding: 24px; }
@media (min-width: 768px) { .carte-l { padding: 32px; } }
.carte-brume { background: var(--brume); border-color: transparent; }
.carte-elevee { box-shadow: var(--ombre-2); border-color: transparent; }
.carte-lien { display: block; color: inherit; text-decoration: none; transition: border-color var(--duree), transform var(--duree); }
.carte-lien:hover { border-color: var(--trait-fort); color: inherit; }
.carte-lien:active { transform: scale(.995); }
.carte h3 { font-size: var(--t-l); }
.carte-titre { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.carte-titre h2, .carte-titre h3 { margin: 0; }
.liste-plate { list-style: none; margin: 0; padding: 0; }
.liste-plate > li + li { border-top: 1px solid var(--trait); }
.liste-plate > li { padding: 14px 0; }
.ligne-cle { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; }
.ligne-cle dt { color: var(--gris); }
.ligne-cle dd { margin: 0; font-weight: 700; text-align: right; color: var(--encre); }
dl.details { margin: 0; }
dl.details > div + div { border-top: 1px dashed var(--trait); }
.total { font-family: var(--police-titre); font-size: var(--t-xl); color: var(--marine); }

/* Pastille d'icône en forme de « + » arrondi : motif de la marque */
.croix {
  --c: var(--foret); --f: var(--menthe);
  width: 52px; height: 52px; flex: none; display: grid; place-items: center; color: var(--c); position: relative; isolation: isolate;
}
.croix::before, .croix::after { content: ""; position: absolute; background: var(--f); border-radius: 10px; z-index: -1; }
.croix::before { inset: 0 26%; }
.croix::after { inset: 26% 0; }
.croix .ic { width: 24px; height: 24px; }
.croix-l { width: 72px; height: 72px; }
.croix-l .ic { width: 32px; height: 32px; }
.croix-urgence { --c: var(--rouge); --f: var(--rouge-doux); }
.croix-annuaire { --c: var(--sarcelle); --f: var(--sarcelle-doux); }
.croix-marche { --c: var(--ambre); --f: var(--ambre-doux); }
.croix-marine { --c: var(--marine); --f: var(--info-doux); }
.croix-pleine { --c: #fff; --f: var(--foret); }

/* ---------- Pastilles de statut ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 700; line-height: 1.4; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-succes { background: var(--menthe); color: var(--foret-2); }
.pill-info { background: var(--info-doux); color: var(--info); }
.pill-attente { background: var(--ambre-doux); color: var(--ambre); }
.pill-danger { background: var(--rouge-doux); color: var(--rouge); }
.pill-neutre { background: var(--brume-2); color: var(--gris); }
.etiquette-douce { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--brume); color: var(--foret-2); font-size: var(--t-xs); font-weight: 700; }

/* ---------- Messages ---------- */
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-m); background: var(--info-doux); color: #163f7a; font-size: var(--t-s); }
.note .ic { width: 20px; height: 20px; margin-top: 1px; }
.note p:last-child { margin-bottom: 0; }
.note-succes { background: var(--menthe); color: var(--foret-2); }
.note-attente { background: var(--ambre-doux); color: #7c3a06; }
.note-danger { background: var(--rouge-doux); color: #8a0c20; }
.note-neutre { background: var(--brume); color: var(--encre); }
.messages { position: fixed; z-index: 120; left: 50%; transform: translateX(-50%); top: calc(var(--entete) + 10px); width: min(560px, calc(100vw - 24px)); display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-m); background: var(--marine-fixe); color: #fff; box-shadow: var(--ombre-3); font-weight: 600; animation: entre .25s ease-out; }
.toast-succes { background: var(--foret); }
.toast-erreur { background: var(--rouge); }
.toast-alerte { background: #7c3a06; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; opacity: .8; }
@keyframes entre { from { opacity: 0; transform: translateY(-8px); } }

/* État vide */
.vide { text-align: center; padding: 48px 16px; display: grid; justify-items: center; gap: 10px; }
.vide .croix { margin-bottom: 6px; }
.vide h3 { margin: 0; }
.vide p { color: var(--gris); max-width: 42ch; margin: 0 auto 8px; }

/* Squelette de chargement */
.squelette { background: linear-gradient(90deg, var(--brume) 25%, var(--brume-2) 37%, var(--brume) 63%); background-size: 400% 100%; animation: chatoie 1.3s ease infinite; border-radius: var(--r-s); min-height: 16px; }
@keyframes chatoie { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Bandeau réseau & synchronisation ---------- */
.reseau {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--onglets) + 12px + env(safe-area-inset-bottom)); z-index: 90;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-m);
  background: var(--encre); color: #fff; font-weight: 600; font-size: var(--t-s); box-shadow: var(--ombre-3);
}
@media (min-width: 900px) { .reseau { left: auto; right: 24px; bottom: 24px; width: 380px; } }
.reseau.en-ligne { background: var(--foret); }
.reseau .ic { width: 20px; height: 20px; }
.attente-sync { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--ambre-doux); color: var(--ambre); font-weight: 700; font-size: var(--t-xs); text-decoration: none; }

/* ---------- Chronologie (suivi) ---------- */
.etapes { list-style: none; margin: 0; padding: 0; position: relative; }
.etapes li { position: relative; padding: 0 0 22px 40px; }
.etapes li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--trait); }
.etapes li:last-child { padding-bottom: 0; }
.etapes li:last-child::before { display: none; }
.etapes .puce { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--trait-fort); color: var(--gris); }
.etapes .puce .ic { width: 15px; height: 15px; }
.etapes .fait .puce { background: var(--feuille); border-color: var(--feuille); color: #fff; }
.etapes .fait::before { background: var(--feuille); }
.etapes .courant .puce { border-color: var(--foret); color: var(--foret); box-shadow: 0 0 0 5px var(--menthe); }
.etapes strong { display: block; color: var(--marine); }
.etapes small { color: var(--gris); }

/* ---------- Tableaux ---------- */
.tableau-conteneur { width: 100%; overflow-x: auto; border: 1px solid var(--trait); border-radius: var(--r-l); background: var(--surface); }
table.tableau { width: 100%; border-collapse: collapse; font-size: var(--t-s); }
.tableau th { text-align: left; color: var(--gris); font-weight: 700; padding: 12px 14px; background: var(--brume); border-bottom: 1px solid var(--trait); white-space: nowrap; }
.tableau td { padding: 12px 14px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover { background: var(--survol); }
.tableau .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 719px) {
  .tableau-empile { border: 0; background: none; overflow: visible; }
  .tableau-empile table, .tableau-empile tbody, .tableau-empile tr, .tableau-empile td { display: block; width: 100%; }
  .tableau-empile thead { display: none; }
  .tableau-empile tr { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-l); padding: 8px 14px; margin-bottom: 10px; }
  .tableau-empile td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 8px 0; text-align: right; }
  .tableau-empile td::before { content: attr(data-label); color: var(--gris); font-weight: 700; text-align: left; }
  .tableau-empile td.num { text-align: right; }
}

/* ---------- Chiffres clés ---------- */
.chiffres { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.chiffre { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-l); padding: 16px; min-width: 0; }
.chiffre .valeur { font-family: var(--police-titre); font-size: var(--t-2xl); font-weight: 700; color: var(--marine); line-height: 1.1; overflow-wrap: anywhere; }
.chiffre .libelle { color: var(--gris); font-size: var(--t-s); }
a.chiffre { text-decoration: none; color: inherit; }
a.chiffre:hover { border-color: var(--trait-fort); }
.chiffre-alerte { border-color: #f6c768; background: var(--ambre-doux); }

/* ---------- Puces filtres (défilement horizontal interne) ---------- */
.puces { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin-inline: calc(var(--gouttiere) * -1); padding-inline: var(--gouttiere); }
.puces::-webkit-scrollbar { display: none; }
.puce {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1.5px solid var(--trait); background: var(--surface); color: var(--encre); font-weight: 700; font-size: var(--t-s); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.puce:hover { border-color: var(--trait-fort); color: var(--foret); }
.puce[aria-current="true"], .puce.actif { background: var(--foret); border-color: var(--foret); color: #fff; }

/* Onglets */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--trait); overflow-x: auto; scrollbar-width: none; margin-bottom: 20px; }
.onglets a { padding: 12px 14px; color: var(--gris); text-decoration: none; font-weight: 700; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglets a[aria-current="page"] { color: var(--foret); border-color: var(--feuille); }

/* Fil d'Ariane / retour */
.retour { display: inline-flex; align-items: center; gap: 6px; color: var(--gris); text-decoration: none; font-weight: 700; font-size: var(--t-s); padding: 8px 0; }
.retour:hover { color: var(--foret); }
.entete-page { padding-block: 24px 8px; }
.entete-page h1 { margin-bottom: 6px; }
.entete-page p { color: var(--gris); max-width: 60ch; }

/* ---------- Accueil ---------- */
.heros { padding-block: 28px 36px; background:
  radial-gradient(1200px 400px at 110% -10%, var(--menthe), transparent 60%), var(--fond); }
@media (min-width: 900px) { .heros { padding-block: 64px 72px; } }
.heros-grille { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) { .heros-grille { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.heros h1 { font-size: var(--t-4xl); line-height: 1.02; max-width: 14ch; margin-bottom: 16px; }
.heros .accroche { font-size: var(--t-l); color: var(--gris); max-width: 46ch; }
.heros-recherche { margin-top: 24px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-xl); padding: 16px; box-shadow: var(--ombre-2); }
.heros-recherche .etiquette { display: block; margin-bottom: 10px; }
.heros-recherche .rangee { display: flex; flex-wrap: wrap; gap: 10px; }
.heros-recherche .rangee .btn { flex: 1 1 240px; min-width: 0; padding-block: 10px; }
.garanties { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; color: var(--gris); font-size: var(--t-s); font-weight: 600; }
.garanties span { display: inline-flex; align-items: center; gap: 6px; }
.garanties .ic { color: var(--feuille); width: 18px; height: 18px; }

/* La grande croix des modules : élément signature */
.plus-modules {
  display: grid; gap: 10px;
  grid-template-columns: 1fr 1fr;
}
.plus-modules .bras {
  display: flex; flex-direction: column; gap: 6px; justify-content: flex-end;
  min-height: 150px; padding: 18px; border-radius: var(--r-xl); text-decoration: none; color: var(--marine);
  background: var(--brume); position: relative; overflow: hidden; transition: transform var(--duree), background var(--duree);
}
.plus-modules .bras:hover { transform: translateY(-2px); color: var(--marine); }
.plus-modules .bras strong { font-family: var(--police-titre); font-size: var(--t-l); line-height: 1.15; }
.plus-modules .bras small { color: var(--gris); font-size: var(--t-xs); line-height: 1.35; }
.plus-modules .bras .ic { width: 28px; height: 28px; position: absolute; top: 18px; left: 18px; }
.plus-modules .bras-intime { background: var(--foret); color: #fff; }
.plus-modules .bras-intime:hover { color: #fff; }
.plus-modules .bras-intime small { color: #cfeedd; }
.plus-modules .bras-urgence { background: var(--rouge-doux); }
.plus-modules .bras-urgence .ic { color: var(--rouge); }
.plus-modules .bras-marche { background: var(--ambre-doux); }
.plus-modules .bras-marche .ic { color: var(--ambre); }
.plus-modules .bras-annuaire { background: var(--sarcelle-doux); }
.plus-modules .bras-annuaire .ic { color: var(--sarcelle); }
@media (min-width: 560px) {
  .plus-modules {
    grid-template-columns: 1fr 1fr 1fr; grid-template-rows: auto auto auto;
    grid-template-areas: ". haut ." "gauche centre droite" ". bas .";
  }
  .plus-modules .bras-intime { grid-area: haut; }
  .plus-modules .bras-marche { grid-area: gauche; }
  .plus-modules .bras-urgence { grid-area: droite; }
  .plus-modules .bras-annuaire { grid-area: bas; }
  .plus-modules .coeur { grid-area: centre; display: grid; place-items: center; border-radius: var(--r-xl); background: var(--surface); border: 1.5px dashed var(--trait-fort); }
  .plus-modules .coeur img { width: 64%; }
}
@media (max-width: 559px) { .plus-modules .coeur { display: none; } }

.bande-modules { display: grid; gap: 14px; }
@media (min-width: 900px) { .bande-modules { grid-template-columns: repeat(3, 1fr); } }
.module { padding: 24px; border-radius: var(--r-xl); border: 1px solid var(--trait); background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.module h3 { margin: 6px 0 0; }
.module p { color: var(--gris); margin: 0; }
.module .btn { margin-top: auto; align-self: flex-start; }
.module ul { margin: 0; padding-left: 18px; color: var(--encre); }

.parcours { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: etape; }
@media (min-width: 900px) { .parcours { grid-template-columns: repeat(4, 1fr); } }
.parcours li { counter-increment: etape; background: var(--surface); border-radius: var(--r-l); padding: 20px; border: 1px solid var(--trait); }
.parcours li::before { content: counter(etape); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--menthe); color: var(--foret-2); font-family: var(--police-titre); font-weight: 700; margin-bottom: 12px; }
.parcours strong { display: block; color: var(--marine); margin-bottom: 4px; }
.parcours p { color: var(--gris); margin: 0; font-size: var(--t-s); }

/* ---------- Produits ---------- */
.produits { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .produits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1080px) { .produits { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.produit { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-l); overflow: hidden; text-decoration: none; color: inherit; min-width: 0; }
.produit:hover { border-color: var(--trait-fort); color: inherit; }
.produit .visuel { aspect-ratio: 1; background: var(--brume); display: grid; place-items: center; position: relative; }
.produit .visuel img { width: 100%; height: 100%; object-fit: cover; }
.produit .visuel .ic { width: 40px; height: 40px; color: var(--trait-fort); }
.produit .corps { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.produit .nom { font-weight: 700; color: var(--encre); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--t-s); }
.produit .vendeur { color: var(--gris); font-size: var(--t-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.produit .prix { margin-top: auto; padding-top: 6px; font-family: var(--police-titre); font-weight: 700; color: var(--marine); font-size: var(--t-l); }
.prix-barre { color: var(--gris-clair); text-decoration: line-through; font-size: var(--t-s); font-weight: 400; margin-left: 4px; }
.remise { position: absolute; top: 10px; left: 10px; background: var(--feuille); color: #fff; font-size: var(--t-xs); font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill); }
.rupture { position: absolute; inset: auto 10px 10px 10px; background: rgba(23,38,47,.82); color: #fff; font-size: var(--t-xs); font-weight: 700; padding: 5px 8px; border-radius: var(--r-s); text-align: center; }

.galerie { aspect-ratio: 1; border-radius: var(--r-xl); background: var(--brume); overflow: hidden; display: grid; place-items: center; }
.galerie img { width: 100%; height: 100%; object-fit: cover; }

/* Panier */
.article-panier { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--trait); }
.article-panier .vignette { width: 72px; height: 72px; border-radius: var(--r-m); background: var(--brume); overflow: hidden; display: grid; place-items: center; }
.article-panier .vignette img { width: 100%; height: 100%; object-fit: cover; }
.barre-action {
  position: fixed; left: 0; right: 0; bottom: calc(var(--onglets) + env(safe-area-inset-bottom)); z-index: 65;
  background: var(--surface); border-top: 1px solid var(--trait); padding: 12px var(--gouttiere); box-shadow: 0 -10px 30px -20px rgba(0,0,0,.3);
}
@media (min-width: 900px) { .barre-action { position: static; box-shadow: none; border: 0; padding: 0; background: none; } }

/* ---------- Boutique ---------- */
.banniere { height: 140px; background: linear-gradient(120deg, var(--foret), var(--feuille)); border-radius: 0 0 var(--r-xl) var(--r-xl); overflow: hidden; }
@media (min-width: 768px) { .banniere { height: 220px; border-radius: var(--r-xl); margin-top: 16px; } }
.banniere img { width: 100%; height: 100%; object-fit: cover; }
.logo-boutique { width: 84px; height: 84px; border-radius: 22px; border: 4px solid var(--surface); background: var(--brume); overflow: hidden; display: grid; place-items: center; margin-top: -42px; box-shadow: var(--ombre-1); font-family: var(--police-titre); font-weight: 700; font-size: var(--t-xl); color: var(--foret); }
.logo-boutique img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Annuaire ---------- */
.etab { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
.etab h3 { margin: 0 0 4px; font-size: var(--t-l); }
.etab .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--gris); font-size: var(--t-s); }
.etab .meta span { display: inline-flex; align-items: center; gap: 4px; }
.etab .meta .ic { width: 16px; height: 16px; }
.garde { background: var(--feuille); color: #fff; }
.carte-geo { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--r-l); background: var(--brume); }

/* ---------- BioSecours ---------- */
.heros-urgence { background: radial-gradient(900px 380px at 100% 0, var(--rouge-doux), transparent 60%), var(--fond); }
.fiche-publique { max-width: 560px; margin-inline: auto; }
.bandeau-urgence { background: var(--rouge); color: #fff; border-radius: var(--r-xl); padding: 20px; display: grid; gap: 4px; }
.bandeau-urgence h1 { color: #fff; font-size: var(--t-2xl); margin: 0; }
.appel { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-l); border: 1.5px solid var(--trait); background: var(--surface); text-decoration: none; color: var(--encre); }
.appel:hover { border-color: var(--rouge); color: var(--encre); }
.appel .numero { margin-left: auto; font-family: var(--police-titre); font-size: var(--t-xl); font-weight: 700; color: var(--rouge); white-space: nowrap; }
.appel-principal { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.appel-principal:hover { color: #fff; filter: brightness(.95); }
.appel-principal .numero { color: #fff; }
.appel-principal .croix { --c: var(--rouge); --f: #fff; }
.donnee-medicale { border-left: 4px solid var(--rouge); padding: 10px 0 10px 14px; }
.donnee-medicale dt { font-weight: 700; color: var(--marine); }
.donnee-medicale dd { margin: 2px 0 0; white-space: pre-line; }

/* Carte physique au format CR80 (85,6 × 54 mm) */
.carte-bio {
  --marine: #0d2b66; --encre: #17262f; --gris: #5b6b66; --rouge: #c8102e; --brume: #f2f7f4; --trait: #d9e5de;
  color: var(--encre);
  width: 100%; max-width: 428px; aspect-ratio: 85.6 / 54; border-radius: 18px; overflow: hidden;
  background: #fff; border: 1px solid var(--trait); box-shadow: var(--ombre-3);
  display: grid; grid-template-columns: 1fr auto; container-type: inline-size;
}
.carte-bio .gauche { padding: 5cqw 0 5cqw 5.5cqw; display: flex; flex-direction: column; gap: 1.6cqw; min-width: 0; }
.carte-bio .titre { display: flex; align-items: center; gap: 2cqw; font-family: var(--police-titre); font-weight: 700; color: var(--rouge); font-size: 4.2cqw; }
.carte-bio .titre img { width: 7cqw; height: 7cqw; }
.carte-bio .nom { font-family: var(--police-titre); font-size: 6cqw; font-weight: 700; color: var(--marine); line-height: 1.05; }
.carte-bio .ligne-contact { font-size: 3.4cqw; color: var(--encre); line-height: 1.25; }
.carte-bio .ligne-contact b { display: block; font-size: 4.6cqw; color: var(--rouge); }
.carte-bio .pied-carte { margin-top: auto; font-size: 2.7cqw; color: var(--gris); }
.carte-bio .droite { background: var(--brume); padding: 4cqw; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqw; }
.carte-bio .droite img { width: 31cqw; height: 31cqw; image-rendering: pixelated; }
.carte-bio .droite small { font-size: 2.5cqw; color: var(--gris); text-align: center; }

/* ---------- Magazine ---------- */
.une { display: grid; gap: 20px; }
@media (min-width: 900px) { .une { grid-template-columns: 1.4fr 1fr; } }
.article-carte { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; }
.article-carte:hover h3 { color: var(--foret); }
.article-carte .vignette { aspect-ratio: 16 / 10; border-radius: var(--r-l); background: var(--brume); overflow: hidden; display: grid; place-items: center; position: relative; }
.article-carte .vignette img { width: 100%; height: 100%; object-fit: cover; }
.article-carte .vignette .ic { width: 36px; height: 36px; color: var(--trait-fort); }
.article-carte h3 { margin: 0; font-size: var(--t-l); transition: color var(--duree); }
.article-carte p { margin: 0; color: var(--gris); font-size: var(--t-s); }
.lecture { max-width: 68ch; margin-inline: auto; font-size: var(--t-l); line-height: 1.7; }
.lecture h1 { font-size: var(--t-3xl); }
.lecture h2 { font-size: var(--t-xl); margin-top: 1.6em; }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--r-l); background: #000; }
.badge-verifie { display: inline-flex; align-items: center; gap: 6px; color: var(--foret-2); font-weight: 700; font-size: var(--t-s); }

/* ---------- Progression ---------- */
.jauge { height: 10px; border-radius: var(--r-pill); background: var(--brume-2); overflow: hidden; }
.jauge > span { display: block; height: 100%; background: var(--feuille); border-radius: inherit; }

/* ---------- Dialogue ---------- */
dialog { border: 0; border-radius: var(--r-xl); padding: 0; width: min(520px, calc(100vw - 24px)); box-shadow: var(--ombre-3); color: var(--encre); }
dialog::backdrop { background: rgba(13, 43, 102, .45); backdrop-filter: blur(3px); }
dialog .dialogue-corps { padding: 24px; }
dialog .dialogue-pied { padding: 16px 24px; background: var(--brume); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Espaces professionnels / console ---------- */
.espace-entete { background: var(--marine-fixe); color: #dbe5f5; padding-block: 24px; }
.espace-entete h1 { color: #fff; margin: 0; font-size: var(--t-2xl); }
.espace-entete p { margin: 4px 0 0; }
.espace-entete .btn-secondaire { --fond: transparent; --texte: #fff; --bord: rgba(255,255,255,.35); }
.console { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
.console-corps { padding: 24px var(--gouttiere) 48px; min-width: 0; }
.file-attente { display: grid; gap: 10px; }
.file-attente .carte { display: grid; gap: 10px; }
@media (min-width: 720px) { .file-attente .carte { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }

/* Mission (livreur) */
.mission-code { font-family: var(--police-titre); font-size: 2.5rem; letter-spacing: .3em; font-weight: 700; color: var(--marine); text-align: center; padding: 12px; background: var(--brume); border-radius: var(--r-l); }

/* ---------- Divers ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--menthe); color: var(--foret-2); display: grid; place-items: center; font-weight: 700; flex: none; }
.separateur { display: flex; align-items: center; gap: 12px; color: var(--gris); font-size: var(--t-s); }
.separateur::before, .separateur::after { content: ""; flex: 1; height: 1px; background: var(--trait); }
.code-suivi { font-family: var(--police-titre); font-weight: 700; letter-spacing: .06em; color: var(--marine); }
.qr-image { width: 220px; height: 220px; image-rendering: pixelated; border-radius: var(--r-m); background: #fff; padding: 10px; border: 1px solid var(--trait); }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }

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

/* ================================================================== */
/* Mouvement : l'interface réagit et s'anime (désactivé si l'appareil   */
/* demande moins d'animations)                                          */
/* ================================================================== */
/* Transitions entre pages (navigateurs compatibles) : la barre latérale et les onglets restent fixes */
@view-transition { navigation: auto; }
.lateral { view-transition-name: lateral; }
.onglets-bas { view-transition-name: onglets; }
.entete { view-transition-name: entete; }
::view-transition-old(root) { animation: 160ms ease-in both sortie-page; }
::view-transition-new(root) { animation: 260ms cubic-bezier(.2, .8, .2, 1) both entree-page; }
@keyframes sortie-page { to { opacity: 0; transform: translateY(-6px); } }
@keyframes entree-page { from { opacity: 0; transform: translateY(10px); } }

/* Apparition au défilement (classe ajoutée par app.js) */
.js .revele { opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .55s cubic-bezier(.2, .8, .2, 1), transform .55s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 60ms); }
.js .revele.visible { opacity: 1; transform: none; }
.apparait { animation: entree-page .5s cubic-bezier(.2, .8, .2, 1) both; }

/* Cartes et boutons : relief au survol, enfoncement au toucher */
.carte-lien, .produit, a.chiffre, .bras, .module { transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s, border-color .22s; }
@media (hover: hover) {
  .carte-lien:hover, .produit:hover, a.chiffre:hover { transform: translateY(-3px); box-shadow: 0 14px 34px -18px rgba(13, 43, 102, .35); }
  .btn:hover .ic { transform: translateX(2px); }
  .nav-lat a:hover .ic { transform: scale(1.12); }
}
.btn .ic, .nav-lat .ic, .onglets-bas .ic { transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.btn:active { transform: scale(.96); }
.carte-lien:active, .produit:active { transform: scale(.985); }
/* Onglet actif : l'icône saute légèrement */
.onglets-bas a[aria-current="page"] .ic { animation: saut .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes saut { 40% { transform: translateY(-4px) scale(1.12); } }
/* Ondulation au toucher */
.onde { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .18; pointer-events: none; animation: onde .6s ease-out forwards; }
@keyframes onde { to { transform: scale(4); opacity: 0; } }
.btn, .bouton-rond, .nav-lat a, .onglets-bas a { overflow: hidden; }
/* Compteurs (panier, notifications) : rebond quand le nombre change */
.compteur.rebond { animation: rebond .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rebond { 30% { transform: scale(1.45); } }
/* Accueil : modules qui flottent doucement, croix qui respire */
.plus-modules > * { animation: flotte 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -1.4s); }
@keyframes flotte { 50% { transform: translateY(-6px); } }
.plus-modules .coeur img, .croix-l { animation: respire 4s ease-in-out infinite; }
@keyframes respire { 50% { transform: scale(1.05); } }
/* Squelettes de chargement */
.squelette { position: relative; overflow: hidden; background: var(--brume); border-radius: var(--r-m); min-height: 1em; }
.squelette::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); animation: balaye 1.3s infinite; }
@keyframes balaye { to { transform: translateX(100%); } }
/* Changement de thème en douceur */
html.transition-theme, html.transition-theme * { transition: background-color .35s, color .35s, border-color .35s !important; }
/* Pastilles « en cours » qui pulsent */
.pill-info::before, .pill-attente::before { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.7); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .js .revele { opacity: 1; transform: none; transition: none; }
  .plus-modules > *, .plus-modules .coeur img, .croix-l, .pill-info::before, .pill-attente::before { animation: none; }
}

/* ================================================================== */
/* Visite guidée                                                       */
/* ================================================================== */
.tuto-voile { position: fixed; inset: 0; z-index: 400; }
.tuto-voile.plein { background: rgba(6, 18, 40, .58); backdrop-filter: blur(2px); }
.tuto-trou { position: fixed; z-index: 401; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 4px var(--feuille), 0 0 0 9999px rgba(6, 18, 40, .58);
  transition: left .35s cubic-bezier(.2, .8, .2, 1), top .35s cubic-bezier(.2, .8, .2, 1), width .35s, height .35s; }
.tuto-trou::after { content: ""; position: absolute; inset: -4px; border-radius: 18px; border: 3px solid var(--feuille); animation: halo 1.6s ease-out infinite; }
@keyframes halo { to { inset: -16px; opacity: 0; border-radius: 26px; } }
.tuto-bulle { position: fixed; z-index: 402; width: min(380px, calc(100vw - 32px)); background: var(--surface); color: var(--encre);
  border-radius: 20px; padding: 18px 18px 14px; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .45); border: 1px solid var(--trait); }
.tuto-bulle h3 { font-size: var(--t-l); margin: 2px 0 6px; }
.tuto-bulle .tuto-texte { margin: 0 0 14px; color: var(--gris); }
.tuto-etape { margin: 8px 0 0; font-size: var(--t-xs); font-weight: 700; color: var(--foret); text-transform: uppercase; letter-spacing: .04em; }
.tuto-progression { height: 4px; border-radius: 4px; background: var(--brume); overflow: hidden; }
.tuto-progression span { display: block; height: 100%; background: var(--feuille); border-radius: 4px; transition: width .35s; }
.tuto-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tuto-centre { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); text-align: center; padding: 26px 22px 18px; }
.tuto-centre .tuto-actions { justify-content: space-between; }
.tuto-feuille { left: 12px !important; right: 12px; width: auto; }
.tuto-feuille.en-bas { bottom: calc(12px + env(safe-area-inset-bottom)); top: auto !important; }
.tuto-feuille.en-haut { top: calc(12px + env(safe-area-inset-top)) !important; }
.tuto-bulle.entre { animation: bulle .35s cubic-bezier(.2, .8, .2, 1); }
.tuto-centre.entre { animation: bulle-centre .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes bulle { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes bulle-centre { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .tuto-trou::after { animation: none; } }

/* ---------- Impression ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .entete, .onglets-bas, .pied, .messages, .reseau, .ne-pas-imprimer, .barre-action { display: none !important; }
  main { padding: 0; min-height: 0; }
  .carte-bio { width: 85.6mm; max-width: none; height: 54mm; box-shadow: none; border: .2mm solid #999; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Pages autonomes (fiche d'urgence publique) : pas de barre latérale */
.sans-lateral .app-principal { margin-left: 0; }
.sans-lateral .entete { display: block; }
.sans-lateral main { padding-bottom: 32px; }
.fichier-actuel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 12px; border-radius: var(--r-s); background: var(--brume); font-size: var(--t-s); }
.fichier-actuel .case { margin: 0; }

/* Langues à mots longs (allemand…) : césure et coupure plutôt que débordement */
h1, h2, h3, h4, .titre-hero, .carte-titre, p, li, dd, td, strong, label { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }

/* Pied de page complet */
.pied-marque img { height: 40px; width: auto; margin-bottom: 10px; }
.pied-marque p { margin: 0; max-width: 32ch; }
.pied-bas { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; border-top: 1px solid rgba(255,255,255,.14); margin-top: 28px; padding-top: 18px; font-size: var(--t-xs); }
.pied ul a { overflow-wrap: anywhere; }
/* Contact */
.grille-contact { display: grid; gap: 20px; align-items: start; }
@media (min-width: 860px) { .grille-contact { grid-template-columns: minmax(260px, 1fr) 1.6fr; } }


/* ================================================================== */
/* Adaptation à chaque support                                         */
/* ================================================================== */
/* Tablette : rail d'icônes */
@media (min-width: 720px) and (max-width: 1199.98px) {
  :root { --lateral-largeur: 96px; }
  .lateral { padding: 14px 8px 10px; }
  .lateral .marque { padding: 0 0 10px; justify-content: center; }
  .lateral .marque img { display: none !important; }
  .lateral .marque::before { content: ""; width: 46px; height: 46px; background: url("../img/croix.5aab4c7d057f.png") center / contain no-repeat; }
  .lateral .nav-lat .groupe, .lateral-pied, .lateral [data-installer] { display: none !important; }
  .lateral .nav-lat a, .lateral .nav-lat button {
    flex-direction: column; gap: 5px; padding: 10px 2px; font-size: 10.5px; line-height: 1.15; text-align: center; justify-content: center; border-radius: 14px;
  }
  .lateral .nav-lat .ic { width: 23px; height: 23px; }
  .lateral .nav-lat .compteur { position: absolute; top: 4px; right: 14px; margin: 0; }
  .lateral .nav-lat a[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--feuille); }
  .lateral-defile { margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
  .entete .marque { visibility: hidden; width: 0; }
  .entete .conteneur { justify-content: flex-end; }
  /* Menu : panneau latéral droit (la navigation est déjà dans le rail) */
  .menu-panneau { left: auto; width: min(420px, 100%); border-left: 1px solid var(--trait); box-shadow: var(--ombre-3, 0 20px 50px rgba(0,0,0,.18)); padding-bottom: 24px; }
  .menu-panneau > .nav-lat { display: none; }
}
/* Petits téléphones */
@media (max-width: 359.98px) {
  :root { --gouttiere: 12px; --t-3xl: 1.85rem; --t-2xl: 1.5rem; }
  .onglets-bas a { font-size: 10px; }
  .btn { padding-inline: 16px; }
}
/* Téléphone à l'horizontale : barres plus fines pour laisser la place au contenu */
@media (max-height: 480px) and (orientation: landscape) and (max-width: 1000px) {
  :root { --entete: 52px; --onglets: 52px; }
  .onglets-bas a { flex-direction: row; gap: 6px; font-size: 12px; }
  .onglets-bas a .ic { width: 20px; height: 20px; }
  .onglets-bas a[aria-current="page"]::before { display: none; }
  .heros { padding-block: 20px; }
}
/* Grands écrans */
@media (min-width: 1600px) { .produits { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 2200px) { .produits { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* Très grands écrans et téléviseurs : agrandissement proportionnel (lecture à distance) */
@media (min-width: 1920px) { html { font-size: 112.5%; } :root { --lateral-largeur: 300px; --largeur: 1820px; } }
/* Au-delà, l'interface est agrandie d'un bloc (zoom) : un écran 4K ou une TV affiche la même mise en page qu'un écran de 1920 px, en plus grand */
@media (min-width: 2560px) { html { zoom: 1.333; } }
@media (min-width: 3400px) { html { zoom: 2; } }
/* Téléviseurs et télécommandes (pas de survol, grand écran) : focus très visible pour la navigation aux flèches */
@media (hover: none) and (min-width: 1200px) {
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 4px solid var(--feuille); outline-offset: 4px; box-shadow: 0 0 0 10px rgba(18, 161, 80, .18);
  }
  .carte-lien:focus-visible { transform: scale(1.03); }
}
/* Écrans tactiles : cibles de 44 px minimum */
@media (pointer: coarse) { .nav-lat a, .nav-lat button, .puce, .langues a { min-height: 44px; } .langues a { display: inline-flex; align-items: center; } }

/* Cartes-liens en ligne (aide, contact, espace) : icône à gauche du texte */
.carte-lien.ligne { display: flex; align-items: center; flex-wrap: nowrap; }
.carte-lien.ligne > .croix { flex: none; }
/* Notes lisibles en mode nuit */
:root[data-theme="sombre"] .note-danger { color: #ffc2cc; }
:root[data-theme="sombre"] .note-attente { color: #ffd9a8; }
:root[data-theme="sombre"] .note-succes { color: #b9f3cf; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .note-danger { color: #ffc2cc; }
  :root[data-theme="auto"] .note-attente { color: #ffd9a8; }
  :root[data-theme="auto"] .note-succes { color: #b9f3cf; }
}

/* ---------- Paiement direct (Mixx by Yas, Moov Money) ---------- */
.paiement-direct { margin-bottom: 18px; }
.pd-attente { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 18px 8px 4px; }
.pd-attente[hidden], .pd-formulaire[hidden] { display: none; }
.pd-telephone { position: relative; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--menthe); color: var(--foret); }
.pd-telephone .ic { width: 34px; height: 34px; animation: pd-vibre 1.6s ease-in-out infinite; }
.pd-onde { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--foret); animation: pd-onde 1.6s ease-out infinite; }
@keyframes pd-vibre { 0%, 60%, 100% { transform: rotate(0); } 65% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } 85% { transform: rotate(-6deg); } }
@keyframes pd-onde { from { transform: scale(1); opacity: .7; } to { transform: scale(1.6); opacity: 0; } }
.paiement-direct.pd-reussi .pd-telephone { background: var(--foret); color: #fff; }
.paiement-direct.pd-reussi .pd-onde, .paiement-direct.pd-reussi .ic { animation: none; }
.autre-paiement { border-top: 1px dashed var(--trait); padding-top: 14px; margin-top: 6px; }
.autre-paiement > summary { cursor: pointer; font-weight: 700; color: var(--foret); list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.autre-paiement > summary::-webkit-details-marker { display: none; }
.autre-paiement > summary .ic { transition: transform .2s; }
.autre-paiement[open] > summary .ic { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .pd-telephone .ic, .pd-onde { animation: none; } }

/* Les fieldsets prennent par défaut la largeur de leur contenu le plus long (liste déroulante) : on les contraint */
fieldset { min-width: 0; max-width: 100%; }
select { max-width: 100%; text-overflow: ellipsis; }
.choix label { min-width: 0; overflow-wrap: anywhere; }
