/*
 * Mijoka — composants communs, pensés pour le doigt (mobile et tablette).
 * Les couleurs, polices et textures viennent de themes.css (variables).
 */
:root {
  --cible: 52px;          /* cible tactile minimale sur mobile */
  --texte-base: 17px;
  --erreur: #B3261E;
  font-size: var(--texte-base);
}
/* Tablette : assez large ET assez haute (un téléphone en paysage n'est pas une tablette) */
@media (min-width: 700px) and (min-height: 521px) {
  :root { --cible: 48px; --texte-base: 16px; }   /* charte tablette (15/11/2026) : taille du doigt, détails dans tablette.css */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 {
  font-family: var(--police-titre);
  font-weight: var(--titre-graisse);
  color: var(--titre-couleur);
  line-height: 1.15;
}
h1 { font-size: calc(1.55rem * var(--titre-echelle)); margin: 0 0 var(--esp-2); }
h2 { font-size: calc(1.2rem * var(--titre-echelle)); margin: var(--esp-6) 0 var(--esp-3); }
h3 { font-size: calc(1.05rem * var(--titre-echelle)); margin: var(--esp-4) 0 var(--esp-2); }
p { margin: 0 0 var(--esp-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-fort); }

svg.icone { width: 1.4em; height: 1.4em; flex: none; }

/* ---------- Structure ---------- */
.entete { text-align: center; padding: 16px 16px 0; }
.entete-logo { max-width: 180px; height: auto; }
.page { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: var(--esp-4); }

.page-large { max-width: 1100px; }
.pied { text-align: center; font-size: .8rem; color: var(--texte-doux); padding: 16px; }

.barre-titre {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}
.barre-titre h1 { margin: 0; }
@media (min-width: 700px) and (min-height: 521px) {
  .page, .barre-titre { max-width: 1080px; padding-left: 28px; padding-right: 28px; }
}
.salut { color: var(--texte-doux); margin: 0; }

/* ---------- Surfaces ---------- */
.carte {
  background-color: var(--surface);
  background-image: var(--surface-image);
  border: 1px solid var(--surface-bord);
  border-radius: var(--rayon);
  padding: var(--esp-5) var(--esp-5);
  box-shadow: var(--ombre);
}
/* Le premier élément d'une carte colle au bord intérieur ; les cartes se suivent avec un écart fixe */
.carte > :first-child { margin-top: 0; }
.carte > :last-child { margin-bottom: 0; }
* + .carte, * + .grille-2 { margin-top: var(--esp-4); }
.grille-2 > .carte { margin-top: 0; }
/* Écrans d'accès (connexion, code) : carte étroite et centrée */
.carte-etroite { max-width: 440px; margin: var(--esp-7) auto; }
.page .barre-titre { padding-left: 0; padding-right: 0; }
.a-droite { text-align: right; }
.lien-secondaire { display: block; margin-top: var(--esp-4); font-size: .9rem; }
.centre { text-align: center; }

/* ---------- Tuiles d'accueil (tablette et mobile) ---------- */
.tuiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 700px) and (min-height: 521px) {
  .tuiles { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
.tuile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 132px;
  padding: 18px;
  background-color: var(--tuile-fond);
  background-image: var(--surface-image);
  border: 1px solid var(--surface-bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  color: var(--texte);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
}
@media (min-width: 700px) and (min-height: 521px) {
  .tuile { min-height: 180px; padding: 24px; font-size: 1.25rem; }
}
.tuile-icone {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--tuile-icone-fond);
  color: var(--tuile-icone);
}
.tuile-icone svg { width: 30px; height: 30px; }
.tuile small { display: block; font-weight: 600; font-size: .85rem; color: var(--texte-doux); }
.tuile.principale { grid-column: 1 / -1; min-height: 110px; flex-direction: row; align-items: center; justify-content: flex-start; }
.tuile[aria-disabled="true"] { pointer-events: none; box-shadow: none; }
.tuile[aria-disabled="true"] > * { opacity: .5; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--cible);
  margin-top: var(--esp-5);
  padding: 0 26px;
  border: 0;
  border-radius: 14px;
  background: var(--accent-fort);
  color: var(--accent-texte);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  touch-action: manipulation;
}
.bouton:active { transform: translateY(1px); filter: brightness(.95); }
.bouton:focus-visible, .tuile:focus-visible { outline: 3px solid var(--mise-en-avant); outline-offset: 2px; }
.bouton.secondaire { background: var(--secondaire-doux); color: var(--texte); }
.bouton.discret { background: transparent; color: var(--accent-fort); box-shadow: inset 0 0 0 2px var(--ligne); }
.bouton-rond {
  display: inline-grid;
  place-items: center;
  width: var(--cible);
  height: var(--cible);
  border: 0;
  border-radius: 50%;
  background: var(--accent-doux);
  color: var(--accent-fort);
  cursor: pointer;
}
@media (min-width: 700px) and (min-height: 521px) { .bouton { width: auto; } }

/* ---------- Puces (choix au toucher) ---------- */
.puces { display: flex; gap: 10px; flex-wrap: wrap; }
.puce { position: relative; margin: 0; cursor: pointer; font-weight: 700; }
.puce input { position: absolute; opacity: 0; }
.puce span, a.puce {
  display: inline-flex;
  align-items: center;
  min-height: calc(var(--cible) - 6px);
  padding: 0 20px;
  border: 2px solid var(--ligne);
  border-radius: 999px;
  background: var(--surface);
  color: var(--texte);
  text-decoration: none;
}
.puce input:checked + span, a.puce.active { border-color: var(--accent-fort); background: var(--accent-fort); color: var(--accent-texte); }
.puce input:focus-visible + span { outline: 3px solid var(--mise-en-avant); }

/* ---------- Recettes ---------- */
.liste-recettes { display: grid; gap: 14px; }
@media (min-width: 700px) and (min-height: 521px) { .liste-recettes { grid-template-columns: repeat(2, 1fr); gap: 20px; } }

.carte-recette {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background-color: var(--surface);
  background-image: var(--surface-image);
  border: 1px solid var(--surface-bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  color: var(--texte);
  text-decoration: none;
}
.carte-recette h3 { margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--texte-doux); font-size: .9rem; font-weight: 700; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 18px; height: 18px; }

.etiquettes { display: flex; flex-wrap: wrap; gap: 6px; }
.etiquette {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--secondaire-doux);
  color: var(--secondaire);
  font-size: .78rem;
  font-weight: 800;
}

/* Pastille Mijo-score : vert olive (A, B), moutarde (C), orange (D, E) */
.mijo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: .85rem;
  color: var(--texte-doux);
}
.mijo b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.05rem;
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.mijo.a b { background: #4C5C22; }
.mijo.b b { background: #6F8030; }
.mijo.c b { background: #F5A623; color: #3A2410; }
.mijo.d b { background: #D9681F; }
.mijo.e b { background: #B8480F; }

.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px dashed var(--ligne);
}
.ingredients .quantite { font-weight: 800; white-space: nowrap; }

.etapes-recette { list-style: none; padding: 0; margin: 0; counter-reset: etape; }
.etapes-recette li {
  position: relative;
  padding: 12px 0 12px 52px;
  counter-increment: etape;
}
.etapes-recette li::before {
  content: counter(etape);
  position: absolute;
  left: 0;
  top: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-doux);
  color: var(--accent-fort);
  font-weight: 800;
}
.minuteur {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-doux);
  color: var(--accent-fort);
  font-weight: 800;
  font-size: .85rem;
}

/* Portions : boutons − / + */
.portions { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; }

/* Fiche recette en paysage (tablette) : ingrédients et étapes côte à côte */
.fiche { display: grid; gap: 18px; }
@media (min-width: 900px) and (orientation: landscape) {
  .fiche { grid-template-columns: 2fr 3fr; align-items: start; }
}

/* ---------- Mode En cuisine (plein écran) ---------- */
.cuisine {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 18px;
  gap: 16px;
}
.cuisine-etape {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
}
@media (min-width: 700px) and (min-height: 521px) { .cuisine-etape { font-size: 2.5rem; padding: 48px; } }
.cuisine-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cuisine-nav .bouton { width: 100%; min-height: 96px; margin: 0; font-size: 1.3rem; }
.progression { height: 8px; border-radius: 999px; background: var(--ligne); overflow: hidden; }
.progression span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* ---------- Navigation basse (mobile) ---------- */
/* Barre du bas fixée à l'écran (jamais dans la zone qui défile : l'élasticité du défilement ne la déplace pas) */
.nav-basse {
  position: fixed;
  left: 0; right: 0; bottom: 0; z-index: 20;
  transform: translateZ(0);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--nav-fond);
  border-top: 1px solid var(--ligne);
  backdrop-filter: blur(8px);
}
.nav-basse a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: var(--cible);
  justify-content: center;
  color: var(--texte-doux);
  text-decoration: none;
  font-size: .72rem;
  font-weight: 800;
}
.nav-basse a[aria-current="page"] { color: var(--accent-fort); }
.nav-basse svg { width: 26px; height: 26px; }
@media (min-width: 700px) and (min-height: 521px) { .nav-basse { display: none; } }
/* La place de la barre est réservée en bas de page : le pied et le dernier bloc restent juste au-dessus */
@media not ((min-width: 700px) and (min-height: 521px)) { body.avec-nav { padding-bottom: calc(65px + env(safe-area-inset-bottom)); } }
@media (orientation: landscape) and (max-height: 520px) { body.avec-nav { padding-bottom: 0; } }

/* ---------- Formulaires ---------- */
/* Formulaire : une seule structure partout.
   étiquette ─esp-1─ champ ─esp-1─ aide ─esp-4─ étiquette suivante … ─esp-5─ bouton */
.formulaire { display: flex; flex-direction: column; margin-top: var(--esp-4); }
.carte > h1 + .formulaire, .carte > h2 + .formulaire, .carte > p + .formulaire { margin-top: var(--esp-4); }
.formulaire > fieldset { display: flex; flex-direction: column; }
label, .libelle { font-weight: 700; margin: var(--esp-4) 0 var(--esp-2); }
.formulaire > label:first-child, .formulaire > input[type=hidden] + label, .formulaire > input[type=hidden] + input[type=hidden] + label,
.formulaire > div:first-child > label:first-child { margin-top: 0; }
.formulaire input, .formulaire select, .formulaire textarea { margin: 0; }
.formulaire .choix, .formulaire .puces { margin-top: var(--esp-4); }
.formulaire .choix + .choix { margin-top: var(--esp-2); }
.formulaire .libelle + .puces { margin-top: 0; }

/* Champs de saisie : l'habillage vient du thème (variables --champ-*) */
input[type=text], input[type=password], input[type=search], input[type=email], input[type=number],
input[type=tel], input[type=url], input[type=date], input[type=time], input:not([type]), input[inputmode], select, textarea {
  min-height: var(--cible);
  padding: var(--champ-padding, 10px 14px);
  font: inherit;
  font-family: var(--champ-police, inherit);
  font-size: var(--champ-taille, 1rem);
  border: var(--champ-bord, 2px solid var(--ligne));
  border-bottom: var(--champ-bord-bas, var(--champ-bord, 2px solid var(--ligne)));
  border-radius: var(--champ-rayon, 12px);
  background-color: var(--champ-fond, var(--surface));
  background-image: var(--icone, var(--icone-crayon));
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 18px 18px;
  padding-left: 44px;
  box-shadow: var(--champ-ombre, none);
  color: var(--texte);
  caret-color: var(--accent-fort);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 6em; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--texte-doux); opacity: .7; font-family: var(--police-texte); font-size: 1rem; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--champ-fond-focus, var(--champ-fond, var(--surface)));
  box-shadow: var(--champ-ombre-focus, 0 0 0 3px var(--accent-doux));
}
/* Pré-remplissage du navigateur : garder les couleurs du thème */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--texte);
  -webkit-box-shadow: 0 0 0 1000px var(--champ-autofill, var(--accent-doux)) inset;
  transition: background-color 9999s;
}
/* Cases à cocher et boutons radio natifs à la couleur du thème */
input[type=checkbox], input[type=radio] { accent-color: var(--accent-fort); }

.code { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }

.choix {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 400;
  padding: 14px;
  border: 2px solid var(--ligne);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}
.choix input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--accent-fort); }
.choix:has(input:checked) { border-color: var(--accent-fort); background: var(--accent-doux); }

fieldset.mysql { border: 0; padding: 0; margin: 0; min-width: 0; }
.formulaire:has(input[value=sqlite]:checked) fieldset.mysql { display: none; }

.aide { font-size: .9rem; color: var(--texte-doux); margin: var(--esp-1) 0 0; }
.carte > .aide, section > .aide { margin-bottom: var(--esp-3); }

.alerte {
  border-left: 4px solid var(--erreur);
  background: #FCEDEC;
  color: var(--erreur);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.alerte p { margin: 4px 0; }
.info {
  border-left: 4px solid var(--secondaire);
  background: var(--secondaire-doux);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ---------- Installeur ---------- */
.etapes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  font-size: .8rem;
  font-weight: 700;
}
.etapes li { padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--ligne); }
.etapes li a { color: inherit; }
.etapes li.faite { background: var(--secondaire-doux); color: var(--secondaire); }
.etapes li.en-cours { background: var(--accent-fort); border-color: var(--accent-fort); color: var(--accent-texte); }

