/* ==========================================================================
   Cx Spoofer — design system (toutes les pages)
   Deux thèmes, mêmes composants : html[data-theme="dark"] (défaut, « nuit ») et
   html[data-theme="light"] (« clair »), posé avant le premier rendu par le script
   de <head> de chaque page puis piloté par theme.js (window.CxTheme).
   Nuit : graphite profond, panneaux anthracite, liserés clairs, accent monochrome blanc.
   Clair : surfaces blanches et gris neutres, texte quasi noir, accent monochrome noir.
   Aucune teinte d'accent : seuls les statuts (vert ok, rouge erreur, ambre alerte) sont colorés.
   Boutons principaux : argent brossé (« gris brillant », jetons --btn-metal-*), coins de 6 px pour tous les contrôles (--radius-control).
   Îlots toujours sombres (vidéo, écran du téléphone, visionneuse) : ils reprennent
   les jetons de nuit quel que soit le thème (sélecteur ci-dessous).
   Inter + JetBrains Mono : feuille Google Fonts posée par le serveur dans chaque page, juste avant ds.css
   (server.py, FONTS_CSS) — téléchargée en parallèle, plus en chaîne derrière ce fichier (@import)
   ========================================================================== */

/* jetons de nuit : page entière par défaut, et îlots sombres en thème clair
   (visionneuse des résultats, scène d'aperçu du Studio, barre rapide posée sur la vidéo du téléphone) */
