/* ===================================================================
   NACI2 - feuille de style unique
   Theme clair « ocean », mobile first, sans dependance externe.
   Sommaire :
     1. Jetons de design      5. Composants de contenu
     2. Base                  6. Formulaires
     3. Barre et navigation   7. Tableau de bord
     4. Cartes et grilles     8. Authentification
   =================================================================== */

/* ------------------------- 1. JETONS DE DESIGN --------------------- */
:root {
  /* surfaces */
  --bg: #f4f8fc;
  --bg-alt: #ffffff;
  --bg-soft: #eef4fa;
  --bg-voile: #f8fbfe;

  /* texte */
  --txt: #16233a;
  --txt-soft: #566b84;
  --txt-faint: #8ca0b5;

  /* traits */
  --bord: #e3ecf5;
  --bord-fort: #cfdcea;

  /* bleu ocean, couleur d'accent principale */
  --prim: #1875ce;
  --prim-fort: #125ca6;
  --prim-vif: #2e8be6;
  --prim-clair: #e8f1fc;
  --prim-voile: #f3f8fe;

  /* etats */
  --ok: #0f8a5f;        --ok-bg: #e6f7ef;
  --attn: #a87400;      --attn-bg: #fef4dc;
  --alerte: #c25410;    --alerte-bg: #fdeee0;
  --crit: #c0352f;      --crit-bg: #fdeceb;
  --info: #1875ce;      --info-bg: #e8f1fc;

  /* accents thematiques des cartes */
  --a-eau: #1e88e5;     --a-eau-bg: #e6f2fd;
  --a-pb: #e05a44;      --a-pb-bg: #fdecea;
  --a-poisson: #7335f8; --a-poisson-bg: #f0e9fe;
  --a-corail: #0f9d6b;  --a-corail-bg: #e6f9f0;
  --a-algue: #c08a09;   --a-algue-bg: #fef4dc;
  --a-biblio: #8d5cf1;  --a-biblio-bg: #f2e9fe;

  /* formes */
  --rayon-xs: 8px;
  --rayon-s: 10px;
  --rayon: 14px;
  --rayon-l: 20px;

  /* profondeur */
  --ombre-xs: 0 1px 2px rgba(22, 48, 82, .05);
  --ombre: 0 1px 2px rgba(22, 48, 82, .04), 0 4px 14px rgba(22, 48, 82, .05);
  --ombre-f: 0 2px 6px rgba(22, 48, 82, .06), 0 14px 34px rgba(22, 48, 82, .10);
  --ombre-haut: 0 1px 0 rgba(22, 48, 82, .06);

  /* gabarit */
  --nav-l: 232px;
  --barre-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

/* ------------------------------ 2. BASE ---------------------------- */
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--prim); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--prim);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; color: var(--txt); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; margin-top: 1.4em; }
h4 { font-size: .9rem; margin-top: 1.2em; color: var(--txt-soft); }
p  { margin: 0 0 .9em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin-bottom: .3em; }
hr { border: 0; border-top: 1px solid var(--bord); margin: 1.6em 0; }
small { font-size: .82rem; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em;
  background: var(--bg-soft); padding: .1em .35em; border-radius: 5px; }

.ic { flex: 0 0 auto; vertical-align: -.15em; }

/* lien d'evitement : hors ecran, ramene au premier plan au focus clavier.
   Gere entierement en CSS, pour ne pas dependre de script en ligne. */
.lien-evitement {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--prim); color: #fff; padding: .6rem 1rem;
  border-radius: 0 0 var(--rayon-s) 0; font-weight: 650; font-size: .9rem;
}
.lien-evitement:focus { left: 0; text-decoration: none; }

/* --------------------- 3. BARRE ET NAVIGATION ---------------------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .7rem;
  height: var(--barre-h); padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--bord);
}

.burger {
  display: none;
  background: transparent; border: 0; color: var(--txt-soft); cursor: pointer;
  width: 40px; height: 40px; border-radius: var(--rayon-xs);
  align-items: center; justify-content: center;
}
.burger:hover { background: var(--bg-soft); color: var(--txt); }

/* marque */
.marque-bloc { display: inline-flex; align-items: center; gap: .55rem; color: var(--prim); }
.marque-mots { display: flex; flex-direction: column; line-height: 1.05; }
.marque-nom {
  font-weight: 800; letter-spacing: -.02em; color: var(--txt);
  font-size: 1.32rem;
}
.marque-nom i { font-style: normal; color: var(--prim-vif); }
.marque-sous { font-size: .68rem; color: var(--txt-faint); letter-spacing: .01em; font-weight: 500; }
.marque-lg .marque-nom { font-size: 2.3rem; }
.marque-lg .marque-sous { font-size: .85rem; }
a.marque-lien:hover { text-decoration: none; }

/* recherche — le selecteur porte le type pour passer devant la regle
   generique des champs de formulaire, declaree plus loin */
.recherche { flex: 1 1 auto; max-width: 480px; margin: 0 auto; position: relative; }
.appbar .recherche input[type=search] {
  width: 100%; height: 40px; padding: 0 1rem 0 2.6rem;
  background: var(--bg-soft); border: 1px solid transparent; border-radius: 999px;
  font-size: .9rem; color: var(--txt);
}
.recherche input::placeholder { color: var(--txt-faint); }
.appbar .recherche input[type=search]:focus {
  background: #fff; border-color: var(--prim); outline: none;
  box-shadow: 0 0 0 3px var(--prim-clair);
}
.recherche .ic { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--txt-faint); pointer-events: none; }

/* selecteur de bac */
.selbac-enveloppe { position: relative; display: inline-flex; align-items: center; }
.selbac-enveloppe > .ic { position: absolute; left: .65rem; color: var(--prim); pointer-events: none; }
.selbac {
  appearance: none;
  background: #fff; border: 1px solid var(--bord-fort); color: var(--txt);
  border-radius: 999px; padding: .45rem 2rem .45rem 2.3rem; font-size: .86rem; font-weight: 600;
  max-width: 230px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23566b84' stroke-width='2' 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 .6rem center;
}
.selbac:hover { border-color: var(--prim); }

/* bloc compte */
.compte-bloc { display: flex; align-items: center; gap: .3rem; }
.compte-nom {
  display: flex; align-items: center; gap: .5rem; color: var(--txt); text-decoration: none;
  padding: .3rem .6rem .3rem .3rem; border-radius: 999px; font-size: .88rem; font-weight: 600;
}
.compte-nom:hover { background: var(--bg-soft); text-decoration: none; }
.avatar {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%;
  background: linear-gradient(140deg, #7c4ddb, #5b63d3);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.lien-sortie {
  display: inline-flex; align-items: center; gap: .35rem;
  background: none; border: 0; color: var(--txt-soft); font: inherit; font-size: .86rem; font-weight: 600;
  cursor: pointer; padding: .45rem .7rem; border-radius: var(--rayon-xs);
}
.lien-sortie:hover { background: var(--bg-soft); color: var(--txt); }

/* coque et barre laterale */
.coque { display: flex; min-height: calc(100vh - var(--barre-h)); }

.nav {
  flex: 0 0 var(--nav-l); width: var(--nav-l);
  background: #fff; border-right: 1px solid var(--bord);
  padding: .55rem .6rem .45rem;
  position: sticky; top: var(--barre-h); height: calc(100vh - var(--barre-h)); overflow-y: auto;
  /* barre de defilement discrete : elle n'apparait que sur les ecrans trop
     courts pour afficher les 21 entrees d'un bloc */
  scrollbar-width: thin; scrollbar-color: var(--bord-fort) transparent;
}
.nav::-webkit-scrollbar { width: 7px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.nav:hover::-webkit-scrollbar-thumb { background: var(--bord-fort); }

.nav h5 {
  margin: .72rem .7rem .18rem; font-size: .66rem; text-transform: uppercase;
  letter-spacing: .09em; color: var(--txt-faint); font-weight: 700;
}
.nav h5:first-child { margin-top: .1rem; }
.nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .7rem; border-radius: var(--rayon-s);
  color: var(--txt-soft); font-size: .89rem; font-weight: 500; text-decoration: none;
  line-height: 1.35;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg-soft); color: var(--txt); text-decoration: none; }
.nav a .ic { color: var(--txt-faint); transition: color .15s; }
.nav a:hover .ic { color: var(--prim); }
.nav a.actif { background: var(--prim-clair); color: var(--prim-fort); font-weight: 650; }
.nav a.actif .ic { color: var(--prim); }
.nav .pastille {
  margin-left: auto; background: var(--crit); color: #fff; font-size: .68rem;
  min-width: 19px; height: 19px; padding: 0 .35rem; border-radius: 10px; font-weight: 700;
  display: grid; place-items: center;
}

.contenu { flex: 1 1 auto; min-width: 0; padding: 1.6rem 24px 4rem; max-width: 1480px; }

@media (max-width: 1000px) {
  .burger { display: inline-flex; }
  .coque { display: block; }
  .nav {
    position: fixed; top: var(--barre-h); left: 0; bottom: 0; width: 272px; z-index: 50;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--ombre-f);
    height: auto;
  }
  body.nav-ouvert .nav { transform: translateX(0); }
  body.nav-ouvert::after {
    content: ''; position: fixed; inset: var(--barre-h) 0 0 0; background: rgba(13, 38, 66, .4); z-index: 45;
  }
  .contenu { padding: 1.2rem 16px 3.5rem; }
  .recherche { max-width: none; }
  h1 { font-size: 1.45rem; }
}
@media (max-width: 720px) {
  .marque-sous { display: none; }
  .recherche { display: none; }
  .recherche.mobile-visible { display: block; }
  .compte-nom span:not(.avatar) { display: none; }
  .lien-sortie span { display: none; }
  .selbac { max-width: 130px; font-size: .8rem; }
  /* la recherche masquee, le bac et le compte se calent a droite */
  .selbac-enveloppe, .creer-bac { margin-left: auto; }
}
.creer-bac { flex: 0 0 auto; white-space: nowrap; }
.creer-bac .lib-court { display: none; }
@media (max-width: 420px) {
  .creer-bac .lib-long { display: none; }
  .creer-bac .lib-court { display: inline; }
  .appbar { gap: .5rem; padding: 0 12px; }
}

/* --------------------- 4. CARTES ET GRILLES ------------------------ */
.carte {
  background: var(--bg-alt); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: 1.15rem 1.25rem; margin-bottom: 1rem;
  box-shadow: var(--ombre-xs);
}
.carte > :first-child { margin-top: 0; }
.carte > :last-child { margin-bottom: 0; }
.carte.plat { box-shadow: none; }
.carte .ct { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .7rem; }
.carte .ct h2, .carte .ct h3 { margin: 0; }
a.carte { display: block; color: inherit; transition: box-shadow .18s, transform .18s; }
a.carte:hover { text-decoration: none; box-shadow: var(--ombre-f); transform: translateY(-2px); }

.grille { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ------------------- 5. COMPOSANTS DE CONTENU ---------------------- */
/* tuiles de parametre */
.tuile {
  background: var(--bg-alt); border: 1px solid var(--bord); border-left: 4px solid var(--bord-fort);
  border-radius: var(--rayon); padding: .8rem .95rem; box-shadow: var(--ombre-xs);
  display: block; color: inherit;
}
.tuile:hover { text-decoration: none; box-shadow: var(--ombre); }
.tuile .nom { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); font-weight: 700; }
.tuile .val { font-size: 1.6rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tuile .val u { font-size: .78rem; font-weight: 600; color: var(--txt-soft); text-decoration: none; margin-left: .15rem; }
.tuile .meta { font-size: .75rem; color: var(--txt-faint); margin-top: .15rem; }
.tuile.z-ok    { border-left-color: var(--ok); }
.tuile.z-attn  { border-left-color: var(--attn); }
.tuile.z-alerte{ border-left-color: var(--alerte); }
.tuile.z-crit  { border-left-color: var(--crit); }
.tuile.z-vide  { border-left-color: var(--bord-fort); opacity: .75; }

.plage { position: relative; height: 6px; background: var(--bg-soft); border-radius: 3px; margin: .55rem 0 .2rem; }
.plage .zone-ok { position: absolute; top: 0; bottom: 0; background: var(--ok); opacity: .3; border-radius: 3px; }
.plage .curseur { position: absolute; top: -3px; width: 3px; height: 12px; background: var(--txt); border-radius: 2px; }
.plage-leg { display: flex; justify-content: space-between; font-size: .68rem; color: var(--txt-faint); }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .01em;
  padding: .2rem .55rem; border-radius: 999px; white-space: nowrap;
  background: var(--bg-soft); color: var(--txt-soft);
}
.badge.z-ok     { background: var(--ok-bg);     color: var(--ok); }
.badge.z-attn   { background: var(--attn-bg);   color: var(--attn); }
.badge.z-alerte { background: var(--alerte-bg); color: var(--alerte); }
.badge.z-crit   { background: var(--crit-bg);   color: var(--crit); }
.badge.z-neutre { background: var(--bg-soft);   color: var(--txt-faint); }
.badge.sev-info      { background: var(--info-bg);   color: var(--info); }
.badge.sev-conseil   { background: var(--info-bg);   color: var(--info); }
.badge.sev-attention { background: var(--attn-bg);   color: var(--attn); }
.badge.sev-alerte    { background: var(--alerte-bg); color: var(--alerte); }
.badge.sev-critique  { background: var(--crit-bg);   color: var(--crit); }
.badge.pleine { background: var(--prim); color: #fff; }

.puces { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* jauges */
.jauge { display: inline-flex; gap: 2px; vertical-align: middle; }
.jauge i { width: 7px; height: 7px; border-radius: 2px; background: var(--bord-fort); display: block; }
.jauge i.on { background: var(--prim); }
.jauge.danger i.on { background: var(--alerte); }

/* conseils */
.conseil {
  background: var(--bg-alt); border: 1px solid var(--bord); border-left: 4px solid var(--info);
  border-radius: var(--rayon); padding: 1.05rem 1.2rem; margin-bottom: .9rem; box-shadow: var(--ombre-xs);
}
.conseil.sev-critique  { border-left-color: var(--crit);   background: linear-gradient(100deg, var(--crit-bg) 0%, var(--bg-alt) 20%); }
.conseil.sev-alerte    { border-left-color: var(--alerte); background: linear-gradient(100deg, var(--alerte-bg) 0%, var(--bg-alt) 20%); }
.conseil.sev-attention { border-left-color: var(--attn); }
.conseil.sev-conseil   { border-left-color: var(--prim); }
.conseil.sev-info      { border-left-color: var(--bord-fort); }
.conseil h3 { margin: 0 0 .4rem; font-size: 1.04rem; }
.conseil .tete { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin-bottom: .45rem; }
.conseil p:last-child { margin-bottom: 0; }
a.conseil { display: block; color: inherit; transition: box-shadow .18s, transform .18s; }
a.conseil:hover { text-decoration: none; box-shadow: var(--ombre-f); transform: translateY(-2px); }

.actionbloc { background: var(--bg-voile); border: 1px solid var(--bord);
  border-radius: var(--rayon-s); padding: .8rem .95rem; margin-top: .8rem; }
.actionbloc h4 { margin: 0 0 .4rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); }
.actionbloc ul, .actionbloc ol { margin: 0; padding-left: 1.2rem; }

.correctif { border: 1px solid var(--bord); border-radius: var(--rayon-s); padding: .8rem .95rem;
  margin-top: .65rem; background: var(--prim-voile); }
.correctif .qte { font-size: 1.25rem; font-weight: 800; color: var(--prim); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.source { font-size: .78rem; color: var(--txt-faint); margin-top: .7rem;
  padding-top: .55rem; border-top: 1px dashed var(--bord); }

/* tableaux */
.tabwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1rem;
  border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--bg-alt); box-shadow: var(--ombre-xs); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: top; }
