/* ==========================================================
   Apparence de l'appli — couleurs du logo Emile (bleu marine)
   Pensée d'abord pour le téléphone, puis élargie pour
   l'ordinateur (voir les blocs @media).
   ========================================================== */

/* --- Couleurs et réglages communs (modifiables ici) --- */
:root {
  --marine: #232c4d;           /* bleu du logo : menu, boutons, titres */
  --marine-fonce: #1a2140;
  --marine-clair: #34406b;     /* survol dans le menu */
  --marine-pale: #e9ecf5;      /* fonds légers (en-têtes de tableau…) */
  --fond: #f4f5f9;             /* fond de page gris-bleu très clair */
  --surface: #ffffff;
  --texte: #1f2433;
  --texte-doux: #6b7285;
  --bordure: #e2e5ee;
  --fond-marine: #232c4d;      /* marine utilisé comme FOND (menu, boutons, en-têtes) */
  --fond-marine-clair: #3a4677;
  --surface-2: #f6f7fb;        /* lignes alternées, survol */
  --surface-3: #e3e7f1;
  --bordure-forte: #c5cbdc;    /* bords des champs */
  --ok-fond: #e8f5ec;
  --ok-texte: #1f6b3a;
  --cuisson-texte: #8a5300;
  --cuisson-fond: #fff9ef;
  --texte-sur-marine-doux: #d6dbea;
  --principal: var(--fond-marine);
  --principal-texte: #ffffff;
  --alerte-orange: #e8962e;    /* stock bas */
  --alerte-orange-fond: #fff4e5;
  --alerte-rouge: #c62828;     /* rupture */
  --alerte-rouge-fond: #fdecea;
  --ok-vert: #2e7d32;
  --rayon: 10px;
  --ombre: 0 1px 3px rgba(35, 44, 77, 0.08);
  --largeur-menu: 220px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  font-size: 16px;
  line-height: 1.4;
}

[hidden] { display: none !important; }

/* ==========================================================
   En-tête : logo à gauche, prénom + Déconnexion à droite
   ========================================================== */
.entete {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--bordure);
}
.logo { margin: 0; line-height: 0; flex-shrink: 0; }
.logo img, .logo svg { height: 40px; width: auto; display: block; }

/* Rond avec les initiales (en haut à droite) + son menu */
.zone-utilisateur { margin-left: auto; position: relative; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 2px solid var(--bordure);
  border-radius: 50%;
  background: var(--marine-pale);
  color: var(--marine);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
button.avatar { cursor: pointer; }
button.avatar:hover,
button.avatar[aria-expanded="true"] { border-color: var(--marine); }
.avatar-grand { width: 52px; height: 52px; font-size: 1.15rem; }
.avatar-tres-grand { width: 76px; height: 76px; font-size: 1.6rem; border-width: 3px; }
.menu-compte {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(280px, calc(100vw - 32px));
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: 0 8px 24px rgba(26, 33, 64, 0.15);
}
.menu-compte-identite { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.menu-compte-identite div { display: flex; flex-direction: column; min-width: 0; }
.menu-compte-identite strong { color: var(--marine); }
.email-compte { font-size: 0.8rem; overflow-wrap: anywhere; }
.menu-compte .bouton { width: 100%; }

/* ==========================================================
   Écrans (chargement, connexion, refusé, appli)
   ========================================================== */
.message-centre {
  text-align: center;
  color: var(--texte-doux);
  margin: 40px 0;
}
#ecran-chargement { padding: 16px; }
.carte-centre {
  max-width: 420px;
  margin: 48px auto;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  text-align: center;
}
.carte-centre h2 { margin-top: 0; color: var(--marine); }
@media (max-width: 480px) { .carte-centre { margin: 24px 16px; } }
.texte-doux { color: var(--texte-doux); font-size: 0.9rem; }
.texte-erreur { color: var(--alerte-rouge); font-size: 0.9rem; }

/* L'appli : menu latéral + pages (téléphone : menu en haut) */
#ecran-appli { display: block; }
.zone-pages { padding: 16px; min-width: 0; }

/* ==========================================================
   Barre de pages : colonne d'icônes à gauche sur ordinateur,
   barre horizontale en haut sur téléphone.
   ========================================================== */
.onglets {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
  background: var(--fond-marine);
  overflow-x: auto;
}
.onglets-haut, .onglets-bas { display: flex; gap: 6px; }
.onglet {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);   /* le "carré arrondi" */
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.onglet svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.onglet:hover { background: var(--marine-clair); color: #fff; }
.onglet.actif { background: var(--surface); border-color: #fff; color: var(--marine); }
.onglet-outil { display: none; }   /* "Afficher les noms" : utile sur ordinateur seulement */

/* ==========================================================
   Boutons
   ========================================================== */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;            /* taille confortable pour le doigt */
  padding: 0 16px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  cursor: pointer;
}
.bouton:hover { border-color: var(--marine); }
.bouton-principal {
  background: var(--principal);
  border-color: var(--principal);
  color: var(--principal-texte);
  font-weight: 600;
}
.bouton-principal:hover { background: var(--marine-fonce); }
.bouton-petit { min-height: 34px; padding: 0 10px; font-size: 0.85rem; }
.bouton:disabled { opacity: 0.4; cursor: not-allowed; }
.bouton-danger { color: var(--alerte-rouge); }

/* ==========================================================
   Titre de page, filtres, bandeaux
   ========================================================== */
.barre-titre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
}
.barre-titre h2 { margin: 0; font-size: 1.3rem; color: var(--marine); }
.barre-titre .bouton-principal { margin-left: auto; }

.filtres {
  display: grid;
  grid-template-columns: 1fr;         /* téléphone : l'un sous l'autre */
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
}
.filtres input,
.filtres select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  width: 100%;
  min-width: 0;
}
#compteur-filtres { margin: 0 0 12px; }

.resume-alertes {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--rayon);
  background: var(--alerte-orange-fond);
  border: 1px solid var(--alerte-orange);
  font-size: 0.9rem;
}
.resume-alertes.grave {
  background: var(--alerte-rouge-fond);
  border-color: var(--alerte-rouge);
}

/* ==========================================================
   Tableaux (stock, historique)
   ========================================================== */
.carte-tableau {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
}
.tableau { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tableau th {
  padding: 12px 14px;
  background: var(--marine-pale);
  color: var(--marine);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  white-space: nowrap;
}
.tableau td {
  padding: 8px 14px;
  border-top: 1px solid var(--bordure);
  vertical-align: middle;
}
.tableau tbody tr:hover td { background: var(--surface-2); }

/* Choix du site : deux boutons collés "Poitiers | Châtellerault" */
.choix-site {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 10px;
}
.choix-site-bouton {
  min-height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--texte-doux);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.choix-site-bouton.actif { background: var(--fond-marine); color: #fff; }

/* Stock : une ligne par gâteau (dépliable), puis une ligne par taille */
.ligne-gateau { cursor: pointer; }
.ligne-gateau td { border-top: 2px solid var(--bordure); }
.tableau-stock tbody tr:first-child td { border-top: none; }
.ligne-gateau.deplie td { background: var(--surface-2); }
.bouton-deplier {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0;
  border: none;
  background: none;
  color: var(--marine);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
}
/* Petite flèche dessinée en CSS : pointe à droite, puis vers le bas une fois déplié */
.chevron {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-right: 2px solid var(--marine);
  border-bottom: 2px solid var(--marine);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.deplie .chevron { transform: rotate(45deg); }
.ligne-gateau .pastille { margin-left: 10px; }
.note-gateau { margin: 2px 0 0 18px; font-size: 0.82rem; }
.total-stock {
  display: inline-block;
  min-width: 52px;
  text-align: center;
  font-weight: 700;
  color: var(--marine);
}
.ligne-taille td { background: var(--surface-2); }
.nom-taille { display: inline-block; padding-left: 28px; }
.col-prix { white-space: nowrap; }
.col-stock { white-space: nowrap; }
.col-actions { white-space: nowrap; text-align: right; }
.col-actions .bouton + .bouton { margin-left: 6px; }
.tableau-stock:not(.avec-actions) .col-actions { display: none; }

/* Quantité : un bouton qu'on touche pour la modifier */
.quantite-valeur,
.quantite-bouton {
  min-width: 52px;
  min-height: 40px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}
.quantite-valeur { display: inline-flex; align-items: center; justify-content: center; }
.quantite-bouton {
  padding: 0 10px;
  border: 1px dashed var(--bordure-forte);
  border-radius: 8px;
  background: var(--marine-pale);
  color: var(--marine);
  font-family: inherit;
  cursor: pointer;
}
.quantite-bouton:hover { border-color: var(--marine); }
.ligne-rouge .quantite-bouton, .ligne-rouge .quantite-valeur { color: var(--alerte-rouge); background: var(--alerte-rouge-fond); }
.ligne-orange .quantite-bouton, .ligne-orange .quantite-valeur { color: var(--cuisson-texte); background: var(--alerte-orange-fond); }
.quantite-saisie {
  width: 76px;
  min-height: 40px;
  padding: 4px 8px;
  border: 2px solid var(--marine);
  border-radius: 8px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

/* Pastilles d'alerte (Stock bas, Rupture) */
.pastille {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}
.pastille-orange { background: var(--alerte-orange-fond); color: var(--cuisson-texte); border: 1px solid var(--alerte-orange); }
.pastille-rouge  { background: var(--alerte-rouge-fond); color: var(--alerte-rouge); border: 1px solid var(--alerte-rouge); }

/* Historique */
.historique-date { white-space: nowrap; color: var(--texte-doux); }
.historique-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--marine-pale);
  color: var(--marine);
  white-space: nowrap;
}
.historique-action.ajout { background: var(--ok-fond); color: var(--ok-vert); }
.historique-action.suppression { background: var(--alerte-rouge-fond); color: var(--alerte-rouge); }
.historique-detail { overflow-wrap: anywhere; }

/* ==========================================================
   Module Recettes : tuiles, fil d'Ariane, listes en cartes
   ========================================================== */
.tuiles { display: flex; flex-wrap: wrap; gap: 16px; }
.tuile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 170px;
  height: 160px;
  border: 1px solid var(--bordure);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--ombre);
  color: var(--marine);
  font: inherit;
  cursor: pointer;
}
.tuile:hover { border-color: var(--marine); box-shadow: 0 4px 14px rgba(35, 44, 77, 0.12); }
.tuile-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--fond-marine);
  color: #fff;
}
.tuile-icone svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tuile-titre { font-size: 1.1rem; font-weight: 700; }
.tuile-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--marine-pale);
  font-size: 0.75rem;
  font-weight: 600;
}
@media (max-width: 420px) { .tuile { width: calc(50% - 8px); height: 140px; } }

.fil-ariane { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--texte-doux); font-size: 0.9rem; }
.lien-retour {
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--marine);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.compteur { color: var(--texte-doux); font-weight: 600; font-size: 1rem; }

/* Barre de recherche + lettres A–Z + filtres */
.filtres-liste { gap: 10px; }
.lettres { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.lettre {
  min-width: 28px;
  min-height: 28px;
  padding: 0 4px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--texte-doux);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.lettre:hover { color: var(--marine); background: var(--marine-pale); }
.lettre.actif { background: var(--fond-marine); color: #fff; }
.filtres-selects { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 700px) { .filtres-selects { grid-template-columns: repeat(3, 1fr); } }

/* Grille de cartes (ingrédients, recettes) */
.grille-fiches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.carte-fiche {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 130px;
  padding: 14px;
  border: 1px solid var(--bordure);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--ombre);
  color: var(--texte);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.carte-fiche:hover { border-color: var(--marine); }
.carte-fiche-categorie {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--marine-pale);
  color: var(--marine);
  font-size: 0.75rem;
  font-weight: 600;
}
.carte-fiche-nom { color: var(--marine); font-size: 1.02rem; overflow-wrap: anywhere; }
.carte-fiche-prix { font-weight: 700; }
.carte-fiche-allergenes { margin-top: auto; font-size: 0.78rem; color: var(--cuisson-texte); }

/* ==========================================================
   Grande fenêtre "Détail de l'ingrédient"
   ========================================================== */
.dialogue.dialogue-large { width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.fiche-ingredient { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.bandeau-dialogue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--fond-marine);
  color: #fff;
}
.bandeau-dialogue h2 { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.04em; }
.bouton-fermer {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: none;
  color: #fff;
  cursor: pointer;
}
.bouton-fermer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.corps-dialogue { flex: 1; overflow-y: auto; padding: 18px; background: var(--fond); }
.pied-dialogue {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border-top: 1px solid var(--bordure);
}
.pied-dialogue .bouton-danger { margin-right: auto; }
.champ-nom-ingredient {
  width: 100%;
  min-height: 52px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--marine);
}
.fiche-ingredient-colonnes { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .fiche-ingredient-colonnes { grid-template-columns: 220px 1fr; } }
.fiche-ingredient-cote {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--bordure);
  border-radius: 12px;
  background: var(--surface);
  align-self: start;
}
.fiche-ingredient-cote label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 700; color: var(--marine); text-transform: uppercase; }
.fiche-ingredient-cote select,
.grille-tarif input, .grille-tarif select,
.ligne-unite input[type=number],
.valeur-nutrition input,
.recherche-ciqual input {
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-weight: 400;
  text-transform: none;
}
.resume-ingredient { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; }
.resume-ingredient strong { color: var(--marine); font-size: 1.1rem; }
.fiche-ingredient-principal {
  min-width: 0;
  padding: 0 14px 14px;
  border: 1px solid var(--bordure);
  border-radius: 12px;
  background: var(--surface);
}
.onglets-fiche { display: flex; gap: 4px; overflow-x: auto; margin: 0 -14px 14px; padding: 10px 14px 0; border-bottom: 1px solid var(--bordure); }
.onglet-fiche {
  padding: 10px 14px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--texte-doux);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.onglet-fiche.actif { color: var(--marine); border-bottom-color: var(--marine); }
