/* =====================================================================
   MyProject — feuille de style unique (aucun style inline : CSP style-src 'self')
   Structure : menu latéral sombre sur ordinateur, onglets en bas sur mobile.
   ===================================================================== */

@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: 700; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-700-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"); }
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url("../fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-display: swap; src: url("../fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("../fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("../fonts/figtree-latin-700-normal.woff2") format("woff2"); }

/* ----- Jetons de design ------------------------------------------------ */
:root {
  --fond: #f2f4f9;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --encre: #121a2c;
  --discret: #5d6780;
  --trait: #e2e6ef;
  --primaire: #2f49d1;
  --primaire-survol: #2539b0;
  --primaire-clair: #e9edfd;
  --sur-primaire: #ffffff;
  --vert: #11905b;
  --vert-clair: #e1f4ea;
  --ambre: #b86e00;
  --ambre-clair: #fdf0d9;
  --rouge: #c53a3a;
  --rouge-clair: #fbe7e7;
  --nav: #0f1730;
  --nav-2: #18224a;
  --nav-texte: #aeb7d3;
  --voile: rgba(10, 16, 34, .42);
  --ombre: 0 1px 2px rgba(16, 24, 48, .05), 0 6px 20px rgba(16, 24, 48, .06);
  --ombre-forte: 0 12px 40px rgba(16, 24, 48, .18);
  --rayon: 16px;
  --rayon-m: 12px;
  --rayon-s: 9px;
  --police-titre: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --police: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --largeur-menu: 252px;
  --hauteur-onglets: 66px;
  /* Couleurs des natures (attribuées selon l'identifiant) */
  --n0: #2f49d1; --n1: #0d8a82; --n2: #d07a06; --n3: #d0386c; --n4: #6f4ae0; --n5: #4b5a73;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0c1120; --surface: #151c30; --surface-2: #1a2238; --encre: #e7ebf5; --discret: #9aa4bd; --trait: #273049;
    --primaire: #7d92ff; --primaire-survol: #9aabff; --primaire-clair: #1f2a52; --sur-primaire: #0c1120;
    --vert: #45c98d; --vert-clair: #12301f; --ambre: #f0ad4e; --ambre-clair: #33260e; --rouge: #ef7b7b; --rouge-clair: #3a1a1d;
    --nav: #080c18; --nav-2: #131a31; --voile: rgba(0, 0, 0, .6);
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --n0: #7d92ff; --n1: #3cc3b8; --n2: #f0a23a; --n3: #f06a96; --n4: #a48bff; --n5: #9aa8bf;
    color-scheme: dark;
  }
}
.nature-0 { --nature: var(--n0); } .nature-1 { --nature: var(--n1); } .nature-2 { --nature: var(--n2); }
.nature-3 { --nature: var(--n3); } .nature-4 { --nature: var(--n4); } .nature-5 { --nature: var(--n5); }

/* ----- Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--police); font-size: 15.5px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--police-titre); line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--primaire); text-underline-offset: 2px; }
img, svg { max-width: 100%; }
.discret { color: var(--discret); font-size: .92em; }
.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--primaire); outline-offset: 2px; border-radius: 6px; }
.icone { width: 20px; height: 20px; flex: none; }
.icone.petite { width: 16px; height: 16px; }
.nombre { font-variant-numeric: tabular-nums; }

/* ----- Structure de l'application -------------------------------------- */
body.app { display: grid; grid-template-columns: var(--largeur-menu) minmax(0, 1fr); min-height: 100vh; }
.barre-laterale {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  background: var(--nav); color: var(--nav-texte);
  display: flex; flex-direction: column; gap: 1.6rem; padding: 22px 14px 18px;
}
.marque { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; padding: 0 10px; }
.marque-logo { width: 34px; height: 34px; flex: none; }
.marque-nom { font-family: var(--police-titre); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.menu { display: grid; gap: 4px; }
.menu-titre { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6e7aa0; padding: 12px 12px 4px; }
.menu a {
  display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: var(--rayon-s);
  color: var(--nav-texte); text-decoration: none; font-weight: 600;
}
.menu a:hover { background: var(--nav-2); color: #fff; }
.menu a.actif { background: var(--nav-2); color: #fff; box-shadow: inset 3px 0 0 #7d92ff; }
.utilisateur { margin-top: auto; display: flex; align-items: center; gap: .65rem; padding: 12px; border-radius: var(--rayon-m); background: var(--nav-2); }
.utilisateur-nom { color: #fff; font-weight: 600; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.utilisateur-nom small { display: block; color: var(--nav-texte); font-weight: 500; font-size: .8rem; }
.bouton-sortie { background: none; border: 0; color: var(--nav-texte); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.bouton-sortie:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.barre-mobile, .onglets { display: none; }
.contenu { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 32px 64px; min-width: 0; }
.contenu.etroit { max-width: 780px; }

/* ----- Avatars ----------------------------------------------------------- */
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, #7d92ff, #2f49d1); color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .02em;
}
.avatar.petit { width: 24px; height: 24px; font-size: .66rem; }
.avatar.grand { width: 44px; height: 44px; font-size: .95rem; }

/* ----- En-têtes de page -------------------------------------------------- */
/* Onglets des pages d'administration (Utilisateurs | Natures) */
.onglets-admin { display: flex; gap: .3rem; border-bottom: 1px solid var(--trait); margin-bottom: 1.2rem; overflow-x: auto; }
.onglets-admin a { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .9rem; min-height: 44px; text-decoration: none;
  color: var(--discret); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.onglets-admin a:hover { color: var(--encre); }
.onglets-admin a.actif { color: var(--primaire); border-bottom-color: var(--primaire); }
.titre-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.titre-page > div { display: grid; gap: .35rem; min-width: 0; }
.surtitre { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--discret); }
.retour { display: inline-flex; align-items: center; gap: .3rem; color: var(--discret); text-decoration: none; font-weight: 600; font-size: .92rem; margin-bottom: .9rem; }
.retour:hover { color: var(--primaire); }
.retour .icone { width: 18px; height: 18px; }

/* ----- Boutons ------------------------------------------------------------ */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: .55rem 1.05rem; border-radius: var(--rayon-s); border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.bouton:active { transform: translateY(1px); }
.bouton.principal { background: var(--primaire); color: var(--sur-primaire); box-shadow: 0 6px 16px -6px rgba(47, 73, 209, .55); }
.bouton.principal:hover { background: var(--primaire-survol); }
.bouton.secondaire { background: var(--surface); color: var(--encre); border-color: var(--trait); }
.bouton.secondaire:hover { border-color: var(--primaire); color: var(--primaire); }
.bouton.fantome { background: transparent; color: var(--primaire); }
.bouton.fantome:hover { background: var(--primaire-clair); }
.bouton.danger { background: var(--rouge); color: #fff; }
.bouton.petit { min-height: 34px; padding: .35rem .75rem; font-size: .88rem; }
.bouton.large { width: 100%; }
.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--primaire); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.lien.danger { color: var(--rouge); }
.bouton-icone {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--discret); cursor: pointer; flex: none;
}
.bouton-icone:hover { background: var(--surface-2); border-color: var(--trait); color: var(--encre); }

/* ----- Formulaires ------------------------------------------------------- */
.pile { display: grid; gap: 1rem; }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .93rem; }
input, select, textarea {
  font: inherit; font-weight: 500; color: var(--encre); background: var(--surface);
  border: 1.5px solid var(--trait); border-radius: var(--rayon-s); padding: .6rem .75rem; min-height: 44px; width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 84px; }
input:hover, select:hover, textarea:hover { border-color: #c7cede; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primaire); box-shadow: 0 0 0 4px var(--primaire-clair); }
input::placeholder, textarea::placeholder { color: #9ba3b6; font-weight: 400; }
.err { color: var(--rouge); font-weight: 500; font-size: .86rem; }
.en-ligne { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.en-ligne > input[type=text] { flex: 1 1 200px; width: auto; }
.en-ligne > select { width: auto; }
input.court { width: 7.5rem; flex: none; }
/* Champs date (EVO-006/008) : étiquette « Date prévue » visible ; sur iPhone un champ date vide n'affiche aucun texte */
.champ-date { display: grid; gap: .2rem; font-size: .78rem; font-weight: 600; color: var(--discret); flex: none; width: 10.5rem; }
.champ-date > input { width: 100%; }
.ajout-etape .champ-date { width: auto; }
.ajout-sous .en-ligne { align-items: flex-end; }
@supports (-webkit-touch-callout: none) {
  input[type=date] { -webkit-appearance: none; appearance: none; min-height: 44px; }
  input[type=date]::-webkit-date-and-time-value { text-align: left; }
}
.bas-aligne { align-items: flex-end; }
.actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }

/* ----- Cartes et blocs ------------------------------------------------------ */
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); }
.bloc { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.4rem; margin-bottom: 1.2rem; }
.bloc > h2:first-child, .bloc > .bloc-titre { margin-bottom: .9rem; }
.bloc-titre { display: flex; align-items: center; gap: .6rem; }
.bloc-titre .icone { color: var(--primaire); }
.section-titre { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 2rem 0 1rem; }

/* ----- Messages ------------------------------------------------------------ */
.messages:empty { display: none; }
.alerte { display: flex; gap: .6rem; align-items: flex-start; border-radius: var(--rayon-m); padding: .8rem 1rem; margin: 0 0 1.2rem; font-weight: 500; border: 1px solid transparent; }
.alerte::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: .5em; flex: none; background: currentColor; }
.alerte.ok { background: var(--vert-clair); color: var(--vert); border-color: color-mix(in srgb, var(--vert) 25%, transparent); }
.alerte.ko { background: var(--rouge-clair); color: var(--rouge); border-color: color-mix(in srgb, var(--rouge) 25%, transparent); }
.alerte.info { background: var(--primaire-clair); color: var(--primaire); border-color: color-mix(in srgb, var(--primaire) 22%, transparent); }
.alerte p { color: inherit; }
.alerte a { color: inherit; font-weight: 700; }

/* ----- Pastilles ------------------------------------------------------------- */
.etiquette {
  display: inline-flex; align-items: center; gap: .4rem; width: fit-content;
  font-size: .78rem; font-weight: 700; letter-spacing: .03em; color: var(--nature, var(--primaire));
  background: color-mix(in srgb, var(--nature, var(--primaire)) 12%, transparent); padding: .22rem .6rem; border-radius: 99px;
}
.etiquette::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.statut { display: inline-block; font-size: .74rem; font-weight: 700; border-radius: 99px; padding: .16rem .6rem; white-space: nowrap; background: var(--surface-2); color: var(--discret); border: 1px solid var(--trait); }
.statut.en_cours, .statut.compte-en_attente { background: var(--ambre-clair); color: var(--ambre); border-color: transparent; }
.statut.termine, .statut.compte-actif { background: var(--vert-clair); color: var(--vert); border-color: transparent; }
.statut.compte-refuse, .statut.compte-suspendu { background: var(--rouge-clair); color: var(--rouge); border-color: transparent; }
.role { font-size: .8rem; font-weight: 600; color: var(--discret); }

/* ----- Anneau et barres d'avancement ---------------------------------------- */
.anneau { position: relative; width: 64px; height: 64px; flex: none; }
.anneau svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau .piste { fill: none; stroke: var(--trait); stroke-width: 3.4; }
.anneau .valeur { fill: none; stroke: var(--nature, var(--vert)); stroke-width: 3.4; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.anneau .pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--police-titre); font-weight: 800; font-size: .95rem; font-variant-numeric: tabular-nums; }
.anneau.grand { width: 128px; height: 128px; }
.anneau.grand .pct { font-size: 1.8rem; }
.anneau.grand .piste, .anneau.grand .valeur { stroke-width: 3; }

progress { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--trait); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--trait); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--nature, var(--vert)); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--nature, var(--vert)); border-radius: 99px; }
.mini-avancement { display: inline-flex; align-items: center; gap: .45rem; }
.mini-avancement progress { width: 64px; height: 6px; }
.mini-avancement .pct { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--encre); min-width: 2.6rem; }