th { background: var(--bg-voile); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--txt-faint); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-voile); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* blocs depliables */
details.bloc { border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--bg-alt);
  margin-bottom: .6rem; box-shadow: var(--ombre-xs); }
details.bloc > summary { padding: .8rem 1rem; cursor: pointer; font-weight: 600; list-style: none;
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; border-radius: var(--rayon); }
details.bloc > summary::-webkit-details-marker { display: none; }
details.bloc > summary::before { content: '▸'; color: var(--txt-faint); flex: 0 0 auto; }
details.bloc[open] > summary::before { content: '▾'; }
details.bloc > summary:hover { background: var(--bg-voile); }
details.bloc .corps { padding: .85rem 1rem 1rem; border-top: 1px solid var(--bord); }

/* divers */
.muet { color: var(--txt-soft); }
.faible { color: var(--txt-faint); }
.centre { text-align: center; }
.chapeau { font-size: 1.02rem; color: var(--txt-soft); margin-bottom: 1.5rem; max-width: 76ch; }
.filtres { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1.2rem;
  background: var(--bg-alt); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .9rem; box-shadow: var(--ombre-xs); }
.filtres > * { flex: 0 1 auto; }
.filtres .champ { margin-bottom: 0; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.chip { display: inline-block; padding: .35rem .8rem; border-radius: 999px; font-size: .84rem; font-weight: 500;
  background: var(--bg-alt); border: 1px solid var(--bord-fort); color: var(--txt-soft); }
.chip:hover { background: var(--bg-soft); text-decoration: none; color: var(--txt); }
.chip.actif { background: var(--prim); border-color: var(--prim); color: #fff; font-weight: 650; }

.score { display: flex; align-items: center; gap: 1.1rem; }
.score .anneau {
  --p: 0;
  width: 92px; height: 92px; flex: 0 0 auto; border-radius: 50%;
  background: conic-gradient(var(--c, var(--ok)) calc(var(--p) * 1%), var(--bg-soft) 0);
  display: grid; place-items: center; position: relative;
}
.score .anneau::before { content: ''; position: absolute; inset: 10px; background: var(--bg-alt); border-radius: 50%; }
.score .anneau b { position: relative; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }

.barre { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.barre i { display: block; height: 100%; background: linear-gradient(90deg, var(--prim-vif), var(--prim)); border-radius: 999px; }

.liste-def { margin: 0; }
.liste-def dt { font-weight: 650; margin-top: .8rem; }
.liste-def dd { margin: 0 0 .2rem; color: var(--txt-soft); }

.etape { border-left: 3px solid var(--bord); padding: 0 0 1.2rem 1.2rem; margin-left: .4rem; position: relative; }
.etape::before { content: ''; position: absolute; left: -7px; top: .45rem; width: 11px; height: 11px;
  border-radius: 50%; background: var(--bg-alt); border: 2px solid var(--bord-fort); }
.etape.fait { border-left-color: var(--ok); }
.etape.fait::before { background: var(--ok); border-color: var(--ok); }
.etape.courante { border-left-color: var(--prim); }
.etape.courante::before { background: var(--prim); border-color: var(--prim); box-shadow: 0 0 0 4px var(--prim-clair); }
.etape h3 { margin-top: 0; }

.graphe { width: 100%; height: 190px; display: block; }

.confiance { display: flex; align-items: center; gap: .5rem; min-width: 140px; }
.confiance .b { flex: 1 1 auto; height: 7px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.confiance .b i { display: block; height: 100%; background: var(--prim); }
.confiance b { font-variant-numeric: tabular-nums; font-size: .88rem; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; font-size: .9rem; }
.kv dt { color: var(--txt-faint); font-weight: 600; font-size: .8rem; white-space: nowrap; }
.kv dd { margin: 0; }

/* --------------------------- 6. FORMULAIRES ------------------------ */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--txt-soft); margin-bottom: .3rem; }
input[type=text], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: .55rem .7rem; font: inherit; font-size: .92rem;
  background: #fff; color: var(--txt);
  border: 1px solid var(--bord-fort); border-radius: var(--rayon-xs);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--prim); box-shadow: 0 0 0 3px var(--prim-clair);
}
textarea { min-height: 74px; resize: vertical; }
.champ { margin-bottom: 1rem; }
.champ .aide { font-size: .76rem; color: var(--txt-faint); margin-top: .25rem; font-weight: 400; }
.aide.erreur { color: var(--crit); font-weight: 600; }
input[aria-invalid="true"] { border-color: var(--crit); }
.inline { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; }
.inline > * { flex: 1 1 150px; }
.coche { display: flex; align-items: flex-start; gap: .6rem; font-weight: 400; font-size: .9rem;
  color: var(--txt); margin-bottom: .6rem; cursor: pointer; }
.coche input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: .2rem; accent-color: var(--prim); }

.btn {
  display: inline-flex; align-items: center; gap: .45rem; justify-content: center;
  padding: .6rem 1.1rem; font: inherit; font-size: .92rem; font-weight: 650;
  background: var(--prim); color: #fff; border: 1px solid var(--prim);
  border-radius: var(--rayon-xs); cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .12s;
}
.btn:hover { background: var(--prim-fort); border-color: var(--prim-fort); text-decoration: none; color: #fff;
  box-shadow: 0 4px 14px rgba(24, 117, 206, .28); }
