/*
 * Ter@conso : feuille de style commune des écrans (F84).
 *
 * Charte tirée du logo (27 octobre 2026) : le bois brun de la cagette et ses fruits
 * dorés, d'après le logo de Ter@plant fourni par Paul (docs/marque/teraplant.png) ; le
 * logo de Ter@conso est celui de Thomas (29 octobre 2026, docs/marque/thomas-2026-10-29/ ;
 * fichiers de la marque dans static/marque/, écrits par outils/marque.py). Mise en page
 * des maquettes (docs/maquettes/terconso-accueil.html et
 * terconso-preparation-commande.html) : titres et chiffres en Archivo à largeur variable,
 * texte courant en Atkinson Hyperlegible, lisible au soleil. Tout se fait au doigt, sur
 * tablette : aucune cible tactile de moins de 44 px. Sobre et chaleureux : ni dégradé, ni
 * animation gratuite ; une ombre à peine visible sous les cartes.
 *
 * Le guide des écrans (docs/guide-des-ecrans.md) décrit les jetons et les composants
 * de cette feuille, avec leurs classes : c'est lui que suivent les nouveaux écrans.
 *
 * Aucune ressource tierce : les polices sont servies par le serveur lui-même
 * (static/fonts/, licences OFL à côté des fichiers), les icônes et la marque aussi
 * (static/icones/, static/marque/).
 *
 * Sommaire
 *   1. Polices
 *   2. Jetons : couleurs (clair, sombre), typographie, espacements, rayons, ombres
 *   3. Base
 *   4. Mise en page
 *   5. Bandeau, choix du site et de la campagne, intervention du support
 *   6. Boutons et gestes du jour
 *   7. Pastilles et filtres
 *   8. Cartes et listes
 *   9. Tableaux
 *  10. Formulaires
 *  11. Messages et alertes
 *  12. Connexion et pages d'erreur
 *  13. Utilitaires
 *  14. Référentiels : recherche, fenêtre superposée
 *  15. Petits écrans, contraste renforcé, mouvement, impression
 */

/* 1. Polices ------------------------------------------------------------------ */

/* Archivo, police variable : graisse 100 à 900, largeur 62 % à 125 % (font-stretch). */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo/archivo-latin-ext-wdth-normal.589f7bc0fac4.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo/archivo-latin-wdth-normal.de2f1fe81758.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Atkinson Hyperlegible : normal et gras, droit et italique. Le jeu « latin »
   couvre le français (é, œ, €, espace insécable U+00A0 des milliers, celle du format
   de Django en français, pour les prix comme pour les poids) ; « latin-ext » n'est
   téléchargé que si un nom en a besoin. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-400-normal.fe905e20f857.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-400-normal.f1f8a8210104.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-700-normal.764b69c9ccc8.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-700-normal.13a58e05dfd2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-400-italic.43bf22741c7e.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-400-italic.de4c0c22fd4e.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-display: swap;
  font-weight: 700;
  src: url("../fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-700-italic.adf2b701fc29.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-display: swap;
  font-weight: 700;
  src: url("../fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-700-italic.4a631a0a40b7.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. Jetons ------------------------------------------------------------------- */

/* Charte tirée du logo (27 octobre 2026) : le bois brun de la cagette et ses fruits dorés,
   relevés au pixel sur le logo de Ter@plant (docs/marque/teraplant.png : #783b14, #feb701 ;
   les SVG de Thomas du 29 octobre portent #784019 et #FFBF00, un écart qui ne se voit pas).
   Thème « Chocolat » (30 octobre 2026, choisi par Paul et Thomas, qui trouvait le brun de
   l'en-tête « un peu trop clair, tout comme le beige clair derrière ») : le bandeau, ses deux
   rangées et les aplats prennent un chocolat, le bois du logo en plus profond (--terre,
   --bande-contexte) ; le brun du logo reste à --marque et aux fichiers de Thomas ; les fonds
   perdent leur jaune (blanc lin). Clair par défaut, même sur un appareil réglé en sombre
   (demande de Thomas du 15 octobre 2026 : « éclaircir l'application ») : le thème sombre
   n'est pris que par le choix « Thème : sombre » du menu du compte, retenu par l'appareil,
   que le serveur écrit en data-theme="dark" sur <html> (comptes.theme). Un écran n'écrit
   jamais une couleur en dur : il prend un jeton. Contrastes WCAG entre parenthèses, détaillés
   dans docs/guide-des-ecrans.md. Sur un plan, jamais --chair ni --chair-fonce (ΔE 11 et 3,3
   avec l'Orange des variétés), ni --terre ni ses alias (--contour, --anneau, --aplat-fort : le
   chocolat, ou en sombre le brun du logo, trop proches du Brun) : --chair-plan,
   --chair-plan-fonce, --trait-plan, --anneau-plan. */
:root {
  /* Marque */
  --terre: #45220f;          /* chocolat, le bois du logo en plus profond : bandeau, toast, bulles, contour, anneau ; en clair, les aplats (crème 12,93 ; or 8,05 ; blanc du logo 14,11) */
  --terre-trait: #6b3d22;    /* filets et contours des pastilles du bandeau (1,56 contre lui), survol du bouton fort (crème 8,31) */
  --terre-support: #2f2a26;  /* graphite : bandeau du support de l'éditeur (crème 13,0 ; or 8,1) */
  --bande-support: #252120;  /* le panneau de sa pastille, un graphite plus sombre (crème 14,61 ; texte secondaire 11,17 ; or 9,10) */
  --trait-support: #4d4743;  /* filets et contours du bandeau du support, à la place de --terre-trait (1,55 contre --terre-support ; 1,74 sur --bande-support) */
  --sur-terre: #fcf4e8;      /* texte sur le bandeau (12,93 ; 14,70 sur la seconde rangée) */
  --sur-terre-doux: #e8d5c0; /* texte secondaire sur le bandeau (9,88 ; 11,23 sur la seconde rangée) */
  --chair: #feb701;          /* or du logo : @, action principale, site et page choisis, liserés « en cours ». Jamais en texte ni en trait seul sur fond clair (1,75) ; jamais sur un plan */
  --chair-fonce: #eba600;    /* survol de l'action principale (texte 7,19) ; jamais sur un plan */
  --chair-pale: #fff1c7;     /* avertissement, ligne nouvelle, en-valeur (texte 14,48) */
  --sur-chair: #3d1e0a;      /* texte sur l'or (8,63), dans les deux thèmes */
  --sur-chair-doux: #6b3410; /* texte secondaire sur l'or (5,64) */
  --marque: #783b14;         /* brun du logo : bois et lettres du logo complet (partiels/logo.html) sur une carte (8,63 sur blanc) */

  /* Plans (.batiment et leurs légendes) : l'ancienne chair, validée par Thomas, la même dans
     les deux thèmes, distincte de toute variété (referentiel.couleurs). */
  --chair-plan: #f2cf6b;       /* destination, choix en cours, cadre de sélection (ΔE ≥ 26,6 avec toute variété) */
  --chair-plan-fonce: #e8c55a; /* circulation, pile choisie du plan de récolte (ΔE ≥ 24) */
  --trait-plan: #3a2a1f;       /* trait des piles et de leurs pastilles : un plan ne change pas d'aspect */
  --anneau-plan: var(--trait-plan); /* anneau de focus d'une pile, d'un obstacle (au clavier) : celui d'avant la charte */
  /* Palox vides sur un plan (demande du 29 octobre 2026, n° 7) : un fond neutre et clair par
     catégorie, le même dans les deux thèmes, distinct des variétés et des calibres
     (referentiel.couleurs : des teintes vives, le gris moyen du « sans calibre ») ; le texte
     posé dessus : --trait-plan. */
  --vides-propres: #dde8ee;    /* bleu-gris pâle */
  --vides-sales: #ddcdb6;      /* sable */
  --vides-a-reparer: #ecd3d3;  /* rose-gris pâle */
  /* Des palox vides quand l'exploitation a masqué l'option « Palox vides » (retour de Thomas
     du 17 novembre 2026, point 1) : l'emplacement occupé, sans catégorie. */
  --sans-lot: #e2e0dc;         /* gris pâle */

  /* Bois */
  --peau: #b5763f;           /* filet des messages d'information, bords au survol, contours pointillés du plan (3,73 : jamais un texte ni un souligné) */
  /* Soulignés des liens (lot t73, question 8, accord de Thomas du 30 octobre 2026 : « passer
     les soulignés au chocolat ») : fil d'Ariane et sa flèche « ‹ », liens des tableaux, des
     états, des expéditions, du rappel, soulignés au survol. Le chocolat du thème (--terre,
     même teinte) éclairci : 7,27 sur blanc, 6,56 sur --sillon, 6,02 sur --sous-total ; 2,24
     contre --texte, le trait se distingue du texte qu'il souligne. Jamais sur un plan. */
  --souligne: #7d4a2c;
  --peau-texte: #95541f;     /* la peau en texte (renvois « * ») : 5,89 sur blanc */
  --peau-pale: #f1e3d1;      /* pastille neutre, message d'information, préfixe (texte 12,92) */

  /* Sens */
  --fane: #3f6b35;           /* stock disponible, réussite, état actif (6,24 sur blanc) */
  --fane-pale: #dfe8d6;      /* réussite */
  --gel: #b42318;            /* alerte : stock négatif, erreur, action dangereuse (6,57) */
  --gel-pale: #f8e1dd;       /* erreur */

  /* Neutres : un blanc lin, à peine teinté de brun (sans le jaune d'avant le 30 octobre) */
  --sillon: #f5f3ef;         /* fond des pages, blanc lin (texte 14,71 ; doux 7,34) */
  --surface: #ffffff;        /* cartes, champs, tableaux */
  --surface-2: #f8f6f2;      /* survol, codes, carte dans une carte (doux 7,54) */
  --texte: #2b1d14;          /* 16,30 sur blanc */
  --doux: #5e4c3f;           /* texte secondaire, aides, libellés discrets (8,13 sur blanc) */
  --trait: #ddd6cc;          /* bordures des cartes, décor */
  --trait-fort: #b0a596;     /* filet sous l'en-tête d'un tableau, au-dessus d'un total */
  --filet: #ebe6df;          /* filet entre les lignes d'un tableau */
  --bord-champ: #94806b;     /* contour d'un champ de saisie (3,78 sur blanc ; 4,01 en sombre) */
  /* Tableaux et états : en-tête, une ligne sur deux, survol d'une ligne, sous-total. */
  --entete: #efebe5;         /* doux 6,85 */
  --zebre: #faf9f6;          /* doux 7,73 */
  --survol: #fff5d9;         /* or lavé (doux 7,48) */
  --sous-total: #efe9e1;     /* doux 6,75 ; peau-texte 4,88 */
  --bande-contexte: #361a0b; /* panneau de la pastille du bandeau (ex-seconde rangée), un chocolat plus sombre : exploitation, campagne, site (crème 14,70 ; texte secondaire 11,23) */
  /* Couleur d'une variété (referentiel.couleurs, la même dans les deux thèmes) : le texte
     posé dessus, noir ou blanc selon sa clarté, et le filet qui la détache du fond. */
  --sur-couleur-claire: #000000;
  --sur-couleur-foncee: #ffffff;
  --filet-couleur: rgb(43 29 20 / .32);
  --contour: var(--terre); /* contour des boutons secondaires et des tuiles (14,11 sur blanc) */
  --anneau: var(--terre);  /* anneau de focus hors du bandeau et des plans (--anneau-plan) */
  /* Aplat brun posé sur une surface : bouton fort, filtre actif, zoom choisi, recherche
     ouverte, choix proposé, numéro d'étape ; son bord est --contour. Le chocolat en clair
     (crème dessus 12,93) ; en sombre, le brun du logo, jamais le bandeau sombre, qui se
     perdrait sur la surface. */
  --aplat-fort: var(--terre);
  --ombre: 0 1px 2px rgb(61 30 10 / .07), 0 3px 10px rgb(61 30 10 / .05); /* cartes */
  --ombre-fenetre: 0 18px 48px rgb(30 15 5 / .35);
  --chevron: url("../icones/chevron.9741d57b91be.svg"); /* flèche des listes de choix */

  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --corps: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  /* Échelle des textes : petit (aides, pastilles, en-têtes), courant, grand (saisies). */
  --texte-petit: 15px;
  --texte-courant: 17px;
  --texte-grand: 19px;

  /* Espacements : 4, 8, 12, 16, 24, 32. */
  --esp-1: 4px;
  --esp-2: 8px;
  --esp-3: 12px;
  --esp-4: 16px;
  --esp-5: 24px;
  --esp-6: 32px;
  --rayon: 12px;           /* boutons, champs, tableaux, messages */
  --rayon-petit: 8px;      /* chips, codes */
  --rayon-grand: 16px;     /* cartes, tuiles, fenêtres */
  --cible: 44px;           /* cible tactile minimale */
  --cible-champ: 52px;     /* hauteur des champs de saisie et des boutons */
  --largeur: 1120px;       /* largeur utile des écrans */
  color-scheme: light;
}
/* Thème sombre : seulement au choix de l'appareil (jamais d'après prefers-color-scheme). Le
   thème « Chocolat » du 30 octobre 2026 n'a pas changé ses jetons, hormis --bande-support (la
   seconde rangée du support, qui y était brune sous le graphite), --trait-support et
   --souligne (les soulignés des liens, un chocolat au lait plutôt que la peau) ; mais la
   seconde rangée du bandeau, dont les règles sont communes aux deux thèmes, y prend celles du
   bandeau : texte crème (14,47 sur --bande-contexte), filet au-dessus, et en sombre seulement
   ses contours et son filet du bas d'avant (section 5). Le bandeau, brun du logo très
   assombri, reste plus sombre que la surface ; les aplats posés sur une surface
   (--aplat-fort) prennent le brun du logo ; l'or ne change pas.
   Repris du thème clair sans changement : --sur-chair, --sur-chair-doux, --chair-plan,
   --chair-plan-fonce, --bord-champ, les couleurs posées sur une variété. */
:root[data-theme="dark"] {
  --terre: #2a1508; --terre-trait: #5a3418; --terre-support: #34312e; --bande-support: #2a2725;
  --trait-support: #504b47; /* 1,50 contre --terre-support ; 1,72 sur --bande-support */
  --sur-terre: #fcf4e8; --sur-terre-doux: #dcc6ae;
  --chair: #feb701; --chair-fonce: #ffc633; --chair-pale: #4a3a14;
  --marque: #fcf4e8;      /* logo complet sur une carte sombre : bois et lettres en crème (13,89) */
  --trait-plan: #1c1510;  /* le trait des piles du plan sombre, inchangé */
  --anneau-plan: var(--chair-plan); /* l'anneau d'une pile du plan sombre, inchangé */
  --peau: #c98f5c; --peau-texte: #e3aa78; --peau-pale: #4a3626;
  --souligne: #c49a7a;    /* un chocolat au lait, moins orangé que la peau : 5,95 sur la surface, 6,60 sur --sillon, 4,40 sur --survol ; 2,15 contre --texte */
  --fane: #8bbb78; --fane-pale: #2f4029; --gel: #f0857a; --gel-pale: #4a2420;
  --sillon: #231c16; --surface: #2e241c; --surface-2: #392e25; --texte: #f3ebdf; --doux: #bfae9c;
  --trait: #4a3c30; --trait-fort: #6e5c4c; --filet: #43372c;
  --entete: #3a2f26; --zebre: #342a21; --survol: #45392b; --sous-total: #3d3127; --bande-contexte: #2a2119;
  --contour: #9a7a60;     /* boutons secondaires, tuiles, et bord des aplats --aplat-fort (3,85 sur la surface) */
  --aplat-fort: #783b14;  /* brun du logo, plus clair que le bandeau sombre : 1,76 contre la surface, 1,53 contre --surface-2 ; crème dessus 7,91 */
  --anneau: #feb701; --filet-couleur: rgb(246 239 228 / .4);
  --ombre: 0 1px 2px rgb(0 0 0 / .3), 0 3px 10px rgb(0 0 0 / .2);
  --chevron: url("../icones/chevron-clair.545ff02e98a5.svg");
  color-scheme: dark;
}

/* 3. Base --------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--sillon);
  color: var(--texte);
  font: var(--texte-courant)/1.5 var(--corps);
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--anneau); outline-offset: 3px; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--souligne); }
img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-stretch: 112%; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
/* Chiffres : alignés en colonnes, dans la police des titres. */
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
/* Identifiants et codes (fermea.alice, S1) : une puce discrète, en Archivo. */
code {
  font-family: var(--display);
  font-size: .95em;
  padding: 1px 6px;
  border-radius: var(--rayon-petit);
  background: var(--surface-2);
}
h1 code { padding-inline: 10px; }
del { color: var(--doux); }
ins { text-decoration: none; font-weight: 700; }
details > summary { cursor: pointer; font-weight: 700; min-height: var(--cible); display: flex; align-items: center; }

/* 4. Mise en page ------------------------------------------------------------- */

.page {
  max-width: var(--largeur);
  margin: 0 auto;
  padding-inline: var(--esp-4);
  padding-block: 28px calc(56px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 28px;
}
.page > * { min-width: 0; }
/* En-tête d'écran : fil d'Ariane ou contexte (sur-titre), titre, phrase d'aide. */
.entete-page { display: grid; gap: var(--esp-2); }
.entete-page .sur-titre, .connexion .sur-titre { color: var(--doux); font-size: var(--texte-petit); }
.entete-page .sur-titre a, .connexion .sur-titre a { text-decoration-color: var(--souligne); }
.entete-page .sur-titre a::before, .connexion .sur-titre a::before { content: "\2039\00a0"; color: var(--souligne); }
.entete-page .sur-titre a:hover, .connexion .sur-titre a:hover { color: var(--texte); }
.entete-page > .aide { max-width: 72ch; }
.pile { display: grid; gap: var(--esp-4); }
.rangee { display: flex; flex-wrap: wrap; gap: var(--esp-3); align-items: center; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--esp-5); align-items: start; }

/* Lien d'évitement : visible seulement au clavier. */
.evitement {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--chair); color: var(--sur-chair); padding: 12px 18px; border-radius: 10px;
  font-weight: 700;
}
.evitement:focus { top: 12px; }

/* 5. Bandeau ------------------------------------------------------------------ */

/* Une seule ligne de 56 px sur tous les écrans (retour de Thomas du 17 novembre 2026 :
   proposition du 6 novembre acceptée ; partiels/bandeau.html) : la cagette (l'accueil), la
   navigation, puis à droite trois menus repliés, « + » (les raccourcis), la pastille de la
   campagne et du site, « Menu » (le compte, le thème, la déconnexion). Ils s'ouvrent sous la
   ligne, en panneaux sur le fond du bandeau. Si la ligne ne tient pas (support en
   intervention sur une tablette en portrait), les menus passent à la ligne, à droite. */
.bandeau {
  background: var(--terre);
  color: var(--sur-terre);
  padding-inline: var(--esp-4);
  padding-top: env(safe-area-inset-top, 0px);
}
.bandeau-in {
  --anneau: var(--chair);
  position: relative;
  max-width: var(--largeur);
  margin: 0 auto;
  padding-block: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}
/* Marque des pages d'erreur (erreur.html) : le logo de Thomas en négatif, cagette et mot
   (static/marque/teraconso-negatif.svg : bois et lettres blancs, fruits et @ dorés), une
   image dont le texte de remplacement nomme le lien. 36 px de haut. Le lien seulement :
   « sup.marque » est le renvoi « * » d'un état (section des états). */
a.marque {
  display: inline-flex;
  align-items: center;
  min-height: var(--cible);
  text-decoration: none;
  color: var(--sur-terre);
}
a.marque img { display: block; flex: none; width: auto; height: 36px; }
/* Marque du bandeau : la cagette seule (static/marque/cagette-negatif.svg, telle quelle),
   34 px de haut, dans une cible ronde de 44 px ; c'est le bouton « Accueil », entouré d'or
   sur l'accueil (aria-current), comme l'écran courant de la navigation. */
.bandeau-in > a.marque {
  flex: none;
  justify-content: center;
  min-width: var(--cible);
  padding-inline: 2px;
  border: 2px solid transparent;
  border-radius: 999px;
  transition: border-color .15s, background-color .15s;
}
.bandeau-in > a.marque img { height: 34px; }
.bandeau-in > a.marque:hover { background: rgb(255 255 255 / .10); }
.bandeau-in > a.marque[aria-current="page"] { border-color: var(--chair); }
/* Page publique (connexion, liens reçus par e-mail) : le bandeau se réduit à un filet brun,
   le logo complet est en tête de la carte (partiels/logo.html). */
.bandeau-anonyme { min-height: 6px; }
.exploitation { font: 700 17px/1.2 var(--display); font-stretch: 112%; margin: 0; }
.campagne { color: var(--sur-terre-doux); font-size: var(--texte-petit); display: flex; gap: 8px; align-items: center; margin: 0; }
.campagne select {
  min-height: var(--cible);
  border: 2px solid var(--terre-trait);
  border-radius: 999px;
  background: var(--terre) url("../icones/chevron-clair.545ff02e98a5.svg") no-repeat right 14px center / 14px;
  color: var(--sur-terre);
  padding: 6px 38px 6px 16px;
  font-weight: 700;
  font-size: var(--texte-petit);
  appearance: none;
}
.qui { margin: 0; font-size: var(--texte-petit); color: var(--sur-terre-doux); }
.qui strong { color: var(--sur-terre); font-weight: 700; }

/* Navigation principale (Stockage, Lots, Commandes, États, Référentiels ; l'espace du
   support pour le support sans exploitation) : des pastilles du bandeau, l'écran courant en
   or, sur la ligne. Sur téléphone, elle devient une barre en bas de l'écran (section 15). */
.navigation { display: flex; gap: 4px; flex-wrap: nowrap; min-width: 0; }
.navigation a { white-space: nowrap; }

/* Boutons du bandeau (maquettes : .retour, pastilles de site) et navigation. */
.bouton-bandeau, .sites button, .navigation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px solid var(--terre-trait);
  color: var(--sur-terre);
  border-radius: 999px;
  padding: 6px 14px;
  min-height: var(--cible);
  font-weight: 700;
  font-size: var(--texte-petit);
  text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.bouton-bandeau:hover, .sites button:hover, .navigation a:hover { border-color: var(--sur-terre-doux); background: rgb(255 255 255 / .10); }
.bouton-bandeau[aria-current="page"], .navigation a[aria-current="page"] { border-color: var(--chair); color: var(--chair); }

/* Les trois menus (<details data-bandeau-replie>, sans JavaScript ; terconso.js les referme
   par Échap ou un toucher ailleurs, et un seul reste ouvert), serrés à droite de la ligne. */
.bandeau-menus { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.menu-bandeau { position: relative; flex: none; }
.menu-bandeau > summary { list-style: none; cursor: pointer; gap: 6px; white-space: nowrap; }
.menu-bandeau > summary::-webkit-details-marker { display: none; }
.menu-bandeau > summary svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.menu-bandeau[open] > summary { border-color: var(--chair); color: var(--chair); }
/* « + Saisir » : les raccourcis, l'action principale du bandeau, en or plein ; ouvert, un
   contour crème. */
.bouton-saisir { background: var(--chair); border-color: var(--chair); color: var(--sur-chair); padding-inline: 12px 16px; }
.bouton-saisir:hover { background: var(--chair-fonce); border-color: var(--chair-fonce); }
.menu-saisir[open] > .bouton-saisir { color: var(--sur-chair); border-color: var(--sur-terre); }
.menu-bandeau > .bouton-saisir svg { stroke-width: 2.8; }
/* La pastille de la campagne et du site : « 2026 · Tous les sites ». */
.pastille-contexte { padding-inline: 14px 10px; }
.contexte-resume { display: inline-flex; align-items: baseline; }
.contexte-point { color: var(--sur-terre-doux); white-space: pre; }
.menu-bandeau > summary .chevron { width: 16px; height: 16px; stroke-width: 2.4; }
.bouton-menu { padding-inline: 12px 16px; }

/* Les panneaux des menus, sous la ligne, sur le fond du bandeau, alignés à droite de leur
   bouton (sur toute la largeur au téléphone, section 15) ; ils défilent s'ils dépassent
   l'écran. */
.panneau-bandeau {
  --anneau: var(--chair);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  background: var(--terre);
  color: var(--sur-terre);
  border: 1px solid var(--terre-trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-fenetre);
}
.panneau-titre { margin: 0; font-size: var(--texte-petit); color: var(--sur-terre-doux); }
.panneau-bandeau .contexte { display: grid; gap: 12px; justify-items: start; }
/* Les liens du compte (partiels/liens_du_compte.html), en pastilles du bandeau. */
.menu-liens { display: flex; flex-wrap: wrap; gap: 6px; }
.menu-liens a {
  display: flex;
  align-items: center;
  min-height: var(--cible);
  padding: 6px 14px;
  border: 2px solid var(--terre-trait);
  border-radius: 999px;
  color: var(--sur-terre);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--texte-petit);
  white-space: nowrap;
}
.menu-liens a:hover { background: rgb(255 255 255 / .10); border-color: var(--sur-terre-doux); }
.menu-liens a[aria-current="page"] { border-color: var(--chair); color: var(--chair); }
/* Thème de l'affichage, au bas des liens du compte (comptes.theme) : « Thème », puis
   « Clair » et « Sombre », deux boutons d'envoi réunis dans une pilule, le choix courant en
   or (comme le site choisi). */
.choix-theme {
  display: flex; align-items: center; justify-content: flex-start; gap: 6px 14px; flex-basis: 100%;
  margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--terre-trait);
  font-size: var(--texte-petit); font-weight: 700;
}
.choix-theme-boutons { display: inline-flex; gap: 2px; padding: 2px; border: 2px solid var(--terre-trait); border-radius: 999px; }
.choix-theme button {
  min-height: var(--cible); padding: 6px 16px; border: 0; border-radius: 999px;
  background: transparent; color: var(--sur-terre); font-weight: 700; font-size: var(--texte-petit);
}
.choix-theme button:hover { background: rgb(255 255 255 / .10); }
.choix-theme button[aria-pressed="true"] { background: var(--chair); color: var(--sur-chair); }
.deconnexion { margin: 0; padding-top: 12px; border-top: 1px solid var(--terre-trait); }

/* Les raccourcis du « + » : pictogramme en or, titre, sous-titre. */
.panneau-saisir { width: min(400px, calc(100vw - 32px)); gap: 4px; padding: 8px; }
.raccourci {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 2px 12px;
  min-height: 60px; padding: 8px 12px; border-radius: var(--rayon-petit);
  color: var(--sur-terre); text-decoration: none;
}
.raccourci:hover { background: rgb(255 255 255 / .10); }
.raccourci .pictogramme { grid-row: span 2; justify-self: center; width: 26px; height: 26px; stroke: var(--chair); }
.raccourci strong { font: 700 17px/1.2 var(--display); font-stretch: 112%; }
.raccourci small { grid-column: 2; color: var(--sur-terre-doux); font-size: var(--texte-petit); }
/* Pictogramme d'un geste (partiels/pictogramme_geste.html) : un trait, sans remplissage. */
.pictogramme { flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Pastilles de site : une par site actif, plus « Tous les sites ». */
.sites { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.sites button[aria-pressed="true"] { background: var(--chair); border-color: var(--chair); color: var(--sur-chair); }
.sites button small { font-weight: 400; margin-left: 6px; color: var(--sur-terre-doux); }
.sites button[aria-pressed="true"] small { color: var(--sur-chair-doux); }
.site-seul { margin: 0; font-size: var(--texte-petit); color: var(--sur-terre-doux); }
.site-seul strong { color: var(--sur-terre); }

/* Tablette en portrait et moins (1 099 px et moins) : « + » et « Menu » sans leur mot (dit
   aux lecteurs d'écran), un carré de 44 px ; la pastille sur deux lignes, l'année puis le
   site, en petit ; les pastilles de la navigation un peu moins larges. */
@media (max-width: 1099px) {
  .bouton-saisir, .bouton-menu { padding: 0; min-width: var(--cible); }
  .menu-bandeau .mot {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .navigation a { padding-inline: 10px; }
  .pastille-contexte { padding-block: 2px; }
  .contexte-resume { display: grid; text-align: left; line-height: 1.15; }
  .contexte-point { display: none; }
  .contexte-site {
    max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 400; font-size: 13px; color: var(--sur-terre-doux);
  }
  .menu-bandeau[open] > summary .contexte-site { color: var(--chair); }
  .marque-support { font-size: 11px; padding: 5px 7px; }
}

/* Support de l'éditeur : le bandeau change de teinte, ses filets et contours aussi (graphite,
   --trait-support, hérité par les panneaux, la barre du bas au téléphone et la liste des
   campagnes), et une bande jaune rappelle sur chaque écran que l'on intervient sur une
   exploitation cliente. */
.bandeau.support { background: var(--terre-support); --terre-trait: var(--trait-support); }
.bandeau.support .panneau-bandeau { background: var(--terre-support); }
.bandeau.support .campagne select { background-color: var(--terre-support); }
/* Le panneau de la pastille (où l'on travaille : exploitation, campagne, sites) garde le
   chocolat plus sombre de l'ancienne seconde rangée (--bande-contexte ; --bande-support pour
   le support) et, en sombre, ses contours --trait-fort (2,48), sans lesquels ses pastilles de
   site ne se liraient plus comme des boutons (1,46). */
.panneau-contexte { background: var(--bande-contexte); }
.panneau-contexte .campagne select { background-color: var(--bande-contexte); }
:root[data-theme="dark"] .bandeau:not(.support) .panneau-contexte { --terre-trait: var(--trait-fort); }
.bandeau.support .panneau-contexte { background: var(--bande-support); }
.bandeau.support .panneau-contexte .campagne select { background-color: var(--bande-support); }
.marque-support {
  font: 800 13px/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--chair);
  color: var(--sur-chair);
  padding: 6px 10px;
  border-radius: 6px;
}
.intervention {
  --anneau: var(--terre);
  background: var(--chair);
  color: var(--sur-chair);
  border-bottom: 4px solid var(--terre-support);
  padding-inline: var(--esp-4);
}
.intervention-in {
  max-width: var(--largeur);
  margin: 0 auto;
  padding-block: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  font-size: 16px;
}
.intervention strong { font-weight: 700; }
/* « Terminer l'intervention », à droite de la bande (sous le texte sur petit écran). */
.intervention-in > p { flex: 1 1 320px; }
.fin-intervention { margin: 0; }
.fin-intervention .bouton { min-height: var(--cible); }

/* 6. Boutons ------------------------------------------------------------------ */

/* Secondaire par défaut (contour terre, fond blanc) ; principal (chair, un seul par
   écran), fort (terre plein : action de second rang à mettre en avant), alerte
   (contour rouge : désactiver, supprimer), discret (lien souligné). */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--cible-champ);
  padding: 8px 22px;
  border-radius: var(--rayon);
  border: 2px solid var(--contour);
  background: var(--surface);
  color: var(--texte);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.bouton:hover { background: var(--surface-2); }
.bouton:active, .geste:active { transform: translateY(1px); }
.bouton:disabled, .bouton[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
/* Action principale de l'écran : une seule par écran. */
.bouton-principal {
  background: var(--chair);
  border-color: var(--chair);
  color: var(--sur-chair);
  font-family: var(--display);
  font-stretch: 112%;
  font-size: var(--texte-grand);
}
.bouton-principal:hover { background: var(--chair-fonce); border-color: var(--chair-fonce); }
.bouton-fort { background: var(--aplat-fort); border-color: var(--contour); color: var(--sur-terre); }
.bouton-fort:hover { background: var(--terre-trait); border-color: var(--terre-trait); }
.bouton-alerte { background: transparent; border-color: var(--gel); color: var(--gel); }
.bouton-alerte:hover { background: var(--gel-pale); }
.bouton-discret { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.bouton-discret:hover { background: transparent; text-decoration-color: var(--souligne); }
.champ > .bouton-discret { justify-self: start; padding-inline: 4px; }
/* Bouton d'une cellule de tableau ou d'une pagination : plus bas, toujours 44 px. */
.bouton-petit { min-height: var(--cible); padding: 4px 16px; font-size: var(--texte-petit); border-radius: 10px; }
.bouton-large { width: 100%; min-height: 64px; font-size: 21px; }
.boutons { display: flex; flex-wrap: wrap; gap: var(--esp-3); align-items: center; }

/* Gestes du jour : grandes tuiles d'action de l'accueil, et tuiles des référentiels. */
.gestes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--esp-3); }
.geste {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  min-height: 96px;
  padding: 18px 20px;
  border-radius: var(--rayon-grand);
  border: 2px solid var(--contour);
  background: var(--surface);
  color: var(--texte);
  text-decoration: none;
  transition: background-color .15s, box-shadow .15s;
}
.geste:hover { background: var(--surface-2); box-shadow: var(--ombre); }
.geste strong { font: 700 21px/1.2 var(--display); font-stretch: 112%; }
.geste span { color: var(--doux); font-size: var(--texte-petit); }
.geste.principal { background: var(--chair); border-color: var(--chair); color: var(--sur-chair); }
.geste.principal:hover { background: var(--chair-fonce); border-color: var(--chair-fonce); }
.geste.principal span { color: var(--sur-chair-doux); }

/* 7. Pastilles et filtres ----------------------------------------------------- */

/* Pastille d'état : neutre (peau), fane (actif, réussite), gel (désactivé, erreur),
   chair (à noter : « vous », « site affiché », « obligatoire »). */
.pastille {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--peau-pale);
  color: var(--texte);
  white-space: nowrap;
  vertical-align: middle;
}
.pastille.gel { background: var(--gel-pale); color: var(--gel); }
.pastille.fane { background: var(--fane-pale); color: var(--fane); }
.pastille.chair { background: var(--chair-pale); color: var(--texte); }
/* Le producteur d'un lot qui n'est pas « en propre » (lot t67, stock/lots/_pastille_producteur
   .html) : discrète, en creux (un filet, sans fond), « Producteur » en petites capitales
   douces devant son nom ; un nom long passe à la ligne plutôt que de déborder. */
.pastille.producteur-tiers {
  background: transparent; box-shadow: inset 0 0 0 1px var(--trait-fort);
  font-weight: 600; white-space: normal; max-width: 100%;
}
.pastille.producteur-tiers .pastille-genre {
  margin-right: 3px; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--doux);
}

/* Filtres en pastilles, sur fond clair (Actifs / Désactivés / Tous, variétés de
   l'accueil, navigation de l'espace du support). */
.filtres { display: flex; gap: 8px; flex-wrap: wrap; }
.filtres button, .filtres a {
  display: inline-flex; align-items: center;
  border: 2px solid var(--trait); background: var(--surface); color: var(--texte);
  border-radius: 999px; padding: 8px 16px; min-height: var(--cible);
  font-size: var(--texte-petit); font-weight: 700; text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.filtres button:hover, .filtres a:hover { border-color: var(--peau); }
.filtres [aria-pressed="true"], .filtres [aria-current="true"], .filtres [aria-current="page"] {
  border-color: var(--contour); background: var(--aplat-fort); color: var(--sur-terre);
}

/* 8. Cartes et listes --------------------------------------------------------- */

.carte {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--rayon-grand);
  box-shadow: var(--ombre);
  padding: var(--esp-5);
  display: grid;
  gap: var(--esp-4);
  align-content: start;
}
.carte-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.carte-tete .aide { margin-left: auto; }
.carte-tete .bouton { margin-left: auto; }
.cartes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cartes > li {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
}
.cartes .code { font: 800 23px/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.cartes .actuel { box-shadow: inset 6px 0 0 var(--chair); border-color: var(--contour); }
/* Une carte dans une carte (liste de sites de l'accueil) : fond légèrement teinté. */
.carte .cartes > li { background: var(--surface-2); }

/* Étapes numérotées d'un écran (préparation de commande). */
.etape { display: grid; gap: 14px; }
.etape h2 { display: flex; gap: 12px; align-items: center; }
.etape h2 .n {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--aplat-fort); color: var(--sur-terre); font-size: 18px;
}

/* Liste de termes et valeurs chiffrées (bilan de l'accueil, d'un import). */
.bilan { display: grid; gap: 2px; margin: 0; }
.bilan > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-block: 10px; border-bottom: 1px solid var(--trait);
}
.bilan > div:last-child { border-bottom: 0; }
.bilan dt { color: var(--doux); }
.bilan dd { margin: 0; font-size: 22px; font-weight: 700; }

/* Fiche : libellés et valeurs (Mon compte, fiche d'un utilisateur, historique). */
.fiche { display: grid; margin: 0; }
.fiche > div {
  display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr); gap: 4px 16px;
  padding-block: 10px; border-bottom: 1px solid var(--trait);
}
.fiche > div:last-child { border-bottom: 0; }
.fiche dt { color: var(--doux); }
.fiche dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
/* Une précision sous la valeur (les origines d'un lot qui a reçu d'un autre producteur). */
.fiche dd .aide { display: block; margin-top: 2px; font-weight: 400; }

/* État vide : une phrase accueillante, et le geste qui remplit la liste. */
.vide {
  padding: var(--esp-6) var(--esp-5);
  text-align: center;
  color: var(--doux);
  background: var(--surface);
  border-radius: var(--rayon);
  border: 1px dashed var(--trait);
  display: grid;
  gap: 14px;
  justify-items: center;
}
.vide .bouton { color: var(--texte); }

/* 9. Tableaux ----------------------------------------------------------------- */

/* Dans .table-wrap : bords arrondis, défilement horizontal sur petit écran plutôt
   qu'un tableau écrasé. Lisibles d'un coup d'œil (demande de Thomas du 15 octobre 2026) :
   en-tête net (texte foncé sur fond teinté, un filet marqué dessous), lignes aérées et
   alternées (une sur deux en --zebre), filets légers entre elles ; les chiffres (classe n)
   à droite, en chiffres tabulaires ; le total au pied, sur fond teinté sous un filet
   marqué. Une ligne cliquable se touche en entier (a.ligne) et s'éclaire au survol.
   La couleur du fond d'une ligne est une variable (--fond-ligne) que prennent ses cases :
   une case collée à gauche au téléphone, ou la bande du chiffre principal d'un état, la
   suivent. Les règles de fond sont dans :where(), sans poids : une ligne marquée (nouvelle,
   en valeur) ou une case particulière (sous-total, chiffre principal) l'emporte toujours. */
