/* Menus de la semaine — même langage visuel que le site Finance :
   boutons-pilules, barre d'onglets flottante avec indicateur qui glisse, sections qui glissent de côté. */
:root {
  --bg: #F3F5F2; --surface: #FFFFFF; --surface-2: #E8ECE7; --line: #D5DCD4;
  --fg: #16211C; --muted: #5B6A62;
  --accent: #1D6B57; --accent-soft: #D6EBE3; --gold: #B7832A;
  --resto: #964F14; --resto-soft: #F5E6D6;
  --down: #B4423A;
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-titre: "Fraunces", Georgia, serif;
  --radius: 14px;
  --ressort: cubic-bezier(.34,1.56,.64,1);
  --glisse: cubic-bezier(.3,.8,.25,1);
  /* anciens noms gardés pour les styles écrits dans app.js */
  --fond: var(--bg); --carte: var(--surface); --texte: var(--fg); --doux: var(--muted);
  --ligne: var(--line); --vert: var(--accent); --vert-pale: var(--accent-soft); --danger: var(--down);
  color-scheme: light;
}
/* Thème : automatique (selon l'appareil), clair ou sombre — choisi en bas de la page */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1426; --surface: #101E36; --surface-2: #172843; --line: #243A5E;
    --fg: #E8EEF8; --muted: #93A6C6; --accent: #4E9F86; --accent-soft: #15393A; --gold: #F2C35B;
    --resto: #F2B266; --resto-soft: #3A2C1E; --down: #F87171;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0A1426; --surface: #101E36; --surface-2: #172843; --line: #243A5E;
    --fg: #E8EEF8; --muted: #93A6C6; --accent: #4E9F86; --accent-soft: #15393A; --gold: #F2C35B;
    --resto: #F2B266; --resto-soft: #3A2C1E; --down: #F87171;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body {
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  background: var(--bg); color: var(--fg);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; font-family: var(--font-display); font-weight: 700; text-wrap: balance; }

/* ---------- en-tête ---------- */
.top {
  max-width: 820px; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px 6px;
  display: flex; align-items: center; gap: 10px;
}
.top h1 { font-family: var(--font-titre); font-size: clamp(1.45rem, 4vw, 2.1rem); letter-spacing: -.01em; line-height: 1.05; }
.logo { width: 1.9rem; height: 1.9rem; flex: none; color: var(--accent); }
.logo .vapeur { animation: vapeur 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
.logo .vapeur:nth-of-type(2) { animation-delay: .6s; }
.logo .vapeur:nth-of-type(3) { animation-delay: 1.2s; }
@keyframes vapeur { 0%,100% { opacity: .25; transform: translateY(1px) scaleY(.8); } 50% { opacity: 1; transform: translateY(-1.5px) scaleY(1.05); } }

main { max-width: 820px; margin: 0 auto; padding: 8px 16px 32px; overflow-x: clip; }

/* ---------- barre d'onglets (pilule flottante) ---------- */
.tabs {
  display: flex; gap: 2px; padding: 5px; position: relative;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  z-index: 15;
}
.tabs a {
  position: relative; z-index: 1; text-decoration: none; color: var(--muted);
  font-weight: 600; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .2s;
}
.tabs a.actif { color: var(--fg); }
.tab-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ressort), color .2s; }
.tabs a.actif .tab-ic { color: var(--accent); transform: scale(1.08); }
.tab-ind {
  position: absolute; left: 0; top: 5px; bottom: 5px; width: 0; border-radius: 999px; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 17%, transparent); opacity: 0;
  transition: transform .38s var(--glisse), width .38s var(--glisse), opacity .2s;
}

/* Ordinateur : pilule collée en haut */
@media (min-width: 601px) {
  .tabs { position: sticky; top: 10px; width: max-content; max-width: calc(100% - 32px); margin: 6px auto 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); }
  .tabs a { padding: 9px 20px; font-size: .95rem; }
  .tabs a:hover:not(.actif) { background: color-mix(in srgb, var(--fg) 6%, transparent); }
}
/* Téléphone : barre flottante en bas */
@media (max-width: 600px) {
  .tabs {
    position: fixed; left: 14px; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px;
    justify-content: space-between; gap: 0; box-shadow: 0 10px 30px rgba(0,0,0,.28);
  }
  .tabs a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 8px 2px 7px; font-size: .74rem; }
  .tab-ic { width: 23px; height: 23px; }
  .tabs a.actif .tab-ic { transform: translateY(-1px) scale(1.08); }
  .tab-ind { top: 6px; bottom: 6px; }
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .top { padding-top: calc(14px + env(safe-area-inset-top)); }
}

