/* ============================================================
   Bar IA — base : reset, typographie, colonne, composants.
   Mobile-first (390 px), colonne centrée à 520 px au-delà.
   Aucune couleur en dur : tout passe par tokens.css.
   ============================================================ */

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

/* P17 : le débordement horizontal se coupe sur html, jamais sur body — sur iOS, un overflow sur body déplace le
   défilement du viewport vers body et fait flotter les éléments fixed / sticky (barre d'onglets, en-tête). */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bar-fond);
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bar-fond);
  color: var(--bar-texte);
  font: 400 var(--bar-corps) / 1.4 var(--bar-police);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body.bar-avec-onglets {
  padding-bottom: calc(var(--bar-onglets) + env(safe-area-inset-bottom, 0px) + var(--bar-e4));
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; user-select: none; -webkit-user-select: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--bar-action); outline-offset: 3px; border-radius: 6px; }

/* ---------- Colonne ---------- */
.bar-app {
  width: 100%;
  max-width: var(--bar-colonne);
  margin: 0 auto;
  padding: 0 var(--bar-e4);
}

/* ---------- En-tête ---------- */
.bar-entete { position: sticky; top: 0; z-index: 5; background: var(--bar-fond); }
.bar-entete__ligne {
  display: flex;
  align-items: center;
  gap: var(--bar-e3);
  min-height: 60px;
  padding-top: env(safe-area-inset-top, 0px);
}
.bar-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bar-puce);
  color: var(--bar-texte);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--bar-second);
}
.bar-entete__nom {
  min-width: 0;
  font-weight: 700;
  font-size: var(--bar-t3);
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-espace { flex: 1; }

/* ---------- Interrupteur « Sans alcool » ---------- */
.bar-interrupteur {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--bar-cible);
  padding: 0 14px 0 10px;
  border-radius: var(--bar-rayon-puce);
  border: 1.5px solid var(--bar-contour);
  background: transparent;
  color: var(--bar-texte);
  font-size: var(--bar-second);
  font-weight: 600;
  transition: background var(--bar-duree), color var(--bar-duree), border-color var(--bar-duree);
}
.bar-interrupteur[aria-checked="true"] {
  background: var(--bar-action);
  color: var(--bar-sur-action);
  border-color: var(--bar-action);
}

/* ---------- Typographie ---------- */
.bar-t1 { font-size: var(--bar-t1); font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; }
.bar-t2 { font-size: var(--bar-t2); font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.bar-t3 { font-size: var(--bar-t3); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.bar-corps { font-size: var(--bar-corps); }
.bar-secondaire { color: var(--bar-secondaire); font-size: var(--bar-second); }
.bar-legende { color: var(--bar-secondaire); font-size: var(--bar-legende); }
.bar-grise { color: var(--bar-grise); }
.bar-chiffre { font-size: var(--bar-t1); font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.bar-chiffre__ref { color: var(--bar-secondaire); font-size: var(--bar-second); font-weight: 400; letter-spacing: -0.01em; }

/* ---------- Boutons ---------- */
.bar-bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--bar-cible);
  padding: 0 20px;
  border-radius: var(--bar-rayon);
  border: 0;
  background: var(--bar-action);
  color: var(--bar-sur-action);
  font-size: var(--bar-corps);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform var(--bar-duree) var(--bar-courbe), opacity var(--bar-duree);
}
.bar-bouton:active { transform: scale(0.98); }
.bar-bouton--large { width: 100%; min-height: 52px; }
.bar-bouton--secondaire { background: transparent; color: var(--bar-texte); border: 1.5px solid var(--bar-contour); }
.bar-bouton--discret { background: transparent; color: var(--bar-action-texte); padding: 0 12px; }
.bar-bouton--icone { width: var(--bar-cible); padding: 0; border-radius: 50%; background: transparent; color: var(--bar-texte); }

/* ---------- Puces ---------- */
.bar-puces { display: flex; flex-wrap: wrap; gap: 8px; }
.bar-puce {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--bar-cible);
  padding: 0 16px;
  border-radius: var(--bar-rayon-puce);
  border: 0;
  background: var(--bar-puce);
  color: var(--bar-texte);
  font-size: var(--bar-second);
  font-weight: 600;
  transition: background var(--bar-duree), color var(--bar-duree);
}
.bar-puce[aria-pressed="true"] { background: var(--bar-action); color: var(--bar-sur-action); }
.bar-puce--cocktail { background: var(--bar-puce-cocktail); color: var(--bar-puce-cocktail-texte); }
.bar-puce--soft { background: var(--bar-puce-soft); color: var(--bar-puce-soft-texte); }
.bar-puce--granite { background: var(--bar-puce-granite); color: var(--bar-puce-granite-texte); }
.bar-puce--smoothie { background: var(--bar-puce-smoothie); color: var(--bar-puce-smoothie-texte); }

