/* SparkleLab — design system « Séquence »
   Direction : un outil de travail sur une bibliothèque d'images. Sombre par défaut, barre latérale fixe, images denses, interface sobre.
   Polices : Work Sans pour tout le texte (fichier variable embarqué dans fonts/, licence OFL), Geist Mono pour les valeurs et le code.
   Un seul accent, « étincelle » (orange vif), réservé à ce qui est vivant : sélection, mouvement, lecture par Claude.
   Signature : la découpe du symbole du logo, à ses cotes exactes (web/split.js), jouée sur la landing et la page du DS :
   l'image arrive découpée en quatre panneaux, comme le symbole, puis les fentes se referment. Aucune icône décorative, aucune étoile.
   États en cours (analyse, agent au travail, chargement) : un orb en points, <sl-orb> (web/orb.js, moteur thinking-orbs).
   Fichier unique : fondations puis composants, utilisé tel quel par l'app, la page de connexion et la page du DS.
   Thème : suit le système ; data-theme="light|dark" sur un élément force un thème. */

/* ───────────── Fondations ───────────── */

/* Work Sans, un seul fichier variable : toutes les graisses de 100 à 900. On en utilise deux, 400 et 500,
   plus 600 pour le seul titre du hero de la landing. */
@font-face { font-family: "Work Sans"; src: url(fonts/WorkSans-Variable.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --font-display: "Work Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font: "Work Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Texte : l'approche se resserre seulement sur les grands titres. */
  --text-caption: 12px;  --track-caption: 0;
  --text-ui: 14px;
  --text-read: 16px;
  --text-lead: 20px;
  --text-title: 28px;    --track-title: -.025em;
  --text-page: clamp(40px, 4.6vw, 64px);  --track-page: -.035em;
  --text-hero: clamp(40px, 5vw, 72px);

  /* Espacements : base 4. */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --gutter: 32px;  /* marge de page */
  --side-w: 232px; /* barre latérale */

  /* Rayons : courts partout, pour un outil plutôt qu'une vitrine. Commandes (boutons, champs, filtres) en --radius-sm,
     leurs éléments intérieurs en --radius-xs. Intérieur = extérieur − marge. --radius-pill reste pour les pastilles posées sur les images. */
  --radius-xs: 6px;   /* étiquettes, éléments de menu et de barre latérale */
  --radius-sm: 8px;   /* boutons, champs, filtres, vignettes de liste */
  --radius-md: 12px;  /* images, menus */
  --radius-lg: 20px;  /* panneaux, palette de commande */
  --radius-xl: 24px;  /* grands visuels de la landing */
  --radius-pill: 999px;
  --control-h: 40px;
  --control-h-sm: 32px;

  /* Logo : hauteur du symbole. 28 px en barre (capitales à 16 px, comme les barres de Magnific et Higgsfield sur Mobbin),
     40 px en grand (connexion, pied de page). Zone de protection : la moitié de la hauteur, sur les quatre côtés. */
  --logo-h: 28px;
  --logo-h-lg: 40px;
  --bar-h: 72px;      /* 28 + 2 × 22 : le logo respire d'au moins sa zone de protection */

  /* Mouvement : des ressorts plutôt que des durées figées. --spring : amorti critique, aucun rebond.
     --spring-soft : un soupçon de dépassement, réservé à ce qui « arrive ». */
  --spring: linear(0, .042 1.4%, .156 3%, .52 8.2%, .736 12.3%, .874 16.6%, .953 21.4%, .985 26.4%, .997 32.6%, 1);
  --spring-soft: linear(0, .028 1.2%, .114 2.6%, .498 8.4%, .78 13.4%, .943 18.4%, 1.021 23%, 1.044 27.4%, 1.034 33%, 1.008 43.6%, .998 55%, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);     /* arrivée : part vite, se pose longuement */
  --ease-inout: cubic-bezier(.76, 0, .24, 1);  /* transformation sur place : lent, rapide, lent */
  --dur-press: 120ms;
  --dur: 280ms;
  --dur-arrive: 520ms;
  --dur-split: 720ms;
  --hold-split: 260ms;  /* temps pendant lequel la découpe reste lisible avant de se refermer */
}

/* Sombre : le thème de référence, celui où les images ressortent le mieux. Gris à peine chauds. */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0c;
  --surface: #181816;
  --raised: #232320;
  --hover: rgba(244, 243, 239, .06);
  --pressed: rgba(244, 243, 239, .11);
  --line: rgba(244, 243, 239, .1);
  --line-strong: rgba(244, 243, 239, .18);
  --text: #f4f3ef;
  --text-2: #b4b1a9;
  --text-3: #8f8c84;
  --accent: #ff6a2b;
  --accent-text: #ff8a55;
  --on-accent: #1a0d06;
  --accent-soft: rgba(255, 106, 43, .16);
  --danger: #ff6b81;
  --ok: #5fd08a;
  --primary: #f4f3ef;
  --on-primary: #0d0d0c;
  --scrim: rgba(13, 13, 12, .6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  /* Élément choisi posé sur une commande (pastille du segmenté, onglet actif) : un très léger volume. Le haut prend la
     lumière (dégradé et liseré clair), le bas s'assombrit, une ombre courte le pose sur son fond. */
  --raised-fill: linear-gradient(to bottom, #2b2b27, #21211e);
  --shadow-raised: inset 0 1px 0 rgba(244, 243, 239, .08), inset 0 0 0 1px rgba(244, 243, 239, .05), inset 0 -1px 0 rgba(0, 0, 0, .25), 0 1px 1px rgba(0, 0, 0, .3), 0 2px 4px -2px rgba(0, 0, 0, .25);
  --shadow-lift: 0 32px 64px -24px rgba(0, 0, 0, .7);
  --shadow-pop: 0 0 0 1px rgba(244, 243, 239, .1), 0 24px 56px -16px rgba(0, 0, 0, .7);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #fafaf8; --surface: #f0efeb; --raised: #ffffff;
    --hover: rgba(22, 22, 20, .05); --pressed: rgba(22, 22, 20, .09);
    --line: rgba(22, 22, 20, .1); --line-strong: rgba(22, 22, 20, .18);
    --text: #161614; --text-2: #5e5c56; --text-3: #6b6862;
    --accent: #e8521a; --accent-text: #b83c0c; --on-accent: #ffffff; --accent-soft: rgba(232, 82, 26, .12);
    --danger: #c2264a; --ok: #1f8a4c;
    --primary: #161614; --on-primary: #fafaf8;
    --scrim: rgba(250, 250, 248, .7);
    --shadow-1: 0 1px 2px rgba(22, 22, 20, .08);
    --raised-fill: linear-gradient(to bottom, #ffffff, #f8f8f5);
    --shadow-raised: inset 0 1px 0 #ffffff, 0 0 0 1px rgba(22, 22, 20, .07), 0 1px 1px rgba(22, 22, 20, .05), 0 2px 4px -2px rgba(22, 22, 20, .07);
    --shadow-lift: 0 32px 64px -32px rgba(22, 22, 20, .35);
    --shadow-pop: 0 0 0 1px rgba(22, 22, 20, .08), 0 24px 52px -16px rgba(22, 22, 20, .25);
  }
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #fafaf8; --surface: #f0efeb; --raised: #ffffff;
  --hover: rgba(22, 22, 20, .05); --pressed: rgba(22, 22, 20, .09);
  --line: rgba(22, 22, 20, .1); --line-strong: rgba(22, 22, 20, .18);
  --text: #161614; --text-2: #5e5c56; --text-3: #6b6862;
  --accent: #e8521a; --accent-text: #b83c0c; --on-accent: #ffffff; --accent-soft: rgba(232, 82, 26, .12);
  --danger: #c2264a; --ok: #1f8a4c;
  --primary: #161614; --on-primary: #fafaf8;
  --scrim: rgba(250, 250, 248, .7);
  --shadow-1: 0 1px 2px rgba(22, 22, 20, .08);
  --raised-fill: linear-gradient(to bottom, #ffffff, #f8f8f5);
  --shadow-raised: inset 0 1px 0 #ffffff, 0 0 0 1px rgba(22, 22, 20, .07), 0 1px 1px rgba(22, 22, 20, .05), 0 2px 4px -2px rgba(22, 22, 20, .07);
  --shadow-lift: 0 32px 64px -32px rgba(22, 22, 20, .35);
  --shadow-pop: 0 0 0 1px rgba(22, 22, 20, .08), 0 24px 52px -16px rgba(22, 22, 20, .25);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--text-ui)/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
[data-theme] { background: var(--bg); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Ce que le navigateur dessine lui-même suit aussi la palette : sélection, curseur de saisie, barres de défilement. */
::selection { background: var(--accent); color: var(--on-accent); }
html { caret-color: var(--accent); scrollbar-color: var(--line-strong) transparent; }
h1, h2, h3, p { margin: 0; }
.t-page { margin: 0; font: 500 var(--text-page)/1.04 var(--font-display); letter-spacing: var(--track-page); text-wrap: balance; }
.t-title { margin: 0; font: 500 var(--text-title)/1.15 var(--font-display); letter-spacing: var(--track-title); text-wrap: balance; }
.t-lead { font-size: var(--text-lead); line-height: 1.5; text-wrap: pretty; }
.t-read { font-size: var(--text-read); line-height: 1.6; text-wrap: pretty; }
.t-caption { font-size: var(--text-caption); color: var(--text-3); }
.t-2 { color: var(--text-2); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Icônes : jeu Lucide au trait, 16 px, trait 1,5, couleur du texte.
   Sprite <svg> en tête de page ; usage : <svg class="icon"><use href="#i-search"/></svg> */
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

sl-orb { flex: none; vertical-align: middle; }

/* Signature : la découpe du logo. Elle n'est pas dessinée en CSS : c'est un tracé de détourage (clip-path) calculé et
   animé par web/split.js, à partir des cotes relevées sur le symbole. Ici, seulement son rythme (--hold-split, --dur-split,
   --ease-inout) : la forme tient un instant, puis se referme d'un seul geste. */

/* Tout ce qu'on presse répond à l'appui (pointer-down), pas au relâchement. */
.pressable { transition: transform var(--dur) var(--spring), background-color var(--dur) var(--spring), color var(--dur) var(--spring), box-shadow var(--dur) var(--spring); }
.pressable:active { transform: scale(.96); transition-duration: var(--dur-press); }

/* ───────────── Commandes ───────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--control-h); padding: 0 var(--space-4);
  border: 0; border-radius: var(--radius-sm);
  background: var(--hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong);
  font: 500 var(--text-ui)/1 var(--font); white-space: nowrap; cursor: pointer; text-decoration: none;
}
/* Secondaire : un léger fond au repos en plus du filet. Vide, il paraissait plus petit que le bouton plein
   (le clair « déborde » sur le sombre, et l'œil lit le bord à l'intérieur d'un filet pâle). */
.btn:hover { background: var(--pressed); }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.btn--primary:hover { background: color-mix(in srgb, var(--primary), var(--bg) 12%); }
.btn--plain { background: transparent; box-shadow: none; color: var(--text-2); }
.btn--plain:hover { background: var(--hover); color: var(--text); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn--icon { width: var(--control-h); padding: 0; }
.btn--sm { height: var(--control-h-sm); padding: 0 var(--space-3); }
.btn--sm.btn--icon { width: var(--control-h-sm); padding: 0; }
.btn[disabled] { opacity: .4; pointer-events: none; }

.kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 var(--space-1);
  border-radius: 5px; background: var(--raised); color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font: 400 var(--text-caption)/1 var(--font-mono);
}
.keys { display: inline-flex; gap: 2px; } /* une touche par symbole : ⌘ puis K */

/* Bouton de filtre : la facette, le nombre de valeurs choisies, un chevron. Sert aussi de puce de sujet. */
.filter {
  display: inline-flex; align-items: center; gap: 6px; height: var(--control-h-sm); padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); font: 400 var(--text-ui)/1 var(--font); cursor: pointer; white-space: nowrap;
}
.filter:hover { background: var(--hover); color: var(--text); }
.filter.is-set { background: var(--primary); color: var(--on-primary); }
.filter--menu { box-shadow: inset 0 0 0 1px var(--line-strong); padding-right: var(--space-2); }
.filter--menu.is-set { background: var(--accent-soft); box-shadow: none; color: var(--accent-text); }
.filter__count { font-family: var(--font-mono); font-size: var(--text-caption); }
.filter .icon { width: 14px; height: 14px; }

/* Étiquette de valeur, lecture seule ou cliquable. */
.tag {
  display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding: 0 var(--space-2);
  border: 0; border-radius: var(--radius-xs); background: var(--hover); color: var(--text-2);
  font: var(--text-caption)/1 var(--font); white-space: nowrap; text-decoration: none;
}
.tag .icon { width: 12px; height: 12px; }
button.tag, a.tag { cursor: pointer; }
button.tag:hover, a.tag:hover { background: var(--pressed); color: var(--text); }

/* Contrôle segmenté : la pastille active glisse d'un choix à l'autre. */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: var(--radius-sm); background: var(--hover); }
.seg::before {
  content: ""; position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n, 2));
  border-radius: var(--radius-xs); background: var(--raised-fill); box-shadow: var(--shadow-raised);
  transform: translateX(calc(100% * var(--i, 0))); transition: transform var(--dur) var(--spring);
}
.seg button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 var(--space-3);
  border: 0; background: transparent; color: var(--text-2); font: 500 var(--text-ui)/1 var(--font); cursor: pointer;
  transition: color var(--dur) var(--spring);
}
.seg button[aria-pressed="true"] { color: var(--text); }

