/* On mange quoi ? — styles (mobile d'abord, thème clair et sombre) */

:root {
  --fond: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #efece4;
  --texte: #1e2421;
  --texte-2: #5d6660;
  --bord: #e3dfd5;
  --primaire: #2f5d50;
  --primaire-texte: #ffffff;
  --primaire-doux: #e1ece7;
  --danger: #b3261e;
  --alerte: #9a5800;
  --alerte-fond: #fff3dd;
  --succes: #2f7a4b;
  --lourd: #c8553d;
  --moyen: #d6992a;
  --leger: #4c9a6a;
  --rayon: 16px;
  --ombre: 0 1px 2px rgba(30, 36, 33, .06), 0 4px 14px rgba(30, 36, 33, .05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #121615;
    --surface: #1b201e;
    --surface-2: #252b29;
    --texte: #eaeeeb;
    --texte-2: #a2aca6;
    --bord: #303735;
    --primaire: #6fb39e;
    --primaire-texte: #0d1412;
    --primaire-doux: #1f322c;
    --danger: #f08a82;
    --alerte: #f2b75f;
    --alerte-fond: #332610;
    --succes: #7fcf9b;
    --lourd: #e07b62;
    --moyen: #e9b54e;
    --leger: #6cbf8b;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.sans-defilement { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 3px solid var(--primaire); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }

.niv-lourd { --niv: var(--lourd); }
.niv-moyen { --niv: var(--moyen); }
.niv-leger { --niv: var(--leger); }

#vue {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

/* ---------- boutons ---------- */

.btn-primaire, .btn-secondaire, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 18px; border-radius: 14px;
  font-weight: 600; border: 0; text-decoration: none;
}
.btn-primaire { background: var(--primaire); color: var(--primaire-texte); }
.btn-secondaire { background: var(--surface-2); color: var(--texte); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid currentColor; }
.btn-primaire.petit { min-height: 40px; padding: 8px 14px; border-radius: 12px; }
.btn-primaire.petit svg { width: 18px; height: 18px; }
.btn-icone {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 12px; background: transparent; color: var(--texte);
}
.btn-icone:active { background: var(--surface-2); }
.bouton-pilule {
  border: 1.5px solid var(--bord); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; font-weight: 500; min-height: 40px;
}
.bouton-pilule.petit { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.bouton-pilule:active { background: var(--surface-2); }

/* ---------- en-têtes ---------- */

.entete-semaine { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.entete-titre { flex: 1; text-align: center; }
.entete-titre h1 { font-size: 22px; }
.entete-titre p { margin: 2px 0 0; color: var(--texte-2); font-size: 14px; }
.lien-retour {
  display: block; margin: -4px auto 12px; border: 0; background: none;
  color: var(--primaire); font-weight: 600; font-size: 14px; padding: 6px;
}
.entete-page { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 14px; }
.entete-page h1 { font-size: 26px; }
.resume { margin: -6px 0 12px; color: var(--texte-2); font-size: 14px; }

/* ---------- bandeau d'installation ---------- */

.banniere-install {
  display: grid; grid-template-columns: 40px 1fr; gap: 10px 12px; align-items: center;
  background: var(--primaire-doux); border-radius: var(--rayon); padding: 12px 14px; margin-bottom: 12px;
}
.banniere-install img { border-radius: 10px; }
.banniere-install p { margin: 0; font-size: 15px; font-weight: 500; }
.banniere-boutons { grid-column: 2; display: flex; align-items: center; gap: 12px; }
.btn-lien { border: 0; background: none; color: var(--primaire); font-weight: 600; padding: 8px 4px; }

/* ---------- compteur et alertes ---------- */

.compteur { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.puce {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--bord); font-size: 14px; font-weight: 600;
}
.puce small { font-weight: 400; color: var(--texte-2); margin-left: -3px; }
.puce i, .tag i, .filtre i, .seg i, .groupe i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--niv, var(--texte-2)); display: inline-block; flex: none;
}
.puce.ko, .puce.ko-doux { background: var(--alerte-fond); border-color: transparent; color: var(--alerte); }
.puce.ko small, .puce.ko-doux small { color: inherit; }

.alertes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.alertes li {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 12px; border-radius: 12px; font-size: 14px;
}
.alertes li svg { width: 18px; height: 18px; margin-top: 1px; }
.alertes .warn { background: var(--alerte-fond); color: var(--alerte); }
.alertes .info { background: var(--surface-2); color: var(--texte-2); }

.btn-generer { width: 100%; margin-bottom: 14px; }

/* ---------- soirs ---------- */

.soirs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.soir {
  display: flex; align-items: stretch;
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre);
  border-left: 6px solid var(--niv, var(--bord));
  overflow: hidden;
}
.soir.neutre { --niv: var(--bord); background: var(--surface-2); box-shadow: none; }
.soir.vide { --niv: transparent; background: transparent; box-shadow: none; border: 1.5px dashed var(--bord); border-left-width: 6px; }
.soir.passe { opacity: .55; }
.soir.ajd { box-shadow: 0 0 0 2px var(--primaire), var(--ombre); }
.soir-principal {
  flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 12px 6px 12px 10px; border: 0; background: none; text-align: left;
}
.soir-jour { width: 46px; flex: none; display: grid; justify-items: center; line-height: 1.1; }
.soir-jour small { text-transform: uppercase; font-size: 12px; letter-spacing: .04em; color: var(--texte-2); font-weight: 600; }
.soir-jour b { font-size: 22px; }
.soir-jour em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--primaire); text-transform: uppercase; margin-top: 2px; }
.soir-corps { display: grid; gap: 4px; min-width: 0; }
.soir-nom { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.soir-nom.muet { font-weight: 400; color: var(--texte-2); font-style: italic; }
.soir-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--texte-2); background: var(--surface-2);
  border-radius: 999px; padding: 2px 8px;
}
.soir.neutre .tag { background: var(--surface); }
.btn-de {
  flex: none; width: 56px; border: 0; background: none; font-size: 22px;
  border-left: 1px solid var(--bord);
}
.soir.vide .btn-de, .soir.neutre .btn-de { border-left-color: transparent; }
.btn-de:active { background: var(--surface-2); }
.btn-de.tourne svg { animation: tourne .55s ease-in-out infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.soir.flash { animation: flash .9s ease-out; }
@keyframes flash { from { background: var(--primaire-doux); } }
.aide-bas { color: var(--texte-2); font-size: 13px; text-align: center; margin: 14px 0 0; }

/* ---------- listes de plats / options ---------- */

.outils-liste { display: grid; gap: 8px; margin-bottom: 8px; }
.champ-recherche, .champ input, .champ select, .ligne-saisie input, .carte-connexion input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1.5px solid var(--bord); border-radius: 12px; background: var(--surface);
}
.filtres { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filtres::-webkit-scrollbar { display: none; }
.filtre {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 1.5px solid var(--bord); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 14px; font-weight: 500; min-height: 36px;
}
.filtre[aria-pressed="true"] { background: var(--texte); color: var(--fond); border-color: var(--texte); }

.groupe {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-2);
  margin: 16px 2px 4px;
}
.groupe span { font-weight: 400; }
.option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 11px 6px; border: 0; border-bottom: 1px solid var(--bord);
  background: none; text-align: left;
}
.option:active { background: var(--surface-2); }
.option.grise .option-texte { opacity: .55; }
.option.courant { background: var(--primaire-doux); border-radius: 10px; }
.option-texte { display: grid; gap: 2px; min-width: 0; }
.option-nom { font-weight: 600; overflow-wrap: anywhere; }
.option-nom em { font-style: normal; font-size: 12px; color: var(--primaire); font-weight: 700; margin-left: 4px; }
.option-meta { font-size: 13.5px; color: var(--texte-2); }
.option-alerte { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--alerte); font-weight: 500; }
.option-alerte svg { width: 15px; height: 15px; }
.pastille { width: 12px; height: 12px; border-radius: 50%; background: var(--niv); flex: none; margin-top: 5px; }
.pastille.vide { background: transparent; border: 2px dashed var(--bord); }
.liste-vide { color: var(--texte-2); text-align: center; padding: 24px 0; }
.liste-plats .option { padding-left: 2px; }