.table-wrap {
  position: relative; /* un texte caché (en-tête « Retirer ») reste dans le cadre, qui le rogne */
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}
table { width: 100%; border-collapse: collapse; font-size: 16px; --case-v: 14px; --case-h: 16px; }
.table-wrap table { min-width: 560px; }
/* Un tableau de trois colonnes au plus tient sur un téléphone : pas de largeur imposée. */
.table-wrap table:not(:has(tr > :nth-child(4))) { min-width: 0; }
caption { text-align: left; padding: 12px 16px 0; font-weight: 700; }
th, td { padding: var(--case-v) var(--case-h); text-align: left; border-bottom: 1px solid var(--filet); vertical-align: top; }
th { font-size: 14px; color: var(--texte); font-weight: 700; }
thead th {
  background: var(--entete); padding-block: 12px; white-space: nowrap;
  border-bottom: 2px solid var(--trait-fort); letter-spacing: .01em;
}
td.n, th.n { text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody td.n { font-weight: 500; }
:where(.table-wrap tbody > tr) { --fond-ligne: var(--surface); }
:where(.table-wrap tbody > tr:nth-child(even)) { --fond-ligne: var(--zebre); }
:where(.table-wrap tbody > tr) > :is(td, th) { background-color: var(--fond-ligne); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:has(a.ligne):hover { --fond-ligne: var(--survol); }
tfoot td, tfoot th {
  font-weight: 700; background: var(--sous-total); color: var(--texte); font-size: 16px;
  border-top: 2px solid var(--trait-fort); border-bottom: 0;
}
tr.nouveau td { background: var(--chair-pale); }
tr.annule td { color: var(--doux); text-decoration: line-through; }
tr.inactif td { color: var(--doux); }
tr.desactivee td { color: var(--doux); }
/* Ligne cliquable : toute la cellule est une cible tactile. */
td a.ligne {
  display: block; min-height: var(--cible); margin: calc(-1 * var(--case-v)) calc(-1 * var(--case-h));
  padding: var(--case-v) var(--case-h); text-decoration: none;
}
td a.ligne:hover { text-decoration: underline; text-decoration-color: var(--souligne); }
td .bouton { margin-block: -6px; }
@media (max-width: 760px) {
  /* Au téléphone : des cases plus serrées, et la première colonne (le lot, la commande,
     le nom) reste en place quand le tableau défile de côté, un filet à sa droite. */
  table { --case-v: 12px; --case-h: 12px; }
  .table-wrap :is(thead, tbody, tfoot) > tr > :first-child:not([colspan]) {
    position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--filet);
  }
}

/* 10. Formulaires ------------------------------------------------------------- */

.formulaire { display: grid; gap: 20px; }
.champ { display: grid; gap: 6px; min-width: 0; }
.champ > label, .champ > .libelle, fieldset > legend { font-weight: 700; font-size: var(--texte-petit); }
.champ.en-erreur > label, fieldset.en-erreur > legend { color: var(--gel); }
.champ input:not([type="checkbox"], [type="radio"]),
.champ select,
.champ textarea {
  min-height: var(--cible-champ);
  width: 100%;
  border: 2px solid var(--bord-champ);
  border-radius: 10px;
  padding: 8px 14px;
  background: var(--surface);
  font-size: var(--texte-grand);
  transition: border-color .15s;
}
.champ input:focus, .champ select:focus, .champ textarea:focus { border-color: var(--contour); outline-offset: 2px; }
.champ textarea { min-height: 120px; }
.champ select {
  appearance: none;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 44px;
}
/* Une saisie qui propose une liste (<datalist> : les calibres déjà utilisés,
   referentiel.calibres.ChampCalibre, demande de Thomas du 29 octobre 2026 ; les lots du
   rappel). Sous Chrome,
   sa flèche, qui ouvre la liste, prend le chevron des listes de choix et reste visible :
   la liste se voit sans survol. Ailleurs, la flèche du navigateur, jamais masquée. */
.champ input[list]::-webkit-calendar-picker-indicator {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 28px;
  margin: 0 -2px 0 8px;
  padding: 0;
  background: var(--chevron) no-repeat center / 16px;
  color: transparent;
  opacity: 1;
  cursor: pointer;
}
.champ input[type="file"] { padding-block: 12px; font-size: 16px; }
.champ input[type="file"]::file-selector-button {
  font: inherit; font-weight: 700; color: var(--texte); background: var(--surface-2);
  border: 2px solid var(--contour); border-radius: 10px; padding: 4px 14px; margin-right: 12px;
  min-height: 36px; cursor: pointer;
}
.champ [aria-invalid="true"], .champ.en-erreur input, .champ.en-erreur select { border-color: var(--gel); }
.aide { color: var(--doux); font-size: var(--texte-petit); }
.aide b, .aide code { color: var(--texte); }
/* Aide en liste (règles des mots de passe, par exemple). */
.aide ul { margin: 4px 0 0; padding-left: 20px; }
/* Filtre d'une liste (journal du support) : le choix, puis le bouton. */
.filtre-journal { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.erreur { color: var(--gel); font-weight: 700; font-size: var(--texte-petit); }
.erreur ul, ul.errorlist { margin: 0; padding: 0; list-style: none; }
ul.errorlist { color: var(--gel); font-weight: 700; font-size: var(--texte-petit); display: grid; gap: 2px; }
.deux { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.facultatif { font-weight: 400; color: var(--doux); }

/* Saisie précédée d'un préfixe fixe : le code de l'exploitation devant le nom d'un
   identifiant (« fermea. » alice). */
.saisie-prefixee { display: flex; min-width: 0; }
.saisie-prefixee .prefixe {
  display: inline-flex; align-items: center; flex: none;
  padding-inline: 14px; border: 2px solid var(--bord-champ); border-right: 0;
  border-radius: 10px 0 0 10px; background: var(--peau-pale);
  font: 700 19px var(--display); white-space: nowrap;
}
.champ .saisie-prefixee input { flex: 1 1 auto; min-width: 0; border-radius: 0 10px 10px 0; }

/* Case à cocher au doigt. */
.coche { display: flex; gap: 12px; align-items: center; min-height: var(--cible); cursor: pointer; }
.coche input { width: 24px; height: 24px; accent-color: var(--terre); flex: none; }

/* Choix parmi des cartes (profil d'un compte, lot à servir) : toute la carte se touche. */
.choix { display: grid; gap: 10px; }
.choix label {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon);
  padding: 14px 16px; cursor: pointer; min-height: 64px;
  transition: border-color .15s;
}
.choix label:hover { border-color: var(--peau); }
.choix label:has(input:checked) { border-color: var(--contour); box-shadow: inset 6px 0 0 var(--chair); }
.choix input { width: 24px; height: 24px; accent-color: var(--terre); }
.choix label > span { font-weight: 700; }

/* Mot de passe d'un nouveau compte : invitation par e-mail ou saisie, deux cartes côte à
   côte ; les champs du mot de passe ne paraissent que pour la saisie (sans JavaScript). */
.choix-du-mot-de-passe .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.mots-de-passe { display: grid; gap: 20px; }
.formulaire:has(.choix-du-mot-de-passe input[value="invitation"]:checked) .mots-de-passe { display: none; }
/* Mon compte, « Couleurs des plans » (demande de Thomas du 29 octobre 2026) : deux cartes
   côte à côte, « Par variété » et « Par calibre », chacune son titre, ce qu'elle fait en
   doux, puis un exemple pris dans l'exploitation (pastilles et noms, qui passent à la ligne). */
.couleurs-des-plans .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.couleurs-des-plans .choix label { align-items: start; }
.couleurs-des-plans .choix input { margin: 2px 0 0; }
.choix label > .choix-couleurs { display: grid; gap: 6px; font-weight: 400; }
.choix-couleurs .choix-titre { font-weight: 700; }
.choix-couleurs .choix-detail { color: var(--doux); font-size: var(--texte-petit); }
.choix-exemple { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--texte-petit); }
.choix-exemple > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.choix-exemple .pastille-couleur { width: 16px; height: 16px; }
/* Liste de conseils sous un texte (mot de passe oublié, lien qui ne sert plus). */
.liste-aide { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* Compteur − / + pour un nombre de contenants. */
.compteur { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 8px; }
.compteur button {
  min-height: 60px; border-radius: 10px; border: 2px solid var(--contour); background: var(--surface);
  font: 800 28px/1 var(--display);
}
.compteur button:hover { background: var(--surface-2); }
.champ .compteur input { text-align: center; font: 800 30px var(--display); font-variant-numeric: tabular-nums; }
/* Sans les flèches du navigateur (Safari, Firefox ; Chrome au survol) : − et + les remplacent,
   et elles mangeaient la place du chiffre dans un panneau étroit (retour de Thomas du 19
   novembre 2026, capture sur Mac). */
.compteur input[type="number"] { appearance: textfield; -moz-appearance: textfield; padding-inline: 4px; }
.compteur input[type="number"]::-webkit-inner-spin-button,
.compteur input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* 11. Messages et alertes ----------------------------------------------------- */

/* Message de Django ou d'un écran : information (peau), réussite (fane), avertissement
   (chair), erreur (gel). Un bouton peut suivre le texte. */
.messages { display: grid; gap: 10px; }
.message, .alerte {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 14px 18px;
  border-radius: var(--rayon);
  border-left: 6px solid var(--peau);
  background: var(--peau-pale);
  color: var(--texte);
}
.message > p, .alerte > p { flex: 1 1 280px; }
.message-success { background: var(--fane-pale); border-left-color: var(--fane); }
.message-warning { background: var(--chair-pale); border-left-color: var(--chair); }
.message-error, .alerte { background: var(--gel-pale); border-left-color: var(--gel); }
.message-error strong, .alerte strong { color: var(--gel); }
.alerte .bouton { margin-left: auto; min-height: var(--cible); }
.message .bouton { min-height: var(--cible); }
/* Palox rangés au-delà de ce qui est entré dans un lot (stock.stockage.RangeDuLot ; page
   « Stockage », zone 3 de la récolte) : un avertissement, « Attention : » en gras, et sur la
   page « Stockage » le lien « Fiche du lot » à la suite du texte. */
.message.trop-range .bouton { margin-inline-start: 6px; vertical-align: middle; }

/* Message bref en bas d'écran. */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--terre); color: var(--sur-terre); padding: 12px 20px; border-radius: 10px;
  font-size: var(--texte-petit); max-width: calc(100% - 32px); box-shadow: var(--ombre-fenetre);
}

/* 12. Connexion et pages d'erreur --------------------------------------------- */

.page-connexion { max-width: 520px; padding-top: 48px; }
.connexion { padding: 32px 28px; gap: 22px; }
/* Logo complet (partiels/logo.html) : bois et lettres en --marque, fruits et @ en or. */
.connexion .logo { display: block; width: 240px; height: auto; justify-self: center; }
.logo-bois { fill: var(--marque); }
.logo-or { fill: var(--chair); }
.connexion h1 { font-size: clamp(30px, 6vw, 40px); }
.connexion .accroche { margin-top: -12px; }
.connexion .sur-titre { margin-bottom: -14px; }
.connexion .champ input { font-size: 21px; }
.page-erreur { max-width: 640px; padding-top: 48px; }
.page-erreur .carte { gap: 20px; }

/* 13. Utilitaires ------------------------------------------------------------- */

/* Texte lu par les lecteurs d'écran, invisible à l'œil. */
.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Bouton de validation d'un choix, inutile quand htmx envoie le choix de lui-même
   (classe posée sur <html> par terconso.js une fois htmx chargé). */
.htmx .sans-htmx { display: none; }
/* Indicateur de chargement htmx (les styles intégrés de htmx sont désactivés). */
.htmx-indicator { opacity: 0; transition: opacity .2s ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-request [type="submit"], .htmx-request.bouton { opacity: .7; }

/* 14. Référentiels ------------------------------------------------------------ */

/* Recherche d'une liste : la saisie, puis le bouton (masqué par rien : sans htmx, il
   envoie la recherche ; avec, la liste suit la frappe et Entrée garde son effet). */
.recherche { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: end; }
.recherche input[type="search"] { -webkit-appearance: none; appearance: none; }
/* Champ en lecture seule (consultation d'une fiche sans le droit de la modifier). */
.champ input:disabled, .champ select:disabled, .champ textarea:disabled {
  background-color: var(--sillon); color: var(--texte); border-style: dashed; opacity: 1;
}
.champ select:disabled { background-image: none; padding-right: 14px; }
/* Valeur calculée d'une saisie (masse brute d'un conditionnement) : en lecture seule, pas
   un champ (ni contour ni pointillés) ; la valeur en grands chiffres, le calcul en petit à
   côté, sur fond doux avec un liseré chair. Un aperçu htmx la remplit pendant la frappe. */
.champ-calcule .calcul {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px;
  min-height: var(--cible-champ); padding: 10px 16px;
  background: var(--surface-2); border-radius: 10px; box-shadow: inset 6px 0 0 var(--chair);
}
.valeur-calculee { font: 800 24px/1.2 var(--display); font-stretch: 112%; }
.valeur-calculee.sans-valeur { font: 700 var(--texte-grand)/1.3 var(--corps); color: var(--doux); }
.detail-calcul { color: var(--doux); font-size: var(--texte-petit); }
/* Lien de création à la volée, sous la liste de choix qu'il complète. */
.champ > .a-la-volee { justify-self: start; padding-inline: 4px; }

/* Fenêtre superposée (création à la volée, F03, F08, F18), ouverte par terconso.js. */
dialog.fenetre {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  border: 0;
  border-radius: var(--rayon-grand);
  padding: 28px;
  background: var(--surface);
  color: var(--texte);
  box-shadow: var(--ombre-fenetre);
}
dialog.fenetre::backdrop { background: rgb(30 15 5 / .6); }
dialog.fenetre h2 { padding-bottom: 12px; border-bottom: 1px solid var(--trait); }

/* 15. Petits écrans, contraste renforcé, mouvement, impression ---------------- */

@media (max-width: 760px) {
  .page { padding-block: 20px 48px; gap: 22px; }
  .carte { padding: 18px 16px; }
  /* Bandeau d'une ligne au téléphone (retour de Thomas du 17 novembre 2026) : la cagette,
     puis à droite « + », la pastille et « Menu » ; leurs panneaux s'ouvrent sous la ligne,
     sur toute la largeur de la page (gouttière de 16 px). La navigation, en barre fixe en
     bas de l'écran, sous le pouce (la page et le message bref lui laissent la place). */
  .menu-bandeau { position: static; }
  .panneau-bandeau, .panneau-saisir { left: 0; right: 0; top: 100%; width: auto; }
  .navigation {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--terre);
    border-top: 1px solid var(--terre-trait);
  }
  .bandeau.support .navigation { background: var(--terre-support); }
  .navigation a { border-color: transparent; border-radius: 10px; min-height: 48px; padding-inline: 8px; }
  .navigation a[aria-current="page"] { background: var(--chair); border-color: var(--chair); color: var(--sur-chair); }
  body:has(.navigation) .page { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  body:has(.navigation) .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .deux { grid-template-columns: minmax(0, 1fr); }
  .fiche > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .filtre-journal { grid-template-columns: minmax(0, 1fr); }
  .geste { min-height: 72px; }
  .alerte .bouton { margin-left: 0; }
  .carte-tete .aide, .carte-tete .bouton { margin-left: 0; }
  h2 { font-size: 20px; }
  dialog.fenetre { padding: 20px 16px; }
}
@media (max-width: 520px) {
  /* Boutons en pleine largeur, faciles à toucher d'un pouce. */
  .boutons > .bouton, .boutons > form, .boutons > form > .bouton { flex: 1 1 auto; width: 100%; }
  .page-connexion, .page-erreur { padding-top: 20px; }
  .connexion .logo { width: 200px; }
}
@media (prefers-contrast: more) {
  :root:not([data-theme="dark"]) {
    --trait: #8f8170; --trait-fort: #6c5f50; --filet: #b8ab99; --doux: #4a3a2e; --surface-2: #efebe3;
  }
  .champ input:not([type="checkbox"], [type="radio"]), .champ select, .champ textarea { border-color: var(--doux); }
  /* Les contours et filets du bandeau, dans les deux thèmes, en texte secondaire crème (9,9
     sur le chocolat, 11,2 sur le panneau de la pastille) : une pastille de site non choisie
     se lit comme un bouton au soleil. « !important » l'emporte sur les traits du support et
     du panneau sombre, redéfinis plus haut. */
  .bandeau { --terre-trait: var(--sur-terre-doux) !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bouton:active, .geste:active, .geste-compact:active { transform: none; }
}
@media print {
  .bandeau, .intervention, .evitement, .boutons, .sans-htmx, .filtre-journal, .recherche, .navigation { display: none !important; }
  body { background: #fff; color: #000; }
  .page { padding: 0; }
  .carte, .table-wrap { box-shadow: none; }
}

/* --- Accueil et navigation (phase 2) --- */

/* Accueil de l'exploitation (stock/accueil.html ; maquette terconso-accueil.html, réorganisée
   à la demande de Thomas du 15 octobre 2026) : les gestes du jour en tête, puis la bande des
   chiffres du stock, sur une ligne (deux par deux au téléphone), puis les lots par variété ;
   devant chaque lot, le pictogramme de son emplacement, qui ouvre une bulle. */
.page-accueil { gap: 24px; }
/* Gestes du jour : une rangée de boutons compacts (retour de Thomas du 17 novembre 2026,
   « variante 1 » de la maquette du 6 novembre), le pictogramme et le titre côte à côte, de
   même largeur (240 px au plus : ceux de l'Opérateur ne s'étirent pas), sur une ligne ; le
   premier, le geste principal, en or. Le nombre de
   commandes à servir en pastille brune, en haut à droite de « Préparer une commande ».
   Sous 1 100 px (tablette en portrait), le pictogramme au-dessus du titre, centrés ; au
   téléphone, deux par ligne, côte à côte. */
.gestes-du-jour { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 240px); gap: var(--esp-2); }
.geste-compact {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 8px 14px;
  border: 2px solid var(--contour); border-radius: var(--rayon);
  background: var(--surface); color: var(--texte); text-decoration: none;
  font-weight: 700; font-size: var(--texte-petit); line-height: 1.2;
  transition: background-color .15s, border-color .15s;
}
.geste-compact:hover { background: var(--survol); }
.geste-compact:active { transform: translateY(1px); }
.geste-compact.principal { background: var(--chair); border-color: var(--chair); color: var(--sur-chair); }
.geste-compact.principal:hover { background: var(--chair-fonce); border-color: var(--chair-fonce); }
.geste-compact .pictogramme { width: 26px; height: 26px; }
.geste-compact .compteur {
  position: absolute; top: -12px; right: 10px;
  display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding-inline: 8px;
  border-radius: 999px; background: var(--aplat-fort); color: var(--sur-terre);
  font-weight: 800; font-size: 14px;
}
@media (max-width: 1099px) {
  .geste-compact { flex-direction: column; justify-content: center; gap: 4px; padding: 10px 8px; text-align: center; }
}
/* La bande des chiffres : une carte basse, une case par chiffre, séparées d'un filet ; le
   disponible en tête, plus grand, en vert (la couleur du stock disponible), en rouge s'il
   est négatif ; à son pied, en petit, la campagne, la dernière sortie, la dernière entrée et
   le raccourci « Stock par calibre ». */
.jour { background: var(--surface); border-radius: var(--rayon-grand); box-shadow: var(--ombre); }
.chiffres-du-jour {
  display: grid; grid-template-columns: minmax(0, 1.6fr);
  grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column;
}
.chiffres-du-jour > .chiffre {
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px;
  margin: 0; padding: 14px 20px;
}
.chiffres-du-jour > .chiffre + .chiffre { border-left: 1px solid var(--trait); }
.titre-stock, .chiffres-du-jour dt { font: 500 var(--texte-petit)/1.3 var(--corps); color: var(--doux); letter-spacing: 0; }
.chiffres-du-jour dd { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.15; }
.stock-total {
  font: 800 clamp(32px, 4.4vw, 44px)/1 var(--display); font-stretch: 112%; letter-spacing: -.01em;
  color: var(--fane);
}
.stock-total small { font-size: .5em; font-weight: 700; margin-left: 6px; color: var(--doux); letter-spacing: 0; }
.stock-total.negatif, .var-dispo.negatif, .dispo.negatif { color: var(--gel); }
/* Le disponible mène au stock par variété (F62) : le chiffre ne change pas, une flèche dans
   un rond, collée à « t » (ils passent à la ligne ensemble), le dit au doigt comme à la
   souris ; au survol, la flèche passe en chair et « t » se souligne ; au clavier, l'anneau
   de focus entoure le tout. Le raccourci « Stock par calibre » a la même flèche. */
.stock-total a.vers-etat { color: inherit; text-decoration: none; border-radius: var(--rayon); }
.stock-total a.vers-etat small { white-space: nowrap; }
.vers-etat-fleche {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: max(26px, .8em); height: max(26px, .8em); margin-left: .3em;
  border: 2px solid var(--trait); border-radius: 50%; background: var(--surface); color: var(--texte);
  transition: background-color .15s, border-color .15s;
}
.vers-etat-fleche svg {
  width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.vers-etat:hover .vers-etat-fleche, .vers-etat:focus-visible .vers-etat-fleche,
.vers-calibres:hover .vers-etat-fleche, .vers-calibres:focus-visible .vers-etat-fleche {
  background: var(--chair); border-color: var(--chair); color: var(--sur-chair);
}
.vers-etat:hover small { text-decoration: underline; text-decoration-color: var(--souligne); text-decoration-thickness: 2px; }
.jour-pied {
  display: flex; align-items: center; gap: 4px 20px;
  padding: 8px 12px 8px 20px; border-top: 1px solid var(--trait);
}
.jour-notes { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; padding-block: 2px; }
.heure { color: var(--doux); font-size: 14px; line-height: 1.4; }
.vers-calibres {
  flex: none; display: inline-flex; align-items: center; min-height: var(--cible); padding-inline: 8px;
  border-radius: var(--rayon); color: var(--texte); font-weight: 700; text-decoration: none;
}
.vers-calibres:hover { text-decoration: underline; text-decoration-color: var(--souligne); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.stock-varietes { display: grid; gap: var(--esp-4); }
.lots-tete { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.lots-tete h2 { font-size: 26px; }
/* Légende des jauges (fiche d'une commande, préparation), qui en précisent les teintes. */
.legende { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--doux); }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.variete { display: grid; gap: 10px; }
.variete + .variete { margin-top: 18px; }
.var-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 0 4px 8px; border-bottom: 3px solid var(--terre); }
.var-tete h3 { font: 800 28px/1.1 var(--display); font-stretch: 112%; }
.var-tete .n-lots { color: var(--doux); font-size: var(--texte-petit); }
.var-dispo { margin-left: auto; font: 800 30px/1 var(--display); font-stretch: 112%; color: var(--fane); }
.var-dispo small, .dispo small { font-size: 15px; font-weight: 700; color: var(--doux); margin-left: 4px; }
.lots { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lot {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 150px;
  gap: 8px 20px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 16px 20px;
}
.lot-num { font: 800 23px/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
/* Le numéro mène à la fiche du lot : une cible de 44 px, soulignée au survol. */
.lot-num a { display: inline-block; padding-block: 11px; margin-block: -11px; text-decoration-color: transparent; }
.lot-num a:hover { text-decoration-color: var(--souligne); }
.lot-num small { display: block; margin-top: 6px; font: 400 13px/1.2 var(--corps); color: var(--doux); }
.lot-info { min-width: 0; display: grid; gap: 8px; }
.lot-titre { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--doux); font-size: var(--texte-petit); }
/* Emplacement d'un lot (F73) : un pictogramme de localisation, bouton rond de 44 px sur fond
   chair pâle ; en retrait (contour pointillé, trait doux) quand rien n'est renseigné. Il
   ouvre une bulle sombre sous lui : la liste des lieux où le lot est rangé, chacun un lien
   vers son plan sur la page « Stockage » (voir plus bas). Sans JavaScript, la bulle
   paraît au survol et tant que le focus est dans le bloc (le bouton, puis ses liens) ; avec
   terconso.js, le bouton porte aria-expanded et la bulle le suit (survol, toucher, Entrée ;
   Échap ou un toucher ailleurs la ferment). */
.emplacement { position: relative; flex: none; }
.emplacement-bouton {
  display: grid; place-items: center; width: var(--cible); height: var(--cible); min-height: var(--cible);
  padding: 0; border: 2px solid transparent; border-radius: 50%;
  background: var(--chair-pale); color: var(--texte);
  transition: background-color .15s, border-color .15s, color .15s;
}
.emplacement-bouton svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.emplacement-bouton:hover, .emplacement-bouton[aria-expanded="true"] { background: var(--chair); color: var(--sur-chair); }
.emplacement.non-renseigne .emplacement-bouton { background: transparent; border: 2px dashed var(--trait); color: var(--doux); }
.emplacement.non-renseigne .emplacement-bouton:hover,
.emplacement.non-renseigne .emplacement-bouton[aria-expanded="true"] { background: var(--surface-2); border-color: var(--peau); color: var(--texte); }
.emplacement-bulle {
  --anneau: var(--chair); /* l'anneau de focus se voit sur le fond terre */
  display: none; position: absolute; z-index: 20; left: 0; top: calc(100% + 10px);
  width: max-content; max-width: min(460px, calc(100vw - 48px));
  padding: 6px; border: 1px solid var(--terre-trait); border-radius: var(--rayon);
  background: var(--terre); color: var(--sur-terre); box-shadow: var(--ombre-fenetre);
  font: 400 var(--texte-petit)/1.4 var(--corps); text-align: left; white-space: normal;
}
/* La pointe vers le pictogramme, et un pont invisible au-dessus : la souris passe du
   pictogramme à la bulle sans la fermer. */
.emplacement-bulle::before {
  content: ""; position: absolute; left: 15px; top: -7px; width: 12px; height: 12px;
  background: var(--terre); border: solid var(--terre-trait); border-width: 1px 0 0 1px;
  transform: rotate(45deg);
}
.emplacement-bulle::after { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.emplacement:hover > .emplacement-bouton:not([aria-expanded]) + .emplacement-bulle,
.emplacement:focus-within > .emplacement-bouton:not([aria-expanded]) + .emplacement-bulle,
.emplacement-bouton[aria-expanded="true"] + .emplacement-bulle { display: block; }
/* Dans la bulle, sans dessin (demande de Thomas du 10 octobre 2026), une ligne par lieu,
   séparées d'un filet : chaque ligne est un lien vers le plan du lieu, 52 px de haut au
   moins, toute la ligne pour cible ; à gauche, le nom du lieu (Archivo, clair), puis ses
   palox et leurs piles ou son poids en vrac (.bulle-detail) et ses anciens emplacements en
   grille (.bulle-ancien), en plus doux ; à droite, un chevron chair. Au survol et au
   toucher, la ligne s'éclaire (filet du fond terre) ; au clavier, l'anneau (chair) est
   tracé dedans, pour rester visible si la liste défile. Une liste plus haute que 60 % de
   l'écran (un lot dans bien des lieux) défile dans la bulle, qui n'est jamais plus haute
   que l'écran. */
.bulle-lieux {
  list-style: none; margin: 0; padding: 0;
  min-width: min(260px, calc(100vw - 62px));
  max-height: 60vh; overflow-y: auto; overscroll-behavior: contain;
}
.bulle-lieux > li + li { border-top: 1px solid var(--terre-trait); }
.bulle-lieu {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: var(--cible-champ); padding: 9px 8px 9px 12px;
  border-radius: var(--rayon-petit); color: var(--sur-terre); text-decoration: none;
  transition: background-color .15s;
}
.bulle-lieu:hover, .bulle-lieu:active { background: var(--terre-trait); }
.bulle-lieu:focus-visible { outline-offset: -3px; }
.bulle-lieu-texte { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.bulle-lieu-texte strong { font: 700 17px/1.25 var(--display); font-stretch: 112%; color: var(--sur-terre); }
.bulle-detail, .bulle-ancien { font-size: 15px; line-height: 1.35; color: var(--sur-terre-doux); }
.bulle-chevron {
  width: 20px; height: 20px; fill: none; stroke: var(--chair); stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .15s;
}
.bulle-lieu:hover .bulle-chevron { transform: translateX(2px); }
/* Un lot rangé nulle part : la phrase, puis « Ranger ce lot » pour qui le peut (en chair, une
   flèche), cible de 44 px. */
.bulle-vide { padding: 6px 10px 0; color: var(--sur-terre); }
.bulle-action {
  display: inline-flex; align-items: center; gap: 2px;
  font: 700 15px/1.2 var(--display); font-stretch: 112%; color: var(--chair);
  text-decoration-line: underline; text-decoration-color: transparent;
  text-decoration-thickness: 2px; text-underline-offset: 3px;
  transition: text-decoration-color .15s;
}
.bulle-action svg {
  flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round;
}
a.bulle-action:hover { text-decoration-color: currentColor; }
.bulle-ajout { min-height: var(--cible); padding-inline: 10px; }
.lot-chiffres { text-align: right; }
.dispo { font: 800 30px/1 var(--display); font-stretch: 112%; color: var(--fane); }
.lot-chiffres p { margin-top: 6px; font-size: 14px; color: var(--doux); }
.accueil-vide p { max-width: 60ch; }

@media (max-width: 760px) {
  .page-accueil { gap: 20px; }
  /* Au téléphone : les gestes deux par ligne, côte à côte ; les chiffres deux par deux (une
     case seule sur sa ligne, les transferts entre sites, prend toute la largeur) ; le
     raccourci passe sous les notes. */
  .gestes-du-jour { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .geste-compact { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 8px 10px; text-align: left; }
  .chiffres-du-jour { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; }
  .chiffres-du-jour > .chiffre { padding: 12px 14px; }
  .chiffres-du-jour > .chiffre + .chiffre { border-left: 0; }
  .chiffres-du-jour > .chiffre:nth-child(even) { border-left: 1px solid var(--trait); }
  .chiffres-du-jour > .chiffre:nth-child(n + 3) { border-top: 1px solid var(--trait); }
  .chiffres-du-jour > .chiffre:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stock-total { font-size: 30px; }
  .chiffres-du-jour dd { font-size: 22px; }
  .jour-pied { flex-wrap: wrap; padding: 8px 6px 4px 14px; }
  .lots-tete h2 { font-size: 22px; }
  .lot { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; }
  .lot-num { grid-column: 1; white-space: nowrap; }
  .lot-chiffres { grid-column: 2; grid-row: 1; }
  .lot-info { grid-column: 1 / -1; }
}

/* --- Écrans des lots (phase 2) --- */

/* Fiche d'un lot : le résumé sous le titre (variété en gros, site, campagne, producteur,
   pastilles), et le grand chiffre du stock disponible, en fane, en gel s'il est négatif. */
.lot-resume { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; color: var(--doux); }
.lot-resume strong { color: var(--texte); font: 700 21px/1.2 var(--display); font-stretch: 112%; }
/* Réservation d'un lot à un client (carte de la fiche d'un lot ; demande du 29 octobre
   2026, n° 10) : le client en grand, le formulaire de l'Administrateur dessous. */
.reservation-client { margin: 0; color: var(--doux); }
.reservation-client strong { color: var(--texte); font: 800 22px/1.2 var(--display); font-stretch: 112%; }
.reservation-formulaire { max-width: 560px; margin-top: 8px; }
/* Analyses export d'un lot (option « Export » ; demande du 29 octobre 2026, n° 13) : à
   gauche le suivi, ce qui reste avant la prochaine analyse en grand (fane ; gel une fois
   dépassé), la dernière analyse et l'historique ; à droite, sur fond doux, « Noter une
   analyse » pour l'Administrateur. Côte à côte dès 900 px, l'un sous l'autre en dessous. */
.analyses-export-corps { display: grid; gap: var(--esp-5); align-items: start; }
@media (min-width: 900px) {
  .analyses-export-corps { grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); }
}
.suivi-analyse { display: grid; gap: 8px; min-width: 0; }
.suivi-analyse > p { margin: 0; }
.analyse-reste {
  font: 800 clamp(36px, 5vw, 48px)/1 var(--display); font-stretch: 112%; color: var(--fane);
}
.analyse-reste small { font-size: .42em; font-weight: 700; color: var(--doux); margin-left: 6px; }
.analyse-reste.negatif, .analyse-etat.negatif { color: var(--gel); }
.analyse-etat { color: var(--doux); font-size: 17px; }
.analyse-a-faire .pastille { font-size: 15px; }
.analyses-du-lot td { white-space: nowrap; }
.analyses-du-lot td.analyse-rapport { white-space: normal; width: 100%; overflow-wrap: break-word; }
@media (max-width: 520px) {
  /* Au téléphone, la date et le bouton serrés : le rapport garde la place. */
  .analyses-du-lot th, .analyses-du-lot td { padding-inline: 8px; }
}
.analyses-du-lot td small {
  display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux);
  white-space: normal;
}
.analyses-du-lot tr.annule td.n { text-decoration: none; }
.noter-analyse {
  display: grid; gap: var(--esp-3); padding: var(--esp-4);
  border-radius: var(--rayon); background: var(--surface-2);
}
.noter-analyse h3 { margin: 0; font: 700 19px/1.2 var(--display); font-stretch: 112%; }
/* Mon exploitation, option « Export » : le tonnage qu'une analyse couvre, sous l'option. */
.tonnage-par-analyse { max-width: 420px; }
.stock-lot { display: grid; gap: 4px; }
.stock-lot .dispo {
  font: 800 clamp(44px, 7vw, 68px)/1 var(--display); font-stretch: 112%; letter-spacing: -.01em;
  color: var(--fane);
}
.stock-lot .dispo.negatif { color: var(--gel); }
.stock-lot .dispo small { font-size: .36em; font-weight: 700; color: var(--doux); margin-left: 8px; letter-spacing: 0; }
/* Chiffre négatif dans un tableau (stock négatif, RG11). */
td.negatif { color: var(--gel); font-weight: 700; }
/* Liste des lots : des valeurs courtes, chacune sur une ligne (au téléphone, le tableau
   défile de côté plutôt que de plier « Le Moulin »). */
.liste-lots td { white-space: nowrap; }
/* Parcelles d'un lot (fiche du lot ; décision du 9 octobre 2026) : la parcelle et son site
   en petit dessous ; le rendement de la parcelle sur la campagne en chiffre fort, sa récolte
   et sa surface en petit dessous ; un renvoi « * » pour une part répartie au prorata. */
.parcelles-du-lot td small { display: block; color: var(--doux); font-size: var(--texte-petit); font-weight: 400; }
/* Le nom de la parcelle ne se plie pas mot à mot quand le tableau défile (téléphone). */
.parcelles-du-lot td:first-child { min-width: 11em; }
.rendement-parcelle strong { font: 800 21px/1.2 var(--display); font-stretch: 112%; }
.rendement-parcelle .aide { font-size: var(--texte-petit); }
sup.renvoi { margin-left: 2px; color: var(--peau-texte); font-weight: 700; }
.note-parcelles { margin-top: var(--esp-3); }
/* Calibres d'un lot (fiche du lot, #calibres ; demande du 29 octobre 2026, n° 3, réponses de
   Thomas, Q3 et Q4) : le tableau de Thomas ; le calibre en chiffres forts ; les cases des
   pourcentages retenus à droite, étroites, au pavé numérique, « corrigé · calibrage 50 » en
   petit dessous ; la ligne qui ajoute un calibre sur fond doux ; au pied, le total des
   calibres en gras, l'écart de tri et la freinte en maigre, leur explication en petit. */
/* Les en-têtes se plient (« % retenu / Non-lavées ») : le tableau tient sur la tablette en
   portrait ; les chiffres sont centrés en hauteur sur les cases de saisie. */
.tableau-calibres thead th { white-space: normal; vertical-align: bottom; }
.tableau-calibres thead th > span { white-space: nowrap; }
.tableau-calibres :is(tbody, tfoot) :is(td, th) { vertical-align: middle; }
.tableau-calibres tbody th[scope="row"] { font: 700 17px/1.3 var(--display); white-space: nowrap; }
.tableau-calibres td.case-pourcentage, .tableau-calibres td.case-calibre { padding-block: 8px; }
.tableau-calibres .champ { justify-items: end; gap: 4px; }
.tableau-calibres .champ input {
  width: 5.5em; text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums;
}
.tableau-calibres .case-calibre .champ { justify-items: start; }
.tableau-calibres .case-calibre .champ input { width: 6em; text-align: left; }
.tableau-calibres td.aide-ajout strong { color: var(--texte); }
.tableau-calibres .champ ul.errorlist { white-space: normal; text-align: right; max-width: 14em; }
.tableau-calibres small.corrige { color: var(--peau-texte); font: 400 var(--texte-petit)/1.2 var(--corps); white-space: nowrap; }
.tableau-calibres tr.ajout-calibre { --fond-ligne: var(--surface-2); }
.tableau-calibres tr.ajout-calibre > td { vertical-align: bottom; }
.tableau-calibres td.aide-ajout { white-space: normal; vertical-align: middle; }
.tableau-calibres tfoot th small { display: block; font-weight: 400; color: var(--doux); font-size: var(--texte-petit); white-space: nowrap; }
.tableau-calibres tfoot tr:not(.total-calibrees) > :is(th, td) { font-weight: 500; border-top: 1px solid var(--filet); }
/* Au téléphone, le tableau défile de côté : la première colonne, qui reste en place, se fait
   étroite (la saisie du calibre ajouté, les explications du pied qui se plient). */
@media (max-width: 760px) {
  .tableau-calibres tfoot th small { white-space: normal; }
  .tableau-calibres .case-calibre .champ input { width: 5.8em; }
}
/* Fiche d'une parcelle : une campagne par bloc, son rendement à droite du titre (le chiffre
   en grand, la récolte et la surface en petit dessous), puis ses lots. */
.campagne-parcelle { display: grid; gap: var(--esp-3); }
.campagne-parcelle + .campagne-parcelle { margin-top: var(--esp-4); padding-top: var(--esp-4); border-top: 1px solid var(--trait); }
.campagne-parcelle-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.campagne-parcelle-tete h3 { margin: 0; }
.rendement-campagne { margin: 0; color: var(--doux); text-align: right; }
.rendement-campagne strong { color: var(--texte); font: 800 28px/1.1 var(--display); font-stretch: 112%; }
.rendement-campagne small { display: block; font-size: var(--texte-petit); }
/* Formulaire d'ajout au bas d'une section de la fiche (parcelle) : séparé de la liste par
   un filet. */
.ajout { padding-top: var(--esp-4); border-top: 1px solid var(--trait); }

/* Où est le lot (fiche d'un lot, F73, F85) : ses lieux en cartes, comme la liste de la page
   « Stockage » (.carte-de-lieu, plus basses : le dessin du lieu en petit, ses seules piles
   du lot mises en valeur), puis ses piles en puces (repère en Archivo, palox du lot, ses
   calibres et « mixte » en plus doux). À replacer : la liste des anciens (.anciens).
   « Ranger ce lot » : un bouton par lieu du site, son type en petit dessous. */
.lieux-du-lot { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.lieux-du-lot .carte-de-lieu { min-height: 0; }
.piles-du-lot { display: flex; flex-wrap: wrap; gap: 6px; }
.pile-du-lot {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px;
  border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--trait);
  font-size: var(--texte-petit);
}
.pile-du-lot b { font: 800 14px/1.3 var(--display); font-stretch: 112%; }
.pile-du-lot .num { font-weight: 700; }
.pile-du-lot small { color: var(--doux); font-size: 13px; }
.ou-est-le-lot .anciens-liste li > strong { overflow-wrap: anywhere; }
.ranger-le-lot { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--trait); }
.lieux-pour-ranger { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.lieux-pour-ranger .bouton { flex-direction: column; gap: 0; line-height: 1.15; }
.lieux-pour-ranger .bouton small { color: var(--doux); font: 400 13px/1.2 var(--corps); }

/* Couleurs des variétés (referentiel.couleurs ; remarque de Thomas du 9 octobre 2026). Une
   couleur, libre, n'est pas une classe : un petit SVG la peint (attribut fill, jamais de
   style=). Fond d'une case ou d'une pile (balise fond_de_couleurs) : il remplit son parent,
   positionné, et passe sous son texte (le parent fait un contexte d'empilement : position
   et z-index 0) ; en bandes pour plusieurs variétés. Pastille (pastille_de_couleur) : un
   petit carré de la couleur, détaché du fond par un filet. Texte posé sur une couleur :
   noir (.sur-clair) ou blanc (.sur-fonce), le plus contrasté (couleurs.texte_sur). */
.fond-couleurs {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  border-radius: inherit; pointer-events: none;
}
.pastille-couleur {
  display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: -.15em;
  border-radius: 4px; outline: 1px solid var(--filet-couleur); outline-offset: -1px;
}
.sur-clair { color: var(--sur-couleur-claire); }
.sur-fonce { color: var(--sur-couleur-foncee); }
/* Liste des variétés : la pastille et le nom de la couleur. */
.couleur-de-variete { display: inline-flex; align-items: center; gap: 8px; }
.couleur-de-variete .pastille-couleur { width: 20px; height: 20px; border-radius: 6px; }
/* Accueil : la pastille de la variété devant son nom (la couleur de ses lots sur les plans). */
.var-tete .pastille-couleur { width: 18px; height: 18px; margin-right: 10px; vertical-align: -1px; border-radius: 5px; }

/* Choix de la couleur d'une variété (referentiel/champs_varietes.html) : douze pastilles
   rondes de 48 px au doigt, la choisie cerclée de la couleur du texte et cochée ; « Autre
   couleur » et le sélecteur du navigateur ; l'aperçu, une case de plan, à droite (au-dessous
   sur un téléphone). Les boutons radio sont cachés à la vue, pas au clavier : les flèches
   passent d'une pastille à l'autre, l'anneau de focus entoure la pastille. */
.choix-couleur-corps { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px 32px; }
.pastilles-couleur { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 348px; }
.pastille-choix {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; cursor: pointer;
}
.pastille-choix input {
  position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none;
}
.pastille-echantillon {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px;
  border-radius: 50%; transition: box-shadow .15s;
}
.pastille-echantillon .pastille-couleur {
  width: 40px; height: 40px; border-radius: 50%; vertical-align: 0;
}
.pastille-choix:hover .pastille-echantillon { box-shadow: 0 0 0 2px var(--peau); }
.pastille-choix input:checked + .pastille-echantillon { box-shadow: 0 0 0 3px var(--texte); }
.pastille-choix input:checked + .pastille-echantillon .pastille-couleur { width: 34px; height: 34px; }
.pastille-choix input:focus-visible + .pastille-echantillon { outline: 3px solid var(--anneau); outline-offset: 4px; }
.pastille-choix input:disabled + .pastille-echantillon { opacity: .4; }
.pastille-choix input:disabled:checked + .pastille-echantillon { opacity: 1; }
.pastille-choix:has(input:disabled) { cursor: default; }
/* « Autre couleur » : une pilule, avec le rond d'un bouton radio (la couleur libre est dans
   le sélecteur, à côté). */
.pastille-autre {
  padding: 0 16px 0 12px; border: 2px solid var(--trait); border-radius: 999px;
  background: var(--surface);
}
.pastille-autre:hover { border-color: var(--peau); }
.pastille-autre:has(input:checked) { border-color: var(--texte); }
.pastille-autre .pastille-echantillon {
  width: 22px; height: 22px; border: 2px solid var(--contour); background: var(--surface);
}
.pastille-autre:hover .pastille-echantillon { box-shadow: none; }
.pastille-autre input:checked + .pastille-echantillon {
  border-color: var(--texte); background: var(--texte); box-shadow: inset 0 0 0 4px var(--surface);
}
.pastille-libelle { font-weight: 700; font-size: var(--texte-petit); }
.champ .couleur-libre input[type="color"] {
  width: 72px; min-height: 48px; height: 48px; padding: 4px; cursor: pointer;
}
.champ .couleur-libre input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.champ .couleur-libre input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.champ .couleur-libre input[type="color"]::-moz-color-swatch { border: 0; border-radius: 6px; }
/* L'aperçu : une case de plan à la couleur choisie, le nom de la variété écrit dessus. */
.apercu-couleur { display: grid; gap: 8px; justify-items: start; }
.apercu-case {
  position: relative; z-index: 0; display: grid; align-content: center; gap: 2px;
  width: 168px; min-height: 92px; padding: 10px 14px; border-radius: var(--rayon-petit);
  box-shadow: var(--ombre);
}
.apercu-case strong { font: 800 19px/1.15 var(--display); font-stretch: 112%; overflow-wrap: anywhere; }
.apercu-case small { font-size: 13px; }
.emplacements-du-lieu > li { align-items: baseline; }
.emplacements-du-lieu .code { text-decoration-color: transparent; }
.emplacements-du-lieu .code:hover { text-decoration-color: var(--souligne); }

/* Bâtiment en palox, dessiné à l'échelle (demande de Thomas d'octobre 2026 ; gabarit
   stock/lieux/_batiment.html, données de stock.dessins, en centimètres). Un SVG qui s'étire
   sur la largeur de son cadre ; en pleine page, il garde 640 px au moins et défile dans son
   cadre sur un téléphone, jamais la page. Les traits fins gardent un pixel quelle que soit
   l'échelle (vector-effect) ; les couleurs du thème viennent d'ici, celles des variétés sont
   des attributs du dessin (fill), qu'aucune règle d'ici ne touche. Murs en couleur du texte
   (sombres en clair, clairs en sombre), sol en sillon ; obstacles : groupe froid hachuré,
   porte en pointillé peau, zone de circulation en chair pâle bordée de tirets, autre en
   gris ; pile vide en pointillé ; pile de plusieurs lots ou calibres au cadre en gras ; pile
   mise en valeur cerclée, les autres atténuées. */
.batiment-cadre {
  overflow: auto; max-height: min(78vh, 860px); padding: 10px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
}
.batiment { display: block; width: 100%; height: auto; min-width: 640px; font-family: var(--display); }
/* Une largeur qui garde les plus petits textes lisibles (attribut width) : pas en deçà. */
.batiment[width] { width: auto; min-width: 100%; max-width: none; }
/* Un lieu en vrac, sans échelle : sa largeur naturelle au plus, plus étroit sur un petit
   écran (des tas de taille fixe, leurs textes grands). */
.batiment.batiment-vrac, .batiment.batiment-vrac[width] { width: auto; min-width: 0; max-width: 100%; }
.batiment rect, .batiment line { vector-effect: non-scaling-stroke; }
.batiment .mur { fill: var(--texte); }
.batiment .sol { fill: var(--sillon); }
.batiment .motif-fond { fill: var(--surface-2); }
.batiment .motif-hachures line { stroke: var(--doux); stroke-width: 1.5px; }
.batiment .obstacle rect { stroke: var(--doux); stroke-width: 1px; }
.batiment .obstacle-porte rect { fill: var(--surface); stroke: var(--peau); stroke-width: 2px; stroke-dasharray: 6 4; }
.batiment .obstacle-circulation rect { fill: var(--chair-pale); stroke: var(--chair-plan-fonce); stroke-width: 1.5px; stroke-dasharray: 9 6; }
.batiment .obstacle-autre rect { fill: var(--surface-2); stroke: var(--trait); }
.batiment .obstacle text { fill: var(--doux); stroke: none; font-weight: 700; letter-spacing: .02em; }
.batiment .obstacle-groupe_froid text { fill: var(--texte); stroke: var(--surface-2); paint-order: stroke; stroke-linejoin: round; }
.batiment .pile-contour { fill: none; stroke: var(--trait-plan); stroke-width: calc(1px + var(--gras, 0px)); }
/* Pile de plusieurs lots ou calibres (demande de Thomas du 29 octobre 2026 ; classe
   heterogene de stock.dessins) : son cadre en gras, 2 px de plus (--gras ; 1 px sur un petit
   plan compact), de la couleur du texte (sombre en clair ; crème en sombre, où le trait des
   piles se perdrait sur le sol). Chaque trait d'une pile plus bas (survolée, touchée,
   choisie, bloquée, proposée, sélectionnée…) ajoute ce gras et garde sa couleur : un état
   reste lisible sur une pile en gras, avec son écart au repos. */
.batiment .pile.heterogene { --gras: 2px; }
.batiment.batiment-compact .pile.heterogene { --gras: 1px; }
.batiment .pile.heterogene .pile-contour { stroke: var(--texte); }
.batiment .pile-fond { fill: var(--surface); }
.batiment .pile text { font-weight: 800; font-variant-numeric: tabular-nums; paint-order: stroke; stroke-linejoin: round; }
.batiment .pile .pile-texte.fin { font-weight: 500; }
/* Une pile mixte, ou de plusieurs couleurs (variétés, ou calibres sur un plan coloré par
   calibre : classe en-bandes) : ses textes aux couleurs du thème, sur un halo. */
.batiment .pile.mixte .pile-texte, .batiment .pile.en-bandes .pile-texte { fill: var(--texte); stroke: var(--surface); }
.batiment .pile-pastille { stroke: var(--trait-plan); stroke-width: 1px; }
.batiment .batiment-message { fill: var(--doux); font-weight: 600; }
.batiment .pile.vide .pile-contour { stroke: var(--doux); stroke-dasharray: 4 3; }
.batiment .pile.vide text { fill: var(--doux); }
.batiment .pile.attenuee { opacity: .25; }
.batiment.mode-lot .pile.en-valeur .pile-contour { stroke: var(--texte); stroke-width: calc(3px + var(--gras, 0px)); }
/* Le filtre des calibres (page « Stockage ») : ses piles cerclées comme celles d'un lot ; la
   pile choisie, un emplacement proposé ou la destination gardent leur trait. */
.batiment.mode-calibre .pile.en-valeur:not(.choisie, .candidate, .destination) .pile-contour { stroke: var(--texte); stroke-width: calc(3px + var(--gras, 0px)); }
.batiment .cote line { stroke: var(--doux); stroke-width: 1px; }
.batiment .cote text { fill: var(--doux); font-weight: 700; stroke: var(--surface); paint-order: stroke; stroke-linejoin: round; }
/* Emplacement bloqué (demande de Thomas du 10 octobre 2026) : des hachures rouges sobres
   par-dessus la pile (motif du dessin, en sens inverse de celles d'un groupe froid), un
   contour rouge, la mention « bloqué » en rouge sur un halo clair ; vide, un fond gris pâle. */
.batiment .motif-blocage line { stroke: var(--gel); stroke-width: 1.5px; stroke-opacity: .6; }
.batiment .pile.bloquee .pile-contour { stroke: var(--gel); stroke-width: calc(2px + var(--gras, 0px)); stroke-dasharray: none; }
.batiment .pile.bloquee.vide .pile-fond { fill: var(--surface-2); }
.batiment .pile .pile-texte.pile-texte-bloque { fill: var(--gel); stroke: var(--surface); }
/* Sélection (lots suivants : page « Stockage », récolte, préparation) : chaque pile est un
   lien, cerclé au survol et au clavier. */
.batiment .pile-lien { cursor: pointer; }
.batiment .pile-lien:hover .pile-contour { stroke: var(--texte); stroke-width: calc(3px + var(--gras, 0px)); }
.batiment .pile-lien:focus { outline: none; }
.batiment .pile-lien:focus-visible .pile-contour { stroke: var(--anneau-plan); stroke-width: calc(4px + var(--gras, 0px)); }
/* Détail au toucher (terconso.js) : la pile touchée cerclée, son détail écrit sous le
   dessin, signalé d'un filet chair ; rien tant qu'aucune pile n'est touchée. */
.batiment .pile.touchee .pile-contour { stroke: var(--texte); stroke-width: calc(3px + var(--gras, 0px)); }
.detail-du-plan {
  padding: 8px 12px; border-left: 4px solid var(--chair); border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0;
  background: var(--surface-2); font-size: var(--texte-petit);
}
.detail-du-plan:empty { display: none; }
/* Légende sous le dessin : la couleur de chaque variété (un carré dessiné), ses palox, puis
   la pile vide et les natures d'obstacles du lieu. */
/* Fiche d'un lieu de plusieurs palox (demande de Thomas du 29 octobre 2026, n° 4) : ses
   emplacements et sa capacité par palox, une ligne chacun, en petit. */
.formats-du-lieu { list-style: none; margin: 0 0 var(--esp-3); padding: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; color: var(--doux); font-size: var(--texte-petit); }
.legende-batiment { list-style: none; margin: 0; padding: 0; margin-left: 0; align-items: center; }
.legende-batiment li { display: inline-flex; align-items: center; gap: 6px; }
.legende-batiment svg { width: 14px; height: 14px; flex: none; }
.legende-batiment .num { color: var(--texte); font-weight: 700; }
.legende-batiment i { margin-right: 0; width: 14px; height: 14px; }
.legende-batiment .legende-vide { background: var(--surface); box-shadow: inset 0 0 0 1px var(--doux); border-radius: 2px; }
.legende-batiment .legende-groupe_froid {
  background: repeating-linear-gradient(45deg, var(--doux) 0 1.5px, var(--surface-2) 1.5px 5px);
}
.legende-batiment .legende-porte { background: var(--surface); box-shadow: inset 0 0 0 2px var(--peau); }
.legende-batiment .legende-circulation { background: var(--chair-pale); box-shadow: inset 0 0 0 1.5px var(--chair-plan-fonce); }
.legende-batiment .legende-autre { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--trait); }
.legende-batiment .legende-bloquee {
  background: repeating-linear-gradient(-45deg, var(--gel) 0 1.5px, var(--surface-2) 1.5px 5px);
  box-shadow: inset 0 0 0 1.5px var(--gel); border-radius: 2px;
}
/* Plusieurs lots ou calibres : deux moitiés (deux contenus) dans un cadre en gras, comme sur
   le plan ; distinct de « Sélectionnée » (le même cadre sur un fond uni). */
.legende-batiment .legende-heterogene {
  background: linear-gradient(90deg, var(--trait-fort) 0 50%, var(--surface) 50%);
  box-shadow: inset 0 0 0 3px var(--texte); border-radius: 2px;
}
/* Places réservées et palox vides (demande du 29 octobre 2026, n° 7 ; stock.dessins) : une
   place réservée a un cadre en tirets épais en retrait, à la couleur de la variété du lot
   (attribut stroke, que la feuille ne remplace pas ; celle du trait du plan pour des palox
   vides) ; vide, ses textes (« réservé », le lot, ses places) au texte du thème. Des palox
   vides : un fond neutre clair par catégorie, leurs textes au trait du plan. Les filtres
   « Réservations » et « Palox vides » cerclent leurs piles comme celles d'un lot. */
.batiment .pile-reserve { fill: none; stroke-width: calc(3px + var(--gras, 0px)); stroke-dasharray: 9 5; }
.batiment .pile-reserve:not([stroke]) { stroke: var(--trait-plan); }
.batiment .pile.vide.reservee text { fill: var(--texte); }
.batiment .pile.vides-propres .pile-fond { fill: var(--vides-propres); }
.batiment .pile.vides-sales .pile-fond { fill: var(--vides-sales); }
.batiment .pile.vides-a_reparer .pile-fond { fill: var(--vides-a-reparer); }
.batiment .pile.sans-lot .pile-fond { fill: var(--sans-lot); }
.batiment .pile.palox-vides .pile-texte { fill: var(--trait-plan); stroke: none; }
.batiment.mode-reservations .pile.en-valeur:not(.choisie, .candidate, .destination) .pile-contour,
.batiment.mode-vides .pile.en-valeur:not(.choisie, .candidate, .destination) .pile-contour { stroke: var(--texte); stroke-width: calc(3px + var(--gras, 0px)); }
.legende-batiment .legende-reservee { background: var(--surface); box-shadow: inset 0 0 0 1px var(--doux); outline: 2px dashed var(--trait-plan); outline-offset: -5px; border-radius: 2px; }
.legende-batiment .legende-vides-propres, .puce-vides-propres { background: var(--vides-propres); }
.legende-batiment .legende-vides-sales, .puce-vides-sales { background: var(--vides-sales); }
.legende-batiment .legende-vides-a_reparer, .puce-vides-a_reparer { background: var(--vides-a-reparer); }
.legende-batiment [class^="legende-vides-"] { box-shadow: inset 0 0 0 1px var(--trait-plan); border-radius: 2px; }
/* Un bâtiment qui reste à modéliser, ou sans ses dimensions : une note signalée d'un filet
   peau. */
.a-modeliser {
  padding: 12px 16px; border-left: 4px solid var(--peau); border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0;
  background: var(--surface-2); max-width: 70ch;
}
/* La liste des piles, équivalent textuel du dessin : repliée sous son titre. */
.liste-des-piles > summary { color: var(--texte); }
.liste-des-piles .table-wrap { margin-top: 8px; }
.liste-des-piles tr.en-valeur td, .liste-des-piles tr.en-valeur th { background: var(--chair-pale); }
.ligne-de-pile { display: inline-block; margin-right: 14px; white-space: nowrap; }
.ligne-de-pile small { color: var(--doux); }

/* Plan zoomable (demande de Thomas du 10 octobre 2026 : page « Stockage », zone 3 de la
   récolte, préparation par le plan ; static/js/plan.js) : un cadre [data-zoom-plan] montre
   d'abord le plan entier dans sa largeur, centré (et dans sa hauteur s'il en a une limite) ;
   sans script, c'est tout (le pincement du navigateur reste possible). Avec le script
   ([data-zoom-actif] : un attribut, que htmx ne remet pas à zéro comme une classe), la largeur du dessin est celle que pose le zoom (attribut width), le cadre
   défile s'il le faut, le pincement à deux doigts zoome le plan et non la page. Au-dessus,
   la barre de zoom (.zoom-plan : « − », « + », « Tout voir », et sur un téléphone en portrait
   « Tourner » pour un bâtiment allongé), des boutons ronds de 44 px. Un plan tourné d'un
   quart de tour (.plan-tourne : murs, portes, obstacles et piles tournés, textes droits) le
   dit sous la barre (.plan-tourne-note). Sur téléphone, le cadre n'a pas de hauteur limite :
   la page défile. */
.batiment-cadre[data-zoom-plan] > .batiment,
.batiment-cadre[data-zoom-plan] > .batiment[width] { width: 100%; min-width: 0; max-width: 100%; margin-inline: auto; }
.batiment-cadre[data-zoom-actif] > .batiment[width] { width: auto; max-width: none; }
.batiment-cadre[data-zoom-actif] { touch-action: pan-x pan-y; }
.zoom-plan { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.zoom-plan button {
  display: inline-grid; place-items: center; grid-auto-flow: column; gap: 6px;
  min-width: var(--cible); min-height: var(--cible); padding: 0 10px; border: 2px solid var(--trait);
  border-radius: 999px; background: var(--surface); color: var(--texte);
  font: 800 22px/1 var(--display); transition: border-color .15s, background-color .15s;
}
.zoom-plan button[hidden] { display: none; }
.zoom-plan button:hover:not(:disabled) { border-color: var(--peau); }
.zoom-plan button:disabled { color: var(--doux); opacity: .45; cursor: default; }
.zoom-plan button[aria-pressed="true"] { border-color: var(--contour); background: var(--aplat-fort); color: var(--sur-terre); }
.zoom-plan svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.zoom-plan .zoom-libelle { font: 700 var(--texte-petit) var(--corps); }
.plan-barre { display: flex; justify-content: flex-end; }
.plan-tourne-note { color: var(--doux); font-size: var(--texte-petit); }
.plan-tourne-note:empty { display: none; }
@media (max-width: 760px) {
  div.batiment-cadre[data-zoom-plan] { max-height: none; }
  .zoom-plan .zoom-libelle { display: none; }
  .zoom-plan button { padding: 0; }
}
@media print {
  .zoom-plan, .plan-tourne-note, .recherche-repliee { display: none !important; }
}

/* Éditeur du bâtiment (demande de Thomas d'octobre 2026 ; stock/modelisation/,
   static/js/modelisation.js), pour ordinateur : une page plus large, les outils du plan en
   bandeau, le plan à gauche, le panneau des propriétés à droite (collé en haut de l'écran
   pendant le défilement), la liste des éléments dessous. Sous 1 024 px, la phrase « La
   modélisation se fait sur ordinateur » paraît ; sous 1 100 px, le panneau passe sous le
   plan. Le dessin est celui de la fiche (même gabarit) ; le script y ajoute la trame d'un
   mètre, puis un calque : cadres de la sélection (un halo chair et un trait couleur du
   texte, rouge pointillé quand le geste serait refusé), poignées d'un obstacle, guides
   d'accroche en pointillé peau, cadre de sélection, fantômes d'un placement ou d'une série
   (chair pâle en pointillé ; une place sautée barrée de rouge), cote du geste en cours. */
.page.page-modelisation { max-width: min(1680px, 100%); }
.modelisation-ordinateur { display: none; }
.modelisation { display: grid; gap: var(--esp-4); min-width: 0; }
.modelisation-outils {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-3) var(--esp-5);
  padding: 10px 16px; background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--rayon); box-shadow: var(--ombre);
}
.modelisation-outils[hidden] { display: none; }
.outils-groupe { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2); }
.outil-grille { font-weight: 700; font-size: var(--texte-petit); }
.outil-choix {
  min-height: var(--cible); padding: 4px 36px 4px 12px; appearance: none;
  border: 2px solid var(--trait); border-radius: 10px; font-size: var(--texte-petit);
  background: var(--surface) var(--chevron) no-repeat right 10px center / 14px;
}
.outil-aimant { font-size: var(--texte-petit); gap: 8px; }
.outil-aimant input { width: 20px; height: 20px; }
.outil-zoom { min-width: var(--cible); padding-inline: 10px; font: 700 20px var(--display); }
.outils-raccourcis { margin-left: auto; position: relative; }
.outils-raccourcis > summary { font-size: var(--texte-petit); color: var(--doux); }
.raccourcis {
  position: absolute; right: 0; top: 100%; z-index: 5; width: min(520px, 90vw); margin: 4px 0 0;
  display: grid; gap: 6px; padding: 14px 16px; font-size: var(--texte-petit);
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: var(--ombre-fenetre);
}
.raccourcis div { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 10px; }
.raccourcis dt { font-weight: 700; }
.raccourcis dd { margin: 0; color: var(--doux); }
kbd {
  font-family: var(--display); font-size: .85em; font-weight: 700; color: var(--texte);
  padding: 0 6px; border: 1px solid var(--trait); border-bottom-width: 2px; border-radius: 6px;
  background: var(--surface-2); white-space: nowrap;
}
.modelisation-grille {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--esp-4) var(--esp-5);
  align-items: start;
}
.modelisation-plan { display: grid; gap: var(--esp-3); min-width: 0; }
.modelisation-barre {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--esp-2) var(--esp-3); min-height: var(--cible);
}
.modelisation-message {
  flex: 1 1 280px; padding: 8px 12px; font-size: var(--texte-petit);
  border-left: 4px solid var(--fane); border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0;
  background: var(--surface);
}
.modelisation-message:empty { visibility: hidden; }
.modelisation-message.refus { border-left-color: var(--gel); background: var(--gel-pale); font-weight: 700; }
.modelisation-annuler { margin-left: auto; }
.modelisation-cadre { max-height: calc(100vh - 180px); min-height: 280px; padding: 16px; }
.modelisation-aide { max-width: 80ch; }
/* Le dessin à la taille que lui donne le script (zoom), plus petit que son cadre s'il le
   faut ; rien ne s'y sélectionne comme du texte. */