/* ----- Liste des projets ------------------------------------------------------ */
.accueil-resume { display: flex; gap: .6rem; flex-wrap: wrap; margin: -.6rem 0 1.6rem; }
.chiffre { background: var(--surface); border: 1px solid var(--trait); border-radius: 99px; padding: .35rem .9rem; font-weight: 600; font-size: .9rem; color: var(--discret); }
.chiffre strong { color: var(--encre); font-family: var(--police-titre); font-size: 1.05rem; margin-right: .2rem; }
.grille-projets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem; }
.carte-projet {
  position: relative; display: grid; gap: 1rem; height: 100%; padding: 1.25rem 1.25rem 1.1rem; overflow: hidden;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre);
  color: var(--encre); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.carte-projet::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--nature); }
.carte-projet:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); border-color: color-mix(in srgb, var(--nature) 40%, var(--trait)); }
.carte-projet .haut { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.carte-projet .nom { font-family: var(--police-titre); font-weight: 700; font-size: 1.2rem; line-height: 1.2; overflow-wrap: anywhere; }
.carte-projet .desc { color: var(--discret); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carte-projet .bas { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-top: .9rem; border-top: 1px solid var(--trait); color: var(--discret); font-size: .86rem; font-weight: 600; }
.carte-projet .bas span { display: inline-flex; align-items: center; gap: .3rem; }
.carte-nouveau {
  display: grid; place-items: center; gap: .5rem; min-height: 200px; height: 100%; text-align: center; padding: 1.2rem;
  border: 2px dashed var(--trait); border-radius: var(--rayon); color: var(--discret); text-decoration: none; font-weight: 700;
  transition: border-color .15s, color .15s, background-color .15s;
}
.carte-nouveau:hover { border-color: var(--primaire); color: var(--primaire); background: var(--primaire-clair); }
.carte-nouveau .rond { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--primaire-clair); color: var(--primaire); }

.vide { display: grid; justify-items: center; text-align: center; gap: .8rem; padding: 3rem 1.5rem; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); }
.vide svg.illustration { width: 120px; height: 120px; }
.vide p { max-width: 46ch; color: var(--discret); }
.vide strong { color: var(--encre); font-family: var(--police-titre); font-size: 1.2rem; }

