/* ============================================================================
   Mes repas de la semaine
   Standard de la catégorie joué droit, au niveau de finition Apple Rappels /
   Fitness (jauges lisibles, grands chiffres tabulaires, hiérarchie nette) avec
   la chaleur de Jow. Aucune photo : la typographie et les jauges portent tout.
   ========================================================================= */

:root {
  color-scheme: light dark;

  --papier:    #fbf8f3;
  --surface:   #ffffff;
  --surface-2: #f4f0e7;
  --encre:     #1c1a17;
  --encre-2:   #55504a;
  --encre-3:   #6e6960;
  --filet:     #e7e1d6;
  --filet-fort:#d5cdbe;

  --vert:      #1f7a4c;
  --vert-fort: #17603b;
  --vert-doux: #e2f0e8;
  --ambre:     #9c5320;
  --ambre-doux:#f8ebdf;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --ombre-1: 0 1px 2px rgba(28, 26, 23, .05), 0 2px 6px rgba(28, 26, 23, .04);
  --ombre-2: 0 2px 4px rgba(28, 26, 23, .06), 0 12px 28px rgba(28, 26, 23, .1);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;

  --duree: 220ms;
  --sortie: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier:    #14120f;
    --surface:   #1d1a16;
    --surface-2: #262119;
    --encre:     #f3efe8;
    --encre-2:   #bdb6a9;
    --encre-3:   #a09889;
    --filet:     #302b23;
    --filet-fort:#413a30;

    --vert:      #55c489;
    --vert-fort: #6ed69d;
    --vert-doux: #16301f;
    --ambre:     #e2a76c;
    --ambre-doux:#2f2215;

    --ombre-1: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 6px rgba(0, 0, 0, .3);
    --ombre-2: 0 2px 4px rgba(0, 0, 0, .45), 0 14px 32px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0 20px 64px;
  background: var(--papier);
  color: var(--encre);
  font: 400 16px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--filet-fort) transparent;
  accent-color: var(--vert);
  caret-color: var(--vert);
}

::selection { background: var(--vert-doux); color: var(--encre); }

:focus-visible {
  outline: 2px solid var(--vert);
  outline-offset: 2px;
  border-radius: 4px;
}

.enveloppe { max-width: 1600px; margin: 0 auto; }

h1, h2, h3 { margin: 0; letter-spacing: -.018em; text-wrap: balance; }

.ic {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic--sm { width: 16px; height: 16px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--encre);
  cursor: pointer;
  transition: background var(--duree) var(--sortie), border-color var(--duree) var(--sortie);
}

.btn--primaire {
  flex: none;
  align-self: center;
  background: var(--vert);
  color: #fff;
  box-shadow: var(--ombre-1);
  padding: 12px 22px;
}
.btn--primaire:hover { background: var(--vert-fort); }
.btn--primaire:active { transform: translateY(1px); }

.btn--fantome { border-color: var(--filet); background: var(--surface); color: var(--encre-2); }
.btn--fantome:hover { border-color: var(--filet-fort); color: var(--encre); }

.btn--petit { padding: 7px 12px; font-size: .875rem; }

@media (prefers-color-scheme: dark) {
  .btn--primaire { color: #0d1a13; }
}

/* ------------------------------------------------------------------- entête */

.tete { padding-top: 32px; }

.tete__ligne {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

h1 { font-size: 1.875rem; font-weight: 700; }

.tete__actions { display: flex; gap: 8px; }

/* ------------------------------------------------------------------- jauges */

/* Sous la semaine, pas au-dessus : le produit c'est la semaine, ces compteurs
   sont un bilan qu'on consulte après coup. Placés en tête, ils repoussaient
   tous les repas sous la ligne de flottaison sur téléphone. */
.jauges {
  margin: 34px 0 0;
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--r-lg);
  padding: 22px 28px 20px;
  box-shadow: var(--ombre-1);
}

.jauges__titre {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--encre-2);
  margin-bottom: 6px;
}

