:root {
  --fond: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #f1f4f2;
  --texte: #1c2421;
  --texte-2: #5b6661;
  --bord: #dde3df;
  --accent: #0f766e;
  --accent-texte: #ffffff;
  --accent-doux: #e3f3f0;
  --danger: #b42318;
  --ombre: 0 1px 2px rgba(16, 24, 20, .06), 0 2px 8px rgba(16, 24, 20, .05);
  --rayon: 12px;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #121715;
    --surface: #1b2220;
    --surface-2: #232c29;
    --texte: #e7ecea;
    --texte-2: #9aa6a1;
    --bord: #2f3a36;
    --accent: #2dd4bf;
    --accent-texte: #06231f;
    --accent-doux: #173a35;
    --danger: #f97066;
    --ombre: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}

button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* --- En-tête --- */

.entete {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--accent);
  color: var(--accent-texte);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.entete h1 { margin: 0; font-size: 1.15rem; font-weight: 700; flex: 1 1 auto; }

.barre-semaine { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; }
.semaine-titre { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.semaine-titre span { font-size: .85rem; opacity: .85; }
.barre-semaine .btn-icone { color: inherit; background: rgba(255, 255, 255, .15); }
.barre-semaine .puce { background: rgba(255, 255, 255, .9); color: #0f4f49; border: 0; }

@media (min-width: 720px) {
  .barre-semaine { flex: 0 1 460px; }
}

.bandeau {
  background: #fff4d6;
  color: #6b4a00;
  padding: 8px 16px;
  font-size: .9rem;
  text-align: center;
}

/* --- Onglets : barre en bas sur téléphone, en haut sur grand écran --- */

.onglets {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--bord);
  padding-bottom: env(safe-area-inset-bottom);
}
.onglets button {
  height: var(--nav-h);
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: .78rem;
  color: var(--texte-2);
  cursor: pointer;
}
.onglets button span { font-size: 1.3rem; line-height: 1; filter: grayscale(1); opacity: .7; }
.onglets button.actif { color: var(--accent); font-weight: 600; }
.onglets button.actif span { filter: none; opacity: 1; }

main { max-width: 1100px; margin: 0 auto; padding: 16px; }

/* --- Éléments communs --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--bord);
  background: var(--surface);
  cursor: pointer;
  font-weight: 500;
}
.btn.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.petit { min-height: 34px; padding: 4px 12px; font-size: .9rem; }

.btn-icone {
  width: 40px; height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.btn-suppr {
  width: 36px; height: 36px;
  border: 0;
  background: none;
  color: var(--texte-2);
  font-size: 1.3rem;
  border-radius: 8px;
  cursor: pointer;
  flex: none;
}
.btn-suppr:hover { color: var(--danger); background: var(--surface-2); }

.puce {
  border: 1px solid var(--bord);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--surface);
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
}

input[type=text], input[type=search], input[type=password], input[type=url], input:not([type]), select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--bord);
  border-radius: 10px;
  background: var(--surface);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
label.champ { display: block; font-size: .85rem; color: var(--texte-2); margin: 12px 0 4px; }

.carte {
  background: var(--surface);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  border: 1px solid var(--bord);
}

.barre-outils {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.barre-outils .espace { flex: 1; }
.barre-outils h2 { margin: 0; font-size: 1.2rem; }

.vide-msg { color: var(--texte-2); text-align: center; padding: 32px 16px; }
.aide { color: var(--texte-2); font-size: .9rem; margin: 0 0 16px; }

/* --- Planning --- */

.grille-jours { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grille-jours { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grille-jours { grid-template-columns: repeat(4, 1fr); } }

.jour { padding: 12px; }
.jour h3 { margin: 0 0 8px; font-size: 1rem; display: flex; justify-content: space-between; align-items: baseline; }
.jour h3 span { font-weight: 400; color: var(--texte-2); font-size: .85rem; margin-left: 8px; }
.jour.aujourdhui { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.jour.aujourdhui h3::after { content: "aujourd'hui"; font-size: .7rem; font-weight: 600; color: var(--accent); margin-left: auto; padding-left: 8px; }
.jour.aujourdhui h3 span { order: 2; }

.creneau {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 6px;
  cursor: pointer;
  min-height: 52px;
}
.creneau:hover { background: var(--accent-doux); }
.creneau.vide { background: transparent; border: 1px dashed var(--bord); }
.creneau.vide .libre { font-size: .85rem; opacity: .75; }
.creneau .moment { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); width: 34px; flex: none; }
.creneau .contenu { display: flex; flex-direction: column; min-width: 0; }
.creneau .titre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.creneau .titre.note { font-weight: 500; font-style: italic; }
.creneau .meta { font-size: .8rem; color: var(--texte-2); }
.creneau .libre { color: var(--texte-2); }

/* --- Choix d'une recette (modale) --- */

.choix-recettes { max-height: 38vh; overflow-y: auto; margin-top: 8px; border: 1px solid var(--bord); border-radius: 10px; }
.choix-recettes button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--bord);
  background: var(--surface);
  padding: 10px 12px;
  cursor: pointer;
}
.choix-recettes button:last-child { border-bottom: 0; }
.choix-recettes button.choisi { background: var(--accent-doux); font-weight: 600; }
.choix-recettes button.choisi::before { content: "✓ "; color: var(--accent); }

