/* ==========================================================================
   Avocado — design system inspiré du thème YOOtheme « Flow »
   Surfaces douces et arrondies, accents en dégradé, sections au bord courbé.
   Six styles (comme le sélecteur de styles de Flow) × modes auto / clair / sombre.
   FR : Mulish · AR : Cairo (principale), Ruwudu (display), Fustat (données)
   ========================================================================== */

:root {
  /* Typographie */
  --font-latin: "Mulish", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-ar: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-ar-display: "Ruwudu", "Cairo", "Segoe UI", serif;
  --font-ar-utility: "Fustat", "Cairo", "Segoe UI", sans-serif;
  --font-body: var(--font-latin);
  --font-head: var(--font-latin);
  --font-display: var(--font-latin);
  --font-data: var(--font-latin);
  --lh-body: 1.6;
  --lh-head: 1.18;
  --track-head: -0.02em;
  --track-label: 0.06em;

  /* Style « Flow » (défaut) : violet → magenta, accent rose */
  --primary: #6b4ef6;
  --primary-2: #9646ea;
  --accent: #ff6fa5;
  --on-primary: #ffffff;

  /* Neutres légèrement teintés vers l'accent */
  --bg: #f5f6fb;
  --bg-public: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f3f9;
  --surface-3: #e7e9f3;
  --text: #1b1f33;
  --text-2: #474d6b;
  --muted: #6c7392;
  --border: #e3e5ef;
  --border-strong: #cdd1e2;

  /* Sémantique */
  --success: #12804a;
  --warning: #a86400;
  --danger: #cf3442;
  --info: #2263d2;

  /* Teintes pour avatars et catégories */
  --hue-1: #2563eb;
  --hue-2: #0f9d76;
  --hue-3: #d9480f;
  --hue-4: #c2255c;
  --hue-5: #7048e8;
  --hue-6: #0c8599;

  --shadow-color: 27, 31, 51;
  --shadow-sm: 0 1px 2px rgba(var(--shadow-color), .06), 0 2px 10px rgba(var(--shadow-color), .04);
  --shadow: 0 12px 32px -14px rgba(var(--shadow-color), .22);
  --shadow-lg: 0 32px 64px -24px rgba(var(--shadow-color), .32);
  --overlay: rgba(13, 16, 32, .5);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* Héros : « Flow » utilise un fond en dégradé, les styles « White » un fond clair */
  --hero-bg: linear-gradient(135deg, #5236ee 0%, #8b3ee6 52%, #e2559b 100%);
  --hero-fg: #ffffff;
  --hero-muted: rgba(255, 255, 255, .84);
  --hero-glass: rgba(255, 255, 255, .14);
  --hero-glass-border: rgba(255, 255, 255, .28);

  /* Dérivés */
  --grad: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  --grad-accent: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 55%, var(--accent) 100%);
  --primary-soft: color-mix(in srgb, var(--primary) 11%, var(--surface));
  --primary-soft-2: color-mix(in srgb, var(--primary) 20%, var(--surface));
  --primary-ink: color-mix(in srgb, var(--primary) 86%, #000000);
  --success-soft: color-mix(in srgb, var(--success) 12%, var(--surface));
  --warning-soft: color-mix(in srgb, var(--warning) 14%, var(--surface));
  --danger-soft: color-mix(in srgb, var(--danger) 11%, var(--surface));
  --info-soft: color-mix(in srgb, var(--info) 11%, var(--surface));
  --focus: color-mix(in srgb, var(--primary) 45%, transparent);

  color-scheme: light;
}

/* ---- Styles « White » ---------------------------------------------------- */
:root[data-style="blue"] { --primary: #2459e0; --primary-2: #3b7bf2; --accent: #4cc3ff; }
:root[data-style="darkblue"] { --primary: #1e2a64; --primary-2: #34448f; --accent: #8a98d8; }
:root[data-style="green"] { --primary: #0b805c; --primary-2: #109a73; --accent: #3ddc9b; }
:root[data-style="lightblue"] { --primary: #0a76b8; --primary-2: #0b93cf; --accent: #5ad1f5; }
:root[data-style="pink"] { --primary: #cc2b67; --primary-2: #e2407c; --accent: #ff9fc2; }

:root[data-style]:not([data-style="flow"]) {
  --hero-bg: var(--bg-public);
  --hero-fg: var(--text);
  --hero-muted: var(--text-2);
  --hero-glass: var(--surface);
  --hero-glass-border: var(--border);
}

/* ---- Mode sombre (auto) --------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1020;
    --bg-public: #0d1020;
    --surface: #151a2e;
    --surface-2: #1b2139;
    --surface-3: #262d4b;
    --text: #eceef9;
    --text-2: #bfc5de;
    --muted: #8e95b6;
    --border: #283051;
    --border-strong: #38426c;
    --success: #3fcf8a;
    --warning: #f1b44f;
    --danger: #ff6d7a;
    --info: #6fa7ff;
    --hue-1: #6d9dff;
    --hue-2: #3fd0a6;
    --hue-3: #ff8a50;
    --hue-4: #ff6fa3;
    --hue-5: #a28bff;
    --hue-6: #44c6dc;
    --shadow-color: 0, 0, 0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .2);
    --shadow: 0 14px 34px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 32px 64px -24px rgba(0, 0, 0, .7);
    --overlay: rgba(0, 0, 0, .6);
    --hero-bg: linear-gradient(135deg, #261a6e 0%, #3f1d73 52%, #6a2251 100%);
    --hero-glass: rgba(255, 255, 255, .08);
    --hero-glass-border: rgba(255, 255, 255, .16);
    --primary-soft: color-mix(in srgb, var(--primary) 22%, var(--surface));
    --primary-soft-2: color-mix(in srgb, var(--primary) 34%, var(--surface));
    --primary-ink: color-mix(in srgb, var(--primary) 45%, #ffffff);
    --success-soft: color-mix(in srgb, var(--success) 16%, var(--surface));
    --warning-soft: color-mix(in srgb, var(--warning) 16%, var(--surface));
    --danger-soft: color-mix(in srgb, var(--danger) 16%, var(--surface));
    --info-soft: color-mix(in srgb, var(--info) 16%, var(--surface));
    color-scheme: dark;
  }
  :root[data-style="darkblue"]:not([data-theme="light"]) { --primary: #4c5fd6; --primary-2: #6474e4; --accent: #9aa8ec; }
}

/* ---- Mode sombre (choix explicite) --------------------------------------- */
:root[data-theme="dark"] {
  --bg: #0d1020;
  --bg-public: #0d1020;
  --surface: #151a2e;
  --surface-2: #1b2139;
  --surface-3: #262d4b;
  --text: #eceef9;
  --text-2: #bfc5de;
  --muted: #8e95b6;
  --border: #283051;
  --border-strong: #38426c;
  --success: #3fcf8a;
  --warning: #f1b44f;
  --danger: #ff6d7a;
  --info: #6fa7ff;
  --hue-1: #6d9dff;
  --hue-2: #3fd0a6;
  --hue-3: #ff8a50;
  --hue-4: #ff6fa3;
  --hue-5: #a28bff;
  --hue-6: #44c6dc;
  --shadow-color: 0, 0, 0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .2);
  --shadow: 0 14px 34px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 32px 64px -24px rgba(0, 0, 0, .7);
  --overlay: rgba(0, 0, 0, .6);
  --hero-bg: linear-gradient(135deg, #261a6e 0%, #3f1d73 52%, #6a2251 100%);
  --hero-glass: rgba(255, 255, 255, .08);
  --hero-glass-border: rgba(255, 255, 255, .16);
  --primary-soft: color-mix(in srgb, var(--primary) 22%, var(--surface));
  --primary-soft-2: color-mix(in srgb, var(--primary) 34%, var(--surface));
  --primary-ink: color-mix(in srgb, var(--primary) 45%, #ffffff);
  --success-soft: color-mix(in srgb, var(--success) 16%, var(--surface));
  --warning-soft: color-mix(in srgb, var(--warning) 16%, var(--surface));
  --danger-soft: color-mix(in srgb, var(--danger) 16%, var(--surface));
  --info-soft: color-mix(in srgb, var(--info) 16%, var(--surface));
  color-scheme: dark;
}
:root[data-theme="dark"][data-style="darkblue"] { --primary: #4c5fd6; --primary-2: #6474e4; --accent: #9aa8ec; }

/* Les styles « White » gardent un héros sombre neutre en mode sombre */
:root[data-theme="dark"][data-style]:not([data-style="flow"]) {
  --hero-glass: var(--surface);
  --hero-glass-border: var(--border);
}

/* ---- Arabe ---------------------------------------------------------------- */
html[lang="ar"] {
  --font-body: var(--font-ar);
  --font-head: var(--font-ar);
  --font-display: var(--font-ar-display);
  --font-data: var(--font-ar-utility);
  --lh-body: 1.8;
  --lh-head: 1.45;
  --track-head: 0;
  --track-label: 0;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.public { background: var(--bg-public); font-size: 16px; }
img, svg { max-width: 100%; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  line-height: var(--lh-head);
  letter-spacing: var(--track-head);
  margin: 0;
  text-wrap: balance;
  color: var(--text);
  font-weight: 800;
}
h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
small, .small { font-size: .85em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.num, .data { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow {
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: var(--track-label);
  color: var(--primary-ink);
}
.lead { font-size: 1.12rem; color: var(--text-2); max-width: 62ch; }
.grad-text {
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[lang="ar"] .display-ar { font-family: var(--font-ar-display); font-weight: 700; }

/* Icônes */
.ic { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.ic-lg { width: 1.5em; height: 1.5em; }
.ic-xl { width: 2em; height: 2em; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ==========================================================================
   Mise en page utilitaire
   ========================================================================== */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
.container-narrow { max-width: 860px; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.stack-sm { --gap: 8px; }
.stack-lg { --gap: 28px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 10px); }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: var(--gap, 18px); }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.g-5 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.cols-main { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.cols-main-wide { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.cols-side { display: grid; gap: 20px; grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
.cols-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.min0 { min-width: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
@media (max-width: 1100px) {
  .cols-main, .cols-main-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .cols-side, .cols-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Composants
   ========================================================================== */

/* Boutons */
.btn {
  --btn-pad: .68em 1.35em;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: var(--btn-pad); border-radius: var(--radius-pill);
  font: inherit; font-weight: 700; font-size: .94rem; line-height: 1.25;
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  white-space: nowrap; transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, filter .2s ease;
  color: var(--text); background: transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad); color: var(--on-primary);
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--primary) 75%, transparent);
}
.btn-primary:hover { filter: brightness(1.06) saturate(1.05); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-soft { background: var(--primary-soft); color: var(--primary-ink); }
.btn-soft:hover { background: var(--primary-soft-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #ffffff; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-hero { background: var(--hero-fg); color: color-mix(in srgb, var(--primary) 78%, #000000); }
:root[data-style]:not([data-style="flow"]) .btn-hero { background: var(--grad); color: var(--on-primary); }
.btn-hero-outline { border-color: var(--hero-glass-border); color: var(--hero-fg); background: var(--hero-glass); }
.btn-sm { --btn-pad: .45em .95em; font-size: .84rem; }
.btn-lg { --btn-pad: .85em 1.7em; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-icon { --btn-pad: 0; width: 38px; height: 38px; border-radius: 50%; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .55; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary-ink); font-weight: 700; cursor: pointer; }

/* Badges & chips */
.badge {
  display: inline-flex; align-items: center; gap: .35em; padding: .18em .7em; border-radius: var(--radius-pill);
  font-size: .76rem; font-weight: 800; line-height: 1.5; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2); font-family: var(--font-data);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-primary { background: var(--primary-soft); color: var(--primary-ink); }
.b-success { background: var(--success-soft); color: var(--success); }
.b-warning { background: var(--warning-soft); color: var(--warning); }
.b-danger { background: var(--danger-soft); color: var(--danger); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-neutral { background: var(--surface-3); color: var(--text-2); }
.b-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.chip {
  display: inline-flex; align-items: center; gap: .4em; padding: .38em .85em; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .85rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.chip.is-active { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.chip .count { font-family: var(--font-data); color: var(--muted); font-weight: 700; }
.kbd { font-family: var(--font-data); font-size: .72rem; padding: .1em .45em; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--muted); }

/* Cartes */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); min-width: 0;
}
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 1rem; font-weight: 800; }
.card-body { padding: 18px 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); }
.card-flat { box-shadow: none; }
.card-soft { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card-hover { transition: transform .18s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-link { color: inherit; text-decoration: none !important; display: block; }

/* Listes de propriétés */
.dl { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* Listes */
.list { list-style: none; display: flex; flex-direction: column; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list-tight > li { padding: 8px 0; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .ic { color: var(--success); margin-top: .2em; }
.check-list .no .ic, .check-list li.no { color: var(--muted); }

/* Avatars */
.avatar {
  --h: var(--hue-1);
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: .8rem; font-weight: 800; font-family: var(--font-data);
  background: color-mix(in srgb, var(--h) 16%, var(--surface)); color: color-mix(in srgb, var(--h) 78%, var(--text));
  border: 2px solid var(--surface);
}
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.05rem; }
.avatar.xl { width: 84px; height: 84px; font-size: 1.5rem; }
.avatar.sq { border-radius: 14px; }
.h1 { --h: var(--hue-1); } .h2 { --h: var(--hue-2); } .h3 { --h: var(--hue-3); }
.h4 { --h: var(--hue-4); } .h5 { --h: var(--hue-5); } .h6 { --h: var(--hue-6); }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-inline-start: -10px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-name { font-weight: 700; color: var(--text); }
.who-sub { font-size: .82rem; color: var(--muted); }

/* Icône ronde */
.ibox {
  --h: var(--primary);
  width: 42px; height: 42px; border-radius: 14px; display: inline-grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--h) 13%, var(--surface)); color: color-mix(in srgb, var(--h) 82%, var(--text));
}
.ibox.lg { width: 54px; height: 54px; border-radius: 18px; }
.ibox.grad { background: var(--grad); color: var(--on-primary); }
.ibox.round { border-radius: 50%; }

/* Alertes */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--info) 22%, transparent); }
.alert > .ic { color: var(--info); margin-top: .15em; }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-success > .ic { color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 28%, transparent); }
.alert-warning > .ic { color: var(--warning); }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-danger > .ic { color: var(--danger); }
.alert-primary { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 22%, transparent); }
.alert-primary > .ic { color: var(--primary-ink); }
.alert strong { display: block; }
.banner-grad { background: var(--grad-accent); color: var(--on-primary); border-radius: var(--radius); padding: 18px 22px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.banner-grad a.btn { background: #ffffff; color: var(--primary-ink); }

/* Progression */
.progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.progress.ok > span { background: var(--success); }
.progress.warn > span { background: var(--warning); }
.progress.bad > span { background: var(--danger); }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 11px 14px; color: var(--text-2); font-weight: 700; font-size: .9rem;
  border-bottom: 2.5px solid transparent; white-space: nowrap; text-decoration: none !important; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary-ink); border-bottom-color: var(--primary); }
.tab .count { font-family: var(--font-data); font-size: .74rem; background: var(--surface-3); color: var(--text-2); padding: 0 .5em; border-radius: var(--radius-pill); }
.seg { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: var(--radius-pill); gap: 2px; border: 1px solid var(--border); }
.seg > a, .seg > button, .seg > label {
  border: 0; background: transparent; font: inherit; font-size: .84rem; font-weight: 700; color: var(--text-2);
  padding: .4em .9em; border-radius: var(--radius-pill); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none !important;
}
.seg > .is-active, .seg > [aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-icons > button { padding: .4em .55em; }

/* Étapes */
.steps { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; counter-reset: st; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: .88rem; }
.steps li .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-family: var(--font-data); font-size: .8rem; }
.steps li.done .n { background: var(--success-soft); color: var(--success); }
.steps li.current { color: var(--text); }
.steps li.current .n { background: var(--grad); color: var(--on-primary); }
.steps li + li::before { content: ""; width: 26px; height: 2px; background: var(--border-strong); border-radius: 2px; }
.vsteps { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.vsteps li a, .vsteps li span.vs { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 700; text-decoration: none !important; }
.vsteps .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-family: var(--font-data); font-size: .82rem; flex: none; }
.vsteps li.done .n { background: var(--success-soft); color: var(--success); }
.vsteps li.current a, .vsteps li.current span.vs { background: var(--primary-soft); color: var(--primary-ink); }
.vsteps li.current .n { background: var(--grad); color: var(--on-primary); }
.vsteps .sub { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); }

/* Formulaires */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-weight: 700; font-size: .88rem; color: var(--text); display: flex; justify-content: space-between; gap: 10px; }
.label .opt { font-weight: 600; color: var(--muted); }
.help { font-size: .8rem; color: var(--muted); }
.error-text { font-size: .8rem; color: var(--danger); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: .94rem; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: .7em .95em; min-height: 46px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .85; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus); }
.input.is-invalid { border-color: var(--danger); }
.input.is-valid { border-color: var(--success); }
.select { appearance: none; padding-inline-end: 2.4em; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap > .ic { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .ic.lead-ic { position: absolute; inset-inline-start: 14px; color: var(--muted); pointer-events: none; }
.input-wrap > .input.has-lead { padding-inline-start: 2.6em; }
.input-wrap > .trail { position: absolute; inset-inline-end: 6px; }
.input-wrap > .input.has-trail { padding-inline-end: 3em; }
.input-wrap > .input.has-trail-lg { padding-inline-end: 4.6em; }
/* Valeur de gauche à droite (e-mail, mot de passe, montant) dans une page en arabe : l'icône et l'unité restent du
   côté de la page, l'espace réservé doit les suivre. */
[dir="rtl"] .input-wrap > .input[dir="ltr"].has-lead { padding-left: .95em; padding-right: 2.6em; }
[dir="rtl"] .input-wrap > .input[dir="ltr"].has-trail { padding-right: .95em; padding-left: 3em; }
[dir="rtl"] .input-wrap > .input[dir="ltr"].has-lead.has-trail { padding-right: 2.6em; }
[dir="rtl"] .input-wrap > .input[dir="ltr"].has-trail-lg { padding-left: 4.6em; }
.prefix-wrap { display: flex; }
.prefix-wrap .prefix { display: inline-flex; align-items: center; padding-inline: .9em; border: 1.5px solid var(--border-strong); border-inline-end: 0; border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-weight: 700; font-family: var(--font-data); }
.prefix-wrap .input { border-start-start-radius: 0; border-end-start-radius: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; cursor: pointer; }

/* ---- Lien (i) / (م) et fenêtre d'information ---- */
.info-link { display: inline-flex; align-items: center; gap: 7px; padding-block: 3px; padding-inline: 3px 11px; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary-ink); font-size: .8rem; font-weight: 700; line-height: 1.2; text-decoration: none !important; white-space: nowrap; }
.info-link:hover { background: var(--primary-soft-2); }
.info-link:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.info-mark { flex: none; display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font: 800 .78rem/1 var(--font-latin); font-style: normal; }
html[lang="ar"] .info-mark { font-family: var(--font-ar); font-size: .8rem; padding-bottom: 2px; }
.dialog { border: 0; padding: 0; width: min(600px, calc(100vw - 32px)); max-height: min(84vh, 760px); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.dialog:focus, .dialog:focus-visible { outline: none; }
.dialog::backdrop { background: var(--overlay, rgba(13, 16, 32, .5)); backdrop-filter: blur(2px); }
.dialog-box { display: flex; flex-direction: column; max-height: inherit; }
.dialog-head { display: flex; align-items: center; gap: 12px; padding-block: 16px 14px; padding-inline: 20px 12px; border-bottom: 1px solid var(--border); }
.dialog-head .info-mark { width: 28px; height: 28px; font-size: .95rem; }
.dialog-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 1.05rem; text-wrap: balance; }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 20px; overflow-y: auto; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.dialog-foot .small { min-width: 0; }
@media (prefers-reduced-motion: no-preference) { .dialog[open] { animation: dialog-in .16s ease-out; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.note-block h4 { margin: 0 0 6px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted); }
html[lang="ar"] .note-block h4 { text-transform: none; letter-spacing: 0; font-size: .82rem; }
.note-block p { margin: 0; color: var(--text-2); }
.note-kind .badge { gap: 6px; }
.note-kind .badge .ic { width: 14px; height: 14px; }
.note-refs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note-refs li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.note-ref-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.note-ref-head b { font-size: .88rem; line-height: 1.4; min-width: 0; }
.note-art { flex: none; font: 800 .76rem/1.3 var(--font-data); color: var(--primary-ink); background: var(--primary-soft); border-radius: var(--radius-pill); padding: 2px 8px; white-space: nowrap; }
.note-refs p { margin: 0; font-size: .86rem; color: var(--text-2); }
.note-sub { display: flex; align-items: baseline; gap: 8px; }
.note-refs li > .note-sub + .note-sub { margin-top: 4px; }
@media (max-width: 480px) { .note-sub { flex-direction: column; align-items: flex-start; gap: 3px; } }

/* ---- Pages légales ---- */
.legal-switch { margin-top: 6px; }
.legal-switch > a { text-decoration: none !important; }
.legal-layout { gap: 40px; }
.legal-toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 92px); display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 120px); overflow-y: auto; }
.legal-toc-title { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted); padding: 0 10px 6px; }
html[lang="ar"] .legal-toc-title { text-transform: none; letter-spacing: 0; font-size: .84rem; }
.legal-toc a { display: flex; align-items: baseline; gap: 10px; padding: 6px 10px; border-radius: var(--radius-xs); color: var(--text-2); font-size: .86rem; font-weight: 600; line-height: 1.35; text-decoration: none !important; }
.legal-toc a:hover { background: var(--surface-2); color: var(--text); }
.legal-toc a b { flex: none; min-width: 1.4em; font-family: var(--font-data); color: var(--primary-ink); }
.legal-main { min-width: 0; }
.legal-summary h2 { margin: 0 0 10px; font-size: 1.05rem; }
.legal-summary ul { margin: 0; padding-inline-start: 1.2em; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.legal-sec { scroll-margin-top: 96px; display: flex; flex-direction: column; gap: 12px; padding-block-end: 28px; border-bottom: 1px solid var(--border); }
.legal-sec:last-of-type { border-bottom: 0; padding-block-end: 0; }
.legal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.legal-head h2 { margin: 0; font-size: 1.2rem; text-wrap: balance; }
.legal-head h2 .num { margin-inline-end: 10px; color: var(--primary-ink); font-family: var(--font-data); font-weight: 800; }
.legal-sec > p, .legal-sec > ul { margin: 0; max-width: 72ch; color: var(--text-2); }
.legal-sec > ul { padding-inline-start: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.legal-sec .table td, .legal-sec .table th { vertical-align: top; }
@media (max-width: 860px) { .legal-toc { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; } .legal-toc-title { width: 100%; } .legal-toc a span { display: none; } .legal-toc a { padding: 4px 9px; background: var(--surface-2); } }
.check input { width: 18px; height: 18px; accent-color: var(--primary); margin-top: .2em; flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: var(--radius-pill); background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background .2s ease; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: inset-inline-start .2s ease; }
.switch input:checked { background: var(--primary); border-color: transparent; }
.switch input:checked::after { inset-inline-start: 20px; }
.radio-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.radio-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); }
.radio-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus); background: var(--primary-soft); }
.radio-card .rc-title { font-weight: 800; }
.radio-card .rc-sub { font-size: .84rem; color: var(--muted); }
.radio-card .rc-check { position: absolute; top: 12px; inset-inline-end: 12px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; }
.radio-card:has(input:checked) .rc-check { background: var(--grad); border-color: transparent; color: var(--on-primary); }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 30px 20px; text-align: center; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-2); }
.dropzone .ibox { margin-bottom: 4px; }
.otp { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.otp input { width: 52px; height: 60px; text-align: center; font-size: 1.5rem; font-weight: 800; font-family: var(--font-data); border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); }
.otp input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus); }
@media (max-width: 420px) { .otp { gap: 6px; } .otp input { width: 42px; height: 52px; } }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.strength span { height: 6px; border-radius: 6px; background: var(--surface-3); }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--warning); }
.strength[data-level="3"] span:nth-child(-n+3) { background: var(--info); }
.strength[data-level="4"] span:nth-child(-n+4) { background: var(--success); }
.rules { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: .82rem; color: var(--muted); }
.rules li { display: flex; gap: 6px; align-items: center; }
.rules li.ok { color: var(--success); font-weight: 700; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .84rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 800; margin-bottom: 10px; }

