/* Marmite — feuille de style.
   Toute l'identité visuelle passe par les variables ci-dessous : la direction
   artistique pourra être retravaillée sans toucher aux composants. */

:root {
  --fond: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f6ef;
  --texte: #16251b;
  --texte-doux: #5e6d62;
  --bord: #e3ebe0;
  --accent: #ff5a36;
  --accent-fonce: #e0401d;
  --accent-doux: #ffe6df;
  --vert: #2f8f4e;
  --vert-doux: #dff4e4;
  --rouge: #d0342c;
  --rouge-doux: #fde2e0;
  --ambre: #b07800;
  --ambre-doux: #fff3cc;
  --menthe: #c7e8c2;
  --citron: #ffd23f;
  --encre: #16251b;
  --ombre: 0 2px 10px rgb(22 37 27 / 6%);
  --ombre-forte: 0 14px 40px rgb(22 37 27 / 14%);
  --rayon: 22px;
  --rayon-petit: 14px;
  --police-titre: 'Bricolage Grotesque', system-ui, sans-serif;
  --police: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --largeur: 1240px;
  color-scheme: light;
}

/* Clair par défaut, quel que soit le réglage de l'appareil ; sombre au choix (Profil → Apparence), voir plus bas. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.55 var(--police); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--police-titre); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; font-family: var(--police); font-weight: 600; }
small { color: var(--texte-doux); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--surface); padding: .5rem 1rem; }

/* ── En-tête & navigation ─────────────────────────────────────────────── */

.entete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .7rem max(1rem, calc((100vw - var(--largeur)) / 2)); background: color-mix(in srgb, var(--fond) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--bord); }
body:not(.connecte) .nav, body:not(.connecte) .profil-lien { display: none; }
.logo { font-family: var(--police-titre); font-weight: 700; font-size: 1.4rem; color: var(--texte); text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: .2rem; margin-left: auto; }
.nav a { display: flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 999px; color: var(--texte-doux); text-decoration: none; font-weight: 500; font-size: .93rem; }
.nav a:hover { background: var(--surface-2); color: var(--texte); }
.nav a.actif { background: var(--accent-doux); color: var(--accent-fonce); }
.profil-lien { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--surface-2); text-decoration: none; font-size: 1.3rem; }

@media (max-width: 900px) {
  .nav { position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--bord); padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom)); margin: 0; z-index: 30; }
  .nav a { flex-direction: column; gap: 0; padding: .3rem .4rem; font-size: .68rem; border-radius: 10px; }
  .nav a span { font-size: 1.25rem; }
  .profil-lien { margin-left: auto; }
  main { padding-bottom: 5.5rem !important; }
}

main { max-width: var(--largeur); margin: 0 auto; padding: 1.5rem 1rem 4rem; min-height: 70vh; }
main[aria-busy] { opacity: .7; transition: opacity .2s .15s; }

/* ── Boutons & formulaires ────────────────────────────────────────────── */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .62rem 1.1rem; border: 1px solid transparent; border-radius: 999px; background: var(--accent); color: #fff; font: 600 .93rem var(--police); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: var(--accent-fonce); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondaire { background: var(--surface); color: var(--texte); border-color: var(--bord); }
.btn.secondaire:hover { background: var(--surface-2); }
.btn.lien { background: none; color: var(--accent); padding: .3rem .4rem; }
.btn.lien:hover { text-decoration: underline; }
.btn.danger { background: var(--rouge); }
.btn.lien.danger { background: none; color: var(--rouge); }
.btn.petit { padding: .35rem .75rem; font-size: .83rem; }
.btn.large { padding: .85rem 1.6rem; font-size: 1rem; }
.btn.icone, button.icone { width: 2.2rem; height: 2.2rem; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); cursor: pointer; font-size: 1rem; text-decoration: none; }
button.icone:hover { background: var(--surface-2); }

input, select, textarea { width: 100%; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: .6rem .8rem; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.champ { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 0; }
.champ > span { font-weight: 600; font-size: .9rem; }
.champ.court { flex: 0 1 11rem; }
.ligne { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; }
.ligne > input { flex: 1; min-width: 12rem; }
.pile { display: flex; flex-direction: column; gap: 1rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .95rem; margin-bottom: .5rem; }
legend small { font-weight: 400; }
.actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.actions.gauche { justify-content: flex-start; }
.aide { color: var(--texte-doux); font-size: .92rem; margin: .2rem 0 .6rem; }

.interrupteur { display: flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .93rem; }
.interrupteur input { position: absolute; opacity: 0; width: 1px; }
.interrupteur > span { flex: none; width: 2.5rem; height: 1.45rem; border-radius: 999px; background: var(--bord); position: relative; transition: background .2s; }
.interrupteur > span::after { content: ''; position: absolute; top: .15rem; left: .15rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .2s; }
.interrupteur input:checked + span { background: var(--accent); }
.interrupteur input:checked + span::after { transform: translateX(1.05rem); }
.interrupteur input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Puces */
.puces { display: flex; flex-wrap: wrap; gap: .4rem; }
.puce { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px; background: var(--surface-2); color: var(--texte); font-size: .82rem; border: 1px solid transparent; cursor: default; white-space: nowrap; }
button.puce { cursor: pointer; font: inherit; font-size: .85rem; }
button.puce:hover { border-color: var(--accent); }
.puce-amb { background: var(--accent-doux); color: var(--accent-fonce); }
.puce-alerte { background: var(--ambre-doux); color: var(--ambre); }
.puce-erreur { background: var(--rouge-doux); color: var(--rouge); }
.puce-choix input { position: absolute; opacity: 0; width: 1px; }
.puce-choix span { display: inline-block; padding: .38rem .8rem; border-radius: 999px; border: 1px solid var(--bord); background: var(--surface); cursor: pointer; font-size: .88rem; transition: all .15s; user-select: none; }
.puce-choix span:hover { border-color: var(--accent); }
.puce-choix input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.puce-choix input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.puce-retirable { background: var(--accent-doux); color: var(--accent-fonce); padding-right: .25rem; }
.puce-retirable button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .3rem; }

/* Sélecteur d'aliments */
.selecteur { display: flex; flex-direction: column; gap: .4rem; }
.selecteur-puces { display: flex; flex-wrap: wrap; gap: .35rem; }
.selecteur-saisie { position: relative; }
.suggestions { position: absolute; z-index: 40; top: 100%; left: 0; right: 0; margin: .2rem 0 0; padding: .3rem; list-style: none; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-petit); box-shadow: var(--ombre-forte); max-height: 16rem; overflow: auto; }
.suggestions li { padding: .45rem .6rem; border-radius: 6px; cursor: pointer; }
.suggestions li:hover { background: var(--surface-2); }
.suggestions li.libre { color: var(--texte-doux); font-style: italic; }

