/* 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: transparent; 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;
}
.btn:hover { background: var(--hover); }
.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 { box-shadow: none; color: var(--text-2); }
.btn--plain:hover { background: var(--hover); color: var(--text); }
.btn--danger { color: var(--danger); }
.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__home { align-self: start; padding: 0 var(--space-2); margin-bottom: var(--space-5); border: 0; background: none; border-radius: var(--radius-xs); cursor: pointer; }
.side__home .logo { height: 22px; }
.side__add { width: 100%; margin-bottom: var(--space-2); }
.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__foot { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.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: 36px; 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:hover .chip--pal, .card:focus-visible .chip--pal { opacity: 1; transform: none; }

/* 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:hover .card__save, .card:focus-within .card__save, .card__save:focus-visible, .card__save.is-saved { 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); }
body.is-dropping::after { content: "Dépose le lien 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); }

/* Entrée d'une nouvelle réf : elle apparaît en montant légèrement. */
.card.is-new { animation: arrive var(--dur-arrive) var(--ease-out) both; }
@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); }
.palette span { flex: 1; display: flex; align-items: flex-end; padding: var(--space-3); font: var(--text-caption)/1 var(--font-mono); }

/* ───────────── 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); }
.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.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: 680px; max-width: 100%; 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; gap: var(--space-2); }

/* Connexion */
/* ───────────── 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; }
.login__g { width: 18px; height: 18px; }
/* 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::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; }

@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(4, 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); }
  .toast-dock { bottom: 88px; }
}

/* ───────────── Page « Claude » : ce qu'il fait avec la bibliothèque ───────────── */
.claude { display: grid; gap: var(--space-16); max-width: 1040px; }
.claude__lead { margin: 0; max-width: 60ch; color: var(--text-2); font-size: var(--text-lead); line-height: 1.5; text-wrap: pretty; }
.claude__status:has(sl-orb) i { display: none; }
.claude__status { display: inline-flex; align-items: center; gap: var(--space-2); margin-top: var(--space-5); color: var(--text-2); }
.claude__status i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.claude__status.is-live i { background: var(--ok); }
.section-title { margin: 0 0 var(--space-5); font: 500 var(--text-title)/1.15 var(--font-display); letter-spacing: var(--track-title); }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-4); }
.tool { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--surface); }
.tool__name { font: 400 var(--text-caption)/1 var(--font-mono); color: var(--text-3); }
.tool__title { font-weight: 500; font-size: var(--text-read); }
.tool p { margin: 0; color: var(--text-2); }
.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; }
.prompts { display: grid; }
.prompt { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.prompt p { flex: 1; margin: 0; font-size: var(--text-read); }
.quote { margin: 0; padding: var(--space-6); border-radius: var(--radius-lg); background: var(--surface); color: var(--text-2); line-height: 1.6; white-space: pre-wrap; }
.timeline { display: grid; }
.event { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.event__when { font: var(--text-caption)/1.75 var(--font-mono); color: var(--text-3); }
.event__what b { font-weight: 500; }
.event__thumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.event__thumbs img { width: 72px; height: 54px; border-radius: var(--radius-xs); object-fit: cover; object-position: top; cursor: pointer; }
.top { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-5); }
@media (max-width: 900px) { .event { grid-template-columns: 1fr; gap: var(--space-1); } }

/* ───────────── 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__row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.account__meter { height: 4px; margin: var(--space-3) 0 var(--space-2); border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.account__meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.account__token { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.account__token code { display: block; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--surface); font: var(--text-caption)/1.6 var(--font-mono); overflow-wrap: anywhere; user-select: all; }
.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; }