.verifications { list-style: none; padding: 0; margin: 16px 0; }
.verifications li { padding: 10px 0; border-bottom: 1px solid var(--ligne); display: flex; flex-direction: column; }
.verifications li span { font-size: .85rem; color: var(--texte-doux); word-break: break-all; }
.verifications .ok strong { color: var(--secondaire); }
.verifications .ko strong { color: var(--erreur); }
.verifications .attention strong { color: #A86A00; }

.commande {
  background: #3A2410;
  color: #FBF3E4;
  padding: 12px 14px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: .85rem;
}

.qr { display: flex; justify-content: center; margin: 16px 0; min-height: 228px; }
.qr img { background: #fff; border-radius: 10px; image-rendering: pixelated; }
.cle-secrete { font-family: ui-monospace, monospace; font-size: 1.05rem; text-align: center; word-break: break-all; }

.codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  list-style: none;
  padding: 0;
  font-family: ui-monospace, monospace;
  font-size: 1.1rem;
}
.codes li { background: var(--accent-doux); border-radius: 8px; padding: 8px; text-align: center; }
.suite li { margin: 6px 0; }

/* ---------- Téléphone en paysage (mode conseillé sur mobile) ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --cible: 48px; }
  .entete { display: none; }
  .avec-nav .nav-basse {
    position: fixed;
    inset: 0 auto 0 0;
    width: 84px;
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
    padding: calc(6px + env(safe-area-inset-top)) 4px 6px calc(4px + env(safe-area-inset-left));
    border-top: 0;
    border-right: 1px solid var(--ligne);
    z-index: 10;
  }
  .avec-nav .page, .avec-nav .barre-titre { margin-left: 84px; margin-right: 0; width: calc(100% - 84px); max-width: none; min-width: 0; align-self: stretch; }
  .cuisine-nav .libelle { display: none; }
  .cuisine-nav .bouton svg { width: 44px; height: 44px; }
  .tuiles { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .tuile { min-height: 96px; padding: 14px; flex-direction: row; align-items: center; justify-content: flex-start; }
  .tuile.principale { min-height: 80px; }
  .liste-recettes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fiche { grid-template-columns: 2fr 3fr; align-items: start; }
  .cuisine { grid-template-columns: 110px 1fr 110px; grid-template-rows: auto 1fr; padding: 10px; gap: 10px; }
  .cuisine > header { grid-column: 1 / -1; }
  .cuisine-nav { display: contents; }
  .cuisine-nav .bouton { min-height: 0; height: 100%; }
  .cuisine-nav .bouton:first-child { grid-column: 1; grid-row: 2; }
  .cuisine-nav .bouton:last-child { grid-column: 3; grid-row: 2; }
  .cuisine-etape { grid-column: 2; grid-row: 2; font-size: 1.35rem; padding: 18px 24px; }
}

/* ---------- Bascule paysage / portrait ---------- */
.bascule-orientation {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: calc(var(--cible) - 8px);
  padding: 0 14px;
  border: 2px solid var(--ligne);
  border-radius: 999px;
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-weight: 800;
  font-size: .85rem;
  cursor: pointer;
}
.bascule-orientation svg { width: 22px; height: 22px; color: var(--accent-fort); }
@media (min-width: 700px) and (min-height: 521px) { .bascule-orientation { display: none; } }  /* inutile sur tablette */



/* ---------- Modale « Tournez l'appareil » (flou + appareil animé) ---------- */
.modale-rotation {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(60, 35, 18, .28);
  -webkit-backdrop-filter: blur(12px) saturate(.9);
  backdrop-filter: blur(12px) saturate(.9);
  animation: modale-apparition .25s ease-out;
}
.modale-rotation[hidden] { display: none; }
.modale-carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 360px;
  padding: 32px 28px 26px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--surface-bord);
  box-shadow: 0 24px 60px rgba(40, 20, 8, .35);
  text-align: center;
  color: var(--texte);
}
.modale-carte p {
  margin: 0;
  font-family: var(--police-titre);
  font-weight: var(--titre-graisse);
  font-size: calc(1.3rem * var(--titre-echelle));
  color: var(--titre-couleur);
}
.modale-carte .bouton { margin-top: 4px; }

/* Appareil dessiné en CSS qui pivote d'un quart de tour */
.appareil-anime {
  position: relative;
  width: 64px;
  height: 104px;
  margin: 18px 0;
  border: 5px solid var(--accent-fort);
  border-radius: 14px;
  background: var(--accent-doux);
  animation: pivoter-paysage 2.4s cubic-bezier(.6, 0, .3, 1) infinite;
}
.appareil-anime::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent-fort);
  transform: translateX(-50%);
}
.appareil-anime.tablette { width: 92px; height: 126px; border-radius: 16px; }
.appareil-anime.vers-portrait { animation-name: pivoter-portrait; }

@keyframes pivoter-paysage {
  0%, 18% { transform: rotate(0deg); }
  50%, 78% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
@keyframes pivoter-portrait {
  0%, 18% { transform: rotate(-90deg); }
  50%, 78% { transform: rotate(0deg); }
  100% { transform: rotate(-90deg); }
}
@keyframes modale-apparition {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .appareil-anime { animation: none; transform: rotate(-90deg); }
  .appareil-anime.vers-portrait { transform: none; }
  .modale-rotation { animation: none; }
}

/* Tablette : paysage uniquement. En portrait, la modale s'affiche par-dessus l'app floutée. */
.modale-rotation.tablette-portrait { display: none; }
@media (orientation: portrait) and (min-width: 700px) and (pointer: coarse) and (hover: none) {
  .modale-rotation.tablette-portrait { display: grid; }
}

/* ---------- Clé discrète vers L'Office (vitrine) ---------- */
/* La clé suspendue : discrète, mais atteignable au clavier et au toucher */
.cle-cachee {
  position: absolute;
  top: 0;
  right: 24px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 64px;
  color: var(--texte-doux);
  opacity: .45;
  transform-origin: 50% 0;
  transform: rotate(8deg);
  transition: opacity .2s, transform .3s;
}
.cle-cachee::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 18px; background: currentColor; }
.cle-cachee svg { width: 30px; height: 30px; margin-top: 18px; transform: rotate(90deg); }
.cle-cachee:hover, .cle-cachee:focus-visible { opacity: 1; transform: rotate(-6deg); }

/* ---------- Petits écrans : installeur et formulaires ---------- */
.etapes-compact { display: none; }
.identifiants { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 8px; align-items: baseline; }
.identifiants dt { color: var(--texte-doux); font-weight: 700; font-size: .9rem; }
.identifiants dd { margin: 0; overflow-wrap: anywhere; }
.identifiants .cle-secrete { text-align: left; white-space: nowrap; font-size: 1.15rem; font-weight: 700; }
.cle-secrete { overflow-wrap: anywhere; word-break: normal; }
.verifications li span { word-break: normal; overflow-wrap: anywhere; }
@media (min-width: 700px) {
  .verifications { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
}
@media (max-width: 699px) {
  .entete { padding-top: 10px; }
  .entete-logo { max-width: 120px; }
  .etapes-compact { display: block; margin: 0 0 var(--esp-2); font-size: .85rem; color: var(--texte-doux); }
  .codes { grid-template-columns: 1fr 1fr; gap: 6px; }
  .codes li { padding: 8px 4px; font-size: .95rem; }
  .identifiants { grid-template-columns: 1fr; gap: 2px; }
  .identifiants dd { margin-bottom: 8px; }
  /* Filtres du Carnet : une seule ligne qui défile */
  .filtres { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .filtres::-webkit-scrollbar { display: none; }
  .filtres > * { flex: 0 0 auto; }
}
.verifications-ok { margin: 16px 0 0; }
.verifications-ok summary { cursor: pointer; font-weight: 700; color: var(--secondaire); padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.verifications-ok .verifications { margin-top: 0; }
.verifications:empty { display: none; }
/* Zones scolaires : trois boutons égaux sur une ligne */
.puces:has(input[name=zone]) { display: grid; grid-template-columns: repeat(3, 1fr); }
.puces:has(input[name=zone]) .puce span { display: flex; justify-content: center; padding: 0 8px; }

/* Rien ne doit dépasser de l'écran : les longs mots et adresses se coupent, les médias se réduisent */
body { overflow-wrap: anywhere; }
img, video, canvas, pre, table { max-width: 100%; }
.carte, .page > *, form { min-width: 0; }
pre { overflow-x: auto; white-space: pre-wrap; }
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23C24E17' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.carte-formulaire { max-width: 640px; }
.puces.filtres { margin: var(--esp-3) 0 var(--esp-4); }
.fiche > .meta, .carte > .meta { margin: var(--esp-2) 0; }
.fiche { margin-top: var(--esp-4); }
.bouton-ligne { margin: 0; width: auto; }
/* Charte : boutons pleine largeur sur téléphone, à leur taille sur tablette et PC */
@media (min-width: 700px) and (min-height: 521px) {
  .formulaire > .bouton, .formulaire > fieldset > .bouton { align-self: flex-start; width: auto; }
  .carte-etroite .formulaire > .bouton { align-self: stretch; width: 100%; }
}

/* ---------- Tutoriel de bienvenue ---------- */
.tutoriel { max-width: 560px; margin: 0 auto; }
.tutoriel-progression { display: flex; gap: var(--esp-1); margin-bottom: var(--esp-5); }
.tutoriel-progression span { flex: 1; height: 6px; border-radius: 3px; background: var(--ligne); }
.tutoriel-progression span.faite { background: var(--accent-fort); }
.tutoriel-visite { text-align: center; }
.tutoriel-visite .tuile-icone { display: inline-grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; background: var(--tuile-icone-fond); color: var(--tuile-icone); margin-bottom: var(--esp-4); }
.tutoriel-visite .tuile-icone svg { width: 48px; height: 48px; }
.tutoriel-visite p { font-size: 1.1rem; }
.tutoriel-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: var(--esp-2); }
.tutoriel-navigation .bouton { width: 100%; }
.tutoriel .lien-secondaire { text-align: center; }
.choix-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--esp-2); margin-top: var(--esp-4); }
.apercu-theme {
  padding: var(--esp-2);
  border: 3px solid transparent;
  border-radius: 16px;
  background: var(--fond-motif), var(--fond);
  cursor: pointer;
  font: inherit;
  min-height: 132px;
}
.apercu-theme.choisi { border-color: var(--accent-fort); box-shadow: 0 0 0 3px var(--accent-doux); }
.apercu-fiche {
  display: flex; flex-direction: column; gap: 6px; height: 100%;
  padding: var(--esp-2);
  background-color: var(--surface); background-image: var(--surface-image);
  border: 1px solid var(--surface-bord); border-radius: var(--rayon); box-shadow: var(--ombre);
  text-align: left;
}
.apercu-titre { font-family: var(--police-titre); font-weight: var(--titre-graisse); color: var(--titre-couleur); font-size: calc(.9rem * var(--titre-echelle)); line-height: 1.1; }
.apercu-ligne { height: 6px; border-radius: 3px; background: var(--ligne); }
.apercu-ligne.courte { width: 60%; }
.apercu-bouton { margin-top: auto; height: 16px; border-radius: 6px; background: var(--accent-fort); }
@media (max-width: 380px) { .choix-themes { grid-template-columns: 1fr; } .apercu-theme { min-height: 96px; } }
/* Les boutons ne coupent jamais un mot */
.bouton, .puce span, button { overflow-wrap: normal; word-break: normal; hyphens: none; text-align: center; }
.tutoriel-navigation .bouton { padding: 0 var(--esp-3); }
.bouton-ligne { padding: 0 var(--esp-4); white-space: nowrap; flex: none; }
/* Ligne d'appareil : le bouton passe dessous si la place manque */
.ingredients li:has(.bouton-ligne) { flex-wrap: wrap; gap: var(--esp-2); }
.ingredients li:has(.bouton-ligne) > span { flex: 1 1 160px; min-width: 0; }

/* Indicateur de force du mot de passe : critères rayés une fois remplis */
.force-mdp { list-style: none; padding: 0; margin: var(--esp-2) 0 0; display: flex; flex-wrap: wrap; gap: var(--esp-1) var(--esp-3); font-size: .85rem; color: var(--texte); }
.force-mdp li { transition: color .2s, opacity .2s; }
.force-mdp li.ok { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--texte-doux); opacity: .6; }
.confirmation-mdp { min-height: 1.2em; color: var(--erreur); }
.confirmation-mdp.ok { color: var(--secondaire); }