/* ---------- Pastilles et statuts ---------- */
.bar-pastille {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bar-statut-gris);
  vertical-align: 1px;
  margin-right: 6px;
}
.bar-pastille--vert { background: var(--bar-statut-vert); }
.bar-pastille--orange { background: var(--bar-statut-orange); }
.bar-statut { font-size: var(--bar-legende); color: var(--bar-secondaire); }
.bar-statut--attention { color: var(--bar-attention); }

/* ---------- Cartes, piles, lignes ---------- */
.bar-carte {
  background: var(--bar-carte);
  border: 0.5px solid var(--bar-bordure);
  border-radius: var(--bar-rayon);
  padding: var(--bar-e3) var(--bar-e4);
}
.bar-carte--lien { display: block; text-decoration: none; color: inherit; }
.bar-carte--lien:active { opacity: 0.85; }
.bar-carte > .bar-legende + .bar-legende { margin-top: 4px; }
.bar-carte > .bar-chiffre + .bar-legende { margin-top: 8px; }
.bar-pile > * + * { margin-top: var(--bar-e3); }
.bar-ligne { display: flex; align-items: center; gap: var(--bar-e3); min-height: 64px; }
.bar-ligne__corps { flex: 1; min-width: 0; }
.bar-ligne__titre {
  font-weight: 700;
  font-size: var(--bar-t3);
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-ligne--grise .bar-ligne__titre,
.bar-ligne--grise .bar-statut { color: var(--bar-grise); }

/* ---------- Champs ---------- */
.bar-champ {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--bar-rayon);
  border: 1.5px solid var(--bar-contour);
  background: var(--bar-carte);
  color: var(--bar-texte);
  font-size: var(--bar-corps);
}
.bar-champ::placeholder { color: var(--bar-grise); }
.bar-champ:focus { border-color: var(--bar-action); outline: none; }

/* ---------- Tuiles famille ---------- */
.bar-tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bar-e3); }
.bar-tuile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 96px;
  padding: var(--bar-e3) var(--bar-e4);
  border-radius: var(--bar-rayon);
  border: 1.5px solid var(--bar-bordure);
  background: var(--bar-carte);
  color: var(--bar-texte);
  font-weight: 700;
  font-size: var(--bar-t3);
  letter-spacing: -0.02em;
  text-align: left;
  transition: border-color var(--bar-duree), color var(--bar-duree);
}
.bar-tuile[data-famille="cocktail"] { --bar-note: var(--bar-note-cocktail); --bar-note-texte: var(--bar-puce-cocktail-texte); }
.bar-tuile[data-famille="soft"] { --bar-note: var(--bar-note-soft); --bar-note-texte: var(--bar-puce-soft-texte); }
.bar-tuile[data-famille="granite"] { --bar-note: var(--bar-note-granite); --bar-note-texte: var(--bar-puce-granite-texte); }
.bar-tuile[data-famille="smoothie"] { --bar-note: var(--bar-note-smoothie); --bar-note-texte: var(--bar-puce-smoothie-texte); }
/* la note de couleur n'apparaît que sur la tuile sélectionnée */
.bar-tuile[aria-pressed="true"] { border-color: var(--bar-note); }
.bar-tuile[aria-pressed="true"] .bar-icone { color: var(--bar-note-texte); }

