/* =====================================================================
   Dynasty 8 AlyniaRP : fondations communes (charte graphique)
   ---------------------------------------------------------------------
   Utilisé par la partie publique ET par l'espace employés.
   Documentation complète des composants : public/CHARTE.md

   Règles imposées (non négociables) :
   - Jamais de texte sombre sur un fond clair ou vif : un fond coloré est
     toujours foncé/saturé avec du texte blanc (contraste >= 4,5).
   - letter-spacing toujours à 0, pas de petites capitales, pas de tirets
     décoratifs devant les sur-titres.
   - Graisses : titres 700, libellés 500-600, texte 400-500. Jamais 800-900.
   - Animations : uniquement transform et opacity (will-change sur ce qui
     bouge). Aucun backdrop-filter, aucun filter: blur animé, aucun
     mix-blend-mode, pas d'animation de box-shadow ni de dégradé.
   ===================================================================== */

/* ---------- 1. Variables (thème sombre par défaut) ---------- */
:root {
  /* Fonds et surfaces */
  --fond: #07080a;
  --fond-2: #0b0d10;
  --surface: #101216;
  --surface-2: #161920;
  --surface-3: #1d212a;
  --surface-carte: linear-gradient(180deg, #141820 0%, #101216 100%);
  --barre-laterale: #040506;
  --bordure: rgba(255, 255, 255, 0.08);
  --bordure-forte: rgba(255, 255, 255, 0.16);
  --voile: rgba(3, 4, 5, 0.78);           /* fond des modales */

  /* Texte */
  --texte: #f4f1ea;
  --texte-2: #aab1bd;
  --texte-3: #8a919d;                     /* reste lisible : contraste > 4,5 sur --surface */

  /* Identité Dynasty 8 */
  --vert: #22d477;                        /* accent : texte, icônes, filets sur fond sombre */
  --vert-doux: #9ce0b6;
  --vert-plein: #0f7a45;                  /* FOND des boutons / badges verts (texte blanc) */
  --vert-plein-survol: #0c6a3b;
  --vert-teinte: rgba(34, 212, 119, 0.12);
  --vert-halo: rgba(34, 212, 119, 0.28);

  --or: #e9c75a;                          /* texte or sur fond sombre */
  --or-vif: #f0de48;
  --or-plein: #8a6514;                    /* FOND or foncé (texte blanc) */
  --or-plein-2: #6b4c0d;
  --or-teinte: rgba(233, 199, 90, 0.12);

  --danger: #ff7a7a;                      /* texte rouge sur fond sombre */
  --danger-plein: #b3261e;                /* FOND rouge (texte blanc) */
  --danger-teinte: rgba(255, 90, 90, 0.12);
  --info: #8fb4ff;
  --info-plein: #2f5bc4;
  --discord: #4752c4;                     /* bleu Discord assombri : blanc lisible */
  --discord-survol: #3c46ad;
  --discord-teinte: rgba(88, 101, 242, 0.14);

  /* Typographie */
  --police-titre: "Playfair Display", Georgia, "Times New Roman", serif;
  --police-texte: "Manrope", "Segoe UI", Arial, sans-serif;

  /* Formes */
  --rayon-s: 10px;
  --rayon: 14px;
  --rayon-l: 20px;
  --rayon-pilule: 999px;
  --ombre: 0 22px 54px rgba(0, 0, 0, 0.32);
  --ombre-douce: 0 10px 28px rgba(0, 0, 0, 0.22);

  /* Mouvement */
  --courbe: cubic-bezier(0.22, 1, 0.36, 1);
  --courbe-rebond: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duree: 240ms;

  /* Mise en page */
  --gouttiere: 32px;
  --hauteur-barre-mobile: 72px;

  color-scheme: dark;
}

/* ---------- 2. Thème clair (classe posée sur <html> par le script du <head>) ---------- */
.theme-light {
  --fond: #f2f5f3;
  --fond-2: #e9eeea;
  --surface: #ffffff;
  --surface-2: #f5f8f6;
  --surface-3: #eaf0ec;
  --surface-carte: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
  --barre-laterale: #fbfdfc;
  --bordure: rgba(16, 40, 28, 0.1);
  --bordure-forte: rgba(16, 40, 28, 0.2);
  --voile: rgba(10, 18, 14, 0.62);

  --texte: #13201a;
  --texte-2: #4f5d55;
  --texte-3: #5f6c64;

  --vert: #0d7a47;                        /* texte vert lisible sur blanc */
  --vert-doux: #0d7a47;
  /* En clair, pas de fond teinté sous du texte sombre : surfaces neutres + bordure/icône colorées */
  --vert-teinte: #f4f7f5;
  --or: #7a5a10;
  --or-vif: #8a6514;
  --or-teinte: #f4f7f5;
  --danger: #b3261e;
  --danger-teinte: #f4f7f5;
  --info: #2f5bc4;

  --ombre: 0 22px 54px rgba(20, 40, 30, 0.14);
  --ombre-douce: 0 10px 28px rgba(20, 40, 30, 0.1);

  color-scheme: light;
}

/* ---------- 3. Remise à zéro ---------- */
*, *::before, *::after { box-sizing: border-box; letter-spacing: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--vert); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--police-titre);
  font-weight: 700;
  line-height: 1.12;
  color: var(--texte);
  font-variant-numeric: lining-nums;   /* Playfair : chiffres alignés (sinon le 0 ressemble à un o) */
}
h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--vert); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--vert-plein); color: #fff; }
.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
body.defilement-bloque { overflow: hidden; }