/* Champ de recherche. */
.field {
  display: flex; align-items: center; gap: var(--space-2); height: var(--control-h); padding: 0 var(--space-2) 0 var(--space-4);
  border: 0; border-radius: var(--radius-sm); background: var(--hover); color: var(--text-3); font: var(--text-ui) var(--font);
  transition: box-shadow var(--dur) var(--spring), background-color var(--dur) var(--spring);
}
.field:focus-within { background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: var(--text-ui) var(--font); }
.field input::placeholder { color: var(--text-3); }
button.field { cursor: text; }
button.field:hover { background: var(--pressed); }

.logo { display: block; height: var(--logo-h); aspect-ratio: 1844 / 335; background: url(brand/sparklelab-logo.png) center / contain no-repeat; }
.logo--lg { height: var(--logo-h-lg); }
.logo-mark { display: block; width: var(--logo-h); height: var(--logo-h); background: url(brand/sparklelab-mark.png) center / contain no-repeat; }
/* Le fichier du logo est blanc. Il est posé en image de fond, pas en masque : un masque ne s'affiche pas quand la page
   est ouverte comme un simple fichier. En thème clair, on l'inverse pour l'avoir en noir. */
[data-theme="light"] :is(.logo, .logo-mark) { filter: invert(1); }
[data-theme="light"] [data-theme="dark"] :is(.logo, .logo-mark), [data-theme="dark"] :is(.logo, .logo-mark) { filter: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) :is(.logo, .logo-mark) { filter: invert(1); } :root:not([data-theme="dark"]) [data-theme="dark"] :is(.logo, .logo-mark) { filter: none; } }

/* ───────────── Barre latérale ─────────────
   Ce qu'on consulte tout le temps reste à gauche, toujours visible : recherche, familles, sujets, puis ce qui concerne Claude.
   Chaque entrée porte son nombre de réfs : on voit l'état de la bibliothèque sans l'ouvrir. */

.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; scrollbar-width: none;
  padding: var(--space-5) var(--space-3) var(--space-3); border-right: 1px solid var(--line); background: var(--bg);
}
/* Quand la liste dépasse la hauteur de l'écran, la barre défile : ses éléments gardent leur hauteur au lieu d'être tassés. */
.side > * { flex-shrink: 0; }
.side__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-4); }
.side__home { padding: 0 var(--space-2); border: 0; background: none; border-radius: var(--radius-xs); cursor: pointer; }
.side__home .logo { height: 22px; }
.side__search { height: var(--control-h-sm); padding-left: var(--space-3); margin-bottom: var(--space-4); }
.side__search span:first-of-type { flex: 1; text-align: left; }
.side__nav { display: grid; gap: 2px; }
.side__label { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-2) var(--space-2); font-size: var(--text-caption); color: var(--text-3); }
.side__label-btn { display: grid; place-items: center; width: 20px; height: 20px; margin: -2px -4px -2px 0; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--text-3); cursor: pointer; }
.side__label-btn:hover { background: var(--hover); color: var(--text); }
.side__label-btn .icon { width: 14px; height: 14px; }
.nav-item__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side__pinned { position: sticky; bottom: calc(-1 * var(--space-3)); margin: auto calc(-1 * var(--space-3)) calc(-1 * var(--space-3)); padding: var(--space-3); padding-top: 0; background: var(--bg); }
.side__foot { padding-top: var(--space-3); border-top: 1px solid var(--line); }
/* Qui est connecté : photo, nom et formule. Mène à la page Compte. */
.me { display: flex; align-items: center; gap: var(--space-2); width: 100%; margin-top: var(--space-2); padding: var(--space-2); border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); text-align: left; cursor: pointer; transition: background-color var(--dur) var(--spring); }
.me:hover { background: var(--hover); }
.me.is-active { background: var(--pressed); }
.me__text { display: grid; gap: 2px; min-width: 0; }
.me__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 var(--text-ui)/1.2 var(--font); }
.me__plan { font-size: var(--text-caption); line-height: 1.2; color: var(--text-3); }
.bar__me .avatar { width: 28px; height: 28px; }
.side .nav-item { width: 100%; height: 32px; padding: 0 var(--space-2); border-radius: var(--radius-xs); font-weight: 400; }
.side .nav-item .icon { color: var(--text-3); transition: color var(--dur) var(--spring); }
.side .nav-item:hover .icon, .side .nav-item.is-active .icon { color: var(--text); }
.side .nav-item__count, .side .nav-item__badge { margin-left: auto; }
/* Un point à la place de l'icône : un sujet n'a pas de glyphe, mais s'aligne sur les familles. Il s'allume quand on filtre. */
.nav-item__dot { width: 16px; display: grid; place-items: center; }
.nav-item__dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background-color var(--dur) var(--spring); }
.nav-item.is-active .nav-item__dot::before { background: var(--accent); }