/* ---------- Silhouettes ---------- */
.bar-silhouette { width: 52px; height: auto; }
.bar-silhouette__contour {
  fill: none;
  stroke: var(--bar-trait);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.bar-silhouette__detail { fill: none; stroke: var(--bar-trait); stroke-width: 1; stroke-linecap: round; opacity: 0.6; }
.bar-silhouette__liquide { fill: var(--bar-liquide, var(--bar-liquide-neutre)); }
/* Le liquide porte une teinte (produit : sa teinte de taxonomie ; verre d'une recette : la couleur de la boisson,
   shared/couleur.js). Les notes de famille ne colorent que les tuiles et les puces, jamais un verre (P17). */
/* P14b : teinte du produit (bouteilles, jus, fruits…) ; « bientôt vide » reste ambre (règle ci-dessous, plus spécifique). */
.bar-silhouette[data-teinte="clair"] { --bar-liquide: var(--bar-teinte-clair); }
.bar-silhouette[data-teinte="paille"] { --bar-liquide: var(--bar-teinte-paille); }
.bar-silhouette[data-teinte="ambre"] { --bar-liquide: var(--bar-teinte-ambre); }
.bar-silhouette[data-teinte="brun"] { --bar-liquide: var(--bar-teinte-brun); }
.bar-silhouette[data-teinte="rouge"] { --bar-liquide: var(--bar-teinte-rouge); }
.bar-silhouette[data-teinte="bordeaux"] { --bar-liquide: var(--bar-teinte-bordeaux); }
.bar-silhouette[data-teinte="orange"] { --bar-liquide: var(--bar-teinte-orange); }
.bar-silhouette[data-teinte="jaune"] { --bar-liquide: var(--bar-teinte-jaune); }
.bar-silhouette[data-teinte="vert"] { --bar-liquide: var(--bar-teinte-vert); }
.bar-silhouette[data-teinte="rose"] { --bar-liquide: var(--bar-teinte-rose); }
.bar-silhouette[data-teinte="blanc"] { --bar-liquide: var(--bar-teinte-blanc); }
.bar-silhouette[data-teinte="bleu"] { --bar-liquide: var(--bar-teinte-bleu); }
.bar-silhouette[data-teinte="violet"] { --bar-liquide: var(--bar-teinte-violet); }
.bar-silhouette--bas .bar-silhouette__liquide { fill: var(--bar-attention-liquide); }
.bar-silhouette--absent .bar-silhouette__contour,
.bar-silhouette--absent .bar-silhouette__detail { stroke: var(--bar-trait-absent); }

.bar-grille-produits { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--bar-e3) var(--bar-e2); }
.bar-produit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: var(--bar-cible);
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--bar-texte);
  text-align: center;
}
.bar-produit__nom { font-size: var(--bar-legende); line-height: 1.2; color: var(--bar-secondaire); max-width: 84px; }
/* Marque ou saveur saisie dans la fiche : sous le nom, une ligne, coupée aux points de suspension. */
.bar-produit__marque { font-size: var(--bar-mini); line-height: 1.2; color: var(--bar-texte); max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -3px; }
.bar-produit--absent .bar-produit__nom { color: var(--bar-grise); }