/* Tableaux */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.table th {
  text-align: start; font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: var(--track-label);
  color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .t-num { font-family: var(--font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .t-end { text-align: end; }
.table a.row-link { color: var(--text); font-weight: 700; }
.table .sub { display: block; font-size: .8rem; color: var(--muted); font-weight: 500; }
.table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: start; }

/* Barre d'outils / filtres */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 260px; max-width: 420px; }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; color: var(--muted); font-size: .86rem; }
.pagination .pages { display: flex; gap: 4px; }
.pagination .pages a { min-width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); font-weight: 700; font-family: var(--font-data); }
.pagination .pages a.is-active { background: var(--primary-soft); color: var(--primary-ink); }

/* Indicateurs */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-weight: 700; font-size: .86rem; }
.kpi-value { font-family: var(--font-data); font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-value small { font-size: .9rem; color: var(--muted); font-weight: 700; }
.kpi-foot { font-size: .82rem; color: var(--muted); }
.trend-up { color: var(--success); font-weight: 800; }
.trend-down { color: var(--danger); font-weight: 800; }

/* Barres simples */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 70px; gap: 12px; align-items: center; font-size: .88rem; }
.bar-row .track { height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.bar-row .track > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.bar-row .v { font-family: var(--font-data); font-weight: 800; text-align: end; font-variant-numeric: tabular-nums; }
.vchart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; border-bottom: 1px solid var(--border); }
.vchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vchart .col > span { width: 100%; max-width: 38px; border-radius: 10px 10px 4px 4px; background: var(--grad); display: block; }
.vchart .col > span.alt { background: color-mix(in srgb, var(--primary) 28%, var(--surface-3)); }
.vchart-labels { display: flex; gap: 10px; }
.vchart-labels span { flex: 1; text-align: center; font-size: .76rem; color: var(--muted); font-family: var(--font-data); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--grad); margin-inline-end: 6px; vertical-align: -1px; }
.legend i.alt { background: color-mix(in srgb, var(--primary) 28%, var(--surface-3)); }
.donut { --v: 60; width: 120px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--v) * 1%), var(--surface-3) 0); display: grid; place-items: center; max-width: 100%; }
.donut::before { content: ""; grid-area: 1 / 1; width: 72%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); }
.donut > b { grid-area: 1 / 1; font-family: var(--font-data); font-size: 1.3rem; z-index: 1; }