/* ---------- 4. Typographie utilitaire ---------- */
/* Sur-titre : casse normale, couleur or, aucun tiret devant. */
.sur-titre {
  display: inline-block;
  color: var(--or);
  font-family: var(--police-texte);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}
.texte-2 { color: var(--texte-2); }
.texte-3 { color: var(--texte-3); }
.texte-vert { color: var(--vert); }
.texte-or { color: var(--or); }
.texte-danger { color: var(--danger); }
.chiffre { font-variant-numeric: tabular-nums; }
.titre-section { display: grid; gap: 10px; margin-bottom: 28px; }
.titre-section p { color: var(--texte-2); max-width: 70ch; }

/* ---------- 5. Icônes (SVG Lucide générés par D8.icone) ---------- */
.icone { width: 1.15em; height: 1.15em; flex: none; stroke-width: 2; }
.icone--l { width: 1.5em; height: 1.5em; }

/* ---------- 6. Boutons ---------- */
.bouton {
  --b-fond: var(--surface-2);
  --b-texte: var(--texte);
  --b-bord: var(--bordure-forte);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--b-bord);
  border-radius: var(--rayon-s);
  background: var(--b-fond);
  color: var(--b-texte);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--duree) var(--courbe), opacity var(--duree);
  will-change: transform;
}
.bouton:hover { text-decoration: none; transform: translateY(-2px); }
.bouton:active { transform: translateY(0) scale(0.98); }
.bouton:disabled, .bouton[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
/* Couches de survol : on anime l'opacité d'un calque, jamais la couleur de fond. */
.bouton::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: rgba(255, 255, 255, 0.08); opacity: 0; transition: opacity var(--duree);
  pointer-events: none;
}
.bouton:hover::after { opacity: 1; }
.bouton--principal { --b-fond: var(--vert-plein); --b-texte: #fff; --b-bord: transparent; }
.bouton--or { --b-fond: linear-gradient(135deg, var(--or-plein), var(--or-plein-2)); --b-texte: #fff; --b-bord: rgba(233, 199, 90, 0.4); }
.bouton--danger { --b-fond: var(--danger-plein); --b-texte: #fff; --b-bord: transparent; }
.bouton--discord { --b-fond: var(--discord); --b-texte: #fff; --b-bord: transparent; }
.bouton--fantome { --b-fond: transparent; --b-texte: var(--texte); --b-bord: var(--bordure-forte); }
.bouton--lien { --b-fond: transparent; --b-bord: transparent; --b-texte: var(--texte-2); padding-inline: 10px; }
.bouton--petit { min-height: 44px; padding: 8px 14px; font-size: 0.92rem; }
.bouton--icone { width: 46px; padding: 0; }
.bouton--bloc { width: 100%; }
.bouton.est-charge { pointer-events: none; opacity: 0.75; }

/* ---------- 7. Champs de formulaire ---------- */
.champ { display: grid; gap: 8px; }
.champ__libelle { font-weight: 600; font-size: 0.95rem; color: var(--texte); }
.champ__libelle .requis { color: var(--danger); margin-left: 2px; }
.champ__aide { font-size: 0.88rem; color: var(--texte-3); line-height: 1.45; }
.champ__erreur { font-size: 0.88rem; color: var(--danger); font-weight: 500; }
.saisie, .zone-texte, .selection {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--bordure-forte);
  border-radius: var(--rayon-s);
  background: var(--fond-2);
  color: var(--texte);
  font-size: 1rem;
  outline: none;
}
.zone-texte { min-height: 120px; resize: vertical; line-height: 1.5; }
.saisie::placeholder, .zone-texte::placeholder { color: var(--texte-3); opacity: 1; }
.saisie:focus, .zone-texte:focus, .selection:focus { border-color: var(--vert); }
.saisie:disabled, .zone-texte:disabled { opacity: 0.55; cursor: not-allowed; }
.saisie[aria-invalid="true"], .zone-texte[aria-invalid="true"] { border-color: var(--danger); }
.saisie-icone { position: relative; display: flex; align-items: center; }
.saisie-icone > .icone { position: absolute; left: 14px; color: var(--texte-3); pointer-events: none; }
.saisie-icone > .saisie { padding-left: 44px; }
.grille-champs { display: grid; gap: 18px; align-items: start; }
.grille-champs--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Curseur (range) */
.curseur { width: 100%; height: 44px; background: transparent; accent-color: var(--vert-plein); cursor: pointer; }

/* Cases radio sous forme de tuiles */
.choix-tuiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.choix-tuile { position: relative; display: block; cursor: pointer; }
.choix-tuile input { position: absolute; opacity: 0; inset: 0; }
.choix-tuile span {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 12px 14px; border: 1px solid var(--bordure-forte); border-radius: var(--rayon-s);
  background: var(--fond-2); font-weight: 500;
}
.choix-tuile span::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 2px solid var(--vert);
  opacity: 0; transition: opacity var(--duree);
}
.choix-tuile input:checked + span::after { opacity: 1; }
.choix-tuile input:focus-visible + span { outline: 2px solid var(--vert); outline-offset: 2px; }

/* Interrupteur (case à cocher stylée) */
.interrupteur { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 500; }
.interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interrupteur__piste {
  position: relative; flex: none; width: 48px; height: 28px; border-radius: var(--rayon-pilule);
  background: var(--surface-3); border: 1px solid var(--bordure-forte); overflow: hidden;
}
.interrupteur__piste::before { /* fond vert qui apparaît en opacité */
  content: ""; position: absolute; inset: 0; background: var(--vert-plein); opacity: 0; transition: opacity var(--duree);
}
.interrupteur__piste::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform var(--duree) var(--courbe); will-change: transform;
}
.interrupteur input:checked + .interrupteur__piste::before { opacity: 1; }
.interrupteur input:checked + .interrupteur__piste::after { transform: translateX(20px); }
.interrupteur input:focus-visible + .interrupteur__piste { outline: 2px solid var(--vert); outline-offset: 2px; }

/* Segments (groupe de boutons exclusifs : durée, garage…) */
.segments { display: flex; flex-wrap: wrap; gap: 8px; }
.segment {
  position: relative; min-height: 44px; padding: 9px 14px; border-radius: var(--rayon-s);
  border: 1px solid var(--bordure-forte); background: var(--fond-2); color: var(--texte);
  font-weight: 500; font-size: 0.94rem; line-height: 1.25; text-align: left;
  transition: transform var(--duree) var(--courbe);
}
.segment::before { /* fond actif vert plein, en opacité */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; background: var(--vert-plein);
  opacity: 0; transition: opacity var(--duree); z-index: 0;
}
.segment > * , .segment { z-index: 0; }
.segment span { position: relative; z-index: 1; }
.segment.est-actif { color: #fff; border-color: transparent; }
.segment.est-actif::before { opacity: 1; }
.segment:hover { transform: translateY(-1px); }
.segment:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 8. Cartes génériques ---------- */
.carte {
  position: relative;
  background: var(--surface-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 24px;
}
.carte--plate { background: var(--surface); }
.carte__titre { font-size: 1.25rem; margin-bottom: 6px; }
.panneau { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-l); padding: 28px; }

/* ---------- 9. Badges et pastilles (toujours fond foncé + texte blanc) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 4px 11px;
  border-radius: var(--rayon-pilule);
  background: #23272f; color: #fff;
  font-size: 0.84rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.badge .icone { width: 14px; height: 14px; }
.badge--vert { background: var(--vert-plein); }
.badge--or { background: linear-gradient(135deg, var(--or-plein) 0%, var(--or-plein-2) 100%); box-shadow: inset 0 0 0 1px rgba(255, 226, 140, 0.35); }
.badge--danger { background: var(--danger-plein); }
.badge--info { background: var(--info-plein); }
.badge--discord { background: var(--discord); }
.badge--sombre { background: rgba(8, 9, 11, 0.82); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.pastille { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--vert); }

/* ---------- 10. Modales ---------- */
.modale {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  padding: 24px;
  overflow-y: auto;
}
.modale__voile {
  position: fixed; inset: 0; background: var(--voile);
  opacity: 0; transition: opacity 260ms ease; will-change: opacity;
}
.modale__boite {
  position: relative;
  width: min(100%, 560px);
  max-height: none;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--bordure-forte);
  border-radius: var(--rayon-l);
  box-shadow: var(--ombre);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: transform 320ms var(--courbe), opacity 260ms ease;
  will-change: transform, opacity;
}
.modale--m .modale__boite { width: min(100%, 720px); }
.modale--l .modale__boite { width: min(100%, 960px); }
.modale--xl .modale__boite { width: min(100%, 1180px); }
.modale.est-ouverte .modale__voile { opacity: 1; }
.modale.est-ouverte .modale__boite { opacity: 1; transform: none; }
.modale__entete { display: grid; gap: 6px; padding: 26px 64px 0 28px; }
.modale__entete h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.modale__corps { padding: 22px 28px 28px; }
.modale__pied { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 0 28px 28px; }
.modale__fermer {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--bordure-forte); border-radius: 50%;
  background: var(--surface-2); color: var(--texte);
  transition: transform var(--duree) var(--courbe);
}
.modale__fermer:hover { transform: rotate(90deg); }

