/* ════════════════════════════════════════════════════════════════════════════
   gna.css — LA COUCHE DE COMPOSANTS DU FRONT DE GNÁ

   C'est le design system shadcn (jeu de jetons « neutral », en clair) porté en
   CSS nu : ni React, ni Tailwind, ni étape de build. Les gabarits sont des
   templates Go, ils écrivent des CLASSES, pas des utilitaires.

   TROIS RÈGLES QUI TIENNENT TOUT LE FICHIER :

   1. LES JETONS SONT RELEVÉS SUR LA RÉFÉRENCE DU CLIENT, pas inventés. Les
      valeurs du §1 ne se retouchent pas « pour voir » : elles se remesurent.
   2. CLAIR UNIQUEMENT. Il n'y a AUCUN bloc `prefers-color-scheme: dark` dans
      ce fichier, et il ne doit jamais y en avoir : le client l'a explicitement
      refusé. `color-scheme: light` au §2 force aussi les surfaces du navigateur
      (ascenseurs, contrôles natifs) à rester claires sur un poste en thème
      sombre — sans lui, les `<select>` du lundi matin seraient noirs.
   3. UNE VALEUR EN DUR DANS UN COMPOSANT EST UN BOGUE. Tout part de `:root`.

   Sommaire
     §1  jetons
     §2  socle et surfaces du navigateur
     §3  typographie
     §4  mise en page (coque, barre latérale, page)
     §5  boutons
     §6  champs de saisie (input, select, checkbox, switch, segmented)
     §7  pastilles
     §8  tableaux
     §9  arbre repliable (l'écran d'arbitrage)
     §10 cartes, séparateurs, avis, stats, infobulles, icônes
     §11 utilitaires
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Polices ──────────────────────────────────────────────────────────────────
   AUTO-HÉBERGÉES, en woff2 variable. Pas de Google Fonts, pas de CDN : Gná est
   un outil interne qui doit démarrer et s'afficher sans réseau sortant. Les
   deux fichiers sont embarqués dans le binaire (`//go:embed`, statique.go).
   Geist et Geist Mono — SIL OFL 1.1, voir polices/LICENCE-Geist.txt.          */

@font-face {
  font-family: "Geist";
  src: url("../polices/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../polices/geist-mono-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ══ §1 JETONS ══════════════════════════════════════════════════════════════ */

:root {
  /* Les couleurs, relevées telles quelles sur la référence. */
  --background: #ffffff;
  --foreground: #262626;
  --card: #ffffff;
  --card-foreground: #262626;
  --popover: #ffffff;
  --popover-foreground: #262626;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --secondary: #f5f5f5;
  --secondary-foreground: #262626;
  --muted: #f5f5f5;
  --muted-foreground: #737373;
  --accent: #f5f5f5;
  --accent-foreground: #262626;
  --destructive: #dc2626;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --ring: #a3a3a3;

  --sidebar: #fafafa;
  --sidebar-foreground: #262626;
  --sidebar-border: #e5e5e5;
  --sidebar-accent: #f5f5f5;
  --sidebar-primary: #171717;
  --sidebar-primary-foreground: #fafafa;

  --chart-1: #e76e50;
  --chart-2: #2a9d90;
  --chart-3: #274754;
  --chart-4: #e9c468;
  --chart-5: #f4a462;

  --radius: 0.625rem; /* 10px */
  --shadow: none;

  /* Dérivés d'échelle, exactement comme shadcn les dérive du rayon. */
  --radius-sm: calc(var(--radius) - 4px); /*  6px */
  --radius-md: calc(var(--radius) - 2px); /*  8px — boutons, champs */
  --radius-lg: var(--radius); /* 10px — cartes */
  --radius-xl: calc(var(--radius) + 4px); /* 14px */
  --radius-pilule: 26px;

  /* Deux couleurs de service DÉRIVÉES de la palette, jamais inventées.

     `--succes` n'existe pas dans le jeu shadcn : on la prend sur --chart-2,
     comme demandé. `--anneau-visible` est --ring poussé vers --foreground :
     --ring seul (#a3a3a3) donne 2,3:1 sur blanc, sous le 3:1 exigé d'un
     indicateur de focus. C'est le seul écart assumé avec la référence, et il
     est du côté de l'accessibilité. */
  --succes: var(--chart-2);
  --succes-doux: color-mix(in oklab, var(--chart-2) 12%, var(--background));
  --anneau-visible: color-mix(in oklab, var(--ring) 55%, var(--foreground));

  /* Métriques relevées sur la référence. */
  --h-controle: 32px; /* bouton, champ, cible tactile minimale */
  --h-controle-sm: 28px;
  --h-pastille: 20px;
  --h-entete-tableau: 40px;
  /* LA PREMIÈRE RANGÉE DE L'EN-TÊTE DE L'ARBRE, et elle vaut 45 et non 40 : elle porte le bouton
     de détail par magasin, un `btn-sm` de 28px dans 8px de marge intérieure. C'est un JETON parce
     que la seconde rangée s'y colle : tant que la valeur était devinée — `--h-entete-tableau` —,
     les deux rangées se chevauchaient de cinq pixels une fois l'en-tête épinglé, et le bas des
     cellules à cheval sur les deux tombait cinq pixels plus bas que celui des autres. Un décalage
     de bordure pile entre les colonnes réseau et le premier magasin (23 septembre 2026). */
  --h-entete-groupe: 45px;
  --pad-cellule: 8px;

  /* Deux largeurs de l'écran d'arbitrage. Elles sont ICI et pas dans le gabarit
     parce qu'elles décrivent des composants, pas une page : la colonne du pool
     doit tenir un crayon et trois chiffres, la bande de réglages doit tenir
     deux ou trois cartes de magasin. */
  --col-pool: 84px;
  /* LES QUATRE COLONNES QUI N'APPARTIENNENT À AUCUN MAGASIN : pool, besoin
     théorique, manquant et couverture du réseau. Elles précèdent les magasins et
     ne partent pas au défilement horizontal (`fixerLeReseau`, 18 novembre 2026) — ce sont celles qu'on lit avant de
     décider s'il vaut la peine d'ouvrir un produit. « Besoin th. » est la plus
     large des trois dernières : c'est son en-tête qui la mesure. */
  --col-reseau: var(--col-pool) 64px 64px 58px; /* pool, stock, besoin, manquant */
  /* La colonne d'offre d'un magasin : la pastille d'offre, et la consigne qui la
     suit. Mesurée sur la plus large — un reset en alerte, 53px — plus la pastille,
     l'écart, les deux marges et le filet du magasin. */
  --col-offre: 92px;

  /* La barre latérale, et ce qu'elle laisse voir de la grille : la fenêtre moins
     la barre, les deux marges de page et les deux filets du cadre. La bande de
     réglages s'y borne — sinon elle dépasse à droite d'un portable de 13 pouces,
     et sa quatrième carte devient invisible sans qu'on sache qu'elle existe. */
  --largeur-barre: 220px;
  --gouttiere-grille: calc(var(--largeur-barre) + 2 * var(--gouttiere) + 2px);

  /* LE CONTENEUR DE PAGE, LE MÊME PARTOUT (6 novembre 2026). Chaque écran avait sa largeur —
     1100, 1360, pleine — et son titre sautait d'une page à l'autre. Une seule largeur de
     contenu, une seule gouttière ; l'arbitrage seul va d'un bord à l'autre, et son décor garde
     la même gouttière que les autres. */
  --page-max: 1440px;
  --gouttiere: var(--esp-8);

  /* Typographie. Le corps est à 14px, la grille à 12px : c'est la référence. */
  --police: "Geist", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --texte-2xs: 10px;
  --texte-xs: 12px;
  --texte-sm: 13px;
  --texte: 14px;
  --texte-lg: 16px;
  --texte-xl: 18px;
  --texte-2xl: 22px;

  /* Espacements. Quatre pas suffisent ; un cinquième se discute. */
  --esp-1: 4px;
  --esp-2: 8px;
  --esp-3: 12px;
  --esp-4: 16px;
  --esp-6: 24px;
  --esp-8: 32px;

  --transition: 120ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══ §2 SOCLE ET SURFACES DU NAVIGATEUR ═════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Clair, et rien d'autre : ce jeton commande les contrôles natifs, la barre
     de défilement par défaut et le fond de la page avant la première peinture. */
  color-scheme: light;
  accent-color: var(--primary);
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--police);
  font-size: var(--texte);
  line-height: 1.5;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: color-mix(in oklab, var(--primary) 16%, transparent);
  color: var(--foreground);
}

:root {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--foreground) 22%, transparent) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--foreground) 20%, transparent);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in oklab, var(--foreground) 34%, transparent);
  background-clip: content-box;
}

/* L'ANNEAU DE FOCUS EST UNE RÈGLE GLOBALE, PAS UNE DÉCORATION PAR COMPOSANT.
   Écrit une fois ici, il ne peut pas manquer sur le composant qu'on aura
   oublié. Chaque composant le reprend tel quel ; aucun ne le retire. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.focus-anneau:focus-visible {
  outline: 3px solid var(--anneau-visible);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}

:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

img,
svg {
  display: block;
  max-width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--esp-4) 0;
}

/* Les chiffres s'alignent en colonne partout où ils se comparent : c'est tout
   l'écran d'arbitrage. */
table,
input,
.num,
.mono,
.stat-valeur,
.tree {
  font-variant-numeric: tabular-nums;
}

/* ══ §3 TYPOGRAPHIE ═════════════════════════════════════════════════════════ */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--foreground);
}

h1,
.t-titre {
  font-size: var(--texte-xl);
  line-height: 1.3;
}

h2,
.t-section {
  font-size: var(--texte-lg);
  line-height: 1.35;
}

/* UNE SECTION DE PAGE, LA MÊME PARTOUT : plus d'air au-dessus qu'en dessous, et la première
   colle à l'en-tête. Les marges étaient écrites en ligne, section par section. */
.t-section {
  margin: var(--esp-8) 0 var(--esp-3);
  font-weight: 600;
}

h2.t-section:first-of-type {
  margin-top: 0;
}

/* Ce qu'une section contient, en une phrase sous son titre. */
.section-desc {
  max-width: 88ch;
  margin: calc(-1 * var(--esp-1)) 0 var(--esp-3);
  font-size: var(--texte-xs);
  line-height: 1.5;
  color: var(--muted-foreground);
}

h3 {
  font-size: var(--texte);
}

p {
  margin: 0;
}

a {
  color: var(--foreground);
  text-decoration-color: color-mix(in oklab, var(--foreground) 35%, transparent);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: currentColor;
}

a.lien-sourd {
  color: var(--muted-foreground);
  text-decoration: none;
}

a.lien-sourd:hover {
  color: var(--foreground);
  text-decoration: underline;
}

.t-sourdine,
.muted {
  color: var(--muted-foreground);
}

.t-petit {
  font-size: var(--texte-xs);
}

.t-aide {
  font-size: var(--texte-xs);
  line-height: 1.45;
  color: var(--muted-foreground);
}

.mono {
  font-family: var(--police-mono);
  font-size: 0.92em;
  letter-spacing: -0.01em;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ══ §4 MISE EN PAGE ════════════════════════════════════════════════════════ */

/* .coque : barre latérale fixe + colonne de contenu. Sous 900px la barre passe
   au-dessus et se replie : le portable de 13 pouces dégrade la grille, il ne
   devient pas une seconde interface. */
.coque {
  display: grid;
  grid-template-columns: var(--largeur-barre) minmax(0, 1fr);
  min-height: 100%;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  border-right: 1px solid var(--sidebar-border);
  padding: var(--esp-3);
  display: flex;
  flex-direction: column;
  gap: var(--esp-4);
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  /* RIEN N'Y DÉFILE DE CÔTÉ. Une barre qui défile en hauteur défile aussi en largeur dès que
     quelque chose dépasse : l'infobulle de « mode test », invisible mais posée et centrée sur la
     pastille, débordait à droite et laissait sous la barre un défilement horizontal
     (5 novembre 2026). */
  overflow-x: hidden;
}

/* L'infobulle de la barre s'ouvre vers le bas et s'aligne sur le bord droit de sa pastille :
   centrée, elle sortait de la barre. */
.sidebar [data-infobulle]::after {
  top: calc(100% + 6px);
  bottom: auto;
  left: auto;
  right: 0;
  translate: none;
  max-width: 200px;
}

.sidebar-marque {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  height: var(--h-controle);
  padding: 0 var(--esp-2);
  font-size: var(--texte-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sidebar-groupe {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-titre {
  padding: 0 var(--esp-2);
  margin-bottom: var(--esp-1);
}

/* Les groupes suivants se détachent du précédent (Séance, Suivi, Configuration). */
.sidebar-lien + .sidebar-titre {
  margin-top: var(--esp-4);
}

.sidebar-titre {
  font-size: var(--texte-2xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.sidebar-lien {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  min-height: var(--h-controle);
  padding: 0 var(--esp-2);
  border-radius: var(--radius-md);
  font-size: var(--texte-xs);
  font-weight: 500;
  color: var(--sidebar-foreground);
  text-decoration: none;
  transition: background-color var(--transition);
}

.sidebar-lien .ic {
  color: var(--muted-foreground);
}

.sidebar-lien:hover {
  background: var(--sidebar-accent);
}

.sidebar-lien[aria-current],
.sidebar-lien.actif {
  background: var(--sidebar-primary);
  color: var(--sidebar-primary-foreground);
}

.sidebar-lien[aria-current] .ic,
.sidebar-lien.actif .ic {
  color: inherit;
}

.sidebar-pied {
  margin-top: auto;
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

/* La barre du haut : fil d'Ariane à gauche, actions à droite. */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--esp-3);
  height: 48px;
  padding: 0 var(--esp-4);
  border-bottom: 1px solid var(--border);
  background: var(--background);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--esp-2);
}

.page {
  padding: var(--esp-6) var(--gouttiere) var(--esp-8);
  max-width: calc(var(--page-max) + 2 * var(--gouttiere));
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1200px) {
  :root {
    --gouttiere: var(--esp-6);
  }
}

.page-pleine {
  max-width: none;
}

/* ── L'ÉCRAN PLEIN : UN SEUL DÉFILEMENT, ET SEUL L'EN-TÊTE RESTE ──────────────
   L'en-tête des colonnes était `sticky` depuis le premier jour et ne tenait
   jamais. La cause n'est pas dans l'en-tête : un élément qui défile
   HORIZONTALEMENT — il le faut, pour sept magasins — est un conteneur de
   défilement dans les DEUX axes, et CSS n'offre pas de sortie (`overflow-x:
   auto` force `overflow-y` à `auto`). Un `top: 0` s'y accrochait donc à un
   cadre qui, faute de hauteur bornée, ne défilait jamais verticalement : c'est
   la page qui bougeait, et l'en-tête partait avec elle.

   LA SORTIE EST DE N'AVOIR QU'UN SEUL DÉFILEMENT, celui de la page de contenu,
   et d'y mettre TOUT — le titre, le bandeau, la barre d'outils et la grille.
   L'en-tête s'accroche alors à ce défilement-là, et le décor s'en va librement
   au-dessus de lui. C'est la différence avec la première tentative, qui
   épinglait le décor avec l'en-tête : sur un écran plein, tout ce qu'on épingle
   est de la hauteur prise à la grille EN PERMANENCE, pour des lignes qu'on lit
   au début d'une séance et plus jamais.

   Le décor reste calé à GAUCHE, parce que ce défilement porte aussi les sept
   magasins en largeur : sans ça le bandeau partirait avec les colonnes.

   SOUS 900px, RIEN DE TOUT ÇA. La barre latérale passe au-dessus et mange de la
   hauteur ; sur une fenêtre étroite, une page qui défile normalement vaut mieux
   qu'une grille haute de six lignes. Le portable de 13 pouces est au-dessus du
   seuil, il garde l'en-tête. */
@media (min-width: 901px) {
  .ecran-plein .coque {
    height: 100dvh;
    overflow: hidden;
  }

  .ecran-plein .colonne {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .ecran-plein .topbar {
    flex: none;
  }

  /* LE seul conteneur de défilement de l'écran, dans les deux axes. Sans marge
     intérieure : elle appartient aux blocs de décor, qui sont les seuls à en
     vouloir — la grille, elle, va d'un bord à l'autre. */
  .ecran-plein .page-pleine {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: auto;
  }

  /* LE CADRE PERD SON DÉFILEMENT, PAS SON TRAIT.
     Il portait les deux ; le défilement est monté d'un cran. Il a d'abord été
     mis en `display: contents`, donc effacé — et la grille s'est retrouvée à nu :
     « il n'y a plus de border noir sur la table des produits ; c'est clean quand
     c'est fixé en haut, mais sinon ce n'est pas très beau », 21 septembre 2026.
     Le trait dit où la table commence et où elle finit, et une table qui finit
     sans rien a l'air coupée.

     `width: max-content` ET `min-width: 100%` : le cadre épouse la grille, pas
     la fenêtre. Sans lui il ferait la largeur visible et la grille dépasserait
     par la droite — le filet tomberait au milieu des colonnes. */
  /* LE FILET PASSE AU-DESSUS DES CELLULES, IL N'EST PLUS SOUS ELLES.
     `clip-path` découpe au bon endroit — il crée un contexte d'empilement, pas
     un scrollport, donc l'en-tête continue de tenir. Mais il découpe à la BOÎTE
     DE BORDURE, c'est-à-dire que l'arrondi qu'il taille passe PAR-DESSUS le
     trait au lieu de passer autour. Or une cellule d'en-tête commence un pixel
     plus haut et un pixel plus à gauche, coin carré et fond blanc opaque : entre
     l'arc du trait et la découpe, c'est le blanc de la cellule qui gagnait. D'où
     le trou signalé le 21 septembre 2026 — « il y a un trou dans le coin de la
     bordure de chaque côté » — et d'où l'inefficacité de la découpe seule, qui
     range les coins sans changer qui peint en dernier.

     `overflow: hidden` réglerait les deux d'un coup, parce qu'il rogne les
     ENFANTS à la boîte de remplissage, donc en dedans du trait. Il reste
     interdit : il ferait de ce cadre un conteneur de défilement et l'en-tête
     cesserait de tenir, ce qui est tout ce que cet écran a coûté.

     Le trait quitte donc l'élément et devient une surcouche — au-dessus de tout
     ce que la grille empile (4 au plus, `.th-tete`), transparente aux clics,
     découpée par le MÊME `clip-path` que les cellules. Les quatre coins sont
     exacts parce que c'est le même arrondi qui taille le trait et ce qu'il
     entoure. */
  /* LA GRILLE PREND LA GOUTTIÈRE DE LA PAGE (6 novembre 2026) : elle commençait contre la barre
     latérale, son coin arrondi collé au trait, quand le titre et les filtres au-dessus d'elle
     tenaient la gouttière. Un seul bord gauche pour tout l'écran. */
  .ecran-plein .tree-cadre {
    position: relative;
    overflow: visible;
    width: max-content;
    min-width: calc(100% - 2 * var(--gouttiere));
    margin-inline: var(--gouttiere);
    max-height: none;
    border: 0;
    border-radius: var(--radius-lg);
    clip-path: inset(0 round var(--radius-lg));
  }

  .ecran-plein .tree-cadre::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }

  .ecran-plein .ecran-tete,
  .ecran-plein .ecran-pied {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 100%;
    padding: var(--esp-6) var(--gouttiere) var(--esp-3);
    background: var(--background);
  }

  .ecran-plein .ecran-pied {
    padding: var(--esp-3) var(--gouttiere) var(--esp-6);
  }
}

/* ── L'ÉCRAN D'ENTRÉE ────────────────────────────────────────────────────────
   C'est la seule page du service qu'on voit avant d'être quelqu'un, et la seule
   qu'on regarde en entier : partout ailleurs, un acheteur cherche un chiffre.
   Elle est donc CENTRÉE dans la fenêtre plutôt que collée en haut — une carte de
   360px posée sous une barre de navigation absente a l'air d'un reste de page. */
.page-etroite {
  max-width: 380px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--esp-6);
  padding-block: var(--esp-8);
}

.marque {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

/* Le nom porte la seule licence typographique du service : plus gros que tout le
   reste, resserré. Geist tient l'approche négative sans se refermer. */
.marque-nom {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.marque-sous {
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.marque-pied {
  margin: 0;
  text-align: center;
  font-size: var(--texte-2xs);
  color: color-mix(in oklab, var(--muted-foreground) 75%, var(--background));
}

/* L'étiquette d'un champ et son recours sur la même ligne : « mot de passe » à
   gauche, « oublié ? » à droite. Sous le bouton, le lien se lisait comme une
   seconde action ; ici il se lit comme ce qu'il est. */
.field-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--esp-2);
}

/* LE FORMULAIRE D'ENTRÉE RESPIRE PLUS QUE LES AUTRES. `--esp-2` convient à une
   bande de réglages qu'on balaie ; ici il y a trois éléments et tout l'écran pour
   eux, et deux champs collés se lisent comme un seul. */
.page-etroite .card-corps .vstack {
  gap: var(--esp-4);
}

.page-etroite .field {
  gap: 6px;
}

.page-tete {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-4);
  flex-wrap: wrap;
  margin-bottom: var(--esp-6);
}

.page-tete .page-actions {
  margin-left: auto;
  display: flex;
  gap: var(--esp-2);
  align-items: center;
}

.page-desc {
  margin-top: var(--esp-1);
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
  max-width: 68ch;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  flex-wrap: wrap;
  margin-bottom: var(--esp-3);
}

.toolbar-fin {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--esp-2);
}

.vstack {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

.hstack {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  flex-wrap: wrap;
}

.hstack-serre {
  gap: var(--esp-1);
}

@media (max-width: 900px) {
  /* La barre passe au-dessus : la grille a toute la largeur, et la bande de
     réglages avec elle. */
  :root {
    --gouttiere: var(--esp-4);
    --gouttiere-grille: calc(2 * var(--gouttiere) + 2px);
  }

  .coque {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .sidebar-groupe {
    flex-direction: row;
    flex-wrap: wrap;
  }

  /* Le TITRE de groupe disparaît — il ne fait que nommer une liste qu'on voit —,
     mais PAS le pied : c'est lui qui porte le compte et la déconnexion. Les cacher
     laisserait quelqu'un sans aucun moyen de se déconnecter sur un portable, et
     « je n'arrive pas à sortir » ne ressemble pas à un défaut de mise en page. */
  .sidebar-titre {
    display: none;
  }

  .sidebar-pied {
    margin-left: auto;
    padding: 0;
    border-top: 0;
  }

  .page {
    padding: var(--esp-4) var(--gouttiere) var(--esp-8);
  }
}

/* ══ §5 BOUTONS ═════════════════════════════════════════════════════════════ */

/* Géométrie relevée sur la référence : 32px de haut, 12px/500, 0 10px de
   remplissage, rayon 8px, AUCUNE ombre.

   `.btn` seul est la variante « default » de shadcn : primaire plein. La
   référence, elle, emploie surtout `.btn-outline` — transparent, bordure
   --border — et c'est lui qui vaut au pixel près pour la mesure ci-dessus. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--h-controle);
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: inherit;
  font-size: var(--texte-xs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    opacity var(--transition);
}

.btn .ic {
  flex: none;
  color: currentColor;
}

.btn:hover {
  background: color-mix(in oklab, var(--primary) 88%, var(--background));
}

.btn:active {
  background: color-mix(in oklab, var(--primary) 78%, var(--background));
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: transparent;
}

.btn-secondary:hover {
  background: color-mix(in oklab, var(--secondary) 70%, var(--foreground) 6%);
}

.btn-secondary:active {
  background: color-mix(in oklab, var(--secondary) 60%, var(--foreground) 10%);
}

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-outline:active {
  background: color-mix(in oklab, var(--accent) 70%, var(--foreground) 8%);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--accent);
}

.btn-ghost:active {
  background: color-mix(in oklab, var(--accent) 70%, var(--foreground) 8%);
}

.btn-destructive {
  background: var(--destructive);
  color: #fff;
  border-color: transparent;
}

.btn-destructive:hover {
  background: color-mix(in oklab, var(--destructive) 88%, #000);
}

.btn-destructive:active {
  background: color-mix(in oklab, var(--destructive) 78%, #000);
}

.btn-destructive:focus-visible {
  outline-color: color-mix(in oklab, var(--destructive) 60%, var(--foreground));
}

/* Tailles. LE CORPS DE TEXTE NE CHANGE PAS avec la taille du bouton : seule la
   boîte rétrécit. Un libellé à 10px dans une barre d'outils se lit mal, et on
   ne gagne rien à le rétrécir puisque c'est la hauteur qui fait la densité.
   `.btn-icon` reste carré et garde la cible tactile de 32px. */
.btn-sm {
  height: var(--h-controle-sm);
  padding: 0 8px;
}

.btn-icon {
  width: var(--h-controle);
  height: var(--h-controle);
  padding: 0;
}

.btn-icon.btn-sm {
  width: var(--h-controle-sm);
  height: var(--h-controle-sm);
}

.btn-bloc {
  width: 100%;
}

/* `.btn-groupe` colle des boutons en un seul bloc (filtres, bascules d'affichage). */
.btn-groupe {
  display: inline-flex;
}

.btn-groupe .btn {
  border-radius: 0;
  margin-left: -1px;
}

.btn-groupe .btn:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  margin-left: 0;
}

.btn-groupe .btn:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.btn-groupe .btn:focus-visible {
  z-index: 1;
}

/* ══ §6 CHAMPS DE SAISIE ════════════════════════════════════════════════════ */

.label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--texte-xs);
  font-weight: 500;
  line-height: 1;
  color: var(--foreground);
}

.label-requis::after {
  content: "·";
  color: var(--destructive);
}

/* `.field` empile étiquette, champ et aide, et sert d'ancre aux états. */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* L'aide sous un champ. ELLE EST SOUS, PAS À CÔTÉ : à côté, elle se lit comme
   une unité posée entre deux commandes — « 17 init. » ne veut rien dire. */
.field-aide {
  margin: 0;
  font-size: var(--texte-2xs);
  line-height: 1.4;
  color: var(--muted-foreground);
}

/* Une grille de cartes qui revient à la ligne : les réglages d'un magasin, un
   compte, tout ce qui se lit carte par carte. `auto-fill` et pas `auto-fit` :
   à deux magasins, `auto-fit` étirerait deux cartes sur toute la largeur. */
.grille-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--esp-4);
  align-items: start;
}

