/* Comita — feuille de style unique (CLAUDE.md). Direction visuelle « Galets » : pop, couleurs franches,
   contours nets, galets qui tombent et rebondissent. Sans aucun code de la séduction (D6) :
   ni rose, ni cœur, ni swipe. Ni ombre portée, ni dégradé (docs/design-system.md).
   Trois mises en page : mobile (< 720 px, onglets en bas), tablette (720-1023 px, onglets en haut),
   ordinateur (≥ 1024 px, barre latérale et écrans en deux colonnes).
   Contrastes vérifiés dans les deux thèmes : php bin/outils/contrastes.php */

/* Polices hébergées localement : aucun appel à un tiers. Licences SIL OFL. */
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }

:root {
    --fond: #fff3d6;            /* crème */
    --surface: #ffffff;
    --surface-creuse: #ffe8ad;  /* crème soutenu */
    --trait: #17142b;           /* contours francs */
    --bord-doux: #ead9ad;       /* filet décoratif, jamais sur un champ */
    --bord: #6e6787;            /* contour de contrôle */
    --texte: #17142b;           /* encre */
    --texte-doux: #4a4560;
    --accent: #3b35a8;          /* indigo : actions et liens */
    --accent-survol: #2a2580;
    --accent-texte: #ffffff;
    --accent-doux: #e6e4ff;
    --soleil: #ffd23f;          /* jaune : toujours avec --sur-couleur dessus */
    --orange: #ff7a3d;          /* orange : toujours avec --sur-couleur dessus */
    --sur-couleur: #17142b;     /* texte sur soleil et orange, identique dans les deux thèmes */
    --succes: #2f6b3f;
    --succes-fond: #e3f2e6;
    --alerte: #a3243b;
    --alerte-fond: #fde7ea;
    --focus: #17142b;
    /* Galets : logo, illustrations et avatars */
    --pierre-1: #3b35a8;
    --pierre-2: #ff7a3d;
    --pierre-3: #17142b;
    --pierre-4: #ffd23f;

    --titre: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
    --rayon: 18px;
    --rayon-carte: 30px;
    --mesure: 640px;
    --cible: 48px;
    --barre: 76px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --fond: #17142b;
        --surface: #221e3d;
        --surface-creuse: #2c2750;
        --trait: #fff3d6;
        --bord-doux: #3a3466;
        --bord: #9b95c4;
        --texte: #fff3d6;
        --texte-doux: #cfc7e6;
        --accent: #a5a1ff;
        --accent-survol: #c4c1ff;
        --accent-texte: #17142b;
        --accent-doux: #2f2a5c;
        --succes: #8fd19e;
        --succes-fond: #1d3324;
        --alerte: #ff9fae;
        --alerte-fond: #3d1c2a;
        --focus: #ffd23f;
        --pierre-1: #a5a1ff;
        --pierre-3: #fff3d6;
        color-scheme: dark;
    }
}

/* =========================================================== Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh; /* iPhone : la hauteur réellement visible, barres de Safari comprises */
    background: var(--fond);
    color: var(--texte);
    font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 18px;
    line-height: 1.55;
}
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-survol); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--fond); }
.evitement { position: absolute; left: -9999px; }
.evitement:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 50; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sans-marge { margin: 0; }
.doux { color: var(--texte-doux); }
.centre { text-align: center; }
.pierre-1 { fill: var(--pierre-1); } .pierre-2 { fill: var(--pierre-2); } .pierre-3 { fill: var(--pierre-3); } .pierre-4 { fill: var(--pierre-4); }
.soleil { fill: var(--soleil); }

h1, h2, .titre { font-family: var(--titre); font-weight: 800; letter-spacing: -.025em; }
h1 { font-size: 2.2rem; line-height: 1; margin: .25rem 0 1rem; }
h2 { font-size: 1.4rem; line-height: 1.15; margin: 2rem 0 .75rem; }
.surtitre { margin: 0 0 .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* Galets qui tombent et rebondissent — coupés si l'on a demandé moins d'animations.
   Mouvement seulement, jamais de transparence : le contenu reste visible même si l'animation ne joue pas. */
@keyframes tomber { 0% { transform: translateY(-40px); } 70% { transform: translateY(3px); } 100% { transform: none; } }
@keyframes rebond { 0% { transform: scale(.7) rotate(-6deg); } 70% { transform: scale(1.05) rotate(1deg); } 100% { transform: none; } }
@keyframes entrer { from { transform: translateY(16px); } to { transform: none; } }
.tombe-1 { animation: tomber .55s ease-out .05s both; } .tombe-2 { animation: tomber .55s ease-out .25s both; }
.tombe-3 { animation: tomber .55s ease-out .45s both; } .tombe-4 { animation: tomber .55s ease-out .65s both; }
.rebondit { animation: rebond .5s ease-out both; }
.entre { animation: entrer .4s ease-out both; }

/* =========================================================== Coquille d'app */
.entete { background: var(--fond); }
.entete__interieur { display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem; }
.marque { display: inline-flex; align-items: center; gap: .5rem; min-height: var(--cible); margin-right: auto; color: var(--texte); text-decoration: none; font-family: var(--titre); font-weight: 800; font-size: 1.6rem; letter-spacing: -.03em; }
.marque svg { width: 30px; height: 34px; flex: none; }
.marque:hover { color: var(--texte); }

.nav { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav a { position: relative; display: flex; align-items: center; gap: .6rem; min-height: var(--cible); padding: 0 .9rem; border-radius: var(--rayon); text-decoration: none; color: var(--texte-doux); font-weight: 700; font-size: .95rem; }
.nav a:hover { color: var(--texte); background: var(--surface-creuse); }
.nav__icone { display: grid; place-items: center; flex: none; }
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav a[aria-current="page"] { color: var(--texte); }
.nav a[aria-current="page"] .nav__icone { background: var(--soleil); color: var(--sur-couleur); border: 2px solid var(--trait); border-radius: 999px; }
.pastille { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem; border-radius: 999px; background: var(--orange); color: var(--sur-couleur); border: 2px solid var(--trait); font-size: .75rem; font-weight: 800; }

main { min-width: 0; }
.contenu { max-width: calc(var(--mesure) + 2rem); margin: 0 auto; padding: 1rem 1rem 3rem; }
main:focus { outline: none; box-shadow: none; }

/* --- Mobile et tablette : onglets en bas, à portée de pouce --- */
@media (max-width: 1023px) {
    /* Clavier réellement ouvert (détecté par pwa.js) : la barre fixe disparaît, sinon elle remontait au milieu de l'écran.
       Un champ sélectionné sans clavier ne la masque pas. */
    .clavier-ouvert :is(.barre-onglets, .barre-equipe) { display: none; }
    html { scroll-padding-bottom: calc(var(--barre) + 1rem); }
    body.connecte { padding-bottom: calc(var(--barre) + env(safe-area-inset-bottom)); }
    .barre-onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--fond); border-top: 2px solid var(--trait); padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom)); }
    .nav li { flex: 1; }
    .nav a { flex-direction: column; justify-content: center; gap: .15rem; width: 100%; min-height: 62px; padding: .2rem; font-size: .78rem; }
    .nav a:hover { background: transparent; }
    .nav__icone { width: 52px; height: 32px; border: 2px solid transparent; }
    .nav .pastille { position: absolute; top: .1rem; left: calc(50% + .6rem); }
    .nav__secondaire { display: none; }
}
/* --- Tablette : la barre du bas s'élargit sans s'étirer --- */
@media (min-width: 720px) and (max-width: 1023px) {
    .barre-onglets .nav { max-width: 640px; margin: 0 auto; }
}
/* --- Ordinateur : barre latérale et écrans en deux colonnes --- */
@media (min-width: 1024px) {
    /* Barre latérale : seulement dans l'application connectée (.app), jamais sur les pages publiques */
    .app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
    .app .entete { position: sticky; top: 0; height: 100vh; border-right: 2px solid var(--trait); background: var(--surface-creuse); }
    .app .entete__interieur { flex-direction: column; align-items: stretch; height: 100%; padding: 1.5rem 1rem; gap: 2rem; }
    .app .marque { margin: 0 0 0 .4rem; font-size: 1.9rem; }
    .entete--public, .admin:not(.connecte) .entete { border-bottom: 2px solid var(--trait); }
    .entete--public .entete__interieur, .admin:not(.connecte) .entete__interieur { max-width: 1120px; margin: 0 auto; }
    .barre-onglets { display: flex; flex-direction: column; flex: 1; }
    .nav { flex-direction: column; gap: .35rem; }
    .nav a { padding: 0 .6rem; font-size: 1.05rem; min-height: 54px; border: 2px solid transparent; }
    .nav a:hover { background: var(--fond); }
    .nav a[aria-current="page"] { background: var(--fond); border-color: var(--trait); }
    .nav__icone { width: 44px; height: 34px; border: 2px solid transparent; }
    .nav .pastille { margin-left: auto; }
    .nav__secondaire { margin-top: auto; }
    .nav__secondaire a { font-weight: 400; }
    .contenu { max-width: 1120px; padding: 2.5rem 3rem 4rem; }
    .contenu--etroit { max-width: calc(var(--mesure) + 6rem); }
    h1 { font-size: 3rem; }
}