/* Les onglets de la fiche recette ont le même style */
.onglet-recette {
  padding: 10px 14px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--texte-doux);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.onglet-recette.actif { color: var(--marine); border-bottom-color: var(--marine); }
.fiche-ingredient-cote input {
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-weight: 400;
  text-transform: none;
}

/* ==========================================================
   Fiches recettes
   ========================================================== */
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 900px) { .filtres-selects-4 { grid-template-columns: repeat(4, 1fr); } }

/* Cartes de la liste (emplacement de photo + numéro + statut + nom + auteur) */
.carte-recette { padding: 8px 8px 12px; gap: 6px; min-height: 0; }
.carte-recette-visuel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 110px;
  border-radius: 8px;
  background: var(--marine-pale);
}
.carte-recette-initiale { font-size: 2.2rem; font-weight: 700; color: var(--bordure-forte); }
.carte-recette-ligne { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.carte-recette .carte-fiche-nom,
.carte-recette > .texte-doux { padding: 0 4px; }
.numero-recette { padding: 1px 8px; border-radius: 999px; background: var(--bordure); font-size: 0.75rem; font-weight: 700; }
.statut-recette { font-size: 0.78rem; font-weight: 600; }
.statut-a-definir { color: var(--alerte-orange); }
.statut-validee { color: var(--ok-vert); }
.carte-recette-auteur { margin-top: auto; font-size: 0.82rem; }
.carte-recette-auteur strong { color: var(--texte); }

/* Résumé des coûts (colonne de gauche de la fiche) */
.resume-cout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  background: var(--marine-pale);
}
.resume-cout div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.resume-cout strong { color: var(--marine); }
.resume-cout .texte-erreur { margin: 0; font-size: 0.8rem; }

/* Rendement "La recette donne 1 cadre" */
.rendement { display: flex; flex-direction: column; gap: 4px; }
.rendement-titre { font-size: 0.8rem; font-weight: 700; color: var(--marine); text-transform: uppercase; }
.rendement-champs { display: grid; grid-template-columns: 80px 1fr; gap: 6px; }
.rendement-champs input { width: 100%; min-width: 0; }

/* Champs communs de la fenêtre recette */
.element-bloc input, .element-bloc select, .element-bloc textarea, .zone-notes {
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
}
.element-bloc textarea, .zone-notes { width: 100%; resize: vertical; }
.bouton-icone { min-width: 34px; padding: 0 8px; }

