/* Le tableau du frigo : une page plein écran pour une tablette posée dans la cuisine, lisible à deux mètres.
   Disposition : l'heure et la météo à gauche, les départs au centre, le repas et les rappels à droite,
   les onglets en bas, à portée de pouce. Couleurs en jetons, avec un thème sombre pour le soir. */
:root {
  --fond: #EEF1F4;
  --carte: #FFFFFF;
  --case: #F2F5F8;
  --encre: #16202A;
  --encre-2: #4A5866;
  --encre-3: #5B6875;
  --trait: #D9DFE5;
  --trait-doux: #E6EAEE;
  --accent: #1D3F8F;
  --accent-encre: #FFFFFF;
  --accent-doux: #E3E9F6;
  --rer: #F5C400;
  --rer-encre: #16202A;
  --ok: #1B6B44;
  --ok-doux: #E3F3EA;
  --alerte: #9A4A06;
  --alerte-doux: #FCEFD9;
  --critique: #A41E14;
  --critique-doux: #FDE7E5;
  --neutre: #4A5866;
  --neutre-doux: #E8ECF0;
  --route-ok: #2E8B57;
  --route-lent: #E08A1E;
  --route-bouche: #B83227;
  --police-titre: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --police-texte: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0F161D;
    --carte: #18222C;
    --case: #1F2A35;
    --encre: #E8EEF3;
    --encre-2: #B8C3CD;
    --encre-3: #9DAAB6;
    --trait: #2A3743;
    --trait-doux: #24303B;
    --accent: #93B2FF;
    --accent-encre: #0F161D;
    --accent-doux: #22314F;
    --ok: #7FD3A5;
    --ok-doux: #173326;
    --alerte: #F2B266;
    --alerte-doux: #3A2814;
    --critique: #FF9C90;
    --critique-doux: #3D1C19;
    --neutre: #B8C3CD;
    --neutre-doux: #26323D;
    --route-ok: #3FA66B;
    --route-lent: #E89A3A;
    --route-bouche: #D8574A;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --fond: #0F161D;
  --carte: #18222C;
  --case: #1F2A35;
  --encre: #E8EEF3;
  --encre-2: #B8C3CD;
  --encre-3: #9DAAB6;
  --trait: #2A3743;
  --trait-doux: #24303B;
  --accent: #93B2FF;
  --accent-encre: #0F161D;
  --accent-doux: #22314F;
  --ok: #7FD3A5;
  --ok-doux: #173326;
  --alerte: #F2B266;
  --alerte-doux: #3A2814;
  --critique: #FF9C90;
  --critique-doux: #3D1C19;
  --neutre: #B8C3CD;
  --neutre-doux: #26323D;
  --route-ok: #3FA66B;
  --route-lent: #E89A3A;
  --route-bouche: #D8574A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: 17px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { list-style: none; padding: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.app {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1440px;
  margin: 0 auto;
  padding-block: 18px;
  padding-inline: clamp(16px, 2vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
main { flex: 1 1 auto; min-width: 0; }
.vue { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.chargement, .sans-js { color: var(--encre-2); padding: 24px 0; }

/* En-tête */
.entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.entete-lieu { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.maison { font-family: var(--police-titre); font-weight: 700; font-size: 24px; letter-spacing: -0.01em; }
.lieu { color: var(--encre-3); font-size: 15px; }
.etat { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.etat .point { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.etat-reel { background: var(--ok-doux); color: var(--ok); }
.etat-exemple, .etat-attente { background: var(--neutre-doux); color: var(--neutre); }
.etat-connexion { background: var(--alerte-doux); color: var(--alerte); }

/* Grilles */
/* Trois colonnes dès 900 px de large environ : une tablette en paysage fait souvent 960 px « CSS ». */
.gouts-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px 20px; }
.gouts-liste .nom { font-weight: 700; }
.gout { margin: 2px 0 0; }
.gout-allergie { color: var(--critique); }
.gout-evite { color: var(--alerte); }
.gouts-alerte { padding: 10px 14px; border-radius: 12px; background: var(--alerte-doux); color: var(--alerte); }
.gouts-alerte.critique { background: var(--critique-doux); color: var(--critique); font-weight: 600; }
.gouts-alerte ul { list-style: none; margin: 0; padding: 0; }
.gouts-alerte .sous { margin: 4px 0 0; color: inherit; font-weight: 400; }
.grille-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 16px; align-items: start; }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
.colonne { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Cartes */
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.carte-tete { display: flex; align-items: center; gap: 10px; }
.carte-titres { flex: 1 1 auto; min-width: 0; }
.carte-titres h2 { font-size: 18px; font-weight: 700; line-height: 1.25; }
.sous { font-size: 14px; color: var(--encre-3); }
.sous.consigne { color: var(--alerte); }
.vide { color: var(--encre-2); font-size: 15px; }
.pied { padding-top: 10px; border-top: 1px solid var(--trait-doux); font-size: 15px; color: var(--encre-2); }

/* Pictogrammes */
.ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-carte { width: 26px; height: 26px; color: var(--accent); }
.ico-meteo { width: 60px; height: 60px; stroke-width: 1.6; color: var(--accent); }
.ico-petit { width: 22px; height: 22px; color: var(--encre-2); margin-inline: auto; }

/* Pastilles et bandeaux */
.pastille { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pastille-neutre { background: var(--neutre-doux); color: var(--neutre); }
.pastille-ok { background: var(--ok-doux); color: var(--ok); }
.pastille-alerte { background: var(--alerte-doux); color: var(--alerte); }
.pastille-critique { background: var(--critique-doux); color: var(--critique); }
.bandeau { padding: 8px 12px; border-radius: 10px; font-size: 15px; }
.bandeau-alerte { background: var(--alerte-doux); color: var(--alerte); }
.bandeau-ok { display: inline-flex; align-items: center; gap: 8px; background: var(--ok-doux); color: var(--ok); font-weight: 700; }
.bandeau-critique { background: var(--critique-doux); color: var(--critique); font-weight: 700; }
.conseil { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-doux); font-size: 15px; }
.conseil .ico { color: var(--accent); width: 22px; height: 22px; }

/* Heure et météo */
.horloge { font-family: var(--police-titre); font-weight: 700; font-size: clamp(64px, 8vw, 104px); line-height: 0.95; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.date { margin-top: 6px; font-size: 22px; color: var(--encre-2); }
.date::first-letter { text-transform: uppercase; }
.meteo-tete { display: flex; align-items: center; gap: 14px; }
.meteo-temp { flex: 1 1 auto; min-width: 0; }
.meteo-ligne { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.temp { font-family: var(--police-titre); font-weight: 700; font-size: 56px; line-height: 1; }
.libelle { font-size: 20px; }
.heures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.heure { display: flex; flex-direction: column; gap: 4px; padding: 8px 4px; border-radius: 10px; background: var(--case); }
.heure-h { font-size: 14px; color: var(--encre-3); }
.heure-t { font-size: 19px; font-weight: 700; }
.meteo-pied { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; color: var(--encre-2); }
.semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding-top: 10px; border-top: 1px solid var(--trait-doux); text-align: center; font-variant-numeric: tabular-nums; }
.jour-meteo { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.jour-nom { font-size: 13px; color: var(--encre-3); }
.jour-max { font-size: 15px; font-weight: 700; }
.jour-min { font-size: 13px; color: var(--encre-3); }
.jour-pluie { font-size: 12px; font-weight: 700; color: var(--accent); }

/* Cantine : les flèches pour passer d'un jour à l'autre */
.fleches { display: flex; gap: 6px; flex: none; }
.fleche { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--trait); background: var(--carte); color: var(--accent); cursor: pointer; }
.fleche .ico { width: 22px; height: 22px; }
.fleche:disabled { opacity: 0.35; cursor: default; }
/* Le bouton de la carte Trajet : aller ou retour. En couleur quand le retour est affiché. */
.inverser-trajet { margin-left: auto; }
.inverser-trajet[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-encre); }
.cantine-corps { display: flex; flex-direction: column; gap: 10px; touch-action: pan-y; }

/* RER et trajet */
.badge-rer { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border-radius: 9px; background: var(--rer); color: var(--rer-encre); font-family: var(--police-titre); font-weight: 700; font-size: 21px; }
.departs li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--trait-doux); }
.depart-dest { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.depart-duree { flex-basis: 100%; }
.depart-heure { font-size: 15px; color: var(--encre-3); font-variant-numeric: tabular-nums; }
.depart-min { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trajet-ligne { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.gros { font-family: var(--police-titre); font-weight: 700; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.route { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; }
.route-ok { background: var(--route-ok); }
.route-lent { background: var(--route-lent); }
.route-bouche { background: var(--route-bouche); }
.route-etapes { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--encre-3); }

/* Cantine, rappels, actualités */
.menu { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; align-items: baseline; }
.menu dt, .etiquette { font-size: 13px; font-weight: 700; color: var(--encre-3); text-transform: uppercase; letter-spacing: 0.06em; }
.menu dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.plats { display: flex; flex-direction: column; gap: 6px; }
.plats li { position: relative; padding-left: 16px; }
.plats li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.barre { text-decoration: line-through; color: var(--encre-3); }
.rappels { display: flex; flex-direction: column; gap: 10px; }
.rappels li { display: flex; flex-direction: column; gap: 2px; }
.rappel-alerte { padding: 8px 12px; border-radius: 10px; background: var(--critique-doux); }
.rappel-alerte > span:first-child { color: var(--critique); font-weight: 700; }
.actus-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px 24px; }
.actus-grille article { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.actu-source { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.actu-titre { font-size: 16px; line-height: 1.35; }

/* Vues secondaires */
.vue-tete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.vue-tete h1 { font-family: var(--police-titre); font-weight: 700; font-size: 36px; line-height: 1.1; letter-spacing: -0.01em; }
.sous-titre { margin-top: 4px; font-size: 16px; color: var(--encre-2); }
.vue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.liste-lignes li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--trait-doux); }
.liste-lignes .nom { font-weight: 700; }
.liste-simple li { padding: 9px 0; border-top: 1px solid var(--trait-doux); }
.zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.zone h3 { margin-bottom: 6px; }
.zone ul { display: flex; flex-direction: column; gap: 6px; }
/* Jardin : un problème à surveiller par carte, son suivi daté, ses photos et « Réglé » en pied */
.signalement-probleme { font-size: 18px; line-height: 1.35; }
.signalement-infos { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 15px; }
.signalement-infos dt { font-size: 13px; font-weight: 700; color: var(--encre-3); text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.suivi li { display: flex; gap: 10px; font-size: 15px; }
.suivi-quand { flex: none; min-width: 3.2em; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--encre-2); }
.signalement-pied { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; }
.signalement-pied .vignettes { margin-top: 0; }

/* Granulés : le stock en grand, sa jauge, et les mouvements à portée de doigt */
.stock-ligne { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.stock-chiffre { font-family: var(--police-titre); font-weight: 700; font-size: 96px; line-height: 0.95; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stock-unite { font-size: 22px; color: var(--encre-2); }
.jauge { height: 14px; border-radius: 999px; background: var(--case); overflow: hidden; }
.jauge > span { display: block; height: 100%; border-radius: 999px; }
.jauge-ok { background: var(--route-ok); }
.jauge-alerte { background: var(--route-lent); }
.jauge-critique { background: var(--route-bouche); }
.bouton-geant { min-height: 76px; font-size: 22px; border-radius: 16px; }
.bouton-geant .ico { width: 28px; height: 28px; stroke-width: 2.6; }
.bouton-petit { min-height: 40px; padding: 0 12px; font-size: 15px; }
.bouton-petit .ico { width: 18px; height: 18px; }
.bouton:disabled { opacity: 0.45; cursor: default; }
.champ-stock { display: flex; flex-direction: column; gap: 6px; }
.mouvement-fin { display: flex; align-items: center; gap: 8px; }
.livraisons li { padding: 7px 0; gap: 10px; }
.livraisons .nom { line-height: 1.25; }
.livraisons .sous { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.travaux li { gap: 10px; }
.vignettes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.vignette, .ajout-photo { width: 48px; height: 48px; border-radius: 8px; flex: none; }
.vignette { padding: 0; overflow: hidden; border: 1px solid var(--trait); background: var(--case); cursor: zoom-in; }
.vignette img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ajout-photo { position: relative; display: inline-flex; align-items: center; justify-content: center; border: 1px dashed var(--trait); color: var(--encre-2); cursor: pointer; }
.ajout-photo .ico { width: 22px; height: 22px; }
.ajout-photo:focus-within, label.bouton:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.cache { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.nouveau-chantier { display: flex; flex-direction: column; gap: 10px; }
.nouveau-chantier input[type="text"], .nouveau-chantier select { min-height: 48px; padding: 0 12px; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); color: inherit; font: inherit; }
.nouveau-chantier-ligne { display: flex; flex-wrap: wrap; gap: 8px; }
.nouveau-chantier-ligne select { flex: 1 1 170px; }
.nouveau-chantier-ligne label.bouton { position: relative; }
.visionneuse { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; background: rgb(0 0 0 / 0.86); }
.visionneuse img { max-width: 100%; max-height: calc(100% - 80px); object-fit: contain; border-radius: 10px; }
.travaux .nom { line-height: 1.25; }
.bouton-petit.a-confirmer { background: var(--accent); color: var(--accent-encre); }
.carte-compacte { padding: 12px 16px; gap: 6px; }
.capteur-ligne { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.capteur-ligne .ico-petit { align-self: center; flex: none; }
.capteur-ligne .nom { font-weight: 700; }
.capteur-ligne .sous { margin-left: auto; white-space: nowrap; }
.capteur-valeurs { display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.capteur-valeur { font-size: 20px; font-weight: 700; line-height: 1.1; }
.capteur-valeur + .capteur-valeur { font-size: 16px; font-weight: 600; color: var(--encre-2); }
.capteur-ligne.ancien { opacity: .55; }

/* Boutons et formulaire */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 700; cursor: pointer; }
.bouton .ico { width: 22px; height: 22px; }
.bouton-principal { border: 0; background: var(--accent); color: var(--accent-encre); }
.bouton-secondaire { border: 1px solid var(--accent); background: var(--carte); color: var(--accent); }
.lien-bouton { text-decoration: none; }
.ajout { display: flex; gap: 8px; }
.ajout input { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 12px; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); }
.ajout-course { display: flex; flex-direction: column; gap: 8px; }
.ajout-course > input { min-height: 48px; padding: 0 12px; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); }
.article input:disabled { opacity: .5; }
.groupes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 18px 24px; }
.groupe { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.groupe h3 { margin-bottom: 4px; }
/* Tous, ou un magasin à la fois : une rangée de boutons au-dessus de la liste, qui défile sur un écran étroit. */
.choix-magasin { display: flex; gap: 8px; overflow-x: auto; margin: -2px 0 12px; padding-bottom: 4px; scrollbar-width: thin; }
.choix-magasin button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--trait); border-radius: 999px; background: var(--carte); color: var(--encre); font-size: 15px; font-weight: 600; cursor: pointer; }
.choix-magasin button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-encre); }
.choix-magasin .compte { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--accent-doux); color: var(--accent); font-size: 13px; text-align: center; }
.choix-magasin button[aria-pressed="true"] .compte { background: var(--carte); }
.articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 0 24px; }
.chez { align-self: flex-start; margin-top: 2px; padding: 0 7px; border-radius: 6px; background: var(--accent-doux); color: var(--accent); font-size: 12px; font-weight: 600; }
.article { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 6px 0; cursor: pointer; }
.article input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.article-texte { display: flex; flex-direction: column; min-width: 0; }
.article.fait .article-nom { text-decoration: line-through; color: var(--encre-3); }
/* L'urgence d'un article (05/11) : un (!) rond, allumé en rouge quand il ne peut pas attendre la prochaine tournée. */
.article .bouton-urgent { flex: none; margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--trait); background: transparent; color: var(--encre-3); font-size: 17px; font-weight: 800; line-height: 1; cursor: pointer; opacity: .45; }
.article .bouton-urgent:hover, .article .bouton-urgent:focus-visible { opacity: 1; }
.article .bouton-urgent[aria-pressed="true"] { opacity: 1; background: var(--critique); border-color: var(--critique); color: var(--carte); }
.article .bouton-urgent:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.article-nom.urgent { font-weight: 700; }
.choix-magasin .marque-urgent { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--critique); color: var(--carte); font-size: 12px; font-weight: 800; }
.cote { display: flex; flex-direction: column; gap: 12px; }
.disposition-courses { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.disposition-courses > .liste { flex: 999 1 560px; min-width: 0; }
.disposition-courses > .cote { flex: 1 1 280px; min-width: 0; }
.miniature-article { flex: none; width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--trait); background: #fff; object-fit: contain; }

/* Produits habituels, sous la liste de courses */
.habituels { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.habituels-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
/* Le tri des produits habituels, à côté du titre : sur plusieurs lignes s'il le faut ; sur un téléphone, une rangée qui défile. */
.choix-habituels { flex: 1 1 320px; min-width: 0; flex-wrap: wrap; margin: 0; padding-bottom: 0; overflow-x: visible; }
.habituels-aide { flex-basis: 100%; }
@media (max-width: 700px) {
  .choix-habituels { flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}
/* Les produits habituels en tuiles : la miniature d'abord, le nom en dessous, « + » dans le coin. */
.tuiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.tuile { position: relative; min-width: 0; }
.tuile-fiche { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 0; border: 0; background: none; color: var(--encre); text-align: left; cursor: pointer; }
.tuile-image { position: relative; display: block; }
.tuile-image > img:not(.tuile-logo), .tuile-sans-photo { display: block; width: 100%; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--trait); background: #fff; object-fit: contain; }
.tuile-sans-photo { display: flex; align-items: center; justify-content: center; background: var(--case); color: var(--encre-3); border-style: dashed; }
.tuile-sans-photo .ico { width: 34px; height: 34px; }
.tuile-nom { font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
/* Le logo de l'enseigne : une petite vignette, en bas à gauche de la miniature, à côté du magasin d'un article et dans
   les puces du choix du magasin. Sans logo, les initiales du magasin. */
.logo-enseigne { flex: none; width: 18px; height: 18px; border-radius: 4px; background: #fff; object-fit: contain; vertical-align: middle; }
.logo-enseigne.initiales { display: inline-flex; align-items: center; justify-content: center; background: var(--case); color: var(--encre-2); font-size: 9px; font-weight: 700; letter-spacing: -.02em; }
.choix-magasin .logo-enseigne { width: 22px; height: 22px; border-radius: 50%; margin-left: -6px; box-shadow: 0 0 0 1px var(--trait); }
.choix-magasin .logo-enseigne.initiales { font-size: 10px; }
.chez { display: inline-flex; align-items: center; gap: 5px; }
.chez .logo-enseigne { width: 16px; height: 16px; margin-left: -4px; }
.chez .logo-enseigne.initiales { font-size: 8px; }
.tuile-logo { position: absolute; left: 6px; bottom: 6px; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--trait); box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.tuile-logo.initiales { font-size: 12px; }
.tuile-ajout { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-encre); box-shadow: 0 1px 4px rgb(0 0 0 / .25); cursor: pointer; }
.tuile-ajout .ico { width: 22px; height: 22px; }
.tuile-ajout:disabled { opacity: .5; }
.fiche-produit { display: flex; flex-direction: column; gap: 8px; width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 18px; border-radius: 16px; background: var(--carte); color: var(--encre); }
.fiche-produit img { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 10px; background: #fff; }
.fiche-produit h2 { margin: 4px 0 0; font-size: 20px; }
.fiche-produit p { margin: 0; }
.fiche-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.garder-produit { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--trait); }
.ajout-produit { display: flex; flex-direction: column; gap: 8px; }
.ajout-produit label.bouton { position: relative; flex: none; }

/* Onglets */
.onglets {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 18px;
}
/* Les onze écrans forment la liste d'onglets ; le Chat, au bout, est un lien vers l'application : il quitte le tableau. */
.onglets-liste { display: contents; }
.onglets .onglet-lien { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; min-height: 60px; border-radius: 13px; box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); min-width: 0; overflow: hidden; font-size: 15px; font-weight: 700; text-decoration: none; }
.onglets .onglet-lien:active { background: var(--accent); color: var(--accent-encre); }
.onglets button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; border: 0; border-radius: 13px; background: transparent; color: var(--encre-2); font-size: 15px; font-weight: 700; cursor: pointer; }
.onglets button[aria-selected="true"] { background: var(--accent); color: var(--accent-encre); }
.onglets .lib-court { display: none; }

/* Fermentations */
.lot-jours { display: flex; align-items: baseline; gap: 10px; }
.lot-j { font-family: var(--police-titre); font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.lot-barre { position: relative; height: 14px; border-radius: 7px; background: var(--case); overflow: hidden; }
.lot-fenetre { position: absolute; top: 0; bottom: 0; background: var(--alerte-doux); }
.lot-avance { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 7px; background: var(--ok); }
.lot-alerte .lot-avance { background: var(--alerte); }
.lot-critique .lot-avance { background: var(--critique); }
.lot-ligne { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--encre-2); }
.lot-ligne .ico-petit { flex: none; }
/* La recette d'un lot (09/11) : un lien vers l'onglet Recettes, ou « Recette manquante ». */
.lot-recette { background: none; border: 0; padding: 4px 0; min-height: 44px; font: inherit; color: var(--accent); text-align: left; cursor: pointer; }
.lot-recette span { text-decoration: underline; text-underline-offset: 3px; }
.lot-sans-recette { color: var(--alerte); }
/* Les lots d'une recette (10/11) : rangés sous leur version, comme des forks ; la version suivie sur la carte du lot. */
.lot-version { margin-left: 6px; color: var(--encre-2); text-decoration: none; }
.lot-ecarts { color: var(--encre-2); }
.lots-version + .lots-version { margin-top: 16px; }
.lots-version-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.lots-forks { margin: 6px 0 0 6px; padding-left: 12px; border-left: 2px solid var(--case); }
.lots-aucun { margin: 4px 0 0 18px; }
/* Les soins d'un lot (05/11) : les rappels partis sans réponse, le dernier fait, et qui s'en occupe. */
.soins { margin: 2px 0 0; }
.soins .soin-attente .nom { font-size: 15px; }
.soin-fait { color: var(--ok); }
.lot-responsable { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.choix-personne { margin: 0; }

/* Véhicules */
.vehicules-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1000px) { .vehicules-page { grid-template-columns: minmax(0, 3fr) minmax(340px, 2fr); } }
.vehicules-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; align-items: start; min-width: 0; }
.vehicule-complet { grid-column: 1 / -1; }
.vehicule-haut { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.vehicule-image { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 10px; border-radius: 12px; background: linear-gradient(180deg, var(--case), transparent); }
.vehicule-dessin { display: block; width: 100%; height: 200px; }
.vehicule-complet .vehicule-dessin { height: 230px; }
.vehicule-detoure { display: block; width: 100%; height: 230px; object-fit: contain; }
.vehicule-ombre { fill: rgb(30 40 60 / .13); }
.voiture-face { stroke: rgb(0 0 0 / .14); stroke-width: .6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vehicule-ombre { fill: rgb(0 0 0 / .35); }
  :root:not([data-theme="light"]) .vehicule-dessin, :root:not([data-theme="light"]) .vehicule-detoure { filter: drop-shadow(0 0 1px rgb(255 255 255 / .75)) drop-shadow(0 0 8px rgb(255 255 255 / .1)); }
}
:root[data-theme="dark"] .vehicule-ombre { fill: rgb(0 0 0 / .35); }
:root[data-theme="dark"] .vehicule-dessin, :root[data-theme="dark"] .vehicule-detoure { filter: drop-shadow(0 0 1px rgb(255 255 255 / .75)) drop-shadow(0 0 8px rgb(255 255 255 / .1)); }
.vehicule-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; align-items: start; }
.tuile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 12px; background: var(--case); }
.tuile-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 40px; }
.tuile-titre { margin-right: auto; font-size: 13px; font-weight: 700; color: var(--encre-3); text-transform: uppercase; letter-spacing: 0.06em; }
.tuile-chiffre { font-family: var(--police-titre); font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tuile .bouton-secondaire { background: transparent; }
.vehicule-bloc { display: flex; flex-direction: column; gap: 2px; }
.titre-bloc { font-size: 15px; font-weight: 700; color: var(--encre-2); }
.vehicule-historique summary { min-height: 40px; display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.vehicule-historique summary::-webkit-details-marker { display: none; }
.vehicule-historique summary::after { content: "▸"; color: var(--encre-3); }
.vehicule-historique[open] summary::after { content: "▾"; }
.vehicule-sans-km { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.vehicule-sans-km .releve-km { align-self: stretch; }
.carte-tete > a.bouton { flex: none; text-decoration: none; }
.releve-km, .releve-carburant { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.releve-km input, .releve-carburant input { flex: 1 1 130px; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); color: inherit; font: inherit; }
.carburant-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.carburant-textes { min-width: 0; }
/* Téléphone : le texte d'une ligne prend toute la largeur, son urgence et « Fait » passent dessous. */
@media (max-width: 520px) {
  .carte-vehicule .reparations li, .carte-vehicule .echeances li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .carte-vehicule .mouvement-fin { justify-content: space-between; }
}
.carburant-alerte { color: var(--alerte); }
.carburant-critique { color: var(--critique); }
.jauge-carburant { width: 84px; height: 54px; flex: none; }
.jauge-carburant .seg { fill: none; stroke-width: 10; }
.jauge-carburant .seg-eteint { stroke: var(--trait); }
.jauge-carburant .seg-ok { stroke: var(--ok); }
.jauge-carburant .seg-alerte { stroke: var(--alerte); }
.jauge-carburant .seg-critique { stroke: var(--critique); }
.jauge-carburant .seg-neutre { stroke: var(--encre-3); }
.jauge-carburant text { font-size: 11px; font-weight: 700; fill: var(--encre-3); }
/* Les prix des carburants : une ligne par station, une colonne par carburant */
.carburants { width: 100%; border-collapse: collapse; font-size: 15px; }
.carburants th, .carburants td { padding: 9px 0; border-top: 1px solid var(--trait-doux); text-align: left; vertical-align: middle; }
.carburants thead th { border-top: 0; padding-top: 0; font-size: 13px; font-weight: 700; color: var(--encre-3); text-transform: uppercase; letter-spacing: 0.06em; }
.carburants tbody th { font-weight: 400; }
.carburants .prix { padding-left: 14px; text-align: right; white-space: nowrap; }
.station { display: flex; align-items: center; gap: 12px; }
.station-logo { flex: none; display: flex; align-items: center; justify-content: center; width: 68px; height: 34px; padding: 3px 5px; border-radius: 8px; background: #fff; color: var(--encre-3); }
.station-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.station-texte { display: flex; flex-direction: column; min-width: 0; }
.station-nom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.station-preferee th, .station-preferee td { background: var(--ok-doux); }
.station-preferee th { padding-left: 10px; border-radius: 10px 0 0 10px; }
.station-preferee td:last-child { padding-right: 10px; border-radius: 0 10px 10px 0; }
.prix-chiffre { font-family: var(--police-titre); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.prix-min .prix-chiffre { color: var(--ok); }
.prix-vieux .prix-chiffre { color: var(--encre-3); font-weight: 600; }
.prix-age { display: block; font-size: 12px; color: var(--encre-3); }
.carburants .prix-absent { padding-left: 14px; text-align: right; color: var(--encre-3); }
.entretiens li { padding: 8px 0; }

/* Recettes : lisibles à un mètre, les mains dans la farine. Les cases se cochent sur la tablette seulement. */
/* Les menus : les sept soirs côte à côte, ce soir souligné, un soir vide en pointillés. */
.menus-semaine { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.menu-soir { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 14px 16px 16px; border: 1px solid var(--trait); border-radius: 14px; background: var(--carte); }
.menu-soir.ce-soir { border: 2px solid var(--accent); }
.menu-soir.sans-diner { border-style: dashed; background: transparent; }
.menu-jour { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.menu-libelle { font-family: var(--police-titre); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--encre-3); }
.ce-soir .menu-libelle { color: var(--accent); }
.menu-vignette { display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--case); }
.menu-vignette img { display: block; width: 100%; height: 100%; object-fit: cover; }
.menu-plat { margin: 0; font-family: var(--police-titre); font-size: 21px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.menu-ligne { margin: 0; font-size: 16px; }
/* Parents et enfants (09/11) : une étiquette au-dessus de chaque plat ; celui des enfants, sur un fond à part. */
.menu-pour { display: flex; flex-direction: column; gap: 2px; }
.menu-pour-enfants { padding: 6px 10px; border-radius: 10px; background: var(--case); }
.menu-qui { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--encre-2); }
.menu-penser { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--accent-doux); font-size: 15px; }
.menu-penser .ico { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--accent); }
.menu-cantine { margin: 0; }
/* La semaine et le chat avec @cuisine : côte à côte sur un grand écran, le chat sous la semaine sinon. */
.menus-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1100px) {
  .menus-page { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
}
/* La colonne de droite : les idées de dîner, puis le chat. */
.menus-cote { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.idees-choix { flex-wrap: wrap; overflow: visible; margin: 0 0 8px; }
.idees-pour-soir { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.idees-soir { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--trait); border-radius: 12px; background: var(--carte); color: inherit; font: inherit; font-size: 16px; }
.idee { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 2px solid var(--accent); border-radius: 14px; background: var(--carte); }
.idee-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.idee-mesures { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.idee-temps { margin: 0; font-weight: 700; color: var(--accent); }
/* L'équilibre : les trois parts de l'assiette, l'absente en grisé barré. */
.idee-equilibre ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.idee-equilibre li { display: flex; gap: 8px; font-size: 15px; }
.idee-equilibre .idee-part { flex: none; width: 76px; font-weight: 700; color: var(--encre-2); }
.idee-equilibre li.absent span:last-child { color: var(--encre-3); font-style: italic; }
.idee-equilibre p { margin: 6px 0 0; }
.idee-pourquoi { margin: 0; font-size: 16px; }
.idee-stock ul { margin: 4px 0 0; padding-left: 18px; }
.idee-stock li { font-size: 15px; }
.idee-vide { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.idees-attente { margin: 8px 0; }
.menu-soir-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; width: 100%; }
.menu-modifier { flex: none; }
.menu-soir.en-edition { border-style: solid; border-color: var(--accent); background: var(--carte); }
.menu-soir-saisie { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.menu-soir-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-chat-fil { display: flex; flex-direction: column; gap: 10px; max-height: min(52vh, 520px); overflow-y: auto; padding: 2px; overscroll-behavior: contain; }
.menu-bulle { max-width: 92%; padding: 10px 14px; border-radius: 14px; }
.menu-bulle p { margin: 0; white-space: pre-line; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.menu-bulle.de-moi { align-self: flex-end; background: var(--accent); color: var(--accent-encre); border-bottom-right-radius: 4px; }
.menu-bulle.de-loki { align-self: flex-start; background: var(--case); border: 1px solid var(--trait-doux); border-bottom-left-radius: 4px; }
.menu-bulle-qui { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--encre-3); }
.menu-chat-attente { margin: 0; }
.menu-chat-idees { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-chat-idees .bouton { white-space: normal; text-align: left; }
.menu-chat-saisie { display: flex; gap: 8px; align-items: stretch; }
.menu-chat-champ { flex: 1 1 auto; min-width: 0; min-height: 50px; padding: 0 14px; border: 1px solid var(--trait); border-radius: 12px; background: var(--carte); color: inherit; font: inherit; font-size: 17px; }
.menu-chat-champ:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.recherche-recettes { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 14px; border: 1px solid var(--trait); border-radius: 12px; background: var(--carte); }
.recherche-recettes:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.recherche-recettes .ico { flex: none; color: var(--encre-3); }
.recherche-recettes input { flex: 1 1 auto; min-width: 0; min-height: 50px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 18px; outline: none; }
.recettes-liste { display: flex; flex-direction: column; gap: 18px; }
.recettes-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.recette-ligne { display: flex; flex-direction: column; align-items: stretch; overflow: hidden; padding: 0; border: 1px solid var(--trait); border-radius: 14px; background: var(--carte); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.recette-texte { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 16px 14px; }
/* La vignette : la photo du plat, ou le pictogramme de sa famille sur une teinte douce. */
/* Le cadre garde son format quel que soit celui de l'image : une photo en hauteur ne l'étire pas. */
.recette-vignette { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--trait-doux); }
.recette-vignette img { position: absolute; inset: 0; }
/* Une illustration trouvée par Loki n'est pas la photo du plat de la maison : elle le dit. */
.vignette-mention { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgb(0 0 0 / .58); color: #fff; font-size: 12px; font-weight: 700; }
.credit-illustration { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.credit-illustration .sous { flex: 1 1 260px; font-size: 13px; }
.recette-vignette img, .recette-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.recette-vignette .ico { width: 60px; height: 60px; stroke-width: 1.4; }
.recette-categorie { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--encre-3); }
.sans-photo.ton-ble { background: var(--alerte-doux); color: var(--alerte); }
.sans-photo.ton-rose { background: var(--critique-doux); color: var(--critique); }
.sans-photo.ton-vert { background: var(--ok-doux); color: var(--ok); }
.sans-photo.ton-bleu { background: var(--accent-doux); color: var(--accent); }
/* La photo du plat, à droite du titre : les ingrédients restent à l'écran ; un appui l'agrandit. */
.recette-tete { flex-wrap: nowrap; align-items: center; }
.recette-tete-texte { flex: 1 1 auto; min-width: 0; }
.recette-photo { flex: none; display: block; width: clamp(140px, 22vw, 240px); aspect-ratio: 4 / 3; overflow: hidden; padding: 0; border: 1px solid var(--trait); border-radius: 14px; background: var(--case); cursor: zoom-in; }
@media (max-width: 559px) {
  .recette-tete { flex-wrap: wrap; }
  .recette-photo { width: 100%; aspect-ratio: 16 / 9; }
}
.recette-barre label.bouton { position: relative; }
.bouton.occupe { opacity: .6; pointer-events: none; }
.recette-ligne:active { background: var(--accent-doux); }
.recette-titre { font-family: var(--police-titre); font-size: 20px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.recette-infos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.recette-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.recette-corps { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
.ingredients, .etapes { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ingredient { padding: 10px 0; border-top: 1px solid var(--trait-doux); font-size: 19px; line-height: 1.35; }
.ingredients li:first-child .ingredient, .etapes li:first-child .etape { border-top: 0; }
.ingredient input { width: 26px; height: 26px; margin-top: 1px; }
.ingredient.fait .article-texte, .etape.fait .etape-texte { color: var(--encre-3); text-decoration: line-through; }
.etape { display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--trait-doux); background: none; color: inherit; font: inherit; font-size: 19px; line-height: 1.4; text-align: left; cursor: pointer; }
.etape-num { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-doux); color: var(--accent); font-family: var(--police-titre); font-size: 17px; font-weight: 700; }
.etape.fait .etape-num { background: var(--ok-doux); color: var(--ok); }
.variantes li, .notes-recette li { align-items: start; }
@media (max-width: 860px) {
  .recette-corps { grid-template-columns: minmax(0, 1fr); }
}

/* Annonce brève, en bas */
.annonce { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: min(560px, calc(100% - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--encre); color: var(--fond); font-size: 15px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); }

/* Écran peu haut (tablette en paysage) : on serre, pour tenir l'accueil sur un écran. */
@media (max-height: 760px) and (min-width: 700px) {
  .app { padding-block: 12px; gap: 12px; }
  .vue, .colonne, .grille-3, .grille-2 { gap: 12px; }
  .carte { padding: 14px; gap: 10px; }
  .horloge { font-size: clamp(52px, 6vw, 80px); }
  .date { font-size: 18px; margin-top: 2px; }
  .temp { font-size: 44px; }
  .gros { font-size: 34px; }
  .ico-meteo { width: 48px; height: 48px; }
  .heure { padding: 6px 4px; }
  .departs li { padding: 7px 0; }
  .onglets button, .onglets .onglet-lien { min-height: 52px; }
  .stock-chiffre { font-size: 76px; }
  .bouton-geant { min-height: 64px; }
}

/* Douze onglets : « Véhicules » ne tient en entier qu'à partir de 1 290 px de large environ. */
@media (max-width: 1289px) {
  .onglets .lib-long { display: none; }
  .onglets .lib-court { display: inline; }
}

@media (max-width: 899px) {
  .onglets button, .onglets .onglet-lien { font-size: 12px; }
}

@media (max-width: 520px) {
  .zones { grid-template-columns: minmax(0, 1fr); }
  .onglets { gap: 2px; padding: 4px; }
  .onglets button, .onglets .onglet-lien { min-height: 56px; }
  .stock-chiffre { font-size: 72px; }
}

/* Téléphone : les douze libellés ne tiennent plus côte à côte, les onglets gardent leur pictogramme (et leur nom pour les lecteurs d'écran). */
@media (max-width: 699px) {
  .onglets button, .onglets .onglet-lien { font-size: 0; gap: 0; }
  .onglets button .ico, .onglets .onglet-lien .ico { width: 24px; height: 24px; }
}

/* --- Le congélateur en vue isométrique (web/congelo.js), dans les couleurs de la maison (/maison) ------------------ */
:root {
  --cg-caisse: #FBFCFD; --cg-caisse-g: #E8ECF0; --cg-caisse-d: #F3F5F7;
  --cg-cuve: #E4EDF4; --cg-cuve-paroi: #D3E0EA; --cg-cuve-sol: #EDF3F8;
  --cg-verre: rgb(196 222 236 / .75); --cg-verre-g: rgb(160 196 216 / .8); --cg-verre-d: rgb(176 208 226 / .8);
  --cg-bac: rgb(226 238 246 / .55); --cg-bac-trait: rgb(150 180 200 / .7);
  --cg-socle: #C9CED4; --cg-socle-g: #B4BAC1; --cg-socle-d: #A6ADB5;
  --cg-joint: #CBD3DA; --cg-afficheur: #1E2A36; --cg-afficheur-texte: #7DC3FF;
  --cg-ombre: rgb(30 40 60 / .18);
  --fam-legumes: #7DB96A; --fam-viande: #DB7B7D; --fam-poisson: #7FA8D8; --fam-plat: #E3B067; --fam-dessert: #D9A6D4;
  --fam-pain: #D2AE80; --fam-graines: #C9C27A; --fam-sauce: #E07E55; --fam-glace: #6EC6E6; --fam-autre: #B5BEC8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cg-caisse: #C9D1D9; --cg-caisse-g: #9AA5B0; --cg-caisse-d: #B2BCC6;
    --cg-cuve: #3A4856; --cg-cuve-paroi: #33404D; --cg-cuve-sol: #44525F;
    --cg-verre: rgb(120 160 185 / .55); --cg-verre-g: rgb(90 130 155 / .7); --cg-verre-d: rgb(105 145 170 / .7);
    --cg-bac: rgb(150 180 200 / .25); --cg-bac-trait: rgb(170 200 220 / .55);
    --cg-socle: #545B63; --cg-socle-g: #474D54; --cg-socle-d: #3E444A;
    --cg-joint: #7B8792; --cg-ombre: rgb(0 0 0 / .45);
  }
}
:root[data-theme="dark"] {
  --cg-caisse: #C9D1D9; --cg-caisse-g: #9AA5B0; --cg-caisse-d: #B2BCC6;
  --cg-cuve: #3A4856; --cg-cuve-paroi: #33404D; --cg-cuve-sol: #44525F;
  --cg-verre: rgb(120 160 185 / .55); --cg-verre-g: rgb(90 130 155 / .7); --cg-verre-d: rgb(105 145 170 / .7);
  --cg-bac: rgb(150 180 200 / .25); --cg-bac-trait: rgb(170 200 220 / .55);
  --cg-socle: #545B63; --cg-socle-g: #474D54; --cg-socle-d: #3E444A;
  --cg-joint: #7B8792; --cg-ombre: rgb(0 0 0 / .45);
}

.congelo-vue { display: grid; grid-template-columns: minmax(260px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
.congelo-scene { background: var(--carte); border: 1px solid var(--trait); border-radius: 16px; padding: 12px; position: sticky; top: 12px; }
.congelo-dessin { display: block; width: 100%; height: auto; max-height: 72vh; }
.congelo-legende { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 8px 4px 0; font-size: 13px; color: var(--encre-2); }
.congelo-legende span { display: inline-flex; align-items: center; gap: 5px; }
.congelo-legende i, .congelo-liste .puce { display: inline-block; width: 11px; height: 11px; border-radius: 3px; flex: none; }
@media (max-width: 860px) { .congelo-vue { grid-template-columns: minmax(0, 1fr); } .congelo-scene { position: static; } .congelo-dessin { max-height: 60vh; } }

.congelo-dessin .ombre-sol { fill: var(--cg-ombre); }
.congelo-dessin .socle.dessus { fill: var(--cg-socle); }
.congelo-dessin .socle.cote-g { fill: var(--cg-socle-g); }
.congelo-dessin .socle.cote-d { fill: var(--cg-socle-d); }
.congelo-dessin .caisse.dessus, .congelo-dessin .battant.dessus { fill: var(--cg-caisse); }
.congelo-dessin .caisse.cote-g, .congelo-dessin .battant.cote-d { fill: var(--cg-caisse-g); }
.congelo-dessin .caisse.cote-d { fill: var(--cg-caisse-d); }
.congelo-dessin .battant.cote-g { fill: var(--cg-caisse); }
.congelo-dessin .caisse, .congelo-dessin .battant { stroke: rgb(40 60 80 / .12); stroke-width: .4; stroke-linejoin: round; }
.congelo-dessin .joint { fill: none; stroke: var(--cg-joint); stroke-width: 1.4; }
.congelo-dessin .cuve.fond { fill: var(--cg-cuve); }
.congelo-dessin .cuve.paroi { fill: var(--cg-cuve-paroi); }
.congelo-dessin .cuve.sol { fill: var(--cg-cuve-sol); }
.congelo-dessin .clayette.dessus { fill: var(--cg-verre); }
.congelo-dessin .clayette.cote-g { fill: var(--cg-verre-g); }
.congelo-dessin .clayette.cote-d { fill: var(--cg-verre-d); }
.congelo-dessin .bac { fill: var(--cg-bac); stroke: var(--cg-bac-trait); stroke-width: .5; }
.congelo-dessin .fond-bac { fill: var(--cg-cuve-sol); }
.congelo-dessin .poignee { fill: var(--cg-bac-trait); }
.congelo-dessin .afficheur { fill: var(--cg-afficheur); }
.congelo-dessin .afficheur-texte { fill: var(--cg-afficheur-texte); font: 700 6px var(--police-titre); }

/* Les paquets : la couleur de leur famille, le dessus plus clair, les côtés plus sombres. */
.congelo-dessin .pq { stroke: rgb(30 40 50 / .18); stroke-width: .35; stroke-linejoin: round; }
.congelo-dessin .pq.dessus { filter: brightness(1.12); }
.congelo-dessin .pq.cote-g { filter: brightness(.9); }
.congelo-dessin .pq.cote-d { filter: brightness(.8); }
.fam-legumes .pq, .puce.fam-legumes, .congelo-legende .fam-legumes { fill: var(--fam-legumes); background: var(--fam-legumes); }
.fam-viande .pq, .puce.fam-viande, .congelo-legende .fam-viande { fill: var(--fam-viande); background: var(--fam-viande); }
.fam-poisson .pq, .puce.fam-poisson, .congelo-legende .fam-poisson { fill: var(--fam-poisson); background: var(--fam-poisson); }
.fam-plat .pq, .puce.fam-plat, .congelo-legende .fam-plat { fill: var(--fam-plat); background: var(--fam-plat); }
.fam-dessert .pq, .puce.fam-dessert, .congelo-legende .fam-dessert { fill: var(--fam-dessert); background: var(--fam-dessert); }
.fam-pain .pq, .puce.fam-pain, .congelo-legende .fam-pain { fill: var(--fam-pain); background: var(--fam-pain); }
.fam-graines .pq, .puce.fam-graines, .congelo-legende .fam-graines { fill: var(--fam-graines); background: var(--fam-graines); }
.fam-sauce .pq, .puce.fam-sauce, .congelo-legende .fam-sauce { fill: var(--fam-sauce); background: var(--fam-sauce); }
.fam-glace .pq, .puce.fam-glace, .congelo-legende .fam-glace { fill: var(--fam-glace); background: var(--fam-glace); }
.fam-autre .pq, .puce.fam-autre, .congelo-legende .fam-autre { fill: var(--fam-autre); background: var(--fam-autre); }

/* Les zones : un bouton chacune. La cible ne se voit qu'au survol, au focus, ou quand la zone est choisie. */
.congelo-dessin .zone, .congelo-dessin .pastille-zone { cursor: pointer; outline: none; }
.congelo-dessin .cible { fill: transparent; stroke: transparent; stroke-width: 1.2; }
.congelo-dessin .zone:hover .cible, .congelo-dessin .zone:focus-visible .cible { fill: rgb(29 63 143 / .08); stroke: var(--accent); stroke-dasharray: 3 2; }
.congelo-dessin .zone.choisie .cible { fill: rgb(29 63 143 / .14); stroke: var(--accent); stroke-dasharray: none; }
.congelo-dessin .zone-compte circle { fill: var(--carte); stroke: var(--accent); stroke-width: 1.2; }
.congelo-dessin .zone-compte text { fill: var(--accent); font: 800 8px var(--police-titre); }
.congelo-dessin .pastille-zone.vide circle { stroke: var(--trait); }
.congelo-dessin .pastille-zone.vide text { fill: var(--encre-3); }
.congelo-dessin .pastille-zone.choisie circle { fill: var(--accent); }
.congelo-dessin .pastille-zone.choisie text { fill: var(--accent-encre); }
/* Le code du compartiment, à côté de la pastille : hors du rond, il garde la couleur de l'encre, même choisi. */
.congelo-dessin .pastille-zone text.zone-code, .congelo-dessin .pastille-zone.vide text.zone-code, .congelo-dessin .pastille-zone.choisie text.zone-code { fill: var(--encre); font: 800 9px var(--police-titre); }

/* La liste à côté : une carte par zone, ou la zone choisie seule. */
.congelo-liste { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.congelo-liste .zone-titre { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.congelo-liste .zone-titre h2 { margin: 0; font-family: var(--police-titre); font-size: 18px; }
.congelo-liste .zone-titre .sous { white-space: nowrap; }
.congelo-liste .carte.choisie { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.congelo-liste ul { list-style: none; margin: 0; padding: 0; }
.congelo-liste li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--trait-doux); }
.congelo-liste li .puce { transform: translateY(1px); }
.congelo-liste li .detail { color: var(--encre-2); font-size: 14px; }

/* Les rappels de l'accueil : le jour et l'heure en pavé, un titre court, le détail replié sur deux lignes. */
.rappels li.rappel { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 12px; align-items: start; padding-top: 10px; border-top: 1px solid var(--trait-doux); }
.rappels li.rappel:first-child { padding-top: 0; border-top: 0; }
.rappel-quand { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border-radius: 10px; background: var(--accent-doux); color: var(--accent); text-align: center; line-height: 1.15; }
.rappel-quand .jour { font-size: 12px; font-weight: 700; }
.rappel-quand .heure { font-family: var(--police-titre); font-size: 16px; font-weight: 800; }
.rappel-corps { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rappel-corps[role="button"] { cursor: pointer; border-radius: 8px; }
.rappel-corps[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.rappel-titre { font-weight: 700; }
.rappel-detail { color: var(--encre-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rappel.ouvert .rappel-detail { display: block; -webkit-line-clamp: unset; }
.congelo-liste .zones-vides { display: flex; flex-wrap: wrap; gap: 8px; }
.congelo-liste .zone-vide { min-height: 36px; padding: 6px 12px; border: 1px solid var(--trait); border-radius: 999px; background: var(--case); color: var(--encre-2); font: inherit; font-size: 14px; cursor: pointer; }
.congelo-liste .zone-vide:hover { border-color: var(--accent); color: var(--accent); }

/* Les produits du congélateur en tuiles : la miniature d'abord, le nom et la quantité dessous. */
.congelo-tuiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.congelo-tuile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0; border: 0; }
.congelo-tuile .sous { font-size: 13px; line-height: 1.2; }
.congelo-initiale { font-family: var(--police-titre); font-size: 34px; font-weight: 800; color: rgb(255 255 255 / .92); border: 0; text-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.tuile-marque { position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: rgb(22 32 42 / .72); color: #fff; font-size: 11px; font-weight: 700; }
.congelo-liste li.congelo-tuile { display: flex; flex-direction: column; align-items: stretch; padding: 0; border-top: 0; }
.congelo-initiale.fam-legumes { background: var(--fam-legumes); }
.congelo-initiale.fam-viande { background: var(--fam-viande); }
.congelo-initiale.fam-poisson { background: var(--fam-poisson); }
.congelo-initiale.fam-plat { background: var(--fam-plat); }
.congelo-initiale.fam-dessert { background: var(--fam-dessert); }
.congelo-initiale.fam-pain { background: var(--fam-pain); }
.congelo-initiale.fam-graines { background: var(--fam-graines); }
.congelo-initiale.fam-sauce { background: var(--fam-sauce); }
.congelo-initiale.fam-glace { background: var(--fam-glace); }
.congelo-initiale.fam-autre { background: var(--fam-autre); }
.livraisons .nom { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* L'onglet Cultures : l'emoji de la famille du lot (ferment, pousses, micropousses, champignons) à la place de l'icône. */
.lot-emoji { flex: none; font-size: 26px; line-height: 1; }

/* Le rangement à tiroirs (web/rangements.js) : un caisson de bois clair, des façades, une plaque par tiroir. */
:root { --rg-caisson: #E9DCC6; --rg-caisson-g: #D6C4A6; --rg-caisson-d: #C8B492; --rg-facade: #F7F1E6; --rg-facade-g: #E4D8C2; --rg-plaque: #FFFFFF; --rg-encre: #4A3F2F; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --rg-caisson: #6E6352; --rg-caisson-g: #5C5244; --rg-caisson-d: #51483B; --rg-facade: #8A7E6A; --rg-facade-g: #756A58; --rg-plaque: #E9E3D8; --rg-encre: #2B241A; }
}
:root[data-theme="dark"] { --rg-caisson: #6E6352; --rg-caisson-g: #5C5244; --rg-caisson-d: #51483B; --rg-facade: #8A7E6A; --rg-facade-g: #756A58; --rg-plaque: #E9E3D8; --rg-encre: #2B241A; }
.congelo-dessin .caisson.dessus { fill: var(--rg-caisson); }
.congelo-dessin .caisson.cote-g { fill: var(--rg-caisson-g); }
.congelo-dessin .caisson.cote-d { fill: var(--rg-caisson-d); }
.congelo-dessin .facade-tiroir.cote-d { fill: var(--rg-facade); }
.congelo-dessin .facade-tiroir.cote-g, .congelo-dessin .facade-tiroir.dessus { fill: var(--rg-facade-g); }
.congelo-dessin .facade-tiroir, .congelo-dessin .caisson { stroke: rgb(60 45 25 / .18); stroke-width: .35; stroke-linejoin: round; }
.congelo-dessin .tiroir-flanc { fill: var(--rg-facade-g); }
.congelo-dessin .plaque { fill: var(--rg-plaque); stroke: rgb(60 45 25 / .25); stroke-width: .25; }
.congelo-dessin .plaque-texte { fill: var(--rg-encre); font: 700 2.6px var(--police-texte); }
.congelo-dessin .facade-tiroir.ouverte { fill-opacity: .28; }