/* Une grille ne s'élargit jamais au contenu d'un tableau : c'est le tableau qui défile */
.grille-profil > * { min-width: 0; }

/* =========================================================== Menu de l'équipe (maquette A : sections) */
.menu-equipe { display: none; }
.menu-equipe ul, .barre-equipe ul, .tiroir-equipe ul { list-style: none; margin: 0; padding: 0; }
.menu-equipe svg, .barre-equipe svg, .tiroir-equipe svg, .carte-moi svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.menu-equipe__titre { margin: 1.1rem .75rem .35rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-doux); }
.menu__libelle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-equipe { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--soleil); color: var(--sur-couleur); border: 2px solid var(--trait); font-weight: 800; font-size: .9rem; }
.carte-moi__qui { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.carte-moi__qui > span:last-child { min-width: 0; }
.carte-moi__qui strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte-moi__qui strong + span { display: block; font-size: .85rem; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mobile et tablette : barre du bas (trois entrées + « Plus ») et tiroir */
.barre-equipe { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--fond); border-top: 2px solid var(--trait); padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom)); }
.barre-equipe ul { display: flex; max-width: 640px; margin: 0 auto; }
.barre-equipe li { flex: 1; min-width: 0; }
.barre-equipe a, .barre-equipe button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; width: 100%; min-height: 62px; padding: .2rem 0; border: 0; border-radius: var(--rayon); background: transparent; color: var(--texte-doux); font-size: .76rem; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.barre-equipe button:hover, .barre-equipe a:hover { background: transparent; color: var(--texte); }
.barre-equipe .nav__icone { width: 54px; height: 32px; border: 2px solid transparent; border-radius: 999px; }
.barre-equipe [aria-current="page"], .barre-equipe .actif { color: var(--texte); }
.barre-equipe [aria-current="page"] .nav__icone, .barre-equipe .actif .nav__icone { background: var(--soleil); color: var(--sur-couleur); border-color: var(--trait); }
.barre-equipe .menu__libelle { max-width: 100%; }
.barre-equipe .pastille { position: absolute; top: .1rem; left: calc(50% + .7rem); }
body.admin.connecte { padding-bottom: calc(var(--barre) + env(safe-area-inset-bottom)); }

.tiroir-equipe { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 640px; max-height: 88vh; margin: 0 auto; overflow-y: auto; padding: 1.1rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom)); border: 0; border-top: 2px solid var(--trait); border-radius: var(--rayon-carte) var(--rayon-carte) 0 0; background: var(--surface); color: var(--texte); }
.tiroir-equipe::backdrop { background: rgba(10, 8, 22, .6); }
.tiroir-equipe__entete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .4rem; }
.tiroir-equipe__fermer { padding-inline: 1.1rem; }
.tiroir-equipe .menu-equipe__titre { margin-inline: .2rem; }
.tiroir-equipe ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.tiroir-equipe a { display: flex; align-items: center; gap: .6rem; min-height: var(--cible); padding: 0 1rem 0 .6rem; border: 2px solid var(--bord); border-radius: var(--rayon); color: var(--texte); font-weight: 700; text-decoration: none; }
.tiroir-equipe a:hover { background: var(--surface-creuse); }
.tiroir-equipe a[aria-current="page"] { background: var(--fond); border-color: var(--trait); }
.tiroir-equipe a[aria-current="page"] .nav__icone { background: var(--soleil); color: var(--sur-couleur); border-color: var(--trait); }
.tiroir-equipe .nav__icone { width: 40px; height: 30px; border: 2px solid transparent; border-radius: 999px; }
.tiroir-equipe .pastille { margin-left: auto; }
@media (max-width: 519px) { .tiroir-equipe ul { grid-template-columns: minmax(0, 1fr); gap: .4rem; } }

/* Ordinateur : colonne rangée en sections, carte « vous » en bas */
@media (min-width: 1024px) {
    .admin .app { grid-template-columns: 292px minmax(0, 1fr); }
    body.admin.connecte { padding-bottom: 0; }
    .barre-equipe { display: none; }
    .admin .app .entete__interieur { gap: .75rem; padding: 1.4rem 1rem 1rem; }
    .menu-equipe { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; margin: 0 -.25rem; padding: 0 .25rem; }
    .menu-equipe__titre:first-child { margin-top: .4rem; }
    .menu-equipe ul { display: flex; flex-direction: column; gap: .15rem; }
    .menu-equipe a { display: flex; align-items: center; gap: .65rem; min-height: var(--cible); padding: 0 .9rem 0 .45rem; border: 2px solid transparent; border-radius: var(--rayon); color: var(--texte-doux); font-weight: 700; text-decoration: none; }
    .menu-equipe a:hover { color: var(--texte); background: var(--fond); }
    .menu-equipe a[aria-current="page"] { color: var(--texte); background: var(--fond); border-color: var(--trait); }
    .menu-equipe .nav__icone { width: 40px; height: 32px; border: 2px solid transparent; border-radius: 999px; }
    .menu-equipe a[aria-current="page"] .nav__icone { background: var(--soleil); color: var(--sur-couleur); border-color: var(--trait); }
    .menu-equipe .pastille { margin-left: auto; }
    .carte-moi { margin-top: auto; padding: 1rem .2rem 0; border-top: 2px solid var(--bord-doux); }
    .carte-moi__qui { margin: 0 .2rem .75rem; }
    .carte-moi__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
    .carte-moi__actions a { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--cible); padding: 0 .8rem; border: 2px solid var(--bord); border-radius: var(--rayon); color: var(--texte); font-weight: 700; font-size: .9rem; text-decoration: none; white-space: nowrap; }
    .carte-moi__actions a:hover { background: var(--fond); }
    .carte-moi__actions a[aria-current="page"] { background: var(--fond); border-color: var(--trait); }
    .carte-moi__actions svg { width: 18px; height: 18px; }
}