/* iPhone : barre du haut avec le logo et la recherche. Masquée sur ordinateur. */
.bar {
  position: sticky; top: 0; z-index: 5; display: none; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-4);
  height: var(--bar-h); padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.bar__home { display: block; padding: 0; border: 0; background: none; color: var(--text); border-radius: var(--radius-xs); cursor: pointer; justify-self: start; }
.nav-item {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-h); padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font: 500 var(--text-ui)/1 var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur) var(--spring), color var(--dur) var(--spring);
}
.nav-item:hover { color: var(--text); background: var(--hover); }
.nav-item.is-active { color: var(--text); background: var(--pressed); }
.nav-item__count { font: 400 var(--text-caption)/1 var(--font-mono); color: var(--text-3); }
.nav-item__badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: 500 var(--text-caption)/20px var(--font-mono); text-align: center; }

.topbar__chips { display: none; }
.tabbar { display: none; }

/* ───────────── Grille de réfs ───────────── */

.group { margin-bottom: var(--space-12); }
.group__head { display: flex; align-items: baseline; gap: var(--space-2); margin: 0 0 var(--space-4); font: 500 var(--text-ui)/1.3 var(--font); color: var(--text-2); }
.group__head .t-caption { font-weight: 400; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-6) var(--space-4); }

.card { position: relative; display: block; color: inherit; text-decoration: none; cursor: pointer; border-radius: var(--radius-md); }
.card__media {
  position: relative; overflow: hidden; border-radius: var(--radius-md); background: var(--surface); aspect-ratio: 4 / 3;
  transition: transform var(--dur) var(--spring);
}
.card__media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; transition: box-shadow var(--dur) var(--ease-out); }
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* Survol : un liseré plus net, pas de zoom. L'image ne bouge pas sous la souris. */
.card:hover .card__media::after { box-shadow: inset 0 0 0 1px var(--line-strong); }
.card:active .card__media { transform: scale(.98); transition-duration: var(--dur-press); }
.card__body { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-2); }
.card__title { min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__meta { flex: none; font-size: var(--text-caption); color: var(--text-3); }

/* Pastilles posées sur l'image : « Mouvement » en permanence, la palette au survol. */
.chip { position: absolute; left: var(--space-3); bottom: var(--space-3); display: inline-flex; align-items: center; gap: var(--space-2); height: 28px; padding: 0 var(--space-3);
  border-radius: var(--radius-pill); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: var(--text-caption); color: var(--text); }
.chip svg { width: 8px; height: 8px; fill: currentColor; }
.chip--pal { left: auto; right: var(--space-3); padding: 0 var(--space-2); opacity: 0; transform: translateY(4px); transition: opacity var(--dur) var(--spring), transform var(--dur) var(--spring); }
.card:focus-visible .chip--pal { opacity: 1; transform: none; }
/* Au survol de la souris seulement : sur iPhone, un survol qui fait apparaître quelque chose mange le premier tap (il en faut deux pour ouvrir). */
@media (hover: hover) { .card:hover .chip--pal { opacity: 1; transform: none; } }
.chip--avoid { top: var(--space-3); bottom: auto; color: var(--accent-text); }

/* Brief d'une collection : une ligne d'intention au-dessus des vignettes, modifiable d'un clic. */
.brief { display: flex; align-items: baseline; gap: var(--space-2); max-width: 64ch; margin: 0 0 var(--space-8); padding: 0; border: 0; background: none; font: 400 var(--text-ui)/1.5 var(--font); color: var(--text); text-align: left; cursor: pointer; }
.brief .icon { flex: none; width: 12px; height: 12px; color: var(--text-3); transform: translateY(1px); }
.brief.is-empty { color: var(--text-3); }
.brief:hover .icon, .brief.is-empty:hover { color: var(--text-2); }
.tag--avoid { align-self: flex-start; color: var(--accent-text); }

/* Signet, en haut à droite de la vignette : au survol, ou en permanence quand la réf est déjà dans une collection. */
.card__save { position: absolute; top: var(--space-2); right: var(--space-2); display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: var(--radius-xs); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--text); cursor: pointer; opacity: 0; transform: translateY(-4px); transition: opacity var(--dur) var(--spring), transform var(--dur) var(--spring), background-color var(--dur) var(--spring); }
.card__save:hover { background: var(--bg); }
.card:focus-within .card__save, .card__save:focus-visible, .card__save.is-saved { opacity: 1; transform: none; }
@media (hover: hover) { .card:hover .card__save { opacity: 1; transform: none; } }
.card__save .icon { width: 14px; height: 14px; }
/* Rangée : le signet se remplit, à la couleur du texte. L'accent reste réservé à la sélection. */
:is(.card__save, .inspector__save).is-saved .icon { fill: currentColor; }
.inspector__save { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Ajouter une réf : la palette de commande, réduite à un champ. Un lien glissé sur la page l'encadre d'accent. */
.add__hint { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); color: var(--text-2); }
.add__hint b { font-weight: 500; color: var(--text); }
.add__hint span { flex: 1; min-width: 0; }
body.is-dropping::after { content: "Dépose le lien ou l'image pour l'ajouter"; position: fixed; inset: var(--space-3); z-index: 60; display: grid; place-items: center;
  border-radius: var(--radius-lg); box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--bg) 70%, transparent);
  font: 500 var(--text-lead) var(--font); color: var(--text); pointer-events: none; }

/* Sélection : anneau d'accent. */
.card.is-selected .card__media { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* En cours d'analyse : un orb au centre de la vignette (l'état est réellement en cours). */
.card.is-pending { cursor: default; }
.card.is-pending .card__media { display: grid; place-items: center; }
.card.is-pending .card__title { color: var(--text-2); }

@keyframes arrive { from { transform: translateY(8px); } }

