/* À notre table — « la nappe du dimanche » */

:root {
  color-scheme: light;

  --creme: #FBF5EA;
  --carte: #FFFDF8;
  --blanc: #FFFFFF;
  --texte: #3B2A20;
  --texte-doux: #6B5444;
  --bord: #E8DCC8;
  --bord-fort: #A88B6A;

  --terracotta: #B5532A;
  --terracotta-fonce: #8E3E1C;
  --terracotta-pale: #F7E6DA;
  --repas-fond: #FFF6EC;

  --sauge: #5E7148;
  --sauge-fonce: #4A5B37;
  --sauge-pale: #E7EDDC;

  --moutarde: #E3A93B;
  --moutarde-fonce: #6A4A12;
  --moutarde-pale: #FBEFD3;

  --vichy: rgba(201, 70, 61, .42);
  --rouge: #A3261B;
  --rouge-pale: #FFF2EF;

  --bulle: #E3F1D3;
  --bulle-bord: #C7DDB0;

  --ombre: 0 1px 2px rgba(59, 42, 32, .06), 0 6px 18px rgba(59, 42, 32, .08);
  --ombre-forte: 0 2px 4px rgba(59, 42, 32, .08), 0 14px 34px rgba(59, 42, 32, .16);

  --police: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --police-titre: "Fraunces", Georgia, "Times New Roman", serif;

  --nav-h: 78px;
  --envoi-h: 84px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --rayon: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--police);
  font-size: 1.1875rem; /* 19 px */
  line-height: 1.5;
  color: var(--texte);
  background-color: var(--creme);
  /* motif discret : petits points comme une toile de lin */
  background-image: radial-gradient(rgba(181, 83, 42, .06) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}
body.avec-envoi { padding-bottom: calc(var(--nav-h) + var(--envoi-h) + var(--safe-b) + 24px); }
body.mode-partage { padding-bottom: calc(var(--safe-b) + 32px); }

h1, h2, h3 { font-family: var(--police-titre); font-weight: 700; line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: var(--terracotta-fonce); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1:focus, h2:focus, main:focus { outline: none; }

.emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-weight: 400; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Focus bien visible */
:focus-visible {
  outline: 3px solid var(--texte);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(227, 169, 59, .6);
}

.lien-evitement {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--texte); color: var(--blanc); padding: 12px 16px; border-radius: 12px;
}
.lien-evitement:focus { top: 12px; }

/* ---------- Liseré vichy + en-tête ---------- */

.vichy {
  position: relative;
  height: calc(16px + env(safe-area-inset-top, 0px));
  background-color: var(--blanc);
  background-image:
    repeating-linear-gradient(90deg, var(--vichy) 0 8px, transparent 8px 16px),
    repeating-linear-gradient(0deg, var(--vichy) 0 8px, transparent 8px 16px);
}
/* petit bord festonné comme une nappe */
.vichy::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -7px; height: 7px;
  background: radial-gradient(circle at 8px 0, var(--blanc) 6.5px, transparent 7px) repeat-x;
  background-size: 16px 7px;
}

.entete {
  text-align: center;
  padding: 18px 16px 4px;
}
.marque {
  font-family: var(--police-titre);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--terracotta-fonce);
  letter-spacing: .01em;
}
.marque-sous { color: var(--texte-doux); font-size: 1.125rem; font-style: italic; }
body.mode-partage .marque-sous { display: none; }

.bandeau {
  max-width: 608px;
  margin: 12px auto 0;
  margin-inline: max(16px, calc((100% - 608px) / 2));
  padding: 12px 16px;
  border: 2px solid var(--moutarde);
  background: var(--moutarde-pale);
  border-radius: 14px;
  font-size: 1.125rem;
}