/* =========================================================== Ajouter à l'écran d'accueil */
.installation { margin-top: 1.5rem; display: grid; gap: 1rem; }
.installation[hidden] { display: none; }
.installation__entete { display: flex; align-items: flex-start; gap: .9rem; }
.installation__entete h2 { margin: 0 0 .2rem; }
.installation__icone img { display: block; width: 52px; height: 52px; border-radius: 14px; border: 2px solid var(--trait); }
.installation__etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; counter-reset: etape; }
.installation__etapes li { display: flex; align-items: center; gap: .8rem; }
.installation__pastille { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--trait); background: var(--surface-creuse); color: var(--texte); }
.installation__pastille svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.installation__pastille--texte { font-weight: 800; font-size: 1rem; }
.installation__masquer { justify-self: start; }

/* =========================================================== Accueil (déconnecté) */
.accueil { display: grid; }
.accueil__visuel { background: var(--soleil); display: grid; place-items: center; padding: 1rem 0 1.5rem; border-bottom: 2px solid var(--trait); }
.accueil__visuel > svg { width: 230px; height: 260px; }
.accueil__texte { padding: 1.75rem 1.4rem 2rem; display: flex; flex-direction: column; gap: 1rem; }
.accueil__texte h1 { font-size: 2.8rem; line-height: .95; margin: 0; letter-spacing: -.04em; }
.accroche { font-size: 1.15rem; margin: 0; }
.principes { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .6rem; }
.principes li { display: flex; gap: .9rem; align-items: flex-start; }
.principes svg { flex: none; width: 34px; height: 24px; margin-top: .15rem; }
.accueil__marque { display: none; }
@media (min-width: 1024px) {
    .accueil { grid-template-columns: 1fr 1fr; min-height: 100vh; }
    .accueil__visuel { border-bottom: 0; border-right: 2px solid var(--trait); position: relative; }
    .accueil__visuel > svg { width: 380px; height: 430px; }
    .accueil__marque { display: inline-flex; position: absolute; top: 2rem; left: 2.5rem; }
    .accueil__texte { justify-content: center; padding: 4rem 5rem; max-width: 720px; }
    .accueil__texte h1 { font-size: 4.4rem; }
}

/* =========================================================== Suggestion */
.ecran-suggestion { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1024px) { .ecran-suggestion { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 2.5rem; } }
.entete-ecran { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.entete-ecran h1 { margin: 0; }
.compteur { display: flex; gap: 6px; align-items: center; margin: 0; }
.compteur span { width: 22px; height: 14px; border-radius: 50%; border: 2px solid var(--trait); }
.compteur .servie { background: var(--trait); }

.carte { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); overflow: hidden; }
.carte--simple { padding: 1.4rem; margin: 1rem 0; }
.carte__haut { background: var(--soleil); color: var(--sur-couleur); padding: 1.25rem 1.25rem 1.1rem; display: flex; gap: 1rem; align-items: center; border-bottom: 2px solid var(--trait); }
.carte__haut h2 { margin: 0; font-size: 2.6rem; line-height: .95; letter-spacing: -.035em; }
.carte__haut p { margin: .3rem 0 0; font-weight: 700; }
.carte__corps { padding: 1.2rem 1.2rem 0; }
.carte__corps > :first-child { margin-top: 0; }
.carte__actions { padding: 1rem 1.2rem 1.2rem; display: grid; gap: .5rem; margin: 0; }

/* Avatar illustré : galets et initiale, jamais de photo (D7) */
.avatar { flex: none; width: 92px; height: 92px; }
.avatar text { font-family: var(--titre); font-weight: 800; }
.avatar--petit { width: 52px; height: 52px; }

.communs { list-style: none; margin: .5rem 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.communs li { border-radius: 999px; padding: .4rem .9rem; font-weight: 700; font-size: .95rem; border: 2px solid var(--trait); }
.communs li:nth-child(4n+1) { background: var(--orange); color: var(--sur-couleur); transform: rotate(-1.5deg); }
.communs li:nth-child(4n+2) { background: var(--accent); color: var(--accent-texte); transform: rotate(1deg); }
.communs li:nth-child(4n+3) { background: var(--soleil); color: var(--sur-couleur); }
.communs li:nth-child(4n) { background: var(--surface-creuse); color: var(--texte); transform: rotate(-.5deg); }
.citation { font-size: 1.05rem; background: var(--fond); border-radius: var(--rayon); padding: .8rem 1rem; margin: 0 0 1rem; }
.etiquettes { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .5rem 0 1rem; }
.etiquettes li { border: 1px solid var(--bord); border-radius: 999px; padding: .15rem .75rem; font-size: .95rem; }
.etiquettes li.partagee { background: var(--accent-doux); border: 2px solid var(--accent); font-weight: 700; }
.legende { font-size: .9rem; color: var(--texte-doux); margin: -.5rem 0 1rem; }
.etiquette-exemple { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 999px; background: var(--accent-doux); border: 2px solid var(--accent); font-size: .75rem; font-weight: 700; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .1rem .7rem; font-size: .88rem; font-weight: 700; color: var(--succes); background: var(--succes-fond); }
.badge::before { content: "✓"; }

/* Panneau de détail : à côté de la carte sur ordinateur, dessous sur mobile */
.panneau { display: grid; gap: 1rem; }
.panneau__bloc { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); padding: 1.25rem 1.4rem; }
.panneau__bloc h2 { margin: 0 0 .75rem; font-size: 1.3rem; }
.panneau__bloc > :last-child { margin-bottom: 0; }
.raisons { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.raisons li { display: flex; gap: .75rem; align-items: flex-start; }
.raisons svg { flex: none; width: 26px; height: 18px; margin-top: .2rem; }
.elargissement { background: var(--accent-doux); }

/* =========================================================== Écrans d'attente : jamais vides */
.attente { display: grid; justify-items: center; text-align: center; gap: 1rem; padding: 2rem 1.25rem; background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); }
.attente svg { width: 150px; height: 170px; }
.attente h2 { margin: 0; }
.attente p { margin: 0; max-width: 32rem; }
.attente .actions { justify-content: center; margin: .5rem 0 0; }

/* =========================================================== Encarts */
.message-flash, .encart { border-radius: var(--rayon); padding: .9rem 1.1rem; margin: 1rem 0; border: 2px solid var(--succes); background: var(--succes-fond); }
.encart--info { border-color: var(--bord); background: var(--surface-creuse); }
.encart--alerte { border-color: var(--alerte); background: var(--alerte-fond); }
.encart--alerte a { color: var(--alerte); font-weight: 700; }
.encart > p:first-child { margin-top: 0; }
.encart > p:last-child { margin-bottom: 0; }

