/* =====================================================================
   Portail RUBI — « Matière calme » (docs/design/philosophie-portail.md,
   planche 01, 2026-09-10).

   Trois tailles de texte, pas dix : Jura Light pour ce qui NOMME (le
   mot-symbole, un titre, un prix), Roboto Condensed pour ce qui se LIT,
   DM Mono en capitales espacées pour ce qui ÉTIQUETTE (un code, un état,
   une unité). Une seule chromatique, l'encre sur le papier chaud ; la
   couleur est laissée aux matières. Des filets d'un pixel, jamais de
   boîtes ombrées, aucun arrondi. Une seule action par écran, noire.
   Tout sur une grille de huit.
   ===================================================================== */

@font-face { font-family: 'Jura'; src: url('../polices/Jura-Light.ttf') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../polices/DMMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }

:root {
  --papier: #FBF7F3;
  --panneau: #FFFFFF;
  --encre: #2B2B2B;            /* ce qui nomme */
  --texte: #393939;            /* ce qui se lit */
  --gris: #8A8A84;             /* ce qui est secondaire */
  --gris-pale: #C9C4BC;        /* ce qui est effacé */
  --filet: #DCD6CD;
  --filet-doux: #EDE8E1;
  --noir: #000000;
  --olive: #5D5D4C;
  --olive-pale: #ECEAE2;
  /* Les états, à petite taille seulement. */
  --patine: #1F7A3D; --patine-pale: #E9F5ED;
  --ambre: #9A6212;  --ambre-pale: #FBF2E2;
  --oxyde: #B93A34;  --oxyde-pale: #FBEDEC;
  /* Les noms que les écrans emploient encore. */
  --ardoise: #2B2B2B; --acier: #8A8A84; --acier-pale: #C9C4BC;
  --trait: #DCD6CD; --trait-doux: #EDE8E1;
  --laiton: #000000; --laiton-fonce: #2B2B2B; --laiton-pale: #EDE8E1;
  --encre-douce: #8A8A84;

  --nommer: 'Jura', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --lire: 'Roboto Condensed', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --etiqueter: 'DM Mono', ui-monospace, Menlo, monospace;
  --sans: var(--lire); --titre: var(--nommer); --mono: var(--etiqueter);

  --ombre-levee: 0 12px 32px rgba(43,43,43,0.10);
  --rayon: 0px;
  --u: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--lire); font-size: 16px; line-height: 1.55;
  background: var(--papier); color: var(--texte);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100%;
}
/* flex-shrink: 0 — body a une hauteur fixe (100 %) : sans ceci, #racine
   restait haut d'un seul écran et son contenu débordait. L'en-tête
   « collant » se décollait alors après un écran de défilement (il ne colle
   que dans son parent), et la navigation disparaissait vers le haut. */