.compteur { display: flex; align-items: center; gap: 12px; }
.compteur output { min-width: 2ch; text-align: center; font-weight: 600; font-size: 1.1rem; }

/* --- Courses --- */

.progression { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: -8px 0 16px; }
.progression div { height: 100%; background: var(--accent); transition: width .2s; }

.form-ajout { display: grid; grid-template-columns: 1fr 110px; gap: 8px; padding: 12px; margin-bottom: 16px; }
.form-ajout .nom { grid-column: 1 / -1; }
.form-ajout .btn { grid-column: 1 / -1; }
.form-ajout.trois select { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .form-ajout { grid-template-columns: 2fr 1fr 1.3fr auto; }
  .form-ajout.trois { grid-template-columns: 2fr 1.3fr auto; }
  .form-ajout .nom, .form-ajout .btn, .form-ajout.trois select { grid-column: auto; }
}

.rayons { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .rayons { grid-template-columns: repeat(2, 1fr); align-items: start; } }
@media (min-width: 1000px) { .rayons { grid-template-columns: repeat(3, 1fr); } }

.rayon { padding: 4px 0; }
.rayon h3 { margin: 0; padding: 10px 14px 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.rayon ul { list-style: none; margin: 0; padding: 0; }

.article { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 4px; border-top: 1px solid var(--bord); }
.article label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px; cursor: pointer; }
.article input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }
.article .nom { display: flex; flex-direction: column; min-width: 0; }
.article .pour { font-size: .75rem; color: var(--texte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article .qte { margin-left: auto; padding-left: 8px; font-weight: 600; white-space: nowrap; font-size: .95rem; }
.article.coche .nom > span:first-child, .article.coche .qte { text-decoration: line-through; color: var(--texte-2); font-weight: 400; }
.etiquette { font-size: .65rem; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--texte-2); margin-left: 6px; vertical-align: middle; }

/* --- Recettes --- */

.liste-recettes { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .liste-recettes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .liste-recettes { grid-template-columns: repeat(3, 1fr); } }
.recette-carte { padding: 14px; text-align: left; cursor: pointer; width: 100%; }
.recette-carte strong { display: block; }
.recette-carte span { font-size: .85rem; color: var(--texte-2); }
.recette-carte .texte-carte { display: block; min-width: 0; font-size: inherit; color: inherit; }
.recette-carte.avec-photo { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; }
.recette-carte img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); opacity: 0; transition: opacity .2s; }
.recette-carte img.chargee { opacity: 1; }

.lignes-ing { display: flex; flex-direction: column; gap: 8px; }
.ligne-ing {
  display: grid;
  grid-template-columns: 64px 92px 1fr 36px;
  grid-template-areas: "nom nom nom suppr" "qte unite rayon rayon";
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--bord);
}
.ligne-ing .i-qte { grid-area: qte; }
.ligne-ing .i-unite { grid-area: unite; padding-left: 6px; }
.ligne-ing .i-nom { grid-area: nom; }
.ligne-ing .i-rayon { grid-area: rayon; font-size: .9rem; color: var(--texte-2); }
.ligne-ing .btn-suppr { grid-area: suppr; align-self: center; }
@media (min-width: 640px) {
  .ligne-ing { grid-template-columns: 72px 96px 1fr 170px 36px; grid-template-areas: "qte unite nom rayon suppr"; border-bottom: 0; padding-bottom: 0; }
}