/* =========================================================== Boutons — jamais en pilule */
.bouton, button {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: var(--cible); padding: .55rem 1.5rem;
    white-space: nowrap; flex-shrink: 0;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; /* dernier recours : jamais plus large que son conteneur (l'audit signale toute coupure) */
    font: inherit; font-weight: 700; line-height: 1.2; text-align: center;
    border-radius: var(--rayon); border: 2px solid var(--trait);
    background: var(--accent); color: var(--accent-texte);
    cursor: pointer; text-decoration: none;
}
.bouton:hover, button:hover { background: var(--accent-survol); color: var(--accent-texte); }
.bouton--fort { min-height: 60px; font-family: var(--titre); font-weight: 800; font-size: 1.2rem; }
.bouton--secondaire { background: var(--surface); color: var(--texte); }
.bouton--secondaire:hover { background: var(--surface-creuse); color: var(--texte); }
.bouton--discret { background: transparent; color: var(--texte); border-color: transparent; text-decoration: underline; }
.bouton--discret:hover { background: var(--surface-creuse); color: var(--texte); }
.bouton--destructif { background: var(--surface); color: var(--alerte); border-color: var(--alerte); }
.bouton--destructif:hover { background: var(--alerte-fond); color: var(--alerte); }
.bouton-plein { width: 100%; white-space: normal; }
.bouton svg, button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0; }
.actions form { margin: 0; }
.actions--pile { flex-direction: column; }
.retour { display: inline-flex; align-items: center; min-height: var(--cible); font-weight: 700; color: var(--texte); text-decoration: none; }
.retour:hover { color: var(--accent); }

/* =========================================================== Formulaires */
form .champ { margin: 0 0 1.5rem; }
label, legend { font-weight: 700; display: block; margin-bottom: .4rem; }
fieldset { border: 2px solid var(--trait); border-radius: var(--rayon-carte); padding: 1.1rem 1.2rem .7rem; margin: 0 0 1.25rem; background: var(--surface); min-width: 0; }
legend { padding: 0 .4rem; font-family: var(--titre); font-weight: 800; font-size: 1.15rem; }
input[type="text"], input[type="number"], input[type="tel"], input[type="password"], input[type="date"], input[type="email"], input[type="url"], select, textarea {
    width: 100%; min-height: 56px; padding: .6rem 1rem;
    font: inherit; color: var(--texte); background: var(--surface);
    border: 2px solid var(--bord); border-radius: var(--rayon);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--trait); }
textarea { min-height: 7rem; }
input[readonly] { background: var(--surface-creuse); color: var(--texte); }
.choix { display: flex; align-items: center; gap: .75rem; min-height: 56px; padding: .5rem .9rem; margin: 0 0 .5rem; font-weight: 400; border: 2px solid var(--bord); border-radius: var(--rayon); background: var(--surface); cursor: pointer; color: var(--texte); text-decoration: none; }
.choix:hover { border-color: var(--trait); color: var(--texte); }
.choix:has(input:checked) { border-color: var(--trait); background: var(--soleil); color: var(--sur-couleur); font-weight: 700; }
.choix:has(input:checked) .doux { color: var(--sur-couleur); }
.choix input { width: 1.4rem; height: 1.4rem; margin: 0; flex: none; accent-color: var(--accent); }
.choix--lien { justify-content: space-between; font-weight: 700; }
.choix--variante { margin-left: 1.25rem; }
.choix-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.choix-grille legend { grid-column: 1 / -1; }
.choix-grille .choix { margin: 0; }
.liste-choix { list-style: none; padding: 0; margin: 0 0 1rem; }
.aide { color: var(--texte-doux); margin: .1rem 0 .6rem; }
.erreur { color: var(--alerte); font-weight: 700; margin: .25rem 0 .5rem; }
.erreur ul { margin: 0; padding-left: 1.2rem; }

/* Pas à pas : une question par écran, progression en galets */
.pas-a-pas__haut { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.progression { display: flex; align-items: center; gap: .6rem; margin: 0; font-weight: 700; }
.progression__pierres { display: flex; gap: 4px; }
.progression__pierre { width: 20px; height: 13px; border-radius: 50%; border: 2px solid var(--trait); }
.progression__pierre.faite { background: var(--orange); }
.question { font-size: 2.1rem; }
.pas-a-pas__bas { display: grid; gap: .5rem; margin-top: 1.5rem; }
/* Le bouton reste dans la page, sous le champ : un bouton collé en bas flottait au milieu de l'écran
   sur iPhone, clavier ouvert, et masquait les champs pendant le défilement. */

/* Parcours d'inscription : une étape à la fois, sans la barre de navigation */
.parcours .barre-onglets { display: none; }
body.parcours.connecte { padding-bottom: 2rem; }
.celebration { text-align: center; display: grid; justify-items: center; gap: .5rem; padding: 1rem 0; }
.celebration svg { width: 140px; height: 160px; }
.formulaire-court { max-width: 440px; }

/* Connexion : formulaire seul sur mobile, à côté d'un visuel sur ordinateur */
.ecran-partage { display: grid; gap: 1.5rem; }
.ecran-partage__visuel { display: none; }
@media (min-width: 1024px) {
    .ecran-partage { grid-template-columns: 1fr 1fr; align-items: center; min-height: 70vh; }
    .ecran-partage__visuel { display: grid; place-items: center; background: var(--soleil); border: 2px solid var(--trait); border-radius: var(--rayon-carte); min-height: 480px; }
    .ecran-partage__visuel svg { width: 260px; height: 300px; }
}

/* =========================================================== Profil */
.grille-profil { display: grid; gap: 1rem; }
@media (min-width: 1024px) { .grille-profil { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; } .grille-profil .large { grid-column: 1 / -1; } }
.bloc { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); padding: 1.25rem 1.4rem; }
.bloc h2 { margin: 0 0 .5rem; font-size: 1.3rem; }
.bloc .actions { margin-bottom: 0; }
.identite { display: flex; gap: 1rem; align-items: center; }
.identite h2 { margin: 0; font-size: 2rem; }

/* =========================================================== Messages : deux volets sur ordinateur */
.messagerie { display: grid; gap: 1rem; }
.messagerie__liste { display: none; }
@media (min-width: 1024px) {
    .messagerie { grid-template-columns: 320px minmax(0, 1fr); gap: 2rem; align-items: start; }
    .messagerie__liste { display: block; position: sticky; top: 2rem; }
    .messagerie__liste h2 { margin-top: 0; }
}
.liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.ligne { display: flex; align-items: center; gap: .9rem; padding: .75rem 1rem; background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); color: var(--texte); text-decoration: none; min-height: 76px; }
.ligne:hover { background: var(--surface-creuse); color: var(--texte); }
.ligne[aria-current="page"] { background: var(--soleil); color: var(--sur-couleur); }
.ligne[aria-current="page"] .horodatage { color: var(--sur-couleur); }
.ligne strong { display: block; font-family: var(--titre); font-weight: 800; font-size: 1.2rem; }

.entete-conversation { display: flex; align-items: center; gap: .9rem; margin: 0 0 .75rem; }
.entete-conversation h1, .entete-conversation h2 { margin: 0; font-size: 1.9rem; }
.options { margin-left: auto; position: relative; }
.options summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; min-height: var(--cible); padding: 0 .9rem; border: 2px solid var(--trait); border-radius: var(--rayon); background: var(--surface); font-weight: 700; cursor: pointer; }
.options summary::-webkit-details-marker { display: none; }
.options[open] summary { background: var(--surface-creuse); }
.options__menu { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; width: 17rem; background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon); padding: .5rem; display: grid; gap: .4rem; }
.options__menu .bouton, .options__menu button { width: 100%; justify-content: flex-start; }
.repli { margin: 0 0 1rem; }
.repli summary { cursor: pointer; font-weight: 700; color: var(--texte-doux); min-height: var(--cible); display: flex; align-items: center; }