/* Jauge de cuisson : couleurs de cuisson, du cru au plat de chef */
.cuisson { --cuisson: #C9A27A; display: flex; align-items: center; gap: var(--esp-3); margin-top: var(--esp-2); font-size: .9rem; font-weight: 700; color: var(--texte-doux); }
.cuisson-barre { flex: 1; height: 8px; border-radius: 4px; background: var(--ligne); overflow: hidden; }
.cuisson-barre span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--cuisson); transition: width .25s, background-color .25s; }
.cuisson-libelle { flex: none; min-width: 9.5em; text-align: right; }
.cuisson[data-niveau="0"], .cuisson[data-niveau="1"] { --cuisson: #B3261E; }  /* cru : rouge viande */
.cuisson[data-niveau="2"] { --cuisson: #D9707E; }                              /* tiède : rosé */
.cuisson[data-niveau="3"] { --cuisson: #E8601C; }                              /* ça mijote : orange cocotte */
.cuisson[data-niveau="4"] { --cuisson: #E0A21E; }                              /* presque à point : doré */
.cuisson[data-niveau="5"] { --cuisson: #A8642A; }                              /* à point : caramel */
.cuisson[data-niveau="6"] { --cuisson: #5C2E12; }                              /* digne d'un chef : brun chocolat */
.cuisson[data-niveau="5"] .cuisson-libelle, .cuisson[data-niveau="6"] .cuisson-libelle { color: var(--cuisson); }
@media (prefers-reduced-motion: reduce) { .cuisson-barre span, .force-mdp li { transition: none; } }

/* Champ mot de passe avec bouton œil */
.champ-mdp { position: relative; display: flex; flex-direction: column; }
.champ-mdp input { padding-right: 52px; }
.voir-mdp {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: #A08066; cursor: pointer;
}
.voir-mdp:hover, .voir-mdp[aria-pressed="true"] { color: var(--accent-fort); }
.voir-mdp:focus-visible { outline: 3px solid var(--mise-en-avant); }
.voir-mdp svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Icônes des champs (charte : chaque champ a sa petite icône au début) ---------- */
:root {
  --icone-crayon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='M13.5 6.5l4 4'/%3E%3C/svg%3E");
  --icone-email: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E");
  --icone-envoi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2L11 13'/%3E%3Cpath d='M22 2l-7 20-4-9-9-4z'/%3E%3C/svg%3E");
  --icone-cadenas: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
  --icone-personne: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
  --icone-serveur: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='7' rx='2'/%3E%3Crect x='3' y='13' width='18' height='7' rx='2'/%3E%3Cpath d='M7 7.5h.01M7 16.5h.01'/%3E%3C/svg%3E");
  --icone-prise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2v5M15 2v5M6 7h12v4a6 6 0 0 1-12 0z'/%3E%3Cpath d='M12 17v5'/%3E%3C/svg%3E");
  --icone-base: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5'/%3E%3Cpath d='M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3'/%3E%3C/svg%3E");
  --icone-maison: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8'/%3E%3Cpath d='M5 9v12h14V9'/%3E%3Cpath d='M10 21v-6h4v6'/%3E%3C/svg%3E");
  --icone-recherche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-5-5'/%3E%3C/svg%3E");
  --icone-cle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='M11 12l9-9M16 7l3 3'/%3E%3C/svg%3E");
  --icone-horloge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A08066' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}
input[type=email], input[name=email], input[name=expediteur] { --icone: var(--icone-email); }
input[name=destinataire] { --icone: var(--icone-envoi); }
input[type=password], .champ-mdp input { --icone: var(--icone-cadenas); }
input[type=search], input[name=q] { --icone: var(--icone-recherche); }
input[name=identifiant], input[name=admin_user], input[name=user_dedie], input[name=utilisateur], input[name=prenom] { --icone: var(--icone-personne); }
input[name=host], input[name=hote] { --icone: var(--icone-serveur); }
input[name=port] { --icone: var(--icone-prise); }
input[name=name] { --icone: var(--icone-base); }
input[name=nom] { --icone: var(--icone-maison); }
input[name=code], input[name=jeton] { --icone: var(--icone-cle); }
input[type=number] { --icone: var(--icone-horloge); }
select { padding-left: 14px; }
/* Le sélecteur garde sa flèche à droite, sans icône à gauche */
.code { padding-left: 44px; padding-right: 44px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23C24E17' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-size: 14px 9px;
}
input[type=email][name=identifiant] { --icone: var(--icone-email); }

/* ---------- Pages d'accès du foyer : plan de travail, logo en grand, fiche posée ---------- */
.page-acces .entete { padding: var(--esp-6) var(--esp-4) var(--esp-3); }
.page-acces .entete-logo { max-width: 240px; filter: drop-shadow(0 6px 14px rgba(60, 30, 10, .25)); }
.page-acces .page { max-width: 460px; }
.page-acces .carte { transform: rotate(-.6deg); box-shadow: 0 2px 0 rgba(78, 40, 16, .08), 0 18px 40px rgba(60, 30, 10, .28); }
.page-acces .carte::after {
  /* petit ruban adhésif qui tient la fiche sur le plan de travail */
  content: ""; position: absolute; top: -12px; left: 50%; width: 96px; height: 24px; margin-left: -48px;
  background: rgba(255, 244, 214, .75); border: 1px solid rgba(160, 128, 102, .25); transform: rotate(2deg);
}
.page-acces .carte { position: relative; }
.page-acces .pied { color: rgba(255, 250, 240, .85); }
@media (max-width: 699px) {
  .page-acces .entete { padding-top: var(--esp-5); }
  .page-acces .entete-logo { max-width: 190px; }
}
/* Téléphone en paysage : logo à gauche, fiche à droite */
@media (orientation: landscape) and (max-height: 520px) {
  .page-acces .entete { display: block; position: fixed; left: 0; top: 0; bottom: 0; width: 38%; display: grid; place-items: center; padding: var(--esp-4); }
  .page-acces .entete-logo { max-width: 200px; }
  .page-acces .page { margin-left: 38%; max-width: none; width: 62%; padding-top: var(--esp-5); }
  .page-acces .pied { margin-left: 38%; }
}
@media (prefers-reduced-motion: reduce) { .page-acces .carte { transform: none; } }
.page-acces .formulaire > .bouton { align-self: stretch; width: 100%; }
/* Tablette : logo en grand en haut, fiche de connexion dessous */
@media (min-width: 700px) and (min-height: 521px) {
  .page-acces .entete { padding-top: var(--esp-7); }
  .page-acces .entete-logo { max-width: 320px; }
  .page-acces .page { max-width: 540px; }
}
.page-acces .entete-logo { width: 240px; height: auto; }
@media (max-width: 699px) { .page-acces .entete-logo { width: 190px; } }
@media (min-width: 700px) and (min-height: 521px) { .page-acces .entete-logo { width: 320px; } }
@media (orientation: landscape) and (max-height: 520px) { .page-acces .entete-logo { width: 200px; } }

/* Interrupteur (charte) : une option oui / non, sans fond coloré autour */
.interrupteur { display: inline-flex; align-items: center; gap: var(--esp-3); margin-top: var(--esp-4); font-weight: 600; cursor: pointer; min-height: var(--cible); }
.interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interrupteur-piste { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--ligne); transition: background-color .2s; }
.interrupteur-piste::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(60, 30, 10, .3); transition: transform .2s; }
.interrupteur input:checked + .interrupteur-piste { background: var(--accent-fort); }
.interrupteur input:checked + .interrupteur-piste::after { transform: translateX(18px); }
.interrupteur input:focus-visible + .interrupteur-piste { outline: 3px solid var(--mise-en-avant); outline-offset: 2px; }
.formulaire > .interrupteur { align-self: flex-start; }
@media (prefers-reduced-motion: reduce) { .interrupteur-piste, .interrupteur-piste::after { transition: none; } }
/* Badges des étapes de l'installation : toujours visibles, sous « Étape x sur y » sur téléphone */
@media (max-width: 699px) {
  .etapes { gap: var(--esp-1); margin-bottom: var(--esp-4); font-size: .78rem; }
  .etapes li { padding: 3px 9px; white-space: nowrap; }
}

/* ---------- Pied de page : toujours en bas de l'écran, jamais par-dessus le contenu ---------- */
body { min-height: 100vh; min-height: 100dvh; }
body > main { flex: 1 0 auto; }
.pied { flex: none; }
.avec-nav .pied { padding-bottom: var(--esp-3); }
/* Rail vertical en paysage : le pied suit le contenu à droite du rail */
@media (orientation: landscape) and (max-height: 520px) {
  .avec-nav .pied { margin-left: 84px; }
}

/* ---------- Connexion compacte : tient sans défiler sur téléphone ---------- */
@media (max-width: 699px) and (max-height: 820px) {
  .page-acces .entete { padding: var(--esp-4) var(--esp-4) var(--esp-2); }
  .page-acces .entete-logo { width: 150px; }
  .page-acces .carte { padding: var(--esp-4) var(--esp-4); }
  .page-acces .carte h1 { margin-bottom: var(--esp-1); }
  .page-acces .formulaire label:not(.interrupteur) { margin-top: var(--esp-3); }
  .page-acces .interrupteur { margin-top: var(--esp-2); }
  .page-acces .formulaire > .bouton { margin-top: var(--esp-4); }
  .page-acces .lien-secondaire { margin-top: var(--esp-3); }
  .page-acces .pied { padding: var(--esp-2); }
}
@media (max-width: 699px) and (max-height: 680px) {
  .page-acces .entete-logo { width: 120px; }
  .page-acces .carte > p { display: none; }
}

/* Activité du compte (foyer) : une ligne par événement, la gravité en couleur */
.activite { list-style: none; margin: 0; padding: 0; }
.activite li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: var(--esp-3); align-items: baseline; padding: var(--esp-2) 0; border-bottom: 1px dashed var(--ligne); }
.activite-point { width: 8px; height: 8px; border-radius: 50%; background: #B9A48F; align-self: center; }
.activite .niveau-attention .activite-point, .activite li.niveau-attention .activite-point { background: var(--mise-en-avant); }
.activite li.niveau-erreur .activite-point { background: var(--erreur); }
.activite-texte { display: flex; flex-direction: column; min-width: 0; }
.activite-texte small { color: var(--texte-doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activite time { font-size: .85rem; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.liste-simple { padding-left: 1.2em; margin: 0 0 var(--esp-3); }
.liste-simple li { margin: var(--esp-1) 0; color: var(--texte-doux); }
.lien-discret { font-size: .85rem; color: var(--texte-doux); }
.page-acces .lien-discret { display: inline-block; margin-left: var(--esp-3); }

/* Boutons : une couleur par type d'action (voir charte) */
.bouton { background: var(--bouton-principal, var(--accent-fort)); color: var(--accent-texte); }
.bouton.valider { background: var(--bouton-valider); color: #fff; }
.bouton.attention { background: var(--bouton-attention); color: var(--bouton-attention-texte); }
.bouton.bouton-danger, .bouton-danger { background: var(--bouton-danger); color: #fff; }
.bouton.discret { background: var(--surface); color: var(--texte); box-shadow: inset 0 0 0 2px var(--ligne); }
.bouton.discret:hover { box-shadow: inset 0 0 0 2px var(--texte-doux); }
.bouton:hover:not(.discret) { filter: brightness(1.06); }


/* Textes posés sur le fond (hors cartes) : par défaut identiques au thème ; à la craie sur l'ardoise */
.barre-titre h1, .page > h1, .page > h2 { color: var(--sur-fond, var(--titre-couleur)); }
.salut, .page > .aide, .pied { color: var(--sur-fond-doux, var(--texte-doux)); }
.page > p { color: var(--sur-fond-doux, inherit); }
[data-theme="plan-travail"] .barre-titre h1, [data-theme="plan-travail"] .page > h1, [data-theme="plan-travail"] .page > h2 {
  font-family: var(--sur-fond-police); font-weight: 700; font-size: calc(1.55rem * var(--sur-fond-echelle)); letter-spacing: .01em;
  text-shadow: 0 0 1px rgba(241, 238, 230, .55), 0 0 6px rgba(241, 238, 230, .18);
}
[data-theme="plan-travail"] .page > h2 { font-size: calc(1.2rem * var(--sur-fond-echelle)); }
[data-theme="plan-travail"] .salut { font-family: var(--sur-fond-police); font-size: 1.3rem; }
/* Logo lisible sur l'ardoise : halo de craie */
/* Ardoise : le nom passe en crème (version claire du logo) */
[data-theme="plan-travail"] .logo-sombre { display: none; }
[data-theme="plan-travail"] .logo-clair { display: block; }
[data-theme="plan-travail"] .page-acces .entete { background: radial-gradient(ellipse 260px 150px at 50% 55%, rgba(255, 249, 238, .16), transparent 72%); }

/* ---------- La Tablée et La Semaine ---------- */
.lien-retour { display: inline-flex; align-items: center; gap: var(--esp-1); min-height: var(--cible); font-weight: 700; text-decoration: none; color: var(--sur-fond, var(--accent-fort)); }
.lien-retour .icone { width: 1.1em; height: 1.1em; }
.carte.vide { text-align: center; }
.carte.vide .tuile-icone { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; margin-bottom: var(--esp-3); }
.carte.vide .bouton { margin-top: var(--esp-4); }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--tuile-icone-fond); color: var(--tuile-icone); font-family: var(--police-titre); font-weight: 700; font-size: 1.25rem;
  box-shadow: inset 0 0 0 2px var(--surface-bord, var(--ligne));
}
.membres { list-style: none; margin: 0 0 var(--esp-4); padding: 0; display: grid; gap: var(--esp-3); }
@media (min-width: 700px) and (min-height: 521px) { .membres { grid-template-columns: repeat(2, 1fr); gap: var(--esp-4); } }
.membre {
  display: flex; align-items: center; gap: var(--esp-3); min-height: 76px; padding: var(--esp-3) var(--esp-4);
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); color: var(--texte); text-decoration: none;
}
.membre-texte { flex: 1; min-width: 0; display: grid; gap: 2px; }
.membre-texte strong { font-family: var(--police-titre); font-weight: var(--titre-graisse); font-size: 1.1rem; color: var(--titre-couleur); }
.membre-texte small { color: var(--texte-doux); font-weight: 600; }
.membre-texte .etiquettes { margin-top: var(--esp-1); }
.etiquette.alerte-douce { background: var(--accent-doux); color: var(--accent-fort); }
.membre .chevron { width: 1.1em; height: 1.1em; color: var(--texte-doux); }
.puce span small { display: block; font-size: .72rem; font-weight: 600; opacity: .75; margin-left: 6px; }
.puce span:has(small) { gap: 2px; }
.puces-allergies .puce span { padding: 0 14px; }
.membres-tutoriel { list-style: none; margin: 0 0 var(--esp-4); padding: 0; display: grid; gap: var(--esp-2); }
.membres-tutoriel li { display: flex; align-items: center; gap: var(--esp-3); padding: var(--esp-2) 0; border-bottom: 1px solid var(--ligne); }
.membres-tutoriel li > span:not(.avatar) { flex: 1; min-width: 0; }
.membres-tutoriel small { color: var(--texte-doux); font-weight: 600; }
.membres-tutoriel form { margin: 0; }
.membres-tutoriel .avatar { width: 40px; height: 40px; font-size: 1.05rem; }

.grille-jours { display: grid; gap: var(--esp-4); }
.grille-jours > .carte { margin-top: 0; }
@media (min-width: 700px) and (min-height: 521px) { .grille-jours { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) and (min-height: 521px) { .grille-jours { grid-template-columns: repeat(3, 1fr); } }
.jour h2 { margin: 0 0 var(--esp-3); display: flex; align-items: center; flex-wrap: wrap; gap: var(--esp-2); }
.jour.aujourdhui { box-shadow: 0 0 0 3px var(--accent), var(--ombre); }
.jour.passe > * { filter: grayscale(1); }   /* jours passés : couleurs éteintes, texte toujours lisible (plus d'estompage) */
.jour.passe { background-color: color-mix(in srgb, var(--surface) 88%, var(--ligne)); }
.repas-type + .repas-type { margin-top: var(--esp-3); }
.repas-type .libelle { margin: 0 0 var(--esp-2); }
.presences .puce span { padding: 0 16px; }
.presences .puce input:not(:checked) + span { text-decoration: line-through; color: var(--texte-doux); border-style: dashed; }
.barre-enregistrer { margin-top: var(--esp-5); }
.semaine-type .barre-enregistrer .bouton { width: 100%; }

.semaines { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-2); margin: 0 0 var(--esp-4); }
.semaines .bouton { min-width: var(--cible); padding: 0 var(--esp-3); }
.semaine-courante { display: grid; justify-items: center; gap: 2px; line-height: 1.2; font-weight: 800; color: var(--sur-fond, var(--titre-couleur)); }
.semaine-courante .semaine-nom { font-size: .85rem; font-weight: 700; color: var(--sur-fond-doux, var(--texte-doux)); }
a.semaine-nom { min-height: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--accent-fort); }
.semaine-courante .semaine-dates { font-size: 1.15rem; }
.repas-jour { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-2); }
.repas {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "moment couverts" "plat plat"; align-items: center; gap: 2px var(--esp-3);
  min-height: var(--cible); padding: var(--esp-2) var(--esp-3); border-radius: calc(var(--rayon) - 4px);
  background: var(--fond-champ, rgba(127, 127, 127, .06)); border: 1px solid var(--ligne); color: var(--texte); text-decoration: none;
}
.repas-moment { grid-area: moment; font-weight: 800; }
.couverts { grid-area: couverts; }
.repas-plat { grid-area: plat; color: var(--texte-doux); font-style: italic; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.couverts { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: .9rem; white-space: nowrap; background: var(--secondaire-doux); color: var(--secondaire); }
.couverts .icone { width: 1.1em; height: 1.1em; }
.couverts.modifie { background: var(--accent-doux); color: var(--accent-fort); }
.couverts.aucun { background: transparent; color: var(--texte-doux); box-shadow: inset 0 0 0 1px var(--ligne); }
.compteur { display: flex; align-items: center; gap: var(--esp-2); }
.compteur input { width: 5.5em; text-align: center; flex: none; }
.compteur .bouton { width: var(--cible); min-width: var(--cible); padding: 0; flex: none; }
.compteur .icone { width: 1.2em; height: 1.2em; }
input[name=invites], input[name=prenom] { --icone: var(--icone-personne); }
.compteur .bouton { height: var(--cible); margin: 0; align-self: center; }
.compteur input { margin: 0; }
.semaines .bouton { width: auto; flex: none; margin: 0; background: var(--surface); }
.semaines .semaine-courante, .semaines .bouton:not([aria-label]) { flex: 1; text-align: center; white-space: nowrap; }

/* ---------- Décor : calque fixe derrière le contenu ----------
   Couleur, texture, croquis et illustrations restent immobiles ; seul le contenu défile.
   Hauteur « grande fenêtre » (lvh) : aucun saut quand la barre d'adresse du téléphone apparaît.
   Illustrations entières, composées selon la page (data-scene). Absent en mode cuisine, sur la vitrine et à l'impression. */
body { position: relative; isolation: isolate; }
/* Le fond ne bouge jamais :
   - pages du foyer : seul le contenu défile (le corps de page est la zone de défilement), la page elle-même reste immobile,
     donc la barre d'adresse du téléphone ne se replie plus et l'écran ne change pas de taille ;
   - le calque est ancré en bas et prend la hauteur maximale de l'écran : si un navigateur replie quand même sa barre
     du haut, le bas de l'écran ne bouge pas et le fond non plus. */
html.defilement-interne { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.defilement-interne body { height: 100%; height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: none; }
html.defilement-interne:has(dialog[open]) body, html.defilement-interne.modale-ouverte body { overflow: hidden; }
.decor {
  position: fixed; top: auto; bottom: 0; left: 0; z-index: -1; width: 100%; height: 100vh; height: 100lvh;
  overflow: hidden; pointer-events: none;
  background: var(--fond-motif), var(--fond);
}
.decor-croquis, .decor-scene { position: absolute; inset: 0; }
.decor-croquis {
  background: var(--decor-couleur); opacity: var(--decor-opacite);
  -webkit-mask: url("../img/decor-cuisine.svg") 0 0 / 300px 300px repeat;
  mask: url("../img/decor-cuisine.svg") 0 0 / 300px 300px repeat;
}
.decor-scene {
  --k: 1;
  opacity: var(--scene-opacite, .92);
  background-image: var(--sA, none), var(--sB, none), var(--sC, none);
  background-repeat: no-repeat;
  background-position: right 12px top 14px, left 10px bottom 88px, right 14px bottom 104px;
  background-size: calc(var(--tA, 0px) * var(--k)) auto, calc(var(--tB, 0px) * var(--k)) auto, calc(var(--tC, 0px) * var(--k)) auto;
}
/* Téléphone : les cartes occupent toute la largeur, seule l'illustration de l'en-tête reste visible en entier */
@media (max-width: 699px) {
  .decor-scene { background-image: var(--sA, none); background-position: right 12px top 12px; background-size: var(--tA, 0px) auto; }
  /* Accueil : l'en-tête porte le bouton d'orientation, la tomate se pose dans la case libre près de La Tablée */
  .decor[data-scene="accueil"] .decor-scene { background-position: right 24px bottom 76px; --tA: 118px; }
  .page-acces .decor-scene { background-position: right 10px top 10px; }
}
@media (min-width: 700px) {
  .decor-croquis { -webkit-mask-size: 420px 420px; mask-size: 420px 420px; }
  .decor-scene { --k: 1.65; background-position: right 28px top 22px, left 26px bottom 30px, right 40px bottom 40px; }
}
/* Compositions par page */
.decor[data-scene="accueil"] .decor-scene { --sA: url("../img/decor-tomate.svg"); --tA: 118px; --sB: url("../img/decor-farine.svg"); --tB: 170px; --sC: url("../img/decor-epices.svg"); --tC: 62px; }
.decor[data-scene="semaine"] .decor-scene { --sA: url("../img/decor-carotte.svg"); --tA: 64px; --sB: url("../img/decor-salade.svg"); --tB: 96px; --sC: url("../img/decor-epices.svg"); --tC: 58px; }
.decor[data-scene="carnet"] .decor-scene { --sA: url("../img/decor-citron.svg"); --tA: 86px; --sB: url("../img/decor-farine.svg"); --tB: 170px; --sC: url("../img/decor-cuillere.svg"); --tC: 44px; }
.decor[data-scene="tablee"] .decor-scene { --sA: url("../img/decor-ail.svg"); --tA: 86px; --sB: url("../img/decor-persil.svg"); --tB: 116px; --sC: url("../img/decor-epices.svg"); --tC: 58px; }
.decor[data-scene="compte"] .decor-scene, .decor[data-scene=""] .decor-scene { --sA: url("../img/decor-epices.svg"); --tA: 60px; --sB: url("../img/decor-romarin.svg"); --tB: 130px; }
.decor[data-scene="garde-manger"] .decor-scene { --sA: url("../img/decor-ail.svg"); --tA: 80px; --sB: url("../img/decor-citron.svg"); --tB: 86px; --sC: url("../img/decor-sel.svg"); --tC: 70px; }
.decor[data-scene="acces"] .decor-scene { --sA: url("../img/decor-tomate.svg"); --tA: 96px; --sB: url("../img/decor-farine.svg"); --tB: 150px; }
/* Ardoise : texture de pierre et sel ; inscription à la craie sur tablette */
[data-theme="plan-travail"] .decor { background: url("../img/decor-ardoise.svg") 0 0 / 480px 480px repeat, var(--fond-motif), var(--fond); }
[data-theme="plan-travail"] .decor-scene { --sC: url("../img/decor-sel.svg"); --tC: 78px; }
@media (min-width: 700px) {
  [data-theme="plan-travail"] .decor::after {
    content: ""; position: absolute; right: 150px; bottom: 34px; width: 320px; height: 168px;
    background: url("../img/decor-craie.svg") center / contain no-repeat;
  }
  [data-theme="plan-travail"] .page-acces .decor::after, [data-theme="plan-travail"] .decor[data-scene="acces"]::after { display: none; }
}
body.vitrine .decor, body.mode-cuisine .decor { display: none; }
@media print { .decor { display: none; } }

/* ---------- Fenêtres (modales) : fond flouté et immobile, sortie par un bouton ---------- */
html:has(dialog[open]), html.modale-ouverte { overflow: hidden; }
dialog::backdrop { background: rgba(40, 24, 12, .3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@media (orientation: portrait) and (min-width: 700px) and (pointer: coarse) and (hover: none) {
  html:has(.modale-rotation.tablette-portrait), html:has(.modale-rotation.tablette-portrait) body { overflow: hidden; }
}
@media (min-width: 700px) {
  /* Accueil sur tablette : la tomate se pose dans la case libre, à droite de La Tablée */
  .decor[data-scene="accueil"] .decor-scene { background-position: right 90px bottom 120px, left 26px bottom 30px, right 40px bottom 40px; }
  [data-theme="plan-travail"] .decor[data-scene="accueil"]::after { display: none; }
}

/* ---------- À propos ---------- */
.a-propos-entete { display: flex; align-items: center; gap: var(--esp-4); margin-bottom: var(--esp-4); }
.a-propos-entete img { border-radius: 22px; box-shadow: 0 6px 18px rgba(60, 30, 10, .18); flex: none; }
.a-propos-entete h2 { margin: 0; font-size: calc(1.6rem * var(--titre-echelle)); }
.a-propos-slogan { margin: 0; font-weight: 700; color: var(--accent-fort); }
.a-propos-version { margin: var(--esp-1) 0 0; font-size: .9rem; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.propulse { font-size: 1.05rem; }
.langages { list-style: none; margin: 0 0 var(--esp-4); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--esp-2); }
.langages li { display: grid; gap: 2px; padding: var(--esp-2) var(--esp-3); border-radius: 12px; background: var(--accent-doux); }
.langages strong { color: var(--accent-fort); }
.langages span { font-size: .85rem; color: var(--texte-doux); }

/* ---------- Plats de La Semaine ---------- */
.proposer { margin: 0 0 var(--esp-4); }
.proposer .bouton { gap: var(--esp-2); }
.proposer .icone { width: 1.2em; height: 1.2em; }
.repas-plat.choisi { color: var(--texte); font-style: normal; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.repas-plat .icone { width: 1em; height: 1em; flex: none; color: var(--texte-doux); }
.repas-plat.a-revoir, .repas-plat.a-revoir .icone { color: var(--erreur); }
.au-menu .plat { display: grid; gap: var(--esp-2); padding: var(--esp-3) var(--esp-4); margin-bottom: var(--esp-4); border-radius: calc(var(--rayon) - 4px); background: var(--accent-doux); color: var(--texte); text-decoration: none; }
.au-menu .plat strong { font-family: var(--police-titre); font-weight: var(--titre-graisse); font-size: 1.2rem; color: var(--titre-couleur); }
.etiquette.garde { display: inline-flex; align-items: center; gap: 4px; }
.etiquette .icone { width: 1em; height: 1em; }
.au-menu .barre-actions form { margin: 0; }
.choix-recette { margin-top: var(--esp-4); }
.choix-recette > summary { list-style: none; }
.choix-recette > summary::-webkit-details-marker { display: none; }
.choix-recette[open] > summary { margin-bottom: var(--esp-3); }
.liste-recettes { display: grid; gap: var(--esp-2); max-height: 60vh; overflow-y: auto; padding: 2px; }
@media (min-width: 700px) { .liste-recettes { grid-template-columns: 1fr 1fr; } }
.barre-actions { display: flex; flex-wrap: wrap; gap: var(--esp-2); align-items: center; }
.barre-actions > form, .barre-actions > .bouton { margin: 0; }
@media (max-width: 699px) { .barre-actions > form, .barre-actions > form .bouton, .barre-actions > .bouton { width: 100%; } }
/* Titre du plat : jusqu'à deux lignes, jamais coupé au milieu d'un mot */
.repas-plat.choisi { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.repas-plat.choisi .icone { display: inline-block; vertical-align: -2px; margin-right: 4px; }

/* ---------- Le Marché ---------- */
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.preparer-liste .barre-actions form { flex: 1; }
.preparer-liste .barre-actions .bouton { width: 100%; }
.ajout-article { display: flex; gap: var(--esp-2); margin: 0 0 var(--esp-4); }
.ajout-article input { flex: 1; min-width: 0; margin: 0; }
.ajout-article .bouton { width: var(--cible); min-width: var(--cible); padding: 0; flex: none; margin: 0; }
.ajout-article .icone { width: 1.3em; height: 1.3em; }
.liste-courses { display: grid; gap: var(--esp-4); margin-bottom: var(--esp-4); }
@media (min-width: 700px) and (min-height: 521px) { .liste-courses { grid-template-columns: 1fr 1fr; align-items: start; } }
.liste-courses .carte { margin: 0; }
.rayon h2 { margin-bottom: var(--esp-2); }
.rayon ul { list-style: none; margin: 0; padding: 0; }
.rayon li + li { border-top: 1px solid var(--ligne); }
.rayon form { margin: 0; }
.article {
  display: flex; align-items: center; gap: var(--esp-3); width: 100%; min-height: var(--cible);
  padding: var(--esp-2) 0; border: 0; background: none; color: var(--texte); font: inherit; text-align: left; cursor: pointer;
}
.article .case { flex: none; width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--texte-doux) 55%, transparent); background: var(--surface); transition: background-color .15s; }
.article[aria-checked="true"] .case { background: var(--secondaire) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 18px no-repeat; box-shadow: none; }
.article-nom { flex: 1; min-width: 0; font-weight: 700; }
.article-quantite { flex: none; color: var(--texte-doux); font-weight: 700; font-variant-numeric: tabular-nums; }
.article[aria-checked="true"] .article-nom, .article[aria-checked="true"] .article-quantite { text-decoration: line-through; color: var(--texte-doux); opacity: .7; }
.article:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[data-partager] { gap: var(--esp-2); }
[data-partager] .icone { width: 1.1em; height: 1.1em; }
.ordre-rayons { list-style: none; margin: 0; padding: 0; counter-reset: rayon; }
.ordre-rayons li { display: flex; align-items: center; gap: var(--esp-2); padding: var(--esp-2) 0; counter-increment: rayon; }
.ordre-rayons li + li { border-top: 1px solid var(--ligne); }
.ordre-rayons li > span { flex: 1; font-weight: 700; }
.ordre-rayons li > span::before { content: counter(rayon) ". "; color: var(--texte-doux); }
.ordre-rayons form { margin: 0; }
.ordre-rayons .bouton { width: var(--cible); min-width: var(--cible); padding: 0; }
.ordre-rayons .monter .icone { transform: rotate(90deg); }
.ordre-rayons .descendre .icone { transform: rotate(90deg); }
.ordre-rayons .bouton[disabled] { opacity: .35; }
.decor[data-scene="marche"] .decor-scene { --sA: url("../img/decor-salade.svg"); --tA: 80px; --sB: url("../img/decor-carotte.svg"); --tB: 70px; --sC: url("../img/decor-citron.svg"); --tC: 70px; }
@media (max-width: 699px) { .preparer-liste .barre-actions form { flex: 1 1 100%; } }

/* ---------- Logo empilé (pages d'accès, installation) : emblème au-dessus du nom et du slogan ---------- */
.entete-logo { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; max-width: 180px; width: 100%; }
.entete-logo img { display: block; height: auto; }
.entete-logo .logo-icone { width: 54%; margin-bottom: var(--esp-2); border-radius: 22%; box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
.entete-logo .logo-nom { width: 100%; }
.logo-clair { display: none; }
.page-acces .entete-logo .logo-nom { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .55)); }

/* ---------- Fond photographique du thème Plan de travail (ardoise) ----------
   Porté par le calque fixe .decor : immobile sur toutes les pages, seul le contenu défile.
   Il remplace texture, croquis et illustrations. Réservé au thème Plan de travail.
   - Tablette paysage : fond complet.
   - Tablette portrait : recadrage centré.
   - Téléphone portrait : ardoise au centre, ingrédients des quatre coins de la photo posés sur les bords.
   - Téléphone paysage : fond complet, léger voile sombre derrière l'interface. */
[data-theme="plan-travail"] .decor { background: #1F2326 url("../img/fonds/ardoise-paysage.webp") center / cover no-repeat; }
[data-theme="plan-travail"] .decor-croquis,
[data-theme="plan-travail"] .decor-scene,
[data-theme="plan-travail"] .decor::after { display: none; }
/* Téléphone portrait */
@media (orientation: portrait) and (max-width: 699px) {
  [data-theme="plan-travail"] .decor {
    background:
      url("../img/fonds/ardoise-coin-hg.webp") left 0 top calc(100lvh - 100svh) / 72vw auto no-repeat,
      url("../img/fonds/ardoise-coin-hd.webp") right 0 top calc(100lvh - 100svh) / 32vw auto no-repeat,
      url("../img/fonds/ardoise-coin-bg.webp") left bottom / 62vw auto no-repeat,
      url("../img/fonds/ardoise-coin-bd.webp") right bottom / 58vw auto no-repeat,
      #1F2326 url("../img/fonds/ardoise-centre.webp") center / cover no-repeat;
  }
}
/* Téléphone paysage : version allégée et voile sombre */
@media (orientation: landscape) and (max-height: 520px) {
  [data-theme="plan-travail"] .decor { background-image: url("../img/fonds/ardoise-paysage-1024.webp"); }
  [data-theme="plan-travail"] .decor::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(16, 12, 9, .32); }
}
@media all {
  /* Textes posés sur la photo : ombre portée pour rester lisibles sur le torchon et les herbes */
  [data-theme="plan-travail"] .barre-titre h1, [data-theme="plan-travail"] .page > h1, [data-theme="plan-travail"] .page > h2,
  [data-theme="plan-travail"] .salut, [data-theme="plan-travail"] .page > .aide, [data-theme="plan-travail"] .page > p,
  [data-theme="plan-travail"] .pied, [data-theme="plan-travail"] .semaine-courante, [data-theme="plan-travail"] .lien-retour {
    text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 2px 10px rgba(0, 0, 0, .75);
  }
}

/* ---------- Fond photographique du thème Carnet (vieux papier, torchon, tomates, café) ----------
   Mêmes règles que l'ardoise : calque fixe, immobile, qui remplace texture, croquis et illustrations.
   - Tablette paysage : fond complet.
   - Tablette portrait : recadrage centré.
   - Téléphone portrait : papier au centre, torchon, tasse, tomates et crayon posés sur les bords.
   - Téléphone paysage : fond complet, léger voile sombre derrière l'interface. */
[data-theme="carnet"] .decor { background: #E9D6B4 url("../img/fonds/carnet-paysage.webp") center / cover no-repeat; }
[data-theme="carnet"] .decor-croquis,
[data-theme="carnet"] .decor-scene,
[data-theme="carnet"] .decor::after { display: none; }
@media (orientation: portrait) and (max-width: 699px) {
  [data-theme="carnet"] .decor {
    background:
      url("../img/fonds/carnet-coin-hg.webp") left 0 top calc(100lvh - 100svh) / 62vw auto no-repeat,
      url("../img/fonds/carnet-coin-hd.webp") right 0 top calc(100lvh - 100svh + 18vh) / 26vw auto no-repeat,
      url("../img/fonds/carnet-coin-bg.webp") left bottom / 62vw auto no-repeat,
      url("../img/fonds/carnet-coin-bd.webp") right bottom / 54vw auto no-repeat,
      #E9D6B4 url("../img/fonds/carnet-centre.webp") center / cover no-repeat;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  [data-theme="carnet"] .decor { background-image: url("../img/fonds/carnet-paysage-1024.webp"); }
  [data-theme="carnet"] .decor::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(40, 24, 10, .22); }
}
@media all {
  /* Textes posés sur le papier : halo crème pour rester lisibles sur le torchon, les tomates et les taches */
  [data-theme="carnet"] .barre-titre h1, [data-theme="carnet"] .page > h1, [data-theme="carnet"] .page > h2,
  [data-theme="carnet"] .salut, [data-theme="carnet"] .page > .aide, [data-theme="carnet"] .page > p,
  [data-theme="carnet"] .pied, [data-theme="carnet"] .semaine-courante, [data-theme="carnet"] .lien-retour,
  [data-theme="carnet"] .page > .entete-section h1 {
    text-shadow: 0 0 2px rgba(255, 246, 228, .95), 0 0 12px rgba(255, 246, 228, .9);
  }
}

/* ---------- Rythme vertical commun à toutes les pages (charte, § Structure) ----------
   Les blocs posés directement dans la page se suivent avec un seul écart : --esp-4 (16 px).
   Paires liées : titre → phrase d'aide --esp-1 ; lien de retour → titre --esp-2.
   Les marges propres des blocs sont neutralisées pour que l'écart ne dépende que de cette règle. */
body:not(.page-acces) main.page > *, main.office-page > * { margin-top: 0; margin-bottom: 0; }
body:not(.page-acces) main.page > * + *, main.office-page > * + * { margin-top: var(--esp-4); }
body:not(.page-acces) main.page > h1 + .aide, body:not(.page-acces) main.page > h1 + p,
main.office-page > h1 + .aide { margin-top: var(--esp-1); }
body:not(.page-acces) main.page > p:has(> .lien-retour) + *, main.office-page > .lien-retour + * { margin-top: var(--esp-2); }
.page .barre-titre { padding-top: 0; padding-bottom: 0; }
.barre-titre h1 + .salut, .barre-titre .salut { margin: var(--esp-1) 0 0; }
.lien-retour { min-height: 32px; }
/* Grilles de cartes : un seul écart, --esp-4 */
.tuiles, .membres, .grille-jours, .liste-courses, .grille-2 { gap: var(--esp-4); }
@media (min-width: 700px) and (min-height: 521px) { .tuiles { gap: var(--esp-4); } }
@media (orientation: landscape) and (max-height: 520px) { .tuiles { gap: var(--esp-4); } }
/* Dernier élément d'une carte : jamais de marge basse, même pour un texte d'aide */
.carte > .aide:last-child, .carte > p:last-child { margin-bottom: 0; }

/* ---------- En cuisine : plein écran, lisible à un mètre ---------- */
.en-cuisine { gap: var(--esp-2); margin-top: var(--esp-4); }
.en-cuisine .icone { width: 1.3em; height: 1.3em; }
body.mode-cuisine { background: var(--surface); }
body.mode-cuisine main.page { max-width: none; padding: 0; }
body.mode-cuisine .pied { display: none; }
.cuisine { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: var(--esp-4) var(--esp-4) calc(var(--esp-4) + 92px); }
.cuisine-haut { display: flex; align-items: center; gap: var(--esp-3); }
.cuisine-titre { flex: 1; min-width: 0; display: grid; }
.cuisine-titre strong { font-family: var(--police-titre); font-size: 1.15rem; color: var(--titre-couleur); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cuisine-titre span { color: var(--texte-doux); font-weight: 700; font-size: .9rem; }
.cuisine-progression { margin: 0; font-weight: 800; color: var(--accent-fort); white-space: nowrap; }
.minuteurs { display: flex; flex-wrap: wrap; gap: var(--esp-2); margin-top: var(--esp-3); }
.minuteurs[hidden] { display: none; }
.minuteur-actif { display: flex; align-items: center; gap: var(--esp-3); padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--accent-doux); box-shadow: inset 0 0 0 2px var(--accent); }
.minuteur-actif.pause { background: var(--surface); box-shadow: inset 0 0 0 2px var(--ligne); }
.minuteur-actif.sonne { background: var(--erreur); color: #fff; box-shadow: none; animation: minuteur-pulse 1s ease-in-out infinite; }
.minuteur-nom { font-weight: 700; }
.minuteur-temps { font-size: 1.35rem; font-variant-numeric: tabular-nums; min-width: 4.2ch; }
.minuteur-actif .bouton { min-height: 40px; padding: 0 14px; width: auto; margin: 0; }
.minuteur-retirer { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 1.4rem; cursor: pointer; }
@keyframes minuteur-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--erreur) 30%, transparent); } }
@media (prefers-reduced-motion: reduce) { .minuteur-actif.sonne { animation: none; } }

.cuisine-active .ecran:not(.actif) { display: none; }
.ecran { flex: 1; padding-top: var(--esp-5); }
.ecran + .ecran { border-top: 1px solid var(--ligne); }
.cuisine-active .ecran + .ecran { border-top: 0; }
.ecran h1 { font-size: clamp(1.8rem, 1.2rem + 2.5vw, 2.8rem); margin: 0 0 var(--esp-2); }
.mise-en-place-liste { list-style: none; margin: var(--esp-4) 0 0; padding: 0; display: grid; gap: 0 var(--esp-6); }
@media (min-width: 700px) { .mise-en-place-liste { grid-template-columns: 1fr 1fr; } }
.mise-en-place-liste li { border-bottom: 1px solid var(--ligne); }
.mise-en-place-liste .article { min-height: 56px; font-size: 1.15rem; }
.etape { display: grid; gap: var(--esp-5); align-content: start; }
@media (orientation: landscape) and (min-width: 700px) { .etape { grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); align-items: start; } }
.etape-numero { margin: 0 0 var(--esp-3); color: var(--texte-doux); font-weight: 800; font-size: 1.1rem; }
.etape-numero span { display: inline-grid; place-items: center; width: 2.4em; height: 2.4em; margin-right: var(--esp-2); border-radius: 50%; background: var(--accent); color: var(--accent-texte); font-size: 1.3rem; }
.etape-texte { margin: 0 0 var(--esp-5); font-size: clamp(1.5rem, 1.1rem + 2.2vw, 2.6rem); line-height: 1.35; font-weight: 600; color: var(--texte); }
.etiquette.pendant, .etiquette.aide-enfant { display: inline-flex; align-items: center; gap: 6px; font-size: 1rem; padding: 6px 12px; }
.etiquette.pendant { background: var(--mise-en-avant); color: #4E2810; }
.etiquette .icone { width: 1.1em; height: 1.1em; }
.lancer-minuteur { gap: var(--esp-2); font-size: 1.2rem; min-height: 64px; width: auto; padding: 0 28px; }
.lancer-minuteur .icone { width: 1.4em; height: 1.4em; }
.lancer-minuteur[disabled] { opacity: .6; }
.etape-ingredients { padding: var(--esp-5); border-radius: var(--rayon); background: var(--accent-doux); }
.etape-ingredients h2 { margin: 0 0 var(--esp-3); font-size: 1.1rem; }
.etape-ingredients ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-2); }
.etape-ingredients li { display: flex; justify-content: space-between; gap: var(--esp-3); font-size: 1.15rem; }
.fin { text-align: center; display: grid; justify-items: center; align-content: center; gap: var(--esp-3); }
.fin-icone { width: 96px; height: 96px; color: var(--accent); }
.fin .barre-actions { justify-content: center; }
.cuisine-nav {
  position: fixed; z-index: 30; inset: auto 0 0 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--esp-3);
  padding: var(--esp-3) var(--esp-4) calc(var(--esp-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--ligne); box-shadow: 0 -6px 18px rgba(0, 0, 0, .06);
}
.cuisine-nav .bouton { min-height: 64px; margin: 0; gap: var(--esp-2); font-size: 1.15rem; }
.cuisine-nav .icone { width: 1.3em; height: 1.3em; }
.cuisine-nav [data-suivant] { justify-self: end; }
.cuisine-nav [data-precedent][disabled] { visibility: hidden; }
.points { display: flex; gap: 6px; justify-content: center; }
.points span { width: 9px; height: 9px; border-radius: 50%; background: var(--ligne); }
.points span.fait { background: var(--accent); }
@media (min-width: 700px) { .cuisine-nav { grid-template-columns: 1fr 1fr 1fr; } .cuisine-nav .bouton { width: 100%; } }
@media (max-width: 699px) and (orientation: portrait) { .points { display: none; } .cuisine-nav { grid-template-columns: 1fr 1fr; } .cuisine-nav .bouton { width: 100%; } }
@media (orientation: landscape) and (max-height: 520px) {
  .cuisine { padding-bottom: calc(var(--esp-3) + 76px); }
  .cuisine-nav .bouton { min-height: 52px; }
  .ecran { padding-top: var(--esp-3); }
}
.cuisine-nav [hidden] { display: none !important; }
@media (max-width: 699px) and (orientation: portrait) {
  .cuisine-nav { padding-left: var(--esp-3); padding-right: var(--esp-3); gap: var(--esp-2); }
  .cuisine-nav .bouton { min-width: 0; padding: 0 var(--esp-3); font-size: 1.05rem; }
  .cuisine-titre strong { font-size: 1rem; }
}

/* ---------- En cuisine, version 2 : témoins, réglages, voix, veille, avis ---------- */
.cuisine-temoins { display: flex; gap: var(--esp-2); margin: 0; }
.temoin {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--secondaire-doux); color: var(--secondaire); font-weight: 800; font-size: .8rem; white-space: nowrap;
}
.temoin[hidden] { display: none; }
.temoin .icone { width: 16px; height: 16px; }
.temoin::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: temoin-vivant 1.6s ease-in-out infinite; }
@keyframes temoin-vivant { 50% { opacity: .3; } }
@media (max-width: 699px) { .temoin > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .temoin::before { animation: none; } }
.cuisine-haut [data-ouvrir-reglages][hidden] { display: none; }

.cuisine-annonce {
  position: fixed; z-index: 60; top: var(--esp-4); left: 50%; transform: translate(-50%, -12px); margin: 0;
  padding: 10px 20px; border-radius: 999px; background: var(--texte); color: var(--surface); font-weight: 800; font-size: 1.1rem;
  box-shadow: var(--ombre); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.cuisine-annonce.visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .cuisine-annonce { transition: none; } }

.etape-corps { display: flex; flex-direction: column; align-items: flex-start; gap: var(--esp-3); }
.etape-corps .etape-texte { margin-bottom: var(--esp-2); }
.etape-corps .lancer-minuteur, .etape-corps .lire-etape { margin: 0; }
.lire-etape { gap: var(--esp-2); min-height: 52px; width: auto; padding: 0 20px; }
.lire-etape[hidden] { display: none; }
.lire-etape .icone { width: 1.3em; height: 1.3em; }

/* Réglages : fenêtre, sortie par « Fermer » */
.reglages-cuisine {
  position: fixed; inset: 0; margin: auto; height: fit-content;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: var(--esp-5); border: 0; border-radius: var(--rayon); background: var(--surface); color: var(--texte); box-shadow: var(--ombre);
}
.reglages-cuisine[open] { display: flex; flex-direction: column; gap: var(--esp-4); }
.reglages-cuisine h2, .reglages-cuisine > .aide { margin: 0; }
.reglages-cuisine h2 + .aide { margin-top: calc(var(--esp-1) - var(--esp-4)); }
.reglages-cuisine fieldset { margin: 0; padding: var(--esp-4); border: 1px solid var(--ligne); border-radius: 14px; display: grid; gap: var(--esp-3); min-width: 0; }
.reglages-cuisine legend { display: flex; align-items: center; gap: var(--esp-2); padding: 0 var(--esp-2); font-weight: 800; font-size: 1.05rem; color: var(--titre-couleur); }
.reglages-cuisine legend .icone { width: 22px; height: 22px; color: var(--accent-fort); }
.reglages-cuisine .interrupteur { margin: 0; }
.reglages-cuisine .interrupteur:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.reglages-cuisine .aide { margin: 0; }
.reglage-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2); margin: 0; font-weight: 600; }
.reglage-ligne input[type=time] { width: auto; min-height: 44px; padding: 0 var(--esp-2); border: 2px solid var(--champ-bord); border-radius: var(--champ-rayon); background: var(--champ-fond); color: var(--texte); font: inherit; }
.reglages-cuisine > .bouton { align-self: stretch; margin: 0; }