/* Composition : une suite de blocs (groupe / cuisson / information) */
.liste-elements { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.element-bloc { padding: 12px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); }
.element-groupe:nth-child(odd) { background: var(--surface-2); }
.element-cuisson { border-color: var(--alerte-orange); background: var(--alerte-orange-fond); }
.element-information { border-style: dashed; }
.element-entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.element-titre { font-weight: 700; color: var(--marine); }
.element-boutons { display: inline-flex; gap: 4px; }
/* Groupe : procédé à gauche, ingrédients à droite */
.groupe-corps { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 760px) { .groupe-corps { grid-template-columns: 200px 1fr; } }
.groupe-procede { min-height: 90px; }
.groupe-lignes { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.ligne-groupe {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto auto;
  align-items: center;
  gap: 4px 8px;
  width: 100%;
}
.ligne-groupe .equivalent-g, .ligne-groupe .manque-ligne { grid-column: 1 / -1; }
.ligne-groupe .equivalent-g:empty, .ligne-groupe .manque-ligne:empty { display: none; }
.ligne-incomplete .choix-bouton { border-color: var(--alerte-rouge); }
.choix-ligne { width: 100%; min-width: 0; }
.quantite-ligne { display: inline-flex; gap: 4px; }
.quantite-ligne input { width: 80px; }
.cout-ligne { min-width: 64px; text-align: right; white-space: nowrap; font-weight: 600; color: var(--marine); }
.boutons-ligne { display: inline-flex; gap: 4px; }
.equivalent-g { font-size: 0.8rem; }
.manque-ligne { display: block; color: var(--alerte-rouge); font-size: 0.8rem; }
/* Cuisson */
.cuisson-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.champ-element { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.champ-large { grid-column: 1 / -1; }
.champ-unite { display: inline-flex; align-items: center; gap: 6px; }
.champ-unite input { width: 100%; min-width: 0; }
.ajouts-elements { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 699px) {
  .ligne-groupe { grid-template-columns: 1fr auto; }
  .ligne-groupe .choix-ligne { grid-column: 1 / -1; }
}

/* Icônes des cartes de recettes (voir, modifier, dupliquer, supprimer) */
.carte-recette { cursor: pointer; }
.carte-recette:focus-visible { outline: 2px solid var(--marine); outline-offset: 2px; }
.carte-recette-actions { display: flex; justify-content: flex-end; align-self: stretch; gap: 6px; margin-top: -26px; padding: 0 6px; }
.icone-carte {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--surface);
  color: var(--marine);
  box-shadow: var(--ombre);
  cursor: pointer;
}
.icone-carte:hover { border-color: var(--marine); }
.icone-carte svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icone-danger { color: var(--alerte-rouge); }
.icone-danger:hover { border-color: var(--alerte-rouge); }
/* Avec une souris : les icônes n'apparaissent qu'au survol de la carte.
   Sur téléphone/tablette (pas de survol possible), elles restent visibles. */
@media (hover: hover) {
  .carte-recette-actions { opacity: 0; transition: opacity 0.15s; }
  .carte-recette:hover .carte-recette-actions,
  .carte-recette:focus-within .carte-recette-actions { opacity: 1; }
}

/* Boutons « Retour » en haut des pages */
.bouton-retour { margin-bottom: 12px; }
.fil-ariane .bouton-retour { margin: 0 6px 0 0; }
.aide-colonnes { font-size: 0.8rem; }

/* ==========================================================
   Fiche de pesée (façon tableau Excel)
   ========================================================== */
.pesee-resume { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pesee-resume-case {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--surface);
}
.pesee-resume-case strong { color: var(--marine); font-size: 1.15rem; }
.pesee-colonne-temp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 0.9rem; }
.pesee-colonne-temp input {
  width: 90px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  font: inherit;
}
.pesee-cadre { overflow-x: auto; }
/* Largeur des colonnes fixée par recettes.js (réglable à la souris) */
.pesee-tableau { table-layout: fixed; border-collapse: collapse; font-size: 0.95rem; }
/* Un trait bien visible entre CHAQUE ligne et chaque colonne */
.pesee-tableau th, .pesee-tableau td { padding: 8px 12px; border: 1px solid #6f7898; overflow-wrap: anywhere; }
.pesee-tableau thead th { position: relative; }
/* Poignée de redimensionnement (bord droit de chaque en-tête) */
.poignee-colonne {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 2;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}
.poignee-colonne:hover { background: rgba(255, 255, 255, 0.35); }
.ligne-centree { text-align: center; }
/* Trait épais entre la colonne Procédé et les ingrédients */
.pesee-tableau .pesee-procede { border-right: 2px solid var(--marine); }
.pesee-tableau .pesee-ingredient,
.pesee-tableau tfoot th,
.pesee-tableau .ligne-poids-cuisson th { border-left: 2px solid var(--marine); }
/* Trait épais au-dessus de chaque groupe, cuisson, information et des totaux */
.pesee-tableau .debut-groupe > *,
.pesee-tableau .ligne-cuisson > *,
.pesee-tableau .ligne-information > *,
.pesee-tableau tfoot tr:first-child > * { border-top: 2px solid var(--marine); }
/* En-tête : traits clairs bien visibles entre Procédé, Ingrédient, colonnes, % */
.pesee-tableau thead th { border-color: rgba(255, 255, 255, 0.45); }
/* Bandeau du nom de la recette, au-dessus des titres de colonnes */
.pesee-tableau .pesee-bandeau th {
  padding: 6px 12px;
  background: var(--marine-fonce);
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  text-align: left;
  text-transform: uppercase;
  white-space: normal;
}
/* Cuisson / Information : libellé centré dans sa case */
.ligne-cuisson th, .ligne-information th { text-align: center !important; }
.pesee-tableau thead th { background: var(--fond-marine); color: #fff; font-weight: 700; text-align: left; white-space: nowrap; }
.pesee-tableau thead th.pesee-col-qte { text-align: right; }
.pesee-col-procede { min-width: 140px; }
.pesee-procede { font-weight: 600; color: var(--marine); white-space: pre-wrap; vertical-align: middle; text-align: center; }
.pesee-qte { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Contour épais et continu tout autour du tableau (coins compris) */
.pesee-tableau tr > :first-child { border-left: 2px solid var(--marine-fonce); }
.pesee-tableau tr > :last-child { border-right: 2px solid var(--marine-fonce); }
.pesee-tableau thead tr:first-child > * { border-top: 2px solid var(--marine-fonce); }
.pesee-tableau tfoot tr:last-child > * { border-bottom: 2px solid var(--marine-fonce); }
/* Admin : toute case modifiable au toucher */
.pesee-modifiable { cursor: pointer; }
.pesee-modifiable:hover, .pesee-modifiable:focus-visible { outline: 2px dashed var(--marine); outline-offset: -4px; }
.ligne-information .pesee-modifiable:hover, .pesee-bandeau .pesee-modifiable:hover,
.ligne-information .pesee-modifiable:focus-visible, .pesee-bandeau .pesee-modifiable:focus-visible { outline-color: #fff; }
.pesee-saisie {
  width: 100%;
  min-width: 40px;
  padding: 2px 6px;
  border: 2px solid var(--marine);
  border-radius: 6px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}
textarea.pesee-saisie { resize: vertical; }
.pesee-qte .pesee-saisie { width: calc(100% - 26px); text-align: right; }
.pesee-saisie-unite { margin-left: 4px; font-size: 0.8rem; color: var(--texte-doux); }
.pesee-saisie-cuisson { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pesee-saisie-champ { display: flex; flex-direction: column; gap: 2px; font-size: 0.78rem; font-weight: 600; text-align: left; }
.pesee-saisie-champ .pesee-saisie { width: 120px; }
.pesee-pourcent { color: var(--texte-doux); }
.pesee-ingredient .manque-ligne { margin-top: 2px; }
/* Une teinte par groupe : les ingrédients d'un même groupe se pèsent ensemble */
.groupe-clair td { background: var(--surface); }
.groupe-fonce td { background: var(--surface-3); }
.pesee-tableau .ligne-incomplete td.pesee-ingredient { color: var(--alerte-rouge); }
/* Cuisson : en gras, ton orangé, centrée sur la recette */
.ligne-cuisson th, .ligne-cuisson td { background: var(--alerte-orange-fond); }
.ligne-cuisson th { color: var(--cuisson-texte); text-align: left; }
.cuisson-valeurs { font-weight: 700; color: var(--cuisson-texte); font-size: 1.02rem; }
.cuisson-info { display: block; margin-top: 2px; font-weight: 700; color: var(--cuisson-texte); }
.ligne-poids-cuisson th, .ligne-poids-cuisson td { background: var(--cuisson-fond); font-weight: 600; }
/* Information : en gras, bleu (couleur du logo), centrée sur la recette */
.ligne-information th, .ligne-information td { background: var(--marine-clair); color: #fff; font-weight: 700; }
.ligne-information th { text-align: left; font-size: 0.85rem; }
.pesee-tableau tfoot th { text-align: left; }
.ligne-total th, .ligne-total td { background: var(--marine-pale); font-weight: 700; color: var(--marine); }
.ligne-cout th, .ligne-cout td { background: var(--surface-2); font-weight: 600; }
.colonne-temporaire { background: var(--marine-clair) !important; }
.retirer-colonne {
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.pesee-annexes { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 16px; }
@media (min-width: 900px) { .pesee-annexes { grid-template-columns: 1fr 1fr; } }
.pesee-annexes .bloc { margin-bottom: 0; }
.pesee-notes { margin: 0; white-space: pre-wrap; }
.titre-panneau { margin: 14px 0 8px; font-weight: 700; color: var(--marine); }
.panneau-fiche > .titre-panneau:first-child { margin-top: 0; }

/* Unités */
.choix-unite { display: flex; flex-direction: column; gap: 10px; }
.ligne-unite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 44px; }
.ligne-unite > span:nth-of-type(1) { min-width: 70px; font-weight: 600; }
.ligne-unite input[type=radio] { width: 18px; height: 18px; accent-color: var(--marine); }
.equivalence { display: inline-flex; align-items: center; gap: 8px; color: var(--texte-doux); }
.equivalence input { width: 110px; }

/* Tarifs */
.onglets-tarifs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.onglet-tarif {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--bordure);
  border-radius: 8px 8px 0 0;
  background: var(--fond);
  color: var(--texte);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.onglet-tarif.actif { background: var(--surface); border-color: var(--marine); border-bottom-width: 3px; color: var(--marine); }
.onglet-tarif-ajout { font-size: 1.2rem; }
.point-defaut { width: 7px; height: 7px; border-radius: 50%; background: var(--alerte-orange); }
.ligne-tarif-haut { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.interrupteur { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interrupteur-curseur {
  flex-shrink: 0;
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--bordure-forte);
  transition: background 0.15s;
}
.interrupteur-curseur::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 0.15s;
}
.interrupteur input:checked + .interrupteur-curseur { background: var(--fond-marine); }
.interrupteur input:checked + .interrupteur-curseur::after { transform: translateX(18px); }
.interrupteur input:focus-visible + .interrupteur-curseur { outline: 2px solid var(--marine); outline-offset: 2px; }
.grille-tarif { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
@media (min-width: 600px) { .grille-tarif { grid-template-columns: 1fr 1fr; } }
.champ-tarif { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.calcul-tarif {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--marine-pale);
}
.calcul-tarif strong { color: var(--marine); font-size: 1.15rem; }

/* Évolution des prix : tableau + graphique sur fond marine */
/* Graphique en haut (pleine largeur), tableau des prix en dessous */
.evolution { display: flex; flex-direction: column-reverse; gap: 14px; }
.tableau-prix { border: 1px solid var(--bordure); border-radius: 8px; }
.graphique-prix { min-height: 240px; padding: 12px; border-radius: 16px; background: var(--fond-marine); color: #fff; }
.graphique-prix svg { display: block; width: 100%; height: auto; }
.graphique-vide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 216px; text-align: center; color: var(--texte-sur-marine-doux); }
.graphique-grille { stroke: rgba(255, 255, 255, 0.15); stroke-width: 1; }
.graphique-texte { fill: var(--texte-sur-marine-doux); font-size: 12px; }
.graphique-titre { fill: #fff; font-size: 15px; font-weight: 700; }

/* Allergènes : pastilles à cocher */
.pastilles-allergenes { display: flex; flex-wrap: wrap; gap: 8px; }
.pastille-allergene {
  /* texte bien centré dans la pastille */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.pastille-allergene:hover:not(:disabled) { border-color: var(--marine); }
.pastille-allergene.actif { background: var(--fond-marine); border-color: var(--marine); color: #fff; font-weight: 600; }
#ing-traces .pastille-allergene.actif { background: var(--alerte-orange-fond); border-color: var(--alerte-orange); color: var(--cuisson-texte); }
.pastille-allergene:disabled { cursor: default; }

/* Nutrition + recherche CIQUAL */
.recherche-ciqual { position: relative; margin-bottom: 6px; }
.recherche-ciqual input { width: 100%; }
.ciqual-resultats {
  position: absolute;
  left: 0;
  right: 0;
  top: 46px;
  z-index: 5;
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(26, 33, 64, 0.15);
}
.ciqual-resultats button {
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ciqual-resultats button:hover { background: var(--marine-pale); }
.ciqual-resultats li.texte-doux, .ciqual-resultats li.texte-erreur { padding: 8px 10px; }
.grille-nutrition { display: grid; grid-template-columns: 1fr; gap: 8px 28px; }
@media (min-width: 700px) { .grille-nutrition { grid-template-columns: 1fr 1fr; } }
.ligne-nutrition { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.92rem; }
.valeur-nutrition { display: inline-flex; align-items: center; gap: 6px; }
.valeur-nutrition input { width: 90px; text-align: right; }

/* ==========================================================
   Réglages
   ========================================================== */
.bloc {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}
.bloc h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--marine); }

/* Cartes "fiche" : en-tête (titre ou identité + bouton à droite), grille libellé / valeur */
.fiche { padding: 20px; }
.fiche-entete {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.fiche-entete h2 { margin: 0; }
.fiche-entete .bouton { margin-left: auto; }
.fiche-identite { display: flex; flex-direction: column; min-width: 0; }
.fiche-identite strong { color: var(--marine); font-size: 1.05rem; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.fiche-grille {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 24px;
  margin: 16px 0 0;
}
.fiche-grille dt { font-weight: 700; font-size: 0.9rem; color: var(--marine); }
.fiche-grille dd { margin: 4px 0 0; overflow-wrap: anywhere; }
@media (min-width: 700px) { .fiche-grille { grid-template-columns: 1fr 1fr; } }

/* Bouton arrondi en "pilule" (style du bouton Déconnexion) */
.bouton-pilule { border-radius: 999px; padding: 0 16px; border-color: var(--bordure-forte); color: var(--marine); font-weight: 600; }
.bouton-pilule:hover { border-color: var(--marine); background: var(--marine-pale); }

.ligne-utilisateur .avatar { width: 36px; height: 36px; font-size: 0.8rem; }

.formulaire-ligne {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.formulaire-ligne input,
.formulaire-ligne select {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
}
.formulaire-ligne input { flex: 1 1 200px; min-width: 0; }
.champ-court { flex: 0 1 140px !important; }
.liste-reglages { list-style: none; margin: 12px 0 0; padding: 0; }
.ligne-reglage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--bordure);
}
.ligne-reglage-nom { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.champ-prenom-ligne,
.ligne-reglage select {
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 0.9rem;
}
.champ-prenom-ligne { width: 120px; }

/* ==========================================================
   Fenêtre d'ajout / modification d'un gâteau
   ========================================================== */
.dialogue {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: none;
  border-radius: var(--rayon);
  background: var(--surface);
  color: var(--texte);
}
.dialogue::backdrop { background: rgba(26, 33, 64, 0.5); }
.formulaire { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.formulaire h2 { margin: 0 0 4px; font-size: 1.2rem; color: var(--marine); }
.formulaire label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 600; }
.formulaire input,
.formulaire select,
.formulaire textarea {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-weight: 400;
  width: 100%;
}
.formulaire textarea { resize: vertical; }
.formulaire input:disabled { opacity: 0.4; }
.actions-formulaire { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Une ligne par taille dans le formulaire */
.tailles-formulaire {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
}
.tailles-formulaire legend { font-size: 0.9rem; font-weight: 600; padding: 0 4px; }
/* Grille : [nom du site] [quantité] [alerte] ; le prix prend les 2 dernières colonnes */
.ligne-formulaire-taille {
  display: grid;
  grid-template-columns: minmax(80px, auto) 1fr 1fr;
  align-items: end;
  gap: 6px 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bordure);
}
.site-formulaire {
  align-self: center;
  padding-top: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--marine);
}
.formulaire .champ-prix { grid-column: 2 / -1; }
.ligne-formulaire-taille:last-child { border-bottom: none; }
.formulaire .taille-nom {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.formulaire .taille-nom input { width: 22px; min-height: 22px; accent-color: var(--marine); }
.formulaire .mini-champ { font-weight: 400; font-size: 0.8rem; color: var(--texte-doux); }

/* ==========================================================
   Fenêtre de confirmation (aux couleurs de l'appli)
   ========================================================== */
.dialogue.dialogue-confirmation { width: min(420px, calc(100vw - 32px)); border-top: 5px solid var(--marine); }
.confirmation { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 22px 20px; text-align: center; }
.confirmation-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--alerte-rouge-fond);
  color: var(--alerte-rouge);
}
.confirmation-icone svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.confirmation h2 { margin: 4px 0 0; font-size: 1.15rem; color: var(--marine); overflow-wrap: anywhere; }
.confirmation p { margin: 0; color: var(--texte-doux); overflow-wrap: anywhere; }
.confirmation-saisie {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  font: inherit;
}
.confirmation-saisie:focus { outline: 2px solid var(--marine); outline-offset: 1px; }
/* Bouton de validation écrit en premier mais affiché à droite */
.confirmation-boutons { display: flex; flex-direction: row-reverse; justify-content: center; gap: 10px; width: 100%; margin-top: 8px; }
.confirmation-boutons .bouton { flex: 1; max-width: 170px; }
.bouton-supprimer { background: var(--alerte-rouge); border-color: var(--alerte-rouge); color: #fff; }
.bouton-supprimer:hover { background: #a61f1f; }

/* ==========================================================
   Notification temporaire en bas de l'écran
   ========================================================== */
.notification {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: var(--rayon);
  background: var(--fond-marine);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 33, 64, 0.25);
  z-index: 100;
}
.notification-erreur { background: var(--alerte-rouge); }

/* ==========================================================
   TÉLÉPHONE (moins de 700 px) : les tableaux deviennent des
   lignes empilées, faciles à lire et à toucher.
   ========================================================== */
@media (max-width: 699px) {
  .logo img, .logo svg { height: 34px; }
  /* Barre de pages en haut : plus compacte pour tenir sur la largeur */
  .onglets { gap: 4px; padding: 8px; }
  .onglets-haut, .onglets-bas { gap: 4px; }
  .onglet { min-height: 40px; padding: 0 9px; gap: 6px; font-size: 0.85rem; }
  .onglet svg { width: 18px; height: 18px; }
  /* Seule la page active affiche son nom ; les autres : icône seule */
  .onglet:not(.actif) .onglet-libelle { display: none; }
  .tableau thead { display: none; }
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; }
  .tableau td { border-top: none; padding: 4px 14px; }
  .tableau td:empty { display: none; }

  /* Stock : chaque ligne sur une grille "Nom   Prix   [Stock]" */
  .tableau-stock tr {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    column-gap: 10px;
    padding: 4px 0;
  }
  .tableau-stock td { background: none !important; }
  .tableau-stock tr.ligne-gateau { border-top: 2px solid var(--bordure); padding: 8px 0; }
  .tableau-stock tbody tr:first-child { border-top: none; }
  .tableau-stock tr.ligne-gateau.deplie { background: var(--surface-2); }
  .tableau-stock tr.ligne-taille { background: var(--surface-2); }
  .tableau-stock .col-actions { grid-column: 1 / -1; text-align: right; }
  .ligne-gateau .pastille,
  .ligne-taille .pastille { display: block; width: fit-content; margin: 2px 0 0 18px; }
  .nom-taille { padding-left: 18px; }
  .note-gateau { margin-left: 18px; }

  /* Historique : une "fiche" par mouvement */
  .tableau-historique tr { padding: 10px 0; border-top: 1px solid var(--bordure); }
  .tableau-historique tbody tr:first-child { border-top: none; }
  .tableau-historique td { padding: 2px 14px; }
  .historique-auteur { color: var(--texte-doux); font-size: 0.85rem; }
  .historique-auteur::before { content: "par "; }
}

/* ==========================================================
   ORDINATEUR (700 px et plus) : menu latéral bleu marine
   ========================================================== */
@media (min-width: 700px) {
  #ecran-appli {
    display: grid;
    grid-template-columns: 76px 1fr;          /* colonne d'icônes étroite */
    min-height: calc(100vh - 64px);
  }
  #ecran-appli.menu-large { grid-template-columns: var(--largeur-menu) 1fr; }
  #ecran-appli.sans-menu { grid-template-columns: 1fr; }

  /* La barre reste visible quand on fait défiler la page */
  .onglets {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    flex-direction: column;
    padding: 16px 14px;
    overflow: visible;
  }
  .onglets-haut, .onglets-bas { flex-direction: column; gap: 10px; }
  .onglets-bas { padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.15); }
  .onglet { width: 48px; height: 48px; padding: 0; justify-content: center; }
  .onglet-outil { display: inline-flex; }

  /* Barre étroite : seulement les icônes ; le nom apparaît au survol */
  #ecran-appli:not(.menu-large) .onglet-libelle { display: none; }
  #ecran-appli:not(.menu-large) .onglet:hover::after {
    content: attr(data-libelle);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--marine-fonce);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
  }

  /* Barre élargie : icône + nom */
  #ecran-appli.menu-large .onglet { width: 100%; justify-content: flex-start; padding: 0 12px; }

  .zone-pages { padding: 24px; }
  .logo img, .logo svg { height: 46px; }
}
#ecran-appli.sans-menu .onglets { display: none; }

/* Bouton Imprimer à droite, à côté de Modifier */
#pesee-imprimer { margin-left: auto; }
#pesee-imprimer + .bouton-principal { margin-left: 0; }

/* =====================================================================
   IMPRESSION de la fiche de pesée : A4 paysage, sans menu ni boutons
   ===================================================================== */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  /* Garder les couleurs de fond (bandeau, cuisson, information…) */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: var(--surface); }
  .entete, .onglets, .fil-ariane, .pesee-colonne-temp, #pesee-imprimer, #pesee-modifier,
  .choix-partie, #gateau-imprimer, #gateau-modifier, #gateau-edition,
  .poignee-colonne, .retirer-colonne, #notification { display: none !important; }
  #ecran-appli { display: block !important; }
  .zone-pages { padding: 0 !important; }
  .barre-titre { margin-bottom: 6px; }
  .pesee-resume-case, .bloc, .carte-tableau { box-shadow: none !important; }
  .carte-tableau { border: none !important; background: none !important; padding: 0 !important; }
  .pesee-cadre { overflow: visible; }
  .pesee-tableau { font-size: 0.85rem; }
  .pesee-tableau th, .pesee-tableau td { padding: 5px 8px; }
  .pesee-modifiable:hover { outline: none; }
  /* Une ligne du tableau n'est jamais coupée entre deux pages */
  .pesee-tableau tr, .pesee-annexes .bloc { break-inside: avoid; }
  .pesee-annexes { grid-template-columns: 1fr 1fr; }
}

/* Réglages : valeurs par défaut du prix de revient */
.grille-prix-revient { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: end; margin-top: 12px; }
@media (min-width: 700px) { .grille-prix-revient { grid-template-columns: 1fr 1fr; } }
.grille-prix-revient label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 700; color: var(--marine); }
.grille-prix-revient input {
  min-height: 40px;
  padding: 4px 10px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
}
.grille-prix-revient .bouton { justify-self: start; }

/* Fiche de pesée : bloc Prix de revient (sur toute la largeur) */
.pesee-bloc-prix { grid-column: 1 / -1; }
.tableau-prix-revient { width: 100%; border-collapse: collapse; }
.tableau-prix-revient th, .tableau-prix-revient td { padding: 7px 10px; border-bottom: 1px solid var(--bordure); text-align: left; }
.tableau-prix-revient th { width: 30%; color: var(--marine); font-weight: 600; }
.tableau-prix-revient .prix-montant { width: 20%; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau-prix-revient .prix-total > * { background: var(--marine-pale); font-weight: 700; color: var(--marine); }
.prix-reglage { display: inline-block; padding: 1px 4px; border-radius: 6px; }
.prix-reglage .pesee-saisie { width: 110px; }
.prix-reglage select.pesee-saisie { width: auto; max-width: 100%; }
.prix-defaut { color: var(--texte-doux); font-size: 0.8rem; }
.prix-ecart { color: var(--ok-texte); font-size: 0.85rem; }
.prix-ecart.negatif { color: var(--alerte-rouge); }

/* =====================================================================
   FICHES GÂTEAUX : deux parties (Montage / Fiche de vente) + modification
   ===================================================================== */
#gateau-imprimer { margin-left: auto; }
#gateau-imprimer + .bouton-principal { margin-left: 0; }
.choix-partie { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.partie-gateau {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: var(--surface);
  color: var(--marine);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.partie-gateau.actif { background: var(--fond-marine); border-color: var(--marine); color: #fff; }
.partie-fiche-gateau > * + * { margin-top: 14px; }
.tableau-gateau { width: 100%; }
.tableau-gateau .col-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau-gateau .ligne-incomplete td:first-child { color: var(--alerte-rouge); }
/* Fiche de vente : présentation soignée pour le client */
.fiche-vente { max-width: 760px; }
.fiche-vente h3 { margin: 18px 0 8px; font-size: 1rem; color: var(--marine); }
.vente-nom { margin: 0 0 8px; font-size: 1.6rem; color: var(--marine); }
.vente-description { margin: 0 0 10px; font-size: 1.05rem; white-space: pre-wrap; }
.vente-prix { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--marine); }
/* Modification */
.gateau-edition h3 { margin: 18px 0 8px; font-size: 1rem; color: var(--marine); }
.champ-gateau { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 0.9rem; font-weight: 700; color: var(--marine); }
.champ-gateau input, .champ-gateau textarea, .ged-ligne select, .ged-ligne input, .gateau-edition .grille-prix-revient select {
  min-width: 0;
  min-height: 40px;
  padding: 4px 10px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  color: var(--texte);
}
.champ-gateau textarea { resize: vertical; }
.ged-ligne { display: grid; grid-template-columns: 1fr 90px 130px auto; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 699px) { .ged-ligne { grid-template-columns: 1fr 1fr; } .ged-ligne .choix-ligne { grid-column: 1 / -1; } }
.ged-boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ged-boutons #ged-supprimer { margin-right: auto; }

/* Fiches gâteaux – Montage : un bloc repliable par recette (fiche de pesée) */
.gateau-composants { display: flex; flex-direction: column; gap: 14px; }
.composant { border: 1px solid var(--bordure); border-radius: 12px; background: var(--surface); overflow: hidden; }
.composant-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 14px;
  background: var(--marine-pale);
  color: var(--marine);
  cursor: pointer;
  list-style: none;
}
.composant-entete::-webkit-details-marker { display: none; }
/* Chevron : ouvert / replié */
.composant-entete::before { content: "▸"; font-size: 0.9rem; transition: transform 0.15s; }
.composant[open] > .composant-entete::before { transform: rotate(90deg); }
.composant-entete strong { font-size: 1.05rem; }
.composant-entete .composant-ouvrir { margin-left: auto; }
.composant > .carte-tableau { margin: 0; border: none; border-radius: 0; }
.tableau-decor { width: auto; min-width: 360px; }
.ged-deux { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 700px) { .ged-deux { grid-template-columns: 1fr 1fr; } }
@media print {
  .composant-entete { display: none !important; }
  .composant { border: none; break-inside: avoid; }
  .gateau-composants { gap: 10px; }
  #gateau-partie-montage .bloc, #gateau-resume { break-inside: avoid; }
}

/* =====================================================================
   FICHES GÂTEAUX – tableaux au modèle « SUPRÊME » (écran et impression)
   Nom de la recette dans la ligne d'en-tête ; cuisson sur deux lignes.
   ===================================================================== */
.pesee-tableau thead th.pesee-nom-recette { text-align: left; font-size: 1rem; text-transform: none; }
.ligne-cuisson-titres th { text-align: center !important; font-weight: 700; }
.ligne-cuisson-titres th:first-child { vertical-align: middle; }
.pesee-tableau .case-sombre { background: var(--marine-fonce) !important; }

/* =====================================================================
   IMPRESSION D'UNE FICHE GÂTEAU (Montage) : dimensions du modèle
   « SUPRÊME », couleurs de l'appli. La classe "impression-gateau" est
   posée sur <body> juste avant l'impression (gateaux.js).
   ===================================================================== */
.impression-gateau #vue-gateau .barre-titre, .impression-gateau #gateau-alerte,
.impression-gateau #gateau-resume, .impression-gateau #gateau-bloc-prix,
.impression-gateau .composant-entete, .impression-gateau #gateau-bloc-montage.vide,
.impression-gateau .pesee-tableau .ligne-cout, .impression-gateau .retirer-colonne,
.impression-gateau .poignee-colonne { display: none !important; }
.impression-gateau #gateau-partie-montage > * + * { margin-top: 26px; }
.impression-gateau .titre-impression {
  display: block !important;
  margin: 0 0 22px;
  color: var(--texte);
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.impression-gateau .gateau-composants { gap: 26px; }
.impression-gateau .composant, .impression-gateau .carte-tableau {
  overflow: visible;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
/* Toute la largeur ; proportions des colonnes du modèle */
.impression-gateau .pesee-tableau { width: 100% !important; table-layout: fixed; font-size: 10.5px; }
.impression-gateau .pesee-tableau col { width: auto !important; }
.impression-gateau .pesee-tableau col[data-cle="procede"] { width: 19% !important; }
.impression-gateau .pesee-tableau col[data-cle="ingredient"] { width: 20% !important; }
.impression-gateau .pesee-tableau col[data-cle="pourcent"] { width: 8% !important; }
.impression-gateau .pesee-tableau th, .impression-gateau .pesee-tableau td {
  padding: 3px 5px !important;
  font-size: 10.5px !important;
  line-height: 1.25;
  outline: none !important;
}
.impression-gateau .pesee-tableau thead th.pesee-nom-recette { font-size: 10.5px !important; }
.impression-gateau .pesee-tableau .cuisson-valeurs, .impression-gateau .pesee-tableau .cuisson-info { font-size: 10.5px; }
.impression-gateau .pesee-tableau .pesee-pourcent { color: var(--texte); }
.impression-gateau .tableau-decor { min-width: 0; }
.impression-gateau #gateau-bloc-montage { padding: 0; border: none; box-shadow: none; font-size: 10.5px; }
.impression-gateau #gateau-bloc-montage h2 { margin: 0 0 4px; font-size: 12px; }
@media print {
  .impression-gateau .composant, .impression-gateau .pesee-tableau tr { break-inside: avoid; }
}

/* Importer une facture (Mercuriale, admin) */
.facture-etat { margin: 10px 0 0; font-weight: 600; color: var(--marine); }
.tableau-facture { width: 100%; }
.tableau-facture td { vertical-align: top; }
.tableau-facture select, .tableau-facture input {
  min-height: 36px;
  padding: 2px 8px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  font: inherit;
  max-width: 100%;
}
.tableau-facture .facture-nom-nouveau { display: block; width: 100%; margin-top: 6px; }
.facture-conditionnement { white-space: nowrap; }
.facture-conditionnement input { width: 70px; margin-right: 4px; }
.facture-prix { width: 90px; text-align: right; }
.facture-ref { font-size: 0.8rem; }
.facture-ignoree td { opacity: 0.5; }
.facture-bloc + .facture-bloc { margin-top: 22px; padding-top: 16px; border-top: 2px solid var(--bordure); }
.facture-bloc h3 { margin: 0 0 8px; color: var(--marine); font-size: 1rem; }
.facture-detail { display: block; margin-top: 4px; font-size: 0.78rem; color: var(--texte-doux); }
.facture-a-verifier { display: block; margin-top: 4px; font-size: 0.8rem; font-weight: 700; color: var(--alerte-rouge); }
.facture-a-part { display: block; margin-top: 6px; }
.tableau-facture .facture-categorie { display: block; width: 100%; margin-top: 6px; }
/* Colonne « Prix (et avant) » : le texte passe à la ligne au lieu de sortir du cadre */
.facture-comparaison { white-space: normal; min-width: 180px; max-width: 260px; }
.facture-comparaison .facture-detail { white-space: normal; }
/* Si le tableau reste trop large (petit écran) : il défile sur le côté, dans le cadre */
#facture-blocs .carte-tableau { overflow-x: auto; }
.tableau-facture td:first-child { min-width: 150px; }
/* Titres de colonnes sur 2 lignes si besoin (sinon « PRIX HT DU CONDITIONNEMENT » élargit trop le tableau) */
.tableau-facture th { white-space: normal; vertical-align: bottom; }
.facture-ancien { color: var(--texte-doux); text-decoration: line-through; }
.facture-ecart { font-weight: 700; color: var(--texte-doux); }
.facture-ecart.hausse { color: var(--alerte-rouge); }
.facture-ecart.baisse { color: var(--ok-texte); }
.facture-date input { max-width: 200px; }
/* Prix au kilo / litre / pièce : bien visible (étiquette bleu clair) */
.prix-unitaire {
  display: inline-block;
  width: fit-content;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--marine-pale);
  color: var(--marine);
  font-size: 1rem;
  font-weight: 700;
}
.facture-comparaison .prix-unitaire { display: table; }
.carte-fiche-prix { display: flex; flex-direction: column; align-items: flex-start; }
/* Prix du conditionnement (lot, carton…) : plus petit que le prix au kilo */
.prix-conditionnement { display: block; font-size: 0.82rem; font-weight: 600; }

/* Fiche fournisseur */
.lien-fournisseur { color: var(--marine); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.lien-fournisseur:hover, .lien-fournisseur:focus-visible { color: var(--marine-fonce); outline: none; }
.fournisseur-prochaine { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--marine-pale); color: var(--marine); font-weight: 700; }
.fournisseur-grille { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .fournisseur-grille { grid-template-columns: 1fr 1fr; } }
.fournisseur-grille label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 700; color: var(--marine); }
.fournisseur-grille input, .fournisseur-grille textarea {
  min-height: 38px; padding: 4px 10px; border: 1px solid var(--bordure); border-radius: 8px; font: inherit; font-weight: 400; color: var(--texte);
}
.fournisseur-large { grid-column: 1 / -1; }
.fournisseur-bloc { margin: 0; padding: 10px 12px; border: 1px solid var(--bordure); border-radius: 10px; }
.fournisseur-bloc legend { padding: 0 4px; font-weight: 700; color: var(--marine); }
.choix-jours { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.case-jour { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--bordure); border-radius: 999px; font-weight: 600 !important; cursor: pointer; }
.case-jour:has(input:checked) { background: var(--fond-marine); border-color: var(--marine); color: #fff; }
.fournisseur-liens { display: flex; gap: 8px; margin: 12px 0 0; }
.fournisseur-liens:empty { display: none; }
.tableau-fournisseur { width: 100%; }
.ligne-cliquable { cursor: pointer; }
.ligne-cliquable:hover td { background: var(--marine-pale); }
.facture-ciqual { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 0.8rem; color: var(--texte-doux); white-space: normal; }

/* Import de recette (photo) : un groupe = procédé + tableau des ingrédients */
.rp-groupe { margin: 12px 0; padding-left: 10px; border-left: 3px solid var(--marine); }
.rp-cuisson, .rp-information { margin: 8px 0; font-weight: 600; color: var(--marine); }

/* Coût matière de la fiche de pesée repliable (le poids total reste visible) */
.totaux-replies .ligne-cout { display: none; }
.ligne-repli td { padding: 0; background: var(--surface-2); }
.bouton-repli { width: 100%; padding: 6px 12px; border: 0; background: none; text-align: left; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--marine); cursor: pointer; }
.bouton-repli:hover { text-decoration: underline; }
@media print { .ligne-repli { display: none; } }


/* ===== Page de bienvenue : grandes tuiles, sans barre de gauche ===== */
#ecran-appli.sur-accueil .onglets { display: none; }
@media (min-width: 700px) { #ecran-appli.sur-accueil { grid-template-columns: 1fr; } }
.accueil { max-width: 820px; margin: 6vh auto 0; padding: 0 16px; text-align: center; }
.accueil-sur-titre { margin: 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--texte-doux); }
.accueil-titre { margin: 6px 0 4px; font-size: 2rem; color: var(--marine); }
.accueil-tuiles { justify-content: center; margin: 28px 0 22px; gap: 20px; }
.tuile-accueil { width: 230px; height: 210px; padding: 16px; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.tuile-accueil:hover, .tuile-accueil:focus-visible { transform: translateY(-3px); }
.tuile-accueil .tuile-icone { width: 64px; height: 64px; border-radius: 18px; }
.tuile-accueil .tuile-icone svg { width: 34px; height: 34px; }
.tuile-texte { font-size: 0.82rem; color: var(--texte-doux); line-height: 1.3; }
.logo a { display: inline-block; border-radius: 8px; }
@media (max-width: 699px) {
  .accueil-tuiles { flex-direction: column; align-items: stretch; }
  .tuile-accueil { width: 100%; height: auto; flex-direction: row; justify-content: flex-start; text-align: left; flex-wrap: wrap; column-gap: 14px; }
  .tuile-accueil .tuile-texte { flex-basis: 100%; padding-left: 78px; margin-top: -14px; }
}

/* ===== Cases modifiables : une surbrillance douce au lieu du pointillé ===== */
.pesee-modifiable { transition: box-shadow 0.12s; }
.pesee-modifiable:hover, .pesee-modifiable:focus-visible {
  outline: none;
  /* voile PAR-DESSUS la couleur de la case (fond bleu, cuisson…) : la couleur reste visible */
  background-image: linear-gradient(rgba(35, 44, 77, 0.07), rgba(35, 44, 77, 0.07));
  box-shadow: inset 0 0 0 2px rgba(35, 44, 77, 0.22);
}
.ligne-information .pesee-modifiable:hover, .pesee-bandeau .pesee-modifiable:hover,
.ligne-information .pesee-modifiable:focus-visible, .pesee-bandeau .pesee-modifiable:focus-visible,
.pesee-modele-gateau thead .pesee-modifiable:hover {
  background-image: linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
/* Case en cours de saisie */
.pesee-modifiable:has(.pesee-saisie) { background-image: linear-gradient(rgba(35, 44, 77, 0.07), rgba(35, 44, 77, 0.07)); box-shadow: inset 0 0 0 2px var(--marine); }
.pesee-saisie { border: 1px solid var(--bordure-forte); border-radius: 8px; padding: 4px 8px; }
.pesee-saisie:focus { outline: none; border-color: var(--marine); box-shadow: 0 0 0 3px rgba(35, 44, 77, 0.15); }

/* ===== Choix d'un ingrédient : bouton (formulaires) + fenêtre « Choisir un ingrédient » ===== */
.choix-ligne { position: relative; }
.choix-bouton {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 38px; padding: 6px 12px;
  border: 1px solid var(--bordure-forte); border-radius: 10px; background: var(--surface);
  color: var(--texte); font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.choix-bouton:hover { border-color: var(--marine); }
.choix-bouton:focus-visible { outline: none; border-color: var(--marine); box-shadow: 0 0 0 3px rgba(35, 44, 77, 0.15); }
.choix-bouton-texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix-chevron { flex-shrink: 0; width: 8px; height: 8px; margin-top: -4px; border-right: 2px solid var(--marine); border-bottom: 2px solid var(--marine); transform: rotate(45deg); }

/* Tableau de calcul du coût (Éléments | Calcul | Montant) */
.tableau-prix-revient thead th { padding-top: 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-doux); border-bottom: 2px solid var(--bordure); }

/* Fenêtre « Modifier la recette » : la composition prend toute la largeur,
   le bandeau (numéro, statut, catégorie, rendement, colonnes, résumé) passe EN BAS */
.rec-mise-en-page { display: flex; flex-direction: column-reverse; }
.rec-mise-en-page > * { width: 100%; align-self: stretch; }
.rec-mise-en-page .fiche-ingredient-cote {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: start;
}
.rec-mise-en-page .resume-cout { grid-column: span 2; }
@media (max-width: 499px) { .rec-mise-en-page .resume-cout { grid-column: auto; } }

/* ===== Fenêtre « Choisir un ingrédient » (onglets, catégories, A–Z, liste) ===== */
.dialogue.choix-dialogue[open] {
  display: flex; flex-direction: column;
  width: min(980px, calc(100vw - 24px)); height: min(680px, calc(100vh - 24px)); overflow: hidden;
}
.choix-entete { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--fond-marine); color: #fff; }
.choix-entete h2 { margin: 0; font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; }
.choix-fermer {
  width: 32px; height: 32px; border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 50%;
  background: none; color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.choix-fermer:hover, .choix-fermer:focus-visible { background: rgba(255, 255, 255, 0.15); outline: none; }
.choix-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--bordure); }
.choix-onglets { display: inline-flex; padding: 3px; border: 1px solid var(--bordure); border-radius: 12px; background: var(--fond); }
.choix-onglet {
  padding: 7px 16px; border: 1px solid transparent; border-radius: 9px;
  background: none; color: var(--texte); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.choix-onglet.actif { border-color: var(--marine); background: var(--surface); color: var(--marine); box-shadow: 0 1px 4px rgba(35, 44, 77, 0.12); }
.choix-recherche {
  flex: 1; min-width: 180px; padding: 9px 14px 9px 38px;
  border: 1px solid var(--bordure-forte); border-radius: 12px; font: inherit; font-size: 0.92rem;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23232c4d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 13px center / 16px;
}
.choix-recherche:focus { outline: none; border-color: var(--marine); background-color: var(--surface); box-shadow: 0 0 0 3px rgba(35, 44, 77, 0.15); }
.choix-corps { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px 1fr; }
.choix-cote { overflow-y: auto; padding: 12px; border-right: 1px solid var(--bordure); background: var(--fond); }
.choix-cote-titre { margin: 2px 6px 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--texte-doux); }
.choix-categories { display: flex; flex-direction: column; gap: 2px; }
.choix-categorie {
  display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px;
  border: none; border-radius: 8px; background: none; color: var(--texte); font: inherit; font-size: 0.88rem; text-align: left; cursor: pointer;
}
.choix-categorie:hover { background: var(--marine-pale); }
.choix-categorie.actif { background: var(--fond-marine); color: #fff; }
.choix-nombre { font-size: 0.78rem; opacity: 0.7; }
.choix-principal { display: flex; flex-direction: column; min-height: 0; padding: 10px 16px 0; }
.choix-compte { margin: 0 0 6px; font-size: 0.9rem; color: var(--marine); }
.choix-lettres { display: flex; flex-wrap: wrap; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--bordure); }
.choix-lettre {
  width: 24px; height: 24px; border: none; border-radius: 50%;
  background: none; color: var(--marine); font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.choix-lettre:hover:not(:disabled) { background: var(--marine-pale); }
.choix-lettre.actif { background: var(--fond-marine); color: #fff; }
.choix-lettre:disabled { color: var(--bordure-forte); cursor: default; }
.choix-liste { flex: 1; min-height: 0; overflow-y: auto; }
.choix-option {
  display: grid; grid-template-columns: 22px 1fr auto 90px; align-items: center; gap: 10px;
  padding: 10px 8px; border-bottom: 1px solid var(--bordure); cursor: pointer; font-size: 0.93rem;
}
.choix-option:hover { background: var(--surface-2); }
.choix-option.choisi { background: var(--marine-pale); }
.choix-option.choisi .choix-nom { font-weight: 700; color: var(--marine); }
.choix-radio { width: 18px; height: 18px; border: 2px solid var(--bordure-forte); border-radius: 50%; background: var(--surface); }
.choix-option.choisi .choix-radio { border: 5px solid var(--marine); }
.choix-pastille { padding: 2px 8px; border-radius: 999px; background: var(--fond); color: var(--texte-doux); font-size: 0.74rem; white-space: nowrap; }
.choix-info { font-size: 0.8rem; color: var(--texte-doux); text-align: right; white-space: nowrap; }
.choix-vide { padding: 20px 8px; color: var(--texte-doux); }
.choix-pied { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--bordure); background: var(--fond); }
@media (max-width: 699px) {
  .choix-corps { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .choix-cote { border-right: none; border-bottom: 1px solid var(--bordure); padding: 8px; }
  .choix-cote-titre { display: none; }
  .choix-categories { flex-direction: row; overflow-x: auto; }
  .choix-categorie { flex-shrink: 0; }
  .choix-option { grid-template-columns: 22px 1fr auto; }
  .choix-info { display: none; }
}

/* Fenêtre « Modifier la recette » : cases de quantité plus larges (ex. 68 597,5) */
.quantite-ligne input { width: 120px; }

/* Barre « Ajouter une colonne » : une pastille champ + unité + bouton */
.pesee-colonne-temp { gap: 12px; padding: 10px 14px; border: 1px solid var(--bordure); border-radius: 14px; background: var(--surface); }
.colonne-temp-titre { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--marine); }
.groupe-saisie {
  display: inline-flex; align-items: center; overflow: hidden;
  border: 1px solid var(--bordure-forte); border-radius: 999px; background: var(--surface);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.groupe-saisie:focus-within { border-color: var(--marine); box-shadow: 0 0 0 3px rgba(35, 44, 77, 0.15); }
.pesee-colonne-temp .groupe-saisie input {
  width: 80px; min-height: 34px; padding: 4px 4px 4px 16px; border: none; border-radius: 0; background: none; outline: none; text-align: right;
}
.groupe-saisie #pesee-unite-colonne { padding: 0 10px 0 6px; }
.groupe-saisie-bouton {
  align-self: stretch; padding: 0 16px; border: none; background: var(--fond-marine); color: #fff;
  font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.groupe-saisie-bouton:hover, .groupe-saisie-bouton:focus-visible { background: #34406b; outline: none; }
.aide-colonnes { font-size: 0.8rem; }

/* Bouton avec icône (ex. « Importer une photo ») */
.bouton-icone-texte { display: inline-flex; align-items: center; gap: 8px; }
.bouton-icone-texte svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Import de recette : zone de dépôt ===== */
.zone-depot {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 36px 20px; border: 2px dashed var(--bordure-forte); border-radius: 18px;
  background: var(--surface); text-align: center; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.zone-depot:hover, .zone-depot:focus-within, .zone-depot.survol { border-color: var(--marine); background: var(--marine-pale); }
.zone-depot.survol { transform: scale(1.01); }
.zone-depot-icone {
  display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 4px;
  border-radius: 18px; background: linear-gradient(135deg, var(--fond-marine-clair), var(--fond-marine)); color: #fff;
  box-shadow: 0 8px 20px rgba(35, 44, 77, 0.25);
}
.zone-depot-icone svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zone-depot-titre { font-size: 1.1rem; color: var(--marine); }
.zone-depot-texte { color: var(--texte); font-size: 0.92rem; }
.zone-depot-texte u { color: var(--marine); font-weight: 600; text-underline-offset: 3px; }
.zone-depot-astuce { font-size: 0.8rem; color: var(--texte-doux); }
.zone-depot kbd { padding: 1px 6px; border: 1px solid var(--bordure-forte); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); font: inherit; font-size: 0.75rem; }
.etapes-import { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 16px 0 6px; padding: 0; list-style: none; font-size: 0.85rem; color: var(--texte); }
.etapes-import li { display: inline-flex; align-items: center; gap: 8px; }
.etapes-import span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--marine-pale); color: var(--marine); font-size: 0.75rem; font-weight: 700; }
.note-import { margin: 6px 0 0; text-align: center; font-size: 0.8rem; }
/* Lecture en cours : pastille avec un petit indicateur qui tourne */
.etat-import { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px auto 0; padding: 10px 16px; border-radius: 999px; background: var(--marine-pale); color: var(--marine); font-weight: 600; width: fit-content; max-width: 100%; }
.etat-import:not(.texte-erreur)::before { content: ""; width: 16px; height: 16px; border: 2px solid rgba(35, 44, 77, 0.25); border-top-color: var(--marine); border-radius: 50%; animation: tourner 0.8s linear infinite; flex-shrink: 0; }
.etat-import.texte-erreur { background: var(--alerte-rouge-fond); }
@keyframes tourner { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .etat-import::before { animation: none; } }

/* Pastilles d'icône des tuiles : léger dégradé + ombre (plus moderne) */
.tuile-icone { background: linear-gradient(135deg, var(--fond-marine-clair), var(--fond-marine)); box-shadow: 0 6px 16px rgba(35, 44, 77, 0.22); }
.tuile-icone svg { stroke-width: 1.7; }

/* Fiche fournisseur : contenu sous le bandeau */
.fournisseur-corps { display: flex; flex-direction: column; gap: 12px; min-height: 0; background: var(--surface); }
/* Les blocs ne se tassent pas : c'est la zone entière qui défile (sinon le tableau était coupé) */
.fournisseur-corps > * { flex-shrink: 0; }
.fournisseur-corps h3 { margin: 8px 0 0; }

/* ===== Import des factures : vérifications et mémoire ===== */
.facture-controles { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.controle { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 0.86rem; font-weight: 600; }
.controle-ok { background: var(--ok-fond); color: var(--ok-texte); }
.controle-alerte { background: var(--alerte-rouge-fond); color: var(--alerte-rouge); }
.controle-neutre { background: var(--fond); color: var(--texte-doux); }
.facture-ligne-alerte td { background: var(--alerte-rouge-fond); }
.facture-ligne-alerte td:first-child { box-shadow: inset 4px 0 0 var(--alerte-rouge); }
.pastille-memoire { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--ok-fond); color: var(--ok-texte); font-size: 0.72rem; font-weight: 700; vertical-align: middle; }

/* Bandeau « Nouvelle version disponible » (mise à jour automatique) */
.bandeau-mise-a-jour {
  position: fixed; z-index: 1000; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 10px 12px 10px 18px;
  border-radius: 999px; background: var(--fond-marine); color: #fff; box-shadow: 0 10px 28px rgba(35, 44, 77, 0.35);
  font-size: 0.9rem; font-weight: 600;
}
.bandeau-mise-a-jour .bouton { background: var(--surface); color: var(--marine); border-color: #fff; }
@media print { .bandeau-mise-a-jour { display: none; } }

/* ===== Liste de commandes (Recettes > Commandes) ===== */
.barre-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.commande-ajout { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.commande-ajout select { min-height: 38px; min-width: 260px; max-width: 100%; padding: 4px 10px; border: 1px solid var(--bordure-forte); border-radius: 10px; font: inherit; background: var(--surface); }
.commande-ajout .groupe-saisie input { width: 80px; min-height: 34px; padding: 4px 4px 4px 16px; border: none; background: none; outline: none; text-align: right; font: inherit; }
.commande-ajout #commande-unite { padding: 0 10px 0 6px; }
.commande-liste-production { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.commande-liste-production li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--fond); }
.commande-liste-production input { width: 80px; padding: 4px 8px; border: 1px solid var(--bordure-forte); border-radius: 8px; font: inherit; text-align: right; }
.commande-liste-production .retirer-colonne { margin-left: auto; }
.commande-resume { margin: 0 0 12px; font-weight: 600; color: var(--marine); }
.commande-bloc { margin-top: 14px; }
.commande-entete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.commande-entete h3 { margin: 0; font-size: 1.1rem; color: var(--marine); }
.commande-sous-total { font-size: 1.05rem; color: var(--marine); white-space: nowrap; }
.commande-date { margin: 6px 0 0; font-weight: 600; }
.commande-franco { margin: 4px 0 0; font-size: 0.86rem; color: var(--ok-texte); }
.commande-franco.sous-minimum { color: var(--alerte-rouge); font-weight: 600; }
.commande-bloc .carte-tableau { margin-top: 10px; overflow-x: auto; }
.tableau-commande td, .tableau-commande th { vertical-align: top; }
.commande-total { margin: 18px 0; font-size: 1.1rem; text-align: right; }
.commande-historique { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.commande-historique li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--bordure); }
.commande-historique .retirer-colonne { margin-left: auto; }
.lien-commande { padding: 0; border: none; background: none; color: var(--marine); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
@media print {
  .pas-imprimer { display: none !important; }
  #vue-commandes .commande-bloc { break-inside: avoid; box-shadow: none; }
}

/* ===== Fiche allergènes pour la vitrine ===== */
.allergenes-cadre { overflow-x: auto; }
.allergenes-tableau { width: 100%; border-collapse: collapse; }
.allergenes-tableau th, .allergenes-tableau td { border: 1px solid var(--bordure); }
.allergenes-tableau tbody th { padding: 8px 10px; text-align: left; font-size: 0.95rem; font-weight: 600; white-space: nowrap; text-transform: none; letter-spacing: normal; color: var(--texte); background: none; }
.allergenes-tableau tbody th label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
/* Titres des 14 allergènes écrits à la verticale : le tableau tient sur une page */
.allergene-titre { height: 120px; padding: 6px 2px; vertical-align: bottom; }
.allergene-titre span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 0.82rem; }
.allergene-case { width: 44px; text-align: center; font-size: 1.15rem; }
.allergene-present { color: var(--marine); font-weight: 700; }
.allergene-traces { color: var(--texte-doux); }
.allergenes-tableau tbody tr:nth-child(even) { background: var(--surface-2); }
.allergenes-exclu { opacity: 0.4; }
.allergenes-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 12px 0 4px; }
.allergenes-legende .allergene-present, .allergenes-legende .allergene-traces { font-size: 1.1rem; }
.allergenes-mention { margin: 0; font-size: 0.82rem; color: var(--texte-doux); }
@media print {
  .impression-allergenes .allergenes-exclu { display: none; }
  .impression-allergenes .allergenes-tableau { font-size: 11px; }
  .impression-allergenes .allergenes-tableau tr { break-inside: avoid; }
  .impression-allergenes .allergenes-tableau tbody tr:nth-child(even) { background: #f2f3f7; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Fiche de vente : prix d'une part */
.vente-part { margin: -6px 0 8px; font-weight: 600; color: var(--marine); }

/* ===== Hausses de prix ===== */
#hausses-periode { min-height: 38px; padding: 4px 10px; border: 1px solid var(--bordure-forte); border-radius: 10px; font: inherit; background: var(--surface); }
.tableau-hausses .hausse { color: var(--alerte-rouge); }
.tableau-hausses .baisse { color: var(--ok-texte); }
.tableau-hausses td { white-space: nowrap; }
.tableau-hausses td:first-child { white-space: normal; }

/* Fiche gâteau : sur petit écran, le tableau d'une recette défile sur le côté au lieu d'être coupé */
@media screen { .pesee-cadre.composant { overflow-x: auto; } }

/* =====================================================================
   MODE SOMBRE (Réglages ou menu du compte : Automatique / Clair / Sombre)
   Même direction artistique : bleu nuit du logo, accents bleu clair.
   L'attribut data-theme="sombre" est posé sur <html> (voir index.html).
   Seulement à l'écran : l'impression reste en clair.
   ===================================================================== */
@media screen {
  :root[data-theme="sombre"] {
    color-scheme: dark;
    --marine: #aeb9ec;            /* texte « marine » : bleu clair lisible sur fond sombre */
    --marine-fonce: #1c2347;
    --marine-clair: #36427a;
    --marine-pale: #252c45;
    --fond-marine: #2b3563;
    --fond-marine-clair: #3d4a85;
    --fond: #11141f;
    --surface: #1a1f2e;
    --surface-2: #20263a;
    --surface-3: #272e46;
    --texte: #e6e9f2;
    --texte-doux: #9aa2b8;
    --bordure: #2c3350;
    --bordure-forte: #434c6c;
    --alerte-orange-fond: #3a2c14;
    --alerte-rouge: #ff8a80;
    --alerte-rouge-fond: #3b1d20;
    --ok-vert: #7fd894;
    --ok-fond: #17301f;
    --ok-texte: #8ee0a2;
    --cuisson-texte: #f2b766;
    --cuisson-fond: #2e2416;
    --ombre: 0 1px 3px rgba(0, 0, 0, 0.45);
  }
  /* Loupe des champs de recherche en bleu clair */
  :root[data-theme="sombre"] .choix-recherche {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aeb9ec' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  }
  /* Champs et listes : fond sombre, texte clair */
  :root[data-theme="sombre"] input, :root[data-theme="sombre"] select, :root[data-theme="sombre"] textarea {
    background-color: var(--surface); color: var(--texte); border-color: var(--bordure-forte);
  }
  :root[data-theme="sombre"] .pastille-memoire { background: var(--ok-fond); color: var(--ok-texte); }
}

/* Bouton du thème (menu du compte) */
.bouton-theme { width: 100%; justify-content: center; }

/* Prix fantôme : estimation en attendant une facture (italique, discret) */
.prix-fantome { font-style: italic; color: var(--texte-doux); }
.prix-fantome-champ { display: grid; gap: 4px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--bordure); font-weight: 600; }
.prix-fantome-champ input { width: 110px; }

/* =====================================================================
   PAGE D'ACCUEIL PUBLIQUE (écran de connexion) : présentation de Kookio
   ===================================================================== */
.vitrine { max-width: 1040px; margin: 0 auto; padding: 40px 16px 56px; }
.vitrine-haut { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.vitrine-titre { margin: 8px 0 12px; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; color: var(--marine); }
.vitrine-intro { font-size: 1.05rem; line-height: 1.6; color: var(--texte); margin: 0 0 24px; }
.vitrine-bouton { font-size: 1rem; padding: 12px 22px; }
/* Sommaire : 6 cartes cliquables (défilement vers la démonstration) */
.vitrine-atouts {
  list-style: none; margin: 0 0 24px; padding: 0;
  display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr);
}
.vitrine-atouts a {
  display: block; height: 100%; padding: 14px 16px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
  box-shadow: var(--ombre); transition: transform 0.15s, border-color 0.15s;
}
.vitrine-atouts a:hover, .vitrine-atouts a:focus-visible { transform: translateY(-2px); border-color: var(--marine); }
.vitrine-atouts h3 { margin: 4px 0; font-size: 0.98rem; color: var(--marine); }
.vitrine-atouts p { margin: 0; font-size: 0.85rem; line-height: 1.4; color: var(--texte-doux); }
.vitrine-num { font-weight: 800; font-size: 0.8rem; letter-spacing: 0.08em; color: var(--alerte-orange); }

/* Une fonction = texte + démonstration, côte à côte (alternés), empilés sur téléphone */
.vitrine-section {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center;
  padding: 48px 0; border-top: 1px solid var(--bordure); scroll-margin-top: 16px;
}
.vitrine-section.inverse .vitrine-texte { order: 2; }
.vitrine-etiquette { margin: 0 0 6px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--texte-doux); }
.vitrine-texte h3 { margin: 0 0 12px; font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.25; color: var(--marine); }
.vitrine-texte > p { margin: 0 0 16px; line-height: 1.6; color: var(--texte); }
.vitrine-points { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.vitrine-points li {
  padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; background: var(--marine-pale); color: var(--marine);
}
@media (max-width: 760px) {
  .vitrine-atouts { grid-template-columns: repeat(2, 1fr); }
  .vitrine-section { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
  .vitrine-section.inverse .vitrine-texte { order: 0; }
}

/* ---------------------------------------------------------------------
   Démonstrations animées (vitrine.js) : une fenêtre d'appli posée sur un
   fond coloré, légèrement inclinée, avec curseur, chiffres qui défilent et
   barre de lecture comme une vidéo.
   --------------------------------------------------------------------- */
.demo-scene {
  position: relative; padding: 34px 26px 18px; border-radius: 26px; isolation: isolate; perspective: 1400px;
  background:
    radial-gradient(circle at 12% 18%, rgba(232, 150, 46, 0.30), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(58, 70, 119, 0.32), transparent 48%),
    linear-gradient(135deg, var(--marine-pale), var(--surface-2));
  border: 1px solid var(--bordure);
}
.demo-scene::before, .demo-scene::after {   /* deux pastilles décoratives qui flottent */
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(2px);
  animation: demo-flotte 7s ease-in-out infinite;
}
.demo-scene::before { width: 70px; height: 70px; top: -18px; right: 14%; background: rgba(232, 150, 46, 0.35); }
.demo-scene::after { width: 46px; height: 46px; bottom: 40px; left: -14px; background: rgba(58, 70, 119, 0.35); animation-delay: -3s; }
@keyframes demo-flotte { 50% { transform: translateY(-10px); } }
.demo-legende { margin: 14px 4px 0; font-size: 0.78rem; color: var(--texte-doux); text-align: center; }

.demo {
  position: relative; margin: 0; padding: 0 0 22px; min-height: 330px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 16px;
  box-shadow: 0 2px 4px rgba(20, 26, 50, 0.06), 0 24px 48px -12px rgba(20, 26, 50, 0.35);
  transform: rotateY(-7deg) rotateX(3deg); transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(.2, .8, .2, 1);
  animation: demo-flotte-fenetre 8s ease-in-out infinite;   /* « translate » : ne remplace pas l inclinaison */
}
@keyframes demo-flotte-fenetre { 50% { translate: 0 -8px; } }
.vitrine-section.inverse .demo { transform: rotateY(7deg) rotateX(3deg); }
.demo-scene:hover .demo { transform: none; }
.demo-barre {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 14px 11px 58px;
  font-weight: 700; font-size: 0.9rem; color: var(--principal-texte);
  background: linear-gradient(180deg, var(--fond-marine-clair), var(--fond-marine));
}
.demo-barre::before {   /* trois points de fenêtre */
  content: ""; position: absolute; left: 15px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
  background: #ff6b5f; box-shadow: 14px 0 0 #ffbd2e, 28px 0 0 #28c840;
}
.demo-badge {
  margin-left: auto; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  background: rgba(255, 255, 255, 0.16); color: var(--texte-sur-marine-doux);
}
.demo-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px 0; }
.demo-bouton {
  padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 700; cursor: default;
  border: 1px solid var(--bordure-forte); color: var(--marine); background: var(--surface);
  transition: transform 0.15s, box-shadow 0.15s;
}
.demo-bouton.principal { margin-left: auto; border-color: transparent; background: var(--fond-marine); color: var(--principal-texte); }
.demo-appui { transform: scale(0.94); box-shadow: 0 0 0 4px rgba(232, 150, 46, 0.35); }
.demo-puce { padding: 5px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--marine-pale); color: var(--marine); }

/* Apparitions : léger rebond ; disparition : fondu */
.demo [data-a] { transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.34, 1.56, .64, 1), filter 0.5s; }
.demo .demo-cache { opacity: 0; transform: translateY(10px) scale(0.97); filter: blur(2px); }
.demo td.demo-cache, .demo th.demo-cache, .demo tr.demo-cache { transform: none; filter: none; }
.demo .demo-parti, .demo td > span.demo-cache { display: none; }   /* parti / chiffre remplacé : pas de place réservée */
.demo-eclat { animation: demo-eclat 1.2s ease-out; }
@keyframes demo-eclat { 0% { background-color: rgba(232, 150, 46, 0.45); } 100% { background-color: transparent; } }

/* Curseur : flèche qui rejoint le bouton, puis onde du clic */
.demo-curseur {
  position: absolute; z-index: 5; left: 85%; top: 85%; width: 22px; height: 22px; pointer-events: none;
  transition: left 0.75s cubic-bezier(.65, 0, .35, 1), top 0.75s cubic-bezier(.65, 0, .35, 1), opacity 0.4s;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-6.5 1.2L16 21l-3 1.4-3.6-6.8L4 20z' fill='%23111' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));
}
.demo-curseur.repos { opacity: 0; }
.demo-curseur::after {
  content: ""; position: absolute; left: -9px; top: -9px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--alerte-orange); opacity: 0;
}
.demo-curseur.clic::after { animation: demo-onde 0.6s ease-out; }
@keyframes demo-onde { 0% { opacity: 1; transform: scale(0.3); } 100% { opacity: 0; transform: scale(2.2); } }

/* Barre de lecture (comme une vidéo) */
.demo-progression { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--surface-3); }
.demo-progression span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--alerte-orange), #f2b766); }

/* Contenus */
.demo-table { width: calc(100% - 28px); margin: 12px 14px 0; border-collapse: collapse; font-size: 0.86rem; }
.demo-table th, .demo-table td { padding: 8px; border-bottom: 1px solid var(--bordure); text-align: right; font-variant-numeric: tabular-nums; }
.demo-table th:first-child, .demo-table td:first-child { text-align: left; }
.demo-table th { background: var(--surface-2); color: var(--marine); font-size: 0.76rem; letter-spacing: 0.02em; }
.demo-table .demo-cuisson td { background: var(--cuisson-fond); color: var(--cuisson-texte); font-weight: 700; text-align: center; }
.demo-pastille {
  display: inline-flex; align-items: center; gap: 7px; margin: 12px 14px 0; padding: 7px 13px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 700; background: var(--ok-fond); color: var(--ok-texte); position: relative; overflow: hidden;
}
.demo-pastille::before { content: "✓"; font-weight: 900; }
.demo-pastille.alerte { background: var(--alerte-orange-fond); color: var(--alerte-orange); }
.demo-pastille.rouge { background: var(--alerte-rouge-fond); color: var(--alerte-rouge); }
.demo-pastille.alerte::before, .demo-pastille.rouge::before { content: "!"; }
.demo-pastille::after {   /* reflet qui traverse la pastille */
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55), transparent 70%);
  animation: demo-reflet 2.6s ease-in-out infinite;
}
@keyframes demo-reflet { 60%, 100% { transform: translateX(120%); } }
.demo-note { margin: 10px 14px 0; font-size: 0.82rem; color: var(--texte-doux); }
.demo-note i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; }
.demo-note i.plein { background: var(--marine); }
.demo-note i.vide { border: 2px solid var(--marine); }
.demo-lignes { list-style: none; margin: 12px 14px 0; padding: 0; display: grid; gap: 8px; }
.demo-lignes li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--bordure);
  border-radius: 10px; background: var(--surface-2); font-size: 0.86rem;
}
.demo-lignes span { flex: 1; }
.demo-lignes small { display: block; font-size: 0.74rem; color: var(--texte-doux); }
.demo-lignes strong { color: var(--marine); white-space: nowrap; font-variant-numeric: tabular-nums; }
.demo-lignes em { font-style: normal; font-weight: 800; min-width: 3em; text-align: right; color: var(--texte-doux); }
.demo-lignes em.hausse { color: var(--alerte-rouge); }
.demo-lignes em.baisse { color: var(--ok-vert); }
.demo-prix .demo-total { background: var(--marine-pale); font-weight: 700; }
.demo-prix .demo-total.fort { background: var(--fond-marine); color: var(--principal-texte); }
.demo-prix .demo-total.fort strong { color: var(--principal-texte); font-size: 1rem; }
.demo-jauge { position: relative; margin: 12px 14px 0; height: 26px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.demo-jauge span {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--ok-vert), #5cbf74); transition: width 1.2s cubic-bezier(.2, .8, .2, 1) 0.2s;
}
.demo-jauge:not(.demo-cache) span { width: var(--part); }
.demo-jauge b { position: relative; display: block; line-height: 26px; padding-left: 12px; font-size: 0.8rem; color: #fff; }
.demo-total-commande { margin: 12px 14px 0; font-size: 0.9rem; color: var(--texte-doux); }
.demo-total-commande strong { color: var(--marine); font-size: 1.05rem; }

/* Facture : petit ticket papier incliné, balayé par le rayon de lecture */
.demo-ticket {
  position: relative; width: 58%; margin: 16px auto 0; padding: 14px 16px 12px; overflow: hidden;
  background: #fffdf7; color: #333; border-radius: 4px; transform: rotate(-3deg);
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, 0.35);
  -webkit-mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) -6px 0 / 12px 100% repeat-x;
}
.demo .demo-ticket.demo-cache { transform: rotate(-8deg) translateY(30px) scale(0.9); }
.demo-ticket b { display: block; font-size: 0.78rem; letter-spacing: 0.06em; }
.demo-ticket small { display: block; margin-bottom: 10px; font-size: 0.66rem; color: #888; }
.demo-ticket span { display: block; height: 6px; margin: 0 0 9px; border-radius: 3px; background: #e6e1d4; }
.demo-ticket span:nth-of-type(2n) { width: 72%; }
.demo-ticket i { display: block; margin-top: 8px; font-style: normal; font-size: 0.7rem; font-weight: 700; text-align: right; }
.demo-ticket::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26px;
  background: linear-gradient(180deg, transparent, rgba(232, 150, 46, 0.55), transparent);
  animation: demo-balayage 1.5s ease-in-out infinite alternate;
}
@keyframes demo-balayage { from { top: -26px; } to { top: 100%; } }
.demo-lecture { margin: 12px 14px 0; text-align: center; font-weight: 700; color: var(--marine); }
.demo-points::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border-radius: 50%; border: 2px solid var(--marine-pale); border-top-color: var(--alerte-orange); animation: demo-tourne 0.8s linear infinite; }
@keyframes demo-tourne { to { transform: rotate(360deg); } }