/* ---------- Animation signature : le verre se remplit ---------- */
@keyframes bar-remplir {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
.bar-verre--remplit .bar-silhouette__liquide {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: bar-remplir var(--bar-duree-verre) var(--bar-courbe) both;
}

/* ---------- Squelette (statique : une seule animation dans l'app) ---------- */
.bar-squelette { background: var(--bar-puce); border-radius: 8px; min-height: 14px; }
/* P14 : largeurs des squelettes et blocs sans attribut style (CSP style-src 'self'). */
.bar-squelette[data-l="35"] { width: 35%; } .bar-squelette[data-l="40"] { width: 40%; } .bar-squelette[data-l="50"] { width: 50%; }
.bar-squelette[data-l="60"] { width: 60%; } .bar-squelette[data-l="65"] { width: 65%; } .bar-squelette[data-l="70"] { width: 70%; }
.bar-squelette[data-l="75"] { width: 75%; } .bar-squelette[data-l="80"] { width: 80%; } .bar-squelette[data-l="85"] { width: 85%; }
.bar-squelette[data-haut] { min-height: 20px; }
.bar-bloc { display: block; }
.bar-ligne--libre { min-height: auto; }

/* ---------- Barre d'onglets ---------- */
.bar-onglets {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--bar-fond);
  border-top: 0.5px solid var(--bar-bordure);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bar-onglets__liste { display: flex; margin: 0 auto; max-width: var(--bar-colonne); }
.bar-onglets__liste li { flex: 1; min-width: 0; }
.bar-onglet {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: var(--bar-onglets);
  border: 0;
  background: none;
  color: var(--bar-secondaire);
  font-size: var(--bar-mini);
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  transition: color var(--bar-duree);
}
.bar-onglet[aria-current="page"] { color: var(--bar-action-texte); }

/* ---------- Écrans ---------- */
.bar-ecran { padding: var(--bar-e3) 0 var(--bar-e5); }
.bar-ecran > * + * { margin-top: var(--bar-e4); }
.bar-vide { padding: var(--bar-e5) 0; }
.bar-vide > * + * { margin-top: var(--bar-e3); }
.bar-message { color: var(--bar-secondaire); font-size: var(--bar-second); }
.bar-icone { flex: none; }

/* ---------- Sections et catégories ---------- */
.bar-section > * + * { margin-top: var(--bar-e3); }
.bar-section__titre { display: flex; align-items: center; justify-content: space-between; gap: var(--bar-e3); }
.bar-categorie + .bar-categorie { margin-top: var(--bar-e4); }
.bar-categorie > h3 { margin-bottom: var(--bar-e2); }

/* ---------- Frais (Mes produits frais) ---------- */
.bar-frais { display: flex; flex-wrap: wrap; gap: 8px; }
.bar-puce--frais { padding-right: 12px; }
.bar-puce__age { color: var(--bar-secondaire); font-weight: 400; font-size: var(--bar-legende); margin-left: 4px; }
.bar-puce--grise { color: var(--bar-grise); background: transparent; border: 1.5px dashed var(--bar-contour); }
.bar-puce--grise .bar-puce__age { color: var(--bar-grise); }

/* ---------- Bouton flottant (Ajouter, Continuer) ---------- */
.bar-flottant {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bar-onglets) + env(safe-area-inset-bottom, 0px));
  z-index: 9;
  pointer-events: none;
}
.bar-flottant__inner { max-width: var(--bar-colonne); margin: 0 auto; padding: 8px var(--bar-e4) 12px; display: flex; justify-content: flex-end; }
.bar-flottant__inner--large { justify-content: stretch; }
.bar-flottant .bar-bouton { pointer-events: auto; }
body.bar-avec-flottant { padding-bottom: calc(var(--bar-onglets) + env(safe-area-inset-bottom, 0px) + 84px); }
body:not(.bar-avec-onglets) .bar-flottant { bottom: env(safe-area-inset-bottom, 0px); }

/* ---------- Grille sélectionnable (première minute, inventaire éclair) ---------- */
.bar-produit[aria-pressed="true"] { outline: 2px solid var(--bar-action); outline-offset: 2px; border-radius: 12px; }
.bar-produit[aria-pressed="true"] .bar-produit__nom { color: var(--bar-texte); }

/* ---------- Voile, feuille basse, toast ---------- */
.bar-voile { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.45); }
.bar-feuille {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  max-height: 88dvh;
  overflow: auto;
  margin: 0 auto;
  max-width: var(--bar-colonne);
  background: var(--bar-carte);
  border-radius: 20px 20px 0 0;
  padding: 10px var(--bar-e4) calc(var(--bar-e4) + env(safe-area-inset-bottom, 0px));
}
.bar-feuille__poignee { width: 36px; height: 4px; border-radius: 2px; background: var(--bar-contour); margin: 0 auto 12px; }
.bar-feuille__entete { display: flex; align-items: center; gap: var(--bar-e3); margin-bottom: var(--bar-e3); }
.bar-feuille__titre { flex: 1; min-width: 0; font-size: var(--bar-t2); font-weight: 900; letter-spacing: -0.02em; }
.bar-feuille__corps > * + * { margin-top: var(--bar-e4); }
.bar-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--bar-onglets) + env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 30;
  max-width: calc(100% - 32px);
  background: var(--bar-texte);
  color: var(--bar-fond);
  padding: 10px 16px;
  border-radius: var(--bar-rayon-puce);
  font-weight: 600;
  font-size: var(--bar-second);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.bar-avec-flottant .bar-toast { bottom: calc(var(--bar-onglets) + env(safe-area-inset-bottom, 0px) + 88px); }