/* ── Cartes de recettes ───────────────────────────────────────────────── */

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.grille.petite { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.carte { background: var(--surface); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.carte:hover { transform: translateY(-2px); box-shadow: var(--ombre-forte); }
.carte.exclue { opacity: .62; }
.carte.exclue:hover { opacity: 1; }
.carte-lien { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.carte-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); }
.carte-img img, .carte-img .img-vide { width: 100%; height: 100%; object-fit: cover; }
.img-vide { display: grid; place-items: center; font-size: 2.6rem; background: linear-gradient(135deg, var(--accent-doux), var(--surface-2)); }
.coeur { position: absolute; top: .5rem; right: .5rem; background: var(--surface); color: var(--accent); width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--ombre); }
.jauge { position: absolute; left: .5rem; bottom: .5rem; background: var(--vert); color: #fff; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; }
.carte-corps { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.carte h3 { font-family: var(--police-titre); font-size: 1.05rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carte-meta { display: flex; gap: .7rem; flex-wrap: wrap; color: var(--texte-doux); font-size: .83rem; margin: 0; }
.carte-puces { display: flex; gap: .3rem; flex-wrap: wrap; margin: .1rem 0; }
.carte-source { color: var(--texte-doux); font-size: .78rem; margin: auto 0 0; }
.carte .raisons { color: var(--rouge); font-size: .8rem; margin: 0; }
.carte .manquants { color: var(--texte-doux); font-size: .8rem; margin: 0; }
.carte .pourquoi { color: var(--vert); font-size: .8rem; margin: 0; }
.carte-actions { display: flex; gap: .3rem; justify-content: flex-end; padding: 0 .7rem .7rem; }
.carte.compacte .carte-corps { padding: .6rem .7rem .7rem; }

/* ── Pages ────────────────────────────────────────────────────────────── */

.page-tete { margin-bottom: 1.5rem; }
.page.etroite { max-width: 760px; margin: 0 auto; }
.vide { text-align: center; padding: 3rem 1rem; color: var(--texte-doux); display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.chargement { display: flex; flex-direction: column; align-items: center; padding: 3rem 1rem; color: var(--texte-doux); text-align: center; }
.marmite-anim { width: 3rem; height: 3rem; border-radius: 50%; border: 4px solid var(--accent-doux); border-top-color: var(--accent); animation: tourne 0.9s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.encadre { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.1rem 1.2rem; margin: 1rem 0; }
.encadre h2 { margin-top: 0; }
.encadre-fort { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-doux); }
.alerte { border-radius: var(--rayon-petit); padding: .8rem 1rem; margin: 1rem 0; font-size: .95rem; }
.alerte-ok { background: var(--vert-doux); color: var(--vert); }
.alerte-danger { background: var(--rouge-doux); color: var(--rouge); }
.bandeau-filtre { background: var(--surface); border: 1px dashed var(--bord); border-radius: var(--rayon-petit); padding: .6rem .9rem; font-size: .9rem; color: var(--texte-doux); }
.onglets { display: flex; gap: .3rem; border-bottom: 1px solid var(--bord); margin-bottom: 1.5rem; overflow-x: auto; }
.onglets a { padding: .6rem 1rem; color: var(--texte-doux); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.onglets a.actif { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.bloc { margin: 2.2rem 0; }
.bloc > header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.bloc > header h2 { margin: 0; }
.compte { color: var(--texte-doux); font-size: .92rem; }

/* Accueil */
.hero { background: linear-gradient(135deg, var(--accent-doux), var(--surface-2)); border-radius: calc(var(--rayon) * 1.5); padding: clamp(1.5rem, 4vw, 3rem); margin-bottom: 1.5rem; }
.hero-ia { display: flex; gap: .6rem; margin: 1rem 0; }
.hero-ia input { font-size: 1.05rem; padding: .85rem 1.1rem; border-radius: 999px; }
.suggestions-ia { display: flex; flex-wrap: wrap; gap: .4rem; }
.suggestions-ia .puce { background: var(--surface); }
.bloc-menu { display: flex; align-items: center; gap: 1rem; background: var(--surface); border-radius: var(--rayon); padding: 1rem 1.2rem; text-decoration: none; color: inherit; box-shadow: var(--ombre); margin: 1rem 0; }
.bloc-menu > span { font-size: 2rem; }
.bloc-menu small { display: block; }

/* Recherche */
.barre-recherche { display: flex; gap: .6rem; margin-bottom: 1.2rem; }
.barre-recherche input { font-size: 1.05rem; border-radius: 999px; padding: .75rem 1.1rem; }
.barre-recherche select { width: auto; border-radius: 999px; }
.recherche-corps { display: grid; grid-template-columns: 270px 1fr; gap: 1.5rem; align-items: start; }
.filtres { position: sticky; top: 5rem; background: var(--surface); border-radius: var(--rayon); padding: 1rem; display: flex; flex-direction: column; gap: .8rem; max-height: calc(100vh - 6rem); overflow: auto; box-shadow: var(--ombre); }
.filtres-tete { display: flex; justify-content: space-between; align-items: baseline; }
.filtres-tete h2 { margin: 0; font-size: 1.1rem; }
.filtres details { border-top: 1px solid var(--bord); padding-top: .6rem; }
.filtres summary { cursor: pointer; font-weight: 600; font-size: .92rem; margin-bottom: .5rem; }
.filtres .puce-choix span { font-size: .8rem; padding: .28rem .6rem; }
.appel-web { text-align: center; background: var(--surface); border: 1px dashed var(--bord); border-radius: var(--rayon); padding: 1.5rem; margin: 2rem 0; }
.sites-bilan { display: flex; flex-wrap: wrap; gap: .3rem; }
@media (max-width: 900px) {
  .recherche-corps { grid-template-columns: 1fr; }
  .filtres { position: static; max-height: none; }
  .recherche-corps aside { order: 0; }
  .volet-filtres:not(.ouvert) { display: none; }
  .bouton-filtres { display: inline-flex; margin-bottom: 1rem; }
  .barre-recherche { flex-wrap: wrap; }
  .barre-recherche input { flex: 1 1 100%; }
}

/* Fiche recette */
.fiche-tete { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2rem; align-items: start; }
.fiche-img { border-radius: calc(var(--rayon) * 1.4); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); }
.fiche-img img, .fiche-img .img-vide { width: 100%; height: 100%; object-fit: cover; font-size: 5rem; }
.fil { margin: 0 0 .3rem; font-size: .9rem; }
.fil a { text-decoration: none; }
.description { color: var(--texte-doux); }
.fiche-meta { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .95rem; }
.source { font-size: .9rem; color: var(--texte-doux); }
.fiche-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.plus { position: relative; }
.plus summary { list-style: none; }
.plus summary::-webkit-details-marker { display: none; }
.menu-plus { position: absolute; right: 0; top: 110%; z-index: 10; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-petit); box-shadow: var(--ombre-forte); padding: .3rem; min-width: 14rem; display: flex; flex-direction: column; }
.menu-plus a, .menu-plus button { text-align: left; padding: .55rem .7rem; border: 0; background: none; color: var(--texte); font: inherit; text-decoration: none; border-radius: 6px; cursor: pointer; }
.menu-plus a:hover, .menu-plus button:hover { background: var(--surface-2); }
.fiche-corps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); grid-template-areas: "ing etapes" "ing infos" "ing avis"; grid-template-rows: auto auto 1fr; column-gap: 2rem; row-gap: 1rem; margin-top: 1rem; }
.fiche-corps > .ingredients { grid-area: ing; }
.fiche-corps > .etapes-recette { grid-area: etapes; }
.fiche-corps > .fiche-infos { grid-area: infos; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; align-items: start; }
.fiche-corps > .fiche-avis { grid-area: avis; }
.fiche-infos .encadre { margin: 0; }
/* sur ordinateur et tablette, les ingrédients suivent la lecture des étapes */
@media (min-width: 801px) {
  .fiche-corps > .ingredients { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: .3rem; }
}
.portions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.portions h2 { margin: 0; }
.stepper { display: flex; align-items: center; gap: .6rem; }
.liste-ingredients { list-style: none; padding: 0; margin: 1rem 0; }
.liste-ingredients li { padding: .45rem 0; border-bottom: 1px solid var(--bord); display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.liste-ingredients label { display: flex; gap: .6rem; cursor: pointer; }
.liste-ingredients input { width: auto; accent-color: var(--accent); }
.liste-ingredients input:checked + span { text-decoration: line-through; color: var(--texte-doux); }
.liste-ingredients .section, .etapes-recette .section { font-weight: 700; border: 0; padding-top: 1rem; list-style: none; color: var(--accent-fonce); }
.dispo { color: var(--vert); white-space: nowrap; }
.etapes-recette ol { padding-left: 1.4rem; counter-reset: etape; }
.etapes-recette li { margin-bottom: 1rem; padding-left: .3rem; }
.video-recette { margin: 0 0 1.2rem; border-radius: var(--rayon, 14px); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.video-recette video, .video-recette iframe { width: 100%; height: 100%; display: block; border: 0; object-fit: contain; }
.etape-img { display: block; width: 100%; max-width: 420px; border-radius: 10px; margin: .4rem 0; }
.puce-video { color: var(--accent-fonce); font-weight: 600; }
.mc-video { display: block; width: 100%; max-height: 42vh; object-fit: contain; background: #000; border-radius: 12px; margin-bottom: 1rem; }
.etapes-recette li::marker { font-family: var(--police-titre); font-weight: 700; color: var(--accent); }
.grossesse { list-style: none; padding: 0; margin: 0; }
.grossesse li { padding: .5rem 0; border-bottom: 1px solid var(--bord); }
.grossesse li p { margin: .2rem 0 0; font-size: .9rem; color: var(--texte-doux); }
.g-eviter strong { color: var(--rouge); }
.g-precaution strong, .g-limiter strong { color: var(--ambre); }
.etoiles { display: flex; gap: .2rem; margin-bottom: .6rem; }
.etoiles button { border: 0; background: none; font-size: 1.6rem; color: var(--bord); cursor: pointer; padding: 0; }
.etoiles button.on { color: #f59e0b; }
.perso form { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; margin-bottom: .8rem; }
@media (max-width: 800px) { .fiche-tete, .fiche-corps { grid-template-columns: 1fr; } .fiche-corps { grid-template-areas: "ing" "infos" "etapes" "avis"; grid-template-rows: none; } }

/* Mode cuisine */
.mode-cuisine { position: fixed; inset: 0; z-index: 60; background: var(--fond); display: flex; flex-direction: column; }
.mode-cuisine header, .mode-cuisine footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--bord); }
.mode-cuisine footer { border: 0; border-top: 1px solid var(--bord); }
.mode-cuisine footer .btn { flex: 1; }
.mc-corps { flex: 1; display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.mc-corps aside { overflow: auto; padding: 1.5rem; border-right: 1px solid var(--bord); }
.mc-corps aside ul { list-style: none; padding: 0; }
.mc-corps aside li { padding: .3rem 0; }
.mc-corps aside input { width: auto; }
.mc-corps main { padding: 2rem clamp(1rem, 5vw, 4rem); overflow: auto; max-width: none; }
.mc-num { color: var(--accent); font-weight: 600; }
.mc-texte { font-size: clamp(1.3rem, 2.6vw, 2rem); line-height: 1.45; font-family: var(--police-titre); }
@media (max-width: 800px) { .mc-corps { grid-template-columns: 1fr; } .mc-corps aside { display: none; } }
.minuteur { position: fixed; right: 1rem; bottom: 6rem; z-index: 70; background: var(--texte); color: var(--fond); padding: .7rem 1rem; border-radius: 999px; display: flex; gap: .8rem; align-items: center; font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: var(--ombre-forte); }
.minuteur + .minuteur { bottom: 9.5rem; }
.minuteur button { background: none; border: 0; color: inherit; cursor: pointer; }
.minuteur.sonne { background: var(--accent); color: #fff; animation: sonne .5s ease-in-out infinite alternate; }
@keyframes sonne { to { transform: scale(1.06); } }

/* Auth & bienvenue */
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; min-height: 70vh; }
.auth-visuel { background: linear-gradient(135deg, var(--accent), #ea580c 60%, #f59e0b); color: #fff; border-radius: calc(var(--rayon) * 2); padding: 3rem; min-height: 420px; display: flex; flex-direction: column; justify-content: flex-end; }
.auth-visuel span { font-size: 5rem; }
.auth-visuel p { font-family: var(--police-titre); font-size: 1.8rem; line-height: 1.25; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; max-width: 420px; }
.bascule { color: var(--texte-doux); }
.mdp-oublie { margin: -.5rem 0 0; text-align: right; font-size: .9rem; }
.mdp-oublie a { color: var(--texte-doux); }
@media (max-width: 800px) { .auth { grid-template-columns: 1fr; } .auth-visuel { min-height: 0; padding: 1.5rem; } .auth-visuel span { font-size: 3rem; } .auth-visuel p { font-size: 1.3rem; } }
.bienvenue { max-width: 820px; margin: 0 auto; }
.etapes { list-style: none; padding: 0; display: flex; gap: .4rem; margin: 1rem 0 1.5rem; overflow-x: auto; }
.etapes li { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--texte-doux); white-space: nowrap; padding-right: .6rem; }
.etapes li span { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--surface-2); font-weight: 600; }
.etapes li.courante { color: var(--texte); font-weight: 600; }
.etapes li.courante span { background: var(--accent); color: #fff; }
.etapes li.faite span { background: var(--vert); color: #fff; }
.carte-etape { background: var(--surface); border-radius: var(--rayon); padding: clamp(1rem, 3vw, 2rem); box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 1rem; }
.navigation-etapes { justify-content: space-between; margin-top: 1.2rem; }
.membres { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.membre-ligne { display: flex; align-items: center; gap: .9rem; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .7rem 1rem; }
.membre-ligne > div { flex: 1; }
.membre-ligne strong { margin-right: .4rem; }
.membre-ligne.inactif { opacity: .6; }
.membre-ligne .aide { margin: .1rem 0 0; font-size: .85rem; }
.avatar { font-size: 1.8rem; }
.membre-details { border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem 1rem; }
.membre-details summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.membre-details summary small { font-weight: 400; }
.membre-form { display: flex; flex-direction: column; gap: 1.1rem; padding-top: 1rem; }

/* Menus */
.liste-menus { display: flex; flex-direction: column; gap: .6rem; }
/* aperçu d'une recette partagée, pour qui n'a pas de compte */
.apercu { max-width: 640px; margin: 0 auto 2rem; }
.apercu-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; display: block; }
.apercu-corps { padding: 1rem .2rem; }
.apercu-corps h1 { margin: .4rem 0 .5rem; }
.apercu-corps h2 { font-size: 1.1rem; margin: 1rem 0 .4rem; }
.apercu-corps h2 small { color: var(--texte-doux); font-weight: 500; }
.apercu-infos { display: flex; flex-wrap: wrap; gap: .9rem; color: var(--texte-doux); }
.apercu-infos span { display: inline-flex; align-items: center; gap: .3rem; }
.apercu-liste { margin: 0; padding-left: 1.2rem; }
.apercu-cache { position: relative; filter: blur(4px); user-select: none; pointer-events: none; opacity: .75;
  -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); }
.apercu-cache ul { margin: 0; padding-left: 1.2rem; }
.apercu-appel { margin-top: .4rem; padding: 1rem; border-radius: 16px; background: var(--fond-doux, #f4f1ea); display: flex; flex-direction: column; gap: .6rem; }
.apercu-appel p { margin: 0; }
/* liste des menus : en cours, à venir, puis l historique par mois */
.groupe-menus { margin-top: 1.4rem; }
.groupe-menus h2 { font-size: 1.15rem; margin: 0 0 .7rem; }
.groupe-menus .mois-menus { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-doux, #6b6b6b); margin: 1rem 0 .5rem; }
.ligne-menu { display: flex; align-items: center; gap: 1rem; background: var(--surface); border-radius: var(--rayon); padding: 1rem 1.2rem; text-decoration: none; color: inherit; box-shadow: var(--ombre); }
.ligne-menu > span:first-child { font-size: 1.6rem; }
.ligne-menu div { flex: 1; }
.ligne-menu small { display: block; }
.quotas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.quota { display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: .4rem .6rem; font-size: .9rem; }
.quota input { width: 4rem; padding: .3rem .4rem; }
.page.large { max-width: none; }
.planning { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.jour { background: var(--surface); border-radius: var(--rayon); padding: 1rem; box-shadow: var(--ombre); }
.jour h2 { font-size: 1.05rem; }
.jour h2::first-letter { text-transform: uppercase; }
.repas + .repas { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--bord); }
.repas h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-doux); margin-bottom: .4rem; }
.case { display: flex; flex-direction: column; gap: .4rem; border-radius: var(--rayon-petit); padding: .4rem; margin-bottom: .4rem; }
.case.verrouillee { background: var(--accent-doux); }
.case-lien { display: grid; grid-template-columns: 64px 1fr; gap: .6rem; color: inherit; text-decoration: none; align-items: start; }
.case-img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; font-size: 1.6rem; }
.case strong { display: block; font-size: .92rem; line-height: 1.3; }
.case small { display: block; font-size: .78rem; }
.case .pourquoi { color: var(--vert); }
.case .service { text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; color: var(--accent); }
.case-actions { display: flex; gap: .3rem; justify-content: flex-end; }
.case-actions .icone { width: 1.9rem; height: 1.9rem; font-size: .85rem; }
.vide-case { border: 1px dashed var(--bord); align-items: flex-start; }
.vide-case p { margin: 0; font-size: .85rem; color: var(--texte-doux); }

/* Courses */
.ajout-article { margin-bottom: 1.5rem; }
.rayon h2 { font-size: 1rem; font-family: var(--police); text-transform: uppercase; letter-spacing: .05em; color: var(--accent-fonce); margin-top: 1.5rem; }
.rayon ul { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); }
.rayon li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .65rem 1rem; border-bottom: 1px solid var(--bord); }
.rayon li:last-child { border: 0; }
.rayon label { display: flex; align-items: center; gap: .7rem; flex: 1; cursor: pointer; }
.rayon input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); flex: none; }
.rayon .article { flex: 1; }
.rayon .qte { font-weight: 600; white-space: nowrap; }
.rayon li.coche .article, .rayon li.coche .qte { text-decoration: line-through; color: var(--texte-doux); font-weight: 400; }
.rayon li small { max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Livres */
.etagere { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.4rem; }
.livre { position: relative; aspect-ratio: 3 / 4; border-radius: 6px 14px 14px 6px; background: var(--c); color: #fff; text-decoration: none; padding: 1.2rem; display: flex; flex-direction: column; justify-content: flex-end; gap: .2rem; overflow: hidden; box-shadow: inset 10px 0 0 rgb(0 0 0 / 18%), var(--ombre-forte); transition: transform .2s; }
.livre:hover { transform: translateY(-4px) rotate(-1deg); }
.livre img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; mix-blend-mode: luminosity; }
.livre > * { position: relative; }
.livre-emoji { font-size: 2.6rem; }
.livre strong { font-family: var(--police-titre); font-size: 1.25rem; line-height: 1.2; }
.livre small { color: rgb(255 255 255 / 85%); }
.livre-tete { display: flex; gap: 1.2rem; align-items: center; border-left: 8px solid var(--c); padding-left: 1rem; }
.liste-livres { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.livre-choix { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .8rem; border-radius: var(--rayon-petit); border: 0; background: var(--c); color: #fff; cursor: pointer; font: 600 .9rem var(--police); text-align: left; }
.livre-choix span { font-size: 1.5rem; }
.livre-choix small { color: rgb(255 255 255 / 85%); }
.pastille input { position: absolute; opacity: 0; }
.pastille span { display: block; width: 2rem; height: 2rem; border-radius: 50%; background: var(--c); cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--bord); }
.pastille input:checked + span { box-shadow: 0 0 0 3px var(--texte); }
.livre-impression .couverture { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: var(--c); color: #fff; border-radius: var(--rayon); padding: 2rem; }
.livre-impression .couverture span { font-size: 5rem; }
.livre-impression .couverture h1 { font-size: 3rem; }
.page-recette { padding: 2rem 0; border-bottom: 1px solid var(--bord); }
.page-recette img { max-height: 280px; width: 100%; object-fit: cover; border-radius: var(--rayon); margin: 1rem 0; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; }
.note-perso { background: var(--ambre-doux); padding: .6rem .9rem; border-radius: var(--rayon-petit); }

/* Assistant */
.assistant { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; min-height: 70vh; }
.fil-chat { flex: 1; display: flex; flex-direction: column; gap: 1rem; padding-bottom: 1rem; }
.bulle { max-width: 100%; padding: .9rem 1.1rem; border-radius: 18px; }
.bulle.moi { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; max-width: 80%; }
.bulle.ia { align-self: flex-start; background: var(--surface); box-shadow: var(--ombre); border-bottom-left-radius: 4px; width: 100%; }
.bulle.ia .grille { margin-top: .8rem; }
.bulle.erreur { color: var(--rouge); }
.saisie-chat { position: sticky; bottom: 0; display: flex; gap: .6rem; background: var(--fond); padding: .8rem 0; }
@media (max-width: 900px) { .saisie-chat { bottom: 4.3rem; } }
.saisie-chat textarea { border-radius: 18px; }
.points { display: inline-flex; gap: .3rem; }
.points i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--texte-doux); animation: saute 1s infinite; }
.points i:nth-child(2) { animation-delay: .15s; }
.points i:nth-child(3) { animation-delay: .3s; }
@keyframes saute { 50% { transform: translateY(-5px); opacity: .5; } }
.apercu-menu { grid-column: 1 / -1; display: block; background: var(--surface-2); border-radius: var(--rayon); padding: 1rem; color: inherit; text-decoration: none; }
.apercu-menu ol { list-style: none; padding: 0; margin: .6rem 0; }
.apercu-menu li { padding: .25rem 0; }
.apercu-menu li span { display: inline-block; width: 2rem; color: var(--accent); font-weight: 600; }
.apercu-menu small { color: var(--vert); margin-left: .3rem; }

/* Modales & toasts */
dialog.modale { border: 0; border-radius: calc(var(--rayon) * 1.3); padding: 0; width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); background: var(--surface); color: var(--texte); box-shadow: var(--ombre-forte); }
dialog.modale.large { width: min(900px, calc(100vw - 2rem)); }
dialog.modale::backdrop { background: rgb(20 14 10 / 55%); backdrop-filter: blur(2px); }
.modale-tete { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--bord); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modale-tete h2 { margin: 0; font-size: 1.2rem; }
.modale-corps { padding: 1.2rem; }
.recherche-modale { display: flex; gap: .5rem; margin-bottom: 1rem; }
#toasts { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
@media (max-width: 900px) { #toasts { bottom: 5.5rem; } }
.toast { background: var(--texte); color: var(--fond); padding: .7rem 1.1rem; border-radius: 999px; box-shadow: var(--ombre-forte); font-size: .92rem; animation: entre .25s ease-out; max-width: 90vw; }
.toast-succes { background: var(--vert); color: #fff; }
.toast-erreur { background: var(--rouge); color: #fff; }
.toast.sortie { opacity: 0; transition: opacity .4s; }
@keyframes entre { from { transform: translateY(10px); opacity: 0; } }

/* Impression */
@media print {
  .entete, .nav, .fiche-actions, .actions, .no-print, #toasts, .filtres, .case-actions, .carte-actions, .perso, .ajout-article, .stepper a, .barre-recherche { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .carte, .jour, .encadre, .rayon ul { box-shadow: none; border: 1px solid #ddd; }
  .page-recette, .jour { break-inside: avoid; }
  .livre-impression .couverture { break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sommaire { break-after: page; }
  .page-recette { break-before: page; }
}

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

/* ── Direction « Marché » : frais, joyeux, familial ──────────────────────
   Menthe, citron et tomate ; titres très gras ; formes rondes. */

h1, h2, .logo { font-weight: 800; letter-spacing: -.025em; }
.logo { color: var(--accent); font-size: 1.6rem; }
.nav a.actif { background: var(--encre); color: var(--fond); }
.btn { font-weight: 700; }

.hero { background: var(--menthe); position: relative; overflow: hidden; }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 340px; height: 340px; right: -80px; top: -120px; background: var(--citron); }
.hero::after { width: 180px; height: 180px; right: 160px; bottom: -110px; background: var(--accent); opacity: .9; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); max-width: 16ch; line-height: 1.02; }
.hero .puce, .hero button.puce, .suggestions-ia .puce { background: var(--surface); border: 0; font-weight: 600; box-shadow: var(--ombre); }
.hero-ia input { border: 2px solid var(--encre); box-shadow: 4px 4px 0 var(--encre); }
.hero .btn { background: var(--encre); color: var(--fond); }
.barre-recherche input { border: 2px solid var(--encre); box-shadow: 3px 3px 0 var(--encre); }

.carte { box-shadow: none; border: 1px solid var(--bord); }
.carte:hover { box-shadow: var(--ombre-forte); }
.carte h3 { font-weight: 800; letter-spacing: -.01em; }
.carte-img { margin: .5rem .5rem 0; border-radius: 16px; overflow: hidden; }
.jauge { background: var(--citron); color: #16251b; }
.bloc > header h2 { font-size: 1.8rem; }
.bloc-menu { border: 1px solid var(--bord); box-shadow: none; }

.fiche-img { box-shadow: 10px 10px 0 var(--menthe); }
.fiche-tete h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
.video-recette { margin: 0 0 1.2rem; border-radius: var(--rayon, 14px); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.video-recette video, .video-recette iframe { width: 100%; height: 100%; display: block; border: 0; object-fit: contain; }
.etape-img { display: block; width: 100%; max-width: 420px; border-radius: 10px; margin: .4rem 0; }
.puce-video { color: var(--accent-fonce); font-weight: 600; }
.mc-video { display: block; width: 100%; max-height: 42vh; object-fit: contain; background: #000; border-radius: 12px; margin-bottom: 1rem; }
.etapes-recette li::marker { font-weight: 800; }
.encadre { border-radius: var(--rayon); }
.onglets a.actif { font-weight: 800; }

.auth-visuel { background: var(--menthe); color: var(--encre); position: relative; overflow: hidden; }
.auth-visuel::before { content: ''; position: absolute; width: 300px; height: 300px; right: -90px; top: -90px; border-radius: 50%; background: var(--citron); }
.auth-visuel::after { content: ''; position: absolute; width: 170px; height: 170px; left: -40px; bottom: -60px; border-radius: 50%; background: var(--accent); }
.auth-visuel > * { position: relative; z-index: 1; }
.auth-visuel p { font-weight: 800; letter-spacing: -.02em; }
.auth-visuel::after { left: auto; right: 50px; bottom: -90px; }
.puce { max-width: 100%; white-space: normal; text-align: left; }

@media (max-width: 900px) {
  /* backdrop-filter ferait de l'en-tête le repère de la barre « fixe » du bas : elle remontait sur le logo */
  .entete { backdrop-filter: none; background: var(--fond); }
  .hero::before { width: 200px; height: 200px; right: -90px; top: -90px; }
  .hero::after { width: 120px; height: 120px; right: 30px; bottom: -80px; }
  .hero-ia { flex-wrap: wrap; }
  .hero-ia input { flex: 1 1 100%; }
}

/* ── Icônes (Lucide) et logo typographique ───────────────────────────── */

.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.plein { fill: currentColor; }
.btn .ic, .puce .ic, .puce-choix .ic { width: 1.05em; height: 1.05em; }
.nav a .ic { width: 1.1rem; height: 1.1rem; }
.coeur .ic { width: 1rem; height: 1rem; }
.carte-meta span { display: inline-flex; align-items: center; gap: .25rem; }
.carte-meta .ic { width: .95em; height: .95em; color: var(--accent); }
.img-vide { color: var(--vert); }
.img-vide .ic { width: 2.6rem; height: 2.6rem; stroke-width: 1.5; }
.bloc-menu > span, .ligne-menu > span:first-child { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--menthe); color: var(--encre); font-size: 1.4rem; flex: none; }
.avatar, .livre-emoji { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--menthe); color: var(--encre); font-size: 1.3rem; flex: none; }
.livre-emoji { width: 3.4rem; height: 3.4rem; font-size: 1.7rem; border-radius: 16px; background: var(--citron); }
.livre-impression .couverture span { font-size: 4rem; }
.avatars .puce-choix span { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; font-size: 1.15rem; }
.langue { display: inline-block; font: 800 .62rem/1 var(--police); letter-spacing: .06em; padding: .18rem .35rem; border-radius: 6px; background: var(--surface-2); color: var(--texte-doux); text-decoration: none; vertical-align: .1em; }
.bloc > header h2 .ic { color: var(--accent); }
h1 .ic { color: var(--accent); }

.logo { font-family: var(--police-titre); font-weight: 800; letter-spacing: -.04em; color: var(--accent); font-size: 1.75rem; line-height: 1; }
.auth-visuel .auth-marque { font: 800 clamp(3rem, 7vw, 5rem)/1 var(--police-titre); letter-spacing: -.04em; color: var(--accent); }
@media (max-width: 900px) { .nav a .ic { width: 1.35rem; height: 1.35rem; } }
@media (max-width: 800px) { .auth-visuel .auth-marque { font-size: 3rem; } }

/* Foyer partagé */
.rejoindre-encadre { background: var(--menthe); border: 0; }
.rejoindre-encadre h3 { margin-top: 0; }
.rejoindre-encadre .ligne input { flex: 1; min-width: 10rem; }
.code-invitation { font: 800 2.2rem/1 var(--police-titre); letter-spacing: .12em; text-align: center; color: var(--accent); background: var(--surface-2); border-radius: var(--rayon-petit); padding: .8rem; margin: 1rem 0; }

@media (min-width: 901px) { .bouton-filtres { display: none; } }

/* Tirer pour actualiser (app installée sur l'écran d'accueil) */
.tirer { position: fixed; top: calc(env(safe-area-inset-top) + 10px); left: 50%; z-index: 80; width: 2.6rem; height: 2.6rem; margin-left: -1.3rem; border-radius: 50%;
  background: var(--surface); box-shadow: var(--ombre-forte); display: grid; place-items: center; opacity: 0; pointer-events: none;
  transform: translateY(calc(var(--tire, 0) * 60px - 50px)); transition: opacity .15s; }
.tirer.visible { opacity: 1; }
.tirer span { width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 3px solid var(--accent-doux); border-top-color: var(--accent); transform: rotate(calc(var(--tire, 0) * 300deg)); }
.tirer.tourne { transform: translateY(10px); transition: transform .2s; }
.tirer.tourne span { animation: tourne .8s linear infinite; }

/* Photo d'une recette perso */
.photo-recette { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.photo-apercu { width: 7rem; aspect-ratio: 4 / 3; border-radius: var(--rayon-petit); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--texte-doux); font-size: 1.6rem; flex: none; }
.photo-apercu img { width: 100%; height: 100%; object-fit: cover; }
.photo-apercu.envoi { opacity: .5; animation: sonne .6s ease-in-out infinite alternate; }
.photo-boutons { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.photo-boutons label.btn { cursor: pointer; }
.photos-choisies { display: flex; gap: .5rem; flex-wrap: wrap; }
.photos-choisies img { width: 5.5rem; height: 7rem; object-fit: cover; border-radius: var(--rayon-petit); border: 1px solid var(--bord); }
#photo label.btn { cursor: pointer; align-self: flex-start; }

/* Matériel de cuisine */
.materiel-manquant { color: var(--ambre); font-size: .8rem; margin: 0; display: flex; gap: .3rem; align-items: center; }
.fiche-materiel { font-size: .92rem; color: var(--texte-doux); margin: .3rem 0; }
.fiche-materiel .ic { margin-right: .2rem; }
.fiche-materiel .manquant { color: var(--ambre); font-weight: 700; text-decoration: underline dotted; }
.photos-choisies figure { position: relative; margin: 0; }
.photos-choisies figcaption { font-size: .75rem; color: var(--texte-doux); text-align: center; }
.photos-choisies .icone { position: absolute; top: -.5rem; right: -.5rem; width: 1.7rem; height: 1.7rem; font-size: .8rem; }
.au-frigo { color: var(--vert); font-size: .78rem; font-weight: 600; white-space: nowrap; }
/* Onglets sur mobile : tiennent sur la largeur, sans barre de défilement visible */
.onglets { scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
@media (max-width: 600px) { .onglets a { padding: .6rem .55rem; font-size: .92rem; } }
/* Barre du bas sur mobile : 6 onglets (Assistant est en haut de l'accueil, Livres dans le Carnet) */
@media (max-width: 900px) {
  .nav a.nav-pc { display: none; }
  .nav a { flex: 1 1 0; min-width: 0; }
}

/* Compte connecté en haut à droite : avatar + prénom */
.profil-lien { display: flex; align-items: center; gap: .45rem; width: auto; height: 2.5rem; padding: 0 .9rem 0 .25rem; border-radius: 999px; color: var(--texte); }
#nav-profil { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--surface); color: var(--accent); font-size: 1.1rem; }
#nav-prenom { font: 700 .92rem var(--police); max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Mode sombre vert foncé (au choix, Profil → Apparence ; par appareil) ── */
:root[data-theme="sombre"] {
  --fond: #101a13; --surface: #16231a; --surface-2: #1e2e23; --texte: #eef5ec; --texte-doux: #a5b8a9; --bord: #2a3d30;
  --accent: #ff7a5c; --accent-fonce: #ff9478; --accent-doux: #3a1f17;
  --vert: #6fd08f; --vert-doux: #17301f; --rouge: #ff8a80; --rouge-doux: #3a1a18; --ambre: #ffd23f; --ambre-doux: #33290e;
  --menthe: #24432c; --citron: #e9bd2a; --encre: #eef5ec;
  --ombre: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%); --ombre-forte: 0 14px 40px rgb(0 0 0 / 45%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --fond: #101a13; --surface: #16231a; --surface-2: #1e2e23; --texte: #eef5ec; --texte-doux: #a5b8a9; --bord: #2a3d30;
    --accent: #ff7a5c; --accent-fonce: #ff9478; --accent-doux: #3a1f17;
    --vert: #6fd08f; --vert-doux: #17301f; --rouge: #ff8a80; --rouge-doux: #3a1a18; --ambre: #ffd23f; --ambre-doux: #33290e;
    --menthe: #24432c; --citron: #e9bd2a; --encre: #eef5ec;
    --ombre: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%); --ombre-forte: 0 14px 40px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}
.choix-theme { margin-bottom: 2rem; }
#frigo-photo.envoi { opacity: .6; pointer-events: none; }

/* Avis du foyer sur une recette */
.avis-membres { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.avis-membres li { display: flex; align-items: center; gap: .6rem; }
.avis-membres li strong { flex: 1; }
.avis-membres .avatar { width: 2rem; height: 2rem; font-size: 1rem; }
.avis-membres button.oui { background: var(--vert-doux); color: var(--vert); border-color: var(--vert); }
.avis-membres button.non { background: var(--rouge-doux); color: var(--rouge); border-color: var(--rouge); }
.mc-outils { display: flex; gap: .5rem; align-items: center; }
.mc-voix { margin: 0; padding: .5rem 1.5rem; background: var(--menthe); color: var(--encre); font-size: .9rem; display: flex; gap: .4rem; align-items: center; }

/* Batch cooking */
.liste-batch { display: flex; flex-direction: column; gap: .6rem; }
.deroule { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: .6rem; }
.deroule li { display: grid; grid-template-columns: 4.2rem 1fr; gap: .8rem; align-items: start; }
.deroule .quand { font: 800 .95rem var(--police-titre); color: var(--accent); background: var(--accent-doux); border-radius: 999px; text-align: center; padding: .2rem .4rem; }
.deroule p { margin: 0; }
.deroule small { color: var(--texte-doux); }

/* ── Blog public (/blog, pages rendues par le serveur) ─────────────────── */
.blog main { max-width: 860px; }
.blog-entete { justify-content: space-between; }
.blog-entete .blog-rubrique { margin-right: auto; margin-left: .3rem; font: 800 1rem var(--police-titre); color: var(--texte); text-decoration: none; padding: .3rem .8rem; border-radius: 999px; background: var(--menthe); }
.blog-tete { text-align: center; margin: 1rem 0 2rem; }
.blog-tete p { color: var(--texte-doux); }
.blog-categorie { display: inline-block; font: 800 .95rem var(--police-titre); color: var(--texte); border-bottom: 3px dotted var(--texte); padding-bottom: .1rem; margin: 1.2rem 0 .4rem; }
.blog-une, .blog-carte { display: block; color: inherit; text-decoration: none; }
.blog-une h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.1; margin: .2rem 0 .5rem; }
.blog-une:hover h2, .blog-carte:hover h3 { color: var(--accent); }
.blog-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2rem 1.5rem; margin-top: 2.5rem; }
.blog-carte h3 { font: 800 1.15rem/1.2 var(--police-titre); margin: .2rem 0 .4rem; }
.blog-carte p:not(.blog-categorie) { color: var(--texte-doux); font-size: .92rem; margin: 0; }
.blog-carte small { display: block; margin-top: .5rem; color: var(--texte-doux); font-size: .82rem; }

/* Couverture : fond de couleur, photos aux coins, titre dans un cadre blanc (façon magazine) */
.blog-couv { position: relative; aspect-ratio: 16 / 10; background: var(--fond); overflow: hidden; border-radius: 6px; display: grid; place-items: center; container-type: inline-size; }
.blog-couv::before, .blog-couv::after { content: ''; position: absolute; width: 6%; aspect-ratio: 1; background: var(--accent); }
.blog-couv::before { left: 0; top: 0; } .blog-couv::after { right: 0; bottom: 0; }
.blog-couv-photo { position: absolute; width: 38%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: 0 10px 24px rgb(0 0 0 / 18%); }
.blog-couv-photo img { width: 100%; height: 100%; object-fit: cover; }
.blog-couv-photo.p0 { left: -6%; top: -12%; }
.blog-couv-photo.p1 { right: -5%; bottom: -14%; }
.blog-couv-photo.p2 { right: 4%; top: -18%; width: 24%; }
.blog-couv-titre { position: relative; z-index: 1; width: 64%; background: #fff; color: #16251b; padding: 6cqw 5cqw; text-align: center; font: 800 clamp(.95rem, 5.4cqw, 2.4rem)/1.15 var(--police-titre); letter-spacing: -.01em; }
.blog-couv.grande { border-radius: 8px; }

/* Article */
.blog-article > .blog-couv { margin-top: .5rem; }
.blog-article { text-align: left; }
.blog-article h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.08; margin: .2rem 0 .7rem; }
.blog-chapeau { font-size: 1.2rem; line-height: 1.5; margin: 0 0 .4rem; }
.blog-date { color: var(--texte-doux); font-size: .88rem; margin: 0 0 1.5rem; }
.blog-intro { font-size: 1.05rem; }
.blog-section h2 { font-size: 1.6rem; margin: 2.2rem 0 .8rem; padding-top: .8rem; border-top: 2px solid var(--bord); }
.blog-recette { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.2rem; align-items: start; margin: 1.2rem 0 1.8rem; }
.blog-recette-img { display: block; aspect-ratio: 4 / 3; border-radius: var(--rayon-petit); overflow: hidden; background: var(--surface-2); }
.blog-recette-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.blog-recette-img:hover img { transform: scale(1.04); }
.blog-recette h3 { font: 800 1.25rem/1.2 var(--police-titre); margin: 0 0 .3rem; }
.blog-recette h3 a { color: inherit; text-decoration: none; }
.blog-recette p { margin: 0 0 .5rem; }
.blog-meta { color: var(--texte-doux); font-size: .88rem; }
.blog-liens { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.blog-source { font-size: .85rem; color: var(--texte-doux); }
.blog-astuce { background: var(--citron); color: #16251b; border-radius: var(--rayon); padding: 1.2rem 1.4rem; margin: 2rem 0; }
.blog-astuce b { font: 800 1.1rem var(--police-titre); }
.blog-astuce p { margin: .3rem 0 0; }

/* Planning du mois : calendrier */
.blog-calendrier { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; margin: 1.5rem 0 1rem; }
.blog-calendrier > b { text-align: center; font: 800 .8rem var(--police-titre); color: var(--texte-doux); }
.blog-calendrier a { position: relative; display: flex; flex-direction: column; gap: .2rem; color: inherit; text-decoration: none; background: var(--surface-2); border-radius: 10px; padding: .3rem; font-size: .7rem; line-height: 1.2; }
.blog-calendrier a img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 8px; }
.blog-calendrier a span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-calendrier i { position: absolute; top: .45rem; left: .45rem; font: 800 .75rem var(--police-titre); font-style: normal; background: #fff; border-radius: 6px; padding: .05rem .3rem; }

.blog-pied { max-width: 860px; margin: 0 auto; padding: 0 1rem 3rem; }
.blog-appel { background: var(--menthe); border-radius: var(--rayon); padding: 1.6rem; text-align: center; margin-bottom: 1rem; }
.blog-appel h2 { margin-top: 0; }
@media (max-width: 640px) {
  .blog-recette { grid-template-columns: 1fr; gap: .6rem; }
  .blog-calendrier { gap: .2rem; } .blog-calendrier a span { display: none; } .blog-calendrier a { padding: .15rem; }
  .blog-entete .btn { padding: .5rem .8rem; font-size: .85rem; }
}

/* Accueil de l'appli : les derniers articles du blog */
.blog-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.blog-mini a { display: flex; flex-direction: column; color: inherit; text-decoration: none; background: var(--fond-art, var(--menthe)); border-radius: var(--rayon); overflow: hidden; }
.blog-mini img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.blog-mini span { display: flex; flex-direction: column; gap: .2rem; padding: .8rem 1rem 1rem; color: #16251b; }
.blog-mini small { color: inherit; opacity: .75; font-weight: 700; }
.blog-mini b { font: 800 1.05rem/1.25 var(--police-titre); }

/* Accueil : carrousel de bannières, au-dessus de la question */
.carrousel { margin-bottom: 1.2rem; }
.carrousel-piste { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--rayon); }
.carrousel-piste::-webkit-scrollbar { display: none; }
.carrousel-piste > .banniere { flex: 0 0 100%; scroll-snap-align: start; border-radius: 0; }
.carrousel-points { display: flex; justify-content: center; gap: .4rem; margin-top: .5rem; }
.carrousel-points button { width: .55rem; height: .55rem; padding: 0; border: 0; border-radius: 999px; background: var(--bord); cursor: pointer; transition: width .2s, background .2s; }
.carrousel-points button.on { width: 1.4rem; background: var(--accent); }
.banniere { display: flex; align-items: stretch; min-height: 7.5rem; border-radius: var(--rayon); overflow: hidden; background: var(--fond-art, var(--menthe)); color: #16251b; text-decoration: none; }
.banniere-texte { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: .25rem; padding: 1rem 1.3rem; }
.banniere small { color: inherit; opacity: .75; font-weight: 700; }
.banniere b { font: 800 clamp(1.1rem, 2.6vw, 1.6rem)/1.15 var(--police-titre); }
.banniere em { font-style: normal; font-weight: 700; color: var(--accent-fonce); }
.banniere img { width: clamp(7.5rem, 32%, 22rem); object-fit: cover; flex: none; }
.banniere:hover b { text-decoration: underline; text-decoration-thickness: 2px; }
.carrousel .banniere { height: clamp(9.5rem, 20vw, 13.5rem); min-height: 0; }
.carrousel .banniere img { height: 100%; width: clamp(8rem, 42%, 30rem); }
.carrousel .banniere-texte { padding: 1rem clamp(1.2rem, 4vw, 3rem); }
.carrousel .banniere b { font-size: clamp(1.15rem, 3vw, 2.1rem); }
/* Carrousel, version « vraie bannière » : la photo en plein cadre, le texte posé dessus */
.carrousel { position: relative; }
.carrousel .banniere { position: relative; height: clamp(13rem, 34vw, 22rem); background: #16251b; color: #fff; }
.carrousel .banniere img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 6s ease-out; }
.carrousel .banniere:hover img { transform: scale(1.04); }
.carrousel .banniere::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(10 18 12 / 78%) 0%, rgb(10 18 12 / 45%) 45%, transparent 75%), linear-gradient(0deg, rgb(10 18 12 / 45%), transparent 40%); }
.carrousel .banniere-texte { position: relative; z-index: 1; max-width: min(34rem, 80%); justify-content: flex-end; padding: 1.4rem clamp(1.2rem, 4vw, 2.6rem) 2.4rem; gap: .45rem; }
.carrousel .banniere small { align-self: flex-start; background: var(--accent); color: #fff; opacity: 1; border-radius: 999px; padding: .2rem .7rem; font-size: .78rem; letter-spacing: .02em; }
.carrousel .banniere b { font-size: clamp(1.5rem, 4.4vw, 2.9rem); line-height: 1.05; text-shadow: 0 2px 14px rgb(0 0 0 / 35%); }
.carrousel .banniere em { color: #fff; font-size: .95rem; text-decoration: underline; text-underline-offset: 3px; }
.carrousel-points { position: absolute; left: clamp(1.2rem, 4vw, 2.6rem); bottom: 1rem; margin: 0; z-index: 2; }
.carrousel-points button { background: rgb(255 255 255 / 55%); }
.carrousel-points button.on { background: #fff; }
/* Téléphone : bloc « on mange quoi ? » resserré sous la bannière */
@media (max-width: 600px) {
  .hero { padding: 1.3rem 1.2rem 1.1rem; }
  .hero h1 { font-size: 2rem; }
  .hero-ia { flex-wrap: nowrap; margin: .8rem 0; }
  .hero-ia input { flex: 1 1 auto; min-width: 0; font-size: 1rem; padding: .7rem 1rem; }
  .hero .btn { padding: .6rem .9rem; }
  .suggestions-ia { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .4rem; margin: 0 -1.2rem; padding: 0 1.2rem .2rem; scrollbar-width: none; }
  .suggestions-ia::-webkit-scrollbar { display: none; }
  .suggestions-ia .puce { white-space: nowrap; flex: none; }
}

/* ── Téléphone : passe d'ensemble (04/10) ─────────────────────────────── */
.assistant-lien { display: none; }
.puce-reprendre { background: var(--encre) !important; color: var(--fond) !important; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
@media (max-width: 900px) {
  /* l'assistant n'a pas d'onglet en bas : un bouton dans l'en-tête */
  .assistant-lien { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin-left: auto; margin-right: .4rem; border-radius: 50%; background: var(--menthe); color: var(--encre); }
  .assistant-lien .ic { width: 1.2rem; height: 1.2rem; }
}
@media (max-width: 600px) {
  main { padding: 1rem .9rem 5.5rem; }
  /* recettes en 2 colonnes, cartes allégées */
  .grille, .grille.petite { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .carte-img { aspect-ratio: 1; margin: .35rem .35rem 0; border-radius: 12px; }
  .carte-corps { padding: .55rem .6rem .7rem; gap: .2rem; }
  .carte h3 { font-size: .92rem; line-height: 1.25; }
  .carte-meta { font-size: .74rem; gap: .15rem .5rem; }
  .carte-puces, .carte-source, .carte .pourquoi, .carte .manquants, .carte .materiel-manquant { display: none; }
  .carte .raisons { font-size: .72rem; }
  .jauge { font-size: .68rem; padding: .1rem .45rem; }
  .bloc { margin: 1.6rem 0; }
  .bloc > header h2 { font-size: 1.35rem; }
  /* fiche recette : les actions sur une ligne qui glisse */
  .fiche-actions { flex-wrap: nowrap; overflow-x: auto; margin: 1rem -.9rem 0; padding: 0 .9rem .3rem; scrollbar-width: none; }
  .fiche-actions::-webkit-scrollbar { display: none; }
  .fiche-actions > * { flex: none; }
  .fiche-actions .btn { padding: .55rem .9rem; }
  /* en-têtes de page : boutons qui glissent au lieu de s'empiler */
  .page-tete .actions { flex-wrap: nowrap; overflow-x: auto; margin-right: -.9rem; padding-right: .9rem; scrollbar-width: none; }
  .page-tete .actions::-webkit-scrollbar { display: none; }
  .page-tete .actions > * { flex: none; }
  /* menu : les boutons d'un plat sous son titre, plus petits */
  .case-actions { margin-left: calc(64px + .6rem); justify-content: flex-start; gap: .3rem; }
  .case-actions .icone { width: 2rem; height: 2rem; }
  .jour { padding: .8rem; }
  /* frigo : l'ajout rapide sur deux lignes qui glissent */
  .ajout-rapide, .puces-rapides { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); justify-content: start; overflow-x: auto; scrollbar-width: none; }
  /* livres : deux par ligne */
  .liste-livres, .etagere { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
  .livre { padding: .9rem; }
  /* assistant : la saisie reste au-dessus de la barre du bas */
  .saisie-chat textarea { font-size: 1rem; }
}
@media (max-width: 900px) { .entete .profil-lien { margin-left: 0; } }
@media (max-width: 600px) {
  .puces-rapides .puce { white-space: nowrap; }
  .fiche-actions [data-action="mode-cuisine"] { order: -1; }
}
@media (max-width: 800px) { .fiche-tete, .fiche-corps { grid-template-columns: minmax(0, 1fr); } .fiche-intro, .fiche-img { min-width: 0; } }
@media (max-width: 600px) { .puces-rapides { grid-auto-columns: max-content; } }
/* l'assistant collé au prénom (l'en-tête espace ses éléments de 1rem) */
@media (max-width: 900px) { .entete .assistant-lien { margin-right: -.6rem; width: 2.3rem; height: 2.3rem; } }

/* Page Recettes : catégories en rangées de vignettes */
.categories { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1.6rem; }
.categories h2 { font-size: 1.05rem; margin: 0 0 .45rem; }
.categories-rangee { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: thin; scroll-snap-type: x proximity; }
.categorie { flex: none; width: 6.4rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; text-decoration: none; color: inherit; text-align: center; scroll-snap-align: start; }
.categorie-img { width: 5.6rem; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: var(--surface-2); box-shadow: var(--ombre); transition: transform .2s; }
.categorie-img img { width: 100%; height: 100%; object-fit: cover; }
.categorie:hover .categorie-img { transform: translateY(-2px) rotate(-2deg); }
.categorie b { font-size: .85rem; line-height: 1.2; margin-top: .25rem; }
.categorie small { font-size: .72rem; }
.categorie.active .categorie-img { outline: 3px solid var(--accent); outline-offset: 2px; }
.categorie.active b { color: var(--accent-fonce); }
@media (max-width: 600px) {
  .categories-rangee { margin-right: -.9rem; padding-right: .9rem; scrollbar-width: none; }
  .categorie { width: 4.7rem; } .categorie-img { width: 4.3rem; border-radius: 16px; }
  .categorie b { font-size: .76rem; overflow-wrap: anywhere; }
  .categories { gap: .6rem; }
}
/* Téléphone, suite : rien ne doit glisser sans qu'on le devine */
@media (max-width: 600px) {
  /* fiche : « Mode cuisine » en large, puis une barre d'actions : icône dans un rond, mot court dessous */
  .fiche-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .2rem; overflow: visible; margin: 1rem 0 0; padding: 0; }
  .fiche-actions [data-action="mode-cuisine"] { grid-row: 1; grid-column: 1 / -1; padding: .75rem; font-size: 1rem; margin-bottom: .6rem; }
  .fiche-actions > button.btn:not([data-action="mode-cuisine"]):not([data-action="voir-video"]), .fiche-actions .plus > summary { grid-row: 2; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 0; background: none; border: 0; box-shadow: none; color: var(--texte); font-size: .74rem; font-weight: 700; min-width: 0; }
  .fiche-actions > button.btn:not([data-action="mode-cuisine"]):not([data-action="voir-video"]) .ic, .fiche-actions .plus > summary .ic { box-sizing: content-box; width: 1.3rem; height: 1.3rem; padding: .75rem; border-radius: 50%; background: var(--surface-2); color: var(--encre); transition: background .15s; }
  .fiche-actions > button.btn:not(.secondaire):not([data-action="mode-cuisine"]) .ic { background: var(--accent-doux); color: var(--accent); }
  .fiche-actions > button.btn:not([data-action="mode-cuisine"]):not([data-action="voir-video"]):active .ic { background: var(--menthe); }
  .fiche-actions .plus { grid-row: 2; display: flex; justify-content: center; }
  .fiche-actions .plus > summary { list-style: none; }
  .fiche-actions .plus > summary::-webkit-details-marker { display: none; }
  /* une recette avec vidéo : « Vidéo » en grand à côté de « Mode cuisine » */
  .fiche-actions:has([data-action="voir-video"]) [data-action="mode-cuisine"] { grid-column: 1 / 3; }
  .fiche-actions [data-action="voir-video"] { grid-row: 1; grid-column: 3 / -1; margin-bottom: .6rem; padding: .75rem; font-size: 1rem; background: var(--encre); color: var(--fond); border-color: var(--encre); }
  .lib-long { display: none; }
  .lib-court { display: contents; }
  /* boutons d'en-tête de page : de nouveau sur plusieurs lignes */
  .page-tete .actions { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; }
  /* les rangées qui glissent s'estompent à droite : on voit qu'il y a une suite */
  .categories-rangee, .puces-rapides, .suggestions-ia { -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent); mask-image: linear-gradient(90deg, #000 78%, transparent); }
}
/* une rangée qui glisse ne doit jamais élargir la page : les colonnes peuvent rétrécir sous leur contenu */
.recherche-corps > *, .categories, .categories > section { min-width: 0; }
.categories h2 { display: flex; align-items: center; justify-content: space-between; }
.categories-suite { width: 2rem; height: 2rem; }

/* libellés des actions de la fiche : longs sur ordinateur, courts (sous l'icône) sur téléphone */
@media (min-width: 601px) { .lib-court { display: none; } }

/* Fiche : le favori est un cœur posé sur la photo */
.fiche-img { position: relative; }
.coeur-photo { position: absolute; top: .8rem; right: .8rem; width: 3rem; height: 3rem; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / 92%); color: var(--accent); box-shadow: 0 4px 14px rgb(0 0 0 / 18%); cursor: pointer; transition: transform .15s; }
.coeur-photo .ic { width: 1.45rem; height: 1.45rem; }
.coeur-photo:active { transform: scale(.9); }
.coeur-photo.on { background: var(--accent); color: #fff; }
/* le cœur des cartes : un vrai bouton, sur toutes les recettes */
.carte { position: relative; }
.coeur-carte { top: .9rem; right: .9rem; width: 2.3rem; height: 2.3rem; z-index: 2; }
.coeur-carte .ic { width: 1.1rem; height: 1.1rem; }
@media (max-width: 600px) { .coeur-carte { top: .7rem; right: .7rem; width: 2rem; height: 2rem; } .coeur-carte .ic { width: .95rem; height: .95rem; } }
@media (min-width: 601px) { .fiche-actions [data-action="mode-cuisine"] { order: -2; } .fiche-actions [data-action="voir-video"] { order: -1; } }
/* Recettes, téléphone : « Pour moi », « Filtres » et la loupe sur une seule ligne sous le champ */
@media (max-width: 900px) {
  .recherche { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: .5rem; align-items: center; }
  .barre-recherche { display: contents; }
  .barre-recherche input { grid-column: 1 / -1; margin-bottom: .6rem; }
  .barre-recherche select { grid-column: 1; grid-row: 2; min-width: 0; }
  .recherche > .bouton-filtres { grid-column: 2; grid-row: 2; margin: 0; }
  .barre-recherche .btn { grid-column: 3; grid-row: 2; }
  .recherche-corps { grid-column: 1 / -1; margin-top: 1.2rem; }
}
/* champ de recherche : même apparence que les autres (iPhone lui met sinon son propre style) */
input[type="search"] { -webkit-appearance: none; appearance: none; }
/* catégorie choisie : son nom en titre, et le retour aux catégories */
.categorie-choisie { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; margin-bottom: 1rem; }
.categorie-choisie h1 { display: flex; align-items: center; gap: .7rem; margin: 0; font-size: clamp(1.6rem, 5vw, 2.2rem); }
.categorie-choisie h1 img { width: 3.2rem; height: 3.2rem; border-radius: 14px; object-fit: cover; box-shadow: var(--ombre); }

/* Prix estimé */
.prix-courses { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem; background: var(--menthe); color: var(--encre); border-radius: var(--rayon-petit); padding: .6rem .9rem; margin: .4rem 0 0; }
.prix-courses strong { font-size: 1.15rem; }
.prix-courses small { color: inherit; opacity: .75; }
@media (max-width: 600px) { .carte-meta .kcal { display: none; } }

/* Mode cuisine : les ingrédients de l'étape, avec les quantités */
.mc-ingredients { margin-top: 1.2rem; background: var(--surface-2); border-radius: var(--rayon-petit); padding: .8rem 1rem; }
.mc-ingredients small { display: block; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; margin-bottom: .35rem; }
.mc-ingredients ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.mc-ingredients li { background: var(--surface); border-radius: 999px; padding: .35rem .8rem; font-size: 1.05rem; font-weight: 600; box-shadow: var(--ombre); }

/* Scanner de codes-barres */
.scanner { display: flex; flex-direction: column; gap: .8rem; }
.scanner-video { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: var(--rayon-petit); overflow: hidden; }
.scanner-video video { width: 100%; height: 100%; object-fit: cover; }
.scanner-cadre { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 3px solid #fff; border-radius: 12px; box-shadow: 0 0 0 999px rgb(0 0 0 / 35%); }
.scanner-produit { display: flex; gap: .8rem; align-items: center; background: var(--surface-2); border-radius: var(--rayon-petit); padding: .7rem; }
.scanner-produit img { width: 4rem; height: 4rem; object-fit: contain; background: #fff; border-radius: 10px; }
.scanner-produit div { display: flex; flex-direction: column; gap: .1rem; }
.scanner-choix { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin-top: .6rem; }
.scanner-choix .btn { flex-direction: column; white-space: normal; padding: .6rem .3rem; font-size: .82rem; text-align: center; }

/* Scanner : Nutri-Score, Éco-Score, NOVA */
.scanner-notes { display: flex; gap: .5rem; margin-top: .6rem; }
.note-lettre { flex: 1; display: flex; flex-direction: column; align-items: center; border-radius: 12px; padding: .35rem .3rem; font: 800 1.4rem/1.1 var(--police-titre); color: #fff; }
.note-lettre small { font: 700 .66rem var(--police); color: inherit; opacity: .9; }
.n-a { background: #038141; } .n-b { background: #85bb2f; } .n-c { background: #fecb02; color: #3b2a00; } .n-d { background: #ee8100; } .n-e { background: #e63e11; }
.nova-1 { background: #00aa00; } .nova-2 { background: #ffcc00; color: #3b2a00; } .nova-3 { background: #ff6600; } .nova-4 { background: #ff0000; }

/* Fiche produit façon Yuka */
.scanner-bas { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .4rem; }
.fiche-produit h3 { font-size: .95rem; margin: 1rem 0 .4rem; }
.fp-tete { display: flex; gap: .8rem; align-items: center; margin: .4rem 0 .8rem; }
.fp-tete img { width: 4.5rem; height: 4.5rem; object-fit: contain; background: #fff; border-radius: 12px; }
.fp-tete div { display: flex; flex-direction: column; }
.fp-note { display: flex; align-items: center; gap: .8rem; border-radius: var(--rayon-petit); padding: .7rem 1rem; color: #fff; }
.fp-note b { font: 800 2.2rem/1 var(--police-titre); } .fp-note b small { font-size: 1rem; color: inherit; opacity: .85; }
.fp-note span { font: 800 1.2rem var(--police-titre); }
.note-excellent { background: #038141; } .note-bon { background: #5aa52f; } .note-médiocre { background: #ee8100; } .note-mauvais { background: #e63e11; }
.fp-nutrition, .fp-additifs { list-style: none; margin: 0; padding: 0; }
.fp-nutrition li { display: grid; grid-template-columns: 1fr auto 4.2rem; gap: .5rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--bord); }
.fp-nutrition i { font-style: normal; font-size: .75rem; font-weight: 700; text-align: center; border-radius: 999px; padding: .1rem .4rem; }
.niv-ok { background: #d8f0d1; color: #1d6b2c; } .niv-moyen { background: #ffe9c2; color: #8a5300; } .niv-haut { background: #ffd8cf; color: #b0300f; }
.fp-additifs li { padding: .35rem 0; border-bottom: 1px solid var(--bord); }
.fp-additifs li.debat b, .fp-additifs li.debat small { color: #c0392b; }
.fp-ingredients { font-size: .88rem; color: var(--texte-doux); }
/* le scan à côté de l'assistant, dans l'en-tête du téléphone */
@media (max-width: 900px) { .entete .scanner-lien { border: 0; padding: 0; cursor: pointer; margin-right: -.6rem; } .entete .scanner-lien + .assistant-lien { margin-left: 0; } }

/* Connexion : l'encart « ChowMe en appli », et pas de boutons scan / assistant tant qu'on n'est pas connecté */
.encart-appli { display: flex; align-items: center; gap: .8rem; background: var(--menthe); color: var(--encre); border-radius: var(--rayon-petit); padding: .8rem 1rem; margin-bottom: 1.2rem; }
.encart-appli > .ic { width: 1.6rem; height: 1.6rem; flex: none; }
.encart-appli div { flex: 1; display: flex; flex-direction: column; }
.encart-appli small { color: inherit; opacity: .8; }
.encart-appli small .ic { width: 1em; height: 1em; vertical-align: -.15em; }
body:not(.connecte) .assistant-lien { display: none !important; }

/* Programmes alimentaires */
.fiche-programme header { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.fiche-programme header h2 { margin: 0; }
.besoins { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bord); }
.besoins p { margin: 0 0 .5rem; }
.macros { list-style: none; padding: 0; margin: .4rem 0 .8rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.macros li { background: var(--surface-2); border-radius: var(--rayon-petit); padding: .5rem; text-align: center; display: flex; flex-direction: column; }
.macros b { font: 800 1.2rem var(--police-titre); }
.suivi { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bord); }
.suivi h3 { margin-top: 0; }
.courbe-poids { width: 100%; height: auto; color: var(--accent); background: var(--surface-2); border-radius: var(--rayon-petit); margin-bottom: .5rem; }
.courbe-poids circle { fill: var(--accent); }
.courbe-poids text { font-size: 9px; fill: var(--texte-doux); }
.programme .avertissement { margin-top: 1.5rem; }
.fiche-nutrition, .fiche-portions { font-size: .92rem; color: var(--texte-doux); margin: .3rem 0; }
/* mode diabète : les glucides de la portion, en évidence */
.glucides { display: flex; gap: .7rem; align-items: flex-start; margin: .6rem 0; padding: .7rem .9rem; border-radius: 12px; border: 2px solid; }
.glucides svg { width: 1.4rem; height: 1.4rem; flex: none; margin-top: .1rem; }
.glucides strong { display: block; font-size: 1.05rem; }
.glucides p { margin: .3rem 0 0; font-size: .92rem; }
.glucides .glucides-detail { font-weight: 600; margin-top: .15rem; }
.glucides small { display: block; margin-top: .3rem; color: var(--texte-doux); font-size: .8rem; }
.glucides.g-faible { border-color: #3f9a5a; background: #eaf6ee; color: #1f5a33; }
.glucides.g-modere { border-color: #d9a21a; background: #fdf5e0; color: #6a4a05; }
.glucides.g-eleve { border-color: #d6452f; background: #fdecea; color: #7a1f12; }
.glucides.g-inconnu { border-color: #b8b8b8; background: #f4f4f4; color: #444; }
.fiche-portions { color: var(--accent-fonce); font-weight: 600; }

/* ── Espace Programme : un coin à part, avec son en-tête et ses sous-onglets ── */
.espace-programme { max-width: 760px; margin: 0 auto; }
.ep-tete { position: relative; background: linear-gradient(135deg, var(--menthe), color-mix(in srgb, var(--citron) 55%, var(--menthe))); color: #16251b; border-radius: var(--rayon); padding: 1.2rem 1.2rem 1rem; margin-bottom: .8rem; overflow: hidden; }
.ep-tete::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgb(255 255 255 / 25%); }
.ep-tete h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.4rem); }
.ep-sous { margin: .2rem 0 0; font-weight: 700; opacity: .8; }
.ep-retour { position: absolute; right: 1rem; top: 1rem; z-index: 1; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: rgb(255 255 255 / 70%); color: inherit; }
.ep-personnes { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0 .2rem; position: relative; z-index: 1; }
.ep-personnes a { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem .25rem .25rem; border-radius: 999px; background: rgb(255 255 255 / 55%); color: inherit; text-decoration: none; font-weight: 700; font-size: .9rem; }
.ep-personnes a.actif { background: #16251b; color: #fff; }
.ep-personnes .avatar { width: 1.8rem; height: 1.8rem; font-size: .95rem; }
.ep-onglets { position: sticky; top: 4.2rem; z-index: 5; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; background: var(--surface-2); border-radius: 999px; padding: .25rem; margin-bottom: 1rem; }
.ep-onglets a { display: flex; align-items: center; justify-content: center; gap: .3rem; padding: .5rem .3rem; border-radius: 999px; color: var(--texte-doux); text-decoration: none; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.ep-onglets a.actif { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }
@media (max-width: 420px) { .ep-onglets a { flex-direction: column; gap: .1rem; font-size: .72rem; border-radius: 16px; } .ep-onglets { border-radius: 20px; } }
.ep-jour { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1rem; }
.ep-anneau { position: relative; width: 9.5rem; aspect-ratio: 1; }
.ep-anneau svg { width: 100%; height: 100%; }
.ep-anneau circle { fill: none; stroke-width: 11; }
.ep-anneau .fond { stroke: var(--surface-2); }
.ep-anneau .part { stroke: var(--vert); stroke-linecap: round; transition: stroke-dasharray .6s; }
.ep-anneau .part.trop { stroke: var(--accent); }
.ep-anneau > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.2rem; }
.ep-anneau b { font: 800 1.7rem/1 var(--police-titre); }
.ep-anneau small { font-size: .7rem; line-height: 1.2; }
.ep-macros { display: flex; flex-direction: column; gap: .7rem; }
.ep-barre { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; font-size: .88rem; }
.ep-barre span { font-weight: 700; }
.ep-barre i { grid-column: 1 / -1; grid-row: 2; height: .55rem; border-radius: 999px; background: linear-gradient(90deg, var(--vert) var(--p), var(--surface-2) var(--p)); }
.ep-barre.trop i { background: linear-gradient(90deg, var(--accent) var(--p), var(--surface-2) var(--p)); }
.ep-barre small { grid-column: 2; grid-row: 1; }
@media (max-width: 520px) { .ep-jour { grid-template-columns: 1fr; justify-items: center; } .ep-macros { width: 100%; } }
.ep-repas { list-style: none; padding: 0; margin: .5rem 0 1rem; display: flex; flex-direction: column; gap: .5rem; }
.ep-repas a { display: grid; grid-template-columns: 4rem 1fr; gap: .8rem; align-items: center; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: .5rem; color: inherit; text-decoration: none; }
.ep-repas img, .ep-repas .img-vide { width: 4rem; height: 4rem; border-radius: 12px; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); }
.ep-repas div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.ep-conseil { display: flex; gap: .7rem; align-items: flex-start; background: var(--citron); color: #16251b; border-radius: var(--rayon); padding: 1rem; margin: 1rem 0; }
.ep-conseil > .ic { width: 1.5rem; height: 1.5rem; flex: none; }
.ep-conseil p { margin: 0; } .ep-conseil strong { display: block; }
.ep-poids { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .6rem; } .ep-poids b { font: 800 1.8rem var(--police-titre); }
.ep-invitation h2 { margin-top: 0; }
.ep-avertissement { margin-top: 1.5rem; }
/* Accueil : la carte d'entrée */
.carte-programme { display: flex; align-items: center; gap: .9rem; background: linear-gradient(135deg, var(--menthe), color-mix(in srgb, var(--citron) 45%, var(--menthe))); color: #16251b; border-radius: var(--rayon); padding: 1rem 1.1rem; margin: 0 0 1.2rem; text-decoration: none; }
.carte-programme .cp-icone { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: rgb(255 255 255 / 65%); flex: none; }
.carte-programme .cp-icone .ic { width: 1.5rem; height: 1.5rem; }
.carte-programme div { flex: 1; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.carte-programme strong { font: 800 1.15rem var(--police-titre); }
.carte-programme small { color: inherit; opacity: .8; }
.cp-barre { height: .45rem; border-radius: 999px; margin-top: .3rem; background: linear-gradient(90deg, #16251b var(--p), rgb(255 255 255 / 60%) var(--p)); }

/* ── Visite guidée ── */
.tuto { position: fixed; inset: 0; z-index: 200; }
.tuto-trou { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgb(10 20 14 / 62%); outline: 3px solid var(--citron); transition: all .35s ease; pointer-events: none; }
.tuto.centre .tuto-trou { left: 50%; top: 50%; width: 0; height: 0; outline: none; }
.tuto-bulle { position: fixed; background: var(--surface); color: var(--texte); border-radius: var(--rayon); padding: 1rem 1.1rem; box-shadow: 0 18px 50px rgb(0 0 0 / 35%); transition: top .35s ease, bottom .35s ease, left .35s ease; animation: tuto-entree .3s ease; }
.tuto.centre .tuto-bulle { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(400px, calc(100vw - 32px)); }
@keyframes tuto-entree { from { opacity: 0; translate: 0 8px; } }
.tuto-tete { display: flex; align-items: center; gap: .6rem; }
.tuto-tete small { color: var(--texte-doux); font-weight: 700; }
.tuto-icone { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--menthe); color: #16251b; }
.tuto-icone .ic { width: 1.3rem; height: 1.3rem; }
.tuto-passer { margin-left: auto; background: none; border: 0; padding: .3rem .2rem; color: var(--texte-doux); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tuto-bulle h2 { margin: .6rem 0 .3rem; font-size: 1.3rem; }
.tuto-bulle p { margin: 0; line-height: 1.45; }
.tuto-points { display: flex; gap: .3rem; justify-content: center; margin: .9rem 0 .7rem; }
.tuto-points i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--surface-2); transition: width .25s; }
.tuto-points i.actif { width: 1.3rem; border-radius: 999px; background: var(--accent); }
.tuto-actions { display: flex; justify-content: space-between; gap: .6rem; }
button.bloc-menu { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }

/* mode diabète : pastille d'indice glycémique sur les cartes de recette */
.carte-meta .ig { font-weight: 700; }
.carte-meta .ig i { display: inline-block; width: .6em; height: .6em; border-radius: 50%; margin-right: .3em; vertical-align: .05em; }
.carte-meta .ig-faible { color: #2f7d47; } .carte-meta .ig-faible i { background: #3f9a5a; }
.carte-meta .ig-moyen { color: #9a6a05; } .carte-meta .ig-moyen i { background: #d9a21a; }
.carte-meta .ig-fort { color: #b8321f; } .carte-meta .ig-fort i { background: #d6452f; }

/* logo ChowMe! (06/10/2026) : « Chow » à l'encre, « Me! » en tomate */
.logo, .auth-visuel .auth-marque, .apercu .auth-marque { color: var(--encre); }
.logo em, .auth-marque em { font-style: normal; color: var(--accent); }