/* Chronologie */
.timeline { list-style: none; position: relative; display: flex; flex-direction: column; gap: 6px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding-block: 8px; }
.tl-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-2); z-index: 1; }
.tl-item.is-key .tl-dot { background: var(--grad); color: var(--on-primary); border-color: transparent; }
.tl-item.is-future .tl-dot { border-style: dashed; color: var(--muted); }
.tl-date { font-family: var(--font-data); font-size: .8rem; color: var(--muted); font-weight: 700; }
.tl-card { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.tl-card h4 { font-size: .95rem; }
.tl-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--surface-2); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; padding: 4px 6px; }
.kcard { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; }
.kcard h4 { font-size: .92rem; font-weight: 700; }
.kcard .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }

/* Calendrier */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-h { padding: 10px; font-size: .76rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: var(--track-label); background: var(--surface-2); text-align: center; }
.cal-d { min-height: 112px; padding: 8px; border-top: 1px solid var(--border); border-inline-start: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-d:nth-child(7n + 1) { border-inline-start: 0; }
.cal-d .d { font-family: var(--font-data); font-size: .82rem; font-weight: 800; color: var(--text-2); }
.cal-d.out .d { color: var(--muted); opacity: .55; }
.cal-d.today .d { background: var(--grad); color: var(--on-primary); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.cal-d.holiday { background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.cal-e { font-size: .74rem; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; text-decoration: none !important; }
.cal-e.t-hearing { background: color-mix(in srgb, var(--hue-5) 15%, var(--surface)); color: color-mix(in srgb, var(--hue-5) 80%, var(--text)); }
.cal-e.t-deadline { background: var(--danger-soft); color: var(--danger); }
.cal-e.t-meeting { background: color-mix(in srgb, var(--hue-2) 15%, var(--surface)); color: color-mix(in srgb, var(--hue-2) 80%, var(--text)); }
.cal-e.t-client { background: color-mix(in srgb, var(--hue-1) 14%, var(--surface)); color: color-mix(in srgb, var(--hue-1) 80%, var(--text)); }
.cal-e.t-holiday { background: var(--warning-soft); color: var(--warning); }
@media (max-width: 760px) { .cal-d { min-height: 74px; padding: 4px; } .cal-e { font-size: .64rem; padding: 2px 4px; } }

/* Menus */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; display: flex; flex-direction: column; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; background: none; border: 0; text-align: start; cursor: pointer; text-decoration: none !important; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop hr { margin: 6px 0; }

/* Divers */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.paper { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 36px 40px; box-shadow: var(--shadow); font-size: .9rem; line-height: 1.9; color: var(--text); }
.paper h4 { text-align: center; margin-bottom: 12px; }
.mark { background: color-mix(in srgb, var(--warning) 26%, transparent); color: inherit; border-radius: 4px; padding: 0 .2em; }
.mark-p { background: var(--primary-soft-2); color: inherit; border-radius: 4px; padding: 0 .2em; }
.mark-s { background: color-mix(in srgb, var(--success) 22%, transparent); color: inherit; border-radius: 4px; padding: 0 .2em; }
.mark-d { background: color-mix(in srgb, var(--danger) 18%, transparent); color: inherit; border-radius: 4px; padding: 0 .2em; }
.ai-box { border-radius: var(--radius); padding: 18px 20px; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad-accent) border-box; border: 1.5px solid transparent; }
.ai-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 800; color: var(--primary-ink); background: var(--primary-soft); padding: .2em .7em; border-radius: var(--radius-pill); }
.diff-old { background: var(--danger-soft); color: var(--text); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; white-space: pre-wrap; direction: ltr; text-align: left; }
.diff-new { background: var(--success-soft); color: var(--text); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; white-space: pre-wrap; direction: ltr; text-align: left; }
.file-ic { width: 40px; height: 48px; border-radius: 8px; display: grid; place-items: center; font-size: .62rem; font-weight: 800; color: #ffffff; flex: none; font-family: var(--font-latin); letter-spacing: .02em; }
.file-ic.pdf { background: #d83a3a; } .file-ic.doc { background: #2f6fde; } .file-ic.xls { background: #1d8a4e; } .file-ic.img { background: #8a4fe0; } .file-ic.eml { background: #d98a00; }
.score { font-family: var(--font-data); font-weight: 800; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; font-weight: 800; }
.note { font-size: .82rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.code-chip { font-family: var(--font-data); font-weight: 800; letter-spacing: .02em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .15em .55em; font-size: .84rem; color: var(--text); direction: ltr; unicode-bidi: isolate; display: inline-block; }
.priority { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; }
.priority::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--muted); }
.priority.p-urgent::before { background: var(--danger); }
.priority.p-high::before { background: var(--warning); }
.priority.p-medium::before { background: var(--info); }
.priority.p-low::before { background: var(--success); }
.countdown { font-family: var(--font-data); font-weight: 800; }
.countdown.bad { color: var(--danger); } .countdown.warn { color: var(--warning); } .countdown.ok { color: var(--success); }

/* ==========================================================================
   Site public
   ========================================================================== */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: color-mix(in srgb, var(--bg-public) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.site-header .container { display: flex; align-items: center; gap: 22px; height: 70px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.22rem; color: var(--text); text-decoration: none !important; font-family: var(--font-latin); letter-spacing: -0.02em; }
.logo svg { width: 34px; height: 34px; }
.logo .tag { font-family: var(--font-body); font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: 0; display: block; line-height: 1; }
@media (max-width: 480px) { .logo .tag-ar { display: none; } }
.site-nav { display: flex; gap: 4px; align-items: center; }
.site-nav a { color: var(--text-2); font-weight: 700; font-size: .93rem; padding: 8px 12px; border-radius: var(--radius-pill); }
.site-nav a:hover, .site-nav a.is-active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.mobile-nav { display: none; }
@media (max-width: 1020px) {
  .site-nav, .header-actions .hide-m { display: none; }
  .mobile-nav { display: block; }
}
.mobile-nav .menu-pop { min-width: 260px; }

.hero { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-fg); padding-block: 72px 120px; border-end-start-radius: 50% 70px; border-end-end-radius: 50% 70px; }
.hero h1 { color: var(--hero-fg); font-size: clamp(2.1rem, 1.4rem + 3vw, 3.5rem); font-weight: 800; }
html[lang="ar"] .hero h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.2rem); }
.hero .lead { color: var(--hero-muted); font-size: 1.15rem; }
.hero .eyebrow { color: var(--hero-fg); opacity: .9; }
:root[data-style]:not([data-style="flow"]) .hero .eyebrow { color: var(--primary-ink); opacity: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; position: relative; z-index: 1; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } .hero { padding-block: 48px 96px; } }
.hero-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.hero-blob.b1 { width: 420px; height: 420px; background: var(--accent); top: -120px; inset-inline-end: -80px; }
.hero-blob.b2 { width: 360px; height: 360px; background: var(--primary-2); bottom: -160px; inset-inline-start: -100px; opacity: .4; }
:root[data-style]:not([data-style="flow"]) .hero-blob { opacity: .22; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--hero-muted); font-size: .9rem; font-weight: 600; }
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.glass { background: var(--hero-glass); border: 1px solid var(--hero-glass-border); border-radius: var(--radius-lg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.mock-window { background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; }
.mock-bar { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: center; background: var(--surface-2); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); display: block; }
.mock-float { position: absolute; z-index: 2; background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: .85rem; }
.section { padding-block: 84px; position: relative; }
.section-sm { padding-block: 56px; }
.section-muted { background: var(--surface-2); }
.section-bent-top { border-start-start-radius: 50% 60px; border-start-end-radius: 50% 60px; }
.section-bent { border-end-start-radius: 50% 60px; border-end-end-radius: 50% 60px; }
.section-head { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; max-width: 760px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem); }
.section-head .lead { margin-inline: auto; }
.overlap { margin-top: -64px; position: relative; z-index: 2; }
.feature { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.feature p { color: var(--text-2); font-size: .95rem; }
.pill-img { border-radius: var(--radius-pill); overflow: hidden; }
.cta-band { background: var(--grad-accent); color: var(--on-primary); border-radius: var(--radius-lg); padding: 48px clamp(22px, 5vw, 60px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; position: relative; overflow: hidden; }
.cta-band h2 { color: var(--on-primary); font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.2rem); }
.cta-band p { color: color-mix(in srgb, var(--on-primary) 85%, transparent); }
.cta-band .btn-white { background: #ffffff; color: #1b1f33; }
.cta-band .btn-outline-white { border-color: rgba(255, 255, 255, .55); color: #ffffff; }
@media (max-width: 760px) { .cta-band { grid-template-columns: minmax(0, 1fr); } }
.orbit { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 760px; margin-inline: auto; }
.orbit .core { grid-column: 2; grid-row: 2; background: var(--grad); color: var(--on-primary); border-radius: var(--radius-lg); padding: 22px; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 6px; box-shadow: var(--shadow-lg); }
.orbit .core h3 { color: var(--on-primary); font-size: 1.3rem; }
.orbit .sat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: .92rem; box-shadow: var(--shadow-sm); }
@media (max-width: 640px) { .orbit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .orbit .core { grid-column: 1 / -1; grid-row: 1; } }
.chain { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.chain .node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 10px 16px; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; box-shadow: var(--shadow-sm); font-size: .92rem; }
.chain .node.key { background: var(--grad); color: var(--on-primary); border-color: transparent; }
.chain .arrow { color: var(--muted); }
.price-card { padding: 28px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.price-card.is-featured { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad-accent) border-box; box-shadow: var(--shadow-lg); }
.price-card .ribbon { position: absolute; top: -13px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--grad); color: var(--on-primary); font-size: .76rem; font-weight: 800; padding: .3em 1em; border-radius: var(--radius-pill); white-space: nowrap; }
[dir="rtl"] .price-card .ribbon { transform: translateX(50%); }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price .amount { font-family: var(--font-data); font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.price .per { color: var(--muted); font-weight: 600; font-size: .9rem; }
.faq details { border-bottom: 1px solid var(--border); padding-block: 16px; }
.faq summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin-top: 10px; color: var(--text-2); }
.compare th, .compare td { text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: start; }
.compare td .ic { color: var(--success); }
.compare td .ic.no { color: var(--muted); }
.roadmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; counter-reset: rm; }
.roadmap .rm { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.roadmap .rm .tag { font-family: var(--font-data); font-size: .74rem; font-weight: 800; color: var(--primary-ink); }
.site-footer { background: var(--surface-2); padding-block: 56px 28px; margin-top: 40px; border-start-start-radius: 50% 50px; border-start-end-radius: 50% 50px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: 28px; }
.footer-grid h4 { font-size: .86rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-grid a { color: var(--text-2); font-size: .9rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-grid > :first-child { grid-column: 1 / -1; } }
.page-hero { padding-block: 56px 72px; background: var(--surface-2); border-end-start-radius: 50% 50px; border-end-end-radius: 50% 50px; text-align: center; }
.page-hero .container { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.page-hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); }

/* ==========================================================================
   Authentification
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg-public); }
.auth-main { display: flex; flex-direction: column; padding: 24px clamp(20px, 5vw, 64px); min-width: 0; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-form { width: 100%; max-width: 440px; margin: auto; padding-block: 36px; display: flex; flex-direction: column; gap: 22px; }
.auth-form.wide { max-width: 640px; }
.auth-form h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); }
.auth-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }
.auth-art { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-fg); border-start-start-radius: 56px; border-end-start-radius: 56px; display: flex; align-items: center; justify-content: center; padding: 48px; min-height: 100%; }
:root[data-style]:not([data-style="flow"]) .auth-art { background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--primary) 18%, var(--surface-2)) 0%, var(--surface-2) 60%); }
.auth-art-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 22px; max-width: 460px; width: 100%; }
.auth-art h2 { color: var(--hero-fg); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); }
.auth-art p { color: var(--hero-muted); }
.art-card { background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); }
.art-card:nth-child(2n) { margin-inline-start: 36px; }
.state-icon { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.state-icon .ic { width: 36px; height: 36px; }
.state-icon.ok { background: var(--success-soft); color: var(--success); }
.state-icon.warn { background: var(--warning-soft); color: var(--warning); }
.state-icon.bad { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 980px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; } }

/* Assistant de démarrage */
.wizard { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.wizard-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px clamp(20px, 4vw, 40px); background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wizard-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; padding: 32px clamp(20px, 4vw, 40px); max-width: 1180px; width: 100%; margin-inline: auto; align-items: start; }
.wizard-aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.wizard-card { padding: 28px clamp(20px, 3vw, 36px); display: flex; flex-direction: column; gap: 22px; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
@media (max-width: 900px) { .wizard-body { grid-template-columns: minmax(0, 1fr); } .wizard-aside { position: static; } }

/* ==========================================================================
   Application (espace cabinet)
   ========================================================================== */
.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-inline-end: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.sidebar .logo { padding-inline: 8px; }
.org-switch { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); text-decoration: none !important; }
.org-switch .name { font-weight: 800; font-size: .88rem; line-height: 1.25; }
.org-switch .sub { font-size: .76rem; color: var(--muted); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: var(--track-label); padding: 10px 12px 4px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 700; font-size: .9rem; text-decoration: none !important; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary-ink); }
.nav-link .count { margin-inline-start: auto; font-family: var(--font-data); font-size: .72rem; font-weight: 800; background: var(--surface-3); color: var(--text-2); border-radius: var(--radius-pill); padding: 0 .55em; }
.nav-link .count.hot { background: var(--danger); color: #ffffff; }
.nav-link .soon { margin-inline-start: auto; font-size: .66rem; font-weight: 800; color: var(--muted); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); padding: 0 .5em; }
.sidebar-foot { margin-top: auto; }
.plan-card { padding: 14px; border-radius: var(--radius); background: var(--primary-soft); display: flex; flex-direction: column; gap: 8px; font-size: .84rem; }
.plan-card b { font-size: .9rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar .search-box { flex: 1 1 auto; max-width: 520px; }
.topbar .search-box .input { border-radius: var(--radius-pill); background: var(--surface); min-height: 42px; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-2); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .pip { position: absolute; top: 8px; inset-inline-end: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.menu-toggle { display: none; }
.content { padding: 26px 28px 80px; width: 100%; max-width: 1440px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .titles { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-head p { color: var(--text-2); }
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--muted); font-weight: 600; }
.crumbs a { color: var(--muted); }
.crumbs .ic { width: 14px; height: 14px; }
.matter-head { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.matter-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px; }
.matter-meta .m { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.matter-meta .m span { font-size: .78rem; color: var(--muted); font-weight: 700; }
.matter-meta .m b { font-size: .92rem; overflow-wrap: anywhere; }
.scrim { display: none; }
@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 284px; z-index: 70; transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 65; }
  .menu-toggle { display: inline-grid; }
  .content { padding: 20px 16px 90px; }
  .topbar { padding: 10px 16px; }
  .topbar .hide-m { display: none; }
}
@media (max-width: 640px) { .topbar .search-box { display: none; } }

/* Portail client */
.portal-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-header .container { display: flex; align-items: center; gap: 18px; min-height: 68px; flex-wrap: wrap; }
.portal-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.portal-nav a { padding: 8px 12px; border-radius: var(--radius-pill); color: var(--text-2); font-weight: 700; font-size: .9rem; }
.portal-nav a.is-active { background: var(--primary-soft); color: var(--primary-ink); text-decoration: none; }
.portal-main { padding-block: 28px 80px; display: flex; flex-direction: column; gap: 22px; }

/* ==========================================================================
   Pages de référence (plan des pages, parcours)
   ========================================================================== */
.hub-hero { background: var(--hero-bg); color: var(--hero-fg); padding-block: 48px 84px; border-end-start-radius: 50% 56px; border-end-end-radius: 50% 56px; }
.hub-hero h1 { color: var(--hero-fg); font-size: clamp(1.8rem, 1.2rem + 2vw, 2.7rem); }
.hub-hero p { color: var(--hero-muted); max-width: 70ch; }
.hub-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.hub-stat { background: var(--hero-glass); border: 1px solid var(--hero-glass-border); border-radius: var(--radius); padding: 10px 16px; display: flex; flex-direction: column; color: var(--hero-fg); }
.hub-stat b { font-family: var(--font-data); font-size: 1.4rem; line-height: 1.2; }
.hub-stat span { font-size: .82rem; color: var(--hero-muted); }
.module-card { padding: 0; overflow: hidden; scroll-margin-top: 90px; }
.module-card .mc-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.module-card .mc-num { font-family: var(--font-data); font-weight: 800; font-size: .78rem; color: var(--primary-ink); }
.page-list { list-style: none; display: flex; flex-direction: column; }
.page-list li a { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 20px; color: var(--text); text-decoration: none !important; border-bottom: 1px solid var(--border); }
.page-list li:last-child a { border-bottom: 0; }
.page-list li a:hover { background: var(--surface-2); }
.page-list .pl-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.page-list .pl-t { font-weight: 700; font-size: .92rem; }
.page-list .pl-d { display: block; font-size: .8rem; color: var(--muted); font-weight: 500; }
.toc { display: flex; gap: 8px; flex-wrap: wrap; }
.flow-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 90px; }
.flow-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.flow { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.flow > li { display: flex; align-items: center; gap: 8px; }
.flow-step { width: 148px; min-height: 148px; padding: 14px 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--text); text-decoration: none !important; position: relative; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease; }
.flow-step:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.flow-step .fs-ic { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: var(--on-primary); box-shadow: 0 10px 20px -12px var(--primary); }
.flow-step .fs-n { position: absolute; top: 8px; inset-inline-start: 10px; font-family: var(--font-data); font-size: .72rem; font-weight: 800; color: var(--muted); }
.flow-step .fs-t { font-weight: 800; font-size: .84rem; line-height: 1.3; }
.flow-step .fs-a { font-size: .74rem; color: var(--muted); line-height: 1.35; }
.flow-step .fs-v { margin-top: auto; font-size: .72rem; font-weight: 800; color: var(--primary-ink); display: inline-flex; gap: 4px; align-items: center; }
.flow-step.is-ext .fs-ic { background: var(--surface-3); color: var(--text-2); box-shadow: none; }
.flow-arrow { color: var(--muted); display: inline-grid; place-items: center; }
@media (max-width: 520px) { .flow-step { width: 132px; min-height: 140px; } }
.persona { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .86rem; color: var(--text-2); }