:root,
html[data-theme="light"] :is(dialog.viewer, .st-stage, .qt) {
  /* fonds : graphite profond → panneaux anthracite (studio pro) */
  --bg: #09090b;            /* fond de l'application */
  --bg-2: #111114;          /* creux : champs, segments, rails */
  --bg-3: #1a1a1f;          /* creux survolé */
  --surface: #131316;       /* cartes, panneaux */
  --surface-2: #19191d;     /* éléments posés sur une carte */
  --surface-3: #212126;     /* survol / sélection douce */
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .11);
  --line-3: rgba(255, 255, 255, .19);
  --text: #f3f3f5;
  --text-2: #a1a1aa;
  --text-3: #6b6b74;
  --ink: #f3f3f5;           /* boutons principaux : blanc */
  --on-ink: #0b0b0d;        /* texte sur --ink */
  --accent: #f3f3f5;        /* accent monochrome (blanc) : sélection, progression, tête de lecture */
  --accent-2: #b9b9c1;      /* second ton (gris argent) des barres */
  --accent-strong: #ffffff; /* texte d'accent */
  --accent-soft: rgba(255, 255, 255, .1);
  --accent-ring: rgba(255, 255, 255, .34);
  --grad: linear-gradient(160deg, #ffffff 0%, #ececef 48%, #cfcfd5 100%);   /* blanc nacré → argent */
  --on-accent: #0b0b0d;     /* encre sur l'accent : 18:1 */
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .13);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .13);
  --info: #d4d4d8; --info-soft: rgba(255, 255, 255, .07);   /* information : neutre (pas de teinte) */
  --hover: rgba(255, 255, 255, .055);
  --hover-2: rgba(255, 255, 255, .09);
  --glass: rgba(17, 17, 20, .78);          /* barres et menus translucides */
  --scrim: rgba(0, 0, 0, .6);
  --r-xs: 6px; --r-sm: 9px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --radius-control: 6px;    /* boutons, champs, listes, segments, boutons d'outils : coins légers */
  --radius-inner: 4px;      /* élément posé dans un contrôle (segment choisi, bouton d'un compteur) */
  --radius-tag: 5px;        /* pastilles, badges, étiquettes (pas des boutons) */
  --sh-1: 0 0 0 1px rgba(255, 255, 255, .06);
  --sh-2: 0 0 0 1px rgba(255, 255, 255, .07), 0 16px 40px -16px rgba(0, 0, 0, .7);
  --sh-3: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 100px -24px rgba(0, 0, 0, .85);
  --glow: 0 10px 30px -14px rgba(255, 255, 255, .28);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --dur: .22s;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sb-w: 296px; --sb-min: 72px;                 /* (11/10 : 264 → 296, « Descriptions Médias Privés ») */
  color-scheme: dark;
}
/* jetons dérivés : construits sur la charte ci-dessus, définis une seule fois ici */
:root,
html[data-theme="light"] :is(dialog.viewer, .st-stage, .qt) {
  --accent-deep: #e9e9ed;                 /* accent plein sous un petit texte --on-accent (badges, pastilles) : 15:1 */
  --grad-shade: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 0, 0, .04)); /* voile posé sur --grad sous le libellé --on-accent */
  --glass-hi: rgba(30, 30, 35, .9);       /* toasts et info-bulles : verre clair quasi opaque + flou (se détache du fond) */
  --grad-text: linear-gradient(135deg, #ffffff 0%, #e4e4e8 45%, #a1a1aa 100%);   /* reflet argent posé sur du texte (titres « em ») : ≥ 7:1 */
  --accent-hi: #ffffff;                   /* lien d'accent survolé */
  --ink-hi: #fff;                         /* bouton principal (--ink) survolé */
  --ink-glow: rgba(255, 255, 255, .35);   /* halo du bouton principal survolé */
  --track: rgba(255, 255, 255, .12);      /* rail des curseurs */
  --track-bar: rgba(255, 255, 255, .08);  /* fond des barres de progression */
  --track-ring: rgba(255, 255, 255, .1);  /* fond des anneaux de progression */
  --skel: rgba(255, 255, 255, .05);       /* squelettes de chargement… */
  --skel-hi: rgba(255, 255, 255, .06);    /* …et leur reflet */
  --scrollbar: rgba(255, 255, 255, .16);
  --edge: rgba(255, 255, 255, .16);       /* liseré des pastilles de couleur (lisible sur blanc comme sur noir) */
  --seg-on: var(--surface-3);             /* segment / onglet choisi */
  --seg-sh: 0 2px 6px -2px rgba(0, 0, 0, .6);
  --switch-off: var(--surface-3);         /* interrupteur éteint */
  --thumb-sh: 0 2px 6px rgba(0, 0, 0, .55), 0 0 0 .5px rgba(0, 0, 0, .3);   /* pouce blanc des curseurs */
  --grid-line: rgba(255, 255, 255, .035); /* trame des pages de compte */
  --card-hi: inset 0 1px 0 rgba(255, 255, 255, .04), 0 36px 90px -30px rgba(0, 0, 0, .9);   /* reflet + ombre portée des cartes de compte */
  --sb-bg: #0c0c0f;                       /* barre latérale */
  --card-sh: 0 0 0 1px rgba(255, 255, 255, .07);   /* liseré des cartes (= --line) */
  /* bouton principal « gris brillant » : argent brossé, reflet haut, liseré acier, encre sombre (≥ 11:1) */
  --btn-metal: linear-gradient(180deg, #f5f6f8 0%, #e3e5e8 46%, #c4c7cd 100%);
  --btn-metal-hover: linear-gradient(180deg, #fbfbfc 0%, #ebecef 46%, #cfd2d7 100%);
  --btn-metal-active: linear-gradient(180deg, #c1c4ca 0%, #d4d6da 55%, #e2e4e7 100%);
  --btn-metal-border: #9ea2aa;
  --btn-metal-ink: #111214;
  --btn-metal-emboss: 0 1px 0 rgba(255, 255, 255, .45);                  /* libellé légèrement gravé */
  --btn-metal-hi: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(0, 0, 0, .1);
  --btn-metal-sh: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 20px -10px rgba(0, 0, 0, .75);
  --btn-metal-sh-hover: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 26px -10px rgba(255, 255, 255, .24);
  --btn-metal-press: inset 0 1px 3px rgba(0, 0, 0, .3);
  --btn-metal-off: #2c2d32;             /* désactivé : à plat, éteint */
  --btn-metal-off-border: #3b3d43;
  --btn-metal-off-ink: #85878f;
  --metal-fill: linear-gradient(90deg, #c4c7cd, #f5f6f8);   /* remplissage argent des barres de progression */
}

/* ── thème clair : blanc, gris neutres, texte quasi noir, accent monochrome noir ── */
html[data-theme="light"] {
  --bg: #f7f7f8;
  --bg-2: #f2f2f4;
  --bg-3: #e9e9ed;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --surface-3: #f0f0f3;
  --line: rgba(12, 12, 24, .08);
  --line-2: rgba(12, 12, 24, .12);
  --line-3: rgba(12, 12, 24, .2);
  --text: #111114;
  --text-2: #5b5b66;        /* 6.7:1 sur blanc */
  --text-3: #7c7c86;        /* 4.1:1 sur blanc */
  --ink: #111114;           /* boutons principaux : noir */
  --on-ink: #ffffff;
  --accent: #0b0b0d;        /* accent monochrome (noir) */
  --accent-2: #3f3f46;
  --accent-strong: #0b0b0d; /* texte d'accent : 19:1 sur blanc */
  --accent-soft: rgba(12, 12, 24, .06);
  --accent-ring: rgba(12, 12, 24, .28);
  --grad: linear-gradient(160deg, #2c2c33 0%, #141417 50%, #000000 100%);   /* graphite → noir */
  --on-accent: #ffffff;
  --accent-deep: #111114;
  --ok: #0a8560; --ok-soft: rgba(10, 133, 96, .1);
  --warn: #b45309; --warn-soft: rgba(180, 83, 9, .1);
  --bad: #dc2626; --bad-soft: rgba(220, 38, 38, .09);
  --info: #3f3f46; --info-soft: rgba(12, 12, 24, .05);
  --hover: rgba(12, 12, 24, .04);
  --hover-2: rgba(12, 12, 24, .065);
  --glass: rgba(255, 255, 255, .8);
  --scrim: rgba(18, 18, 28, .34);
  --sh-1: 0 0 0 1px rgba(12, 12, 24, .07), 0 1px 2px rgba(12, 12, 24, .04);
  --sh-2: 0 0 0 1px rgba(12, 12, 24, .07), 0 14px 34px -16px rgba(12, 12, 24, .22);
  --sh-3: 0 0 0 1px rgba(12, 12, 24, .08), 0 30px 80px -26px rgba(12, 12, 24, .3);
  --glow: 0 10px 26px -14px rgba(12, 12, 24, .5);
  --glass-hi: rgba(255, 255, 255, .94);
  --grad-text: linear-gradient(135deg, #0b0b0d 0%, #2a2a31 55%, #52525b 100%);   /* ≥ 7:1 sur blanc sur toute la largeur */
  --accent-hi: #3f3f46;
  --grad-shade: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0));
  --ink-hi: #2a2a31;
  --ink-glow: rgba(12, 12, 24, .32);
  --track: rgba(12, 12, 24, .1);
  --track-bar: rgba(12, 12, 24, .07);
  --track-ring: rgba(12, 12, 24, .08);
  --skel: rgba(12, 12, 24, .05);
  --skel-hi: rgba(255, 255, 255, .65);
  --scrollbar: rgba(12, 12, 24, .22);
  --edge: rgba(12, 12, 24, .14);
  --seg-on: #ffffff;
  --seg-sh: 0 0 0 .5px rgba(12, 12, 24, .06), 0 1px 3px rgba(12, 12, 24, .12);
  --switch-off: #dcdce2;
  --thumb-sh: 0 1px 4px rgba(12, 12, 24, .28), 0 0 0 .5px rgba(12, 12, 24, .22);
  --grid-line: rgba(12, 12, 24, .045);
  --card-hi: 0 1px 2px rgba(12, 12, 24, .04), 0 30px 70px -34px rgba(12, 12, 24, .26);
  --sb-bg: #fbfbfc;
  --card-sh: 0 0 0 1px rgba(12, 12, 24, .075), 0 1px 2px rgba(12, 12, 24, .04);   /* cartes : liseré + ombre à peine posée */
  /* argent un peu plus profond pour se détacher du blanc ; encre sombre (≥ 8:1 sur le bas du dégradé) */
  --btn-metal: linear-gradient(180deg, #e9eaee 0%, #d2d4d9 46%, #b3b7be 100%);
  --btn-metal-hover: linear-gradient(180deg, #f0f1f3 0%, #dbdde1 46%, #bfc2c8 100%);
  --btn-metal-active: linear-gradient(180deg, #adb1b8 0%, #c5c8cd 55%, #d9dbdf 100%);
  --btn-metal-border: #8f949c;
  --btn-metal-ink: #111214;
  --btn-metal-emboss: 0 1px 0 rgba(255, 255, 255, .4);
  --btn-metal-hi: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 -1px 0 rgba(12, 12, 24, .08);
  --btn-metal-sh: 0 1px 2px rgba(12, 12, 24, .16), 0 6px 16px -8px rgba(12, 12, 24, .34);
  --btn-metal-sh-hover: 0 1px 2px rgba(12, 12, 24, .18), 0 10px 22px -10px rgba(12, 12, 24, .42);
  --btn-metal-press: inset 0 1px 3px rgba(12, 12, 24, .26);
  --btn-metal-off: #e6e7ea;
  --btn-metal-off-border: #d3d5d9;
  --btn-metal-off-ink: #7a7d85;
  --metal-fill: linear-gradient(90deg, #34363c, #8b8f97);   /* (clair : graphite → argent, lisible sur le rail) */
  color-scheme: light;
}
/* changement de thème : pas de transitions pendant la bascule (tout change d'un coup, sans traînées) */
html.cx-theming, html.cx-theming *, html.cx-theming *::before, html.cx-theming *::after { transition: none !important; }
html.sb-min { --sb-cur: var(--sb-min); }
html:not(.sb-min) { --sb-cur: var(--sb-w); }

/* ── base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); scrollbar-color: var(--scrollbar) transparent; }
* { scrollbar-width: thin; }
body { min-height: 100vh; background: var(--bg); color: var(--text); font: 400 14.5px/1.5 var(--sans);
       letter-spacing: -.006em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
       font-feature-settings: "cv11", "ss01", "ss03"; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--text); text-decoration: none; }
svg { display: block; flex: none; }
img { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent-ring); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ── typographie ──────────────────────────────────────────────────────── */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 11px/1 var(--sans); letter-spacing: .12em;
           text-transform: uppercase; color: var(--text-3); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 8px var(--accent-ring); }
.display { margin: 0; font: 680 clamp(30px, 3.6vw, 40px)/1.08 var(--display); letter-spacing: -.034em; color: var(--text); overflow-wrap: break-word; }
.display em { font-style: normal; color: var(--accent-strong); background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
              -webkit-text-fill-color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.h2 { margin: 0; font: 600 19px/1.25 var(--display); letter-spacing: -.022em; color: var(--text); }
.h3 { margin: 0; font: 600 15px/1.3 var(--sans); letter-spacing: -.014em; color: var(--text); }
.lead { margin: 0; color: var(--text-2); font-size: 15.5px; line-height: 1.55; }
.small { font-size: 13px; } .tiny { font-size: 12px; }

/* ── page ─────────────────────────────────────────────────────────────── */
.app-main { margin-left: var(--sb-cur); min-width: 0; min-height: 100vh; transition: margin-left .28s var(--ease); }
html.sb-noanim .app-main, html.sb-noanim .sb, html.sb-noanim .sb * { transition: none !important; }
.page { max-width: 1240px; margin: 0 auto; padding: 44px 40px 96px; }
.page.narrow { max-width: 880px; }
.page.wide { max-width: 1480px; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.ph .t { min-width: 0; }
.ph .eyebrow { margin-bottom: 12px; }
.ph .lead { margin-top: 10px; }
.ph .acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.crumbs a { color: var(--text-2); transition: color .15s; } .crumbs a:hover { color: var(--text); }
.enter { animation: enter .42s var(--ease) both; }
.enter-2 { animation: enter .42s .05s var(--ease) both; }
.enter-3 { animation: enter .42s .1s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ── cartes & sections ────────────────────────────────────────────────── */
.card { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--card-sh); }
.card.pad { padding: 24px; }
.card.hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card.hover:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2), var(--sh-2); }
.group { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--card-sh); }
.group:focus-within { z-index: 5; }
.group + .group { margin-top: 18px; }
.group-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 20px 24px 0; }
.group-h .step { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center;
                 background: var(--surface-3); color: var(--text-2); font: 600 12px/1 var(--sans); box-shadow: inset 0 0 0 1px var(--line); }
.group-h .step.done { background: var(--accent-deep); color: var(--on-accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.group-b { padding: 18px 24px 24px; }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .lbl { font-weight: 500; }
.row .sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.sep { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ── boutons ──────────────────────────────────────────────────────────── */
.btn { --h: 38px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h);
       padding: 0 16px; border-radius: var(--radius-control); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
       font: 500 14px/1 var(--sans); letter-spacing: -.01em; white-space: nowrap; text-decoration: none;
       transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease),
                   box-shadow var(--dur) var(--ease), transform .12s var(--ease), opacity var(--dur), filter var(--dur); user-select: none; }
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.sm { --h: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { --h: 48px; padding: 0 24px; font-size: 15px; font-weight: 600; }
.btn.xl { --h: 56px; padding: 0 30px; font-size: 16px; font-weight: 600; }
.btn.block { width: 100%; }
/* boutons principaux (.primary et .accent) : « gris brillant », argent brossé — jetons --btn-metal-* (ds.css, par thème) */
.btn.primary, .btn.accent, .metal, .viewbar button { background: var(--btn-metal) padding-box; border-color: var(--btn-metal-border); color: var(--btn-metal-ink);
              font-weight: 600; text-shadow: var(--btn-metal-emboss); box-shadow: var(--btn-metal-hi), var(--btn-metal-sh); }
.btn.primary:hover:not(:disabled), .btn.accent:hover:not(:disabled), .metal:hover:not(:disabled), .viewbar button:hover {
              background: var(--btn-metal-hover) padding-box; border-color: var(--btn-metal-border); box-shadow: var(--btn-metal-hi), var(--btn-metal-sh-hover); }
.btn.primary:active:not(:disabled), .btn.accent:active:not(:disabled), .metal:active:not(:disabled), .viewbar button:active {
              background: var(--btn-metal-active) padding-box; box-shadow: var(--btn-metal-press); }
.btn.primary:disabled, .btn.accent:disabled, .metal:disabled { opacity: 1; background: var(--btn-metal-off); border-color: var(--btn-metal-off-border);
              color: var(--btn-metal-off-ink); text-shadow: none; box-shadow: none; filter: none; }
.btn.primary:focus-visible, .btn.accent:focus-visible, .metal:focus-visible, .viewbar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.solid-danger { background: #dc2626; border-color: #dc2626; color: #fff; font-weight: 600; }
.btn.solid-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn .spin { margin-right: 2px; }
.btn.loading { color: transparent !important; text-shadow: none !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
                      border-color: rgba(255,255,255,.95) rgba(255,255,255,.95) rgba(255,255,255,.28) rgba(255,255,255,.28);
                      animation: spin .7s linear infinite; }
.btn.primary.loading::after, .btn.accent.loading::after { border-color: var(--btn-metal-ink) var(--btn-metal-ink) color-mix(in srgb, var(--btn-metal-ink) 22%, transparent) color-mix(in srgb, var(--btn-metal-ink) 22%, transparent); }
.btn:not(.primary):not(.accent):not(.solid-danger).loading::after { border-color: var(--text-2) var(--text-2) var(--line-2) var(--line-2); }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: var(--radius-control); border: 0; background: transparent;
            color: var(--text-2); transition: background var(--dur), color var(--dur); }
.icon-btn:hover { background: var(--hover-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn svg { width: 17px; height: 17px; }
.link { border: 0; background: none; padding: 0; color: var(--accent-strong); font-weight: 500; cursor: pointer; }
.link:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }

/* ── champs ───────────────────────────────────────────────────────────── */
.field { display: block; }
.field + .field { margin-top: 16px; }
.label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px;
         font: 500 13px/1.3 var(--sans); color: var(--text); }
.label .val { color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.hint { margin-top: 7px; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 0 14px; border-radius: var(--radius-control); border: 1px solid var(--line-2);
         background: var(--bg-2); color: var(--text); font-size: 14.5px; transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
         -webkit-appearance: none; appearance: none; }
.textarea { padding: 10px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.select { padding-right: 36px; cursor: pointer;
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23a1a1aa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
          background-repeat: no-repeat; background-position: right 14px center; }
.select option, .select optgroup { background: var(--surface-2); color: var(--text); }
.input.mono { font-family: var(--mono); font-size: 13.5px; }
.input::-webkit-calendar-picker-indicator { opacity: .65; cursor: pointer; transition: opacity .15s; }
.input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.input:-webkit-autofill, .input:-webkit-autofill:hover { -webkit-text-fill-color: var(--text); caret-color: var(--text);
         -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset; box-shadow: 0 0 0 1000px var(--bg-2) inset; }
.input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset, 0 0 0 3px var(--accent-ring);
         box-shadow: 0 0 0 1000px var(--bg-2) inset, 0 0 0 3px var(--accent-ring); }

/* combobox (saisie + liste déroulante)
   listes et menus : panneau sombre opaque, un cran au-dessus des cartes (le texte dessous ne doit
   jamais transparaître) ; info-bulles et toasts : verre sombre quasi opaque + flou */
.cb { position: relative; }
.cb-in { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px 0 14px; border-radius: var(--radius-control); border: 1px solid var(--line-2);
         background: var(--bg-2); cursor: text; transition: border-color var(--dur), box-shadow var(--dur); }
.cb-in:hover { border-color: var(--line-3); }
.cb.open .cb-in, .cb-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.cb-in input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.cb-in input::placeholder { color: var(--text-3); }
.cb-ico { width: 22px; flex: none; display: grid; place-items: center; font-size: 17px; color: var(--text-2); }
.cb-ico svg { width: 17px; height: 17px; }
.cb-chev { color: var(--text-3); transition: transform var(--dur) var(--ease); }
.cb.open .cb-chev { transform: rotate(180deg); }
.cb-clear { border: 0; background: var(--surface-3); color: var(--text-2); width: 22px; height: 22px; border-radius: var(--radius-inner); display: grid; place-items: center; }
.cb-clear:hover { background: linear-gradient(var(--hover), var(--hover)) var(--surface-3); color: var(--text); }
.cb-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 8px); max-height: 340px; overflow: auto; padding: 6px;
           background: var(--surface-2); border-radius: 10px; box-shadow: 0 0 0 1px var(--line-2), var(--sh-3);
           opacity: 0; transform: translateY(-4px) scale(.99);
           transform-origin: top; pointer-events: none; transition: opacity .16s var(--ease), transform .16s var(--ease); overscroll-behavior: contain; }
.cb.open .cb-list { opacity: 1; transform: none; pointer-events: auto; }
.cb-opt { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-control); cursor: pointer; }
.cb-opt .e { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); font-size: 16px; }
.cb-opt .t { flex: 1; min-width: 0; }
.cb-opt .t b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-opt .t span { display: block; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-opt .r { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cb-opt.act { background: var(--hover-2); }
.cb-opt.sel .t b { color: var(--accent-strong); }
.cb-opt.special .e { background: var(--accent-soft); }
.cb-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.cb-head { padding: 8px 10px 4px; font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.cb-empty { padding: 18px 12px; text-align: center; color: var(--text-2); font-size: 13.5px; }
mark { background: transparent; color: var(--accent-strong); font-weight: 600; }

/* contrôle segmenté */
.seg { position: relative; display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border-radius: var(--radius-control); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { position: relative; z-index: 1; height: 32px; padding: 0 14px; border: 0; border-radius: var(--radius-inner); background: transparent;
              color: var(--text-2); font: 500 13px/1 var(--sans); white-space: nowrap; transition: color var(--dur), background var(--dur); }
.seg button:hover { color: var(--text); }
.seg button.on { color: var(--text); background: var(--seg-on); box-shadow: inset 0 0 0 1px var(--line-2), var(--seg-sh); }
.seg.block { display: flex; } .seg.block button { flex: 1; }

/* curseur */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; --p: 0%; }
.range::-webkit-slider-runnable-track { height: 5px; border-radius: 99px;
          background: linear-gradient(to right, var(--accent) var(--p), var(--track) var(--p)); }
.range::-moz-range-track { height: 5px; border-radius: 99px; background: var(--track); }
.range::-moz-range-progress { height: 5px; border-radius: 99px; background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8.5px; border-radius: 50%; background: #fff;
                               box-shadow: var(--thumb-sh); transition: transform .12s var(--ease); }
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.55); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--accent-ring), 0 2px 6px rgba(0,0,0,.55); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px var(--accent-ring), 0 2px 6px rgba(0,0,0,.55); }
.ticks { display: flex; justify-content: space-between; margin-top: 2px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* interrupteur */
.switch { -webkit-appearance: none; appearance: none; position: relative; width: 44px; height: 26px; flex: none; margin: 0; border-radius: 99px;
          background: var(--switch-off); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; transition: background .2s var(--ease), box-shadow .2s var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
                 box-shadow: 0 2px 5px rgba(0,0,0,.45); transition: transform .24s var(--ease); }
.switch:checked { background: var(--accent); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 4px 14px -6px var(--accent-ring); }
.switch:checked::after { transform: translateX(18px); background: var(--on-accent); }
.switch:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 3px var(--accent-ring); }
.switch:checked:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.check { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; flex: none; margin: 0; border-radius: 6px; border: 1.5px solid var(--text-3);
         background: var(--bg-2); display: inline-grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s; }
.check:hover { border-color: var(--text-2); }
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after { content: ""; width: 10px; height: 5px; margin-top: -2px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: rotate(-45deg); }
.check:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.stepper { display: inline-flex; align-items: center; border-radius: var(--radius-control); background: var(--bg-2); padding: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.stepper button { width: 32px; height: 32px; border: 0; border-radius: var(--radius-inner); background: transparent; font-size: 17px; color: var(--text-2);
                  transition: background .15s, color .15s; }
.stepper button:hover:not(:disabled) { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.stepper button:disabled { cursor: not-allowed; opacity: .4; }
.stepper output { min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px var(--edge);
          transition: transform .12s var(--ease), box-shadow .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.swatch-in { position: relative; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; cursor: pointer;
             background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); box-shadow: inset 0 0 0 1px var(--edge); }
.swatch-in input { position: absolute; inset: -8px; width: 44px; height: 44px; opacity: 0; cursor: pointer; }

/* ── pastilles, badges, états ─────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-tag); background: var(--surface-3);
        color: var(--text-2); font: 500 12px/1 var(--sans); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); }
.pill svg { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 16%, transparent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 16%, transparent); }
.pill.bad { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 16%, transparent); }
.pill.accent { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.pill.info { background: var(--info-soft); color: var(--info); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 16%, transparent); }
.pill.ink { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live .d { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--surface-3);
       box-shadow: 0 0 0 1px var(--line-2), 0 1px 0 var(--line-3); font: 500 11px/1 var(--mono); color: var(--text-2); }

/* ── progression & chargement ─────────────────────────────────────────── */
.spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent);
        animation: spin .7s linear infinite; vertical-align: middle; }
.spin.lg { width: 28px; height: 28px; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { position: relative; height: 6px; border-radius: 99px; background: var(--track-bar); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: 0; overflow: hidden; border-radius: inherit; background: var(--metal-fill);
           transition: width .5s var(--ease); }
.bar > i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
                  transform: translateX(-100%); animation: sheen 1.6s var(--ease) infinite; }
.bar.idle > i::after, .bar.done > i::after { display: none; }
.bar.done > i { background: var(--ok); }
.bar.indet > i { width: 36% !important; animation: indet 1.2s var(--ease) infinite; }
@keyframes sheen { to { transform: translateX(200%); } }
@keyframes indet { 0% { left: -36%; } 100% { left: 100%; } }
.ring { --p: 0; --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: grid; place-items: center;
        background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--track-ring) 0); transition: --p .5s var(--ease); }
.ring::before { content: ""; grid-area: 1 / 1; width: calc(var(--size) - 8px); height: calc(var(--size) - 8px); border-radius: 50%; background: var(--surface); }
.ring > span { grid-area: 1 / 1; position: relative; font: 600 11px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--text); }
@property --p { syntax: "<number> | <percentage>"; inherits: true; initial-value: 0; }   /* anneaux (nombre, animé) et curseurs (pourcentage, lu par la piste) */
.skel { position: relative; overflow: hidden; background: var(--skel); border-radius: var(--r); }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--skel-hi), transparent);
               transform: translateX(-100%); animation: sheen 1.3s ease-in-out infinite; }