/* ---------- Fiche produit ---------- */
.bar-fiche__tete { display: flex; align-items: center; gap: var(--bar-e3); }
/* Actions d'une fiche (P17) : en ligne au-delà de 480 px ; en dessous, l'action principale prend la ligne et les
   suivantes se partagent la suivante (jamais un libellé sur plus de deux lignes). Avec .bar-pile : une par ligne. */
.bar-fiche__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--bar-e5); }
.bar-fiche__actions > .bar-bouton:first-child { flex: 1; }
.bar-fiche__actions > .bar-bouton--icone { flex: none; }
.bar-fiche__actions.bar-pile { display: block; }
@media (max-width: 479px) {
  .bar-fiche__actions > :first-child, .bar-fiche__actions > .bar-bouton:first-child { flex: 1 1 100%; }
  .bar-fiche__actions > :not(:first-child):not(.bar-bouton--icone) { flex: 1 1 0; min-width: 0; padding-left: 12px; padding-right: 12px; }
}
.bar-rangee { display: flex; align-items: center; justify-content: space-between; gap: var(--bar-e3); min-height: 52px; }
.bar-champ-ligne { display: block; }
.bar-champ-ligne > .bar-legende { display: block; margin-bottom: 6px; }
.bar-choix-silhouettes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.bar-choix-silhouettes button { min-height: var(--bar-cible); display: grid; place-items: center; background: none; border: 0; padding: 4px; border-radius: 10px; color: inherit; }
.bar-choix-silhouettes button[aria-pressed="true"] { outline: 2px solid var(--bar-action); outline-offset: -2px; }

/* ---------- Listes (recherche, à racheter) et menu ---------- */
.bar-liste > * + * { border-top: 0.5px solid var(--bar-bordure); }
.bar-liste__ligne {
  display: flex;
  align-items: center;
  gap: var(--bar-e3);
  width: 100%;
  min-height: 56px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--bar-texte);
  text-align: left;
}
a.bar-liste__ligne { text-decoration: none; }
.bar-liste__ligne .bar-silhouette { width: 28px; flex: none; }
/* Ligne avec un ⋯ à droite (carnet commun) : le lien prend la ligne, le bouton reste à côté (jamais un bouton dans un lien). */
.bar-liste__lien { display: flex; align-items: center; gap: var(--bar-e3); flex: 1; min-width: 0; min-height: 44px; color: inherit; text-decoration: none; }
.bar-liste__ligne--menu { padding-right: 0; }
.bar-menu > * + * { border-top: 0.5px solid var(--bar-bordure); }
.bar-menu__item {
  display: flex;
  align-items: center;
  gap: var(--bar-e3);
  width: 100%;
  min-height: 52px;
  border: 0;
  background: none;
  color: var(--bar-texte);
  font-size: var(--bar-corps);
  text-align: left;
}
.bar-menu__item > span:first-of-type { flex: 1; }

