/* Marmiteo — feuille de style unique, pensee pour le telephone d'abord. */

/* ------------------------------------------------------------- variables */
:root {
  color-scheme: light dark;

  --fond: #f6f4ee;
  --fond-2: #ffffff;
  --fond-3: #efece3;
  --bord: #e0dcd0;
  --bord-fort: #c9c3b2;
  --texte: #1d2420;
  --texte-2: #5d6861;
  --texte-3: #8a948d;

  --vert: #2f7d53;
  --vert-clair: #e4f1e9;
  --vert-fonce: #205a3b;
  --ambre: #b5751b;
  --ambre-clair: #fbeed8;
  --rouge: #b43b2e;
  --rouge-clair: #fbe6e3;
  --bleu: #2e6a8f;
  --bleu-clair: #e2eef5;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --ombre: 0 1px 2px rgba(29, 36, 32, .06), 0 6px 18px -8px rgba(29, 36, 32, .18);
  --ombre-haute: 0 -6px 24px -10px rgba(29, 36, 32, .25);

  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
  --h-entete: 56px;
  --h-nav: 62px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #121a15;
    --fond-2: #1a241e;
    --fond-3: #223029;
    --bord: #2c3c33;
    --bord-fort: #3e5347;
    --texte: #e9efe9;
    --texte-2: #a3b1a8;
    --texte-3: #76857b;

    --vert: #58b483;
    --vert-clair: #1d3328;
    --vert-fonce: #7dcda1;
    --ambre: #e3a54e;
    --ambre-clair: #33281a;
    --rouge: #e8796a;
    --rouge-clair: #351f1c;
    --bleu: #6aaad0;
    --bleu-clair: #1b2c36;

    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .6);
    --ombre-haute: 0 -6px 24px -10px rgba(0, 0, 0, .7);
  }
}

/* Le theme choisi a la main gagne sur la preference du systeme. */
:root[data-theme="light"] {
  color-scheme: light;
  --fond: #f6f4ee; --fond-2: #fff; --fond-3: #efece3;
  --bord: #e0dcd0; --bord-fort: #c9c3b2;
  --texte: #1d2420; --texte-2: #5d6861; --texte-3: #8a948d;
  --vert: #2f7d53; --vert-clair: #e4f1e9; --vert-fonce: #205a3b;
  --ambre: #b5751b; --ambre-clair: #fbeed8;
  --rouge: #b43b2e; --rouge-clair: #fbe6e3;
  --bleu: #2e6a8f; --bleu-clair: #e2eef5;
  --ombre: 0 1px 2px rgba(29,36,32,.06), 0 6px 18px -8px rgba(29,36,32,.18);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #121a15; --fond-2: #1a241e; --fond-3: #223029;
  --bord: #2c3c33; --bord-fort: #3e5347;
  --texte: #e9efe9; --texte-2: #a3b1a8; --texte-3: #76857b;
  --vert: #58b483; --vert-clair: #1d3328; --vert-fonce: #7dcda1;
  --ambre: #e3a54e; --ambre-clair: #33281a;
  --rouge: #e8796a; --rouge-clair: #351f1c;
  --bleu: #6aaad0; --bleu-clair: #1b2c36;
  --ombre: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -10px rgba(0,0,0,.6);
}