/* La palette lue par Claude, en pastilles. */
.swatches { display: inline-flex; gap: var(--space-1); }
.swatches i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); }
/* En grand dans la fiche : une bande, le code de chaque couleur dedans. */
.palette { display: flex; height: 96px; border-radius: var(--radius-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
/* Chaque couleur se copie d'un clic ou d'un tap : son code hex part dans le presse-papiers. */
.palette button { flex: 1; min-width: 0; display: flex; align-items: flex-end; padding: var(--space-3); border: 0; font: var(--text-caption)/1 var(--font-mono); cursor: copy; }
.palette--img { height: 64px; }
.img-note__text { margin-top: var(--space-3); }
/* Le bandeau rogne tout ce qui dépasse : l'anneau reste dedans, encadré de deux filets sombres (0-2 px et 4-5 px) pour que l'orange se détache d'une pastille claire comme d'une sombre (≥ 3:1). */
.palette button:focus-visible { outline-offset: -4px; box-shadow: inset 0 0 0 5px #0d0d0c; }

/* ───────────── Mouvement en détail ─────────────
   Une règle graduée en millisecondes, une barre par animation, puis une fiche par animation : sa courbe, ses valeurs, un aperçu.
   Survoler, toucher ou donner le focus rejoue. L'accent vit ici : c'est le seul endroit où la couleur porte une mesure. */
.motion { display: flex; flex-direction: column; gap: var(--space-2); }
.motion-timeline, .motion-anim { border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; outline-offset: 2px; transition: box-shadow var(--dur) var(--spring); }
.motion-timeline:hover, .motion-anim:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.motion-timeline { --label: 152px; position: relative; display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-5) var(--space-5); }
.motion-timeline__head { display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.motion-timeline__head span:last-child { font: var(--text-caption) var(--font-mono); color: var(--text-2); }
.motion-ruler { position: relative; height: 24px; margin-left: calc(var(--label) + var(--space-4)); border-bottom: 1px solid var(--line-strong); }
.motion-ruler span { position: absolute; bottom: 0; left: var(--at); height: 6px; border-left: 1px solid var(--line-strong); }
.motion-ruler span b { position: absolute; bottom: 8px; left: 0; translate: -50% 0; font: 400 11px/1 var(--font-mono); color: var(--text-3); }
.motion-ruler span:first-child b { translate: 0 0; } .motion-ruler span:last-child b { translate: -100% 0; }
.motion-timeline__row { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); gap: var(--space-4); align-items: center; min-height: 24px; }
.motion-timeline__label { font-size: var(--text-caption); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.motion-timeline__track { position: relative; height: 8px; border-radius: 4px; background: var(--hover); }
.motion-timeline__track i { position: absolute; top: 0; bottom: 0; min-width: 4px; border-radius: 4px; background: var(--accent); }
/* La tête de lecture balaie la seule colonne des barres. */
.motion-timeline__rows { position: relative; display: grid; gap: var(--space-2); }
.motion-timeline__sweep { position: absolute; top: 0; bottom: 0; left: calc(var(--label) + var(--space-4)); right: 0; pointer-events: none; }
.motion-timeline__sweep i { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--text); opacity: 0; }
.motion-anim { display: grid; grid-template-columns: 112px minmax(0, 1fr) 72px; gap: var(--space-5); align-items: center; padding: var(--space-4) var(--space-5); }
.motion-anim__plot { position: relative; height: 84px; }
.motion-anim__plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.motion-anim__plot .guide { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.motion-anim__plot .curve { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* Le point : x avance au rythme du temps, y suit la courbe ; bas et haut de la boîte = 0 et 1 du tracé. */
.motion-anim__x { position: absolute; top: 20%; bottom: 20%; left: 0; width: 100%; opacity: 0; pointer-events: none; }
.motion-anim__y { position: absolute; inset: 0; }
.motion-anim__y i { position: absolute; left: -4px; bottom: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 4px var(--accent-soft); }
.motion-anim__body { min-width: 0; display: grid; gap: var(--space-1); }
.motion-anim__title { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; }
.motion-anim__title span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.motion-anim__title .tag { flex: none; }
.motion-anim__meta { font: var(--text-caption) var(--font-mono); color: var(--text-2); }
.motion-anim__code { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.motion-anim__code code { min-width: 0; font: var(--text-caption)/1.4 var(--font-mono); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.motion-anim__lane { display: grid; place-items: center; height: 56px; border-radius: var(--radius-sm); background: var(--hover); overflow: hidden; }
.motion-anim__lane i { width: 24px; height: 24px; border-radius: var(--radius-xs); background: var(--accent); }
.motion__hint { font-size: var(--text-caption); color: var(--text-3); }

/* ───────────── Liste (Outils, Code, Articles) ───────────── */

.list { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: var(--space-5); align-items: center;
  min-height: 96px; padding: var(--space-3) 0; border-top: 1px solid var(--line); cursor: pointer;
  transition: background-color var(--dur) var(--spring);
}
.row:hover .row__title { color: var(--text); }
.row__thumb { width: 96px; height: 72px; border-radius: var(--radius-sm); object-fit: cover; object-position: top; background: var(--surface); }
.row__title { font-weight: 500; font-size: var(--text-read); }
.row__desc { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__side { display: flex; align-items: center; gap: var(--space-2); }
.row__domain { margin-left: var(--space-2); font: var(--text-caption) var(--font-mono); color: var(--text-3); }

/* ───────────── Menus et superpositions ───────────── */

/* Un menu jaillit du bouton qui l'ouvre (transform-origin sur le déclencheur). */
.menu {
  min-width: 240px; padding: var(--space-1); border-radius: var(--radius-md);
  background: var(--raised); box-shadow: var(--shadow-pop);
  transform-origin: top left; animation: pop var(--dur) var(--spring) both;
}
@keyframes pop { from { transform: scale(.96) translateY(-4px); } }
.menu__search { margin: var(--space-1) var(--space-1) var(--space-2); }
.menu__search .field { height: var(--control-h-sm); }
/* Longue liste (Stack, Styles) : elle défile dans le menu au lieu de le faire sortir de l'écran. */
.menu [data-items] { max-height: min(50dvh, 400px); overflow-y: auto; }
.menu__label { padding: var(--space-2) var(--space-2) var(--space-1); font-size: var(--text-caption); color: var(--text-3); }
.menu__item {
  display: flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-2);
  border-radius: var(--radius-sm); color: var(--text); cursor: pointer;
}
.menu__item:hover, .menu__item:focus-visible, .menu__item.is-hover { background: var(--hover); }
.menu__check { width: 16px; display: inline-grid; place-items: center; color: var(--accent-text); }
.menu__count { margin-left: auto; font: var(--text-caption) var(--font-mono); color: var(--text-3); }
.menu__sep { height: 1px; margin: var(--space-1) var(--space-2); background: var(--line); }

.scrim { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: fade var(--dur) var(--ease-out) both; }
@keyframes fade { from { opacity: 0; } }

.toast {
  display: inline-flex; align-items: center; gap: var(--space-3); height: 48px; padding: 0 var(--space-2) 0 var(--space-5);
  border-radius: var(--radius-pill); background: var(--raised); box-shadow: var(--shadow-pop); font-weight: 500;
  animation: rise var(--dur-arrive) var(--ease-out) both;
}
.toast:not(:has(button)) { padding-right: var(--space-5); }
@keyframes rise { from { transform: translateY(8px); } }
.toast .icon { color: var(--ok); }

/* ───────────── Fiche d'une réf ─────────────
   Une feuille plein écran qui monte : l'image entière en haut, puis le titre à gauche et les notes à droite. */

.inspector {
  position: fixed; inset: 0 0 0 var(--side-w); z-index: 10; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); box-shadow: -1px 0 0 var(--line); animation: sheet-up var(--dur-arrive) var(--spring) both;
}
@keyframes sheet-up { from { transform: translateY(6%); } }
.inspector.is-still { animation: none; } /* passage d'une réf à l'autre : la feuille reste, l'image se transforme */
body:has(.inspector) { overflow: hidden; }
.inspector__bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: var(--space-2); height: var(--bar-h); padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.inspector__bar .grow { flex: 1; }
.inspector__bar .t-caption { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: var(--space-3); color: var(--text-2); }
.inspector__bar .btn--icon { background: var(--hover); color: var(--text); }
.inspector__bar .btn--icon:hover { background: var(--pressed); }
.inspector__stage { display: grid; justify-items: center; gap: var(--space-5); padding: var(--space-2) var(--gutter) var(--space-10); background: var(--surface); }
.inspector__media { display: grid; place-items: center; height: min(60dvh, 680px); min-height: 280px; }
.inspector__media img { display: block; max-width: 100%; max-height: min(60dvh, 680px); width: auto; height: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-lift); cursor: zoom-in; }
.thumbs { display: flex; gap: var(--space-2); }
.thumbs img { width: 56px; height: 42px; border-radius: var(--radius-xs); object-fit: cover; object-position: top; opacity: .5; cursor: pointer; transition: opacity var(--dur) var(--spring), box-shadow var(--dur) var(--spring); }
.thumbs img:hover { opacity: .9; }
.thumbs img.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.inspector__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-24); max-width: 1280px; margin-inline: auto; padding: var(--space-16) var(--gutter) var(--space-24); }
.inspector__head { position: sticky; top: calc(var(--bar-h) + var(--space-8)); align-self: start; display: flex; flex-direction: column; gap: var(--space-5); }
.inspector__head .t-title { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.06; letter-spacing: var(--track-page); }
.filing { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.inspector__foot { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.inspector__notes { display: flex; flex-direction: column; gap: var(--space-12); min-width: 0; }
.inspector__section { display: flex; flex-direction: column; gap: var(--space-3); }
.inspector__section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.inspector__section-head .section__label { margin: 0; }
/* Titres des blocs de la fiche : de vrais titres, à la couleur du texte. Pas de petite étiquette grise au-dessus du contenu. */
.section__label { margin: 0 0 var(--space-3); font: 500 var(--text-read)/1.3 var(--font); color: var(--text); }
.facts { display: grid; margin: 0; }
.facts > div { display: flex; justify-content: space-between; align-items: center; gap: var(--space-6); min-height: 48px; padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { flex: none; color: var(--text-3); }
.facts dd { margin: 0; display: flex; gap: var(--space-1); flex-wrap: wrap; justify-content: flex-end; }

/* ───────────── Palette de commande ⌘K ───────────── */

.cmdk { width: min(680px, 100vw - 2 * var(--space-4)); border-radius: var(--radius-lg); background: var(--raised); box-shadow: var(--shadow-pop); overflow: hidden; transform-origin: top center; animation: pop var(--dur) var(--spring) both; }
.cmdk__input { display: flex; align-items: center; gap: var(--space-3); height: 64px; padding: 0 var(--space-5); border-bottom: 1px solid var(--line); color: var(--text-3); }
.cmdk__input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: var(--text-lead) var(--font); }
.cmdk__input input::placeholder { color: var(--text-3); }
.cmdk__list { padding: var(--space-2); max-height: min(56dvh, 520px); overflow-y: auto; }
.cmdk__item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-2); border-radius: var(--radius-md); cursor: pointer; }
.cmdk__item.is-hover { background: var(--hover); }
.cmdk__item .t-caption { color: var(--text-2); } /* sur un fond survolé, le gris le plus pâle ne passe plus le contraste AA */
.cmdk__item img { width: 64px; height: 48px; border-radius: var(--radius-xs); object-fit: cover; object-position: top; }
.cmdk__foot { display: flex; gap: var(--space-5); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); font-size: var(--text-caption); color: var(--text-3); }
.cmdk__foot span { display: inline-flex; align-items: center; gap: var(--space-2); }

/* ───────────── États vides ───────────── */

.empty { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-24) var(--space-6); text-align: center; color: var(--text-2); }
.empty .icon { width: 24px; height: 24px; margin-bottom: var(--space-2); color: var(--text-3); }
.empty strong { color: var(--text); font: 500 var(--text-title)/1.15 var(--font-display); letter-spacing: var(--track-title); }
.empty span { max-width: 44ch; }
.empty .btn { margin-top: var(--space-4); }

/* ───────────── Coquille de l'app ───────────── */

