/**
 * Nutrition · Recherche ultra Chine + finitions + alignement éditeur — 05/10
 * AJOUT SEUL. Interrupteur html[data-nutri-chine="1"] (nutri.rech.chine).
 * Design sombre + or (pas crystal glass).
 */

/* ── Zéro doublon : une seule zone d’ajout dominante ── */
html[data-nutri-chine="1"] .v5-c2,
html[data-nutri-chine="1"] .v5-lien-fav {
  display: none !important;
}
/* CTA « J’ai mangé » Carnet : masqué (la barre Chine le remplace) — code intact */
html[data-nutri-chine="1"] .tr-nutri > .tr-cta,
html[data-nutri-chine="1"] #app > .tr-cta.tr-cta-sombre {
  /* ne masque pas tous les CTA : seulement ceux « mangé » via JS class */
}
html[data-nutri-chine="1"] .tr-cta[data-chine-hide="1"],
html[data-nutri-chine="1"] .tr-lien[data-chine-hide="1"] {
  display: none !important;
}
/* Lien Journal « chercher un aliment › » : reste cliquable mais redirigé JS ;
   on le soft-mute visuellement pour éviter le doublon d’intention */
html[data-nutri-chine="1"] .nf-lien-carnet[data-va="#/mange"] {
  opacity: .72;
}

/* Filet post-#202 : C1 sticky orphelin (dock hors panneau) ne couvre pas Recettes / autres hub.
   Quand C1 est bien dans #nutri-panel-carnet, le [hidden] du panneau suffit ; ce filet couvre l’orphelin. */