.btn:active { transform: translateY(1px); }
.btn.sec { background: #fff; color: var(--txt); border-color: var(--bord-fort); }
.btn.sec:hover { background: var(--bg-soft); color: var(--txt); box-shadow: var(--ombre); }
.btn.danger { background: #fff; color: var(--crit); border-color: var(--crit); }
.btn.danger:hover { background: var(--crit-bg); color: var(--crit); box-shadow: none; }
.btn.petit { padding: .35rem .7rem; font-size: .82rem; }
.btn.large { padding: .8rem 1.4rem; font-size: 1rem; width: 100%; }
.btns { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; }

.flash { padding: .8rem 1.05rem; border-radius: var(--rayon-s); margin-bottom: 1.2rem; font-size: .92rem; font-weight: 500;
  border: 1px solid transparent; }
.flash.ok   { background: var(--ok-bg); color: var(--ok); border-color: rgba(15, 138, 95, .22); }
.flash.warn { background: var(--attn-bg); color: var(--attn); border-color: rgba(168, 116, 0, .22); }
.flash.err  { background: var(--crit-bg); color: var(--crit); border-color: rgba(192, 53, 47, .22); }

/* ------------------------ 7. TABLEAU DE BORD ----------------------- */
/* banniere recifale */
.hero {
  position: relative; border-radius: var(--rayon-l); overflow: hidden; margin-bottom: 1.8rem;
  background: linear-gradient(104deg, #eaf3fd 0%, #e2eefb 38%, #cfe6fa 58%, #9fcdf2 100%);
  box-shadow: var(--ombre);
  isolation: isolate;
}
.hero-photo {
  position: absolute; inset: 0 0 0 auto; width: 62%; height: 100%;
  object-fit: cover; object-position: 72% 50%;
  z-index: -1;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
}
.hero-contenu { padding: 2.2rem 2rem; max-width: 620px; }
.hero-sur { font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--prim); margin-bottom: .5rem; }
.hero h1 { font-size: 2.6rem; letter-spacing: -.035em; margin-bottom: .25rem; }
.hero h1 i { font-style: normal; color: var(--prim-vif); }
.hero .accroche { font-size: 1.12rem; font-weight: 600; color: var(--txt); margin-bottom: .6rem; }
.hero p { color: var(--txt-soft); max-width: 48ch; }
.hero .btns { margin-top: 1.3rem; }

.hero-carte {
  position: absolute; right: 1.6rem; top: 50%; transform: translateY(-50%);
  width: 310px; padding: 1.1rem 1.2rem;
  background: rgba(255, 255, 255, .17);
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: var(--rayon);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #fff; text-shadow: 0 1px 10px rgba(6, 30, 56, .45);
}
.hero-carte .rond {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .22); margin-bottom: .7rem; color: #fff;
}
.hero-carte h3 { color: #fff; margin: 0 0 .35rem; font-size: 1.02rem; line-height: 1.35; }
.hero-carte p { color: rgba(255, 255, 255, .9); font-size: .85rem; margin: 0; }

/* variante « bac en cours » : bandeau plus compact */
.hero-bac .hero-contenu { padding: 1.7rem 2rem; }
.hero-bac h1 { font-size: 2rem; margin-bottom: .6rem; }
.hero-puces { margin-bottom: .2rem; }
.hero-puces .badge { background: rgba(255, 255, 255, .78); color: var(--txt-soft); }
.hero-puces .badge.pleine { background: var(--prim); color: #fff; }

@media (max-width: 1180px) { .hero-carte { display: none; } .hero-photo { width: 48%; } }
@media (max-width: 780px) {
  .hero { background: linear-gradient(170deg, #eaf3fd 0%, #d7e9fb 100%); }
  .hero-photo { position: relative; inset: auto; width: 100%; height: 150px;
    -webkit-mask-image: none; mask-image: none; display: block; }
  .hero-contenu { padding: 1.4rem 1.2rem; max-width: none; }
  .hero h1 { font-size: 1.9rem; }
  .hero .btns .btn { flex: 1 1 100%; }
}

/* cartes statistiques du referentiel */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 1rem; }
.stat {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon);
  overflow: hidden; color: inherit; box-shadow: var(--ombre-xs);
  transition: box-shadow .2s, transform .2s;
  min-height: 190px;
}
.stat:hover { text-decoration: none; box-shadow: var(--ombre-f); transform: translateY(-3px); }
.stat-haut { padding: 1rem 1.1rem .6rem; display: flex; gap: .75rem; align-items: flex-start; }
.stat-rond { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; }
.stat-haut > span:last-child { min-width: 0; }
.stat-chiffre { display: block; font-size: 1.85rem; font-weight: 800; line-height: 1.05; letter-spacing: -.035em; }
.stat-nom { display: block; font-weight: 700; font-size: .95rem; margin-top: .2rem; line-height: 1.25; }
.stat-desc { padding: 0 1.1rem; font-size: .79rem; color: var(--txt-faint); line-height: 1.45; }
.stat-img { margin-top: auto; width: 100%; height: 74px; object-fit: cover; object-position: center 62%;
  display: block; opacity: .95; }
.stat-chiffre small { font-size: .9rem; font-weight: 700; color: var(--txt-faint); margin-left: 1px; }

/* rangee d'indicateurs du tableau de bord : pas d'illustration, donc plus basse */
.stats-kpi { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 1.4rem; }
.stats-kpi .stat { min-height: 0; }
.stats-kpi .stat-desc { padding-bottom: 1rem; }

.stat.a-eau     .stat-rond { background: var(--a-eau-bg); color: var(--a-eau); }
.stat.a-pb      .stat-rond { background: var(--a-pb-bg); color: var(--a-pb); }
.stat.a-poisson .stat-rond { background: var(--a-poisson-bg); color: var(--a-poisson); }
.stat.a-corail  .stat-rond { background: var(--a-corail-bg); color: var(--a-corail); }
.stat.a-algue   .stat-rond { background: var(--a-algue-bg); color: var(--a-algue); }
.stat.a-biblio  .stat-rond { background: var(--a-biblio-bg); color: var(--a-biblio); }

/* parcours en trois etapes */
.etapes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.etape-carte {
  display: flex; gap: .9rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 1.1rem 1.2rem; box-shadow: var(--ombre-xs); position: relative; overflow: hidden;
}
.etape-num {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.etape-carte:nth-child(1) .etape-num { background: var(--a-eau-bg); color: var(--a-eau); }
.etape-carte:nth-child(2) .etape-num { background: var(--a-biblio-bg); color: var(--a-biblio); }
.etape-carte:nth-child(3) .etape-num { background: var(--a-corail-bg); color: var(--a-corail); }
.etape-carte h3 { margin: 0 0 .3rem; font-size: 1rem; }
.etape-carte p { margin: 0; font-size: .87rem; color: var(--txt-soft); }
.etape-img { position: absolute; right: -10px; bottom: -14px; width: 108px; opacity: .5;
  pointer-events: none; border-radius: 10px; }

/* duo diagnostic / conseils */
.duo { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.duo-bloc {
  position: relative; overflow: hidden; border-radius: var(--rayon);
  border: 1px solid var(--bord); padding: 1.3rem 1.4rem; min-height: 158px;
  display: flex; gap: 1rem; align-items: flex-start;
}
.duo-bloc.bleu  { background: linear-gradient(100deg, #e4f0fc 0%, #d4e8fb 100%); }
.duo-bloc.ambre { background: linear-gradient(100deg, #fef3dd 0%, #fde9c6 100%); }
.duo-bloc .rond { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%;
  background: rgba(255, 255, 255, .8); display: grid; place-items: center; }
.duo-bloc.bleu  .rond { color: var(--a-eau); }
.duo-bloc.ambre .rond { color: var(--a-algue); }
.duo-bloc h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.duo-bloc p { color: var(--txt-soft); font-size: .9rem; max-width: 44ch; }
.duo-img { position: absolute; right: 0; top: 0; height: 100%; width: 42%; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
          mask-image: linear-gradient(90deg, transparent, #000 60%);
  opacity: .9; pointer-events: none; }
.duo-bloc > * { position: relative; }

/* --------------------------- videos YouTube ------------------------ */
.video-play {
  position: absolute; inset: 0; margin: auto;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(232, 48, 42, .92); color: #fff;
  display: grid; place-items: center; font-size: .9rem; padding-left: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3); transition: transform .18s, background .18s;
}

.video-une {
  display: flex; gap: 1.3rem; align-items: stretch;
  background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 1rem; box-shadow: var(--ombre-xs); color: inherit; margin-bottom: 1rem;
  transition: box-shadow .2s, transform .2s;
}
.video-une:hover { text-decoration: none; box-shadow: var(--ombre-f); transform: translateY(-2px); }
.video-une:hover .video-play { transform: scale(1.1); background: #e8302a; }
.video-une-img { position: relative; flex: 0 0 300px; border-radius: var(--rayon-s); overflow: hidden; }
.video-une-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-une-txt { display: flex; flex-direction: column; gap: .4rem; justify-content: center; min-width: 0; }
.video-une-txt strong { font-size: 1.2rem; line-height: 1.3; }
.video-resume { font-size: .88rem; line-height: 1.5; }

.videos-grille { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.video-carte { display: flex; flex-direction: column; gap: .45rem; color: inherit; }
.video-carte:hover { text-decoration: none; }
.video-carte:hover .video-titre { color: var(--prim); }
.video-carte:hover .video-play { transform: scale(1.1); background: #e8302a; }
.video-vignette {
  position: relative; display: block; border-radius: var(--rayon-s); overflow: hidden;
  aspect-ratio: 16 / 10; background: var(--bg-soft); box-shadow: var(--ombre-xs);
}
.video-vignette img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .3s; }
.video-carte:hover .video-vignette img { transform: scale(1.04); }
.video-titre { font-weight: 650; font-size: .92rem; line-height: 1.35; transition: color .15s; }

/* bandeau « nouvelle video » en tete du tableau de bord */
.video-bandeau {
  display: flex; align-items: center; gap: 1rem;
  background: #fff; border: 1px solid var(--bord); border-left: 4px solid #e8302a;
  border-radius: var(--rayon); padding: .7rem .9rem; margin-bottom: 1.1rem;
  color: inherit; box-shadow: var(--ombre-xs);
  transition: box-shadow .2s, transform .2s;
}
.video-bandeau:hover { text-decoration: none; box-shadow: var(--ombre-f); transform: translateY(-2px); }
.video-bandeau:hover .video-play { transform: scale(1.1); background: #e8302a; }
.video-bandeau .video-vignette { flex: 0 0 168px; aspect-ratio: 16 / 10; }
.video-bandeau .video-play { width: 36px; height: 36px; font-size: .72rem; }
.video-bandeau-txt { display: flex; flex-direction: column; gap: .25rem; min-width: 0; flex: 1 1 auto; }
.video-bandeau-txt strong { font-size: 1.04rem; line-height: 1.3; }
.video-bandeau:hover .video-bandeau-txt strong { color: var(--prim); }
.video-bandeau-fleche { flex: 0 0 auto; color: var(--txt-faint); padding-right: .3rem; }
.video-bandeau-pied { margin: -.4rem 0 1.4rem; font-size: .86rem; }
.video-bandeau-pied a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }
.badge.rouge { background: #fdeceb; color: #c0352f; }

@media (max-width: 620px) {
  .video-bandeau { flex-direction: column; align-items: stretch; gap: .7rem; }
  .video-bandeau .video-vignette { flex: none; }
  .video-bandeau-fleche { display: none; }
}

/* encart « derniere video » du tableau de bord */
.video-encart { display: flex; gap: .9rem; align-items: center; color: inherit; }
.video-encart:hover { text-decoration: none; }
.video-encart .video-vignette { flex: 0 0 132px; aspect-ratio: 16 / 10; }
.video-encart .video-play { width: 34px; height: 34px; font-size: .7rem; }
.video-encart-txt { min-width: 0; }
.video-encart strong { display: block; font-size: .93rem; line-height: 1.35; }
.video-encart:hover strong { color: var(--prim); }

@media (max-width: 620px) {
  .video-une { flex-direction: column; gap: .8rem; }
  .video-une-img { flex: none; aspect-ratio: 16 / 10; }
  .video-une-txt strong { font-size: 1.05rem; }
}

/* en-tete de section */
.section-tete { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 2rem 0 1rem; }
.section-tete h2 { margin: 0; }
.section-tete .pousse { margin-left: auto; }
.section-ic {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px;
  background: var(--prim-clair); color: var(--prim); display: grid; place-items: center;
}

/* ------------------------- administration -------------------------- */
.histo { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.histo-barre {
  flex: 1 1 auto; min-width: 3px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--prim-vif), var(--prim));
  transition: opacity .15s;
}
.histo-barre:hover { opacity: .7; }
.histo-leg { display: flex; justify-content: space-between; gap: 1rem;
  margin-top: .5rem; font-size: .76rem; color: var(--txt-faint); }

.tab-nu { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tab-nu td { padding: .45rem .3rem; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tab-nu tr:last-child td { border-bottom: 0; }
.mini-barre { display: block; height: 7px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.mini-barre i { display: block; height: 100%; background: var(--prim); border-radius: 999px; }

.liste-nue { list-style: none; margin: 0; padding: 0; }
.liste-nue li { display: flex; gap: .6rem; align-items: center; padding: .45rem 0;
  border-bottom: 1px solid var(--bord); }
.liste-nue li:last-child { border-bottom: 0; }
.avatar-s { width: 26px; height: 26px; font-size: .75rem; }

.actions-compte { display: flex; gap: .3rem; flex-wrap: wrap; }

/* carte de rappel en pied de page */
.carte-rappel { background: var(--prim-voile); border-color: var(--bord); margin-top: 2rem; }
.carte-rappel h3 { display: flex; align-items: center; gap: .5rem; color: var(--prim-fort); }

/* ------------------------- en-tete de page ------------------------- */
.entete { margin-bottom: 1.4rem; }
.entete-retour { margin: 0 0 .7rem; font-size: .88rem; }
.entete-retour a { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--txt-soft); }
.entete-retour a:hover { color: var(--prim); }
.ic-retour { transform: rotate(180deg); }

.entete-ligne { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.entete-rond {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--prim-clair); color: var(--prim);
}
.entete.a-eau     .entete-rond { background: var(--a-eau-bg);     color: var(--a-eau); }
.entete.a-pb      .entete-rond { background: var(--a-pb-bg);      color: var(--a-pb); }
.entete.a-poisson .entete-rond { background: var(--a-poisson-bg); color: var(--a-poisson); }
.entete.a-corail  .entete-rond { background: var(--a-corail-bg);  color: var(--a-corail); }
.entete.a-algue   .entete-rond { background: var(--a-algue-bg);   color: var(--a-algue); }
.entete.a-biblio  .entete-rond { background: var(--a-biblio-bg);  color: var(--a-biblio); }

.entete-texte { min-width: 0; flex: 1 1 auto; }
.entete-texte h1 { margin: 0; }
.entete-sous { margin: .15rem 0 0; color: var(--txt-faint); font-size: .92rem; }
.entete-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-left: auto; }
.entete .chapeau { margin: .9rem 0 0; }
.entete-puces { margin-top: .9rem; }

@media (max-width: 620px) {
  .entete-rond { width: 40px; height: 40px; border-radius: 11px; }
  .entete-actions { margin-left: 0; width: 100%; }
  .entete-actions .btn { flex: 1 1 auto; }
}

/* ---------------------- 8. AUTHENTIFICATION ------------------------ */
.page-auth { min-height: 100vh; position: relative; }
.page-auth::before {
  content: ''; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1200px 420px at 50% -6%, rgba(255,255,255,.5), transparent 62%),
    linear-gradient(180deg, #2a86c9 0%, #1b6bb0 30%, #11518d 62%, #0d3f71 100%);
}
.page-auth::after {
  content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: min(46vh, 420px); z-index: -1;
  background-image: image-set(url("../img/banniere-recif.webp") type("image/webp"));
  background-image: url("../img/banniere-recif.webp");
  background-size: cover; background-position: center 42%; background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 34%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 34%);
}

.auth-coque { min-height: 100vh; display: grid; place-items: center; padding: 2.5rem 16px; }
.auth-boite {
  width: 100%; max-width: 468px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--rayon-l);
  padding: 2rem 2rem 1.6rem;
  box-shadow: 0 20px 60px rgba(5, 32, 60, .35);
  backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1);
}
.auth-marque { display: block; text-align: center; margin-bottom: 1.6rem; }
.auth-marque .marque-bloc { justify-content: center; }
.auth-boite h1 { font-size: 1.9rem; margin-bottom: .35rem; }
.auth-boite > p.muet { font-size: .96rem; margin-bottom: 1.4rem; }

.auth-liens {
  margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--bord);
  font-size: .9rem; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; justify-content: center;
}
.auth-liens a { font-weight: 600; }

/* champ encadre : icone, libelle et saisie sur une meme ligne flex, ce qui
   centre l'icone sur la hauteur reelle du champ */
.champ-boite {
  display: flex; align-items: center; gap: .85rem;
  background: var(--bg-voile); border: 1px solid var(--bord-fort);
  border-radius: 12px; padding: .5rem .9rem;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.champ-boite:focus-within { background: #fff; border-color: var(--prim); box-shadow: 0 0 0 3px var(--prim-clair); }
.champ-boite.en-erreur { border-color: var(--crit); }
.champ-ic-g { flex: 0 0 auto; display: flex; align-items: center; color: var(--prim); }
.champ-corps { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.champ-corps label { margin: 0; font-size: .78rem; font-weight: 700; color: var(--txt-soft); }
.champ-boite input {
  width: 100%; border: 0; background: transparent; padding: 0;
  height: 24px; font-size: .95rem; color: var(--txt); border-radius: 0;
}
.champ-boite input:focus { outline: none; box-shadow: none; border: 0; }
.champ-boite input::placeholder { color: var(--txt-faint); }
.bouton-oeil {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer; color: var(--txt-faint);
  padding: .4rem; border-radius: 50%; display: grid; place-items: center;
}
.bouton-oeil:hover { background: var(--bg-soft); color: var(--txt); }

.separateur { display: flex; align-items: center; gap: .8rem; margin: 1.3rem 0 .2rem;
  color: var(--txt-faint); font-size: .84rem; }
.separateur::before, .separateur::after { content: ''; flex: 1; border-top: 1px solid var(--bord); }

.auth-credit {
  margin-top: 1.2rem; padding: .75rem .9rem;
  background: var(--prim-voile); border: 1px solid var(--bord); border-radius: var(--rayon-s);
  display: flex; gap: .65rem; align-items: flex-start;
}
.auth-credit p { margin: 0; font-size: .84rem; color: var(--txt-soft); line-height: 1.5; }
.auth-credit strong { color: var(--txt); }
.auth-credit-pastille {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px;
  background: #e8302a; color: #fff; display: grid; place-items: center;
  font-size: .6rem; margin-top: .05rem;
}

@media (max-width: 520px) {
  .auth-boite { padding: 1.5rem 1.25rem 1.2rem; border-radius: var(--rayon); }
  .auth-boite h1 { font-size: 1.55rem; }
  .marque-lg .marque-nom { font-size: 1.9rem; }
}

/* ------------------------------ impression ------------------------- */
@media print {
  .appbar, .nav, .btns, .filtres, .hero-carte { display: none !important; }
  .contenu { max-width: none; padding: 0; }
  .carte, .conseil, .stat { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

/* ------------------------------------------------------------------ *
 * 9. Ecrans courts : menu lateral compact
 *
 * Avec la section Administration, le menu compte 23 entrees et 6
 * intertitres, soit ~925 px : plus que les 708 px visibles d'un
 * ecran 1366x768. Plutot qu'un ascenseur, on resserre les entrees
 * jusqu'a ce que le menu tienne d'un seul regard. Ne s'applique qu'au
 * menu fixe (au-dela de 1000 px), le tiroir mobile defilant tres bien.
 * ------------------------------------------------------------------ */
@media (min-width: 1001px) and (max-height: 880px) {
  .nav { padding: .35rem .5rem .22rem; }
  .nav h5 {
    margin: .36rem .6rem .07rem; font-size: .62rem; letter-spacing: .08em;
  }
  .nav h5:first-child { margin-top: 0; }
  .nav a {
    padding: .17rem .6rem; gap: .5rem; font-size: .855rem; line-height: 1.3;
  }
  .nav .pastille { min-width: 17px; height: 17px; font-size: .64rem; }
}

/* Ecrans vraiment courts (ordinateurs portables 1280x720 et moins) :
   on retire aussi la place perdue par les icones. */
@media (min-width: 1001px) and (max-height: 740px) {
  .nav h5 { margin: .3rem .6rem .06rem; }
  .nav a { padding: .14rem .6rem; font-size: .84rem; }
  .nav a .ic { width: 16px; height: 16px; }
}

/* ------------------------------------------------------------------ *
 * 10. Mentions legales, pied de page et consentement
 * ------------------------------------------------------------------ */

/* Pages consultables sans compte : barre reduite, lecture confortable */
.appbar-nue { justify-content: space-between; }
.contenu-lecture { max-width: 980px; margin: 0 auto; }

/* Pied de page commun */
.pied-legal {
  margin: 3rem 0 0; padding: 1.1rem 0 .3rem;
  border-top: 1px solid var(--bord);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.4rem;
  font-size: .84rem; color: var(--txt-faint);
}
.pied-legal-mention { margin: 0; flex: 1 1 22rem; }
.pied-legal-mention strong { color: var(--txt-soft); }
.pied-legal-liens { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; }
.pied-legal-liens a { color: var(--txt-soft); text-decoration: none; }
.pied-legal-liens a:hover { color: var(--prim); text-decoration: underline; }
.pied-legal-choix { display: inline; }
.pied-legal-choix button {
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--txt-faint); text-decoration: underline dotted;
}
.pied-legal-choix button:hover { color: var(--prim); }

/* Liens legaux sous la carte de connexion */
.auth-legal {
  margin: 1.1rem 0 0; text-align: center;
  font-size: .78rem; color: rgba(255, 255, 255, .72);
  display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem .5rem;
}
.auth-legal a { color: rgba(255, 255, 255, .92); text-decoration: none; }
.auth-legal a:hover { text-decoration: underline; }

/* Bandeau de consentement */
.bandeau-rgpd {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: #fff; border-top: 2px solid var(--prim);
  box-shadow: 0 -8px 28px rgba(13, 38, 66, .18);
  padding: .9rem 24px; display: flex; flex-wrap: wrap;
  align-items: center; gap: .7rem 1.5rem;
}
.bandeau-rgpd-texte { flex: 1 1 28rem; min-width: 0; }
.bandeau-rgpd-texte strong { display: block; font-size: .95rem; margin-bottom: .15rem; }
.bandeau-rgpd-texte p { margin: 0; font-size: .84rem; color: var(--txt-soft); line-height: 1.45; }
.bandeau-rgpd-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }

/* Vignette distante non chargee, faute de consentement */
.vignette-bloquee {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; width: 100%; height: 100%; min-height: 86px;
  background: var(--bg-soft); color: var(--txt-faint);
  border: 1px dashed var(--bord-fort); border-radius: var(--rayon-s);
  font-size: .72rem; text-align: center; padding: .4rem;
}
.vignette-bloquee .ic { opacity: .55; }

/* Encadre d'action dans les pages d'information */
.encadre {
  margin-top: 1rem; padding: .85rem 1rem;
  background: var(--bg-soft); border: 1px solid var(--bord);
  border-radius: var(--rayon-s);
}
.encadre p:first-child { margin-top: 0; }
.encadre .btns { margin-bottom: 0; }

@media (max-width: 720px) {
  .bandeau-rgpd { padding: .8rem 16px; }
  .bandeau-rgpd-actions { width: 100%; }
  .bandeau-rgpd-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* Liste a puces de texte courant, dans les pages d'information */
.liste-points { margin: .4rem 0 0; padding-left: 1.15rem; }
.liste-points li { margin: .35rem 0; line-height: 1.55; }
.liste-points li::marker { color: var(--prim); }

/* Le bandeau de consentement est fixe : on lui reserve sa hauteur pour
   qu'il ne recouvre jamais la fin de la page. */
body.avec-bandeau { padding-bottom: 7.5rem; }
@media (max-width: 720px) { body.avec-bandeau { padding-bottom: 12rem; } }

/* La carte de connexion est centree dans toute la hauteur : sans cette
   reserve, le bandeau fixe recouvrirait les liens legaux. */
body.page-auth.avec-bandeau { padding-bottom: 0; }
body.page-auth.avec-bandeau .auth-coque { padding-bottom: 9rem; }
@media (max-width: 720px) { body.page-auth.avec-bandeau .auth-coque { padding-bottom: 13rem; } }

/* ------------------------------------------------------------------ *
 * 11. Cartes de mesure et fiche de parametre                          *
 * ------------------------------------------------------------------ */
.pc.a-eau,     .fiche.a-eau     { --pc: var(--a-eau);     --pc-bg: var(--a-eau-bg); }
.pc.a-pb,      .fiche.a-pb      { --pc: var(--a-pb);      --pc-bg: var(--a-pb-bg); }
.pc.a-poisson, .fiche.a-poisson { --pc: var(--a-poisson); --pc-bg: var(--a-poisson-bg); }
.pc.a-corail,  .fiche.a-corail  { --pc: var(--a-corail);  --pc-bg: var(--a-corail-bg); }
.pc.a-algue,   .fiche.a-algue   { --pc: var(--a-algue);   --pc-bg: var(--a-algue-bg); }
.pc.a-biblio,  .fiche.a-biblio  { --pc: var(--a-biblio);  --pc-bg: var(--a-biblio-bg); }

.pgrille { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

.pc {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  padding: .8rem .95rem .65rem;
  background: var(--bg-alt); border: 1px solid var(--bord); border-radius: var(--rayon-l);
  box-shadow: var(--ombre); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.pc:hover { box-shadow: var(--ombre-f); transform: translateY(-2px); border-color: var(--bord-fort); }
.pc.z-alerte { border-color: var(--alerte); }
.pc.z-crit   { border-color: var(--crit); }

.pc-tete { display: flex; align-items: center; gap: .55rem; }
.pc-ic {
  flex: 0 0 auto; min-width: 32px; height: 32px; padding: 0 .3rem; border-radius: var(--rayon-xs);
  display: grid; place-items: center;
  background: var(--pc-bg); color: var(--pc); font-size: .78rem; font-weight: 700;
}
.pc-nom { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .74rem; }
.pc-ouvre {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--txt-soft); text-align: left;
  text-transform: uppercase; letter-spacing: .07em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sans-capitales .pc-ouvre { text-transform: none; letter-spacing: 0; font-size: .9rem; }
/* tout le carre est cliquable, sans imbriquer de bouton dans un bouton */
.pc-ouvre::after { content: ''; position: absolute; inset: 0; border-radius: var(--rayon-l); }
.pc-ouvre:focus-visible { outline: none; }
.pc-ouvre:focus-visible::after { outline: 3px solid var(--prim); outline-offset: 2px; }
.pc-plus {
  position: relative; z-index: 1; flex: 0 0 auto; width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: none; border: 0; border-radius: var(--rayon-xs); color: var(--txt-faint);
  transition: background .15s, color .15s;
}
.pc-plus:hover, .pc-plus:focus-visible { background: var(--pc-bg); color: var(--pc); }

.pc-ligne { display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; margin-top: .45rem; min-height: 3rem; }
.pc-valeur {
  margin: 0; font-size: 2.1rem; font-weight: 500; line-height: 1.1; white-space: nowrap;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em; color: var(--txt);
}
.pc-vide { color: var(--txt-faint); }
.pc-tend { font-size: .72rem; letter-spacing: 0; color: var(--txt-faint); vertical-align: .15em; }
.pc-etat { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; min-width: 0; text-align: right; }
.pc-etat small { font-size: .7rem; color: var(--txt-faint); line-height: 1.2; white-space: nowrap; }
.pc-etat .badge { font-size: .66rem; padding: .1rem .42rem; white-space: nowrap; }

.pc-courbe { position: relative; height: 46px; margin: .3rem .25rem 0 0; }
.pc-spark { display: block; width: 100%; height: 100%; overflow: visible; }
.pc-spark-trait {
  fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--pc-n1) 50%, transparent));
}
.pc-point {
  position: absolute; right: 0; width: 7px; height: 7px; border-radius: 50%;
  transform: translate(50%, -50%); background: var(--pc-n2);
  box-shadow: 0 0 0 2px #fff, 0 0 7px 2px color-mix(in srgb, var(--pc-n2) 65%, transparent);
}
.pc-spark-vide { stroke: var(--bord-fort); stroke-width: 1.5; stroke-dasharray: 4 5; }
.pc-grad-haut { stop-color: var(--pc-n1); stop-opacity: .2; }
.pc-grad-bas  { stop-color: var(--pc-n2); stop-opacity: 0; }
.pc-trait-a { stop-color: var(--pc-n1); }
.pc-trait-b { stop-color: var(--pc-n2); }

.pc-pied {
  display: flex; justify-content: space-between; gap: .6rem; margin-top: .45rem; padding-top: .45rem;
  border-top: 1px solid var(--bord); font-size: .74rem; color: var(--txt-soft);
  font-variant-numeric: tabular-nums;
}

@keyframes pc-maj { from { box-shadow: 0 0 0 4px var(--ok); } to { box-shadow: var(--ombre); } }
.pc-maj { animation: pc-maj 2.4s ease-out; }

/* fiche ouverte au clic */
html:has(dialog.fiche[open]) { overflow: hidden; }
dialog.fiche {
  width: min(920px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
  margin: auto; padding: 0; overflow: hidden;
  border: 0; border-radius: var(--rayon-l); box-shadow: var(--ombre-f); color: var(--txt);
}
dialog.fiche::backdrop { background: rgba(14, 32, 56, .5); backdrop-filter: blur(3px); }
.fiche-dedans { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); }
.fiche-tete {
  flex: 0 0 auto; display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--bord);
}
.fiche-tete .pc-ic { min-width: 40px; height: 40px; font-size: .9rem; border-radius: var(--rayon-s); }
.fiche-titre { flex: 1 1 auto; min-width: 0; }
.fiche-titre h2 { margin: 0; font-size: 1.15rem; }
.fiche-titre p { margin: .05rem 0 0; font-size: .84rem; color: var(--txt-soft); }
.fiche-fermer {
  flex: 0 0 auto; width: 36px; height: 36px; padding: 0; cursor: pointer;
  background: var(--bg-soft); border: 0; border-radius: var(--rayon-xs);
  font-size: 1.4rem; line-height: 1; color: var(--txt-soft);
}
.fiche-fermer:hover { background: var(--bord); color: var(--txt); }
.fiche-corps {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: start;
}
.fiche-suivi { grid-column: 1; grid-row: 1; padding: 1rem 1.2rem; min-width: 0; }
.fiche-suivi section + section { margin-top: 1rem; }
.fiche-sect { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin-bottom: .4rem; }
.fiche-sect h3 { margin: 0; font-size: .95rem; }
.fiche-sect a { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; font-weight: 600; }
.fiche-histo { margin-bottom: 0; }
.fiche-histo table { table-layout: fixed; }
.fiche-histo td, .fiche-histo th {
  padding-top: .28rem; padding-bottom: .28rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fiche-histo th:nth-child(1) { width: 34%; }
.fiche-histo th:nth-child(2) { width: 15%; }
.fiche-histo th:nth-child(5) { width: 2.6rem; }
.fiche-histo .btn.petit { padding: .05rem .45rem; }
.fiche-saisie {
  grid-column: 2; grid-row: 1; align-self: stretch; padding: 1rem 1.1rem;
  background: var(--bg-voile); border-left: 1px solid var(--bord);
}
.fiche-saisie h3 { margin: 0 0 .7rem; font-size: .95rem; }
.fiche-saisie .champ { margin-bottom: .7rem; }
.fiche-saisie [data-saisie-champ] { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fiche-saisie .btn.large { padding: .65rem 1rem; font-size: .95rem; }

@media (max-width: 760px) {
  .fiche-corps { display: block; }
  .fiche-saisie { border-left: 0; border-bottom: 1px solid var(--bord); }
}
@media (max-width: 520px) {
  .pgrille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .pc { padding: .65rem .7rem .55rem; }
  .pc-valeur { font-size: 1.6rem; }
  .pc-ligne { flex-direction: column; align-items: flex-start; gap: .1rem; }
  .pc-etat { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3rem; text-align: left; }
  .fiche-tete .badge { display: none; }
}

/* Une carte etroite passe sur plusieurs lignes plutot que de tronquer sa valeur */
.pc { container-type: inline-size; }
@container (max-width: 175px) {
  .pc-tete { flex-wrap: wrap; justify-content: space-between; row-gap: .2rem; }
  .pc-nom { order: 3; flex: 0 0 100%; }
  .pc-ligne { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .1rem; margin-top: .1rem; }
  .pc-etat { flex-direction: row; align-items: center; gap: .3rem; min-height: 1.05rem; text-align: left; }
  .pc-valeur { font-size: 1.6rem; }
}

/* Ordinateur : la page tient exactement dans l'ecran, sans defilement.
   Les 21 cartes se partagent en 7 x 3 la hauteur laissee par l'en-tete, et
   seule leur courbe s'etire ou se resserre. Sous 620 px de haut, ou sur un
   telephone, 21 cartes lisibles ne tiennent plus : la page defile normalement. */
@media (min-width: 1001px) and (min-height: 620px) {
  .contenu:has(.pgrille) {
    display: flex; flex-direction: column; max-width: none;
    height: calc(100dvh - var(--barre-h)); padding: .7rem 24px .35rem;
  }
  .contenu:has(.pgrille) .entete {
    flex: 0 0 auto; display: flex; align-items: center; gap: .9rem; margin-bottom: .6rem;
  }
  .contenu:has(.pgrille) .entete-ligne { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; order: 1; }
  .contenu:has(.pgrille) .entete-puces { flex: 0 0 auto; margin: 0; order: 2; flex-wrap: nowrap; }
  .contenu:has(.pgrille) .entete-actions { flex-wrap: nowrap; }
  .contenu:has(.pgrille) .entete-actions { order: 3; }
  .contenu:has(.pgrille) .entete-rond { width: 38px; height: 38px; border-radius: 11px; }
  .contenu:has(.pgrille) .entete-texte h1 { font-size: 1.3rem; white-space: nowrap; }
  .contenu:has(.pgrille) .entete-sous { font-size: .8rem; margin: 0; white-space: nowrap; }
  .contenu:has(.pgrille) .btn { padding: .4rem .75rem; font-size: .84rem; white-space: nowrap; }
  .contenu:has(.pgrille) .badge { white-space: nowrap; }

  .pgrille {
    flex: 1 1 0; min-height: 0; gap: .6rem;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
  .pc { min-height: 0; padding: .55rem .7rem .4rem; border-radius: var(--rayon); }
  .pc-ouvre::after { border-radius: var(--rayon); }
  .pc-ic { min-width: 28px; height: 28px; font-size: .72rem; }
  .pc-plus { width: 28px; height: 28px; margin-right: -.2rem; }
  .pc-nom { font-size: .68rem; }
  .pc-ligne { min-height: 0; }
  .pc-courbe { flex: 1 1 0; min-height: 0; height: auto; margin-top: .2rem; }
  .pc-pied { margin-top: .25rem; padding-top: .25rem; font-size: .7rem; white-space: nowrap; }
  .pc-pied span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

  /* le message de confirmation flotte : il ne pousse pas les cartes */
  @keyframes flash-part { 0%, 85% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
  .contenu:has(.pgrille) .flash {
    position: fixed; top: calc(var(--barre-h) + .5rem); left: 50%; transform: translateX(-50%);
    z-index: 60; margin: 0; box-shadow: var(--ombre-f); animation: flash-part 5s forwards;
  }

  /* pied legal ramene a une ligne de liens */
  .contenu:has(.pgrille) .pied-legal { flex: 0 0 auto; margin: .35rem 0 0; padding: 0; border: 0; }
  .contenu:has(.pgrille) .pied-legal-mention { display: none; }
  .contenu:has(.pgrille) .pied-legal-liens { font-size: .72rem; }
}

@media (max-height: 780px) {
  .fiche .graphe { height: 135px; }
  .fiche-suivi { padding: .7rem 1.2rem; }
  .fiche-suivi section + section { margin-top: .6rem; }
  .fiche-saisie { padding: .7rem 1.1rem; }
  .fiche-saisie .champ { margin-bottom: .5rem; }
  .fiche-tete { padding: .6rem 1.2rem; }
}

/* Tant que le bandeau de consentement est affiche, la grille se pose au-dessus
   de lui plutot que de rendre la page defilante. */
@media (min-width: 1001px) and (min-height: 620px) {
  body.avec-bandeau:has(.pgrille) { padding-bottom: 0; }
  body.avec-bandeau .contenu:has(.pgrille) { height: calc(100dvh - var(--barre-h) - 6.6rem); }
}

/* Courbes : teintes vives, halo leger. Le halo reste sous 50 % d'opacite pour
   que le trait lui-meme demeure net sur le fond clair. */
.pc.a-eau,     .fiche.a-eau     { --pc-n1: #0ea5ff; --pc-n2: #22d3ee; }
.pc.a-pb,      .fiche.a-pb      { --pc-n1: #f43f5e; --pc-n2: #fb923c; }
.pc.a-poisson, .fiche.a-poisson { --pc-n1: #a855f7; --pc-n2: #6366f1; }
.pc.a-corail,  .fiche.a-corail  { --pc-n1: #10b981; --pc-n2: #22d3ee; }
.pc.a-algue,   .fiche.a-algue   { --pc-n1: #f59e0b; --pc-n2: #f97316; }
.pc.a-biblio,  .fiche.a-biblio  { --pc-n1: #8b5cf6; --pc-n2: #d946ef; }

.graphe { --g1: #1b8cf2; --g2: #22d3ee; }
.fiche .graphe { --g1: var(--pc-n1); --g2: var(--pc-n2); }
.g-a { stop-color: var(--g1); }
.g-b { stop-color: var(--g2); }
.g-fond-haut { stop-color: var(--g1); stop-opacity: .2; }
.g-fond-bas  { stop-color: var(--g2); stop-opacity: 0; }
.g-grille { stroke: var(--bord); stroke-width: 1; }
.g-cible { fill: var(--ok); opacity: .09; }
.g-cible-txt { fill: var(--ok); }
.g-trait {
  fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--g1) 50%, transparent));
}
.g-point { fill: #fff; stroke: var(--g1); stroke-width: 1.5; }
.g-halo { fill: var(--g2); opacity: .2; }
.g-dernier { fill: var(--g2); stroke: #fff; stroke-width: 1.5; }
.g-valeur { fill: var(--g1); }

/* Bandeau de consentement affiche sur un petit ecran : c'est le pied des
   cartes qui cede sa place, pour que la courbe reste visible. */
@media (min-width: 1001px) and (min-height: 620px) and (max-height: 800px) {
  body.avec-bandeau .pc-pied { display: none; }
}

/* La zone cliquable passe devant la courbe (positionnee, donc peinte au-dessus
   sans cela) : la carte s'ouvre d'ou que parte le clic, sauf sur le +. */
.pc { cursor: pointer; }
.pc-ouvre::after { z-index: 1; }
.pc-plus { z-index: 2; }
.pc-courbe { pointer-events: none; }

/* Valeur et unite cote a cote : le selecteur n'ajoute aucune hauteur a la fiche */
.saisie-unite { display: flex; gap: .4rem; }
.saisie-unite input { flex: 1 1 auto; min-width: 0; }
.saisie-unite select { flex: 0 0 auto; width: auto; font-size: .86rem; }

/* ------------------------------------------------------------------ *
 * 12. Limites conseillees, bulle de survol, onglets de la fiche       *
 * ------------------------------------------------------------------ */

.g-cible { fill: var(--ok); opacity: .05; }
.g-limite { stroke: #e5484d; stroke-width: 1.4; stroke-dasharray: 5 4; }
.g-limite-txt { fill: #d93a3f; font-weight: 600; }

.graphe { cursor: crosshair; touch-action: pan-y; }
.graphe-hote { position: relative; }
.g-guide { stroke: var(--txt-faint); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; pointer-events: none; }
.g-vise { fill: #fff; stroke: var(--g1); stroke-width: 2.5; opacity: 0; pointer-events: none;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--g1) 60%, transparent)); }
.g-guide.visible, .g-vise.visible { opacity: 1; }

.graphe-bulle {
  position: absolute; z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; gap: .05rem; white-space: nowrap;
  padding: .35rem .6rem; border-radius: var(--rayon-xs);
  background: rgba(14, 32, 56, .92); color: #fff; box-shadow: var(--ombre-f);
  font-size: .76rem; line-height: 1.3;
  transform: translate(-50%, calc(-100% - 12px));
  opacity: 0; transition: opacity .12s;
}
.graphe-bulle strong { font-size: .92rem; font-variant-numeric: tabular-nums; }
.graphe-bulle span { color: rgba(255, 255, 255, .72); }
.graphe-bulle.visible { opacity: 1; }
.graphe-bulle.a-gauche { transform: translate(calc(-100% - 12px), -50%); }
.graphe-bulle.dessous { transform: translate(-50%, 14px); }
.graphe-bulle.a-gauche.dessous { transform: translate(calc(-100% - 12px), 8px); }

.fiche-onglets {
  display: flex; align-items: center; gap: .3rem; margin-bottom: .7rem;
  border-bottom: 1px solid var(--bord);
}
.fiche-onglets [role="tab"] {
  padding: .45rem .8rem; margin-bottom: -1px; cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid transparent;
  font: inherit; font-size: .88rem; font-weight: 650; color: var(--txt-soft);
}
.fiche-onglets [role="tab"]:hover { color: var(--txt); }
.fiche-onglets [role="tab"][aria-selected="true"] { color: var(--pc); border-bottom-color: var(--pc); }
.fiche-onglets [role="tab"]:focus-visible { outline: 2px solid var(--prim); outline-offset: -2px; border-radius: 4px; }
.fiche-compte {
  display: inline-block; min-width: 1.4rem; padding: 0 .35rem; margin-left: .2rem;
  border-radius: 10px; background: var(--bg-soft); color: var(--txt-soft);
  font-size: .72rem; text-align: center;
}
.fiche-lien { margin-left: auto; display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; font-weight: 600; }
.fiche-panneau[hidden] { display: none; }
.fiche-legende { margin: .35rem 0 0; font-size: .76rem; color: var(--txt-faint); display: flex; align-items: center; gap: .45rem; }
.fiche-panneau .fiche-legende:first-child { margin: 0 0 .4rem; }
.trait-limite { display: inline-block; width: 22px; border-top: 2px dashed #e5484d; }

/* La courbe prend toute la hauteur que l'onglet lui laisse */
.fiche .graphe { height: clamp(220px, calc(100dvh - 330px), 430px); }
@media (max-height: 780px) {
  .fiche .graphe { height: clamp(200px, calc(100dvh - 300px), 430px); }
}
@media (max-width: 760px) {
  .fiche .graphe { height: 240px; }
  .fiche-lien { display: none; }
}

/* Mini et maxi conseilles sur les courbes des cartes */
.pc-limite { stroke: #e5484d; stroke-width: 1; stroke-dasharray: 3 3; opacity: .75; }

/* Colonne de suppression de l'historique : le bouton tient dans sa cellule */
.fiche-histo th:nth-child(5) { width: 3rem; }
.fiche-histo th:last-child, .fiche-histo td:last-child {
  padding-left: .25rem; padding-right: .4rem; text-align: right; overflow: visible;
}
.fiche-histo td:last-child .btn.petit { width: 1.9rem; height: 1.6rem; padding: 0; line-height: 1; }

/* Donne des cartes : en attendant le script, les cartes restent cachees ; si
   le script ne tourne pas, elles apparaissent d'elles-memes au bout d'une seconde. */
@keyframes pc-secours { to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) and (min-width: 761px) and (not (display-mode: standalone)) {
  .pgrille:not(.donne) .pc { opacity: 0; animation: pc-secours .2s 1s forwards; }
}

/* ------------------------------------------------------------------ *
 * 13. Consultation d'un compte par un administrateur                  *
 * ------------------------------------------------------------------ */
.visu-bandeau {
  flex: 0 0 auto; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  margin-bottom: .8rem; padding: .5rem .8rem;
  background: var(--a-poisson-bg); border: 1px solid color-mix(in srgb, var(--a-poisson) 35%, transparent);
  border-radius: var(--rayon-s); color: var(--txt);
}
.visu-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--rayon-xs);
  background: var(--a-poisson); color: #fff; flex: 0 0 auto; }
.visu-texte { margin: 0; flex: 1 1 auto; font-size: .88rem; min-width: 0; }
.visu-email { color: var(--txt-faint); font-size: .8rem; margin-left: .3rem; }
.visu-choix { display: flex; align-items: center; gap: .4rem; }
.visu-choix select { width: auto; padding: .3rem .5rem; font-size: .84rem; }
.visu-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.visu-bandeau form { margin: 0; }

/* Lecture seule : sans colonne de saisie, la courbe prend toute la largeur */
.fiche-corps.sans-saisie { grid-template-columns: minmax(0, 1fr); }

/* ------------------------------------------------------------------ *
 * 14. Historique des modifications                                    *
 * ------------------------------------------------------------------ */
.modifs { list-style: none; margin: 0; padding: 0; }
.modif { display: flex; align-items: flex-start; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--bord); }
.modif:first-child { border-top: 0; padding-top: 0; }
.modif-ic {
  flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: var(--rayon-xs); background: var(--bg-soft); color: var(--txt-soft);
}
.modif-ic.z-ok   { background: var(--ok-bg);   color: var(--ok); }
.modif-ic.z-attn { background: var(--info-bg); color: var(--info); }
.modif-ic.z-crit { background: var(--crit-bg); color: var(--crit); }
.modif-txt { flex: 1 1 auto; min-width: 0; font-size: .88rem; line-height: 1.4; padding-top: .2rem; overflow-wrap: anywhere; }
.modif-bac { display: block; color: var(--txt-faint); font-size: .74rem; }
.modif-date { flex: 0 0 auto; font-size: .76rem; color: var(--txt-faint); white-space: nowrap; padding-top: .25rem; }
.pousse-droite { margin-left: auto; display: inline-flex; align-items: center; gap: .25rem; font-size: .84rem; font-weight: 600; }

.filtres-histo { margin-bottom: 1rem; }
.filtres-histo .badge { text-decoration: none; font-size: .8rem; padding: .3rem .7rem; }
.histo-jour { margin-bottom: .8rem; }
.histo-jour h2 { font-size: .95rem; margin: 0 0 .6rem; color: var(--txt-soft); }

/* ------------------------------------------------------------------ *
 * 15. Page Population                                                 *
 * ------------------------------------------------------------------ */
.pop-stats { margin-bottom: 1.2rem; }
/* champs alignes par le haut : le texte d'aide sous un champ ne decale plus
   les libelles de ses voisins */
.inline.inline-haut { align-items: flex-start; }
.form-pop .inline + .inline { margin-top: .2rem; }
.form-pop .champ { margin-bottom: .8rem; }
.form-pop .btns { margin-top: .4rem; }

/* les trois tableaux partagent les memes colonnes */
.table-pop { table-layout: fixed; width: 100%; }
.table-pop th:nth-child(1) { width: 30%; }
.table-pop th:nth-child(2) { width: 6%; }
.table-pop th:nth-child(3) { width: 12%; }
.table-pop th:last-child { width: 200px; }
.table-pop td { vertical-align: middle; overflow-wrap: anywhere; }
.form-retirer { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; margin: 0; }
.form-retirer select { width: auto; flex: 0 1 auto; min-width: 0; padding: .25rem .4rem; font-size: .8rem; }
.form-retirer .btn { flex: 0 0 auto; }

/* ------------------------------------------------------------------ *
 * 16. Photos des especes                                              *
 * ------------------------------------------------------------------ */
.photo-espece {
  margin: 0 0 1.2rem; border-radius: var(--rayon-l); overflow: hidden;
  background: #0e2038; box-shadow: var(--ombre);
}
.photo-espece img { display: block; width: 100%; max-height: 380px; object-fit: contain; margin: 0 auto; }
.photo-espece figcaption {
  padding: .4rem .8rem; font-size: .72rem; color: var(--txt-faint); background: var(--bg-alt);
  border-top: 1px solid var(--bord);
}
.photo-espece figcaption a { color: var(--txt-soft); }
.espece-cellule { display: flex; align-items: center; gap: .7rem; }
.vignette-espece {
  flex: 0 0 auto; width: 56px; height: 56px; object-fit: cover; border-radius: var(--rayon-s);
  background: var(--bg-soft);
}

/* Nom d'espece cliquable dans les listes, avec ou sans vignette */
a.espece-cellule { color: inherit; text-decoration: none; }
a.espece-cellule strong { color: var(--prim); }
a.espece-cellule:hover strong { text-decoration: underline; }
.vignette-vide { display: block; border: 1px dashed var(--bord-fort); background: var(--bg-voile); }

/* ------------------------------------------------------------------ *
 * 17. Rappels d'entretien                                             *
 * ------------------------------------------------------------------ */
.rap-grille { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 1.4rem; }
.rap {
  display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem;
  background: var(--bg-alt); border: 1px solid var(--bord); border-left: 4px solid var(--ok);
  border-radius: var(--rayon); box-shadow: var(--ombre);
}
.rap.z-crit   { border-left-color: var(--crit); }
.rap.z-alerte { border-left-color: var(--alerte); }
.rap.z-attn   { border-left-color: var(--attn); }
.rap-tete { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rap-quand { font-size: .8rem; font-weight: 650; color: var(--txt-soft); }
.rap.z-crit .rap-quand { color: var(--crit); }
.rap h3 { margin: .15rem 0 0; font-size: 1rem; line-height: 1.35; }
.rap-meta { margin: 0; font-size: .82rem; color: var(--txt-soft); }
.rap-auto { margin: 0; display: flex; align-items: center; gap: .3rem; font-size: .76rem; color: var(--ok); }
.rap-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .4rem; margin-top: auto; padding-top: .45rem; }
.rap-actions form { margin: 0; }
.rap-modif { flex: 1 1 100%; }
.rap-modif > summary { display: inline-flex; list-style: none; cursor: pointer; }
.rap-modif > summary::-webkit-details-marker { display: none; }
.rap-modif[open] > summary { margin-bottom: .6rem; }
.rap-modif .rap-form .champ { margin-bottom: .55rem; }
.rap-modif .rap-form + form { margin-top: .5rem; }
/* « Modifier » se range a cote de « Fait » tant qu'il est ferme */
.rap-modif:not([open]) { flex: 0 0 auto; }

.rap-vide { display: flex; gap: 1rem; align-items: flex-start; }
.rap-vide h2 { margin: 0 0 .3rem; }
.rap-vide-ic {
  flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 14px; background: var(--a-corail-bg); color: var(--a-corail);
}
.rap-email { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: 0; }
.rap-email .coche { flex: 1 1 280px; margin: 0; }
.rap-email .rap-vide-ic { width: 40px; height: 40px; border-radius: 12px; }
.rap-ajout .champ { margin-bottom: .7rem; }

.col-rappel { width: 112px; text-align: right; }
.col-rappel form { margin: 0; }
.col-rappel .badge { display: inline-flex; align-items: center; gap: .2rem; text-decoration: none; }

/* tableau de bord : a faire et previsions */
.bord-suivi { margin-bottom: 1.2rem; }
.bord-suivi .ct h3 { display: flex; align-items: center; gap: .45rem; margin: 0; }
.rap-liste, .prev-liste { list-style: none; margin: .2rem 0 0; padding: 0; }
.rap-liste li, .prev-liste li {
  display: flex; align-items: center; gap: .65rem; padding: .5rem 0; border-top: 1px solid var(--bord);
}
.rap-liste li:first-child, .prev-liste li:first-child { border-top: 0; }
.rap-liste .badge { flex: 0 0 auto; min-width: 5.6rem; justify-content: center; text-align: center; }
.rap-liste-txt, .prev-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rap-liste-txt strong, .prev-txt strong { font-size: .9rem; overflow-wrap: anywhere; }
.rap-liste-txt small, .prev-txt small { font-size: .76rem; color: var(--txt-soft); }
.prev-txt small.faible { color: var(--txt-faint); }
.rap-liste form { margin: 0; }
.prev-jours {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.prev-jours b { font-size: 1.3rem; }
.prev-jours small { font-size: .62rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; margin-top: .1rem; }
.prev-jours.z-attn   { background: var(--attn-bg); color: var(--attn); }
.prev-jours.z-alerte { background: var(--alerte-bg); color: var(--alerte); }

/* ------------------------------------------------------------------ *
 * 18. Previsions sur les mesures et le calculateur                    *
 * ------------------------------------------------------------------ */
.pc-prev { cursor: help; }
.fiche-tendance { margin: .15rem 0 0; font-size: .8rem; color: var(--txt-soft); }
.fiche-tendance strong { color: var(--alerte); font-weight: 650; }
.trait-projection { display: inline-block; width: 22px; border-top: 2px dotted var(--pc, var(--prim)); margin-left: .6rem; }
.g-projection {
  fill: none; stroke: var(--pc-n2, var(--prim)); stroke-width: 2; stroke-dasharray: 2 5;
  stroke-linecap: round; opacity: .85;
}
.g-projection-fin { fill: #fff; stroke: var(--pc-n2, var(--prim)); stroke-width: 1.6; }

.conso { display: flex; gap: .9rem; align-items: flex-start; border-left: 4px solid var(--a-eau); }
.conso h3 { margin: 0 0 .3rem; }
.conso p { margin: .2rem 0; }
.conso-ic {
  flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; background: var(--a-eau-bg); color: var(--a-eau);
}
.conso-dose strong { color: var(--prim); }

/* ------------------------------------------------------------------ *
 * 19. Simulation d'un ajout                                           *
 * ------------------------------------------------------------------ */
.sim-form { margin-bottom: 1.2rem; }
.sim-form .champ { margin-bottom: .2rem; }
.sim-verdict {
  --v: var(--ok); --v-bg: var(--ok-bg);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.2rem; align-items: center;
  padding: 1rem; margin-bottom: 1rem; background: var(--bg-alt);
  border: 1px solid var(--bord); border-top: 5px solid var(--v); border-radius: var(--rayon-l);
  box-shadow: var(--ombre);
}
.sim-verdict.z-attn   { --v: var(--attn);   --v-bg: var(--attn-bg); }
.sim-verdict.z-alerte { --v: var(--alerte); --v-bg: var(--alerte-bg); }
.sim-verdict.z-crit   { --v: var(--crit);   --v-bg: var(--crit-bg); }
.sim-photo {
  width: 150px; height: 112px; object-fit: cover; border-radius: var(--rayon); background: var(--bg-soft);
}
.sim-photo-vide { display: grid; place-items: center; color: var(--txt-faint); }
.sim-sur { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-faint); }
.sim-texte h2 { margin: .1rem 0 0; font-size: 1.45rem; }
.sim-sci { margin: .1rem 0 .5rem; font-size: .85rem; color: var(--txt-soft); }
.sim-phrase { margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sim-phrase strong { color: var(--v); font-size: 1.05rem; }
.sim-chiffres { display: flex; gap: .6rem; margin: 0; }
.sim-chiffres > div {
  min-width: 96px; padding: .55rem .8rem; border-radius: var(--rayon-s); background: var(--bg-soft); text-align: center;
}
.sim-chiffres dt { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-faint); }
.sim-chiffres dd { margin: .15rem 0 0; font-size: .92rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sim-chiffres dd span { color: var(--txt-faint); }
.sim-points { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: 1rem; }
.sim-point {
  display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .9rem;
  background: var(--bg-alt); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-xs);
}
.sim-point h3 { margin: 0 0 .2rem; font-size: .92rem; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.sim-point p { margin: 0; font-size: .85rem; color: var(--txt-soft); line-height: 1.5; }
.sim-pastille {
  flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: var(--ok-bg); color: var(--ok);
}
.sim-point.z-attn .sim-pastille   { background: var(--attn-bg); color: var(--attn); }
.sim-point.z-alerte .sim-pastille { background: var(--alerte-bg); color: var(--alerte); }
.sim-point.z-crit .sim-pastille   { background: var(--crit-bg); color: var(--crit); }
.sim-point.z-crit   { border-color: color-mix(in srgb, var(--crit) 35%, var(--bord)); }
.sim-point.z-alerte { border-color: color-mix(in srgb, var(--alerte) 30%, var(--bord)); }
.sim-point.n-info .sim-pastille { background: var(--info-bg); color: var(--info); }
.sim-point.n-info .badge { background: var(--info-bg); color: var(--info); }
@media (max-width: 760px) {
  .sim-verdict { grid-template-columns: 1fr; text-align: left; }
  .sim-photo { width: 100%; height: 170px; }
  .sim-chiffres { flex-wrap: wrap; }
  .sim-points { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ *
 * 20. Changement d'eau et import d'analyse                            *
 * ------------------------------------------------------------------ */
.table-eau td, .table-icp td { vertical-align: middle; }
.saisie-num { width: 6.5rem; max-width: 100%; padding: .35rem .5rem; text-align: right; font-variant-numeric: tabular-nums; }
.eau-plus  { color: var(--alerte); font-weight: 650; }
.eau-moins { color: var(--ok); font-weight: 650; }
.calc-res { margin: .4rem 0; font-size: 1.05rem; }
.calc-res strong { font-size: 1.5rem; color: var(--prim); }
.calc-eau h2 { display: flex; align-items: center; gap: .5rem; }
.calc-eau .champ { margin-bottom: .6rem; }
.col-coche { width: 42px; text-align: center; }
.col-coche input { width: 18px; height: 18px; accent-color: var(--prim); }
.icp-doute td { background: var(--attn-bg); }
.icp-depot textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.icp-depot input[type="file"] { padding: .5rem; background: var(--bg-voile); border-style: dashed; }

/* ------------------------------------------------------------------ *
 * 21. Application mobile                                              *
 * ------------------------------------------------------------------ */
.app-hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 2rem; align-items: center;
  padding: 2rem 2.2rem; margin-bottom: 1.4rem; overflow: hidden;
  background: radial-gradient(120% 140% at 85% 10%, #dff0ff 0%, #f6fbff 45%, #ffffff 100%);
  border: 1px solid var(--bord); border-radius: var(--rayon-l); box-shadow: var(--ombre);
}
.app-sur { margin: 0 0 .5rem; display: flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--prim); }
.app-hero h1 { margin: 0 0 .6rem; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.12; letter-spacing: -.02em; }
.app-chapeau { margin: 0 0 1.1rem; font-size: 1.04rem; color: var(--txt-soft); line-height: 1.6; max-width: 34rem; }
.app-hero .btns { margin: 0; }
.app-hero .btn.large { width: auto; }
.app-etat { margin: .8rem 0 0; padding: .55rem .8rem; border-radius: var(--rayon-s); background: var(--ok-bg); color: var(--ok); font-size: .9rem; }
.app-gratuit { margin: .9rem 0 0; display: flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--txt-faint); }

.app-tel { display: flex; justify-content: center; }
.app-tel-ecran {
  width: 230px; padding: .7rem .7rem 1rem; border-radius: 34px;
  background: linear-gradient(180deg, #f6faff, #eaf3fd); border: 9px solid #16233a;
  box-shadow: 0 24px 50px rgba(22, 48, 82, .28), inset 0 0 0 1px rgba(255, 255, 255, .6);
  transform: rotate(4deg);
}
.app-tel-barre { display: flex; justify-content: space-between; align-items: center; padding: 0 .4rem .45rem;
  font-size: .62rem; font-weight: 700; color: var(--txt); }
.app-tel-encoche { width: 62px; height: 16px; border-radius: 10px; background: #16233a; }
.app-tel-tete { display: flex; align-items: center; gap: .4rem; padding: .35rem .3rem .55rem; }
.app-tel-tete img { width: 24px; height: 24px; border-radius: 7px; }
.app-tel-tete b { font-size: .82rem; }
.app-tel-tete span { margin-left: auto; font-size: .68rem; color: var(--txt-faint); font-weight: 650; }
.app-tel-cartes { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.app-mini {
  --pc: var(--a-eau);
  display: flex; flex-direction: column; padding: .45rem .5rem .35rem; border-radius: 12px;
  background: #fff; border: 1px solid var(--bord); box-shadow: var(--ombre-xs);
}
.app-mini.a-biblio { --pc: var(--a-biblio); }
.app-mini.a-algue  { --pc: var(--a-algue); }
.app-mini.a-pb     { --pc: var(--a-pb); }
.app-mini i { font-style: normal; font-size: .55rem; font-weight: 800; letter-spacing: .08em; color: var(--txt-soft); }
.app-mini b { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; }
.app-mini svg { width: 100%; height: 16px; overflow: visible; }
.app-mini path { fill: none; stroke: var(--pc); stroke-width: 2; stroke-linecap: round;
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--pc) 45%, transparent)); vector-effect: non-scaling-stroke; }
.app-mini small { font-size: .55rem; color: var(--txt-faint); }
.app-tel-rappel { display: flex; align-items: center; gap: .35rem; margin-top: .5rem; padding: .45rem .5rem;
  border-radius: 12px; background: #fff; border: 1px solid var(--bord); font-size: .6rem; font-weight: 600; line-height: 1.3; }
.app-tel-rappel .badge { font-size: .55rem; padding: .08rem .35rem; flex: 0 0 auto; }

.app-atouts { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 1.4rem; }
.app-atout { padding: 1rem 1.1rem; background: var(--bg-alt); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-xs); }
.app-atout h3 { margin: .6rem 0 .3rem; font-size: 1rem; }
.app-atout p { margin: 0; font-size: .86rem; color: var(--txt-soft); line-height: 1.55; }
.app-atout-ic { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; }
.app-atout-ic.a-eau     { background: var(--a-eau-bg); color: var(--a-eau); }
.app-atout-ic.a-corail  { background: var(--a-corail-bg); color: var(--a-corail); }
.app-atout-ic.a-poisson { background: var(--a-poisson-bg); color: var(--a-poisson); }
.app-atout-ic.a-biblio  { background: var(--a-biblio-bg); color: var(--a-biblio); }

.app-procedure { --pc: var(--prim); scroll-margin-top: calc(var(--barre-h) + 1rem); }
.app-onglets { flex-wrap: wrap; }
.app-onglets [role="tab"] small { font-weight: 500; color: var(--txt-faint); margin-left: .2rem; }
.app-panneau[hidden] { display: none; }
.app-etapes { counter-reset: etape; list-style: none; margin: .4rem 0 .2rem; padding: 0; }
.app-etapes li {
  counter-increment: etape; position: relative; padding: .55rem 0 .55rem 2.7rem; line-height: 1.6;
  border-top: 1px solid var(--bord);
}
.app-etapes li:first-child { border-top: 0; }
.app-etapes li::before {
  content: counter(etape); position: absolute; left: 0; top: .5rem; width: 1.9rem; height: 1.9rem;
  display: grid; place-items: center; border-radius: 50%; background: var(--prim); color: #fff;
  font-weight: 700; font-size: .9rem;
}
.pic-nav { display: inline-block; width: 1.35em; height: 1.35em; vertical-align: -.3em; margin: 0 .1em;
  padding: .12em; border-radius: 6px; background: var(--prim-clair); color: var(--prim); }
@media (max-width: 860px) {
  .app-hero { grid-template-columns: 1fr; padding: 1.4rem 1.2rem; gap: 1.4rem; }
  .app-tel-ecran { transform: none; }
  .app-hero .btn.large { width: 100%; }
}

/* annonce sur le tableau de bord */
.pub-app {
  display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.4rem; padding: 1rem 1.2rem;
  background: radial-gradient(140% 160% at 100% 0%, #d9edff 0%, #f3f9ff 50%, #ffffff 100%);
  border: 1px solid color-mix(in srgb, var(--prim) 22%, var(--bord)); border-radius: var(--rayon-l);
  box-shadow: var(--ombre);
}
.pub-app[hidden] { display: none; }
.pub-app-icone { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 6px 16px rgba(24, 117, 206, .22); }
.pub-app-texte { flex: 1 1 auto; min-width: 0; }
.pub-app-sur { margin: 0; display: flex; align-items: center; gap: .45rem; font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--prim); }
.pub-app h2 { margin: .2rem 0 .15rem; font-size: 1.12rem; }
.pub-app p { margin: 0; font-size: .87rem; color: var(--txt-soft); }
.pub-app-actions { flex: 0 0 auto; display: flex; align-items: center; gap: .4rem; }
.pub-app-fermer {
  width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--txt-faint);
}
.pub-app-fermer:hover { background: var(--bg-soft); color: var(--txt); }
@media (max-width: 720px) {
  .pub-app { flex-wrap: wrap; position: relative; }
  .pub-app-texte { flex-basis: calc(100% - 90px); }
  .pub-app-actions { flex: 1 1 100%; }
  .pub-app-actions .btn { flex: 1 1 auto; justify-content: center; }
  .pub-app-fermer { position: absolute; top: .5rem; right: .5rem; }
}

/* lien vers l'application sous la carte de connexion */
.auth-app {
  display: flex; align-items: center; gap: .7rem; margin-top: 1.1rem; padding: .6rem .8rem;
  border: 1px solid var(--bord); border-radius: var(--rayon); background: rgba(255, 255, 255, .7);
  color: var(--txt); text-decoration: none;
}
.auth-app:hover { text-decoration: none; background: #fff; box-shadow: var(--ombre); }
.auth-app[hidden] { display: none; }
.auth-app img { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; }
.auth-app span { flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.3; }
.auth-app strong { font-size: .86rem; }
.auth-app small { font-size: .76rem; color: var(--txt-soft); }

/* message flottant (saisie hors connexion) */
.avis-flottant {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 200;
  transform: translateX(-50%); max-width: min(92vw, 480px); padding: .7rem 1rem;
  border-radius: var(--rayon-s); box-shadow: var(--ombre-f); font-size: .9rem; line-height: 1.45;
  background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(15, 138, 95, .22);
  transition: opacity .5s, transform .5s;
}
.avis-flottant.warn { background: var(--attn-bg); color: var(--attn); border-color: rgba(168, 116, 0, .22); }
.avis-flottant.err  { background: var(--crit-bg); color: var(--crit); border-color: rgba(192, 53, 47, .22); }
.avis-flottant.part { opacity: 0; transform: translate(-50%, 8px); }

/* application installee : l'annonce n'a plus lieu d'etre */
html.app-installee .pub-app, html.app-installee .auth-app { display: none; }

/* ------------------------------------------------------------------ *
 * 22. Vitrine publique d'un bac                                       *
 * ------------------------------------------------------------------ */
.vit-hero { position: relative; margin-bottom: 1.2rem; border-radius: var(--rayon-l); overflow: hidden; box-shadow: var(--ombre); }
.vit-photo { display: block; width: 100%; height: 210px; object-fit: cover; }
.vit-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 30, 58, .78), rgba(8, 30, 58, .2) 70%); }
.vit-hero-texte { position: absolute; inset: auto 0 0 0; z-index: 1; padding: 1.2rem 1.4rem; color: #fff; }
.vit-hero-texte .hero-sur { color: rgba(255, 255, 255, .8); margin: 0; }
.vit-hero-texte h1 { margin: .15rem 0 .55rem; font-size: clamp(1.5rem, 3vw, 2.2rem); color: #fff; }
.vit-hero-texte .badge { background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(4px); }
.vit-hero-texte .badge.pleine { background: var(--prim); }
.vit-kpi .stat:hover { transform: none; box-shadow: var(--ombre-xs); }
.vit-grille { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.vit-grille .pc:hover { transform: none; }
.vit-grille .pc-courbe { flex: 0 0 auto; height: 46px; }
.pc-titre { display: block; font-weight: 700; color: var(--txt-soft); text-transform: uppercase; letter-spacing: .07em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vit-pop { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.vit-especes { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.vit-especes .vignette-espece { width: 48px; height: 48px; }
.vit-appel {
  display: flex; align-items: center; gap: 1rem; margin: 1.6rem 0 .6rem; padding: 1.1rem 1.3rem;
  background: var(--prim-voile); border: 1px solid var(--bord); border-radius: var(--rayon-l);
}
.vit-appel img { border-radius: 14px; flex: 0 0 auto; }
.vit-appel div { flex: 1 1 auto; }
.vit-appel h2 { margin: 0 0 .2rem; font-size: 1.1rem; }
.vit-appel p { margin: 0; font-size: .88rem; color: var(--txt-soft); }
.vit-absente { display: flex; gap: 1rem; align-items: flex-start; }
.vit-absente h1 { margin: 0 0 .4rem; font-size: 1.35rem; }
@media (max-width: 640px) {
  .vit-appel { flex-wrap: wrap; }
  .vit-appel .btn { width: 100%; justify-content: center; }
}

/* reglage de la vitrine, dans « Mes bacs » */
.vit-reglage { margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--bord-fort); scroll-margin-top: calc(var(--barre-h) + 1rem); }
.vit-reglage h4 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .3rem; font-size: .9rem; }
.vit-reglage p { margin: 0 0 .5rem; }
.vit-lien { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.vit-lien .btn { flex: 0 0 auto; }
.vit-lien input { flex: 1 1 260px; min-width: 0; font-size: .8rem; padding: .35rem .5rem; background: var(--bg-voile); }
.vit-options { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; margin-bottom: .4rem; }
.vit-options .coche { margin: 0; font-size: .84rem; }
.vit-reglage .btns { margin: .3rem 0 0; }
.vit-reglage .btns form { margin: 0; }

/* ------------------------------------------------------------------ *
 * 23. Annonce de l'application a la connexion                         *
 * ------------------------------------------------------------------ */
.annonce-app {
  width: min(92vw, 420px); padding: 1.6rem 1.5rem 1.2rem; overflow: hidden;
  border: 0; border-radius: 26px; text-align: center; color: var(--txt);
  background: radial-gradient(130% 90% at 50% 0%, #dcefff 0%, #f5faff 55%, #ffffff 100%);
  box-shadow: 0 30px 80px rgba(8, 30, 58, .35);
}
.annonce-app[open] { animation: annonce-entre .65s cubic-bezier(.2, 1.35, .35, 1) both; }
.annonce-app::backdrop { background: rgba(10, 28, 52, .45); backdrop-filter: blur(3px); animation: annonce-fond .4s ease both; }
.annonce-app.sort { animation: annonce-sort .22s ease-in both; }
@keyframes annonce-entre { from { opacity: 0; transform: translateY(40px) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes annonce-sort { to { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes annonce-fond { from { opacity: 0; } to { opacity: 1; } }

.annonce-fermer {
  position: absolute; top: .7rem; right: .7rem; z-index: 2; width: 34px; height: 34px;
  border: 0; border-radius: 10px; background: rgba(255, 255, 255, .7); cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--txt-soft);
}
.annonce-fermer:hover { background: #fff; color: var(--txt); }

.annonce-tel { position: relative; z-index: 1; display: flex; justify-content: center; margin-bottom: .9rem; }
.annonce-tel-ecran {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  width: 112px; height: 150px; border-radius: 24px; border: 6px solid #16233a;
  background: linear-gradient(180deg, #eaf5ff, #bfe0fb);
  box-shadow: 0 16px 34px rgba(22, 48, 82, .3);
  animation: annonce-tel 1s .35s cubic-bezier(.2, 1.4, .4, 1) both, annonce-flotte 3.6s 1.4s ease-in-out infinite;
}
.annonce-tel-ecran img { width: 62px; height: 62px; border-radius: 16px; box-shadow: 0 6px 14px rgba(24, 117, 206, .3);
  animation: annonce-icone .7s .9s cubic-bezier(.2, 1.6, .4, 1) both; }
.annonce-tel-ecran span { font-size: .7rem; font-weight: 700; color: var(--txt); }
@keyframes annonce-tel { from { opacity: 0; transform: translateY(26px) rotate(-12deg); } to { opacity: 1; transform: rotate(-4deg); } }
@keyframes annonce-flotte { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-6px); } }
@keyframes annonce-icone { from { transform: scale(0); } to { transform: scale(1); } }

.annonce-bulles { position: absolute; inset: 0; pointer-events: none; }
.annonce-bulles i {
  position: absolute; bottom: -20px; width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid rgba(30, 136, 229, .35); background: rgba(255, 255, 255, .5);
  animation: annonce-bulle 5s linear infinite;
}
.annonce-bulles i:nth-child(1) { left: 12%; animation-delay: .2s; }
.annonce-bulles i:nth-child(2) { left: 26%; width: 7px; height: 7px; animation-delay: 1.6s; animation-duration: 4s; }
.annonce-bulles i:nth-child(3) { left: 72%; width: 16px; height: 16px; animation-delay: .8s; animation-duration: 6s; }
.annonce-bulles i:nth-child(4) { left: 86%; width: 8px; height: 8px; animation-delay: 2.4s; }
.annonce-bulles i:nth-child(5) { left: 58%; width: 6px; height: 6px; animation-delay: 3.2s; animation-duration: 4.4s; }
.annonce-bulles i:nth-child(6) { left: 40%; width: 10px; height: 10px; animation-delay: 4s; animation-duration: 5.6s; }
@keyframes annonce-bulle {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translateY(-260px) translateX(8px); }
  100% { transform: translateY(-540px) translateX(-6px); opacity: 0; }
}

.annonce-sur { position: relative; z-index: 1; margin: 0 0 .3rem; }
.annonce-app h2 { position: relative; z-index: 1; margin: 0 0 .5rem; font-size: 1.35rem; line-height: 1.25; }
.annonce-txt { position: relative; z-index: 1; margin: 0 0 1.1rem; font-size: .92rem; line-height: 1.55; color: var(--txt-soft); }
.annonce-btns { position: relative; z-index: 1; display: flex; flex-direction: column; gap: .5rem; }
.annonce-btns .btn { justify-content: center; }
.annonce-masquer { position: relative; z-index: 1; margin: .9rem 0 0; display: flex; justify-content: center; }
.annonce-masquer .coche { margin: 0; font-size: .84rem; color: var(--txt-soft); }

@media (prefers-reduced-motion: reduce) {
  .annonce-bulles { display: none; }
}

/* ------------------------------------------------------------------ *
 * 24. Lettre d'information                                            *
 * ------------------------------------------------------------------ */
.nl-grille { align-items: start; }
.nl-form textarea { font-size: .9rem; line-height: 1.5; }
.nl-envoi {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: 1rem; padding-top: 1rem;
  border-top: 1px dashed var(--bord-fort);
}
.nl-envoi .coche { flex: 1 1 260px; margin: 0; }
.nl-sujet { margin: 0 0 .6rem; }
.nl-apercu {
  margin: 0; padding: .9rem 1rem; max-height: 470px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font: .85rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--bg-voile); border: 1px solid var(--bord); border-radius: var(--rayon-s);
}

/* ------------------------------------------------------------------ *
 * 25. Menu lateral en tiroirs                                         *
 * ------------------------------------------------------------------ */
:root { interpolate-size: allow-keywords; }
.nav-groupe {
  margin-bottom: .4rem; border: 1px solid var(--bord); border-radius: var(--rayon);
  background: var(--bg-voile); transition: background .2s, border-color .2s, box-shadow .2s;
}
.nav-groupe[open] { background: #fff; border-color: var(--bord-fort); box-shadow: var(--ombre-xs); }
.nav-groupe > summary {
  display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; cursor: pointer;
  list-style: none; border-radius: var(--rayon); user-select: none;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-soft);
  white-space: nowrap;
}
.nav-groupe > summary::-webkit-details-marker { display: none; }
.nav-groupe > summary:hover { color: var(--txt); background: var(--bg-soft); }
.nav-groupe > summary:focus-visible { outline: 2px solid var(--prim); outline-offset: -2px; }
.nav-groupe-ic {
  flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; background: var(--bg-soft); color: var(--txt-faint); transition: background .2s, color .2s;
}
.nav-groupe[open] .nav-groupe-ic { background: var(--prim-clair); color: var(--prim); }
.nav-groupe[open] > summary { color: var(--txt); }
.nav-groupe-nom { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav .nav-groupe-pastille { margin-left: 0; }
.nav-groupe[open] .nav-groupe-pastille { display: none; }
.nav-chevron { flex: 0 0 auto; width: 16px; height: 16px; color: var(--txt-faint); transition: transform .25s; }
.nav-groupe[open] .nav-chevron { transform: rotate(180deg); }
.nav-groupe-liens { padding: 0 .3rem .35rem; }

/* ouverture en douceur la ou le navigateur sait animer un <details> */
.nav-groupe::details-content {
  block-size: 0; overflow: hidden;
  transition: block-size .28s ease, content-visibility .28s allow-discrete;
}
.nav-groupe[open]::details-content { block-size: auto; }
@media (prefers-reduced-motion: reduce) {
  .nav-groupe::details-content { transition: none; }
}

/* ecrans courts : les tiroirs se resserrent */
@media (min-width: 1001px) and (max-height: 880px) {
  .nav-groupe { margin-bottom: .3rem; }
  .nav-groupe > summary { padding: .38rem .55rem; }
  .nav-groupe-ic { width: 24px; height: 24px; }
}

/* Application mobile : entree a part, sous les tiroirs */
.nav a.nav-app {
  margin-top: .6rem; padding: .55rem .6rem; gap: .6rem; align-items: center;
  border: 1px solid color-mix(in srgb, var(--prim) 25%, var(--bord)); border-radius: var(--rayon);
  background: linear-gradient(135deg, #eaf5ff 0%, #ffffff 80%); color: var(--txt);
}
.nav a.nav-app:hover { background: linear-gradient(135deg, #dcefff 0%, #f6fbff 80%); box-shadow: var(--ombre-xs); }
.nav a.nav-app.actif { border-color: var(--prim); background: var(--prim-clair); }
.nav-app img { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 3px 8px rgba(24, 117, 206, .22); }
.nav-app span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.nav-app strong { font-size: .86rem; font-weight: 700; }
.nav-app small { font-size: .72rem; color: var(--txt-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.app-installee .nav-app { display: none; }
@media (display-mode: standalone) { .nav-app, .pub-app, .auth-app { display: none; } }

/* ------------------------------------------------------------------ *
 * 26. Application installee : barre du bas et menu circulaire         *
 * ------------------------------------------------------------------ */
.barre-app, .roue-menu:not([open]) { display: none; }

@media (max-width: 1000px) {
  html.app-installee .burger { display: none; }
  html.app-installee body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  html.app-installee .appbar { padding-top: env(safe-area-inset-top); height: calc(var(--barre-h) + env(safe-area-inset-top)); }
  html.app-installee .avis-flottant { bottom: calc(88px + env(safe-area-inset-bottom)); }
  html.app-installee .bandeau-rgpd { bottom: calc(68px + env(safe-area-inset-bottom)); }

  html.app-installee .barre-app {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 180;
    display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: end;
    height: calc(64px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px) saturate(1.4);
    border-top: 1px solid var(--bord); box-shadow: 0 -6px 24px rgba(22, 48, 82, .08);
  }
}

/* Meme chose des le premier rendu, sans attendre le script : la barre ne
   surgit pas apres coup a chaque page. app-installee reste pour iOS. */
@media (max-width: 1000px) and (display-mode: standalone) {
  .burger { display: none; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .appbar { padding-top: env(safe-area-inset-top); height: calc(var(--barre-h) + env(safe-area-inset-top)); }
  .avis-flottant { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .bandeau-rgpd { bottom: calc(68px + env(safe-area-inset-bottom)); }

  .barre-app {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 180;
    display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: end;
    height: calc(64px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px) saturate(1.4);
    border-top: 1px solid var(--bord); box-shadow: 0 -6px 24px rgba(22, 48, 82, .08);
  }
}

.barre-app-onglet {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; height: 64px; color: var(--txt-faint); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.barre-app-onglet:hover { text-decoration: none; color: var(--txt-soft); }
.barre-app-ic { display: grid; place-items: center; width: 46px; height: 30px; border-radius: 15px; transition: background .2s, color .2s; }
.barre-app-lib { font-size: .66rem; font-weight: 650; letter-spacing: .01em; }
.barre-app-onglet.actif { color: var(--prim); }
.barre-app-onglet.actif .barre-app-ic { background: var(--prim-clair); }

/* le rond du milieu, qui deborde au-dessus de la barre */
.barre-app-rond {
  justify-self: center; align-self: start; margin-top: -22px;
  width: 62px; height: 62px; border-radius: 50%; border: 4px solid #fff; padding: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #3d9cf0 0%, #1875ce 55%, #125ca6 100%);
  box-shadow: 0 8px 20px rgba(24, 117, 206, .42); -webkit-tap-highlight-color: transparent;
  transition: transform .3s cubic-bezier(.3, 1.5, .5, 1);
}
.barre-app-rond svg { width: 28px; height: 28px; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.barre-app-rond:active { transform: scale(.92); }

/* menu circulaire : plein ecran, transparent, l'anneau au centre */
.roue-menu[open] {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden;
  display: block;
}
.roue-menu::backdrop { background: rgba(10, 28, 52, .5); backdrop-filter: blur(5px); animation: annonce-fond .3s ease both; }
.roue-menu.sort { animation: roue-sort .2s ease-in both; }
@keyframes roue-sort { to { opacity: 0; } }

.roue {
  --d: min(90vw, 360px);
  position: absolute; left: 50%; bottom: calc(108px + env(safe-area-inset-bottom));
  width: var(--d); height: var(--d); margin-left: calc(var(--d) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .98) 0%, rgba(239, 247, 255, .96) 70%, rgba(222, 238, 253, .95) 100%);
  box-shadow: 0 24px 60px rgba(8, 30, 58, .38), inset 0 0 0 1px rgba(255, 255, 255, .8);
  transform-origin: 50% calc(100% + 80px);
  animation: roue-entre .45s cubic-bezier(.2, 1.3, .35, 1) both;
}
@media (max-height: 560px) { .roue { --d: min(80vw, 300px); bottom: calc(96px + env(safe-area-inset-bottom)); } }
@keyframes roue-entre { from { opacity: 0; transform: scale(.2) rotate(-40deg); } to { opacity: 1; transform: none; } }

.roue-anneau { position: absolute; inset: 0; }
.roue-anneau[hidden] { display: none; }
.roue-item {
  position: absolute; left: 50%; top: 50%; width: 82px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0; border: 0; background: none; cursor: pointer; text-decoration: none; color: var(--txt);
  -webkit-tap-highlight-color: transparent;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) / -2 + 52px)) rotate(calc(var(--a) * -1));
  animation: roue-item .4s cubic-bezier(.2, 1.5, .4, 1) both;
  animation-delay: calc(var(--i) * 35ms + 60ms);
}
.roue-item:hover { text-decoration: none; }
@keyframes roue-item {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) rotate(calc(var(--a) * -1)) scale(.3); }
}
.roue-bulle {
  position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--prim); box-shadow: 0 4px 12px rgba(22, 48, 82, .16), inset 0 0 0 1px var(--bord);
  transition: transform .2s, background .2s, color .2s;
}
.roue-item:active .roue-bulle { transform: scale(.9); }
.roue-item.actif .roue-bulle, .roue-item:focus-visible .roue-bulle { background: var(--prim); color: #fff; }
.roue-item:focus-visible { outline: none; }
.roue-bulle .pastille {
  position: absolute; top: -3px; right: -5px; min-width: 18px; height: 18px; padding: 0 .3rem;
  border-radius: 9px; background: var(--crit); color: #fff; font-size: .62rem; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px #fff;
}
.roue-lib {
  max-width: 82px; font-size: .66rem; font-weight: 650; line-height: 1.15; text-align: center;
  color: var(--txt); text-shadow: 0 1px 0 #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.roue-centre {
  position: absolute; left: 50%; top: 50%; width: 34%; height: 34%; transform: translate(-50%, -50%);
  border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(160deg, #ffffff, #e4f1fe); color: var(--prim);
  box-shadow: 0 6px 18px rgba(22, 48, 82, .16), inset 0 0 0 1px var(--bord);
  -webkit-tap-highlight-color: transparent;
}
.roue-centre-ic { display: grid; place-items: center; }
.roue-centre-ic img { width: 46px; height: 46px; border-radius: 12px; }
.roue-centre-ic svg { width: 28px; height: 28px; }
.roue-centre-ic [hidden] { display: none; }
.roue-centre-lib { font-size: .72rem; font-weight: 750; color: var(--txt); max-width: 90%; line-height: 1.15; }

/* la croix de fermeture prend la place exacte du rond de la barre */
.roue-fermer {
  /* barre de 64 px, rond de 62 px qui depasse de 22 px : son bas est a 24 px du bas */
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px);
  margin: 0 0 0 -31px;
}
.roue-fermer svg { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) {
  .roue, .roue-item { animation: none; }
}

/* ------------------------------------------------------------------ *
 * 27. Telephone : tableaux en cartes, filtres en bande defilante      *
 * ------------------------------------------------------------------ */
@media (max-width: 640px) {
  .tabwrap:has(> table.cartes-mobile) {
    overflow: visible; border: 0; background: none; box-shadow: none; border-radius: 0;
  }
  table.cartes-mobile { table-layout: auto; }
  table.cartes-mobile, table.cartes-mobile tbody, table.cartes-mobile tr, table.cartes-mobile td {
    display: block; width: auto !important;
  }
  table.cartes-mobile thead { display: none; }
  table.cartes-mobile tr {
    margin-bottom: .65rem; padding: .7rem .85rem .45rem;
    background: var(--bg-alt); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-xs);
  }
  table.cartes-mobile td {
    display: block; padding: .38rem 0; border: 0; border-top: 1px dashed var(--bord);
    text-align: right; white-space: normal; overflow-wrap: anywhere; min-height: 2rem;
  }
  table.cartes-mobile td::after { content: ""; display: table; clear: both; }
  table.cartes-mobile td::before {
    content: attr(data-label); float: left; max-width: 48%; margin: .15rem .8rem 0 0; text-align: left; line-height: 1.3;
    font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--txt-faint);
  }
  /* la premiere cellule sert de titre a la carte */
  table.cartes-mobile td:first-child {
    display: block; padding: 0 0 .45rem; border-top: 0; text-align: left; font-size: .98rem;
  }
  table.cartes-mobile td:first-child::before { display: none; }
  table.cartes-mobile td:empty { display: none; }
  /* colonne d'actions sans titre : alignee a droite, sans libelle */
  table.cartes-mobile td:not([data-label])::before, table.cartes-mobile td[data-label=""]::before { display: none; }
  table.cartes-mobile td .espece-cellule { justify-content: flex-start; }
  table.cartes-mobile .form-retirer { justify-content: flex-end; width: 100%; }
  table.cartes-mobile .saisie-num { width: 7.5rem; }
  table.cartes-mobile .icp-doute, table.cartes-mobile tr.icp-doute { background: var(--attn-bg); }
  table.cartes-mobile td.col-coche { text-align: left; }

  /* filtres en bande : une seule ligne qu'on fait glisser */
  .chips {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin-right: -16px; margin-left: -16px; padding: 0 16px .2rem;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chips .chip { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }
}

@media (max-width: 640px) {
  /* filtres : deux champs par ligne, de meme largeur, le bouton en pleine largeur */
  .filtres { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
  .filtres > .champ, .filtres > * { flex: none !important; min-width: 0; }
  .filtres > .champ:first-of-type:has(input[type="text"], input[type="search"]) { grid-column: 1 / -1; }
  .filtres select, .filtres input { width: 100%; }
  .filtres > .champ:last-child:has(.btn), .filtres > .btn, .filtres > button { grid-column: 1 / -1; }
  .filtres .btn { width: 100%; justify-content: center; }
  .filtres > input[type="hidden"] { display: none; }

  /* tuiles chiffrees : deux par ligne plutot qu'une colonne interminable */
  .grille.g4 { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .grille.g4 .tuile { padding: .7rem .8rem; }
  .grille.g4 .tuile .val { font-size: 1.5rem; }
  .grille.g4 .tuile .meta { font-size: .72rem; }
}
@media (max-width: 640px) {
  /* champs en ligne : chacun prend la place qui reste, plus de liste deroulante etriquee */
  .inline > .champ { flex-grow: 1 !important; }
  .inline > .champ select { width: 100%; }
}
@media (max-width: 640px) {
  table.cartes-mobile td.td-long:not(:first-child) { text-align: left; }
  table.cartes-mobile td.td-long:not(:first-child)::before { float: none; display: block; max-width: none; margin: 0 0 .2rem; }
}

/* ------------------------------------------------------------------ *
 * 28. Application installee : d'une page a l'autre sans page blanche  *
 * ------------------------------------------------------------------ */
/* La page quittee reste affichee jusqu'a ce que la suivante soit prete,
   puis un fondu tres court : plus de flash blanc entre deux ecrans. Les
   barres du haut et du bas ne bougent pas. */
@media (display-mode: standalone) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }
  .appbar { view-transition-name: barre-haut; }
  .barre-app { view-transition-name: barre-bas; }
}
@media (display-mode: standalone) and (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
}

/* Ecran de chargement entre deux pages (application installee) : le corail
   du logo se remplit d'eau au milieu de l'ecran. --p (0 a 100) est tenu a
   jour par le script. */
.charge-page {
  position: fixed; inset: 0; z-index: 300; display: none;
  place-items: center; pointer-events: none;
  background: rgba(238, 244, 250, .55); backdrop-filter: blur(3px);
}
.charge-page.part { display: grid; animation: charge-entre .14s ease-out both; }
/* sur la page d'arrivee : deja la, sans nouvelle entree, puis il s'efface */
.charge-page.part.arrivee, .charge-page.part.arrivee .charge-boite { animation: none; }
.charge-page.part.fin { animation: charge-sort .24s ease-in both; }
@keyframes charge-sort { to { opacity: 0; } }
@keyframes charge-entre { from { opacity: 0; } to { opacity: 1; } }
.charge-boite {
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  padding: 1.3rem 1.6rem 1rem; border-radius: 26px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--bord);
  box-shadow: 0 18px 50px rgba(14, 40, 72, .18);
}
.charge-page.part .charge-boite { animation: charge-boite .32s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes charge-boite { from { transform: scale(.7); } to { transform: none; } }
.charge-logo { position: relative; width: 96px; height: 96px; }
.charge-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.charge-vide { filter: grayscale(1); opacity: .22; }
.charge-plein {
  clip-path: inset(calc(100% - var(--p, 0) * 1%) 0 0 0);
  filter: drop-shadow(0 4px 10px rgba(24, 117, 206, .25));
}
.charge-bulle {
  position: absolute; bottom: 6px; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid rgba(30, 136, 229, .55); background: rgba(255, 255, 255, .7);
  opacity: 0; animation: charge-bulle 1.3s ease-in infinite;
}
.charge-bulle:nth-of-type(1) { left: 24%; }
.charge-bulle:nth-of-type(2) { left: 58%; width: 5px; height: 5px; animation-delay: .45s; }
.charge-bulle:nth-of-type(3) { left: 76%; width: 9px; height: 9px; animation-delay: .85s; }
@keyframes charge-bulle {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-92px) scale(1.1); }
}
.charge-txt { font-size: .82rem; font-weight: 600; color: var(--txt-soft); font-variant-numeric: tabular-nums; }
.charge-txt b { color: var(--prim); font-weight: 800; }
@media (prefers-reduced-motion: reduce) {
  .charge-page.part, .charge-page.part .charge-boite, .charge-bulle { animation: none; }
}

/* Mon compte : onglets Profil / Securite, detaches des tuiles au-dessus et
   du contenu en dessous, en commutateur a deux positions. */
.onglets-compte {
  display: flex; width: fit-content; gap: 4px; margin: 1.6rem 0 1.2rem; padding: 4px;
  background: var(--bg-soft); border: 1px solid var(--bord); border-radius: 999px;
}
.onglets-compte .chip {
  border: 0; background: transparent; padding: .5rem 1.4rem; font-size: .9rem; font-weight: 600;
  text-align: center; color: var(--txt-soft);
}
.onglets-compte .chip:hover { background: rgba(255, 255, 255, .6); }
.onglets-compte .chip.actif { background: #fff; color: var(--prim); box-shadow: 0 1px 4px rgba(22, 48, 82, .12); }
@media (max-width: 640px) {
  .onglets-compte { width: 100%; margin: 1.4rem 0 1rem; }
  .onglets-compte .chip { flex: 1 1 0; }
}

/* ------------------------------------------------------------------ *
 * 29. Notifications                                                   *
 * ------------------------------------------------------------------ */
.notifs h2 { display: flex; align-items: center; gap: .5rem; }
.notifs h2 .ic { color: var(--prim); }
.notifs-etat { margin: .6rem 0 .4rem; }
.notifs-ok { display: flex; align-items: center; gap: .4rem; margin: 0 0 .4rem; font-weight: 650; color: var(--ok); }
.notifs-msg { margin: .5rem 0; }
.notifs-options { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--bord); display: grid; gap: .55rem; }
.notifs-options .btns { align-items: center; margin-top: .2rem; }

.invite-notifs {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.2rem; padding: 1rem 1.15rem;
  border-radius: var(--rayon); border: 1px solid color-mix(in srgb, var(--prim) 30%, transparent);
  background: linear-gradient(135deg, #e8f3ff 0%, #f6fbff 70%); box-shadow: var(--ombre-xs);
}
.invite-notifs[hidden] { display: none; }
.invite-notifs-ic {
  flex: 0 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  background: var(--prim); color: #fff; box-shadow: 0 6px 16px rgba(24, 117, 206, .3);
  animation: cloche 2.4s ease-in-out infinite;
}
@keyframes cloche { 0%, 60%, 100% { transform: rotate(0); } 65% { transform: rotate(12deg); } 75% { transform: rotate(-10deg); } 85% { transform: rotate(6deg); } }
.invite-notifs-texte { flex: 1 1 220px; min-width: 0; }
.invite-notifs h2 { margin: 0 0 .2rem; font-size: 1.05rem; }
.invite-notifs p { margin: 0; color: var(--txt-soft); font-size: .9rem; }
.invite-notifs-msg { margin-top: .4rem !important; font-weight: 600; color: var(--txt) !important; }
.invite-notifs-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.invite-notifs-actions[hidden] { display: none; }
.invite-notifs.fait .invite-notifs-ic { background: var(--ok); animation: none; }
@media (prefers-reduced-motion: reduce) { .invite-notifs-ic { animation: none; } }

/* ------------------------------------------------------------------ *
 * 30. Journal photo                                                   *
 * ------------------------------------------------------------------ */
.photo-envoi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.photo-envoi-choix { display: grid; gap: .7rem; }
.photo-deposer {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-height: 170px; padding: 1.2rem; text-align: center; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--prim) 45%, var(--bord)); border-radius: var(--rayon);
  background: var(--prim-clair); color: var(--txt);
}
.photo-deposer:hover, .photo-deposer:focus-within { border-color: var(--prim); background: #e3f0ff; }
.photo-deposer input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.photo-deposer-ic { color: var(--prim); }
.photo-deposer small { color: var(--txt-soft); font-size: .78rem; max-width: 34ch; }
.photo-apercus { display: flex; gap: .4rem; flex-wrap: wrap; }
.photo-apercus[hidden] { display: none; }
.photo-apercus img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--bord); }
.photo-envoi-champs { display: grid; gap: .2rem; }
.photo-envoi-champs .btns { align-items: center; }

.photo-mois { margin: 1.4rem 0 .6rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-soft); }
.photo-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .65rem; }
.photo-vignette {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 14px;
  background: var(--bg-soft); box-shadow: var(--ombre-xs); color: #fff;
}
.photo-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.photo-vignette:hover img { transform: scale(1.04); }
.photo-legende {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem .6rem .45rem; font-size: .76rem; font-weight: 600;
  background: linear-gradient(transparent, rgba(8, 22, 40, .72)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-vit {
  position: absolute; top: .4rem; right: .4rem; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: rgba(255, 255, 255, .9); color: var(--prim);
}
.photo-mode {
  position: sticky; top: calc(var(--barre-h) + .5rem); z-index: 30; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .6rem .9rem; border-radius: var(--rayon-s); background: var(--prim); color: #fff; font-weight: 600; box-shadow: var(--ombre);
}
.photo-mode[hidden] { display: none; }
.photo-mode .btn { margin-left: auto; }
body.choix-comparaison .photo-vignette { outline: 2px dashed color-mix(in srgb, var(--prim) 50%, transparent); outline-offset: 2px; }
body.choix-comparaison .photo-vignette.choisie { outline: 3px solid var(--prim); opacity: .55; }

.photo-visu {
  width: min(960px, 96vw); max-height: 94dvh; padding: 0; border: 0; border-radius: 18px; overflow: auto;
  background: #0d1a2b; color: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.photo-visu::backdrop { background: rgba(6, 16, 30, .78); backdrop-filter: blur(3px); }
.photo-visu img { display: block; width: 100%; max-height: 68dvh; object-fit: contain; background: #050c16; }
.photo-visu-fermer {
  position: absolute; top: .5rem; right: .5rem; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.photo-visu-bas { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; padding: .9rem 1rem 1rem; background: #fff; color: var(--txt); }
.photo-visu-form { flex: 1 1 420px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 .7rem; align-items: end; }
.photo-visu-form .coche, .photo-visu-form .btns { grid-column: 1 / -1; }
.photo-visu-form .btns { margin-top: .3rem; }
.photo-visu-bas > p { margin: 0; }

.comparer-carte { padding: .9rem; }
.comparer-tete { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .7rem; }
.comparer {
  --pos: 50%; position: relative; width: 100%; max-height: 72dvh; overflow: hidden; border-radius: 14px; background: #050c16;
  user-select: none; touch-action: pan-y;
}
.comparer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.comparer-haut { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.comparer-trait {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, .5); pointer-events: none;
}
.comparer-trait::after {
  content: "\2039\00a0\203A"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: var(--prim); font-weight: 800; font-size: 1rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.comparer-lib {
  position: absolute; top: .6rem; padding: .25rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: rgba(0, 0, 0, .55); color: #fff; pointer-events: none;
}
.comparer-lib.g { left: .6rem; }
.comparer-lib.d { right: .6rem; }
.comparer input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
}
.comparer-ecart { margin: .6rem 0 0; font-size: .85rem; }
.vit-photos { margin-bottom: 1.4rem; }

@media (max-width: 640px) {
  .photo-envoi { grid-template-columns: 1fr; }
  .photo-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .photo-visu-form { grid-template-columns: 1fr; }
  .photo-deposer { min-height: 140px; }
}

/* ------------------------------------------------------------------ *
 * 31. Vitrine : validite et partage                                   *
 * ------------------------------------------------------------------ */
.vit-validite { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin: .2rem 0 .6rem; font-size: .84rem; color: var(--txt-soft); }
.vit-duree { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; font-size: .86rem; }
.vit-duree select { width: auto; padding: .3rem 1.8rem .3rem .6rem; font-size: .86rem; }

/* Premier lancement de l'application : proposition d'activer les notifications.
   Reprend la fenetre animee de l'annonce de l'application. */
.invite-dialog .annonce-tel-ecran { justify-content: flex-start; padding-top: 22px; gap: .6rem; }
.invite-cloche {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
  background: var(--prim); color: #fff; box-shadow: 0 6px 14px rgba(24, 117, 206, .35);
  animation: annonce-icone .7s .9s cubic-bezier(.2, 1.6, .4, 1) both, cloche 2.4s 1.6s ease-in-out infinite;
}
.annonce-tel-ecran .invite-notif-exemple {
  width: 92px; padding: .3rem .35rem; border-radius: 8px; background: rgba(255, 255, 255, .92);
  font-size: .52rem; font-weight: 700; line-height: 1.25; text-align: left; color: var(--txt);
  box-shadow: 0 3px 8px rgba(22, 48, 82, .18);
  animation: invite-notif .5s 1.3s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes invite-notif { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.invite-msg { margin: .2rem 0 .8rem; padding: .55rem .7rem; border-radius: var(--rayon-s);
  background: var(--attn-bg); color: var(--txt); font-size: .86rem; }
.invite-dialog [data-invite-btns][hidden] { display: none; }
.invite-dialog.fait .invite-cloche { background: var(--ok); animation: none; }
@media (prefers-reduced-motion: reduce) {
  .invite-cloche, .annonce-tel-ecran .invite-notif-exemple { animation: none; }
}

/* Administration : adoption de l'application mobile */
.appli-resume { display: flex; align-items: center; gap: .9rem; }
.appli-resume img { flex: 0 0 auto; border-radius: 12px; box-shadow: 0 4px 10px rgba(24, 117, 206, .2); }
.col-appli { min-width: 150px; }
.col-appli .badge { vertical-align: middle; }

/* Administration : QR code de l'application pour les plaquettes */
.qr-carte { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.qr-visuel { flex: 0 0 auto; width: 170px; padding: 6px; border: 1px solid var(--bord); border-radius: 14px; background: #fff; }
.qr-visuel svg { display: block; width: 100%; height: auto; }
.qr-texte { flex: 1 1 300px; min-width: 0; }
.qr-lien { font-size: 1.25rem; font-weight: 800; margin: .3rem 0 .8rem; }
.qr-stats { margin: .7rem 0 0; }
@media (max-width: 640px) { .qr-visuel { width: 100%; max-width: 240px; margin: 0 auto; } }
