/*
 * Charte Franck Barnett v1 : la base commune des applis (Forge, Bureau, FB Analytics, Lanceur).
 * Référence visuelle : design/charte.html. Mémoire : memoire/charte-design.md.
 *
 * Source : partage/charte/. Ne pas modifier les copies des sites : lancer `node outils/charte.mjs` après un changement.
 *
 * Mode d'emploi
 *   <html data-app="analytics">         l'accent de l'appli (forge, analytics, lanceur, bureau, sav) ; ou --accent à la main
 *   <html data-theme="light">           le mode clair (sombre par défaut)
 *   Polices : Bricolage Grotesque, Inter, Instrument Serif, JetBrains Mono (Google Fonts, voir charte.js).
 *   Composants préfixés « ch- » pour ne rien casser chez une appli qui a déjà ses propres classes.
 *   Animations : prefers-reduced-motion respecté ici et dans charte.js.
 */

/* =========================================================== 1. JETONS */
@property --accent   { syntax: '<color>'; inherits: true; initial-value: #ff9a3c; }
@property --accent-2 { syntax: '<color>'; inherits: true; initial-value: #ff5f8f; }
@property --ch-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  /* Polices */
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Tailles : 8 crans */
  --t-xs: 12px; --t-sm: 13px; --t-md: 14px; --t-lg: 16px;
  --t-xl: 20px; --t-2xl: 28px; --t-3xl: 40px; --t-4xl: clamp(44px, 6.4vw, 84px);

  /* Espaces (pas de 4) */
  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 24px; --e-6: 32px; --e-7: 48px; --e-8: 72px;

  /* Rayons */
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;

  /* Motion : durées et courbes */
  --d-1: 120ms; --d-2: 200ms; --d-3: 320ms; --d-4: 560ms; --d-5: 900ms;
  --e-sortie: cubic-bezier(.22, 1, .36, 1);
  --e-expo: cubic-bezier(.16, 1, .3, 1);
  --e-tiroir: cubic-bezier(.32, .72, 0, 1);
  --e-rebond: cubic-bezier(.34, 1.56, .64, 1);
  /* Ressort 300 / 25 */
  --e-ressort: linear(0, .076, .243, .437, .618, .767, .879, .955, 1.002, 1.027, 1.037, 1.037, 1.032, 1.025, 1.018, 1.011, 1.006, 1.003, 1.001, .999, .999, 1);

  /* Couleurs : sombre par défaut */
  --fond: #090b14;
  --surface: #10131e;
  --surface-2: #161a28;
  --surface-3: #1e2334;
  --ligne: rgba(255, 255, 255, .075);
  --ligne-forte: rgba(255, 255, 255, .15);
  --texte: #eef0f7;
  --doux: #9aa0b4;
  --tres-doux: #636a80;
  --creme: #efe7dc; --logo: #efe7dc;
  --bon: #3fd68a; --alerte: #fbbf24; --danger: #ff6b6b;
  --reflet: rgba(255, 255, 255, .05);
  --o-1: inset 0 1px 0 var(--reflet), 0 0 0 1px var(--ligne);
  --o-2: inset 0 1px 0 var(--reflet), 0 0 0 1px var(--ligne), 0 18px 40px -24px rgba(0, 0, 0, .85);
  --o-3: inset 0 1px 0 var(--reflet), 0 0 0 1px var(--ligne-forte), 0 40px 80px -32px rgba(0, 0, 0, .95);
  --o-accent: 0 16px 40px -16px color-mix(in srgb, var(--accent) 70%, transparent);
  --verre: color-mix(in srgb, var(--fond) 92%, transparent);
  --encre-accent: #160b02;
  --degrade-accent: linear-gradient(135deg, var(--accent), var(--accent-2));

  color-scheme: dark;
}

/* Un accent par appli : le reste ne bouge pas */
[data-app="forge"]     { --accent: #8b5cf6; --accent-2: #c084fc; --encre-accent: #ffffff; }
[data-app="analytics"] { --accent: #ff9a3c; --accent-2: #ff5f8f; --encre-accent: #1b0d05; }
[data-app="lanceur"]   { --accent: #22d3ee; --accent-2: #6366f1; --encre-accent: #04161c; }
[data-app="bureau"]    { --accent: #e3b877; --accent-2: #efe7dc; --encre-accent: #1a1206; }
[data-app="sav"]       { --accent: #6aa8ff; --accent-2: #7ee0d2; --encre-accent: #04122b; }

:root[data-theme="light"] {
  --fond: #f4f3ef; --surface: #ffffff; --surface-2: #f2f1ec; --surface-3: #e8e6df;
  --ligne: rgba(16, 18, 30, .08); --ligne-forte: rgba(16, 18, 30, .16);
  --texte: #14161f; --doux: #5c6173; --tres-doux: #8d91a0; --logo: #14161f;
  --bon: #13894f; --alerte: #a86a00; --danger: #c93a3a;
  --reflet: rgba(255, 255, 255, .9);
  --o-1: 0 0 0 1px var(--ligne), 0 1px 2px rgba(16, 18, 30, .04);
  --o-2: 0 0 0 1px var(--ligne), 0 18px 40px -26px rgba(16, 18, 30, .28);
  --o-3: 0 0 0 1px var(--ligne-forte), 0 40px 80px -36px rgba(16, 18, 30, .4);
  --verre: color-mix(in srgb, var(--fond) 94%, transparent);
  color-scheme: light;
}
:root[data-theme="light"][data-app="forge"]     { --accent: #7c3aed; --accent-2: #a855f7; }
:root[data-theme="light"][data-app="analytics"] { --accent: #f07b16; --accent-2: #e8457a; }
:root[data-theme="light"][data-app="lanceur"]   { --accent: #0891b2; --accent-2: #4f46e5; --encre-accent: #ffffff; }
:root[data-theme="light"][data-app="bureau"]    { --accent: #a77a35; --accent-2: #6b5330; --encre-accent: #ffffff; }
:root[data-theme="light"][data-app="sav"]       { --accent: #2563eb; --accent-2: #0f9e8a; --encre-accent: #ffffff; }

/* =========================================================== 2. AIDES */
.ch-chiffre { font-variant-numeric: tabular-nums; }
.ch-display { font-family: var(--f-display); font-stretch: 92%; letter-spacing: -.03em; }
.ch-serif { font: italic 400 1.04em/1 var(--f-serif); letter-spacing: -.01em; padding-right: .06em; background: var(--degrade-accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ch-surtitre { display: flex; align-items: center; gap: 12px; margin: 0; font: 700 var(--t-xs)/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--doux); }
.ch-surtitre::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: var(--degrade-accent); }

/* Fond vivant : deux halos qui dérivent lentement (à poser une fois, sous tout) */
.ch-aurore { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ch-aurore i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .14; }
.ch-aurore i:nth-child(1) { background: var(--accent); top: -34vmax; left: -16vmax; animation: ch-aurore 18s ease-in-out infinite; }
.ch-aurore i:nth-child(2) { background: var(--accent-2); top: -38vmax; right: -24vmax; opacity: .1; animation: ch-aurore 22s ease-in-out infinite reverse; }
@keyframes ch-aurore { 50% { transform: translate(5%, 4%) scale(1.08); } }

/* Entrées : [data-revele] au défilement (une fois, charte.js), .ch-entre tout de suite ; --i décale de 70 ms */
[data-revele] { opacity: 0; transform: translateY(16px); transition: opacity var(--d-4) var(--e-sortie), transform var(--d-4) var(--e-sortie); transition-delay: calc(var(--i, 0) * 70ms); }
[data-revele].vu { opacity: 1; transform: none; }
.ch-entre { animation: ch-monte var(--d-4) var(--e-sortie) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes ch-monte { from { opacity: 0; transform: translateY(16px); } }
@keyframes ch-fondu { from { opacity: 0; } }

/* =========================================================== 3. CARTE */
.ch-carte { position: relative; min-width: 0; border-radius: var(--r-lg); padding: var(--e-5); background: radial-gradient(120% 90% at 50% 0%, var(--reflet), transparent 55%), var(--surface); box-shadow: var(--o-2); }
.ch-carte--action { cursor: pointer; transition: transform var(--d-3) var(--e-sortie), box-shadow var(--d-3) var(--e-sortie); }
.ch-carte--action:hover { transform: translateY(-3px); box-shadow: var(--o-3); }
.ch-carte--action:active { transform: translateY(-1px) scale(.995); transition-duration: var(--d-1); }
.ch-etiquette { font-size: var(--t-sm); color: var(--doux); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.ch-valeur { font: 700 var(--t-3xl)/1 var(--f-display); font-stretch: 92%; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* Carte vedette : liseré lumineux qui tourne et halo d'accent */
.ch-vedette { isolation: isolate; overflow: hidden; }
.ch-vedette::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1; pointer-events: none;
  background: conic-gradient(from var(--ch-angle), transparent 0 62%, color-mix(in srgb, var(--accent) 80%, transparent) 76%, var(--accent-2) 84%, transparent 94%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ch-tourne 7s linear infinite; }
.ch-vedette::after { content: ""; position: absolute; inset: auto -20% -60% 30%; height: 120%; z-index: -2; pointer-events: none; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); }
.ch-vedette .ch-valeur { background: linear-gradient(95deg, var(--texte) 30%, color-mix(in srgb, var(--accent) 55%, var(--texte))); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes ch-tourne { to { --ch-angle: 360deg; } }

/* Petite courbe (charte.js : Charte.etincelle) */
.ch-etincelle { display: block; width: 100%; height: 44px; overflow: visible; cursor: crosshair; }
.ch-etincelle .ch-trace { fill: none; stroke: var(--doux); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.ch-etincelle .ch-trace-fin { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.ch-etincelle .ch-aire { opacity: .9; }
.ch-etincelle .ch-point { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.ch-etincelle .ch-halo { fill: var(--accent); opacity: .25; transform-box: fill-box; transform-origin: center; animation: ch-halo 2.4s var(--e-sortie) infinite; }
.ch-etincelle .ch-curseur { stroke: var(--ligne-forte); stroke-width: 1; opacity: 0; transition: opacity var(--d-2); }
.ch-etincelle .ch-point-survol { fill: var(--texte); opacity: 0; transition: opacity var(--d-2); }
.ch-etincelle.survol .ch-curseur, .ch-etincelle.survol .ch-point-survol { opacity: 1; }
.ch-dessine { stroke-dasharray: var(--long); stroke-dashoffset: var(--long); animation: ch-dessine var(--d-5) var(--e-expo) forwards .15s; }
@keyframes ch-dessine { to { stroke-dashoffset: 0; } }
@keyframes ch-halo { from { transform: scale(1); opacity: .35; } to { transform: scale(3.2); opacity: 0; } }
.ch-info-point { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); padding: 6px 9px; border-radius: var(--r-sm); background: var(--surface-3); box-shadow: var(--o-2); font-size: var(--t-xs); white-space: nowrap; opacity: 0; transition: opacity var(--d-2); }
.ch-info-point b { font-variant-numeric: tabular-nums; }
.ch-info-point.vu { opacity: 1; }

/* =========================================================== 4. BOUTONS */
.ch-bouton { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-sm); font: 600 var(--t-md)/1 var(--f-ui); text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate; white-space: nowrap;
  background: var(--surface-2); color: var(--texte); box-shadow: var(--o-1);
  transition: transform var(--d-2) var(--e-sortie), box-shadow var(--d-2) var(--e-sortie), background-color var(--d-2), color var(--d-2); }
.ch-bouton svg { width: 16px; height: 16px; transition: transform var(--d-3) var(--e-rebond); }
.ch-bouton:hover:not(:disabled) { transform: translateY(-1px); background: var(--surface-3); }
.ch-bouton:active:not(:disabled) { transform: translateY(0) scale(.97); transition-duration: var(--d-1); }
.ch-bouton:disabled { opacity: .45; cursor: not-allowed; }
.ch-bouton.ch-grand { height: 48px; padding: 0 22px; font-size: var(--t-lg); border-radius: var(--r-md); }
.ch-bouton.ch-petit { height: 32px; padding: 0 12px; font-size: var(--t-sm); }
.ch-bouton.ch-carre { width: 40px; padding: 0; }
.ch-primaire { color: var(--encre-accent) !important; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, white), var(--accent)) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 1px color-mix(in srgb, var(--accent) 70%, black) !important; }
.ch-primaire:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 1px color-mix(in srgb, var(--accent) 70%, black), var(--o-accent) !important; }
.ch-primaire::after { content: ""; position: absolute; inset: -2px; z-index: -1; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%); transform: translateX(-120%); }
.ch-primaire:hover:not(:disabled)::after, .ch-primaire.ch-brille::after { animation: ch-balaye .9s var(--e-sortie); }
.ch-fantome { background: transparent !important; box-shadow: none !important; color: var(--doux); }
.ch-fantome:hover:not(:disabled) { color: var(--texte); background: var(--surface-2) !important; }
.ch-danger { background: color-mix(in srgb, var(--danger) 14%, transparent) !important; color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 30%, transparent) !important; }
@keyframes ch-balaye { to { transform: translateX(120%); } }

/* Chargement puis coche (charte.js : Charte.travail) */
.ch-lib { display: inline-flex; align-items: center; gap: inherit; transition: opacity var(--d-2), transform var(--d-3) var(--e-sortie); }
.ch-roue, .ch-ok { position: absolute; inset: 0; margin: auto; opacity: 0; pointer-events: none; transition: opacity var(--d-2); }
.ch-roue { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ch-roue .7s linear infinite; }
svg.ch-ok { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ch-ok path { stroke-dasharray: 20; stroke-dashoffset: 20; }
[aria-busy="true"] > .ch-lib, .ch-reussi > .ch-lib { opacity: 0; transform: translateY(-6px); }
[aria-busy="true"] > .ch-roue { opacity: 1; }
.ch-reussi > .ch-ok { opacity: 1; }
.ch-reussi > .ch-ok path { transition: stroke-dashoffset .45s var(--e-expo) .05s; stroke-dashoffset: 0; }
@keyframes ch-roue { to { transform: rotate(360deg); } }

/* Onde au clic (charte.js) */
.ch-onde { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); animation: ch-onde .6s var(--e-sortie) forwards; pointer-events: none; z-index: -1; }
@keyframes ch-onde { to { transform: scale(var(--taille, 30)); opacity: 0; } }

/* =========================================================== 5. ONGLETS (pastille qui glisse) */
.ch-onglets { position: relative; display: inline-flex; padding: 4px; border-radius: var(--r-full); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ligne); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ch-onglets::-webkit-scrollbar { display: none; }
.ch-onglets > button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-full); background: none; color: var(--doux); font: 600 var(--t-sm)/1 var(--f-ui); cursor: pointer; white-space: nowrap; transition: color var(--d-2); }
.ch-onglets > button:hover, .ch-onglets > button[aria-selected="true"], .ch-onglets > button.on { color: var(--texte); }
.ch-nb { min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r-full); display: inline-grid; place-items: center; font: 700 11px/1 var(--f-mono); background: var(--surface-3); color: var(--doux); transition: background-color var(--d-3), color var(--d-3); }
[aria-selected="true"] > .ch-nb, .on > .ch-nb { background: var(--accent); color: var(--encre-accent); }
.ch-glisse { position: absolute; z-index: 0; top: 0; left: 0; height: 100%; border-radius: var(--r-full); pointer-events: none;
  background: var(--surface); box-shadow: inset 0 1px 0 var(--reflet), 0 0 0 1px var(--ligne), 0 6px 16px -8px rgba(0, 0, 0, .5);
  transition: transform .6s var(--e-ressort), width .6s var(--e-ressort), height .6s var(--e-ressort), opacity var(--d-2); }
.ch-panneau { animation: ch-monte var(--d-4) var(--e-sortie) both; }

/* =========================================================== 6. TABLEAU */
.ch-tableau { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-md); font-variant-numeric: tabular-nums; }
.ch-tableau th { position: sticky; top: 0; z-index: 2; padding: 10px 14px; text-align: left; font: 700 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--tres-doux); background: var(--surface); border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.ch-tableau th.n, .ch-tableau td.n { text-align: right; }
.ch-tableau th[aria-sort] { cursor: pointer; transition: color var(--d-2); }
.ch-tableau th[aria-sort]:hover, .ch-tableau th[aria-sort="ascending"], .ch-tableau th[aria-sort="descending"] { color: var(--texte); }
.ch-tableau .ch-fl { display: inline-block; width: 10px; height: 10px; margin-left: 5px; vertical-align: -1px; opacity: 0; transition: transform var(--d-3) var(--e-rebond), opacity var(--d-2); }
.ch-tableau th[aria-sort]:hover .ch-fl { opacity: .45; }
.ch-tableau th[aria-sort="ascending"] .ch-fl, .ch-tableau th[aria-sort="descending"] .ch-fl { opacity: 1; color: var(--accent); }
.ch-tableau th[aria-sort="ascending"] .ch-fl { transform: rotate(180deg); }
.ch-tableau td { padding: 12px 14px; border-bottom: 1px solid var(--ligne); white-space: nowrap; transition: background-color var(--d-2), box-shadow var(--d-3) var(--e-sortie); }
.ch-tableau tbody tr { position: relative; }
.ch-tableau tbody tr:last-child td { border-bottom: 0; }
.ch-tableau tbody tr:hover td { background: color-mix(in srgb, var(--texte) 3%, transparent); }
.ch-tableau tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.ch-positif { color: var(--bon); } .ch-negatif { color: var(--danger); }

/* =========================================================== 7. PASTILLE D'ÉTAT */
.ch-pastille { --c: var(--doux); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--r-full); font: 600 var(--t-xs)/1 var(--f-ui); white-space: nowrap;
  color: color-mix(in srgb, var(--c) 82%, var(--texte)); background: color-mix(in srgb, var(--c) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 26%, transparent); }
.ch-pastille svg { width: 13px; height: 13px; }
.ch-pastille.bon { --c: var(--bon); } .ch-pastille.alerte { --c: var(--alerte); } .ch-pastille.danger { --c: var(--danger); } .ch-pastille.accent { --c: var(--accent); }
.ch-direct { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--bon)); box-shadow: 0 0 0 0 color-mix(in srgb, var(--c, var(--bon)) 60%, transparent); animation: ch-direct 1.8s var(--e-sortie) infinite; }
@keyframes ch-direct { to { box-shadow: 0 0 0 7px transparent; } }

/* =========================================================== 8. JAUGES */
/* Linéaire : --v (0 à 1) et --c ; se remplit quand .vu est posé (sur elle ou un parent) */
.ch-metre { position: relative; width: 72px; height: 6px; border-radius: var(--r-full); background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); }
.ch-metre > i { position: absolute; inset: 0; border-radius: inherit; background: var(--c, var(--accent)); transform-origin: left; transform: scaleX(0); transition: transform var(--d-5) var(--e-expo); }
.vu .ch-metre > i, .ch-metre.vu > i { transform: scaleX(var(--v)); }
.ch-metre > u { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--texte); opacity: .75; }
/* Anneau : --v (0 à 1) et --c */
.ch-anneau { --c: var(--accent); position: relative; width: 120px; height: 120px; }
.ch-anneau svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ch-anneau circle { fill: none; stroke-width: 10; }
.ch-anneau .ch-piste { stroke: color-mix(in srgb, var(--c) 16%, transparent); }
.ch-anneau .ch-arc { stroke: var(--c); stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.1s var(--e-expo), stroke var(--d-3); }
.vu .ch-anneau .ch-arc, .ch-anneau.vu .ch-arc { stroke-dashoffset: calc(100 - var(--v, 0) * 100); }

/* =========================================================== 9. MODALE (s'ouvre depuis l'élément cliqué) */
/* charte.js : Charte.ouvrir(panneau, { depuis, fond }) ; Charte.fermer(panneau, { fond }) */
.ch-modale-fond { position: fixed; inset: 0; z-index: 40; background: color-mix(in srgb, var(--fond) 55%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0; pointer-events: none; transition: opacity var(--d-3) var(--e-sortie); }
.ch-modale-fond.vu { opacity: 1; pointer-events: auto; }
.ch-modale-panneau { position: fixed; inset: 12px; z-index: 41; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--o-3); overflow: auto; overscroll-behavior: contain; visibility: hidden; }
@media (min-width: 720px) { .ch-modale-panneau { inset: 20px; } }
.ch-modale-panneau.ch-ouverte { visibility: visible; animation: ch-ouvre var(--d-4) var(--e-tiroir) both; }
.ch-modale-panneau.ch-ferme { visibility: visible; animation: ch-ferme .42s var(--e-tiroir) both; }
@keyframes ch-ouvre { from { clip-path: inset(var(--h0, 30%) var(--d0, 30%) var(--b0, 30%) var(--g0, 30%) round var(--r-lg)); } to { clip-path: inset(0 round var(--r-xl)); } }
@keyframes ch-ferme { from { clip-path: inset(0 round var(--r-xl)); } to { clip-path: inset(var(--h0, 30%) var(--d0, 30%) var(--b0, 30%) var(--g0, 30%) round var(--r-lg)); opacity: .3; } }
.ch-modale-panneau.ch-ouverte .ch-modale-corps > * { animation: ch-monte var(--d-4) var(--e-sortie) both; animation-delay: calc(140ms + var(--i, 0) * 70ms); }
.ch-modale-tete { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: var(--e-3); padding: var(--e-4) var(--e-5); background: var(--surface); border-bottom: 1px solid var(--ligne); }

/* =========================================================== 10. SQUELETTE */
.ch-squelette { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-md); }
.ch-squelette::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--texte) 7%, transparent) 50%, transparent 80%); animation: ch-balaye 1.4s ease-in-out infinite; }

/* =========================================================== 11. MOINS DE MOUVEMENT */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .ch-aurore i, .ch-vedette::before, .ch-etincelle .ch-halo, .ch-direct, .ch-squelette::after { animation: none !important; }
  [data-revele] { opacity: 1; transform: none; }
}