/* ---------- Carnet ---------- */
.bar-puces--defilantes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bar-puces--defilantes::-webkit-scrollbar { display: none; }
.bar-puces--defilantes .bar-puce { flex: none; }
.bar-puce--petite { padding: 0 12px; font-size: var(--bar-legende); }
.bar-segments { display: flex; gap: 6px; }
.bar-segment {
  flex: 1;
  min-height: var(--bar-cible);
  border-radius: var(--bar-rayon);
  border: 1.5px solid var(--bar-contour);
  background: transparent;
  color: var(--bar-texte);
  font-size: var(--bar-second);
  font-weight: 600;
}
.bar-segment[aria-pressed="true"] { background: var(--bar-puce); border-color: var(--bar-puce); }
.bar-groupe { display: flex; align-items: baseline; gap: 8px; margin-top: var(--bar-e4); }
.bar-groupe__n { color: var(--bar-secondaire); font-weight: 400; font-size: var(--bar-second); }
.bar-ligne--recette { text-decoration: none; color: inherit; }
.bar-ligne--recette .bar-statut { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-carnet__pied { margin-top: var(--bar-e4); }

/* ---------- Fiche recette ---------- */
.bar-fiche { padding-top: var(--bar-e2); }
.bar-fiche > * + * { margin-top: 10px; }
.bar-fiche__barre { display: flex; align-items: center; gap: 8px; }
.bar-fiche__titre { display: flex; align-items: center; gap: var(--bar-e3); }
.bar-ingredients { display: grid; grid-template-columns: 76px 1fr; row-gap: 4px; column-gap: 10px; font-size: var(--bar-second); }
.bar-ingredient { display: contents; }
.bar-ingredient__qte { color: var(--bar-secondaire); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-ingredient--manque .bar-ingredient__nom { color: var(--bar-grise); }
.bar-etapes { padding-left: 22px; font-size: var(--bar-second); line-height: 1.4; }
.bar-etapes li + li { margin-top: 4px; }
.bar-effet { color: var(--bar-secondaire); font-size: var(--bar-second); }
.bar-pourquoi summary {
  display: flex;
  align-items: center;
  min-height: var(--bar-cible);
  cursor: pointer;
  list-style: none;
  color: var(--bar-action-texte);
  font-size: var(--bar-second);
  font-weight: 600;
}
.bar-pourquoi summary::-webkit-details-marker { display: none; }
.bar-pourquoi ul { font-size: var(--bar-second); color: var(--bar-secondaire); }
.bar-pourquoi li + li { margin-top: 6px; }
.bar-pourquoi strong { color: var(--bar-texte); font-weight: 600; }
.bar-question { margin-top: var(--bar-e3); }

/* ---------- Créer : épinglés, attente, résultat ---------- */
.bar-epingles { display: flex; flex-wrap: wrap; gap: 8px; }
.bar-puce--epingle { padding-right: 4px; }
.bar-puce--tiret { background: transparent; border: 1.5px dashed var(--bar-contour); color: var(--bar-secondaire); }
.bar-puce__x { display: grid; place-items: center; width: 36px; height: 36px; margin-left: 2px; border: 0; border-radius: 50%; background: transparent; color: inherit; }
.bar-attente > * + * { margin-top: 10px; }
.bar-attente__lignes { flex: 1; display: grid; gap: 8px; }
.bar-reactions { display: flex; gap: 8px; }
.bar-modifier { display: flex; gap: 8px; }
.bar-modifier .bar-champ { flex: 1; min-width: 0; }
.bar-modifier .bar-bouton { flex: none; }
.bar-version { color: var(--bar-action-texte); }
.bar-question .bar-message { margin-top: 8px; }

/* ---------- Notation, notes, versions ---------- */
.bar-etoiles { display: flex; gap: 4px; }
.bar-etoile { flex: 1; min-height: 56px; display: grid; place-items: center; border: 0; border-radius: var(--bar-rayon); background: var(--bar-puce); color: var(--bar-secondaire); }
.bar-etoile[aria-pressed="true"] { color: var(--bar-attention); }
.bar-etoile[aria-pressed="true"] svg { fill: currentColor; }
.bar-etoiles-mini { display: inline-flex; gap: 1px; vertical-align: -3px; color: var(--bar-attention); }
.bar-etoiles-mini .bar-etoile-mini--pleine svg { fill: currentColor; }
.bar-etoiles-mini .bar-etoile-mini { color: var(--bar-grise); }
.bar-segments--court { flex: none; }
.bar-segments--court .bar-segment { flex: none; padding: 0 12px; font-size: var(--bar-legende); }
.bar-vignette { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; }
.bar-vignette--grande { width: 64px; height: 64px; }
.bar-notes { display: grid; gap: 10px; }
.bar-note { display: flex; align-items: center; gap: var(--bar-e3); }
.bar-note__corps { flex: 1; min-width: 0; font-size: var(--bar-second); }
.bar-versions { display: grid; gap: 6px; }
.bar-version-ligne { display: flex; align-items: baseline; gap: 10px; min-height: var(--bar-cible); text-decoration: none; color: inherit; font-size: var(--bar-second); }
.bar-version-ligne--courante .bar-version-ligne__nom { color: var(--bar-action-texte); font-weight: 700; }
.bar-version-ligne__v { flex: none; width: 28px; color: var(--bar-secondaire); font-variant-numeric: tabular-nums; }
.bar-bandeau { display: flex; align-items: center; justify-content: space-between; gap: var(--bar-e3); }
.bar-texte-long { min-height: 96px; padding: 10px 14px; resize: vertical; line-height: 1.4; }

/* ---------- Nous : amis, courses ---------- */
.bar-course { display: flex; align-items: center; gap: var(--bar-e3); min-height: 56px; }
.bar-course__coche { width: var(--bar-cible); height: var(--bar-cible); flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--bar-contour); background: transparent; color: transparent; }
.bar-course__coche:active { color: var(--bar-sur-action); background: var(--bar-action); border-color: var(--bar-action); }
.bar-unlock { justify-content: flex-start; padding: 0; margin-top: 8px; }
.bar-liste__ligne .bar-avatar { width: 36px; height: 36px; }
.bar-puce[aria-disabled="true"] { opacity: 0.55; }
.bar-puce[aria-disabled="true"][aria-pressed="true"] { opacity: 1; }

/* ---------- Soirée ---------- */
.bar-lien-soiree { display: flex; align-items: center; gap: 10px; min-height: var(--bar-cible); padding: 0 var(--bar-e3); border-radius: var(--bar-rayon); background: var(--bar-carte); border: 0.5px solid var(--bar-bordure); color: var(--bar-texte); font-weight: 600; text-decoration: none; }
.bar-lien-soiree > span { flex: 1; }
.bar-compteur { display: inline-flex; align-items: center; gap: 10px; }
.bar-compteur__n { min-width: 28px; text-align: center; font-size: var(--bar-t2); font-weight: 900; font-variant-numeric: tabular-nums; }
.bar-item-menu { padding: var(--bar-e3) 0; }
.bar-item-menu + .bar-item-menu { border-top: 0.5px solid var(--bar-bordure); }
.bar-item-menu > * + * { margin-top: 8px; }
.bar-ingredients--menu { grid-template-columns: 64px 1fr; font-size: var(--bar-legende); }

/* ---------- Mode préparation (plein écran, toujours en nuit) ---------- */
body.bar-plein-ecran .bar-entete, body.bar-plein-ecran .bar-onglets { display: none; }
body.bar-plein-ecran { padding-bottom: 0; }
.bar-preparation {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  max-width: var(--bar-colonne);
  margin: 0 auto;
  background: var(--bar-fond);
  color: var(--bar-texte);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--bar-e4) calc(env(safe-area-inset-bottom, 0px) + 16px);
}
.bar-preparation__barre { display: flex; align-items: center; gap: 8px; }
.bar-preparation__nom { margin-top: var(--bar-e3); }
.bar-preparation__etape { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--bar-e3); }
.bar-preparation__texte { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.bar-preparation__ingredients { font-size: var(--bar-t2); font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.bar-preparation__ingredients li + li { margin-top: 6px; }
.bar-preparation__ingredients .bar-ingredient__qte { font-weight: 400; }
.bar-preparation__points { display: flex; justify-content: center; gap: 6px; margin: var(--bar-e3) 0; }
.bar-preparation__point { width: 8px; height: 8px; border-radius: 50%; background: var(--bar-puce); }
.bar-preparation__point--actif { background: var(--bar-action); }
.bar-preparation__nav { display: flex; gap: 8px; }
.bar-preparation__nav > .bar-bouton { flex: 1; min-height: 52px; }
.bar-preparation__nav > .bar-bouton[disabled] { opacity: 0.4; }

/* ---------- Entrée ---------- */
.bar-entree { padding-top: var(--bar-e7); }
.bar-entree__marque { color: var(--bar-action-texte); margin-bottom: var(--bar-e3); }

/* ---------- Sections repliables (P18) : <details> natif, titre + compteur + chevron, corps en carte ---------- */
.bar-repli { margin-top: var(--bar-e4); }
.bar-repli__titre { display: flex; align-items: center; gap: var(--bar-e3); min-height: var(--bar-cible); cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none; }
.bar-repli__titre::-webkit-details-marker { display: none; }
.bar-repli__texte { flex: 1; min-width: 0; }
.bar-repli__chevron { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bar-puce); color: var(--bar-secondaire); transition: transform var(--bar-duree); }
.bar-repli[open] > .bar-repli__titre .bar-repli__chevron { transform: rotate(180deg); }
.bar-repli__corps { margin-top: var(--bar-e2); }
.bar-repli__corps.bar-carte > .bar-liste > :first-child { border-top: 0; }
.bar-repli__corps > .bar-bouton--discret { margin-top: var(--bar-e2); }

/* Nous : la carte Moi (prénom, notes, ce que l'IA sait de toi) sur deux lignes */
.bar-carte--moi { padding-top: 0; padding-bottom: 0; }
.bar-carte--moi > * + * { border-top: 0.5px solid var(--bar-bordure); }
.bar-ligne-carte { display: flex; align-items: center; gap: var(--bar-e3); width: 100%; min-height: 56px; padding: 8px 0; border: 0; background: none; color: inherit; text-align: left; }

/* Carnet : segment + « Filtrer » sur une ligne, filtres actifs en puces fermables */
.bar-carnet__barre { display: flex; gap: 8px; align-items: center; }
.bar-carnet__barre .bar-segments { flex: 1; min-width: 0; }
.bar-puce--filtre { flex: none; padding: 0 14px; }
.bar-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bar-action); color: var(--bar-sur-action); font-size: var(--bar-mini); font-weight: 700; }
.bar-puce[aria-pressed="true"] .bar-badge { background: var(--bar-sur-action); color: var(--bar-action); }
.bar-puce--actif { padding-right: 6px; }

