/* Design « Chez les Mim's » (v31) — choisi sur maquettes le 01/10/2026 :
   papier, titres en serif, ornements centrés, accent terracotta.
   Le thème sombre reprend la direction « Ardoise » (fond ardoise, cuivre). */
:root {
  --pap: #f7f1e8; --carte: #fffaf3; --champ: #fffdf9;
  --ink: #2b211b; --mut: #7d6b5a; --soft: #8a7867; --ln: #e4d7c5; --btn: #dccab5; --btn-ac: #d9b99a;
  --ac: #a8541d; --ac-ink: #ffffff; --or: #d39a3a; --or-vide: #dccab5; --danger: #b4432a;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --barre: 64px;
}
/* Thème sombre — Réglages › Apparence (v32) : « Sombre » pose data-theme="sombre" sur <html>,
   « Clair » pose data-theme="clair », « Auto » n'en pose aucun et suit le téléphone.
   Les deux blocs portent les MÊMES valeurs : en changer une, c'est changer l'autre. */
:root[data-theme="sombre"] {
  --pap: #1c1b18; --carte: #24221e; --champ: #24221e;
  --ink: #eee5d3; --mut: #a69c8b; --soft: #9a9080; --ln: #34312b; --btn: #45413a; --btn-ac: #6b5a40;
  --ac: #d6a35c; --ac-ink: #1c1b18; --or: #d6a35c; --or-vide: #45413a; --danger: #e07a5f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --pap: #1c1b18; --carte: #24221e; --champ: #24221e;
    --ink: #eee5d3; --mut: #a69c8b; --soft: #9a9080; --ln: #34312b; --btn: #45413a; --btn-ac: #6b5a40;
    --ac: #d6a35c; --ac-ink: #1c1b18; --or: #d6a35c; --or-vide: #45413a; --danger: #e07a5f;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* overflow-x « clip » et non « hidden » sur body : « hidden » fait de body une zone de
   défilement qui ne défile jamais, et la barre « Copier la liste » ne restait plus collée en bas */
html { max-width: 100%; overflow-x: hidden; }
body { max-width: 100%; overflow-x: clip; }
body {
  font-family: var(--sans); background: var(--pap); color: var(--ink); line-height: 1.45;
  padding-bottom: calc(var(--barre) + 12px + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; }
/* un clic sur le picto ou le texte d'un bouton doit compter comme un clic sur le bouton :
   le gestionnaire de clics d'app.js lit e.target directement */
button * { pointer-events: none; }
a { color: var(--ac); }

/* bandeau du haut : seulement l'état du partage, invisible quand il n'y a rien à dire */
.haut { display: flex; justify-content: flex-end; padding: env(safe-area-inset-top) 16px 0; }
.sync-etat { font-size: .7rem; font-weight: 600; color: var(--soft); margin-top: 6px; }
.sync-etat:empty { display: none; }
.sync-etat.erreur { color: var(--danger); }

main { max-width: 560px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

/* ---------- en-tête de chaque onglet ---------- */
.vue-tete { text-align: center; padding: 16px 24px 8px; }
.orn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: .66rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--ac);
}
.orn i { display: block; width: 28px; height: 1px; background: currentColor; opacity: .6; flex: none; }
.titre { font-family: var(--serif); font-style: italic; font-size: 1.75rem; line-height: 1.15; margin-top: 4px; }
.week-head, .sous { font-size: .75rem; color: var(--soft); margin-top: 3px; }
.week-head strong { font-weight: 600; }
.hint {
  font-family: var(--serif); font-style: italic; font-size: .8rem; line-height: 1.45;
  color: var(--mut); text-align: center; padding: 0 28px 8px;
}
/* « p.empty » et non « .empty » : les étoiles vides de la note portent aussi la classe « empty »
   (app.js, etoiles) et prenaient ces marges, ce qui décalait la dernière étoile */
p.empty { font-family: var(--serif); font-style: italic; text-align: center; color: var(--mut); font-size: .9rem; padding: 30px 24px; }
.cat-title { margin: 14px 22px 4px; font-weight: 600; }
.orn-sec { margin: 14px 0 2px; }
.pied { display: flex; justify-content: center; padding: 14px 0 6px; }
.pill {
  font-size: .82rem; font-weight: 600; border-radius: 999px; padding: 10px 18px;
  color: var(--ac); border: 1px solid var(--btn-ac); background: transparent; cursor: pointer;
}
.linkbtn { display: block; width: 100%; padding: 10px; border: none; background: none; color: var(--soft); font-size: .82rem; cursor: pointer; text-decoration: underline; }
.linkbtn.danger { color: var(--danger); }

/* ---------- Semaine : « ce soir » ---------- */
.ce-soir {
  margin: 6px 0 4px; padding: 14px 20px; text-align: center;
  background: var(--carte); border-top: 1px solid var(--ac); border-bottom: 1px solid var(--ac);
}
.kk { font-size: .66rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ac); }
.ce-soir .nm { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; line-height: 1.2; margin-top: 4px; overflow-wrap: anywhere; }
.ce-soir.vide .nm { color: var(--soft); }
.duree { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 8px; margin-top: 4px; }
.duree b { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.15; color: var(--ac); }
.duree span { font-size: .75rem; color: var(--mut); }
.avec { font-family: var(--serif); font-style: italic; font-size: .95rem; margin-top: 2px; }
.avec a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.btn-side {
  margin-left: 6px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--btn);
  background: var(--champ); color: var(--ac); font-size: .8rem; line-height: 1; cursor: pointer; vertical-align: 1px;
}
.plus { font-size: .8rem; color: var(--mut); margin-top: 2px; }
/* v33 : accompagnement à prendre, prix et calories */
.avec-choix { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.pris {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--btn-ac); border-radius: 999px;
  background: var(--champ); color: var(--ac); padding: 6px 12px; font-size: .78rem; font-weight: 600; cursor: pointer;
}
.pris.on { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); }
.remplace-info { font-family: var(--serif); font-style: italic; font-size: .75rem; color: var(--mut); }
.eco { font-size: .8rem; color: var(--mut); margin-top: 4px; }
/* v34 : résumé budget / calories en tête de la Semaine — deux colonnes séparées d'un filet */
.bilan { display: flex; justify-content: center; margin: 2px 20px 10px; }
.bilan .bc { flex: 1 1 0; min-width: 0; text-align: center; padding: 0 8px; font-size: .82rem; line-height: 1.35; }
.bilan .bc + .bc { border-left: 1px solid var(--ln); }
.bilan .bk { display: block; font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); margin-bottom: 2px; }
.bilan b { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.bilan .niv { white-space: nowrap; margin: 0 4px; }
.bilan .nd { display: block; font-family: var(--serif); font-style: italic; font-size: .72rem; color: var(--mut); }
/* échelle à 3 € : les atteints en plein, les autres pâles */
/* v45 : ce qui est en promo cette semaine (plat ou accompagnement proposé) */
.tag-promo {
  display: inline-block; font-family: var(--sans); font-style: normal; font-size: .62rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ac-ink); background: var(--ac);
  border-radius: 999px; padding: 1px 7px; vertical-align: 1px;
}
.promo-info { font-size: .8rem; color: var(--mut); margin-top: 6px; }
/* v46 : version du repas avec l'accompagnement, et « Je l'ai fait » de l'onglet Recettes */
.detail.alt { margin-top: 14px; padding-top: 6px; border-top: 1px solid var(--ln); }
.detail.alt .pris { margin-top: 12px; }
.ing-list em.aussi { font-size: .72rem; color: var(--soft); white-space: nowrap; }
.fait-le { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--ln); }
.fait-le .add-row { margin: 6px 0 0; }
.fait-le .add-row input { flex: 1; min-width: 0; }
/* v48 : ingrédient retiré d'une recette, accompagnement inclus, morceau du boucher, autres accompagnements */
.ing-list li.retire .in s, .ing-list li.retire .iq { opacity: .5; }
.ing-list li.retire em { font-size: .72rem; color: var(--soft); }
button.remettre { margin-left: auto; flex-shrink: 0; border: 1px solid var(--btn); border-radius: 999px; background: var(--champ);
  color: var(--ac); font-size: .72rem; font-weight: 600; padding: 3px 10px; cursor: pointer; }