/* Écran de veille : l'heure en grand, le menu du jour, les minuteurs ; un toucher le referme */
.veille {
  position: fixed; z-index: 80; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--esp-3);
  padding: var(--esp-6) var(--esp-5); text-align: center; cursor: pointer;
  background: radial-gradient(ellipse at 50% 35%, #3A2618 0%, #1C120B 70%); color: #FFF4E6;
  animation: veille-apparition .6s ease-out;
}
.veille[hidden] { display: none; }
.veille p { margin: 0; }
.veille-heure { font-family: var(--police-titre); font-size: clamp(5rem, 20vw, 11rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.veille-date { font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 700; color: #F2C79A; }
.veille-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--esp-3) var(--esp-6); margin: var(--esp-4) 0 0; }
.veille-menu div { display: grid; gap: 2px; }
.veille-menu dt { font-size: .95rem; font-weight: 800; color: #F2C79A; }
.veille-menu dd { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 700; }
.veille-etape { font-size: 1.05rem; color: #E6D3BE; }
.veille-minuteurs { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--esp-2); }
.veille-minuteur { padding: 8px 18px; border-radius: 999px; background: rgba(255, 244, 230, .12); font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.veille-minuteur.pause { opacity: .7; }
.veille-aide { margin-top: var(--esp-5) !important; font-size: .95rem; color: #BFA68D; }
.veille.soir { background: #0B0704; color: #9C8672; }
.veille.soir .veille-date, .veille.soir .veille-menu dt { color: #8A6A4E; }
.veille.soir .veille-etape, .veille.soir .veille-aide { color: #6E5A48; }
.veille.soir .veille-minuteur { background: rgba(255, 244, 230, .06); }
html.veille-active, html.veille-active body { overflow: hidden; }
@keyframes veille-apparition { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .veille { animation: none; } }
@media (orientation: landscape) and (max-height: 520px) { .veille { gap: var(--esp-2); padding: var(--esp-4); } .veille-heure { font-size: clamp(3.5rem, 16vh, 6rem); } .veille-menu { margin-top: var(--esp-2); } .veille-aide { margin-top: var(--esp-2) !important; } }

/* Avis de fin de recette */
.fin-formulaire { width: min(720px, 100%); display: grid; gap: var(--esp-3); justify-items: center; }
.fin-formulaire > .aide { margin: 0; }
.fin .avis-famille { width: 100%; text-align: left; display: grid; gap: var(--esp-4); margin: var(--esp-2) 0; }
.fin .bouton.terminer { margin: 0; min-width: min(320px, 100%); }
.avis-famille h2, .avis-famille .aide { margin: 0; }
.avis-famille h2 + .aide { margin-top: calc(var(--esp-1) - var(--esp-4)); }
.avis-famille ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-3); }
.avis-famille li { display: grid; gap: var(--esp-2); padding-bottom: var(--esp-3); border-bottom: 1px solid var(--ligne); }
.avis-famille li:last-child { padding-bottom: 0; border-bottom: 0; }
.avis-prenom { font-weight: 800; font-size: 1.1rem; }
.avis-choix .puce span { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; }
.avis-choix .icone { width: 20px; height: 20px; }
.avis-choix .avis-1 input:checked + span { background: var(--texte-doux); border-color: var(--texte-doux); }
.avis-famille .bouton { margin: 0; }
@media (min-width: 700px) { .avis-famille li { grid-template-columns: 8rem 1fr; align-items: center; } }

.avis-recette ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-2); }
.avis-recette h2 { margin-top: 0; }
.avis-recette li { display: flex; justify-content: space-between; align-items: center; gap: var(--esp-3); min-height: 44px; border-bottom: 1px solid var(--ligne); }
.avis-recette li:last-child { border-bottom: 0; }
.avis-recette li > span { font-weight: 700; }
.avis-recette strong { display: inline-flex; align-items: center; gap: 6px; }
.avis-recette .icone { width: 20px; height: 20px; }
.avis-recette .avis-3 strong { color: var(--accent-fort); }
.avis-recette .avis-2 strong { color: var(--secondaire); }
.avis-recette .avis-1 strong, .avis-recette em { color: var(--texte-doux); }
.avis-recette em { font-style: normal; }

/* ---------- Parcours « cuisiner » : un toucher depuis l'accueil ---------- */
.bouton.cuisiner { gap: var(--esp-2); }
.bouton.cuisiner .icone { width: 1.3em; height: 1.3em; }
.au-menu .bouton.cuisiner { width: 100%; }
.au-menu .changer-plat { margin: var(--esp-5) 0 var(--esp-2); font-size: .95rem; color: var(--texte-doux); }
.au-menu-du-jour h2 { margin: 0 0 var(--esp-3); }
.au-menu-du-jour ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-3); }
.au-menu-du-jour li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--esp-3); padding-top: var(--esp-3); border-top: 1px solid var(--ligne); }
.au-menu-du-jour li:first-child { padding-top: 0; border-top: 0; }
.repas-du-jour { display: grid; gap: 2px; min-width: 0; color: var(--texte); text-decoration: none; }
.repas-du-jour .moment { font-size: .9rem; font-weight: 700; color: var(--texte-doux); }
.repas-du-jour strong { font-family: var(--police-titre); font-weight: var(--titre-graisse); font-size: 1.15rem; color: var(--titre-couleur); overflow-wrap: anywhere; }
.au-menu-du-jour .bouton { margin: 0; width: auto; white-space: nowrap; }
@media (max-width: 380px) { .au-menu-du-jour li { grid-template-columns: 1fr; } .au-menu-du-jour .bouton { width: 100%; } }
.reprendre[hidden] { display: none; }
.reprendre .bouton { width: 100%; gap: var(--esp-2); margin: 0; }
.reprendre .icone { width: 1.2em; height: 1.2em; flex: none; }