main {
  display: block;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

.vue { padding-top: 8px; animation: apparaitre .25s ease-out; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-height: 52px;
  padding: .65em 1.1em;
  border: 2px solid transparent;
  border-radius: 14px;
  font-family: var(--police);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-bloc { display: flex; width: 100%; }
.btn-xl { min-height: 60px; font-size: 1.25rem; }

.btn-principal {
  background: var(--terracotta);
  color: var(--blanc);
  box-shadow: 0 3px 0 var(--terracotta-fonce);
}
.btn-principal:hover { background: #A2481F; }
.btn-principal:active { box-shadow: 0 1px 0 var(--terracotta-fonce); transform: translateY(2px); }

.btn-secondaire {
  background: var(--carte);
  color: var(--terracotta-fonce);
  border-color: var(--terracotta);
}
.btn-secondaire:hover { background: var(--terracotta-pale); }

.btn-lien {
  background: transparent;
  color: var(--texte-doux);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-lien:hover { color: var(--texte); }

/* ---------- Ma semaine : en-tête ---------- */

.semaine-tete { text-align: center; padding: 8px 0 4px; }
.semaine-relatif { font-size: 2.125rem; color: var(--texte); }
.semaine-dates { color: var(--texte-doux); font-size: 1.1875rem; margin-top: 2px; }
.semaine-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.btn-nav {
  background: var(--carte);
  color: var(--texte);
  border-color: var(--bord);
  box-shadow: var(--ombre);
  padding-inline: .6em;
}
.btn-nav:hover { border-color: var(--bord-fort); }
.btn-nav.petit { min-height: 52px; font-size: 1.125rem; }
.btn-retour-semaine {
  margin-top: 10px;
  background: var(--moutarde-pale);
  color: var(--moutarde-fonce);
  border-color: var(--moutarde);
  width: 100%;
}

.indicateur {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 4px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--sauge-pale);
  color: var(--sauge-fonce);
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
}
.indicateur.pulse { animation: pulse .9s ease-out; }

/* ---------- Cartes ---------- */

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

.accueil {
  margin: 14px 0;
  padding: 18px;
  background: var(--moutarde-pale);
  border: 2px dashed var(--moutarde);
}
.accueil p { margin-top: 8px; }
.accueil-titre { font-size: 1.5rem; }
.accueil .btn { margin-top: 14px; }

.encart-vide, .encart-erreur {
  margin: 14px 0;
  padding: 20px 18px;
  text-align: center;
}
.encart-vide p + p, .encart-erreur p + p { margin-top: 6px; }
.encart-vide .btn, .encart-erreur .btn { margin-top: 12px; }
.encart-titre { font-family: var(--police-titre); font-size: 1.375rem; font-weight: 700; }
.encart-doux { text-align: center; padding: 8px 4px; }
.encart-doux p + p { margin-top: 8px; }

/* ---------- Cartes jour ---------- */

.jours { display: grid; gap: 14px; margin: 14px 0 0; }

.jour {
  overflow: hidden;
  scroll-margin-top: 14px;
  scroll-margin-bottom: calc(var(--nav-h) + var(--envoi-h) + 16px);
}
.jour-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 16px 6px;
}
.jour-nom { font-size: 1.4375rem; }
.jour-date { font-family: var(--police); font-weight: 400; color: var(--texte-doux); font-size: 1.1875rem; }

.badge-auj {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--moutarde);
  color: var(--texte);
  font-weight: 700;
  font-size: 1.125rem;
}
.badge-auj::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--texte); }
.badge-auj.petit { font-size: 1rem; padding: 1px 10px; margin-left: 8px; }

.jour.aujourdhui {
  border: 3px solid var(--moutarde);
  box-shadow: 0 0 0 4px var(--moutarde-pale), var(--ombre-forte);
}
.jour.aujourdhui .jour-tete { background: linear-gradient(180deg, var(--moutarde-pale), transparent); }

.repas-liste { display: grid; gap: 10px; padding: 6px 12px 14px; }

.repas {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "creneau modif"
    "plat plat"
    "note note";
  align-items: center;
  gap: 2px 8px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px 12px;
  border-radius: 14px;
  text-align: left;
  touch-action: manipulation;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.repas:active { transform: scale(.99); }

.repas-creneau {
  grid-area: creneau;
  color: var(--texte-doux);
  font-size: 1.125rem;
  font-weight: 700;
}
.repas-plat {
  grid-area: plat;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--texte);
  overflow-wrap: anywhere;
}
.repas-note {
  grid-area: note;
  justify-self: start;
  margin-top: 6px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--moutarde-pale);
  border: 1px solid #EBD39E;
  color: var(--moutarde-fonce);
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}
.repas-modifier {
  grid-area: modif;
  justify-self: end;
  padding: 2px 12px;
  border-radius: 999px;
  border: 2px solid var(--terracotta);
  background: var(--blanc);
  color: var(--terracotta-fonce);
  font-size: 1.125rem;
  font-weight: 700;
  white-space: nowrap;
}
.repas-ajout {
  grid-area: plat;
  color: var(--terracotta-fonce);
  font-size: 1.25rem;
  font-weight: 700;
}