.field-inline {
  flex-direction: row;
  align-items: center;
  gap: var(--esp-2);
}

.input,
.textarea {
  height: var(--h-controle);
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  font-family: inherit;
  font-size: var(--texte);
  line-height: 1.4;
  box-shadow: var(--shadow);
  caret-color: var(--foreground);
  transition:
    border-color var(--transition),
    background-color var(--transition);
}

.textarea {
  height: auto;
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
}

.input:hover:not(:disabled),
.textarea:hover:not(:disabled) {
  border-color: color-mix(in oklab, var(--input) 60%, var(--foreground) 18%);
}

.input:disabled,
.textarea:disabled {
  background: var(--muted);
  color: var(--muted-foreground);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--destructive);
}

.input[aria-invalid="true"]:focus-visible {
  outline-color: color-mix(in oklab, var(--destructive) 60%, var(--foreground));
}

.input-sm {
  height: var(--h-controle-sm);
  padding: 0 8px;
  font-size: var(--texte-xs);
}

/* Un champ de nombre : chiffres alignés, largeur juste, et pas de petites
   flèches natives — elles ne se cliquent pas dans une grille dense. */
.input-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 4.5rem;
  -moz-appearance: textfield;
  appearance: textfield;
}

.input-num::-webkit-outer-spin-button,
.input-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-mono {
  font-family: var(--police-mono);
}

/* Le champ de recherche porte son icône à gauche. */
.recherche {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.recherche .ic {
  position: absolute;
  left: 9px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.recherche .input {
  padding-left: 31px;
  min-width: 220px;
}

/* Le `<select>` : flèche DESSINÉE (svg en fond), pas un glyphe unicode.
   La flèche est le seul endroit du fichier où une couleur est écrite en dur —
   un `background-image` ne connaît pas `currentColor`. C'est --muted-foreground
   (#737373) encodé ; si le jeton bouge, cette ligne bouge avec lui. */
.select {
  height: var(--h-controle);
  width: 100%;
  padding: 0 30px 0 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background-color: var(--background);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6.5 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px 16px;
  color: var(--foreground);
  font-family: inherit;
  font-size: var(--texte);
  line-height: 1.4;
  appearance: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}

.select:hover:not(:disabled) {
  border-color: color-mix(in oklab, var(--input) 60%, var(--foreground) 18%);
}

.select:disabled {
  background-color: var(--muted);
  color: var(--muted-foreground);
  cursor: not-allowed;
}

.select-sm {
  height: var(--h-controle-sm);
  padding: 0 26px 0 8px;
  font-size: var(--texte-xs);
  background-position: right 6px center;
  background-size: 14px 14px;
}

.select-auto {
  width: auto;
}

/* La case à cocher. La coche est un SVG en fond, dans --primary-foreground
   encodé (#fafafa) : même raison que la flèche du select. */
.checkbox {
  appearance: none;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--input);
  border-radius: var(--radius-sm);
  background-color: var(--background);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition);
}

.checkbox:hover:not(:disabled) {
  border-color: color-mix(in oklab, var(--input) 50%, var(--foreground) 24%);
}

.checkbox:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fafafa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 4.5 6.5 11.5 3.5 8.5'/%3E%3C/svg%3E");
}

.checkbox:indeterminate {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fafafa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 8h8'/%3E%3C/svg%3E");
}

.checkbox:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* L'INTERRUPTEUR — c'est lui qui porte la mise à l'offre.
   Le pouce est un dégradé radial, pas un pseudo-élément : un `<input>` est un
   élément remplacé, et ses `::before`/`::after` ne sont pas garantis. Le
   dégradé, lui, s'anime (background-position) et ne dépend de rien. */
.switch {
  appearance: none;
  flex: none;
  width: 36px;
  height: 20px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background-color: var(--input);
  background-image: radial-gradient(circle 8px at center, var(--background) 98%, transparent 100%);
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: 0 center;
  cursor: pointer;
  transition:
    background-color var(--transition),
    background-position var(--transition);
}

.switch:hover:not(:disabled) {
  background-color: color-mix(in oklab, var(--input) 70%, var(--foreground) 12%);
}

.switch:checked {
  background-color: var(--primary);
  background-position: 16px center;
}

.switch:checked:hover:not(:disabled) {
  background-color: color-mix(in oklab, var(--primary) 88%, var(--background));
}

.switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* `.choix` porte une case ou un interrupteur AVEC son libellé, et garantit la
   cible tactile de 32px qu'une case de 16px n'a pas. */
.choix {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
  min-height: var(--h-controle);
  font-size: var(--texte-xs);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.choix:has(:disabled) {
  color: var(--muted-foreground);
  cursor: not-allowed;
}

.choix-aide {
  display: block;
  font-weight: 400;
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
}

/* Le contrôle segmenté : des radios déguisés. C'est ce qu'il faut pour une
   consigne — les trois modes se voient D'UN COUP, là où un `<select>` les
   cache et ne montre que celui qui est déjà choisi. */
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
}

.segmented-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: var(--texte-xs);
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--transition),
    color var(--transition);
}

.segmented-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.segmented-option:hover {
  color: var(--foreground);
}

.segmented-option:has(:checked) {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 0 7px;
}

.segmented-option:has(:focus-visible) {
  outline: 3px solid var(--anneau-visible);
  outline-offset: 1px;
}

.segmented-sm .segmented-option {
  height: 20px;
  font-size: var(--texte-2xs);
}

/* ══ §7 PASTILLES ═══════════════════════════════════════════════════════════ */

/* Géométrie relevée : 20px de haut, 10px/500, 2px 6px, pilule.
   `.badge` seul est la variante « default » de shadcn (primaire plein) ; les
   pastilles de la référence sont des `.badge.badge-outline`. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: var(--h-pastille);
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-pilule);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: var(--texte-2xs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.badge .ic {
  width: 10px;
  height: 10px;
}

.badge-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.badge-destructive {
  background: color-mix(in oklab, var(--destructive) 10%, var(--background));
  color: color-mix(in oklab, var(--destructive) 85%, var(--foreground));
  border-color: color-mix(in oklab, var(--destructive) 35%, var(--background));
}

.badge-succes {
  background: var(--succes-doux);
  color: color-mix(in oklab, var(--succes) 70%, var(--foreground));
  border-color: color-mix(in oklab, var(--succes) 40%, var(--background));
}

.badge-muet {
  background: transparent;
  color: var(--muted-foreground);
  border-color: var(--border);
}

/* LES TROIS UNIVERS. Sur une liste de 151 produits, une pastille grise à chaque
   ligne ne dit rien de plus que l'en-tête du groupe : c'est la COULEUR qui fait
   d'« Homme » un repère qu'on attrape du coin de l'œil.

   Les teintes viennent des jetons `--chart-*`, jamais inventées (règle 1 du §1),
   et le texte est la teinte POUSSÉE VERS `--foreground` : `--chart-4` (#e9c468)
   sur un fond presque blanc donne 1,7:1, c'est-à-dire illisible. Mélangé à 55 %
   de la couleur de texte, il garde sa teinte et passe le seuil. */
/* LA MENTION DU MODE TEST. `--chart-5` est la seule teinte de la palette qu'aucun univers
   n'occupe et qui ne dit pas « succès » : elle ne peut se confondre avec rien. Le texte est
   poussé vers `--foreground` pour tenir le contraste, comme celui des univers. */
.badge-test {
  margin-left: var(--esp-2);
  vertical-align: middle;
  background: color-mix(in oklab, var(--chart-5) 22%, var(--background));
  color: color-mix(in oklab, var(--chart-5) 35%, var(--foreground));
  border-color: color-mix(in oklab, var(--chart-5) 55%, var(--background));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-univers {
  background: color-mix(in oklab, var(--univers) 14%, var(--background));
  color: color-mix(in oklab, var(--univers) 45%, var(--foreground));
  border-color: color-mix(in oklab, var(--univers) 32%, var(--background));
}

.badge-univers-homme {
  --univers: var(--chart-3);
}

.badge-univers-femme {
  --univers: var(--chart-1);
}

.badge-univers-mixte {
  --univers: var(--chart-4);
}

/* Une pastille qui n'est qu'un point coloré, pour une colonne d'état. */
.point {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted-foreground);
  flex: none;
}

.point-succes {
  background: var(--succes);
}

.point-alerte {
  background: var(--destructive);
}

/* ══ §8 TABLEAUX ════════════════════════════════════════════════════════════ */

.table-cadre {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: auto;
  max-height: var(--table-hauteur, none);
}

/* Un long tableau borne sa hauteur, pour que son en-tête reste en haut au défilement (R234). */
.table-cadre-long {
  --table-hauteur: calc(100dvh - 230px);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--texte-xs);
  color: var(--card-foreground);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: var(--h-entete-tableau);
  padding: 0 var(--pad-cellule);
  text-align: left;
  font-size: var(--texte-xs);
  font-weight: 500;
  color: var(--foreground);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  height: 41px;
  padding: var(--pad-cellule);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: var(--muted);
}

.table th.num,
.table td.num {
  text-align: right;
}

.table td.tronque {
  max-width: 0;
}

.table-fixe {
  table-layout: fixed;
}

.table-compacte tbody td {
  height: 33px;
  padding: 4px var(--pad-cellule);
}

.table .ligne-selectionnee td {
  background: var(--accent);
}

/* Une colonne d'actions : discrète, mais JAMAIS INVISIBLE.
   Elle était en `opacity: 0` jusqu'au survol. Sur une liste de comptes où le
   geste principal est « désactiver », une action qu'il faut découvrir en
   promenant la souris est une action qu'on ne trouve pas — et la ligne du
   dessus ne dit pas qu'il y en a une. Elle reste donc en sourdine, et le survol
   la ramène au premier plan. */
/* LA CASE RESTE UNE CASE (13 novembre 2026). Elle était en `display: flex` : une
   cellule qui n'est plus `table-cell` sort de sa colonne, et ses boutons flottaient
   à droite du tableau — jusque hors de la carte, sur l'écran des données. Le
   rangement des gestes se fait DANS la case. */
.table .actions-ligne {
  text-align: right;
  white-space: nowrap;
  opacity: 0.55;
  transition: opacity var(--transition);
}

.table .actions-ligne > * {
  display: inline-flex;
  vertical-align: middle;
}

.table .actions-ligne > * + * {
  margin-left: var(--esp-1);
}

.table tr:hover .actions-ligne,
.table tr:focus-within .actions-ligne {
  opacity: 1;
}

/* ══ §9 ARBRE REPLIABLE ═════════════════════════════════════════════════════ */

/* L'ÉCRAN D'ARBITRAGE EST UNE MATRICE : les lignes sont une hiérarchie à quatre
   niveaux (produit › couleur › taille › sku), les colonnes sont les magasins.
   Les deux contraintes se contredisent dans un `<table>` — on ne peut pas
   replier une sous-arborescence de `<tr>` en CSS pur — et dans une liste de
   `<div>` imbriqués, où les colonnes ne s'alignent plus d'un niveau à l'autre.

   LA SORTIE EST `display: contents` : seules les CELLULES sont des éléments de
   la grille. Les emballages (`.node`, `.row`, `.node-body`) ne produisent aucune
   boîte, donc un sku au quatrième niveau tombe dans les mêmes colonnes que son
   produit. Replier, c'est rendre `.node-body` à `display: none`.

   L'ÉTAT EST UNE CASE À COCHER, pas du JavaScript. Le serveur rend `checked`
   quand il veut le nœud ouvert — c'est ce qui permet de rouvrir au bon endroit
   après un POST — et l'attribut `data-ouvert` fait la même chose pour un
   rendu entièrement piloté par le serveur. */

.tree-cadre {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: auto;
  max-height: var(--tree-hauteur, none);
}

.tree {
  display: grid;
  /* Une colonne de libellé, d'éventuelles colonnes fixes (le pool), puis un
     magasin par colonne. Le gabarit pose `style="--magasins: 4"`, et
     `--col-fixes: var(--col-reseau)` pour les trois colonnes réseau. */
  grid-template-columns:
    var(--col-tete, minmax(220px, 1.4fr))
    var(--col-fixes, )
    repeat(var(--magasins, 4), minmax(var(--col-magasin, 96px), var(--max-magasin, 1fr)));
  align-items: stretch;
  font-size: var(--texte-xs);
  min-width: max-content;
}

.tree-tete,
.node,
.row,
.node-body {
  display: contents;
}

.th,
.cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 41px;
  padding: var(--pad-cellule);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

/* L'EN-TÊTE TIENT EN DEUX RANGÉES, ET ELLES NE COLLENT PAS AU MÊME ENDROIT : le
   nom du magasin en haut, ses cinq mesures juste dessous. Avec `top: 0` pour les
   deux, la seconde remontait SUR la première au premier défilement — deux
   rangées superposées, illisibles. La seconde colle donc à la hauteur de la
   première, qui est `--h-entete-tableau` par construction : `.th` porte cette
   hauteur en minimum, et le nom d'un magasin tient sur une ligne (`nowrap`). */
.th {
  z-index: 3;
  min-height: var(--h-entete-tableau);
  font-size: var(--texte-xs);
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
}

/* TROIS ÉTAGES DE PEINTURE, ET ILS COMPTENT QUAND TOUT DÉFILE ENSEMBLE : les
   cellules au fond, la colonne de tête au-dessus d'elles, le décor de l'écran
   par-dessus, et l'en-tête des colonnes au-dessus de tout — c'est lui qui reste,
   donc c'est lui qui doit couvrir ce qui passe dessous.

   LES DÉCLARATIONS DE POSITION SONT PORTÉES PAR `.tree`, ET C'EST DÉLIBÉRÉ.
   `[data-infobulle]` pose `position: relative` — un sélecteur d'attribut, donc la
   même spécificité qu'une classe, et il est écrit plus bas dans ce fichier. Il
   décollait donc silencieusement toute cellule d'en-tête portant une infobulle :
   la colonne « Pool » en porte une, et elle était la seule à s'en aller au
   défilement pendant que ses voisines tenaient. Deux classes valent mieux qu'un
   ordre de déclaration qu'un déplacement de bloc casserait sans bruit. */
.tree .th {
  position: sticky;
  top: var(--h-entete-groupe);
}

/* La première rangée, et les deux cellules qui enjambent les deux. */
.tree .th-groupe,
.tree .th-span2 {
  top: 0;
}

/* LA HAUTEUR EST IMPOSÉE, PAS SUBIE, parce que la seconde rangée s'y colle. Laissée au contenu,
   elle a changé le jour où le bouton de détail est arrivé dans cet en-tête — 41px devenus 45 —
   sans que rien ne suive, et les deux rangées épinglées se sont mises à se chevaucher. */
.tree .th-groupe {
  height: var(--h-entete-groupe);
}

/* UN MAGASIN N'EST PAS UNE COLONNE, C'EST UN GROUPE DE MESURES — offre, stock, besoin,
   proposé, manquant, pénurie. Le gabarit pose donc `--magasins` au nombre de magasins
   MULTIPLIÉ par le nombre de mesures, et l'en-tête du groupe s'étend sur `--mesures`.
   `repeat()` n'accepte pas de `calc()`, la multiplication se fait donc en Go.

   ET LES PISTES SONT EN `auto`, PAS EN `1fr`. Avec `min-width: max-content` sur la grille,
   `1fr` égalise TOUTES les pistes sur la plus large : une colonne qui ne porte qu'un « 3 »
   finit à 272px et la grille à 5 800px. Mesuré, pas supposé. */
.tree-mesures {
  --max-magasin: auto;
}

/* L'en-tête d'un magasin enjambe SES colonnes : cinq par défaut, sept quand il a
   ouvert ses colonnes de lecture. `--mesures-mag` est posée par l'îlot sur cet
   en-tête-là ; sans JavaScript elle n'existe pas et `--mesures` s'applique. */
.th-groupe {
  grid-column: span var(--mesures-mag, var(--mesures, 6));
  justify-content: center;
  font-weight: 600;
  gap: var(--esp-2);
}

/* Le nom prend la place, l'interrupteur se pose au bord droit. Sans le `1 1 auto`
   le nom serait centré sur la moitié gauche et l'icône collerait au titre. */
.th-groupe-nom {
  flex: 1 1 auto;
  text-align: center;
  padding-left: 22px; /* la largeur de l'interrupteur, pour que le nom reste centré */
}