.ing-list li.acc-titre { font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); padding-top: 12px; }
.boucher { font-size: .8rem; color: var(--mut); margin-top: 6px; }
.boucher strong { color: var(--ink); font-weight: 600; }
.boucher-c { grid-column: 2; min-width: 0; font-family: var(--serif); font-style: italic; font-size: .76rem; color: var(--ac); }
.autres-acc { margin-top: 6px; }
.autres-acc > summary { list-style: none; cursor: pointer; font-size: .78rem; color: var(--ac); }
.autres-acc > summary::-webkit-details-marker { display: none; }
.autres-acc .chips { justify-content: center; margin-top: 6px; }
.promos-semaine { margin: 8px 0 0; padding-left: 18px; font-size: .8rem; color: var(--mut); line-height: 1.45; }
.prix { font-family: var(--sans); font-style: normal; font-weight: 700; letter-spacing: .03em; color: var(--ac); white-space: nowrap; }
.prix i { font-style: normal; opacity: .3; }
.ing-list li.remplace s { opacity: .55; }
.ing-list li.remplace em { color: var(--ac); font-size: .8rem; }
.bt {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 12px; margin-top: 12px;
  border-radius: 12px; background: var(--ac); color: var(--ac-ink); font-weight: 700; font-size: .9rem; text-decoration: none;
}
.actions { display: flex; gap: 8px; margin-top: 8px; }
.actions button {
  flex: 1; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px;
  border: 1px solid var(--btn); border-radius: 12px; background: var(--champ);
  font-size: .85rem; font-weight: 600; cursor: pointer;
}
.actions button:active { border-color: var(--ac); }
.actions .fait.done { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); }
.fav { display: flex; align-items: center; justify-content: center; color: var(--ac); cursor: pointer; }
.actions .fav { flex: none; width: 46px; padding: 0; }
.epingle-info {
  margin: 8px 0 2px; padding: 8px 10px; text-align: left;
  border-left: 3px solid var(--ac); background: var(--champ); border-radius: 4px; font-size: .8rem; line-height: 1.4;
}
.epingle-info .linkbtn { padding: 6px 0 0; text-align: left; }
.constraint { font-family: var(--serif); font-style: italic; color: var(--mut); font-size: .82rem; margin-top: 6px; }