.repas.vide {
  background: transparent;
  border: 2px dashed var(--bord-fort);
}
.repas.vide:hover { background: var(--terracotta-pale); border-color: var(--terracotta); }

.repas.rempli {
  background: var(--repas-fond);
  border: 2px solid var(--bord);
  border-left: 7px solid var(--terracotta);
}
.repas.rempli:hover { border-color: var(--terracotta); }

.repas.flash { animation: flash 1.8s ease-out; }

/* Lecture seule (menu reçu) */
.repas-lecture {
  display: grid;
  gap: 2px;
  padding: 10px 14px 12px;
  border-radius: 14px;
  background: var(--repas-fond);
  border-left: 7px solid var(--terracotta);
}
.repas-lecture.sans { background: transparent; border-left: 7px solid var(--bord); }
.repas-lecture .repas-plat, .repas-lecture .repas-note, .repas-lecture .repas-creneau { grid-area: auto; }
.repas-rien { color: var(--texte-doux); font-style: italic; }
.rien-prevu { padding: 2px 16px 16px; color: var(--texte-doux); font-style: italic; font-size: 1.1875rem; }
.jour-vide { box-shadow: none; background: rgba(255, 253, 248, .6); }

/* ---------- Bouton Envoyer collé en bas ---------- */

.barre-envoyer {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b));
  z-index: 30;
  padding: 18px 16px 10px;
  background: linear-gradient(to top, var(--creme) 62%, rgba(251, 245, 234, 0));
  pointer-events: none;
}
.btn-envoyer {
  pointer-events: auto;
  display: flex;
  width: 100%;
  max-width: 608px;
  margin: 0 auto;
  min-height: 60px;
  font-size: 1.3125rem;
  border-radius: 18px;
  box-shadow: 0 3px 0 var(--terracotta-fonce), var(--ombre-forte);
}

/* ---------- Barre de navigation ---------- */

.nav-bas {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: calc(var(--nav-h) + var(--safe-b));
  padding: 0 max(6px, calc((100% - 640px) / 2)) var(--safe-b);
  background: var(--carte);
  border-top: 1px solid var(--bord);
  box-shadow: 0 -4px 18px rgba(59, 42, 32, .08);
}
body.mode-partage .nav-bas, body.mode-partage .barre-envoyer { display: none; }

.nav-lien {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--nav-h);
  padding: 6px 4px;
  color: var(--texte-doux);
  text-decoration: none;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}
.nav-icone {
  width: 28px; height: 28px;
  padding: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  border-radius: 10px;
  box-sizing: content-box;
  padding: 2px 12px;
}
.nav-icone .plein { fill: currentColor; stroke: none; }
.nav-lien[aria-current="page"] { color: var(--terracotta-fonce); }
.nav-lien[aria-current="page"] .nav-icone { background: var(--terracotta-pale); }
.nav-lien[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 4px;
  border-radius: 0 0 4px 4px; background: var(--terracotta);
}

/* ---------- Message en bas ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(608px, calc(100% - 32px));
  padding: 12px 12px 12px 18px;
  border-radius: 16px;
  background: var(--texte);
  color: var(--blanc);
  font-size: 1.1875rem;
  font-weight: 700;
  box-shadow: var(--ombre-forte);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px);
  transition: opacity .2s, transform .2s, visibility 0s .2s;
}
body.avec-envoi .toast { bottom: calc(var(--nav-h) + var(--envoi-h) + var(--safe-b) + 8px); }
body.mode-partage .toast { bottom: calc(var(--safe-b) + 16px); }
.toast.visible {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
  transition: opacity .2s, transform .2s, visibility 0s;
}
.toast-texte { flex: 1; min-width: 0; }
.toast-action {
  flex: none;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 12px;
  border: 2px solid #F3CF84;
  background: transparent;
  color: #F7D894;
  font-weight: 700;
  font-size: 1.125rem;
}

/* ---------- Fenêtres ---------- */