/* ------------------------------------------------------------- base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* L'attribut hidden doit toujours gagner, meme contre un display: flex pose
   plus bas dans cette feuille. Sans cette regle, le mode cuisine et les
   feuilles modales resteraient affiches en permanence. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--fond);
  color: var(--texte);
  font: 400 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--h-nav) + var(--bas));
  min-height: 100dvh;
}

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; font-weight: 650; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
p { margin: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; }

::selection { background: var(--vert); color: #fff; }

:focus-visible { outline: 2px solid var(--vert); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------- entete */
.entete {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  height: calc(var(--h-entete) + var(--haut));
  padding: var(--haut) 12px 0;
  background: color-mix(in srgb, var(--fond) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--bord);
}
.entete-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.entete-titre strong {
  font-size: 17px; font-weight: 650; letter-spacing: -.015em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entete-titre span { font-size: 12px; color: var(--texte-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-icone {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--texte-2);
}
.btn-icone:active { background: var(--fond-3); }

.i-soleil { display: none; }
:root[data-theme="dark"] .i-lune, html:not([data-theme]) .i-lune { display: block; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .i-lune { display: none; } html:not([data-theme]) .i-soleil { display: block; } }
:root[data-theme="dark"] .i-lune { display: none; }
:root[data-theme="dark"] .i-soleil { display: block; }
:root[data-theme="light"] .i-lune { display: block; }
:root[data-theme="light"] .i-soleil { display: none; }

/* ------------------------------------------------------------- mise en page */
.ecran { padding: 4px 0 24px; animation: entre .22s ease both; }
@keyframes entre { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .ecran { animation: none; } }

.bloc { padding: 14px 16px; }
.bloc.intro { padding-top: 18px; padding-bottom: 6px; }
.bloc-entete { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.bloc-entete h2 { flex: 1; }
.aide { color: var(--texte-2); font-size: 14px; margin-top: 6px; }
.compteur {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px;
  padding: 0 6px; border-radius: 11px;
  background: var(--vert-clair); color: var(--vert-fonce);
  font-size: 12px; font-weight: 650;
}
.lien-action { border: 0; background: none; color: var(--texte-3); font-size: 13px; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------- chargement */
.chargement { padding: 80px 24px; text-align: center; color: var(--texte-2); }
.marmite-anim { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.marmite-anim span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--vert);
  animation: saute 1s ease-in-out infinite;
}
.marmite-anim span:nth-child(2) { animation-delay: .15s; }
.marmite-anim span:nth-child(3) { animation-delay: .3s; }
@keyframes saute { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-9px); opacity: 1; } }

/* ------------------------------------------------------------- saisie */
.saisie-enveloppe { position: relative; }
.saisie-ligne {
  display: flex; align-items: center; gap: 8px;
  background: var(--fond-2); border: 1.5px solid var(--bord);
  border-radius: var(--r-m); padding: 0 10px 0 12px;
  transition: border-color .15s;
}
.saisie-ligne:focus-within { border-color: var(--vert); }
.saisie-ligne .loupe { color: var(--texte-3); }
#saisie {
  flex: 1; min-width: 0; border: 0; background: none; color: var(--texte);
  font-size: 16px; padding: 14px 0; outline: none;
}
#saisie::placeholder { color: var(--texte-3); }

.propositions {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--fond-2); border: 1px solid var(--bord);
  border-radius: var(--r-m); box-shadow: var(--ombre);
  max-height: 46vh; overflow-y: auto;
}
.propositions li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 10px; border-radius: var(--r-s); font-size: 15px;
}
.propositions li[aria-selected="true"], .propositions li:active { background: var(--fond-3); }
.propositions li small { color: var(--texte-3); font-size: 12px; margin-left: auto; }
.non-reconnu { margin-top: 10px; font-size: 13px; color: var(--ambre); }

/* ------------------------------------------------------------- pastilles */
.groupes { display: flex; flex-direction: column; gap: 14px; }
.groupe-titre {
  font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--texte-3); margin-bottom: 8px;
}
.pastilles { display: flex; flex-wrap: wrap; gap: 7px; }