.modelisation .batiment, .modelisation .batiment[width] {
  width: auto; min-width: 0; max-width: none; margin-inline: auto;
  -webkit-user-select: none; user-select: none;
}
.modelisation .batiment g[data-cle] { cursor: grab; touch-action: none; }
.modelisation .batiment g[data-cle]:focus { outline: none; }
.modelisation .batiment g.pile[data-cle]:focus-visible .pile-contour,
.modelisation .batiment g.obstacle[data-cle]:focus-visible > rect { stroke: var(--anneau-plan); stroke-width: calc(4px + var(--gras, 0px)); }
.modelisation .batiment g.pile.choisi .pile-contour { stroke-width: calc(2px + var(--gras, 0px)); }
.modelisation.geste-deplacer .batiment, .modelisation.geste-deplacer .batiment * { cursor: grabbing; }
.modelisation.en-placement .batiment, .modelisation.en-placement .batiment * { cursor: crosshair; }
.modelisation.occupe .batiment { cursor: progress; }
.batiment .trame { pointer-events: none; }
.batiment .trame line { stroke: var(--trait); stroke-width: 1px; }
.batiment .trame line.fort { stroke: var(--doux); stroke-opacity: .35; }
.batiment .calque { pointer-events: none; }
.batiment .calque .poignee { pointer-events: all; fill: var(--surface); stroke: var(--texte); stroke-width: 1.5px; }
.batiment .poignee-nw, .batiment .poignee-se { cursor: nwse-resize; }
.batiment .poignee-ne, .batiment .poignee-sw { cursor: nesw-resize; }
.batiment .poignee-n, .batiment .poignee-s { cursor: ns-resize; }
.batiment .poignee-e, .batiment .poignee-w { cursor: ew-resize; }
.batiment .cadre-choix rect { fill: none; }
.batiment .choix-halo { stroke: var(--chair-plan); stroke-width: 6px; stroke-opacity: .9; }
.batiment .choix-trait { stroke: var(--texte); stroke-width: 1.5px; }
.batiment .cadre-choix.refus .choix-halo { stroke: var(--gel-pale); }
.batiment .cadre-choix.refus .choix-trait { stroke: var(--gel); stroke-width: 2px; stroke-dasharray: 6 4; }
.batiment .guide { stroke: var(--peau); stroke-width: 1px; stroke-dasharray: 5 4; }
.batiment .cadre-de-selection { fill: var(--chair-plan); fill-opacity: .15; stroke: var(--peau); stroke-width: 1px; stroke-dasharray: 4 3; }
.batiment .fantome, .batiment .fantome-serie rect {
  fill: var(--chair-pale); fill-opacity: .85; stroke: var(--peau); stroke-width: 1.5px; stroke-dasharray: 6 4;
}
.batiment .fantome.refus { fill: var(--gel-pale); stroke: var(--gel); }
.batiment .fantome-serie.sautee rect { fill: none; stroke: var(--gel); stroke-opacity: .7; }
.batiment .fantome-serie line { stroke: var(--gel); stroke-width: 1px; stroke-opacity: .7; }
.batiment .fantome-serie text { fill: var(--texte); font-weight: 700; }
.batiment .etiquette-geste { fill: var(--texte); stroke: var(--surface); paint-order: stroke; stroke-linejoin: round; font-weight: 700; }
/* Le panneau des propriétés : des champs plus serrés qu'au doigt (44 px, texte courant). */
.modelisation-panneau {
  position: sticky; top: var(--esp-4); display: grid; gap: var(--esp-4); min-width: 0;
  max-height: calc(100vh - 2 * var(--esp-4)); overflow-y: auto;
  padding: var(--esp-4) var(--esp-5) var(--esp-5);
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-grand);
  box-shadow: var(--ombre);
}
.modelisation-panneau .panneau-tete { display: grid; gap: var(--esp-2); }
.modelisation-panneau .panneau-tete .rangee { gap: var(--esp-2) var(--esp-3); }
.formulaire.formulaire-panneau { gap: 14px; }
.modelisation-panneau .champ input:not([type="checkbox"], [type="radio"]),
.modelisation-panneau .champ select { min-height: var(--cible); padding: 6px 12px; font-size: var(--texte-courant); }
.modelisation-panneau .champ select { padding-right: 40px; }
.modelisation-panneau .boutons { gap: var(--esp-2); }
.modelisation-panneau .bouton { min-height: var(--cible); }
.panneau-actions { display: flex; flex-wrap: wrap; gap: var(--esp-2); }
/* Choisir plusieurs éléments (retour de Thomas du 4 novembre 2026, n° 6) : l'aide, le bouton à
   bascule d'un écran sans clavier (enfoncé : aplat brun, comme le zoom du plan) et la rangée. */
.choisir-plusieurs { display: grid; gap: var(--esp-2); }
.choisir-plusieurs .boutons:not(:has(> :not([hidden]))) { display: none; }
.choisir-plusieurs .bouton .aide { font-weight: 400; }
.choisir-plusieurs [aria-pressed="true"] { border-color: var(--contour); background: var(--aplat-fort); color: var(--sur-terre); }
.volet { border-top: 1px solid var(--trait); padding-top: var(--esp-2); }
.volet > summary { font-family: var(--display); font-size: 17px; }
.volet > summary::before {
  content: "+"; display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; margin-right: 12px;
  border: 2px solid var(--trait); border-radius: 8px; color: var(--texte); font-size: 18px; line-height: 1;
}
.volet[open] > summary::before { content: "−"; }
.volet[open] > summary { margin-bottom: var(--esp-2); }
.choix-orientation { display: flex; flex-wrap: wrap; gap: var(--esp-2); }
.choix-orientation label {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--cible); padding: 6px 14px;
  border: 2px solid var(--trait); border-radius: 999px; cursor: pointer; font-size: var(--texte-petit); font-weight: 700;
}
.choix-orientation label:has(input:checked) { border-color: var(--contour); background: var(--chair-pale); }
.choix-orientation input { width: 18px; height: 18px; margin: 0; accent-color: var(--terre); }
.apercu-serie {
  display: grid; gap: 6px; padding: 10px 12px; font-size: var(--texte-petit);
  border-left: 4px solid var(--chair); border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0;
  background: var(--surface-2);
}
.apercu-serie:not(:has(> :not([hidden]))) { display: none; }
.apercu-raisons { margin: 0; padding-left: 18px; }
.contenu-de-pile { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-family: var(--display); font-weight: 700; }
.contenu-de-pile .aide { font-family: var(--corps); font-weight: 400; }
/* Un emplacement bloqué, dans le panneau de l'éditeur ou de la page « Stockage » : une note
   signalée d'un filet rouge, sur fond gris pâle, et son geste (« Débloquer »). */
.note-blocage {
  display: grid; gap: var(--esp-2); justify-items: start; padding: 10px 14px;
  border-left: 4px solid var(--gel); border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0;
  background: var(--surface-2);
}
.note-blocage p { margin: 0; }
/* Réservations d'emplacements et palox vides (demande du 29 octobre 2026, n° 7), page
   « Stockage » : un emplacement réservé, une note signalée d'un filet en tirets au trait du
   plan (comme sa place sur le plan) ; des palox vides, une puce carrée à la couleur de leur
   catégorie (la même que sur le plan) devant leur nombre ; dans la jauge, les palox vides à
   leur couleur, les places réservées en tirets épais ; les compteurs du lieu et de la liste
   des lieux ; les lieux où envoyer des palox vides, en cartes à toucher. */