.jauges__acquis {
  margin: 0 0 22px;
  font-size: .875rem;
  line-height: 1.55;
  color: var(--encre-3);
  max-width: 72ch;
}

/* Bornées : à deux jauges, un 1fr les étirait sur toute la largeur de la page
   et la piste devenait une barre interminable. */
.jauges__grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(184px, 300px));
  justify-content: start;
  gap: 24px 40px;
}

.jauge__valeur {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
}
.jauge__n { font-size: 2.125rem; }
.jauge__sur { font-size: .875rem; color: var(--encre-3); font-weight: 400; }

.jauge__piste {
  display: flex;
  gap: 3px;
  margin: 10px 0 8px;
  padding-bottom: 5px;
}
.jauge__case {
  position: relative;
  height: 7px;
  flex: 1;
  border-radius: 2px;
  background: var(--surface-2);
}
.jauge__case--pleine { background: var(--vert); }

/* Repère de l'objectif sous la case concernée : sans lui, « 5/7 » en vert se
   lisait comme un manque alors que l'objectif de l'avoine est justement 5. */
.jauge__case--objectif::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 3px; height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: var(--encre-3);
}

.jauge__label { font-size: .875rem; font-weight: 600; color: var(--encre); }
.jauge__aide  { font-size: .8125rem; color: var(--encre-3); margin-top: 2px; }
.jauge__objectif { color: var(--encre-2); font-weight: 600; }

.jauge--atteint .jauge__n { color: var(--vert); }
.jauge--atteint .jauge__valeur .ic {
  width: 17px; height: 17px;
  stroke-width: 2.6;
  color: var(--vert);
  align-self: center;
  margin-left: 2px;
}

.jauges__b12 {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--filet);
  font-size: .875rem;
  color: var(--encre-2);
  line-height: 1.5;
}
.jauges__b12 .ic { color: var(--ambre); margin-top: 2px; }
.jauges__b12 b { color: var(--encre); font-weight: 600; }

/* ------------------------------------------------------- barre de réglages */

.barre {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 20px 0 0;
}

/* Liste de réglages : chaque ligne porte son intitulé à gauche et son pas à
   droite, séparée par un filet. Côte à côte, le « + » de la première ligne
   venait toucher l'intitulé de la seconde. */
.couverts {
  flex: 1 1 520px;
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 12px 18px 6px;
  max-width: 840px;
  border: 1px solid var(--filet);
  border-radius: var(--r-md);
  background: var(--surface);
  min-inline-size: 0;
}

.couverts__titre {
  padding: 0 0 4px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--encre-2);
}

/* ------------------------------------------------------- plafond de temps */

.temps {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 16px 14px;
  border: 1px solid var(--filet);
  border-radius: var(--r-md);
  background: var(--surface);
}

.segments {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.segment {
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 7px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--encre-2);
  cursor: pointer;
  transition: background var(--duree) var(--sortie), color var(--duree) var(--sortie);
}
.segment:hover { color: var(--encre); }
.segment--actif {
  background: var(--surface);
  color: var(--vert);
  box-shadow: var(--ombre-1);
}

.couvert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 5px 0;
  border-top: 1px solid var(--filet);
  min-width: 0;
}

.couvert__titre {
  font-size: .875rem;
  font-weight: 600;
}
.couvert__jours { font-weight: 400; color: var(--encre-3); white-space: nowrap; }
.couvert--travail .couvert__titre { color: var(--vert); }
.couvert--maison  .couvert__titre { color: var(--ambre); }

.couvert__reglage { display: flex; align-items: center; gap: 2px; flex: none; }

.couvert__n {
  min-width: 88px;
  text-align: center;
  font-size: .9375rem;
  font-weight: 700;
}

.pas {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--encre-2);
  cursor: pointer;
  transition: background var(--duree) var(--sortie);
}
.pas:hover:not(:disabled) { background: var(--surface-2); color: var(--encre); }
.pas:disabled { opacity: .3; cursor: default; }

