/* ══════════════════════════════════════════════════════════
   ui.css — نظام التصميم المشترك (الموقع، حساب الزبون، الإدارة)
   Tokens + reset + composants de base. Léger, sans librairie, RTL d'abord.
   Les écrans chargent en plus : app.css (client), admin.css (console),
   commerce.css (boutique + SMM), chat.css (assistant). Voir docs/design/DESIGN-SYSTEM.md.
   ══════════════════════════════════════════════════════════ */

/* ── 1. Tokens ─────────────────────────────────────────────
   Chaque couleur est écrite UNE seule fois, sous la forme
     --x: var(--if-light, <clair>) var(--if-dark, <sombre>);
   En clair, --if-light est « initial » (valeur invalide → le repli clair est pris) et
   --if-dark est vide (rien n'est substitué) ; en sombre c'est l'inverse. Le mode sombre
   n'est donc plus dupliqué : les deux sélecteurs sombres ne basculent que ces deux
   interrupteurs (voir la fin de ce bloc). */
:root {
  --if-light: initial; --if-dark: ;

  /* Sponsi — ألوان «السوشيال»: نفس الإحساس متاع فيسبوك وإنستغرام وتيك توك اللي الحريف عايش فيهم.
     --brand      : أزرق Meta — روابط، نص وأيقونات بلون الماركة، حلقة التركيز.
     --brand-fill : خلفية الأزرار والعناصر المختارة (نصّها --brand-ink أبيض في الوضعين).
     --accent     : وردي إنستغرام — تعبئة فقط (نصّها --accent-ink). --accent-text : نص/أيقونة وردي.
     --accent-hi  : برتقالي إنستغرام (زينة فقط). --tt-* : لمسات تيك توك (زينة فقط، أبداً نص).
     --*-solid    : خلفية حالة تحمل نص أبيض (--solid-ink). --line-strong : حدود الحقول (≥ 3:1).
     --grad       : أزرق فيسبوك → بنفسجي → ماجنتا إنستغرام (بطاقات الفلوس، نص --grad-ink). */
  --bg: var(--if-light, #f0f2f5) var(--if-dark, #18191a);
  --surface: var(--if-light, #ffffff) var(--if-dark, #242526);
  --surface-2: var(--if-light, #f2f3f5) var(--if-dark, #323436);
  --surface-3: var(--if-light, #e4e6eb) var(--if-dark, #3a3b3c);
  --ink: var(--if-light, #1c1e21) var(--if-dark, #e4e6eb);
  --ink-2: var(--if-light, #4b4f56) var(--if-dark, #b0b3b8);
  --muted: var(--if-light, #65676b) var(--if-dark, #a8abb0);
  --line: var(--if-light, #dadde1) var(--if-dark, #3e4042);
  --line-strong: var(--if-light, #86898d) var(--if-dark, #737679);

  --brand: var(--if-light, #0a5ce6) var(--if-dark, #4f9fff);
  --brand-2: var(--if-light, #084bbd) var(--if-dark, #72b3ff);
  --brand-ink: #ffffff;
  --brand-soft: var(--if-light, #e7f0ff) var(--if-dark, #172b47);
  --brand-fill: var(--if-light, #0a5ce6) var(--if-dark, #2374e1);
  --brand-fill-2: var(--if-light, #084bbd) var(--if-dark, #1b64c7);
  --brand-solid: var(--if-light, #0866ff) var(--if-dark, #1b64c7);
  --brand-deep: var(--if-light, #0747b3) var(--if-dark, #0a3d8f);
  --brand-deeper: var(--if-light, #05307a) var(--if-dark, #0b1a33);
  --brand-hi: #2d7dff;

  --accent: var(--if-light, #d62a66) var(--if-dark, #f06fae);
  --accent-soft: var(--if-light, #fde8f1) var(--if-dark, #3d1a2d);
  --accent-ink: var(--if-light, #ffffff) var(--if-dark, #2a0717);
  --accent-text: var(--if-light, #b3186a) var(--if-dark, #f58bbd);
  --accent-hi: #f77737;

  --ok: var(--if-light, #1a7f37) var(--if-dark, #5ac26a);
  --ok-soft: var(--if-light, #eaf6ed) var(--if-dark, #1c3322);
  --ok-solid: #1a7f37;
  --warn: var(--if-light, #986100) var(--if-dark, #f5c451);   /* #986100 : 4.63:1 sur --bg (l’ancien #9c6400 faisait 4.42) */
  --warn-soft: var(--if-light, #fff5dd) var(--if-dark, #3a3016);
  --warn-solid: var(--if-light, #9c6400) var(--if-dark, #8f5b00);
  --bad: var(--if-light, #d31b38) var(--if-dark, #ff6b81);
  --bad-soft: var(--if-light, #feeef0) var(--if-dark, #401d25);
  --bad-solid: var(--if-light, #d31b38) var(--if-dark, #c8192f);
  --info: var(--if-light, #5b3cc4) var(--if-dark, #a58bff);
  --info-soft: var(--if-light, #efeafd) var(--if-dark, #2b2548);

  /* Couleurs fixes (identiques dans les deux modes) */
  --white: #ffffff; --black: #000000;
  --ink-fixed: #1c1e21;            /* encre qui ne change pas en sombre : cadre de téléphone, texte sur fond blanc forcé */
  --solid-ink: var(--white);       /* texte sur *-solid, --fb, --ig, toast */
  --grad-ink: var(--white);        /* texte sur --grad */
  --grad-ink-2: color-mix(in srgb, var(--white) 96%, transparent);   /* texte secondaire sur --grad : 96 % de blanc = 4.56:1 sur l’arrêt le plus clair (88 % échouait à 4.08) */
  --scrim: var(--if-light, rgba(8, 16, 13, .55)) var(--if-dark, rgba(0, 0, 0, .62));   /* voile derrière modale / tiroir */

  /* Plateformes (icônes, maquettes) */
  --fb: #1877f2; --ig: #c13584;
  --fb-text: var(--if-light, #0a5ce6) var(--if-dark, #4f9fff);
  --ig-text: var(--if-light, #b3186a) var(--if-dark, #f58bbd);
  --ig-orange: #f58529; --ig-pink: #dd2a7b; --ig-purple: #8134af; --ig-blue: #0095f6;
  --tt: #111111; --tt-cyan: #25f4ee; --tt-red: #fe2c55;
  --wa: #25d366; --wa-ink: #06301a; --yt: #ff0000; --tg: #229ed9;

  /* « Nuit » : sections navy (Auto-Stop sur le site, coffre des clés en boutique) */
  --night: var(--if-light, #0b1a3a) var(--if-dark, #0b1a33);
  --night-2: var(--if-light, #132a5c) var(--if-dark, #132a52);
  --night-3: #081229; --night-line: #1f3566;
  --night-ink: #e8eefc; --night-mute: #aebbdb; --night-hi: #ffc6de; --night-ok: #7ee08a;

  /* Dégradés */
  --logo-grad: linear-gradient(135deg, #2b7bff 0%, #0a4fd6 100%);   /* logo Sponsi (= icon.svg), identique en clair et en sombre */
  --grad: var(--if-light, linear-gradient(135deg, #0866ff 0%, #5b3cc4 50%, #c13584 100%)) var(--if-dark, linear-gradient(135deg, #0a50c8 0%, #4a30a8 50%, #a02a6f 100%));
  --ig-grad: linear-gradient(45deg, var(--ig-orange), var(--ig-pink) 50%, var(--ig-purple));
  --social-grad: linear-gradient(135deg, var(--fb), var(--ig-purple) 55%, var(--ig-pink));
  --shop-grad: linear-gradient(135deg, var(--ig), var(--ig-purple));

  /* Ombres : en sombre, une ombre ne se voit pas → liseré clair (bordure) + ombre plus dense */
  --sh-1: var(--if-light, 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .06)) var(--if-dark, 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .04));
  --sh-2: var(--if-light, 0 4px 12px rgba(0, 0, 0, .08), 0 12px 32px rgba(0, 0, 0, .1)) var(--if-dark, 0 8px 24px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .06));
  --sh-3: var(--if-light, 0 20px 50px rgba(0, 0, 0, .16)) var(--if-dark, 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08));
  --shadow: var(--sh-1); --shadow-lg: var(--sh-3);      /* alias historiques (site.css) */
  --ring: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);   /* anneau de focus */

  /* Rayons : xs (micro-éléments ≤ 12px), sm (badge, kbd, vignette), md (bouton, champ, tuile),
     lg (carte, modale), xl (cadres de téléphone, feuille), pill. 50% = cercle. */
  --r-xs: 4px; --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-xl: 32px; --r-pill: 999px;
  --r: var(--r-lg);

  /* Espacements (4/8) */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  /* Typo : 7 tailles, 12px minimum partout (tabbar comprise) */
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px; --fs-3xl: 36px;
  --lh-tight: 1.3; --lh-normal: 1.65;

  /* Mouvement (tout est neutralisé sous prefers-reduced-motion) */
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms; --ease: cubic-bezier(.2, .8, .2, 1);

  /* Plans (z-index) */
  --z-raised: 5; --z-sticky: 30; --z-fixed: 40; --z-dropdown: 60; --z-sheet: 70; --z-drawer: 80; --z-modal: 90; --z-toast: 100;

  /* Dimensions de l'enveloppe (constantes de mise en page) */
  --tabbar-h: 56px;

  /* Sens d'écriture : --dir vaut 1 en RTL, -1 en LTR (pour les calc() de décalage) ;
     --x-start / --x-end : bord de départ / de fin en % (dégradés décoratifs). */
  --dir: 1; --x-start: 100%; --x-end: 0%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --if-light: ; --if-dark: initial; color-scheme: dark; }
}
:root[data-theme="dark"] { --if-light: ; --if-dark: initial; color-scheme: dark; }
html[dir="ltr"] { --dir: -1; --x-start: 0%; --x-end: 100%; }

/* ── 2. Reset & typo ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: var(--fs-md); line-height: var(--lh-normal); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: var(--lh-tight); font-weight: 700; }
h1 { font-size: clamp(var(--fs-2xl), 4vw, var(--fs-3xl)); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 .8em; }
small, .small { font-size: var(--fs-sm); }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; box-shadow: var(--ring); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.ico { width: 1.2em; height: 1.2em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
/* Icônes directionnelles : dessinées pour le RTL (flèche « suite » = chevron gauche), retournées en LTR */
html[dir="ltr"] .flip-rtl, html[dir="ltr"] .i-left, html[dir="ltr"] .i-right, html[dir="ltr"] .i-logout,
html[dir="ltr"] svg:has(> use[href="#i-left"]) { transform: scaleX(-1); }

/* ── 3. Mise en page ─────────────────────────────── */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--space-4); }
.stack > * + * { margin-top: var(--space-4); }
.stack.sm > * + * { margin-top: var(--space-2); }
.stack.lg > * + * { margin-top: var(--space-6); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.row.top { align-items: flex-start; }
.row.nowrap { flex-wrap: nowrap; }
.row.tight { gap: var(--space-2); }
.col { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.grow { flex: 1; min-width: 0; }
.shrink-0 { flex: none; }
.grid { display: grid; gap: var(--space-4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── 4. Cartes ───────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--space-4); box-shadow: var(--sh-1); }
.card.flat { box-shadow: none; }
.card.pad-lg { padding: var(--space-5); }
.card.interactive { cursor: pointer; color: inherit; transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease); }
.card.interactive:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--sh-2); transform: translateY(-1px); }
.card.interactive:active { transform: none; }
.card.brand { background: var(--grad); color: var(--grad-ink); border: 0; }
.card.brand .muted, .card.brand small, .card.brand .l { color: var(--grad-ink-2); }
.card.brand .btn { background: color-mix(in srgb, var(--white) 18%, transparent); color: inherit; }
.card.brand .btn:hover { background: color-mix(in srgb, var(--white) 28%, transparent); }
.card-h { display: flex; align-items: center; gap: var(--space-3); justify-content: space-between; margin-bottom: var(--space-3); }
.card-h h2, .card-h h3 { margin: 0; }
.soft { background: var(--surface-2); border-color: transparent; box-shadow: none; }

/* Tuile chiffre */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; line-height: var(--lh-tight); }
.stat .l { color: var(--muted); font-size: var(--fs-sm); }
.stat .ic { width: 38px; height: 38px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: var(--space-2); }
.stat .d { font-size: var(--fs-xs); font-weight: 600; display: inline-flex; gap: 2px; align-items: center; }
.stat .d.up { color: var(--ok); } .stat .d.down { color: var(--bad); }
.stat .v .nowrap { white-space: nowrap; }

/* ── 5. Boutons ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; padding: var(--space-2) var(--space-4);
  border-radius: var(--r-md); cursor: pointer; text-decoration: none !important;
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  min-height: 44px; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; cursor: not-allowed; }
.btn.loading, .btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.btn.secondary { background: var(--surface-2); color: var(--ink); }
.btn.primary { background: var(--brand-fill); color: var(--brand-ink); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--white) 15%, transparent), 0 6px 16px color-mix(in srgb, var(--brand-fill) 26%, transparent); }
.btn.primary:hover { background: var(--brand-fill-2); }
.btn.primary:active { box-shadow: none; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--black)); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 14%, var(--bad-soft)); }
.btn.danger.solid { background: var(--bad-solid); color: var(--solid-ink); }
.btn.ok { background: var(--ok-soft); color: var(--ok); }
.btn.ok:hover { background: color-mix(in srgb, var(--ok) 14%, var(--ok-soft)); }
.btn.sm { min-height: 36px; padding: var(--space-1) var(--space-3); font-size: var(--fs-sm); }
.btn.lg { min-height: 52px; padding: var(--space-3) var(--space-5); font-size: var(--fs-md); }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 44px; }
.btn.sm.icon { width: 36px; }
.btn .ico { width: 1.2em; height: 1.2em; }
.btn.loading::after, .btn[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-inline-start-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Sur écran tactile : cible ≥ 44px même pour les petits boutons */
@media (pointer: coarse) { .btn.sm { min-height: 44px; } .btn.sm.icon { width: 44px; } }
/* Sur téléphone, un libellé trop long passe à la ligne au lieu de déborder de l’écran (P0 : site fr à 360px) */
@media (max-width: 560px) { .btn:not(.icon) { white-space: normal; } }

/* ── 6. Formulaires ──────────────────────────────── */
label.f { display: block; }
label.f > span, .f-label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--space-1); }
label.f > span.row { display: flex; }
.f-hint { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--space-1); }
.f-err { display: flex; gap: var(--space-1); align-items: flex-start; color: var(--bad); font-size: var(--fs-sm); font-weight: 600; margin-top: var(--space-1); }
.f-err:empty { display: none; }
.f-err .ico { margin-top: .2em; }
.input, select.input, textarea.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md); padding: var(--space-3) var(--space-4); min-height: 46px;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
textarea.input, .textarea { min-height: 110px; resize: vertical; }
.input::placeholder { color: var(--muted); opacity: 1; }
.input:hover:not(:disabled):not(:focus) { border-color: color-mix(in srgb, var(--ink) 35%, var(--line-strong)); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.input.invalid, .input[aria-invalid="true"], .f.invalid .input { border-color: var(--bad); }
.input.invalid:focus, .input[aria-invalid="true"]:focus, .f.invalid .input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 20%, transparent); }
/* Champs en écriture latine (téléphone, e-mail, montant) : lus de gauche à droite,
   alignés sur le bord de DÉPART de la page (droite en arabe, gauche en français). */
.input.ltr, .input[type="tel"], .input[type="email"], .input[type="url"] { direction: ltr; text-align: left; }
html[dir="rtl"] .input.ltr, html[dir="rtl"] .input[type="tel"], html[dir="rtl"] .input[type="email"], html[dir="rtl"] .input[type="url"] { text-align: right; }
/* Préfixe / suffixe */
.input-group { display: flex; align-items: stretch; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.input-group:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.input-group.invalid { border-color: var(--bad); }
.input-group .input { border: 0; box-shadow: none !important; border-radius: 0; min-width: 0; }
.input-group .input:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }   /* indicateur sur le champ lui-même (a11y) */
.input-group .addon { display: grid; place-items: center; padding: 0 var(--space-4); background: var(--surface-2); color: var(--ink-2); font-weight: 600; direction: ltr; white-space: nowrap; }
.input-group .btn { border-radius: 0; min-height: 0; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin-top: 3px; flex: none; }
.check input:disabled { cursor: not-allowed; } .check:has(input:disabled) { opacity: .55; cursor: not-allowed; }
input[type="range"], .range { width: 100%; accent-color: var(--brand); height: 28px; margin: 0; }
.range-row { display: flex; gap: var(--space-3); align-items: center; }
.range-row .range-v { min-width: 4em; text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Interrupteur */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line); transition: background var(--dur-1) var(--ease); }
.switch span::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); box-shadow: var(--sh-1); transition: transform var(--dur-1) var(--ease); }
.switch input:checked + span { background: var(--ok); border-color: var(--ok); }
.switch input:checked + span::after { transform: translateX(calc(-18px * var(--dir))); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.switch input:disabled, .switch input:disabled + span { cursor: not-allowed; opacity: .5; }

/* Tuiles à choisir (cartes radio) */
.choices { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.choice { position: relative; display: flex; gap: var(--space-3); align-items: flex-start; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--r-md); padding: var(--space-4); cursor: pointer; transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); text-align: start; font: inherit; color: inherit; width: 100%; }
.choice:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.choice.on { border-color: var(--brand); background: var(--brand-soft); }
.choice.on::after { content: ""; position: absolute; top: var(--space-3); inset-inline-end: var(--space-3); width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/13px no-repeat; }
.choice .ci { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex: none; }
.choice.on .ci { background: var(--surface); }
.choice b { display: block; }
.choice small { color: var(--ink-2); display: block; line-height: 1.5; }
.choice.disabled, .choice[disabled] { opacity: .45; pointer-events: none; }
.choices.compact .choice { flex-direction: column; gap: var(--space-2); padding: var(--space-3); }
.choices.compact .choice .ci { width: 34px; height: 34px; }
.choices.c2 { grid-template-columns: 1fr 1fr; }
.choices.wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-pill); padding: var(--space-1) var(--space-3); font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer; color: var(--ink); min-height: 32px; display: inline-flex; align-items: center; gap: var(--space-1); transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-ink); }
.chip .x { margin-inline-start: var(--space-1); opacity: .7; }
.chip[disabled] { opacity: .5; pointer-events: none; }

/* ── 7. Badges & alertes ─────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-xs); font-weight: 600; padding: 3px var(--space-2); border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.badge .ico { width: 1.1em; height: 1.1em; }
.badge.neutral { background: var(--surface-2); color: var(--ink-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.solid { background: var(--ink); color: var(--bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }

.alert { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--r-md); background: var(--info-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.alert > .ico { color: var(--info); margin-top: 3px; }
.alert > div { flex: 1; min-width: 0; }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); } .alert.ok > .ico { color: var(--ok); }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); } .alert.warn > .ico { color: var(--warn); }
.alert.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); } .alert.bad > .ico { color: var(--bad); }
.alert.info > .ico { color: var(--info); }
.alert p:last-child { margin: 0; }
.alert .alert-a { margin-inline-start: auto; align-self: center; flex: none; }
@media (max-width: 560px) { .alert.wrap-a { flex-wrap: wrap; } .alert.wrap-a .alert-a { flex-basis: 100%; margin-inline-start: 0; } }

/* ── 8. Tableaux (cartes sur téléphone < 720px) ──── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; padding: var(--space-3); border-bottom: 1px solid var(--line); }
.table td { padding: var(--space-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.dense th, .table.dense td { padding: var(--space-2) var(--space-2); font-size: var(--fs-sm); }
.table tr.click { cursor: pointer; } .table tr.click:hover td, .table tr.click:focus-within td { background: var(--surface-2); }
.table.sticky thead th { position: sticky; top: 0; z-index: var(--z-raised); background: var(--surface); }
/* Tri : <th aria-sort="ascending"><button class="th-sort">…</button></th> */
.th-sort { border: 0; background: none; font: inherit; color: inherit; font-weight: 600; cursor: pointer; padding: 0; white-space: nowrap; display: inline-flex; gap: var(--space-1); align-items: center; }
.th-sort:hover { color: var(--brand); }
.th-sort::after { content: "↕"; opacity: .5; font-size: var(--fs-xs); }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--brand); }
th[aria-sort="ascending"] .th-sort::after { content: "↑"; opacity: 1; }
th[aria-sort="descending"] .th-sort::after { content: "↓"; opacity: 1; }
.table-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 720px) {
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--space-2) var(--space-1); margin-bottom: var(--space-3); background: var(--surface); }
  .table.cards td { border: 0; padding: var(--space-2) var(--space-3); display: flex; justify-content: space-between; gap: var(--space-3); }
  .table.cards td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: var(--fs-sm); }
  .table.sticky thead th { position: static; }
  .table-x:has(> .table.cards) { overflow: visible; }   /* en mode cartes, plus de défilement horizontal */
}

/* ── 9. Vide / squelettes ────────────────────────── */
.empty { text-align: center; padding: var(--space-6) var(--space-4); color: var(--ink-2); }
.empty .ei { width: 64px; height: 64px; margin: 0 auto var(--space-3); border-radius: var(--r-lg); display: grid; place-items: center; background: var(--surface-2); color: var(--brand); }
.empty .ei .ico { width: 30px; height: 30px; }
.empty h3 { margin: 0 0 var(--space-1); color: var(--ink); }
.empty p { margin: 0 0 var(--space-3); }
.empty .btn { margin-top: var(--space-1); }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-md); min-height: 18px; }
.skel.text { min-height: 1em; height: 1em; border-radius: var(--r-sm); }
.skel.title { height: 1.4em; width: 40%; border-radius: var(--r-sm); }
.skel.circle { border-radius: 50%; }
.skel.card { border-radius: var(--r); min-height: 120px; }
.skel.h-sm { height: 40px; } .skel.h-md { height: 120px; } .skel.h-lg { height: 220px; }
.skel-lines { display: grid; gap: var(--space-2); }
.skel-lines .skel:last-child { width: 70%; }
@keyframes sk { to { background-position: -200% 0; } }

/* ── 10. Progression & étapes ────────────────────── */
.bar { height: 8px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-fill); border-radius: var(--r-pill); transition: width var(--dur-3) var(--ease); }
.bar.sm { height: 5px; margin-top: var(--space-2); }
.steps { display: flex; gap: var(--space-2); }
.steps .s { flex: 1; height: 5px; border-radius: var(--r-pill); background: var(--surface-3); }
.steps .s.on { background: var(--brand-fill); }
/* Stepper d'assistant : <ol class="stepper"><li class="done"><span>…</span></li><li class="cur" aria-current="step">…</li>… */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2); counter-reset: st; }
.stepper li { flex: 1; display: flex; align-items: center; gap: var(--space-2); min-width: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.stepper li::before { counter-increment: st; content: counter(st); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-xs); border: 2px solid transparent; }
.stepper li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--line); border-radius: var(--r-pill); min-width: var(--space-3); }
.stepper li.done { color: var(--ink-2); }
.stepper li.done::before { content: "✓"; background: var(--brand-fill); color: var(--brand-ink); }
.stepper li.done:not(:last-child)::after { background: var(--brand-fill); }
.stepper li.cur, .stepper li[aria-current="step"] { color: var(--brand); }
.stepper li.cur::before, .stepper li[aria-current="step"]::before { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: var(--ring); }
@media (max-width: 560px) { .stepper li:not(.cur):not([aria-current="step"]) span { display: none; } .stepper li:not(.cur):not([aria-current="step"]) { flex: 0 1 auto; } }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--ink-2); flex: none; }
.checklist li.done .n { background: var(--ok-solid); color: var(--solid-ink); }
.checklist li.done .t { color: var(--muted); text-decoration: line-through; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding-block: 0 var(--space-4); padding-inline: var(--space-6) 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 7px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 2px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--surface); }
.timeline li.on::after { background: var(--brand-fill); }
.timeline li.bad::after { background: var(--bad); }

/* ── 11. Toast & modale / feuille ────────────────── */
/* #toasts est créé par ui.js ; il porte role="status" aria-live="polite" (région vivante). */
#toasts { position: fixed; z-index: var(--z-toast); top: var(--space-4); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--space-2); width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: var(--space-3) var(--space-4); border-radius: var(--r-md); box-shadow: var(--sh-3); display: flex; gap: var(--space-3); align-items: center; animation: tin var(--dur-2) var(--ease); pointer-events: auto; font-weight: 500; }
.toast .ico { flex: none; }
.toast.bad { background: var(--bad-solid); color: var(--solid-ink); }
.toast.ok { background: var(--ok-solid); color: var(--solid-ink); }
.toast.warn { background: var(--warn-solid); color: var(--solid-ink); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); width: min(94vw, 560px); max-height: 90vh; box-shadow: var(--sh-3); animation: min var(--dur-3) var(--ease); }
dialog.modal.wide { width: min(96vw, 820px); }
dialog.modal::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
dialog.modal .mh { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
dialog.modal .mh h3 { margin: 0; }
dialog.modal .mb { padding: var(--space-4) var(--space-5); }
dialog.modal .mf { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); display: flex; gap: var(--space-3); justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }
@keyframes min { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 560px) {
  /* Feuille basse (bottom-sheet) : poignée, coins hauts arrondis, boutons pleine largeur */
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; animation-name: sheet-in; }
  dialog.modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--surface-3); margin: var(--space-2) auto 0; }
  dialog.modal .mf .btn { flex: 1; }
}
@keyframes sheet-in { from { transform: translateY(40px); } }