/* Allergènes : rond plein = contient, rond vide = traces ; apparaissent en « pop » */
.demo-allergenes td:not(:first-child), .demo-allergenes th:not(:first-child) { text-align: center; }
.demo-allergenes i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--marine); }
.demo-allergenes i.trace { background: transparent; border: 2px solid var(--marine); }
.demo .demo-allergenes i.demo-cache { transform: scale(0); filter: none; }
/* Stock : stock bas / rupture */
.demo-bas, .demo-rupture { display: inline-block; min-width: 1.8em; padding: 1px 7px; border-radius: 6px; font-weight: 800; text-align: center; }
.demo-bas { background: var(--alerte-orange-fond); color: var(--alerte-orange); }
.demo-rupture { background: var(--alerte-rouge-fond); color: var(--alerte-rouge); }

@media (max-width: 760px) {
  .demo-scene { padding: 24px 12px 14px; }
  .demo, .vitrine-section.inverse .demo { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .demo, .demo-scene::before, .demo-scene::after, .demo-ticket::after, .demo-pastille::after, .demo-points::before { animation: none; }
}


/* =====================================================================
   PAGE D'ACCUEIL – version « vidéos explicatives » (16/11/2026)
   (ces règles complètent / remplacent celles plus haut)
   ===================================================================== */
.vitrine { overflow-x: clip; counter-reset: fonction; }

/* --- En-tête : texte à gauche, visuel à droite --- */
.vitrine-hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; margin-bottom: 52px; }
.vitrine-hero .vitrine-haut { text-align: left; margin: 0; max-width: none; }
.vitrine-surtitre {
  display: inline-block; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--marine-pale); color: var(--marine);
}
.vitrine-hero .vitrine-titre { font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.12; margin: 0 0 16px; }
.vitrine-titre span {
  background: linear-gradient(90deg, var(--alerte-orange), #f2b766);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.vitrine-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 12px; }
.vitrine-lien { font-weight: 700; color: var(--marine); text-decoration: none; }
.vitrine-lien::after { content: "↓"; display: inline-block; margin-left: 6px; transition: transform 0.2s; }
.vitrine-lien:hover::after { transform: translateY(3px); }

.hero-visuel { position: relative; isolation: isolate; perspective: 1400px; padding: 44px 34px 64px 26px; }
.hero-visuel::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 32px;
  background:
    radial-gradient(circle at 15% 20%, rgba(232, 150, 46, 0.32), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(58, 70, 119, 0.35), transparent 50%),
    linear-gradient(135deg, var(--marine-pale), var(--surface-2));
}
.hero-fenetre {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 4px rgba(20, 26, 50, 0.06), 0 30px 60px -14px rgba(20, 26, 50, 0.4);
  transform: rotateY(-9deg) rotateX(4deg);
  animation: hero-entree 0.9s cubic-bezier(.2, .8, .2, 1) both, demo-flotte-fenetre 9s ease-in-out 1s infinite;
}
.hero-fenetre .demo-table { margin-bottom: 4px; font-size: 0.82rem; }
.hero-cout { margin: 8px 14px 14px; font-size: 0.86rem; color: var(--texte-doux); }
.hero-cout strong { color: var(--marine); font-size: 1rem; }
.hero-carte, .hero-telephone {
  position: absolute; z-index: 2; display: grid; gap: 3px; padding: 10px 14px; min-width: 130px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 14px;
  box-shadow: 0 14px 30px -10px rgba(20, 26, 50, 0.35); font-size: 0.8rem; color: var(--texte);
  animation: hero-carte 0.8s cubic-bezier(.34, 1.56, .64, 1) both, demo-flotte-fenetre 6s ease-in-out infinite;
}
.hero-carte b, .hero-telephone b { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-doux); }
.hero-carte.c1 { top: 6px; right: 6px; animation-delay: 0.5s, 1.3s; }
.hero-carte.c2 { top: 46%; left: -14px; animation-delay: 0.8s, 0.2s; }
.hero-carte.c2 span::before { content: "✓ "; color: var(--ok-vert); font-weight: 900; }
.hero-carte.c3 { bottom: -12px; left: 22px; max-width: 230px; animation-delay: 1.1s, 2.1s; }
.hero-grand { font-size: 1.5rem; font-weight: 800; color: var(--ok-vert); line-height: 1.1; }
.hero-jauge { display: block; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hero-jauge span { display: block; height: 100%; width: 68%; border-radius: 999px; background: linear-gradient(90deg, var(--ok-vert), #5cbf74); animation: hero-jauge 1.4s cubic-bezier(.2, .8, .2, 1) 1s both; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.hero-tags em { font-style: normal; padding: 2px 7px; border-radius: 999px; background: var(--marine-pale); color: var(--marine); font-weight: 700; font-size: 0.72rem; }
.hero-telephone {
  right: -10px; bottom: 30px; min-width: 0; width: 128px; padding: 18px 12px 14px;
  border: 6px solid #161a26; border-radius: 24px; animation-delay: 1.4s, 0.6s;
}
.hero-telephone span { font-weight: 700; }
.hero-telephone em {
  justify-self: start; font-style: normal; font-weight: 800; padding: 2px 8px; border-radius: 6px;
  background: var(--alerte-rouge-fond); color: var(--alerte-rouge); animation: hero-alerte 2s ease-in-out 2.4s infinite;
}
@keyframes hero-entree { from { opacity: 0; transform: rotateY(-20deg) rotateX(10deg) translateY(40px); } }
@keyframes hero-carte { from { opacity: 0; transform: scale(0.6) translateY(20px); } }
@keyframes hero-jauge { from { width: 0; } }
@keyframes hero-alerte { 50% { box-shadow: 0 0 0 5px rgba(198, 40, 40, 0.18); } }

/* --- Grand numéro en filigrane derrière le texte de chaque fonction --- */
.vitrine-section { counter-increment: fonction; }
.vitrine-texte { position: relative; isolation: isolate; }
.vitrine-texte::before {
  content: "0" counter(fonction); position: absolute; z-index: -1; top: -58px; left: -8px; pointer-events: none;
  font-size: 7rem; font-weight: 900; line-height: 1; letter-spacing: -0.04em; color: var(--marine); opacity: 0.07;
}

/* --- Apparition des sections au défilement (classes posées par vitrine.js) --- */
.vitrine.animee .vitrine-texte, .vitrine.animee .demo-scene {
  opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2, .8, .2, 1);
}
.vitrine.animee .vu .vitrine-texte, .vitrine.animee .vu .demo-scene { opacity: 1; transform: none; }
.vitrine.animee .vu .demo-scene { transition-delay: 0.15s; }

/* --- Fenêtre de démonstration : contenu, puis sous-titres et contrôles en bas --- */
.demo { display: flex; flex-direction: column; padding: 0; min-height: 420px; }
.demo > .demo-pastille, .demo > .demo-note { align-self: flex-start; }
.demo-sous-titre {
  margin: auto 14px 0; padding: 9px 14px; min-height: 2.9em; border-radius: 10px; text-align: center;
  font-size: 0.85rem; line-height: 1.4; color: #fff; background: rgba(15, 18, 30, 0.84);
  transition: opacity 0.35s;
  border-top: 14px solid transparent; background-clip: padding-box;   /* garde un espace au-dessus, même si le contenu est haut */
}
.demo-sous-titre:empty { opacity: 0; }
.demo-controles {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 12px;
  border-top: 1px solid var(--bordure); background: var(--surface-2);
}
.demo-lire {
  flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 0.68rem; line-height: 1;
  background: var(--fond-marine); color: var(--principal-texte);
}
.demo-lire:focus-visible, .demo-chapitres button:focus-visible { outline: 2px solid var(--alerte-orange); outline-offset: 2px; }
.demo-controles .demo-progression { position: static; flex: 1; height: 5px; border-radius: 999px; overflow: hidden; }
.demo-chapitres { display: flex; gap: 2px; }
.demo-chapitres button { width: 20px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.demo-chapitres button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bordure-forte); transition: transform 0.2s, background 0.2s; }
.demo-chapitres button.actif::before { background: var(--alerte-orange); transform: scale(1.35); }

/* --- Écran-titre (étape 0), comme le début d'une vidéo --- */
.demo-intro {
  position: absolute; z-index: 4; left: 0; right: 0; top: 42px; bottom: 47px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  background: radial-gradient(circle at 50% 42%, var(--surface), var(--surface-2) 75%);
  opacity: 0; pointer-events: none; transition: opacity 0.5s;
}
.demo.en-intro .demo-intro { opacity: 1; }
.demo-intro span { font-size: 0.85rem; font-weight: 900; letter-spacing: 0.14em; color: var(--alerte-orange); }
.demo-intro strong { font-size: 1.45rem; color: var(--marine); }
.demo-intro i { position: relative; width: 56px; height: 56px; border-radius: 50%; background: var(--fond-marine); animation: demo-pouls 1.6s ease-out infinite; }
.demo-intro i::after {
  content: ""; position: absolute; left: 22px; top: 17px;
  border-left: 17px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent;
}
@keyframes demo-pouls { 0% { box-shadow: 0 0 0 0 rgba(232, 150, 46, 0.55); } 100% { box-shadow: 0 0 0 20px rgba(232, 150, 46, 0); } }

/* --- Texte qui s'écrit --- */
.demo-tape::after { content: "|"; margin-left: 1px; font-weight: 400; animation: demo-clignote 0.7s steps(1) infinite; }
@keyframes demo-clignote { 50% { opacity: 0; } }

/* --- Démonstration « téléphone » (stock) avec notification --- */
.demo.telephone { width: 100%; max-width: 310px; margin: 0 auto; min-height: 500px; border: 10px solid #161a26; border-radius: 38px; }
.demo.telephone .demo-barre { padding: 26px 16px 12px; }
.demo.telephone .demo-barre::before { left: 50%; top: 8px; width: 64px; height: 7px; margin: 0 0 0 -32px; border-radius: 6px; background: #161a26; box-shadow: none; }
.demo.telephone .demo-intro { top: 58px; }
.demo.telephone .demo-table { font-size: 0.8rem; }
.demo-toast {
  position: absolute; z-index: 3; left: 10px; right: 10px; top: 62px; display: grid; gap: 2px;
  padding: 10px 12px; border-radius: 14px; border-left: 4px solid var(--alerte-rouge);
  background: var(--surface); box-shadow: 0 12px 26px -6px rgba(0, 0, 0, 0.35); font-size: 0.8rem; font-weight: 700;
}
.demo-toast b { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-doux); }
.demo .demo-toast.demo-cache { transform: translateY(-40px); }

/* --- Téléphone et tablette --- */
@media (max-width: 900px) {
  .vitrine-hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-fenetre { transform: none; }
}
@media (max-width: 600px) {
  .hero-visuel { padding: 34px 10px 70px; }
  .hero-carte.c2, .hero-telephone { display: none; }
  .hero-carte.c1 { right: 4px; top: 4px; }
  .vitrine-texte::before { font-size: 5rem; top: -40px; }
  .demo { min-height: 400px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-fenetre, .hero-carte, .hero-telephone, .hero-telephone em, .hero-jauge span, .demo-intro i, .demo-tape::after { animation: none; }
}

/* =====================================================================
   HABILLAGE DE LA PAGE D'ACCUEIL (16/11/2026) : identité, menu public,
   bandeau de confiance, trois étapes, questions, appel final, pied de page
   ===================================================================== */
:root {
  /* Titres : police à empattements des systèmes (aucun fichier à télécharger, rien envoyé à un tiers) */
  --police-titre: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

/* --- Logo : toque + « Kookio », les « oo » en orange --- */
.logo-mot { font-family: var(--police-titre); font-size: 54px; font-weight: 700; letter-spacing: 0.5px; fill: var(--marine); }
.logo-oo { fill: var(--alerte-orange); }

/* --- En-tête sur la page d'accueil : translucide, avec le menu public --- */
.vitrine-nav { display: none; margin-left: auto; align-items: center; gap: 22px; }
body[data-ecran="ecran-connexion"] .vitrine-nav { display: flex; }
body[data-ecran="ecran-connexion"] .entete {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.vitrine-nav a { color: var(--texte); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.vitrine-nav a:hover { color: var(--marine); text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 640px) { .vitrine-nav a { display: none; } }

/* --- Typographie et fond de la page --- */
.vitrine { position: relative; isolation: isolate; }
.vitrine h2, .vitrine h3, .vitrine-titre, .demo-intro strong, .vitrine-pied-marque strong { font-family: var(--police-titre); }
.vitrine-hero { position: relative; }
.vitrine-hero::before {   /* trame de points, estompée vers les bords */
  content: ""; position: absolute; z-index: -1; inset: -40px -200px -20px; pointer-events: none;
  background-image: radial-gradient(var(--bordure-forte) 1.1px, transparent 1.5px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 35%, #000 15%, transparent 65%);
  mask-image: radial-gradient(ellipse at 30% 35%, #000 15%, transparent 65%);
}
.vitrine-section, .vitrine-etapes, .vitrine-questions, .vitrine-titre-section { scroll-margin-top: 84px; }

/* --- Bandeau de confiance --- */
.vitrine-confiance {
  list-style: none; margin: 0 0 72px; padding: 18px 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 18px; box-shadow: var(--ombre);
}
.vitrine-confiance li { position: relative; display: grid; gap: 2px; padding-left: 32px; }
.vitrine-confiance li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 900;
  background: var(--alerte-orange-fond); color: var(--alerte-orange);
}
.vitrine-confiance strong { color: var(--marine); font-size: 0.95rem; }
.vitrine-confiance span { color: var(--texte-doux); font-size: 0.82rem; line-height: 1.4; }
@media (max-width: 900px) { .vitrine-confiance { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .vitrine-confiance { grid-template-columns: 1fr; } }

/* --- Titres de partie (centrés) --- */
.vitrine-titre-section { text-align: center; max-width: 660px; margin: 0 auto 28px; }
.vitrine-titre-section h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.2; color: var(--marine); }
.vitrine-titre-section > p:not(.vitrine-surtitre) { margin: 0; line-height: 1.6; color: var(--texte-doux); }

/* --- Trois étapes --- */
.vitrine-etapes { padding: 64px 0 24px; border-top: 1px solid var(--bordure); }
.vitrine-etapes ol { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.vitrine-etapes ol::before {   /* pointillé qui relie les étapes */
  content: ""; position: absolute; top: 28px; left: 17%; right: 17%; border-top: 2px dashed var(--bordure-forte);
}
.vitrine-etapes li { position: relative; padding: 0 12px; text-align: center; }
.vitrine-etape-num {
  position: relative; display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  font-family: var(--police-titre); font-size: 1.5rem; font-weight: 800; color: var(--principal-texte);
  background: linear-gradient(135deg, var(--alerte-orange), #f2b766);
  box-shadow: 0 10px 22px -8px rgba(232, 150, 46, 0.7), 0 0 0 7px var(--fond);
}
.vitrine-etapes h3 { margin: 16px 0 6px; font-size: 1.2rem; color: var(--marine); }
.vitrine-etapes p { margin: 0; line-height: 1.55; color: var(--texte-doux); }
@media (max-width: 760px) {
  .vitrine-etapes ol { grid-template-columns: 1fr; }
  .vitrine-etapes ol::before { display: none; }
}

/* --- Questions (ouvrir / fermer) --- */
.vitrine-questions { max-width: 780px; margin: 0 auto; padding: 56px 0 8px; }
.vitrine-questions details {
  margin-bottom: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 14px; box-shadow: var(--ombre); transition: border-color 0.2s;
}
.vitrine-questions details[open] { border-color: var(--bordure-forte); }
.vitrine-questions summary {
  position: relative; list-style: none; cursor: pointer; padding: 17px 56px 17px 20px; font-weight: 700; color: var(--marine);
}
.vitrine-questions summary::-webkit-details-marker { display: none; }
.vitrine-questions summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.1rem; line-height: 1;
  background: var(--marine-pale); color: var(--marine); transition: transform 0.25s, background 0.25s;
}
.vitrine-questions details[open] summary::after { transform: rotate(45deg); background: var(--alerte-orange-fond); color: var(--alerte-orange); }
.vitrine-questions summary:focus-visible { outline: 2px solid var(--alerte-orange); outline-offset: -2px; }
.vitrine-questions details p { margin: 0; padding: 0 20px 18px; line-height: 1.6; color: var(--texte); }

/* --- Appel final (bandeau marine) --- */
.vitrine-final {
  position: relative; overflow: hidden; margin-top: 56px; padding: 56px 24px; text-align: center; border-radius: 28px;
  color: var(--principal-texte);
  background:
    radial-gradient(circle at 12% 18%, rgba(232, 150, 46, 0.45), transparent 42%),
    radial-gradient(circle at 92% 92%, rgba(255, 255, 255, 0.12), transparent 40%),
    linear-gradient(135deg, var(--fond-marine-clair), var(--fond-marine));
}
.vitrine-final h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 3.4vw, 2.3rem); color: var(--principal-texte); }
.vitrine-final p { margin: 0 0 24px; color: var(--texte-sur-marine-doux); }
.vitrine-bouton-clair { border-color: transparent; font-weight: 700; background: var(--principal-texte); color: var(--fond-marine); }
.vitrine-bouton-clair:hover { filter: brightness(0.94); }

/* --- Pied de page --- */
.vitrine-pied {
  display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: center;
  margin-top: 48px; padding: 28px 4px 4px; border-top: 1px solid var(--bordure);
}
.vitrine-pied-marque { display: grid; gap: 4px; }
.vitrine-pied-marque strong { font-size: 1.6rem; color: var(--marine); }
.vitrine-pied-marque strong span { color: var(--alerte-orange); }
.vitrine-pied-marque > span { font-size: 0.88rem; color: var(--texte-doux); }
.vitrine-pied nav { display: flex; flex-wrap: wrap; gap: 18px; }
.vitrine-pied nav a { font-size: 0.9rem; font-weight: 600; color: var(--texte); text-decoration: none; }
.vitrine-pied nav a:hover { color: var(--marine); text-decoration: underline; text-underline-offset: 4px; }
.vitrine-pied > p { grid-column: 1 / -1; margin: 6px 0 0; font-size: 0.8rem; color: var(--texte-doux); }
@media (max-width: 640px) { .vitrine-pied { grid-template-columns: 1fr; } }
