/* LA RUBRIQUE « ALIMENTATION » DE LA FICHE (13 novembre 2026) — voir alimentation.js.
   Rien que les variables de la charte (styles.css) : le mode sombre les redéfinit
   (sombre.css), cette feuille n'a donc AUCUNE couleur en dur à tenir à part.
   Les lignes, les tuiles et les chevrons sont ceux du chantier « des lignes qu'on
   voit » (.carte-liste, .ligne-echeance, .tuile-icone, .chevron-ligne) ; seules
   la jauge et la feuille à questions sont neuves. */

/* --- Sur la fiche ---------------------------------------------------------- */
.alim-ligne { position: relative; }
/* Le filet part du texte, après la tuile (16 + 44 + 12 px), comme les autres listes. */
.alim-ligne + .alim-ligne::before {
  content: ''; position: absolute; top: 0; left: 72px; right: 0; height: 1px; background: var(--bordure);
}
.alim-ligne .ligne-echeance { align-items: flex-start; flex-wrap: nowrap; }
.alim-ligne .chevron-ligne { align-self: center; }
.alim-lecture { cursor: default; }
.alim-lecture:hover, .alim-lecture:active { background: none; }
.alim-tuile { background: var(--statut-bientot-fond); color: var(--statut-bientot-texte); }
.alim-action { align-items: center !important; }
.alim-action .ligne-echeance-titre { color: var(--olive-fonce); }
.alim-plus { font-size: 24px; font-weight: 400; line-height: 1; }
/* La ligne « à commander » de l'accueil et de l'agenda (app-client.js, lignesACommander). */
.tuile-icone.alimentation, .pastille-echeance.alimentation { background: var(--statut-bientot-fond); color: var(--statut-bientot-texte); }

.alim-jauge {
  display: block; height: 6px; margin-top: 7px; border-radius: 3px; overflow: hidden;
  background: var(--olive-clair);
}
.alim-jauge-pleine { display: block; height: 100%; border-radius: 3px; background: var(--statut-ok); }
.alim-jauge-basse { background: var(--statut-bientot-fond); }
.alim-jauge-basse .alim-jauge-pleine { background: var(--statut-bientot); }
.alim-reste { font-size: 13px; font-weight: 600; color: var(--statut-ok-texte); }
.alim-reste-bas { color: var(--statut-bientot-texte); }
.alim-partage { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 13px; color: var(--texte-doux); }
.alim-coche { display: inline-flex; flex: none; width: 16px; height: 16px; color: var(--statut-ok-texte); }
.alim-coche svg { width: 16px; height: 16px; }
.alim-rachat { padding: 0 16px 14px 72px; }
.alim-bouton-rachat { width: 100%; min-height: 44px; }