/* ----- Page projet ------------------------------------------------------------- */
.projet-entete { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 2rem; align-items: center; padding: 1.6rem 1.7rem; margin-bottom: 1.6rem; }
.projet-entete::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--nature); }
.projet-entete .infos { display: grid; gap: .65rem; min-width: 0; }
.projet-entete h1 { overflow-wrap: anywhere; }
.projet-entete .description { color: var(--discret); max-width: 62ch; white-space: pre-line; }
.projet-entete .boutons { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
.projet-chiffres { display: flex; align-items: center; gap: 1.6rem; }
.projet-chiffres dl { display: grid; gap: .7rem; margin: 0; }
.projet-chiffres dt { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--discret); }
.projet-chiffres dd { margin: 0; font-family: var(--police-titre); font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.etape { margin-bottom: 1rem; overflow: visible; }
.etape > .tache { padding: 1rem 1.1rem; }
.etape .sous-liste { border-top: 1px solid var(--trait); padding: .4rem 1.1rem .8rem 1.1rem; }
.etape.repliee .sous-liste { display: none; }
.numero { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-family: var(--police-titre); font-weight: 800; font-size: .9rem; color: var(--nature); background: color-mix(in srgb, var(--nature) 13%, transparent); }

.tache { display: flex; align-items: flex-start; gap: .85rem; position: relative; scroll-margin-top: 90px; }
.sous-liste .tache { padding: .75rem 0; border-bottom: 1px solid var(--trait); }
.sous-liste .tache:last-of-type { border-bottom: 0; }
.tache-principal { flex: 1; min-width: 0; display: grid; gap: .3rem; }
.tache-ligne1 { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.tache-nom { font-weight: 700; overflow-wrap: anywhere; }
.etape > .tache .tache-nom { font-family: var(--police-titre); font-size: 1.12rem; }
.tache.terminee .tache-nom { color: var(--discret); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.tache-desc { color: var(--discret); font-size: .92rem; white-space: pre-line; }
.meta { display: flex; align-items: center; gap: .35rem 1rem; flex-wrap: wrap; color: var(--discret); font-size: .86rem; font-weight: 500; }
.meta > span { display: inline-flex; align-items: center; gap: .3rem; }
.meta .agenda { color: var(--vert); font-weight: 600; }
.meta .echeance.en-retard { color: var(--rouge); font-weight: 600; }
.echeance-projet { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .35rem; font-size: .88rem; font-weight: 600; color: var(--discret); }
.echeance-projet.termine { color: var(--vert); }
.echeance-projet.en-retard { color: var(--rouge); }

/* Commentaires d'une tâche (EVO-001) */
.commentaires > summary { cursor: pointer; width: fit-content; color: var(--primaire); font-weight: 600; font-size: .86rem; padding: .2rem 0; }
.commentaires[open] > summary { margin-bottom: .5rem; }
.commentaires > .pile { gap: .5rem; justify-items: start; }
.liste-commentaires { list-style: none; margin: 0 0 .7rem; padding: 0; display: grid; gap: .6rem; }
.commentaire { background: var(--fond); border: 1px solid var(--trait); border-radius: var(--rayon-s); padding: .6rem .75rem; display: grid; gap: .35rem; min-width: 0; }
.commentaire-entete { display: flex; align-items: center; gap: .25rem .5rem; flex-wrap: wrap; font-size: .86rem; }
.commentaire-texte { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.commentaire-actions { display: flex; align-items: flex-start; gap: .3rem 1rem; flex-wrap: wrap; font-size: .86rem; }
.commentaire-actions form { margin: 0; }
.commentaire-modifier[open] { flex: 1 1 100%; order: 2; }
.commentaire-modifier > summary { cursor: pointer; width: fit-content; color: var(--primaire); font-weight: 600; }
.commentaire-modifier[open] > summary { margin-bottom: .4rem; }
.commentaire-modifier .pile { gap: .5rem; justify-items: start; }
.lien-danger { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--rouge); cursor: pointer; }
.lien-danger:hover { text-decoration: underline; }
.tache-droite { display: flex; align-items: center; gap: .2rem; flex: none; }

/* Bouton rond de statut : À faire → En cours → Terminé */
.statut-rond {
  width: 30px; height: 30px; flex: none; border-radius: 50%; margin-top: 1px; padding: 0; cursor: pointer;
  border: 2px solid #b9c1d3; background: var(--surface); color: transparent; display: grid; place-items: center;
  transition: transform .12s, border-color .15s, background .15s;
}
.statut-rond:hover { transform: scale(1.08); border-color: var(--nature, var(--primaire)); }
.statut-rond.en_cours { border-color: var(--ambre); background: conic-gradient(var(--ambre) 0 50%, var(--surface) 50% 100%); }
.statut-rond.termine { border-color: var(--vert); background: var(--vert); color: #fff; }
.statut-rond .icone { width: 16px; height: 16px; }
span.statut-rond { cursor: default; }
span.statut-rond:hover { transform: none; }

/* Panneau d'actions : menu sur ordinateur, feuille du bas sur mobile */
.actions-tache { position: relative; }
.actions-tache > summary { list-style: none; }
.actions-tache > summary::-webkit-details-marker { display: none; }
.actions-tache[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 40; cursor: default; }
.panneau {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; width: min(340px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-m); box-shadow: var(--ombre-forte);
  padding: .9rem; display: grid; gap: .9rem;
}
.panneau h4 { margin: 0 0 .1rem; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--discret); }
.panneau .groupe { display: grid; gap: .5rem; }
.panneau .groupe + .groupe { padding-top: .9rem; border-top: 1px solid var(--trait); }
.panneau .rangee { display: flex; gap: .5rem; align-items: center; }
.panneau .rangee > input { flex: 1; }
.panneau-titre { display: none; }
.action-menu {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .6rem; border-radius: 8px; border: 0; background: none;
  font: inherit; font-weight: 600; color: var(--encre); text-decoration: none; cursor: pointer; text-align: left;
}
.action-menu:hover { background: var(--surface-2); }
.action-menu.danger { color: var(--rouge); }

.ajout-sous { padding-top: .6rem; }
.ajout-sous > summary { list-style: none; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; font-weight: 700; color: var(--primaire); font-size: .92rem; padding: .35rem .2rem; }
.ajout-sous > summary::-webkit-details-marker { display: none; }
.ajout-sous[open] > summary { margin-bottom: .6rem; }
.replier { transition: transform .2s; }
.etape.repliee .replier { transform: rotate(-90deg); }
/* Modèle d'étapes d'une nature (administration, EVO-005) */
.modele-etape > .modele-ligne { padding: 1rem 1.1rem; }
.modele-etape > .modele-ligne input[name=nom] { font-weight: 700; }
.sous-liste .modele-ligne { padding: .7rem 0; border-bottom: 1px solid var(--trait); }
.modele-ligne { display: flex; align-items: flex-start; gap: .5rem; }
.modele-champs { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.modele-champs > input[name=nom] { flex: 1 1 200px; width: auto; }
.modele-champs > .modele-description { flex: 1 1 100%; }
.modele-boutons { display: flex; align-items: center; gap: .1rem; flex: none; }
.modele-boutons form { margin: 0; }
.modele-boutons .bouton-icone:disabled { opacity: .35; cursor: default; }
.icone.haut { transform: rotate(180deg); }
.ajout-etape { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem 10.5rem auto; gap: .6rem; align-items: end; padding: 1rem; border: 2px dashed var(--trait); border-radius: var(--rayon); background: transparent; }

/* ----- Formulaire de création ---------------------------------------------------- */
fieldset.etape-saisie { border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); padding: 1.1rem 1.1rem 1.2rem; margin: 0; display: grid; gap: .7rem; }
fieldset.etape-saisie legend { float: left; width: 100%; display: flex; align-items: center; gap: .6rem; font-family: var(--police-titre); font-weight: 700; font-size: 1.02rem; padding: 0; margin-bottom: .2rem; }
fieldset.etape-saisie legend .num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primaire-clair); color: var(--primaire); font-size: .88rem; }
fieldset.etape-saisie legend + * { clear: both; }
.ligne-tache { display: flex; gap: .5rem; align-items: flex-end; }
.ligne-tache input[type=text] { flex: 1; }
.ligne-tache input[type=number] { width: 7.5rem; flex: none; }
.sous-etapes { display: grid; gap: .5rem; margin-left: .9rem; padding-left: .9rem; border-left: 2px solid var(--trait); }
.sous-etapes:empty { display: none; }
.barre-validation { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; gap: .6rem; padding: .9rem 0; background: linear-gradient(to top, var(--fond) 70%, transparent); }

/* ----- Listes (membres, invitations, utilisateurs) ---------------------------------- */
.liste { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); }
.liste > li { display: flex; align-items: center; gap: .85rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--trait); flex-wrap: wrap; }
.liste > li:last-child { border-bottom: 0; }
.liste .qui { display: flex; align-items: center; gap: .75rem; flex: 1 1 220px; min-width: 0; }
.liste .qui strong { display: block; overflow-wrap: anywhere; }
.liste .qui .discret { display: block; overflow-wrap: anywhere; }
.liste .boutons { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
/* Gestion des utilisateurs (EVO-007) */
.recherche-utilisateurs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.recherche-utilisateurs > input[type=search] { flex: 1 1 240px; width: auto; }
.recherche-utilisateurs > select { flex: 0 1 auto; width: auto; }
.lien-fiche { color: inherit; text-decoration: none; }
.lien-fiche:hover strong { color: var(--primaire); text-decoration: underline; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.2rem; flex-wrap: wrap; }
.profil-entete > .statut { margin-left: auto; }
.filtres { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.filtres a { text-decoration: none; color: var(--discret); font-weight: 600; font-size: .9rem; border: 1px solid var(--trait); background: var(--surface); padding: .38rem .9rem; border-radius: 99px; }
.filtres a:hover { color: var(--encre); }
.filtres a.actif { background: var(--encre); border-color: var(--encre); color: var(--fond); }

.lien-invitation { border: 1.5px solid var(--vert); background: linear-gradient(180deg, var(--vert-clair), var(--surface) 70%); }
.copie { display: flex; gap: .5rem; }
.copie input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; }
.zone-danger { margin-top: 2rem; border: 1.5px solid color-mix(in srgb, var(--rouge) 45%, var(--trait)); border-radius: var(--rayon); padding: 1.3rem 1.4rem; display: grid; gap: .7rem; }
.zone-danger h2 { color: var(--rouge); font-size: 1.1rem; }
.aide summary { cursor: pointer; color: var(--primaire); font-weight: 600; }
.aide ul { margin: .5rem 0 0; padding-left: 1.2rem; display: grid; gap: .3rem; color: var(--discret); }
dl.infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 0; }
dl.infos dt { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--discret); }
dl.infos dd { margin: .15rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.profil-entete { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.google-etat { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.point { width: 10px; height: 10px; border-radius: 50%; background: var(--trait); flex: none; }
.point.vert { background: var(--vert); box-shadow: 0 0 0 4px var(--vert-clair); }

/* ----- Pages de connexion -------------------------------------------------------------- */
body.page-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-visuel {
  position: relative; overflow: hidden; background: var(--nav); color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: 48px clamp(28px, 5vw, 64px);
}
.auth-visuel .marque { padding: 0; }
.auth-visuel h2 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.1rem); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; max-width: 13ch; }
.auth-visuel h2 em { font-style: normal; color: #9fb0ff; }
.auth-visuel p { color: var(--nav-texte); max-width: 40ch; font-size: 1.02rem; }
.auth-anneaux { display: flex; gap: 1rem; flex-wrap: wrap; }
.auth-anneaux .carte-mini { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem .8rem .8rem; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); }
.auth-anneaux .carte-mini strong { display: block; font-size: .95rem; }
.auth-anneaux .carte-mini span { color: var(--nav-texte); font-size: .82rem; }
.auth-anneaux .anneau { width: 52px; height: 52px; }
.auth-anneaux .anneau .piste { stroke: rgba(255, 255, 255, .14); }
.auth-anneaux .anneau .pct { font-size: .8rem; color: #fff; }
.auth-formulaire { display: grid; place-items: center; padding: 40px 24px; background: var(--fond); }
.carte-auth { width: 100%; max-width: 420px; display: grid; gap: 1.3rem; }
.carte-auth h1 { font-size: 2rem; }
.carte-auth .bas { text-align: center; color: var(--discret); }
.carte-auth .bas a { font-weight: 700; }
.page-erreur { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.page-erreur .bloc { max-width: 480px; text-align: center; display: grid; gap: .8rem; justify-items: center; }
.page-erreur .code { font-family: var(--police-titre); font-size: 4rem; font-weight: 800; color: var(--primaire); line-height: 1; }

/* =====================================================================
   Mobile et tablette
   ===================================================================== */
@media (max-width: 900px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .barre-laterale { display: none; }

  .barre-mobile {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    position: sticky; top: 0; z-index: 30; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
    padding-top: calc(10px + env(safe-area-inset-top)); background: var(--nav); color: #fff;
  }
  .barre-mobile .marque { padding: 0; }
  .barre-mobile .marque-logo { width: 30px; height: 30px; }
  .barre-mobile .droite { display: flex; align-items: center; gap: .4rem; }

  .onglets {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: var(--surface); border-top: 1px solid var(--trait); box-shadow: 0 -6px 20px rgba(16, 24, 48, .08);
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  }
  .onglets a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; color: var(--discret); text-decoration: none; font-size: .72rem; font-weight: 700; }
  .onglets a .icone { width: 23px; height: 23px; }
  .onglets a.actif { color: var(--primaire); background: var(--primaire-clair); }

  .contenu, .contenu.etroit {
    padding: 20px max(16px, env(safe-area-inset-right)) calc(var(--hauteur-onglets) + 40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .titre-page { align-items: stretch; flex-direction: column; margin-bottom: 1.2rem; }
  .titre-page > .bouton, .titre-page > .boutons { width: 100%; }

  .projet-entete { grid-template-columns: minmax(0, 1fr); padding: 1.3rem 1.2rem; }
  .projet-chiffres { justify-content: flex-start; gap: 1.2rem; }
  .anneau.grand { width: 96px; height: 96px; }
  .anneau.grand .pct { font-size: 1.35rem; }
  .projet-chiffres dl { grid-template-columns: repeat(3, auto); gap: .4rem 1.2rem; }

  .etape > .tache { padding: .9rem .9rem; }
  .etape .sous-liste { padding: .2rem .9rem .7rem; }
  .meta { gap: .25rem .8rem; }

  /* Le panneau d'actions devient une feuille qui monte du bas de l'écran */
  .actions-tache[open] > summary::before { background: var(--voile); z-index: 60; }
  .panneau {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; z-index: 61;
    border-radius: 20px 20px 0 0; border-bottom: 0; max-height: 85vh; overflow-y: auto;
    padding: .6rem max(18px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    animation: monte .22s ease-out;
  }
  .panneau::before { content: ""; justify-self: center; width: 42px; height: 5px; border-radius: 99px; background: var(--trait); }
  .panneau-titre { display: block; font-family: var(--police-titre); font-weight: 700; font-size: 1.05rem; }
  .panneau input, .panneau .bouton { min-height: 48px; }
  .action-menu { padding: .8rem .6rem; }

  .ajout-etape { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ajout-etape > input[type=text] { grid-column: 1 / -1; }
  .ajout-etape .bouton { grid-column: 1 / -1; }
  .ligne-tache { flex-wrap: wrap; }
  .ligne-tache input[type=text] { flex: 1 1 100%; }
  .ligne-tache input[type=number], .ligne-tache .champ-date { flex: 1; width: auto; }
  .sous-etapes { margin-left: .2rem; padding-left: .7rem; }
  .barre-validation { bottom: calc(var(--hauteur-onglets) + env(safe-area-inset-bottom)); }
  .barre-validation .bouton { flex: 1; }
  .liste > li { padding: .85rem .9rem; }
  .liste .boutons { width: 100%; }
  .copie { flex-direction: column; }

  body.page-auth { grid-template-columns: minmax(0, 1fr); }
  .auth-visuel { padding: calc(28px + env(safe-area-inset-top)) 20px 28px; gap: 1rem; }
  .auth-visuel h2 { font-size: 1.7rem; }
  .auth-visuel p, .auth-anneaux { display: none; }
  .auth-formulaire { place-items: start center; padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); }
}
/* Issue #1 : sur téléphone, « Mon rôle » (ex. Propriétaire) passe sur sa propre ligne au lieu de dépasser l'écran. */
@media (max-width: 560px) {
  .projet-chiffres dl { grid-template-columns: repeat(2, auto); min-width: 0; }
  .projet-chiffres dl > div:last-child { grid-column: 1 / -1; }
  .projet-chiffres dd { white-space: nowrap; }
}
@media (max-width: 420px) {
  .grille-projets { grid-template-columns: minmax(0, 1fr); }
  .onglets a { font-size: .66rem; }
  .modele-ligne { flex-wrap: wrap; }
  .modele-champs { flex: 1 1 100%; }
  .modele-boutons { margin-left: auto; }
}
@keyframes monte { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

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