/* La barre latérale à gauche, le contenu à droite sur toute la largeur. */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.main { position: relative; min-width: 0; }
/* En-tête de vue, collé en haut : le titre et son nombre à gauche, les filtres à droite, sur une seule ligne. */
.toolbar {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: var(--space-4); min-height: 64px; padding: var(--space-3) var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.toolbar__title { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; margin: 0; font: 500 var(--text-lead)/1.2 var(--font); letter-spacing: -.01em; white-space: nowrap; }
.toolbar__sep { color: var(--text-3); font-weight: 400; }
.toolbar__count { font-size: var(--text-caption); color: var(--text-3); letter-spacing: 0; }
.toolbar__row { display: flex; align-items: center; gap: var(--space-2); flex: 1; justify-content: flex-end; min-width: 0; }
.toolbar__sujets { display: none; }
.content { padding: var(--space-6) var(--gutter) var(--space-24); }
.layer-menu { position: fixed; z-index: 30; }
.toast-dock { position: fixed; left: 50%; bottom: var(--space-6); z-index: 40; translate: -50% 0; }
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; justify-items: center; align-items: start; padding: 14vh var(--space-4) 0; }
.overlay .scrim { position: fixed; }
.overlay .cmdk { position: relative; }
.review-block + .review-block { margin-top: var(--space-16); }
.review-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: var(--space-5); align-items: center; padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.review-row__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.review-row .row__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* une adresse longue ne passe pas sous les boutons */

/* ───────────── Connexion ─────────────
   Formulaire à gauche, photo bord à bord à droite. Connexion (login.html) et inscription (inscription.html) partagent ces
   styles et web/auth.js. Étapes dans la même colonne : lien par e-mail, lien envoyé, mot de passe (connexion seulement). Sources : Clay (structure), Hotjar et Supabase (photo bord à bord), Customer.io
   (« Dernière utilisée »), Felt (raccourcis vers la messagerie), sur Mobbin. */
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 100dvh; }
.login__side { display: flex; flex-direction: column; padding: var(--space-5) var(--space-8) var(--space-4); }
.login__home { align-self: start; border-radius: var(--radius-xs); }
.login__step, .login__foot { width: min(360px, 100%); margin-inline: auto; }
.login__step { margin-block: auto; padding-block: var(--space-12); animation: login-in var(--dur-arrive) var(--ease-out); }
@keyframes login-in { from { opacity: 0; transform: translateY(8px); } }
.login__step h1 { outline: 0; }
.login__sub { margin: var(--space-2) 0 var(--space-8); text-wrap: pretty; }
.login__addr { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.login__btn { position: relative; width: 100%; height: 44px; }
/* Posée à cheval sur le bord du bouton, pour ne jamais recouvrir son libellé. */
.login__last { position: absolute; top: -10px; right: var(--space-3); height: 20px; background: var(--raised); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.login__last[hidden] { display: none; }
.login__or { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-3); margin: var(--space-6) 0; font-size: var(--text-caption); color: var(--text-3); }
.login__or[hidden], .login__google[hidden] { display: none; }
.login__or::before, .login__or::after { content: ""; height: 1px; background: var(--line); }
.login__form { display: grid; }
.login__label { margin-bottom: var(--space-2); font-weight: 500; color: var(--text-2); }
.login__field { height: 44px; padding-inline: var(--space-4); margin-bottom: var(--space-3); }
.login__field:has([aria-invalid="true"]) { box-shadow: 0 0 0 2px var(--danger); }
.login__hint { margin-top: var(--space-3); line-height: 1.5; text-wrap: pretty; }
.login__hint.is-error { color: var(--danger); }
.login__pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.login__back { margin: var(--space-6) 0 0 calc(-1 * var(--space-3)); }
.login__link { padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); cursor: pointer; border-radius: 2px; }
.login__link:hover { color: var(--text); text-decoration-color: currentColor; }
.login__foot { text-align: center; }

/* Moitié droite : le dégradé (blanc pâle vers orange) bord à bord, sans marge ni coins arrondis, le même dans les deux thèmes. */
.login__bg { position: relative; margin: 0; overflow: hidden; background: #f1e6dc; }
.login__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: login-settle 1.4s var(--ease-out); }
@keyframes login-settle { from { opacity: 0; transform: scale(1.06); } }
/* La photo est claire partout : le crédit reste en encre sombre, quel que soit le thème. */
.login__credit { position: absolute; right: var(--space-6); bottom: var(--space-5); font-size: var(--text-caption); color: rgba(22, 22, 20, .66); }
.login__credit a { color: inherit; text-underline-offset: 2px; }
.login__credit a:hover { color: #161614; }
.login__foot[hidden] { display: none; }
.login__lang, .account__lang { color: var(--text-3, var(--text)); }
.login__lang { margin-top: var(--space-3); text-align: center; }
.account__lang { margin-left: auto; }
.login__lang a, .account__lang a { color: inherit; text-underline-offset: 2px; }
.login__lang a[aria-current], .account__lang a[aria-current] { color: var(--text); font-weight: 500; text-decoration: none; }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login__side { padding: var(--space-5) var(--space-4); }
  .login__bg { display: none; }
}
@media (prefers-reduced-motion: reduce) { .login__step, .login__bg img { animation: none; } }

/* Fenêtre étroite (demi-écran, panneau d'aperçu) : la barre latérale et les marges se resserrent. */
@media (max-width: 1180px) {
  :root { --gutter: 24px; --side-w: 208px; }
  .inspector__body { gap: var(--space-12); }
}

/* iPhone : pas de barre latérale. Une barre en haut, les familles dessous, la navigation dans une barre d'onglets en bas, à portée de pouce. */
@media (max-width: 900px) {
  :root { --gutter: 20px; --bar-h: 64px; --side-w: 0px; }
  .shell { display: block; }
  .side { display: none; }
  .bar { display: grid; }
  .topbar__chips { position: sticky; top: var(--bar-h); z-index: 4; display: flex; gap: var(--space-1); overflow-x: auto; scrollbar-width: none; padding: 0 calc(var(--gutter) - var(--space-3)) var(--space-3);
    background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  .topbar__chips .filter { flex: none; height: var(--control-h); padding: 0 var(--space-4); }
  .tabbar { position: fixed; z-index: 6; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: var(--space-1) var(--space-2) max(var(--space-1), env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--raised) 84%, transparent); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); box-shadow: 0 -1px 0 var(--line); }
  .tabbar button { position: relative; display: grid; justify-items: center; gap: var(--space-1); height: 52px; padding: var(--space-2) 0 0; border: 0; background: none; color: var(--text-3); font: 500 11px/1 var(--font); cursor: pointer; }
  .tabbar button.is-active { color: var(--text); }
  .tabbar .icon { width: 20px; height: 20px; }
  .tabbar .nav-item__badge { position: absolute; top: 2px; left: calc(50% + 4px); }
  body { padding-bottom: 72px; }
  .toolbar { position: static; flex-wrap: wrap; padding: var(--space-5) var(--gutter) var(--space-4); border-bottom: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .toolbar__row { flex-basis: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .toolbar__sujets { display: flex; flex: 0 0 calc(100% + 2 * var(--gutter)); gap: var(--space-1); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: calc(var(--gutter) - var(--space-3)); }
  .toolbar__sujets .filter { flex: none; height: var(--control-h); }
  .content { padding-top: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-3); }
  .card__meta, .chip--pal { display: none; }
  .row { grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-4); min-height: 80px; }
  .row__thumb { width: 72px; height: 54px; }
  .row__side { display: none; }
  .review-row { grid-template-columns: minmax(0, 1fr); }
  .review-row > :first-child { display: none; }
  .inspector__media { height: 48dvh; }
  .inspector__media img { max-height: 48dvh; }
  .inspector__body { grid-template-columns: 1fr; gap: var(--space-12); padding-top: var(--space-10); }
  .inspector__head { position: static; }
  .motion-timeline { --label: 96px; padding-inline: var(--space-4); }
  .motion-anim { grid-template-columns: 80px minmax(0, 1fr); padding-inline: var(--space-4); }
  .motion-anim__lane { display: none; }
  .overlay { padding-top: var(--space-4); }
  .menu [data-items] { max-height: min(40dvh, 400px); } /* le menu tient entre son bouton et la barre d'onglets */
  /* Au doigt, pas de clavier : les raccourcis (Échap, flèches, ↵) n'ont rien à dire. */
  .cmdk__foot, .cmdk .kbd { display: none; }
  .toast-dock { bottom: 88px; }
}