/* ------------------------------------------------------------------ onglets */

.onglets {
  display: flex;
  gap: 4px;
  margin: 32px 0 0;
  border-bottom: 1px solid var(--filet);
}
.onglets button {
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  padding: 10px 4px;
  margin-right: 20px;
  border: 0;
  background: none;
  color: var(--encre-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--duree) var(--sortie);
}
.onglets button:hover { color: var(--encre); }
.onglets button.actif { color: var(--encre); border-bottom-color: var(--vert); }

/* -------------------------------------------------------------------- notes */

.note {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--encre-3);
  max-width: 74ch;
  margin: 24px 0 20px;
}

/* ------------------------------------------------------------------ semaine */

.semaine {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.jour {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--r-lg);
  padding: 0 20px 12px;
  box-shadow: var(--ombre-1);
  overflow: hidden;
}

/* Bandeau de la journée, à fond perdu jusqu'aux bords de la carte. Trois
   segments, un par repas, séparés par un filet à la couleur de la carte. */
.jour__motif {
  display: flex;
  height: 52px;
  margin: 0 -20px;
}
.jour__motif span {
  flex: 1;
  min-width: 0;
  background-color: var(--surface-2);
  background-size: cover;
}
.jour__motif span + span { box-shadow: -1px 0 0 var(--surface); }

.jour__tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0 12px;
}
.jour__ligne { display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; }
.mini--jour { margin-left: auto; }
.jour__nom { font-size: 1.0625rem; font-weight: 600; }
.jour__temps {
  font-size: .75rem;
  font-weight: 400;
  color: var(--encre-3);
  white-space: nowrap;
  cursor: help;
}

/* Contrôle, pas étiquette : bordure, fond, icône d'échange et états au survol.
   Les étiquettes informatives plus bas sont délibérément plates pour qu'aucune
   des deux ne puisse être prise pour l'autre. */
.bascule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: .75rem;
  font-weight: 600;
  padding: 5px 8px 5px 11px;
  border: 1px solid var(--ambre);
  border-radius: 999px;
  cursor: pointer;
  background: var(--ambre-doux);
  color: var(--ambre);
  transition: box-shadow var(--duree) var(--sortie), transform var(--duree) var(--sortie);
}
.jour--travail .bascule {
  border-color: var(--vert);
  background: var(--vert-doux);
  color: var(--vert);
}
.bascule:hover { box-shadow: var(--ombre-1); transform: translateY(-1px); }
.bascule:active { transform: translateY(0); }
.bascule__n { font-weight: 400; opacity: .8; }
.bascule .ic { width: 14px; height: 14px; stroke-width: 1.8; opacity: .65; }

/* ---------------------------------------------------------------- créneaux */

.repas {
  padding: 13px 0;
  border-top: 1px solid var(--filet);
}

/* Volontairement discret : c'est un repère de lecture, pas un sur-titre.
   Ni capitales ni interlettrage, la ligne suivante porte le contenu. */
.repas__slot {
  display: block;
  font-size: .75rem;
  font-weight: 400;
  color: var(--encre-3);
  margin-bottom: 2px;
  white-space: nowrap;
}
.repas__slot--court { display: none; }

.repas__nom {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.011em;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  color: var(--encre);
  cursor: pointer;
  border-radius: 4px;
  text-wrap: pretty;
}
.repas__nom:hover { color: var(--vert); }

.repas__haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
}

.repas__actions { display: flex; gap: 2px; flex: none; }

.mini {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--encre-3);
  cursor: pointer;
  transition: background var(--duree) var(--sortie), color var(--duree) var(--sortie);
}
.mini:hover:not(:disabled) { background: var(--surface-2); color: var(--encre); }
.mini:disabled { opacity: .28; cursor: default; }
.mini--actif { color: var(--vert); background: var(--vert-doux); }
.mini--actif:hover { background: var(--vert-doux); color: var(--vert); }