/* --- Produits habituels / ingrédients --- */

.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--bord); }
.liste-simple li:first-child { border-top: 0; }
.liste-simple .nom-produit { flex: 1; min-width: 0; }
.liste-simple select { width: auto; max-width: 45%; min-height: 36px; font-size: .9rem; }
@media (max-width: 560px) {
  /* Téléphone : nom sur la 1re ligne, quantité et rayon en dessous. */
  .liste-habituels li { flex-wrap: wrap; }
  .liste-habituels .nom-produit { flex: 1 1 calc(100% - 80px); }
  .liste-habituels .qte-base { margin-left: 30px; }
  .liste-habituels select { flex: 1; max-width: none; }
}
.liste-simple .qte-base { width: 7.5em; flex: none; min-height: 36px; font-size: .9rem; padding: 4px 8px; }
.liste-simple input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.liste-simple li.inactif .nom-produit { color: var(--texte-2); }  /* pas dans la liste en ce moment */
.liste-simple .usage { font-size: .75rem; color: var(--texte-2); white-space: nowrap; }

/* --- Modale --- */

dialog {
  border: 0;
  padding: 0;
  border-radius: 16px;
  width: min(640px, calc(100vw - 16px));
  max-height: calc(100dvh - 24px);
  background: var(--surface);
  color: var(--texte);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(10, 20, 16, .5); }
dialog form, dialog .modale-corps { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.modale-tete { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--bord); }
.modale-tete h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.modale-contenu { padding: 4px 16px 16px; overflow-y: auto; }
.modale-pied { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--bord); flex-wrap: wrap; }
.modale-pied .espace { flex: 1; }

/* --- Connexion --- */

.connexion { max-width: 380px; margin: 10vh auto 0; padding: 24px; }
.connexion h2 { margin-top: 0; }
.connexion .btn { width: 100%; margin-top: 16px; }
.erreur { color: var(--danger); font-size: .9rem; min-height: 1.3em; margin: 8px 0 0; }

/* --- Toast --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 20px);
  background: #1c2421;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  max-width: calc(100vw - 32px);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* --- Impression de la liste --- */