/* ───────────── Pages Journal et Compte : listes de réglages ─────────────
   Même grammaire partout : un titre de groupe, puis des lignes séparées par un filet,
   intitulé et explication à gauche, valeur ou action à droite. */
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12); max-width: 760px; }
.settings { display: grid; }
.settings__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-2); }
.settings__title { margin: 0; font: 500 var(--text-read)/1.3 var(--font); }
.settings__list { display: grid; }
.settings__note { margin: 0; color: var(--text-3); font-size: var(--text-caption); line-height: 1.5; }
.setting { display: flex; align-items: center; gap: var(--space-4); min-height: 64px; padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.settings__list > .setting:last-child { border-bottom: 1px solid var(--line); }
.setting__label { flex: 1; min-width: 0; }
.setting__label b { display: block; font-weight: 500; }
.setting__label p { max-width: 56ch; margin: var(--space-1) 0 0; color: var(--text-2); line-height: 1.5; text-wrap: pretty; }
.setting__label .code { margin-top: var(--space-3); color: var(--text); user-select: all; }
/* Champ de code avec le bouton copier logé à droite, en haut pour rester en place sur plusieurs lignes. */
.copyfield { position: relative; margin-top: var(--space-3); }
.setting__label .copyfield .code { margin: 0; padding-right: calc(var(--control-h-sm) + var(--space-4)); }
.copyfield__btn { position: absolute; top: 6px; right: 6px; color: var(--text-3); }
.copyfield__btn:hover { background: var(--pressed); }
.steps { margin: var(--space-2) 0 0; padding-left: 1.25em; color: var(--text-2); line-height: 1.5; }
.setting__icon { display: grid; place-items: center; flex: none; align-self: start; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--hover); color: var(--text-2); }
.setting > .btn, .setting > form, .setting__actions { flex: none; }
.setting__actions { display: flex; gap: var(--space-2); }
.inline-form { display: flex; align-items: center; gap: var(--space-2); }
.inline-form .field { width: 220px; height: var(--control-h-sm); padding-inline: var(--space-3); }
.confirm { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.confirm .inline-form .field { width: 260px; }
.code { display: block; margin-top: var(--space-2); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--hover); font: var(--text-caption)/1.5 var(--font-mono); color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

/* Statut de la connexion de Claude : un point vert quand il a déjà consulté la bibliothèque. */
.status { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-3); font-size: var(--text-caption); }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.status.is-live i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }

/* Historique : une ligne par évènement, l'heure alignée à droite en chiffres tabulaires. */
.log__day { margin: var(--space-6) 0 var(--space-1); font: 500 var(--text-caption)/1 var(--font); color: var(--text-3); }
.settings__head + .log__day { margin-top: var(--space-2); }
.log { display: grid; margin: 0; padding: 0; list-style: none; }
.log__item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.log__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-xs); background: var(--hover); color: var(--text-2); }
.log__icon .icon { width: 14px; height: 14px; }
img.log__icon { object-fit: cover; object-position: top; cursor: pointer; }
.log__what p { margin: 0; padding-top: 5px; line-height: 1.4; color: var(--text-2); text-wrap: pretty; }
.log__what b { font-weight: 500; color: var(--text); }
.log__meta { margin-left: var(--space-2); font: var(--text-caption) var(--font-mono); color: var(--text-3); }
.log__time { padding-top: 6px; font: var(--text-caption)/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-3); }
.log__thumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.log__thumbs img { width: 56px; height: 42px; border-radius: var(--radius-xs); object-fit: cover; object-position: top; cursor: pointer; transition: opacity var(--dur) var(--spring); }
.log__thumbs img:hover { opacity: .8; }

/* Polices : chaque carte dans sa propre police, sur l'aplat des cartes de la bibliothèque. */
.fonts { display: grid; gap: var(--space-8); }
.fonts__empty { padding: var(--space-16) var(--space-6) 0; }
.fontdrop { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-4) var(--space-6); padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--dur) var(--ease-out); }
.fontdrop__text b { font-weight: 500; }
.fontdrop__text p { max-width: 64ch; margin: var(--space-1) 0 0; color: var(--text-2); line-height: 1.5; text-wrap: pretty; }
.fontdrop .fontdrop__license { grid-area: auto; grid-column: 1 / -1; margin: 0; } /* reprend la case des conditions de vente, sans sa zone de grille */
.fontdrop .btn { position: relative; }
.btn:has(.file-input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.fontdrop .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
body.is-dropping:has(.fontdrop)::after { content: none; } /* la zone de la vue s'allume à la place du voile « lien ou image » */
body.is-dropping .fontdrop { box-shadow: inset 0 0 0 2px var(--accent); }
.fonts__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-8) var(--space-4); }
.font__sample { position: relative; display: grid; align-content: end; gap: var(--space-3); min-height: 200px; padding: var(--space-5); overflow: hidden;
  border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 400; font-style: normal; font-synthesis: none; color: var(--text); }
.font__name { font-size: 44px; line-height: 1.05; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font__sample p { margin: 0; font-size: var(--text-read); line-height: 1.4; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.font.is-pending .font__sample { place-items: center; align-content: center; }
.font__body { display: grid; gap: var(--space-2); padding-top: var(--space-3); }
.font__head { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-h-sm); }
.font__head b { min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font__meta { flex: 1; min-width: 0; font: var(--text-caption) var(--font-mono); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font__head .btn { margin-left: auto; color: var(--text-3); }
.font__tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.font__role { cursor: pointer; color: var(--text); }
.font__role:hover { background: var(--pressed); }
.font__desc { margin: 0; color: var(--text-2); line-height: 1.5; text-wrap: pretty; }
.font__mood { color: var(--text-2); }
.font__facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-3); margin: var(--space-1) 0 0; font-size: var(--text-caption); line-height: 1.45; }
.font__facts dt { color: var(--text-3); }
.font__facts dd { margin: 0; color: var(--text-2); }
.font__none { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); color: var(--text-3); }
@media (max-width: 720px) {
  .fontdrop { grid-template-columns: 1fr; padding: var(--space-4); }
  .fontdrop .btn { justify-self: start; }
  .fonts__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .setting { flex-wrap: wrap; }
  .setting__label { flex: 1 1 220px; }
  .setting > .btn, .setting > form, .setting__actions { margin-left: auto; }
  .inline-form { flex-wrap: wrap; }
  .inline-form .field, .confirm .inline-form .field { width: 100%; }
  /* Un champ seul dans un réglage (le nom) : toute la largeur, aligné sur l'intitulé, le bouton à sa droite. */
  .setting > .inline-form { flex: 1 1 100%; flex-wrap: nowrap; margin-left: 0; }
  .setting > .inline-form .field { flex: 1; width: auto; min-width: 0; }
}

/* ───────────── Visionneuse (aperçu presque plein écran) ─────────────
   Toujours sombre, pour ne pas fausser les couleurs des réfs. */
.viewer {
  position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); /* jamais plus large que l'écran */
  background: rgba(8, 8, 8, .94);
  color: var(--text); animation: fade var(--dur) var(--ease-out) both;
  view-transition-name: viewer;
}
@supports (view-transition-name: none) { .viewer { animation: none; } }
::view-transition-group(viewer), ::view-transition-old(viewer), ::view-transition-new(viewer) { animation-duration: var(--dur); animation-timing-function: var(--ease-out); }
/* z-index : sinon le voile, absent de l'état de départ, passe devant l'image en vol.
   Arrondi : la capture ne garde pas le découpage du parent ; sans lui, coins carrés jusqu'à la fin. */
::view-transition-group(hero) { z-index: 1; }
::view-transition-image-pair(hero) { border-radius: var(--radius-md); overflow: clip; }
.vt-viewer-open::view-transition-image-pair(hero) { animation: vt-shadow var(--dur-arrive) var(--ease-out) both; }
.vt-viewer-close::view-transition-image-pair(hero) { animation: vt-shadow var(--dur-arrive) var(--ease-out) reverse both; }
@keyframes vt-shadow { from { box-shadow: 0 32px 80px -24px rgba(0, 0, 0, 0); } to { box-shadow: 0 32px 80px -24px rgba(0, 0, 0, .8); } }
/* Ouverture et fermeture d'une fiche ou de la visionneuse : seule l'image voyage (nom « hero »). Les autres vignettes
   restent dans la page ; sinon chacune passe au premier plan et flotte au-dessus de la fiche qui arrive. */
:is(.vt-sheet, .vt-viewer-open, .vt-viewer-close) :is(.card, .row) { view-transition-name: none !important; }
.viewer__stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: center; min-height: 0; overflow: auto; padding: var(--space-12) var(--space-12) var(--space-4); }
.viewer__stage img {
  display: block; max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain;
  border-radius: var(--radius-md); box-shadow: 0 32px 80px -24px rgba(0, 0, 0, .8); cursor: zoom-in;
}
.viewer.is-zoomed .viewer__stage { grid-template-columns: auto; justify-content: center; align-items: start; }
.viewer.is-zoomed .viewer__stage img { max-width: none; max-height: none; border-radius: 0; cursor: zoom-out; }
.viewer__bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-6) var(--space-5); }
.viewer__bar .grow { flex: 1; }
.viewer__title { min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer__count { font-family: var(--font-mono); color: var(--text-3); }
.viewer__close { position: absolute; top: var(--space-4); right: var(--space-4); z-index: 1; background: var(--hover); color: var(--text); }
.viewer__nav { position: absolute; top: 50%; z-index: 1; translate: 0 -50%; background: var(--hover); color: var(--text); }
.viewer__nav--prev { left: var(--space-4); }
.viewer__nav--next { right: var(--space-4); }
@media (max-width: 900px) {
  .viewer__stage { padding: var(--space-12) var(--space-2) var(--space-2); }
  .viewer__nav { display: none; }
  .viewer__bar { padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom)); }
}