/* Une seule chaîne qui coule, pas une pile d'étiquettes : dans une colonne
   étroite, chaque information sur sa ligne alourdissait le bas de la carte. */
.repas__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 9px;
  row-gap: 2px;
  min-width: 0;
  margin-top: 5px;
  font-size: .75rem;
  color: var(--encre-3);
}
.repas__tps { font-weight: 600; }

/* Plates et sans fond : ce sont des informations, pas des boutons. */
.puce {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--encre-3);
  font-weight: 400;
  white-space: nowrap;
}
.puce::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.puce--leg { color: var(--vert); }
.puce--boite { color: var(--ambre); }

.repas__vide { font-size: .9375rem; color: var(--encre-3); font-style: italic; }

/* Une semaine se lit en une rangée. Dès qu'il y a la place pour sept colonnes
   confortables, on les prend plutôt que d'empiler trois rangées de trois jours.
   La sous-grille aligne l'en-tête et les trois repas d'une journée à l'autre :
   sans elle, chaque carte démarre ses lignes à une hauteur différente et la
   semaine cesse de se lire en balayant horizontalement.
   Ce bloc doit rester APRÈS les règles de base : une media query n'ajoute
   aucune spécificité, donc placée avant elle se ferait écraser. */
@media (min-width: 1240px) {
  .semaine {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    /* 5 lignes : le bandeau, l'en-tête, puis les trois repas. */
    grid-template-rows: repeat(5, auto);
    gap: 12px;
  }
  .jour {
    grid-row: span 5;
    display: grid;
    grid-template-rows: subgrid;
    padding-inline: 15px;
  }
  .jour__motif { margin-inline: -15px; }
  /* En colonne de 200 px, le nom du jour et la puce ne tiennent pas côte à côte.
     On les empile pour les sept journées, ce qui garde les cartes alignées. */
  /* Trois boutons par repas : on passe aux libellés courts et à des cibles
     resserrées, sinon la ligne déborde la colonne. */
  .repas__slot--long { display: none; }
  .repas__slot--court { display: inline; }
  .mini { width: 27px; height: 27px; }
  .mini .ic { width: 17px; height: 17px; }
  .repas__haut { min-height: 27px; }

  /* En colonne étroite, le nom, le temps et le cadenas ne tiennent pas sur une
     ligne : le temps passe dessous plutôt que de déborder. */
  .jour__ligne { flex-wrap: wrap; row-gap: 0; }
  .jour__temps { order: 3; flex-basis: 100%; }
  .mini--jour { order: 2; }

  .jour__tete { flex-direction: column; align-items: flex-start; gap: 6px; }
  .jour__nom { font-size: 1rem; white-space: nowrap; }
  .bascule { padding: 4px 7px 4px 10px; font-size: .6875rem; }
  .repas { display: flex; flex-direction: column; }
  /* Réservée sur deux lignes elle aussi : un plat portant trois marqueurs
     passait à la ligne et refaisait sauter la grille de 21 px. */
  .repas__meta {
    margin-top: auto;
    padding-top: 5px;
    line-height: 1.45;
    min-height: 44px;
    align-content: flex-start;
  }

  /* Hauteur réservée pour le nom du plat. Sans elle, relancer un seul repas
     change la hauteur de sa ligne, et comme la sous-grille partage ses lignes
     entre les sept journées, toute la grille sautait. Mesuré sur 294 noms
     rendus : 4 lignes suffisent dès 1240 px, 3 à partir de 1440 px. */
  .repas__nom {
    min-height: calc(4 * 1.3em);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
  }
  /* Les deux réglages côte à côte : pleine largeur, l'intitulé se retrouvait
     à un millier de pixels du pas qu'il commande. */
  .couvert:nth-of-type(2) { border-top: 0; }
}