/* ---------- panneau ---------- */

#sheet-racine { position: fixed; inset: 0; z-index: 30; display: none; }
#sheet-racine.ouvert { display: block; }
.sheet-fond { position: absolute; inset: 0; background: rgba(10, 14, 12, .45); animation: fondu .2s ease-out; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 640px; margin: 0 auto; max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--fond); border-radius: 22px 22px 0 0;
  padding: 6px 16px calc(20px + env(safe-area-inset-bottom));
  animation: monte .25s cubic-bezier(.2, .8, .3, 1);
}
@keyframes monte { from { transform: translateY(40%); opacity: .4; } }
@keyframes fondu { from { opacity: 0; } }
.sheet-poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--bord); margin: 4px auto 6px; }
.sheet-entete {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  position: sticky; top: -6px; background: var(--fond); padding: 6px 0 8px; z-index: 1;
}
.sheet-entete h2 { font-size: 20px; }
.sheet-entete small { font-weight: 400; color: var(--texte-2); font-size: 15px; }
.sheet-note, .sheet-texte { color: var(--texte-2); font-size: 14px; margin: 0 0 12px; }
.sheet-chargement { color: var(--texte-2); padding: 24px 0; text-align: center; }
.actions-rapides { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.form-hors-base { display: grid; gap: 8px; margin-bottom: 14px; padding: 12px; background: var(--surface); border-radius: 14px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.ligne-saisie { display: flex; gap: 8px; }
.ligne-saisie .btn-primaire { min-height: 46px; }
.btn-nouveau { width: 100%; margin-top: 14px; }
.sheet > .btn-secondaire { width: 100%; margin-top: 12px; }
.form-plat { margin-top: 14px; padding: 14px; background: var(--surface); border-radius: 16px; }
.sheet > .form-plat { margin-top: 0; }

/* ---------- formulaires ---------- */

.champ { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.champ > span, .champ legend { font-weight: 600; font-size: 14px; padding: 0; }
.champ legend small { font-weight: 400; color: var(--texte-2); }
.champ.ligne { grid-template-columns: 1fr auto; align-items: center; }
.champ.ligne input { width: 84px; text-align: center; }
.champ.ligne select { width: auto; min-width: 140px; }
.segment { display: flex; gap: 6px; }
.jours-rituel { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.jours-rituel .seg span { min-height: 40px; font-size: 13px; padding: 0 2px; }
.champ.ligne > span small { font-weight: 400; color: var(--texte-2); }
.seg { flex: 1; position: relative; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; border-radius: 12px; border: 1.5px solid var(--bord); background: var(--surface);
  font-weight: 600; font-size: 15px;
}
.seg input:checked + span { background: var(--primaire); border-color: var(--primaire); color: var(--primaire-texte); }
.seg[class*="niv-"] input:checked + span {
  background: color-mix(in srgb, var(--niv) 22%, var(--surface)); border-color: var(--niv); color: var(--texte);
}
.seg input:focus-visible + span { outline: 3px solid var(--primaire); outline-offset: 2px; }
.case { display: flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 500; }
.case input { width: 20px; height: 20px; accent-color: var(--primaire); }
.boutons-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.boutons-form .btn-primaire { flex: 1; }

/* ---------- réglages ---------- */

.carte { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px; margin-bottom: 14px; }
.carte h2 { font-size: 17px; margin: 4px 0 12px; }
.carte h2:not(:first-child) { margin-top: 20px; }
.form-reglages .btn-primaire { width: 100%; margin-top: 4px; }
.aide { color: var(--texte-2); font-size: 14px; margin: 0 0 12px; }
.bouton-fichier { width: 100%; }
.code-url {
  display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2);
  font-size: 13px; overflow-wrap: anywhere; user-select: all;
}
.succes { color: var(--succes); font-weight: 600; margin: 12px 0 0; }
.liste-erreurs { color: var(--alerte); font-size: 14px; margin: 8px 0 0; padding-left: 18px; }
.message-erreur { color: var(--danger); font-weight: 500; margin: 8px 0; }
.version { text-align: center; color: var(--texte-2); font-size: 13px; }
.erreur-page { color: var(--danger); text-align: center; margin: 40px 0 16px; }

/* ---------- barre d'onglets ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--bord);
}
.tabbar button {
  flex: 1; max-width: 200px; display: grid; justify-items: center; gap: 2px;
  border: 0; background: none; padding: 6px 0; border-radius: 12px;
  color: var(--texte-2); font-size: 12px; font-weight: 600;
}
.tabbar button[aria-current="page"] { color: var(--primaire); }
.tabbar svg { width: 24px; height: 24px; }

/* ---------- toast ---------- */

#toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px;
  background: var(--texte); color: var(--fond); font-size: 15px; font-weight: 500;
  transition: opacity .2s, transform .2s;
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
#toast.erreur { background: var(--danger); color: #fff; }

/* ---------- connexion ---------- */

.connexion { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.carte-connexion {
  width: 100%; max-width: 380px; display: grid; gap: 12px; justify-items: center; text-align: center;
  background: var(--surface); border-radius: 22px; padding: 28px 22px; box-shadow: var(--ombre);
}
.carte-connexion h1 { font-size: 24px; }
.carte-connexion .aide { margin: 0; }
.carte-connexion .btn-primaire { width: 100%; }

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

/* ---------- images des plats ---------- */

.vignette {
  width: 44px; height: 44px; flex: none; border-radius: 10px; object-fit: cover;
  background: var(--surface-2); box-shadow: 0 0 0 2px var(--niv, var(--bord));
}
.option .vignette { margin-top: 1px; }
.vignette-soir { width: 56px; height: 56px; border-radius: 12px; box-shadow: none; }
.image-plat { margin-bottom: 14px; }
.image-grande {
  display: block; width: 100%; aspect-ratio: 1; max-height: 300px; object-fit: cover;
  border-radius: 16px; background: var(--surface-2);
}
.image-vide {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 120px;
  border-radius: 16px; border: 1.5px dashed var(--bord); color: var(--texte-2); font-size: 14px; text-align: center; padding: 12px;
}
.actions-image { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions-image label { display: inline-flex; align-items: center; cursor: pointer; }
.sablier {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--bord); border-top-color: var(--primaire); animation: tourne .8s linear infinite;
}
.barre { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 12px 0 8px; }
.barre i { display: block; height: 100%; width: 0; background: var(--primaire); transition: width .3s; }
.progression-images .btn-secondaire, .progression-ingredients .btn-secondaire { width: 100%; }
.carte .btn-primaire[data-lot] { width: 100%; }
.message-info { background: var(--surface-2); border-radius: 10px; padding: 9px 12px; font-size: 14px; margin: 0 0 12px; }

/* ---------- actions d'un soir (fiche + dé) ---------- */

.soir-actions { display: flex; flex-direction: column; flex: none; width: 52px; border-left: 1px solid var(--bord); }
.soir-actions button {
  flex: 1; display: grid; place-items: center; min-height: 40px; width: 100%;
  border: 0; background: none; color: var(--texte-2);
}
.soir-actions button + button { border-top: 1px solid var(--bord); }
.soir-actions button:active { background: var(--surface-2); }
.soir-actions .btn-de { border-left: 0; width: 100%; }
.soir-actions svg { width: 20px; height: 20px; }
.soir.vide .soir-actions, .soir.neutre .soir-actions { border-left-color: transparent; }
/* Œil 2x plus grand, à gauche du séparateur. */
.btn-oeil {
  flex: none; display: grid; place-items: center; width: 56px;
  border: 0; background: none; color: var(--texte-2);
}
.btn-oeil svg { width: 30px; height: 30px; stroke-width: 1.8; }
.btn-oeil:active { background: var(--surface-2); }

/* ---------- recette ---------- */

.champ-recette-entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.champ-recette-entete label { font-weight: 600; font-size: 14px; }
.bouton-pilule.petit svg, .detail-plat .boutons-form svg { width: 17px; height: 17px; }
.champ-recette-entete .bouton-pilule { display: inline-flex; align-items: center; gap: 6px; color: var(--texte); }
.champ-recette textarea {
  width: 100%; min-height: 140px; padding: 10px 12px; resize: vertical; line-height: 1.45;
  border: 1.5px solid var(--bord); border-radius: 12px; background: var(--surface); font: inherit; color: inherit;
}

/* ---------- fiche de lecture d'un plat ---------- */

.detail-plat .image-grande { margin-bottom: 12px; }
.sheet-entete .detail-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; margin-left: 6px; }
.sheet-entete .detail-tags .tag { font-weight: 500; }
.detail-infos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 14px;
  background: var(--bord); border-radius: 16px; overflow: hidden;
}
.detail-infos div { background: var(--surface); padding: 8px 12px; min-width: 0; }
.detail-infos dt { color: var(--texte-2); font-size: 12.5px; }
.detail-infos dd { margin: 1px 0 0; font-weight: 500; font-size: 15px; }
.detail-infos dd small { color: var(--texte-2); font-weight: 400; }
.detail-bloc { background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.detail-bloc h3 { font-size: 16px; margin: 0 0 10px; }
.detail-bloc h3 span { font-weight: 400; color: var(--texte-2); font-size: 14px; }
.detail-bloc .aide { margin: 0; }
.puces-ingredients.lecture { margin: 0; }
.puces-ingredients.lecture li { padding: 5px 12px; }
.texte-recette { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.texte-recette a { color: var(--primaire); }
.detail-plat .boutons-form .btn-secondaire { flex: 1; }

/* ---------- ingrédients ---------- */

.ingredients { background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.ingredients-entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ingredients-entete h3 { font-size: 16px; }
.ingredients-entete h3 span { font-weight: 400; color: var(--texte-2); font-size: 14px; }
.ingredients-entete .bouton-pilule { display: inline-flex; align-items: center; gap: 6px; }
.puces-ingredients { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.puces-ingredients li {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px;
  border-radius: 999px; background: var(--surface-2); font-size: 14.5px;
}
.puces-ingredients button {
  width: 28px; height: 28px; border: 0; border-radius: 50%; background: none;
  color: var(--texte-2); font-size: 18px; line-height: 1;
}
.puces-ingredients button:active { background: var(--bord); }
.ajout-ingredient { display: flex; gap: 8px; }
.ajout-ingredient input {
  flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px;
  border: 1.5px solid var(--bord); border-radius: 12px; background: var(--fond);
}
.suggestions-ingredients { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggestions-ingredients:empty { display: none; }
.suggestions-ingredients .nouveau { border-style: dashed; }
.aide.petit { font-size: 12.5px; margin: 10px 0 0; }
.form-basiques textarea {
  width: 100%; padding: 10px 12px; margin-bottom: 12px; resize: vertical;
  border: 1.5px solid var(--bord); border-radius: 12px; background: var(--surface); font: inherit; color: inherit;
}
.form-basiques .btn-primaire { width: 100%; }

/* ---------- courses ---------- */

.btn-large { width: 100%; margin-bottom: 12px; }
.btn-large .sablier { margin-right: 4px; }
.form-extra { display: flex; gap: 8px; margin: 4px 0 6px; }
.form-extra input {
  flex: 1; min-width: 0; min-height: 46px; padding: 10px 14px;
  border: 1.5px solid var(--bord); border-radius: 12px; background: var(--surface);
}
.form-extra .btn-primaire { min-height: 46px; padding: 8px 14px; }
.liste-courses { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); overflow: hidden; }
.article { display: flex; align-items: stretch; border-bottom: 1px solid var(--bord); }
.article:last-child { border-bottom: 0; }
.article-case {
  flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 11px 6px 11px 14px; border: 0; background: none; text-align: left;
}
.article-case:active { background: var(--surface-2); }
.boite {
  width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--bord);
  display: grid; place-items: center;
}
.article.coche .boite { background: var(--primaire); border-color: var(--primaire); }
.article.coche .boite::after {
  content: ''; width: 6px; height: 11px; margin-top: -2px;
  border: solid var(--primaire-texte); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.article-texte { display: grid; gap: 1px; min-width: 0; }
.article-nom { font-weight: 600; overflow-wrap: anywhere; }
.article-meta { font-size: 13px; color: var(--texte-2); overflow-wrap: anywhere; }
.article.coche .article-nom { text-decoration: line-through; color: var(--texte-2); font-weight: 500; }
.article-action { flex: none; width: 48px; border: 0; background: none; color: var(--texte-2); font-size: 20px; }
.article-action:active { background: var(--surface-2); }
.liste-courses.faits { opacity: .75; }
.entete-titre p { text-wrap: balance; }
.tabbar button span { white-space: nowrap; }

/* v1.7 : équilibre par soir */
.niveaux-jours { margin-bottom: 6px; }
.niveaux-jours .champ { margin-bottom: 8px; }
.niveaux-jours select:disabled { opacity: .5; }
.note-abendbrot { font-weight: 400; color: var(--texte-2); }
.alertes-reglages .alertes { margin: 0 0 14px; }

/* v1.8 : articles en plus des recettes */
.form-extra .btn-micro { flex: none; width: 46px; height: 46px; border: 1.5px solid var(--bord); background: var(--surface); }
.form-extra .btn-micro svg { width: 22px; height: 22px; }
.form-extra .btn-micro.ecoute { background: var(--danger); border-color: var(--danger); color: #fff; animation: ecoute 1.2s ease-in-out infinite; }
@keyframes ecoute { 50% { opacity: .55; } }
.suggestions-articles { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.suggestions-articles:empty { display: none; }
.section-courses { font-size: 15px; margin: 22px 0 0; padding-top: 12px; border-top: 1.5px solid var(--bord); }
.section-courses:first-of-type { border-top: 0; padding-top: 0; margin-top: 14px; }
.form-extra { margin-bottom: 10px; }

/* v1.9 : drive Intermarché */
.etapes { margin: 0 0 10px; padding-left: 20px; color: var(--texte-2); font-size: 14px; line-height: 1.5; }
.etapes li { margin-bottom: 4px; }
.etapes a { color: var(--primaire); font-weight: 600; }
.etapes li { margin-bottom: 10px; }
.etapes .btn-etape { display: flex; width: 100%; margin-top: 8px; color: var(--texte); }
.detail-plat .boutons-form button { white-space: nowrap; padding-inline: 14px; }

/* ---------- v1.13 ---------- */

/* Vue semaine compacte : plus de place pour le nom du plat. */
.soir-principal { gap: 10px; padding-left: 8px; }
.soir-jour { width: 38px; }
.soir-jour[data-poignee] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.vignette-soir { width: 44px; height: 44px; border-radius: 10px; }
.soir-nom { font-size: 15px; }
/* « ce soir » sur une seule ligne, centré sous la date (déborde un peu de la colonne si besoin). */
.soir-jour em {
  display: block; width: calc(100% + 10px); margin: 2px -5px 0; text-align: center;
  white-space: nowrap; font-size: 9.5px; letter-spacing: .02em;
}
.btn-oeil { width: 36px; min-width: 0; padding: 0; }
.btn-oeil svg { width: 22px; height: 22px; }
.soir-actions { width: 40px; }
.soir-actions svg { width: 18px; height: 18px; }
/* Appui long sur la date puis glisser : le soir « décolle ». */
.soir.deplace .soir-jour { color: var(--primaire); }
.soir.deplace { position: relative; z-index: 5; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); opacity: .95; transition: none; }
.soir.cible { outline: 2px dashed var(--primaire); outline-offset: 2px; }

/* Icône dans un texte d'aide. */
.icone-texte svg { width: 1.15em; height: 1.15em; vertical-align: -.2em; }

/* Image « Pas de cuisto » en miniature dans Réglages, agrandie au toucher. */
.image-debrouille { display: flex; align-items: center; gap: 14px; margin-bottom: 0; }
.image-debrouille .image-grande { width: 96px; height: 96px; max-height: none; flex: none; border-radius: 14px; cursor: zoom-in; }
.image-debrouille .image-vide { width: 96px; min-height: 96px; flex: none; font-size: 12px; padding: 8px; }
.image-debrouille .actions-image { margin-top: 0; flex-direction: column; align-items: flex-start; }
.zoom-image {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .85);
  display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out;
}
.zoom-image img { max-width: 100%; max-height: 100%; border-radius: 16px; }

/* Courses : « Déjà commandé », replié. */
.deja-commande { margin: 14px 0; }
.deja-commande summary {
  cursor: pointer; font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--texte-2); padding: 6px 2px;
}
.deja-commande summary span { font-weight: 600; margin-left: 4px; }

/* Vue Ingrédients et recherche par ingrédient. */
.compte { font-size: 14px; font-weight: 600; color: var(--texte-2); margin-left: 6px; }
.liste-ingredients { display: grid; gap: 6px; margin-top: 10px; }
.groupe.lettre { margin: 10px 2px 2px; }
.ligne-form { display: flex; gap: 8px; align-items: center; }
.ligne-form input, .ligne-form select { flex: 1; min-width: 0; }
.form-ingredient { margin-top: 14px; }
.option-meta.trouve mark { background: var(--primaire-doux); color: inherit; border-radius: 4px; padding: 0 3px; }
.puce-ingredient { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
/* Photos du frigo (v1.15). */
.frigo-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.frigo-photo { position: relative; }
.frigo-photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.frigo-photo button {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; line-height: 1;
}
.frigo-ajout {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed var(--bord); border-radius: 12px; color: var(--texte-2); text-align: center; cursor: pointer; padding: 6px;
}
.frigo-ajout b { font-size: 26px; font-weight: 400; }
.frigo-ajout span { font-size: 12.5px; }
.frigo .btn-large { width: 100%; margin-top: 8px; }
.frigo .image-attente { min-height: 140px; }
.idee-frigo { background: var(--surface-2); border-radius: 14px; padding: 12px; margin-bottom: 10px; display: grid; gap: 6px; }
.idee-frigo header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.idee-frigo header b { font-size: 16px; margin-right: 2px; }
.idee-frigo .option-meta { margin: 0; }
.idee-frigo .a-acheter { color: var(--alerte); }
.idee-frigo summary { cursor: pointer; font-weight: 600; color: var(--primaire); }
.idee-frigo ol { margin: 6px 0 0; padding-left: 20px; }
.idee-frigo li { margin-bottom: 4px; }
.boutons-idee { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.boutons-idee .btn-secondaire { min-height: 40px; padding: 8px 14px; border-radius: 12px; }

.puces-ingredients .puce-ingredient { width: auto; height: auto; border-radius: 0; font-size: inherit; line-height: inherit; color: var(--texte); }
