/* ═════════════════════════════════════════════════════════════════
 * NUTRITION v5 — 05/10 · AJOUT SEUL (interrupteur nutri.v5 = '0')
 * M2 anneaux Journal · C2 Carnet 3 étapes · header figé date+Livre
 * sur Journal / Carnet / Recettes favorites.
 * Charte noir/or ; jaune #FFE566 UNIQUEMENT sur le texte de la date.
 * ═════════════════════════════════════════════════════════════════ */
html:root:root[data-nutri-v5="1"] {
  --v5-jaune: #FFE566;
  --v5-or: #E3BC52;
  --v5-or-clair: #F2D98A;
  --v5-or-fonce: #CFA32B;
  --v5-encre: #14100a;
  --v5-noir: #0c0b09;
}

/* ── Header figé : date fond NOIR + TEXTE JAUNE (gagne sur journal3 or) ── */
html:root:root[data-nutri-v5="1"][data-nutri-j3="1"] :is(.tr-nutri:has(.nf-racine) .tr-ndate-puce, .nf-cj3 .tr-ndate-puce, .v5-hdr .tr-ndate-puce) {
  background-color: var(--v5-noir) !important;
  background-image: linear-gradient(160deg, #1a1712, #0c0b09 60%, #14110c) !important;
  border: 1.5px solid rgba(227, 188, 82, .65) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -12px 20px -12px rgba(0,0,0,.95), 0 10px 22px -12px #000 !important;
  min-width: 68px !important; min-height: 72px !important; border-radius: 16px !important;
}
html:root:root[data-nutri-v5="1"][data-nutri-j3="1"] :is(.tr-nutri:has(.nf-racine) .tr-ndate-puce, .nf-cj3 .tr-ndate-puce, .v5-hdr .tr-ndate-puce) :is(.tr-ndate-sem, .tr-ndate-jr, .tr-ndate-mois) {
  color: var(--v5-jaune) !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.55) !important;
}

/* Journal : plus de + horaires (affichage seul) — eau ± gardés */
html:root:root[data-nutri-v5="1"] .nf-j2-plus,
html:root:root[data-nutri-v5="1"] .nf-j2-ajout { display: none !important; }
html:root:root[data-nutri-v5="1"] .nf-j2-carte.vide {
  pointer-events: none !important; cursor: default !important; justify-content: flex-start !important;
}
html:root:root[data-nutri-v5="1"] .nf-j2-autre { display: none !important; } /* remplacé par Ajout collation */

/* M2 anneaux macros */
html:root:root[data-nutri-v5="1"] .nf-res {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) 1.15fr !important;
  gap: 8px !important;
}
html:root:root[data-nutri-v5="1"] .nf-mc:not(.nf-mc-eau) .nf-bar { display: none !important; }
html:root:root[data-nutri-v5="1"] .nf-mc:not(.nf-mc-eau) { align-items: center !important; text-align: center !important; }
html:root:root[data-nutri-v5="1"] .v5-ring-wrap {
  position: relative; width: 64px; height: 64px; margin: 6px auto 4px;
}
html:root:root[data-nutri-v5="1"] .v5-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--v5-or) var(--p, 40%), rgba(255,255,255,.12) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
}
html:root:root[data-nutri-v5="1"] .v5-ring-wrap b {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0 !important;
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif !important;
  font-size: 13px !important; font-weight: 800 !important; color: var(--v5-or-clair) !important;
}
html:root:root[data-nutri-v5="1"] .v5-eau-niv {
  height: 48px; border-radius: 10px; margin: 6px 0;
  background: linear-gradient(180deg, transparent calc(100% - var(--eau, 0%)), rgba(120, 190, 255, .55) 0), rgba(255,255,255,.08);
  border: 1px solid rgba(120, 190, 255, .35);
}