.th-detail {
  flex: none;
  color: var(--muted-foreground);
}

.th-detail[aria-pressed="true"] {
  background: var(--secondary);
  color: var(--foreground);
}

/* ── LES COLONNES DE LECTURE ─────────────────────────────────────────────────
   Masquées par défaut, et masquées par `display: none` — pas par une largeur
   nulle. Une piste de zéro pixel resterait une piste, et les pistes sont
   comptées par `--magasins` pour TOUTE la grille : il n'y a pas moyen d'en
   annuler une par magasin. L'îlot ajoute les pistes, le CSS montre les cases.

   SANS JAVASCRIPT, RIEN NE S'OUVRE ET LA GRILLE RESTE JUSTE : aucune piste n'est
   réservée, aucune cellule n'est visible. C'est la dégradation qu'on veut — les
   cinq colonnes qui décident sont toujours là. */
.th-plus,
.cell-plus {
  display: none;
}

/* SEIZE MAGASINS AU PLUS (18 novembre 2026, revue R246) : une règle par magasin, faute d'un
   sélecteur générique en CSS. Un dix-septième ouvrirait son détail sans montrer ses colonnes ; un
   test tient la limite (`TestLeDetailCouvreSeizeMagasins`). */
.tree[data-detail~="0"] .cell-mag-0,
.tree[data-detail~="1"] .cell-mag-1,
.tree[data-detail~="2"] .cell-mag-2,
.tree[data-detail~="3"] .cell-mag-3,
.tree[data-detail~="4"] .cell-mag-4,
.tree[data-detail~="5"] .cell-mag-5,
.tree[data-detail~="6"] .cell-mag-6,
.tree[data-detail~="7"] .cell-mag-7,
.tree[data-detail~="8"] .cell-mag-8,
.tree[data-detail~="9"] .cell-mag-9,
.tree[data-detail~="10"] .cell-mag-10,
.tree[data-detail~="11"] .cell-mag-11,
.tree[data-detail~="12"] .cell-mag-12,
.tree[data-detail~="13"] .cell-mag-13,
.tree[data-detail~="14"] .cell-mag-14,
.tree[data-detail~="15"] .cell-mag-15 {
  display: flex;
}

/* Un filet à gauche du bloc de lecture : il dit que ces deux colonnes sont
   d'une autre nature que les cinq qui décident. */
.cell-plus-debut {
  border-left: 1px dashed var(--border);
}

/* Les colonnes de lecture sont en retrait : elles expliquent, elles ne décident
   pas, et le regard doit continuer de tomber sur le manquant. */
.cell-plus {
  color: var(--muted-foreground);
}

.cell-plus .cell-chiffre {
  font-weight: 400;
}

/* La série des quatre semaines tient sur une ligne, en chasse fixe : on la lit
   comme une suite, pas comme quatre nombres. */
.series {
  font-family: var(--police-mono);
  font-size: var(--texte-2xs);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

/* Le point qui dit « comptage partiel » : des lignes de ce niveau sont relevées
   et d'autres pas. Ni « on sait », ni « on ne sait rien » — la troisième. */
.cell-partiel {
  color: var(--muted-foreground);
  font-weight: 600;
}

.th-groupe,
.th-groupe-debut,
.cell-groupe {
  border-left: 1px solid var(--border);
}

.th-span2 {
  grid-row: span 2;
}

/* La colonne d'offre porte une COMMANDE, pas un chiffre, et la CONDITION qui va avec : à
   l'offre, puis la consigne du magasin quand elle sort de l'ordinaire (8 octobre 2026).

   ELLE S'ALIGNE À GAUCHE, ET C'EST POUR LES INTERRUPTEURS. Centrés, ils se décalaient d'une
   ligne à l'autre selon la largeur de la pastille qui les suit ; à gauche, ils tombent tous à
   la même abscisse et la colonne se balaie d'un regard.

   ET SA LARGEUR EST RÉSERVÉE, PAS SUBIE. Les pistes sont en `auto` : laissée au contenu, la
   colonne s'élargirait au premier produit déplié qui porte une pastille, et toute la grille
   glisserait d'autant sous les yeux de l'acheteur. L'en-tête est toujours rendu, c'est lui
   qui la tient (`--col-offre`). */
.th-offre,
.cell-offre {
  justify-content: flex-start;
}

.th-offre {
  min-width: var(--col-offre);
}

/* ── La consigne d'un magasin ────────────────────────────────────────────────
   UNE PASTILLE À LA HAUTEUR DE L'INTERRUPTEUR, pour que les deux se lisent comme
   une seule phrase : « à l'offre, +60 % ». Son texte est celui du premier plan, pas
   de la sourdine : le résumé qu'elle remplace était gris sur blanc, et c'était la
   moitié de ce qui ne se lisait pas. Chiffres tabulaires : « +60 % » et « +40 % »
   s'alignent d'une ligne à l'autre. */
.consigne {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: var(--h-pastille);
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pilule);
  color: var(--foreground);
  font-size: var(--texte-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.consigne .ic {
  width: 10px;
  height: 10px;
}

/* LE STOP SE DISTINGUE PAR UN FOND, PAS PAR UNE COULEUR. Il arrête le réassort là où
   une variation le module, et il doit se repérer en balayant une colonne — mais c'est
   une décision, et le rouge est réservé à ce qui ne va pas. Le fond est mélangé au
   texte plutôt que pris à `--muted` : celui-ci est le fond d'une ligne survolée, et la
   pastille s'y fondrait. */
.consigne-stop {
  background: color-mix(in oklab, var(--foreground) 7%, var(--background));
}

/* L'HÉRITAGE SE LIT EN POINTILLÉ, et en sourdine — comme la valeur héritée dans la
   bande de réglages. La consigne vaut ici, mais elle a été posée au réseau. */
.consigne-heritee {
  border-style: dashed;
  color: var(--muted-foreground);
}

/* Hors offre, la consigne reste posée et ne joue pas : elle s'efface comme le reste
   de ce qui ne compte pas dans la demande. */
.consigne-hors-offre {
  color: color-mix(in oklab, var(--muted-foreground) 45%, var(--background));
  background: transparent;
}

/* Un reset sans seuil initial retombe sur la voie des ventes (invariant 9) : c'est la
   seule consigne qui signale un défaut, et la seule en rouge. */
.consigne-alerte {
  background: color-mix(in oklab, var(--destructive) 10%, var(--background));
  color: color-mix(in oklab, var(--destructive) 85%, var(--foreground));
  border-color: color-mix(in oklab, var(--destructive) 35%, var(--background));
}

/* La première colonne reste à l'écran quand on file vers le septième magasin.
   La position est sous `.tree` pour la même raison que celle de `.th`. */
.th-tete,
.cell-tete {
  z-index: 1;
  border-right: 1px solid var(--border);
}

.tree .th-tete,
.tree .cell-tete {
  position: sticky;
  left: 0;
}

.th-tete {
  z-index: 4;
}

/* LES QUATRE COLONNES RÉSEAU TIENNENT AUSSI (revue du 18 novembre 2026, R32). L'aide le
   promettait et seule la colonne Produit tenait : en filant vers Lille, pool, stock, besoin et
   manquant réseau passaient sous elle. Chaque rangée de la grille commence par sa cellule de tête
   puis ses quatre cellules réseau — produit, couleur, taille, version, bandes et total —, donc on
   les vise par leur rang parmi les cellules. Les décalages sont mesurés par gna.js
   (`fixerLeReseau`), qui pose `data-reseau-fixe` une fois qu'ils existent. */
.tree-mesures[data-reseau-fixe] .tree-tete > .th-reseau,
.tree-mesures[data-reseau-fixe] .row > .cell:nth-child(n+2 of .cell):nth-child(-n+5 of .cell) {
  position: sticky;
  z-index: 1;
}

.tree-mesures[data-reseau-fixe] .tree-tete > .th-reseau {
  z-index: 4;
}

/* La ligne Total colle en haut avec ses cellules à l'étage 2 : ses cellules réseau prennent
   l'étage de sa tête, sinon ses chiffres de magasins passent par-dessus au défilement. */
.tree-mesures[data-reseau-fixe] .row[data-niveau="total"] > .cell:nth-child(n+2 of .cell):nth-child(-n+5 of .cell) {
  z-index: 3;
}

.tree-mesures[data-reseau-fixe] .tree-tete > .th-reseau:nth-child(1 of .th-reseau),
.tree-mesures[data-reseau-fixe] .row > .cell:nth-child(2 of .cell) { left: var(--l-r1); }
.tree-mesures[data-reseau-fixe] .tree-tete > .th-reseau:nth-child(2 of .th-reseau),
.tree-mesures[data-reseau-fixe] .row > .cell:nth-child(3 of .cell) { left: var(--l-r2); }
.tree-mesures[data-reseau-fixe] .tree-tete > .th-reseau:nth-child(3 of .th-reseau),
.tree-mesures[data-reseau-fixe] .row > .cell:nth-child(4 of .cell) { left: var(--l-r3); }
.tree-mesures[data-reseau-fixe] .tree-tete > .th-reseau:nth-child(4 of .th-reseau),
.tree-mesures[data-reseau-fixe] .row > .cell:nth-child(5 of .cell) {
  left: var(--l-r4);
  border-right: 1px solid var(--border);
}

.row:hover .cell {
  background: var(--muted);
}

.row:focus-within .cell {
  background: var(--muted);
}

/* Le déplieur. Le chevron pointe à droite fermé, en bas ouvert : c'est la
   même icône, tournée — donc un seul symbole à dessiner et aucune bascule de
   balisage à écrire dans le gabarit. */
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: var(--radius-sm);
  color: var(--muted-foreground);
}

.toggle .ic {
  transition: transform var(--transition);
}

.cell-tete {
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}

.cell-tete.cell-fige {
  cursor: default;
}

/* LA CASE D'ÉTAT EST ÉPINGLÉE À LA FENÊTRE, PAS POSÉE DANS LA GRILLE (2 novembre 2026).
   Absolue, elle tombait en haut de la grille — `.node` est `display: contents`, elle n'a pas de
   ligne à elle —, et cliquer l'étiquette lui donne le focus : le navigateur faisait défiler la
   page JUSQU'À ELLE, c'est-à-dire tout en haut, à chaque dépliage. Mesuré sur la copie de DEV :
   1 800 pixels de défilement ramenés à 125. Fixe, elle est toujours dans la fenêtre, et le
   focus n'a plus rien à faire défiler — au clic comme au clavier. Même règle pour la case des
   couleurs dormantes des réglages. */
.node-state,
.rgm-dormantes-case {
  position: fixed;
  top: 50%;
  left: 0;
}

.node-state {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.node > .node-body {
  display: none;
}

.node:has(> .node-state:checked) > .node-body,
.node[data-ouvert] > .node-body {
  display: contents;
}

.node:has(> .node-state:checked) > .row .toggle .ic,
.node[data-ouvert] > .row .toggle .ic {
  transform: rotate(90deg);
}

.node > .node-state:focus-visible ~ .row .toggle {
  outline: 3px solid var(--anneau-visible);
  outline-offset: 1px;
}

/* Les quatre niveaux. L'indentation est portée par la cellule de tête, la
   graisse dit la profondeur, et le sku passe en chasse fixe : un code article
   se lit caractère par caractère, pas comme un mot. */
.row[data-niveau="produit"] .cell {
  font-weight: 500;
  border-top: 1px solid var(--border);
}

.row[data-niveau="produit"] .cell-tete {
  padding-left: var(--pad-cellule);
  font-size: var(--texte-sm);
  font-weight: 600;
}

.row[data-niveau="couleur"] .cell-tete {
  padding-left: 30px;
}

.row[data-niveau="taille"] .cell-tete {
  padding-left: 52px;
  font-weight: 400;
}

.row[data-niveau="sku"] .cell {
  color: var(--muted-foreground);
}

.row[data-niveau="sku"] .cell-tete {
  padding-left: 74px;
  font-family: var(--police-mono);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.row[data-niveau="sku"]:hover .cell {
  color: var(--foreground);
}

/* Quatre états de ligne, qui répondent tous à la même question : est-ce que
   l'acheteur peut quelque chose ici ? Une ligne hors offre, en stop ou DORMANTE
   s'efface — elle ne disparaît pas, elle cesse de réclamer l'attention.

   DORMANT EST LE PLUS LÉGER DES TROIS, à la demande de l'équipe achats : un
   produit que personne n'a mis à l'offre, une couleur sans stock nulle part et
   hors offre partout. Ce sont des lignes qu'on peut vouloir réveiller, pas des
   lignes mortes — la teinte les met en retrait, elle ne les barre pas. */
.row[data-etat="hors-offre"] .cell,
.row[data-etat="stop"] .cell {
  color: var(--muted-foreground);
  background: color-mix(in oklab, var(--muted) 45%, var(--card));
}

.row[data-etat="dormant"] .cell {
  color: var(--muted-foreground);
  background: color-mix(in oklab, var(--muted) 70%, var(--card));
}

/* LE SURVOL REPASSE DEVANT. Sans cette reprise, une ligne effacée perdait son
   retour au survol : les deux règles ont la même spécificité, et celle de l'état
   est écrite après. Pointer une ligne doit l'allumer, quel que soit son état —
   c'est ce qui dit qu'elle est encore cliquable. */
.row[data-etat="hors-offre"]:hover .cell,
.row[data-etat="stop"]:hover .cell,
.row[data-etat="dormant"]:hover .cell,
.row[data-etat="hors-offre"]:focus-within .cell,
.row[data-etat="stop"]:focus-within .cell,
.row[data-etat="dormant"]:focus-within .cell {
  background: var(--muted);
}

/* Une ligne de tableau fermée s'efface, comme une ligne d'arbre hors offre :
   elle ne disparaît pas — son historique reste à consulter — elle cesse de
   réclamer l'attention. */
.table tbody tr[data-etat="ferme"] td {
  color: var(--muted-foreground);
  background: color-mix(in oklab, var(--muted) 45%, var(--card));
}

.row[data-etat="manque"] .cell-tete {
  box-shadow: inset 3px 0 0 var(--destructive);
}

/* UNE LIGNE OÙ UNE RÉPARTITION PEUT ENCORE QUELQUE CHOSE porte l'ambre de l'arbitrable, pas le
   rouge du manquant : c'est là qu'on travaille le lundi (2 novembre 2026). */
.row[data-etat="arbitrable"] .cell-tete {
  box-shadow: inset 3px 0 0 var(--c-attention);
}

/* LES COULEURS À L'OFFRE NULLE PART SONT MASQUÉES tant que le jeton « Couleurs hors offre »
   n'est pas allumé ; la note qui le dit s'efface quand il l'est. */
.tree:not([data-hors-offre]) .node-hors-offre,
.tree[data-hors-offre] .row-note-hors-offre {
  display: none;
}

/* La note occupe toute la ligne : elle n'a pas de chiffres à aligner. */
.row-note-hors-offre .cell-note {
  grid-column: 1 / -1;
  padding-left: 40px;
  font-size: var(--texte-2xs);
  font-weight: 400;
  color: var(--muted-foreground);
  font-style: italic;
}

/* Le rang de service d'un magasin : un chiffre, pas une pastille. Il se lit en
   colonne, du haut vers le bas, et une pastille par ligne ferait un chapelet. */
/* L'écran des données : le récapitulatif d'un job, borné.
   Trois lignes suffisent à reconnaître ce qui s'est passé ; le texte entier
   reste dans l'attribut `title`. Sans borne, la colonne du récapitulatif — quinze
   lignes sur la séance de calcul — écrase les cinq colonnes de chiffres. */
.recap {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  max-width: 44ch;
  overflow: hidden;
}

.rang {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted-foreground);
}

/* ── La colonne du pool ───────────────────────────────────────────────────────
   Elle porte un chiffre à tous les niveaux, et AU NIVEAU COULEUR elle porte en
   plus le déplieur des réglages. Le crayon ne peut pas aller dans la cellule de
   tête : celle-ci est un `<label for>` qui commande le repli, et un second label
   à l'intérieur serait une imbrication invalide que le navigateur ignorerait.
   D'où la commande à gauche, le chiffre à droite, dans la même case. */
.cell-pool {
  justify-content: space-between;
  gap: var(--esp-1);
}

/* ── Les bandes qui traversent la grille ──────────────────────────────────────
   L'en-tête d'un univers et les réglages d'une couleur occupent la LIGNE
   ENTIÈRE — sept magasins à cinq mesures plus trois colonnes réseau, soit près
   de deux mille pixels. Leur
   contenu est donc ancré au bord gauche visible : sans ça il partait hors de
   l'écran dès le premier défilement horizontal, comme l'a fait la bande de
   réglages jusqu'au 20 septembre 2026.

   ET SURTOUT : AUCUN `overflow` ICI. Un `overflow: hidden` sur la cellule ferait
   d'elle le conteneur de défilement le plus proche, et l'ancrage n'aurait plus
   rien à quoi s'accrocher — le titre repartait vers la gauche exactement comme
   sans ancrage, ce qui ressemblait à un ancrage qui « ne marche pas ». */
.cell-bande {
  padding: 0;
}

.ancre-gauche {
  position: sticky;
  left: 0;
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  padding: 0 var(--pad-cellule);
}

/* La bande de réglages se pose sur un fond, pour que les cartes des magasins
   s'en détachent : quatre cartes blanches sur du blanc feraient quatre cadres
   flottants au milieu de la grille. */
.row[data-niveau="reglages"] .cell {
  background: var(--secondary);
}

/* L'en-tête d'univers. Il SÉPARE, il ne titre pas : la pastille dit lequel, le
   compte dit combien, et le trait du dessus fait le reste. */
.row[data-niveau="univers"] .cell {
  min-height: 34px;
  background: var(--secondary);
  border-top: 1px solid var(--border);
}

.row[data-niveau="univers"]:hover .cell {
  background: var(--secondary);
}

/* SES SOMMES SONT EN SOURDINE (13 novembre 2026). Ce sont des sous-totaux : ils se
   consultent, ils ne se travaillent pas. En gris, l'œil glisse dessus pour aller aux
   lignes produit, et la ligne Total garde seule le noir appuyé.

   GRIS ET ITALIQUE, PAS GRIS SEUL : une ligne produit dormante est déjà grise sur fond
   gris, et la bande s'y confondait. L'italique est la marque du sous-total, et aucune
   autre ligne de la grille ne la porte. Les chiffres restent tabulaires, donc alignés.
   Le rouge du manquant reste — il s'éteint d'un cran, il ne disparaît pas. */
.row[data-niveau="univers"] .cell {
  color: var(--muted-foreground);
}

.row[data-niveau="univers"] .cell.num,
.row[data-niveau="univers"] .cell-offre {
  font-style: italic;
}

.row[data-niveau="univers"] .cell-chiffre-manque {
  color: color-mix(in oklab, var(--destructive) 70%, var(--muted-foreground));
}

/* ── La ligne Total ───────────────────────────────────────────────────────────
   ÉPINGLÉE SOUS L'EN-TÊTE : on file jusqu'au dernier produit d'un magasin sans
   perdre sa somme. Elle colle juste sous les deux rangées d'en-tête, au-dessous
   d'elles dans l'empilement, et sa cellule de tête colle aussi à gauche, au-dessus
   des autres cellules de la ligne qui défilent dessous.

   Les déclarations de position sont sous `.tree` pour la raison donnée plus haut :
   `[data-infobulle]` pose `position: relative`, et les cellules réseau en portent
   une. */
.tree .row[data-niveau="total"] .cell {
  position: sticky;
  top: calc(var(--h-entete-groupe) + var(--h-entete-tableau));
  z-index: 2;
  min-height: 36px;
  font-weight: 600;
  color: var(--foreground);
  background: color-mix(in oklab, var(--secondary) 88%, var(--foreground));
  border-bottom: 1px solid color-mix(in oklab, var(--border) 55%, var(--foreground));
}

.tree .row[data-niveau="total"] .cell-tete {
  left: 0;
  z-index: 3;
}

.row[data-niveau="total"] .total-libelle {
  font-size: var(--texte-sm);
  font-weight: 600;
}

.row[data-niveau="total"] .t-aide {
  font-weight: 400;
}

/* Collée sous l'en-tête, son infobulle s'ouvre vers le bas, comme celles de l'en-tête :
   vers le haut, elle passerait sous lui. */
.row[data-niveau="total"] [data-infobulle]::after {
  bottom: auto;
  top: calc(100% + 6px);
}

/* ── La bande de réglages d'une ref. co. ──────────────────────────────────────
   Consigne et seuil initial sont des réglages de SEMAINE, pas des gestes du
   lundi (§6). Ils tenaient sur UNE ligne de deux mille pixels, magasin après
   magasin, libellés mêlés aux champs — « 50 17 init. couv. 24,8 ». Une carte
   par magasin, bornée en largeur et ancrée à gauche : ce sont exactement les
   mêmes commandes, à une largeur où elles se lisent. */
/* L'OFFRE D'UN MAGASIN, EN LECTURE. Pleine : à l'offre. Vide : hors offre. Elle ne
   se règle plus dans l'arbitrage (29 octobre 2026), donc elle ne ressemble plus à
   une commande. */
.offre-etat {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--muted-foreground);
}

/* VERTE, COMME DANS LES RÉGLAGES (2 novembre 2026) : la même pastille dit la même chose sur
   les deux écrans, et le vert est le code de l'offre partout. */
.offre-etat[data-offre="oui"] {
  background: var(--c-offre);
  border-color: var(--c-offre);
}

/* Le compte des couleurs à l'offre, sur les lignes produit, univers et Total : la
   pastille et le vert de l'offre, pour qu'il ne se lise pas comme une quantité à
   côté du besoin. Zéro : pastille creuse, en sourdine. */
.offre-compte {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--texte-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: color-mix(in oklab, var(--c-offre) 78%, var(--foreground));
}

.offre-compte .offre-etat {
  width: 7px;
  height: 7px;
}

.offre-compte[data-vide] {
  font-weight: 500;
  color: var(--muted-foreground);
}

.offre-compte[data-vide] .offre-etat {
  border-color: color-mix(in oklab, var(--muted-foreground) 60%, var(--background));
}

.th-offre {
  color: color-mix(in oklab, var(--c-offre) 70%, var(--muted-foreground));
}

/* ══ L'EN-TÊTE DE L'ARBITRAGE ═════════════════════════════════════════════════
   Refait le 2 novembre 2026 : trois étages, une fonction chacun. Le titre et les
   gestes ; la carte de la séance ; les filtres. Les couleurs reprennent le code
   des réglages — vert l'offre et ce qui part, rouge ce qui manque, ambre ce qu'on
   peut encore déplacer — et ne servent à rien d'autre. */

.arb-tete {
  align-items: center;
  margin-bottom: var(--esp-3);
}

.arb-titre {
  display: flex;
  flex-direction: column;
  gap: var(--esp-1);
  min-width: 0;
}

/* L'état de la séance : un point, une phrase. */
.arb-etat {
  --c: var(--succes);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 6px;
  width: fit-content;
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.arb-etat strong {
  font-weight: 600;
  color: var(--foreground);
}

.arb-etat[data-etat="perime"] {
  --c: var(--c-attention);
}

.arb-etat[data-etat="perime"] strong:first-of-type {
  color: var(--c-attention);
}

.arb-etat[data-etat="aucun"] {
  --c: var(--muted-foreground);
}

.arb-etat-point {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c) 18%, transparent);
}