.note-reservation {
  display: grid; gap: var(--esp-2); justify-items: start; padding: 10px 14px;
  border-left: 4px dashed var(--trait-plan); border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0;
  background: var(--surface-2);
}
.note-reservation p { margin: 0; }
.puce-vides {
  display: inline-block; flex: none; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  border-radius: 3px; box-shadow: inset 0 0 0 1px var(--trait-plan);
}
.pile-vides { display: flex; align-items: baseline; gap: 4px; margin: 0; align-self: center; }
.pile-vides .num { font-size: 21px; font-weight: 800; }
.jauge-pile .case-vides { stroke: var(--trait-plan); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.jauge-pile .case-vides.vides-propres { fill: var(--vides-propres); }
.jauge-pile .case-vides.vides-sales { fill: var(--vides-sales); }
.jauge-pile .case-vides.vides-a_reparer { fill: var(--vides-a-reparer); }
.jauge-pile .case-vides.sans-lot { fill: var(--sans-lot); }
.puce-sans-lot { background: var(--sans-lot); }
.jauge-pile .case-libre.case-reservee { stroke: var(--texte); stroke-width: 2px; stroke-dasharray: 5 3; }
.compteur-des-vides, .compteur-des-places { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.compteur-des-vides .num { font-weight: 800; }
.carte-de-lieu-places { display: flex; flex-wrap: wrap; gap: 2px 18px; color: var(--doux); font-size: var(--texte-petit); }
.choix-categorie { border: 0; margin: 0; padding: 0; min-width: 0; }
.choix-categorie legend { padding: 0; margin-bottom: 6px; font-weight: 700; }
.choix-categorie-liste { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.lieux-des-vides { list-style: none; margin: 0; padding: 0; min-width: 0; width: 100%; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.lieux-des-vides > li { min-width: 0; }
.lieux-des-vides a, .lieux-des-vides .sans-place {
  display: grid; gap: 2px; min-height: var(--cible); padding: 10px 14px; color: inherit; text-decoration: none;
  background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon);
}
.lieux-des-vides a:hover { border-color: var(--peau); }
.lieux-des-vides .sans-place { opacity: .55; background: var(--surface-2); }
/* Palox obtenus posés dans un autre lieu du site (demande de Thomas du 6 novembre 2026, n° 5) :
   les lieux à choisir, comme ceux des palox vides. */
.autres-lieux { display: grid; gap: 8px; margin-top: var(--esp-4); }
.autres-lieux h3 { margin: 0; }
.filtres-places .puce-vides { margin-right: 4px; }
/* Le palox d'une pile, son format, dans un lieu de plusieurs formats (demande de Thomas du
   29 octobre 2026, n° 4) : une pastille et ce qu'elle veut dire, sous la tête du panneau. */
.format-de-la-pile { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.liste-des-elements tr.en-valeur th, .liste-des-elements tr.en-valeur td { background: var(--chair-pale); }
.carte-tete .bouton-modeliser { margin-left: 0; }
@media (max-width: 1100px) {
  .modelisation-grille { grid-template-columns: minmax(0, 1fr); }
  .modelisation-panneau { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 1023px) {
  .modelisation-ordinateur { display: block; }
}

/* Conditionnement : l'usage sur deux cartes ; ses dimensions (trois champs côte à côte) ne
   paraissent que pour un conditionnement de stockage (sans JavaScript, :has). Lieu : les
   dimensions du bâtiment pour un lieu en palox seulement (option marquée data-a-dimensions).
   Sans prise en charge de :has, tout reste visible. */
.trois { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.trois > .champ { align-content: start; }
@media (max-width: 760px) {
  .trois { grid-template-columns: minmax(0, 1fr); }
}
.usage-conditionnement .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.dimensions-contenant .champ input, .batiment-dimensions .champ input { max-width: 160px; }
/* Contenants par unité d'expédition (feuilles de colisage) : un nombre court. */
.contenants-par-unite .champ input { max-width: 160px; }
.formulaire:has(.usage-conditionnement input[value="expedition"]:checked) .dimensions-contenant { display: none; }
/* « Pommes de terre lavées » (demande du 29 octobre 2026, n° 3) : pour un conditionnement
   d'expédition seulement ; ignorée pour un conditionnement de stockage. */
.formulaire:has(.usage-conditionnement input[value="stockage"]:checked) .lave-conditionnement { display: none; }
.formulaire:not(:has(select option[data-a-dimensions]:checked)) .batiment-dimensions,
.formulaire:not(:has(select option[data-a-dimensions]:checked)) .autres-palox { display: none; }
/* Nature d'un lieu (demande de Thomas du 29 octobre 2026, n° 1) : trois cartes côte à côte,
   empilées au téléphone ; ses autres palox (n° 4) : des cases à cocher en colonnes. */
.nature-du-lieu .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.cases-autres-palox { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
/* Les deux cartes du haut de la fiche (stock, renseignements) : côte à côte au bureau,
   empilées dès la tablette portrait, où la liste des renseignements serait trop étroite. */
@media (max-width: 900px) {
  .colonnes-lot { grid-template-columns: minmax(0, 1fr); }
}
/* Dans un tableau, un numéro de lot et une pastille ne se coupent pas : le tableau défile
   dans son .table-wrap plutôt que de les plier sur trois lignes. */
.table-wrap .num, .table-wrap .pastille { white-space: nowrap; }

/* --- Page « Stockage » (demande de Thomas du 9 octobre 2026 ; stock/stockage/) --- */

/* Liste des lieux : une carte à toucher par lieu (tout la carte est le lien), côte à côte
   au bureau et sur tablette, l'une sous l'autre sur un téléphone ; le petit plan d'un
   bâtiment en palox sur un fond doux, ses chiffres en gros, ses variétés avec leur couleur.
   Un lieu qui reste à modéliser a un contour en tirets. */
.lieux-stockage {
  list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.lieux-stockage > li { display: grid; }
.carte-de-lieu {
  display: flex; flex-direction: column; gap: 12px; min-height: 168px; padding: 18px 20px 14px;
  background: var(--surface); color: var(--texte); text-decoration: none;
  border: 2px solid var(--trait); border-radius: var(--rayon-grand); box-shadow: var(--ombre);
  transition: border-color .15s, box-shadow .15s;
}
.carte-de-lieu:hover { border-color: var(--peau); box-shadow: 0 2px 4px rgb(61 30 10 / .08), 0 8px 22px rgb(61 30 10 / .08); }
.carte-de-lieu:active { transform: translateY(1px); }
.carte-de-lieu.a-faire { border-style: dashed; box-shadow: none; }
.carte-de-lieu-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.carte-de-lieu-nom { font: 800 24px/1.15 var(--display); font-stretch: 112%; }
.carte-de-lieu-site { flex-basis: 100%; color: var(--doux); font-size: var(--texte-petit); }
.carte-de-lieu-site small { font: 700 13px var(--display); }
.carte-de-lieu-plan { display: block; padding: 8px; border-radius: var(--rayon-petit); background: var(--surface-2); }
.carte-de-lieu-plan .batiment { min-width: 0; width: 100%; max-height: 150px; }
.carte-de-lieu-plan .batiment .pile-contour { stroke: var(--trait-plan); }
.carte-de-lieu-chiffres { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; color: var(--doux); font-size: var(--texte-petit); }
.carte-de-lieu-chiffres b { color: var(--texte); font-size: 21px; font-weight: 800; }
/* Formats de palox d'un lieu (demande de Thomas du 29 octobre 2026, n° 4) : une ligne par
   palox, ses piles et sa capacité, en petit. */
.carte-de-lieu-formats { display: grid; gap: 2px; color: var(--doux); font-size: var(--texte-petit); }
/* Le filtre des natures (n° 1) : sous le titre, chaque puce avec son nombre de lieux. */
.filtres-natures { margin-bottom: var(--esp-4); }
.filtres-natures .num { margin-left: 8px; font-weight: 800; }
/* Au téléphone, une seule ligne qui défile de côté, comme le filtre des variétés. */
@media (max-width: 760px) {
  .filtres-natures { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filtres-natures::-webkit-scrollbar { display: none; }
  .filtres-natures a { flex: none; white-space: nowrap; }
}
.carte-de-lieu-varietes { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--texte-petit); }
.carte-de-lieu-varietes > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.carte-de-lieu-varietes .pastille-couleur { width: 14px; height: 14px; }
.carte-de-lieu-note {
  padding: 6px 10px; border-left: 4px solid var(--peau); border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0;
  background: var(--surface-2); color: var(--doux); font-size: var(--texte-petit);
}
.carte-de-lieu > .pastille.chair { align-self: flex-start; }
.carte-de-lieu-ouvrir {
  align-self: flex-end; display: inline-flex; align-items: center; gap: 2px; margin-top: auto;
  color: var(--doux); font-size: var(--texte-petit); font-weight: 700;
}
.carte-de-lieu-ouvrir svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.carte-de-lieu:hover .carte-de-lieu-ouvrir { color: var(--texte); }

/* Palox à ranger (réponse de Thomas du 19 novembre 2026 ; stock.ecrans_palox_a_ranger). Sur la
   page « Stockage », sous le titre, une ligne à toucher, liserée d'or sur l'or lavé : « 12 palox
   à ranger · 3 entrées » en Archivo, ce qu'elle mène à faire dessous, « Voir » et la flèche à
   droite. La liste : une carte par entrée (date, lot, variété, calibre ; entrés, rangés et le
   reste en gros ; « Ranger » en bas, sur toute la largeur) ; l'entrée suivante en tête après
   une pose (.a-ranger-suivante), liserée d'or dans la liste (.actuel). */
.a-ranger {
  display: flex; align-items: center; gap: 12px 18px; min-height: 64px; margin-bottom: var(--esp-4);
  padding: 12px 18px; color: var(--texte); text-decoration: none;
  background: var(--chair-pale); border: 1px solid var(--trait); border-left: 6px solid var(--chair);
  border-radius: var(--rayon); box-shadow: var(--ombre); transition: border-color .15s, box-shadow .15s;
}
.a-ranger:hover { border-color: var(--peau); border-left-color: var(--chair-fonce); }
.a-ranger:active { transform: translateY(1px); }
.a-ranger-texte { display: grid; gap: 2px; min-width: 0; flex: 1; }
.a-ranger-texte strong { font: 800 21px/1.2 var(--display); font-stretch: 112%; }
.a-ranger-texte span { color: var(--doux); font-size: var(--texte-petit); }
.a-ranger-ouvrir { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--doux); }
.a-ranger-ouvrir svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.a-ranger:hover .a-ranger-ouvrir { color: var(--texte); }
.page-a-ranger .entete-page { margin-bottom: var(--esp-4); }
.a-ranger-suivante { margin-bottom: var(--esp-5); border-left: 6px solid var(--chair); grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.a-ranger-suivante h2 { grid-column: 1 / -1; margin: 0; font-size: var(--texte-courant); color: var(--doux); }
.a-ranger-suivante-quoi { margin: 0; font-size: var(--texte-grand); }
.a-ranger-suivante .bouton { min-width: 180px; }
.a-ranger-total { margin: 0 0 var(--esp-3); font: 700 19px var(--display); font-stretch: 112%; color: var(--doux); }
.liste-a-ranger {
  list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.entree-a-ranger {
  display: grid; gap: 10px; align-content: start; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-grand); box-shadow: var(--ombre);
}
.entree-a-ranger.actuel { border-left: 6px solid var(--chair); }
.entree-a-ranger > p { margin: 0; }
.entree-a-ranger-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.entree-a-ranger-tete strong { font: 800 22px/1.15 var(--display); font-stretch: 112%; }
.entree-a-ranger-tete time { color: var(--doux); font-weight: 700; }
.entree-a-ranger-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.entree-a-ranger-chiffres > div { display: grid; gap: 2px; }
.entree-a-ranger-chiffres dt { color: var(--doux); font-size: var(--texte-petit); }
.entree-a-ranger-chiffres dd { margin: 0; font-weight: 700; }
.entree-a-ranger-chiffres .reste dd { font: 800 24px/1.1 var(--display); font-stretch: 112%; }
.entree-a-ranger > .bouton { width: 100%; margin-top: 2px; }
.entree-a-ranger-seule { max-width: 760px; }
.ranger-l-entree { display: grid; gap: var(--esp-4); }
.ranger-l-entree-envoi .bouton-large { flex: 1 1 320px; max-width: 560px; margin: 0; }
@media (max-width: 560px) {
  .a-ranger-suivante { grid-template-columns: minmax(0, 1fr); }
  .a-ranger-suivante .bouton { width: 100%; }
  .a-ranger-ouvrir { display: none; }
}

/* Un lieu en pleine page (demande de Thomas du 10 octobre 2026 : au téléphone et à la
   tablette, le plan d'abord) : sous le bandeau d'une ligne, la rangée « ‹ Lieux », nom et filtres, la tête du plan
   (résumé court, zoom), le plan entier dans la largeur (.batiment-cadre[data-zoom-plan],
   plus haut), la légende repliée. Le panneau : sous le plan au repos ; dès qu'il montre une
   pile, un lot ou un geste (.panneau-feuille), il monte du bas de l'écran par-dessus le plan
   (téléphone, tablette en portrait : 58 % de la hauteur au plus, son contenu défile ; il
   couvre la barre du bas, et la page lui laisse sa place pour que la pile touchée reste
   visible au-dessus) ; dès 1 024 px, à droite du plan, et il y reste à l'écran (sticky). */
.page.page-stockage { max-width: 1600px; gap: 12px; padding-top: 12px; }
.zone-stockage { display: grid; gap: 10px 24px; align-items: start; grid-template-columns: minmax(0, 1fr); }
.zone-stockage > * { min-width: 0; }
.zone-stockage > .stockage-plan { display: grid; gap: 6px; }
.stockage-plan .batiment-cadre { max-height: max(320px, calc(100vh - 230px)); min-height: 120px; }
@media (min-width: 1024px) {
  .zone-stockage { grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); }
  .zone-stockage > .stockage-outils, .zone-stockage > .resultat-recherche { grid-column: 1 / -1; }
  .zone-stockage > .stockage-plan { grid-column: 1; }
  .zone-stockage > .panneau {
    grid-column: 2; position: sticky; top: 12px; max-height: calc(100vh - 24px);
    overflow: auto; overscroll-behavior: contain;
  }
}
@media (min-width: 1440px) {
  .zone-stockage { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); }
}
@media (max-width: 1023px) {
  .zone-stockage > .panneau.panneau-feuille {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 16;
    max-height: min(58vh, 620px); overflow: auto; overscroll-behavior: contain;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--rayon-grand) var(--rayon-grand) 0 0;
    box-shadow: inset 0 4px 0 var(--chair), 0 -8px 28px rgb(30 15 5 / .24);
  }
  .zone-stockage > .panneau-feuille.panneau-vider, .zone-stockage > .panneau-feuille.panneau-vrac_vider {
    box-shadow: inset 0 4px 0 var(--gel), 0 -8px 28px rgb(30 15 5 / .24);
  }
  body .page.page-stockage:has(.panneau-feuille) { padding-bottom: calc(var(--hauteur-feuille, 58vh) + 24px); }
}
/* La tête du plan : le résumé court à gauche (« 69/153 palox · 13/26 piles »), le zoom à droite. */
.plan-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: var(--cible); }
.stockage-resume { flex: 1 1 10em; min-width: 0; color: var(--doux); font-size: var(--texte-petit); }
.stockage-resume b { color: var(--texte); font-size: 18px; font-weight: 800; }
.stockage-resume .site-du-lieu, .stockage-resume .insecable { white-space: nowrap; }
/* « · 2 palox à replacer » : des palox qui attendent leur place dans le lieu (demande de Thomas
   du 6 novembre 2026, n° 5), un lien vers le panneau du lieu. */
.mention-a-replacer a { display: inline-block; padding: 6px 0; color: var(--texte); font-weight: 700; text-decoration-color: var(--souligne); text-underline-offset: 3px; }
/* La légende, repliée sous le plan : le site et les dimensions du lieu, la pile vide, les
   obstacles, les emplacements proposés d'un mode de choix (les variétés sont les puces des
   outils). */
.legende-repliee > summary { list-style: none; align-self: start; width: max-content; color: var(--doux); font-size: var(--texte-petit); }
.legende-repliee > summary::-webkit-details-marker { display: none; }
.legende-repliee > summary::before {
  content: "+"; display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; margin-right: 10px;
  border: 2px solid var(--trait); border-radius: 8px; color: var(--texte); font-size: 18px; line-height: 1;
}
.legende-repliee[open] > summary::before { content: "−"; }
.legende-contenu { display: grid; gap: 8px; padding-bottom: 8px; }
.legende-contenu .legende-batiment { margin-left: 0; gap: 6px 18px; }
/* Dans un mode de choix, ce qu'ajoute sa légende : une ligne juste au-dessus du dessin. */
.legende-batiment.legende-du-mode { margin-left: 0; gap: 4px 16px; }
.legende-batiment .legende-candidate { background: var(--fane-pale); box-shadow: inset 0 0 0 2px var(--fane); border-radius: 2px; }

/* Les outils, sur une rangée au-dessus du plan (retour de Thomas du 17 novembre 2026, point
   2 : les filtres en trois menus) : le retour à la liste des lieux, le nom du lieu et son
   type (.lieu-tete), puis les menus des filtres (.filtres-du-plan), sur la même rangée quand
   ils y tiennent, sinon sur la suivante ; à droite, la loupe (<details>) qui déplie la
   recherche d'un lot sur une rangée à elle (et le bouton rond « Scanner un palox »). Le
   résultat de la recherche sur un fond chair pâle, signalé d'un filet chair. */
.stockage-outils {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  min-height: var(--cible); padding-right: calc(var(--cible) + 8px);
}
.stockage-outils:has(> .scanner-replie) { padding-right: calc(2 * var(--cible) + 16px); }
.lieu-tete { display: flex; align-items: center; gap: 8px 12px; flex: 0 1 auto; min-width: 0; }
.lieu-retour {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px; flex: none;
  min-height: var(--cible); min-width: var(--cible); padding: 4px 14px 4px 8px;
  border: 2px solid var(--trait); border-radius: 999px; background: var(--surface);
  color: var(--texte); font-weight: 700; font-size: var(--texte-petit); text-decoration: none;
  transition: border-color .15s;
}
.lieu-retour:hover { border-color: var(--peau); }
.lieu-retour svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lieu-tete h1 {
  min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 800 26px/1.15 var(--display); font-stretch: 112%; letter-spacing: 0;
}
.lieu-tete .pastille { flex: none; }
/* Les menus des filtres : « Variété : toutes », « Calibre : tous », « Vides et
   réservations » (<details data-menu-filtre>, static/js/terconso.js : un seul ouvert, Échap
   ou un toucher ailleurs les replie). Le bouton d'un filtre choisi passe en brun et dit le
   choix ; « Effacer » à côté revient à tout le plan. Le menu s'ouvre sous son bouton, en
   liste : chaque choix, sa couleur et ses palox (la légende des variétés, ou des calibres
   sur un plan coloré par calibre) ; le choix courant en brun. D'une seule variété ou d'un
   seul calibre, la puce seule, sans menu (.varietes-du-lieu). */
.filtres-du-plan { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.filtres-du-plan > .varietes-du-lieu { flex: none; gap: 4px 14px; margin: 0; padding: 0 4px; list-style: none; }
.filtres-du-plan .pastille-couleur { width: 14px; height: 14px; }
.menu-filtre { position: relative; flex: none; }
.menu-filtre > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--cible); padding: 8px 14px 8px 16px;
  list-style: none; border: 2px solid var(--trait); border-radius: 999px; background: var(--surface);
  color: var(--texte); font-size: var(--texte-petit); font-weight: 800; white-space: nowrap; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.menu-filtre > summary::-webkit-details-marker { display: none; }
.menu-filtre > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: -3px 2px 0 4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.menu-filtre[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
.menu-filtre > summary:hover { border-color: var(--peau); }
.menu-filtre[open] > summary { border-color: var(--contour); }
.menu-filtre-choix { font-weight: 600; }
.menu-filtre[data-choisi] > summary { border-color: var(--contour); background: var(--aplat-fort); color: var(--sur-terre); }
.menu-filtre[data-choisi] .menu-filtre-choix { font-weight: 800; }
.menu-filtre-liste {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 18;
  min-width: max(100%, 240px); max-width: calc(100vw - 32px); max-height: min(60vh, 440px);
  overflow: auto; overscroll-behavior: contain; padding: 6px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: var(--ombre-fenetre);
}
.menu-filtre-liste ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.menu-filtre-liste a {
  display: flex; align-items: center; gap: 10px; min-height: var(--cible); padding: 8px 12px;
  border-radius: var(--rayon-petit); color: var(--texte); font-size: var(--texte-petit); font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.menu-filtre-liste a:hover { background: var(--surface-2); }
.menu-filtre-liste a[aria-current="true"] { background: var(--aplat-fort); color: var(--sur-terre); }
.menu-filtre-liste .compte-variete { margin-left: auto; padding-left: 20px; }
.menu-filtre-liste a[aria-current="true"] .compte-variete { color: var(--sur-terre-doux); }
.menu-filtre-liste .puce-vides { margin-right: 0; }
.menu-filtre-groupe { padding: 10px 12px 2px; color: var(--doux); font-size: 12px; font-weight: 600; }
.effacer-filtres {
  display: inline-flex; align-items: center; min-height: var(--cible); padding: 0 6px;
  color: var(--texte); font-size: var(--texte-petit); font-weight: 700;
  text-decoration: underline; text-decoration-color: var(--souligne); text-underline-offset: 3px;
}
.compte-variete { color: var(--doux); font-weight: 800; }
.varietes-du-lieu li {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: var(--cible);
  font-size: var(--texte-petit); font-weight: 700; white-space: nowrap;
}
@media (max-width: 760px) {
  /* Au téléphone : le nom du lieu sur sa rangée (la loupe à droite), les menus dessous, sur
     toute la largeur ; un menu ouvert prend la largeur de la rangée des menus. */
  .stockage-outils, .stockage-outils:has(> .scanner-replie) { padding-right: 0; }
  .lieu-tete { flex-basis: calc(100% - var(--cible) - 8px); }
  .stockage-outils:has(> .scanner-replie) > .lieu-tete { flex-basis: calc(100% - 2 * var(--cible) - 16px); }
  .lieu-tete h1 { font-size: 22px; }
  .menu-filtre { position: static; }
  .menu-filtre-liste { right: 0; min-width: 0; max-width: none; }
}
@media (max-width: 419px) {
  /* Un petit téléphone : la flèche seule (« Lieux de stockage » reste dit aux lecteurs
     d'écran), le titre a la place. */
  .lieu-retour { padding: 0; }
  .lieu-retour-texte {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .lieu-tete h1 { font-size: 20px; }
  .menu-filtre > summary { padding-inline: 12px 10px; }
}
.resultat-calibre { justify-content: flex-start; }
.recherche-repliee { flex: 0 0 0; min-width: 0; }
.recherche-repliee:not([open]) > .recherche-lot { display: none; }
.recherche-repliee[open] { flex-basis: 100%; }
.recherche-repliee > summary {
  position: absolute; top: 0; right: 0; display: grid; place-items: center;
  width: var(--cible); min-height: var(--cible); padding: 0; list-style: none;
  border: 2px solid var(--trait); border-radius: 50%; background: var(--surface); color: var(--texte);
  transition: border-color .15s, background-color .15s;
}
.recherche-repliee > summary::-webkit-details-marker { display: none; }
.recherche-repliee > summary:hover { border-color: var(--peau); }
.recherche-repliee[open] > summary { border-color: var(--contour); background: var(--aplat-fort); color: var(--sur-terre); }
.recherche-repliee > summary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.recherche-repliee .recherche-lot { max-width: 520px; margin-left: auto; }
.recherche-lot { display: flex; align-items: center; gap: 8px; flex: 0 1 380px; min-width: 0; margin-left: auto; }
.recherche-lot input {
  flex: 1 1 0; width: 0; min-width: 0; min-height: var(--cible-champ); padding: 8px 14px;
  border: 2px solid var(--trait); border-radius: 10px; background: var(--surface);
  font: 700 var(--texte-grand) var(--display); font-variant-numeric: tabular-nums;
}
.recherche-lot input:focus { border-color: var(--contour); }
.resultat-recherche {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 8px 12px 8px 16px; border-left: 4px solid var(--chair);
  border-radius: 0 var(--rayon) var(--rayon) 0; background: var(--chair-pale);
}
.resultat-recherche .pastille-couleur { width: 14px; height: 14px; margin-right: 8px; }

/* Le plan de la page : la pile choisie cerclée de la couleur du texte ; dans un mode de
   choix, les autres piles en retrait, les emplacements proposés cerclés de vert (fond vert
   pâle s'ils sont vides), la destination touchée en chair. */
.batiment .pile.choisie .pile-contour { stroke: var(--texte); stroke-width: calc(4px + var(--gras, 0px)); stroke-dasharray: none; }
.mode-choix .batiment .pile:not(.candidate, .choisie) { opacity: .3; }
.batiment .pile.candidate .pile-contour { stroke: var(--fane); stroke-width: calc(3px + var(--gras, 0px)); stroke-dasharray: none; }
.batiment .pile.candidate.vide .pile-fond { fill: var(--fane-pale); }
.batiment .pile.candidate.vide text { fill: var(--fane); }
.batiment .pile-lien:hover .pile.candidate .pile-contour { stroke-width: calc(5px + var(--gras, 0px)); }
.batiment .pile.destination .pile-fond, .batiment .pile.candidate.vide.destination .pile-fond { fill: var(--chair-plan); }
.batiment .pile.destination .pile-contour { stroke: var(--texte); stroke-width: calc(4px + var(--gras, 0px)); }
.batiment .pile.destination.vide text { fill: var(--sur-chair); }

/* Le panneau : un filet chair en tête quand une pile (ou un lot en vrac) est choisie ; son
   titre en grand (« Pile P12 »), sa hauteur « 4/6 », « Fermer » rond de 44 px. Large (sous
   le plan), son contenu se range sur deux colonnes (requête de conteneur) : la pile à
   gauche, les gestes à droite ; les textes gardent une longueur de ligne lisible. */
.panneau { gap: 14px; padding: 20px; container-type: inline-size; }
.panneau > p, .panneau > ul, .panneau .anciens > p { max-width: 75ch; }
.panneau > .formulaire, .panneau-ajout > .formulaire { max-width: 720px; }
.panneau p > .pastille-couleur { width: 16px; height: 16px; margin-right: 8px; }
.panneau-grille, .pile-gestes { display: grid; gap: 14px; align-content: start; }
@container (min-width: 720px) {
  .panneau-grille { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 32px; align-items: start; }
}
.panneau:not(.panneau-repos) { box-shadow: inset 0 4px 0 var(--chair), var(--ombre); }
.panneau-vider, .panneau-vrac_vider { box-shadow: inset 0 4px 0 var(--gel), var(--ombre); }
.panneau h2[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.panneau h3 { font-size: 18px; }
.panneau .panneau-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; }
.panneau .panneau-tete h2 { font-size: 30px; font-weight: 800; }
.panneau-genre { display: block; color: var(--doux); font: 700 13px/1.4 var(--corps); letter-spacing: .06em; text-transform: uppercase; }
.hauteur-pile { font: 800 30px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hauteur-pile .hauteur-possible { color: var(--doux); font-weight: 600; }
.hauteur-pile .unite { color: var(--doux); font: 400 var(--texte-petit) var(--corps); }
.fermer {
  display: grid; place-items: center; width: var(--cible); height: var(--cible); border-radius: 50%;
  border: 2px solid var(--trait); color: var(--texte); text-decoration: none;
}
.fermer:hover { border-color: var(--peau); background: var(--surface-2); }
.fermer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.consigne { font-size: var(--texte-grand); font-weight: 700; }
.trajet { display: flex; align-items: center; gap: 10px; font: 800 28px/1 var(--display); }
.trajet svg { width: 30px; height: 30px; fill: none; stroke: var(--peau); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.note-hauteur { padding-left: 10px; border-left: 3px solid var(--trait); }
/* « Réserver des emplacements » (ou « Réserver le reste ») en tête des gestes de la pile, au-dessus
   des formulaires repliables (retour de Thomas du 6 novembre 2026, n° 4) : un bouton normal et
   son aide sur une ligne quand la place le permet. */
.reserver-en-vue { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.reserver-en-vue .aide { flex: 1 1 18ch; margin: 0; }

/* Le contenu de la pile : à gauche, une jauge (une case par palox possible, à la couleur de
   sa variété, en pointillé au-dessus du contenu) ; à droite, les lignes de haut en bas. */
.pile-detail { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start; }
.jauge-pile { display: block; width: 34px; height: auto; }
.jauge-pile .case-pleine { stroke: var(--filet-couleur); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.jauge-pile .case-libre { fill: none; stroke: var(--doux); stroke-width: 1px; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.pile-vide { color: var(--doux); align-self: center; }
.lignes-pile { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ligne-pile { border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface); }
.ligne-pile-resume { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px 12px; }
.ligne-pile-resume .pastille-couleur { width: 18px; height: 18px; border-radius: 5px; }
.ligne-pile-lot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; min-width: 0; }
.ligne-pile-lot a { display: inline-flex; align-items: center; min-height: var(--cible); font: 800 19px var(--display); text-decoration-color: var(--souligne); }
.ligne-pile-variete { font-weight: 700; }
.ligne-pile-nombre { color: var(--doux); font-size: var(--texte-petit); white-space: nowrap; }
.ligne-pile-nombre b { color: var(--texte); font-size: 24px; font-weight: 800; }
/* Une ligne qui se touche (demande de Thomas du 6 novembre 2026, n° 3) : le lien « Choisir › »
   s'étend à tout le résumé (::after), le lien du lot passe au-dessus ; survol et toucher en
   surface-2, focus clavier en anneau autour du résumé. */
.pile-detail > .aide-des-lignes { grid-column: 1 / -1; grid-row: 1; margin: 0; }
.pile-detail:has(> .aide-des-lignes) > .jauge-pile { grid-row: 2; }
.ligne-pile-resume.se-choisit { position: relative; grid-template-columns: auto minmax(0, 1fr) auto auto; min-height: 60px; border-radius: var(--rayon); }
.ligne-pile-resume.se-choisit .ligne-pile-lot a { position: relative; z-index: 1; }
.ligne-pile-choisir {
  display: inline-flex; align-items: center; gap: 2px; min-height: var(--cible); padding-left: 4px;
  color: var(--souligne); font-size: var(--texte-petit); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.ligne-pile-choisir::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ligne-pile-choisir svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ligne-pile-choisir:focus-visible { outline: none; }
.ligne-pile-resume.se-choisit:has(.ligne-pile-choisir:focus-visible) { outline: 3px solid var(--anneau); outline-offset: 2px; }
.ligne-pile-resume.se-choisit:hover, .ligne-pile-resume.se-choisit:active { background: var(--surface-2); }
.ligne-pile-resume.se-choisit:hover .ligne-pile-choisir { text-decoration: underline; text-decoration-color: var(--souligne); }
.ligne-pile-resume.se-choisit .ligne-pile-lot a { white-space: nowrap; }
/* Panneau étroit (barre de côté du bureau, téléphone) : le chevron seul, le numéro du lot entier. */
@container (max-width: 480px) {
  .ligne-pile-choisir-mot { display: none; }
}
.pastille.sans-calibre { background: transparent; box-shadow: inset 0 0 0 1px var(--trait); color: var(--doux); font-weight: 600; }
.ligne-pile-corriger { border-top: 1px solid var(--trait); }
.ligne-pile-corriger > summary, .panneau-ajout > summary { list-style: none; padding: 0 12px; font-size: var(--texte-petit); }
.ligne-pile-corriger > summary::-webkit-details-marker, .panneau-ajout > summary::-webkit-details-marker { display: none; }
.ligne-pile-corriger > summary::before, .panneau-ajout > summary::before {
  content: "+"; display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; margin-right: 10px;
  border: 2px solid var(--trait); border-radius: 8px; color: var(--texte); font-size: 18px; line-height: 1;
}
.ligne-pile-corriger[open] > summary::before, .panneau-ajout[open] > summary::before { content: "−"; }
.ligne-pile-corriger > summary .aide, .panneau-ajout > summary .aide { margin-left: 6px; font-weight: 400; }
.corrections { display: grid; gap: 14px; padding: 4px 12px 14px; }
.corrections .correction + .correction { padding-top: 14px; border-top: 1px dashed var(--trait); }
.correction, .panneau .formulaire { gap: 14px; }
.panneau-ajout { border: 1px solid var(--trait); border-radius: var(--rayon); }
.panneau-ajout > summary { padding: 0 12px; }
.panneau-ajout > .formulaire { padding: 4px 12px 14px; }
/* Deux champs côte à côte dans un panneau (étroit sur un ordinateur, à côté du plan) passent
   l'un sous l'autre faute de place : le compteur − / + garde la place de son chiffre (retour
   de Thomas du 19 novembre 2026). */
.panneau .deux { align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.panneau .champ .compteur { grid-template-columns: 52px minmax(0, 1fr) 52px; }
.panneau .champ .compteur button { min-height: 52px; }
.panneau .champ .compteur input { font-size: 26px; min-height: 52px; }
.panneau-actions { padding-top: 14px; border-top: 1px solid var(--trait); }
.panneau .messages { margin: 0; }

/* Les gestes d'une pile (demande de Thomas du 29 octobre 2026, n° 2), en deux rangées sous
   un filet. La principale : « Déplacer » en terre pleine (bouton de 52 px), « Envoyer en
   réchauffe » (s'il y a une salle de réchauffe sur le site), « Expédier » (à qui peut
   enregistrer une sortie) : ils se partagent la largeur, sur une ligne dans la colonne des
   gestes d'une tablette (marges réduites ; un libellé long passe sur deux lignes). La
   seconde : « Calibrer », « Envoyer vers un lieu », « Sélectionner d'autres piles du
   lot », « Vider la pile », en petits boutons de 44 px qui passent à la ligne ; au
   téléphone, deux par ligne. */
.gestes-de-la-pile { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--trait); }
.gestes-principaux { gap: var(--esp-2); align-items: stretch; }
.gestes-principaux > .bouton { flex: 1 1 0; min-width: min(100%, 6em); padding-inline: 10px; }
.gestes-secondaires { gap: var(--esp-2); }
.gestes-secondaires:not(:has(.bouton)) { display: none; }
.gestes-secondaires > .bouton { flex: 0 1 auto; width: auto; }
.gestes-de-la-pile > .choix-de-selection { padding-top: 10px; border-top: 1px dashed var(--trait); }
@media (max-width: 520px) {
  .gestes-principaux > .bouton { flex: 1 1 0; width: auto; }
  .gestes-secondaires > .bouton { flex: 1 1 40%; width: auto; padding-inline: 10px; }
}

/* Déplacer des palox d'un lot (même demande) : la tête (« DÉPLACER · PILE P2 », le lot en
   24 px, d'un bloc, sa variété en doux), le compteur visible d'emblée, de la largeur d'un
   pouce sur la tablette (il ne s'étire pas sur toute la feuille du bas), puis ce qui part
   (« Partent les 3 palox du haut : 2 en 45-50, 1 en 35-45 ») en gras ; un calibre ne se
   coupe pas à son trait d'union (.insecable). */
.panneau-lot_deplacer .panneau-tete h2 { font-size: 24px; }
.panneau-lot_deplacer .panneau-tete h2 .pastille-couleur { width: 16px; height: 16px; margin-right: 8px; border-radius: 4px; vertical-align: 1px; }
.deplacer-variete { color: var(--doux); font-weight: 600; }
.deplacer-nombre .champ { max-width: 340px; }
.ce-qui-part { font-weight: 700; }
/* La consigne, que l'aperçu du compteur remplace d'un bloc : l'espacement du panneau. */
.consigne-du-deplacement { display: grid; gap: 14px; max-width: 75ch; }
.panneau .insecable { white-space: nowrap; }

/* Gestes par lot et sélection de plusieurs piles d'un lot (demandes de Thomas du 10 octobre
   2026). Sur le plan : les emplacements proposés restent visibles même hors du lot mis en
   valeur ; dans la sélection, les piles du lot se touchent (« a-selectionner », un trait
   fin), les sélectionnées ont un trait épais (« selectionnee »), les autres du lot en léger
   retrait dès qu'il y en a une ; au choix des destinations, la pile en cours a le trait le
   plus épais (« courante »), celles déjà placées en retrait, les destinations choisies en
   chair (« destination »). */
.mode-choix .batiment .pile.candidate,
.mode-choix .batiment .pile.selectionnee,
.mode-choix .batiment .pile.a-selectionner,
.mode-choix .batiment .pile.destination { opacity: 1; }
.batiment .pile.a-selectionner .pile-contour,
.batiment.mode-lot .pile.a-selectionner .pile-contour { stroke: var(--texte); stroke-width: calc(2px + var(--gras, 0px)); stroke-dasharray: none; }
.batiment .pile-lien:hover .pile.a-selectionner .pile-contour { stroke-width: calc(4px + var(--gras, 0px)); }
.batiment-cadre:has(.selectionnee) .pile.a-selectionner { opacity: .7; }
.batiment .pile.selectionnee .pile-contour,
.batiment.mode-lot .pile.selectionnee .pile-contour,
.batiment .pile-lien:hover .pile.selectionnee .pile-contour { stroke: var(--texte); stroke-width: calc(7px + var(--gras, 0px)); stroke-dasharray: none; }
.batiment .pile.selectionnee.placee { opacity: .45; }
.batiment.mode-lot .pile.selectionnee.courante .pile-contour { stroke-width: calc(11px + var(--gras, 0px)); }
.batiment.mode-lot .pile.candidate .pile-contour { stroke: var(--fane); stroke-width: calc(3px + var(--gras, 0px)); }
.batiment.mode-lot .pile.destination .pile-contour { stroke: var(--texte); stroke-width: calc(4px + var(--gras, 0px)); }
.numero-lot { white-space: nowrap; }
/* Le cadre tracé à la souris sur le plan (demande de Thomas du 28 novembre 2026 ; terconso.js,
   « Cadre à la souris ») : le même que celui de l'éditeur du bâtiment (.cadre-de-selection),
   qui laisse passer le pointeur ; le cadre du plan le dit par un attribut pendant le geste.
   La phrase qui l'apprend (.aide-cadre) ne paraît que sur un écran à souris, avec JavaScript. */
.stockage-plan .batiment .cadre-de-selection { pointer-events: none; }
.batiment-cadre[data-cadre-en-cours], .batiment-cadre[data-cadre-en-cours] .pile-lien { cursor: crosshair; }
.aide-cadre, .legende-batiment .aide-cadre { display: none; }
/* Une pile touchée, le temps que la barre arrive : ses boutons, qui portent encore l'ancienne
   sélection, attendent (data-en-attente ; sans effet si la réponse vient vite). */
.barre-selection[data-en-attente] .barre-selection-actions a:not([data-selection-vers], .bouton-discret) {
  pointer-events: none; opacity: .55; transition: opacity .1s .2s;
}
@media (hover: hover) and (pointer: fine) {
  .htmx .aide-cadre { display: inline; }
  .htmx .legende-batiment .aide-cadre { display: inline-flex; font-style: italic; }
}
.legende-batiment .legende-a-selectionner { background: var(--surface); box-shadow: inset 0 0 0 1px var(--texte); border-radius: 2px; }
.legende-batiment .legende-selectionnee { background: var(--surface); box-shadow: inset 0 0 0 3px var(--texte); border-radius: 2px; }
.legende-batiment .legende-destination { background: var(--chair-plan); box-shadow: inset 0 0 0 2px var(--texte); border-radius: 2px; }
/* « Réserver des emplacements », « Lever des réservations » (retour de Thomas du 6 novembre 2026,
   n° 4) : les emplacements à toucher cerclés de vert comme ceux qu'on propose ailleurs (destinations
   du calibrage, « Placer sur une pile » : .candidate), fond vert pâle s'ils sont vides, et jamais
   en retrait, même quand d'autres sont choisis. */
.batiment .pile.emplacement-a-toucher .pile-contour,
.batiment.mode-lot .pile.emplacement-a-toucher .pile-contour { stroke: var(--fane); stroke-width: calc(3px + var(--gras, 0px)); stroke-dasharray: none; }
.batiment .pile-lien:hover .pile.emplacement-a-toucher .pile-contour { stroke-width: calc(5px + var(--gras, 0px)); }
.batiment .pile-lien:focus-visible .pile.emplacement-a-toucher .pile-contour { stroke: var(--anneau-plan); stroke-width: calc(5px + var(--gras, 0px)); }
.batiment .pile.emplacement-a-toucher.vide .pile-fond { fill: var(--fane-pale); }
.batiment .pile.emplacement-a-toucher.vide text { fill: var(--fane); }
.batiment-cadre:has(.selectionnee) .pile.emplacement-a-toucher { opacity: 1; }
.legende-batiment .legende-emplacement-a-toucher { background: var(--fane-pale); box-shadow: inset 0 0 0 3px var(--fane); border-radius: 2px; }

/* Panneau d'une pile mixte : « Par lot », une carte par lot (pastille, numéro, variété,
   palox en gros), ses calibres, ses gestes en petits boutons qui passent à la ligne. */
.lots-de-la-pile { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--trait); }
.lots-de-la-pile-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lot-de-la-pile { display: grid; gap: 4px 12px; padding: 10px 12px; border-radius: var(--rayon); background: var(--surface-2); }
.lot-de-la-pile-nom { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.lot-de-la-pile-nom .pastille-couleur { width: 16px; height: 16px; border-radius: 4px; }
.lot-de-la-pile-nom strong { font: 800 19px var(--display); }
.lot-de-la-pile-variete { font-weight: 700; }
.lot-de-la-pile-nombre { margin-left: auto; color: var(--doux); font-size: var(--texte-petit); white-space: nowrap; }
.lot-de-la-pile-nombre b { color: var(--texte); font-size: 22px; font-weight: 800; }
.boutons-du-lot { gap: var(--esp-2); margin-top: 4px; }
.boutons-du-lot > .bouton { flex: 0 1 auto; width: auto; }

/* Sélectionner d'autres piles du même lot et du même calibre (demande de Thomas du 16 octobre
   2026) : un petit groupe au lieu d'un bouton par calibre, son titre puis des pastilles de
   44 px qui passent à la ligne (« Tous calibres », « En 35-45 » et leurs piles) ; le choix
   mis en avant (le calibre du filtre du plan) en terre pleine. Sous les gestes de la pile,
   dans la carte d'un lot d'une pile mixte, dans le résultat de la recherche d'un lot. Dans
   le titre de la sélection, la pastille de son calibre. */
.choix-de-selection { display: grid; gap: 6px; }
.choix-de-selection-titre { font-size: var(--texte-petit); font-weight: 700; }
.choix-de-selection-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.choix-de-selection-liste a {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--cible); padding: 4px 16px;
  border: 2px solid var(--contour); border-radius: 999px; background: var(--surface); color: var(--texte);
  font-size: var(--texte-petit); font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.choix-de-selection-liste a:hover { background: var(--surface-2); }
.choix-de-selection-liste .num { font: 800 16px var(--display); }
.choix-de-selection-compte { color: var(--doux); font-weight: 400; }
.choix-de-selection-liste a.propose { border-color: var(--contour); background: var(--aplat-fort); color: var(--sur-terre); }
.choix-de-selection-liste a.propose:hover { background: var(--terre-trait); border-color: var(--terre-trait); }
.choix-de-selection-liste a.propose .choix-de-selection-compte { color: var(--sur-terre-doux); }
.lot-de-la-pile > .choix-de-selection { margin-top: 4px; }
.resultat-recherche > .choix-de-selection { flex: 1 1 320px; }
h2 .pastille-calibre { font: 800 16px/1.4 var(--display); padding: 2px 12px; vertical-align: 3px; }

/* La barre de la sélection (le panneau du mode) : le lot, « 3 piles · 16 palox du lot »
   en gros, les piles sélectionnées en puces à toucher (44 px, une croix : la retirer),
   puis les gestes ; au choix des destinations, la liste des trajets « P1 → P14 ». */
.barre-selection { display: grid; gap: 12px; }
.barre-selection h2 .pastille-couleur { width: 16px; height: 16px; margin-right: 8px; border-radius: 4px; vertical-align: -1px; }
.barre-selection-variete { color: var(--doux); font-weight: 600; }
.selection-resume { font: 800 24px/1.2 var(--display); font-stretch: 112%; }
.selection-resume b { font-weight: 800; }
.puces-de-piles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.puce-de-pile {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--cible); padding: 4px 10px 4px 14px;
  border: 2px solid var(--texte); border-radius: 999px; background: var(--surface); color: var(--texte); text-decoration: none;
}
.puce-de-pile:hover { background: var(--surface-2); }
.puce-de-pile-repere { font: 800 18px var(--display); }
.puce-de-pile-nombre { color: var(--doux); font-size: var(--texte-petit); }
.puce-de-pile svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.barre-selection-actions .aide { margin-left: 4px; font-weight: 400; }
.piles-de-la-selection { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 75ch; }
.piles-de-la-selection li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 12px; border-radius: var(--rayon-petit); background: var(--surface-2); }
.piles-de-la-selection li > .num { min-width: 3ch; font: 800 20px var(--display); }
.trajets { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.trajets li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 12px; border-radius: var(--rayon-petit); background: var(--surface-2); }
.trajets li > .num { font: 800 20px var(--display); }
.trajets svg { width: 22px; height: 22px; fill: none; stroke: var(--peau); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trajets .trajet-en-cours { background: var(--chair-pale); box-shadow: inset 4px 0 0 var(--chair); }
.trajets .trajet-a-venir { color: var(--doux); }
.trajet-a-toucher { font-weight: 700; }
.trajets-confirmes li > .num { font-size: 22px; }
@media (max-width: 520px) {
  /* Au téléphone, la barre reste courte : ses gestes deux par deux, le plan juste dessous. */
  .barre-selection-actions > .bouton { flex: 1 1 40%; width: auto; padding-inline: 10px; }
  .selection-resume { font-size: 20px; }
}
/* Les confirmations d'un retrait du plan : un filet rouge (et pour « vider », que la règle
   du filet chair, plus précise, emportait). */
.panneau.panneau-vider, .panneau.panneau-vrac_vider,
.panneau.panneau-lot_retirer, .panneau.panneau-selection_retirer { box-shadow: inset 0 4px 0 var(--gel), var(--ombre); }

/* Anciens emplacements en grille, à replacer sur une pile ou à reprendre au poids. */
.anciens { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--trait); }
.anciens-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.anciens-liste li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px;
  padding: 10px 12px; border-radius: var(--rayon); background: var(--surface-2);
}
.anciens-liste .bouton { grid-column: 2; grid-row: 1 / span 2; }
.ancien-lot { display: inline-flex; align-items: center; gap: 8px; }
.ancien-lot .pastille-couleur, .lot-vrac .pastille-couleur { width: 16px; height: 16px; }
.lot-vrac .pastille-couleur { margin-right: 8px; }
.fiche-vrac > div { grid-template-columns: minmax(0, 1fr) auto; }
.fiche-vrac dd { font-size: 19px; }
/* Calibrer depuis le vrac (demande de Thomas du 28 novembre 2026) : le choix du lieu en palox. */
.calibrer-vrac { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--trait); }
.calibrer-vrac > p { margin: 0; }
.calibrer-vrac-titre { font-weight: 700; }

@media (max-width: 760px) {
  .recherche-lot { flex-basis: 100%; margin-left: 0; }
  .page.page-stockage { padding-top: 10px; gap: 10px; }
  /* Le plan dans la largeur de l'écran : la marge de la page, pas celle d'une carte. */
  .stockage-plan .batiment-cadre { padding: 6px; }
}
@media (max-width: 520px) {
  .panneau { padding: 16px 14px; }
  .panneau .panneau-tete h2, .hauteur-pile { font-size: 26px; }
  .anciens-liste li { grid-template-columns: minmax(0, 1fr); }
  .anciens-liste .bouton { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* --- Page « Stockage » : recalibrer (demande de Thomas du 15 octobre 2026) --- */

/* stock/stockage/panneaux/recalibrer.html et recalibrer_ranger.html (stock.ecrans_recalibrage) :
   le panneau en deux étapes. Ce qui entre (une carte par pile, au fond doux, ses compteurs
   par calibre), ce qui sort (une ligne par calibre obtenu, liseré chair : calibre, palox,
   poids), le bilan en chiffres (Archivo), l'avertissement d'un écart ; puis ce qui reste à
   poser, calibre par calibre, et les piles choisies (les cartes de la zone 3 de la récolte,
   .pile-choisie, plus bas). Rien d'autre : boutons, champs et compteurs sont ceux de
   toujours. */
.recalibrage, .envoi { display: grid; gap: 14px; }
.recalibrage .panneau-tete h2 .pastille-couleur, .envoi .panneau-tete h2 .pastille-couleur { width: 16px; height: 16px; margin-right: 8px; border-radius: 4px; vertical-align: -1px; }
.recalibrage-variete { color: var(--doux); font-weight: 600; }
.recalibrage .formulaire, .envoi .formulaire { gap: 14px; }
.recalibrage-groupe, .envoi-groupe {
  display: grid; gap: 12px; margin: 0; padding: 10px 14px 16px; min-width: 0;
  border: 1px solid var(--trait); border-radius: var(--rayon);
}
.recalibrage-groupe > legend, .envoi-groupe > legend { padding: 0 6px; font: 700 19px var(--display); font-stretch: 112%; }
.recalibrage-groupe > p, .envoi-groupe > p { margin: 0; }
.recalibrage-piles, .envoi-piles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recalibrage-pile, .envoi-pile, .recalibrage-vrac { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--rayon); background: var(--surface-2); }
.recalibrage-pile-repere, .envoi-pile-repere { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.recalibrage-pile-repere .num, .envoi-pile-repere .num { font: 800 22px var(--display); }
.recalibrage-compteurs, .envoi-compteurs { display: grid; gap: 8px 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.recalibrage-compteurs .champ, .envoi-compteurs .champ { gap: 4px; }
.recalibrage-poids { display: grid; gap: 10px; max-width: 520px; }
.lignes-obtenues { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: ligne; }
.ligne-obtenue {
  display: grid; gap: 8px 12px; align-items: start; padding: 10px 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  border: 1px solid var(--trait); border-left: 5px solid var(--chair); border-radius: var(--rayon); background: var(--surface);
}
.ligne-obtenue .champ { min-width: 0; }
/* « Retirer » une ligne (dès qu'il y en a deux) : en bas à droite de sa carte, discret, 44 px
   (stock/recalibrages/_lignes_obtenues.html, page « Stockage » et préparation). */
.ligne-obtenue-retirer { grid-column: 1 / -1; justify-self: end; margin: -6px -4px -8px 0; }
.ligne-obtenue-retirer .bouton { min-height: var(--cible); padding-inline: 8px; }
.boutons-lignes { margin: 0; }
.bilan-recalibrage { display: grid; gap: 8px; }
.bilan-recalibrage dl { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; }
.bilan-recalibrage dl > div { display: grid; gap: 0; }
.bilan-recalibrage dt { color: var(--doux); font-size: var(--texte-petit); }
.bilan-recalibrage dd { margin: 0; font-weight: 700; }
.bilan-recalibrage dd .num { font: 800 22px var(--display); font-stretch: 112%; }
.bilan-recalibrage .message > p { margin: 0; }
.recalibrage-resume { margin: 0; font-weight: 700; }
.recalibrage-resume .pastille-couleur { width: 16px; height: 16px; margin-right: 8px; border-radius: 4px; vertical-align: -1px; }
.recalibrage-resume .fleche { color: var(--peau); padding-inline: 4px; }
.recalibrage-resume .sorti { color: var(--texte); }
.reste-a-poser { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.reste-a-poser li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 12px;
  border-radius: var(--rayon-petit); background: var(--surface-2);
}
.reste-a-poser .grand { font: 800 24px/1.1 var(--display); font-stretch: 112%; }
.reste-a-poser .texte { color: var(--doux); }
.reste-a-poser .reste { background: var(--chair-pale); box-shadow: inset 4px 0 0 var(--chair); }
.reste-a-poser .complet .grand { color: var(--fane); }
.reste-a-poser .trop .grand, .reste-a-poser .trop .texte { color: var(--gel); }
.recalibrage .pile-choisie-poses, .envoi .pile-choisie-poses { display: grid; gap: 6px; min-width: 0; }
.recalibrage .pile-choisie-poses > .aide, .envoi .pile-choisie-poses > .aide { margin: 0; }
.recalibrage .pile-choisie .pile-choisie-repere, .envoi .pile-choisie .pile-choisie-repere { padding-top: 6px; }
/* Un panneau ou une saisie étroits (tablette en portrait) : le calibre et ses palox côte à
   côte, le poids dessous ; au téléphone, une colonne. */
@container (max-width: 560px) {
  .ligne-obtenue { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .ligne-obtenue .champ-poids-obtenu { grid-column: 1 / -1; }
}
@container (max-width: 380px) {
  .ligne-obtenue { grid-template-columns: minmax(0, 1fr); }
}

/* --- Page « Stockage » : envoyer des palox (demandes de Thomas du 29 octobre 2026, n° 1 et 2) --- */

/* stock/stockage/panneaux/envoyer.html et recevoir.html (stock.ecrans_envois) : le panneau en
   deux vues, sur le modèle du recalibrage (ses groupes, ses cartes de piles et leurs compteurs,
   ce qui reste à poser, les piles choisies de la zone 3 de la récolte : règles ci-dessus et
   plus bas, partagées). En propre : le total de ce qui part
   en chiffres Archivo ; les lieux d'arrivée en cartes .choix, le nom en gras, la place en
   doux, la nature en pastille à droite ; un lieu sans place pour ces palox en retrait, qui ne
   se touche pas ; ce qui part et d'où, en tête de la vue 2 ; vers le vrac, une carte par lot
   et son poids. */
.envoi .panneau-tete h2 { font-size: 24px; }
.envoi-variete { color: var(--doux); font-weight: 600; }
.envoi-total { margin: 0; font-weight: 700; }
.envoi-total .num { font: 800 22px var(--display); font-stretch: 112%; }
.lieux-d-arrivee { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.lieux-d-arrivee label { min-height: var(--cible); }
.lieu-d-arrivee { display: grid; gap: 2px; min-width: 0; }
.lieu-d-arrivee-nom { font-weight: 700; }
.lieu-d-arrivee .aide { font-weight: 400; }
.lieu-d-arrivee-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.lieux-d-arrivee label.sans-place { cursor: not-allowed; opacity: .55; background: var(--surface-2); }
.lieux-d-arrivee label.sans-place:hover { border-color: var(--trait); }
.envoi-resume { margin: 0; font-weight: 700; }
.envoi-revenir { margin: 0; }
.envoi-reste { display: grid; gap: 10px; }
.envoi-reste > p { margin: 0; }
.envoi-lots-vrac { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.envoi-lot-vrac { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--rayon); background: var(--surface-2); }
.envoi-lot-vrac > p { margin: 0; font-weight: 700; }
.envoi-lot-vrac .pastille-couleur { width: 16px; height: 16px; margin-right: 8px; border-radius: 4px; vertical-align: -1px; }
.envoi-lot-vrac .champ { max-width: 420px; }

/* --- Page « Stockage » : expédier depuis une pile (demande de Thomas du 29 octobre 2026, n° 2) --- */

/* stock/stockage/panneaux/expedier.html (stock.ecrans_expedier) : le panneau de l'envoi (ses
   groupes, ses cartes de piles et leurs compteurs, son total : règles .envoi-…, partagées).
   En propre : le client d'un lot réservé sous la tête ; sur une pile qui porte le lot dans
   plusieurs calibres, le calibre qui part en cartes compactes (.choix.choix-compact, sans
   cadre de fieldset, sa légende en petit gras) ; le numéro de commande et « Préparer » côte
   à côte, et sous eux l'avertissement d'une commande soldée et « Préparer quand même » ;
   les commandes à servir en grands boutons pleine largeur (60 px au moins) : l'ordre de
   service en pastille ronde, le numéro en Archivo, le calibre en pastille, le client en
   gras, ce qui reste à servir à droite en chiffres ; une commande au calibre des palox a
   le liseré chair « en cours » ; une commande que le lot ne sert pas
   est en retrait (fond doux, texte doux, pas de survol), sa raison en rouge ;
   « Nouvelle commande » sous un filet en tirets. Un panneau étroit (à côté du plan d'une
   tablette en paysage, au téléphone : requête de conteneur) met tout sur une colonne :
   « Reste 2,5 t · à livrer le 31 octobre » sous le client, « Préparer » sous le numéro. */
.expedition { display: grid; gap: 14px; }
.expedition .formulaire { gap: 14px; }
.expedition .panneau-tete h2 { font-size: 24px; }
.expedition .panneau-tete h2 .pastille-couleur { width: 16px; height: 16px; margin-right: 8px; border-radius: 4px; vertical-align: -1px; }
.expedition-variete { color: var(--doux); font-weight: 600; }
.expedition-reserve { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.calibre-qui-part { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; min-width: 0; }
.calibre-qui-part > legend { padding: 0; margin-bottom: 4px; font-weight: 700; font-size: var(--texte-petit); }
.calibre-qui-part > .aide { margin: 0; }
.expedition-numero-saisie { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: stretch; }
.expedition-numero-saisie > input { flex: 3 1 9em; min-width: 0; font-family: var(--display); font-stretch: 112%; font-size: 20px; font-weight: 700; }
.expedition-numero-saisie > .bouton { flex: 1 0 auto; }
.commandes-a-expedier { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.commande-a-expedier {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 14px;
  width: 100%; min-height: 60px; padding: 10px 14px; text-align: left;
  border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface);
  color: var(--texte); font: inherit; line-height: 1.3;
}
button.commande-a-expedier { cursor: pointer; }
button.commande-a-expedier:hover { border-color: var(--peau); background: var(--survol); }
.commande-a-expedier.au-calibre { box-shadow: inset 6px 0 0 var(--chair); padding-left: 18px; }
.commande-a-expedier-tete { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.commande-a-expedier-tete strong { font: 800 20px/1.1 var(--display); font-stretch: 112%; }
.commande-a-expedier-client { grid-column: 1; font-weight: 700; overflow-wrap: anywhere; }
.commande-a-expedier-reste { grid-column: 2; grid-row: 1 / span 2; text-align: right; color: var(--doux); font-size: var(--texte-petit); }
.commande-a-expedier-reste .num { display: block; color: var(--texte); font: 800 22px/1.1 var(--display); font-stretch: 112%; }
.commande-a-expedier-livrer { display: block; color: var(--peau-texte); font-weight: 700; }
.commande-a-expedier .cap-ordre {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px;
  border-radius: 999px; background: var(--chair-pale); box-shadow: inset 0 0 0 2px var(--contour);
  font: 800 17px/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums;
}
.commande-a-expedier.en-retrait { background: var(--surface-2); color: var(--doux); border-style: dashed; }
.commande-a-expedier.en-retrait .commande-a-expedier-reste .num { color: var(--doux); }
.commande-a-expedier-raison { grid-column: 1 / -1; color: var(--gel); font-weight: 700; font-size: var(--texte-petit); }
.expedition-nouvelle { display: grid; gap: 6px; padding-top: 12px; border-top: 1px dashed var(--trait); }
.expedition-nouvelle > .bouton { justify-self: start; }
.expedition-nouvelle > p { margin: 0; }
@container (max-width: 520px) {
  .commande-a-expedier { grid-template-columns: minmax(0, 1fr); }
  .commande-a-expedier-reste { grid-column: 1; grid-row: auto; text-align: left; }
  .commande-a-expedier-reste .num { display: inline; font-size: 19px; }
  .commande-a-expedier-livrer { display: inline; }
  .commande-a-expedier-livrer::before { content: "· "; color: var(--doux); font-weight: 400; }
}

/* La préparation ouverte depuis « Expédier » : « Retour au stockage », la sortie enregistrée,
   sous son message. */
.retour-au-stockage { margin-bottom: var(--esp-4); }
.retour-au-stockage-lieu { font-weight: 400; }
/* « Placer les 2 palox de 28-35 » après une sortie recalibrée (demande de Thomas du 6 novembre
   2026, n° 5) : des boutons de la rangée en tête, ou sous le texte d'un message. */
.a-placer { display: flex; flex-wrap: wrap; gap: var(--esp-3); margin-top: var(--esp-3); }
.boutons > .a-placer { display: contents; }

/* La fiche d'un recalibrage (stock/recalibrages/fiche.html) : ce qui est entré et sorti, en
   deux colonnes, puis le bilan ; où sont passés les palox, une ligne chacun. */
.recalibrage-fiche h3 { margin: 0 0 6px; font-size: 18px; }
.recalibrage-lignes, .recalibrage-traces { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recalibrage-lignes li { line-height: 1.7; }
.recalibrage-lignes .pastille { margin-right: 6px; }
.recalibrage-fiche + .bilan-recalibrage { margin-top: 18px; }
.pastille-variete .pastille-couleur { margin-right: 6px; }
.recalibrage-lignes .num { font: 800 18px var(--display); }
.recalibrage-traces li { padding: 6px 12px; border-radius: var(--rayon-petit); background: var(--surface-2); }
.recalibrage-traces li.defait { color: var(--doux); }
.recalibrage-traces li.a-replacer { background: var(--chair-pale); }

/* « Calibré avant expédition » dans « Ce qui sort » de la préparation et « Ce qui part » de
   l'expédition directe (ventes/preparation/_recalibre.html) : ses champs ne paraissent que la
   case cochée (:has, sans JavaScript ; un navigateur qui ne le connaît pas les montre
   toujours) ; ses lignes de retour, celles de la page « Stockage », se rangent selon la
   largeur de la saisie (conteneur). */
.recalibre-avant-expedition:has(input[name="recalibre"]:not(:checked)) .champs-du-recalibrage { display: none; }
.champs-du-recalibrage { container-type: inline-size; gap: var(--esp-3); }
.champs-du-recalibrage > .aide { margin: 0; }

/* --- Palox identifiés par QR code (option de l'exploitation, réponse de Thomas du 27 octobre
   2026 ; stock/palox/, stock.ecrans_palox, static/js/scanner.js) --- */

/* Le scanner (stock/palox/_scanner.html) : un gros bouton « Scanner » (64 px, gants et
   poussière), montré seulement là où l'appareil photo s'ouvre, iPad compris (le QR lu par
   le navigateur, ou par jsQR : html[data-scanner="camera"], posé par scanner.js) ; puis,
   toujours, le repli : le code tapé, en grands chiffres, et « Ouvrir ». Côte à côte dès
   640 px de large, l'un sous l'autre au téléphone. */
.scanner { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; min-width: 0; }
.scanner-ouvrir { display: none; min-height: 64px; padding-inline: 22px; gap: 12px; font-size: 21px; }
:root[data-scanner="camera"] .scanner-ouvrir { display: inline-flex; }
.icone-qr { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.scanner-saisie { display: grid; gap: 6px; flex: 1 1 260px; min-width: 0; }
.scanner-saisie > label { font-size: var(--texte-petit); font-weight: 700; }
.scanner-rangee { display: flex; gap: 8px; min-width: 0; }
.scanner-rangee input {
  flex: 1 1 0; width: 0; min-width: 0; min-height: var(--cible-champ); padding: 8px 14px;
  border: 2px solid var(--trait); border-radius: var(--rayon); background: var(--surface); color: var(--texte);
  font: 700 var(--texte-grand) var(--display); font-stretch: 112%; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.scanner-rangee input::placeholder { color: var(--doux); text-transform: none; font-weight: 600; }
.scanner-rangee input:focus { border-color: var(--contour); outline: 3px solid var(--anneau); outline-offset: 1px; }
.scanner-rangee .bouton { flex: none; }
@media (max-width: 639px) {
  .scanner-ouvrir { flex-basis: 100%; justify-content: center; }
}
/* Page « Stockage », la liste des lieux : le scanner en tête, sur une carte. */
.scanner-du-stockage { padding-block: 16px; }
/* Page d'un lieu : le bouton rond « Scanner un palox », à gauche de la loupe ; il ouvre
   l'appareil photo, ou déplie le champ du code sur la ligne suivante. La rangée des outils
   laisse la place aux deux ronds (.stockage-outils). */
.stockage-outils > .scanner-replie > summary { right: calc(var(--cible) + 8px); }
.scanner-replie .scanner-lieu { display: block; max-width: 640px; }
.scanner-replie:not([open]) > .scanner-lieu { display: none; }

/* La fenêtre de l'appareil photo (un <dialog>, créé par scanner.js) : l'image en 4/3, un
   viseur aux coins arrondis en chair, ce que dit la lecture (role="status"), le nombre de
   palox lus d'affilée, « Fermer » ou « Terminer », « Taper le code ». */
dialog.scanner-fenetre { display: grid; gap: 14px; width: min(600px, calc(100% - 24px)); padding: 20px; }
dialog.scanner-fenetre:not([open]) { display: none; }
.scanner-vue { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--rayon); background: var(--terre); }
.scanner-vue video { display: block; width: 100%; height: 100%; object-fit: cover; }
.scanner-viseur {
  position: absolute; inset: 14% 22%; border: 4px solid var(--chair); border-radius: 18px;
  box-shadow: 0 0 0 100vmax rgb(28 21 16 / .35);
}
.scanner-etat { font-size: var(--texte-grand); font-weight: 700; }
.scanner-compte { font: 800 28px var(--display); font-stretch: 112%; color: var(--fane); }
.scanner-fenetre .boutons .bouton { min-height: 56px; }
/* Téléphone couché (600 px de haut au plus) : l'image à gauche, à la hauteur de l'écran, le
   titre, ce que dit la lecture et le compte à droite, les boutons en bas ; tout se voit sans
   faire défiler la fenêtre (dvh : la hauteur visible, barres du navigateur ôtées ; vh là où
   dvh manque). */
@media (orientation: landscape) and (max-height: 600px) {
  dialog.scanner-fenetre {
    width: min(900px, calc(100% - 24px)); padding: 16px 20px;
    grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto 1fr;
    gap: 10px 20px;
  }
  dialog.scanner-fenetre > * { grid-column: 2; align-self: start; }
  dialog.scanner-fenetre > .scanner-vue {
    grid-column: 1; grid-row: 1 / -1;
    width: min((100vh - 80px) * 4 / 3, 60vw); height: min(100vh - 80px, 45vw);
    width: min((100dvh - 80px) * 4 / 3, 60vw); height: min(100dvh - 80px, 45vw);
  }
  dialog.scanner-fenetre > .boutons { grid-row: 4; align-self: end; }
}

/* Le palox lu, en tête du panneau de sa pile : son code en grand, ce qu'il porte, ses
   gestes ; sous les lignes, les codes des palox identifiés de la pile, en puces de 44 px
   (le palox lu en chair). */
.qr-lu {
  display: grid; gap: 8px; padding: 12px 14px; border-left: 4px solid var(--chair);
  border-radius: 0 var(--rayon) var(--rayon) 0; background: var(--chair-pale);
}
.qr-lu-tete { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.qr-lu-tete strong { font: 800 30px var(--display); font-stretch: 112%; }
.qr-lu-porte { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.qr-lu-porte .pastille-couleur { width: 14px; height: 14px; }
.qr-lu .boutons { margin: 0; }
.qr-de-la-pile { display: grid; gap: 6px; }
/* Sous la jauge et les lignes de la pile, sur toute la largeur du détail. */
.pile-detail > .qr-de-la-pile, .pile-detail > .identifier-qr { grid-column: 1 / -1; }
.qr-de-la-pile > .aide { margin: 0; }
.puces-qr { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.code-qr {
  display: inline-flex; align-items: center; min-height: var(--cible); padding: 4px 12px;
  border: 2px solid var(--trait); border-radius: 999px; background: var(--surface);
  color: var(--texte); font-weight: 700; text-decoration: none;
}
.code-qr:hover { border-color: var(--peau); }
.code-qr.lu { border-color: var(--terre); background: var(--chair); color: var(--sur-chair); }
.scanner-destination { margin: 0; }
/* Récolte, zone 3 : « Scanner les palox posés » sous les piles choisies ; les palox lus de
   chaque pile en puces, chacune avec sa croix (retirer un palox lu par erreur). */
.scanner-recolte {
  display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--trait);
}
.scanner-recolte > .message { margin: 0; }
.pile-choisie .puces-qr { margin-top: 6px; }
.retirer-qr { gap: 8px; appearance: none; cursor: pointer; font: inherit; font-weight: 700; }
.retirer-qr .croix { font-size: 20px; line-height: 1; color: var(--doux); }
.retirer-qr:hover .croix, .retirer-qr:focus-visible .croix { color: var(--gel); }
/* Préparation, étape 1 : « Scanner les palox pris », sur un fond doux, avant les lieux ou le
   plan ; à l'étape 2, les codes des palox lus de chaque pile. */
.scanner-preparation { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--rayon); background: var(--surface-2); }
.scanner-preparation > .message { margin: 0; }
.ligne-de-prise .puces-qr { margin: 2px 0 6px; }

/* La fiche d'un palox : son QR à l'écran, sur un fond blanc qui lui garde sa marge (thème
   sombre compris), et son code en très gros. */
.qr-fiche { justify-items: start; }
.qr-ecran { width: min(280px, 100%); padding: 14px; border-radius: var(--rayon); background: #fff; box-shadow: inset 0 0 0 1px var(--trait); }
.qr-ecran svg { display: block; width: 100%; height: auto; }
.code-qr-grand { margin: 0; font: 800 40px/1.1 var(--display); font-stretch: 112%; }
.qr-chiffres { margin: 0; }
.autres-planches { align-items: center; gap: 8px; margin: 0; }
.variete-qr .pastille-couleur { width: 14px; height: 14px; vertical-align: -2px; }
.planches-qr { flex-wrap: wrap; }
/* Espace du support, fiche d'une exploitation : ses options, sous son identité. */
.option-exploitation { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--trait); }
.option-exploitation > * { margin: 0; }
.option-nom { font-weight: 700; }

/* --- Questions de la première connexion et « Fonctions affichées » (retour de Thomas du 17
   novembre 2026, point 1 ; comptes.views_questionnaire, Mon exploitation) --- */
/* Les pages des questions, en pastilles ; la page en cours en aplat. */
.etapes-questions { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: var(--texte-petit); color: var(--doux); }
.etapes-questions li { padding: 4px 12px; border: 1px solid var(--trait); border-radius: 999px; }
.etapes-questions li[aria-current="step"] { border-color: var(--contour); background: var(--aplat-fort); color: var(--sur-terre); font-weight: 700; }
.questionnaire { display: grid; gap: var(--esp-5); }
.question { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.question + .question { padding-top: var(--esp-5); border-top: 1px solid var(--trait); }
.question-texte { padding: 0; font-weight: 700; font-size: var(--texte-grand); line-height: 1.35; }
.question > .aide { margin: 0; }
/* Oui / Non : deux grandes cartes côte à côte, toute la carte se touche. */
.oui-non { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; }
.oui-non label { min-height: 72px; font-size: var(--texte-grand); }
/* Q5 bis ne paraît que si la réchauffe vaut Oui (sans JavaScript ; le serveur l'ignore sinon). */
.questionnaire:has(input[name="rechauffe"][value="non"]:checked) .depend-de-rechauffe { display: none; }
/* Q14 : deux images au choix, les mêmes palox colorés par variété puis par calibre. */
.couleurs-des-questions .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.couleurs-des-questions .choix label { align-items: start; }
.couleurs-des-questions .choix input { margin: 2px 0 0; }
.image-des-couleurs { display: block; width: 100%; max-width: 320px; height: auto; border-radius: 8px; background: var(--surface-2); }
.recapitulatif-des-questions h2 { margin: 0; }
.fonctions-recapitulees { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fonctions-recapitulees li { display: grid; gap: 2px; }
/* Mon exploitation : la question de chaque fonction ; une sous-question (Q5 bis) en retrait. */
.fonction-question { font-style: italic; }
.option-exploitation.sous-option { margin-left: var(--esp-5); }

/* --- Saisie des entrées (phase 2) --- */

/* Saisie sur un lot, freinte d'un lot : la saisie à gauche, le lot et ce qui est déjà
   rentré à droite ; une seule colonne sur un écran étroit (stock/entrees/). */
.saisie-entree { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--esp-5); align-items: start; }
.saisie-entree > * { min-width: 0; }
/* Variété à côté du numéro de lot dans un titre d'écran. */
.titre-variete { display: block; font-size: .6em; font-weight: 500; color: var(--doux); letter-spacing: 0; }
/* Le lot en résumé : son numéro en grand, des libellés courts pour laisser la place aux
   parcelles. */
.carte-du-lot .lot-numero { font: 800 clamp(30px, 5vw, 40px)/1.1 var(--display); font-stretch: 112%; letter-spacing: -.01em; }
.carte-du-lot .fiche > div { grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr); }
/* Compteur sans ses boutons (JavaScript absent) : la saisie seule, toujours en grand. */
.compteur:not(:has(button)) { grid-template-columns: minmax(0, 1fr); }
.champ .compteur input { min-height: 60px; }
/* Poids saisi ou proposé : gros chiffres, lisibles au bâtiment. */
.poids-saisi .champ input { font: 800 30px var(--display); font-variant-numeric: tabular-nums; min-height: 64px; }
/* Options repliées d'une saisie (tare terre, pesée brute, nature). */
.options-saisie { border: 1px solid var(--trait); border-radius: var(--rayon); padding: 4px 16px 0; }
.options-saisie[open] { padding-bottom: 16px; }
.options-saisie > summary { color: var(--doux); font-size: var(--texte-petit); }
.options-saisie > .pile { margin-top: 12px; }
/* Le repli montre son état : « + » fermé, « − » ouvert (le résumé en flex n'a plus de
   triangle). */
.options-saisie > summary::before {
  content: "+"; display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; margin-right: 12px;
  border: 2px solid var(--trait); border-radius: 8px; color: var(--texte); font-size: 18px; line-height: 1;
}
.options-saisie[open] > summary::before { content: "−"; }
/* Bilans et récapitulatifs : la ligne du total, un complément en petit, un stock négatif. */
.bilan .total { border-top: 2px solid var(--trait); margin-top: 4px; }
.bilan .total dt { color: var(--texte); font-weight: 700; }
.bilan dd small { font-size: var(--texte-petit); font-weight: 400; color: var(--doux); margin-left: 6px; }
.bilan dd.negatif { color: var(--gel); }
.chiffres-entree dd { font-size: 26px; }
/* Cartes des lots à choisir avant une saisie : toute la carte se touche. */
.lots-a-choisir > li { padding: 0; }
.lots-a-choisir > li:hover { background: var(--surface-2); border-color: var(--peau); }
.lots-a-choisir .lot-lien {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "code variete stock" "code detail stock";
  gap: 2px 16px; align-items: center; width: 100%; min-height: 72px;
  padding: 16px 20px; text-decoration: none;
}
.lots-a-choisir .code { grid-area: code; }
.lots-a-choisir strong { grid-area: variete; }
.lots-a-choisir .lot-detail { grid-area: detail; color: var(--doux); font-size: var(--texte-petit); }
.lots-a-choisir .lot-stock { grid-area: stock; display: grid; justify-items: end; font-size: 22px; font-weight: 700; }
.lots-a-choisir .lot-stock small { font-size: 13px; font-weight: 400; color: var(--doux); }
.lots-a-choisir .stock-negatif .lot-stock { color: var(--gel); }
/* Tablette en portrait : la saisie prend toute la largeur, le lot vient dessous. */
@media (max-width: 900px) {
  .saisie-entree { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .lots-a-choisir .lot-lien { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "code variete" "code detail" "stock stock"; }
  .lots-a-choisir .lot-stock { justify-items: start; }
}

/* --- Tarifs (phase 3, lot « tarifs et prix proposé ») --- */

/* Filtres d'une liste par des listes de choix (client, famille, variété des tarifs) et la
   recherche : autant de colonnes que la largeur en tient ; le bouton, utile sans
   JavaScript, disparaît quand htmx met la liste à jour à chaque choix. */
.filtres-liste { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.filtres-liste > .bouton { justify-self: start; }
/* Deux champs côte à côte dont l'un porte une erreur : l'autre garde sa hauteur, ses
   éléments en haut, au lieu de s'étirer sur la hauteur de la rangée. */
.deux > .champ, .deux > div > .champ { align-content: start; }
/* Le tarif s'applique à un client ou à une famille : deux cartes côte à côte. Seule la
   liste de choix qui correspond reste visible ; sans :has(), les deux restent, et l'autre
   est ignorée à l'envoi. */
.tarif-pour .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.formulaire:has(.tarif-pour input[value="client"]:checked) .tarif-famille,
.formulaire:has(.tarif-pour input[value="famille"]:checked) .tarif-client { display: none; }
/* Le prix se saisit en grands chiffres, comme un poids (champ de moitié de largeur). */
.tarif-prix input { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 700; }
.formulaire > .tarif-prix { max-width: calc(50% - 7px); }
/* Tableau des tarifs (liste, fiche d'un client ou d'une famille) : valeurs courtes sur une
   ligne (« Catégorie I », une période) ; sur un petit écran, le tableau défile. */
.liste-tarifs td:not(:first-child) { white-space: nowrap; }
/* Fiche d'un tarif : le prix en grand, la période à côté. */
.tarif-resume { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; }
.tarif-resume p { margin: 0; }
.tarif-prix-grand {
  font: 800 clamp(34px, 5vw, 48px)/1 var(--display); font-stretch: 112%;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (max-width: 520px) {
  .formulaire > .tarif-prix { max-width: none; }
}

/* --- Accueil et navigation (phase 3, lot « accueil, navigation et démonstration ») --- */

/* Au pied de la bande des chiffres : la dernière sortie, puis la dernière entrée, sur une
   ligne quand elles y tiennent, chacune sur la sienne sinon. */
.derniers { display: flex; flex-wrap: wrap; column-gap: 16px; }
@media (max-width: 760px) {
  /* Barre du bas (Stockage, Lots, Commandes ; quatre entrées au plus) : le texte se
     resserre pour tenir sur un téléphone de 360 px, sans rien couper. */
  .navigation { gap: 4px; padding-inline: 6px; }
  .navigation a { padding-inline: 2px; font-size: clamp(13px, 3.6vw, 15px); white-space: nowrap; }
}

/* --- Commandes (phase 3, lot « commandes » : liste, saisie, fiche, annulation) --- */

/* Liste : le numéro et sa date, le client et son code, la variété avec son calibre et sa
   catégorie, le poids avec le nombre de contenants, sur deux lignes dans la même case ; le
   nom du client seul se plie. */
.liste-commandes td small {
  display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux);
}
.liste-commandes td { white-space: nowrap; }
.liste-commandes td:nth-child(2) { white-space: normal; min-width: 10em; }
.liste-commandes .article { font-weight: 700; }
/* Le libellé caché de la colonne « Préparer » est placé dans sa case : il ne déborde pas de
   la page quand le tableau défile (tablette en portrait). */
.liste-commandes th { position: relative; }
.liste-commandes tr.annule td small { text-decoration: line-through; }
/* « À livrer le » sous la date de la commande (demande du 29 octobre 2026, n° 11). */
.liste-commandes td small.a-livrer { color: var(--peau-texte); font-weight: 700; }
.filtres-commandes { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
/* Site du lot à côté de son numéro (sorties d'une commande). */
.site-du-lot { color: var(--doux); font-size: 14px; }

/* Saisie : deux colonnes au bureau (le client et l'article ; la quantité, le prix et
   l'observation), une seule sur la tablette en portrait. */
.saisie-commande-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--esp-5); align-items: start; }
.saisie-commande-colonnes > * { min-width: 0; }
.saisie-commande .etape h2 { font-size: 21px; }
/* Le prix se saisit en grands chiffres, comme le poids ; l'aide dit le tarif. */
.champ-prix .champ input { font: 800 30px var(--display); font-variant-numeric: tabular-nums; min-height: 64px; }
.proposition-prix b { font-weight: 700; color: var(--texte); white-space: nowrap; }
.champ-prix .bouton-discret { justify-self: start; padding-inline: 4px; min-height: var(--cible); }

/* GENCOD du client (demande du 29 octobre 2026, n° 12 ; ventes/commandes/_champ_gencod.html),
   dans « 1 Le client » : un groupe encadré. Les 13 chiffres en grands chiffres espacés, leur
   code-barres refait juste dessous, sur papier blanc (noir sur blanc dans les deux thèmes :
   un scanner lit du sombre sur du clair) à 2 px par module, net ; la photo de l'étiquette sur
   papier ; ses deux gestes en boutons au doigt (« Prendre une photo », qui ouvre l'appareil
   de la tablette, masqué sur un ordinateur, où il ne ferait que choisir un fichier). */
.champ-gencod {
  gap: 14px; padding: 10px 14px 16px; border: 1px solid var(--trait); border-radius: var(--rayon);
}
.champ-gencod > legend { padding: 0 6px; }
.champ-gencod #id_gencod {
  font: 800 24px var(--display); font-variant-numeric: tabular-nums; letter-spacing: .06em;
}
.gencod-apercu > * { margin: 0; }
.gencod-code-barres, .gencod-photo-apercu { display: grid; gap: 6px; justify-items: start; margin: 0; }
.papier-code-barres { padding: 10px 12px; }
.papier-code-barres svg { display: block; width: 226px; max-width: 100%; height: auto; }
.gencod-photo-apercu .message { margin: 0; }
/* La photo un peu plus grande que l'image d'une variété : on y vérifie le code-barres. */
.gencod-photo-apercu .papier-image img, .gencod-fiche .papier-image img {
  max-width: min(320px, 100%); max-height: 220px;
}
.gencod-envoi { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gencod-envoi label.bouton { cursor: pointer; }
.gencod-envoi label.bouton:focus-within { outline: 3px solid var(--anneau); outline-offset: 3px; }
/* « Envoi de la photo… » ne prend sa place que le temps de l'envoi (htmx-request). */
.gencod-envoi-en-cours { display: none; margin: 0; font-weight: 700; }
.gencod-envoi-en-cours.htmx-request { display: block; }
ul.gencod-echec[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) {
  .gencod-camera { display: none; }
}
/* Fiche de la commande : le GENCOD dans le détail, son code-barres ou la photo. */
.gencod-fiche { display: grid; gap: 8px; justify-items: start; }
.gencod-fiche .message { margin: 0; }

/* Fiche : le client et l'article à gauche, la jauge à droite (maquette de la préparation). */
.commande-tete { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px 32px; align-items: end; }
.commande-tete > * { min-width: 0; }
.commande-numero { color: var(--doux); }
.commande-numero strong { color: var(--texte); }
.commande-article { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.commande-article li {
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-petit);
  padding: 6px 12px; font-size: var(--texte-petit);
}
.commande-article b { font-weight: 700; }
/* Commande de pommes de terre lavées (demande du 29 octobre 2026, n° 3) : la mention, mise en
   valeur parmi l'article (fiche, préparation) ; jamais sur un document du client. */
.commande-article li.lavees, .specs .spec.lavees { background: var(--chair-pale); border-color: var(--peau); }
.commande-jauge { display: grid; gap: 10px; }
.commande-jauge .jauge-chiffres { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.commande-jauge .grand { font: 800 clamp(48px, 8vw, 76px)/.9 var(--display); font-stretch: 125%; letter-spacing: -.02em; }
.commande-jauge .sur { font: 700 22px var(--display); font-stretch: 112%; color: var(--doux); }
.commande-jauge .jauge-chiffres .pastille { margin-left: auto; font-size: var(--texte-petit); padding: 4px 12px; }
/* Un carré par tonne (ou par dix) : servi en peau, reste à servir en creux. */
.avancement { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; max-width: 560px; }
.avancement i { aspect-ratio: 1.3; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--trait); }
.avancement i.servi { background: var(--peau); box-shadow: none; }
.commande-jauge .legende { margin-left: 0; }
.commande-jauge .legende i { box-shadow: inset 0 0 0 2px var(--trait); }
.commande-jauge .legende i.servi { background: var(--peau); box-shadow: none; }
@media (max-width: 900px) {
  .saisie-commande-colonnes, .commande-tete, .colonnes-commande { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .avancement { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* Annulation (RG23) : la liste des lots ne se montre que pour « dans un autre lot » ; sans
   :has(), elle reste visible et n'est lue que pour ce choix. */
.annulation .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.formulaire:has(.reintegration input[type="radio"]) .lot-de-retour { display: none; }
.formulaire:has(.reintegration input[value="autre"]:checked) .lot-de-retour,
.formulaire:has(.lot-de-retour .en-erreur) .lot-de-retour { display: block; }

/* --- Contrats et stock libre (réponse de Thomas du 27 octobre 2026, lot t34) --- */

/* Liste des contrats : comme la liste des commandes, deux lignes par case (le client et sa
   référence, la variété et son calibre, le début et la fin des livraisons) ; le reste à
   livrer, chiffre que l'on cherche, en Archivo gras ; un dépassement en petit dessous. */
.liste-contrats td small {
  display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux);
}
.liste-contrats td { white-space: nowrap; }
.liste-contrats td:first-child { white-space: normal; min-width: 10em; }
.liste-contrats .article { font-weight: 700; }
.liste-contrats th.reste { color: var(--texte); box-shadow: inset 0 -3px 0 var(--chair); }
.liste-contrats td.reste { font: 800 18px/1.3 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.liste-contrats tr.annule td small { text-decoration: line-through; }
.liste-contrats td small.depassement, .depassement { color: var(--peau-texte); font-weight: 700; }
/* Stock libre de chaque variété (liste des contrats) : une case par variété, côte à côte
   tant qu'elles tiennent (deux au téléphone) ; le libre en grand, en fane (la couleur du
   stock disponible), en gel quand il manque de quoi livrer les contrats. */
.libre-varietes {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: var(--esp-3);
}
.libre-variete {
  display: grid; gap: 2px; padding: 12px 16px;
  background: var(--surface-2); border-radius: var(--rayon); border-left: 4px solid var(--fane);
}
.libre-variete.manque { border-left-color: var(--gel); }
.libre-nom { font-weight: 700; }
.libre-nom .pastille-couleur { width: 14px; height: 14px; margin-right: 8px; vertical-align: -1px; border-radius: 4px; }
.libre-chiffre { font: 800 28px/1.1 var(--display); font-stretch: 112%; color: var(--fane); }
.libre-variete.manque .libre-chiffre { color: var(--gel); }
.libre-chiffre small { font: 700 15px var(--corps); color: var(--doux); margin-left: 4px; }
.libre-detail { font-size: 14px; color: var(--doux); }
/* Fiche d'un contrat : la tête et la jauge de la fiche d'une commande ; sous la jauge, le
   reste à livrer. */
.contrat-reste { color: var(--doux); }
.contrat-reste strong { color: var(--texte); }
.commande-article a { color: inherit; text-underline-offset: 3px; }
.observation-texte { max-width: 70ch; }
/* Accueil : sous le stock disponible, la part sous contrat et la part libre ; dans la tête
   d'une variété sous contrat, la même phrase, sous son disponible. */
.stock-contrats { font-size: 14px; line-height: 1.4; color: var(--doux); }
.stock-contrats strong { color: var(--fane); font-weight: 700; }
.stock-contrats .manque, .var-libre .manque, .libre-detail .manque { color: var(--gel); }
.var-libre { flex: 1 0 100%; text-align: right; font-size: 14px; color: var(--doux); }
.var-libre strong { color: var(--fane); font-weight: 700; }
/* Lots réservés à un client (réponse de Thomas du 30 octobre 2026) : juste en dessous, en
   plus petit encore (13 px, la taille d'une pastille), la part du stock en lots réservés ;
   collée à la ligne des contrats (la marge négative reprend l'écart de la case). */
.stock-reserve { font-size: 13px; line-height: 1.35; color: var(--doux); }
.stock-contrats + .stock-reserve { margin-top: -4px; }
.var-reserve { flex: 1 0 100%; text-align: right; font-size: 13px; line-height: 1.35; color: var(--doux); }
.var-libre + .var-reserve { margin-top: -4px; }

/* --- Consommables d'expédition (option de l'exploitation, demande du 29 octobre 2026) --- */

/* Le stock de chaque consommable (stock/consommables/index.html) : une case chacun, côte à
   côte tant qu'elles tiennent (deux au téléphone), comme le stock libre des contrats ; le
   nombre en grand, en fane (la couleur du stock disponible), l'unité en petit ; un stock
   négatif en gel, case comprise. Toute la case est un lien (ses mouvements, et le choisir
   dans la saisie) ; la case choisie est cerclée de la couleur du texte. */
.stocks-consommables {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--esp-3);
}
.stocks-consommables > li { display: grid; }
.stock-consommable {
  display: grid; gap: 4px; align-content: start; min-height: 112px;
  padding: 14px 16px; border-radius: var(--rayon);
  background: var(--surface-2); border-left: 5px solid var(--fane);
  color: var(--texte); text-decoration: none;
  transition: background-color .15s, box-shadow .15s;
}
.stock-consommable:hover { background: var(--survol); }
.stock-consommable[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--texte); }
.stock-consommable.negatif { background: var(--gel-pale); border-left-color: var(--gel); }
.stock-consommable-nom { font-weight: 700; overflow-wrap: anywhere; }
.stock-consommable-chiffre {
  font: 800 34px/1.1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums;
  color: var(--fane);
}
.stock-consommable-chiffre small { font: 700 16px var(--corps); color: var(--doux); }
.stock-consommable.negatif .stock-consommable-chiffre,
.stock-consommable.negatif .stock-consommable-chiffre small { color: var(--gel); }
.stock-consommable-pied { align-self: end; font-size: 14px; color: var(--doux); }
.stock-consommable.negatif .stock-consommable-pied { color: var(--gel); font-weight: 700; }
/* « Noter un mouvement » : la saisie sur une ligne dès 900 px (le consommable et le
   commentaire plus larges), sur deux colonnes en dessous, sur une au téléphone ; puis les
   deux gros boutons, « Entrée » et « Sortie », côte à côte (64 px), l'un sous l'autre au
   téléphone. */
.ligne-consommable { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.ligne-consommable-choix { display: grid; }
@media (min-width: 521px) {
  .ligne-consommable { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .ligne-consommable {
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 2fr);
  }
}
.sens-consommable { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--esp-3); }
.sens-consommable .bouton-large { margin: 0; }
.sens-signe { font: 800 30px/1 var(--display); }
@media (max-width: 520px) {
  .sens-consommable { grid-template-columns: minmax(0, 1fr); }
}
/* Les derniers mouvements, cinq colonnes (la tablette en portrait les tient) : la date, le
   consommable et son commentaire en petit dessous, le sens en pastille et la quantité signée
   en Archivo, qui l'a noté, « Annuler ». Un mouvement annulé barré, sa mention « Annulé »
   (qui, quand) lisible, sur deux lignes. */
.mouvements-consommables th .unite { font-weight: 400; color: var(--doux); }
.mouvements-consommables td { white-space: nowrap; }
.mouvements-consommables td.mouvement-consommable { white-space: normal; min-width: 8em; }
.mouvements-consommables td.mouvement-auteur { white-space: normal; }
.mouvements-consommables td small {
  display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux);
}
.mouvement-quantite {
  display: inline-block; min-width: 6em; margin-left: 6px; text-align: right;
  font: 600 17px var(--display); font-variant-numeric: tabular-nums;
}
.mouvements-consommables td.mouvement-action { white-space: normal; text-align: right; }
.mouvements-consommables tr.annule td.mouvement-action { text-decoration: none; }

/* --- Préparation des commandes (phase 3, lot « préparation ») --- */

/* Écrans de ventes/preparation/ (maquette terconso-preparation-commande.html) : la page
   porte .page-preparation (plus .page-a-preparer pour la liste, .page-sortie pour une
   sortie). Les noms de la maquette (.cde, .jauge, .cases…) sont rangés dessous : ils ne
   touchent pas les autres écrans. */

/* La commande à gauche (numéro, client, article en pastilles), sa jauge à droite. */
.page-preparation .cde { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 32px; align-items: end; }
.page-preparation .cde-tete { gap: 0; }
.page-preparation .cde-num { margin-top: var(--esp-2); color: var(--doux); font-size: 16px; }
.page-preparation .cde-num strong { color: var(--texte); }
.page-preparation .cde h1 { margin: 2px 0 10px; font-size: clamp(30px, 5vw, 44px); }
.page-preparation .cde-client { color: var(--doux); }
.page-preparation .specs { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.page-preparation .spec {
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-petit);
  padding: 6px 12px; font-size: var(--texte-petit);
}
/* Jauge : le servi en très grand, sur le commandé ; l'état ; une case par tonne (ou à
   l'échelle de la légende) : déjà sorti (peau), en cours de saisie (chair), reste (contour). */
.page-preparation .jauge { display: grid; gap: 10px; }
.page-preparation .jauge-chiffres { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.page-preparation .jauge-chiffres .grand { font: 800 clamp(48px, 8vw, 76px)/.9 var(--display); font-stretch: 125%; }
.page-preparation .jauge-chiffres .sur { font: 700 22px var(--display); font-stretch: 112%; color: var(--doux); }
.page-preparation .etat {
  margin-left: auto; padding: 4px 12px; border-radius: 999px; background: var(--peau-pale);
  font-size: var(--texte-petit); font-weight: 700;
}
.page-preparation .etat.partielle { background: var(--chair-pale); }
.page-preparation .etat.solde { background: var(--fane-pale); color: var(--fane); }
.page-preparation .etat.annulee { background: var(--gel-pale); color: var(--gel); }
.page-preparation .cases { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; }
.page-preparation .cases i { aspect-ratio: 1.3; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--trait); }
.page-preparation .cases i.servi, .page-preparation .barre i.servi { background: var(--peau); box-shadow: none; }
.page-preparation .cases i.encours { background: var(--chair); box-shadow: none; }
.page-preparation .jauge .legende { margin: 0; }
.page-preparation .jauge .legende i { width: 13px; height: 10px; }
.page-preparation .legende .s { background: var(--peau); }
.page-preparation .legende .c { background: var(--chair); }
.page-preparation .legende .r { box-shadow: inset 0 0 0 2px var(--trait); }
@media (prefers-reduced-motion: no-preference) {
  .page-preparation .cases i.encours { animation: preparation-en-cours 1.6s ease-in-out infinite; }
}
@keyframes preparation-en-cours { 50% { opacity: .55; } }

/* Les deux étapes côte à côte : choisir le lot (cartes à toucher), saisir ce qui sort. */
.page-preparation .travail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--esp-5); align-items: start; }
.page-preparation .travail > * { min-width: 0; }
/* Numéro d'étape : un anneau, qui ne se voit que dans le thème sombre (--contour sur --aplat-fort). */
.page-preparation .etape h2 .n { box-shadow: inset 0 0 0 2px var(--contour); }
.page-preparation .saisie {
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-grand);
  box-shadow: var(--ombre); padding: 20px; display: grid; gap: 18px;
}
.page-preparation .choix-lot { display: grid; gap: 4px; font-weight: 400; min-width: 0; }
.page-preparation .choix-numero { font: 800 22px/1.1 var(--display); font-stretch: 112%; }
.page-preparation .choix-lot small, .page-preparation .choix label small {
  display: block; font-size: 14px; font-weight: 400; line-height: 1.3; color: var(--doux);
}
.page-preparation .choix-lot .pastille { justify-self: start; margin-top: 2px; }
.page-preparation .choix-dispo {
  display: grid; justify-items: end; text-align: right;
  font: 800 24px/1 var(--display); font-stretch: 112%; color: var(--fane); white-space: nowrap;
}
.page-preparation .choix-dispo small { margin-top: 6px; font-family: var(--corps); }
.page-preparation .choix-dispo.negatif { color: var(--gel); }
.page-preparation .choix-nouveau { border-style: dashed; }
/* Le site d'un lot à créer ne se montre qu'une fois ce choix fait (sans :has(), il reste). */
.page-preparation .choix-lots:not(:has(input[value="nouveau"]:checked)) .site-nouveau-lot { display: none; }
.page-preparation .alerte-stock:empty { display: none; }
.page-preparation .recap-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.page-preparation .recap td .pastille { margin-left: 6px; }

/* Question de RG23 (correction, annulation) : un cadre, la question en titre, trois
   réponses en cartes ; la liste des lots ne paraît que pour « dans un autre lot ». */
.page-preparation .reintegration { border: 1px solid var(--trait); border-radius: var(--rayon); padding: var(--esp-4); gap: var(--esp-3); }
.page-preparation .reintegration > legend { padding-inline: 6px; font: 700 19px/1.2 var(--display); font-stretch: 112%; }
.page-preparation .reintegration.en-erreur { border-color: var(--gel); }
.page-preparation .reintegration:not(:has(input[value="autre"]:checked)) .lot-de-retour { display: none; }

/* Commandes à préparer : une carte par commande, l'avancement en barre de cases, le gros
   bouton « Préparer » à droite (dessous sur téléphone). */
.page-a-preparer .commandes-a-preparer { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-3); }
.page-a-preparer .commandes-a-preparer > li {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 12px 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-grand);
  box-shadow: var(--ombre); padding: 18px 20px;
}
.page-a-preparer .cap-num { color: var(--doux); font-size: var(--texte-petit); }
.page-a-preparer .cap-num strong { color: var(--texte); }
.page-a-preparer .cap-client { margin-top: 2px; font-size: 24px; }
.page-a-preparer .specs { margin-top: 10px; }
.page-a-preparer .cap-chiffres { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font: 700 18px var(--display); color: var(--doux); }
.page-a-preparer .cap-servi { font: 800 34px/1 var(--display); font-stretch: 112%; color: var(--texte); }
.page-a-preparer .barre { display: flex; gap: 2px; height: 14px; margin-top: 10px; }
.page-a-preparer .barre i { flex: 1 1 0; border-radius: 2px; box-shadow: inset 0 0 0 2px var(--trait); }
.page-a-preparer .cap-preparer { min-height: 60px; padding-inline: 32px; font-family: var(--display); font-stretch: 112%; font-size: var(--texte-grand); }
/* L'ordre de service (demande du 29 octobre 2026, n° 11) : le numéro fixé par
   l'administrateur, en gros chiffres dans une pastille ronde chair pâle, devant le numéro
   de la commande ; la date à livrer sous le client, en peau, en rouge une fois passée. */
.page-a-preparer .cap-ordre {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px;
  margin-right: 6px; border-radius: 999px; background: var(--chair-pale);
  box-shadow: inset 0 0 0 2px var(--contour); color: var(--texte);
  font: 800 19px/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.page-a-preparer .cap-livrer { margin-top: 4px; color: var(--peau-texte); font-weight: 700; }
.page-a-preparer .cap-livrer.en-retard { color: var(--gel); }

/* Tablette en portrait : la jauge sous la commande, la saisie sous les lots. */
@media (max-width: 900px) {
  .page-preparation .cde, .page-preparation .travail { grid-template-columns: minmax(0, 1fr); }
  .page-a-preparer .commandes-a-preparer > li { grid-template-columns: minmax(0, 1fr) auto; }
  .page-a-preparer .cap-avancement { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  .page-a-preparer .commandes-a-preparer > li { grid-template-columns: minmax(0, 1fr); }
  .page-a-preparer .cap-avancement { grid-row: auto; }
  .page-a-preparer .cap-preparer { width: 100%; }
}
@media (max-width: 460px) {
  .page-preparation .cases { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media print {
  .page-preparation .travail, .page-a-preparer .recherche { display: none !important; }
}

/* --- Préparation : départ par le plan (demande de Thomas du 9 octobre 2026, lot t15) --- */

/* ventes/preparation/_origine.html, _lieux.html, _plan_du_lieu.html, _prises.html. L'étape 1
   « D'où part la marchandise » à pleine largeur (le plan a besoin de place) ; l'étape 2
   dessous, ce qui est pris dans le stockage à gauche, ce qui sort à droite. Sans passer par
   le plan (les lots), les deux étapes restent côte à côte, comme avant. */
.page-preparation .travail.pleine-largeur { grid-template-columns: minmax(0, 1fr); }
.page-preparation .etape-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.page-preparation .sortie-grille { display: grid; gap: var(--esp-5); align-items: start; }
.page-preparation .sortie-grille.avec-prises { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.page-preparation .etape-en-attente { padding: var(--esp-5); }
.page-preparation .aide-ce-qui-sort { margin: 0; }

/* Les lieux qui stockent la variété : une carte à toucher par lieu, comme les cartes de lot ;
   le calibre de la commande en pastille chair pleine, et un liseré chair sur la carte d'un
   lieu qui en porte. « Lots non rangés », le repli, en pointillé. */
.lieux-de-la-commande {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.carte-lieu {
  display: grid; gap: 8px; align-content: start; height: 100%; min-height: 64px;
  padding: 16px 18px; border: 2px solid var(--trait); border-radius: var(--rayon);
  background: var(--surface); color: var(--texte); text-decoration: none;
  transition: border-color .15s;
}
.carte-lieu:hover { border-color: var(--peau); }
.carte-lieu:focus-visible { outline: 3px solid var(--anneau); outline-offset: 2px; }
.carte-lieu.au-calibre { box-shadow: inset 6px 0 0 var(--chair); }
.carte-lieu-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.carte-lieu-nom { font: 800 22px/1.1 var(--display); font-stretch: 112%; margin-right: auto; }
.carte-lieu-chiffres { color: var(--doux); font-size: var(--texte-petit); }
.carte-lieu-chiffres b { font: 800 28px/1 var(--display); font-stretch: 112%; color: var(--texte); }
.carte-lieu-lots { color: var(--doux); font-size: 14px; line-height: 1.35; }
.carte-lieu-calibres { display: flex; flex-wrap: wrap; gap: 6px; }
.carte-lieu-calibres .pastille.chair { background: var(--chair); color: var(--sur-chair); }
/* Ses palox au calibre de la commande (demande de Thomas du 16 octobre 2026), sous le
   chiffre du lieu ; aucun : en retrait. */
.carte-lieu-au-calibre { font-size: var(--texte-petit); font-weight: 700; }
.carte-lieu-au-calibre b { font: 800 20px/1 var(--display); font-stretch: 112%; }
.carte-lieu-au-calibre.aucun { color: var(--doux); font-weight: 600; }
.carte-lieu.carte-non-ranges { border-style: dashed; }
/* Le lot que la commande prévoit (demande du 29 octobre 2026, n° 10) : ses palox dans le
   lieu, sous le chiffre ; la carte d'un lieu qui le porte a un filet chair en haut. */
.carte-lieu.avec-lot-prevu { border-top-color: var(--chair); border-top-width: 6px; }
.carte-lieu-lot-prevu { font-size: var(--texte-petit); font-weight: 700; }
.carte-lieu-lot-prevu b { font: 800 20px/1 var(--display); font-stretch: 112%; }

/* Le lieu choisi : son nom et « Changer de lieu », le plan, puis la sélection (piles et
   palox, « Tout désélectionner », « Ce qui sort ») signalée d'un filet chair. */
.lieu-choisi { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.lieu-choisi-nom { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lieu-choisi-nom strong { font: 800 26px/1.1 var(--display); font-stretch: 112%; }
.lieu-choisi .aide { margin: 4px 0 0; max-width: 72ch; }
/* Le filtre du calibre de la commande, au-dessus du plan (demande de Thomas du 16 octobre
   2026) : deux pastilles, « Calibre de la commande » (le défaut) et « Tous les calibres »,
   avec leurs palox ; un lieu sans palox au calibre le dit, sur fond chair pâle. */
.filtre-du-calibre { display: grid; gap: 8px; }
.filtre-du-calibre .filtres a { gap: 8px; }
.filtre-du-calibre [aria-current="true"] .compte-variete { color: var(--sur-terre-doux); }
.aucun-au-calibre {
  margin: 0; padding: 10px 14px; border-left: 4px solid var(--chair);
  border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0; background: var(--chair-pale);
}
/* Le filtre du lot prévu de la commande (demande du 29 octobre 2026, n° 10), comme celui du
   calibre : « Lot prévu » (le défaut) et « Tous les lots » ; un lieu qui ne porte pas le lot
   prévu le dit, sur fond chair pâle. */
.filtre-du-lot { display: grid; gap: 8px; }
.filtre-du-lot .filtres a { gap: 8px; }
.filtre-du-lot [aria-current="true"] .compte-variete { color: var(--sur-terre-doux); }
.lot-prevu-ailleurs {
  margin: 0; padding: 10px 14px; border-left: 4px solid var(--chair);
  border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0; background: var(--chair-pale);
}
.selection-des-piles {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 10px 14px; border-left: 4px solid var(--chair);
  border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0; background: var(--surface-2);
}
.selection-des-piles p { margin: 0; }
/* Une pile (ou un tas) choisie : cerclée d'un trait épais ; tant que des piles sont
   choisies, les autres piles de la variété restent en couleur, un peu effacées. */
.batiment .pile.choisie .pile-contour,
.batiment .pile-lien:hover .pile.choisie .pile-contour { stroke: var(--texte); stroke-width: calc(6px + var(--gras, 0px)); }
.batiment-cadre.avec-choix .pile-lien .pile:not(.choisie) { opacity: .7; }
/* La liste des piles de la variété, sous le plan : une ligne à toucher par pile. */
.piles-a-choisir { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.pile-a-choisir {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: var(--cible);
  padding: 6px 12px; border: 1px solid var(--trait); border-radius: var(--rayon-petit);
  background: var(--surface); color: var(--texte); text-decoration: none;
}
.pile-a-choisir:hover { border-color: var(--peau); }
.pile-a-choisir .pastille { margin-left: auto; }
/* Une place d'un plan de réchauffe en cours, dans l'ordre de reprise (demande du 29 octobre
   2026, n° 3) : son numéro, comme sur le plan. */
.pile-a-choisir .place-a-reprendre {
  padding: 1px 8px; border-radius: var(--rayon-petit); border: 2px dashed var(--trait-fort);
  font: 800 15px/1.3 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Ce qui est pris : sur fond doux, une carte par pile (repère en gros, lot et calibre — celui
   de la commande souligné de chair —, « Retirer »), le lot d'une pile mixte en cartes
   compactes, le compteur des palox ; une pile d'un autre lot, pour la sortie suivante, en
   pointillé. */
.page-preparation .prises {
  display: grid; gap: 14px; align-content: start; padding: 20px;
  border: 1px solid var(--trait); border-radius: var(--rayon-grand); background: var(--surface-2);
}
.page-preparation .prises h3 { margin: 0; }
.page-preparation .prises > .aide, .page-preparation .lot-de-la-sortie, .page-preparation .lot-vrac { margin: 0; }
.page-preparation .lot-de-la-sortie .num { font-weight: 700; }
.lignes-de-prise { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ligne-de-prise {
  display: grid; gap: 10px; padding: 14px; border: 1px solid var(--trait);
  border-radius: var(--rayon); background: var(--surface);
}
.ligne-de-prise.en-attente { border-style: dashed; background: transparent; }
.ligne-de-prise-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.ligne-de-prise .repere { font: 800 26px/1 var(--display); font-stretch: 112%; }
.ligne-de-prise-lot { color: var(--doux); }
.ligne-de-prise-lot .num { color: var(--texte); font-weight: 700; }
.ligne-de-prise-tete .bouton-discret { margin-left: auto; min-height: var(--cible); padding-inline: 4px; }
.calibre-commande { padding: 0 4px; border-radius: 4px; background: var(--chair-pale); box-shadow: inset 0 -2px 0 var(--chair); }
.page-preparation .choix-couple, .page-preparation .lot-de-cette-sortie { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; min-width: 0; }
.page-preparation .choix-couple legend, .page-preparation .lot-de-cette-sortie legend { padding: 0; margin-bottom: 6px; font-weight: 700; font-size: var(--texte-petit); }
.choix.choix-compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.choix.choix-compact label { min-height: var(--cible); padding: 8px 12px; grid-template-columns: auto minmax(0, 1fr); }
.page-preparation .resume-des-prises { margin: 0; }
.page-preparation .resume-des-prises b { font: 800 22px/1 var(--display); font-stretch: 112%; }

/* Fiche d'une sortie : ce qu'elle a pris dans le stockage, une ligne par pile ou lieu, son
   état en pastille (remis : fane ; à replacer : chair). Fiche d'un lot : « À replacer »,
   signalé d'un liseré chair. */
.origines-de-la-sortie { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.origines-de-la-sortie li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.origines-de-la-sortie small { flex-basis: 100%; }
/* Annulation d'une sortie : ce qui avait été pris, puis ce qu'il deviendra, l'un sous
   l'autre dans la note. */
.page-sortie .message > .pile { flex: 1 1 100%; gap: var(--esp-2); }
.carte.a-replacer { box-shadow: var(--ombre), inset 6px 0 0 var(--chair); }
.a-replacer-texte { display: grid; gap: 2px; }
.a-replacer-texte small { color: var(--doux); }

@media (max-width: 900px) {
  .page-preparation .sortie-grille.avec-prises { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .lieu-choisi .bouton, .selection-des-piles .rangee, .selection-des-piles .bouton { width: 100%; }
}

/* --- Expédition directe (phase 4, lot « expédition directe ») --- */

/* ventes/directe/expedier.html : la page porte .page-preparation (étapes, cartes des lots,
   saisie, alerte de stock, site d'un lot à créer) et .page-directe pour ce qui suit. */
.page-directe .saisie-directe { gap: var(--esp-4); }
.page-directe .saisie h2 { font-size: 21px; }
/* La variété d'un lot, à côté de son numéro : c'est celle de la vente (F57). */
.page-directe .choix-variete {
  display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 10px;
  border-radius: 999px; background: var(--fane-pale); color: var(--texte);
  font: 700 15px/1.4 var(--corps); letter-spacing: 0;
}
/* Le lot choisi (F57, F60) : son bilan en deux chiffres, puis ce qui en est déjà sorti. */
.page-directe .lot-choisi {
  display: grid; gap: 12px; padding: 16px 20px; background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--rayon-grand); box-shadow: var(--ombre);
}
.page-directe .lot-choisi:not(:has(*)) { display: none; }
.page-directe .lot-choisi-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.page-directe .lot-choisi h3 { font: 800 22px/1.2 var(--display); font-stretch: 112%; }
.page-directe .lot-choisi .bilan { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.page-directe .lot-choisi .bilan > div { border-bottom: 0; padding-block: 4px; }
.page-directe .lot-choisi .bilan dd.negatif { color: var(--gel); }
.page-directe .lot-choisi .table-wrap { box-shadow: none; }
.page-directe .lot-choisi .table-wrap table { min-width: 420px; }
.page-directe .lot-choisi .bouton-discret { min-height: var(--cible); padding-inline: 4px; }
@media (max-width: 460px) {
  .page-directe .lot-choisi .bilan { grid-template-columns: minmax(0, 1fr); }
}

/* Expédition directe depuis le plan (lot t17) : la variété choisie, l'étape 1 est celle de
   la préparation (lieux, plan, .prises), à pleine largeur ; la suite (#suite-directe)
   dessous : ce qui est pris et le lot de la vente à gauche, pour qui et ce qui part à
   droite (.sortie-grille.avec-prises) ; sans rien de pris (liste des lieux, plan sans
   pile), « Pour qui » et « Ce qui part » côte à côte, l'observation et les boutons dessous,
   sur toute la largeur. Sans passer par le plan, les deux colonnes d'avant. */
.page-directe .suite-directe { display: grid; gap: var(--esp-5); align-items: start; }
.page-directe .suite-directe > * { min-width: 0; }
.page-directe .directe-origine .lot-choisi { box-shadow: none; }
.page-directe .etape-origine > .champ.en-erreur { margin: 0; }
@media (min-width: 901px) {
  .page-directe .suite-directe.sans-prises .directe-saisie {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start;
  }
  .page-directe .suite-directe.sans-prises .directe-saisie > :not(.etape) { grid-column: 1 / -1; }
}

/* --- Table des expéditions (phase 4, lot « table des expéditions, accueil et démonstration ») --- */

/* ventes/expeditions/table.html (F53) : les filtres, le poids total en grands chiffres, puis
   la table, deux lignes par case comme la liste des commandes. */
/* Quatre colonnes au bureau et sur la tablette (la recherche en prend deux) ; deux sur un
   téléphone, la recherche sur toute la largeur. */
.filtres-expeditions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filtres-expeditions .filtre-recherche { grid-column: span 2; }
/* La case « avec bon de livraison seulement » s'aligne sur le bas des champs. */
.filtres-expeditions .coche { align-self: end; min-height: var(--cible-champ); font-size: var(--texte-petit); font-weight: 700; }
@media (max-width: 760px) {
  .filtres-expeditions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filtres-expeditions .filtre-recherche, .filtres-expeditions .coche { grid-column: 1 / -1; }
}
.resume-expeditions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--doux); }
.resume-expeditions .total { font: 800 34px/1 var(--display); font-stretch: 112%; color: var(--texte); }
/* Quatre colonnes (cinq avec le prix) : chaque case dit l'essentiel sur sa première ligne
   (date, client, lot et variété, poids), le détail dessous, en petit. */
.table-expeditions td small {
  display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux);
}
.table-expeditions td { white-space: nowrap; }
/* Le client et les parcelles du lot se plient ; la date, le poids et le prix non. */
.table-expeditions td:nth-child(2), .table-expeditions td:nth-child(3) { white-space: normal; min-width: 9em; }
.table-expeditions .commande, .table-expeditions .article + small { white-space: nowrap; }
/* Tablette en portrait : les cases se resserrent pour que le prix reste à l'écran. */
@media (max-width: 900px) {
  .table-expeditions th, .table-expeditions td { padding-inline: 10px; }
  .table-expeditions .commande { white-space: normal; }
}
.table-expeditions .date { font-variant-numeric: tabular-nums; }
.table-expeditions .bon { color: var(--texte); font-weight: 700; }
.table-expeditions .bon b, .table-expeditions .numero-lot, .table-expeditions .poids { font-family: var(--display); font-weight: 700; }
.table-expeditions .article { margin-left: 4px; font-weight: 700; }
.table-expeditions .pastille { margin-left: 4px; }
/* Bon, commande, lot : des liens dans le texte, mais des cibles de 44 px au doigt. */
.table-expeditions td a {
  display: inline-block; min-height: var(--cible); padding-block: 11px; margin-block: -11px;
  font-weight: 700; text-decoration-color: var(--souligne);
}

/* --- Bons de livraison et étiquettes (phase 4, lot « documents ») --- */

/* ventes/documents/*.html (.page-documents) ; les boutons du chargement sous le
   récapitulatif de la préparation (.documents-chargement) ; la section « Bons de
   livraison » de la fiche d'une commande (tableau standard). */

/* Le contenu d'un bon : les parties côte à côte, l'article, les lignes. */
.bl-contenu { display: grid; gap: var(--esp-4); min-width: 0; }
.bl-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--esp-4); }
.bl-colonne { display: grid; gap: var(--esp-3); align-content: start; min-width: 0; }
.bl-partie { padding: 4px 0; overflow-wrap: anywhere; }
.bl-partie.principale {
  padding: 12px 16px; border: 1px solid var(--trait); border-radius: var(--rayon);
  background: var(--surface-2);
}
.bl-partie h3, .bl-article dt {
  font: 700 13px/1.4 var(--corps); letter-spacing: .06em; text-transform: uppercase;
  color: var(--doux);
}
.bl-partie strong { font-size: 18px; }
/* Le numéro de certification du site, sous l'adresse de l'expéditeur, quand toutes les lignes
   du bon l'ont ; sinon (un lot acheté, des lots de numéros différents), celui de chaque lot,
   sous son numéro (lot t65). */
.bl-certification { margin-top: 6px; color: var(--doux); font-size: var(--texte-petit); }
.bl-certification .num, .bl-certification-du-lot .num { color: var(--texte); font-weight: 700; }
.bl-certification-du-lot { display: block; margin-top: 2px; color: var(--doux); font-size: var(--texte-petit); }
.bl-article {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0;
  padding-block: 12px; border-block: 1px solid var(--trait);
}
.bl-article dd { margin: 0; font-weight: 700; font-size: 18px; }
.bl-article .bl-denomination { flex: 1 1 240px; }
.bl-article .bl-remplace dd { color: var(--gel); }
.bl-contenu td .pastille { margin-left: 6px; }

/* L'écran du bon : l'aperçu, puis la date de livraison et le geste d'édition. */
.bl-apercu { border-left: 6px solid var(--chair); }
.bl-date { max-width: 320px; }

/* Étiquettes : le choix de la planche, l'aperçu d'une étiquette. */
.gabarits label { grid-template-columns: auto minmax(0, 1fr) auto; }
.gabarits .gabarit-nom { font: 800 20px/1.2 var(--display); font-stretch: 112%; }
.gabarits small { display: block; font-weight: 400; font-size: var(--texte-petit); color: var(--doux); }
.gabarits .gabarit-feuilles { font-size: var(--texte-petit); color: var(--doux); white-space: nowrap; }
/* La planche du conditionnement (« Planche du conditionnement Vrac »), choisie d'avance. */
.gabarits .gabarit-du-conditionnement { margin-top: 4px; white-space: normal; }
/* Le format du conditionnement (demande du 6 novembre 2026, n° 6) : une phrase, un bouton ;
   les autres planches repliées dessous. */
.formulaire.format-du-conditionnement { gap: 12px; }
.format-du-conditionnement .boutons { margin-top: 8px; }
.format-du-conditionnement .format-phrase { margin: 0; font-size: 18px; line-height: 1.45; }

/* Essai de l'étiqueteuse du poste (ventes/documents/essai_impression.html, page non
   répertoriée) : le ZPL en chasse fixe, la réponse du serveur sous son bouton (son message
   tel quel, retours à la ligne gardés), la liste des étiqueteuses branchées ou la marche à
   suivre (accès au réseau local refusé) sous le message. */
.essai-impression .zpl { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--texte-petit); }
.essai-resultat:not(:empty) { margin-top: var(--esp-3); }
.essai-liste { flex-basis: 100%; margin: 0; padding-left: 1.2em; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--texte-petit); overflow-wrap: anywhere; }
.essai-serveur { flex-basis: 100%; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.essai-etapes { flex-basis: 100%; margin: 0; padding-left: 1.4em; }
.essai-etapes li + li { margin-top: 4px; }
.format-du-conditionnement .format-phrase strong { font: 800 20px/1.2 var(--display); font-stretch: 112%; }
.format-du-conditionnement .aide { margin: 0; }
.autre-format { margin-top: 20px; }
.autre-format > .formulaire { margin-top: 12px; }
.format-a-regler { margin: 16px 0 0; }
.etiquette-apercu {
  display: grid; gap: 8px; padding: 18px 20px; max-width: 460px;
  background: var(--surface); color: var(--texte); border: 2px dashed var(--trait); border-radius: var(--rayon-petit);
}
.etiquette-denomination {
  display: flex; justify-content: space-between; gap: 12px;
  font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
}
.etiquette-repere { font-size: 13px; color: var(--doux); letter-spacing: 0; white-space: nowrap; }
.etiquette-variete { font: 800 34px/1.05 var(--display); font-stretch: 112%; overflow-wrap: anywhere; }
.etiquette-caracteristiques, .etiquette-identification { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; }
.etiquette-identification { justify-content: space-between; padding-top: 8px; border-top: 2px solid var(--contour); }
.etiquette-apercu dt { font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
.etiquette-apercu dd { margin: 0; font-weight: 700; font-size: 17px; }
.etiquette-identification dd { font: 800 24px/1.1 var(--display); font-stretch: 112%; }
.etiquette-expediteur { font-size: 14px; }
.etiquette-expediteur span { font-weight: 700; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--doux); }
.etiquette-traitement {
  justify-self: start; padding: 2px 10px; border: 2px solid var(--texte); border-radius: 6px;
  font-weight: 700; font-size: 14px;
}

/* Feuilles de colisage (ventes/documents/colisage.html ; demande de Thomas du 29 octobre
   2026, n° 5) : une ligne par lot et conditionnement, encadrée, son nombre d'unités au
   compteur ; le total compté ; l'aperçu de la première feuille, en grands caractères comme
   sur la palette. */
.colisage-ligne {
  display: grid; gap: 10px; margin: 0; padding: 10px 14px 16px; min-width: 0;
  border: 1px solid var(--trait); border-radius: var(--rayon);
}
.colisage-ligne > legend { padding: 0 6px; font: 700 19px var(--display); font-stretch: 112%; }
.colisage-ligne > legend .pastille { margin-left: 6px; vertical-align: 2px; }
.colisage-contenu { margin: 0; color: var(--doux); }
.colisage-ligne .compteur { max-width: 320px; }
.colisage-total {
  margin: 0; padding: 12px 16px; border-radius: var(--rayon); background: var(--surface-2);
  border-left: 6px solid var(--chair); font-size: 17px;
}
.colisage-total strong { font: 800 26px var(--display); font-stretch: 112%; }
.feuille-apercu {
  display: grid; gap: 10px; padding: 18px 20px; max-width: 460px;
  background: var(--surface); color: var(--texte); border: 2px dashed var(--trait); border-radius: var(--rayon-petit);
}
.feuille-titre {
  margin: 0; padding-bottom: 6px; border-bottom: 2px solid var(--texte);
  font: 800 13px var(--display); font-stretch: 112%; letter-spacing: .06em; text-transform: uppercase; text-align: right;
}
.feuille-reperes, .feuille-caracteristiques { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; }
.feuille-apercu dt { font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
.feuille-apercu dd { margin: 0; font-weight: 700; font-size: 17px; }
.feuille-reperes dd { font: 800 44px/1 var(--display); font-stretch: 112%; }
.feuille-variete { margin: 0; font: 800 34px/1.05 var(--display); font-stretch: 112%; overflow-wrap: anywhere; }
.feuille-contenu {
  margin: 0; padding: 8px 12px; border: 2px solid var(--texte); border-radius: 6px; font-size: 15px;
}
.feuille-contenu span, .feuille-expediteur span {
  display: block; font-weight: 700; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--doux);
}
.feuille-expediteur { margin: 0; font-size: 14px; }
/* Le GENCOD du client sur la feuille (demande du 29 octobre 2026, n° 12) : son code-barres,
   ou la photo de l'étiquette, sur papier blanc ; l'avertissement d'une photo sans chiffres
   en tête de l'écran, son bouton à droite. */
.feuille-gencod { display: grid; gap: 4px; justify-items: start; }
.feuille-gencod > span {
  font-weight: 700; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--doux);
}
.gencod-avertissement { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.gencod-avertissement p { margin: 0; flex: 1 1 24rem; }

/* Sous le récapitulatif de la préparation (maquette : « Imprimer les étiquettes »,
   « Éditer le bon de livraison ») : des gestes de 56 px, au doigt. */
.documents-chargement { margin-top: var(--esp-2); }
.documents-chargement .bouton { min-height: 56px; padding-inline: 22px; }

/* --- Écran de récolte (phase 6, lot « écran de récolte pour tablette ») --- */

/* stock/recolte/recolte.html (.page-recolte) : au bureau et sur la tablette en paysage,
   l'origine à gauche, la saisie à droite, puis, sur toute la largeur et dans l'ordre du
   geste, « Où je la range » (le plan a besoin de place), l'enregistrement et ce qui est
   déjà rentré ; en portrait et au téléphone, l'un sous l'autre, dans le même ordre. */
.page-recolte .recolte {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-areas: "origine saisie" "rangement rangement" "envoi envoi" "recap recap";
  grid-template-rows: auto auto auto auto;
  gap: var(--esp-5) var(--esp-6);
  align-items: start;
}
.page-recolte .recolte > * { min-width: 0; }
.page-recolte .recolte-origine { grid-area: origine; }
.page-recolte .recolte-saisie { grid-area: saisie; }
.page-recolte .recolte-recap { grid-area: recap; }
.page-recolte .recolte-rangement { grid-area: rangement; }
.page-recolte .recolte-envoi { grid-area: envoi; }
/* Numéro d'étape : un anneau, qui ne se voit que dans le thème sombre (--contour sur --aplat-fort). */
.page-recolte .etape h2 .n { box-shadow: inset 0 0 0 2px var(--contour); }
.page-recolte .saisie {
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-grand);
  box-shadow: var(--ombre); padding: 20px; display: grid; gap: 18px;
}
/* Les deux listes de l'origine, puis « Changer d'origine », discret, sous la liste des lots
   (et « Mettre à jour l'origine » sans JavaScript). */
.page-recolte .origine { display: grid; gap: 14px; }
.page-recolte .origine-listes > .champ { align-content: start; }
/* Au bureau et en paysage, la colonne de l'origine est étroite : les deux listes l'une sous
   l'autre, pour lire le nom de la parcelle et le numéro du lot en entier. */
@media (min-width: 901px) {
  .page-recolte .origine-listes { grid-template-columns: minmax(0, 1fr); }
}
.page-recolte .boutons-origine { justify-content: flex-end; margin-top: -6px; }
.htmx .page-recolte .boutons-origine:not(:has(.bouton-discret)) { display: none; }
.page-recolte .boutons-origine .bouton-discret { min-height: var(--cible); padding-inline: 6px; }
.page-recolte .origine-aide { padding: 4px 2px; }
/* Le lot choisi (liseré fane) ou le lot à créer (liseré chair) : le numéro en grand et la
   variété, puis la fiche résumée. */
.page-recolte .lot-origine, .page-recolte .nouveau-lot {
  display: grid; gap: 10px; padding: 16px 20px; background: var(--surface);
  border: 1px solid var(--trait); border-left: 6px solid var(--fane);
  border-radius: var(--rayon-grand); box-shadow: var(--ombre);
}
.page-recolte .nouveau-lot { border-left-color: var(--chair); gap: 14px; }
.page-recolte .nouveau-lot h3 { font-size: 21px; }
.page-recolte .lot-origine-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.page-recolte .lot-origine-numero { font: 800 clamp(26px, 4vw, 32px)/1.1 var(--display); font-stretch: 112%; letter-spacing: -.01em; }
.page-recolte .variete-pastille {
  display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 12px;
  border-radius: 999px; background: var(--fane-pale); color: var(--texte);
  font: 700 16px/1.5 var(--corps); letter-spacing: 0;
}
.page-recolte .lot-origine-tete .bouton-discret { min-height: var(--cible); padding-inline: 4px; }
/* Ce qui est déjà rentré sur le lot (F34) et son stock (RG01), en chiffres, sous le numéro :
   visibles dès le choix du lot, à jour après chaque benne. */
.page-recolte .lot-origine-chiffres { display: flex; flex-wrap: wrap; gap: 4px 32px; margin: 0; }
.page-recolte .lot-origine-chiffres dt { color: var(--doux); font-size: var(--texte-petit); }
.page-recolte .lot-origine-chiffres dd { margin: 0; font: 800 28px/1.1 var(--display); font-stretch: 112%; }
.page-recolte .lot-origine-chiffres dd.negatif { color: var(--gel); }
.page-recolte .lot-origine-fiche > div { grid-template-columns: minmax(0, 9em) minmax(0, 1fr); padding-block: 8px; }
.page-recolte .lot-origine-fiche dd { font-weight: 400; }
.page-recolte .avec-lien { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
/* Où est le lot : ses piles par lieu, son vrac, ses anciens emplacements, un par ligne. */
.page-recolte .ou-est-le-lot { display: grid; gap: 2px; }
.page-recolte .avec-lien .bouton-discret { min-height: var(--cible); margin-block: -10px; padding-inline: 4px; font-size: var(--texte-petit); }
/* Le poids net enregistré, sous le poids, quand une tare s'en déduit. */
.page-recolte .poids-net { margin-top: -8px; color: var(--doux); font-size: var(--texte-petit); }
.page-recolte .poids-net:empty { display: none; }
.page-recolte .poids-net strong { color: var(--fane); font-size: 19px; }
.page-recolte .poids-net.en-erreur { color: var(--gel); font-weight: 700; }
/* Le poids proposé et, pour un poids saisi à la main, « Reprendre le poids proposé ». */
.poids-saisi { display: grid; gap: 6px; }
.poids-saisi .reprendre-poids { justify-self: start; min-height: var(--cible); padding-inline: 4px; }
/* Ce qui est déjà rentré : le total du lot en très grand, comme la jauge de la préparation,
   le détail par conditionnement, puis les dernières entrées, la nouvelle en chair. */
.page-recolte .recap-lot {
  display: grid; gap: 14px; padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--rayon-grand); box-shadow: var(--ombre);
}
.page-recolte .recap-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.page-recolte .recap-total .grand { font: 800 clamp(44px, 7vw, 64px)/.95 var(--display); font-stretch: 125%; letter-spacing: -.02em; }
.page-recolte .recap-total .sur { font: 700 20px var(--display); font-stretch: 112%; color: var(--doux); }
.page-recolte .recap-total .compte {
  margin-left: auto; padding: 4px 12px; border-radius: 999px; background: var(--peau-pale);
  font-size: var(--texte-petit); font-weight: 700;
}
.page-recolte .recap-conditionnements dd { font-size: 20px; }
.page-recolte .dernieres-titre { font-size: 17px; color: var(--doux); }
.page-recolte .dernieres-entrees { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.page-recolte .dernieres-entrees li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center;
  padding: 8px 10px 8px 14px; border: 1px solid var(--trait); border-radius: var(--rayon);
}
.page-recolte .dernieres-entrees li.nouveau { background: var(--chair-pale); border-color: var(--chair); }
.page-recolte .dernieres-entrees time { color: var(--doux); font-weight: 700; }
.page-recolte .dernieres-entrees .detail { font-weight: 700; }
.page-recolte .dernieres-entrees .detail small { display: block; font-weight: 400; font-size: 14px; color: var(--doux); }
.page-recolte .dernieres-entrees .poids { font-weight: 700; font-size: 18px; white-space: nowrap; }
.page-recolte .recap-lot > .bouton { justify-self: start; }
/* Tablette en portrait et téléphone : une seule colonne, dans l'ordre du geste. */
@media (max-width: 900px) {
  .page-recolte .recolte { grid-template-columns: minmax(0, 1fr); grid-template-areas: "origine" "saisie" "rangement" "envoi" "recap"; grid-template-rows: none; }
}
@media (max-width: 520px) {
  .page-recolte .dernieres-entrees li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .page-recolte .dernieres-entrees .bouton { grid-column: 1 / -1; justify-self: start; }
  /* Ce qui est déjà rentré sur le lot (F34) et son stock (RG01), en chiffres, sous le numéro :
   visibles dès le choix du lot, à jour après chaque benne. */
.page-recolte .lot-origine-chiffres { display: flex; flex-wrap: wrap; gap: 4px 32px; margin: 0; }
.page-recolte .lot-origine-chiffres dt { color: var(--doux); font-size: var(--texte-petit); }
.page-recolte .lot-origine-chiffres dd { margin: 0; font: 800 28px/1.1 var(--display); font-stretch: 112%; }
.page-recolte .lot-origine-chiffres dd.negatif { color: var(--gel); }
.page-recolte .lot-origine-fiche > div { grid-template-columns: minmax(0, 1fr); }
  .page-recolte .recap-total .compte { margin-left: 0; }
  .page-recolte .boutons-origine > .bouton-discret { width: auto; flex: 0 0 auto; }
}
@media print {
  .page-recolte .recolte-saisie, .page-recolte .boutons-origine { display: none !important; }
}

/* Zone 3 « Où je la range » (stock/recolte/_rangement.html, demande de Thomas du 9 octobre
   2026 ; stock.ecrans_rangement) : une carte comme la saisie ; le site figé et le lieu en
   tête, le compteur « reste à ranger » en grand, le plan du bâtiment en mode sélection, les
   piles choisies dessous, chacune sur sa carte au liseré chair. Sur le plan (seulement
   ici) : où poser cerclé de fane, sur fond fane pâle quand la pile est vide ; pile mixte
   possible en tirets peau ; pile choisie cerclée de chair, « +4 » à la place de sa
   hauteur ; pleine atténuée. Les couleurs des variétés restent celles du dessin. */
:is(.page-recolte, .page-a-ranger) .rangement {
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-grand);
  box-shadow: var(--ombre); padding: 20px; display: grid; gap: 16px;
}
:is(.page-recolte, .page-a-ranger) .rangement > p { margin: 0; }
:is(.page-recolte, .page-a-ranger) .rangement-ou > .champ { align-content: start; }
:is(.page-recolte, .page-a-ranger) .rangement-ou:not(.deux) { max-width: 560px; }
/* Sous le lieu, l'avertissement d'une entrée dont le conditionnement ne va pas avec lui
   (stock/recolte/_rangement_melange.html : en vrac dans un lieu en palox, en palox dans un
   lieu en vrac) ; vide, il ne prend pas de place dans la carte. */
:is(.page-recolte, .page-a-ranger) .rangement-melange:empty { display: none; }
:is(.page-recolte, .page-a-ranger) .rangement-melange .message { max-width: 760px; }
:is(.page-recolte, .page-a-ranger) .rangement-melange .message > p { margin: 0; }
:is(.page-recolte, .page-a-ranger) .rangement-sans-emplacement { max-width: 760px; }
:is(.page-recolte, .page-a-ranger) .rangement-sans-emplacement > p { margin: 0; }
:is(.page-recolte, .page-a-ranger) .rangement-sous-titre { font-size: 17px; color: var(--doux); margin: 0; }
:is(.page-recolte, .page-a-ranger) .rangement-suivi { display: grid; gap: 4px; }
:is(.page-recolte, .page-a-ranger) .reste-a-ranger { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0; }
:is(.page-recolte, .page-a-ranger) .reste-a-ranger .grand { font: 800 clamp(40px, 6vw, 56px)/.95 var(--display); font-stretch: 125%; letter-spacing: -.02em; }
:is(.page-recolte, .page-a-ranger) .reste-a-ranger .texte { font: 700 19px var(--display); font-stretch: 112%; color: var(--doux); }
:is(.page-recolte, .page-a-ranger) .reste-a-ranger.complet .grand { color: var(--fane); }
:is(.page-recolte, .page-a-ranger) .reste-a-ranger.trop .grand, :is(.page-recolte, .page-a-ranger) .reste-a-ranger.trop .texte { color: var(--gel); }
:is(.page-recolte, .page-a-ranger) .reste-a-ranger.inconnu .texte:only-child { font: inherit; color: var(--doux); }
:is(.page-recolte, .page-a-ranger) .rangement-suivi .trop-range { margin-top: 8px; }
:is(.page-recolte, .page-a-ranger) .rangement-plan { display: grid; gap: 10px; }
:is(.page-recolte, .page-a-ranger) .rangement-cadre { max-height: min(70vh, 720px); }
/* Compact sur la tablette : tout le bâtiment dans la largeur de la carte, sans défiler (les
   piles y gardent une cible de plus de 44 px) ; sur un téléphone, 640 px au moins, le plan
   défile dans son cadre. */
.rangement-plan .batiment[width] { width: 100%; min-width: 640px; max-width: none; }
.rangement-plan .batiment .pile.conseillee .pile-contour { stroke: var(--fane); stroke-width: calc(3px + var(--gras, 0px)); stroke-dasharray: none; }
.rangement-plan .batiment .pile.conseillee.vide .pile-fond { fill: var(--fane-pale); }
.rangement-plan .batiment .pile.conseillee.vide text { fill: var(--fane); }
.rangement-plan .batiment .pile.mixte-possible .pile-contour { stroke: var(--peau); stroke-width: calc(2px + var(--gras, 0px)); stroke-dasharray: 7 4; }
.rangement-plan .batiment .pile.pleine:not(.choisie),
.rangement-plan .batiment .pile.reservee-a-un-autre:not(.choisie),
.rangement-plan .batiment .pile.porte-des-vides:not(.choisie) { opacity: .3; }
/* Un emplacement d'un autre palox que l'entrée (retour de Thomas du 17 novembre 2026 :
   « filtrer visuellement ») : en filigrane, sans fond ni pastille, son contour en pointillé
   fin et ses textes au texte secondaire (lisible sur le sol des deux thèmes, où le trait du
   plan sombre se perdrait) ; distinct d'une pile pleine (son fond, estompé) et d'un emplacement
   où poser. Choisi quand même, il garde le cadre d'une pile choisie, avec son refus. */
.rangement-plan .batiment .pile.autre-format:not(.choisie) { opacity: .55; }
.rangement-plan .batiment .pile.autre-format:not(.choisie) .pile-fond { fill: none; }
.rangement-plan .batiment .pile.autre-format:not(.choisie) .pile-pastille,
.rangement-plan .batiment .pile.autre-format:not(.choisie) .pile-bande { display: none; }
.rangement-plan .batiment .pile.autre-format:not(.choisie) .pile-contour { stroke: var(--doux); stroke-width: calc(1px + var(--gras, 0px)); stroke-dasharray: 2 4; }
.rangement-plan .batiment .pile.autre-format:not(.choisie) .pile-texte { fill: var(--doux); stroke: none; }
/* Une place réservée au lot de l'entrée (demande du 29 octobre 2026, n° 7) : proposée
   d'abord, cerclée de fane comme une pile conseillée, son cadre en tirets à la couleur de la
   variété du lot (stock.dessins). */
.rangement-plan .batiment .pile.reservee-au-lot .pile-contour { stroke: var(--fane); stroke-width: calc(4px + var(--gras, 0px)); stroke-dasharray: none; }
.rangement-plan .batiment .pile.reservee-au-lot.vide .pile-fond { fill: var(--fane-pale); }
.legende-rangement .legende-reservee-au-lot { background: var(--fane-pale); box-shadow: inset 0 0 0 3px var(--fane); outline: 2px dashed var(--trait-plan); outline-offset: -6px; }
.rangement-plan .batiment .pile.bloquee:not(.choisie) { opacity: .6; }
.rangement-plan .batiment .pile.choisie .pile-contour,
.rangement-plan .batiment .pile-lien:hover .pile.choisie .pile-contour { stroke: var(--chair-plan-fonce); stroke-width: calc(6px + var(--gras, 0px)); stroke-dasharray: none; }
.rangement-plan .batiment .pile.choisie.vide .pile-fond { fill: var(--chair-pale); }
.rangement-plan .batiment .pile.choisie.vide text { fill: var(--texte); }
.rangement-plan .batiment .pile-lien:focus-visible .pile.choisie .pile-contour { stroke: var(--anneau-plan); }
.legende-rangement i { border-radius: 2px; }
.legende-rangement .legende-conseillee { background: var(--fane-pale); box-shadow: inset 0 0 0 2px var(--fane); }
.legende-rangement .legende-mixte { background: var(--surface); border: 2px dashed var(--peau); }
.legende-rangement .legende-choisie { background: var(--chair-pale); box-shadow: inset 0 0 0 3px var(--chair-plan-fonce); }
.legende-rangement .legende-pleine { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--doux); opacity: .45; }
.legende-rangement .legende-autre-format { background: none; border: 1px dashed var(--doux); opacity: .7; }
:is(.page-recolte, .page-a-ranger) .piles-choisies { display: grid; gap: 10px; }
:is(.page-recolte, .page-a-ranger) .piles-choisies > p { margin: 0; }
:is(.page-recolte, .page-a-ranger) .liste-piles-choisies, .recalibrage .liste-piles-choisies, .envoi .liste-piles-choisies {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
:is(.page-recolte, .page-a-ranger) .pile-choisie, .recalibrage .pile-choisie, .envoi .pile-choisie {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; align-items: start;
  padding: 12px 14px; border: 1px solid var(--trait); border-left: 6px solid var(--chair);
  border-radius: var(--rayon); background: var(--surface);
}
:is(.page-recolte, .page-a-ranger) .pile-choisie.pleine, :is(.page-recolte, .page-a-ranger) .pile-choisie.autre-format,
:is(.page-recolte, .page-a-ranger) .pile-choisie.en-erreur { border-left-color: var(--gel); }
:is(.page-recolte, .page-a-ranger) .pile-choisie-repere, .recalibrage .pile-choisie-repere, .envoi .pile-choisie-repere { font: 800 28px/1 var(--display); font-stretch: 112%; padding-top: 36px; min-width: 2.2ch; }
:is(.page-recolte, .page-a-ranger) .pile-choisie .retirer-pile, .recalibrage .pile-choisie .retirer-pile, .envoi .pile-choisie .retirer-pile { grid-column: 2; justify-self: start; min-height: var(--cible); padding-inline: 4px; }
:is(.page-recolte, .page-a-ranger) .piles-a-choisir ul { list-style: none; margin: 8px 0 0; padding: 0; }
:is(.page-recolte, .page-a-ranger) .contenu-du-vrac .num { font-weight: 700; }
.page-recolte .recolte-envoi .bouton-large { margin: 0; }
@media (min-width: 901px) {
  .page-recolte .recolte-envoi { justify-content: flex-end; }
  .page-recolte .recolte-envoi .bouton-large { max-width: 560px; }
}
@media print {
  .page-recolte .recolte-rangement, .page-recolte .recolte-envoi { display: none !important; }
}

/* --- Mon exploitation et images (phase 4, lot « personnalisation des documents ») --- */

/* compte/mon_exploitation.html (logo des bons de livraison), referentiel/image_variete.html
   (image des étiquettes d'une variété), partiels/champ_image.html. Un aperçu se montre sur
   « papier » : blanc et encre sombre dans tous les thèmes, comme le document imprimé (un
   logo au fond transparent, pensé pour le papier blanc, resterait sinon illisible dans le
   thème sombre). */
.papier {
  --papier: #ffffff; --encre-papier: #1b1410; --doux-papier: #4f4339;
  background: var(--papier); color: var(--encre-papier);
  border: 1px solid var(--trait); border-radius: var(--rayon-petit); box-shadow: var(--ombre);
}
.logo-apercu, .image-apercu { display: grid; gap: var(--esp-2); margin: 0; }

/* L'en-tête d'un bon : le logo dans son cadre (18 × 60 mm sur le bon, ici 68 × 226 px),
   puis le libellé et le numéro, soulignés de chair comme sur le bon. */
.entete-bon {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px;
  padding: 20px 22px 18px; border-bottom: 3px solid var(--encre-papier);
}
.entete-bon-logo {
  display: block; width: auto; height: 68px; max-width: min(226px, 100%);
  object-fit: contain; object-position: left bottom;
}
.entete-bon-titre { margin: 0; line-height: 1.1; }
.entete-bon-titre span {
  display: block; font-weight: 700; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--doux-papier);
}
.entete-bon-titre strong {
  display: inline-block; margin-top: 4px; padding-bottom: 3px;
  font: 800 30px/1 var(--display); font-stretch: 112%; border-bottom: 5px solid var(--chair);
}

/* L'image d'une variété : à sa taille, dans un cadre de 220 × 160 px au plus. */
.papier-image { justify-self: start; padding: 14px; }
.papier-image img { display: block; width: auto; height: auto; max-width: min(220px, 100%); max-height: 160px; }

/* L'aperçu d'une étiquette (ventes/documents/etiquettes.html) avec l'image de la variété,
   à droite de son nom, comme sur l'étiquette imprimée. */
.etiquette-avec-image { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.etiquette-image { display: block; flex: 0 0 auto; width: auto; height: auto; max-width: 120px; max-height: 64px; }

/* Logos HVE et Bio d'un site (demande de Thomas du 29 octobre 2026, n° 6 ;
   referentiel/site_fiche.html, referentiel.certifications). La carte de la fiche du site : un
   bloc encadré par logo, côte à côte dès qu'il y a la place (bureau), l'un sous l'autre sur
   la tablette et au téléphone ; dans chacun, le titre et la pastille de l'état du
   certificat, l'aperçu sur « papier » (le logo à sa taille, 96 px de haut au plus ; sous le
   logo bio, son code et son origine, petits et serrés comme imprimés), puis la saisie. */
.logos-certification {
  display: grid; gap: var(--esp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}
.logo-du-site {
  display: grid; gap: var(--esp-3); align-content: start; min-width: 0;
  padding: var(--esp-4); border: 1px solid var(--trait); border-radius: var(--rayon);
}
.logo-du-site-tete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2) var(--esp-3); }
.logo-du-site-tete .pastille { white-space: normal; }
.papier-logo { justify-self: start; display: grid; justify-items: start; gap: 2px; padding: 14px 18px; }
.papier-logo img { display: block; width: auto; height: auto; max-width: min(200px, 100%); max-height: 96px; margin-bottom: 6px; }
.papier-logo-ligne { margin: 0; font-size: 14px; line-height: 1.2; color: var(--encre-papier); }
.origine-bio .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }

/* La liste des sites : une pastille par logo (« HVE », « Bio », « Bio échu ») ; celle des
   producteurs, une par certificat (« HVE », « Bio à venir », « Bio échu »). */
.logos-de-la-liste { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; }
/* Fiche d'un lot, « Sur ses étiquettes » (lot t65) : les pastilles des logos qu'il imprime,
   chaque logo de son site qu'il n'a pas et pourquoi, puis son n° de certification, chacun
   sur sa ligne. */
.sur-ses-etiquettes dd { display: grid; justify-items: start; gap: 4px; }
.sur-ses-etiquettes .aide { margin: 0; }

/* Certifications d'un producteur (demande de Thomas du 30 octobre 2026 ;
   referentiel/producteur_fiche.html, referentiel.producteurs). La carte de la fiche d'un
   producteur tiers : un bloc encadré par certification (n° de certification, HVE, bio), comme
   les logos d'un site, deux par rangée dès qu'il y a la place (bureau, tablette en paysage),
   l'un sous l'autre sur la tablette en portrait et au téléphone, pour que les deux dates
   tiennent côte à côte ; dans chacun, le titre et la pastille de son état, ce qui est noté
   (en consultation), ou la saisie de l'administrateur. Le n° de certification, court, prend
   toute la rangée : HVE et bio restent ensemble dessous. */
.certifications {
  display: grid; gap: var(--esp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
}
.certifications > .certification-numero { grid-column: 1 / -1; }
.certification {
  display: grid; gap: var(--esp-3); align-content: start; min-width: 0;
  padding: var(--esp-4); border: 1px solid var(--trait); border-radius: var(--rayon);
}
.certification-tete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2) var(--esp-3); }
.certification-tete .pastille { white-space: normal; }
/* L'historique des périodes d'un certificat (lot t65 ; réponse de Thomas Q7) : une ligne par
   période, la plus récente en tête, ses dates (et pour le bio le code et l'origine, en doux),
   la pastille de son état, et « Annuler » pour l'administrateur ; une période annulée reste,
   en retrait. Puis « Ajouter une période », séparée d'un filet. */
.periodes-du-certificat { display: grid; gap: var(--esp-2); margin: 0; padding: 0; list-style: none; }
.periode-du-certificat {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2) var(--esp-3);
  padding: var(--esp-2) var(--esp-3); border: 1px solid var(--trait); border-radius: var(--rayon);
  background: var(--surface-2);
}
.periode-texte { flex: 1 1 220px; display: grid; gap: 2px; margin: 0; }
.periode-texte span { color: var(--doux); font-size: var(--texte-petit); }
.periode-du-certificat .pastille { white-space: normal; }
.periode-du-certificat.annulee { background: transparent; border-style: dashed; }
.periode-du-certificat.annulee .periode-texte strong { color: var(--doux); text-decoration: line-through; }
.periode-annuler { margin: 0; }
.periode-nouvelle { padding-top: var(--esp-3); border-top: 1px solid var(--trait); }
.periode-nouvelle-titre { margin: 0; font-size: 17px; }

/* L'aperçu d'une étiquette ou d'une feuille de colisage : les logos du site sur du papier
   blanc (un logo au fond transparent, pensé pour le papier, resterait illisible en sombre),
   côte à côte, le code et l'origine sous le logo bio ; la planche qui n'en a pas la place le
   dit d'une pastille. */
.apercu-logos { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.apercu-logo { display: grid; justify-items: start; gap: 2px; margin: 0; padding: 8px 10px; box-shadow: none; }
.apercu-logo img { display: block; width: auto; height: auto; max-height: 48px; max-width: 96px; }
.apercu-logo figcaption { display: grid; margin-top: 4px; font-size: 12px; line-height: 1.2; }
.gabarits .gabarit-sans-logos { margin-top: 4px; white-space: normal; }
/* Les lots d'une impression qui n'ont pas un logo de leur site (lot t65 :
   ventes/documents/_sans_les_logos.html) : la phrase, puis un lot par ligne et sa raison. */
.message.sans-les-logos { display: block; }
.sans-les-logos ul { margin: var(--esp-2) 0 0; padding-left: 22px; }
.sans-les-logos li + li { margin-top: 4px; }

/* --- États (phase 6, lot « socle des états, états de production et de stock ») --- */

/* Navigation : « États » rejoint la barre. Sur téléphone, la barre du bas garde Stockage,
   Lots et Commandes (l'accueil est la cagette du bandeau depuis le 17 novembre 2026) ;
   « États » et « Référentiels », moins fréquents au chariot, y passent dans « Menu » (même
   HTML : la navigation porte le lien en .nav-bureau, le menu en .menu-telephone).
   « Consommables » (option de l'exploitation) y passe dès 1 099 px, pour que la ligne du
   bandeau tienne sur une tablette en portrait (.nav-large, .menu-etroit). */
.menu-liens .menu-telephone { display: none; }
@media (max-width: 1099px) {
  .navigation .nav-large { display: none; }
  .menu-liens .menu-etroit { display: flex; }
}
@media (max-width: 760px) {
  .navigation .nav-bureau { display: none; }
  .menu-liens .menu-telephone { display: flex; }
}

/* Page des états : une rubrique (Production et stock, Ventes, Campagnes), ses tuiles. */
.rubrique-etats h2 { font-size: 22px; }
/* Des tuiles de même largeur d'une rubrique à l'autre, même seules sur leur rangée. */
.rubrique-etats .gestes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

/* Écran d'un état (etats/etat.html) : les filtres, autant de colonnes que la largeur en
   tient ; le résumé à gauche, « Imprimer » et « Exporter » à droite ; le tableau. */
.filtres-etat { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.etat-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.etat-resume { color: var(--doux); font-weight: 700; }
.etat-documents { margin-left: auto; }
.etat-notes { display: grid; gap: 4px; max-width: 80ch; color: var(--doux); font-size: var(--texte-petit); }

/* Tableau d'un état : un groupe par variété ou par parcelle, son titre en Archivo sur un
   filet terre, bien détaché du groupe précédent ; ses lignes, alternées quand elles n'ont
   pas de sous-lignes ; son sous-total sur fond teinté sous un filet marqué ; le total
   général au pied, sur un filet terre épais. Les chiffres en colonnes (classe n), un stock
   négatif en rouge. Les unités de l'en-tête en maigre, couleur douce : « Récolté (t) ». */
.table-etat th .unite, .table-etat th .complement { font-weight: 400; color: var(--doux); }
/* Ce qui s'écrit sous la valeur d'une case (les parcelles sous le numéro du lot) ; une
   anomalie (Ligne.alertes : « Analyse dépassée de 3,0 t » sous un lot du « Stock par
   calibre »), en rouge et en gras, comme un stock négatif. */
.table-etat td .complement {
  display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux);
  white-space: normal;
}
.table-etat td .complement.negatif { color: var(--gel); font-weight: 700; }
/* Une ligne sur deux, compté dans chaque groupe sans son titre ni son sous-total ; pas
   dans un état à sous-lignes (les calibres d'un lot), où le filet sépare les lots. */
:where(.table-etat tbody > tr) { --fond-ligne: var(--surface); }
:where(.table-etat:not(:has(tr.sous-ligne)) tbody > tr:nth-child(even of :not(.ensemble-tete, .groupe-tete, .sous-total))) {
  --fond-ligne: var(--zebre);
}
.table-etat tr.groupe-tete th {
  padding: 28px var(--case-h) 8px; background: var(--surface); color: var(--texte);
  font: 800 20px/1.2 var(--display); font-stretch: 112%;
  border-bottom: 2px solid var(--terre);
}
.table-etat tbody:first-of-type tr.groupe-tete th { padding-top: 16px; }
.table-etat .groupe-tete .detail {
  margin-left: 8px; font: 400 var(--texte-petit)/1.2 var(--corps); color: var(--doux);
}
.table-etat tr.sous-total th, .table-etat tr.sous-total td {
  background: var(--sous-total); color: var(--texte); font-weight: 700; font-size: 16px;
  border-bottom: 0; box-shadow: inset 0 1px 0 var(--trait-fort);
}
/* Un ensemble de groupes (un producteur au-dessus de ses parcelles : état par parcelle d'une
   exploitation qui a des producteurs tiers, etats.socle.Ensemble) : sa tête au-dessus du
   titre de son premier groupe, plus grande, en bandeau sur le fond des en-têtes, sous un
   filet terre de 3 px ; son sous-total, sous celui de son dernier groupe, en Archivo, sous
   un filet terre de 2 px : entre le sous-total d'un groupe et le total général. */
.table-etat tr.ensemble-tete th {
  padding: 16px var(--case-h) 14px; background: var(--entete); color: var(--texte);
  font: 800 24px/1.2 var(--display); font-stretch: 112%;
  box-shadow: inset 0 3px 0 var(--terre);
}
.table-etat tbody:first-of-type tr.ensemble-tete th { box-shadow: none; }
.table-etat .ensemble-tete .detail {
  margin-left: 8px; font: 400 var(--texte-petit)/1.2 var(--corps); color: var(--doux);
}
.table-etat tr.ensemble-tete + tr.groupe-tete th { padding-top: 16px; }
.table-etat tr.sous-total.total-d-ensemble th, .table-etat tr.sous-total.total-d-ensemble td {
  padding-block: 14px; font: 800 17px/1.2 var(--display); font-stretch: 112%;
  box-shadow: inset 0 2px 0 var(--terre);
}
.table-etat tfoot th, .table-etat tfoot td {
  padding-block: 16px; background: var(--sous-total); color: var(--texte);
  font: 800 18px/1.2 var(--display); font-stretch: 112%;
  border-top: 3px solid var(--terre); border-bottom: 0;
}
.table-etat tfoot td.n { font-variant-numeric: tabular-nums; }
.table-etat .marque { margin-left: 2px; color: var(--peau-texte); font-weight: 700; }
/* Le chiffre que l'on cherche d'abord (stock disponible, rendement : Colonne.principale) :
   sa colonne se lit d'un coup d'œil, de l'en-tête (en couleur de texte, souligné de chair)
   au total, sur une bande à peine teintée de chair (qui suit l'alternance des lignes) ; ses
   chiffres en Archivo, plus grands et plus gras que les autres. Un stock négatif y reste
   rouge (td.negatif). */
.table-etat th.principale { color: var(--texte); box-shadow: inset 0 -3px 0 var(--chair); }
.table-etat td.principale {
  background: color-mix(in srgb, var(--chair-pale) 45%, var(--fond-ligne, var(--surface)));
  font: 800 19px/1.3 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums;
}
.table-etat tr.sous-total td.principale {
  background: color-mix(in srgb, var(--chair-pale) 60%, var(--sous-total));
  font-size: 19px;
}
.table-etat tfoot td.principale { background: var(--chair-pale); font-size: 21px; }
/* Un négatif reste rouge jusqu'au sous-total et au total (td.negatif : la couleur du texte
   de ces rangées ne l'efface pas ; --gel sur --sous-total : 5,6:1). */
.table-etat tr.sous-total td.negatif, .table-etat tfoot td.negatif { color: var(--gel); }
/* Les cases d'une ligne sur la même ligne de base, le chiffre principal plus grand compris. */
.table-etat tbody td, .table-etat tbody th, .table-etat tfoot td, .table-etat tfoot th { vertical-align: baseline; }
/* Un lot, une quantité expédiée (F64), une variété : des liens dans le tableau, mais des
   cibles de 44 px au doigt. */
.table-etat td a {
  display: inline-block; min-height: var(--cible); padding-block: 11px; margin-block: -11px;
  font-weight: 700; text-decoration-color: var(--souligne);
  /* Un numéro (lot, bon, commande) d'un tenant : jamais « S1-26- » puis « 001 ». */
  white-space: nowrap;
}
.table-etat td:first-child { white-space: nowrap; }
/* Un état large (le récapitulatif de facturation) : au bureau et sur la tablette, ce qui
   s'écrit en petit sous une valeur se dit aussi en petit dans l'en-tête (« Variété et
   calibre · catégorie… ») ; ce complément passe à la ligne plutôt que d'élargir la colonne
   et de pousser les chiffres hors du cadre. Au téléphone, le tableau défile de côté. */
@media (min-width: 761px) {
  .table-etat thead th .complement { white-space: normal; }
}
@media (max-width: 900px) {
  .table-etat { --case-h: 10px; }
}
@media (max-width: 760px) {
  .etat-documents { margin-left: 0; width: 100%; }
  .table-etat tr.groupe-tete th { font-size: 18px; padding-top: 22px; }
  /* Sur téléphone, le tableau défile de côté : chaque case tient sur une ligne, et la
     première colonne (le lot, la variété) reste en place, un filet à sa droite. */
  .table-etat th, .table-etat td { white-space: nowrap; }
  .table-etat thead th:first-child, .table-etat tbody td:first-child,
  .table-etat tr.sous-total th, .table-etat tfoot th {
    position: sticky; left: 0; z-index: 1; background-color: var(--fond-ligne, var(--surface));
    box-shadow: inset -1px 0 0 var(--filet);
  }
  .table-etat thead th:first-child { background-color: var(--entete); }
  .table-etat tr.sous-total th {
    background-color: var(--sous-total); box-shadow: inset -1px 0 0 var(--filet), inset 0 1px 0 var(--trait-fort);
  }
  .table-etat tr.sous-total.total-d-ensemble th {
    box-shadow: inset -1px 0 0 var(--filet), inset 0 2px 0 var(--terre);
  }
  .table-etat tfoot th { background-color: var(--sous-total); }
}
@media print {
  .etat-documents, .filtres-etat { display: none !important; }
}

/* --- États des ventes et comparaison des campagnes (phase 6, lot « états des ventes et
   comparaison des campagnes ») --- */

/* Les campagnes comparées (F80) : une case à cocher par campagne, en pastille de la hauteur
   des listes voisines ; la pastille cochée prend le contour terre et le fond chair. */
.filtres-etat .filtre-cases { grid-column: span 2; gap: 6px; }
.filtre-cases .cases { display: flex; flex-wrap: wrap; gap: 8px; }
.filtre-cases .case {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--cible-champ);
  padding: 0 16px 0 12px; border: 2px solid var(--trait); border-radius: 10px;
  background: var(--surface); font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.filtre-cases .case:hover { border-color: var(--peau); }
.filtre-cases .case:has(input:checked) { border-color: var(--contour); background: var(--chair-pale); }
.filtre-cases .case input { width: 22px; height: 22px; margin: 0; accent-color: var(--terre); flex: none; }
@media (max-width: 560px) {
  .filtres-etat .filtre-cases { grid-column: 1 / -1; }
}
/* La fourchette des calibres (demande de Thomas du 16 octobre 2026) : « Calibre min » et
   « Calibre max » côte à côte sous leur légende, les calibres connus en aide dessous. */
.filtres-etat .filtre-fourchette { grid-column: span 2; margin: 0; padding: 0; border: 0; }
.filtre-fourchette > legend { padding: 0; margin-bottom: 2px; }
.filtre-fourchette .bornes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.filtre-fourchette .borne { display: grid; gap: 4px; color: var(--doux); font-size: var(--texte-petit); font-weight: 600; }
.filtre-fourchette .aide { margin: 0; font-size: var(--texte-petit); }
@media (max-width: 560px) {
  .filtres-etat .filtre-fourchette { grid-column: 1 / -1; }
}

/* Un écart d'une campagne à l'autre : une hausse en vert, une baisse en rouge, sans le gras
   d'une alerte (une baisse n'est pas une anomalie) ; aussi dans les sous-totaux et le
   total. */
.table-etat tr td.hausse { color: var(--fane); }
.table-etat tr td.baisse { color: var(--gel); }

/* Sur téléphone, la première colonne (un client, une famille, un sous-total) passe à la
   ligne dans une largeur fixe plutôt que de pousser les chiffres hors de l'écran. */
@media (max-width: 760px) {
  .table-etat tbody td:first-child, .table-etat tr.sous-total th, .table-etat tfoot th {
    width: 9.5em; min-width: 9.5em; white-space: normal;
  }
}

/* --- Traçabilité pour les audits : exercice de rappel (lot t33, demande de Thomas du 27
   octobre 2026 ; etats/rappel/, etats/ecrans_rappel.py) --- */

/* Le départ : deux cartes côte à côte (descendant, ascendant), le sens en pastille au-dessus
   du titre ; dans la carte ascendante, trois petits formulaires séparés d'un filet. */
.rappel-depart-tete { display: grid; gap: var(--esp-2); justify-items: start; }
.rappel-formulaire + .rappel-formulaire { padding-top: var(--esp-4); border-top: 1px solid var(--trait); }
/* Un numéro et son bouton sur une ligne ; l'un sous l'autre au téléphone. */
.rappel-saisie { display: flex; gap: var(--esp-2); align-items: stretch; }
.rappel-saisie input { flex: 1 1 auto; min-width: 0; }
.rappel-saisie .bouton { flex: 0 0 auto; }
@media (max-width: 520px) { .rappel-saisie { flex-direction: column; } }
.rappel-explication .liste-aide { max-width: 80ch; }

/* Un rappel : le sens sous le titre ; le résumé, filet chair en tête, la phrase en grand,
   les chiffres en cases à fond doux (deux par ligne au téléphone), puis la trace de
   l'exercice (date, heure, auteur, temps de la lecture). */
.rappel-sens { color: var(--doux); }
.rappel-resume { box-shadow: var(--ombre), inset 0 4px 0 var(--chair); }
.rappel-phrase { max-width: 72ch; font-size: var(--texte-grand); font-weight: 700; line-height: 1.4; }
.rappel-phrase + .rappel-phrase { font-size: var(--texte-courant); font-weight: 400; }
.rappel-chiffres {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: var(--esp-2); margin: 0;
}
.rappel-chiffres > div {
  display: grid; gap: 2px; align-content: end;
  padding: 10px 14px; background: var(--surface-2); border-radius: var(--rayon-petit);
}
.rappel-chiffres dt { color: var(--doux); font-size: var(--texte-petit); }
.rappel-chiffres dd { margin: 0; font: 800 26px/1.15 var(--display); font-stretch: 112%; }
.rappel-trace { color: var(--doux); font-size: var(--texte-petit); }
@media (max-width: 520px) {
  .rappel-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rappel-chiffres dd { font-size: 22px; }
}

/* Dans les tableaux : sous une case, en petit (la variété et le site d'un lot, ses liens par
   transfert, la surface d'une parcelle) ; les pastilles d'un lot de la chaîne à la suite. */
.page-rappel td .complement { display: block; margin-top: 2px; font-size: 14px; color: var(--doux); white-space: normal; }
.page-rappel td .pastille + .pastille { margin-left: 4px; }
.rappel-sous-titre { font-size: 19px; }
.rappel-adresse { font-weight: 400; color: var(--doux); }
/* Lot, commande, bon : des liens dans le texte, mais des cibles de 44 px au doigt. */
.rappel-livraisons td a {
  display: inline-block; min-height: var(--cible); padding-block: 11px; margin-block: -11px;
  font-weight: 700; text-decoration-color: var(--souligne);
}

/* Un client livré : son nom et ce qu'il a reçu sur une ligne, ses coordonnées dessous, ses
   livraisons ; un filet entre deux clients. Une sortie annulée barrée (tr.annule), et ce
   qu'est devenue la marchandise sur une ligne à elle, en petit (RG23). */
.rappel-client { display: grid; gap: var(--esp-3); }
.rappel-client + .rappel-client { padding-top: var(--esp-5); border-top: 1px solid var(--trait); }
.rappel-client-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.rappel-client-tete h3 { font-size: 21px; }
.rappel-client-poids .num { font: 700 19px var(--display); font-stretch: 112%; }
.rappel-coordonnees { display: flex; flex-wrap: wrap; gap: 2px 18px; color: var(--doux); }
.rappel-coordonnees a {
  display: inline-block; min-height: var(--cible); padding-block: 11px; margin-block: -11px;
  color: var(--texte); text-decoration-color: var(--souligne);
}
.rappel-client.sans-livraison .rappel-client-tete h3 { color: var(--doux); }
.rappel-livraisons tr.rappel-devenir td {
  padding-top: 0; font-size: var(--texte-petit); color: var(--doux); font-style: italic;
  text-decoration: none;
}
.rappel-livraisons tr:has(+ tr.rappel-devenir) td { border-bottom: 0; }
.rappel-bons-annules, .rappel-observation { max-width: 80ch; }

/* Un producteur d'origine (lot t66, #producteurs-d-origine) : comme un client, son nom (lien
   vers sa fiche, cible de 44 px) et ses pastilles, ses coordonnées, puis une fiche courte
   (n° de certification, certificats, ses lots), une valeur par ligne, en graisse normale. */
.rappel-producteur h3 a {
  display: inline-block; min-height: var(--cible); padding-block: 9px; margin-block: -9px;
  color: var(--texte); text-decoration-color: var(--souligne);
}
.rappel-producteur .rangee { margin: 0; }
.rappel-fiche-producteur > div { padding-block: 8px; }
.rappel-fiche-producteur .rappel-ligne { display: block; font-weight: 400; }
.rappel-fiche-producteur .rappel-ligne + .rappel-ligne { margin-top: 2px; }
/* Ce qu'un certificat couvrait des récoltes des lots du producteur, sous sa période ; ce
   qu'il ne couvrait pas en rouge (lot t66 : réponse de Thomas Q7). */
.rappel-couverture { display: block; color: var(--doux); font-size: var(--texte-petit); }
.rappel-couverture.negatif { color: var(--gel); font-weight: 700; }
.rappel-fiche-producteur .rappel-ligne:has(.rappel-couverture) + .rappel-ligne { margin-top: 8px; }

/* Ce qui reste en stock : un lot par ligne, son stock en gros, ses lieux dessous. */
.rappel-stock { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-3); }
.rappel-stock > li { display: grid; gap: 4px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--rayon-petit); }
.rappel-stock-lot { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.rappel-stock-lot strong { font: 700 19px var(--display); font-stretch: 112%; }
.rappel-stock-lot .num:not(strong) { font-weight: 700; }
.rappel-lieux { margin: 0; padding-left: 20px; display: grid; gap: 2px; color: var(--doux); }
.rappel-lieux strong { color: var(--texte); }
@media print {
  .page-rappel .boutons { display: none !important; }
}

/* --- États : sous-lignes d'une ligne (lot « calibres de l'état des stocks » ; F62, RG14) --- */

/* Les sous-lignes d'une ligne (les calibres d'un lot, etats/_tableau.html) : le détail se lit
   sous son lot, en plus petit et en couleur douce, sans filet entre elles ni avec leur lot
   (le filet vient sous la dernière) ; un trait fin, devant les libellés, les rattache au
   lot. Les chiffres restent alignés sur ceux du lot ; le stock garde sa bande teintée, en
   plus petit ; un négatif n'y est pas une alerte (pas de rouge : etats.presentation). */
.table-etat tr.avec-details td { padding-bottom: 8px; border-bottom: 0; }
.table-etat tr.sous-ligne td {
  padding-block: 3px; color: var(--doux); font-size: var(--texte-petit); line-height: 1.4;
  border-bottom: 0;
}
.table-etat tr.sous-ligne.derniere td { padding-bottom: 12px; border-bottom: 1px solid var(--trait); }
.table-etat tbody tr.sous-ligne.derniere:last-child td { border-bottom: 0; }
.table-etat tr.sous-ligne td:first-child {
  padding-left: 42px; color: var(--texte); font-weight: 700;
  font-family: var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums;
  background: linear-gradient(var(--trait), var(--trait)) 26px 0 / 2px 100% no-repeat, var(--fond-ligne, var(--surface));
}
.table-etat tr.sous-ligne.derniere td:first-child { background-size: 2px calc(100% - 9px), auto; }
.table-etat tr.sous-ligne td.principale { color: var(--texte); font-size: 16px; font-weight: 700; }
.table-etat tr.sous-ligne td a { font-weight: 400; color: inherit; }
@media (max-width: 760px) {
  .table-etat tr.sous-ligne td:first-child { padding-left: 30px; background-position: 16px 0, 0 0; }
}

/* --- Commandes à servir : l'ordre avant l'impression (demande du 29 octobre 2026 ;
   etats/a_servir/ordre.html, etats/ecrans_a_servir.py) --- */

/* Les filtres de l'état, rappelés en une ligne au-dessus de la liste. */
.ordre-filtres { color: var(--doux); }
.ordre-filtres strong { color: var(--texte); }
/* La case « Ordre » : étroite, en tête de ligne, un nombre en gros chiffres centrés, de la
   hauteur d'un champ (52 px) ; remplie, elle prend le contour terre et le fond chair pâle,
   comme une case cochée des filtres. */
.table-ordre .ordre-case { width: 1%; white-space: nowrap; }
.saisie-ordre {
  width: 4.4em; min-height: var(--cible-champ); padding: 6px 8px;
  border: 2px solid var(--bord-champ); border-radius: 10px; background: var(--surface);
  color: var(--texte); font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums;
  text-align: center; transition: border-color .15s;
}
.saisie-ordre:focus { border-color: var(--contour); outline-offset: 2px; }
.table-ordre tr.ordonnee .saisie-ordre { border-color: var(--contour); background: var(--chair-pale); }
/* Une case qui ne se lit pas (« 0 », « 1000 ») : contour d'alerte, la consigne dessous. */
.table-ordre tr.en-erreur .saisie-ordre { border-color: var(--gel); background: var(--gel-pale); }
.table-ordre .erreur-ordre {
  display: block; max-width: 12em; margin-top: 4px; white-space: normal;
  color: var(--gel); font-weight: 700; font-size: var(--texte-petit);
}
/* La date à livrer, sous le numéro de la commande, en peau et en gras, d'un tenant. */
.table-ordre td .complement.a-livrer { color: var(--peau-texte); font-weight: 700; white-space: nowrap; }
/* Ce qui fait reconnaître la commande, en petit sous son numéro, son client, sa variété. */
.table-ordre td .complement {
  display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux);
}
.table-ordre td { vertical-align: middle; }
/* Le reste à servir, le chiffre que l'on cherche, comme le chiffre principal d'un état. */
.table-ordre td.principale { font: 800 19px/1.3 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.ordre-actions { margin-top: var(--esp-2); }
/* « Effacer les numéros… » : un lien discret, loin des boutons de l'impression ; il ouvre
   sa confirmation, sans script (un <details>), sous un filet d'alerte, avec le bouton qui
   efface (.bouton-alerte). */
.effacer-l-ordre { justify-self: start; max-width: 40rem; }
.effacer-l-ordre > summary {
  list-style: none; width: max-content; padding-inline: 4px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px;
}
.effacer-l-ordre > summary::-webkit-details-marker { display: none; }
.effacer-l-ordre > summary:hover { text-decoration-color: var(--gel); }
.effacer-l-ordre[open] {
  display: grid; gap: 12px; padding: 4px 16px 16px;
  border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: inset 0 4px 0 var(--gel);
}
.effacer-l-ordre > p { margin: 0; }
@media print {
  .page-ordre .boutons, .page-ordre .ordre-filtres a, .page-ordre .effacer-l-ordre { display: none !important; }
}

/* --- Préparer la réchauffe et plans de réchauffe (demande du 29 octobre 2026, n° 3 ;
   stock/rechauffe/, stock/ecrans_rechauffe.py) --- */

/* Étape 1 : la date de la fenêtre et « Mettre à jour » sur une ligne ; une commande par
   ligne, sa case à cocher au doigt en tête ; une commande écartée passe en texte doux. */
.rechauffe-fenetre { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.rechauffe-fenetre .champ { flex: 0 1 260px; }
.table-rechauffe-commandes td { vertical-align: middle; }
.table-rechauffe-commandes .case { width: 1%; }
.coche-seule { display: inline-grid; place-items: center; min-width: var(--cible); min-height: var(--cible); cursor: pointer; }
.coche-seule input { width: 24px; height: 24px; margin: 0; accent-color: var(--terre); }
.table-rechauffe-commandes tr.ecartee td:not(.case), .table-rechauffe-commandes tr.ecartee td a { color: var(--doux); }
.page-rechauffe td .complement { display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux); }
.page-rechauffe td .complement.a-livrer { color: var(--peau-texte); font-weight: 700; white-space: nowrap; }
.page-rechauffe td.principale { font: 800 19px/1.3 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.page-rechauffe .cap-ordre {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px;
  margin-right: 6px; border-radius: 999px; background: var(--chair-pale);
  box-shadow: inset 0 0 0 2px var(--contour); color: var(--texte);
  font: 800 16px/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

/* Étape 2 : une carte par lot, sur fond doux ; en tête, le lot et, à droite, les palox à
   sortir en gros chiffres ; puis le poids d'un palox, le calcul du lot en clair (ci-dessous,
   .calcul-du-lot), les commandes du lot (chacune sur sa carte blanche, par quoi elle est
   servie), où sont les palox. Un lot à compléter (pourcentage ou poids manquant) a un liseré
   rouge. */
.lot-a-rechauffer {
  display: grid; gap: 12px; padding: 16px 18px; background: var(--surface-2);
  border: 1px solid var(--trait); border-radius: var(--rayon);
}
.lot-a-rechauffer.a-completer { box-shadow: inset 6px 0 0 var(--gel); }
.lot-a-rechauffer-tete, .lot-du-plan-tete {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 24px;
}
.lot-a-rechauffer-tete h3, .lot-du-plan-tete h3 { margin: 0; font: 800 22px/1.2 var(--display); font-stretch: 112%; }
.lot-du-plan-tete h3 small { font: 400 var(--texte-petit)/1.4 var(--corps); color: var(--doux); }
.lot-a-rechauffer-resume { margin: 4px 0 0; color: var(--doux); }
.nombre-a-sortir { margin: 0; text-align: right; font-weight: 700; }
.nombre-a-sortir .grand {
  margin-right: 6px; font: 800 40px/1 var(--display); font-stretch: 112%;
  font-variant-numeric: tabular-nums; color: var(--texte); vertical-align: -4px;
}
.nombre-a-sortir small { display: block; margin-top: 2px; font-weight: 400; font-size: var(--texte-petit); color: var(--doux); }
.poids-unitaire { max-width: 340px; }
.commandes-du-lot { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.commandes-du-lot > li {
  display: grid; gap: 6px; padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--rayon);
}
.commande-du-lot { margin: 0; }
.pastille.lavees { background: var(--chair-pale); box-shadow: inset 0 0 0 1px var(--peau); }
.calcul-en-clair { margin: 0; color: var(--doux); font-variant-numeric: tabular-nums; }
.calcul-en-clair.manque { color: var(--gel); font-weight: 700; }
.servie-par { margin: 0; color: var(--doux); }
.servie-par .num { white-space: nowrap; } /* le numéro du lot, jamais coupé à ses tirets */
.lot-de-la-commande { max-width: 440px; }
.total-du-lot { margin: 0; padding: 10px 14px; border-radius: var(--rayon); background: var(--chair-pale); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Le calcul d'un lot en clair (réponse de Thomas du 30 octobre 2026 au soir, question 4 ;
   stock/rechauffe/_calcul_du_lot.html, sur l'étape 2 et la fiche d'un plan) : les palox déjà
   calibrés pris d'abord, une carte blanche par commande ; puis chaque passage à la
   calibreuse, son titre et son tableau (.table-passage : une ligne par calibre demandé ; celui
   qui décide du nombre de palox sur fond chair pâle, liseré or à gauche, sa pastille en
   aplat brun) et la phrase qui le dit, liseré or (des besoins additionnés : liseré peau).
   Au téléphone, chaque calibre en carte : son nom, puis ce que donne le passage et la marge
   côte à côte, libellés, puis les commandes. */
.calcul-du-lot { display: grid; gap: 14px; }
.calcul-du-lot h4, .titre-commandes-du-lot {
  margin: 0; font: 800 18px/1.25 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums;
}
.pris-d-abord, .passage { display: grid; gap: 8px; }
.passage > .aide { margin: 0; }
.liste-du-calcul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.liste-du-calcul > li {
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--rayon); font-variant-numeric: tabular-nums;
}
.table-passage th.calibre { min-width: 11em; }
.table-passage tbody tr:last-child th { border-bottom: 0; }
.table-passage .nom-du-calibre { font: 800 19px/1.3 var(--display); font-stretch: 112%; }
/* Des calibres demandés qui se partagent des calibres du lot : une seule ligne, leurs noms
   reliés par « et » en texte courant, et la marge « — » quand elle ne se calcule pas. */
.table-passage th .et { font: 400 16px/1.3 var(--corps); color: var(--doux); }
.table-passage .sans-marge { color: var(--doux); font-weight: 400; }
.table-passage th .complement { display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux); }
.table-passage td.donne { font-weight: 700; font-size: 18px; }
.table-passage .demande { display: block; font-variant-numeric: tabular-nums; }
.table-passage .demande + .demande { margin-top: 4px; }
.table-passage .demande small { display: block; color: var(--doux); font-size: 14px; }
.table-passage .demande.en-tout { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--filet); font-weight: 700; }
.table-passage tr.decide { --fond-ligne: var(--chair-pale); }
/* Plus fort que la première colonne collée du téléphone (section 9), qui pose son filet. */
.table-wrap .table-passage > tbody > tr.decide > th:first-child { box-shadow: inset 5px 0 0 var(--chair); }
.pastille.decide { background: var(--aplat-fort); color: var(--sur-terre); }
.qui-decide {
  margin: 0; padding: 10px 14px; border-radius: var(--rayon); background: var(--surface);
  border: 1px solid var(--trait); box-shadow: inset 4px 0 0 var(--chair); font-variant-numeric: tabular-nums;
}
.qui-decide.additionnes { box-shadow: inset 4px 0 0 var(--peau); }

/* Un tableau empilé au téléphone (.table-empilee : le passage d'un lot, les commandes d'un
   plan) : chaque ligne en carte, sa première case en titre sur toute la largeur, puis les
   cases libellées (data-libelle) deux par deux, une case .pleine sur toute la largeur, en
   dernier. Ni défilement de côté, ni colonne collée ; l'unité que portait l'en-tête revient
   à côté du nombre (.unite-empilee). */
.unite-empilee { display: none; }
@media (max-width: 600px) {
  .table-empilee .unite-empilee { display: inline; }
  .table-wrap table.table-empilee { min-width: 0; }
  .table-empilee, .table-empilee tbody { display: block; }
  .table-empilee thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .table-empilee tbody > tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px;
    padding: 12px 14px; background: var(--fond-ligne); border-bottom: 1px solid var(--filet);
  }
  .table-empilee tbody > tr:last-child { border-bottom: 0; }
  .table-wrap .table-empilee tbody > tr > :is(th, td):not([colspan]) {
    display: block; position: static; padding: 0; border: 0; text-align: left;
    background: none; box-shadow: none; min-width: 0;
  }
  .table-empilee tbody > tr > :first-child { grid-column: 1 / -1; }
  .table-empilee tbody > tr > .pleine { grid-column: 1 / -1; order: 3; }
  .table-empilee td[data-libelle]::before {
    content: attr(data-libelle); display: block; margin-bottom: 2px;
    font: 700 13px/1.3 var(--corps); color: var(--doux);
  }
  .table-passage tbody > tr.decide { box-shadow: inset 5px 0 0 var(--chair); }
  .table-wrap .table-passage > tbody > tr.decide > th:first-child { box-shadow: none; }
}
.ou-les-prendre { margin: 0; display: grid; gap: 8px; }
.ou-les-prendre > div { display: grid; grid-template-columns: minmax(120px, 170px) minmax(0, 1fr); gap: 2px 16px; }
.ou-les-prendre dt { color: var(--doux); font-weight: 700; font-size: var(--texte-petit); }
.ou-les-prendre dd { margin: 0; }
.ou-les-prendre .ligne-lieu { display: block; }

/* Étape 3 : les salles en cartes côte à côte, « Plus tard » en dernier ; le résumé du plan. */
.salle-de-rechauffe { border: 0; padding: 0; margin: 0; }
.salle-de-rechauffe .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.salle-de-rechauffe .choix label { grid-template-columns: auto minmax(0, 1fr); }
.salle-de-rechauffe .choix label .aide { grid-column: 2; font-weight: 400; }
.resume-du-plan { margin: 0; font-weight: 700; }
.resume-du-plan .grand { margin-right: 4px; font: 800 30px/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }

/* Fiche d'un plan : la consigne, l'avancement en deux grands chiffres, les lots. */
.observation-du-plan { margin: 0; padding: 10px 14px; border-radius: var(--rayon); background: var(--chair-pale); }
.chiffres-du-plan { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; }
.chiffres-du-plan dt { color: var(--doux); font-size: var(--texte-petit); font-weight: 700; }
.chiffres-du-plan dd { margin: 0; font: 800 32px/1.1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.chiffres-du-plan dd small { font: 400 var(--texte-petit)/1.4 var(--corps); color: var(--doux); }
.lots-du-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.lot-du-plan { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--trait); border-radius: var(--rayon); }
.avancement-du-lot { margin: 0; color: var(--peau-texte); font-weight: 700; }
.avancement-du-lot.complet { color: var(--fane); }
.table-plan td { vertical-align: middle; }
.table-plan td.servie-par { min-width: 14em; color: var(--texte); }
.liste-plans td { vertical-align: middle; }
.entete-page .boutons form { display: contents; }

@media (max-width: 760px) {
  .nombre-a-sortir { text-align: left; }
  .ou-les-prendre > div { grid-template-columns: minmax(0, 1fr); }
  .lot-a-rechauffer { padding: 12px; }
}

/* Les places dans la salle de réchauffe (demande du 29 octobre 2026, n° 3, partie c ;
   stock/rechauffe/_places.html, stock.rechauffe.placer) : le plan de la salle dans son cadre
   zoomable, chaque place en tirets à la couleur de son lot (stock.dessins) avec son numéro
   d'ordre de reprise en gros (remplie, .remplie, la pile telle qu'elle est, son numéro
   gardé) ; les emplacements qu'on peut ajouter cerclés de vert (.candidate) ; quand on
   touche, les autres piles en retrait, et toujours les places d'un autre plan
   (.autre-plan). Puis la liste des places, un
   numéro en pastille (.numero-de-place), comme sur le plan. Jamais l'or de la marque sur un
   plan. */
.places-de-la-salle { display: grid; gap: 10px; margin-top: 8px; }
.places-de-la-salle h3 { margin: 0; font: 800 20px/1.2 var(--display); font-stretch: 112%; }
.places-rechauffe { display: grid; gap: 10px; }
.places-cadre { max-height: min(70vh, 640px); }
/* Sur la tablette, toute la salle dans la largeur de la carte ; sur un téléphone, 560 px au
   moins, le plan défile dans son cadre. */
.places-rechauffe .batiment[width] { width: 100%; min-width: 560px; max-width: none; }
.places-a-toucher .batiment .pile:not(.candidate, .place-de-reprise),
.places-rechauffe .batiment .pile.autre-plan { opacity: .45; }
.places-a-toucher .batiment .pile.candidate.inutile .pile-contour { stroke-dasharray: 8 5; }
.batiment .pile-texte-ordre { font-family: var(--display); font-weight: 800; }
.legende-batiment .legende-place-de-reprise {
  display: inline-grid; place-items: center; width: 18px; height: 18px; font: 800 12px/1 var(--display);
  font-style: normal; color: var(--texte); background: var(--surface);
  outline: 2px dashed var(--trait-plan); outline-offset: -2px;
}
.legende-batiment .legende-place-de-reprise.legende-autre-plan { opacity: .45; }
.legende-places .legende-candidate { background: var(--fane-pale); box-shadow: inset 0 0 0 2px var(--fane); }
.places-proposees, .places-du-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.places-proposees > li, .place-du-plan {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
}
.place-du-plan p { margin: 0; }
.place-du-plan.remplie { background: var(--surface-2); color: var(--doux); }
.places-proposees .complement, .place-du-plan .complement { color: var(--doux); }
.numero-de-place {
  display: inline-grid; place-items: center; min-width: var(--cible); height: var(--cible); padding: 0 6px;
  border-radius: var(--rayon-petit); background: var(--surface-2); border: 2px dashed var(--trait-fort);
  font: 800 26px/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; color: var(--texte);
}
.place-du-plan.remplie .numero-de-place { border-style: solid; color: var(--doux); }
.places-remplies { margin-top: 10px; }
/* Sur une pile d'un frigo, ce qu'un plan de réchauffe en cours prévoit d'en sortir. */
.note-rechauffe {
  margin: 4px 0 0; padding: 10px 14px; border-radius: var(--rayon); background: var(--chair-pale);
  box-shadow: inset 4px 0 0 var(--peau);
}

/* --- Avant la récolte : estimations, étiquettes de palox, « Préparer la récolte » (demande du
   29 octobre 2026, n° 7 ; réponse de Thomas, Q9 ; stock/ecrans_estimations.py) --- */

/* Carte de la fiche d'un lot (#avant-la-recolte) : à gauche l'estimation retenue en grand
   (Archivo, au texte courant : une estimation n'est pas du stock), sa date, ses palox, l'écart
   avec le récolté (fane au-dessus de l'estimation, peau en dessous : ni l'un ni l'autre n'est
   une anomalie) ; à droite, pour qui voit les prix, le chiffre d'affaires estimé sur fond doux.
   Côte à côte dès 760 px. */
.estimation-retenue { display: grid; gap: var(--esp-4); align-items: start; }
@media (min-width: 760px) {
  .estimation-retenue { grid-template-columns: minmax(0, 3fr) minmax(240px, 2fr); }
}
.estimation-chiffres { display: grid; gap: 6px; min-width: 0; }
.estimation-chiffres > p { margin: 0; }
.estimation-chiffres > .bouton { justify-self: start; }
.estimation-tonnage {
  font: 800 clamp(40px, 6vw, 56px)/1 var(--display); font-stretch: 112%; letter-spacing: -.01em;
  color: var(--texte);
}
.estimation-tonnage small { font-size: .38em; font-weight: 700; color: var(--doux); margin-left: 8px; letter-spacing: 0; }
.estimation-legende { color: var(--doux); font-size: 17px; }
.estimation-legende b { color: var(--texte); }
.estimation-ecart {
  justify-self: start; padding: 6px 12px; border-radius: var(--rayon-petit);
  background: var(--fane-pale); color: var(--fane); font-weight: 700;
}
.estimation-ecart.en-dessous { background: var(--peau-pale); color: var(--peau-texte); }
.estimation-ca {
  display: grid; gap: 4px; padding: var(--esp-4); border-radius: var(--rayon); background: var(--surface-2);
}
.estimation-ca > p { margin: 0; }
.libelle-ca { color: var(--doux); font-size: var(--texte-petit); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.estimation-ca .num { font: 800 clamp(28px, 4vw, 36px)/1.1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.estimation-ca .num small { font-size: .5em; font-weight: 700; color: var(--doux); margin-left: 6px; }
/* La répartition estimée : le calibre en chiffres forts, le non réparti en texte doux, le
   total en gras au pied. */
.repartition-estimee tbody th[scope="row"] { font: 700 17px/1.3 var(--display); white-space: nowrap; }
.repartition-estimee tr.non-reparti > * { color: var(--doux); font-weight: 400; }
.repartition-estimee tbody tr.non-reparti th[scope="row"] { font: 700 15px/1.3 var(--corps); }
.repartition-estimee tr.non-reparti th small { display: block; font-weight: 400; font-size: var(--texte-petit); }
.repartition-estimee td { white-space: nowrap; }
/* Préparer la récolte : les places à prévoir sur fond chair pâle (fane pâle quand tout est
   prévu), puis un bouton par lieu en palox du site (« Réserver dans … », ses places libres en
   petit dessous, comme « Ranger ce lot ») ; un lieu qui n'a pas assez de place en retrait. */
.preparer-la-recolte { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--trait); }
.preparer-la-recolte h3, .titre-estimations { margin: 0; font: 700 19px/1.2 var(--display); font-stretch: 112%; }
.places-a-prevoir {
  margin: 0; padding: 10px 14px; border-radius: var(--rayon); background: var(--chair-pale);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.places-a-prevoir.prevues { background: var(--fane-pale); color: var(--fane); }
/* Le mode « Réserver des emplacements » ouvert pour préparer la récolte d'un lot : la note de
   ses places à prévoir, sur fond chair pâle, et ce qui manque encore à la sélection (rien
   n'est présélectionné : retour de Thomas du 30 octobre 2026). */
.preparer-la-recolte-panneau {
  display: grid; gap: 6px; justify-items: start; padding: 10px 12px;
  border-radius: var(--rayon); background: var(--chair-pale);
}
.preparer-la-recolte-panneau p { margin: 0; }
.titre-estimations { padding-top: 14px; border-top: 1px solid var(--trait); }
/* Les estimations du lot : trois colonnes que tient un téléphone (la date, l'estimation avec
   ses précisions en petit dessous, « Retenue » et les gestes). */
.estimations-du-lot td { white-space: nowrap; vertical-align: middle; }
.estimations-du-lot td.estimation-texte { white-space: normal; width: 100%; overflow-wrap: break-word; }
.estimations-du-lot td small {
  display: block; margin-top: 2px; font: 400 14px/1.35 var(--corps); color: var(--doux);
}
.estimations-du-lot tr.annule td.n { text-decoration: none; }
/* Les gestes d'une estimation, l'un sous l'autre, de la même largeur (« Retenir », « Modifier »,
   « Annuler ») ; la pastille et la date d'annulation à droite. */
.gestes-estimation { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.gestes-estimation > .pastille, .gestes-estimation > small { align-self: flex-end; }
.gestes-estimation .bouton { margin-block: 0; } /* l'un sous l'autre : sans la marge négative d'une case */
.gestes-estimation form { display: contents; }
.estimations-du-lot small.estimation-annulee-par { margin-top: 0; font-size: 13px; white-space: nowrap; }
@media (max-width: 520px) {
  .estimations-du-lot th, .estimations-du-lot td { padding-inline: 8px; }
}

/* Saisie d'une estimation (retours de Thomas du 30 octobre 2026) : la façon d'estimer sur trois
   cartes côte à côte (ce qu'on y tape en petit dessous) ; seuls les champs de la carte choisie
   paraissent (:has, sans JavaScript ; sans :has, tous restent, et seuls ceux de la carte
   choisie comptent), puis le poids d'un palox, toujours. Le rendement et la surface côte à
   côte, « × » entre eux ; l'un sous l'autre au téléphone. Une correction : la date en texte. */
.facon-d-estimer .choix { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.facon-d-estimer .choix label > span small {
  display: block; margin-top: 2px; font-weight: 400; font-size: var(--texte-petit); color: var(--doux);
}
.formulaire:has(.facon-d-estimer input[value="tonnage"]:checked) :is(.mesure-rendement, .mesure-palox),
.formulaire:has(.facon-d-estimer input[value="rendement"]:checked) :is(.mesure-tonnage, .mesure-palox),
.formulaire:has(.facon-d-estimer input[value="palox"]:checked) :is(.mesure-tonnage, .mesure-rendement) { display: none; }
.mesures-estimation { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: start; }
.mesure-tonnage, .mesure-palox, .mesure-poids-palox { flex: 1 1 14em; max-width: 22em; min-width: 0; }
.mesure-rendement {
  flex: 2 1 28em; min-width: 0; display: grid; gap: 0 12px; align-items: start;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}
.mesures-fois {
  margin: 0; padding-top: 38px; color: var(--doux); font: 700 24px/1 var(--display);
}
@media (max-width: 600px) {
  .mesure-rendement { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mesures-fois { display: none; }
}
.date-de-l-estimation { margin: 0; font-weight: 700; }
/* La répartition : une carte par calibre, liseré chair (comme les calibres obtenus d'un
   recalibrage) : calibre, part, prix et ce que proposent les tarifs dessous. */
.parts-estimees { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; container-type: inline-size; }
.part-estimee {
  display: grid; gap: 8px 12px; align-items: start; padding: 10px 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
  border: 1px solid var(--trait); border-left: 5px solid var(--chair); border-radius: var(--rayon); background: var(--surface);
}
.part-estimee .champ { min-width: 0; }
.part-prix { display: grid; gap: 4px; min-width: 0; }
.indication-prix { margin: 0; }
@container (max-width: 480px) {
  .part-estimee { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .part-prix { grid-column: 1 / -1; }
}
.repartition-pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.reparti { margin: 0; color: var(--doux); }
.reparti b { color: var(--texte); font: 800 20px var(--display); font-stretch: 112%; }
.reparti.trop, .reparti.trop b { color: var(--gel); }

/* Étiquettes de palox : l'aperçu d'une étiquette, comme celui d'une feuille de colisage (le
   papier en tirets) ; le lot en très gros, la variété sur un bandeau de sa couleur (SVG de
   fond, texte noir ou blanc : .sur-clair, .sur-fonce), les quatre cases à remplir. */
.etiquette-palox-apercu {
  display: grid; gap: 10px; padding: 18px 20px; max-width: 520px;
  background: var(--surface); color: var(--texte); border: 2px dashed var(--trait); border-radius: var(--rayon-petit);
}
.etiquette-palox-tete {
  display: flex; justify-content: space-between; gap: 12px; margin: 0; padding-bottom: 6px;
  border-bottom: 2px solid var(--texte); font-weight: 700; font-size: 14px;
}
.etiquette-palox-tete .num { font: 800 18px var(--display); font-stretch: 112%; white-space: nowrap; }
.etiquette-palox-identite { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 6px 24px; margin: 0; }
.etiquette-palox-apercu dt { font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
.etiquette-palox-apercu dd { margin: 0; font-weight: 700; font-size: 17px; }
.etiquette-palox-identite dd { font: 800 26px/1 var(--display); font-stretch: 112%; white-space: nowrap; }
.etiquette-palox-identite dd.etiquette-palox-lot { font-size: clamp(30px, 4vw, 42px); }
.etiquette-palox-variete {
  position: relative; z-index: 0; margin: 0; padding: 8px 12px; border-radius: 6px; overflow: hidden;
  font: 800 28px/1.1 var(--display); font-stretch: 112%; letter-spacing: .04em;
  text-transform: uppercase; text-align: center; overflow-wrap: anywhere;
  box-shadow: inset 0 0 0 1px var(--filet-couleur);
}
.etiquette-palox-cases { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.etiquette-palox-cases li {
  min-height: 56px; padding: 4px 6px; border: 2px solid var(--texte); border-radius: 6px;
  font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--doux);
}
@media (max-width: 520px) {
  .etiquette-palox-cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