.pastille {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--bord); border-radius: 999px;
  background: var(--fond-2); color: var(--texte);
  padding: 8px 12px; font-size: 14px; line-height: 1;
  max-width: 100%;
}
.pastille.ajout { border-style: dashed; color: var(--texte-2); }
.pastille.ajout svg { width: 15px; height: 15px; }
.pastille span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pastille .croix { display: grid; place-items: center; width: 18px; height: 18px; margin-right: -4px; color: var(--texte-3); }
.pastille .croix svg { width: 13px; height: 13px; stroke-width: 2.2; }
.pastille .delai {
  font-size: 11px; font-weight: 650; padding: 2px 6px; border-radius: 999px;
  background: var(--fond-3); color: var(--texte-2);
}
.pastille.urgent { border-color: var(--rouge); background: var(--rouge-clair); }
.pastille.urgent .delai { background: var(--rouge); color: #fff; }
.pastille.bientot { border-color: var(--ambre); background: var(--ambre-clair); }
.pastille.bientot .delai { background: var(--ambre); color: #fff; }

/* ------------------------------------------------------------- interrupteur */
.interrupteur { display: flex; align-items: flex-start; gap: 12px; }
.interrupteur input { position: absolute; opacity: 0; width: 0; height: 0; }
.piste {
  flex: none; width: 46px; height: 28px; border-radius: 999px;
  background: var(--bord-fort); position: relative; transition: background .18s; margin-top: 2px;
}
.piste::after {
  content: ""; position: absolute; inset: 3px auto 3px 3px; width: 22px;
  border-radius: 50%; background: #fff; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.interrupteur input:checked + .piste { background: var(--vert); }
.interrupteur input:checked + .piste::after { transform: translateX(18px); }
.interrupteur input:focus-visible + .piste { outline: 2px solid var(--vert); outline-offset: 2px; }
.interrupteur-texte { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.interrupteur-texte small { color: var(--texte-2); font-size: 13px; line-height: 1.4; }

/* ------------------------------------------------------------- convives */
.convives {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  background: var(--fond-2); border: 1px solid var(--bord);
  border-radius: var(--r-m); padding: 14px;
}
.btn-rond {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--bord); border-radius: 50%;
  background: var(--fond); color: var(--texte);
}
.btn-rond:active { background: var(--fond-3); transform: scale(.94); }
.btn-rond[disabled] { opacity: .35; }
.convives-valeur { text-align: center; min-width: 94px; }
.convives-valeur strong { display: block; font-size: 30px; font-weight: 650; font-variant-numeric: tabular-nums; }
.convives-valeur small { color: var(--texte-2); font-size: 13px; }

/* ------------------------------------------------------------- boutons */
.btn-principal {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; border-radius: var(--r-m);
  background: var(--vert); color: #fff;
  padding: 16px; font-size: 16px; font-weight: 600;
  box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--vert) 70%, transparent);
}
.btn-principal:active { transform: scale(.985); filter: brightness(.95); }
.btn-principal[disabled] { opacity: .5; box-shadow: none; }

.btn-secondaire {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 1px solid var(--bord-fort); border-radius: var(--r-m);
  background: var(--fond-2); color: var(--texte);
  padding: 14px; font-size: 15px; font-weight: 550;
}
.btn-secondaire:active { background: var(--fond-3); }
.btn-secondaire.danger { color: var(--rouge); border-color: color-mix(in srgb, var(--rouge) 40%, transparent); }

/* ------------------------------------------------------------- filtres */
.filtres-barre {
  position: sticky; top: calc(var(--h-entete) + var(--haut)); z-index: 30;
  display: flex; gap: 8px; padding: 10px 16px;
  overflow-x: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--fond) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
}
.filtres-barre::-webkit-scrollbar { display: none; }
.puce-filtre {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid var(--bord); border-radius: 999px;
  background: var(--fond-2); color: var(--texte-2);
  padding: 8px 13px; font-size: 14px;
}
.puce-filtre svg { width: 16px; height: 16px; }
.puce-filtre.actif { background: var(--vert); border-color: var(--vert); color: #fff; }

.resume { padding: 14px 16px 2px; color: var(--texte-2); font-size: 14px; }

/* ------------------------------------------------------------- sections de résultats */
.section-resultats { padding: 16px 0 6px; }
.section-entete { padding: 0 16px 10px; display: flex; align-items: center; gap: 10px; }
.section-entete h2 { flex: 1; font-size: 16px; }
.pastille-section {
  font-size: 11px; font-weight: 650; padding: 4px 8px; border-radius: 999px;
}
.pastille-section.vert { background: var(--vert-clair); color: var(--vert-fonce); }
.pastille-section.ambre { background: var(--ambre-clair); color: var(--ambre); }
.pastille-section.bleu { background: var(--bleu-clair); color: var(--bleu); }
.section-aide { padding: 0 16px 12px; font-size: 13px; color: var(--texte-3); }

.cartes { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }

.carte {
  display: block; width: 100%; text-align: left;
  background: var(--fond-2); border: 1px solid var(--bord);
  border-radius: var(--r-m); padding: 14px; box-shadow: var(--ombre);
}
.carte:active { transform: scale(.99); }
.carte-haut { display: flex; align-items: flex-start; gap: 10px; }
.carte-nom { flex: 1; font-size: 16px; font-weight: 600; line-height: 1.3; }
.carte-resume { color: var(--texte-2); font-size: 13.5px; margin-top: 5px; line-height: 1.45; }
.carte-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }

.etiquette {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 550; padding: 4px 8px; border-radius: 7px;
  background: var(--fond-3); color: var(--texte-2);
}
.etiquette svg { width: 13px; height: 13px; stroke-width: 2; }
.etiquette.vert { background: var(--vert-clair); color: var(--vert-fonce); }
.etiquette.ambre { background: var(--ambre-clair); color: var(--ambre); }
.etiquette.rouge { background: var(--rouge-clair); color: var(--rouge); }
.etiquette.bleu { background: var(--bleu-clair); color: var(--bleu); }

.anneau { position: relative; width: 42px; height: 42px; flex: none; }
.anneau svg { width: 42px; height: 42px; stroke-width: 3.4; }
.anneau .fond { stroke: var(--bord); }
.anneau .avance { stroke: var(--vert); transition: stroke-dashoffset .4s; }
.anneau b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums;
}

.manque { margin-top: 10px; font-size: 13px; color: var(--ambre); display: flex; gap: 6px; align-items: flex-start; }
.manque svg { width: 15px; height: 15px; margin-top: 2px; }
.remplace { margin-top: 8px; font-size: 13px; color: var(--bleu); display: flex; gap: 6px; align-items: flex-start; }
.remplace svg { width: 15px; height: 15px; margin-top: 2px; }

.vide { padding: 40px 24px; text-align: center; color: var(--texte-2); }
.vide svg { width: 44px; height: 44px; color: var(--texte-3); margin-bottom: 14px; stroke-width: 1.4; }
.vide strong { display: block; margin-bottom: 6px; color: var(--texte); font-size: 16px; }
.vide p { font-size: 14px; max-width: 32ch; margin: 0 auto; }

/* ------------------------------------------------------------- fiche recette */
.fiche-entete { padding: 18px 16px 12px; }
.fiche-type { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--vert); }
.fiche-entete h1 { margin: 6px 0 8px; }
.fiche-entete .aide { margin: 0; }

.fiche-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin: 14px 16px; border-radius: var(--r-m); overflow: hidden;
  background: var(--bord); border: 1px solid var(--bord);
}
.stat { background: var(--fond-2); padding: 11px 6px; text-align: center; }
.stat b { display: block; font-size: 15px; font-weight: 650; }
.stat small { display: block; font-size: 10.5px; color: var(--texte-3); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

.bascule-healthy {
  display: flex; align-items: center; gap: 12px; margin: 0 16px;
  padding: 13px 14px; border-radius: var(--r-m);
  border: 1px solid var(--bord); background: var(--fond-2);
}
.bascule-healthy.active { border-color: var(--vert); background: var(--vert-clair); }
.bascule-healthy .interrupteur-texte strong { font-size: 15px; }

.gain {
  margin: 10px 16px 0; padding: 12px 14px; border-radius: var(--r-m);
  background: var(--vert-clair); color: var(--vert-fonce); font-size: 13.5px; line-height: 1.5;
}

.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--bord); font-size: 15px;
}
.ingredients li:last-child { border-bottom: 0; }
.ing-marque { flex: none; width: 20px; height: 20px; display: grid; place-items: center; margin-top: 1px; }
.ing-marque svg { width: 16px; height: 16px; stroke-width: 2.2; }
.ing-marque.a { color: var(--vert); }
.ing-marque.manque { color: var(--ambre); }
.ing-marque.sub { color: var(--bleu); }
.ing-marque.placard { color: var(--texte-3); }
.ing-corps { flex: 1; min-width: 0; }
.ing-nom { line-height: 1.35; }
.ing-prep { color: var(--texte-3); font-size: 13px; }
.ing-note { color: var(--bleu); font-size: 12.5px; margin-top: 3px; line-height: 1.4; }
.ing-qte { flex: none; color: var(--texte-2); font-variant-numeric: tabular-nums; font-size: 14.5px; font-weight: 550; text-align: right; }
.ing-opt { color: var(--texte-3); font-size: 12px; }
.ing-barre { text-decoration: line-through; color: var(--texte-3); }