.skel.line { height: 12px; border-radius: 6px; }
.dots::after { content: "…"; display: inline-block; animation: dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; width: 0; }
@keyframes dots { to { width: 1.1em; } }

/* ── vides & zones de dépôt ───────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 72px 24px; }
.empty .ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2);
              box-shadow: inset 0 0 0 1px var(--line-2), var(--glow); color: var(--accent-strong); margin-bottom: 6px; }
.empty .ico svg { width: 28px; height: 28px; }
.empty .h2 { font-size: 20px; }
.empty p { margin: 0 0 8px; max-width: 420px; color: var(--text-2); }
.drop { position: relative; display: flex; align-items: center; gap: 20px; padding: 26px 28px; border-radius: var(--r-xl); cursor: pointer;
        background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--dur), transform var(--dur) var(--ease), background var(--dur); }
.drop::before { content: ""; position: absolute; inset: 8px; border-radius: 18px; border: 1.5px dashed var(--line-3); pointer-events: none;
                transition: border-color var(--dur); }
.drop:hover { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-2), var(--sh-2); }
.drop:hover::before { border-color: var(--accent-ring); }
.drop .ico { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong);
             box-shadow: inset 0 0 0 1px var(--accent-soft); transition: transform .3s var(--ease); }
.drop .ico svg { width: 24px; height: 24px; }
.drop:hover .ico { transform: translateY(-2px); }
.drop .t b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.015em; color: var(--text); }
.drop .t span { color: var(--text-2); font-size: 13.5px; }
body.dragging .drop { background: var(--accent-soft); transform: scale(1.005); }
body.dragging .drop::before { border-color: var(--accent); border-style: solid; }
.dropveil { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--scrim);
            -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
body.dragging .dropveil { opacity: 1; }
.dropveil .card { padding: 34px 40px; text-align: center; box-shadow: 0 0 0 1px var(--line-2), var(--sh-3); animation: pop .3s var(--ease) both; }
.dropveil .ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--grad); color: var(--on-accent);
                 box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .25); }
.dropveil .ico svg { width: 28px; height: 28px; }

/* ── tuiles médias ────────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 0; padding: 0; cursor: pointer;
        box-shadow: 0 0 0 1px var(--line); transition: transform .28s var(--ease), box-shadow .28s var(--ease); }
.tile.sq { aspect-ratio: 1; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-2), var(--sh-2); }
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s var(--ease), transform .5s var(--ease); }
.tile img.ld { opacity: 1; }
.tile:hover img { transform: scale(1.04); }
.tile .tag { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
             border-radius: var(--radius-tag); background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
             color: #fff; font: 600 11px/1 var(--sans); font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.tile .tag svg { width: 9px; height: 9px; }
/* grid-template-columns/gap : neutralise la règle de page .run (app.css) que porte aussi le badge « cc run » */
.tile .cc { position: absolute; right: 8px; bottom: 8px; height: 22px; padding: 0 7px; border-radius: var(--radius-tag); display: inline-grid; place-items: center;
            grid-template-columns: none; gap: 0;
            font: 700 10px/1 var(--sans); letter-spacing: .04em; color: #fff; background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.tile .cc.ok { background: rgba(4, 120, 87, .92); } .tile .cc.run { background: var(--accent-deep); }
.tile .new { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
             box-shadow: 0 0 0 2px var(--bg), 0 0 10px var(--accent-ring); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* vidéo : bouton lecture discret au centre, au survol (jamais au toucher ni en sélection) */
.tile .t-play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; display: grid; place-items: center;
                background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; pointer-events: none;
                box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); opacity: 0; transform: scale(.9); transition: opacity .18s var(--ease), transform .18s var(--ease); }