.fil { list-style: none; padding: 0; margin: 1rem 0; }
.fil li { margin: .6rem 0; max-width: 80%; }
.fil .moi { margin-left: auto; text-align: right; }
.fil .jour { max-width: none; text-align: center; margin: 1.25rem 0 .5rem; font-size: .85rem; font-weight: 700; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .08em; }
.bulle { display: inline-block; text-align: left; background: var(--surface); border: 2px solid var(--trait); border-radius: 22px 22px 22px 6px; padding: .6rem 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.moi .bulle { background: var(--accent); color: var(--accent-texte); border-radius: 22px 22px 6px 22px; }
.horodatage { display: block; font-size: .85rem; color: var(--texte-doux); margin: 0 .25rem .15rem; }
.saisie { position: sticky; bottom: 0; background: var(--fond); padding: .75rem 0 .5rem; border-top: 2px solid var(--trait); }
@media (max-width: 719px) { .saisie { bottom: calc(var(--barre) + env(safe-area-inset-bottom)); } }
.composer { display: flex; gap: .5rem; align-items: flex-end; }
.composer textarea { min-height: 56px; height: 56px; resize: vertical; }

/* =========================================================== Tableaux et code (/doc) */
table { border-collapse: collapse; width: 100%; margin-bottom: 1.5rem; }
th, td { text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--bord-doux); }
th { font-weight: 700; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-creuse); color: var(--texte); border-radius: 6px; }
code { padding: .1rem .3rem; overflow-wrap: anywhere; }
pre { padding: .75rem; overflow-x: auto; }
pre code { padding: 0; background: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Avatars : teinte stable par compte, initiale toujours contrastée sur son galet */
.avatar__grand { stroke: var(--trait); stroke-width: 3; }
.avatar__petit { stroke: var(--trait); stroke-width: 3; }
.avatar--1 .avatar__grand { fill: var(--accent); } .avatar--1 text { fill: var(--accent-texte); } .avatar--1 .avatar__petit { fill: var(--orange); }
.avatar--2 .avatar__grand { fill: var(--orange); } .avatar--2 text { fill: var(--sur-couleur); } .avatar--2 .avatar__petit { fill: var(--accent); }
.avatar--3 .avatar__grand { fill: var(--trait); } .avatar--3 text { fill: var(--fond); } .avatar--3 .avatar__petit { fill: var(--soleil); }
.avatar--4 .avatar__grand { fill: var(--soleil); } .avatar--4 text { fill: var(--sur-couleur); } .avatar--4 .avatar__petit { fill: var(--orange); }
@media (min-width: 1024px) { .sans-entete .entete--public { display: none; } }
@media (max-width: 719px) { h1 { font-size: 1.9rem; } .entete-ecran h1 { font-size: 1.6rem; } }
@media (min-width: 1024px) { .messagerie .retour { display: none; } }
.demo { border-style: dashed; display: grid; gap: .6rem; }
.demo .surtitre, .demo label { margin: 0; }

/* =========================================================== Groupes */
.groupe { margin: 1.5rem 0 2rem; }
.groupe__entete { display: flex; gap: .9rem; align-items: center; margin-bottom: .9rem; }
.groupe__entete svg { width: 42px; height: 30px; flex: none; }
.groupe__entete h2 { margin: 0; }
.sujets { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.sujet { display: grid; gap: .2rem; height: 100%; padding: 1rem 1.1rem; background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); color: var(--texte); text-decoration: none; }
.sujet:hover { background: var(--soleil); color: var(--sur-couleur); }
.sujet:hover .doux, .sujet:hover .sujet__compte { color: var(--sur-couleur); }
.sujet strong { font-family: var(--titre); font-weight: 800; font-size: 1.2rem; }
.sujet__compte { margin-top: .4rem; font-size: .9rem; font-weight: 700; color: var(--accent); }
.ligne--discussion { min-height: 64px; }
.contributions { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .75rem; }
.contribution { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); padding: 1rem 1.2rem; }
.contribution--question { background: var(--surface-creuse); }
.contribution__auteur { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.contribution__auteur .horodatage { display: inline; margin-left: .5rem; }
.contribution__texte { white-space: pre-wrap; overflow-wrap: anywhere; }
.contribution__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.contribution__actions form { margin: 0; }
.recherche-ville { margin: 1rem 0 0; }

/* Messagerie : une colonne de grille ne doit jamais s'élargir au contenu (débordement sur mobile) */
.messagerie { grid-template-columns: minmax(0, 1fr); }
.messagerie > * { min-width: 0; }
@media (min-width: 1024px) { .messagerie { grid-template-columns: 320px minmax(0, 1fr); } }
.repli summary { gap: .5rem; }
.repli summary::-webkit-details-marker { display: none; }
.repli summary::before { content: "›"; display: inline-block; font-size: 1.3em; line-height: 1; transition: transform .15s; }
.repli[open] summary::before { transform: rotate(90deg); }
.repli p { margin: 0 0 .5rem; padding: .8rem 1rem; background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon); }