.reglages-cuisine [data-https-seulement][hidden] { display: none; }
[data-theme="plan-travail"] .page > .reprendre { text-shadow: none; }

/* Page d'un repas : « Cuisiner » en haut, puis un seul formulaire (qui mange, quel plat), un seul « Valider » */
.page > .bouton.cuisiner { width: 100%; }
.repas-unique h2 { margin: 0; }
.repas-unique h2 ~ h2 { margin-top: var(--esp-6); }
.repas-unique h2 + .puces { margin-top: var(--esp-3); }
.choix-plat { display: grid; gap: var(--esp-2); margin-top: var(--esp-3); }
.choix-plat .choix-recette { margin: 0; }
.choix-plat .choix-recette > summary { list-style: none; cursor: pointer; }
.choix-plat .choix-recette > summary::-webkit-details-marker { display: none; }
.choix-plat .choix-recette > summary::after { content: "▾"; margin-left: auto; color: var(--texte-doux); }
.choix-plat .choix-recette[open] > summary { margin-bottom: var(--esp-2); border-color: var(--accent-fort); }
.choix-plat .choix-recette[open] > summary::after { content: "▴"; }
.choix-plat .choix-recette:has(input:checked) > summary { border-color: var(--accent-fort); background: var(--accent-doux); }
button.lien-secondaire { background: none; border: 0; padding: 0; font: inherit; font-size: .9rem; color: var(--accent-fort); text-decoration: underline; cursor: pointer; justify-self: center; min-height: 44px; }