.tile .t-play svg { width: 16px; height: 16px; margin-left: 2px; }
@media (hover: hover) { .tile:hover .t-play { opacity: 1; transform: none; } }
html.fx-sel .tile .t-play, .fx-on .t-play { display: none; }

/* ── dialogues, notifications, menus ──────────────────────────────────── */
dialog.dlg { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text);
             box-shadow: 0 0 0 1px var(--line-2), var(--sh-3); }
dialog.dlg[open] { animation: pop .26s var(--ease) both; }
dialog.dlg::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s both; }
dialog.dlg.wide { width: min(720px, calc(100vw - 32px)); }
.dlg .in { padding: 28px; }
.dlg .h2 { margin-bottom: 8px; }
.dlg .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.dlg .x { position: absolute; top: 14px; right: 14px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 200; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(520px, calc(100vw - 32px));
         padding: 12px 18px; border-radius: var(--r); background: var(--glass-hi); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
         color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--line-2), var(--sh-2);
         transform: translate(-50%, 16px); opacity: 0; transition: .32s var(--ease); pointer-events: none; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast .i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: var(--on-ink); flex: none; }
.toast .i.bad { background: var(--bad); }
.toast .i svg { width: 12px; height: 12px; }
/* par-dessus une fenêtre modale ouverte (visionneuse, confirmation…), la notification passe en popover (shell.js,
   couche supérieure) : sans les réglages par défaut du navigateur (centrée, bordure, marges) */