/* ── 12. Enveloppe des applications (client + admin) ─ */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-inline-start: 1px solid var(--line); padding: var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
/* Logo + nom (lien) : sélecteur a.brand pour ne pas contaminer .badge.brand et .card.brand */
a.brand { display: flex; align-items: center; gap: var(--space-3); font-weight: 700; font-size: var(--fs-lg); color: var(--ink); padding: var(--space-1) var(--space-2) var(--space-4); }
a.brand:hover { text-decoration: none; }
.logo { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--logo-grad); color: #fff; display: grid; place-items: center; flex: none; }
.logo .ico { width: 22px; height: 22px; stroke-width: 2.2; }
.logo .mk { width: 100%; height: 100%; }   /* logo Sponsi : la marque occupe déjà ~70 % de son carré */
.nav a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--r-md); color: var(--ink-2); font-weight: 500; min-height: 44px; }
.nav a > span { min-width: 0; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.on, .nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav .sep { font-size: var(--fs-xs); color: var(--muted); padding: var(--space-4) var(--space-3) var(--space-1); font-weight: 600; }
.nav a .badge { margin-inline-start: auto; }
.main { min-width: 0; padding: var(--space-5) var(--space-5) var(--space-7); }
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.top h1 { font-size: var(--fs-xl); margin: 0; }
.top .sub { color: var(--muted); font-size: var(--fs-sm); }
.mobile-top, .tabbar { display: none; }
.bell { position: relative; }
.bell .n { position: absolute; top: var(--space-1); inset-inline-end: var(--space-1); min-width: 18px; height: 18px; border-radius: var(--r-pill); background: var(--bad-solid); color: var(--solid-ink); font-size: var(--fs-xs); line-height: 18px; display: grid; place-items: center; padding: 0 var(--space-1); }
.money-hero { background: var(--grad); color: var(--grad-ink); border: 0; }
.money-hero .l { color: var(--grad-ink-2); }
.money-hero .v { font-size: var(--fs-2xl); font-weight: 700; }
.money-hero .btn { background: color-mix(in srgb, var(--white) 18%, transparent); color: inherit; }
.money-hero .btn:hover { background: color-mix(in srgb, var(--white) 28%, transparent); }

/* Bouton d'action flottant (un seul par écran, jamais deux éléments fixes en bas) */
.fab { position: fixed; z-index: var(--z-fixed); inset-inline-end: var(--space-5); bottom: var(--space-5); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-width: 56px; min-height: 56px; padding: 0 var(--space-4); border-radius: var(--r-pill); background: var(--grad); color: var(--grad-ink); font-weight: 700; box-shadow: var(--sh-2); }
.fab:hover { text-decoration: none; filter: brightness(1.05); }
.fab.icon { padding: 0; width: 56px; }
@media (max-width: 960px) { .fab { bottom: calc(var(--tabbar-h) + var(--space-4) + env(safe-area-inset-bottom)); } }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: var(--space-4) var(--space-4) calc(var(--tabbar-h) + var(--space-7)); }
  .mobile-top { display: flex; position: sticky; top: 0; z-index: var(--z-sticky); align-items: center; justify-content: space-between; gap: var(--space-3);
    padding: var(--space-2) var(--space-4); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); min-height: 60px; }
  .mobile-top .bal { font-weight: 700; font-size: var(--fs-sm); background: var(--brand-soft); color: var(--brand); padding: var(--space-1) var(--space-3); border-radius: var(--r-pill); min-height: 32px; display: inline-flex; align-items: center; }
  /* Tabbar : 5 onglets, libellé 12px sur UNE ligne */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: var(--z-fixed); background: var(--surface);
    border-top: 1px solid var(--line); padding: var(--space-1) var(--space-1) calc(var(--space-1) + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; font-size: var(--fs-xs); line-height: 1.2; color: var(--muted); padding: var(--space-1) 2px; font-weight: 500; min-width: 0; min-height: 48px; }
  .tabbar a > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.on, .tabbar a[aria-current="page"] { color: var(--brand); font-weight: 700; }
  .tabbar a .ico { width: 22px; height: 22px; }
  .tabbar a.fab { position: static; inset: auto; min-width: 0; min-height: 48px; padding: var(--space-1) 2px; border-radius: 0; background: none; color: var(--muted); font-weight: 500; box-shadow: none; }
  .tabbar a.fab .ico { width: 26px; height: 26px; }
  .tabbar a.fab span:first-child { width: 50px; height: 50px; margin-top: -28px; border-radius: var(--r-lg); background: var(--brand-fill); color: var(--brand-ink); display: grid; place-items: center; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 40%, transparent); }
  .top h1 { font-size: var(--fs-lg); }
  .top .actions { display: none; }
}

