/* ═════════════════════════════════════════════════════════════════
 * NUTRITION · JOURNAL v2 (04/10, ordres d'Alexandre 17:23 → 17:28) — AJOUT SEUL, noir et or, cristal glacé discret.
 * Tout est sous html[data-nutri-j2="1"] (posé par brancherFriseNutrition tant que localStorage nutri.journal2 ≠ '0') :
 * mettre nutri.journal2 = '0' (ou ?journal2=0) rend la structure de l'ancien Journal (PAS pixel-identique à main : le cristal et le ± de l'eau du lot 1 restent ; vrai retour arrière = redéployer a31). Rien n'est supprimé : ce qui est retiré de l'affichage l'est ICI.
 * Retirés de la vue Journal : frise de la semaine, trois ronds + bulle, ligne « J'ai mangé / Carnet », carte « Aujourd'hui », signet et tuile du Livre.
 * ═════════════════════════════════════════════════════════════════ */
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) {
  --j2-or: #FFC766; --j2-or-doux: rgba(255, 199, 102, .55); --j2-verre: rgba(24, 23, 27, .62); --j2-lisere: rgba(255, 255, 255, .24);
  --j2-reflet: linear-gradient(118deg, rgba(255, 255, 255, .20) 0%, rgba(255, 255, 255, .05) 34%, rgba(255, 255, 255, 0) 56%);
}
/* ── 1. Ce qui n'est plus affiché dans le Journal (display seulement) ── */
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) :is(.nf-frisec, .nf-slot-modes, .nf-liens, .tr-nutri-jour, .lv-signet, .lv-signet-bulle, [data-lv-signet-zone], .nf-modes-aide, .tr-livre-tuile) { display: none !important; }

/* ── 2. Widget date en haut à droite (le mini-calendrier existant), cristal glacé ── */
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .tr-ndate { left: auto; right: 16px; }
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .tr-ndate-puce {
  background: var(--j2-reflet), linear-gradient(150deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .03) 60%), rgba(14, 14, 16, .66);
  border: 1px solid rgba(255, 255, 255, .34); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 8px 18px -8px rgba(0, 0, 0, .8);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) :is(.tr-ndate-puce, .tr-ndate-cal, .nonglets .nonglet, .nf-j2-carte) { -webkit-backdrop-filter: blur(12px) saturate(1.25); backdrop-filter: blur(12px) saturate(1.25); }
}
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .tr-ndate-cal { background: var(--j2-reflet), rgba(16, 15, 18, .86); border: 1px solid rgba(255, 255, 255, .28); }