/* --- La feuille : une question par écran ------------------------------------- */
.alim-feuille {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 901; box-sizing: border-box;
  max-height: 92vh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 16px calc(24px + var(--zone-sure-bas));
  background: var(--fond); color: var(--texte);
  border-radius: 20px 20px 0 0; box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.2);
  animation: alim-feuille-monte 0.2s ease-out;
}
/* Sur un écran large : une fenêtre au milieu, pas une bande collée en bas. */
@media (min-width: 600px) {
  .alim-feuille {
    left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; max-height: 86vh;
    transform: translate(-50%, -50%); border-radius: 20px; padding-bottom: 24px;
    box-shadow: var(--ombre-relief), 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: alim-feuille-apparait 0.16s ease-out;
  }
}
@keyframes alim-feuille-monte { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes alim-feuille-apparait { from { opacity: 0; } to { opacity: 1; } }

/* UNE HAUTEUR QUI NE BOUGE PAS d'une question à l'autre (13 novembre 2026) : la
   feuille qui rétrécit puis regrandit à chaque réponse donnait un parcours sec.
   La petite question du rachat, posée depuis la fiche, garde sa taille. */
.alim-feuille-haute { height: min(92vh, 640px); }
@media (min-width: 600px) { .alim-feuille-haute { height: min(86vh, 620px); } }

/* L'ÉCRAN GLISSE, la barre reste : de la droite en avançant, de la gauche en revenant. */
.alim-ecran-avant { animation: alim-glisse-avant 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
.alim-ecran-arriere { animation: alim-glisse-arriere 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes alim-glisse-avant { from { transform: translateX(36px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes alim-glisse-arriere { from { transform: translateX(-36px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .alim-feuille, .alim-ecran-avant, .alim-ecran-arriere { animation: none; }
}

.alim-barre { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
/* LES GESTES DE LA FEUILLE ne sont plus des liens soulignés (.bouton-lien) :
   du texte à la couleur de la charte, comme une barre de navigation. */
.alim-geste {
  min-height: 44px; padding: 0; font: inherit; font-size: 16px; color: var(--olive-fonce);
  background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.alim-geste:active { opacity: 0.55; }
.alim-geste:disabled { opacity: 0.4; cursor: default; }
.alim-gauche, .alim-passer { flex: 0 0 84px; }
.alim-gauche { text-align: left; }
.alim-passer { text-align: right; }
/* « Retour » porte son chevron, comme partout où l'on revient d'un cran. */
.alim-retour::before {
  content: ''; display: inline-block; width: 9px; height: 9px; margin: 0 5px 1px 2px;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.alim-points { display: flex; gap: 6px; }
.alim-point { width: 6px; height: 6px; border-radius: 3px; background: var(--bordure); }
.alim-point-fait { background: var(--olive); }
/* « balance » : le point d'interrogation ne part pas seul à la ligne. */
.alim-question { margin: 6px 0 10px; font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; outline: none; text-wrap: balance; }
.alim-aide { margin: 0 0 14px; }

.alim-recherche { width: 100%; box-sizing: border-box; min-height: 44px; margin: 0 0 6px; }
.alim-famille {
  margin: 16px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--texte-doux);
}
.alim-groupe { margin-bottom: 14px; background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre-carte); overflow: hidden; }
.alim-rangee {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box;
  min-height: 48px; padding: 10px 14px; text-align: left; font: inherit; color: inherit;
  background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.alim-rangee + .alim-rangee::before {
  content: ''; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--bordure);
}
.alim-rangee:hover { background: var(--survol-ligne); }
.alim-rangee:active { background: var(--appui-ligne); }
.alim-rangee-libelle { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.alim-rangee-libelle small { font-size: 13px; color: var(--texte-doux); }
.alim-rangee-droite { flex: 0 1 auto; max-width: 55%; text-align: right; font-size: 13px; color: var(--texte-doux); overflow-wrap: anywhere; }
.alim-rangee-choisie .alim-rangee-libelle { font-weight: 600; }
.alim-rangee .chevron-ligne { color: var(--chevron-ligne); }

.alim-etiquette { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.alim-champ { width: 100%; box-sizing: border-box; min-height: 44px; }
.alim-suite { margin-top: 14px; }
/* La taille du sac, à toucher : quatre par rangée, « Autre » en dernier. */
.alim-puces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.alim-puce {
  min-height: 44px; padding: 0 4px; font: inherit; font-size: 15px; font-weight: 600; color: var(--texte);
  background: var(--carte); border: 1px solid var(--bordure); border-radius: 12px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.alim-puce:hover { background: var(--survol-ligne); }
.alim-puce-prise, .alim-puce-prise:hover { background: var(--olive-fonce); border-color: var(--olive-fonce); color: var(--fond); }
.alim-poids-libre .alim-etiquette { margin-top: 10px; }
.alim-deux-boutons { display: flex; gap: 10px; }
.alim-deux-boutons > button { flex: 1; min-height: 48px; }
.alim-choix-pris { background: var(--olive-fonce); border-color: var(--olive-fonce); color: var(--fond); }
.alim-resultat {
  margin: 16px 0 0; padding: 12px 14px; border-radius: var(--rayon-petit);
  background: var(--statut-ok-fond); color: var(--statut-ok-texte); font-size: 14px; font-weight: 600; line-height: 1.4;
}
.alim-apercu { margin: 0 0 18px; padding: 14px 16px; background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon); }
.alim-apercu-titre { margin: 0; font-weight: 700; }
.alim-apercu-origine {
  margin: 3px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--statut-bientot-texte);
}
.alim-apercu-ligne { display: flex; flex-direction: column; gap: 3px; margin: 0; padding-top: 10px; border-top: 1px solid var(--bordure); }
.alim-etat-sac { margin: 4px 0 6px; }
.alim-etat-sac .alim-jauge { margin: 0 0 6px; height: 8px; border-radius: 4px; }
.alim-retirer, .alim-effacer { display: block; width: 100%; min-height: 44px; margin-top: 6px; text-align: center; }
.alim-retirer { color: var(--statut-urgent-texte); }
.alim-rachat-detail { margin: 6px 0 18px; }
#alim-feuille-message { margin-top: 14px; }

/* Hors connexion (application installée) : la rubrique ne se charge pas, et
   rien ne s'y écrit — elle n'est pas dans la copie du carnet, à dessein. */
body.hors-connexion #alim-ajouter,
body.hors-connexion .alim-bouton-rachat { opacity: 0.5; pointer-events: none; }