/* Ajout collation + recherche Livre */
.v5-collation {
  margin: 14px 0 10px; padding: 12px; border-radius: 16px;
  background: linear-gradient(160deg, #241c10, #13100a);
  border: 1.5px solid rgba(227, 188, 82, .55);
}
.v5-collation .v5-btn {
  width: 100%; min-height: 52px; border-radius: 14px; border: 0;
  font: 800 15px/1.1 system-ui, sans-serif; color: var(--v5-encre);
  background-color: var(--v5-or);
  background-image: linear-gradient(160deg, #F2D98A, #E3BC52 55%, #CFA32B);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.v5-panel { margin-top: 12px; display: grid; gap: 10px; }
.v5-panel[hidden] { display: none !important; }
.v5-heures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.v5-heures button {
  min-height: 44px; min-width: 44px; border-radius: 12px;
  border: 1.5px solid rgba(227,188,82,.55); background: #0d0a06; color: var(--v5-or);
  font: 700 14px/1 system-ui;
}
.v5-heures button.on {
  background-color: var(--v5-or); background-image: linear-gradient(160deg, #F2D98A, #CFA32B);
  color: var(--v5-encre); border-color: #F2D98A;
}
.v5-rech {
  display: flex; gap: 8px; align-items: center; min-height: 48px;
  padding: 0 8px 0 14px; border-radius: 14px;
  background: #100e0c; border: 1.5px solid rgba(227,188,82,.55);
}
.v5-rech input {
  flex: 1; min-height: 44px; border: 0; outline: 0; background: transparent;
  color: #F4EFE0; font: 600 14.5px/1 system-ui;
}
.v5-rech .ico { width: 44px; height: 44px; display: grid; place-items: center; color: var(--v5-or); flex: none; }
.v5-sugg {
  border-radius: 14px; overflow: hidden; border: 1px solid rgba(227,188,82,.35); background: #0e0c0a;
}
.v5-sugg .s {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 52px; padding: 8px 14px; text-align: left;
  border: 0; border-bottom: 1px solid rgba(255,255,255,.06); background: transparent; color: #F4EFE0;
}
.v5-sugg .s:last-child { border-bottom: 0; }
.v5-sugg .s b { display: block; font: 700 14.5px/1.2 system-ui; color: #fff; }
.v5-sugg .s small { font: 600 12px/1.2 system-ui; color: #C9C2AE; }
.v5-sugg .add {
  min-width: 44px; min-height: 44px; border-radius: 12px; flex: none;
  border: 1.5px solid rgba(227,188,82,.7); background: #0d0a06; color: var(--v5-or);
  font: 800 20px/1 system-ui; display: grid; place-items: center;
}
.v5-sugg-vide { padding: 12px 14px; font: 600 13px/1.3 system-ui; color: #C9C2AE; }

/* Carnet : date+Livre hors sous J'ai mangé ; gap date→calendrier RESSERRÉ */
html:root:root[data-nutri-v5="1"] .nf-cj3 .nf-cj2-tete .tr-ndate-racine,
html:root:root[data-nutri-v5="1"] .nf-cj3 .nf-cj2-tete .nf-j3-signet,
html:root:root[data-nutri-v5="1"] .nf-cj3 .nf-cj2-tete .lv-signet,
/* 05/10 · Chef B3 : ne plus masquer la bulle signet (tip/croix immersif-nav) — était display:none */
/* html:root:root[data-nutri-v5="1"] .nf-cj3 .lv-signet-bulle { display: none !important; } */
html:root:root[data-nutri-v5="1"] .nf-cj3 .nf-cj2-tete .lv-signet { display: none !important; }   /* 05/10 · re-QC B3 : ferme la liste de sélecteurs ci-dessus (sinon elle fusionne avec la règle display:block suivante) */
html:root:root[data-nutri-v5="1"] .nf-cj3 .nf-cj2-tete {
  display: block !important;
  min-height: 0 !important;
  margin: 0 0 4px !important;
  padding: 0 !important;
  gap: 0 !important;
}
html:root:root[data-nutri-v5="1"] .nf-cj3 .nf-cj2-jour {
  text-align: left !important; margin: 0 !important; padding: 0 !important;
}
html:root:root[data-nutri-v5="1"] .nf-cj3 .nf-j3-cal {
  margin-top: 4px !important; /* collé sous la date choisie */
}
html:root:root[data-nutri-v5="1"] .nf-cj3 .v5-c2 + .nf-cj2-tete,
html:root:root[data-nutri-v5="1"] .nf-cj3 .nf-cj2-tete + .nf-j3-cal { margin-top: 4px !important; }

/* Header figé injecté (Carnet / Recettes) */
.v5-hdr {
  position: relative; z-index: 8; display: flex; align-items: flex-start;
  justify-content: space-between; padding: 10px 0 8px; min-height: 100px; gap: 8px;
}
.v5-hdr .v5-logo { flex: 1; text-align: center; padding-top: 4px; }
.v5-hdr .v5-logo .tr {
  font: italic 800 32px/1 'Barlow Condensed', system-ui, sans-serif; color: #fff;
  text-shadow: 0 2px 0 rgba(227,188,82,.35);
}
.v5-hdr .v5-logo .perf { font: 700 10px/1.1 system-ui; letter-spacing: .18em; color: #fff; margin-top: 2px; }
.v5-hdr .v5-logo .nut { font: 700 10px/1 system-ui; letter-spacing: .2em; color: var(--v5-or); margin-top: 3px; }
.v5-hdr .v5-livre {
  width: 56px; min-height: 93px; border-radius: 4px 10px 10px 4px;
  background: linear-gradient(160deg, #6b3a1e, #3a1f10);
  border: 1.5px solid rgba(227,188,82,.7);
  box-shadow: 0 8px 18px -10px #000, inset 0 1px 0 rgba(255,255,255,.25);
  position: relative; display: grid; place-items: center; padding: 0; color: transparent; font-size: 0;
}
.v5-hdr .v5-livre::after {
  content: "Livre"; position: absolute; left: 0; right: 0; top: 100%;
  margin-top: 4px; text-align: center; font: 600 11px/1.1 system-ui; color: #fff;
  background: rgba(14,14,16,.86); border-radius: 8px; padding: 4px 0; min-height: 22px;
}
.v5-hdr .v5-livre .couv {
  width: 36px; height: 52px; border-radius: 2px;
  background: linear-gradient(180deg, #8a4a28, #4a2814);
  border: 1px solid rgba(242,217,138,.4); pointer-events: none;
}

.v5-lien-fav {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 48px; margin: 0 0 10px; padding: 0 14px; border-radius: 14px;
  border: 1.5px solid rgba(227,188,82,.5); background: rgba(16,14,12,.92);
  color: #F4EFE0; font: 700 14px/1.2 system-ui;
}
.v5-lien-fav span { color: var(--v5-or); font-size: 18px; }

.v5-c2 {
  margin: 0 0 8px; padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(160deg, #241c10, #13100a);
  border: 1.5px solid rgba(227,188,82,.55);
}
.v5-c2 h3 { margin: 0 0 10px; font: 800 16px/1.2 system-ui; color: var(--v5-or-clair); }
.v5-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.v5-steps .st {
  min-height: 64px; border-radius: 12px; padding: 8px; text-align: center;
  border: 1.5px solid rgba(227,188,82,.4); background: #0d0a06; color: #F4EFE0;
  font: 600 12.5px/1.25 system-ui;
}
.v5-steps .st.on { border-color: #F2D98A; background: #1a1408; }
.v5-steps .st b { display: block; color: var(--v5-or); font-size: 18px; margin-bottom: 4px; }
.v5-c2 .v5-rech { margin-top: 0; }
.v5-c2 .hint { margin: 8px 0 0; font: 600 12px/1.3 system-ui; color: #C9C2AE; }

/* Masquer bulle Livre interactif sur les écrans v5 (header déjà clair) */
/* 05/10 · Chef B3 : ne plus masquer la bulle signet (Journal) — était display:none */
/* html:root:root[data-nutri-v5="1"] .tr-nutri .lv-signet-bulle { display: none !important; } */

/* Date dans le header injecté : annuler le position:absolute de skin-nutrition-date */
html:root:root[data-nutri-v5="1"] .v5-hdr .tr-ndate-racine,
html:root:root[data-nutri-v5="1"] .v5-hdr .tr-ndate {
  position: static !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  z-index: auto !important;
}
html:root:root[data-nutri-v5="1"] .v5-hdr .v5-hdr-date { flex: none; }

/* 05/10 09:04 · Livre header COMPACT (Recettes + Carnet) — .lv-couv immersif trop grand sinon */
html:root:root[data-nutri-v5="1"] .v5-hdr {
  min-height: 100px !important;
  max-height: 120px !important;
  overflow: visible;
  align-items: flex-start !important;
}
html:root:root[data-nutri-v5="1"] .v5-hdr .v5-livre,
html:root:root[data-nutri-v5="1"] .v5-hdr [data-v5-livre] {
  width: 48px !important;
  height: 78px !important;
  min-height: 78px !important;
  max-height: 78px !important;
  overflow: hidden !important;
  flex: none !important;
  align-self: flex-start !important;
  padding: 4px !important;
  box-sizing: border-box !important;
}
html:root:root[data-nutri-v5="1"] .v5-hdr .v5-livre::after,
html:root:root[data-nutri-v5="1"] .v5-hdr [data-v5-livre]::after {
  content: "Livre";
  position: absolute;
  left: 0; right: 0; top: 100%;
  margin-top: 3px;
  text-align: center;
  font: 600 10px/1.1 system-ui, sans-serif;
  color: #fff;
  background: rgba(14,14,16,.9);
  border-radius: 6px;
  padding: 3px 0;
  min-height: 18px;
  z-index: 2;
}
html:root:root[data-nutri-v5="1"] .v5-hdr .v5-livre .lv-couv,
html:root:root[data-nutri-v5="1"] .v5-hdr [data-v5-livre] .lv-couv,
html:root:root[data-nutri-v5="1"] .v5-hdr .v5-livre .couv,
html:root:root[data-nutri-v5="1"] .v5-hdr [data-v5-livre] .couv {
  width: 36px !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  margin: 0 auto !important;
  display: block !important;
  transform: none !important;
  position: relative !important;
  inset: auto !important;
  font-size: 0 !important;
}
html:root:root[data-nutri-v5="1"] .v5-hdr .lv-couv small,
html:root:root[data-nutri-v5="1"] .v5-hdr .lv-couv b,
html:root:root[data-nutri-v5="1"] .v5-hdr .lv-couv span:not(.lv-couv-cadre):not([class]) {
  font-size: 5px !important;
  line-height: 1.05 !important;
}
html:root:root[data-nutri-v5="1"] .v5-hdr .lv-couv-cadre {
  transform: scale(0.55);
  transform-origin: center center;
}
/* date inchangée, logo un peu plus compact pour équilibrer */
html:root:root[data-nutri-v5="1"] .v5-hdr .v5-logo .tr { font-size: 28px !important; }