@media print {
  body { background: #fff; color: #000; padding: 0; }
  .entete, .onglets, .bandeau, .barre-outils button, .form-ajout, .progression, .btn-suppr, .toast { display: none !important; }
  .carte { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .rayons { grid-template-columns: repeat(2, 1fr); }
  .article.coche { display: none; }
}

/* Les colonnes de grille ne doivent jamais s'élargir au-delà de l'écran. */
.grille-jours > *, .rayons > *, .liste-recettes > * { min-width: 0; }
.grille-jours, .rayons, .liste-recettes { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .grille-jours, .rayons, .liste-recettes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .grille-jours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rayons, .liste-recettes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.modale-pied { flex-wrap: nowrap; gap: 6px; }
.modale-pied .btn { padding: 8px 12px; }

/* Catalogue d'ingrédients : nom puis unité + rayon sur téléphone, une ligne sur grand écran */
.liste-ingredients li { flex-wrap: wrap; row-gap: 6px; }
.liste-ingredients .nom-produit { flex: 1 1 70%; min-width: 0; min-height: 38px; }
.liste-ingredients .btn-suppr, .liste-ingredients .usage { order: 1; }
.liste-ingredients select { order: 2; flex: 1 1 28%; min-width: 0; width: auto; max-width: none; }
.liste-ingredients select[data-champ=rayon] { flex-basis: 44%; }
@media (min-width: 640px) {
  .liste-ingredients li { flex-wrap: nowrap; }
  .liste-ingredients .nom-produit { flex: 1 1 auto; }
  .liste-ingredients select { order: 0; flex: 0 0 auto; }
}
.catalogue-ajout { padding: 0; margin-bottom: 12px; }

/* --- Photo dans le formulaire de recette --- */
.zone-photo img { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; margin-bottom: 8px; object-fit: cover; }
.photo-boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-boutons label.btn { cursor: pointer; }

/* --- Fiche de lecture --- */
.fiche h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin: 18px 0 8px; }
.fiche-photo img { display: block; width: 100%; max-height: 45vh; object-fit: cover; border-radius: 12px; margin-top: 12px; }
.fiche-portions { margin-top: 14px; }
.fiche-ingredients { list-style: none; margin: 0; padding: 0; }
.fiche-ingredients li { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--bord); }
.fiche-ingredients .fiche-qte { min-width: 72px; font-weight: 600; text-align: right; white-space: nowrap; }
.fiche-preparation { white-space: pre-wrap; line-height: 1.65; font-size: 1.02rem; }
.fiche-source { font-size: .9rem; color: var(--texte-2); margin-top: 16px; }
.fiche-source a { color: var(--accent); }
.voir-recette { width: 100%; margin-top: 12px; }

/* --- Import --- */
.import-section + .import-section { border-top: 1px solid var(--bord); margin-top: 16px; }
.import-section h3 { font-size: 1rem; margin: 14px 0 4px; }
.ligne-import { display: flex; gap: 8px; }
.ligne-import input { flex: 1; min-width: 0; }
.etapes-import { padding-left: 20px; margin: 8px 0; }
.etapes-import li { margin-bottom: 6px; }
#im-ia { min-height: 110px; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.voir-prompt { margin-top: 12px; font-size: .9rem; color: var(--texte-2); }
.voir-prompt textarea { min-height: 220px; font-size: .8rem; margin-top: 6px; }

/* La notification est un popover (au-dessus des fenêtres) : on annule le style par défaut du navigateur. */
.toast[popover] { top: auto; right: auto; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  margin: 0; border: 0; overflow: visible; width: max-content; }

/* Repli « article » de l'import par lien */
.repli-article { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-doux); font-size: .92rem; }
.repli-article p { margin: 0 0 6px; }
.repli-article .texte-article { min-height: 140px; font-size: .8rem; margin-top: 8px; }

/* --- Réglages --- */
.entete h1 { order: 1; }
.barre-semaine { order: 3; }
.btn-reglages { order: 2; color: inherit; background: rgba(255, 255, 255, .15); font-size: 1.15rem; width: 36px; height: 36px; }
.reglages h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin: 18px 0 4px; }
.reglages .aide { margin-bottom: 8px; }

/* --- Placard dans la liste de courses --- */
.placard { margin-top: 12px; padding: 4px 0; }
.placard summary { padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--texte-2); list-style-position: inside; }
.placard summary .puce { margin-left: 6px; }
.placard .aide { padding: 0 14px; margin: 0 0 6px; }
.placard ul { list-style: none; margin: 0; padding: 0; }
.btn-placard { font-size: 1rem; opacity: .45; }
.btn-placard:hover, .btn-placard:focus-visible { opacity: 1; }
.liste-ingredients .ing-placard { order: 2; display: flex; align-items: center; gap: 4px; font-size: .95rem; white-space: nowrap; cursor: pointer; }
.liste-ingredients .ing-placard input { width: 20px; height: 20px; accent-color: var(--accent); }