/* Au-delà de 1440 px les colonnes sont assez larges pour que 3 lignes suffisent :
   on rend la ligne perdue au reste de la carte. */
@media (min-width: 1440px) {
  .repas__nom {
    min-height: calc(3 * 1.3em);
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

@media (min-width: 1000px) {
  .couverts { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .couverts__titre { grid-column: 1 / -1; }
  .couvert { border-top: 0; padding: 2px 0 8px; }
  .couvert:nth-of-type(2) { border-left: 1px solid var(--filet); padding-left: 32px; }
}

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

.courses__tete {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}

.courses {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  align-items: start;
}

.rayon {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--r-lg);
  padding: 18px 20px 14px;
  box-shadow: var(--ombre-1);
}
.rayon h3 {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--vert);
  margin-bottom: 10px;
}
.rayon ul { list-style: none; margin: 0; padding: 0; }
.rayon li { border-top: 1px solid var(--filet); }
.rayon li:first-child { border-top: 0; }

.rayon label {
  display: flex;
  gap: 11px;
  align-items: baseline;
  padding: 9px 0;
  cursor: pointer;
  font-size: .9375rem;
}
.rayon input { margin: 0; width: 16px; height: 16px; align-self: center; flex: none; }
.rayon li.coche label { color: var(--encre-3); text-decoration: line-through; }

.qte {
  color: var(--encre-3);
  white-space: nowrap;
  font-weight: 600;
  font-size: .875rem;
  min-width: 66px;
}
.rayon li.coche .qte { color: var(--encre-3); }

.vide { color: var(--encre-3); font-style: italic; }

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

.modale {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  background: rgba(20, 18, 15, .5);
  backdrop-filter: blur(3px);
  animation: fondu var(--duree) var(--sortie);
}
.modale[hidden] { display: none; }

.fiche {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border-radius: 22px;
  padding: 30px 34px 34px;
  box-shadow: var(--ombre-2);
  animation: monte var(--duree) var(--sortie);
  overflow: hidden;
}

/* Bandeau abstrait, une composition par famille de plat. Purement décoratif,
   d'où role="presentation" et aucune alternative textuelle. */
.fiche__motif {
  height: 132px;
  margin: -30px -34px 22px;
  background-color: var(--surface-2);
  background-size: cover;
  background-position: center 42%;
}

.fiche__fermer {
  position: absolute;
  top: 16px; right: 16px;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 0;
  border-radius: 999px;
  /* Posé sur le bandeau : il lui faut son propre fond pour rester lisible
     quelle que soit la composition derrière. */
  background: var(--surface);
  color: var(--encre-2);
  cursor: pointer;
  box-shadow: var(--ombre-1);
}
.fiche__fermer:hover { color: var(--encre); }

.fiche__jour {
  margin: 0 0 4px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--vert);
}
.fiche h2 { font-size: 1.5rem; font-weight: 700; margin-right: 40px; }
.fiche__meta { margin: 6px 0 0; font-size: .875rem; color: var(--encre-3); }

.fiche__corps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 30px;
  margin-top: 26px;
}
.fiche h3 {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--encre-2);
  margin-bottom: 10px;
}

.fiche__ing { list-style: none; margin: 0; padding: 0; }
.fiche__ing li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--filet);
  font-size: .875rem;
}
.fiche__ing li:first-child { border-top: 0; }
.fiche__ing .qte { min-width: 62px; }

.fiche__etapes { margin: 0; padding-left: 20px; }
.fiche__etapes li { padding: 3px 0 9px; font-size: .9375rem; line-height: 1.55; }
.fiche__etapes::marker { color: var(--encre-3); }

.fiche__note {
  margin: 26px 0 0;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--vert-doux);
  color: var(--encre);
  font-size: .875rem;
  line-height: 1.5;
}
.fiche__note[hidden] { display: none; }

/* -------------------------------------------------------------------- pied */

.pied { margin-top: 48px; font-size: .8125rem; line-height: 1.6; color: var(--encre-3); }
.pied p { margin: 8px 0; max-width: 80ch; }