/* ---------- 11. Tableaux ---------- */
.tableau-conteneur { overflow-x: auto; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
.tableau { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tableau th, .tableau td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.tableau th { color: var(--texte-2); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr { transition: opacity var(--duree); }
.tableau .nombre { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 12. Toasts ---------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 2000;
  display: grid; gap: 10px; width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--rayon);
  background: #15181e; color: #fff;           /* toujours sombre, même en thème clair */
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--ombre);
  font-weight: 500; line-height: 1.45;
  pointer-events: auto;
  opacity: 0; transform: translateY(16px) scale(0.98);
  transition: transform 320ms var(--courbe), opacity 240ms ease;
  will-change: transform, opacity;
}
.toast.est-visible { opacity: 1; transform: none; }
.toast .icone { margin-top: 2px; color: #22d477; }
.toast--erreur .icone { color: #ff8a8a; }
.toast--info .icone { color: #9dbcff; }

/* ---------- 13. Onglets ---------- */
.onglets { display: flex; gap: 6px; padding: 5px; border-radius: var(--rayon); background: var(--surface-2); border: 1px solid var(--bordure); overflow-x: auto; }
.onglet {
  position: relative; min-height: 44px; padding: 8px 16px; border: 0; border-radius: var(--rayon-s);
  background: transparent; color: var(--texte-2); font-weight: 600; white-space: nowrap;
}
.onglet::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--vert-plein); opacity: 0; transition: opacity var(--duree); }
.onglet span { position: relative; }
.onglet[aria-selected="true"] { color: #fff; }
.onglet[aria-selected="true"]::before { opacity: 1; }
.panneau-onglet { animation: d8-apparition 360ms var(--courbe) both; }

/* ---------- 14. Menu déroulant personnalisé (D8.menuDeroulant) ---------- */
.menu-deroulant { position: relative; }
.menu-deroulant__bouton {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px;
  padding: 8px 14px; border: 1px solid var(--bordure-forte); border-radius: var(--rayon-s);
  background: var(--fond-2); color: var(--texte); text-align: left;
}
.menu-deroulant__bouton:focus-visible, .menu-deroulant.est-ouvert .menu-deroulant__bouton { border-color: var(--vert); outline: none; }
.menu-deroulant__valeur { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.menu-deroulant__valeur strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-deroulant__valeur small { color: var(--texte-2); font-size: 0.86rem; }
.menu-deroulant__valeur.est-vide strong { color: var(--texte-3); font-weight: 500; }
.menu-deroulant__fleche { transition: transform var(--duree) var(--courbe); color: var(--texte-2); }
.menu-deroulant.est-ouvert .menu-deroulant__fleche { transform: rotate(180deg); }
.menu-deroulant__liste {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  display: grid; gap: 4px; max-height: 320px; overflow-y: auto;
  padding: 6px; margin: 0; list-style: none;
  border: 1px solid var(--bordure-forte); border-radius: var(--rayon);
  background: var(--surface); box-shadow: var(--ombre);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--courbe);
  will-change: transform, opacity;
}
.menu-deroulant.est-ouvert .menu-deroulant__liste { opacity: 1; transform: none; pointer-events: auto; }
.menu-deroulant--grille .menu-deroulant__liste { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.menu-deroulant__option {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 46px;
  padding: 8px 10px; border-radius: var(--rayon-s); cursor: pointer; line-height: 1.3;
}
.menu-deroulant__option::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--surface-3); opacity: 0; transition: opacity 160ms; }
.menu-deroulant__option > * { position: relative; }
.menu-deroulant__option.est-survole::before, .menu-deroulant__option:hover::before { opacity: 1; }
.menu-deroulant__option[aria-selected="true"]::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--vert);
}
.menu-deroulant__option[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.menu-deroulant__option img { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }
.menu-deroulant--grille .menu-deroulant__option { flex-direction: column; align-items: stretch; }
.menu-deroulant--grille .menu-deroulant__option img { width: 100%; height: 82px; }
.menu-deroulant__texte { display: grid; min-width: 0; }
.menu-deroulant__texte strong { font-weight: 600; font-size: 0.95rem; }
.menu-deroulant__texte small { color: var(--texte-2); font-size: 0.85rem; }

/* ---------- 15. Squelettes de chargement ---------- */
.squelette {
  position: relative; overflow: hidden; border-radius: var(--rayon-s);
  background: var(--surface-2); min-height: 16px;
}
.squelette::after { /* reflet qui glisse : transform uniquement */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.07) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: d8-reflet 1.4s ease-in-out infinite;
  will-change: transform;
}
.theme-light .squelette::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent); }
.squelette--texte { height: 14px; margin: 8px 0; }
.squelette--titre { height: 26px; width: 60%; }
.squelette--image { aspect-ratio: 16 / 10; border-radius: var(--rayon); }