.toast[popover] { inset: auto auto 28px 50%; margin: 0; border: 0; overflow: visible; }
.menu { position: fixed; z-index: 150; min-width: 200px; padding: 6px; border-radius: 10px; background: var(--surface-2);
        box-shadow: 0 0 0 1px var(--line-2), var(--sh-3);
        animation: pop .16s var(--ease) both; transform-origin: top left; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-control); background: transparent;
               text-align: left; font-size: 14px; color: var(--text); }
.menu button:hover, .menu button:focus-visible { background: var(--hover-2); outline: none; }
.menu button svg { width: 16px; height: 16px; color: var(--text-2); }
.menu button.danger { color: var(--bad); } .menu button.danger svg { color: var(--bad); }
.menu button.danger:hover, .menu button.danger:focus-visible { background: var(--bad-soft); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 5px 6px; }

/* ── tableau ──────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 12px 14px; text-align: left; font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
            border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; transition: background .15s; }
.table tr.click:hover td { background: var(--hover); }

/* ── barre latérale ───────────────────────────────────────────────────── */
.sb { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: var(--sb-cur); display: flex; flex-direction: column;
      background: var(--sb-bg); border-right: 1px solid var(--line); transition: width .28s var(--ease), transform .3s var(--ease); overflow: hidden; }
.sb-head { display: flex; align-items: center; gap: 10px; height: 68px; padding: 0 14px 0 20px; flex: none; }
.sb-brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; color: var(--text); }
/* logo « Objectif » : diaphragme d'objectif (bague, 4 lamelles, pupille) en SVG currentColor — clair la nuit, sombre en clair */
.logo { width: 32px; height: 32px; flex: none; display: grid; place-items: center; color: var(--text); }
.logo svg { width: 30px; height: 30px; }
.wordmark { font: 600 16px/1 var(--display); letter-spacing: -.022em; color: var(--text); white-space: nowrap; transition: opacity .18s; }
.sb-toggle { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text-3);
             transition: background .15s, color .15s, opacity .15s; }
.sb-toggle:hover { background: var(--hover-2); color: var(--text); }
.sb-toggle svg { width: 17px; height: 17px; transition: transform .28s var(--ease); }
html.sb-min .sb-toggle svg { transform: rotate(180deg); }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 18px; scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; }
.sb-sec { margin-top: 20px; }
.sb-sec:first-child { margin-top: 6px; }
.sb-sec-h { display: flex; align-items: center; height: 26px; padding: 0 8px 0 12px; }
.sb-sec-t { flex: 1; font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; transition: opacity .18s; }
.sb-add { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text-3); transition: opacity .18s, background .15s, color .15s; }
.sb-add:hover { background: var(--hover-2); color: var(--text); }
.sb-add svg { width: 15px; height: 15px; }
.sb-link { position: relative; display: flex; align-items: center; gap: 12px; height: 38px; margin-top: 2px; padding: 0 10px 0 12px; border-radius: var(--radius-control);
           color: var(--text-2); font: 500 14px/1 var(--sans); white-space: nowrap; transition: background .16s, color .16s, box-shadow .16s; outline: none; }