/* ==========================================================================
   Personnalisation (styles, mode, langue) et parcours guidé
   ========================================================================== */
.customizer-btn { position: fixed; z-index: 90; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); inset-inline-end: 18px; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; background: var(--grad-accent); color: var(--on-primary); box-shadow: var(--shadow-lg); display: grid; place-items: center; }
.customizer-btn .ic { width: 24px; height: 24px; }
.customizer { position: fixed; z-index: 91; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); inset-inline-end: 18px; width: min(330px, calc(100vw - 36px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 18px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 110px); overflow-y: auto; }
.customizer h3 { font-size: .95rem; }
.cz-label { font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: var(--track-label); }
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.swatch { border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 8px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font: inherit; font-size: .7rem; font-weight: 700; color: var(--text-2); text-align: center; line-height: 1.25; }
.swatch .sw { width: 30px; height: 30px; border-radius: 50%; display: block; }
.swatch[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); color: var(--text); }
.sw-flow { background: linear-gradient(135deg, #5236ee, #9646ea 55%, #ff6fa5); }
.sw-blue { background: linear-gradient(135deg, #2459e0, #4cc3ff); }
.sw-darkblue { background: linear-gradient(135deg, #1e2a64, #8a98d8); }
.sw-green { background: linear-gradient(135deg, #0b805c, #3ddc9b); }
.sw-lightblue { background: linear-gradient(135deg, #0a76b8, #5ad1f5); }
.sw-pink { background: linear-gradient(135deg, #cc2b67, #ff9fc2); }
.mode-seg { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
.mode-seg > button { justify-content: center; }
.lang-seg { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); }
.lang-seg > a { justify-content: center; }
.tour-bar { position: fixed; z-index: 89; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); width: min(720px, calc(100vw - 180px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.tour-bar .tb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tour-bar .tb-t { font-size: .74rem; font-weight: 800; color: var(--primary-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-bar .tb-s { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-bar .tb-p { height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.tour-bar .tb-p > span { display: block; height: 100%; background: var(--grad); }
@media (max-width: 640px) { .tour-bar { left: auto; inset-inline-start: 12px; transform: none; width: calc(100vw - 88px); padding: 10px; gap: 6px; } .tour-bar .btn-label { display: none; } }

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

/* ---- Compléments ----------------------------------------------------------- */
.hero .hl { background: linear-gradient(transparent 60%, rgba(255, 255, 255, .26) 0); border-radius: 4px; padding-inline: .08em; }
:root[data-style]:not([data-style="flow"]) .hero .hl { background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0; }
html[lang="ar"] .hero .hl { font-family: var(--font-ar-display); font-weight: 700; line-height: 1.6; }
.btn-white { background: #ffffff; color: #1b1f33; }
.btn-outline-white { border-color: rgba(255, 255, 255, .55); color: #ffffff; }
.btn-outline-white:hover { background: rgba(255, 255, 255, .12); }

/* ==========================================================================
   Compléments des écrans métier
   ========================================================================== */
.invite-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) auto; align-items: end; }
@media (max-width: 640px) { .invite-row { grid-template-columns: minmax(0, 1fr); padding-bottom: 12px; border-bottom: 1px solid var(--border); } }
.code-chip { white-space: nowrap; }
.bar-row { grid-template-columns: minmax(70px, 34%) minmax(0, 1fr) auto; }
.countdown { white-space: nowrap; }

/* ==========================================================================
   Plan des pages, parcours et page d'entrée
   ========================================================================== */
[lang="ar"]:not(html) { --font-body: var(--font-ar); --font-head: var(--font-ar); --font-display: var(--font-ar-display); --font-data: var(--font-ar-utility); font-family: var(--font-body); }
.hub-body { position: relative; margin-top: -40px; padding-bottom: 110px; }
.zone { scroll-margin-top: 90px; }
.zone-head { display: flex; gap: 14px; align-items: flex-start; }
.zone-head h2 { font-size: clamp(1.2rem, 1rem + .8vw, 1.55rem); }
.zone-n { flex: none; min-width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: var(--on-primary); font-family: var(--font-data); font-weight: 800; font-size: .9rem; }
.module-grid { columns: 2 440px; column-gap: 20px; }
.module-grid > .module-card { display: block; break-inside: avoid; margin-bottom: 20px; }
.module-card .mc-head h3 { font-size: 1.05rem; }
.module-card .mc-foot { padding: 10px 20px 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
.page-list .pl-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.toc .chip { text-decoration: none; }
.toc .chip b { font-family: var(--font-data); color: var(--primary-ink); }
.flow-card h3 { font-size: 1.05rem; }
.lang-card { padding: 0; overflow: hidden; }
.lang-card-head { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.lang-card-head > div { flex: 1; min-width: 0; }
.lang-mark { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: var(--grad); color: var(--on-primary); font-weight: 800; font-size: 1.3rem; flex: none; }
.root-ar { font-family: var(--font-ar-display); font-size: 1.25rem; font-weight: 700; color: var(--hero-fg) !important; }
@media (max-width: 640px) {
  .page-list.rich li a { grid-template-columns: 32px minmax(0, 1fr); }
  .page-list .pl-r { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
  .lang-card-head { flex-wrap: wrap; }
}
.vchart .col.pair { flex-direction: row; align-items: flex-end; justify-content: center; gap: 3px; }
.vchart .col.pair > span { max-width: 16px; }
.timeline .chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: start; }
.flow > li { align-items: stretch; }
.flow > li > .flow-arrow { align-self: center; }
@media (max-width: 640px) {
  .flow { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  .flow > li { flex-direction: column; gap: 0; }
  .flow-step { width: 100%; min-height: 0; display: grid; grid-template-columns: 22px 40px minmax(0, 1fr); column-gap: 10px; row-gap: 1px; align-items: center; text-align: start; padding: 10px 12px; }
  .flow-step:hover { transform: none; }
  .flow-step .fs-n { position: static; grid-row: 1 / span 3; }
  .flow-step .fs-ic { width: 40px; height: 40px; border-radius: 14px; grid-row: 1 / span 3; }
  .flow-step .fs-t, .flow-step .fs-a, .flow-step .fs-v { grid-column: 3; }
  .flow-step .fs-v { margin-top: 2px; }
  .flow > li > .flow-arrow { align-self: flex-start; margin-inline-start: 42px; height: 22px; transform: rotate(90deg); }
  [dir="rtl"] .flow > li > .flow-arrow { transform: rotate(-90deg); }
}
.root-ar { text-align: left; }
@media (max-width: 480px) {
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
}