.arb-tete .page-actions form {
  display: contents;
}

.arb-actions-trait {
  width: 1px;
  height: 20px;
  margin: 0 var(--esp-1);
  background: var(--border);
}

/* ── La carte de la séance ─────────────────────────────────────────────────────
   Deux colonnes et un pied : les chiffres, ce qui part par magasin, les sources.
   Sous 900 pixels, les colonnes s'empilent. */
.seance {
  display: grid;
  grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr);
  margin-bottom: var(--esp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.seance-chiffres,
.seance-magasins {
  display: flex;
  flex-direction: column;
  gap: var(--esp-3);
  padding: var(--esp-4);
  min-width: 0;
}

.seance-magasins {
  border-left: 1px solid var(--border);
}

.seance-etiquette {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  white-space: nowrap;
  gap: var(--esp-2);
  font-size: var(--texte-2xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.seance-etiquette .t-aide {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.seance-kpis {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--esp-3) var(--esp-6);
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-valeur {
  font-size: var(--texte-2xl);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi-libelle {
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
  white-space: nowrap;
}

.kpi-alerte .kpi-valeur {
  color: var(--c-alerte);
}

/* Le total se lit APRÈS les deux autres : il est l'échelle de la barre, pas un résultat. */
.kpi-muet {
  margin-left: auto;
  text-align: right;
}

.kpi-muet .kpi-valeur {
  font-size: var(--texte-lg);
  font-weight: 500;
  color: var(--muted-foreground);
}

/* LA BARRE DU BESOIN : trois segments qui la remplissent exactement. Ce qui part
   en vert, ce qu'on peut encore déplacer en ambre, ce qu'il faut acheter en rouge
   pâle — rouge parce que c'est du manquant, pâle parce qu'aucun geste de l'écran
   n'y peut rien. */
.jauge {
  display: flex;
  gap: 2px;
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pilule);
  background: var(--muted);
}

.jauge > span {
  flex: none;
  min-width: 0;
}

.jauge-alloue {
  background: var(--c-offre);
}

.jauge-arbitrable {
  background: var(--c-attention);
}

.jauge-structurel {
  background: color-mix(in oklab, var(--c-alerte) 45%, var(--background));
}

.jauge-legende {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-1) var(--esp-4);
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.jauge-legende > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.jauge-legende strong {
  font-weight: 600;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.jauge-point {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* ── Ce qui part, par magasin ─────────────────────────────────────────────────
   Une tuile par magasin : le nom court, les PIÈCES en chiffres pleins, les colis
   en sourdine derrière un « ≈ » parce que l'estimation n'est pas un compte, et
   une barre à l'échelle du magasin le mieux servi. AUCUNE COULEUR D'ALERTE : le
   plafond de colis est une règle de découpage, pas une limite franchie. */
.seance-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--esp-3) var(--esp-4);
}

.charge {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.charge-magasin {
  overflow: hidden;
  font-size: var(--texte-xs);
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.charge-chiffres {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.charge-pieces {
  font-size: var(--texte-lg);
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.charge-colis {
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.charge-vide .charge-colis {
  font-size: var(--texte-lg);
  line-height: 1.2;
}

.charge-barre {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius-pilule);
  background: var(--muted);
}

.charge-barre > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in oklab, var(--c-offre) 75%, var(--foreground));
}

/* ── Les sources ──────────────────────────────────────────────────────────────
   Le pied de la carte. Un point par source, et sa couleur dit le dernier passage :
   vert réussi, rouge échoué, bleu qui bat en cours, gris jamais. */
.seance-sources {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--esp-2) var(--esp-6);
  padding: var(--esp-2) var(--esp-4);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: color-mix(in oklab, var(--muted) 55%, var(--card));
}

a.seance-etiquette {
  text-decoration: none;
}

a.seance-etiquette:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source {
  --c: var(--succes);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--texte-xs);
  white-space: nowrap;
}

.source[data-etat="echec"] {
  --c: var(--c-alerte);
}

.source[data-etat="cours"] {
  --c: var(--c-variation);
}

.source[data-etat="retard"] {
  --c: var(--c-attention);
}

.source[data-etat="retard"] .source-heure {
  color: var(--c-attention);
  font-weight: 500;
}

.source[data-etat="jamais"] {
  --c: color-mix(in oklab, var(--muted-foreground) 60%, var(--background));
}

.source-point {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
}

.source[data-etat="cours"] .source-point {
  animation: source-bat 1.2s ease-in-out infinite;
}

@keyframes source-bat {
  50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
  .source[data-etat="cours"] .source-point {
    animation: none;
  }
}

.source-nom {
  font-weight: 500;
  color: var(--foreground);
}

.source-heure {
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.source[data-etat="echec"] .source-nom,
.source[data-etat="echec"] .source-heure {
  color: var(--c-alerte);
  font-weight: 500;
}

@media (max-width: 900px) {
  .seance {
    grid-template-columns: 1fr;
  }

  .seance-magasins {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

/* ── Les filtres ──────────────────────────────────────────────────────────────── */
.arb-filtres {
  margin-bottom: var(--esp-3);
}

.filtres-groupe {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--esp-2);
}

/* ── L'ÉCRAN DU RÉSEAU ────────────────────────────────────────────────────────
   Refait le 2 novembre 2026 dans la langue de l'écran des magasins et de l'en-tête
   de l'arbitrage : une carte du réseau en trois blocs, puis un magasin par ligne.
   Les blocs du tableau se séparent par un filet posé par CLASSE (`.rs-debut`) —
   jamais par numéro de colonne, qui a dérivé le jour où une colonne est partie. */
.rs-carte {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 5fr);
  margin-bottom: var(--esp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.rs-bloc {
  display: flex;
  flex-direction: column;
  gap: var(--esp-3);
  min-width: 0;
  padding: var(--esp-4);
}

.rs-bloc + .rs-bloc {
  border-left: 1px solid var(--border);
}

.rs-bloc-pied {
  margin: auto 0 0;
}

.rs-rythme {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--esp-4);
}

.rs-graphe {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.rs-graphe .barres {
  margin: 0;
}

.rs-graphe-legende {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.rs-graphe-legende strong {
  display: block;
  font-size: var(--texte-xs);
  font-weight: 600;
  color: var(--muted-foreground);
}

.rs-graphe-derniere strong {
  color: var(--foreground);
}

@media (max-width: 1000px) {
  .rs-carte {
    grid-template-columns: 1fr;
  }

  .rs-bloc + .rs-bloc {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

.table-reseau td,
.table-reseau th {
  white-space: nowrap;
}

.table-reseau .rs-debut {
  border-left: 1px solid var(--border);
}

/* Le nom ne se replie pas : un tableau de comparaison dont les lignes n'ont plus la
   même hauteur ne se compare plus. Le code passe dessous, comme sur les magasins. */
.table-reseau tbody th.rs-magasin {
  padding: var(--pad-cellule);
  font-weight: 400;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table-reseau tbody tr:last-child th.rs-magasin {
  border-bottom: 0;
}

.rs-nom {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
}

.rs-nom strong {
  font-weight: 600;
}

.rs-nom .t-aide {
  font-size: var(--texte-2xs);
}

.table-reseau .th-serie {
  width: 1%;
}

.rs-service {
  min-width: 120px;
}

.rs-service .jauge {
  height: 6px;
}

/* LES QUATRE SEMAINES, EN SVG RENDU PAR LE SERVEUR. Une encre, pas une couleur de
   graphique : les `--chart-*` portent les univers (`--chart-3` est Homme), et les
   réemployer donnerait une seconde signification à une couleur qui en a une. Les
   trois semaines d'avant en sourdine, la dernière à l'encre pleine — c'est elle
   qu'on compare au rythme. */
.barres {
  display: inline-block;
  vertical-align: middle;
  fill: color-mix(in oklab, var(--foreground) 22%, var(--background));
}

.barres .barres-derniere {
  fill: var(--foreground);
}

/* LE SOCLE SE VOIT TOUJOURS, barres nulles comprises : quatre barres absentes sur
   du blanc se lisent « le graphique n'a pas chargé », un trait de base se lit
   « zéro ». */
.barres-socle {
  stroke: var(--border);
  stroke-width: 1;
}

.reseau-provenance {
  max-width: 100ch;
  margin-top: var(--esp-3);
}

/* ── LA BARRE DE FILTRES ──────────────────────────────────────────────────────
   Un seul formulaire en GET : l'adresse EST l'état, donc elle se met en favori,
   se colle dans un message et revient telle quelle après une saisie. */
.filtres {
  row-gap: var(--esp-2);
}

.filtres-trait {
  width: 1px;
  height: 18px;
  margin: 0 var(--esp-1);
  background: var(--border);
}

/* Le compte et l'effacement se replient ENSEMBLE : séparés, le compte poussait
   « Effacer » seul sur une deuxième ligne dès 1 100 pixels. */
.filtres-fin {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
  margin-left: auto;
  white-space: nowrap;
}

/* LE JETON : UN INTERRUPTEUR QUI SE LIT COMME UNE ÉTIQUETTE. Le système avait un
   contrôle segmenté — des radios, donc un choix EXCLUSIF — et des pastilles, qui
   ne se cliquent pas. Un filtre est ni l'un ni l'autre : plusieurs jetons tiennent
   ensemble, et chacun s'allume seul. Il reprend la géométrie et les états de
   `.segmented-option` pour que les deux se ressemblent là où ils se croisent. */
.jeton {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: var(--h-controle-sm);
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pilule);
  background: var(--background);
  font-size: var(--texte-xs);
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--transition),
    color var(--transition),
    border-color var(--transition);
}

/* La case est RETIRÉE DE L'ŒIL, PAS DU DOCUMENT : elle reste focalisable au
   clavier et c'est elle qui porte l'état. Même technique que `.segmented-option`. */
.jeton input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.jeton:hover {
  color: var(--foreground);
  border-color: var(--ring);
}

/* ALLUMÉ, IL S'INVERSE. Un jeton coché doit se distinguer d'un jeton survolé sans
   qu'on ait à comparer : le fond plein le fait à 16:1, là où un simple
   changement de bordure demande de regarder les deux. */
.jeton:has(:checked) {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.jeton:has(:focus-visible) {
  outline: 3px solid var(--anneau-visible);
  outline-offset: 2px;
}

/* LE JETON TEINTÉ (2 novembre 2026) porte la couleur de ce qu'il retient : un point
   creux éteint, plein et sur un fond teinté allumé — plus doux que l'inversion noire,
   et c'est la couleur, pas le contraste, qui dit lequel est allumé. L'univers donne
   la sienne par sa classe de pastille (`--univers`) ; les autres par `data-teinte`. */
.jeton-teinte {
  --c: var(--foreground);
}

.jeton-teinte.badge-univers {
  --c: var(--univers);
}

.jeton-teinte[data-teinte="alerte"] {
  --c: var(--c-alerte);
}

.jeton-teinte[data-teinte="offre"] {
  --c: var(--c-offre);
}

.jeton-teinte[data-teinte="arbitrable"] {
  --c: var(--c-attention);
}

.jeton-point {
  flex: none;
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in oklab, var(--c) 60%, var(--background));
}

.jeton-teinte:has(:checked) {
  background: color-mix(in oklab, var(--c) 10%, var(--background));
  border-color: color-mix(in oklab, var(--c) 45%, var(--background));
  color: color-mix(in oklab, var(--c) 80%, var(--foreground));
}

.jeton-teinte:has(:checked) .jeton-point {
  background: var(--c);
  border-color: var(--c);
}

.champ {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

/* Une étiquette au-dessus de sa commande, pas à côté : à côté, elle se lisait
   comme une unité posée entre deux champs — « 17 init. » ne veut rien dire. */
.champ-etiquette {
  font-size: var(--texte-2xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.champ-ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-2);
  cursor: pointer;
}

/* Le suffixe d'unité est DANS le champ, posé sur son bord intérieur : dehors, il
   flottait entre deux commandes sans dire à laquelle il appartenait. */
.champ-suffixe {
  position: relative;
  display: inline-flex;
}

.champ-suffixe .input {
  padding-right: 20px;
}

.champ-suffixe::after {
  content: attr(data-suffixe);
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
  pointer-events: none;
}

.champ-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--esp-1);
  margin: 0;
}

/* Le contrôle segmenté prend toute la largeur de sa carte et répartit ses
   options : quatre consignes de largeurs différentes feraient quatre colonnes
   qui ne s'alignent pas d'une carte à l'autre. */
.segmented-bloc {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
}

.segmented-bloc .segmented-option {
  justify-content: center;
  min-width: 0;
  padding: 0 4px;
}

.segmented-bloc .segmented-option:has(:checked) {
  padding: 0 3px;
}

/* La valeur d'une cellule, et son commentaire dessous. */
.cell-valeur {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
  min-width: 0;
}

.cell-chiffre {
  font-size: var(--texte-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.cell-chiffre-manque {
  color: var(--destructive);
}

/* L'ARBITRABLE EN AMBRE, la couleur de la jauge de l'en-tête : l'entrepôt a les pièces. Seul,
   c'est le chiffre qui change de couleur ; mêlé à un manquant qu'il faut acheter, il passe
   devant en pastille. */
.cell-chiffre-arbitrable {
  color: var(--c-attention);
  font-weight: 600;
}

.cell-arb {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 16px;
  margin-right: 4px;
  padding: 0 4px;
  border-radius: var(--radius-pilule);
  background: color-mix(in oklab, var(--c-attention) 14%, var(--background));
  color: color-mix(in oklab, var(--c-attention) 85%, var(--foreground));
  font-size: var(--texte-2xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cell-detail {
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.cell-vide {
  color: color-mix(in oklab, var(--muted-foreground) 45%, var(--background));
}

.th.num,
.cell.num {
  justify-content: flex-end;
  text-align: right;
}

/* Une valeur empilée dans une colonne de nombres s'aligne à droite elle aussi :
   sinon la même colonne a deux bords, et l'œil ne peut plus comparer. */
.cell.num .cell-valeur {
  align-items: flex-end;
  text-align: right;
}

/* Les saisies d'une cellule. `.cell-actions` reste en place ; `.au-survol` ne
   se montre qu'au survol ou au focus, pour les commandes secondaires. */
.cell-actions {
  display: flex;
  align-items: center;
  gap: var(--esp-1);
  margin-left: auto;
}

.au-survol {
  opacity: 0;
  transition: opacity var(--transition);
}

.row:hover .au-survol,
.row:focus-within .au-survol {
  opacity: 1;
}

/* ══ §10 CARTES, SÉPARATEURS, AVIS, STATS, INFOBULLES, ICÔNES ═══════════════ */

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--card-foreground);
}

/* LES SURFACES DE CONTENU N'ONT PAS D'OMBRE, comme les cadres de tableau et les cartes de la
   page des magasins : un trait et un fond suffisent à dire où un bloc commence. L'ombre reste
   aux couches qui flottent — panneaux, survols — et à la carte seule de l'écran d'entrée. */
.page-etroite .card {
  box-shadow: var(--shadow);
}

.card-tete {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-3);
  padding: var(--esp-4);
  border-bottom: 1px solid var(--border);
}

.card-tete .card-actions {
  margin-left: auto;
  display: flex;
  gap: var(--esp-2);
}

.card-titre {
  font-size: var(--texte);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-desc {
  margin-top: 2px;
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.card-corps {
  padding: var(--esp-4);
}

.card-corps-nu {
  padding: 0;
}

.card-pied {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  padding: var(--esp-3) var(--esp-4);
  border-top: 1px solid var(--border);
}

.separator {
  height: 1px;
  width: 100%;
  background: var(--border);
  border: 0;
  margin: var(--esp-3) 0;
}

.separator-vertical {
  width: 1px;
  height: 20px;
  margin: 0 var(--esp-1);
  background: var(--border);
  flex: none;
}

/* Les avis. Quatre tons, et le ton est la seule chose qui change : la
   géométrie est la même, pour qu'un avis ne ressemble jamais à un bouton. */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-2);
  padding: 10px var(--esp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: var(--texte-xs);
  line-height: 1.45;
}

/* UN AVIS POSÉ DANS LE FIL DE LA PAGE SE DÉTACHE DE CE QUI SUIT. Sans marge, « pool relevé »
   collait à la carte de la séance (2 novembre 2026). Seuls les avis du fil sont visés : dans un
   panneau ou une pile, l'espacement vient du conteneur. */
.page > .alert,
.ecran-tete > .alert {
  margin-bottom: var(--esp-4);
}

.alert .ic {
  flex: none;
  margin-top: 1px;
  color: var(--muted-foreground);
}

.alert-titre {
  display: block;
  font-weight: 500;
  margin-bottom: 2px;
}

.alert-erreur {
  border-color: color-mix(in oklab, var(--destructive) 35%, var(--background));
  background: color-mix(in oklab, var(--destructive) 6%, var(--background));
  color: color-mix(in oklab, var(--destructive) 80%, var(--foreground));
}

.alert-erreur .ic {
  color: var(--destructive);
}

.alert-succes {
  border-color: color-mix(in oklab, var(--succes) 35%, var(--background));
  background: var(--succes-doux);
  color: color-mix(in oklab, var(--succes) 65%, var(--foreground));
}

.alert-succes .ic {
  color: var(--succes);
}

.alert-info {
  background: var(--muted);
}

/* Ni une erreur ni un succès : un état qui demande un geste sans que rien n'ait échoué (une
   publication expirée, 18 novembre 2026). La teinte d'attention, celle des cellules à surveiller. */
.alert-attention {
  border-color: color-mix(in oklab, var(--c-attention) 35%, var(--background));
  background: color-mix(in oklab, var(--c-attention) 7%, var(--background));
  color: color-mix(in oklab, var(--c-attention) 75%, var(--foreground));
}

.alert-attention .ic {
  color: var(--c-attention);
}

/* Le mode test, sur les écrans où il a un coût : la teinte de la mention de la
   barre latérale (`--chart-5`), pour qu'on reconnaisse la même chose aux deux
   endroits — et qu'elle ne ressemble ni à une erreur ni à un succès. */
.alert-test {
  border-color: color-mix(in oklab, var(--chart-5) 45%, var(--background));
  background: color-mix(in oklab, var(--chart-5) 10%, var(--background));
  color: color-mix(in oklab, var(--chart-5) 30%, var(--foreground));
  margin-bottom: var(--esp-4);
}

.alert-test .ic {
  color: color-mix(in oklab, var(--chart-5) 70%, var(--foreground));
}

/* Le bandeau de séance : quelques chiffres, un par tuile. */
.stats {
  display: flex;
  align-items: stretch;
  gap: var(--esp-4);
  flex-wrap: wrap;
  padding: var(--esp-3) var(--esp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  margin-bottom: var(--esp-4);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 96px;
}

.stat-valeur {
  font-size: var(--texte-2xl);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-libelle {
  font-size: var(--texte-2xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.stat-muet .stat-valeur {
  color: var(--muted-foreground);
  font-weight: 500;
}

.stat-alerte .stat-valeur {
  color: var(--destructive);
}

.stat-fin {
  margin-left: auto;
  align-self: center;
}

/* L'infobulle, en CSS pur, par attribut. Elle ne remplace JAMAIS un libellé
   accessible : c'est un complément, pas le seul porteur de l'information. */
[data-infobulle] {
  position: relative;
}

/* CACHÉE, ELLE N'EXISTE PAS (18 novembre 2026, revue R233). Une infobulle transparente gardait sa
   boîte : elle élargissait la zone de défilement de son cadre, et Offre, Réseau et les quatre
   tableaux de Données prenaient un défilement horizontal de 20 à 100 px pour rien. Le contenu
   n'est posé qu'au survol ; l'entrée se fait par une animation, puisqu'une transition n'a rien
   d'où partir. */
[data-infobulle]::after {
  content: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  translate: -50% 0;
  z-index: 60;
  max-width: 260px;
  width: max-content;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--popover);
  color: var(--popover-foreground);
  font-family: var(--police);
  font-size: var(--texte-2xs);
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
  pointer-events: none;
}

[data-infobulle]:hover::after,
[data-infobulle]:focus-visible::after {
  content: attr(data-infobulle);
  animation: infobulle-entree var(--transition) both;
}

@keyframes infobulle-entree {
  from { opacity: 0; }
  to { opacity: 1; }
}

[data-infobulle][data-infobulle-position="bas"]::after {
  bottom: auto;
  top: calc(100% + 6px);
}

/* Même règle pour l'en-tête de la grille de l'arbitrage, qui colle en haut d'un cadre qui
   défile lui aussi (2 novembre 2026). */
.tree-tete [data-infobulle]::after {
  bottom: auto;
  top: calc(100% + 6px);
}

/* DANS UN EN-TÊTE DE TABLEAU, L'INFOBULLE S'OUVRE VERS LE BAS. Le cadre d'un tableau défile
   (`overflow: auto`), donc il rogne tout ce qui dépasse de lui — et une infobulle posée
   au-dessus d'un en-tête collé en haut du cadre sortait entièrement par le haut : on n'en
   voyait rien, ou le bas (2 novembre 2026). Vers le bas, elle tombe sur les lignes, qui sont
   dans le cadre. La dernière colonne s'aligne à droite, la première à gauche : centrées, elles
   déborderaient sur le côté et seraient rognées de même. */
.table thead [data-infobulle]::after {
  bottom: auto;
  top: calc(100% + 6px);
}

.table thead th:last-child[data-infobulle]::after {
  left: auto;
  right: var(--esp-2);
  translate: none;
}

.table thead th:first-child[data-infobulle]::after {
  left: var(--esp-2);
  translate: none;
}

/* Les icônes. Un seul jeu, dessiné à la main dans icones.svg : trait 1,5px,
   currentColor, grille de 16. Pas d'emoji, pas de glyphe unicode — un emoji
   n'a ni la couleur du texte, ni la même taille d'une machine à l'autre. */
.ic {
  width: 16px;
  height: 16px;
  flex: none;
  color: inherit;
}

.ic-14 {
  width: 14px;
  height: 14px;
}

.ic-12 {
  width: 12px;
  height: 12px;
}

.ic-20 {
  width: 20px;
  height: 20px;
}

.ic-sourdine {
  color: var(--muted-foreground);
}

/* Une icône demandée sous un nom qui n'existe pas se voit, plutôt que de
   laisser un trou muet dans l'interface. */
.ic-inconnue {
  outline: 1px dashed var(--destructive);
  outline-offset: -1px;
}

/* L'état vide. Il DIT ce qu'il faut faire ; « aucun résultat » tout seul laisse
   le lecteur devant un écran blanc. */
.vide-etat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--esp-2);
  padding: var(--esp-8) var(--esp-4);
  text-align: center;
  color: var(--muted-foreground);
  font-size: var(--texte-xs);
}

.vide-etat .ic {
  width: 20px;
  height: 20px;
  color: color-mix(in oklab, var(--muted-foreground) 60%, var(--background));
}

.vide-etat-titre {
  font-size: var(--texte);
  font-weight: 500;
  color: var(--foreground);
}

/* ══ §11 UTILITAIRES ════════════════════════════════════════════════════════ */

/* La liste est COURTE et le reste : chaque utilitaire ajouté ici est un
   composant qu'on n'a pas nommé. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.tronque {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pousse {
  margin-left: auto;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-1);
  margin: 0;
}

/* CE QUI PART QUAND CE N'EST PAS CE QUI A ÉTÉ TAPÉ (19 novembre 2026, R6) : une flèche et le
   nombre servi, à la teinte d'attention — un écart à lire, pas une erreur. Le survol dit pourquoi. */
.cell-rabot {
  font-variant-numeric: tabular-nums;
  font-size: var(--texte-xs);
  font-weight: 600;
  white-space: nowrap;
  color: color-mix(in oklab, var(--c-attention) 85%, var(--foreground));
  cursor: help;
}

.nowrap {
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .cell-actions,
  .page-actions {
    display: none !important;
  }

  .tree-cadre,
  .table-cadre {
    max-height: none;
    overflow: visible;
  }
}

/* ══ LE PASSAGE DE COMMANDE ═════════════════════════════════════════════════
   Une cellule d'action dans un tableau reste une cellule : `display: flex` sur
   un `td` le sort du modèle de tableau et décale toute la ligne. */
.table td.td-action {
  text-align: right;
  white-space: nowrap;
}

.commande-prevue + .commande-prevue {
  margin-top: var(--esp-6);
}

.commande-prevue-titre {
  display: flex;
  align-items: baseline;
  gap: var(--esp-2);
  flex-wrap: wrap;
  margin-bottom: var(--esp-2);
}


.filtres-case {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.filtres .select {
  width: auto;
  min-width: 160px;
}

/* ══ LA MATRICE DES PRODUITS ════════════════════════════════════════════════
   Une grille plutôt qu'un tableau : chaque produit est un BLOC — sa ligne, puis
   ses versions quand on le déplie —, et un bloc doit pouvoir être redessiné seul
   en réponse à un geste. Toutes les lignes partagent les mêmes pistes, posées
   une fois sur le conteneur : les colonnes des magasins s'alignent de haut en
   bas, celles d'un produit replié comme celles de ses versions. */
.mx {
  --mx-colonnes: minmax(240px, 2.4fr) minmax(120px, 1fr) minmax(170px, 1.2fr) 76px
    repeat(var(--mx-magasins), minmax(76px, 0.7fr)) minmax(200px, 1.3fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: auto;
  /* BORNÉE, POUR QUE SON EN-TÊTE TIENNE (18 novembre 2026, revue R234) : un cadre qui défile sans
     hauteur limite ne défile jamais en hauteur, et l'en-tête collé en haut de lui partait avec la
     page dès la dixième ligne. */
  max-height: calc(100dvh - 210px);
  /* ET ANCRE DE CE QU'ELLE CONTIENT (19 novembre 2026). Les cases qui déplient les lignes
     (`.mx-ouvert`) sont en position absolue ; sans ancre dans le cadre, elles se plaçaient par
     rapport à la page, hors de portée du défilement du cadre, et l'allongeaient de toute la hauteur
     de la matrice : la page défilait aussi, et sous le cadre ne restait que du blanc. */
  position: relative;
}

.mx-entete,
.mx-ligne {
  display: grid;
  grid-template-columns: var(--mx-colonnes);
  align-items: center;
  min-width: 1000px;
}

/* Les versions archivées d'un produit vivant sont repliées ; la case les rend. */
.mx-produit:has(.mx-archives) .mx-ligne-version[data-etat="archivee"] {
  display: none;
}

.mx-produit:has(.mx-archives-case:checked) .mx-ligne-version[data-etat="archivee"] {
  display: grid;
}

.mx-archives {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  padding: var(--esp-2) var(--esp-4);
  cursor: pointer;
}

/* La colonne du réseau porte le seul interrupteur de la ligne : centrée, comme les
   présences des magasins qu'elle commande. */
.mx-c-reseau {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mx-entete {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: var(--h-entete-tableau);
  border-bottom: 1px solid var(--border);
  background: var(--card);
  font-size: var(--texte-xs);
  font-weight: 500;
  color: var(--muted-foreground);
}

.mx-c {
  padding: 6px var(--pad-cellule);
  min-width: 0;
}

.mx-c-magasin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.mx-entete .mx-c-magasin {
  line-height: 1.25;
  color: var(--foreground);
}

.mx-quartier {
  font-weight: 400;
  color: var(--muted-foreground);
}

.mx-c-action {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--esp-2);
}

.mx-univers {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  min-width: 920px;
  padding: var(--esp-3) var(--pad-cellule) var(--esp-2);
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

/* ── un produit */
.mx-produit {
  border-bottom: 1px solid var(--border);
}

.mx-produit:last-child {
  border-bottom: 0;
}

.mx-ouvert {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mx-ligne-produit {
  min-height: 48px;
  transition: background-color var(--transition);
}

.mx-ligne-produit:hover {
  background: color-mix(in oklab, var(--muted) 55%, var(--card));
}

.mx-c-nom {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  overflow: hidden;
}

.mx-deplier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
}

.mx-chevron {
  flex: none;
  color: var(--muted-foreground);
  transition: transform var(--transition);
}

.mx-ouvert:checked + .mx-ligne-produit .mx-chevron {
  transform: rotate(90deg);
}

.mx-ouvert:focus-visible + .mx-ligne-produit .mx-deplier {
  outline: 2px solid var(--anneau-visible);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.mx-nom {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mx-meta {
  flex: none;
}

.mx-version {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mx-produit-archive .mx-nom,
.mx-produit-archive .mx-version {
  color: var(--muted-foreground);
}

.mx-archive {
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.mx-interrupteur {
  display: flex;
  justify-content: center;
}

/* DÉSACTIVÉ, IL RESTE UN ÉTAT LISIBLE. Ailleurs, un interrupteur désactivé
   s'efface à moitié ; ici il est aussi l'indicateur de la colonne — en phase
   de test, pour un lecteur —, et l'état doit se lire d'un coup d'œil. */
.mx-interrupteur .switch:disabled {
  opacity: 0.8;
}

/* À MOITIÉ : le produit est dans le magasin, mais il lui manque des tailles —
   une nouvelle version, une couleur. La pastille reste au milieu, et la piste
   prend la couleur pleine à moitié : ni allumé, ni éteint. */
.switch[data-partiel] {
  background-color: color-mix(in oklab, var(--primary) 38%, var(--input));
  background-position: 8px center;
}

/* Cliqué, il part au bout tout de suite : le bloc redessiné le confirmera. */
.switch[data-partiel]:checked {
  background-color: var(--primary);
  background-position: 16px center;
}

.mx-partiel {
  font-size: var(--texte-2xs);
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

/* ── les versions, une fois déplié */
.mx-corps {
  display: none;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 40%, var(--card));
}

.mx-ouvert:checked ~ .mx-corps {
  display: block;
}

.mx-ligne-version,
.mx-ligne-plm {
  min-height: 40px;
  font-size: var(--texte-sm);
}

.mx-ligne-version + .mx-ligne-version,
.mx-ligne-version + .mx-ligne-plm,
.mx-ligne-plm + .mx-ligne-plm {
  border-top: 1px dashed var(--border);
}

.mx-ligne-version .mx-c-nom,
.mx-ligne-plm .mx-c-nom {
  padding-left: calc(var(--pad-cellule) + 14px);
}

.mx-ligne-version[data-etat="archivee"] .mx-version,
.mx-ligne-version[data-etat="archivee"] .mx-couleur {
  color: var(--muted-foreground);
}

.mx-ordre {
  display: inline-flex;
  flex: none;
  gap: 0;
}

.mx-rang {
  display: inline-flex;
  justify-content: center;
  flex: none;
  width: 56px;
  font-size: var(--texte-xs);
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

.mx-couleurs {
  display: inline-flex;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.mx-couleur {
  flex: none;
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px 7px;
  border-radius: var(--radius-pilule);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: var(--texte-2xs);
  color: var(--foreground);
  white-space: nowrap;
}

.mx-couleur-plus {
  color: var(--muted-foreground);
}

/* Deux chiffres empilés, pas une phrase qui se coupe où elle peut. */
.mx-stock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  font-size: var(--texte-xs);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

.mx-presence {
  font-size: var(--texte-xs);
  font-variant-numeric: tabular-nums;
}

.mx-presence-complet {
  color: var(--succes);
}

.mx-presence-partiel {
  color: var(--foreground);
  font-weight: 500;
}

/* « MANQUE » : le magasin porte le produit, pas cette version. C'est le seul
   état de la colonne qui appelle un geste, d'où la seule couleur forte. */
.mx-presence-manque {
  color: color-mix(in oklab, var(--destructive) 75%, var(--foreground));
  font-weight: 500;
}

.mx-presence-vide {
  color: var(--border);
}

.mx-ligne-plm {
  color: var(--muted-foreground);
}

.mx-ligne-plm .mx-version {
  color: var(--foreground);
}

/* Le refus d'un geste, sous le produit. Ce qu'un geste a fait part dans les
   annonces ; ici ne reste que ce qui appelle un geste. */
.mx-annonce {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 920px;
  margin: 0;
  padding: var(--esp-2) var(--pad-cellule) var(--esp-2) calc(var(--pad-cellule) + 14px);
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--c-attention) 9%, var(--background));
  font-size: var(--texte-xs);
  color: color-mix(in oklab, var(--c-attention) 75%, var(--foreground));
}

.mx-confirmation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mx-confirmation-texte {
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
  text-align: right;
}

.mx-confirmation form {
  display: inline-flex;
}

.mx-filtres {
  margin-bottom: var(--esp-4);
}

.jeton-compte {
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

/* ══ LES PRODUITS NEUFS AU PLM ══════════════════════════════════════════════
   Une ligne par produit, sur les mêmes pistes de haut en bas : le nom, ses
   versions en pastilles, la date, et l'action au bout — toujours au même
   endroit, comme sur la matrice. */
.neufs {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}

.neuf {
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) minmax(180px, 2fr) 88px minmax(180px, auto);
  align-items: center;
  gap: var(--esp-3);
  min-height: 48px;
  padding: 6px var(--esp-4);
  font-size: var(--texte-sm);
  transition: background-color var(--transition);
}

.neuf + .neuf {
  border-top: 1px solid var(--border);
}

.neuf:not(.neuf-entete):not(.neuf-fait):hover {
  background: color-mix(in oklab, var(--muted) 55%, var(--card));
}

.neuf-entete {
  min-height: var(--h-entete-tableau);
  font-size: var(--texte-xs);
  font-weight: 500;
  color: var(--muted-foreground);
}

.neuf-produit {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  min-width: 0;
}

.neuf-nom {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.neuf-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.neuf-version {
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pilule);
  background: var(--card);
  font-size: var(--texte-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Sans fiche Shopify : montrée seulement à la demande, et en pointillé — elle
   entre dans la matrice, pas encore dans les calculs. */
.neuf-version-hors {
  border-style: dashed;
  font-weight: 400;
  color: var(--muted-foreground);
}

.neuf-date {
  font-variant-numeric: tabular-nums;
}

.neuf-action {
  display: flex;
  justify-content: flex-end;
}

/* La ligne une fois le geste fait : le message prend la place des versions. */
.neuf-fait {
  grid-template-columns: minmax(200px, 1.5fr) minmax(0, 2fr) auto;
  background: var(--succes-doux);
}

.neuf-message {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--texte-xs);
  color: color-mix(in oklab, var(--succes) 65%, var(--foreground));
}

.neuf-refus {
  background: color-mix(in oklab, var(--destructive) 7%, var(--card));
}

.neuf-refus .neuf-message {
  color: color-mix(in oklab, var(--destructive) 75%, var(--foreground));
}

@media (max-width: 760px) {
  .neuf,
  .neuf-fait {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 6px;
    padding: var(--esp-2) var(--esp-3);
  }

  .neuf-entete,
  .neuf-date {
    display: none;
  }

  .neuf-produit {
    grid-column: 1;
    grid-row: 1;
  }

  .neuf-versions,
  .neuf-message {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .neuf-action {
    grid-column: 2;
    grid-row: 1;
  }
}


/* ── L'OUVERTURE D'UN MAGASIN ─────────────────────────────────────────────────
   Deux listes et un bouton, alignés sur leur pied ; et la page qui dit ce que la
   copie fera, en phrases courtes, avant le bouton. */
.copie-offre {
  align-items: flex-end;
  flex-wrap: wrap;
}

.liste-faits {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
  margin: 0;
  padding-left: var(--esp-6);
  font-size: var(--texte-sm);
}

/* ══ L'ÉCRAN DES RÉGLAGES ═══════════════════════════════════════════════════════
   Refait le 2 novembre 2026 : « illisible, pas de marge, il faut des infos
   visuelles, des colorations ». Une matrice couleurs × magasins par produit, des
   cases qui disent leur état en couleur, un panneau latéral pour régler.

   LES COULEURS SONT UN CODE, PAS UN DÉCOR. Chacune nomme une consigne, et une
   seule : vert pour l'offre, bleu pour les ventes modulées, orange pour le stop,
   violet pour le reset. Le rouge reste à ce qui ne va pas. Le fond d'une pastille
   est sa couleur à 10 %, son texte la même mêlée au premier plan — lisible à
   plus de 4,5:1 sur blanc. */
:root {
  --c-offre: var(--succes);
  --c-variation: #2563eb;
  --c-stop: #c2410c;
  --c-reset: #7c3aed;
  --c-alerte: var(--destructive);
  --c-attention: #b45309;
}

.rg-filtres {
  margin-bottom: var(--esp-3);
}

/* ── La légende ─────────────────────────────────────────────────────────────── */
.rg-legende {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--esp-2) var(--esp-4);
  margin-bottom: var(--esp-6);
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.rg-legende-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rg-legende-trait {
  width: 1px;
  height: 16px;
  background: var(--border);
}

/* ── La pastille d'offre et les pastilles de consigne ──────────────────────── */
.rg-offre {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in oklab, var(--muted-foreground) 70%, var(--background));
}

.rg-offre[data-offre="oui"] {
  background: var(--c-offre);
  border-color: var(--c-offre);
}

.rg-badge {
  --c: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border: 1px solid color-mix(in oklab, var(--c) 30%, var(--background));
  border-radius: var(--radius-pilule);
  background: color-mix(in oklab, var(--c) 10%, var(--background));
  color: color-mix(in oklab, var(--c) 80%, var(--foreground));
  font-size: var(--texte-2xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rg-badge .ic {
  width: 11px;
  height: 11px;
}

.rg-badge[data-mode="variation"] { --c: var(--c-variation); }
.rg-badge[data-mode="stop"] { --c: var(--c-stop); }
.rg-badge[data-mode="initial"] { --c: var(--c-reset); }
.rg-badge[data-mode="alerte"] { --c: var(--c-alerte); }

/* Hérité du réseau : la même couleur, en pointillé et sans fond. La consigne vaut
   ici, mais elle a été posée plus haut. */
.rg-badge-herite {
  border-style: dashed;
  background: transparent;
}

/* ── Les variations en cascade (20 novembre 2026) ──────────────────────────────────
   Pleine : posée à ce niveau. En pointillé : suivie d'un niveau du dessus, dont le nom
   est écrit à côté, en sourdine. « 0 % » posé est neutre : c'est une décision, pas une
   modulation. */
.rg-badge[data-mode="zero"] {
  --c: var(--muted-foreground);
  background: var(--muted);
  border-color: var(--border);
  color: var(--foreground);
}

.rg-origine {
  margin-left: 5px;
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
  white-space: nowrap;
}

.rg-variation-aucune {
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
}

/* La variation d'une ligne de catégorie ou de produit : la pastille seule, sans cadre de
   champ — un cadre autour d'une pastille se lisait comme une saisie (20 novembre 2026). C'est
   un bouton dans le `summary`, qui ouvre son panneau sans replier la ligne ; le survol le dit. */
.rg-variation-case {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 116px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background-color var(--transition);
}

.rg-variation-case:hover {
  background: color-mix(in oklab, var(--foreground) 6%, transparent);
}

.rg-variation-case:focus-visible {
  outline: 3px solid var(--anneau-visible);
  outline-offset: 1px;
}

.rg-variation-case-vide {
  color: var(--muted-foreground);
  cursor: default;
}

.rg-variation-case-vide:hover {
  background: transparent;
}

.rgm-case-consigne {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.rg-apercu-sur {
  margin-left: -4px;
  font-size: var(--texte-2xs);
}

/* La catégorie EST L'EN-TÊTE DE SA CARTE (20 novembre 2026) : un bandeau posé au-dessus des
   produits, séparé d'eux par un blanc, ne disait pas ce qu'il repliait. Il ferme maintenant la
   carte qui porte ses produits, et se replie avec elle. */
.rg-rayon {
  margin-bottom: var(--esp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.rg-rayon-tete {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--esp-3);
  min-height: 48px;
  padding: var(--esp-2) var(--esp-4);
  border-radius: calc(var(--radius-lg) - 1px);
  background: color-mix(in oklab, var(--muted) 85%, var(--background));
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color var(--transition);
}

.rg-rayon[open] > .rg-rayon-tete {
  border-bottom: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.rg-rayon-tete:hover {
  background: var(--muted);
}

.rg-rayon-tete::-webkit-details-marker {
  display: none;
}

.rg-rayon-tete:focus-visible {
  outline: 3px solid var(--anneau-visible);
  outline-offset: -3px;
}

.rg-rayon[open] > .rg-rayon-tete .toggle .ic {
  transform: rotate(90deg);
}

/* Dans la carte de sa catégorie, la liste des produits n'a ni cadre ni coin du haut. */
.rg-rayon > .rg-groupe {
  border: 0;
  border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px);
  background: transparent;
}

.rg-rayon .rg-produit:first-child > .rg-tete {
  border-radius: 0;
}

.rg-rayon-nom {
  display: flex;
  align-items: baseline;
  gap: var(--esp-2);
  min-width: 0;
  overflow: hidden;
  font-size: var(--texte);
  font-weight: 600;
  white-space: nowrap;
}

.rg-rayon-nom .rg-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.rg-rayon-teinte {
  align-self: center;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 3px;
  background: var(--cat, var(--muted-foreground));
}

.rg-echelon-suit {
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
}

/* La case : l'offre et le seuil initial en tête, côte à côte. */
.rg-case-essentiel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--esp-3);
  padding: var(--esp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.rg-case-offre-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-2);
}

/* L'échelle d'un panneau : les niveaux au-dessus de ce qu'on règle, puis lui. */
.rg-echelle {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rg-echelon {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--esp-2);
  padding: 7px 10px;
  font-size: var(--texte-xs);
}

.rg-echelon + .rg-echelon {
  border-top: 1px solid var(--border);
}

.rg-echelon-ici {
  background: color-mix(in oklab, var(--muted) 70%, var(--background));
}

.rg-echelon-gagne {
  box-shadow: inset 3px 0 0 var(--c-variation);
}

.rg-echelon-niveau {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--muted-foreground);
}

.rg-echelon-ici .rg-echelon-niveau {
  color: var(--foreground);
  font-weight: 600;
}

.rg-echelon-nom {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--texte-2xs);
  font-weight: 400;
  color: var(--muted-foreground);
}

.rg-echelon-valeur {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rg-echelon-marque {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-variation);
}

.rg-echelon-qui {
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
  white-space: nowrap;
}

.choix-variation {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

.choix-variation .champ-suffixe {
  margin-top: 6px;
  max-width: 140px;
}

.rg-choix-variation {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.rg-choix-variation:disabled .choix-variation {
  opacity: 0.55;
}

/* Ce qu'un changement remplacerait plus bas : la teinte d'attention, avant le bouton. */
.rg-cascade {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid color-mix(in oklab, var(--c-attention) 30%, var(--background));
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--c-attention) 7%, var(--background));
  font-size: var(--texte-xs);
}

.rg-cascade-titre {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-weight: 600;
  color: color-mix(in oklab, var(--c-attention) 85%, var(--foreground));
}

.rg-cascade-titre .ic {
  flex: none;
  margin-top: 2px;
}

.rg-cascade ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding-left: 18px;
}

.rg-cascade p {
  margin: 0;
}

.rg-cascade[hidden],
.rg-aligner[hidden],
.rg-variation-morte[hidden] {
  display: none;
}

/* Une case sortie de l'offre par le nettoyage alors que sa couleur a de la réserve retail : la
   teinte d'attention, sur la case — elle n'est pas en sourdine comme le reste du hors offre. */
.rgm-sortie {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--c-attention) 12%, var(--background));
  color: color-mix(in oklab, var(--c-attention) 85%, var(--foreground));
  font-size: var(--texte-2xs);
  font-weight: 600;
  white-space: nowrap;
}

.rg-sorties {
  margin-bottom: var(--esp-3);
}

/* Hors offre, la variation ne joue pas : elle passe en sourdine avec le reste de la case. */
.rgm-case-hors .rgm-case-consigne {
  opacity: 0.45;
}

.rg-aligner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.btn.btn-remplace {
  background: var(--c-attention);
  border-color: var(--c-attention);
  color: #fff;
}

/* ── La liste des produits ───────────────────────────────────────────────────── */
.rg-liste {
  display: flex;
  flex-direction: column;
}

.rg-univers {
  display: flex;
  align-items: baseline;
  gap: var(--esp-2);
  margin: var(--esp-8) 0 var(--esp-3);
  font-size: var(--texte-xs);
  font-weight: 500;
}

.rg-univers:first-child {
  margin-top: 0;
}

/* PAS D'`overflow: hidden` POUR ARRONDIR : il rognait les infobulles de la première
   ligne, qui s'ouvrent vers le haut (2 novembre 2026). Les coins se tiennent par la
   première et la dernière ligne, qui portent elles-mêmes l'arrondi de leur fond. */
.rg-groupe {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.rg-produit:first-child > .rg-tete {
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.rg-produit:last-child:not([open]) > .rg-tete,
.rg-produit:last-child > .rg-corps {
  border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px);
}

.rg-produit:only-child:not([open]) > .rg-tete {
  border-radius: calc(var(--radius-lg) - 1px);
}

.rg-produit + .rg-produit {
  border-top: 1px solid var(--border);
}

.rg-tete {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--esp-3);
  min-height: 48px;
  padding: var(--esp-2) var(--esp-4);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color var(--transition);
}

.rg-tete::-webkit-details-marker {
  display: none;
}

.rg-tete:hover {
  background: color-mix(in oklab, var(--muted) 70%, var(--background));
}

.rg-tete:focus-visible {
  outline: 3px solid var(--anneau-visible);
  outline-offset: -3px;
}

.rg-produit[open] > .rg-tete {
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.rg-produit[open] > .rg-tete .toggle .ic {
  transform: rotate(90deg);
}

.rg-nom {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--texte-sm);
  font-weight: 600;
}

.rg-produit-dormant .rg-nom {
  font-weight: 500;
  color: var(--muted-foreground);
}

.rg-meta {
  font-size: var(--texte-xs);
}

/* Ce que chaque magasin a à l'offre, sur la ligne repliée : le code, et un nombre
   en vert. Zéro se lit en creux. */
.rg-apercu {
  display: flex;
  gap: 6px;
}

.rg-apercu-magasin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid color-mix(in oklab, var(--c-offre) 30%, var(--background));
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--c-offre) 8%, var(--background));
  font-size: var(--texte-2xs);
  font-variant-numeric: tabular-nums;
}

.rg-apercu-code {
  color: var(--muted-foreground);
  font-weight: 500;
}

.rg-apercu-n {
  min-width: 1ch;
  color: color-mix(in oklab, var(--c-offre) 75%, var(--foreground));
  font-weight: 700;
  text-align: right;
}

/* Les ronds de consigne (13 novembre 2026) : un par famille portée par les couleurs
   à l'offre du magasin, dans la couleur du badge de la matrice. Plein : posé sur le
   magasin. Creux : hérité du réseau — le pointillé du badge, à l'échelle d'un point.
   La place de trois ronds est gardée même vide : les magasins restent alignés d'une
   ligne à l'autre, et l'œil compare une colonne, pas un nuage. */
.rg-apercu-points {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: calc(3 * 7px + 2 * 3px);
}

.rg-point {
  --c: var(--muted-foreground);
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--c);
  background: var(--c);
}

.rg-point[data-mode="variation"] { --c: var(--c-variation); }
.rg-point[data-mode="stop"] { --c: var(--c-stop); }
.rg-point[data-mode="initial"] { --c: var(--c-reset); }

.rg-point[data-herite] {
  background: transparent;
}

/* Les jetons des consignes prennent la couleur de leur rond. « Réseau » n'a pas de
   couleur à lui — une consigne réseau peut être de n'importe quelle famille — : son
   rond reste creux, comme sur les lignes. */
.jeton-teinte[data-teinte="variation"] { --c: var(--c-variation); }
.jeton-teinte[data-teinte="stop"] { --c: var(--c-stop); }
.jeton-teinte[data-teinte="reset"] { --c: var(--c-reset); }
.jeton-teinte[data-teinte="reseau"] { --c: var(--muted-foreground); }
.jeton-teinte[data-teinte="sorties"] { --c: var(--c-attention); }

.jeton-teinte[data-teinte="reseau"]:has(:checked) {
  color: var(--foreground);
}

.jeton-teinte[data-teinte="reseau"]:has(:checked) .jeton-point {
  background: transparent;
  border-color: var(--foreground);
}

.rg-filtres-consignes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--esp-2);
}

.rg-apercu-vide {
  border-style: dashed;
  border-color: var(--border);
  background: transparent;
}

.rg-apercu-vide .rg-apercu-n {
  color: var(--muted-foreground);
  font-weight: 500;
}

.rg-corps {
  padding: var(--esp-4) var(--esp-4) var(--esp-6);
  background: color-mix(in oklab, var(--muted) 35%, var(--background));
}

.rg-chargement,
.rg-alerte {
  margin-bottom: var(--esp-3);
}

/* ── La matrice ──────────────────────────────────────────────────────────────── */
.rgm-cadre {
  position: relative;
  overflow-x: auto;
  padding-bottom: 2px;
}

.rgm {
  display: grid;
  /* PAS DE `min-width: max-content` : il donnait à chaque piste `1fr` sa largeur de
     contenu, et quatre magasins débordaient d'un écran qui les tenait. Les minimums
     suffisent ; le cadre défile au-delà. */
  grid-template-columns:
    minmax(128px, 0.9fr) minmax(156px, 1fr)
    repeat(var(--rgm-magasins, 4), minmax(150px, 1fr));
  gap: var(--esp-2);
}

.rgm-ligne {
  display: contents;
}

.rgm-th {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
  padding: 0 var(--esp-1) 2px;
  font-size: var(--texte-2xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rgm-th-reseau {
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
}

.rgm-th-quartier {
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: color-mix(in oklab, var(--muted-foreground) 80%, var(--background));
}

.rgm-th .ic {
  width: 12px;
  height: 12px;
}

.rgm-couleur {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 0 var(--esp-1);
}

.rgm-couleur-nom {
  font-size: var(--texte-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.rgm-couleur-meta {
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
}

/* Repliées, les couleurs dormantes ne prennent aucune piste : la ligne est en
   `display: contents`, ce sont ses cases qui disparaissent. */
.rgm-repliable:not(:has(.rgm-dormantes-case:checked)) .rgm-dormante > * {
  display: none;
}

.rgm-dormantes-case {
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.rgm-dormantes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--esp-3);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
  cursor: pointer;
}

.rgm-dormantes:hover {
  background: var(--muted);
  color: var(--foreground);
}

.rgm-dormantes-case:focus-visible ~ .rgm-dormantes {
  outline: 3px solid var(--anneau-visible);
}

.rgm-dormantes .ic {
  transition: transform var(--transition);
}

.rgm-dormantes-case:checked ~ .rgm-dormantes .ic {
  transform: rotate(90deg);
}

.rgm-dormantes-cacher,
.rgm-dormantes-case:checked ~ .rgm-dormantes .rgm-dormantes-montrer {
  display: none;
}

.rgm-dormantes-case:checked ~ .rgm-dormantes .rgm-dormantes-cacher {
  display: inline;
}

.rgm-dormante .rgm-couleur-nom {
  font-weight: 500;
  color: var(--muted-foreground);
}

/* UNE CASE EST UN BOUTON, et elle en a l'air : bordure, survol, focus. Elle ouvre
   son panneau ; rien ne se règle dans la grille. */
.rgm-case {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--esp-2);
  min-width: 0;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background-color var(--transition);
}

.rgm-case:hover {
  border-color: color-mix(in oklab, var(--ring) 70%, var(--background));
  box-shadow: 0 2px 6px -2px rgb(0 0 0 / 0.08);
}

.rgm-case:focus-visible {
  outline: 3px solid var(--anneau-visible);
  outline-offset: 1px;
}

/* Hors offre, la case passe en sourdine : elle ne demande rien. */
.rgm-case-hors {
  background: var(--muted);
  color: var(--muted-foreground);
}

.rgm-case-hors .rg-offre-libelle {
  color: var(--muted-foreground);
  font-weight: 500;
}

/* La case du réseau se distingue par son fond : elle commande les autres. */
.rgm-case-reseau {
  background: color-mix(in oklab, var(--foreground) 4%, var(--background));
  border-color: color-mix(in oklab, var(--foreground) 14%, var(--background));
}

.rgm-case-absente {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: transparent;
  color: var(--muted-foreground);
  cursor: default;
}

.rgm-case-absente:hover {
  border-color: var(--border);
  box-shadow: none;
}

.rgm-case-haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.rg-offre-libelle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--texte-xs);
  font-weight: 600;
  white-space: nowrap;
}

.rg-points {
  display: inline-flex;
  gap: 4px;
}

.rgm-case-bas {
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--esp-2);
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.rgm-seuil {
  color: color-mix(in oklab, var(--c-reset) 70%, var(--foreground));
  font-weight: 600;
}

/* LA CASE QU'ON VIENT DE RÉGLER S'ÉCLAIRE UNE FOIS : le panneau s'est fermé, la
   grille s'est redessinée, et l'œil doit retrouver où il était. */
.rgm-reglee {
  animation: rgm-reglee 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rgm-reglee {
  0%,
  35% {
    border-color: var(--c-offre);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-offre) 25%, transparent);
  }
}

/* ── Le panneau ──────────────────────────────────────────────────────────────── */
.tiroir {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(440px, 100vw);
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  box-shadow: -16px 0 40px -12px rgb(0 0 0 / 0.18);
  /* LE PANNEAU EST OPAQUE PAR DÉFAUT, ET SEUL LE GLISSEMENT S'ANIME. Une opacité partie
     de zéro dépend de la transition pour se voir : là où elle ne tourne pas — un onglet
     en arrière-plan, un moteur qui ne connaît pas `@starting-style` —, le panneau restait
     invisible, fond sombre et rien dessus. Au pire, ici, il arrive sans glisser. */
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@starting-style {
  .tiroir:popover-open {
    transform: translateX(32px);
  }
}

.tiroir::backdrop {
  background: rgb(23 23 23 / 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .tiroir,
  .rgm-reglee {
    transition: none;
    animation: none;
  }
}

.tiroir-forme {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tiroir-tete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--esp-3);
  padding: var(--esp-6) var(--esp-6) var(--esp-4);
}

.tiroir-sur {
  margin: 0 0 4px;
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.tiroir-titre {
  margin: 0;
  font-size: var(--texte-lg);
  font-weight: 600;
  line-height: 1.3;
}

.tiroir-ou {
  font-weight: 400;
  color: var(--muted-foreground);
}

.tiroir-chiffres {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--esp-3);
  margin: 0 var(--esp-6);
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--radius-md);
  background: var(--muted);
}

.tiroir-chiffres div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tiroir-chiffres dt {
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
}

.tiroir-chiffres dd {
  margin: 0;
  font-size: var(--texte-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tiroir-corps {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--esp-6);
  min-width: 0;
  margin: 0;
  padding: var(--esp-6);
  border: 0;
  overflow-y: auto;
}

.tiroir-groupe {
  display: flex;
  flex-direction: column;
  gap: var(--esp-3);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tiroir-champ {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

.tiroir-champ-ligne {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-4);
}

.tiroir-champ-ligne .field-aide {
  margin: 2px 0 0;
}

.tiroir-label {
  font-size: var(--texte-xs);
  font-weight: 600;
}

.tiroir-champs-nombres {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--esp-4);
}

.tiroir .champ-suffixe {
  display: flex;
}

.tiroir .input-num {
  width: 100%;
}

.tiroir .champ-suffixe[data-suffixe="pièces"] .input,
.tiroir .champ-suffixe[data-suffixe="colis"] .input {
  padding-right: 48px;
}

/* La variation ne vaut qu'en mode ventes : ailleurs elle s'efface, sans disparaître —
   la taper choisit ventes. */
form:not(:has(input[name="mode"][value="ventes"]:checked)) .champ-variation {
  opacity: 0.55;
}

/* ── Les quatre consignes : des cartes, pas un contrôle segmenté ─────────────────
   Chacune dit ce qu'elle fera, avec sa couleur. Choisie, elle prend sa couleur en
   bordure et en fond. */
.choix-consigne {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--esp-2);
}

.choix-carte {
  --c: var(--foreground);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  cursor: pointer;
  transition:
    border-color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.choix-carte[data-mode="variation"] { --c: var(--c-variation); }
.choix-carte[data-mode="stop"] { --c: var(--c-stop); }
.choix-carte[data-mode="initial"] { --c: var(--c-reset); }

/* Le bouton de la carte seulement : un champ de saisie posé dans la carte (la variation
   propre) reste un champ (20 novembre 2026). */
.choix-carte > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.choix-carte:hover {
  border-color: color-mix(in oklab, var(--c) 40%, var(--background));
}

.choix-carte:has(:checked) {
  border-color: var(--c);
  background: color-mix(in oklab, var(--c) 7%, var(--background));
  box-shadow: 0 0 0 1px var(--c);
}

.choix-carte:has(:focus-visible) {
  outline: 3px solid var(--anneau-visible);
  outline-offset: 2px;
}

.choix-carte-titre {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--texte-xs);
  font-weight: 600;
}

.choix-carte-titre::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--c);
}

.choix-carte:has(:checked) .choix-carte-titre::before {
  background: var(--c);
}

.choix-carte[data-mode="herite"] .choix-carte-titre::before {
  border-style: dashed;
}

.choix-carte-aide {
  font-size: var(--texte-2xs);
  line-height: 1.4;
  color: var(--muted-foreground);
}

fieldset:disabled .choix-carte {
  cursor: not-allowed;
  opacity: 0.7;
}

.tiroir-magasins {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 var(--esp-2);
  padding: 0;
  list-style: none;
  font-size: var(--texte-xs);
}

.tiroir-magasins li {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
}

.tiroir-magasins .t-aide {
  margin-left: auto;
}

.tiroir-avertissement {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-2);
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--c-attention) 10%, var(--background));
  color: color-mix(in oklab, var(--c-attention) 80%, var(--foreground));
  font-size: var(--texte-xs);
  line-height: 1.45;
}

.tiroir-avertissement .ic {
  flex: none;
  margin-top: 2px;
}

.tiroir-pied {
  display: flex;
  gap: var(--esp-2);
  padding: var(--esp-4) var(--esp-6);
  border-top: 1px solid var(--border);
  background: var(--card);
}

.tiroir-pied-interne {
  padding: 0;
  border-top: 0;
}

@media (max-width: 720px) {
  .rg-tete {
    grid-template-columns: 16px minmax(0, 1fr);
  }

  .rg-meta,
  .rg-apercu {
    grid-column: 2;
  }

  .choix-consigne,
  .tiroir-champs-nombres {
    grid-template-columns: 1fr;
  }
}

/* ══ L'ÉCRAN DES MAGASINS ════════════════════════════════════════════════════════
   Refait le 2 novembre 2026 sur le modèle des réglages : une liste qu'on lit, un
   panneau latéral par magasin pour le régler. L'état se lit en couleur — vert en
   service, bleu à ouvrir, ambre ne demande rien, gris fermé —, et rien d'autre
   n'en porte. */
.table-magasins td {
  white-space: nowrap;
}

.table-magasins tr[data-etat="ferme"] td {
  color: var(--muted-foreground);
}

/* La ligne qu'on vient de régler s'éclaire une fois. */
.table-magasins tr:target td {
  animation: mg-regle 2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mg-regle {
  0%,
  35% {
    background: var(--succes-doux);
  }
}

@media (prefers-reduced-motion: reduce) {
  .table-magasins tr:target td {
    animation: none;
  }
}

.mg-rang {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--muted);
  font-size: var(--texte-2xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Le nom ouvre le panneau, comme le bouton « Régler » : on clique là où on lit. */
.mg-nom {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mg-nom .t-aide {
  font-size: var(--texte-2xs);
}

.mg-nom:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* L'ÉTAT, UN SEUL COMPOSANT (18 novembre 2026, revue R236). Il venait de la page Magasins, validée
   le 2 novembre ; Commandes, Données et Comptes disaient leurs états avec cinq autres pastilles, de
   hauteurs, de graisses et de points différents — « en cours » en contour ici, en gris là. Le ton
   dit le sens, et rien d'autre : vert fait, rouge à reprendre, ambre à surveiller, bleu en cours,
   gris neutre. */
.etat {
  --c: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid color-mix(in oklab, var(--c) 30%, var(--background));
  border-radius: var(--radius-pilule);
  background: color-mix(in oklab, var(--c) 10%, var(--background));
  color: color-mix(in oklab, var(--c) 80%, var(--foreground));
  font-size: var(--texte-2xs);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.etat::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c);
}

.etat[data-ton="succes"] { --c: var(--succes); }
.etat[data-ton="alerte"] { --c: var(--destructive); }
.etat[data-ton="attention"] { --c: var(--c-attention); }
.etat[data-ton="cours"] { --c: var(--c-variation); }
.etat[data-ton="neutre"] { --c: var(--muted-foreground); }

/* L'offre : le compte, et une barre de la part déployée qui est à l'offre. */
.mg-offre {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 96px;
}

.mg-offre-n {
  font-variant-numeric: tabular-nums;
}

.mg-offre-barre {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius-pilule);
  background: var(--muted);
}

.mg-offre-barre > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--c-offre);
}

.mg-note {
  display: block;
  font-size: var(--texte-2xs);
  color: var(--c-attention);
}

.mg-extremes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.mg-extremes::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in oklab, var(--muted-foreground) 70%, var(--background));
}

.mg-extremes[data-recues="oui"] {
  color: var(--foreground);
  font-weight: 500;
}

.mg-extremes[data-recues="oui"]::before {
  background: var(--c-offre);
  border-color: var(--c-offre);
}

.mg-action {
  width: 1%;
  text-align: right;
}

/* Dans le panneau : la priorité tient sur un nombre court, et ce qui vient d'Airtable
   se lit en sourdine, sous un titre qui dit d'où il vient. */
.tiroir .mg-priorite {
  width: 120px;
}

.mg-repris {
  padding: var(--esp-3) var(--esp-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.mg-repris-titre {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--esp-2);
  font-size: var(--texte-xs);
  font-weight: 600;
  color: var(--muted-foreground);
}

.mg-repris dl {
  display: grid;
  gap: 6px;
  margin: 0 0 var(--esp-2);
}

.mg-repris dl div {
  display: flex;
  justify-content: space-between;
  gap: var(--esp-3);
  font-size: var(--texte-xs);
}

.mg-repris dt {
  color: var(--muted-foreground);
}

.mg-repris dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg-ouvrir-aide {
  margin: 0;
}

/* ══ L'ATTENTE ══════════════════════════════════════════════════════════════════
   Un geste qui prend du temps le dit tout de suite (2 novembre 2026) : le bouton se
   grise et tourne, et un filet court en haut de la fenêtre tant que la page n'est
   pas revenue. `gna.js` pose l'un et l'autre sur les formulaires `data-attente`. */
.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 1;
}

.btn[aria-busy="true"]::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in oklab, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: attente-tourne 0.7s linear infinite;
}

@keyframes attente-tourne {
  to {
    transform: rotate(360deg);
  }
}

body.en-attente::after {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-offre), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: attente-filet 1.1s ease-in-out infinite;
}