.sb-link svg { width: 18px; height: 18px; flex: none; }
.sb-link:hover { background: var(--hover); color: var(--text); }
.sb-link:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.sb-link.on, .sb-grp.has-on:not(.open) > .sb-gh { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.sb-link.on::before, .sb-grp.has-on:not(.open) > .sb-gh::before { content: ""; position: absolute; left: -12px; top: 50%; width: 3px; height: 18px; margin-top: -9px; border-radius: 0 3px 3px 0;
                      background: var(--accent); box-shadow: 0 0 10px var(--accent-ring); }
.sb-link.on:focus-visible, .sb-grp.has-on > .sb-gh:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.sb-link.on svg, .sb-grp.has-on > .sb-gh > svg { color: var(--accent-strong); }
.sb-link.sub { height: 34px; padding-left: 16px; font-size: 13.5px; }
.sb-link.sub .fdot { width: 18px; display: grid; place-items: center; }
.sb-link.sub .fdot i { width: 7px; height: 7px; border-radius: 2px; background: var(--text-3); transition: background .16s, box-shadow .16s; }
.sb-link.sub:hover .fdot i { background: var(--text-2); }
.sb-link.sub.on .fdot i { background: var(--accent); box-shadow: 0 0 8px var(--accent-ring); }
.sb-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity .18s; }
.sb-badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--radius-tag); display: inline-grid; place-items: center; background: var(--hover-2);
            color: var(--text-2); font: 600 11px/1 var(--sans); font-variant-numeric: tabular-nums; transition: opacity .18s; }