/* ---------- transitions de section ---------- */
.vue-in-g { animation: vue-in-g .34s cubic-bezier(.2,.75,.25,1); }
.vue-in-d { animation: vue-in-d .34s cubic-bezier(.2,.75,.25,1); }
.vue-in   { animation: vue-in .3s ease-out; }
@keyframes vue-in-g { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes vue-in-d { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes vue-in   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Ouvrir une page plus « profonde » (une recette) : elle arrive de la droite en grandissant un peu */
.vue-in-avant   { animation: vue-in-avant .38s cubic-bezier(.2,.75,.25,1); }
.vue-in-arriere { animation: vue-in-arriere .34s cubic-bezier(.2,.75,.25,1); }
@keyframes vue-in-avant   { from { opacity: 0; transform: translateX(40px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes vue-in-arriere { from { opacity: 0; transform: translateX(-40px) scale(.98); } to { opacity: 1; transform: none; } }
/* L'ancienne page s'en va dans l'autre sens (très court) */
.vue-out-d, .vue-out-avant   { animation: vue-out-g .13s ease-in forwards; }
.vue-out-g, .vue-out-arriere { animation: vue-out-d .13s ease-in forwards; }
.vue-out { animation: vue-out .12s ease-in forwards; }
@keyframes vue-out-g { to { opacity: 0; transform: translateX(-18px); } }
@keyframes vue-out-d { to { opacity: 0; transform: translateX(18px); } }
@keyframes vue-out   { to { opacity: 0; transform: translateY(4px); } }
/* Glisser le doigt de côté change d'onglet : le navigateur ne doit pas défiler de côté */
main { touch-action: pan-y pinch-zoom; }
html, body { overflow-x: clip; }
.jours > *, .grille > *, .semaine-hist { animation: monte .42s var(--glisse) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes monte { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- en-tête de section ---------- */
.entete { display: flex; align-items: center; gap: 10px; margin: 8px 0 16px; }
.entete h2 { flex: 1; text-align: center; font-size: 1.3rem; letter-spacing: -.01em; }
.entete small { display: block; color: var(--muted); font-family: var(--font-body); font-weight: 500; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; margin-top: 4px; }

/* ---------- boutons ---------- */
button, .btn {
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  border-radius: 999px; padding: 8px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: border-color .15s, background-color .15s, color .15s, transform .12s, box-shadow .15s;
}
button:hover, .btn:hover { border-color: var(--accent); }
button:active, .btn:active { transform: scale(.96); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primaire, .btn.primaire { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
button.primaire:hover, .btn.primaire:hover { box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
button.rond { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 1.15rem; flex: none; }
button.danger, .btn.danger { color: var(--down); }
button.danger:hover { border-color: var(--down); }
button:disabled { opacity: .5; cursor: default; transform: none; }

/* boutons segmentés (comme .seg du site Finance) */
.onglets { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: 14px; position: relative; }
.onglets button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 7px 12px; font-size: .9rem; position: relative; z-index: 1; }
.onglets button:hover { border: 0; color: var(--fg); }
.onglets button.actif { color: var(--fg); font-weight: 600; }
.onglets .seg-ind { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.14); transition: transform .34s var(--glisse), width .34s var(--glisse); }
.onglets:not(.ind-on) button.actif { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* ---------- jours ---------- */
.jours { display: grid; gap: 10px; }
.jour {
  display: flex; gap: 14px; align-items: center; width: 100%; min-height: 76px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
  transition: border-color .15s, transform .15s, box-shadow .2s;
}
.jour:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.jour:active { transform: scale(.985); }
/* (v3.5.2) plus de mise en évidence du jour d'aujourd'hui, à la demande de Pascal */
.jour .date { width: 50px; text-align: center; flex-shrink: 0; display: grid; justify-items: center; line-height: 1.05; border-radius: 10px; background: var(--surface-2); padding: 6px 0; }
.jour .date b { display: block; font-size: .68rem; text-transform: uppercase; color: var(--muted); letter-spacing: .07em; font-weight: 600; }
.jour .date span { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.jour .vignette { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--accent-soft); flex-shrink: 0; }
.jour .quoi { flex: 1; min-width: 0; }
.jour .quoi .titre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.jour .quoi .sous { color: var(--muted); font-size: .85rem; }
.jour.vide { background: transparent; border-style: dashed; }
.jour.vide .quoi .titre { color: var(--muted); font-weight: 400; }
/* (v4.5.0) déjeuner, dîner et lunch : bouton + à côté de chaque jour, repas ajoutés sous le souper */
.jour-bloc { position: relative; }
.jour-bloc .jour { padding-right: 56px; }
.jour-bloc.complet .jour { padding-right: 12px; }
.plus-repas {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.4rem; line-height: 1; padding: 0;
  background: var(--accent-soft); color: var(--accent); border: 1px solid transparent; font-weight: 600;
  transition: transform .15s, background .15s;
}
.plus-repas:hover { background: var(--accent); color: #fff; }
.plus-repas:active { transform: scale(.92); }
.extras { display: grid; gap: 6px; margin: 6px 0 2px 24px; }
.extra-ligne { position: relative; }
.extra-ligne .extra { padding-right: 46px; }
.extra-ligne:has(.extra-edit) .extra { padding-right: 82px; }
.extra-edit {
  position: absolute; top: 50%; right: 40px; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; font-size: .85rem; line-height: 1;
  background: transparent; border: 0; opacity: .7; transition: background .15s, opacity .15s;
}
.extra-edit:hover, .extra-edit:focus-visible { background: var(--surface-2); opacity: 1; }
.extra-x {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; font-size: .95rem; line-height: 1;
  background: transparent; color: var(--muted); border: 0; transition: background .15s, color .15s;
}
.extra-x:hover, .extra-x:focus-visible { background: var(--surface-2); color: var(--fg); }
.extra {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; min-height: 44px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px;
  transition: border-color .15s, transform .15s;
}
.extra:hover { border-color: var(--accent); }
.extra:active { transform: scale(.985); }
.extra-moment { flex-shrink: 0; min-width: 104px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.extra-titre { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.modal-tete h2 small { font-size: .6em; font-weight: 500; color: var(--muted); }
.pastille { display: inline-flex; align-items: center; font-size: .72rem; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pastille.resto { background: var(--resto-soft); color: var(--resto); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- recettes ---------- */
.recherche, input[type=search] { width: 100%; font: inherit; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); transition: border-color .15s, box-shadow .15s; }
.recherche:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.carte-recette {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: border-color .15s, transform .2s var(--glisse), box-shadow .2s;
}
.carte-recette:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.10); }
.carte-recette:active { transform: scale(.98); }
.carte-recette img, .carte-recette .sans-image { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.carte-recette div.txt { padding: 9px 11px 11px; }
.carte-recette .titre { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.carte-recette .sous { color: var(--muted); font-size: .78rem; margin-top: 3px; }

.recette-tete img { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); }
.recette-tete h2 { margin: 14px 0 6px; font-size: 1.6rem; letter-spacing: -.02em; }
.meta { color: var(--muted); font-size: .9rem; display: flex; gap: 14px; flex-wrap: wrap; }
.bloc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-top: 14px; }
.bloc h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-family: var(--font-body); font-weight: 600; margin-bottom: 10px; }
.bloc ul, .bloc ol { margin: 0; padding-left: 20px; }
.bloc li { margin: 6px 0; line-height: 1.5; }
.bloc ol li::marker { font-family: var(--font-display); font-weight: 700; color: var(--accent); }

/* ---------- formulaires ---------- */
label { display: block; font-size: .82rem; color: var(--muted); font-weight: 500; margin: 12px 0 4px; }
input[type=text], input[type=url], input[type=number], input[type=email], input[type=password], textarea {
  width: 100%; font: inherit; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=url]:focus, input[type=number]:focus, input[type=email]:focus, input[type=password]:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
textarea { min-height: 140px; resize: vertical; }
.rangee { display: flex; gap: 8px; align-items: stretch; }
.rangee > input { flex: 1; min-width: 0; }

/* ---------- épicerie ---------- */
.groupe h3 { font-size: .72rem; color: var(--muted); font-family: var(--font-body); font-weight: 600; text-transform: uppercase; letter-spacing: .09em; margin: 18px 0 6px; }
.article {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin: 0 0 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  color: var(--fg); font-size: 1rem;
  transition: background-color .2s, border-color .15s, opacity .2s;
}
.article:hover { border-color: var(--accent); }
.article input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; margin: 0; }
.article .lib { flex: 1; transition: color .2s; }
.article.fait { background: var(--surface-2); border-color: transparent; }
.article.fait .lib { text-decoration: line-through; color: var(--muted); }
.article .x { border: 0; background: none; color: var(--muted); padding: 4px 8px; border-radius: 999px; }
.article .x:hover { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); }
.aide { color: var(--muted); font-size: .88rem; margin: 4px 0 10px; }

/* ---------- historique ---------- */
.semaine-hist {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px; text-decoration: none; color: inherit;
  transition: border-color .15s, transform .2s var(--glisse), box-shadow .2s;
}
.semaine-hist:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.semaine-hist b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-family: var(--font-display); font-size: 1.05rem; }
.semaine-hist ul { margin: 0; padding: 0; list-style: none; font-size: .88rem; color: var(--muted); display: grid; gap: 2px; }
.semaine-hist li span { display: inline-block; width: 38px; font-weight: 600; color: var(--fg); text-transform: capitalize; }

/* ---------- fenêtre (feuille du bas sur téléphone) ---------- */
dialog {
  border: 0; border-radius: 22px 22px 0 0; padding: 0; width: 100%; max-width: 640px; max-height: 88vh; max-height: 88dvh;
  margin: auto auto 0; background: var(--bg); color: var(--fg); box-shadow: 0 -12px 40px rgba(0,0,0,.25);
}
dialog[open] { animation: feuille-monte .36s var(--glisse); }
dialog::backdrop { background: rgba(10,16,13,.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog[open]::backdrop { animation: fondu .25s ease; }
dialog.ferme { animation: feuille-descend .22s ease-in forwards; }
dialog.ferme::backdrop { animation: fondu .22s ease reverse forwards; }
@keyframes feuille-monte { from { transform: translateY(100%); } to { transform: none; } }
@keyframes feuille-descend { to { transform: translateY(100%); } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 700px) {
  dialog { border-radius: 20px; margin: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
  dialog[open] { animation: fenetre-entre .3s var(--ressort); }
  dialog.ferme { animation: fenetre-sort .18s ease-in forwards; }
  @keyframes fenetre-entre { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes fenetre-sort { to { opacity: 0; transform: translateY(10px) scale(.97); } }
}
@media (max-width: 699px) {
  #modal-contenu::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: -6px auto 12px; }
}
#modal-contenu { padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 88vh; max-height: 88dvh; overscroll-behavior: contain; }
.modal-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.modal-tete h2 { font-size: 1.3rem; }
.liste-choix { max-height: 38vh; overflow-y: auto; margin-top: 10px; display: grid; gap: 6px; }
.choix { display: flex; justify-content: flex-start; align-items: center; gap: 10px; width: 100%; text-align: left; border-radius: 12px; padding: 8px 12px 8px 8px; }
.choix img, .choix .sans-image { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--accent-soft); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.choix .sous { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }
.separateur { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; margin: 18px 0 8px; }
.separateur::before, .separateur::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.boutons-rapides { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 16px; }
.boutons-rapides.empile { grid-template-columns: 1fr; }
.boutons-rapides.empile button { white-space: nowrap; min-height: 46px; }

/* ---------- divers ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px) scale(.96); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500;
  max-width: 90vw; z-index: 30; font-size: .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  transition: opacity .2s, transform .3s var(--ressort);
}
#toast.visible { opacity: 1; transform: translateX(-50%); }
@media (max-width: 600px) { #toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }
.chargement { text-align: center; color: var(--muted); padding: 40px 0; animation: fondu .3s ease .15s both; }
.vide-msg { text-align: center; color: var(--muted); padding: 30px 10px; }
.sans-image { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }

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

/* ---------- étoiles ---------- */
.etoiles { color: var(--gold); letter-spacing: 1px; font-size: .85em; white-space: nowrap; }
.etoiles i { font-style: normal; color: var(--line); }
.noter { display: flex; align-items: center; gap: 2px; margin: 2px 0 8px; }
.noter .etoile {
  border: 0; background: transparent; padding: 2px 3px; border-radius: 8px;
  font-size: 1.75rem; line-height: 1; color: var(--line);
  transition: color .2s, transform .15s var(--ressort);
}
.noter .etoile:hover { border: 0; transform: scale(1.15); }
.noter .etoile.pleine { color: var(--gold); }
/* survol : on voit d'avance combien d'étoiles on va donner */
@media (hover: hover) {
  .noter:hover .etoile { color: var(--gold); }
  .noter .etoile:hover ~ .etoile { color: var(--line); }
}
.noter .etoile.pop { animation: etoile-pop .45s var(--ressort) var(--d, 0ms) both; }
@keyframes etoile-pop { 0% { transform: scale(.4) rotate(-25deg); } 60% { transform: scale(1.3) rotate(8deg); } 100% { transform: none; } }
.noter-txt { color: var(--muted); font-size: .85rem; margin-left: 8px; }
.filtre-notes { margin-bottom: 0; }
.filtre-notes button { padding: 6px 8px; font-size: .85rem; }
.liste-choix { margin-top: 10px; }
#modal-contenu .filtre-notes { margin-top: 8px; }

/* ---------- barre « Souper du … » quand on ouvre une recette depuis la semaine ---------- */
.barre-jour {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft); border-radius: var(--radius); padding: 8px 10px; margin: 4px 0 14px;
}
.barre-jour .btn, .barre-jour button { padding: 6px 12px; font-size: .88rem; }
.barre-jour-txt { flex: 1; min-width: 0; font-size: .92rem; }
.barre-jour-txt b { font-weight: 600; }

/* ---------- pied de page : version + thème ---------- */
.pied {
  max-width: 820px; margin: 8px auto 0; padding: 18px 16px 28px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem;
}
.pied .version b { font-weight: 600; color: var(--fg); }
.pied-theme { display: inline-flex; align-items: center; gap: 8px; }
.pied .onglets { margin: 0; display: inline-flex; }
.pied .onglets button { flex: none; padding: 5px 12px; font-size: .82rem; display: inline-flex; gap: 5px; }
.pied .onglets svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) { .pied { justify-content: center; text-align: center; } }
/* Changement de thème en douceur */
html.theme-transition, html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after {
  transition: background-color .35s ease, border-color .35s ease, color .35s ease, fill .35s ease !important;
}

/* ---------- historique : filtres année puis mois ---------- */
.puces { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; }
.puces::-webkit-scrollbar { display: none; }
.puce { flex: none; padding: 6px 14px; font-size: .88rem; color: var(--muted); }
.puce small { font-size: .72rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 0 6px; margin-left: 2px; }
.puce.actif { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.puce.actif small { background: color-mix(in srgb, var(--bg) 25%, transparent); color: var(--bg); }
.puces-mois { flex-wrap: wrap; overflow: visible; }
.puces-mois .puce { padding: 5px 12px; font-size: .84rem; }
.puces-mois.apparait { animation: vue-in-d .3s cubic-bezier(.2,.75,.25,1); }
.titre-mois { font-size: .72rem; color: var(--muted); font-family: var(--font-body); font-weight: 600; text-transform: uppercase; letter-spacing: .09em; margin: 16px 0 8px; }
.titre-mois:first-child { margin-top: 4px; }

/* ---------- fenêtre « Importer une recette » ---------- */
.entete > .primaire { flex: none; }
.option-import { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: inherit; text-decoration: none; }
.option-import + .option-import { margin-top: 8px; }
.option-tete { display: flex; align-items: center; gap: 12px; }
.option-tete b { display: block; font-weight: 600; }
.option-tete small { display: block; color: var(--muted); font-size: .8rem; }
.option-tete > div { flex: 1; min-width: 0; }
.option-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.15rem; flex: none; }
.option-import .rangee { margin-top: 12px; }
.option-import .aide { margin: 10px 0 0; }
.option-lien { transition: border-color .15s, transform .15s, background-color .15s; }
.option-lien:hover { border-color: var(--accent); }
.option-lien:active { transform: scale(.985); }
.option-fleche { color: var(--muted); font-size: 1.4rem; transition: transform .2s var(--glisse); }
.option-lien:hover .option-fleche { transform: translateX(3px); color: var(--accent); }

/* ---------- recettes : tri et filtres ---------- */
.bloc-filtres { display: grid; gap: 8px; margin-top: 10px; }
.bloc-filtres .puces { padding-bottom: 2px; }
.bloc-filtres .filtre-notes { margin: 0; }
.puce.bascule.actif { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.puce.effacer { border-style: dashed; color: var(--down); }
.puce.effacer:hover { border-color: var(--down); }
#compte { margin: 10px 0 0; min-height: 0; }
#compte:empty { display: none; }
.carte-recette { position: relative; }
.carte-recette .rang { position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 1.4rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); animation: etoile-pop .5s var(--ressort) both; }
/* les rangées qui défilent de côté s'estompent à droite pour montrer qu'il y a d'autres choix */
.bloc-filtres .puces { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 40px; }

/* astuce repliable dans la fenêtre d'import */
.astuce { margin-top: 10px; font-size: .86rem; color: var(--muted); }
.astuce summary { cursor: pointer; color: var(--accent); font-weight: 500; list-style: none; }
.astuce summary::-webkit-details-marker { display: none; }
.astuce summary::after { content: " ›"; display: inline-block; transition: transform .2s; }
.astuce[open] summary::after { transform: rotate(90deg); }
.astuce ol { margin: 8px 0 4px; padding-left: 20px; }
.astuce li { margin: 4px 0; }
.astuce p { margin: 4px 0 0; }
.astuce[open] > :not(summary) { animation: vue-in .25s ease-out; }

/* liste des recettes trouvées sur une page « dossier » */
.liste-trouvees { display: grid; gap: 6px; margin-top: 12px; max-height: 46vh; overflow-y: auto; animation: vue-in .3s ease-out; }
#vue .liste-trouvees { max-height: none; }
.liste-trouvees .aide { margin: 0 0 4px; }
.liste-trouvees .choix > *:first-child { width: 52px; height: 52px; }
.liste-trouvees .choix { animation: monte .35s var(--glisse) both; }

/* fiche recette : ingrédients à exclure de la liste d'épicerie */
.bloc-ingredients .aide { margin: -4px 0 8px; font-size: .82rem; }
.liste-ing { list-style: none; padding: 0 !important; margin: 0; }
.liste-ing li { margin: 0 !important; }
.ing { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; color: var(--fg); font-size: 1rem; cursor: pointer; transition: background-color .15s; }
.ing:hover { background: var(--surface-2); }
.ing input { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--muted); }
.ing span { flex: 1; transition: color .2s, opacity .2s; }
.ing .pas-liste { display: none; flex: none; align-self: center; font-size: .68rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.ing.exclu span { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.ing.exclu .pas-liste { display: inline-block; animation: etoile-pop .35s var(--ressort); }
.resume-exclus { margin: 8px 0 0 !important; }
.resume-exclus:empty { display: none; }

/* fiche recette : boîte « Nos notes » sous les étoiles */
.boite-notes { position: relative; margin: 2px 0 12px; }
.boite-notes textarea {
  min-height: 0; resize: none; overflow: hidden; line-height: 1.45;
  background: var(--surface); border-radius: 12px; padding: 10px 12px 22px;
}
.boite-notes textarea::placeholder { color: var(--muted); opacity: .8; }
.etat-notes { position: absolute; right: 12px; bottom: 6px; font-size: .72rem; color: var(--muted); pointer-events: none; transition: opacity .4s; }
.etat-notes.ok { color: var(--accent); }
.etat-notes.erreur { color: var(--down); }
.etat-notes.parti { opacity: 0; }

/* recette en anglais : invitation à traduire */
.bandeau-anglais { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 12px 12px 14px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  box-shadow: inset 4px 0 0 var(--accent); animation: vue-in .3s ease-out; }
.bandeau-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; flex: none; }
.bandeau-ic svg { width: 22px; height: 22px; }
.bandeau-txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.bandeau-txt b { font-weight: 600; font-size: .95rem; }
.bandeau-txt small { color: var(--muted); font-size: .8rem; }
.bandeau-anglais button { flex: none; padding: 8px 16px; }
.ic-traduire { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }

/* petit sélecteur FR / VO à côté de « Modifier » */
.onglets.seg-langue { display: inline-flex; margin: 0; flex: none; align-self: center; }
.seg-langue button { flex: none; padding: 6px 12px; font-size: .82rem; font-weight: 600; letter-spacing: .04em; min-width: 42px; }

/* import en cours : cercle qui tourne */
.tourne { display: inline-block; width: 1em; height: 1em; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; animation: tourne .7s linear infinite; }
.tourne.grand { width: 38px; height: 38px; border-width: 3px; color: var(--accent); }
@keyframes tourne { to { transform: rotate(360deg); } }
button.occupe, button.occupe:disabled { opacity: 1; cursor: progress; }
button.primaire.occupe { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); animation: pulse-import 1.4s ease-in-out infinite; }
@keyframes pulse-import { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 10%, transparent); } }
.etat-import { margin: 10px 0 0; font-size: .85rem; color: var(--accent); font-weight: 500; }
.etat-import.change { animation: vue-in .3s ease-out; }
.import-page { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 56px 16px; color: var(--muted); }
.import-page p { margin: 0; } .import-page b { color: var(--fg); }
.import-page .tourne { margin-bottom: 10px; }
.import-page small { max-width: 100%; overflow-wrap: anywhere; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .tourne { animation: tourne 1.5s linear infinite !important; } }

/* « choisir le souper » : tri de la liste */
.tri-choix { margin: 8px 0 6px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 40px; }
.tri-choix .puce { padding: 5px 12px; font-size: .82rem; }

/* fiche recette : d'où vient la recette, en petit sous le titre */
.recette-tete h2 + .provenance { margin: -2px 0 4px; font-size: .78rem; color: var(--muted); letter-spacing: .01em; }
.provenance a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted color-mix(in srgb, var(--muted) 60%, transparent); transition: color .15s, border-color .15s; }
.provenance a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* sections d'ingrédients (« ## Sauce ») */
.liste-ing .ing-section { margin: 14px 0 2px !important; padding-top: 10px; border-top: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--accent); }
.liste-ing .ing-section:first-child { margin-top: 0 !important; padding-top: 0; border-top: 0; }

/* épicerie : bouton « Regrouper » et liste regroupée par rayon */
.barre-regrouper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 4px;
  border-radius: var(--radius); background: var(--accent-soft); }
.barre-regrouper .aide { flex: 1 1 200px; margin: 0; font-size: .84rem; color: var(--fg); }
.barre-regrouper button { padding: 6px 14px; font-size: .88rem; }
#etat-regrouper { margin: 6px 2px 0; }
.groupe.rayon h3 { display: flex; align-items: center; gap: 8px; }
.groupe.rayon h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.article-groupe { margin-bottom: 6px; border-radius: 12px; animation: monte .35s var(--glisse) both; }
.article-groupe .article { margin: 0; }
.article-groupe.ouvert .article { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.article-groupe .lib b { font-weight: 600; }
.article-groupe .qte { color: var(--accent); font-weight: 500; font-size: .92rem; white-space: nowrap; }
.article-groupe .lib small { color: var(--muted); font-size: .78rem; }
.article-groupe.fait .lib b, .article-groupe.fait .qte { text-decoration: line-through; color: var(--muted); }
.article-groupe.fait .article { background: var(--surface-2); border-color: transparent; }
.deplier { border: 0; background: transparent; color: var(--muted); padding: 2px 8px; font-size: 1.1rem; border-radius: 999px; transition: transform .25s var(--glisse); }
.deplier:hover { background: var(--surface-2); border: 0; }
.deplier[aria-expanded="true"] { transform: rotate(180deg); }
.detail-groupe { list-style: none; margin: 0; padding: 8px 14px 10px 46px; background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 12px 12px; font-size: .85rem; color: var(--fg); animation: vue-in .25s ease-out; }
.detail-groupe li { padding: 3px 0; display: flex; align-items: center; gap: 6px; }
.detail-groupe li small { color: var(--muted); }
.detail-groupe .x { margin-left: auto; }

/* pied de page : bouton calculatrice */
.btn-calc { width: 38px; height: 38px; padding: 0; border-radius: 50%; color: var(--muted); }
.btn-calc svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-calc:hover { color: var(--accent); }

/* calculatrice de cuisine */
.calc { display: grid; gap: 12px; }
.calc-ligne { display: grid; grid-template-columns: minmax(64px, 1fr) minmax(0, 1.3fr) auto minmax(0, 1.3fr); gap: 8px; align-items: center; }
.calc-ligne input { font-size: 1.15rem; font-weight: 600; text-align: center; padding: 10px 8px; }
.calc select, .calc-ingr select { font: inherit; width: 100%; padding: 10px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.calc .rond { width: 38px; height: 38px; font-size: 1rem; }
.calc .rond.tourne-1 { animation: inverser .35s var(--ressort); }
@keyframes inverser { from { transform: rotate(-180deg); } }
.calc-fractions { display: flex; gap: 6px; flex-wrap: wrap; }
.calc-fractions .puce { padding: 4px 11px; font-size: .85rem; }
.calc-ingr { margin: 0; display: grid; gap: 4px; }
.calc-resultat { background: var(--accent-soft); border-radius: var(--radius); padding: 16px; text-align: center; display: grid; gap: 2px; }
.calc-resultat small { color: var(--muted); font-size: .85rem; }
.calc-resultat b { font-family: var(--font-display); font-size: 2rem; color: var(--accent); line-height: 1.1; }
.calc-resultat.change b { animation: etoile-pop .35s var(--ressort); }
.calc-vide { color: var(--muted); font-size: .9rem; }
.calc-equiv { display: flex; flex-wrap: wrap; gap: 6px; }
.calc-equiv span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .82rem; color: var(--muted); }
.calc-equiv b { color: var(--fg); font-weight: 600; }
.calc-note { margin: 0; font-size: .75rem; }
@media (max-width: 380px) { .calc-ligne { grid-template-columns: 1fr auto 1fr; } .calc-ligne input { grid-column: 1 / -1; } }

/* fiche recette : ajuster les portions */
.meta { align-items: center; }
.portions { display: inline-flex; align-items: center; gap: 6px; }
.btn-portions { border: 1px dashed var(--line); background: transparent; color: var(--muted); padding: 3px 10px; font-size: .9rem; font-weight: 400; }
.btn-portions .crayon { font-size: .75rem; opacity: .6; margin-left: 2px; }
.btn-portions:hover { border-color: var(--accent); color: var(--accent); }
.btn-portions.change { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.pas-portions { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); border-radius: 999px; padding: 3px; animation: etoile-pop .3s var(--ressort); }
.pas-portions b { color: var(--accent); font-weight: 600; min-width: 6.5em; text-align: center; font-size: .92rem; }
.pas-portions .rond { width: 30px; height: 30px; font-size: 1.05rem; background: var(--surface); }
.btn-original { width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 1rem; color: var(--muted); animation: etoile-pop .3s var(--ressort); }
.btn-original:hover { color: var(--accent); transform: rotate(-90deg); }
.calcul-portions { margin-left: 8px; color: var(--accent); }
.calcul-portions .tourne { width: 12px; height: 12px; vertical-align: -1px; }
.liste-ing.en-calcul .txt-ing { opacity: .45; transition: opacity .2s; }
.note-portions { margin: -2px 0 8px; font-size: .8rem; color: var(--accent); }
.txt-ing.ajuste { animation: ajuste 1.2s ease-out; border-radius: 4px; }
@keyframes ajuste { 0% { background: color-mix(in srgb, var(--accent) 28%, transparent); } 100% { background: transparent; } }

/* ---------- épicerie : liste unique (à acheter · panier · à la maison) ---------- */
.progres-epicerie { margin: -4px 0 12px; }
.barre-progres { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.barre-progres span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .5s var(--glisse); }
.progres-epicerie p { margin: 8px 0 0; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.progres-epicerie p b { color: var(--fg); }

.progres-epicerie .etat-import { margin-top: 4px; }
.progres-epicerie .etat-import .tourne { width: 12px; height: 12px; vertical-align: -1px; margin-right: 4px; }
.ajout-article { margin-bottom: 4px; }

.ligne-epicerie { position: relative; margin-bottom: 6px; border-radius: 12px; overflow: hidden; }
/* Entrée seulement au premier affichage (pas à chaque case cochée) */
#liste-epicerie.entree .ligne-epicerie { animation: monte .34s var(--glisse) both; animation-delay: calc(var(--i, 0) * 22ms); }
.ligne-fond { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 18px;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--accent); font-weight: 600; font-size: .88rem; border-radius: 12px; }
.ligne-epicerie.pret .ligne-fond { background: var(--accent); color: var(--bg); }
.ligne-contenu { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: transform .25s var(--glisse), background-color .2s; }
.ligne-epicerie.ouvert .ligne-contenu { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ligne-contenu .case-panier { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }
.ligne-contenu .lib { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.ligne-contenu .lib b { font-weight: 600; }
.ligne-contenu .qte { color: var(--accent); font-weight: 500; font-size: .92rem; }
.ligne-contenu .lib small { color: var(--muted); font-size: .76rem; }
.ligne-epicerie.fait .ligne-contenu { background: var(--surface-2); border-color: transparent; }
.ligne-epicerie.fait .lib b, .ligne-epicerie.fait .qte { text-decoration: line-through; color: var(--muted); }
.ligne-epicerie.part .ligne-contenu { transform: translateX(-110%); }
.ligne-epicerie.part { animation: replie .26s ease-in .1s forwards; }
@keyframes replie { to { opacity: 0; margin-bottom: 0; max-height: 0; } }
.btn-ligne { border: 0; background: transparent; width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 1.05rem; flex: none; color: var(--muted); }
.btn-ligne:hover { border: 0; background: var(--surface-2); color: var(--accent); }
.btn-ligne.tourne-1 { animation: inverser .5s var(--ressort); }
.ic-maison { font-size: 1.05rem; flex: none; opacity: .7; }
.section-maison { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.section-maison summary { cursor: pointer; list-style: none; font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; padding: 4px 0 10px; }
.section-maison summary::-webkit-details-marker { display: none; }
.section-maison summary::after { content: " ›"; display: inline-block; transition: transform .2s; }
.section-maison[open] summary::after { transform: rotate(90deg); }
.section-maison .ligne-contenu { background: transparent; border-style: dashed; }
.section-maison .lib b { font-weight: 500; color: var(--muted); }
.bravo { text-align: center; font-size: 1.05rem; font-weight: 600; color: var(--accent); padding: 14px; background: var(--accent-soft); border-radius: var(--radius); animation: etoile-pop .5s var(--ressort); }
.astuce-maison { text-align: center; margin-top: 14px; }
.ligne-contenu { padding: 8px 6px 8px 14px; min-height: 52px; }
.ligne-contenu .lib { display: block; line-height: 1.35; }
.ligne-contenu .lib small { display: block; margin-top: 1px; }
.ligne-contenu .qte { margin-left: 4px; }
.section-maison .ligne-fond { display: none; }
.section-maison .ligne-contenu { background: var(--bg); }

/* épicerie : boutons Regrouper (étincelle) et revenir à la liste par recette */
.progres-epicerie p.outils-regroupement { margin: 10px 0 0; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
button.btn-regrouper { height: 38px; padding: 0 16px 0 12px; gap: 7px; border: 0; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, #7C9CF5 22%, transparent)); }
.btn-regrouper svg { width: 24px; height: 24px; fill: var(--accent); flex: none; margin: -2px 0; }
button.btn-regrouper:hover { border: 0; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 25%, transparent); }
button.btn-regrouper:disabled { opacity: .5; cursor: progress; box-shadow: none; pointer-events: none; }
.btn-regrouper.tourne-1 svg { animation: etincelle .6s var(--ressort); }
@keyframes etincelle { 0% { transform: scale(.6) rotate(-30deg); } 100% { transform: none; } }

/* ---------- Importer avec une photo */
.btn-photo { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex: 1; justify-content: center; white-space: nowrap; }
.btn-photo[hidden] { display: none; }
#btn-photo { flex: 1; }
.photos-choisies { display: flex; gap: 8px; flex-wrap: wrap; }
.photos-choisies:not(:empty) { margin-top: 12px; }
.mini-photo { position: relative; margin: 0; width: 72px; height: 96px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2); animation: etoile-pop .4s var(--ressort); }
.mini-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-photo figcaption { position: absolute; left: 5px; bottom: 5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; font-weight: 600; display: grid; place-items: center; }
.mini-photo .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; display: grid; place-items: center; cursor: pointer; }
/* Pendant la lecture : un reflet passe sur les photos */
.photos-choisies.lecture .x { display: none; }
.photos-choisies.lecture .mini-photo::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-100%); animation: balaye 1.6s ease-in-out infinite; }
.photos-choisies.lecture .mini-photo:nth-child(2)::after { animation-delay: .2s; }
.photos-choisies.lecture .mini-photo:nth-child(3)::after { animation-delay: .4s; }
@keyframes balaye { to { transform: translateX(100%); } }
.bandeau-photo { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin: 4px 0 14px; border-radius: var(--radius);
  background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); animation: vue-in .3s ease-out; }
.bandeau-photo > span { font-size: 1.3rem; }
.bandeau-photo b { display: block; }
.bandeau-photo small { color: var(--muted); }
.rangee-photo { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.rangee-photo .btn { cursor: pointer; }
.apercu-photo[hidden] { display: none; }
.apercu-photo { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius); margin-top: 14px; }
/* Détail d'un article regroupé : par-dessus le fond vert du glisser (sinon il le cachait) */
.detail-groupe { position: relative; z-index: 1; }
.ligne-epicerie.ouvert .ligne-fond { display: none; }
.detail-groupe:not([hidden]) { animation: vue-in .25s ease-out; }
.detail-groupe li { flex-wrap: wrap; column-gap: 6px; row-gap: 0; padding: 5px 0; line-height: 1.3; }
.detail-groupe li small { flex-basis: 100%; font-size: .78rem; }

/* ---------- Mode cuisine (v3.6.1) : toute la recette en plein écran, en plus gros */
body.mode-cuisine { padding-bottom: 0; }
body.mode-cuisine .tabs, body.mode-cuisine .pied, body.mode-cuisine header.top { display: none; }
.cuisine { display: grid; gap: 14px; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.cuisine-haut { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  margin: 0 -16px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.cuisine-haut .rond { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; font-size: 1.1rem; }
.cuisine-titre { flex: 1; min-width: 0; line-height: 1.25; }
.cuisine-titre b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: "Bricolage Grotesque", sans-serif; font-size: 1.15rem; }
.cuisine-titre small { color: var(--muted); font-size: .8rem; }
.cuisine-bloc h3 { margin-bottom: 4px; }
.cuisine-bloc .aide { margin: 0 0 8px; font-size: .82rem; }
.cuisine-ing { list-style: none; margin: 0; padding: 0; }
.cuisine-ing .ing-section, .cuisine-etapes .etape-section { margin: 14px 0 4px; font-weight: 700; color: var(--accent); font-size: 1rem; list-style: none; }
button.ingr-cuisine { width: 100%; justify-content: flex-start; align-items: flex-start; text-align: left; gap: 12px; font-size: 1.15rem; font-weight: 400;
  line-height: 1.4; padding: 11px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; color: var(--fg); }
button.ingr-cuisine:active { transform: none; }
.ingr-cuisine .coche { width: 22px; height: 22px; flex: none; margin-top: 2px; border-radius: 7px; border: 2px solid var(--line); transition: background-color .2s, border-color .2s; }
button.ingr-cuisine.utilise { color: var(--muted); }
button.ingr-cuisine.utilise > span:last-child { text-decoration: line-through; }
.ingr-cuisine.utilise .coche { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.cuisine-etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cuisine-etapes .cuisine-etape { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--surface-2);
  cursor: pointer; transition: opacity .25s, background-color .25s; }
.cuisine-etape .num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--accent); color: var(--bg); transition: background-color .25s; }
.cuisine-etape p { margin: 0; font-size: clamp(1.15rem, 4.6vw, 1.4rem); line-height: 1.5; }
.cuisine-etape.faite { opacity: .5; }
.cuisine-etape.faite .num { background: var(--muted); }
.cuisine-etape.faite .num::after { content: "✓"; position: absolute; }
.cuisine-etape.faite .num { color: transparent; position: relative; }
.cuisine-etape.faite .num::after { color: var(--bg); }
.lien-minuterie { font: inherit; font-size: .9em; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 2px 12px; margin: 2px 0;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--bg); white-space: nowrap; vertical-align: baseline; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); }
.lien-minuterie.lancee { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.cuisine-fin { display: flex; justify-content: center; margin-top: 4px; }
.cuisine-fin .btn { min-height: 52px; padding: 0 24px; font-size: 1.05rem; }

/* ---------- Minuteries (en bas, sur toutes les pages) */
#minuteries { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 60;
  width: min(92vw, 420px); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
body.mode-cuisine #minuteries { bottom: calc(16px + env(safe-area-inset-bottom)); }
button.minuterie { pointer-events: auto; position: relative; overflow: hidden; justify-content: flex-start; gap: 10px; width: 100%;
  padding: 8px 14px; border: 0; border-radius: 16px; background: var(--fg); color: var(--bg); box-shadow: 0 8px 24px rgba(0,0,0,.22); }
button.minuterie::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: rgba(255,255,255,.14); transition: width .5s linear; }
button.minuterie > * { position: relative; }
button.minuterie.neuve { animation: monte .35s var(--glisse); }
button.minuterie.partie { opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .18s, transform .18s; }
button.minuterie.sonne { background: #C2410C; color: #fff; animation: sonne 1s ease-in-out infinite; }
@keyframes sonne { 0%, 100% { transform: none; } 20% { transform: rotate(-1.5deg) scale(1.02); } 40% { transform: rotate(1.5deg) scale(1.02); } 60% { transform: none; } }
.min-ic { font-size: 1.2rem; }
.min-txt { flex: 1; display: grid; text-align: left; line-height: 1.2; }
.min-txt b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.min-txt small { font-size: .72rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.min-x { opacity: .6; font-size: .85rem; }
body.mode-cuisine #toast { bottom: auto; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%) translateY(-16px) scale(.96); }
body.mode-cuisine #toast.visible { transform: translateX(-50%); }
.outils-regroupement #degrouper { width: 40px; height: 40px; font-size: 1.45rem; font-weight: 600; }

/* ---------- Recettes : recherche et filtres (v3.4) */
.barre-recherche { display: flex; gap: 8px; align-items: stretch; }
.champ-recherche { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; height: 46px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; transition: border-color .15s, box-shadow .15s; cursor: text; }
.champ-recherche:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.champ-recherche svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.champ-recherche input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; height: 100%; font: inherit; color: var(--fg); box-shadow: none; outline: none; }
.champ-recherche input::-webkit-search-cancel-button { display: none; }
.champ-recherche input:focus-visible { outline: none; }
button.vider { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: .75rem; flex: none; animation: etoile-pop .3s var(--ressort); }
button.vider[hidden] { display: none; }
button.btn-filtres { position: relative; height: 46px; padding: 0 16px 0 13px; gap: 7px; flex: none; font-weight: 600; }
.btn-filtres svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
button.btn-filtres.actif { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-filtres .pastille { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--bg); font-size: .72rem; display: grid; place-items: center; animation: etoile-pop .35s var(--ressort); }
.btn-filtres .pastille[hidden] { display: none; }
.filtres-actifs { margin-top: 10px; }
.filtres-actifs .puce-tri { color: var(--fg); font-weight: 500; }
.puce.retirable { display: inline-flex; align-items: center; gap: 6px; animation: etoile-pop .3s var(--ressort); }
.puce.retirable span { font-size: .7rem; opacity: .8; }
.puce.partie { opacity: 0; transform: scale(.85); transition: opacity .15s, transform .15s; }
.compte-recettes { margin: 2px 0 10px; display: flex; align-items: center; gap: 10px; }
.compte-recettes:empty { display: none; }
.compte-recettes b { color: var(--fg); }
button.lien { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
button.lien:active { transform: none; }
/* Fenêtre « Trier et filtrer » */
.section-filtre { padding: 14px 0; border-top: 1px solid var(--line); }
.section-filtre:first-of-type { border-top: 0; padding-top: 4px; }
.section-filtre h3 { margin: 0 0 10px; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.choix-tri, .choix-sites { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-filtre { display: flex; width: 100%; }
.seg-filtre button { flex: 1; }
.interrupteur { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.interrupteur > span { flex: 1; display: grid; }
.interrupteur small { color: var(--muted); font-size: .8rem; }
.interrupteur input { position: absolute; opacity: 0; pointer-events: none; }
.interrupteur i { position: relative; width: 48px; height: 28px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); flex: none; transition: background-color .2s; }
.interrupteur i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ressort); }
.interrupteur input:checked + i { background: var(--accent); border-color: var(--accent); }
.interrupteur input:checked + i::after { transform: translateX(20px); }
.interrupteur input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.pied-filtres { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 12px 0 4px; margin-top: 6px;
  background: linear-gradient(transparent, var(--bg) 25%); }
.pied-filtres button { height: 50px; }
.pied-filtres .primaire { flex: 1; font-size: 1rem; }
/* La case de recherche est un <label> : on enlève la marge des étiquettes de formulaire (alignée avec Filtres) */
.barre-recherche { align-items: center; }
label.champ-recherche { margin: 0; font-size: 1rem; font-weight: 400; color: var(--fg); box-sizing: border-box; }
button.btn-filtres { box-sizing: border-box; }

/* ---------- Calculatrice : raccourcis, mesure pratique, lexique (v3.5) */
.calc-raccourcis { margin: -2px -2px 0; flex-wrap: wrap; overflow: visible; }   /* (v4.6.5) tout est visible, sans défilement caché sur ordinateur */
.calc-raccourcis .puce { padding: 6px 12px; font-size: .84rem; }
.calc-ingr small { color: var(--muted); font-size: .8rem; font-weight: 400; }
.calc-mesure { margin-top: 6px; font-size: .9rem; color: var(--fg); }
.calc-mesure b { font-family: inherit; font-size: 1rem; color: var(--fg); font-weight: 600; }
.calc-lexique { margin: 0; }
.calc-lexique dl { margin: 10px 0 0; display: grid; gap: 0; }
.calc-lexique dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.calc-lexique dt { font-weight: 600; }
.calc-lexique dd { margin: 0; color: var(--muted); }

/* ---------- Épicerie : barre d'outils sur une seule ligne (v3.5.1) */
.barre-progres.barre-epicerie { height: 6px; margin: -2px 0 14px; }
.outils-epicerie { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.champ-ajout { flex: 1; min-width: 0; display: flex; align-items: center; height: 44px; padding: 0 4px 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; transition: border-color .15s, box-shadow .15s; }
.champ-ajout:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.champ-ajout input { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0; background: transparent; font: inherit; color: var(--fg); outline: none; box-shadow: none; }
.champ-ajout input:focus-visible { outline: none; }
button.ajout-plus { width: 36px; height: 36px; padding: 0; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: var(--bg); font-size: 1.3rem; font-weight: 600; line-height: 1; }
.outils-epicerie button.btn-regrouper { height: 44px; flex: none; }
.outils-epicerie .btn-degrouper { width: 44px; height: 44px; font-size: 1.45rem; font-weight: 600; flex: none; }
.etat-epicerie { margin: 2px 4px 8px; }
.etat-epicerie .tourne { width: 12px; height: 12px; vertical-align: -1px; margin-right: 4px; }
@media (max-width: 370px) { .outils-epicerie .btn-regrouper span { display: none; } .outils-epicerie button.btn-regrouper { width: 44px; padding: 0; justify-content: center; } }
.champ-ajout #nouvel-article, .champ-ajout #nouvel-article:focus, .champ-ajout #nouvel-article:focus-visible {
  border: 0; border-radius: 0; background: transparent; padding: 0; margin: 0; height: 100%; box-shadow: none; outline: none; }

/* ---------- Tirer vers le bas pour rafraîchir (comme l'app Finance, avec une casserole) */
html { overscroll-behavior-y: contain; }        /* pas le rafraîchissement natif de Chrome : on a le nôtre */
#ptr { position: fixed; left: 50%; top: env(safe-area-inset-top); z-index: 60; width: 48px; height: 48px; margin-left: -24px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.18); color: var(--accent);
  display: grid; place-items: center; transform: translateY(-60px); opacity: 0; pointer-events: none; }
#ptr .ptr-casserole { width: 30px; height: 30px; overflow: visible; transition: transform .2s var(--ressort); }
#ptr .ptr-v { opacity: var(--vapeur, 0); transition: opacity .15s; }
#ptr.pret { border-color: var(--accent); }
#ptr.pret .ptr-casserole { transform: scale(1.12); }
#ptr.retour { transition: transform .32s var(--glisse), opacity .32s ease; }
/* Pendant le chargement : la vapeur monte en ondulant, la casserole frémit, le couvercle sautille */
#ptr.charge .ptr-v { opacity: 1; transform-box: fill-box; transform-origin: bottom; animation: ptr-vapeur 1.1s ease-in-out infinite; }
#ptr.charge .v2 { animation-delay: .25s; }
#ptr.charge .v3 { animation-delay: .5s; }
#ptr.charge .ptr-pot { transform-box: view-box; transform-origin: 16px 27px; animation: ptr-fremit .45s ease-in-out infinite; }
#ptr.charge .ptr-couvercle { animation: ptr-couvercle .9s ease-in-out infinite; }
@keyframes ptr-vapeur {
  0% { opacity: 0; transform: translateY(3px) scaleY(.6); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px) translateX(1px) scaleY(1.15); }
}
@keyframes ptr-fremit { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
@keyframes ptr-couvercle { 0%, 60%, 100% { transform: translateY(0); } 70% { transform: translateY(-1.6px); } 80% { transform: translateY(0); } 88% { transform: translateY(-.8px); } }
@media (prefers-reduced-motion: reduce) { #ptr.charge .ptr-v { animation: none !important; opacity: 1; } }

/* ---------- Paramètres (v3.6) */
.btn-reglages { margin-left: auto; width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%;
  color: var(--muted); border: 1px solid transparent; transition: color .15s, background-color .15s, transform .3s var(--ressort); }
.btn-reglages svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-reglages:hover { color: var(--accent); background: var(--surface-2); }
.btn-reglages:active { transform: rotate(60deg) scale(.94); }
.reglages h3 { margin: 0 0 6px; font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--fg); }
.reglages .aide { margin: 0 0 10px; }
.reglages .aide.petite { margin: 6px 0 0; font-size: .8rem; }
.reglages input[type=email], .reglages input[type=password] { width: 100%; box-sizing: border-box; }
.puces-adresses { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.puces-adresses .puce { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 12px; }
.puces-adresses .puce button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--bg) 25%, transparent);
  color: inherit; font-size: .65rem; }