@keyframes attente-filet {
  from {
    background-position: -40% 0;
  }
  to {
    background-position: 140% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn[aria-busy="true"]::before,
  body.en-attente::after {
    animation-duration: 2.4s;
  }
}

/* ══ LES QUALITÉS DE TAILLE ET LES CATÉGORIES ══════════════════════════════════
   Les qualités sont CALCULÉES depuis le 12 novembre 2026 (§7.6) ; les catégories
   remplacent les grilles. TROIS QUALITÉS, TROIS GRIS D'UNE MÊME GAMME, LES MÊMES
   PARTOUT : la page des catégories, la colonne « Catégorie » de la matrice, son
   survol et son panneau.

   UNE SEULE TEINTE POUR LES QUALITÉS, ET C'EST LE MOT QUI PORTE LE SENS (5 novembre
   2026 : « pas noir, blanc et violet — trois teintes de la même couleur »). Plus la
   taille est au cœur de la gamme, plus elle est foncée.

   - centrale : gris 600, texte blanc ;
   - intermédiaire : gris 400, texte à l'encre ;
   - extrême : gris 200, texte foncé.

   LA COULEUR D'UNE CATÉGORIE N'EST PAS UNE QUALITÉ : c'est un repère pour la
   reconnaître dans la matrice, une pastille ronde à côté de son nom — jamais un
   fond de taille. Seize teintes, la palette est fermée (000043). */
:root {
  --q-central: #525252;
  --q-neutre: #a3a3a3;
  --q-extreme: #e5e5e5;
}

.tiroir-large {
  width: min(560px, 100vw);
}

/* Les chiffres posés dans le corps qui défile : la marge latérale est déjà celle du corps. */
.tiroir-chiffres-dans {
  margin: 0;
}

/* Le titre reste quand le corps défile : un filet le sépare de ce qui passe dessous. */
.tiroir-large .tiroir-tete {
  border-bottom: 1px solid var(--border);
}

/* ── La taille, en pastille ───────────────────────────────────────────────── */
.gq-taille {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: var(--texte-2xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gq-taille[data-q="central"] {
  border: 1px solid var(--q-central);
  background: var(--q-central);
  color: #fff;
}

.gq-taille[data-q="neutre"] {
  border: 1px solid var(--q-neutre);
  background: var(--q-neutre);
  color: #171717;
}

.gq-taille[data-q="extreme"] {
  border: 1px solid color-mix(in oklab, var(--q-extreme) 70%, #a3a3a3);
  background: var(--q-extreme);
  color: #404040;
}

.gq-bande {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gq-bande-petite .gq-taille {
  min-width: 26px;
  height: 20px;
  padding: 0 5px;
}

/* ── L'en-tête de la page : ce que chaque qualité fait, et où on en est ───── */
.gq-tete {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--esp-4);
  margin-bottom: var(--esp-8);
}

.gq-sens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--esp-3);
  padding: var(--esp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.gq-sens-item {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-3);
}

.gq-sens-item .gq-taille {
  flex: none;
  min-width: 38px;
}

.gq-sens-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--texte-xs);
  line-height: 1.45;
}

.gq-couverture {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: var(--esp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition);
}

.gq-couverture:hover {
  border-color: color-mix(in oklab, var(--foreground) 25%, var(--border));
}

.gq-couverture-n {
  font-size: var(--texte-xl);
  font-variant-numeric: tabular-nums;
}

.gq-couverture-lien {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--texte-xs);
  font-weight: 500;
}