.nutrition { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nut {
  background: var(--fond-2); border: 1px solid var(--bord);
  border-radius: var(--r-s); padding: 10px; text-align: center;
}
.nut b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.nut small { display: block; font-size: 11px; color: var(--texte-3); margin-top: 1px; }
.nut .delta { font-size: 11px; font-weight: 650; color: var(--vert); }

.etapes { list-style: none; counter-reset: etape; margin: 0; padding: 0; }
.etapes > li {
  position: relative; padding: 0 0 20px 42px; counter-increment: etape;
}
.etapes > li::before {
  content: counter(etape);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--vert); color: #fff; font-size: 13px; font-weight: 650;
}
.etapes > li::after {
  content: ""; position: absolute; left: 13.5px; top: 32px; bottom: 6px;
  width: 1.5px; background: var(--bord);
}
.etapes > li:last-child::after { display: none; }
.etapes .et-titre { font-weight: 600; font-size: 15.5px; margin-bottom: 5px; }
.etapes .et-texte { color: var(--texte-2); font-size: 14.5px; line-height: 1.6; }
.etapes li.allegee::before { background: var(--bleu); }
.etapes li.allegee .et-titre::after {
  content: "allégé"; margin-left: 7px; font-size: 10px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--bleu-clair); color: var(--bleu); padding: 2px 6px; border-radius: 5px;
  vertical-align: 2px;
}
.astuce {
  display: flex; gap: 8px; margin-top: 9px; padding: 10px 12px;
  background: var(--ambre-clair); border-radius: var(--r-s);
  font-size: 13.5px; line-height: 1.5; color: var(--texte);
}
.astuce svg { width: 16px; height: 16px; color: var(--ambre); flex: none; margin-top: 2px; }

.btn-minuteur {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px;
  border: 1px solid var(--bord-fort); border-radius: 999px;
  background: var(--fond-2); color: var(--texte);
  padding: 8px 14px; font-size: 13.5px; font-weight: 550;
}
.btn-minuteur svg { width: 15px; height: 15px; }
.btn-minuteur:active { background: var(--fond-3); }

.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li {
  display: flex; gap: 9px; padding: 8px 0; font-size: 14.5px;
  color: var(--texte-2); line-height: 1.5;
}
.liste-simple li::before { content: "·"; color: var(--vert); font-weight: 700; }

.actions-fiche { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions-fiche .btn-principal, .actions-fiche .btn-secondaire { grid-column: span 2; }
.actions-fiche .demi { grid-column: span 1; }

.source {
  margin: 4px 16px 0; padding: 12px 14px; border-radius: var(--r-m);
  background: var(--fond-3); color: var(--texte-2); font-size: 12.5px; line-height: 1.55;
}
.source strong { color: var(--texte); }

/* ------------------------------------------------------------- semaine */
.jour { padding: 0 16px 14px; }
.jour-nom {
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--texte-3); margin-bottom: 7px;
}
.jour.aujourdhui .jour-nom { color: var(--vert); }
.repas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.case-repas {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  border: 1px dashed var(--bord-fort); border-radius: var(--r-s);
  background: var(--fond-2); color: var(--texte-3);
  padding: 11px; font-size: 13px; min-height: 68px;
}
.case-repas.pleine { border-style: solid; border-color: var(--bord); color: var(--texte); }
.case-repas em { font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-3); }
.case-repas strong { font-weight: 600; font-size: 13.5px; line-height: 1.3; }

/* ------------------------------------------------------------- courses */
.rayon { padding: 12px 16px 0; }
.rayon-titre {
  font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--texte-3); margin-bottom: 6px;
}
.article {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid var(--bord); background: none;
  padding: 12px 2px; font-size: 15px;
}
.article .case {
  flex: none; width: 23px; height: 23px; border-radius: 7px;
  border: 1.8px solid var(--bord-fort); display: grid; place-items: center;
}
.article .case svg { width: 14px; height: 14px; stroke-width: 2.6; opacity: 0; color: #fff; }
.article.coche .case { background: var(--vert); border-color: var(--vert); }
.article.coche .case svg { opacity: 1; }
.article.coche .art-nom { text-decoration: line-through; color: var(--texte-3); }
.art-corps { flex: 1; min-width: 0; }
.art-nom { line-height: 1.3; }
.art-pour { font-size: 12px; color: var(--texte-3); margin-top: 2px; }
.art-qte { flex: none; color: var(--texte-2); font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 550; }

.actions-courses { display: flex; flex-direction: column; gap: 10px; }

/* ------------------------------------------------------------- onglets */
.onglets { display: flex; gap: 4px; background: var(--fond-3); padding: 4px; border-radius: var(--r-m); }
.onglet {
  flex: 1; border: 0; border-radius: 12px; background: none; color: var(--texte-2);
  padding: 10px 6px; font-size: 14px; font-weight: 550;
}
.onglet.actif { background: var(--fond-2); color: var(--texte); box-shadow: var(--ombre); }

.reglage {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--bord);
}
.reglage:last-child { border-bottom: 0; }
.reglage-corps { flex: 1; }
.reglage-corps strong { display: block; font-size: 15px; font-weight: 550; }
.reglage-corps small { color: var(--texte-2); font-size: 13px; }