/* Tiroir (menu sur téléphone) : s'ouvre depuis le bord de départ */
.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); display: none; }
.drawer.open { display: block; }
.drawer .bg { position: absolute; inset: 0; background: var(--scrim); }
.drawer .panel { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(84vw, 300px); background: var(--surface); padding: var(--space-4) var(--space-4); overflow-y: auto; animation: din var(--dur-2) var(--ease); box-shadow: var(--sh-3); }
@keyframes din { from { transform: translateX(calc(100% * var(--dir))); } }

/* ── 13. Blocs partagés (site, client, admin) ────── */
/* Aperçu d'annonce (faux post) */
.preview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; max-width: 380px; margin: 0 auto; font-size: var(--fs-sm); }
.preview .ph { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3); }
.preview .pa { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.preview .pt { padding: 0 var(--space-3) var(--space-3); white-space: pre-wrap; word-break: break-word; }
.preview .pimg { position: relative; overflow: hidden; aspect-ratio: 1 / 1; max-height: 420px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.preview .pimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview .pf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); background: var(--surface-2); }
.preview .pf .btn { min-height: 34px; font-size: var(--fs-sm); }

.drop { display: block; border: 2px dashed var(--line); border-radius: var(--r-lg); padding: var(--space-5); text-align: center; cursor: pointer; background: var(--surface); transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop img { max-height: 220px; min-height: 80px; width: auto; object-fit: contain; margin: 0 auto var(--space-3); border-radius: var(--r-md); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

.copybox { display: flex; align-items: center; gap: var(--space-2); background: var(--surface-2); border-radius: var(--r-md); padding: var(--space-2); padding-inline-end: var(--space-3); }
.copybox code { flex: 1; font-family: ui-monospace, monospace; direction: ltr; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Onglets : <div class="tabs" role="tablist"><button role="tab" aria-selected="true">…</button>… */
.tabs { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: 2px; margin-bottom: var(--space-4); scrollbar-width: none; }
.tabs button, .tabs [role="tab"] { border: 0; background: var(--surface-2); color: var(--ink-2); font: inherit; font-weight: 600; font-size: var(--fs-sm); padding: var(--space-2) var(--space-4); border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; min-height: 40px; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.tabs button:hover, .tabs [role="tab"]:hover { background: var(--surface-3); color: var(--ink); }
.tabs button.on, .tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tabs button .num { opacity: .75; }

details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 var(--space-4); }
details.faq + details.faq { margin-top: var(--space-3); }
details.faq summary { cursor: pointer; font-weight: 600; padding: var(--space-4) 0; list-style: none; display: flex; justify-content: space-between; gap: var(--space-3); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: var(--fs-xl); color: var(--brand); line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq > div { padding-bottom: var(--space-4); color: var(--ink-2); }

.help-tip { display: flex; gap: var(--space-3); background: var(--accent-soft); border-radius: var(--r-md); padding: var(--space-3) var(--space-4); font-size: var(--fs-sm); color: var(--ink); }
.help-tip .ico { color: var(--accent-text); margin-top: 3px; }

/* Bulle de conversation (assistant / utilisateur) */
.bubble { max-width: min(560px, 100%); padding: var(--space-3) var(--space-4); border-radius: var(--r-lg); line-height: 1.65; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); border-end-start-radius: var(--r-sm); overflow-wrap: anywhere; }
.bubble.me { background: var(--brand-fill); color: var(--brand-ink); border-color: var(--brand-fill); border-end-start-radius: var(--r-lg); border-end-end-radius: var(--r-sm); margin-inline-start: auto; }
.bubble-row { display: flex; gap: var(--space-2); align-items: flex-end; }
.bubble-row.me { justify-content: flex-end; }
.typing { display: inline-flex; gap: 5px; padding: var(--space-1) 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Couleurs des plateformes : icône blanche sur fond, ou icône colorée */
.pf-bg-fb { background: var(--fb) !important; color: var(--solid-ink) !important; } .pf-bg-ig { background: var(--ig) !important; color: var(--solid-ink) !important; }
.pf-c-fb { color: var(--fb-text) !important; } .pf-c-ig { color: var(--ig-text) !important; }

/* ── 14. Utilitaires (remplacent les style="…" inline) ── */
.m-0 { margin: 0 !important; } .p-0 { padding: 0 !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: var(--space-1) !important; } .mt-2 { margin-top: var(--space-2) !important; } .mt-3 { margin-top: var(--space-3) !important; } .mt-4 { margin-top: var(--space-4) !important; } .mt-5 { margin-top: var(--space-5) !important; } .mt-6 { margin-top: var(--space-6) !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: var(--space-1) !important; } .mb-2 { margin-bottom: var(--space-2) !important; } .mb-3 { margin-bottom: var(--space-3) !important; } .mb-4 { margin-bottom: var(--space-4) !important; } .mb-5 { margin-bottom: var(--space-5) !important; } .mb-6 { margin-bottom: var(--space-6) !important; }
.ms-auto { margin-inline-start: auto !important; } .me-auto { margin-inline-end: auto !important; } .mx-auto { margin-inline: auto !important; }
.p-2 { padding: var(--space-2) !important; } .p-3 { padding: var(--space-3) !important; } .p-4 { padding: var(--space-4) !important; } .p-5 { padding: var(--space-5) !important; }
.pt-6 { padding-top: var(--space-6) !important; }
.gap-1 { gap: var(--space-1) !important; } .gap-2 { gap: var(--space-2) !important; } .gap-3 { gap: var(--space-3) !important; } .gap-4 { gap: var(--space-4) !important; } .gap-5 { gap: var(--space-5) !important; }
.d-block { display: block !important; } .d-inline { display: inline !important; } .d-flex { display: flex !important; } .d-grid { display: grid !important; }
.ai-start { align-items: start !important; } .ai-center { align-items: center !important; }
.w-full { width: 100% !important; } .w-auto { width: auto !important; } .mw-0 { min-width: 0 !important; }
.maxw-sm { max-width: 480px; } .maxw-xs { max-width: 220px; } .maxw-md { max-width: 720px; } .maxw-lg { max-width: 960px; }
.text-center { text-align: center !important; } .text-start { text-align: start !important; } .text-end { text-align: end !important; }
.bold { font-weight: 700 !important; } .semibold { font-weight: 600 !important; } .regular { font-weight: 400 !important; }
.fs-xs { font-size: var(--fs-xs) !important; } .fs-sm { font-size: var(--fs-sm) !important; } .fs-md { font-size: var(--fs-md) !important; } .fs-lg { font-size: var(--fs-lg) !important; } .fs-xl { font-size: var(--fs-xl) !important; } .fs-2xl { font-size: var(--fs-2xl) !important; }
.t-ok { color: var(--ok) !important; } .t-warn { color: var(--warn) !important; } .t-bad { color: var(--bad) !important; } .t-info { color: var(--info) !important; } .t-brand { color: var(--brand) !important; } .t-accent { color: var(--accent-text) !important; } .t-ink { color: var(--ink) !important; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; word-break: break-word; }
.oh { overflow: hidden; }
.rel { position: relative; }
.sticky-b { position: sticky; bottom: 0; z-index: var(--z-raised); background: var(--bg); }

/* ── 15. Langue ──────────────────────────────────── */
/* Version française (i18n.js) : page cachée le temps de la traduction, 1,2 s au plus */
.i18n-wait body { visibility: hidden; animation: i18n-show 0s 1.2s forwards; }
@keyframes i18n-show { to { visibility: visible; } }
/* Bouton de langue : on montre la langue VERS laquelle on bascule */
html[lang^="fr"] .l-ar, html:not([lang^="fr"]) .l-fr { display: none; }
.lang-t { min-width: 40px; font-weight: 700; }

/* ── 16. Impression ──────────────────────────────── */
@media print {
  .side, .tabbar, .mobile-top, .no-print, .fab, #toasts, .bell, .drawer { display: none !important; }
  .shell { display: block; } .main { padding: 0; }
  body { background: var(--white); color: var(--ink-fixed); }
  .card { box-shadow: none !important; break-inside: avoid; }
}