/* ── Les cartes, par univers ──────────────────────────────────────────────── */
.gq-univers {
  margin-bottom: var(--esp-8);
}

.gq-univers-titre {
  display: flex;
  align-items: baseline;
  gap: var(--esp-2);
  margin: 0 0 var(--esp-3);
  font-size: var(--texte-xs);
  font-weight: 500;
}

.gq-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--esp-3);
}

.gq-carte {
  display: flex;
  flex-direction: column;
  gap: var(--esp-3);
  padding: var(--esp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  scroll-margin-top: 72px;
}

.gq-carte:target {
  animation: gq-eclairer 1.6s ease-out;
}

@keyframes gq-eclairer {
  from { box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-offre) 35%, transparent); }
  to { box-shadow: 0 0 0 3px transparent; }
}

.gq-carte-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--esp-2);
}

.gq-carte-titre {
  margin: 0;
  font-size: var(--texte-sm);
  font-weight: 600;
}

.gq-porteurs {
  padding: 1px 8px;
  border-radius: var(--radius-pilule);
  background: color-mix(in oklab, var(--c-offre) 12%, var(--background));
  color: color-mix(in oklab, var(--c-offre) 80%, var(--foreground));
  font-size: var(--texte-2xs);
  font-weight: 500;
  white-space: nowrap;
}