.sb-badge:empty { display: none; }
.sb-badge.hot { background: var(--accent-deep); color: var(--on-accent); box-shadow: 0 0 12px -2px var(--accent-ring); }
.sb-badge.ok { background: var(--ok-soft); color: var(--ok); }
.sb-badge.bad { background: var(--bad-soft); color: var(--bad); }
.sb-more { width: 26px; height: 26px; margin-right: -4px; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent;
           color: var(--text-3); opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.sb-link:hover .sb-more, .sb-more:focus-visible, .sb-link.on .sb-more { opacity: 1; }
.sb-more:hover { background: var(--hover-2); color: var(--text); }
.sb-more svg { width: 15px; height: 15px; }
.sb-edit { width: 100%; height: 34px; margin-top: 2px; padding: 0 12px; border-radius: var(--radius-control); border: 1px solid var(--accent); background: var(--bg-2); color: var(--text);
           box-shadow: 0 0 0 3px var(--accent-ring); font: 500 13.5px var(--sans); outline: none; }
.sb-empty { padding: 6px 12px 2px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
/* arbre des dossiers (shell.js, toutes les pages à barre latérale) : flèche des sous-dossiers, niveaux en retrait */
.sb-link.sub .fdot .sb-tw { width: 20px; height: 20px; margin: 0; padding: 0; border: 0; border-radius: var(--radius-inner); display: grid; place-items: center;
                            background: transparent; color: var(--text-3); cursor: pointer; transition: transform .18s var(--ease), background .15s, color .15s; }
.sb-tw svg { width: 13px; height: 13px; }
.sb-tw:hover { background: var(--hover-2); color: var(--text); }
.sb-tw.open { transform: rotate(90deg); }
#sbFolders.closed { display: none; }
html.fx-dragging #sbFolders.closed { display: block; }                 /* glisser-déposer : dossiers visibles comme cibles */
.sb-link .sb-fold { width: 18px; height: 18px; flex: none; display: grid; place-items: center; margin-left: 2px; color: var(--text-3);
                    transition: transform .16s var(--ease, ease), color .16s; }
.sb-link .sb-fold svg { width: 13px; height: 13px; }
.sb-link .sb-fold.open { transform: rotate(90deg); }
.sb-link:hover .sb-fold { color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { .sb-link .sb-fold { transition: none; } }
.sb-link.sub.on .sb-tw { color: var(--accent-strong); }
.sb-link.sub.deep { padding-left: calc(16px + var(--d, 1) * 14px); height: 32px; font-size: 13px; }
.sb-edit { margin-left: calc(var(--d, 0) * 14px); width: calc(100% - var(--d, 0) * 14px); }
@media (min-width: 901px) { html.sb-min .sb-link.sub.deep { display: none; } }
/* groupes déroulants (Studio, Administration : shell.js) : en-tête bouton (flèche), pages en retrait le long d'un filet,
   hauteur animée ; fermé : pastille résumée et en-tête actif si la page en cours en fait partie */
.sb-gh { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.sb-grp.open > .sb-gh .sb-fold { transform: rotate(90deg); }
.sb-grp.open > .sb-gh .sb-badge { display: none; }
.sb-grp.has-on > .sb-gh { color: var(--text); }
.sb-gb { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .26s var(--ease), visibility 0s .26s; }
.sb-grp.open > .sb-gb { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .26s var(--ease), visibility 0s; }
.sb-gi { position: relative; min-height: 0; overflow: hidden; margin-left: -12px; padding-left: 12px; }     /* (marge : trait de la page active visible) */
.sb-gi::before { content: ""; position: absolute; left: 32.5px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.sb-link.kid { height: 34px; gap: 6px; padding-left: 32px; padding-right: 8px; font-size: 13.5px; }
.sb-link.kid .sb-badge { min-width: 20px; padding: 0 5px; letter-spacing: -.02em; }   /* « Traitement complet » + pastille jusqu'à « 99/99 » sans coupure */
.sb-link.kid svg { width: 16px; height: 16px; }
@media (min-width: 901px) {
  html.sb-min .sb-gb { display: none; }                                  /* barre réduite : pages du groupe dans un menu (clic sur l'icône) */
  html.sb-min .sb-grp.has-on > .sb-gh { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); }
  html.sb-min .sb-grp.has-on > .sb-gh::before { content: ""; position: absolute; left: -12px; top: 50%; width: 3px; height: 18px; margin-top: -9px;
                                                border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 10px var(--accent-ring); }
}
.menu.side { transform-origin: left top; }
.menu button.on { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); }
.menu button.on svg { color: var(--accent-strong); }
.menu button > span:not(.sb-badge) { flex: 1; }
.menu.side button .sb-badge { margin-left: 8px; opacity: 1; }          /* (barre réduite : pastilles de la barre masquées, pas celles du menu) */
.sb-foot { flex: none; padding: 12px; }
.sb-status { display: flex; align-items: center; gap: 10px; padding: 0 12px 8px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.sb-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; margin: 0 5.5px; box-shadow: 0 0 0 3px var(--ok-soft), 0 0 8px color-mix(in srgb, var(--ok) 60%, transparent); }
.sb-status.bad i { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft), 0 0 8px color-mix(in srgb, var(--bad) 60%, transparent); }
.sb-status span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-status:empty { display: none; }
.sb-me { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.sb-av { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--grad);
         color: var(--on-accent); font: 650 13px/1 var(--display); text-transform: uppercase; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.sb-who { flex: 1; min-width: 0; line-height: 1.25; transition: opacity .18s; }
.sb-who b { display: block; font-weight: 600; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-who span { display: block; font: 500 11px/1.4 var(--mono); color: var(--text-3); white-space: nowrap; }
.sb-out { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text-3);
          transition: background .15s, color .15s; }
.sb-out:hover { background: var(--bad-soft); color: var(--bad); }
.sb-out svg { width: 16px; height: 16px; }
html.sb-min .wordmark, html.sb-min .sb-lbl, html.sb-min .sb-sec-t, html.sb-min .sb-who, html.sb-min .sb-badge,
html.sb-min .sb-add, html.sb-min .sb-more, html.sb-min .sb-status span, html.sb-min .sb-empty, html.sb-min .sb-fold { opacity: 0; pointer-events: none; }
html.sb-min .sb-head { padding: 0 0 0 20px; }
html.sb-min .sb-brand { flex: 0 0 32px; }
html.sb-min .sb-toggle { position: absolute; left: 21px; top: 19px; opacity: 0; background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
html.sb-min .sb-head:hover .sb-toggle, html.sb-min .sb-toggle:focus-visible { opacity: 1; }
html.sb-min .sb-link { padding: 0 15px; }
html.sb-min .sb-link.sub { padding-left: 15px; }
html.sb-min .sb-me { padding: 8px; background: transparent; box-shadow: none; }
html.sb-min .sb-out { display: none; }
.sb-tip { position: fixed; z-index: 300; padding: 7px 11px; border-radius: var(--radius-control); background: var(--glass-hi); color: var(--text); font: 500 12.5px/1.2 var(--sans);
          -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
          pointer-events: none; white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s;
          box-shadow: 0 0 0 1px var(--line-2), var(--sh-2); }
.sb-tip.on { opacity: 1; transform: none; }
.viewbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 16px;
           background: linear-gradient(90deg, var(--accent-soft), var(--info-soft)) var(--bg); border-bottom: 1px solid var(--accent-ring); color: var(--text); font-size: 13.5px; }
.viewbar b { font-weight: 600; color: var(--text); }
.viewbar button { flex: none; white-space: nowrap; height: 30px; padding: 0 14px; border: 1px solid var(--btn-metal-border); border-radius: var(--radius-control); font-weight: 600; font-size: 13px;
                  transition: background .15s, box-shadow .15s; }   /* (argent : règles des boutons principaux, plus haut) */
.mtop { display: none; }
.sb-scrim { display: none; }

/* ── mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-main { margin-left: 0; }
  .page { padding: 24px 18px 80px; }
  .ph { margin-bottom: 22px; }
  .sb { width: min(86vw, 320px); transform: translateX(-104%); background: var(--sb-bg); }
  html.sb-open .sb { transform: none; border-right-color: var(--line-2); box-shadow: 24px 0 60px -20px var(--scrim); }
  html.sb-min .wordmark, html.sb-min .sb-lbl, html.sb-min .sb-sec-t, html.sb-min .sb-who, html.sb-min .sb-badge,
  html.sb-min .sb-add, html.sb-min .sb-status span, html.sb-min .sb-empty, html.sb-min .sb-fold { opacity: 1; pointer-events: auto; }
  html.sb-min .sb-more { pointer-events: auto; }
  html.sb-min .sb-head { padding: 0 14px 0 20px; } html.sb-min .sb-brand { flex: 1; }
  html.sb-min .sb-toggle { position: static; opacity: 1; background: transparent; color: var(--text-3); box-shadow: none; }
  html.sb-min .sb-link { padding: 0 10px 0 12px; } html.sb-min .sb-link.sub { padding-left: 16px; }
  html.sb-min .sb-me { padding: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); } html.sb-min .sb-out { display: grid; }
  .sb-toggle svg { transform: rotate(0) !important; }
  .sb-more { opacity: 1; }
  .sb-link { height: 44px; font-size: 15px; } .sb-link.sub { height: 40px; }
  .sb-link.kid, html.sb-min .sb-link.kid { height: 40px; padding-left: 36px; }
  .sb-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: var(--scrim); -webkit-backdrop-filter: blur(3px);
              backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  html.sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  html.sb-open, html.sb-open body { overflow: hidden; }
  .mtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 10px 0 8px;
          background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
          border-bottom: 1px solid var(--line); }
  .mtop > button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text); }
  .mtop > button:active { background: var(--hover-2); }
  .mtop > button svg { width: 22px; height: 22px; }
  .mtop-t { flex: 1; min-width: 0; font: 600 16px/1 var(--display); letter-spacing: -.02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .viewbar { top: 58px; }
  .toast, .toast[popover] { bottom: calc(20px + env(safe-area-inset-bottom)); }
  /* sous-dossiers en retrait (tiroir mobile ; barre réduite sur ordinateur comprise) */
  .sb-link.sub.deep, html.sb-min .sb-link.sub.deep { height: 38px; padding-left: calc(16px + var(--d, 1) * 16px); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .drop { padding: 20px; gap: 16px; }
  .group-h { padding: 18px 18px 0; } .group-b { padding: 16px 18px 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* grilles de champs alignées ; pas de zoom automatique iOS sur les champs */
.grid2 > .field + .field, .grid2 > .field { margin-top: 0; }
@media (max-width: 900px) {
  .input, .input.mono, .select, .textarea, .cb-in input, .sb-edit, .title-edit, .mp-filter, .pk-q input { font-size: 16px; }
}

/* ── préférences : langue (FR | EN) et thème (clair | nuit) ──────────────
   balisage de i18n.js : <div class="cx-prefs [compact]"><button class="cx-seg" data-pref="lang"><span data-v="fr" class="on">FR</span><span data-v="en">EN</span></button>
   <button class="cx-seg" data-pref="theme"><span data-v="light">(soleil)</span><span data-v="dark" class="on">(lune)</span></button></div>
   pied de la barre latérale (.sb-prefs ; réduite : l'état actif seul, empilé), barre du haut mobile (.compact), coin des pages autonomes (.cx-corner) */
.cx-prefs { display: flex; align-items: center; gap: 6px; }
.cx-seg { display: inline-flex; align-items: center; gap: 1px; margin: 0; padding: 2px; border: 0; border-radius: var(--radius-control); background: var(--bg-2);
          box-shadow: inset 0 0 0 1px var(--line); color: var(--text-3); font: 600 11px/1 var(--sans); letter-spacing: .04em; cursor: pointer;
          -webkit-tap-highlight-color: transparent; transition: box-shadow .2s, color .2s; }
.cx-seg > span { display: grid; place-items: center; min-width: 28px; height: 26px; padding: 0 6px; border-radius: var(--radius-inner); transition: background .2s, color .2s, box-shadow .2s; }
.cx-seg > span.on { background: var(--seg-on); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2), var(--seg-sh); }
.cx-seg svg { width: 14px; height: 14px; }
.cx-seg:hover { color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.cx-seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sb-prefs { display: flex; padding: 0 2px 10px; }
.mtop .cx-prefs { flex: none; gap: 6px; }
.cx-corner { position: fixed; z-index: 50; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }
/* version réduite (barre mobile, barre latérale repliée, petit écran) : l'état actif seul, un bouton par réglage */
.cx-prefs.compact .cx-seg { padding: 0; background: transparent; box-shadow: none; }
.cx-prefs.compact .cx-seg > span:not(.on) { display: none; }
.cx-prefs.compact .cx-seg > span.on { min-width: 36px; height: 34px; padding: 0 8px; border-radius: var(--radius-control); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; }
.cx-prefs.compact .cx-seg:hover > span.on { background: var(--surface-3); color: var(--text); }
.cx-prefs.compact svg { width: 16px; height: 16px; }
@media (min-width: 901px) {
  html.sb-min .sb-prefs { justify-content: center; padding: 0 0 10px; }
  html.sb-min .sb-prefs .cx-prefs { flex-direction: column; gap: 6px; }
  html.sb-min .sb-prefs .cx-seg { padding: 0; background: transparent; box-shadow: none; }
  html.sb-min .sb-prefs .cx-seg > span:not(.on) { display: none; }
  html.sb-min .sb-prefs .cx-seg > span.on { min-width: 40px; height: 32px; border-radius: var(--radius-control); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
}
@media (max-width: 520px) {
  .cx-corner { top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); }
  .cx-corner .cx-seg { padding: 0; background: transparent; box-shadow: none; }
  .cx-corner .cx-seg > span:not(.on) { display: none; }
  .cx-corner .cx-seg > span.on { min-width: 36px; height: 34px; border-radius: var(--radius-control); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
}

/* ── thème clair : compléments des composants partagés ────────────────── */
html[data-theme="light"] .btn.danger:hover { border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
html[data-theme="light"] .switch::after { box-shadow: 0 1px 3px rgba(12, 12, 24, .3), 0 0 0 .5px rgba(12, 12, 24, .12); }
html[data-theme="light"] .switch:checked { box-shadow: inset 0 0 0 1px rgba(12, 12, 24, .06), 0 4px 12px -6px var(--accent-ring); }
html[data-theme="light"] .range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--accent-ring), var(--thumb-sh); }
html[data-theme="light"] .range::-moz-range-thumb { box-shadow: var(--thumb-sh); }
html[data-theme="light"] .range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px var(--accent-ring), var(--thumb-sh); }
html[data-theme="light"] .kbd { box-shadow: 0 0 0 1px var(--line-2), 0 1px 0 var(--line-3); background: var(--surface); }
html[data-theme="light"] .toast { box-shadow: 0 0 0 1px var(--line-2), 0 16px 40px -14px rgba(12, 12, 24, .28); }
html[data-theme="light"] .viewbar { background: linear-gradient(90deg, var(--accent-soft), var(--info-soft)) var(--surface); }

/* ── mouvement (08/10) : fondu enchaîné entre les pages, apparitions en cascade, survols ───────────────── */
#view { view-transition-name: page; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }   /* barre latérale immobile */
::view-transition-group(page) { animation-duration: .3s; animation-timing-function: var(--ease); }
::view-transition-old(page) { animation: vt-out .14s var(--ease-in) both; }
::view-transition-new(page) { animation: vt-in .34s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
/* cascade : seulement au premier affichage (.enter-2 / .enter-3, retirées des repeints par morph) */
.tiles.enter-2, .folders.enter-3, .subs.enter-2 { animation: none; }
.tiles.enter-2 > *, .folders.enter-3 > *, .subs.enter-2 > *, .hm-grid > * { animation: enter .44s var(--ease) both; }
.tiles.enter-2 > :nth-child(2), .folders.enter-3 > :nth-child(2), .subs.enter-2 > :nth-child(2), .hm-grid > :nth-child(2) { animation-delay: .03s; }
.tiles.enter-2 > :nth-child(3), .folders.enter-3 > :nth-child(3), .subs.enter-2 > :nth-child(3), .hm-grid > :nth-child(3) { animation-delay: .06s; }
.tiles.enter-2 > :nth-child(4), .folders.enter-3 > :nth-child(4), .subs.enter-2 > :nth-child(4), .hm-grid > :nth-child(4) { animation-delay: .09s; }
.tiles.enter-2 > :nth-child(5), .folders.enter-3 > :nth-child(5), .subs.enter-2 > :nth-child(5), .hm-grid > :nth-child(5) { animation-delay: .12s; }
.tiles.enter-2 > :nth-child(6), .folders.enter-3 > :nth-child(6), .subs.enter-2 > :nth-child(6), .hm-grid > :nth-child(6) { animation-delay: .15s; }
.tiles.enter-2 > :nth-child(7), .folders.enter-3 > :nth-child(7), .hm-grid > :nth-child(7) { animation-delay: .18s; }
.tiles.enter-2 > :nth-child(8), .folders.enter-3 > :nth-child(8) { animation-delay: .21s; }
.tiles.enter-2 > :nth-child(n+9), .folders.enter-3 > :nth-child(n+9) { animation-delay: .24s; }
/* survol : les cartes se soulèvent légèrement */
.fcard, .subcard, .hm-grid > * { transition: transform .28s var(--ease), box-shadow .28s var(--ease), background var(--dur) var(--ease); }
@media (hover: hover) {
  .fcard:hover, .subcard:hover, .hm-grid > :hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2), var(--sh-2, 0 8px 24px rgba(0,0,0,.18)); }
}
.fcard:active, .subcard:active { transform: translateY(0) scale(.99); }
/* pastilles et compteurs : changements d'état en douceur */
.pill, .sb-link, .seg > button, .ds-fr { transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
/* l'appareil demande moins d'animations : tout devient instantané */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
                           transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ── bouton Retour (08/10) : en haut du contenu, dans la marge du haut ; téléphone : dans la barre du haut ── */
.backbar { max-width: 1240px; margin: 0 auto; padding: 16px 40px 0; }
.backbar[data-w="wide"] { max-width: 1480px; }
.backbar[data-w="narrow"] { max-width: 880px; }
.app-main.has-back .page { padding-top: 12px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px 0 6px; margin-left: -8px; border: 0;
            border-radius: var(--radius-control); background: transparent; color: var(--text-2); font: inherit; font-size: 13.5px; cursor: pointer;
            transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform .12s var(--ease); }
.back-btn svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.back-btn:hover { background: var(--hover); color: var(--text); }
.back-btn:hover svg { transform: translateX(-2px); }
.back-btn:active { transform: scale(.97); }
.mt-back { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-left: -4px; border: 0; border-radius: var(--radius-control);
           background: transparent; color: var(--text); cursor: pointer; }
.mt-back svg { width: 20px; height: 20px; }
.mt-back:active { background: var(--hover-2); }
@media (max-width: 900px) {
  .backbar { display: none !important; }
  .app-main.has-back .page { padding-top: 24px; }
}

/* ── infobulles (09/10) : nom + description, après ~1 s de survol (shell.js) ── */
.cx-tip { position: fixed; z-index: 1000; max-width: 270px; padding: 9px 12px 10px; border-radius: 12px; background: var(--surface-3, #232328); color: var(--text);
          box-shadow: 0 0 0 1px var(--line-2), 0 18px 44px -14px rgba(0, 0, 0, .6); font: 400 12.5px/1.45 var(--sans); pointer-events: none;
          opacity: 0; transform: translateY(4px); transition: opacity .16s var(--ease), transform .16s var(--ease); }
.cx-tip.below { transform: translateY(-4px); }
.cx-tip.on { opacity: 1; transform: none; }
.cx-tip b { display: block; margin-bottom: 2px; font-weight: 600; font-size: 13px; letter-spacing: -.005em; }
.cx-tip span { display: block; color: var(--text-2); }

.cx-tip[popover] { inset: auto; margin: 0; border: 0; overflow: visible; }