dialog {
  padding: 0;
  border: 0;
  color: var(--texte);
  background: var(--carte);
  max-width: none;
  max-height: none;
}
dialog::backdrop { background: rgba(59, 42, 32, .5); }
dialog[open] { animation: monter .26s ease-out; }
dialog[open]::backdrop { animation: fondu .26s ease-out; }
body.fenetre-ouverte { overflow: hidden; }

.feuille {
  width: 100%;
  max-width: 640px;
  margin: auto auto 0;
  max-height: calc(var(--vvh, 100dvh) - 16px);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--ombre-forte);
  overflow: hidden;
}
.feuille-cadre {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  height: 100%;
}
.feuille-tete {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 16px 12px;
  border-bottom: 1px solid var(--bord);
  flex: none;
}
.feuille-tete::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 9px;
  background-color: var(--blanc);
  background-image:
    repeating-linear-gradient(90deg, var(--vichy) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(0deg, var(--vichy) 0 6px, transparent 6px 12px);
}
.feuille-titre { font-size: 1.5rem; }
.btn-fermer {
  flex: none;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid var(--bord);
  background: var(--creme);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--texte);
}
.btn-fermer:hover { border-color: var(--bord-fort); }
.feuille-corps {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}
.feuille-pied {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--bord);
  background: var(--carte);
}
.feuille-pied > .btn { flex: 1; }
.feuille-pied > .btn-large { flex: 2; }
.pied-colonne, .pied-envoi { flex-direction: column; }
.pied-boutons { display: flex; gap: 10px; }
.pied-boutons .btn { flex: 1; }
.pied-boutons .btn-large { flex: 2; }

/* Fenêtre plat : plein écran sur téléphone, au-dessus du clavier */
@media (max-width: 699px) {
  .feuille.plein {
    position: fixed;
    inset: var(--vvtop, 0px) 0 auto 0;
    margin: 0;
    max-width: none;
    height: var(--vvh, 100dvh);
    max-height: none;
    border-radius: 0;
  }
  .feuille.plein .feuille-tete { padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
}

.feuille.petite {
  margin: auto;
  width: calc(100% - 32px);
  max-width: 460px;
  border-radius: 22px;
}
.choix-texte { margin: 10px 0 16px; }
.choix-boutons { display: grid; gap: 10px; }
.feuille.petite .feuille-corps { padding: 22px 18px calc(18px + var(--safe-b)); }

@media (min-width: 700px) {
  .feuille, .feuille.plein {
    margin: auto;
    border-radius: 24px;
    max-height: min(88vh, 900px);
  }
  .feuille.plein { height: min(88vh, 900px); }
  .feuille-pied { padding-bottom: 14px; }
}

/* ---------- Champs ---------- */

.champ { margin: 4px 0 12px; }
.champ-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--police-titre);
  font-size: 1.3125rem;
  font-weight: 700;
}
.champ-label.petit { font-family: var(--police); font-size: 1.125rem; margin: 14px 0 6px; color: var(--texte-doux); }
.champ-ligne { display: flex; gap: 8px; align-items: stretch; }
.saisie {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 12px 14px;
  border: 2px solid var(--bord-fort);
  border-radius: 14px;
  background: var(--blanc);
  font-size: 1.1875rem;
  -webkit-appearance: none;
  appearance: none;
}
.saisie-grande { min-height: 62px; font-size: 1.375rem; font-weight: 700; }
.saisie::placeholder { color: #8A7465; font-weight: 400; }
.saisie:focus { border-color: var(--terracotta); outline: none; box-shadow: 0 0 0 4px rgba(181, 83, 42, .22); }
.saisie.flash-champ { animation: flash-champ 1.2s ease-out; }
.btn-effacer {
  flex: none;
  min-height: 52px;
  padding: 0 12px;
  border-radius: 14px;
  border: 2px solid var(--bord);
  background: var(--creme);
  color: var(--texte-doux);
  font-weight: 700;
  font-size: 1.125rem;
}
.aide-erreur {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--rouge-pale);
  color: var(--rouge);
  font-weight: 700;
}