.gq-porteurs-vide {
  background: var(--muted);
  color: var(--muted-foreground);
}

.gq-carte-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--esp-2);
  border-top: 1px solid var(--border);
}

.gq-vide {
  margin: 0;
  padding: var(--esp-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.gq-porte {
  padding: var(--esp-3) var(--esp-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.gq-porteurs-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 var(--esp-2);
  padding: 0;
  list-style: none;
}

.gq-porteurs-liste li {
  padding: 2px 8px;
  border-radius: var(--radius-pilule);
  background: var(--muted);
  font-size: var(--texte-2xs);
}

.gq-supprimer {
  margin-left: auto;
  color: var(--destructive);
}

/* ── Les teintes des catégories ───────────────────────────────────────────── */
:root {
  --cat-ardoise: #64748b;
  --cat-bleu: #3b6fd4;
  --cat-sarcelle: #2a9d90;
  --cat-vert: #5f8f3e;
  --cat-ocre: #c9931d;
  --cat-corail: #e76e50;
  --cat-brique: #b4483c;
  --cat-prune: #8a5a9e;
  --cat-marine: #1f3d7a;
  --cat-ciel: #4aa3df;
  --cat-anis: #9bbd34;
  --cat-jaune: #e3bd2d;
  --cat-sable: #c2a678;
  --cat-chocolat: #6e4a2e;
  --cat-rose: #e07aa8;
  --cat-lavande: #9d8fe0;
}

[data-couleur="ardoise"] { --cat: var(--cat-ardoise); }
[data-couleur="bleu"] { --cat: var(--cat-bleu); }
[data-couleur="sarcelle"] { --cat: var(--cat-sarcelle); }
[data-couleur="vert"] { --cat: var(--cat-vert); }
[data-couleur="ocre"] { --cat: var(--cat-ocre); }
[data-couleur="corail"] { --cat: var(--cat-corail); }
[data-couleur="brique"] { --cat: var(--cat-brique); }
[data-couleur="prune"] { --cat: var(--cat-prune); }
[data-couleur="marine"] { --cat: var(--cat-marine); }
[data-couleur="ciel"] { --cat: var(--cat-ciel); }
[data-couleur="anis"] { --cat: var(--cat-anis); }
[data-couleur="jaune"] { --cat: var(--cat-jaune); }
[data-couleur="sable"] { --cat: var(--cat-sable); }
[data-couleur="chocolat"] { --cat: var(--cat-chocolat); }
[data-couleur="rose"] { --cat: var(--cat-rose); }
[data-couleur="lavande"] { --cat: var(--cat-lavande); }

.cat-point {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat, var(--muted-foreground));
}

.cat-point-grand {
  width: 12px;
  height: 12px;
}

/* La carte d'une catégorie porte sa teinte en pastille devant son nom — la même
   que dans la matrice —, pas en filet : la carte reste neutre. */
.gq-carte-titre {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Le choix de la teinte : seize pastilles sur deux rangées de huit, dans l'ordre du
   cercle des teintes ; une cochée. */
.cat-couleurs {
  display: grid;
  grid-template-columns: repeat(8, 30px);
  gap: 8px 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.cat-couleur {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
}

.cat-couleur input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cat-couleur .cat-point {
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
}

.cat-couleur:hover .cat-point {
  transform: scale(1.1);
}

.cat-couleur:has(:checked) {
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--cat);
}

.cat-couleur:has(:focus-visible) {
  outline: 2px solid var(--anneau-visible);
  outline-offset: 4px;
}

fieldset:disabled .cat-couleur {
  cursor: default;
}

/* La cascade de la demande, sous les trois qualités, sur toute la largeur. */
.gq-cascade {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: var(--esp-3);
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

/* Les produits d'une carte : les premiers, puis le compte du reste. */
.cat-porteurs {
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--texte-xs);
  line-height: 1.5;
}

/* ── Les tailles calculées, avec leur part de la demande ──────────────────── */
.gq-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
}

.gq-part {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.gq-part-pc {
  color: var(--muted-foreground);
  font-size: var(--texte-2xs);
  font-variant-numeric: tabular-nums;
}

.gq-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── La pastille de la matrice, et son survol ─────────────────────────────── */
.mx-entete [data-infobulle]::after {
  top: calc(100% + 6px);
  bottom: auto;
}

.gq-pastille {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pilule);
  background: var(--card);
  color: var(--foreground);
  font-size: var(--texte-2xs);
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--transition), background-color var(--transition);
}

.gq-pastille:hover {
  border-color: color-mix(in oklab, var(--foreground) 30%, var(--border));
}

.gq-pastille[data-etat="plm"] {
  border-style: dashed;
  color: var(--muted-foreground);
}

.gq-pastille[data-etat="incomplete"] {
  border-color: color-mix(in oklab, var(--c-alerte) 45%, var(--background));
  background: color-mix(in oklab, var(--c-alerte) 6%, var(--background));
}

.gq-pastille-nom {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gq-pastille-alerte {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--c-alerte);
  font-weight: 600;
}

.gq-points {
  display: inline-flex;
  flex: none;
  gap: 1.5px;
}

.gq-points i {
  width: 3px;
  height: 12px;
  border-radius: 1px;
  background: var(--q-neutre);
}

.gq-points i[data-q="central"] { background: var(--q-central); }
.gq-points i[data-q="neutre"] { background: var(--q-neutre); }
.gq-points i[data-q="extreme"] { background: #d4d4d4; }

/* LE SURVOL EST EN POSITION FIXE, placé par le script : la matrice défile en largeur,
   donc elle rogne tout ce qui dépasse d'elle — une carte posée en absolu dans une
   cellule y aurait été coupée sur les dernières lignes. */
.gq-survol,
.survol-carte {
  position: fixed;
  z-index: 70;
  display: none;
  flex-direction: column;
  gap: 8px;
  width: max-content;
  max-width: 480px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.25);
  font-weight: 400;
  white-space: normal;
  pointer-events: none;
}

.gq-pastille[data-survol] .gq-survol,
.survol-ancre[data-survol] .survol-carte {
  display: flex;
}

.gq-survol-titre {
  font-size: var(--texte-xs);
  font-weight: 600;
}

.gq-survol-alerte {
  font-size: var(--texte-2xs);
  color: var(--c-alerte);
}

/* ── Le panneau d'un produit : une carte par grille ───────────────────────── */
.gq-choix {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

.gq-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.gq-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.gq-option:hover {
  border-color: color-mix(in oklab, var(--foreground) 25%, var(--border));
}

.gq-option:has(:checked) {
  border-color: var(--foreground);
  box-shadow: 0 0 0 1px var(--foreground);
}

.gq-option:has(:focus-visible) {
  outline: 3px solid var(--anneau-visible);
  outline-offset: 2px;
}

.gq-option-refusee {
  cursor: not-allowed;
  background: var(--muted);
}

.gq-option-refusee .gq-bande {
  opacity: 0.55;
}

.gq-option-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-2);
}

.gq-option-titre {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--texte-xs);
  font-weight: 600;
}

.gq-option-titre::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--card);
}

.gq-option:has(:checked) .gq-option-titre::before {
  border: 4px solid var(--foreground);
}

.gq-statut {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--radius-pilule);
  font-size: var(--texte-2xs);
  font-weight: 500;
  white-space: nowrap;
}

.gq-statut[data-etat="ok"] {
  background: color-mix(in oklab, var(--c-offre) 12%, var(--background));
  color: color-mix(in oklab, var(--c-offre) 80%, var(--foreground));
}

.gq-statut[data-etat="manque"] {
  background: color-mix(in oklab, var(--c-alerte) 10%, var(--background));
  color: color-mix(in oklab, var(--c-alerte) 85%, var(--foreground));
  white-space: normal;
}

.gq-statut[data-etat="plm"] {
  background: var(--muted);
  color: var(--muted-foreground);
}

.gq-alerte {
  color: var(--c-alerte);
}

.gq-avertissement {
  background: color-mix(in oklab, var(--c-alerte) 8%, var(--background));
  color: color-mix(in oklab, var(--c-alerte) 80%, var(--foreground));
}

.gq-vers-categories {
  margin-left: auto;
}

/* Posé en page, le panneau n'a ni à se fermer ni à s'annuler : le lien de retour suffit. */
.gq-page [popovertarget] {
  display: none;
}

.gq-retour {
  margin: 0 0 var(--esp-1);
  font-size: var(--texte-xs);
}

.gq-retour a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-foreground);
  text-decoration: none;
}

.gq-page {
  max-width: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

@media (max-width: 900px) {
  .gq-tete,
  .gq-sens {
    grid-template-columns: 1fr;
  }
}

/* ══ L'ÉCRAN D'AUTORISATION DE L'ASSISTANT ═════════════════════════════════════
   Une carte, ce qu'elle ouvre et ce qu'elle n'ouvre pas, et deux boutons. */
.oa-cadre {
  max-width: 520px;
  margin: var(--esp-8) auto 0;
}

.oa-droits {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--texte-sm);
  line-height: 1.5;
}

.oa-droits li {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-2);
}

.oa-droits .ic {
  flex: none;
  margin-top: 3px;
}

.oa-oui .ic {
  color: var(--c-offre);
}

.oa-non .ic {
  color: var(--muted-foreground);
}

.oa-actions {
  display: flex;
  gap: var(--esp-2);
  margin-top: var(--esp-2);
}

.oa-attention {
  margin: 0;
}

/* ══ UNE CIBLE EN ATTENTE ════════════════════════════════════════════════════════
   13 novembre 2026 (000044). Une taille que la séance n'a pas pu calculer — une
   version neuve pas encore relevée par Shopify — garde une cible périmée : l'écran
   ne la compte pas, et le dit d'une horloge. Ambre discret, comme une attente, pas
   le rouge d'un manque. */
.cell-attente {
  display: inline-flex;
  vertical-align: -1px;
  margin-right: 4px;
  color: var(--c-attention);
}

.badge-attente {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-color: color-mix(in oklab, var(--c-attention) 35%, var(--background));
  background: color-mix(in oklab, var(--c-attention) 8%, var(--background));
  color: color-mix(in oklab, var(--c-attention) 85%, var(--foreground));
}

/* ── Les paramètres du réassort (13 novembre 2026) ─────────────────────────────
   UNE LIGNE SE LIT SANS RIEN OUVRIR : ce que le paramètre fait et ce qu'on risque
   à gauche, sa valeur au centre, ce avec quoi il joue à droite. Le panneau ne sert
   qu'à modifier.

   « MODIFIÉ » N'A PAS DE COULEUR DE CONSIGNE. Les couleurs de l'écran Offre sont un
   code — une consigne chacune —, et le bleu y dit « ventes modulées » : modifié se dit
   donc au premier plan, plein, et « par défaut » en sourdine, au trait. */
.pm-bilan {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--esp-1) var(--esp-4);
  margin-bottom: var(--esp-4);
  font-size: var(--texte-xs);
}

.pm-bilan p {
  margin: 0;
}

.pm-bilan-etat {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
}

.pm-bilan-etat::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--foreground);
}

.pm-bilan-etat[data-modifies="0"]::before {
  background: none;
  border: 1.5px solid var(--muted-foreground);
}

/* Le parcours du calcul : sept étapes dans l'ordre, chacune mène à sa section. */
.pm-chaine ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin: 0 0 var(--esp-2);
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}

.pm-chaine li {
  position: relative;
}

/* LA FLÈCHE ENTRE DEUX ÉTAPES est un coin dessiné, pas un glyphe : elle dit que
   chaque étape lit ce que la précédente a produit. */
.pm-chaine li + li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  z-index: 1;
  width: 11px;
  height: 11px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--card);
  transform: translateY(-50%) rotate(45deg);
}

.pm-chaine li + li {
  border-left: 1px solid var(--border);
}

.pm-chaine-pas {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 10px 14px 10px 16px;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--transition);
}

.pm-chaine-pas:hover {
  background: var(--muted);
}

.pm-chaine-pas:focus-visible {
  outline: 3px solid var(--anneau-visible);
  outline-offset: -3px;
}

.pm-chaine-titre {
  font-size: var(--texte-xs);
  font-weight: 600;
}

.pm-chaine-compte {
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
}

.pm-chaine-modif {
  color: var(--foreground);
  font-weight: 600;
}

/* ── Une étape ──────────────────────────────────────────────────────────────── */
.pm-etape {
  margin-top: var(--esp-8);
  scroll-margin-top: var(--esp-6);
}

.pm-etape-tete {
  display: grid;
  gap: var(--esp-1);
  margin-bottom: var(--esp-3);
}

.pm-etape-titre {
  margin: 0;
  font-size: var(--texte-lg);
  font-weight: 600;
  line-height: 1.3;
}

.pm-etape-quoi {
  margin: 0;
  max-width: 72ch;
  font-size: var(--texte-xs);
  line-height: 1.5;
  color: var(--muted-foreground);
}

.pm-etape-quand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
}

.pm-liste {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}

.pm-ligne {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(150px, 0.55fr) minmax(0, 1.2fr) 96px;
  grid-template-areas: "ident valeur liens action";
  gap: var(--esp-6);
  padding: var(--esp-4) var(--esp-6);
  scroll-margin-top: var(--esp-8);
  transition: background-color 0.6s ease-out;
}

.pm-ligne + .pm-ligne {
  border-top: 1px solid var(--border);
}

/* Le lien « joue avec » et le retour d'une modification mènent à la ligne : elle
   s'éclaire, le temps qu'on la trouve. */
.pm-ligne:target {
  background: color-mix(in oklab, var(--foreground) 4%, var(--card));
}

.pm-ident {
  grid-area: ident;
  min-width: 0;
}

.pm-titre {
  margin: 0 0 var(--esp-1);
  font-size: var(--texte-sm);
  font-weight: 600;
  line-height: 1.35;
}

.pm-quoi {
  margin: 0;
  max-width: 64ch;
  font-size: var(--texte-xs);
  line-height: 1.5;
  color: var(--muted-foreground);
}

.pm-prudence {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: var(--esp-2) 0 0;
  max-width: 64ch;
  font-size: var(--texte-2xs);
  line-height: 1.45;
  color: color-mix(in oklab, var(--c-attention) 78%, var(--foreground));
}

.pm-prudence .ic {
  flex: none;
  margin-top: 1px;
  color: var(--c-attention);
}