html[data-nutri-chine="1"] body:has(#nutri-panel-carnet[hidden]) .ar-c1.chine-sticky,
html[data-nutri-chine="1"] body:has(#nutri-panel-carnet[hidden]) .ar-c1[data-chine-dock="1"] {
  display: none !important;
}

/* ── C1 sticky / hors du pli ── */
html[data-nutri-chine="1"] .ar-c1.chine-sticky,
html[data-nutri-chine="1"] .ar-c1[data-chine-dock] {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 8px 12px 14px;
  padding: 12px 12px 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(227, 188, 82, .55);
  background: linear-gradient(165deg, #1a160f 0%, #0e0c0a 55%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 0 1px rgba(242, 217, 138, .08);
  backdrop-filter: blur(8px);
}

html[data-nutri-chine="1"] .ar-c1 .ar-tag {
  background: linear-gradient(160deg, #F2D98A, #E3BC52);
  color: #14100a;
  letter-spacing: .05em;
}
html[data-nutri-chine="1"] .ar-c1 .ar-title {
  font: 800 15px/1.25 system-ui;
  color: #F2D98A;
  letter-spacing: .01em;
}

/* Barre recherche soignée */
html[data-nutri-chine="1"] .ar-rech {
  min-height: 52px;
  border-radius: 14px;
  border: 1.5px solid rgba(227, 188, 82, .5);
  background: #120f0c;
  gap: 4px;
  padding-right: 6px;
}
html[data-nutri-chine="1"] .ar-rech.focus {
  border-color: #F2D98A;
  box-shadow: 0 0 0 2px rgba(242, 217, 138, .18);
}
html[data-nutri-chine="1"] .chine-mic {
  flex: none;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid rgba(227, 188, 82, .55);
  background: #0d0a06; color: #E3BC52;
  display: grid; place-items: center;
  cursor: pointer; font-size: 16px;
}
html[data-nutri-chine="1"] .chine-mic.on {
  border-color: #F2D98A;
  background: rgba(227, 188, 82, .18);
  color: #F2D98A;
}
html[data-nutri-chine="1"] .chine-mic:focus-visible,
html[data-nutri-chine="1"] .chine-scan-btn:focus-visible,
html[data-nutri-chine="1"] .ar-sugg .s:focus-visible {
  outline: 2px solid #F2D98A;
  outline-offset: 2px;
}
html[data-nutri-chine="1"] .chine-mic:disabled { opacity: .4; cursor: not-allowed; }

/* Suggestions détaillées */
html[data-nutri-chine="1"] .ar-sugg .chine-s {
  align-items: flex-start;
  padding: 10px 12px;
  min-height: 56px;
}
html[data-nutri-chine="1"] .ar-sugg .chine-s-ico {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1;
  border-radius: 10px;
  background: rgba(212,175,55,.12);
  border: 1px solid rgba(212,175,55,.28);
  margin-right: 2px;
}
html[data-nutri-chine="1"] .ar-sugg .chine-s-main {
  flex: 1; min-width: 0;
}
html[data-nutri-chine="1"] .ar-sugg .chine-s-main b {
  font: 700 14px/1.3 system-ui;
  color: #fff;
}
html[data-nutri-chine="1"] .ar-sugg .chine-s-main small {
  display: block;
  margin-top: 2px;
  color: #C9C2AE;
  font: 600 11.5px/1.35 system-ui;
}
html[data-nutri-chine="1"] .ar-sugg .chine-s-meta {
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
html[data-nutri-chine="1"] .ar-sugg .pill.recent {
  background: rgba(227, 188, 82, .14);
  color: #E8D59A;
  border: 1px solid rgba(227, 188, 82, .4);
}
html[data-nutri-chine="1"] .chine-vide {
  margin: 0; padding: 12px 14px;
  color: #C9C2AE; font: 600 13px/1.4 system-ui;
}

/* Scan caméra / photo */
html[data-nutri-chine="1"] .chine-scan {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 10px;
}
html[data-nutri-chine="1"] .chine-scan-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 0 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(227, 188, 82, .5);
  background: #0d0a06; color: #E3BC52;
  font: 700 13px/1 system-ui; cursor: pointer;
}
html[data-nutri-chine="1"] .chine-scan-btn:hover {
  border-color: #F2D98A; color: #F2D98A;
}
html[data-nutri-chine="1"] .chine-scan-zone {
  flex: 1 1 100%;
  margin-top: 4px;
}
html[data-nutri-chine="1"] .chine-scan-dit {
  flex: 1 1 100%;
  margin: 0; font: 600 12px/1.35 system-ui; color: #C9C2AE;
}

/* Sheet J3 : même polish micro */
html[data-nutri-chine="1"] .ar-sheet .chine-mic { margin-left: 2px; }

/* ═══════════════════════════════════════════════════════════
 * E) Bugs UI / alignement — éditeur repas (AJOUT CSS)
 * .nf-editeur / .nf-edit / .nf-ligne-ed / .nf-f
 * ═══════════════════════════════════════════════════════════ */
html[data-nutri-chine="1"] .nf-cd.nf-edit,
html[data-nutri-chine="1"] .nf-edit,
html[data-nutri-chine="1"] [data-nf-form] {
  overflow: hidden;
  box-sizing: border-box;
}
html[data-nutri-chine="1"] .nf-ligne-ed {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
html[data-nutri-chine="1"] .nf-nom-ligne {
  margin: 8px 2px 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #F4EFE0;
}
html[data-nutri-chine="1"] .nf-r2 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
  min-width: 0;
  max-width: 100%;
}
html[data-nutri-chine="1"] .nf-f {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 4px 6px 5px;
}
html[data-nutri-chine="1"] .nf-f small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
html[data-nutri-chine="1"] .nf-f span {
  display: flex;
  align-items: baseline;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}
html[data-nutri-chine="1"] .nf-f input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  font: 800 15px/1.2 inherit;
  letter-spacing: -0.01em;
}
html[data-nutri-chine="1"] .nf-f em {
  flex: none;
  font-size: 11px;
  line-height: 1;
}
html[data-nutri-chine="1"] .nf-r1 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 44px;
  min-width: 0;
}
html[data-nutri-chine="1"] .nf-ch {
  min-width: 0;
  overflow: hidden;
}
html[data-nutri-chine="1"] .nf-ch input {
  min-width: 0;
  max-width: 100%;
}
html[data-nutri-chine="1"] .nf-r3 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
html[data-nutri-chine="1"] .nf-r3 .nf-cta {
  flex: 1 1 auto;
  min-width: 0;
}

/* Petites finitions focus 44×44 */
html[data-nutri-chine="1"] .ar-cta:focus-visible,
html[data-nutri-chine="1"] .ar-heures button:focus-visible,
html[data-nutri-chine="1"] .ar-pg:focus-visible {
  outline: 2px solid #F2D98A;
  outline-offset: 2px;
}

/* Photo profil UX (ajout) */
.chine-photo-profil {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px; padding: 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(227, 188, 82, .4);
  background: linear-gradient(160deg, #16130e, #0e0c0a);
}
.chine-photo-profil .chine-photo-preview {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid rgba(227, 188, 82, .55);
  background: #120f0c center/cover no-repeat;
  display: grid; place-items: center;
  color: #E3BC52; font-size: 28px; flex: none;
  overflow: hidden;
}
.chine-photo-profil .chine-photo-preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.chine-photo-profil .chine-photo-actions {
  display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0;
}
.chine-photo-profil .chine-photo-btn {
  min-height: 44px; min-width: 44px; padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(227, 188, 82, .5);
  background: #0d0a06; color: #E3BC52;
  font: 700 13px/1 system-ui; cursor: pointer;
}
.chine-photo-profil .chine-photo-btn:focus-visible {
  outline: 2px solid #F2D98A; outline-offset: 2px;
}
.chine-photo-profil .chine-photo-btn.danger {
  border-color: rgba(255, 120, 100, .45); color: #F5A898;
}
.chine-photo-profil p {
  margin: 0 0 6px; font: 600 12px/1.35 system-ui; color: #C9C2AE;
}
/* Réglages : révéler le bloc identité avatar s’il était hidden */
html[data-chine-photo="1"] .profil-identite[hidden],
html[data-chine-photo="1"] .bloc.profil-identite[hidden] {
  display: block !important;
}