/* ------------------------------------------------------------- mode cuisine */
.cuisine {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column;
  background: var(--fond);
  padding: var(--haut) 0 var(--bas);
}
.cuisine-entete { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.cuisine-progres { flex: 1; height: 5px; border-radius: 3px; background: var(--bord); overflow: hidden; }
.cuisine-progres div { height: 100%; background: var(--vert); border-radius: 3px; transition: width .3s; }
.cuisine-compte { font-size: 13px; color: var(--texte-3); font-variant-numeric: tabular-nums; padding-right: 6px; }

.cuisine-corps { flex: 1; overflow-y: auto; padding: 14px 22px 20px; }
.cuisine-etiquette { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--vert); }
.cuisine-corps h2 { font-size: 26px; margin: 8px 0 14px; }
.cuisine-texte { font-size: 19px; line-height: 1.6; color: var(--texte); }
.cuisine-astuce {
  margin-top: 18px; padding: 14px 16px; border-radius: var(--r-m);
  background: var(--ambre-clair); font-size: 16px; line-height: 1.55;
}
.cuisine-ingredients { margin-top: 24px; border-top: 1px solid var(--bord); padding-top: 12px; }
.cuisine-ingredients summary { font-size: 14px; color: var(--texte-2); padding: 6px 0; }
.cuisine-pied { display: flex; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--bord); }
.cuisine-pied button { flex: 1; }