#racine { display: flex; flex-direction: column; min-height: 100%; flex-shrink: 0; }
#vue { flex: 1; }
a { color: var(--encre); text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* --- Ce qui étiquette : un seul style, partout ----------------------- */
.etiquette-mono, .panneau-titre, .paire-lib, table.tableau th, .article-sku, .marque-sous,
.filtre, .etiq, .suggestion-sku, .suggestion-cat, .numero {
  font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
}

/* --- Le mot-symbole : le vrai, en SVG, couleur du contexte ------------ */
.logo { display: block; height: 22px; width: auto; color: #fff; }
.marque .logo { height: 22px; }
.pied-logo { display: block; margin-bottom: 24px; color: var(--noir); }
.pied-logo .logo { height: 34px; color: var(--noir); }
.connexion-logo .logo { height: 40px; }

/* --- En-tête : un registre sombre, ténu ------------------------------- */
.entete { background: var(--noir); color: #fff; position: sticky; top: 0; z-index: 40; }
.entete-interieur {
  max-width: 1240px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; gap: 40px; height: 64px; position: relative;
}
.marque { display: flex; align-items: baseline; gap: 16px; text-decoration: none; }
.marque-sous { color: rgba(255,255,255,0.55); }
.nav { display: flex; gap: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; height: 64px; }
.nav::-webkit-scrollbar { display: none; }
.onglet {
  background: transparent; border: none; color: rgba(255,255,255,0.78);
  font-family: var(--lire); font-size: 15px; padding: 0 16px; height: 64px;
  border-radius: 0; cursor: pointer; display: flex; align-items: center; gap: 10px;
  white-space: nowrap; letter-spacing: 0.01em;
}
.onglet:hover { color: #fff; }
.onglet.actif { color: #fff; }
/* Le soulignement de l'onglet actif est ancré sur le bouton lui-même
   (position:relative posé dans le gabarit) : un filet blanc, sur la
   ligne du bas du registre. */
.onglet.actif::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 0;
  height: 1px; background: #fff;
}
.pastille {
  background: #fff; color: var(--noir); border-radius: 0;
  font-family: var(--etiqueter); font-size: 11px; padding: 1px 6px; min-width: 20px; text-align: center;
}
.entete-droite { margin-left: auto; display: flex; align-items: center; gap: 24px; flex-shrink: 0; }
.qui { font-family: var(--lire); font-size: 14px; text-align: right; line-height: 1.3; white-space: nowrap; color: #fff; }
.qui-nom { display: block; }
.qui-org { display: block; color: rgba(255,255,255,0.55); font-size: 12px; }
.quitter {
  background: transparent; border: 1px solid rgba(255,255,255,0.45); color: #fff;
  padding: 7px 14px; border-radius: 0; font-size: 13px; cursor: pointer; font-family: var(--lire);
}
.quitter:hover { background: #fff; color: var(--noir); border-color: #fff; }

/* --- Page ------------------------------------------------------------ */
.page { max-width: 1240px; margin: 0 auto; padding: 48px 32px 96px; width: 100%; }
h1 {
  font-family: var(--nommer); font-weight: 300; font-size: 40px; color: var(--encre);
  margin: 0 0 8px; letter-spacing: -0.01em; line-height: 1.05;
}
.sous-titre { color: var(--gris); margin: 0 0 40px; font-size: 16px; max-width: 60ch; }
/* Le chargement RUBI (/commun/css/chargement.css) : il prend la couleur du
   texte autour (currentColor). */
.rubi-chargement-bloc { padding: 96px 0; }
.rubi-chargement-petit { padding: 20px 0; }
.vide {
  color: var(--gris); padding: 64px 32px; text-align: center; font-size: 16px;
  border-top: 1px solid var(--filet); border-bottom: 1px solid var(--filet);
}

/* --- Bandeau d'accueil : sombre, la matière du site ------------------ */
.accueil {
  background: linear-gradient(120deg, #232323 0%, #3A3A32 55%, #5D5D4C 100%);
  color: #fff; padding: 56px 48px; margin-bottom: 40px;
  display: flex; align-items: flex-end; gap: 32px; flex-wrap: wrap;
}
.accueil h1 { color: #fff; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.18em; font-size: 34px; }
.accueil p { margin: 0; color: rgba(255,255,255,0.78); font-size: 16px; max-width: 52ch; }
.accueil-actions { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; }

/* --- Panneaux : un filet, pas une boîte ------------------------------ */
.panneau { background: transparent; border-top: 1px solid var(--filet); margin-bottom: 40px; }
.panneau-titre {
  padding: 16px 0; color: var(--gris); display: flex; align-items: center; gap: 16px;
}
.panneau-titre .note { font-family: var(--lire); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--gris-pale); }
.panneau-corps { padding: 8px 0 24px; }
.panneau .panneau-corps + .panneau-corps { border-top: 1px solid var(--filet-doux); padding-top: 24px; }

/* --- Boutons : une seule action, noire ------------------------------- */
.bouton {
  background: var(--noir); color: #fff; border: 1px solid var(--noir);
  padding: 0 24px; height: 48px; border-radius: 0; font-size: 15px; font-weight: 400;
  cursor: pointer; font-family: var(--lire); text-decoration: none; letter-spacing: 0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1;
}
.bouton:hover { background: var(--encre); border-color: var(--encre); }
.bouton:disabled { opacity: 0.35; cursor: default; }
.bouton-clair {
  background: #fff; color: var(--noir); border: 1px solid #fff;
  padding: 0 24px; height: 48px; border-radius: 0; font-size: 15px; font-weight: 400;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; font-family: var(--lire);
}
.bouton-clair:hover { background: var(--papier); }
.bouton-doux {
  background: transparent; color: var(--encre); border: 1px solid var(--encre);
  padding: 0 20px; height: 44px; border-radius: 0; font-size: 14.5px; cursor: pointer;
  font-family: var(--lire); text-decoration: none; display: inline-flex; align-items: center;
}
.bouton-doux:hover { background: var(--noir); color: #fff; border-color: var(--noir); }
.bouton-mini {
  background: transparent; color: var(--gris); border: 1px solid var(--filet);
  padding: 0 12px; height: 32px; border-radius: 0; font-size: 13px; cursor: pointer; font-family: var(--lire);
}
.bouton-mini:hover { color: var(--encre); border-color: var(--encre); }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 24px; }

/* --- Champs : un filet en dessous, l'encre au-dessus ----------------- */
.champ {
  width: 100%; padding: 12px 14px; border: 1px solid var(--filet); border-radius: 0;
  font-size: 15px; font-family: var(--lire); background: var(--panneau); color: var(--texte);
}
.champ:focus { outline: none; border-color: var(--encre); box-shadow: none; }
textarea.champ { line-height: 1.6; resize: vertical; }
.qte {
  width: 64px; height: 48px; padding: 0 8px; border: 1px solid var(--filet); border-radius: 0;
  font-size: 15px; font-family: var(--etiqueter); text-align: center;
  background: var(--panneau); color: var(--texte);
}
.label { display: block; font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gris); margin-bottom: 8px; }
.aide { font-size: 13.5px; color: var(--gris); margin-top: 8px; }

.chercher { position: relative; }
.chercher input { padding-left: 48px; height: 56px; font-size: 16px; border-radius: 0; background: var(--panneau); }
.chercher svg { position: absolute; left: 18px; top: 19px; color: var(--gris); }

/* --- États : petits, en capitales espacées, jamais en aplat large ----- */
.etiq { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 0; white-space: nowrap; }
.etiq-vert  { color: var(--patine); background: var(--patine-pale); }
.etiq-bleu  { color: var(--encre);  background: var(--olive-pale); }
.etiq-ambre { color: var(--ambre);  background: var(--ambre-pale); }
.etiq-rouge { color: var(--oxyde);  background: var(--oxyde-pale); }
.etiq-gris  { color: var(--gris);   background: var(--filet-doux); }
.mono { font-family: var(--etiqueter); }

/* --- Bandeaux -------------------------------------------------------- */
.bandeau {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px;
  margin-bottom: 24px; font-size: 15px; line-height: 1.5; border-left: 2px solid var(--encre);
  background: var(--panneau);
}
.bandeau-info  { border-left-color: var(--olive); }
.bandeau-ambre { border-left-color: var(--ambre); color: var(--ambre); }
.bandeau-vert  { border-left-color: var(--patine); color: var(--patine); }
.erreur {
  background: var(--panneau); color: var(--oxyde); border-left: 2px solid var(--oxyde);
  padding: 16px 20px; margin-bottom: 24px; font-size: 15px;
}

/* --- Filtres : des références, comme sur une planche ------------------ */
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.filtre {
  padding: 0 14px; height: 36px; border-radius: 0; border: 1px solid var(--filet);
  background: transparent; color: var(--texte); cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.filtre:hover { border-color: var(--encre); }
.filtre.actif { border-color: var(--noir); background: var(--noir); color: #fff; }
.filtre-pastille { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,0.14); }
.filtres.categories { margin-bottom: 12px; }
.filtre-nb { color: var(--gris-pale); }
.filtre.actif .filtre-nb { color: rgba(255,255,255,0.6); }

/* --- Grille et fiche produit : l'image domine, le mot s'efface --------- */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 32px 24px; }
.article {
  background: transparent; border: none; border-top: 1px solid var(--filet);
  overflow: hidden; display: flex; flex-direction: column; padding-top: 16px;
  transition: transform .16s ease;
}
.article:hover { transform: none; box-shadow: none; }
.article:hover .visuel { box-shadow: var(--ombre-levee); }

/* Le visuel : la photo si elle existe, sinon la matière — la plaque de
   finition. Jamais une silhouette inventée. */
.visuel {
  aspect-ratio: 4 / 3; position: relative; display: flex;
  align-items: center; justify-content: center; overflow: hidden; background: var(--panneau);
  border: 1px solid var(--filet-doux); transition: box-shadow .16s ease;
}
.visuel img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.visuel-finition { width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; position: relative; }
.visuel-finition::after { content: ''; position: absolute; inset: 12px; border: 1px solid rgba(255,255,255,0.35); pointer-events: none; }
.visuel-modele {
  font-family: var(--nommer); font-weight: 300; font-size: 28px; letter-spacing: 0.02em;
  color: rgba(255,255,255,0.94); text-shadow: 0 1px 3px rgba(0,0,0,0.22); text-transform: lowercase;
}
.visuel-finition-nom {
  font-family: var(--etiqueter); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}
.visuel-sombre .visuel-modele { color: rgba(255,255,255,0.95); }
.visuel-clair .visuel-modele { color: rgba(43,43,43,0.82); text-shadow: none; }
.visuel-clair .visuel-finition-nom { color: rgba(43,43,43,0.55); }

.article-corps { padding: 16px 0 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.article-sku { color: var(--gris); }
.article-nom { font-family: var(--lire); font-size: 16px; color: var(--encre); line-height: 1.35; font-weight: 400; }
.article-bas { margin-top: auto; padding-top: 16px; }
.prix { font-family: var(--nommer); font-weight: 300; font-size: 30px; letter-spacing: -0.01em; line-height: 1; color: var(--encre); }
.prix-barre { font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.1em; color: var(--gris-pale); text-decoration: line-through; margin-top: 6px; }
.prix-economie { font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--patine); margin-top: 2px; }
.article-ajout { display: flex; gap: 8px; align-items: stretch; margin-top: 16px; }
.article-ajout .bouton { flex: 1; padding: 0 12px; }

/* --- Barre de panier collante ---------------------------------------- */
.barre-panier {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--noir); color: #fff;
}
.barre-panier-interieur {
  max-width: 1240px; margin: 0 auto; padding: 12px 32px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.barre-panier .bouton { background: #fff; color: var(--noir); border-color: #fff; }
.barre-panier[hidden] { display: none; }

/* --- Listes : des rangées, séparées d'un filet ----------------------- */
.rangee {
  background: transparent; border-top: 1px solid var(--filet);
  padding: 20px 0; margin: 0; display: flex; align-items: center;
  gap: 20px; flex-wrap: wrap; cursor: pointer;
}
.rangee:last-of-type { border-bottom: 1px solid var(--filet); }
.rangee:hover .numero { color: var(--noir); }
.rangee-fin { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.numero { color: var(--encre); font-size: 12px; }
.montant { font-family: var(--nommer); font-weight: 300; font-size: 22px; color: var(--encre); }

table.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
table.tableau th {
  text-align: left; color: var(--gris); font-weight: 400;
  padding: 12px 12px 12px 0; border-bottom: 1px solid var(--filet);
}
table.tableau td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--filet-doux); vertical-align: middle; }
table.tableau tr:last-child td { border-bottom: none; }
table.tableau td.mono, table.tableau .mono { font-size: 13px; }
.droite { text-align: right; }
.vignette-ligne { width: 48px; height: 48px; object-fit: contain; background: var(--panneau); border: 1px solid var(--filet-doux); flex-shrink: 0; }

/* --- Suivi : un filet qui s'épaissit là où on en est ----------------- */
.etapes { display: flex; gap: 16px; flex-wrap: wrap; }
.etape {
  flex: 1; min-width: 130px; padding: 14px 0 0; font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  border-top: 1px solid var(--filet); color: var(--gris-pale);
}
.etape.faite { border-top-color: var(--encre); color: var(--gris); }
.etape.ici { border-top: 3px solid var(--noir); padding-top: 12px; color: var(--noir); }

.paires { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.paire-lib { color: var(--gris); }
.paire-val { font-size: 18px; margin-top: 6px; color: var(--encre); }

/* --- Pied de page : l'ancre olive ------------------------------------ */
.pied { background: var(--olive); color: #fff; margin-top: auto; }
.pied-interieur {
  max-width: 1240px; margin: 0 auto; padding: 56px 32px 40px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px;
}
.pied h4 { font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 400; margin: 0 0 16px; color: rgba(255,255,255,0.6); }
.pied p, .pied a { font-size: 14.5px; color: rgba(255,255,255,0.9); margin: 0 0 6px; text-decoration: none; display: block; line-height: 1.5; }
.pied a:hover { text-decoration: underline; }
.pied .bouton { background: var(--noir); border-color: var(--noir); color: #fff; margin-bottom: 12px; display: inline-flex; }
.pied-bas {
  max-width: 1240px; margin: 0 auto; padding: 16px 32px 24px;
  border-top: 1px solid rgba(255,255,255,0.18); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.55);
}

/* --- Connexion : la vitrine, sombre ---------------------------------- */
.connexion {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px; background: #232323; gap: 32px;
}
.boite { background: var(--panneau); padding: 40px; width: 100%; max-width: 460px; }
.boite .marque-sous { color: var(--gris); display: block; }
.compte {
  width: 100%; text-align: left; background: transparent; border: none; border-top: 1px solid var(--filet);
  padding: 14px 0; margin: 0; cursor: pointer;
  font-family: var(--lire); font-size: 15px; display: flex; align-items: center; gap: 12px; color: var(--texte);
}
.compte:hover { color: var(--noir); }
.compte-org { margin-left: auto; font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gris); }

/* --- Suggestions sous la recherche ----------------------------------- */
.suggestions {
  position: absolute; top: calc(100% - 1px); left: 0; right: 0; z-index: 30;
  background: var(--panneau); border: 1px solid var(--encre);
  overflow: hidden; max-height: 440px; overflow-y: auto;
}
.suggestion {
  display: flex; align-items: center; gap: 16px; padding: 12px 18px; cursor: pointer;
  border-bottom: 1px solid var(--filet-doux);
}
.suggestion:last-child { border-bottom: 0; }
.suggestion.actif, .suggestion:hover { background: var(--papier); }
.suggestion-sku { color: var(--gris); white-space: nowrap; }
.suggestion-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.suggestion-nom mark { background: transparent; color: var(--noir); text-decoration: underline; text-underline-offset: 3px; }
.suggestion-prix { font-family: var(--nommer); font-weight: 300; white-space: nowrap; font-size: 18px; color: var(--encre); }
.suggestion-tout { color: var(--encre); justify-content: center; font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.suggestion-vide { padding: 14px 18px; color: var(--gris); font-size: 14.5px; }
.suggestion-cat { color: var(--gris); background: var(--filet-doux); padding: 3px 8px; white-space: nowrap; }

/* --- Rangées serrées (petit écran) ----------------------------------- */
@media (max-width: 1080px) {
  .entete-interieur { height: auto; padding: 12px 24px 0; flex-wrap: wrap; row-gap: 0; }
  .entete-droite { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-top: 4px; height: 48px; border-top: 1px solid rgba(255,255,255,0.12); }
  .onglet { height: 48px; padding: 0 14px; }
  .onglet.actif::after { left: 14px; right: 14px; }
  .pied-interieur { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .entete-interieur { padding: 12px 16px 0; gap: 12px; }
  .qui-org { display: none; }
  .page { padding: 32px 16px 120px; }
  h1 { font-size: 32px; }
  .accueil { padding: 32px 24px; }
  .grille { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 24px 16px; }
  .prix { font-size: 24px; }
  .pied-interieur { grid-template-columns: 1fr; }
}

/* --- Suivi d'un envoi : les étapes du transporteur ------------------- */
/* Une liste, pas un tableau : sur un téléphone de comptoir, la date passe
   au-dessus de l'étape au lieu de pousser la ligne hors de l'écran. La
   plus récente, en tête, garde l'encre ; les suivantes s'effacent. */
.envoi + .envoi { border-top: 1px solid var(--filet-doux); margin-top: 24px; padding-top: 24px; }
.envoi-rang { margin-bottom: 16px; }
.evenements { list-style: none; margin: 24px 0 0; padding: 0; }
.evenement {
  display: grid; grid-template-columns: 168px 1fr auto; gap: 16px; align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--filet-doux); color: var(--gris);
}
.evenement:first-child { border-top-color: var(--filet); color: var(--encre); }
.evenement-date { font-family: var(--etiqueter); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.evenement-desc { font-size: 15px; }
.evenement-lieu { font-size: 14px; text-align: right; }
@media (max-width: 820px) {
  .evenement { grid-template-columns: 1fr; gap: 2px; }
  .evenement-lieu { text-align: left; }
}

/* --- Téléphone et écran tactile ---------------------------------------
   Rien ici ne change l'écran d'un ordinateur : tout est sous 600 px de
   large, ou réservé au toucher (pointer: coarse). */

/* Un doigt ne vise pas comme une souris : 44 px de haut pour tout ce qui
   se touche. Et Safari zoome sur un champ écrit sous 16 px, sans
   dézoomer en sortant : l'écran reste agrandi et déborde. */
@media (pointer: coarse) {
  .champ, .qte, input, select, textarea { font-size: 16px; }
  .bouton-mini, .filtre, .quitter { min-height: 44px; }
  .bouton-mini, .quitter { display: inline-flex; align-items: center; justify-content: center; }
  .compte { min-height: 48px; }
  .pied a { display: flex; align-items: center; min-height: 44px; margin: 0; }
  .pied .bouton { display: inline-flex; }
  a.aide { display: inline-flex; align-items: center; min-height: 44px; }
  /* Le logo mène au catalogue : sa zone de toucher grandit sans rien déplacer. */
  .marque { padding: 9px 0; margin: -9px 0; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
}

@media (max-width: 600px) {
  /* L'en-tête reste collé en haut : il ne garde que l'essentiel sur deux
     rangées (logo et compte, puis les sections), soit la moitié de sa
     hauteur d'avant. */
  .entete { padding-top: env(safe-area-inset-top); }
  .entete-interieur {
    padding: 8px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    gap: 12px;
  }
  .marque-sous { display: none; }
  .entete-droite { min-width: 0; flex-shrink: 1; gap: 12px; }
  .qui { min-width: 0; font-size: 13px; }
  .qui-nom { overflow: hidden; text-overflow: ellipsis; }
  /* Cinq sections ne tiennent pas sur 375 px : la rangée défile au doigt,
     et le fondu à droite dit qu'il en reste. */
  .nav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .onglet { padding: 0 12px; font-size: 14.5px; }
  .onglet.actif::after { left: 12px; right: 12px; }

  .page { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  h1 { font-size: 28px; }
  .accueil { padding: 28px 20px; }
  .accueil h1 { font-size: 24px; letter-spacing: 0.12em; }
  .accueil-actions { margin-left: 0; }
  .bandeau, .erreur { padding: 12px 14px; }

  /* Les trois étapes d'une commande sur une seule ligne : à 130 px chacune,
     « Expédiée » tombait seule sur une deuxième rangée. */
  .etape { min-width: 0; letter-spacing: 0.08em; }

  /* La barre de panier au-dessus de l'indicateur d'accueil de l'iPhone. */
  .barre-panier-interieur { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 12px; }

  .boite { padding: 28px 20px; }
  .connexion { padding: max(24px, env(safe-area-inset-top)) 16px 24px; }
  .suggestion { padding: 12px 14px; gap: 10px; }
  .suggestion-prix { font-size: 16px; }

  /* Les tableaux d'articles deviennent des fiches : à cinq ou six colonnes
     dans 343 px, la description se réduisait à un mot par ligne et le
     total défilait hors de vue. En-têtes masqués : chaque valeur se lit
     par sa place (le total à droite, en gras) ou par son préfixe. */
  table.lignes-commande, table.lignes-commande tbody,
  table.lignes-demande, table.lignes-demande tbody,
  table.tableau:has(.qte), table.tableau:has(.qte) tbody { display: block; }
  table.lignes-commande thead, table.lignes-demande thead, table.tableau:has(.qte) thead { display: none; }
  table.lignes-commande tr, table.lignes-demande tr, table.tableau:has(.qte) tr {
    display: grid; column-gap: 12px; row-gap: 6px; align-items: center;
    padding: 14px 0; border-bottom: 1px solid var(--filet-doux);
  }
  table.lignes-commande tr:last-child, table.lignes-demande tr:last-child, table.tableau:has(.qte) tr:last-child { border-bottom: none; }
  table.lignes-commande td, table.lignes-demande td, table.tableau:has(.qte) td {
    display: block; padding: 0; border: none; text-align: left;
  }

  /* Commande et soumission : code … total / description / quantité × prix */
  table.lignes-commande tr {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "code code total" "desc desc desc" "qte prix prix";
  }
  table.lignes-commande td:nth-child(1) { grid-area: code; }
  table.lignes-commande td:nth-child(2) { grid-area: desc; }
  table.lignes-commande td:nth-child(3) { grid-area: qte; color: var(--gris); }
  table.lignes-commande td:nth-child(4) { grid-area: prix; color: var(--gris); }
  table.lignes-commande td:nth-child(4)::before { content: "× "; }
  table.lignes-commande td:nth-child(5) { grid-area: total; text-align: right; }

  /* Demande de retour : code … quantité / description / ce qui ne va pas */
  table.lignes-demande tr {
    grid-template-columns: 1fr auto;
    grid-template-areas: "code qte" "desc desc" "motif motif";
  }
  table.lignes-demande td:nth-child(1) { grid-area: code; }
  table.lignes-demande td:nth-child(2) { grid-area: desc; }
  table.lignes-demande td:nth-child(3) { grid-area: qte; text-align: right; }
  table.lignes-demande td:nth-child(3)::before { content: "Qté "; }
  table.lignes-demande td:nth-child(4) { grid-area: motif; color: var(--gris); }

  /* Le panier : vignette, description / quantité × prix … total / Retirer.
     Ciblé par son champ de quantité (:has) plutôt que par une classe : son
     gabarit vit dans commander.js, que ce changement ne touche pas. */
  table.tableau:has(.qte) tr {
    grid-template-columns: 48px auto 1fr auto;
    grid-template-areas: "img desc desc desc" "img qte prix total" ". retirer retirer retirer";
  }
  /* Sans photo, la vignette est masquée (visibility) : sa colonne vide
     décalait tout de 60 px. */
  table.tableau:has(.qte) tr:has(img[style*="hidden"]) {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "desc desc desc" "qte prix total" "retirer retirer retirer";
  }
  table.tableau:has(.qte) tr:has(img[style*="hidden"]) td:nth-child(1) { display: none; }
  table.tableau:has(.qte) td:nth-child(1) { grid-area: img; width: auto !important; align-self: start; }
  table.tableau:has(.qte) td:nth-child(2) { grid-area: desc; }
  table.tableau:has(.qte) td:nth-child(3) { grid-area: qte; }
  table.tableau:has(.qte) td:nth-child(4) { grid-area: prix; color: var(--gris); }
  table.tableau:has(.qte) td:nth-child(4)::before { content: "× "; }
  table.tableau:has(.qte) td:nth-child(5) { grid-area: total; text-align: right; }
  table.tableau:has(.qte) td:nth-child(6) { grid-area: retirer; }
}


/* Le champ du code d'accès et son œil (connexion.js) : l'œil vit DANS le
   champ, à droite, sans changer la largeur du formulaire. */
.champ-code { position: relative; }
.champ-code .champ { width: 100%; padding-right: 44px; box-sizing: border-box; }
.champ-code .oeil { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 6px;
  color: var(--acier, #6b7280); cursor: pointer; padding: 0; }
.champ-code .oeil:hover, .champ-code .oeil[aria-pressed="true"] { color: var(--encre, #111); }