/* ───────────── Transitions de vue (ouverture d'une réf, changement de filtre) ─────────────
   Le JS appelle document.startViewTransition() ; la vignette cliquée et la grande image de la fiche
   portent le même view-transition-name pour que l'une se transforme en l'autre. */
::view-transition-group(*) { animation-duration: var(--dur-arrive); animation-timing-function: var(--spring); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur); animation-timing-function: var(--ease-out); }
::view-transition-old(*), ::view-transition-new(*) { mix-blend-mode: normal; }

/* ───────────── Accessibilité ───────────── */

@media (prefers-reduced-motion: reduce) {
  /* Pas de déplacement ni de mise à l'échelle : de simples fondus courts. */
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 120ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .bar, .toolbar, .inspector__bar, .topbar__chips, .tabbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .scrim { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ───────────── Compte ───────────── */
.account { width: min(560px, 100% - 2 * var(--gutter)); margin: 0 auto; padding: var(--space-6) 0 var(--space-12); }
.account__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-12); }
.account__sub { margin: var(--space-2) 0 var(--space-8); }
.account__block { padding: var(--space-6) 0; border-top: 1px solid var(--line); }
.account__block h2 { margin: 0 0 var(--space-2); font: 500 var(--text-lead)/1.3 var(--font-display); letter-spacing: var(--track-title); }
.account__block p { margin: 0 0 var(--space-4); }
.account__foot { display: flex; flex-wrap: wrap; gap: var(--space-4); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.account__foot a { color: var(--text-3); font-size: var(--text-caption); }
.legal .account__block p:last-child { margin-bottom: 0; }
.legal a { color: inherit; }

/* ───────────── Page Compte (dans l'app) ───────────── */
.acct { gap: var(--space-10); }
.acct__panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-10); }
/* Onglets du compte : un trait sous l'onglet actif, posé sur le filet de la liste. */
/* Filet en ombre intérieure, pas en bordure : la zone défile en largeur, et un trait posé sur une bordure y serait rogné. */
.tabs { display: flex; gap: var(--space-5); box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: calc(-1 * var(--space-4)); }
.tabs button { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-h); padding: 0; border: 0; background: none;
  color: var(--text-3); font: 500 var(--text-ui)/1 var(--font); cursor: pointer; white-space: nowrap; transition: color var(--dur) var(--spring); }
.tabs button:hover { color: var(--text-2); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 1px; background: var(--text); }
.tabs button:focus-visible { outline-offset: -2px; }

/* Photo de profil, ou initiale sur une pastille quand il n'y en a pas. */
.avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  background: var(--raised); color: var(--text-2); font: 500 var(--text-ui)/1 var(--font); box-shadow: inset 0 0 0 1px var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 24px; height: 24px; font-size: var(--text-caption); }
.avatar--lg { width: 72px; height: 72px; font: 500 28px/1 var(--font-display); }
.avatar--square { border-radius: var(--radius-lg); }

/* Retour de paiement : activation, puis confirmation. */
.welcome { display: grid; justify-items: center; gap: var(--space-4); max-width: 520px; margin: 0 auto; padding: var(--space-24) 0 var(--space-16); text-align: center; }
.welcome sl-orb { margin-bottom: var(--space-4); }
/* Illustration Icons8, style « Inverse » : noir et blanc, comme le reste de l'interface. */
/* Taille liée au titre : environ deux fois sa hauteur, pour accompagner le message sans le dominer.
   Le téléphone penché tire le dessin vers la gauche (centre visuel à 45 %) : on le recentre à l'œil. */
.welcome__illu { width: clamp(96px, calc(var(--text-page) * 1.9), 120px); height: auto; margin-bottom: var(--space-2); translate: 5% 0;
  animation: arrive var(--dur-arrive) var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) { .welcome__illu { animation: none; } }
/* Le symbole en chrome (rendu 3D, fond transparent) : même échelle que l'illustration, liée au titre. */
.welcome__mark { width: clamp(96px, calc(var(--text-page) * 1.9), 120px); height: auto; margin-bottom: var(--space-3); }
.welcome__title { margin: 0; font: 500 var(--text-page)/1.04 var(--font-display); letter-spacing: var(--track-page); text-wrap: balance; }
.welcome__text { max-width: 44ch; margin: 0; color: var(--text-2); font-size: var(--text-read); line-height: 1.6; text-wrap: pretty; }
.welcome__text a { color: var(--text); text-underline-offset: 3px; }
.welcome__facts { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: var(--space-6) 0 var(--space-4); border-block: 1px solid var(--line); }
.welcome__facts div { display: grid; gap: var(--space-1); padding: var(--space-4) var(--space-3); }
.welcome__facts div + div { border-left: 1px solid var(--line); }
.welcome__facts dt { font-size: var(--text-caption); color: var(--text-3); }
.welcome__facts dd { margin: 0; font-size: var(--text-ui); color: var(--text); font-variant-numeric: tabular-nums; }
.welcome__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.welcome.is-done > * { animation: arrive var(--dur-arrive) var(--ease-out) calc(var(--i, 0) * 70ms) both; }
@media (max-width: 640px) {
  .welcome { padding-top: var(--space-10); gap: var(--space-3); }
  .welcome__facts { grid-template-columns: 1fr; margin: var(--space-4) 0; }
  .welcome__facts div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding: var(--space-3) 0; }
  .welcome__facts div + div { border-left: 0; border-top: 1px solid var(--line); }
  .welcome__actions { width: 100%; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .welcome.is-done > * { animation: none; } }
.acct__legal { display: flex; flex-wrap: wrap; gap: var(--space-5); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.acct__legal a { font-size: var(--text-caption); color: var(--text-3); text-decoration: none; }
.acct__legal a:hover { color: var(--text-2); }

.plan-panel { display: grid; gap: var(--space-8); padding: var(--space-8); border-radius: var(--radius-lg); background: var(--surface); }
.plan-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-6); }
/* Le symbole de la formule active, sur la ligne de son statut et à sa hauteur (cuivre pour Pro, chrome pour Studio) :
   le texte, le bouton et la jauge gardent ainsi le même bord gauche que lui. */
.plan-panel__status { display: flex; align-items: center; gap: var(--space-3); }
.plan-panel__mark { flex: none; width: 28px; height: 28px; }
.plan-panel__text { max-width: 52ch; margin: var(--space-3) 0 0; font-size: var(--text-read); line-height: 1.55; text-wrap: pretty; }
.plan-chip { display: inline-flex; align-items: center; gap: var(--space-2); height: 26px; padding: 0 var(--space-3); border-radius: var(--radius-pill);
  font: 500 var(--text-caption)/1 var(--font); background: var(--hover); color: var(--text-2); }
.plan-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.plan-chip--ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.plan-chip--accent { color: var(--accent-text); background: var(--accent-soft); }
.plan-chip--warn, .plan-chip--danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }

.usage { display: grid; gap: var(--space-2); }
.usage__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); color: var(--text-2); }
.usage__num { flex: none; white-space: nowrap; font: 500 var(--text-read)/1 var(--font-mono); color: var(--text); }
.usage__num span { color: var(--text-3); font-weight: 400; }
.usage__bar { height: 6px; border-radius: var(--radius-pill); background: var(--hover); overflow: hidden; }
.usage__bar i { display: block; height: 100%; border-radius: inherit; background: var(--text); transition: width var(--dur-arrive) var(--ease-out); }
.usage__bar i.is-high { background: var(--accent); }
.usage .t-caption { margin: var(--space-1) 0 0; }

/* Offre : les choix sur une ligne, puis le prix et sa note à gauche, le bouton à droite. La composition reste la même d'une formule à l'autre. */
.upgrade { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "seg seg" "price cta" "consent consent"; align-items: center; gap: var(--space-6) var(--space-8);
  padding-top: var(--space-8); border-top: 1px solid var(--line); }