/* =========================================================== Appel vidéo */
.garanties { margin: 1rem 0 1.25rem; }
.ecran-video { position: relative; background: var(--sur-couleur); border: 2px solid var(--trait); border-radius: var(--rayon-carte); overflow: hidden; aspect-ratio: 3 / 4; max-height: 70vh; width: 100%; }
@media (min-width: 720px) { .ecran-video { aspect-ratio: 16 / 10; } }
#video-distante { width: 100%; height: 100%; object-fit: cover; display: block; }
#video-locale { position: absolute; right: .75rem; bottom: .75rem; width: 30%; max-width: 180px; aspect-ratio: 3 / 4; object-fit: cover; border: 2px solid var(--soleil); border-radius: var(--rayon); transform: scaleX(-1); background: var(--sur-couleur); }
.statut-appel { font-weight: 700; text-align: center; margin: .75rem 0; min-height: 1.6em; }
.bouton--appel { white-space: nowrap; }
.appel-entrant { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; justify-content: space-between; background: var(--soleil); color: var(--sur-couleur); border: 2px solid var(--trait); border-radius: var(--rayon-carte); padding: .9rem 1.1rem; margin: 0 0 1rem; }
.appel-entrant p { margin: 0; font-weight: 800; font-family: var(--titre); font-size: 1.2rem; }
@media (prefers-reduced-motion: no-preference) { .appel-entrant:not([hidden]) { animation: rebond .5s ease-out both; } }
.appel-entrant[hidden] { display: none; }
/* Écran d'appel : vert pour décrocher, rouge pour raccrocher (texte blanc : 5,4:1 et 6,6:1 ; contour --trait pour le fond) */
.ecran-appel__qui { display: grid; justify-items: center; gap: .5rem; text-align: center; padding: 1.5rem 0 1rem; }
.ecran-appel__qui h1 { margin: .6rem 0 0; font-size: 2rem; }
.ecran-appel__qui .doux { margin: 0; }
.commandes-appel { display: flex; justify-content: center; align-items: flex-start; gap: 1.5rem; margin: 1.75rem 0 1rem; }
.commande-appel__libelle { white-space: nowrap; }
.commande-appel { display: flex; flex-direction: column; align-items: center; gap: .45rem; min-height: 0; padding: 0; border: 0; background: none; color: var(--texte); font-size: .95rem; font-weight: 700; text-decoration: none; max-width: none; overflow: visible; }
.commande-appel:hover { background: none; color: var(--texte); }
.commande-appel__rond { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; border: 2px solid var(--trait); background: var(--surface); color: var(--texte); }
.commande-appel__rond svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.commande-appel--decrocher .commande-appel__rond { background: #1d7a3a; color: #ffffff; }
.commande-appel--raccrocher .commande-appel__rond { background: #b42318; color: #ffffff; }
.commande-appel--raccrocher svg { transform: rotate(135deg); }
.commande-appel[aria-pressed="true"] .commande-appel__rond { background: var(--soleil); color: var(--sur-couleur); }
.commande-appel:hover .commande-appel__rond { filter: brightness(1.1); }
.commande-appel:focus-visible { outline: none; }
.commande-appel:focus-visible .commande-appel__rond { outline: 3px solid var(--focus); outline-offset: 3px; }
.commande-appel[disabled] { opacity: .6; }
/* Écran d'appel vocal : l'interlocuteur et la durée, comme un appel téléphonique */
.appel-vocal { display: grid; justify-items: center; gap: .4rem; padding: 2.5rem 1rem 1.5rem; text-align: center; }
.appel-vocal[hidden], .ecran-video[hidden] { display: none; }
.appel-vocal .avatar, .appel-vocal .pastille-equipe { transform: scale(1.8); margin-bottom: 1.4rem; }
.appel-vocal__nom { margin: 0; font-family: var(--titre); font-weight: 800; font-size: 1.9rem; }
.appel-vocal__duree { margin: 0; font-variant-numeric: tabular-nums; font-size: 1.2rem; color: var(--texte-doux); }
/* Bandeau partout : fixé en haut de l'écran, au-dessus du contenu */
.appel-entrant--partout { position: fixed; top: calc(.6rem + env(safe-area-inset-top)); left: .6rem; right: .6rem; z-index: 60; margin: 0; max-width: 640px; margin-inline: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.appels { display: flex; gap: .4rem; margin-left: auto; }
.appels + .options { margin-left: 0; }
.bouton-icone { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-width: 56px; min-height: 56px; padding: .3rem .85rem; border: 2px solid var(--trait); border-radius: var(--rayon); background: var(--surface); color: var(--texte); text-decoration: none; font-size: .78rem; font-weight: 700; }
.bouton-icone:hover { background: var(--soleil); color: var(--sur-couleur); }
.bouton-icone svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* L'attribut hidden cache toujours, quelle que soit la règle d'affichage d'une classe */
[hidden] { display: none !important; }
.entete-conversation { flex-wrap: wrap; row-gap: .6rem; }
.entete-conversation h1 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 719px) { .appels { margin-left: 0; } .entete-conversation .appels, .entete-conversation .options { flex: none; } }
@media (max-width: 719px) {
    .entete-conversation h1 { flex-basis: calc(100% - 80px); }
    .entete-conversation .options summary { min-height: 56px; }
}
.proposer-appel { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0 .5rem; }
.proposer-appel .bouton-icone { flex-direction: row; gap: .45rem; font-size: .9rem; padding: .3rem .8rem; min-height: var(--cible); background: var(--surface); color: var(--texte); }
.proposer-appel .bouton-icone:hover { background: var(--soleil); color: var(--sur-couleur); }

/* =========================================================== Espace équipe */
.etiquette-equipe { display: inline-block; vertical-align: middle; margin-left: .3rem; padding: 0 .5rem; border-radius: 999px; background: var(--accent); color: var(--accent-texte); font-family: "Atkinson Hyperlegible", system-ui, sans-serif; font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
@media (min-width: 1024px) { .contenu--admin { max-width: 1240px; } }
.onglets-vue { display: flex; flex-wrap: wrap; gap: .4rem; }
.onglets-vue a { display: inline-flex; align-items: center; min-height: var(--cible); padding: 0 1.25rem; white-space: nowrap; border: 2px solid var(--trait); border-radius: var(--rayon); color: var(--texte); text-decoration: none; font-weight: 700; }
.onglets-vue a[aria-current="page"] { background: var(--soleil); color: var(--sur-couleur); }
.tableau-defilant { position: relative; overflow-x: auto; border: 2px solid var(--trait); border-radius: var(--rayon); background: var(--surface); }
.tableau-admin { margin: 0; min-width: 640px; }
.tableau-admin th { background: var(--surface-creuse); font-size: .9rem; }
.tableau-admin th, .tableau-admin td { padding: .7rem .9rem; }
.tableau-admin tbody tr:hover { background: var(--fond); }
.tableau-admin .nombre { text-align: right; font-variant-numeric: tabular-nums; }
/* Statut : toujours une icône et un texte, jamais la couleur seule */
.statut { display: inline-flex; align-items: center; gap: .3rem; margin: .1rem .3rem .1rem 0; padding: .05rem .6rem; border: 1px solid var(--bord); border-radius: 999px; font-size: .85rem; font-weight: 700; color: var(--texte); background: var(--surface-creuse); white-space: nowrap; }
.statut--critique { border-color: var(--alerte); color: var(--alerte); background: var(--alerte-fond); }
.statut--retard, .statut--attention { border-color: var(--trait); color: var(--sur-couleur); background: var(--soleil); }
.statut--ok { border-color: var(--succes); color: var(--succes); background: var(--succes-fond); }
.statut--neutre { color: var(--texte-doux); }
.fil--admin li { max-width: 100%; }
.fil--admin .signale .bulle { border-color: var(--alerte); border-width: 3px; }
.liste-simple { margin: 0; padding-left: 1.2rem; }
.grille-reglages { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
/* Tuiles d'indicateurs : le chiffre en grand, le contexte en clair, le statut en texte */
.tuiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); margin: 1rem 0 2rem; }
.tuile { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); padding: 1.1rem 1.25rem; display: grid; align-content: start; gap: .35rem; }
.tuile__titre { margin: 0; font-size: 1rem; font-family: "Atkinson Hyperlegible", system-ui, sans-serif; font-weight: 700; letter-spacing: 0; color: var(--texte-doux); }
.tuile__valeur { margin: 0; font-family: var(--titre); font-weight: 800; font-size: 3rem; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tuile__unite { font-size: 1.4rem; margin-left: .15rem; }
.tuile__contexte { margin: 0; color: var(--texte-doux); font-size: .92rem; }
.tuile .statut { justify-self: start; margin-top: .3rem; }
.sujets-admin { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .5rem; }
.sujets-admin > li { border: 2px solid var(--trait); border-radius: var(--rayon); background: var(--fond); }
.sujets-admin > li.archive { border-style: dashed; }
.sujets-admin summary { display: flex; align-items: center; gap: .6rem; min-height: var(--cible); padding: .6rem .9rem; cursor: pointer; list-style: none; }
.sujets-admin summary::-webkit-details-marker { display: none; }
.sujets-admin summary::before { content: "›"; font-size: 1.3em; line-height: 1; transition: transform .15s; }
.sujets-admin details[open] summary::before { transform: rotate(90deg); }
.sujet-edition { padding: 0 .9rem .9rem; }
.sujet-edition .actions { margin: .5rem 0 0; }
.sujet-nouveau { border-top: 2px solid var(--bord-doux); padding-top: 1rem; }
.sujet-nouveau h3 { margin: 0 0 .75rem; font-family: var(--titre); font-weight: 800; }
.ligne-action { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0; }
.ligne-action select { width: auto; min-height: var(--cible); }
.mdp { font-size: 1.15rem; font-weight: 700; letter-spacing: .05em; }
.formulaire-equipe { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); align-items: end; }
.formulaire-equipe button { margin-bottom: 1.5rem; }
.formulaire-equipe .aide { grid-column: 1 / -1; margin-top: -1rem; }

/* =========================================================== Groupes : forum questions-réponses */
.question-forum { background: var(--surface-creuse); border: 2px solid var(--trait); border-radius: var(--rayon-carte); padding: 1.2rem 1.3rem; margin: .5rem 0 1rem; }
.question-forum h1 { margin: 0 0 .9rem; font-size: 1.9rem; }
.reponses { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .75rem; counter-reset: reponse; }
.reponse { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); padding: 1rem 1.2rem; }
.contribution__entete { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; margin-bottom: .6rem; }
.contribution__texte { white-space: pre-wrap; overflow-wrap: anywhere; }
.compte-reponses { flex: none; display: grid; place-items: center; min-width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-texte); font-family: var(--titre); font-weight: 800; }
.compte-reponses--zero { background: var(--surface-creuse); color: var(--texte); border: 2px solid var(--trait); }
.repondre h2 { margin: 1.5rem 0 .5rem; }
.repondre label { display: inline; margin: 0; font: inherit; }