/* Indicateur de chargement (rotation = transform) */
.chargeur { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--bordure-forte); border-top-color: var(--vert); animation: d8-rotation 0.8s linear infinite; will-change: transform; }

/* État vide */
.etat-vide { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--texte-2); border: 1px dashed var(--bordure-forte); border-radius: var(--rayon); }
.etat-vide .icone { width: 36px; height: 36px; color: var(--texte-3); }
.etat-vide strong { color: var(--texte); font-size: 1.1rem; font-weight: 600; }

/* Message dans un formulaire */
.message-formulaire { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--rayon-s); font-weight: 500; line-height: 1.45; }
.message-formulaire--succes { background: var(--vert-teinte); color: var(--texte); border: 1px solid rgba(34, 212, 119, 0.35); }
.message-formulaire--succes .icone { color: var(--vert); }
.message-formulaire--erreur { background: var(--danger-teinte); color: var(--texte); border: 1px solid rgba(255, 90, 90, 0.35); }
.message-formulaire--erreur .icone { color: var(--danger); }
.message-formulaire--info { background: var(--surface-2); color: var(--texte); border: 1px solid var(--bordure-forte); }

/* Filet décoratif vert -> or (statique) */
.filet { height: 2px; border: 0; background: linear-gradient(90deg, var(--vert), var(--or-vif) 60%, transparent); }