/* --- Mode cuisine --- */
.fiche-etapes { margin: 0; padding-left: 26px; }
.fiche-etapes .etape { padding: 8px 6px; margin-bottom: 4px; border-radius: 8px; line-height: 1.6; cursor: pointer; }
.fiche-etapes .etape:hover { background: var(--surface-2); }
.fiche-etapes .etape.faite { color: var(--texte-2); text-decoration: line-through; opacity: .6; }
.fiche-note { margin: 10px 0; color: var(--texte-2); }
.fiche-astuce { margin: -4px 0 8px; font-size: .85rem; }
.fiche-ecran { font-size: .85rem; color: var(--texte-2); margin-top: 14px; }
.btn-minuteur {
  display: inline-block; border: 1px solid var(--accent); color: var(--accent); background: var(--accent-doux);
  border-radius: 999px; padding: 1px 9px; margin: 0 2px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.etape.faite .btn-minuteur { opacity: .5; }

/* --- Minuteurs (en haut de l'écran, au-dessus de la fenêtre ouverte) --- */
.minuteurs {
  position: fixed; z-index: 50; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; width: min(420px, calc(100vw - 16px));
}
.minuteur {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 12px;
  background: #1c2421; color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.minuteur-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.minuteur strong { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.minuteur .btn-suppr { color: #fff; }
.minuteur.fini { background: var(--danger); animation: clignote 1s steps(2) infinite; }
@keyframes clignote { 50% { opacity: .75; } }
@media print { .minuteurs, .btn-placard, .btn-reglages { display: none !important; } .placard { display: block; } }

/* --- Conversions (⚖) --- */
.btn-conversion { font-size: 1rem; color: var(--accent); }
.liste-ingredients .btn-conversion { order: 1; }
.conversion .lignes-recettes { margin: 4px 0 8px; padding-left: 20px; font-size: .92rem; }
.conversion .lignes-recettes small { color: var(--texte-2); }
.conversion input.propose { border-color: #e8a33d; background: #fff6e6; }
@media (prefers-color-scheme: dark) { .conversion input.propose { background: #3a2c12; } }
.conversion .propose-note { color: #b26b00; margin: 6px 0 0; font-size: .85rem; }
.conversion .contenance { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.conversion .contenance input { width: 110px; }
.conversion .contenance select { width: auto; }
.conversion .apercu { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--accent-doux); }

/* --- Profils --- */
.profil-nom { order: 1; margin-left: -8px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: .85rem; font-weight: 600; }
.liste-profils li { flex-wrap: wrap; }
.liste-profils .nom-produit small { color: var(--texte-2); font-weight: 400; }
.reglages .liste-profils { margin-bottom: 8px; }

/* Filtre « Les miennes » des recettes */

/* --- Plusieurs recettes par repas --- */
.plats-choisis { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.plats-choisis:empty { display: none; }
.plat-choisi { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; background: var(--accent-doux); border: 1px solid var(--accent); border-radius: 10px; }
.plat-choisi .plat-nom { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.plat-choisi .compteur { gap: 4px; flex: none; }
.plat-choisi .btn-suppr { width: 28px; height: 28px; font-size: 1.1rem; flex: none; }
.creneau .contenu .titre small { font-weight: 400; color: var(--texte-2); }
#cr-tous[hidden] { display: none; }
.creneau .contenu .titre + .titre { margin-top: 2px; }
.voir-recette + .voir-recette { margin-top: 6px; }

/* Liste de courses : repas pris en compte, déjà acheté */
.repas-liste { padding: 10px 12px; margin-bottom: 16px; }
.repas-liste summary { cursor: pointer; font-weight: 600; }
.repas-liste ul { list-style: none; margin: 8px 0 0; padding: 0; }
.repas-liste li label { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-top: 1px solid var(--bord); cursor: pointer; }
.repas-liste li input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; align-self: center; }
.repas-liste .quand { font-size: .8rem; color: var(--texte-2); white-space: nowrap; width: 8.5em; flex: none; }
.repas-liste .plats { min-width: 0; }
.repas-liste .fait { color: var(--accent); font-weight: 700; }
.repas-liste li.inactif .plats { color: var(--texte-2); }
.etiquette.reste { background: var(--accent-doux); }
.case-liste { display: flex; align-items: center; gap: 8px; margin-top: 14px; cursor: pointer; }
.case-liste input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
@media print { .repas-liste, .deja-achete, .intro-courses { display: none !important; } }

/* Filtre « Toutes les recettes / Mes recettes » */
.filtre-auteur { display: flex; margin: 0 0 10px; border: 1px solid var(--accent); border-radius: 999px; overflow: hidden; width: fit-content; max-width: 100%; }
.filtre-auteur button { border: 0; background: transparent; color: var(--accent); padding: 7px 14px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; min-height: 36px; }
.filtre-auteur button.actif { background: var(--accent); color: var(--accent-texte); }
.fiche-autre { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Filtre par personne, catégories */
.filtre-personne { width: auto; max-width: 100%; min-height: 36px; margin: 0 0 12px; }
.titre-section-recettes { margin: 18px 0 8px; font-size: 1rem; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.titre-section-recettes:first-of-type { margin-top: 4px; }
.choix-recettes .titre-categorie { flex-basis: 100%; width: 100%; margin: 0; padding: 10px 12px 2px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); }