/* ---------- Le Garde-manger ---------- */
.idees h2, .lieu h2 { margin: 0 0 var(--esp-3); }
.idees ul, .produits { list-style: none; margin: 0; padding: 0; display: grid; }
.idees li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--esp-3); padding: var(--esp-3) 0; border-top: 1px solid var(--ligne); }
.idees li:first-child { border-top: 0; padding-top: 0; }
.idees li:last-child { padding-bottom: 0; }
.idee { display: grid; gap: 2px; min-width: 0; color: var(--texte); text-decoration: none; }
.idee strong { font-family: var(--police-titre); font-weight: var(--titre-graisse); color: var(--titre-couleur); }
.idee span { font-size: .9rem; color: var(--texte-doux); }
.idees .bouton { margin: 0; width: auto; }
@media (max-width: 380px) { .idees li { grid-template-columns: 1fr; } .idees .bouton { width: 100%; } }
.ajout-produit > summary { list-style: none; cursor: pointer; }
.ajout-produit > summary::-webkit-details-marker { display: none; }
.ajout-produit > summary h2 { display: flex; align-items: center; gap: var(--esp-2); margin: 0; }
.ajout-produit > summary .icone { width: 1.1em; height: 1.1em; color: var(--accent-fort); }
.ajout-produit[open] > summary { margin-bottom: var(--esp-4); }
.quantite-unite { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--esp-3); margin-top: var(--esp-4); }
.quantite-unite > div { display: grid; gap: var(--esp-2); min-width: 0; }
.quantite-unite label { margin: 0; }
.produits li { border-top: 1px solid var(--ligne); }
.produits li:first-child { border-top: 0; }
.produit > summary { display: flex; align-items: center; gap: var(--esp-3); min-height: 52px; list-style: none; cursor: pointer; }
.produit > summary::-webkit-details-marker { display: none; }
.produit-nom { flex: 1; min-width: 0; font-weight: 700; }
.produit-quantite { color: var(--texte-doux); white-space: nowrap; }
.produit-date { padding: 2px 10px; border-radius: 999px; background: var(--secondaire-doux); color: var(--secondaire); font-size: .82rem; font-weight: 800; white-space: nowrap; }
.produit.etat-vite .produit-date { background: var(--mise-en-avant); color: #4E2810; }
.produit.etat-perime .produit-date { background: var(--erreur); color: #fff; }
.produit[open] { padding-bottom: var(--esp-4); }
.produit .formulaire .puces { margin-top: var(--esp-4); }
.tuile.a-surveiller small { color: var(--accent-fort); font-weight: 800; }
.quantite-unite input, .quantite-unite select { width: 100%; min-width: 0; box-sizing: border-box; }

/* Mini icône de chaque ingrédient (base commune Fluent Emoji) */
.icone-ingredient { flex: none; width: 1.5em; height: 1.5em; }
.ingredient, .article-nom, .produit-nom { display: inline-flex; align-items: center; gap: .5em; min-width: 0; }
.article[aria-checked="true"] .icone-ingredient { opacity: .5; filter: grayscale(1); }

/* ---------- Menu de la semaine à imprimer (A4 paysage) ---------- */
body.impression .decor, body.impression .pied { display: none; }
body.impression { background: #EDE6DA; }
body.impression main.page { max-width: 1100px; }
.barre-impression { display: flex; justify-content: space-between; gap: var(--esp-3); }
.barre-impression .bouton { margin: 0; width: auto; flex: none; white-space: nowrap; gap: var(--esp-2); }
/* Écran étroit : la feuille est montrée en entier, réduite à la largeur de l'écran (comme un aperçu avant impression) */
.menu-imprime.reduite { overflow: visible; }
.menu-imprime { background: #FFFDF8; color: #3B2414; border-radius: 12px; box-shadow: var(--ombre); padding: 28px 32px; overflow-x: auto; }
.menu-imprime header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 14px; border-bottom: 6px solid transparent;
  border-image: repeating-linear-gradient(90deg, #E8601C 0 10px, #FBF3E4 10px 20px) 6; }
.menu-imprime header img { height: 58px; width: auto; }
.menu-imprime header { min-width: 760px; }
/* À droite du logo, sur la même ligne : le titre, puis la période en toutes lettres dessous ; chacun sur une seule ligne */
.menu-imprime h1 { flex: 1; min-width: 0; margin: 0; display: grid; justify-items: end; gap: 2px; text-align: right;
  font-family: var(--police-titre); font-size: 1.3rem; line-height: 1.15; color: #5C2E12; overflow-wrap: normal; word-break: normal; hyphens: none; }
.menu-imprime h1 span { white-space: nowrap; }
.menu-imprime .menu-periode { font-family: var(--police-texte); font-weight: 700; font-size: .72em; color: #7A5A44; letter-spacing: .01em; }
.menu-imprime table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 5px; margin-top: 12px; table-layout: fixed; }
.menu-imprime thead th { font-size: .95rem; color: #5C2E12; padding: 4px; }
.menu-imprime thead small { display: block; font-weight: 600; font-size: .72rem; color: #5A6B2A; }
.menu-imprime tbody th { width: 30px; padding: 0; font-size: .9rem; color: #C24E17; text-align: center; }
.menu-imprime tbody th span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; }
.menu-imprime thead th:first-child { width: 30px; }
.menu-imprime td { vertical-align: top; padding: 8px 9px; border-radius: 10px; background: #FBF3E4; height: 92px; }
.menu-imprime td strong { display: block; font-size: .88rem; line-height: 1.22; color: #3B2414; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.menu-imprime td small { display: block; margin-top: 6px; font-size: .75rem; color: #7A5A44; }
.menu-imprime td.absent { background: transparent; color: #BCA48F; text-align: center; vertical-align: middle; }
@media print {
  /* Marges à zéro : le navigateur n'ajoute ni adresse ni date en haut et en bas ; la marge est donnée par la feuille */
  @page menu { size: A4 landscape; margin: 0; }
  .menu-imprime { page: menu; }
  html.defilement-interne, html.defilement-interne body { height: auto; overflow: visible; }
  body.impression { background: #fff; }
  body.impression main.page { max-width: none; padding: 0; margin: 0; }
  .barre-impression, .nav-basse, .info, .alerte { display: none !important; }
  .menu-imprime { box-shadow: none; border-radius: 0; padding: 10mm; overflow: visible; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .menu-imprime table { min-width: 0; }
  /* Feuille remplie, lisible de loin sur le frigo */
  .menu-imprime header { min-width: 0; }
  .menu-imprime h1 { font-size: 19pt; }
  .menu-imprime .menu-periode { font-size: 12pt; }
  .menu-imprime header img { height: 15mm; }
  .menu-imprime thead th { font-size: 12pt; }
  .menu-imprime tbody th { font-size: 12pt; }
  .menu-imprime td { height: 66mm; padding: 2.5mm; }
  .menu-imprime td strong { font-size: 10.5pt; line-height: 1.2; }
  .menu-imprime tbody th, .menu-imprime thead th:first-child { width: 8mm; }
  .menu-imprime td small { font-size: 9pt; }
}

/* ---------- Partager une recette ---------- */
.partage-recette h2 { margin: 0 0 var(--esp-3); }
.partage-recette p { margin: 0 0 var(--esp-3); }
.partage-recette .barre-actions .bouton { margin: 0; }
.partage-lien { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--esp-4); align-items: center; margin-bottom: var(--esp-4); }
.partage-lien .qr { width: 148px; min-height: 0; margin: 0; padding: 6px; background: #fff; border-radius: 12px; border: 1px solid var(--ligne); }
.partage-lien .qr img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; }
.partage-lien .bouton { margin: 0; gap: var(--esp-2); }
@media (max-width: 420px) { .partage-lien { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
body.page-partage main.page { max-width: 900px; }
.partage-entete { display: flex; justify-content: center; }
.partage-entete img { height: 56px; width: auto; }
.recette-partagee form .bouton { margin: var(--esp-4) 0 0; }

/* ---------- Le Marché intelligent ---------- */
.resume-marche p { margin: var(--esp-3) 0 0; }
.resume-marche .aide { margin-top: var(--esp-1); }
.periodes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--esp-2); }
.periodes form { margin: 0; display: grid; }
.periodes .puce-bouton { justify-content: center; padding: 0 10px; }
.puce-bouton {
  display: inline-flex; align-items: center; min-height: calc(var(--cible) - 6px); padding: 0 20px; cursor: pointer;
  border: 2px solid var(--ligne); border-radius: 999px; background: var(--surface); color: var(--texte); font: inherit; font-weight: 700;
}
.puce-bouton.active { border-color: var(--accent-fort); background: var(--accent-fort); color: var(--accent-texte); }
.puce-bouton:focus-visible { outline: 3px solid var(--mise-en-avant); }
.article-nom > span { display: grid; min-width: 0; }
.article-pour { font-weight: 400; font-size: .8rem; color: var(--texte-doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Passe charte du 15 novembre : cibles tactiles de 44 px au moins ---------- */
.ajout-produit > summary { min-height: 48px; display: flex; align-items: center; }
.lien-retour { display: inline-flex; align-items: center; min-height: 44px; }
/* lien secondaire : zone de toucher de 44 px sans changer l'écart visible (10 px de marge intérieure compensés) */
a.lien-secondaire { padding-block: 10px; margin-top: calc(var(--esp-4) - 10px); }
.ajouter-recette { margin: 0; gap: var(--esp-2); }
.etiquette.cuisine-fait { display: inline-flex; align-items: center; gap: 6px; background: var(--secondaire-doux); color: var(--secondaire); font-weight: 800; padding: 6px 12px; }
.etiquette.cuisine-fait .icone { width: 1em; height: 1em; }

/* ---------- Photos perso ---------- */
.couverture { display: block; margin: 0 0 var(--esp-4); }
.couverture img, img.couverture { display: block; width: 100%; height: auto; max-height: 340px; object-fit: cover; border-radius: 12px; }
.photos-recette h2 { margin: 0 0 var(--esp-3); }
.galerie { list-style: none; margin: 0 0 var(--esp-4); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--esp-2); }
.galerie img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; }
.galerie a { display: block; border-radius: 10px; }
.galerie a:focus-visible { outline: 3px solid var(--mise-en-avant); outline-offset: 2px; }
.ajout-photo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2); margin: 0; }
.ajout-photo .bouton, .photo-plat { margin: 0; gap: var(--esp-2); cursor: pointer; }
.ajout-photo label:focus-within, .photo-plat:focus-within { outline: 3px solid var(--mise-en-avant); outline-offset: 2px; }
.ajout-photo [hidden] { display: none; }
.photo-grande { margin: 0; padding: 0; overflow: hidden; }
.photo-grande img { display: block; width: 100%; height: auto; }
.photo-grande figcaption { padding: var(--esp-3) var(--esp-5); color: var(--texte-doux); font-size: .9rem; }
.carte-recette.avec-photo .vignette { display: block; width: 100%; height: 140px; object-fit: cover; border-radius: 10px; }

/* ---------- En-tête d'une recette : photo en grand, ou dessin aux couleurs du thème ---------- */
.entete-recette {
  position: relative; display: grid; align-items: end; overflow: hidden; isolation: isolate;
  min-height: clamp(220px, 58vw, 340px); border-radius: var(--rayon); box-shadow: var(--ombre);
}
.entete-recette .entete-image, .entete-recette .entete-image img { position: absolute; inset: 0; width: 100%; height: 100%; }
.entete-recette .entete-image { z-index: -1; display: block; }
.entete-recette .entete-image img { object-fit: cover; }
.entete-recette .entete-image:focus-visible { outline: 3px solid var(--mise-en-avant); outline-offset: -3px; }
.entete-texte { position: relative; padding: var(--esp-6) var(--esp-5) var(--esp-5); pointer-events: none; }
.entete-texte h1 { margin: 0 0 var(--esp-2); font-size: calc(1.7rem * var(--titre-echelle)); line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.entete-texte .meta { margin: 0; gap: 8px; }
.entete-texte .meta span { padding: 4px 12px 4px 8px; border-radius: 999px; }
/* photo : titre crème sur un dégradé sombre, pastilles givrées */
.entete-recette.avec-photo .entete-texte { background: linear-gradient(to top, rgba(33, 17, 8, .86), rgba(33, 17, 8, .45) 62%, rgba(33, 17, 8, 0)); }
.entete-recette.avec-photo h1 { color: #FFF8EE; font-family: var(--police-titre); text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.entete-recette.avec-photo .meta { color: #FFF8EE; }
.entete-recette.avec-photo .meta span { background: rgba(255, 248, 238, .16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.entete-recette.avec-photo .mijo { color: #FFF8EE; }
/* sans photo : fond doux du thème, grand ingrédient vedette dessiné, jamais un vide */
.entete-recette.dessinee {
  min-height: clamp(200px, 50vw, 280px);
  background:
    radial-gradient(circle at 86% 30%, color-mix(in srgb, var(--surface) 75%, transparent) 0 22%, transparent 22.5%),
    linear-gradient(135deg, var(--accent-doux), color-mix(in srgb, var(--accent-doux) 70%, var(--surface)));
}
.entete-dessin { position: absolute; inset: 0; z-index: -1; }
.icone-vedette { position: absolute; right: 5%; top: 7%; width: min(32%, 140px); height: auto; aspect-ratio: 1; transform: rotate(-8deg); filter: drop-shadow(0 8px 14px rgba(92, 46, 18, .18)); }
.entete-recette.dessinee h1 { padding-right: 36%; }
.entete-recette.dessinee .meta span { background: color-mix(in srgb, var(--surface) 70%, transparent); }
@media (min-width: 700px) and (min-height: 521px) {
  .entete-texte h1 { font-size: calc(2.2rem * var(--titre-echelle)); }
  .entete-recette.dessinee h1 { padding-right: 30%; }
}
.barre-titre-actions { display: flex; align-items: center; gap: var(--esp-2); }
.fiche-sous-entete .description-recette { margin: 0 0 var(--esp-2); font-size: 1.05rem; }
.ajout-entete { display: flex; margin: 0; padding: 0; }
.fiche-sous-entete > .en-cuisine { margin-top: var(--esp-3); }
.fiche-sous-entete > .etiquettes { margin-top: var(--esp-3); }
.lien-photo { display: inline-flex; align-items: center; gap: var(--esp-2); min-height: 44px; color: var(--accent-fort); font-weight: 800; cursor: pointer; }
.lien-photo .icone { width: 1.3em; height: 1.3em; }
.lien-photo:focus-within { outline: 3px solid var(--mise-en-avant); outline-offset: 2px; border-radius: 8px; }
.ajout-entete [hidden] { display: none; }
.entete-choisie { display: inline-block; }

/* Carnet : chaque carte a son en-tête (photo ou dessin) */
.carte-recette .vignette { display: block; width: 100%; height: 140px; object-fit: cover; border-radius: 10px; }
/* sans photo : une pastille dessinée à gauche du titre, la carte reste compacte */
.carte-recette:not(.avec-photo) { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: var(--esp-3); row-gap: 8px; align-items: start; }
.carte-recette:not(.avec-photo) > :not(.vignette) { grid-column: 2; }
.carte-recette .vignette.dessinee { grid-row: 1 / span 3; position: relative; width: 64px; height: 64px; border-radius: 16px; background: var(--accent-doux); }
.carte-recette .vignette.dessinee .icone-vedette { width: 44px; right: auto; left: 10px; top: 10px; transform: rotate(-8deg); filter: none; }
.actions-carnet { display: flex; flex-wrap: wrap; gap: var(--esp-2); }
.actions-carnet .bouton { margin: 0; gap: var(--esp-2); width: auto; }
.pastille-nombre { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--accent-fort); color: var(--accent-texte); font-size: .8rem; }
.page > .entete-section { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--esp-3); }
.page > .entete-section h1 { margin: 0; }
.entete-section .nouvelle-recette { margin: 0; width: auto; gap: var(--esp-2); }

/* ---------- Créer ou modifier une recette ---------- */
.choix-entete {
  position: relative; display: grid; place-items: center; overflow: hidden; height: 180px; margin: 0 0 var(--esp-4);
  border: 2px dashed var(--ligne); border-radius: var(--rayon); background: var(--accent-doux); cursor: pointer; color: var(--texte);
}
.choix-entete img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.choix-entete-dessin { position: absolute; inset: 0; }
.choix-entete-dessin .icone-vedette { width: 110px; top: 50%; transform: translateY(-50%) rotate(-8deg); opacity: .55; }
.choix-entete-texte { position: relative; display: inline-flex; align-items: center; gap: var(--esp-2); padding: 10px 16px; border-radius: 999px; background: var(--surface); box-shadow: var(--ombre); font-weight: 800; }
.choix-entete-texte .icone { width: 1.3em; height: 1.3em; color: var(--accent-fort); }
.choix-entete.avec-photo { border-style: solid; }
.choix-entete.avec-photo .choix-entete-texte { position: absolute; bottom: 12px; }
.choix-entete:focus-within { outline: 3px solid var(--mise-en-avant); outline-offset: 2px; }
.editeur-recette h2 { margin: var(--esp-6) 0 var(--esp-1); }
.editeur-recette h2 + .aide { margin: 0 0 var(--esp-3); }
.editeur-recette h2 + ul, .editeur-recette h2 + ol { margin-top: var(--esp-3); }
.grille-compteurs { display: grid; gap: var(--esp-4); }
.grille-compteurs label { display: block; margin-bottom: var(--esp-2); }
@media (min-width: 620px) { .grille-compteurs { grid-template-columns: repeat(3, auto); justify-content: start; column-gap: var(--esp-6); } }
.lignes-ingredients, .lignes-etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-3); }
.ligne-ingredient {
  display: grid; align-items: center; gap: var(--esp-2);
  grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 44px;
  grid-template-areas: "ico nom nom ret" ". qte uni .";
  padding-bottom: var(--esp-3); border-bottom: 1px dashed var(--ligne);
}
.ligne-ingredient .icone-ingredient { grid-area: ico; width: 24px; height: 24px; }
.ligne-ingredient input:not(.champ-quantite) { grid-area: nom; }
.ligne-ingredient .champ-quantite { grid-area: qte; }
.ligne-ingredient select { grid-area: uni; }
.ligne-ingredient .bouton-retirer { grid-area: ret; }
@media (min-width: 620px) {
  .ligne-ingredient { grid-template-columns: 26px minmax(0, 1fr) 5.5em 9.5em 44px; grid-template-areas: "ico nom qte uni ret"; }
}
.lignes-etapes { counter-reset: etape; }
.ligne-etape { position: relative; counter-increment: etape; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: var(--esp-2); }
.ligne-etape::before {
  content: counter(etape); grid-row: 1; margin-top: 10px; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--accent-fort); color: var(--accent-texte); font-weight: 800; font-size: .9rem;
}
.ligne-etape .options-etape { grid-column: 1 / -1; }
.ligne-etape textarea { width: 100%; min-height: 4.6em; resize: vertical; field-sizing: content; }
/* lignes d'ingrédients et d'étapes : l'icône de l'ingrédient (ou le numéro) remplace l'icône du champ */
.ligne-ingredient input, .ligne-ingredient select, .ligne-etape textarea { background-image: none; padding-left: 12px; }
.ligne-ingredient select { padding-right: 8px; }
.options-etape { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--esp-2); padding: 0 44px 0 36px; }
.options-etape .bouton-retirer { position: absolute; right: 0; bottom: 0; }
.puce.petite span { min-height: 40px; padding: 0 12px; font-size: .8rem; }
.bouton-retirer {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--texte-doux); cursor: pointer;
}
.bouton-retirer:hover, .bouton-retirer:focus-visible { background: var(--accent-doux); color: var(--accent-fort); }
.bouton-retirer .icone { width: 18px; height: 18px; }
.ajouter-ligne { margin: var(--esp-3) 0 0; width: auto; align-self: flex-start; gap: var(--esp-2); }
.reglages-semaine { margin-top: var(--esp-6); border-top: 1px solid var(--ligne); padding-top: var(--esp-4); }
.reglages-semaine > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--esp-2); min-height: 44px; cursor: pointer; font-weight: 800; font-size: 1.1rem; }
.reglages-semaine > summary .aide { font-weight: 600; font-size: .85rem; }
.reglages-semaine fieldset { border: 0; padding: 0; margin: var(--esp-4) 0 0; }
.reglages-semaine legend { font-weight: 700; margin-bottom: var(--esp-2); padding: 0; }
.reglages-semaine label[for] { display: block; margin: var(--esp-4) 0 var(--esp-2); }
.editeur-recette > .bouton[type=submit] { margin-top: var(--esp-6); }

/* ---------- Partage : envoi et page du lien ---------- */
.partage-envoi { min-width: 0; }
.partage-envoi .barre-actions { margin: 0 0 var(--esp-3); }
.lien-en-clair { width: 100%; font-size: .85rem; color: var(--texte-doux); }
.partage-envoi [hidden] { display: none; }
.partage-validite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--esp-3); padding: var(--esp-3) var(--esp-4); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); }
.partage-validite p { margin: 0; }
.partage-validite p .icone { width: 1.2em; height: 1.2em; margin-right: 6px; vertical-align: -.2em; color: var(--accent-fort); }
.partage-validite .bouton { margin: 0; width: auto; gap: var(--esp-2); }
.pied-impression { display: none; }
.meta-impression { margin: 0 0 var(--esp-3); }

/* Impression de la page du lien : A4 portrait, économe en encre, sauts de page maîtrisés */
@media print {
  @page { size: A4 portrait; margin: 14mm 14mm 16mm; }
  body.page-partage { background: #fff !important; color: #2B1A10; font-size: 10.5pt; }
  body.page-partage main.page { max-width: none; padding: 0; margin: 0; }
  body.page-partage .pied, body.page-partage .partage-validite, body.page-partage .ecran-seulement, body.page-partage .info, body.page-partage .alerte { display: none !important; }
  body.page-partage .partage-entete { justify-content: flex-start; margin: 0 0 4mm; }
  body.page-partage .partage-entete img { height: 12mm; }
  body.page-partage .entete-recette { min-height: 0; box-shadow: none; border-radius: 0; background: none; display: block; break-inside: avoid; }
  body.page-partage .entete-recette .entete-image { position: static; display: block; height: 55mm; margin-bottom: 4mm; }
  body.page-partage .entete-recette .entete-image img { position: static; height: 55mm; border-radius: 3mm; }
  body.page-partage .entete-dessin { display: none; }
  body.page-partage .entete-texte { padding: 0; background: none !important; }
  body.page-partage .entete-texte h1 { color: #5C2E12 !important; text-shadow: none; font-size: 22pt; margin: 0 0 2mm; }
  body.page-partage .entete-texte .meta, body.page-partage .entete-texte .mijo { color: #6B4A35 !important; }
  body.page-partage .entete-texte .meta span { background: none; backdrop-filter: none; padding: 0; }
  body.page-partage .mijo b { -webkit-print-color-adjust: exact; print-color-adjust: exact; width: 7mm; height: 7mm; font-size: 10pt; box-shadow: none; }
  body.page-partage .recette-partagee { box-shadow: none; border: 0; border-radius: 0; padding: 0; margin-top: 4mm; background: none; }
  body.page-partage .recette-partagee::before, body.page-partage .recette-partagee::after { display: none; }
  body.page-partage .fiche { display: block; margin-top: 3mm; }
  body.page-partage h2 { font-size: 13pt; color: #C24E17; margin: 5mm 0 2mm; padding-bottom: 1mm; border-bottom: .3mm solid #E8D9C4; break-after: avoid; page-break-after: avoid; }
  /* ingrédients sur deux colonnes, d'un bloc quand ils tiennent sur une page */
  body.page-partage .bloc-ingredients { break-inside: avoid; }
  body.page-partage .ingredients { columns: 2; column-gap: 10mm; }
  body.page-partage .ingredients li { break-inside: avoid; padding: 1.4mm 0; border-bottom: .2mm dotted #D8C6AE; }
  body.page-partage .icone-ingredient { width: 4mm; height: 4mm; }
  /* une étape n'est jamais coupée ; le titre n'est jamais seul en bas de page */
  body.page-partage .etapes-recette li { break-inside: avoid; page-break-inside: avoid; orphans: 3; widows: 3; margin-bottom: 2.5mm; }
  body.page-partage .etapes-recette li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.page-partage .minuteur { color: #6B4A35; }
  body.page-partage .pied-impression { display: block; margin-top: 8mm; padding-top: 2mm; border-top: .3mm solid #E8D9C4; font-size: 8.5pt; color: #8A6E58; text-align: center; break-inside: avoid; }
  body.page-partage p { orphans: 3; widows: 3; }
}

/* ---------- Mon compte : voix en cuisine (Louise, Victor) ---------- */
.voix-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--esp-3); margin: 0; }
.voix-carte { position: relative; display: grid; justify-items: center; gap: var(--esp-2); padding: var(--esp-4); border: 2px solid var(--ligne); border-radius: var(--rayon); background: var(--surface); cursor: pointer; text-align: center; }
.voix-carte input { position: absolute; opacity: 0; }
.voix-contenu { display: grid; justify-items: center; gap: 2px; }
.voix-icone { width: 72px; height: 72px; padding: 8px; border-radius: 50%; background: var(--accent-doux); color: var(--accent-fort); margin-bottom: var(--esp-1); }
.voix-contenu strong { font-size: 1.25rem; font-family: var(--police-titre); }
.voix-contenu span { color: var(--texte-doux); font-size: .9rem; font-weight: 700; }
.voix-carte:has(input:checked) { border-color: var(--accent-fort); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-fort) 25%, transparent); }
.voix-carte:has(input:checked) .voix-icone { background: var(--accent-fort); color: var(--accent-texte); }
.voix-carte:has(input:checked)::after { content: "✓"; position: absolute; top: 10px; right: 12px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-fort); color: var(--accent-texte); font-weight: 800; font-size: .9rem; }
.voix-carte:has(input:focus-visible) { outline: 3px solid var(--mise-en-avant); outline-offset: 2px; }
.voix-carte .bouton-ecouter { margin: 0; width: auto; min-height: 44px; gap: var(--esp-2); }
.voix-note { color: var(--texte-doux); font-size: .8rem; line-height: 1.3; }
.voix-cartes [hidden] { display: none; }
.voix-cartes > .bouton { grid-column: 1 / -1; }
/* Le Marché : repas encore sans plat, signalés */
.alerte-douce { display: flex; gap: var(--esp-2); align-items: flex-start; margin: var(--esp-3) 0 0; padding: var(--esp-2) var(--esp-3); border-radius: 12px; background: color-mix(in srgb, var(--mise-en-avant) 18%, var(--surface)); }
.alerte-douce .icone { flex: none; width: 1.2em; height: 1.2em; margin-top: 2px; color: #8A5A00; }
.alerte-douce a { font-weight: 800; color: var(--accent-fort); }
.pastille-repete { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: color-mix(in srgb, var(--mise-en-avant) 30%, var(--surface)); color: var(--texte); font-size: .75rem; font-weight: 800; vertical-align: 1px; white-space: nowrap; }
.voix-appareil { margin-top: var(--esp-4); }
.voix-appareil > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--accent-fort); }
.voix-appareil ul { margin: var(--esp-2) 0; padding-left: 1.2em; font-size: .9rem; }

/* ---------- Audit charte du 15 novembre : retours à la ligne et formats ---------- */
/* Titres, plats et choix : jamais un mot seul sur la dernière ligne quand le navigateur sait l'éviter */
h1, h2, h3, .repas-plat, .choix span, .menu-imprime td strong, .carte-recette h3, .entete-texte h1, label { text-wrap: pretty; }
/* Réglages du téléphone : inutiles sur tablette */
@media (min-width: 700px) and (min-height: 521px) { .reglage-telephone { display: none; } }
/* Éditeur : les trois compteurs passent à la ligne au lieu de déborder (téléphone en paysage avec le rail) */
@media (min-width: 620px) { .grille-compteurs { grid-template-columns: repeat(auto-fit, minmax(190px, max-content)); } }
.credits { list-style: none; margin: var(--esp-3) 0 0; padding: 0; display: grid; gap: var(--esp-1); }
/* « Cuisiner » d'un repas : le verbe, puis le nom du plat en petit dessous (deux lignes voulues, jamais coupées au hasard) */
.bouton.cuisiner .cuisiner-texte { display: grid; justify-items: center; line-height: 1.15; text-align: center; }
.bouton.cuisiner .cuisiner-texte small { font-size: .78rem; font-weight: 700; opacity: .9; text-wrap: balance; }
.periodes .puce-bouton { white-space: nowrap; padding: 0 6px; font-size: .88rem; }

/* ---------- Pages d'accès sur tablette en paysage : logo empilé à gauche, fiche à droite, sans défiler ----------
   8 pouces (≈ 960 × 600), 10 pouces (1280 × 800, 1180 × 820) et plus (1366 × 1024). */
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) {
  .page-acces .entete { position: fixed; left: 0; top: 0; bottom: 0; width: 42%; display: grid; place-items: center; padding: var(--esp-5); }
  /* Logo aussi grand que la colonne gauche le permet : limité par la largeur (34 vw) et par la hauteur (le logo empilé fait ≈ 1,1 × sa largeur) */
  .page-acces .entete-logo { width: min(34vw, 72dvh, 460px); max-width: none; }
  .page-acces .page { margin-left: 42%; width: 58%; max-width: none; min-height: 100dvh; display: grid; align-content: center; justify-items: center;
    padding: var(--esp-5) clamp(24px, 4vw, 72px) calc(var(--esp-6) + 20px); }
  .page-acces .page > * { width: 100%; max-width: 460px; }
  .page-acces .pied { position: fixed; right: 0; bottom: 0; width: 58%; margin: 0; padding: var(--esp-2); text-align: center; }
}
/* Tablette basse (8 pouces, 10 pouces Android à ~530-640 px de haut) : on resserre logo, fiche et espacements */
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) and (max-height: 700px) {
  .page-acces .page { padding-top: var(--esp-3); padding-bottom: calc(var(--esp-5) + 16px); }
  .page-acces .carte { padding: var(--esp-4) var(--esp-5); }
  .page-acces .carte h1 { margin-bottom: var(--esp-1); }
  .page-acces .formulaire label:not(.interrupteur) { margin-top: var(--esp-3); }
  .page-acces .interrupteur { margin-top: var(--esp-2); min-height: 44px; }
  .page-acces .formulaire > .bouton { margin-top: var(--esp-4); }
  .page-acces .lien-secondaire { margin-top: var(--esp-2); }
}
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) and (max-height: 700px) {
  .page-acces .carte { font-size: 1rem; }
  .page-acces .formulaire input:not([type=checkbox]), .page-acces .formulaire > .bouton { min-height: 50px; height: 50px; }
  .page-acces .carte h1 { font-size: 1.5rem; }
  .page-acces .lien-secondaire { min-height: 40px; display: inline-flex; align-items: center; }
}
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) and (max-height: 620px) {
  .page-acces .carte > p:first-of-type { display: none; }   /* la phrase d'introduction : le titre suffit */
  .page-acces .page { padding-bottom: var(--esp-6); }
  .page-acces .pied { font-size: .75rem; padding: 4px; }
}