/* Étoiles de notation */
.etoiles { display: inline-flex; gap: 2px; color: var(--or); }
.etoiles .icone { width: 18px; height: 18px; }
.etoiles .est-vide { color: var(--texte-3); opacity: 0.5; }
.etoiles .est-pleine { fill: currentColor; }

/* Tuile de statistique : libellé, valeur, détail (fond neutre, icône colorée) */
.tuile-stat {
  display: grid; gap: 6px; align-content: start; min-width: 0;
  padding: 18px; border-radius: var(--rayon); background: var(--surface); border: 1px solid var(--bordure);
}
.tuile-stat__haut { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--texte-2); font-weight: 600; font-size: 0.92rem; }
.tuile-stat__haut .icone { color: var(--vert); width: 20px; height: 20px; }
.tuile-stat__valeur { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tuile-stat__detail { color: var(--texte-3); font-size: 0.88rem; line-height: 1.4; }
.tuile-stat--or .tuile-stat__haut .icone { color: var(--or); }
.tuile-stat--danger .tuile-stat__haut .icone { color: var(--danger); }
.tuile-stat--texte .tuile-stat__valeur { font-size: 1.2rem; line-height: 1.3; }

/* Barre de progression : la jauge est mise à l'échelle (transform), jamais sa largeur */
.barre-progres { position: relative; height: 10px; border-radius: var(--rayon-pilule); background: var(--surface-3); overflow: hidden; }
.barre-progres__jauge {
  position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--vert-plein), var(--vert));
  transform-origin: left center; transform: scaleX(var(--progres, 0)); transition: transform 600ms var(--courbe); will-change: transform;
}
.barre-progres--or .barre-progres__jauge { background: linear-gradient(90deg, var(--or-plein), var(--or-vif)); }

/* ---------- 16. Animations communes (transform / opacity seulement) ---------- */
@keyframes d8-apparition { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes d8-fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes d8-reflet { to { transform: translateX(100%); } }
@keyframes d8-rotation { to { transform: rotate(360deg); } }
@keyframes d8-tremblement {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-6px) rotate(-3deg); }
  40% { transform: translateX(6px) rotate(3deg); }
  60% { transform: translateX(-4px) rotate(-2deg); }
  80% { transform: translateX(4px) rotate(2deg); }
}
@keyframes d8-respiration { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.apparait { animation: d8-apparition 480ms var(--courbe) both; }

/* ---------- 17. Mobile ---------- */
@media (max-width: 760px) {
  :root { --gouttiere: 16px; }
  .grille-champs--2 { grid-template-columns: 1fr; }
  .modale { padding: 12px; align-items: start; }
  .modale__entete { padding: 22px 60px 0 20px; }
  .modale__corps { padding: 18px 20px 22px; }
  .modale__pied { padding: 0 20px 22px; }
  .modale__pied .bouton { flex: 1; }
  .toasts { right: 16px; left: 16px; bottom: 16px; width: auto; }
  .choix-tuiles { grid-template-columns: 1fr; }
}