.suggestions {
  margin-top: 8px;
  border: 2px solid var(--bord);
  border-radius: 16px;
  background: var(--blanc);
  overflow: hidden;
  box-shadow: var(--ombre);
}
.petit-titre { padding: 8px 14px 4px; font-size: 1.125rem; color: var(--texte-doux); font-weight: 700; }
.suggestions ul { list-style: none; margin: 0; padding: 0; }
.suggestion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 0;
  border-top: 1px solid var(--bord);
  background: transparent;
  text-align: left;
}
.suggestion:hover { background: var(--terracotta-pale); }
.suggestion-nom { font-size: 1.25rem; font-weight: 700; }
.suggestion-type { font-size: 1.125rem; color: var(--texte-doux); }

/* ---------- Puces ---------- */

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 52px;
  padding: 8px 16px;
  border: 2px solid var(--bord);
  border-radius: 999px;
  background: var(--blanc);
  color: var(--texte);
  font-size: 1.125rem;
  text-align: left;
  line-height: 1.25;
  touch-action: manipulation;
  transition: background-color .15s, border-color .15s;
}
.puce:hover { border-color: var(--terracotta); background: var(--terracotta-pale); }
.puce[aria-pressed="true"] {
  background: var(--sauge);
  border-color: var(--sauge);
  color: var(--blanc);
  font-weight: 700;
}
.puce-filtre[aria-pressed="true"] { background: var(--terracotta); border-color: var(--terracotta); }

.sous-titre { font-size: 1.25rem; margin: 18px 0 10px; padding: 0; }
.bloc-idees:first-child .sous-titre { margin-top: 8px; }
.bloc-idees .btn-lien { margin-top: 6px; padding-left: 4px; }
.bloc-note { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.bloc-note legend { float: left; width: 100%; margin-top: 0; }
.bloc-note legend + * { clear: both; }
.facultatif { font-family: var(--police); font-weight: 400; color: var(--texte-doux); font-size: 1.125rem; }

.btn-etoile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--moutarde);
  background: var(--blanc);
  color: var(--moutarde-fonce);
  font-weight: 700;
  font-size: 1.125rem;
}
.btn-etoile[aria-pressed="true"] { background: var(--moutarde-pale); }

.btn-supprimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  width: 100%;
  min-height: 52px;
  margin-top: 26px;
  padding: 8px 16px;
  border-radius: 14px;
  border: 2px solid #E8C3BE;
  background: var(--rouge-pale);
  color: var(--rouge);
  font-weight: 700;
  font-size: 1.125rem;
}

/* ---------- Envoyer ---------- */