/* ── 3. Les trois onglets Journal / Mes recettes / Carnet : verre givré, actif doré ── */
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nonglets .nonglet {
  position: relative; min-height: 48px; color: #F4EFE0; white-space: normal; text-align: center; line-height: 1.15; overflow: hidden;
  background: var(--j2-reflet), linear-gradient(150deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 60%), rgba(24, 24, 28, .6);
  border: 1px solid rgba(255, 255, 255, .26); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .36), 0 8px 18px -10px rgba(0, 0, 0, .85);
}
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nonglets .nonglet.actif {
  color: #14100a; font-weight: 800; border-color: rgba(255, 244, 205, .85);
  background: linear-gradient(118deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, .1) 36%, rgba(255, 255, 255, 0) 54%), linear-gradient(150deg, rgba(255, 236, 170, .96), rgba(224, 182, 70, .93) 55%, rgba(196, 150, 40, .92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 3px rgba(212, 175, 55, .2), 0 8px 18px -8px rgba(212, 175, 55, .55);
}

/* 04/10 · CORRECTIF CONTRASTE (contrôle Chef QC) : une règle déjà en prod (skin-boutons-verre-ajouts.css : html:root:root :is(…, .tr-nutri-porte, …) { background-image: … !important }) écrasait le fond doré de l'onglet actif → texte sombre sur verre sombre (2,6:1). Ajout seul : sélecteur plus fort + !important sur le fond doré (opaque), texte #14100a sur or ≥ 4,5:1 mesuré aux 3 largeurs. */
html:root:root[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nonglets .nonglet.actif {
  color: #14100a !important; text-shadow: none;
  background-color: #E3BC52 !important;
  background-image: linear-gradient(118deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, .08) 36%, rgba(255, 255, 255, 0) 54%), linear-gradient(150deg, #F2D98A, #E3BC52 55%, #CFA32B) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 3px rgba(212, 175, 55, .2), 0 8px 18px -8px rgba(212, 175, 55, .55) !important;
}
html:root:root[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nonglets .nonglet.actif * { color: inherit; }

/* Même correctif pour « Mes recettes favorites » et « Carnet » quand ils sont actifs (même défaut déjà sur main : texte #1A1206 sur verre sombre). Suit l'interrupteur nutri.journal2 (repère data-nutri-j2-onglets). */
html:root:root[data-nutri-j2-onglets="1"] .nonglet.tr-nutri-porte.actif[aria-current="page"] {
  color: #14100a !important; text-shadow: none; font-weight: 800;
  background-color: #E3BC52 !important;
  background-image: linear-gradient(118deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, .08) 36%, rgba(255, 255, 255, 0) 54%), linear-gradient(150deg, #F2D98A, #E3BC52 55%, #CFA32B) !important;
  border-color: rgba(255, 244, 205, .85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 3px rgba(212, 175, 55, .2), 0 8px 18px -8px rgba(212, 175, 55, .55) !important;
}
html:root:root[data-nutri-j2-onglets="1"] .nonglet.tr-nutri-porte.actif[aria-current="page"] * { color: inherit; }

/* ── 4. Quatre cartes d'un coup : Glucides · Lipides · Protéines · Eau (− et + seulement, aucun texte dessous) ── */
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nf-res { display: grid; grid-template-columns: 1fr 1fr 1fr 1.5fr; gap: 6px; align-items: stretch; }
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nf-res .nf-mc { grid-column: auto; padding-left: 7px; padding-right: 6px; min-width: 0; }
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nf-res .nf-mc small { font-size: 12.5px; white-space: nowrap; overflow: visible; }
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nf-mc-eau { display: flex; flex-direction: column; justify-content: space-between; padding: 8px 3px 4px; }
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nf-mc-eau > small { padding-left: 4px; }
/* la quantité et la barre restent dans le code (lecteurs d'écran) mais ne s'affichent pas sous la carte */
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nf-mc-eau > b, html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nf-mc-eau > .nf-bar {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
html[data-nutri-j2="1"] .tr-nutri:has(.nf-racine) .nf-mc-eau .nf-eau-ctl { position: static; display: flex; justify-content: center; gap: 0; margin: 0; width: auto; }

/* ── 5. Le déroulé : heures en gros (or, chiffres tabulaires) · nom du créneau plus petit · repas noté ── */
.nf-j2 { margin-top: 4px; }
.nf-j2-tl { list-style: none; margin: 0; padding: 0; position: relative; --j2-col: 74px; }
.nf-j2-tl::before { content: ""; position: absolute; left: calc(var(--j2-col) + 8px); top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, rgba(255, 199, 102, .7), rgba(255, 199, 102, .22)); }
.nf-j2-r, .nf-j2-tl > .nf-e { position: relative; display: grid; grid-template-columns: var(--j2-col) 18px minmax(0, 1fr); align-items: center; column-gap: 0; margin: 0 0 10px; }
.nf-j2-h, .nf-j2-tl > .nf-e > .nf-h {
  font-size: 23px; font-weight: 800; line-height: 1; color: var(--j2-or, #FFC766); text-align: right; padding-right: 10px; white-space: nowrap;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: -.01em;
}
.nf-j2-pt, .nf-j2-tl > .nf-e > .nf-pt { justify-self: center; width: 12px; height: 12px; margin: 0; border-radius: 50%; background: #0B0B0C; border: 2px solid var(--j2-or, #FFC766); z-index: 1; }
.nf-j2-r.plein .nf-j2-pt { background: var(--j2-or, #FFC766); box-shadow: 0 0 0 4px rgba(255, 199, 102, .2); }
.nf-j2-carte {
  position: relative; min-width: 0; margin-left: 8px; border-radius: 16px; text-align: left; color: #F6F2EC; font: inherit; overflow: hidden;
  background: var(--j2-reflet), var(--j2-verre); border: 1px solid var(--j2-lisere); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), 0 10px 22px -14px rgba(0, 0, 0, .9);
}
button.nf-j2-carte.vide { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: auto; min-height: 56px; padding: 6px 8px 6px 14px; cursor: pointer; border-style: solid; }
.nf-j2-nom { font-size: 14px; font-weight: 600; line-height: 1.2; color: #D9D2C2; letter-spacing: .01em; }
.nf-j2-plus { display: grid; place-items: center; width: 44px; height: 44px; flex: none; color: var(--j2-or, #FFC766); }
.nf-j2-plus .nf-i { width: 22px; height: 22px; stroke-width: 2.4; }
.nf-j2-carte.plein { padding: 8px 6px 4px 14px; background: var(--j2-reflet), linear-gradient(160deg, rgba(255, 199, 102, .16), rgba(255, 199, 102, .05)), var(--j2-verre); border-color: rgba(255, 199, 102, .55); }
.nf-j2-carte.plein > .nf-j2-nom { margin-bottom: 2px; }
.nf-j2-repas { display: flex; align-items: center; gap: 6px; min-height: 48px; }
.nf-j2-mn { flex: 1; min-width: 0; }
.nf-j2-mn b { display: block; font-size: 16px; font-weight: 700; color: #fff; line-height: 1.25; overflow-wrap: anywhere; white-space: normal; }
.nf-j2-mn small { display: block; font-size: 13px; color: #CFC8B8; margin-top: 1px; line-height: 1.25; }
.nf-j2-mn small i { font-style: normal; font-weight: 700; }
.nf-j2-eau { display: flex; align-items: center; gap: 6px; min-height: 36px; color: #8FD3F4; font-size: 14px; }
.nf-j2-eau b { font-weight: 700; }
.nf-j2-eau { min-height: 44px; }   /* 30/10 · lot eau — ajout : la ligne d'eau devient une cible ≥ 44 px (36 avant) */
.nf-j2-ajout { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px 0 0; background: none; border: 0; color: var(--j2-or, #FFC766); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.nf-j2-ajout .nf-i { width: 20px; height: 20px; }
.nf-j2-autre {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin: 4px 0 0; border-radius: 14px; cursor: pointer;
  color: #F4EFE0; font: inherit; font-size: 15px; font-weight: 600; border: 1px solid var(--j2-lisere, rgba(255, 255, 255, .24)); background: var(--j2-reflet), rgba(24, 23, 27, .55);
}
.nf-j2-autre .nf-i { color: var(--j2-or, #FFC766); }
.nf-j2 button:focus-visible { outline: 2px solid #FFC766; outline-offset: 2px; }
/* l'éditeur d'un repas (nouveau ou modifié) garde son habillage ; on aligne seulement sa colonne d'heure */
.nf-j2-tl > .nf-e > .nf-cd.nf-edit { margin-left: 8px; }
/* repli sans flou : verre plus opaque */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .nf-j2-carte, .nf-j2-autre { background-color: #1d1c20; } }
@media (max-width: 340px) { .nf-j2-tl { --j2-col: 64px; } .nf-j2-h, .nf-j2-tl > .nf-e > .nf-h { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .nf-j2 * { transition: none !important; } }

/* ── 6. Carnet : le widget date (même mini-calendrier) puis « Ajouter un repas » ── */
.nf-cj2 { position: relative; margin: 0 0 16px; z-index: 3; }
.nf-cj2-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; }
.nf-cj2-jour { min-width: 0; flex: 1; }
.nf-cj2-jour small { display: block; font-size: 13px; color: #CFC8B8; margin-bottom: 2px; }
.nf-cj2-jour b { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; color: #fff; overflow-wrap: anywhere; }
.nf-cj2 .tr-ndate-racine { position: static; }
.nf-cj2 .tr-ndate { position: relative; top: auto; right: auto; flex: none; }
.nf-cj2 .tr-ndate-puce {
  background: linear-gradient(118deg, rgba(255, 255, 255, .20) 0%, rgba(255, 255, 255, .05) 34%, rgba(255, 255, 255, 0) 56%), linear-gradient(150deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .03) 60%), rgba(14, 14, 16, .66);
  border: 1px solid rgba(255, 255, 255, .34); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 8px 18px -8px rgba(0, 0, 0, .8);
}
.nf-cj2 .tr-ndate-cal { background: linear-gradient(118deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .04) 34%, rgba(255, 255, 255, 0) 56%), rgba(16, 15, 18, .9); border: 1px solid rgba(255, 255, 255, .28); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .nf-cj2 :is(.tr-ndate-puce, .tr-ndate-cal) { -webkit-backdrop-filter: blur(12px) saturate(1.25); backdrop-filter: blur(12px) saturate(1.25); } }
.nf-cj2-ajout {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin-top: 6px; border-radius: 16px; cursor: pointer; font: inherit; font-size: 16px; font-weight: 700; color: #14100a;
  border: 1px solid rgba(255, 244, 205, .85);
  background: linear-gradient(118deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, .1) 36%, rgba(255, 255, 255, 0) 54%), linear-gradient(150deg, rgba(255, 236, 170, .96), rgba(224, 182, 70, .93) 55%, rgba(196, 150, 40, .92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 8px 18px -8px rgba(212, 175, 55, .55);
}
.nf-cj2-ajout:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.nf-cj2-eau { display: flex; align-items: center; gap: 8px; min-height: 52px; margin-top: 8px; padding: 4px 8px 4px 14px; border-radius: 16px; border: 1px solid rgba(143, 211, 244, .4); background: linear-gradient(118deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 56%), rgba(24, 23, 27, .6); }
.nf-cj2-eau-mot { font-size: 15px; font-weight: 700; color: #8FD3F4; }
.nf-cj2-eau-dit { flex: 1; min-width: 0; text-align: center; font-size: 13px; color: #CFC8B8; }
.nf-cj2-eau-b { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; cursor: pointer; color: #BDE6FA; background: rgba(79, 195, 247, .16); border: 1.5px solid rgba(143, 211, 244, .75); }
.nf-cj2-eau-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* 31/10 · LOT 0 — entrées d'avant à portion par défaut fausse : « à vérifier » / « portion fausse » (calculé à l'affichage) + message unique */
.nf-lot0 { margin: 4px 0 0; font-size: 12px; line-height: 1.4; color: var(--txt-2, #555); }
.nf-lot0 b { color: #F5B041; font-weight: 700; }
.nf-lot0-corr { display: inline-flex; align-items: center; min-height: 44px; margin: 4px 0 0 6px; padding: 0 12px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.nf-lot0-msg { margin: 8px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid #f59e0b; background: rgba(245, 158, 11, .08); font-size: 13px; line-height: 1.45; }
.nf-lot0-msg p { margin: 0 0 6px; }
/* 31/10 · LOT 0 (P1-B) — « J'ai mangé » : ligne douteuse visible hors du pli, « Cru ou cuit ? » en boutons (44 px) */
.tr-mange-choix { margin: 8px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid #f59e0b; background: rgba(245, 158, 11, .08); font-size: 13px; line-height: 1.45; }
.tr-mange-choix p { margin: 0 0 6px; }
.tr-mange-choix button { display: block; width: 100%; min-height: 44px; margin: 6px 0 0; text-align: left; }
