/**
 * Nutrition · Ajout rapide (J3 feuille + C1 Carnet) — 05/10
 * AJOUT SEUL. Interrupteur nutri.ajoutRapide='0' (ou ?ajoutRapide=0).
 * Actif par défaut (décision A 05/10).
 */
html[data-nutri-ar="1"] .v5-collation { display: none !important; } /* remplacé par J3 */

.ar-open {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 32px); margin: 12px 16px; min-height: 52px;
  border-radius: 14px; border: 1.5px solid rgba(227,188,82,.55);
  background: #0d0a06; color: #E3BC52; font: 800 15px/1 system-ui;
  cursor: pointer;
}
.ar-open:focus-visible { outline: 2px solid #F2D98A; outline-offset: 2px; }

.ar-dim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
}
.ar-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  max-height: min(88vh, 720px); overflow: auto;
  padding: 10px 16px 24px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #1a1610 0%, #0e0c0a 40%);
  border: 1.5px solid rgba(227,188,82,.45);
  border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,.55);
  color: #F4EFE0;
}
.ar-sheet .grab {
  width: 44px; height: 5px; margin: 4px auto 12px; border-radius: 999px;
  background: rgba(227,188,82,.45);
}
.ar-tag {
  display: inline-block; margin: 0 0 8px; padding: 4px 10px; border-radius: 999px;
  font: 700 10px/1 system-ui; letter-spacing: .04em; text-transform: uppercase;
  color: #14100a; background: #F2D98A;
}
.ar-title { margin: 0 0 10px; font: 800 16px/1.2 system-ui; color: #F2D98A; }

.ar-heures {
  display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 8px; margin-bottom: 10px;
}
.ar-heures button {
  min-height: 44px; border-radius: 12px;
  border: 1.5px solid rgba(227,188,82,.55); background: #0d0a06; color: #E3BC52;
  font: 700 14px/1 system-ui; cursor: pointer;
}
.ar-heures button.on {
  border-color: #F2D98A; color: #14100a;
  background: linear-gradient(160deg, #F2D98A, #CFA32B);
}
.ar-libre {
  min-width: 88px; display: flex; align-items: center; gap: 4px;
  padding: 0 8px; border-radius: 12px;
  border: 1.5px solid rgba(227,188,82,.55); background: #0d0a06; color: #E3BC52;
}
.ar-libre.on { border-color: #F2D98A; }
.ar-libre input[type="time"] {
  flex: 1; min-height: 40px; min-width: 0; border: 0; background: transparent;
  color: #F4EFE0; font: 700 14px/1 system-ui;
}
.ar-libre input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.85) sepia(1) saturate(3) hue-rotate(5deg); }

.ar-rech {
  display: flex; gap: 8px; align-items: center;
  min-height: 52px; padding: 0 8px 0 14px; border-radius: 14px;
  background: #100e0c; border: 1.5px solid rgba(227,188,82,.4);
}
.ar-rech.focus { border-color: #F2D98A; }
.ar-rech .ico {
  width: 44px; height: 44px; display: grid; place-items: center; color: #E3BC52; font-size: 18px;
}
.ar-rech input {
  flex: 1; min-height: 48px; border: 0; background: transparent;
  color: #F4EFE0; font: 600 15px/1 system-ui;
}
.ar-rech input::placeholder { color: #8a8374; }

.ar-sugg {
  margin-top: 8px; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(227,188,82,.4); background: #0e0c0a;
}
.ar-sugg .s {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 52px; padding: 8px 14px; border: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: transparent; color: #F4EFE0; text-align: left; cursor: pointer;
  font: inherit;
}
.ar-sugg .s:last-child { border-bottom: 0; }
.ar-sugg .s.on { background: rgba(227,188,82,.12); }
.ar-sugg .s b { display: block; color: #fff; font: 700 14px/1.25 system-ui; }
.ar-sugg .s small { color: #C9C2AE; font: 600 12px/1.3 system-ui; }
.ar-sugg .pill {
  min-height: 28px; padding: 4px 10px; border-radius: 999px;
  font: 700 11px/1 system-ui; white-space: nowrap;
}
.ar-sugg .pill.livre { background: rgba(227,188,82,.2); color: #F2D98A; border: 1px solid rgba(227,188,82,.45); }
.ar-sugg .pill.fuzzy { background: rgba(120,180,255,.12); color: #A8C8FF; border: 1px solid rgba(120,180,255,.35); }
.ar-sugg .pill.libre { background: rgba(180,255,160,.12); color: #C8F5B0; border: 1px solid rgba(180,255,160,.35); }
.ar-sugg .add {
  min-width: 44px; min-height: 44px; border-radius: 12px;
  border: 1.5px solid rgba(227,188,82,.7); background: #0d0a06; color: #E3BC52;
  font: 800 20px/1 system-ui; display: grid; place-items: center; flex-shrink: 0;
}
.ar-sugg .s.on .add { border-color: #F2D98A; background: rgba(227,188,82,.15); }

.ar-sel {
  margin-top: 10px; padding: 12px; border-radius: 14px;
  border: 1px solid rgba(227,188,82,.4); background: rgba(227,188,82,.06);
}
.ar-sel .nom { margin: 0 0 8px; font: 800 15px/1.25 system-ui; color: #fff; }
.ar-sel .macros {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.ar-sel label {
  display: flex; flex-direction: column; gap: 4px;
  font: 700 11px/1 system-ui; color: #C9C2AE;
}
.ar-sel input[type="number"] {
  min-height: 44px; border-radius: 10px; border: 1px solid rgba(227,188,82,.4);
  background: #0d0a06; color: #F4EFE0; font: 700 14px/1 system-ui; padding: 0 8px;
}
.ar-badge-est {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  font: 700 10px/1 system-ui; text-transform: uppercase; letter-spacing: .03em;
  background: rgba(180,255,160,.14); color: #C8F5B0; border: 1px solid rgba(180,255,160,.35);
  vertical-align: middle;
}
.ar-cta {
  width: 100%; min-height: 52px; margin-top: 12px; border-radius: 14px; border: 0;
  font: 800 15px/1 system-ui; color: #14100a;
  background: linear-gradient(160deg, #F2D98A, #E3BC52 55%, #CFA32B);
  cursor: pointer;
}
.ar-cta:disabled { opacity: .45; cursor: not-allowed; }
.ar-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ar-hint { margin: 8px 0 0; font: 600 12px/1.35 system-ui; color: #C9C2AE; }
.ar-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ar-chips span {
  padding: 4px 10px; border-radius: 999px; font: 700 11px/1 system-ui;
  color: #E3BC52; border: 1px solid rgba(227,188,82,.35); background: rgba(227,188,82,.08);
}

/* C1 panel under J'ai mangé */
.ar-c1 {
  margin: 12px 16px; padding: 14px;
  border-radius: 16px; border: 1.5px solid rgba(227,188,82,.4);
  background: linear-gradient(160deg, #16130e, #0e0c0a);
  color: #F4EFE0;
}
.ar-c1 .ar-heures { grid-template-columns: repeat(4, 1fr) auto; }

/* Badge estimé on journal / carnet cards (lecture) */
html[data-nutri-ar="1"] .ar-estime-lu {
  display: inline-flex; margin-left: 6px; padding: 2px 7px; border-radius: 999px;
  font: 700 10px/1 system-ui; text-transform: uppercase;
  background: rgba(180,255,160,.14); color: #C8F5B0; border: 1px solid rgba(180,255,160,.35);
}

/* ═══ 05/10 · Re-QC Chef (NO-GO 1963251) — AJOUTS SEULS, rien de retiré au-dessus ═══ */
/* B1 — macros corrigeables visibles à 360/390 (J3 feuille + C1 Carnet) : 4 colonnes qui rétrécissent, champs à 100 % */
.ar-sel .macros { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ar-sel .macros label { min-width: 0; }
.ar-sel .macros input[type="number"] { width: 100%; min-width: 0; box-sizing: border-box; padding: 0 6px; }
.ar-sheet, .ar-c1 { overflow-x: hidden; }
/* B2 — feuille J3 + voile AU-DESSUS de #barre (z-index 200) : Fermer atteignable, la barre ne capte plus les taps */
.ar-dim { z-index: 210; }
.ar-sheet { z-index: 220; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
/* Softs R1/R2 — chips heure ≥ 44 px même à 360, « 12h30 » entier ; heure libre sur sa propre ligne (lisible) */
.ar-heures { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
.ar-c1 .ar-heures { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
.ar-heures button { min-width: 44px; padding: 0 4px; white-space: nowrap; }
.ar-heures .ar-libre { grid-column: 1 / -1; min-height: 44px; }
/* Soft R3 — portion (100 g) et base de l’estimation affichées */
.ar-sel .ar-portion { margin: -2px 0 8px; font: 600 12px/1.35 system-ui; color: #C9C2AE; }
/* B1 (suite) — flèches du champ nombre masquées dans la grille étroite : la valeur reste lisible (kcal « 204 » entier à 360) */
.ar-sel .macros input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.ar-sel .macros input[type="number"]::-webkit-inner-spin-button,
.ar-sel .macros input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ═══════════════════════════════════════════════════════════
 * 05/10 · Précision Carnet (AJOUT) : portions rapides + sans labo
 * ═══════════════════════════════════════════════════════════ */
.ar-portions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 10px;
}
.ar-pg {
  min-height: 36px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid rgba(227, 188, 82, .4);
  background: rgba(0, 0, 0, .25); color: #E8DFC8;
  font: 700 12px/1 system-ui; cursor: pointer;
}
.ar-pg.on, .ar-pg[aria-pressed="true"] {
  background: #E3BC52; color: #14100a; border-color: #F2D98A;
}
.ar-pg:focus-visible { outline: 2px solid #F2D98A; outline-offset: 2px; }
.ar-badge-labo {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font: 700 10px/1.2 system-ui; letter-spacing: .03em; text-transform: uppercase;
  color: #1a1208; background: #C9A227;
  vertical-align: middle;
}
html[data-nutri-ar="1"] .ar-labo-lu {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font: 700 10px/1.2 system-ui; text-transform: uppercase;
  color: #1a1208; background: #C9A227;
}
/* Carnet cartes : grammes un peu plus lisibles dans .nf-j3-it */
html[data-nutri-c3="1"] .nf-j3-it {
  font-variant-numeric: tabular-nums;
}

/* ═══ 28/10 · NOTER V2 (AJOUT) — croix/retour, toast Ajouté + Annuler, erreur + Réessayer, derniers aliments ═══
   Coupe-circuit : localStorage nutri.noterV2='0' (aucune de ces classes n'est alors posée). */
.ar-v2-tete { display: flex; justify-content: space-between; align-items: center; margin: -6px -6px 4px; min-height: 44px; }
.ar-v2-retour, .ar-v2-x {
  min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 12px;
  border: 1px solid rgba(227,188,82,.35); background: rgba(255,255,255,.04); color: #F4EFE0;
  font: 700 15px/1 system-ui; cursor: pointer;
}
.ar-v2-retour[hidden] { display: inline-block; visibility: hidden; }
.ar-v2-x { margin-left: auto; font-size: 18px; }
.ar-v2-retour:focus-visible, .ar-v2-x:focus-visible, .ar-toast button:focus-visible, .ar-err button:focus-visible { outline: 3px solid #F2D98A; outline-offset: 2px; }
.ar-v2-recents { margin: 4px 2px 6px; font: 700 11px/1 system-ui; letter-spacing: .04em; text-transform: uppercase; color: #C9C2AE; }
.ar-err {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px;
  padding: 6px 6px 6px 12px; border-radius: 12px; background: #5a1d14; border: 1px solid #e0705c; color: #fff; font: 600 14px/1.3 system-ui;
}
.ar-err button { min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: #fff; color: #5a1d14; font: 800 14px/1 system-ui; cursor: pointer; }
.ar-toast {
  position: fixed; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 9002;
  max-width: 560px; margin: 0 auto; box-sizing: border-box;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 16px;
  background: linear-gradient(180deg, #1f3a22, #142616); border: 1.5px solid rgba(160,230,140,.55); color: #F4EFE0;
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
}
.ar-toast[data-ar-toast="retire"] { background: linear-gradient(180deg, #2a241a, #17130d); border-color: rgba(227,188,82,.5); }
.ar-toast-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ar-toast-txt b { font: 800 14px/1.25 system-ui; overflow-wrap: anywhere; }
.ar-toast-txt small { font: 600 12px/1.2 system-ui; color: #CFE8C4; }
.ar-toast button { flex: none; min-height: 44px; min-width: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: #F2D98A; font: 800 14px/1 system-ui; text-decoration: underline; cursor: pointer; }
.ar-toast [data-ar-toast-x] { text-decoration: none; color: #F4EFE0; }
.ar-cta[aria-busy="true"] { opacity: .7; cursor: progress; }
@media (prefers-reduced-motion: no-preference) {
  .ar-toast { animation: ar-toast-in .18s ease-out; }
  @keyframes ar-toast-in { from { transform: translateY(-12px); opacity: .4; } }
}