.ajout-adresse { margin-bottom: 4px; }
.ajout-adresse input#nouvelle-adresse, .ajout-adresse input#nouvelle-adresse:focus { border: 0; border-radius: 0; background: transparent; padding: 0; margin: 0; height: 100%; box-shadow: none; outline: none; }
.groupe-envoi { padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 14px; }
.groupe-envoi .quand { margin-top: 10px; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; transition: opacity .2s; }
.groupe-envoi .quand.eteint { opacity: .4; pointer-events: none; }
.quand select, .quand input[type=time] { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); width: auto; }
.actions-courriel { margin-top: 16px; flex-wrap: wrap; }
.actions-courriel button { flex: 1; min-width: 150px; }
.journal-courriels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.journal-courriels li { display: flex; gap: 10px; font-size: .88rem; }
.journal-courriels li > span:last-child { display: grid; }
.journal-courriels small { color: var(--muted); }
.journal-courriels li.erreur b { color: #B45309; }
.pied-reglages { display: flex; justify-content: flex-end; margin: 6px 0 18px; }
.pied-reglages .primaire { min-width: 160px; height: 46px; }
.seg-apercu { display: flex; margin-bottom: 12px; }
.seg-apercu button { flex: 1; }
.apercu-courriel { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 14px; background: #F3F5F2; }
.journal-courriels li > span:first-child { flex: none; width: 18px; }
.journal-courriels .msg { color: var(--fg); }
.bloc ol.cuisine-etapes { padding-left: 0; margin-left: 0; }
.bloc ol.cuisine-etapes > li { margin-left: 0; }

/* ---------- Notes de la recette (v3.7) */
.notes-recette p { margin: 0 0 10px; line-height: 1.55; }
.notes-recette p:last-child { margin-bottom: 0; }
.notes-recette h4 { margin: 14px 0 6px; font-size: .98rem; color: var(--accent); }
.notes-recette h4:first-of-type { margin-top: 2px; }
.notes-recette ul { margin: 0 0 10px; padding-left: 20px; }
.notes-recette li { margin-bottom: 6px; line-height: 1.5; }
.cuisine-bloc.notes-recette p, .cuisine-bloc.notes-recette li { font-size: 1.08rem; }


/* ======================================================================== v3.8.0 : accessibilité et confort */
/* Lien « Aller au contenu » (clavier) et texte réservé aux lecteurs d'écran */
.saut { position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 999px; background: var(--accent);
  color: var(--bg); font-weight: 600; text-decoration: none; transition: top .15s; }
.saut:focus { top: calc(10px + env(safe-area-inset-top)); outline: 2px solid var(--fg); outline-offset: 2px; }
.sr-seul { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#vue:focus { outline: none; }

/* Petits boutons : zone tactile d'au moins 44 px (norme WCAG 2.5.5 / Apple HIG) sans changer leur apparence */
button.rond, .btn-ligne, .btn-original, .mini-photo .x, .champ-recherche .vider { position: relative; }
button.rond::after, .btn-ligne::after, .btn-original::after, .mini-photo .x::after, .champ-recherche .vider::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
.onglets button, .puce, .lien { min-height: 36px; }

/* Texte trop petit : plancher à 12 px */
.carte-recette .sous, .jour .date b, .bloc h3, .groupe h3, .entete small { font-size: max(.75rem, 12px); }
@media (max-width: 600px) { .tabs a { font-size: .75rem; } }

/* Focus clavier visible partout */
summary:focus-visible, select:focus-visible, [tabindex]:focus-visible, .carte-recette:focus-visible, .jour:focus-visible, .article:focus-within {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs a:focus-visible { outline-offset: -3px; border-radius: 999px; }

/* Défilement fluide et sans saut de mise en page quand la barre de défilement apparaît (grands écrans) */
html { scroll-padding-top: 12px; }
@media (hover: none) { button:hover, .btn:hover { border-color: inherit; } }

/* Mode contraste élevé demandé par le système */
@media (prefers-contrast: more) {
  :root { --line: color-mix(in srgb, var(--fg) 45%, transparent); --muted: color-mix(in srgb, var(--fg) 78%, var(--bg)); }
}

/* Mises à jour en direct : pas de réanimation des cartes quand la page se redessine toute seule */
body.en-direct #vue, body.en-direct #vue * { animation: none !important; }

/* Impression : seulement le contenu (liste d'épicerie, recette) */
@media print {
  .tabs, .top .btn-reglages, .pied, #ptr, #toast, #minuteries, .saut { display: none !important; }
  body { padding: 0 !important; background: #fff !important; color: #000 !important; }
  a { color: inherit; text-decoration: none; }
  .carte-recette, .jour, .bloc, .ligne { break-inside: avoid; box-shadow: none !important; }
}

/* ======================================================================== v3.9.1 : mode cuisine — texte qui ne déborde plus */
/* La grille laissait le texte long élargir la colonne bien au-delà de l'écran : on la force à la largeur de l'écran. */
.cuisine { grid-template-columns: minmax(0, 1fr); }
.cuisine > *, .cuisine-bloc, .cuisine-ing, .cuisine-etapes, .cuisine-ing > li, .cuisine-etapes > li { min-width: 0; max-width: 100%; }
.bloc.cuisine-bloc { padding: 16px 16px 12px; margin-top: 0; }
.bloc .cuisine-ing { padding-left: 0; margin-left: 0; }            /* l'indentation des listes de recette n'a pas sa place ici */
.cuisine-ing > li { list-style: none; }
/* Les boutons du site ne passent pas à la ligne par défaut : ici le texte doit le faire */
button.ingr-cuisine { white-space: normal; text-align: left; overflow-wrap: anywhere; text-wrap: pretty; }
.ingr-cuisine > span:last-child { flex: 1; min-width: 0; }
.cuisine-etape { min-width: 0; }
.cuisine-etape p { flex: 1; min-width: 0; overflow-wrap: anywhere; text-wrap: pretty; }
.cuisine-etape p a { overflow-wrap: anywhere; word-break: break-all; }
/* Titre : jusqu'à deux lignes au lieu d'être coupé */
.cuisine-titre b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }
.cuisine-bloc.notes-recette { overflow-wrap: anywhere; }
.cuisine-fin .btn { max-width: 100%; white-space: normal; text-align: center; }
@media (max-width: 380px) {
  .cuisine-etapes .cuisine-etape { gap: 10px; padding: 12px; }
  .cuisine-etape .num { width: 30px; height: 30px; }
}

/* ---------- accueil et tutoriel (version publique) ---------- */
.accueil { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }
.accueil-tete h2 { font-family: var(--font-titre); font-size: 1.9rem; font-weight: 600; letter-spacing: -.01em; }
.accueil-tete .aide { margin: 0 0 2px; }
.accueil-recherche { margin: 0; }
.accueil .bloc { margin: 0; }
.entete-bloc { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.entete-bloc h3 { font-size: 1.1rem; }
.entete-bloc a { font-size: .9rem; font-weight: 500; }
.accueil-tuto { background: var(--accent); color: var(--bg); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.accueil-tuto h3 { font-size: 1.25rem; }
.accueil-tuto p { margin: 0; font-size: .95rem; }
.btn-clair { background: var(--bg); color: var(--fg); border: 0; border-radius: 999px; min-height: 44px; padding: 0 20px; font-weight: 600; margin-top: 4px; }
.accueil-depart progress { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 10px 0 4px; accent-color: var(--accent); }
.accueil-depart progress::-webkit-progress-bar { background: var(--surface-2); }
.accueil-depart progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.accueil-depart progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.etapes { list-style: none; margin: 0; padding: 0; }
.etapes li { border-top: 1px solid var(--surface-2); }
.etapes li:first-child { border-top: 0; }
.etapes a, .etapes li > div { display: flex; align-items: center; gap: 12px; min-height: 56px; text-decoration: none; color: var(--fg); }
.etapes svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rond-etape { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; }
.rond-etape.fait { background: var(--accent); }
.rond-etape.fait svg { width: 16px; height: 16px; stroke: var(--bg); stroke-width: 3; }
.etape-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.etape-texte small { color: var(--muted); font-size: .82rem; }
.accueil-soir { display: flex; flex-direction: column; gap: 8px; }
.accueil-soir .pastille { align-self: flex-start; }
.soir { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: stretch; }
.soir-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.soir-texte h3 { font-size: 1.3rem; }
.soir-texte .aide { margin: 0; }
.nowrap { white-space: nowrap; }
.soir-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.soir-photo { width: 104px; flex: none; border-radius: 14px; object-fit: cover; align-self: stretch; }
.accueil-cartes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.carte-grande { display: flex; flex-direction: column; gap: 6px; min-height: 172px; padding: 16px; border-radius: 20px; text-decoration: none; }
.carte-grande b { font-family: var(--font-titre); font-size: 1.2rem; font-weight: 600; line-height: 1.15; }
.carte-grande span { font-size: .92rem; }
.carte-grande i { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-style: normal; font-weight: 600; font-size: .9rem; min-height: 44px; padding: 0 16px; border-radius: 999px; }
.carte-grande svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.carte-grande.semaine { background: var(--accent); color: var(--bg); }
.carte-grande.semaine i { background: var(--bg); color: var(--fg); }
.carte-grande.epicerie { background: var(--accent-soft); color: var(--accent); }
.carte-grande.epicerie i { background: var(--accent); color: var(--accent-soft); }
/* Samedi et dimanche : grande carte « prépare ta semaine prochaine » */
.carte-weekend { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 18px; border-radius: 20px; text-decoration: none; color: var(--fg); background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line)); }
.carte-weekend:hover { background: var(--accent-soft); }
.carte-weekend:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.we-dessin { width: 116px; height: auto; flex: none; order: 2; }
.we-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.we-texte b { font-family: var(--font-titre); font-size: 1.3rem; font-weight: 600; line-height: 1.15; color: var(--accent); }
.we-texte > span { font-size: .93rem; line-height: 1.35; }
.we-texte i { margin-top: 4px; display: inline-flex; align-items: center; gap: 8px; font-style: normal; font-weight: 600; font-size: .9rem; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--accent); color: var(--bg); }
.we-texte i svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.we-feuille { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.we-trait { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.we-pt { fill: var(--accent); }
.we-vide { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 4 4; }
.we-or { fill: #f0b43c; }
.we-rayon { fill: none; stroke: #f0b43c; stroke-width: 3; stroke-linecap: round; }
.we-crayon { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.we-mine { fill: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .we-soleil { transform-box: fill-box; transform-origin: center; animation: we-tourne 18s linear infinite; }
  .we-crayon-g { animation: we-ecrit 2.4s ease-in-out infinite alternate; }
}
@keyframes we-tourne { to { transform: rotate(360deg); } }
@keyframes we-ecrit { from { transform: translate(107px, 78px) rotate(35deg); } to { transform: translate(104px, 80px) rotate(28deg); } }
@media (max-width: 380px) { .we-dessin { width: 88px; } }
.defile { display: flex; gap: 12px; overflow-x: auto; padding: 8px 0 4px; scroll-snap-type: x proximity; }
.mini-recette { flex: none; width: 156px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--fg); scroll-snap-align: start; }
.mini-recette .mini-photo { width: 100%; height: 112px; border-radius: 16px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; }
.mini-recette b { font-size: .92rem; line-height: 1.3; }
.mini-recette small { color: var(--muted); }
.accueil-revoir { text-align: center; margin: 4px 0 0; }
button.lien { background: none; border: 0; padding: 0 8px; min-height: 44px; color: var(--accent); font-weight: 500; text-decoration: underline; }

dialog.tuto { border: 0; padding: 0; width: 100%; max-width: 440px; height: 100%; max-height: none; margin: 0 auto; background: var(--bg); color: var(--fg); }
dialog.tuto[open] { display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); gap: 4px; }
dialog.tuto::backdrop { background: rgba(0,0,0,.5); }
.tuto-haut { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.tuto-dessin { flex: none; align-self: center; width: min(300px, 78vw); aspect-ratio: 1; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; margin: 8px 0; }
.tuto-dessin.chaud { background: var(--resto-soft); }
.tuto-dessin svg { width: 76%; height: 76%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tuto-casserole { stroke: var(--accent); stroke-width: 1.3; }
.t-carte { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.t-trait { fill: none; stroke: var(--accent); stroke-width: 3; }
.t-gris { fill: none; stroke: var(--line); stroke-width: 3; }
.t-plein { fill: var(--accent); stroke: none; }
.t-resto { fill: var(--resto-soft); stroke: var(--resto); stroke-width: 3; }
.t-trait-resto { fill: none; stroke: var(--resto); stroke-width: 3; }
.t-plein-resto { fill: var(--resto); stroke: none; }
.t-coche { fill: none; stroke: var(--bg); stroke-width: 3; }
.t-coche-grand { fill: none; stroke: var(--bg); stroke-width: 8; }
.tuto-texte { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.tuto-compteur { margin: 0; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--resto); }
.tuto-texte h2 { font-family: var(--font-titre); font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em; }
.tuto-texte p { margin: 0; max-width: 320px; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.tuto-bas { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.tuto-points { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.tuto-points span { height: 8px; width: 8px; border-radius: 999px; background: var(--line); transition: width .25s var(--glisse), background .2s; }
.tuto-points span.actif { width: 24px; background: var(--accent); }
.tuto-bas button.grand { min-height: 52px; border-radius: 999px; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .tuto-points span { transition: none; } }
@media (min-width: 601px) { dialog.tuto[open] { height: min(760px, 92vh); margin: auto; border-radius: 24px; border: 1px solid var(--line); } }
.accueil-recherche { flex: none; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.accueil-recherche svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.accueil-recherche input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; box-shadow: none; padding: 0; font: inherit; color: var(--fg); }
.accueil-recherche:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.soir-texte h3 { text-transform: none; letter-spacing: 0; color: var(--fg); font-family: var(--font-display); font-size: 1.3rem; }

/* Bouton « + » au centre de la barre (version publique) */
.tabs a.tab-plus { flex: none; align-self: center; width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--bg); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform .2s var(--ressort); }
.tabs a.tab-plus .tab-ic { width: 26px; height: 26px; stroke-width: 2.4; }
.tabs a.tab-plus:active { transform: scale(.92); }
@media (max-width: 600px) {
  /* (v4.7.11) Le + est sur la même ligne que les autres onglets (il ne dépasse plus de la barre) */
  .tabs a.tab-plus { margin: 0 4px; transform: none; border: 0; width: 52px; height: 52px; box-sizing: border-box; align-self: center; }
  .tabs a.tab-plus:active { transform: scale(.92); }
}
@media (max-width: 380px) { .tabs a { font-size: .68rem; } .tabs a.tab-plus { margin: 0 1px; } }   /* petits téléphones : 6 onglets en version publique */
@media (min-width: 601px) { .tabs a.tab-plus { width: 40px; height: 40px; margin: 0 6px; } .tabs a.tab-plus .tab-ic { width: 22px; height: 22px; } }
/* (v4.6.3) Au survol, la règle générale « .tabs a:hover:not(.actif) » (fond presque transparent) effaçait le vert du + :
   il devenait blanc sur blanc. On garde le vert et on le met simplement en valeur. */
@media (min-width: 601px) {
  .tabs a.tab-plus:hover:not(.actif) { background: var(--accent); filter: brightness(1.1);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 55%, transparent); }
}


/* ---------- Bandeaux illustrés des pages d'onglet (v4.7.0) : l'illustration est centrée, le fond remplit toute la largeur */
.bandeau { display: block; width: 100%; height: 92px; margin: 0 0 14px; border-radius: 16px; background: var(--accent-soft); }
@media (min-width: 601px) { .bandeau { height: 136px; margin-bottom: 18px; } }
.bandeau .bw { fill: var(--surface); }
.bandeau .bl { fill: var(--surface-2); }
.bandeau .ba { fill: var(--accent); }
.bandeau .ba2 { fill: color-mix(in srgb, var(--accent) 68%, var(--surface)); }
.bandeau .bc { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.bandeau .bsh { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.bandeau .bln { fill: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.bandeau .bst { stroke: color-mix(in srgb, var(--accent) 30%, var(--surface)); stroke-width: 2; }
.bandeau .bs { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.bandeau .bvap { fill: none; stroke: color-mix(in srgb, var(--accent) 38%, var(--surface)); stroke-width: 4; stroke-linecap: round; }
.bandeau .bgrille { fill: none; stroke: color-mix(in srgb, var(--accent) 55%, #000); stroke-width: 3; stroke-linecap: round; }

/* Page Recettes (v4.7.1) : recherche en premier, puis le total et le bouton d'import sur une même rangée */
.rangee-recettes { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 2px 6px; }
.total-recettes { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; }
.rangee-recettes > .primaire { flex: none; }
@media (max-width: 380px) { .rangee-recettes > .primaire { padding-inline: 14px; } }
.bandeau .bflux { fill: none; stroke: color-mix(in srgb, var(--accent) 45%, var(--surface)); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 11; }

/* Accueil : le salut est écrit dans le bandeau, la maison est décalée à droite */
.bandeau-hote { position: relative; margin: 0 0 14px; }
.bandeau-hote .bandeau { margin: 0; }
.bandeau-texte { position: absolute; left: 16px; top: 0; bottom: 0; max-width: 46%; display: flex; flex-direction: column; justify-content: center; }
.bandeau-texte .aide { margin: 0 0 2px; font-size: .78rem; line-height: 1.25; }
.bandeau-texte h2 { margin: 0; font-family: var(--font-titre); font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
@media (min-width: 601px) { .bandeau-hote { margin-bottom: 18px; } .bandeau-texte { left: 28px; } .bandeau-texte .aide { font-size: .9rem; } .bandeau-texte h2 { font-size: 2.1rem; } }

/* Accueil : scène de jour / de nuit, avec un peu de mouvement */
.bandeau.nuit { background: #10302d; --fond-nuit: #10302d; }
.bandeau.nuit .bc { fill: rgba(255, 255, 255, .05); }
.bandeau.nuit .bw { fill: color-mix(in srgb, var(--surface) 80%, #10302d); }
.bandeau.nuit .bsh { fill: rgba(0, 0, 0, .25); }
.bandeau.nuit .bvap { stroke: rgba(255, 255, 255, .45); }
.bandeau .b-fondnuit { fill: var(--fond-nuit, #10302d); }
.bandeau .b-halo { fill: none; stroke: rgba(243, 230, 184, .16); stroke-width: 7; }
.bandeau .b-lumiere { fill: #f6c453; }
.bandeau-hote.nuit .bandeau-texte { color: #f3f5ff; }
.bandeau-hote.nuit .bandeau-texte .aide { color: #b5d3c8; }
@media (prefers-reduced-motion: no-preference) {
  .bandeau .b-rayons { transform-box: fill-box; transform-origin: center; animation: b-tourne 40s linear infinite; }
  .bandeau .b-nuage { animation: b-derive 9s ease-in-out infinite alternate; }
  .bandeau .b-nuage.n2 { animation-duration: 12s; animation-delay: -4s; }
  .bandeau .b-feuille { transform-box: fill-box; transform-origin: 50% 100%; animation: b-balance 5s ease-in-out infinite alternate; }
  .bandeau .b-feuille.f2 { animation-duration: 6.5s; animation-delay: -2s; }
  .bandeau .b-vap { animation: b-monte 3.2s ease-out infinite; }
  .bandeau .b-etoile { animation: b-scintille 3s ease-in-out infinite; }
  .bandeau .b-etoile.e2 { animation-delay: -1s; }
  .bandeau .b-etoile.e3 { animation-delay: -2s; }
  .bandeau .b-halo { animation: b-respire 5s ease-in-out infinite alternate; }
  .bandeau .b-lumiere { animation: b-vacille 4s ease-in-out infinite alternate; }
}
@keyframes b-tourne { to { transform: rotate(360deg); } }
@keyframes b-derive { from { transform: translateX(-10px); } to { transform: translateX(12px); } }
@keyframes b-balance { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes b-monte { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-8px); opacity: 0; } }
@keyframes b-scintille { 0%, 100% { opacity: .95; } 50% { opacity: .25; } }
@keyframes b-respire { from { opacity: .6; } to { opacity: 1; } }
@keyframes b-vacille { from { opacity: 1; } to { opacity: .78; } }

/* Calculatrice : en haut à droite, à gauche de la roue des paramètres */
.top .btn-calc { margin-left: auto; background: transparent; box-shadow: none; width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 1px solid transparent; transition: color .15s, background-color .15s; }
.top .btn-calc svg { width: 22px; height: 22px; }
.top .btn-calc:hover { color: var(--accent); background: var(--surface-2); }
.top .btn-calc + .btn-reglages { margin-left: 0; }

/* Guide d'une semaine vide : un halo lumineux entoure l'élément dont parle le texte, qui s'écrit lettre par lettre */
.guide-fleche { position: fixed; inset: 0; z-index: 60; pointer-events: none; color: var(--accent); }
.gf-halo { position: absolute; border: 3px solid var(--accent); border-radius: 999px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 18px 4px color-mix(in srgb, var(--accent) 55%, transparent); animation: gf-halo-entre .4s ease-out, gf-halo-pulse 1.3s ease-in-out .4s infinite alternate; }
.gf-bulle { position: absolute; transform: translate(-50%, -50%); width: max-content; max-width: 220px; padding: 9px 16px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: .95rem; font-weight: 600; text-align: left; white-space: nowrap; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent); animation: gf-entre .25s ease-out .25s backwards; }
.gf-reste { visibility: hidden; }                  /* réserve la largeur finale pendant que le texte s'écrit */
.gf-ecrit.curseur::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -.15em; background: currentColor; animation: gf-curseur .5s steps(1) infinite; }
@keyframes gf-entre { from { opacity: 0; } to { opacity: 1; } }
@keyframes gf-curseur { 50% { opacity: 0; } }
@keyframes gf-halo-entre { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: scale(1); } }
@keyframes gf-halo-pulse { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 10px 2px color-mix(in srgb, var(--accent) 40%, transparent); } to { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 26%, transparent), 0 0 26px 8px color-mix(in srgb, var(--accent) 60%, transparent); } }
@media (prefers-reduced-motion: reduce) { .gf-halo, .gf-bulle { animation: none; } }
@media print { .guide-fleche { display: none !important; } }

/* Accueil : « Historique des menus » et « Revoir le tutoriel » ont exactement le même style */
.accueil-revoir .lien, .accueil-revoir button.lien { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; margin: 0; border: 0; background: none; font: inherit; font-size: .95rem; font-weight: 400; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Remplissage automatique du navigateur : pas de fond bleu/jaune, les champs gardent les couleurs de l'app */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-text-fill-color: var(--fg); caret-color: var(--fg);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset; box-shadow: 0 0 0 1000px var(--surface) inset;
  transition: background-color 600000s 0s;
}

/* ---------- squelettes de chargement ---------- */
.squelette { padding-top: 2px; }
.sq { background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 50%, var(--surface-2) 70%); background-size: 220% 100%; border-radius: 10px; animation: sq-balaye 1.3s ease-in-out infinite; }
@keyframes sq-balaye { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.sq-bandeau { height: 78px; border-radius: var(--radius); margin: 6px 0 18px; }
.sq-titre { height: 22px; width: 58%; margin: 0 auto 18px; }
.sq-ligne { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sq-vignette { width: 56px; height: 56px; flex: none; }
.sq-vignette.petit { width: 40px; height: 40px; border-radius: 8px; }
.sq-col { flex: 1; display: grid; gap: 8px; }
.sq-t { height: 12px; width: 72%; border-radius: 6px; }
.sq-t.court { width: 38%; }
.sq-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sq-carte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding-bottom: 12px; overflow: hidden; display: grid; gap: 8px; }
.sq-carte .sq-t { margin-left: 11px; }
.sq-photo { aspect-ratio: 4/3; border-radius: 0; }
.squelette > * { animation-delay: 0s; }
.sq-ligne:nth-of-type(2) .sq, .sq-carte:nth-child(2) .sq { animation-delay: .1s; }
.sq-ligne:nth-of-type(3) .sq, .sq-carte:nth-child(3) .sq { animation-delay: .2s; }
.sq-ligne:nth-of-type(4) .sq, .sq-carte:nth-child(4) .sq { animation-delay: .3s; }
.squelette { animation: fondu .25s ease both; }

/* ---------- photos : fondu à l'arrivée ---------- */
img[data-err] { transition: opacity .5s ease, filter .6s ease; }
img[data-err]:not(.ok) { opacity: 0; filter: blur(6px); }
img[data-err].deja { transition: none; }

/* ---------- pages vides ---------- */
.etat-vide { text-align: center; padding: 34px 20px 20px; animation: monte .5s var(--glisse) both; }
.etat-vide h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 18px 0 6px; }
.etat-vide p { color: var(--muted); margin: 0 auto 20px; max-width: 30ch; }
.etat-vide .btn { display: inline-flex; }
.ev-disque { position: relative; width: 96px; height: 96px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); font-size: 2.6rem; }
.ev-disque span { display: block; animation: ev-flotte 3.2s ease-in-out infinite; }
.ev-disque::before, .ev-disque::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ev-onde 3.2s ease-out infinite; }
.ev-disque::after { animation-delay: 1.6s; }
@keyframes ev-flotte { 0%, 100% { transform: translateY(2px) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes ev-onde { 0% { transform: scale(1); opacity: .35; } 100% { transform: scale(1.6); opacity: 0; } }
#grille > .etat-vide { grid-column: 1 / -1; }

/* ---------- Importer depuis Menium */
.fichiers-menium { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.fichiers-menium li { display: flex; justify-content: space-between; gap: 10px; }
.fichiers-menium li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fichiers-menium li span:last-child { flex: none; }
.res-menium { display: grid; gap: 8px; }
.res-menium:not(:empty) { margin-top: 12px; }
.res-menium > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; animation: vue-in .3s ease-out; overflow-wrap: anywhere; }
.res-menium .ok { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.res-menium .attention { box-shadow: inset 4px 0 0 var(--gold); }
.res-menium ul { margin: 6px 0 0; padding-left: 18px; }
.res-menium .aide { margin: 4px 0 0; }
/* Sous-titre de section dans la préparation (« ## Pour le sirop ») : pas de numéro */
.bloc ol > li.etape-section { list-style: none; margin: 14px 0 4px; font-weight: 700; color: var(--accent); }
.bloc ol > li.etape-section:first-child { margin-top: 0; }


/* ---------- boutons « icône + légende » (fiche recette, épicerie, semaine) : côte à côte ---------- */
.actions-ligne { flex-wrap: nowrap; gap: 8px; }
.actions-ligne > * { min-width: 0; }
.actions-centre { justify-content: center; }
.btn-leg { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; flex: 1 1 0; height: 60px; padding: 6px 4px; border-radius: 16px; font-size: .78rem; line-height: 1.1; font-weight: 500; text-decoration: none; color: var(--fg); }
.actions-centre .btn-leg { flex: 0 1 140px; }
.btn-leg span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-leg svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ressort); }
.btn-leg:hover svg { transform: scale(1.1); }
.btn-leg:active svg { transform: scale(.92); }
.btn-leg.primaire { color: var(--bg); font-weight: 600; }
.btn-leg .ic-traduire { width: 22px; height: 22px; vertical-align: 0; }
.btn-leg .tourne { margin: 0; }
.actions-ligne .seg-langue { flex: none; align-self: center; }

/* Voile de déconnexion : couvre l'app dès le toucher */
#voile-deconnexion { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--bg); color: var(--muted, var(--text)); font-weight: 600; animation: voile-entree .18s ease-out both; }
@keyframes voile-entree { from { opacity: 0; } to { opacity: 1; } }

/* Accueil : section « Installer l'application » */
.accueil-installer { position: relative; transition: opacity .25s, transform .25s, max-height .25s; }
.accueil-installer.part { opacity: 0; transform: scale(.97); }
.installer-corps { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 52px 14px 14px; border-radius: 20px; border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--fg); }
.installer-icone { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; }
.installer-icone svg { width: 24px; height: 24px; fill: none; stroke: var(--bg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.installer-texte { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.installer-texte b { font-size: 1rem; }
.installer-texte small { color: var(--muted); font-size: .85rem; line-height: 1.3; }
.installer-fleche { position: absolute; right: 16px; bottom: 12px; color: var(--accent); font-size: 1.5rem; line-height: 1; }
.installer-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; line-height: 1; display: grid; place-items: center; }
.installer-x:active { background: var(--line); }

/* Tuto d'installation : captures dessinées */
.tuto-capture { flex: none; align-self: center; width: min(250px, 66vw); margin: 4px 0; }
.tuto-capture svg { width: 100%; height: auto; display: block; }
.cap-tel { fill: var(--bg); stroke: var(--fg); stroke-width: 3; }
.cap-gris { fill: var(--line); }
.cap-ligne { fill: var(--line); stroke: var(--line); stroke-width: 6; stroke-linecap: round; }
.cap-bas { fill: var(--accent-soft); }
.cap-icone { fill: var(--accent); }
.cap-modal { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.cap-rang { fill: var(--accent-soft); }
.cap-rang.vise, .cap-vise { fill: none; stroke: var(--accent); stroke-width: 3; }
.cap-rang.vise { fill: var(--accent-soft); }
.cap-vise { animation: cap-pouls 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.cap-txt { fill: var(--muted); font: 500 10.5px var(--font-body); }
.cap-txt.fort { fill: var(--accent); font-weight: 700; }
.cap-ico { fill: var(--fg); stroke: var(--fg); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cap-ico path { fill: none; }
@keyframes cap-pouls { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .cap-vise { animation: none; } .accueil-installer { transition: none; } }

/* Avis sur les témoins (cookies) */
.avis-temoins { position: fixed; z-index: 900; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0,0,0,.18); animation: voile-entree .25s ease-out both; transition: opacity .25s, transform .25s; }
.avis-temoins.avec-onglets { bottom: calc(96px + env(safe-area-inset-bottom)); }
.avis-temoins.part { opacity: 0; transform: translateY(8px); }
.avis-temoins p { margin: 0; flex: 1; font-size: .85rem; line-height: 1.4; color: var(--muted); }
.avis-temoins a { color: var(--accent); text-decoration: underline; white-space: nowrap; }
.avis-temoins button { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--accent); color: var(--bg); font-weight: 600; font-size: .9rem; }
@media (max-width: 420px) { .avis-temoins { flex-direction: column; align-items: stretch; } .avis-temoins button { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .avis-temoins { animation: none; transition: none; } }

/* Épicerie : avis « des articles ne sont pas encore classés » */
.avis-maj { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--fg); font-size: .88rem; line-height: 1.35; min-height: 0; animation: voile-entree .25s ease-out both; }
.avis-maj svg { flex: none; width: 20px; height: 20px; stroke: var(--accent); }
.avis-maj span { display: flex; flex-direction: column; gap: 1px; color: var(--muted); }
.avis-maj b { color: var(--fg); font-size: .92rem; }
@media (prefers-reduced-motion: reduce) { .avis-maj { animation: none; } }
.avis-maj em { font-style: normal; }

/* ---------- accueil : pour en apprendre plus ---------- */
.apprendre-liste { list-style: none; margin: 0; padding: 0; }
.apprendre-liste li { margin: 0; border-top: 1px solid var(--surface-2); }
.apprendre-liste li:first-child { border-top: 0; }
.apprendre-liste button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 0; text-align: left; background: none; border: 0; color: var(--fg); font: inherit; cursor: pointer; }
.apprendre-liste button > svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.apprendre-ic { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; }
.apprendre-ic svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge-abo { display: inline-block; font-style: normal; font-size: .66rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; margin-left: 6px; border-radius: 999px; background: var(--resto-soft); color: var(--resto); vertical-align: middle; }
.apprendre-note { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--surface-2); font-size: .82rem; color: var(--muted); }
.apprendre-note .badge-abo { margin: 0 6px 0 0; }
.apprendre-entete { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.apprendre-entete h3 { margin: 0; }
.apprendre-fleche svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; transform: rotate(90deg); transition: transform .2s var(--glisse, ease); }
.accueil-apprendre.ferme .apprendre-fleche svg { transform: rotate(0deg); }
.accueil-apprendre.ferme { padding-top: 6px; padding-bottom: 6px; }
@media (prefers-reduced-motion: reduce) { .apprendre-fleche svg { transition: none; } }
.accueil-apprendre .apprendre-entete h3 { font-family: var(--font-titre); font-size: 1.2rem; font-weight: 600; line-height: 1.15; text-transform: none; letter-spacing: 0; color: var(--fg); }
.avis-maj { cursor: default; }
#debut-semaine { font: inherit; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