.upgrade__choice { grid-area: seg; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.upgrade .seg .tag { margin-left: var(--space-1); height: 18px; background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.upgrade__price { grid-area: price; min-width: 0; }
.upgrade__price b { margin-right: var(--space-2); font: 500 var(--text-title)/1 var(--font-display); letter-spacing: var(--track-title); white-space: nowrap; }
.upgrade__price span { color: var(--text-2); }
.upgrade__note { max-width: 52ch; margin: var(--space-2) 0 0; text-wrap: pretty; }
.upgrade__cta { grid-area: cta; height: 44px; padding-inline: var(--space-6); }
/* Consentement avant paiement (CGV et démarrage immédiat) : une case native, à la couleur d'accent. */
.upgrade__consent { grid-area: consent; display: flex; align-items: flex-start; gap: var(--space-2); margin-top: calc(-1 * var(--space-2)); color: var(--text-2); cursor: pointer; text-wrap: pretty; }
.upgrade__consent input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.upgrade__consent a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* Équipe : en-tête du studio, membres et invitations, ou l'offre Studio. */
.team-head, .who { display: flex; align-items: center; gap: var(--space-4); }
.team-head > div:not(.who__actions), .who__text { flex: 1; min-width: 0; }
.who__name { margin: 0; font: 500 var(--text-title)/1.15 var(--font-display); letter-spacing: var(--track-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-head .t-caption, .who .t-caption { margin: var(--space-1) 0 0; }
.who__photo { position: relative; flex: none; border-radius: 50%; cursor: pointer; }
.who__edit { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--raised); color: var(--text); box-shadow: 0 0 0 2px var(--bg); transition: transform var(--dur) var(--spring); }
.who__edit .icon { width: 12px; height: 12px; }
.who__photo:hover .who__edit { transform: scale(1.08); }
.who__photo--square { border-radius: var(--radius-lg); }
/* Le champ de fichier reste atteignable au clavier (un champ « hidden » ne l'est pas) ; l'anneau se dessine sur la photo. */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.who__photo:has(+ input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.who__actions { display: flex; flex: none; gap: var(--space-2); }

.members { display: grid; }
.member { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 72px; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.members > .member:last-child { border-bottom: 1px solid var(--line); }
.member__who { display: grid; gap: 2px; min-width: 0; }
.member__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member__mail { font-size: var(--text-caption); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .btn { justify-self: end; }
.member__role { justify-self: end; min-width: 104px; justify-content: space-between; }
.invite-form { gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); }
.invite-form .setting__label { cursor: default; }
.invite-form .field { flex: 1; width: auto; }

.team-offer { display: grid; justify-items: center; gap: var(--space-4); padding: var(--space-12) var(--space-8) var(--space-8); border-radius: var(--radius-lg); background: var(--surface); text-align: center; }
.team-offer__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--raised); color: var(--text); box-shadow: var(--shadow-raised); }
.team-offer__icon .icon { width: 22px; height: 22px; }
.team-offer__title { font-size: var(--text-title); letter-spacing: var(--track-title); }
.team-offer .upgrade { width: 100%; margin-top: var(--space-4); text-align: left; }

.invoices { display: grid; }
.invoice { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto 72px; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.invoices > .invoice:last-child { border-bottom: 1px solid var(--line); }
.invoice__num { font: var(--text-caption)/1 var(--font-mono); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.invoice__amount { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.invoice .btn { justify-self: end; }
.tag--warn { color: var(--danger); }

@media (max-width: 720px) {
  .plan-panel { padding: var(--space-6); gap: var(--space-6); }
  .plan-panel__head { flex-direction: column; }
  .upgrade { grid-template-columns: 1fr; grid-template-areas: "seg" "price" "cta" "consent"; row-gap: var(--space-5); }
  .upgrade .seg { flex: 1 1 auto; }
  .upgrade__cta { width: 100%; }
  .invoice { grid-template-columns: minmax(0, 1fr) auto auto; }
  .invoice__num, .invoice .tag { display: none; }
  .who, .team-head { flex-wrap: wrap; }
  .who__name { white-space: normal; text-wrap: balance; }
  .avatar--lg { width: 56px; height: 56px; font-size: 22px; }
  .who__actions { width: 100%; }
  .member { grid-template-columns: 32px minmax(0, 1fr) auto auto; }
  .member .tag { display: none; }
  .team-offer { padding: var(--space-8) var(--space-5) var(--space-6); }
}
/* Bouton Google natif (rendu par Google dans un cadre) : même hauteur et même largeur que nos boutons. */
.login__google { position: relative; min-height: 44px; color-scheme: normal; contain: inline-size; } /* le cadre de Google (largeur fixe) ne doit pas dicter la largeur de la colonne */
.login__google #google-btn { display: flex; justify-content: center; min-height: 44px; }
/* Le bouton apparaît en fondu une fois le cadre de Google en place (pas de surgissement brutal). */
.login__google #google-btn { opacity: 0; }
.login__google #google-btn.is-ready { opacity: 1; transition: opacity 200ms ease-out; }
@media (prefers-reduced-motion: reduce) { .login__google #google-btn.is-ready { transition: none; } }

/* Bandeau de proposition de langue (web/lang.js) : en bas, fixe, centré ; il ne décale rien et laisse la page cliquable autour de lui */
.langhint { position: fixed; z-index: 60; left: 50%; bottom: max(var(--space-4), env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: var(--space-3);
  width: max-content; max-width: calc(100vw - 2 * var(--space-4)); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  background: var(--surface); color: var(--text-2); border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  font: 400 var(--text-ui)/1.3 var(--font); animation: langhint-in .3s ease-out; }
.langhint__go { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; border-radius: var(--radius-xs); }
.langhint__x { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-3); font-size: 20px; line-height: 1; cursor: pointer; }
.langhint__x:hover { color: var(--text); background: var(--line); }
@keyframes langhint-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .langhint { animation: none; } }
@media (max-width: 480px) { .langhint { width: calc(100vw - 2 * var(--space-4)); justify-content: space-between; } .langhint span { flex: 1; } }

/* ───────────── Compte › Apps et agents : lignes sobres, dépliants et QR code ───────────── */
.apps > .app { border-top: 1px solid var(--line); }
.app__row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) 0; }
.app__row > .btn { flex: none; }
.app__ok { display: inline-grid; place-items: center; margin-left: var(--space-2); color: var(--ok); vertical-align: middle; }
.app__ok .icon { width: 14px; height: 14px; }
.app__meta { display: block; margin-top: var(--space-1); color: var(--text-3); font-size: var(--text-caption); }
.app__link, .app__toggle { display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-2); padding: 0; border: 0; background: none; color: var(--text-2);
  font: var(--text-caption)/1.5 var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); border-radius: var(--radius-xs); }
.app__toggle { text-decoration: none; }
.app__link:hover, .app__toggle:hover { color: var(--text); }
.app__toggle .icon { width: 14px; height: 14px; transition: transform var(--dur) var(--spring); }
.app__toggle[aria-expanded="true"] .icon, .app__qrbtn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.app__qrbtn { gap: var(--space-2); }
.app__qrbtn .icon { width: 14px; height: 14px; transition: transform var(--dur) var(--spring); }
.app__more { margin: 0 0 var(--space-4) calc(32px + var(--space-4)); padding: var(--space-4); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); }
.app__more[hidden] { display: none; }
.app__more .steps { margin-top: 0; }
.app__more p { margin: 0; line-height: 1.5; max-width: 56ch; text-wrap: pretty; }
.app__more .copyfield .code { background: var(--hover); margin: 0; padding-right: calc(var(--control-h-sm) + var(--space-4)); color: var(--text); }
.app__qr { display: flex; align-items: center; gap: var(--space-4); }
/* Toujours sombre sur clair, quel que soit le thème : un QR inversé n'est pas lu par tous les lecteurs. */
.qr { flex: none; width: 152px; height: 152px; padding: var(--space-2); box-sizing: content-box; border-radius: var(--radius-xs); background: #f4f3ef; fill: #0d0d0c; }
.app { scroll-margin-top: calc(var(--bar-h) + var(--space-4)); }
.app__token { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-4) calc(32px + var(--space-4)); }
.app__k { color: var(--text-3); font-size: var(--text-caption); }
.app__v { color: var(--text-2); }
.app__v--mask { font-family: var(--font-mono); letter-spacing: .15em; }
.app__token .btn { margin-left: auto; }
.app__token .app__once, .app__token .copyfield { flex: 1 1 100%; margin-top: var(--space-1); }
.app__token .copyfield .code { padding-right: calc(var(--control-h-sm) + var(--space-4)); }
.agent-tabs { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0 0 var(--space-3) calc(32px + var(--space-4)); }
.agent-tabs .btn[aria-pressed="true"] { background: var(--pressed); color: var(--text); }
.app__agent { margin-top: 0; }
.app__agent .copyfield { margin-top: var(--space-3); }
@media (max-width: 360px) { .acct .tabs { gap: var(--space-2); } .acct .tabs button { font-size: 13px; } }
@media (max-width: 720px) {
  .app__row { flex-wrap: wrap; }
  .app__row > .setting__label { flex: 1 1 200px; }
  .app__row > .btn { margin-left: calc(32px + var(--space-4)); }
  .app__more, .app__token, .agent-tabs { margin-left: 0; }
  .app__qr { flex-direction: column; align-items: flex-start; }
}

/* Bandeau cookies (web/analytics.js) : discret, en bas à gauche, jamais bloquant. */
.consent { position: fixed; z-index: 100; left: var(--space-4, 16px); bottom: var(--space-4, 16px); max-width: min(400px, calc(100vw - 32px));
  display: grid; gap: var(--space-3, 12px); padding: var(--space-4, 16px); border-radius: var(--radius-md); background: var(--surface, var(--bg));
  color: var(--text-2); font: 400 var(--text-ui)/1.5 var(--font); box-shadow: var(--shadow-pop); animation: consent-in var(--dur-arrive) var(--ease-out); }
.consent p { margin: 0; }
.consent a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.consent__actions { display: flex; justify-content: flex-end; gap: var(--space-2, 8px); }
@keyframes consent-in { from { opacity: 0; translate: 0 8px; } }
@media (prefers-reduced-motion: reduce) { .consent { animation: none; } }