/* dépliant « Ingrédients, étapes & source » */
.detail { margin-top: 10px; text-align: left; }
.detail > summary {
  list-style: none; cursor: pointer; text-align: center; padding: 4px 0;
  font-size: .8rem; font-weight: 600; color: var(--ac);
}
.detail > summary::-webkit-details-marker { display: none; }
.detail > summary::before { content: "▸ "; }
.detail[open] > summary::before { content: "▾ "; }
.det-body { padding-top: 4px; }
.det-t { font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); margin: 12px 0 4px; }
.ing-list { list-style: none; }
.ing-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--ln); font-size: .88rem; min-width: 0; }
.iq { color: var(--ac); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.ing-list li > :not(.iq):not(.x) { min-width: 0; overflow-wrap: anywhere; }
button.x {
  margin-left: auto; width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid var(--btn); background: var(--champ); color: var(--soft); font-size: .7rem; cursor: pointer;
}
button.x:active { background: var(--danger); border-color: var(--danger); color: #fff; }
.step-list { padding-left: 20px; font-size: .88rem; }
.step-list li { margin-bottom: 7px; }
.src { display: inline-block; margin-top: 10px; font-size: .82rem; font-weight: 600; overflow-wrap: anywhere; }
.style-jour { font-size: .75rem; color: var(--soft); font-style: italic; margin-top: 10px; }

/* note en demi-étoiles */
.note-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: .78rem; color: var(--mut); margin: 6px 0 2px; }
.stars { display: inline-flex; align-items: center; }
.star { position: relative; display: inline-block; width: 1.05em; color: var(--or-vide); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.star.full { color: var(--or); }
.star.half {
  background: linear-gradient(90deg, var(--or) 50%, var(--or-vide) 50%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hz { position: absolute; top: 0; bottom: 0; width: 50%; }
.hz.l { left: 0; } .hz.r { right: 0; }
.note-val { font-size: .75rem; color: var(--mut); }
.note-vide { font-family: var(--serif); font-style: italic; }
.btn-clr {
  padding: 3px 9px; border: 1px solid var(--btn); border-radius: 999px; background: transparent;
  color: var(--soft); font-size: .7rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}

/* ---------- Semaine : la suite, en lignes de menu ---------- */
.menu { padding: 0 22px; }
.jour-ligne { border-top: 1px solid var(--ln); }
.jour-ligne > summary { list-style: none; cursor: pointer; text-align: center; padding: 8px 0; }
.jour-ligne > summary::-webkit-details-marker { display: none; }
.dy { font-size: .62rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ac); }
.jour-ligne .n { font-family: var(--serif); font-size: 1.03rem; line-height: 1.25; margin-top: 1px; overflow-wrap: anywhere; }
.jour-ligne.vide .n { color: var(--soft); }
.jour-ligne .l2 { font-family: var(--serif); font-style: italic; font-size: .8rem; color: var(--mut); }
.jour-ligne[open] > summary .n { font-weight: 600; }
.fiche-int { text-align: center; padding: 0 0 14px; }
.passes { margin-top: 2px; }
.passes > summary {
  list-style: none; cursor: pointer; text-align: center; margin: 0 22px; padding: 10px 0 4px;
  border-top: 1px dashed var(--btn); font-size: .75rem; color: var(--soft);
}
.passes > summary::-webkit-details-marker { display: none; }
.passes > summary::after { content: " ›"; }
.passes[open] > summary::after { content: " ⌄"; }
.passes .jour-ligne > summary { opacity: .6; }

/* ---------- Courses ---------- */
.shop-row {
  display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; align-items: center;
  min-height: 46px; padding: 7px 20px; border-bottom: 1px solid var(--ln); cursor: pointer;
}
.shop-row input {
  grid-row: 1 / span 2; appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer;
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--btn-ac); background: var(--champ);
}
.shop-row input:checked {
  border-color: var(--ac);
  background: var(--ac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
:root[data-theme="sombre"] .shop-row input:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1b18' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) .shop-row input:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1b18' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  }
}
/* v33 : choix des jours à acheter, en tête de la liste de courses */
/* les 8 choix tiennent sur UNE ligne, même sur un téléphone de 360 px */
.jours-filtre { display: flex; justify-content: center; gap: 4px; padding: 4px 12px 10px; }
.jours-filtre button {
  flex: 1 1 0; min-width: 0; max-width: 52px; height: 32px; padding: 0 2px; border-radius: 999px; border: 1px solid var(--btn-ac);
  background: none; color: var(--soft); font-size: .74rem; font-weight: 600; cursor: pointer;
}
.jours-filtre button[aria-pressed="true"] { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); }
/* v36 : 2e rangée = jours de la semaine prochaine, en pointillés pour la distinguer */
.jours-filtre.s1 { padding-top: 0; }
.jours-filtre.s1 button { border-style: dashed; }
.jours-filtre.s1 button:first-child { font-weight: 700; }
.s1-vide { padding-top: 0; }
.s1-vide .lien { color: var(--ac); font-size: .8rem; }
/* v36 : « Cette semaine / Semaine prochaine » en tête de l'onglet Semaine */
.sem-choix { display: flex; justify-content: center; margin: 2px 20px 10px; }
.sem-choix button {
  flex: 1 1 0; max-width: 170px; height: 34px; border: 1px solid var(--btn-ac); background: none;
  color: var(--soft); font-size: .8rem; font-weight: 600; cursor: pointer;
}
.sem-choix button:first-child { border-radius: 999px 0 0 999px; }
.sem-choix button:last-child { border-radius: 0 999px 999px 0; border-left: none; }
.sem-choix button[aria-pressed="true"] { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); }
.sn { font-family: var(--serif); font-size: .97rem; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.sp {
  grid-column: 2; min-width: 0; font-family: var(--serif); font-style: italic; font-size: .72rem; color: var(--mut);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shop-row.checked .sn { text-decoration: line-through; opacity: .5; }
.shop-row.checked .sp { opacity: .5; }
.shop-row.optionnel .sn { font-style: italic; }
/* « Copier » et « Tout décocher » restent collés au-dessus de la barre d'onglets */
.barre-bas {
  position: sticky; bottom: calc(var(--barre) + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 10px 16px;
  background: var(--pap); border-top: 1px solid var(--ln);
}
.barre-bas .cp {
  flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; background: var(--ac); color: var(--ac-ink); font-weight: 700; font-size: .9rem; cursor: pointer;
}
.lien { border: none; background: none; color: var(--soft); font-size: .8rem; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- Recettes ---------- */
.recherche {
  display: flex; align-items: center; gap: 8px; height: 44px; margin: 6px 20px 8px; padding: 0 14px;
  border: 1px solid var(--btn); border-radius: 999px; background: var(--champ); color: var(--soft);
}
.recherche input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font: inherit; font-size: .9rem; color: var(--ink);
}
.recipe { display: flex; align-items: flex-start; gap: 4px; padding: 0 8px 0 20px; border-bottom: 1px solid var(--ln); }
.recipe details { flex: 1; min-width: 0; }
.recipe summary { list-style: none; cursor: pointer; padding: 8px 0; }
.recipe summary::-webkit-details-marker { display: none; }
.recipe .n { display: block; font-family: var(--serif); font-size: .97rem; line-height: 1.25; overflow-wrap: anywhere; }
.recipe .m { display: block; font-family: var(--serif); font-style: italic; font-size: .75rem; color: var(--mut); }
.recipe details[open] .n { font-weight: 600; }
.recipe .det-body { padding: 0 0 12px; }
.recipe .fav { flex: none; width: 40px; height: 44px; border: none; background: none; }
.recipe.excluded { opacity: .45; }
.tag {
  display: inline-block; margin-left: 6px; padding: 2px 4px; vertical-align: 2px;
  font: 700 .55rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--ac); border-radius: 3px; color: var(--ac);
}

/* ---------- Historique ---------- */
.card.hist { display: flex; align-items: flex-start; gap: 14px; padding: 10px 8px 10px 20px; border-bottom: 1px solid var(--ln); }
.hist .dd { width: 38px; flex: none; text-align: center; padding-top: 2px; }
.hist .dd small { display: block; font-size: .62rem; font-weight: 700; letter-spacing: .14em; color: var(--soft); }
.hist .dd span { display: block; font-family: var(--serif); font-size: 1.4rem; line-height: 1.1; }
.hist .tx { flex: 1; min-width: 0; }
.hist .n { font-family: var(--serif); font-size: .97rem; line-height: 1.25; overflow-wrap: anywhere; }
.hist .note-row { margin: 2px 0 0; }
.liens { display: flex; align-items: center; gap: 16px; margin-top: 2px; }
.liens a { font-size: .75rem; font-weight: 600; text-decoration: none; }
.liens button { border: none; background: none; padding: 0; font-size: .75rem; font-weight: 600; color: var(--soft); cursor: pointer; }
.hist .fav { flex: none; width: 40px; height: 40px; border: none; background: none; }

/* ---------- Réglages : sommaire ---------- */
.sommaire { border-top: 1px solid var(--ln); margin-top: 6px; }
.so {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 8px 20px;
  border: none; border-bottom: 1px solid var(--ln); background: none; text-align: left; cursor: pointer;
}
.so .tx { flex: 1; min-width: 0; }
.so .n { display: block; font-family: var(--serif); font-size: 1rem; line-height: 1.25; }
.so .m { display: block; font-family: var(--serif); font-style: italic; font-size: .75rem; line-height: 1.35; color: var(--mut); overflow-wrap: anywhere; }
.so .cv { flex: none; color: var(--soft); font-size: 1.1rem; }
.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; cursor: pointer;
  width: 44px; height: 26px; border-radius: 999px; background: var(--btn); transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch:checked { background: var(--ac); }
.switch:checked::after { transform: translateX(18px); }
/* Apparence : trois choix côte à côte (Auto / Clair / Sombre) directement sur le sommaire */
.so.choix { cursor: default; }
.seg { display: inline-flex; flex: none; border: 1px solid var(--btn-ac); border-radius: 999px; overflow: hidden; }
.seg button {
  border: none; background: none; padding: 7px 11px; font-size: .78rem; font-weight: 600;
  color: var(--soft); cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--btn-ac); }
.seg button[aria-pressed="true"] { background: var(--ac); color: var(--ac-ink); }

/* ---------- Réglages : une section ouverte ---------- */
.retour { border: none; background: none; color: var(--ac); font-size: .85rem; font-weight: 600; padding: 14px 20px 0; cursor: pointer; }
.sec-titre { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.5rem; line-height: 1.2; margin-top: 4px; }
.sec { padding: 4px 20px 20px; }
.sec .hint { padding: 0 6px 10px; }
.jours-editor { display: flex; flex-direction: column; border-top: 1px solid var(--ln); margin-bottom: 14px; }
.jour-row { display: flex; align-items: center; gap: 14px; min-height: 48px; border-bottom: 1px solid var(--ln); }
.jour-row .jour { width: 36px; flex: none; font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ac); }
.jour-row select {
  flex: 1; min-width: 0; padding: 10px 0; border: none; background: transparent; cursor: pointer;
  font-family: var(--serif); font-size: 1rem; color: var(--ink);
}
.preset-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.preset-mini {
  padding: 6px 12px; border: 1px solid var(--btn-ac); border-radius: 999px; background: transparent;
  color: var(--ac); font-size: .8rem; font-weight: 600; cursor: pointer;
}
.add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.add-row input, .add-row select {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  border: 1px solid var(--btn); border-radius: 12px; background: var(--champ); font: inherit; font-size: .9rem; color: var(--ink);
}
.add-row button { height: 44px; padding: 0 16px; border: none; border-radius: 12px; background: var(--ac); color: var(--ac-ink); font-weight: 700; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px;
  border: 1px solid var(--btn); border-radius: 999px; background: var(--champ);
  font-family: var(--serif); font-size: .85rem;
}
.chip.promo, .chip.fav-chip { border-color: var(--btn-ac); }
.chip button { width: 20px; height: 20px; border: none; border-radius: 50%; background: var(--ln); color: inherit; font-size: .65rem; cursor: pointer; }
/* v38 : liste des envies, avec le suivi du guetteur du PC sous chaque plat */
.envies-liste { border-top: 1px solid var(--ln); margin: 4px 0 10px; }
.envie-l { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--ln); }
.el-t { min-width: 0; overflow-wrap: anywhere; }
.el-n { font-family: var(--serif); font-size: .95rem; }
.el-t em { font-size: .72rem; color: var(--soft); }
.el-s { grid-column: 1 / -1; font-family: var(--serif); font-style: italic; font-size: .78rem; line-height: 1.35; color: var(--mut); }
.el-s.ok { color: var(--ac); }
.el-s.encours { color: var(--ink); }
.el-s .lien { font-style: normal; color: var(--ac); padding: 0; }
.suivi-pc { text-align: left; padding: 6px 0 2px; }
/* v36 : propositions de plats sous le champ des envies — la puce entière se touche */
button.chip.prop { padding: 6px 12px; color: var(--ink); cursor: pointer; text-align: left; }
button.chip.prop em { font-family: var(--sans); font-style: normal; font-size: .68rem; color: var(--soft); }
.sec .actions { margin-bottom: 8px; }

/* ---------- barre d'onglets ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex;
  height: calc(var(--barre) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
  background: var(--pap); border-top: 1px solid var(--ln);
}
.tab {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: none; background: none; color: var(--soft); cursor: pointer; font-size: .66rem; font-weight: 600;
}
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.active { color: var(--ac); }

/* toast — durée de vie portée par l'animation, pas par un minuteur JS */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--barre) + 22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--pap); padding: 11px 16px; border-radius: 10px;
  font-size: .85rem; font-weight: 600; max-width: 88vw; text-align: center;
  z-index: 40; opacity: 0; pointer-events: none;
}
#toast.on { animation: toastlife 2.4s ease forwards; }
@keyframes toastlife {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  12% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 6px); }
}