/* Clic sur la personne : un menu d'actions, pas un profil */
.personne { position: relative; display: inline-block; }
.personne > summary, .personne--moi { display: inline-flex; align-items: center; gap: .55rem; min-height: var(--cible); padding: .2rem .7rem .2rem .3rem; border-radius: 999px; list-style: none; }
.personne > summary { cursor: pointer; border: 2px solid transparent; }
.personne > summary::-webkit-details-marker { display: none; }
.personne > summary:hover, .personne[open] > summary { border-color: var(--trait); background: var(--soleil); color: var(--sur-couleur); }
.personne__fleche { font-size: .8em; }
.personne__menu { position: absolute; left: 0; top: calc(100% + .35rem); z-index: 20; width: min(20rem, 85vw); display: grid; gap: .5rem; padding: .75rem; background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon); }
.appels form { margin: 0; }
.bouton-icone--a-proposer { border-style: dashed; }
/* Mobile : téléphone et caméra sur la ligne du nom, « Options » en dessous */
@media (max-width: 719px) {
    .entete-conversation h1 { flex: 1 1 0; flex-basis: 0; }
    .entete-conversation .appels { order: 2; }
    .entete-conversation .options { order: 3; flex: 1 1 100%; margin-left: 0; }
    .entete-conversation .options summary { min-height: var(--cible); }
}
/* Pastilles d'état sur les icônes d'appel : horloge (en attente), croix (refusé) */
.bouton-icone { position: relative; }
.pastille-etat { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--trait); }
.pastille-etat svg { width: 14px; height: 14px; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pastille-etat--attente { background: var(--soleil); }
.pastille-etat--attente svg { stroke: var(--sur-couleur); }
.pastille-etat--refus { background: var(--alerte); }
.pastille-etat--refus svg { stroke: var(--fond); }
/* Réponse à un message précis : citation et lien « Répondre » */
.repondre-a { display: inline-flex; align-items: center; min-height: var(--cible); margin-top: .4rem; font-weight: 700; }
.citation-forum { display: grid; gap: .15rem; margin: 0 0 .6rem; padding: .5rem .8rem; border-left: 4px solid var(--accent); background: var(--fond); border-radius: 4px var(--rayon) var(--rayon) 4px; color: var(--texte); text-decoration: none; }
a.citation-forum:hover { background: var(--surface-creuse); color: var(--texte); }
.citation-forum__qui { font-size: .85rem; font-weight: 700; color: var(--texte-doux); }
.citation-forum__extrait { font-size: .95rem; color: var(--texte-doux); font-style: italic; overflow-wrap: anywhere; }
.citation-forum--formulaire { margin-bottom: 1rem; }
.reponse:target, .question-forum:target { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Fil : les réponses à un message se placent dessous, en retrait (un seul niveau) */
.sous-reponses { list-style: none; margin: .9rem 0 0; padding: 0 0 0 1rem; border-left: 3px solid var(--bord-doux); display: grid; gap: .6rem; }
.sous-reponse { background: var(--fond); border: 1px solid var(--bord-doux); border-radius: var(--rayon); padding: .8rem 1rem; }
.sous-reponse:target { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (min-width: 720px) { .sous-reponses { padding-left: 1.5rem; } }
.choix svg { width: 22px; height: 22px; margin-right: .4rem; vertical-align: -5px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Menus dépliants : un bouton « Fermer » toujours visible */
.menu__haut { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-bottom: .4rem; border-bottom: 1px solid var(--bord-doux); }
.menu__titre { font-family: var(--titre); font-weight: 800; }
.fermer-menu { min-height: var(--cible); padding: .2rem .7rem; background: var(--surface); color: var(--texte); border: 2px solid var(--trait); font-size: .9rem; }
.fermer-menu:hover { background: var(--surface-creuse); color: var(--texte); }
.options__menu .fermer-menu { width: auto; justify-content: center; }
/* Nom cliquable dans la conversation : mène à la fiche */
.nom-lien a { display: inline-flex; align-items: center; gap: .6rem; min-height: var(--cible); color: var(--texte); text-decoration: none; border-radius: var(--rayon); padding-right: .4rem; }
.nom-lien a:hover span { text-decoration: underline; text-underline-offset: .15em; }
.accueil__marque svg { width: 30px; height: 34px; }

/* Espace équipe : modération des groupes */
.messages-admin { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .75rem; }
.message-admin { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon); padding: .9rem 1.1rem; }
.message-admin--retire { border-style: dashed; border-color: var(--alerte); background: var(--alerte-fond); }
.message-admin__entete { margin: 0 0 .4rem; display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.message-admin__entete .horodatage { display: inline; }
.message-admin__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.message-admin__actions input[type="text"] { flex: 1 1 14rem; width: auto; }
.filtres { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); align-items: end; }
.filtres button { margin-bottom: 1.5rem; }

/* Inscription : charte standard et FALC */
.charte { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); padding: 1rem 1.3rem; margin: 0 0 1.25rem; max-height: 60vh; overflow-y: auto; }
.charte h2 { font-size: 1.15rem; margin: 1.25rem 0 .4rem; }
.charte h2:first-child { margin-top: .25rem; }
.charte ul { padding-left: 1.2rem; }
.charte li { margin: .35rem 0; }
.charte--falc { font-size: 1.1rem; line-height: 1.8; }
.charte--falc p { margin: 0 0 .9rem; }
.bascule-version { margin: 0 0 1rem; font-weight: 700; }
.code-invitation { margin: .2rem 0 .5rem; font-family: var(--titre); font-weight: 800; font-size: 2.2rem; letter-spacing: .08em; }
/* Recherche dans les groupes */
.recherche-groupes { margin: 1rem 0 1.5rem; }
.recherche-groupes input[type="search"] { width: 100%; min-height: 56px; padding: .6rem 1rem; font: inherit; color: var(--texte); background: var(--surface); border: 2px solid var(--bord); border-radius: var(--rayon); }
.resultat { display: grid; gap: .25rem; padding: .9rem 1.1rem; background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon-carte); color: var(--texte); text-decoration: none; }
.resultat:hover { background: var(--surface-creuse); color: var(--texte); }
.resultat strong { font-family: var(--titre); font-weight: 800; font-size: 1.15rem; }
.resultat__extrait { color: var(--texte-doux); }
mark { background: var(--soleil); color: var(--sur-couleur); border-radius: 3px; padding: 0 .15em; }

/* --- Espace de l'association : groupe, annonces, fiche, messages ---
   Couleurs existantes seulement (accent sur accent-texte, soleil sous sur-couleur, contours en --trait). */
.etiquette-association, .etiquette-nouveau { display: inline-block; vertical-align: middle; margin-left: .3rem; padding: .05rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.etiquette-association { background: var(--accent); color: var(--accent-texte); }
.etiquette-nouveau { background: var(--soleil); color: var(--sur-couleur); border: 1px solid var(--trait); }
.pastille-association { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-texte); }
.pastille-association svg { width: 24px; height: 24px; }
/* Canal officiel de l'équipe (D15) : badge et pastille réservés, jamais disponibles pour un membre */
.pastille-equipe { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--soleil); color: var(--sur-couleur); border: 2px solid var(--trait); }
.pastille-equipe svg, .etiquette-officielle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.etiquette-officielle { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .7rem .1rem .45rem; border-radius: 999px; background: var(--soleil); color: var(--sur-couleur); border: 2px solid var(--trait); font-size: .85rem; font-weight: 700; white-space: nowrap; }
.etiquette-officielle svg { width: 18px; height: 18px; }
.entete-officielle h1 { display: flex; align-items: center; gap: .6rem; white-space: nowrap; flex: 0 1 auto; min-width: max-content; }
.entete-officielle .etiquette-officielle { flex: none; }
/* Événements d'appel dans un fil (proposition, réponse) : une bulle comme un message, avec l'icône du mode */
.fil li.evenement .bulle { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.bulle__icone svg { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bulle__action { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; width: 100%; margin: .2rem 0 0; }
.bulle__action .bouton--discret { min-height: 40px; padding: 0 .6rem; }
.bulle__action.bulle__reponse { display: grid; gap: .5rem; }
/* Seul le texte écrit garde ses retours à la ligne : jamais l'indentation des gabarits */
.bulle:has(> .bulle__texte) { white-space: normal; }
.bulle__texte { white-space: pre-wrap; }
/* Dans ma propre bulle (fond accent) : lien « Annuler » et mention dans la couleur du texte de la bulle */
.moi .bulle .bouton--discret, .moi .bulle .doux { color: inherit; }
.bulle__action fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: .1rem; }
.bulle__boutons { display: flex; flex-wrap: wrap; gap: .5rem; }
.appels button.bouton-icone { font: inherit; font-size: .78rem; font-weight: 700; }
.personne--association { display: inline-flex; align-items: center; gap: .55rem; min-height: var(--cible); padding: .2rem .7rem .2rem .3rem; border-radius: 999px; color: var(--texte); text-decoration: none; border: 2px solid transparent; }
.personne--association:hover { border-color: var(--trait); }
.groupe--association { padding: 1rem; border: 2px solid var(--trait); border-radius: var(--rayon-carte); background: var(--accent-doux); }
.annonces { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .9rem; }
.annonce { padding: 1rem 1.1rem; background: var(--surface); border: 2px solid var(--trait); border-left-width: 8px; border-radius: var(--rayon); }
.annonce h3 { margin: .2rem 0 .4rem; }
.annonce--apercu { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .6rem; min-height: var(--cible); color: var(--texte); text-decoration: none; }
.annonce--apercu .etiquette-association { margin-left: 0; align-self: flex-start; }
.annonce--apercu:hover { background: var(--soleil); color: var(--sur-couleur); }
.coordonnees { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem 1rem; margin: 0; }
.coordonnees { align-items: center; gap: 0 1rem; }
.coordonnees dt, .coordonnees dd { min-height: var(--cible); display: flex; align-items: center; }
.coordonnees dt { font-weight: 700; }
.coordonnees dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.coordonnees a { display: inline-flex; align-items: center; min-height: var(--cible); }
.fiche-association + .bloc, .annonces + .bloc { margin-top: 1.25rem; }
.repli--sujets { margin-top: 1rem; }
.repli--sujets .sujets { margin-top: .75rem; }
.entete-conversation .etiquette-association { margin-left: 0; }
.onglets-espace { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.onglets-espace a { display: inline-flex; align-items: center; min-height: var(--cible); padding: 0 1rem; border: 2px solid var(--trait); border-radius: 999px; color: var(--texte); text-decoration: none; font-weight: 700; }
.onglets-espace a[aria-current="page"] { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.onglets-espace a[aria-current="page"]::before { content: "✓"; margin-right: .4rem; }
.liste-invites { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.liste-invites > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; background: var(--surface); border: 2px solid var(--bord-doux); border-radius: var(--rayon); }
.actions-invite { display: flex; flex-wrap: wrap; gap: .5rem; }
.message-admin--association { border-left: 8px solid var(--accent); }
.saisie > label { display: block; font-weight: 700; margin-bottom: .4rem; }

.domaines-association { display: grid; gap: .6rem; }
.domaine { margin: 0; padding: .5rem .8rem; border: 2px solid var(--bord-doux); border-radius: var(--rayon); }
.domaine__diagnostics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0 1rem; padding-left: 1.6rem; }

/* Pages de l'espace association (équipe) : une colonne de lecture, formulaires empilés */
.colonne-lecture { max-width: 760px; }
.colonne-lecture > h2 { margin-top: 2.25rem; }
.formulaire-long { display: flex; flex-direction: column; gap: 0; }
.formulaire-long .champ { margin-bottom: 1.25rem; }
.formulaire-long .aide { margin-top: 0; }
.formulaire-long > button, .formulaire-long > .actions { align-self: flex-start; margin: .25rem 0 0; }
.formulaire-long > .aide:last-of-type { margin-bottom: 1rem; }
.annonce__pied { display: flex; justify-content: flex-end; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--bord-doux); }
.annonce__pied .bouton--destructif { min-height: var(--cible); }
/* Situations suivies : des groupes légers, pas des cadres dans un cadre */
.domaines-association { background: none; border: 0; padding: 0; }
.domaines-association > legend { padding: 0; margin-bottom: .3rem; }
.domaine { background: var(--surface); }
.domaine .choix { margin-bottom: .35rem; }
.domaine__diagnostics { padding-left: 1.25rem; }

/* Application : notifications de l'appareil, installation */
.appareil, .installer { margin-top: 1.25rem; }
.appareil [data-etat] > :last-child { margin-bottom: 0; }
.etapes-simples { margin: 0 0 .5rem; padding-left: 1.4rem; }
.etapes-simples li { margin-bottom: .3rem; }