/* ---------- Accueil compact (15 novembre 2026) : date sur la ligne du « Bonjour », midi et soir côte à côte ---------- */
.barre-titre .date-du-jour { margin: 0; flex: none; text-align: right; white-space: nowrap; font-weight: 700; }
.barre-titre .date-du-jour .date-courte { display: none; }
.barre-titre:has(.date-du-jour) h1 { flex: 1 1 auto; min-width: 0; text-wrap: pretty; }
@media (max-width: 559px) {
  .barre-titre .date-du-jour .date-longue { display: none; }
  .barre-titre .date-du-jour .date-courte { display: inline; }
}
/* Deux repas : une seule ligne coupée en deux (midi à gauche, soir à droite), même hauteur qu'une ligne */
.au-menu-du-jour ul.deux-repas { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--esp-4); }
.au-menu-du-jour ul.deux-repas li, .au-menu-du-jour ul.deux-repas li:first-child { padding-top: 0; border-top: 0; }
.au-menu-du-jour ul.deux-repas li + li { padding-left: var(--esp-4); border-left: 1px solid var(--ligne); }
.au-menu-du-jour .repas-du-jour strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: normal; text-wrap: pretty; }
/* Moitié étroite (téléphone portrait) : « Cuisiner » réduit à son icône, la ligne garde sa hauteur */
@media (max-width: 599px) {
  .au-menu-du-jour ul.deux-repas li { gap: var(--esp-2); }
  .au-menu-du-jour ul.deux-repas .bouton { width: 48px; min-width: 48px; padding: 0; justify-content: center; font-size: 0; }
  .au-menu-du-jour ul.deux-repas .bouton .icone { margin: 0; width: 24px; height: 24px; }
  .au-menu-du-jour ul.deux-repas .repas-du-jour strong { font-size: 1rem; }
  .au-menu-du-jour ul.deux-repas .etiquette.cuisine-fait { font-size: 0; padding: 6px; }
}
@media (max-width: 380px) { .au-menu-du-jour ul.deux-repas li { grid-template-columns: minmax(0, 1fr) auto; } .au-menu-du-jour ul.deux-repas .bouton { width: 48px; } }
/* Titre de l'accueil : jamais coupé au milieu d'un mot */
.page-accueil .barre-titre h1 { overflow-wrap: normal; word-break: normal; hyphens: none; }
@media (max-width: 559px) { .page-accueil .barre-titre h1 { font-size: 1.3rem; } .page-accueil .barre-titre { gap: var(--esp-2); } }
/* Moitié étroite : « 4 » au lieu de « 4 couverts », plat sur deux lignes au plus, boutons en icône seule */
@media (max-width: 599px) {
  .au-menu-du-jour ul.deux-repas .couverts-mot { display: none; }
  .au-menu-du-jour ul.deux-repas li { padding-left: 0; }
  .au-menu-du-jour ul.deux-repas li + li { padding-left: var(--esp-3); }
  .au-menu-du-jour ul.deux-repas { column-gap: var(--esp-3); }
  .au-menu-du-jour ul.deux-repas .etiquette.cuisine-fait .icone { margin: 0; }
}
/* Tablette : une ligne par moitié (plat sur une ligne, « … » si trop long, titre complet au survol) */
@media (min-width: 600px) {
  .au-menu-du-jour ul.deux-repas .repas-du-jour strong { -webkit-line-clamp: 1; }
}
/* Tablette en paysage : l'accueil tient sur un écran, les tuiles prennent la hauteur qui reste */
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) {
  .page-accueil .tuile { min-height: clamp(84px, calc((100dvh - 330px) / 2), 200px); }
}
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) and (max-height: 700px) {
  .page-accueil .tuile { flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--esp-4); padding: var(--esp-4); }
  .page-accueil .au-menu-du-jour { padding-top: var(--esp-4); padding-bottom: var(--esp-4); }
  .page-accueil .au-menu-du-jour h2 { margin-bottom: var(--esp-2); }
  .page-accueil .page { padding-top: var(--esp-3); }
  .page-accueil .pied { padding-top: var(--esp-2); padding-bottom: var(--esp-2); }
}
/* Selon la largeur réelle de la carte (téléphone paysage, tablette 8-10 pouces) : en dessous de 760 px, boutons en icône seule */
.au-menu-du-jour { container-type: inline-size; }
@container (max-width: 760px) {
  .au-menu-du-jour ul.deux-repas li { gap: var(--esp-2); }
  .au-menu-du-jour ul.deux-repas .bouton { width: 48px; min-width: 48px; padding: 0; justify-content: center; font-size: 0; }
  .au-menu-du-jour ul.deux-repas .bouton .icone { margin: 0; width: 24px; height: 24px; }
  .au-menu-du-jour ul.deux-repas .etiquette.cuisine-fait { font-size: 0; padding: 6px; }
  .au-menu-du-jour ul.deux-repas .etiquette.cuisine-fait .icone { margin: 0; }
}
/* Téléphone portrait (moitiés de moins de 200 px) : bouton rond en haut à droite, plat sur toute la largeur de la moitié */
@container (max-width: 420px) {
  .au-menu-du-jour ul.deux-repas li { display: block; position: relative; }
  .au-menu-du-jour ul.deux-repas .repas-du-jour .moment { padding-right: 46px; min-height: 40px; display: flex; align-items: center; }
  .au-menu-du-jour ul.deux-repas .bouton, .au-menu-du-jour ul.deux-repas .etiquette.cuisine-fait { position: absolute; top: 0; right: 0; width: 44px; min-width: 44px; height: 44px; min-height: 44px; border-radius: 50%; }
  .au-menu-du-jour ul.deux-repas li + li .bouton, .au-menu-du-jour ul.deux-repas li + li .etiquette.cuisine-fait { right: 0; }
  .au-menu-du-jour ul.deux-repas .etiquette.cuisine-fait { display: grid; place-items: center; padding: 0; }
}
.au-menu-du-jour ul.deux-repas .etiquette.cuisine-fait .icone { width: 20px; height: 20px; flex: none; }