.minuteur-grand {
  margin-top: 20px; padding: 18px; border-radius: var(--r-m);
  background: var(--fond-2); border: 1px solid var(--bord); text-align: center;
}
.minuteur-grand .temps { font-size: 44px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.minuteur-grand .sous { font-size: 13px; color: var(--texte-3); margin-top: 2px; }
.minuteur-grand .boutons { display: flex; gap: 10px; margin-top: 14px; }
.minuteur-grand .boutons button { flex: 1; }
.minuteur-grand.fini { border-color: var(--vert); background: var(--vert-clair); }
.minuteur-grand.fini .temps { color: var(--vert-fonce); animation: clignote 1s ease-in-out infinite; }
@keyframes clignote { 50% { opacity: .35; } }

/* ------------------------------------------------------------- minuteurs flottants */
.minuteurs {
  position: fixed; z-index: 70; left: 12px; right: 12px;
  bottom: calc(var(--h-nav) + var(--bas) + 10px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.minuteur-flottant {
  display: flex; align-items: center; gap: 11px; pointer-events: auto;
  background: var(--fond-2); border: 1px solid var(--bord);
  border-radius: var(--r-m); padding: 11px 13px; box-shadow: var(--ombre);
}
.minuteur-flottant .temps { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 62px; }
.minuteur-flottant .quoi { flex: 1; min-width: 0; font-size: 13px; color: var(--texte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.minuteur-flottant.fini { border-color: var(--vert); background: var(--vert-clair); }
.minuteur-flottant.fini .temps { animation: clignote 1s ease-in-out infinite; }

/* ------------------------------------------------------------- feuille modale */
.voile { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .45); animation: fondu .2s ease both; }
@keyframes fondu { from { opacity: 0; } }

.feuille {
  position: fixed; z-index: 91; left: 0; right: 0; bottom: 0;
  max-height: 86dvh; overflow-y: auto;
  background: var(--fond); border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 8px 20px calc(24px + var(--bas));
  box-shadow: var(--ombre-haute);
  animation: monte .26s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes monte { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .feuille, .voile { animation: none; } }
.feuille-poignee { width: 38px; height: 4px; border-radius: 2px; background: var(--bord-fort); margin: 6px auto 16px; }
.feuille h2 { margin-bottom: 14px; }

.choix { list-style: none; margin: 0; padding: 0; }
.choix li {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 2px; border-bottom: 1px solid var(--bord); font-size: 15.5px;
}
.choix li:last-child { border-bottom: 0; }
.choix li .coche { flex: none; width: 20px; color: var(--vert); }
.choix li .coche svg { width: 18px; height: 18px; stroke-width: 2.4; opacity: 0; }
.choix li.actif .coche svg { opacity: 1; }
.choix li small { display: block; color: var(--texte-2); font-size: 13px; margin-top: 2px; }
.choix li .texte { flex: 1; }

/* ------------------------------------------------------------- navigation */
.nav {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--h-nav) + var(--bas));
  padding-bottom: var(--bas);
  background: color-mix(in srgb, var(--fond) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--bord);
}
.nav-btn {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; border: 0; background: none;
  color: var(--texte-3); font-size: 10.5px; font-weight: 550; padding: 0;
}
.nav-btn svg { width: 23px; height: 23px; stroke-width: 1.7; }
.nav-btn.actif { color: var(--vert); }
.nav-btn.actif svg { stroke-width: 2; }
.badge {
  position: absolute; top: 6px; right: 50%; transform: translateX(16px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--vert); color: #fff;
  font-size: 10px; font-weight: 700; font-style: normal;
  display: grid; place-items: center;
}

/* ------------------------------------------------------------- annonce */
.annonce {
  position: fixed; z-index: 95; left: 16px; right: 16px;
  bottom: calc(var(--h-nav) + var(--bas) + 14px);
  background: var(--texte); color: var(--fond);
  border-radius: var(--r-m); padding: 13px 16px;
  font-size: 14px; text-align: center;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.annonce.visible { opacity: 1; transform: translateY(0); }
.annonce.cliquable { pointer-events: auto; cursor: pointer; }

/* ------------------------------------------------------------- écrans larges */
@media (min-width: 720px) {
  body { padding-bottom: 0; padding-top: 0; }
  .nav {
    top: 0; bottom: auto; height: auto; padding: 0;
    grid-template-columns: none; display: flex; justify-content: center; gap: 4px;
    border-top: 0; border-bottom: 1px solid var(--bord);
  }
  .nav-btn { flex-direction: row; gap: 8px; padding: 14px 18px; font-size: 14px; }
  .badge { position: static; transform: none; }
  .entete { top: 57px; }
  body { padding-top: 57px; }
  main { max-width: 760px; margin: 0 auto; }
  .filtres-barre { top: calc(var(--h-entete) + 57px); }
  .minuteurs { left: auto; right: 20px; width: 320px; bottom: 20px; }
  .annonce { left: 50%; transform: translate(-50%, 10px); right: auto; width: min(420px, 90vw); bottom: 20px; }
  .annonce.visible { transform: translate(-50%, 0); }
  .feuille { max-width: 560px; margin: 0 auto; border-radius: var(--r-l); bottom: 20px; left: 20px; right: 20px; }
  .cartes, .bloc, .section-entete, .section-aide, .resume { max-width: 760px; margin-left: auto; margin-right: auto; }
  .repas { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------------------------------------- compléments */

/* L'interrupteur de la version healthy : son etat vient de la classe .active
   posee sur l'etiquette, la case a cocher etant masquee. */
.bascule-healthy.active .piste { background: var(--vert); }
.bascule-healthy.active .piste::after { transform: translateX(18px); }
.bascule-healthy { cursor: pointer; }

/* Rappel : les quantites ecrites dans le texte ne sont pas recalculees. */
.note-echelle {
  display: flex; gap: 9px; align-items: flex-start;
  margin: 0 0 14px; padding: 11px 13px; border-radius: var(--r-s);
  background: var(--bleu-clair); color: var(--texte);
  font-size: 13.5px; line-height: 1.5;
}
.note-echelle svg { width: 16px; height: 16px; color: var(--bleu); flex: none; margin-top: 2px; }

.cuisine-echelle {
  margin-top: 14px; padding: 11px 13px; border-radius: var(--r-s);
  background: var(--bleu-clair); font-size: 14px; line-height: 1.5;
}

/* Les minuteurs lances a une etape precedente doivent rester visibles
   par-dessus le mode cuisine, juste au-dessus de ses deux boutons. */
.minuteurs { z-index: 85; }
body.en-cuisine .minuteurs { bottom: calc(92px + var(--bas)); }
body.en-cuisine .annonce { bottom: calc(96px + var(--bas)); }
body.en-cuisine .cuisine-corps { padding-bottom: 90px; }