/* ------------------------------------------------------------- confirmation */

.annonce {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  transform: translateX(-50%);
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--encre);
  color: var(--papier);
  font-size: .875rem;
  font-weight: 600;
  box-shadow: var(--ombre-2);
  animation: monte var(--duree) var(--sortie);
}
.annonce[hidden] { display: none; }

/* ------------------------------------------------------------------ mouvement
   Un seul moment orchestré : les journées se posent en cascade à la génération. */

@keyframes fondu { from { opacity: 0; } }
@keyframes monte { from { opacity: 0; transform: translateY(10px); } }
@keyframes pose  { from { opacity: 0; transform: translateY(14px); } }

.semaine--anime .jour {
  animation: pose 380ms var(--sortie) backwards;
  animation-delay: calc(var(--rang) * 45ms);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}

/* ------------------------------------------------------------------- mobile */

@media (max-width: 620px) {
  body { padding-inline: 16px; }
  .tete { padding-top: 22px; }

  /* Cibles tactiles : 44 px minimum, la barre de finition retenue est Apple. */
  .mini { width: 44px; height: 44px; }
  .pas { width: 44px; height: 44px; }
  .bascule { padding: 9px 12px; }
  .fiche__fermer { width: 40px; height: 40px; }
  .rayon label { padding: 12px 0; }
  .repas { padding: 15px 0; }
  /* Un nom de plat tenant sur une seule ligne ne faisait que 22 px de haut :
     large mais mince, donc pénible à viser au pouce. */
  .repas__nom { padding-block: 7px; }
  .repas__meta { margin-top: 0; }
  .jauges { padding: 22px 20px 18px; border-radius: var(--r-md); }
  .jauges__grille { grid-template-columns: repeat(2, 1fr); gap: 22px 20px; }
  .jauge__n { font-size: 2.125rem; }
  .barre { flex-direction: column; align-items: stretch; }
  .couverts { flex: 0 0 auto; }
  .couvert { gap: 12px; }
  .couvert__n { min-width: 84px; }
  .temps { flex: 0 0 auto; }
  .segment { flex: 1; text-align: center; padding-block: 11px; }
  .btn--primaire { justify-content: center; width: 100%; padding-block: 13px; }
  .fiche { padding: 26px 22px 28px; border-radius: var(--r-md); }
  .fiche__motif { height: 104px; margin: -26px -22px 18px; }
  .fiche__corps { grid-template-columns: 1fr; gap: 24px; }
  .modale { padding: 16px; }
}

/* --------------------------------------------------------------- impression
   On imprime la vue active, pas systématiquement la liste de courses. */

@media print {
  :root {
    --papier: #fff; --surface: #fff; --surface-2: #fff;
    --encre: #000; --encre-2: #333; --encre-3: #555;
    --filet: #bbb; --filet-fort: #999;
    --vert: #000; --vert-doux: #eee; --ambre: #000; --ambre-doux: #eee;
    --ombre-1: none; --ombre-2: none;
  }
  body { padding: 0; }
  .tete__actions, .barre, .onglets, .note, .pied, .modale, .annonce, .fiche__motif,
  .repas__actions, .courses__tete .btn { display: none !important; }
  .jauges { border: 0; border-bottom: 1px solid #999; border-radius: 0; padding: 0 0 14px; }
  .jauges__b12 { display: none; }
  h1 { margin-bottom: 14px; }

  body.vue-semaine [data-vue="courses"] { display: none !important; }
  body.vue-courses [data-vue="semaine"] { display: none !important; }
  body.vue-courses [data-vue="courses"] { display: block !important; }

  .semaine, .courses { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .jour, .rayon { border: 1px solid #bbb; border-radius: 4px; break-inside: avoid; padding: 4px 12px 8px; }
  .jauge__case--pleine { background: #000; }
  .jauge__case { border: 1px solid #999; }
}