.envoyer-intro { color: var(--texte-doux); margin-bottom: 10px; }
.bulle {
  position: relative;
  padding: 14px 16px;
  margin: 0 6px 6px 10px;
  border-radius: 18px 18px 18px 4px;
  background: var(--bulle);
  border: 1px solid var(--bulle-bord);
  white-space: pre-wrap;
  font-size: 1.125rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 1px rgba(59, 42, 32, .08);
}
.bulle::before {
  content: "";
  position: absolute; left: -9px; bottom: -1px;
  width: 14px; height: 14px;
  background: var(--bulle);
  border-left: 1px solid var(--bulle-bord);
  border-bottom: 1px solid var(--bulle-bord);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.bulle-lien { color: #2F5B8A; word-break: break-all; }

.choix-envoi-titre { font-weight: 700; color: var(--texte-doux); font-size: 1.125rem; }
.choix-envoi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-choix {
  background: var(--blanc);
  color: var(--texte);
  border-color: var(--bord-fort);
  padding-inline: .5em;
}
.btn-choix:hover { background: var(--terracotta-pale); }
.choix-envoi:not(.petits) .btn-choix { min-height: 60px; font-size: 1.1875rem; }
.confirmation:empty { display: none; }
.confirmation {
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
}
.confirmation.ok { background: var(--sauge-pale); color: var(--sauge-fonce); }
.confirmation.pas-ok { background: var(--rouge-pale); color: var(--rouge); }
.copie-secours { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }

/* ---------- Mettre au menu ---------- */

.mam-recette { font-family: var(--police-titre); font-size: 1.375rem; font-weight: 700; margin-bottom: 12px; }
.mam-semaine {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: var(--creme);
}
.mam-semaine-titre { display: grid; text-align: center; line-height: 1.25; font-size: 1.125rem; }
.mam-semaine-titre strong { font-size: 1.1875rem; }
.mam-semaine-titre span { color: var(--texte-doux); }
.mam-consigne { margin: 16px 0 6px; font-weight: 700; }
.mam-jour { padding: 12px 0; border-bottom: 1px solid var(--bord); }
.mam-jour:last-child { border-bottom: 0; }
.mam-jour.aujourdhui { background: linear-gradient(90deg, var(--moutarde-pale), transparent); margin: 0 -16px; padding: 12px 16px; }
.mam-jour-nom { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; flex-wrap: wrap; }
.mam-creneaux { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mam-creneau {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 64px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 2px solid var(--bord-fort);
  background: var(--blanc);
  text-align: left;
  min-width: 0;
}
.mam-creneau.pris { border-style: dashed; }
.mam-label { font-weight: 700; font-size: 1.1875rem; }
.mam-etat {
  font-size: 1.125rem;
  color: var(--texte-doux);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.mam-creneau.pris .mam-etat { font-style: italic; }
.mam-creneau[aria-pressed="true"] {
  border: 3px solid var(--terracotta);
  border-style: solid;
  background: var(--terracotta-pale);
}
.mam-creneau[aria-pressed="true"] .mam-label { color: var(--terracotta-fonce); }
.mam-resume { font-size: 1.125rem; }
.mam-resume.alerte { color: var(--rouge); font-weight: 700; }
.mam-remplace { color: var(--texte-doux); }

/* ---------- Pages Recettes / Semaines passées ---------- */

.titre-vue { font-size: 2.125rem; text-align: center; margin-top: 8px; }
.intro { text-align: center; color: var(--texte-doux); margin: 6px 0 16px; }
.filtres { margin: 4px 0 8px; }
.compte { color: var(--texte-doux); font-size: 1.125rem; margin: 8px 2px; min-height: 1.5em; }
.liste-recettes { display: grid; gap: 12px; }

.recette-carte {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: var(--texte);
  text-decoration: none;
  transition: border-color .15s, transform .1s;
}
.recette-carte:hover { border-color: var(--terracotta); }
.recette-carte:active { transform: scale(.995); }
.recette-emoji {
  display: grid; place-items: center;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--creme);
  border: 2px solid var(--bord);
  font-size: 1.9rem;
}
.recette-texte { display: grid; gap: 4px; min-width: 0; }
.recette-nom { font-family: var(--police-titre); font-size: 1.3125rem; font-weight: 700; line-height: 1.2; }
.recette-resume {
  color: var(--texte-doux);
  font-size: 1.125rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recette-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 1.125rem; color: var(--texte-doux); align-items: center; }
.recette-fleche { font-size: 2rem; color: var(--terracotta); line-height: 1; }

.etiquette {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--sauge-pale);
  color: var(--sauge-fonce);
  font-size: 1rem;
  font-weight: 700;
}
.etiquettes { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

.btn-retour {
  background: transparent;
  color: var(--terracotta-fonce);
  padding-left: 4px;
  margin: 4px 0 8px;
}

.fiche { padding: 0 0 18px; overflow: hidden; }
.fiche > .btn { width: calc(100% - 32px); margin: 18px 16px 0; }
.fiche-tete {
  position: relative;
  text-align: center;
  padding: 34px 18px 18px;
  background: linear-gradient(180deg, var(--moutarde-pale), var(--carte));
}
.fiche-tete::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 12px;
  background-color: var(--blanc);
  background-image:
    repeating-linear-gradient(90deg, var(--vichy) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(0deg, var(--vichy) 0 6px, transparent 6px 12px);
}
.fiche-emoji { font-size: 3.5rem; line-height: 1.1; display: block; }
.fiche-categorie { color: var(--terracotta-fonce); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 1rem; margin-top: 6px; }
.fiche-titre { font-size: 2rem; margin-top: 4px; }
.fiche-resume { color: var(--texte-doux); margin-top: 8px; }
.fiche-infos { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fiche-infos li {
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--blanc);
  border: 1px solid var(--bord);
  font-size: 1.125rem;
}
.fiche-section { padding: 0 18px; margin-top: 24px; }
.fiche-section h2 { font-size: 1.5rem; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px dotted var(--bord-fort); }
.ingredients { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ingredients li { position: relative; padding-left: 26px; }
.ingredients li::before {
  content: ""; position: absolute; left: 6px; top: .6em;
  width: 9px; height: 9px; border-radius: 50%; background: var(--terracotta);
}
.etapes { list-style: none; padding: 0; margin: 0; counter-reset: etape; display: grid; gap: 14px; }
.etapes li { counter-increment: etape; position: relative; padding-left: 50px; min-height: 38px; }
.etapes li::before {
  content: counter(etape);
  position: absolute; left: 0; top: -2px;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--terracotta); color: var(--blanc);
  font-family: var(--police-titre); font-weight: 700; font-size: 1.25rem;
}
.astuce {
  margin: 22px 18px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--moutarde-pale);
  border-left: 6px solid var(--moutarde);
}
.astuce-titre { font-weight: 700; }
.nutrition { margin: 20px 18px 0; color: var(--texte-doux); font-size: 1rem; text-align: center; }

.liste-semaines { display: grid; gap: 14px; }
.semaine-carte { padding: 16px; }
.semaine-carte.est-cible { border: 2px solid var(--moutarde); }
.semaine-carte-titre { font-size: 1.3125rem; }
.semaine-carte-infos { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pastille {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--terracotta-pale);
  color: var(--terracotta-fonce);
  font-weight: 700;
  font-size: 1.125rem;
}
.nb-repas { color: var(--texte-doux); font-size: 1.125rem; }
.apercu { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.apercu li { position: relative; padding-left: 22px; }
.apercu li::before { content: "•"; position: absolute; left: 6px; color: var(--terracotta); font-weight: 700; }
.apercu .apercu-plus { color: var(--texte-doux); font-style: italic; }
.apercu .apercu-plus::before { content: none; }
.semaine-carte-actions { display: grid; gap: 10px; margin-top: 14px; }
.deja-affichee { color: var(--texte-doux); font-style: italic; align-self: center; text-align: center; }
@media (min-width: 520px) {
  .semaine-carte-actions { grid-template-columns: auto 1fr; }
}

/* ---------- Menu reçu ---------- */

.partage-tete { text-align: center; padding: 6px 0 4px; }
.partage-titre { font-size: 2.125rem; }
.partage-tete .pastille { margin-top: 8px; }
.partage-pied {
  display: grid;
  gap: 8px;
  margin: 28px 0 8px;
  padding-top: 18px;
  border-top: 2px dotted var(--bord-fort);
}
#btn-garder.fait { background: var(--sauge-pale); color: var(--sauge-fonce); border-color: var(--sauge); }

/* ---------- Animations ---------- */

@keyframes apparaitre { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes monter { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse {
  0% { transform: scale(1); background: var(--sauge-pale); }
  30% { transform: scale(1.06); background: #CFDDBB; }
  100% { transform: scale(1); background: var(--sauge-pale); }
}
@keyframes flash {
  0%, 35% { background: var(--moutarde-pale); box-shadow: 0 0 0 4px var(--moutarde); }
  100% { box-shadow: 0 0 0 0 rgba(227, 169, 59, 0); }
}
@keyframes flash-champ {
  0%, 30% { background: var(--sauge-pale); border-color: var(--sauge); }
  100% { background: var(--blanc); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Très petits écrans (320 px) */
@media (max-width: 359px) {
  body { font-size: 1.125rem; }
  .semaine-relatif, .titre-vue, .partage-titre { font-size: 1.875rem; }
  .btn-nav { font-size: 1.0625rem; }
  .nav-lien { font-size: 1rem; }
  .nav-icone { padding: 2px 8px; }
  .choix-envoi { grid-template-columns: 1fr; }
  .mam-semaine { grid-template-columns: 1fr 1fr; }
  .mam-semaine-titre { grid-column: 1 / -1; grid-row: 1; }
}