/* Bar en étagères : une par catégorie, les bouteilles posées sur un trait continu, l'étiquette dessous */
.bar-etagere + .bar-etagere { margin-top: var(--bar-e4); }
.bar-etagere__nom { margin-bottom: 2px; }
.bar-etagere__rangee { display: grid; grid-template-columns: repeat(5, 1fr); column-gap: 0; row-gap: var(--bar-e3); align-items: start; }
.bar-etagere .bar-produit { gap: 0; padding: 0; width: 100%; }
.bar-produit__etiquette { width: 100%; padding: 5px 3px 0; border-top: 2px solid var(--bar-contour); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.bar-etagere .bar-produit__nom { font-size: var(--bar-mini); line-height: 1.15; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bar-etagere .bar-produit__marque { max-width: 100%; margin-top: 0; color: var(--bar-secondaire); }
@media (min-width: 480px) { .bar-etagere__rangee { grid-template-columns: repeat(6, 1fr); } }
.bar-compteur__ligne { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; margin-top: var(--bar-e2); }
.bar-compteur__ligne .bar-lien-carnet { margin-left: auto; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* P13b : sous-titre de section, avatar de l'écran prénom, trois gestes, section vide avec son bouton, lien du compteur. */
.bar-section__sous { margin-top: 2px; }
.bar-carte--profil { width: 100%; text-align: left; }
.bar-avatar--grand { width: 72px; height: 72px; font-size: var(--bar-t2); margin-bottom: var(--bar-e3); }
.bar-gestes > * + * { margin-top: var(--bar-e3); }
.bar-geste { display: grid; grid-template-columns: auto 1fr; gap: var(--bar-e3); align-items: center; }
.bar-geste__icone { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--bar-puce); color: var(--bar-action-texte); }
.bar-geste > .bar-bouton { grid-column: 1 / -1; justify-content: center; }
.bar-vide-section > .bar-bouton { margin-top: var(--bar-e3); }
.bar-lien-carnet { display: flex; align-items: center; gap: 2px; color: var(--bar-action-texte); }
.bar-carte > .bar-legende + .bar-lien-carnet, .bar-carte > .bar-unlock + .bar-lien-carnet { margin-top: var(--bar-e2); }

/* Installation iOS (P13) : la liste numérotée de la feuille. */
.bar-etapes--installation { margin: var(--bar-e3) 0 var(--bar-e4); padding-left: var(--bar-e5); }
.bar-etapes--installation li { margin-top: var(--bar-e2); }
.bar-etapes--installation .bar-icone { display: inline-block; vertical-align: -4px; margin-right: 2px; }