/* ---------- La Semaine : « Proposer » et « Imprimer » (15 novembre 2026) ---------- */
.actions-semaine { display: grid; gap: var(--esp-3); }
.actions-semaine > * { margin: 0; }
.actions-semaine .imprimer-lien .bouton { box-shadow: none; border: 2px solid var(--ligne); background: var(--surface); filter: none; }
.actions-semaine .imprimer-lien .bouton:hover { box-shadow: none; border-color: var(--texte-doux); }
@media (min-width: 700px) and (min-height: 521px) {
  .actions-semaine { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-4); }
}

/* ---------- Semaine type sur tablette (15 novembre 2026) : les 7 jours sur un écran, badges un par ligne, hauteur selon l'écran et le nombre de personnes ---------- */
.semaine-type.nb-1 { --nb: 1; }
.semaine-type.nb-2 { --nb: 2; }
.semaine-type.nb-3 { --nb: 3; }
.semaine-type.nb-4 { --nb: 4; }
.semaine-type.nb-5 { --nb: 5; }
.semaine-type.nb-6 { --nb: 6; }
.semaine-type.nb-7 { --nb: 7; }
.semaine-type.nb-8 { --nb: 8; }
.semaine-type.nb-9 { --nb: 9; }
.semaine-type.nb-10 { --nb: 10; }
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) {
  .page-semaine-type main.page > h1 + .aide { margin-top: 2px; }
  .page-semaine-type main.page > * + * { margin-top: var(--esp-3); }
  .page-semaine-type .page { padding-top: var(--esp-3); padding-bottom: var(--esp-3); }
  .semaine-type .grille-jours { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--esp-2); }
  .semaine-type .jour { padding: var(--esp-3) var(--esp-2); }
  .semaine-type .jour h2 { font-size: 1rem; margin: 0 0 var(--esp-2); justify-content: center; }
  .semaine-type .repas-type + .repas-type { margin-top: var(--esp-2); }
  .semaine-type .repas-type .libelle { margin: 0 0 4px; font-size: .78rem; font-weight: 700; color: var(--texte-doux); text-align: center; }
  /* Hauteur d'un badge : ce qui reste de l'écran, partagé entre midi et soir de chaque personne (28 à 44 px) */
  .semaine-type .presences { display: grid; gap: 4px; --h-badge: clamp(28px, calc((100dvh - 330px) / (2 * var(--nb, 4)) - 4px), 44px); }
  .semaine-type .presences .puce { display: block; }
  .semaine-type .presences .puce span { display: flex; justify-content: center; width: 100%; min-height: var(--h-badge); height: var(--h-badge); padding: 0 6px;
    font-size: clamp(.72rem, calc(var(--h-badge) * .32), .9rem); border-width: 1.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .semaine-type .barre-enregistrer { margin-top: var(--esp-3); display: flex; justify-content: flex-end; }
  .semaine-type .barre-enregistrer .bouton { width: auto; min-width: 320px; }
}
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) and (max-height: 700px) {
  .semaine-type .barre-enregistrer .bouton { min-height: 48px; }
  .page-semaine-type .pied { padding-top: 4px; padding-bottom: 4px; }
}
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) {
  /* « Enregistrer » monte à droite du titre : toute la hauteur va aux jours */
  .page-semaine-type .page { position: relative; }
  .semaine-type .barre-enregistrer { position: absolute; top: var(--esp-3); right: clamp(24px, 3vw, 28px); margin: 0; }
  .semaine-type .barre-enregistrer .bouton { min-width: 0; }
  .page-semaine-type main.page > .aide { padding-right: 340px; }
  .semaine-type .presences { --h-badge: clamp(24px, calc((100dvh - 316px) / (2 * var(--nb, 4)) - 4px), 44px); }
}
@media (orientation: landscape) and (min-width: 700px) and (min-height: 521px) and (max-height: 560px) {
  .page-semaine-type main.page > .aide { display: none; }   /* très basse : la consigne cède sa place aux jours */
  .semaine-type .presences { --h-badge: clamp(24px, calc((100dvh - 290px) / (2 * var(--nb, 4)) - 4px), 44px); }
}