.pm-valeur {
  grid-area: valeur;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.pm-valeur p {
  margin: 0;
}

.pm-chiffre {
  display: flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1.1;
}

.pm-nombre {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.pm-chiffre-choix .pm-nombre {
  font-size: var(--texte-sm);
  letter-spacing: 0;
}

.pm-unite {
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.pm-etat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pilule);
  font-size: var(--texte-2xs);
  font-weight: 600;
  color: var(--muted-foreground);
}

.pm-etat::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.pm-etat[data-etat="modifie"] {
  border-color: transparent;
  background: var(--foreground);
  color: var(--background);
}

.pm-etat[data-etat="modifie"]::before {
  border: 0;
  background: currentColor;
}

.pm-defaut,
.pm-pourquoi {
  font-size: var(--texte-2xs);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.pm-pourquoi {
  max-width: 28ch;
  color: var(--foreground);
  line-height: 1.4;
}

.pm-auteur {
  color: var(--muted-foreground);
}

/* « Joue avec » : chaque lien porte la valeur du moment de l'autre paramètre. */
.pm-liens {
  grid-area: liens;
  min-width: 0;
}

.pm-liens-titre {
  margin: 0 0 6px;
  font-size: var(--texte-2xs);
  font-weight: 600;
  color: var(--muted-foreground);
}

.pm-liens-liste {
  display: grid;
  gap: var(--esp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pm-liens-liste li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  font-size: var(--texte-xs);
}

.pm-lien,
.pm-lien-nom {
  font-weight: 500;
  color: var(--foreground);
}

.pm-lien {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.pm-lien:hover {
  text-decoration-color: currentColor;
}

.pm-lien-ecran {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.pm-lien-valeur {
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  font-size: var(--texte-2xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pm-lien-dit {
  flex-basis: 100%;
  font-size: var(--texte-2xs);
  line-height: 1.4;
  color: var(--muted-foreground);
}

.pm-action {
  grid-area: action;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

/* Ce qui ne se règle pas : en sourdine, au trait, à la fin. */
.pm-fixe {
  margin-top: var(--esp-8);
  padding: var(--esp-4) var(--esp-6);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--texte-xs);
  line-height: 1.55;
  color: var(--muted-foreground);
}

.pm-fixe p {
  margin: 0;
  max-width: 78ch;
}

.pm-fixe p + p {
  margin-top: var(--esp-2);
}

.pm-fixe strong {
  color: var(--foreground);
  font-weight: 600;
}

.pm-fixe-titre {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--esp-2);
  font-size: var(--texte-xs);
  font-weight: 600;
  color: var(--foreground);
}

.pm-poids {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

/* ── Dans le panneau ────────────────────────────────────────────────────────── */
.pm-tiroir-quoi {
  margin: 0;
  font-size: var(--texte-xs);
  line-height: 1.55;
}

.pm-refus {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-2);
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--destructive) 9%, var(--background));
  color: color-mix(in oklab, var(--destructive) 85%, var(--foreground));
  font-size: var(--texte-xs);
  font-weight: 500;
  line-height: 1.45;
}

.pm-refus .ic {
  flex: none;
  margin-top: 2px;
}

/* Le champ garde sa largeur de nombre : étiré sur le panneau, son unité partait au bord droit,
   loin du chiffre qu'elle qualifie. */
.tiroir .pm-champ {
  align-self: flex-start;
  width: 180px;
}

.pm-champ .input {
  padding-right: 64px;
}

.pm-options {
  display: grid;
  gap: var(--esp-2);
}

.pm-tiroir-liens .tiroir-label {
  margin: 0 0 var(--esp-2);
}

.pm-regle {
  margin: 0;
  font-size: var(--texte-2xs);
}

@media (max-width: 1180px) {
  .pm-ligne {
    grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
    grid-template-areas:
      "ident valeur"
      "liens action";
    row-gap: var(--esp-3);
  }
}

@media (max-width: 640px) {
  .pm-ligne {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "ident" "valeur" "liens" "action";
    padding: var(--esp-4);
  }

  .pm-action {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pm-ligne,
  .pm-chaine-pas {
    transition: none;
  }
}

/* ── Ajouter un magasin (13 novembre 2026) ─────────────────────────────────────
   Les emplacements libres sont des cartes de choix, comme les consignes : on lit le nom, le
   numéro qu'on retrouvera chez Shopify, et s'il y est encore désactivé. */
.mg-emplacements {
  display: grid;
  gap: var(--esp-2);
}

.mg-emplacement .choix-carte-aide .mono {
  font-variant-numeric: tabular-nums;
}

.mg-emplacements-vide {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-2);
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: var(--texte-xs);
  line-height: 1.45;
}

.mg-emplacements-vide .ic {
  flex: none;
  margin-top: 2px;
}

.mg-emplacement-num {
  width: 220px;
}

.mg-chargement {
  margin: 0;
}

.mg-aide-serree {
  margin-top: calc(-1 * var(--esp-4));
}

.tiroir .mg-date {
  width: 180px;
}

/* ══ LES ANNONCES (13 novembre 2026) ═════════════════════════════════════════════
   Ce qui vient de se passer, en bas à gauche, contre la barre de navigation : les
   panneaux de réglage s'ouvrent à droite, et une annonce n'a pas à passer dessous.

   UNE CARTE SOMBRE SUR UN ÉCRAN CLAIR. Tout le reste de Gná est du contenu — des
   chiffres à lire ; une annonce est un retour, et elle ne doit ressembler à aucune
   cellule. Le ton se lit à la pastille de gauche et au filet du bas, dans le code
   de l'écran : vert fait, bleu en cours, ambre à voir, rouge raté.

   LE FILET DU BAS EST LE TEMPS QUI RESTE. Il se vide, s'arrête au survol, et sa
   fin ferme l'annonce (gna.js écoute `animationend`) : un seul minuteur, et il se
   voit. Une annonce persistante n'en a pas. */
.annonces {
  position: fixed;
  left: calc(var(--largeur-barre) + var(--esp-4));
  bottom: var(--esp-4);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
  width: min(380px, calc(100vw - 2 * var(--esp-4)));
  pointer-events: none;
}

.annonces:empty,
.annonces-place:empty {
  display: none;
}

.annonces-place {
  display: contents;
}

.annonce {
  --c: var(--c-offre);
  --ton: color-mix(in oklab, var(--c) 72%, white);
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 2px 10px;
  padding: 12px 10px 12px 12px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--foreground) 94%, var(--c));
  color: var(--background);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.12),
    0 12px 32px -8px rgb(0 0 0 / 0.35);
  font-size: var(--texte-sm);
  pointer-events: auto;
  animation: annonce-entre 260ms cubic-bezier(0.25, 1, 0.5, 1) both;
}

.annonce[data-ton="cours"] { --c: var(--c-variation); }
.annonce[data-ton="info"] { --c: var(--muted-foreground); --ton: color-mix(in oklab, var(--background) 80%, transparent); }
.annonce[data-ton="attention"] { --c: var(--c-attention); }
.annonce[data-ton="erreur"] { --c: var(--c-alerte); }

/* Elle remplace l'annonce « en cours » à la même place : pas d'entrée, la pastille
   change seule. */
.annonce[data-suite] {
  animation: none;
}

.annonce[data-suite] .annonce-icone {
  animation: annonce-pastille 320ms cubic-bezier(0.25, 1, 0.5, 1) both;
}

.annonce[data-sortie] {
  animation: annonce-sort 180ms ease-in both;
}

.annonce-icone {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--c) 30%, transparent);
  color: var(--ton);
}

.annonce-icone .ic {
  width: 13px;
  height: 13px;
}

.annonce-pouls {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ton);
  animation: annonce-pouls 1.1s ease-in-out infinite;
}

.annonce-texte {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 2px;
}

.annonce-titre {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

.annonce-detail {
  margin: 0;
  font-size: var(--texte-xs);
  line-height: 1.45;
  color: color-mix(in oklab, var(--background) 68%, transparent);
}

.annonce-action {
  align-self: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid color-mix(in oklab, var(--background) 25%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--background) 8%, transparent);
  color: var(--background);
  font: inherit;
  font-size: var(--texte-xs);
  font-weight: 600;
  line-height: 24px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition);
}

.annonce-action:hover {
  background: color-mix(in oklab, var(--background) 18%, transparent);
}

.annonce-fermer {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: color-mix(in oklab, var(--background) 55%, transparent);
  cursor: pointer;
  transition: color var(--transition), background-color var(--transition);
}

.annonce-fermer:hover {
  background: color-mix(in oklab, var(--background) 12%, transparent);
  color: var(--background);
}

.annonce-action:focus-visible,
.annonce-fermer:focus-visible {
  outline: 2px solid var(--ton);
  outline-offset: 1px;
}

.annonce-temps {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--ton);
  opacity: 0.85;
  transform-origin: left;
  animation: annonce-temps var(--duree, 5s) linear both;
}

.annonce:hover .annonce-temps,
.annonce:focus-within .annonce-temps {
  animation-play-state: paused;
}

/* Au-delà de quatre, les plus anciennes se taisent : une pile n'est pas un journal. */
.annonces > .annonce:nth-last-child(n + 5) {
  display: none;
}

@keyframes annonce-entre {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

@keyframes annonce-sort {
  to {
    opacity: 0;
    transform: translateX(-12px);
  }
}

@keyframes annonce-pastille {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

@keyframes annonce-pouls {
  50% {
    transform: scale(0.6);
    opacity: 0.45;
  }
}

@keyframes annonce-temps {
  to {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .annonce,
  .annonce[data-sortie],
  .annonce[data-suite] .annonce-icone,
  .annonce-pouls {
    animation: none;
  }

  /* Le temps reste : sans lui, l'annonce ne se fermerait plus. Il ne bouge plus,
     il pâlit. */
  .annonce-temps {
    animation-name: annonce-temps-calme;
  }

  @keyframes annonce-temps-calme {
    to {
      opacity: 0;
    }
  }
}

@media (max-width: 900px) {
  .annonces {
    left: var(--esp-4);
  }
}


/* ══ L'ÉCRAN DES DONNÉES (13 novembre 2026) ══════════════════════════════════════
   Quatre tableaux de tâches qui se suivent : mêmes colonnes, mêmes largeurs, pour
   que « Lus » tombe sous « Lus » d'un tableau à l'autre. Un bilan à côté de chaque
   titre, et le geste de chaque ligne à la même place. */
.dn-titre {
  display: flex;
  align-items: baseline;
  gap: var(--esp-3);
}

.dn-bilan {
  --c: var(--succes);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--texte-xs);
  font-weight: 500;
  color: var(--muted-foreground);
}

.dn-bilan[data-etat="echec"] {
  --c: var(--c-alerte);
  color: color-mix(in oklab, var(--c) 85%, var(--foreground));
}

.dn-bilan[data-etat="cours"] { --c: var(--c-variation); }
.dn-bilan[data-etat="attention"] { --c: var(--c-attention); }
.dn-bilan[data-etat="jamais"] { --c: color-mix(in oklab, var(--muted-foreground) 60%, var(--background)); }

.dn-bilan-point {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
}

.dn-bilan[data-etat="cours"] .dn-bilan-point {
  animation: source-bat 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .dn-bilan[data-etat="cours"] .dn-bilan-point {
    animation: none;
  }
}

.table-taches {
  table-layout: fixed;
}

.dn-col-tache { width: 230px; }
.dn-col-etat { width: 128px; }
.dn-col-passage { width: 150px; }
.dn-col-n { width: 72px; }
.dn-col-action { width: 112px; }

.table-taches td {
  vertical-align: top;
}

.table-taches .cell-valeur strong {
  overflow-wrap: anywhere;
}

/* Le récapitulatif prend toute la place qui reste, toujours borné à trois lignes. */
.table-taches .recap {
  max-width: none;
}

.table-taches .badge + .badge {
  margin-top: 4px;
}

.table-taches td.dn-action {
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.dn-action form {
  display: inline-flex;
}

.dn-cron {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
  cursor: help;
}

/* ══ L'ÉCRAN DES STOCKS (13 novembre 2026, refait le 16) ═════════════════════════
   Quatre couvertures côte à côte sous un même chapeau. Le surstock en une seule
   teinte, l'ambre : plus il est appuyé, plus la ref. co. dort. La colonne triée
   est la seule en gras. La section « réservation retail » de l'écran Données
   emprunte les mêmes classes. */
.st-lexique {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-2) var(--esp-6);
  margin: 0 0 var(--esp-4);
  padding: var(--esp-3) var(--esp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--muted) 40%, var(--background));
  font-size: var(--texte-xs);
}

.st-lexique > div {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.st-lexique dt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  white-space: nowrap;
}

.st-lexique dd {
  margin: 0;
  color: var(--muted-foreground);
}

.st-pastille {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: color-mix(in oklab, var(--chart-4) 46%, var(--background));
  border: 1px solid color-mix(in oklab, var(--chart-4) 70%, var(--background));
}

.st-groupes th {
  padding-bottom: 0;
  border-bottom: 0;
}

.st-groupe {
  text-align: center !important;
  font-size: var(--texte-2xs);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border) !important;
}

.st-th-tri a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  white-space: normal;
  text-align: right;
}

.st-th-tri a:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.st-th-tri[data-choisie] {
  color: var(--foreground);
}

.st-bilan-surstock {
  color: color-mix(in oklab, var(--c-attention) 85%, var(--foreground));
}

.st-bilan a {
  color: inherit;
}

.st-col-n-large { width: 120px; }
.st-col-produit { width: 24%; }
.st-col-couleur { width: 16%; }
.st-col-n { width: 76px; }
/* Les quatre semaines, étroites : quatre chiffres qui se lisent ensemble (20 novembre 2026). */
.st-col-s { width: 46px; }
.st-col-moy { width: 72px; }
.st-col-couv { width: 104px; }
.st-col-tailles { width: 18%; }
.st-col-produit-court { width: 22%; }
.st-col-couleur-court { width: 12%; }

.st-produit {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  min-width: 0;
}

.st-produit > :last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-lien {
  color: inherit;
  font-weight: 500;
  text-decoration: none;
}

.st-lien:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.st-table th[data-choisie] {
  color: var(--foreground);
}

.st-couv {
  --c: var(--c-attention);
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

.st-couv[data-choisie] {
  color: var(--foreground);
  font-weight: 600;
}

/* LE SURSTOCK EST UN FOND DE CASE, PAS UN TEXTE COLORÉ (20 novembre 2026) : le chiffre garde l'encre
   du tableau, la case se teinte — à peine au seuil, un cran de plus au double. */
.st-couv[data-niveau="1"] {
  background: color-mix(in oklab, var(--chart-4) 22%, var(--background));
}

.st-couv[data-niveau="2"] {
  background: color-mix(in oklab, var(--chart-4) 46%, var(--background));
}

/* Les semaines brutes, en sourdine ; la base de la couverture — S-1 ou la moyenne — ressort. */
.st-sem {
  color: var(--muted-foreground);
}

.st-table [data-base] {
  color: var(--foreground);
  font-weight: 600;
  background: color-mix(in oklab, var(--muted) 60%, var(--background));
}

/* La sélection sommée, en tête du tableau. */
.st-total th,
.st-total td {
  font-weight: 600;
  color: var(--foreground);
  background: color-mix(in oklab, var(--muted) 85%, var(--background));
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.st-total th {
  text-align: left;
}

.st-base {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
}

.st-bilan {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin: 0 0 var(--esp-3);
  font-size: var(--texte-sm);
  color: var(--muted-foreground);
}

.st-bilan strong {
  color: var(--foreground);
}

.st-bilan-ecart,
.st-bilan-ecart strong {
  color: color-mix(in oklab, var(--c-attention) 80%, var(--foreground));
}

.st-bilan[data-etat="ok"] {
  align-items: center;
  color: color-mix(in oklab, var(--c-offre) 80%, var(--foreground));
}

.st-ecart {
  font-weight: 700;
  color: color-mix(in oklab, var(--c-attention) 85%, var(--foreground));
}

.st-tailles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.st-taille {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid color-mix(in oklab, var(--c-attention) 30%, var(--background));
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--c-attention) 7%, var(--background));
  font-size: var(--texte-2xs);
  font-weight: 500;
}

.st-taille-n {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in oklab, var(--c-attention) 85%, var(--foreground));
}

.st-cause {
  line-height: 1.5;
}

/* Une taille en écart est un bouton : son survol ouvre ses SKU, son clic copie leurs codes
   (18 novembre 2026). */
button.st-taille {
  font: inherit;
  font-size: var(--texte-2xs);
  font-weight: 500;
  color: inherit;
  cursor: pointer;
}

button.st-taille:hover,
button.st-taille:focus-visible {
  border-color: color-mix(in oklab, var(--c-attention) 60%, var(--background));
}

.dn-skus-grille {
  display: grid;
  grid-template-columns: auto auto auto auto auto;
  align-items: baseline;
  gap: 4px 14px;
  font-variant-numeric: tabular-nums;
}

.dn-skus-grille .num {
  text-align: right;
}

.dn-skus-tete {
  color: var(--muted-foreground);
  font-weight: 500;
}

.dn-skus-code {
  font-weight: 600;
}

.dn-skus-code[data-sans-ecart] {
  font-weight: 400;
  color: var(--muted-foreground);
}

/* Ce qui prend le stock du SKU, sous sa ligne. */
.dn-skus-cause {
  grid-column: 1 / -1;
  margin-top: -2px;
  padding-bottom: 4px;
  color: var(--muted-foreground);
}

/* ── Les cartes de survol de l'écran des stocks (17 novembre 2026) ─────────── */
.st-ancre {
  cursor: default;
}

.st-ancre.tronque {
  display: block;
}

.st-ancre .st-lien,
.st-ancre-texte {
  text-decoration: underline dotted color-mix(in oklab, var(--muted-foreground) 50%, transparent);
  text-underline-offset: 3px;
}

.st-carte {
  min-width: 260px;
  font-size: var(--texte-xs);
  text-align: left;
}

/* Toute la case ouvre la carte, pas seulement son chiffre. */
.st-couv .survol-ancre {
  display: block;
}

.st-carte-titre {
  font-weight: 600;
}

.st-carte-magasins {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px 10px;
}

.st-carte-magasins .rg-badge {
  height: 18px;
  padding: 0 6px;
}

.st-carte-nom-hors {
  color: var(--muted-foreground);
}

.st-carte-stock {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--muted-foreground);
}

.st-carte-pied {
  color: var(--muted-foreground);
}

.st-carte-tailles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.st-carte-taille {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--muted);
  font-weight: 600;
}

.st-carte-calcul {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 2px 12px;
  font-variant-numeric: tabular-nums;
}

.st-carte-calcul dt {
  color: var(--muted-foreground);
}

.st-carte-calcul dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

/* ── À rapprocher, sur l'écran des commandes (18 novembre 2026, revue R4) ───────────────────── */
.rapprochement {
  margin-bottom: var(--esp-6);
}

.rapprochement-aide {
  margin: 0 0 var(--esp-3);
}

.rapprochement-manque .badge + .badge {
  margin-left: 4px;
}

.rapprochement-forme {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--esp-2);
}

.rapprochement-forme .input {
  width: 150px;
}

/* ── Publier : la proposition (20 novembre 2026). Les chiffres de ce qui part, puis le tableau
   catégories × magasins, posé seul dans son cadre — plus de tableau encadré dans une carte, dont
   les deux bords se doublaient. */
/* La page entière est bornée : sur un grand écran, quatre colonnes de chiffres étalées sur toute
   la largeur s'éloignaient de leur libellé, et les gestes du haut d'un tableau qui s'arrêtait avant. */
.pb-page {
  max-width: 1080px;
}

.pb-proposition {
  display: flex;
  flex-direction: column;
  gap: var(--esp-4);
}

.pb-resume {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

.pb-meta {
  font-size: var(--texte-xs);
  color: var(--muted-foreground);
}

.pb-table {
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}

/* La colonne des catégories a sa largeur, les magasins se partagent le reste à parts égales. */
.pb-table thead th:first-child {
  width: 240px;
}

.pb-table thead th {
  white-space: normal;
  line-height: 1.25;
}

.pb-table thead th {
  font-weight: 600;
}

.pb-table tbody th {
  padding: 0 var(--pad-cellule);
  text-align: left;
  font-weight: 400;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.pb-table tbody td {
  height: 33px;
  padding: 4px var(--pad-cellule);
}

/* La colonne Total se détache d'un fond, pas d'une couleur : c'est une somme, pas un état. */
.pb-table .pb-total {
  background: var(--muted);
  font-weight: 500;
}

.pb-table tbody tr:hover td.pb-total {
  background: color-mix(in oklab, var(--muted) 70%, var(--foreground) 6%);
}

/* La charge des magasins ouvre le tableau, séparée du détail par un trait appuyé. */
.pb-charges th {
  font-weight: 500;
  color: var(--muted-foreground);
}

.pb-charges tr:last-child th,
.pb-charges tr:last-child td {
  border-bottom: 2px solid var(--border);
}

/* Un contexte — Homme, Femme, Mixte — est un en-tête avec son sous-total. */
.pb-contexte th,
.pb-contexte td {
  background: var(--secondary);
  font-weight: 600;
}

.pb-contexte th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--texte-2xs, 11px);
  color: var(--muted-foreground);
}

.pb-groupe tr:not(.pb-contexte) th {
  padding-left: calc(var(--pad-cellule) + var(--esp-2));
}

.pb-cat {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
}

.pb-pastille {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--cat, var(--muted-foreground));
  flex: none;
}

.pb-aide {
  margin-top: var(--esp-4);
}

/* L'état vide dans la grille de l'arbitrage occupe toute la rangée. */
.cell-vide-etat {
  justify-content: center;
}

/* ── La confirmation d'un geste (revue R241) : une carte de l'application, centrée, au-dessus d'un
   voile. Elle remplace la boîte native du navigateur. */
.confirmation {
  width: min(420px, calc(100vw - 2 * var(--esp-4)));
  padding: var(--esp-4);
  box-shadow: 0 12px 32px color-mix(in oklab, var(--foreground) 14%, transparent);
}

.confirmation::backdrop {
  background: color-mix(in oklab, var(--foreground) 22%, transparent);
}

.confirmation-texte {
  margin: 0 0 var(--esp-4);
  font-size: var(--texte-sm);
  line-height: 1.5;
}

.confirmation-gestes {
  display: flex;
  justify-content: flex-end;
  gap: var(--esp-2);
}
