/* ============================================================================
   IRNSCA Nutrition Application — 2.2.0 interface additions
   brand header · Telegram support button · Meal Builder (three levels, rings,
   charts) · indicator / calculator information sheet · notification star and
   panel · advertisements · mobile secure-app card.
   Mobile first; logical properties for RTL; light/dark via the app tokens;
   no backdrop-filter on phones; animations only on small elements and off for
   prefers-reduced-motion (SETUP §22.6 performance rules).
   ============================================================================ */

/* ── Brand header: Green Way Of Health (iRnsca) · iRnsca.com ─────────────── */
.brand-bar.nutri-brandbar { justify-content: center; padding: 14px 16px 6px; }
.nutri-brand {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 20px 8px 10px; border-radius: 999px; text-decoration: none;
  background: linear-gradient(135deg, rgba(62, 240, 138, 0.14), rgba(0, 194, 255, 0.12) 50%, rgba(157, 0, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 26px rgba(0, 194, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}
.nutri-brand:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 12px 34px rgba(0, 194, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.nutri-brand:focus-visible { outline: 2px solid #00c2ff; outline-offset: 3px; }
[data-theme="light"] .nutri-brand { border-color: rgba(15, 23, 42, 0.1); background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(14, 165, 233, 0.1) 50%, rgba(124, 58, 237, 0.12)); }
.nutri-brand__mark { position: relative; width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.22), rgba(0, 0, 0, 0.25)); }
.nutri-brand__mark svg { width: 42px; height: 42px; overflow: visible; }
.nutri-brand__orbit { transform-origin: 24px 24px; animation: nb-spin 9s linear infinite; }
@keyframes nb-spin { to { transform: rotate(360deg); } }
.nutri-brand__text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.nutri-brand__name {
  font-family: 'ADLaM Display', system-ui, sans-serif; font-size: 1.12rem; font-weight: 700; letter-spacing: .2px; white-space: nowrap;
  background: linear-gradient(90deg, #3ef08a, #00c2ff 40%, #b56bff 70%, #3ef08a); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: nb-flow 7s ease-in-out infinite;
}
.nutri-brand__tag { font-size: .82em; opacity: .95; }
.nutri-brand__url { margin-top: 2px; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: .74rem; font-weight: 700; letter-spacing: 1.6px; color: var(--text-secondary); }
.nutri-brand__url::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-inline-end: 6px; border-radius: 50%; background: #3ef08a; box-shadow: 0 0 8px #3ef08a; vertical-align: middle; animation: nb-blink 2.4s ease-in-out infinite; }
.nutri-brand__shine { position: absolute; inset: -50% auto -50% -40%; width: 30%; z-index: -1; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: skewX(-20deg); animation: nb-shine 6s ease-in-out infinite; pointer-events: none; }
@keyframes nb-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes nb-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes nb-shine { 0%, 70% { left: -40%; } 100% { left: 130%; } }

/* ── Telegram support button ────────────────────────────────────────────── */
.nutri-support {
  position: fixed; z-index: 1900; bottom: max(18px, env(safe-area-inset-bottom)); inset-inline-start: 18px;
  display: none; align-items: center; gap: 0; height: 58px; padding: 4px; border-radius: 999px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #37bbfe, #0088cc); box-shadow: 0 10px 26px rgba(0, 136, 204, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: gap .35s cubic-bezier(.2, .8, .2, 1), padding .35s cubic-bezier(.2, .8, .2, 1), transform .2s ease, box-shadow .2s ease;
}
.nutri-lang-ready .nutri-support { display: inline-flex; }
.nutri-support:hover, .nutri-support:focus-visible { gap: 10px; padding-inline-end: 18px; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 136, 204, 0.55); outline: none; }
.nutri-support__icon { position: relative; z-index: 1; width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.nutri-support__icon svg { width: 44px; height: 44px; animation: tg-plane 5s ease-in-out infinite; }
.nutri-support__label { display: flex; flex-direction: column; max-width: 0; overflow: hidden; white-space: nowrap; line-height: 1.15; transition: max-width .35s cubic-bezier(.2, .8, .2, 1); }
.nutri-support:hover .nutri-support__label, .nutri-support:focus-visible .nutri-support__label { max-width: 160px; }
.nutri-support__label b { font-size: .9rem; }
.nutri-support__label small { font-size: .72rem; opacity: .9; }
.nutri-support__pulse { position: absolute; inset-block: 4px; inset-inline-start: 4px; width: 50px; border-radius: 50%; border: 2px solid rgba(55, 187, 254, 0.8); animation: tg-pulse 2.8s ease-out infinite; pointer-events: none; }
@keyframes tg-pulse { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.7); opacity: 0; } }
@keyframes tg-plane { 0%, 82%, 100% { transform: translate(0, 0) rotate(0); } 88% { transform: translate(2px, -2px) rotate(-8deg); } 94% { transform: translate(-1px, 1px) rotate(4deg); } }

/* ── Meal Builder: header, legend, levels ───────────────────────────────── */
.mb-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.mb-head__sub { color: var(--text-secondary); font-size: .86rem; margin-top: 2px; }
.mb-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mb-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mb-legend__i, .mb-level { --lc: #00c2ff; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--lc) 40%, transparent); }
html[lang="fa"] .mb-legend__i, html[lang="ar"] .mb-legend__i, html[lang="fa"] .mb-level, html[lang="ar"] .mb-level { text-transform: none; letter-spacing: 0; }
.mb-legend__i::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--lc); }
.mb-level--food { --lc: #00c2ff; } .mb-level--meal { --lc: #ff9f1c; } .mb-level--day { --lc: #d946ef; }

/* daily total */
.mb-day { position: relative; padding: 18px !important; margin-bottom: 18px; border-radius: var(--radius-lg); }
.mb-day::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: linear-gradient(90deg, #d946ef, #00c2ff); }
.mb-day__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mb-day__head h3 { flex: 1; font-size: 1.2rem; }
.mb-analyze { min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, #d946ef, #7c3aed); box-shadow: 0 6px 16px rgba(217, 70, 239, 0.3); }
.mb-day__grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; align-items: center; }
.mb-day__chart { text-align: center; }
.mb-mini-title { font-size: .8rem; color: var(--text-secondary); font-weight: 700; margin-bottom: 4px; }
.mb-day .chart-container { height: 240px !important; min-height: 0; }
.mb-day .summary-grid { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mb-day .summary-card { padding: 14px; }
.mb-rings { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; justify-content: center; }
.mb-rings:empty { display: none; }
.mb-ring { --c: #00c2ff; position: relative; width: 92px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.mb-ring svg { width: 72px; height: 72px; transform: rotate(-90deg); }
[dir="rtl"] .mb-ring svg { transform: rotate(-90deg) scaleY(-1); }
.mb-ring__track { fill: none; stroke: rgba(127, 127, 127, 0.18); stroke-width: 7; }
.mb-ring__val { fill: none; stroke: var(--c); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 60%, transparent)); }
.mb-ring b { position: absolute; top: 24px; left: 0; right: 0; font-size: .82rem; font-weight: 900; font-family: system-ui, sans-serif; }
.mb-ring span { margin-top: 4px; font-size: .7rem; font-weight: 700; line-height: 1.2; color: var(--text-secondary); }
.mb-ring small { font-size: .66rem; color: var(--text-muted); }

/* meal cards */
.mb-meal { --mc: #00b8e6; position: relative; padding: 16px !important; border-radius: var(--radius-lg); border-inline-start: 4px solid var(--mc); }
.mb-meal__head { display: grid !important; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 12px; }
.mb-meal__head h3 { font-size: 1.1rem; min-width: 0; outline: none; border-bottom: 1px dashed var(--glass-border); padding-bottom: 2px; }
.mb-meal__head h3:focus { border-bottom-color: var(--mc); }
.mb-meal__totals { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; }
.mb-meal__kcal { font-size: 1.15rem; font-weight: 900; color: var(--mc); }
.mb-meal__kcal small { font-size: .72rem; color: var(--text-muted); }
.mb-meal__share { color: var(--text-muted); font-weight: 700; }
.mb-meal__acts { display: flex; gap: 6px; grid-column: 3; grid-row: 1; }
.mb-meal__body { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.mb-meal__body.is-empty { grid-template-columns: 1fr; }
.mb-meal__body.is-empty .mb-meal__chart { display: none; }
.mb-meal__chart { width: 120px; height: 120px; }
.mb-meal__micro { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mb-meal__micro:empty { display: none; }
.mb-empty { padding: 14px; border-radius: 12px; border: 1px dashed var(--glass-border); color: var(--text-muted); font-size: .85rem; text-align: center; }

/* food item rows */
.mb-item {
  display: grid !important; grid-template-columns: 56px 1fr auto !important; grid-template-areas: "ring main acts" "qty qty qty" "more more more";
  gap: 8px 12px !important; align-items: center; padding: 10px 12px !important; border-radius: 14px !important;
  background: rgba(127, 127, 127, 0.07) !important; border: 1px solid var(--glass-border);
  border-inline-start: 3px solid #00c2ff; transition: background .2s ease;
}
.mb-item:hover { background: rgba(0, 194, 255, 0.06) !important; }
.mb-item.is-locked { opacity: .7; border-inline-start-color: #94a3b8; }
.mb-item__ring {
  grid-area: ring; position: relative; width: 52px; height: 52px; border-radius: 50%;
  background: conic-gradient(#a855f7 0 calc(var(--p, 0) * 1%), #ff3fb4 0 calc(var(--c, 0) * 1%), #ff7a1a 0 100%);
  display: grid; place-items: center; padding: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.mb-item__ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--bg-dark-alt); }
.mb-item__ring--lg { width: 96px; height: 96px; padding: 8px; }
.mb-item__ring--lg::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg-dark-alt); }
.mb-item__ring--lg b, .mb-item__ring--lg small { position: relative; z-index: 1; display: block; text-align: center; line-height: 1.05; }
.mb-item__ring--lg b { font-size: 1.25rem; font-weight: 900; margin-top: 18px; }
.mb-item__ring--lg small { font-size: .66rem; color: var(--text-muted); margin-top: -14px; }
.mb-item__main { grid-area: main; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mb-item__main b { font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }
.mb-item__main small { font-size: .74rem; color: var(--text-secondary); }
.mb-lockmsg { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--text-muted); }
.mb-lockmsg svg { width: 14px; height: 14px; }
.mb-macros { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.mb-chip { font-style: normal; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(127, 127, 127, 0.12); }
.mb-chip--kcal { color: #00c2ff; background: rgba(0, 194, 255, 0.12); }
.mb-chip--p { color: #c084fc; background: rgba(168, 85, 247, 0.14); }
.mb-chip--c { color: #ff6fc8; background: rgba(255, 63, 180, 0.12); }
.mb-chip--f { color: #ff9a4d; background: rgba(255, 122, 26, 0.14); }
[data-theme="light"] .mb-chip--p { color: #7c3aed; } [data-theme="light"] .mb-chip--c { color: #c2187a; } [data-theme="light"] .mb-chip--f { color: #c2410c; } [data-theme="light"] .mb-chip--kcal { color: #0369a1; }
.mb-qty { grid-area: qty; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.mb-qty[hidden] { display: none; }
.mb-qty__btn, .mb-stepper__btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(127, 127, 127, 0.1); color: var(--text-primary); font-size: 1.15rem; font-weight: 900; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.mb-qty__btn:hover, .mb-stepper__btn:hover { background: rgba(0, 194, 255, 0.18); }
.mb-qty__btn:active, .mb-stepper__btn:active { transform: scale(.94); }
.mb-qty__in { width: 76px; height: 38px; text-align: center; border-radius: 12px; border: 1px solid #00c2ff; background: var(--glass-bg); color: var(--text-primary); font: inherit; font-weight: 900; font-size: 1rem; }
.mb-qty__in:focus { outline: none; box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.3); }
.mb-unit { height: 38px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text-primary); font: inherit; font-size: .82rem; font-weight: 700; }
.mb-unit--fixed { display: inline-flex; align-items: center; background: transparent; }
.mb-item__acts { grid-area: acts; display: flex; gap: 4px; }
.mb-icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(127, 127, 127, 0.08); color: var(--text-secondary); display: grid; place-items: center; cursor: pointer; font-size: .9rem; transition: color .15s ease, background .15s ease; }
.mb-icon-btn svg { width: 18px; height: 18px; }
.mb-icon-btn:hover { color: var(--text-primary); background: rgba(0, 194, 255, 0.14); }
.mb-icon-btn--danger:hover { color: #fff; background: #ff4d6d; }
.mb-item__more { grid-area: more; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; border-top: 1px dashed var(--glass-border); }
.mb-item__more[hidden] { display: none; }
.mb-nut { display: inline-flex; flex-direction: column; padding: 6px 10px; border-radius: 10px; background: rgba(127, 127, 127, 0.08); border: 1px solid var(--glass-border); min-width: 88px; }
.mb-nut small { font-size: .66rem; color: var(--text-muted); line-height: 1.25; }
.mb-nut b { font-size: .84rem; font-weight: 800; }

/* analysis panel */
.mb-analysis { --lc: #d946ef; margin-top: 18px; padding: 18px !important; border-radius: var(--radius-lg); border-top: 4px solid var(--lc); scroll-margin-top: 90px; }
.mb-an__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mb-an__head h3 { font-size: 1.15rem; margin-top: 6px; }
.mb-an__head p { color: var(--text-secondary); font-size: .85rem; }
.mb-an__tools { display: flex; align-items: center; gap: 8px; }
.mb-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(127, 127, 127, 0.1); flex-wrap: wrap; }
.mb-seg button { --lc: #00c2ff; min-height: 36px; padding: 4px 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 800; color: var(--text-secondary); }
.mb-seg button[aria-selected="true"] { color: #fff; background: var(--lc); box-shadow: 0 4px 12px color-mix(in srgb, var(--lc) 40%, transparent); }
.mb-an__pick { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; font-size: .8rem; font-weight: 700; color: var(--text-secondary); max-width: 520px; }
.mb-an__grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; align-items: center; margin-top: 8px; }
.mb-an__chart { text-align: center; }
.mb-an__chart small { color: var(--text-muted); font-size: .72rem; }
.mb-an__donut { width: 100%; height: 230px; }
.mb-an__kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mb-kpi { --k: #00c2ff; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--k) 16%, transparent), transparent); border: 1px solid color-mix(in srgb, var(--k) 35%, transparent); }
.mb-kpi span { font-size: .74rem; font-weight: 700; color: var(--text-secondary); }
.mb-kpi b { font-size: 1.35rem; font-weight: 900; }
.mb-kpi b small { font-size: .72rem; color: var(--text-muted); font-weight: 700; }
.mb-an__sub { margin: 16px 0 8px; font-size: .95rem; }
.mb-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--glass-border); }
.mb-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.mb-table th, .mb-table td { padding: 8px 12px; text-align: start; border-bottom: 1px solid var(--glass-border); }
.mb-table th { font-size: .72rem; color: var(--text-muted); background: rgba(127, 127, 127, 0.06); }
.mb-table tr:last-child td { border-bottom: 0; }
.mb-r { text-align: end !important; white-space: nowrap; }
.mb-dvcell { min-width: 140px; }
.mb-dvbar { display: block; height: 7px; border-radius: 999px; background: rgba(127, 127, 127, 0.15); overflow: hidden; }
.mb-dvbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #00c2ff, #22c55e); }
.mb-table tr.is-limit .mb-dvbar i { background: linear-gradient(90deg, #22c55e, #f59e0b); }
.mb-table tr.is-over .mb-dvbar i { background: #ff4d6d; }
.mb-dvcell small { font-size: .7rem; color: var(--text-muted); }
.mb-note { margin-top: 10px; font-size: .74rem; color: var(--text-muted); }

/* add-food dialog */
.mb-stepper { display: flex; align-items: center; gap: 8px; }
.mb-stepper .input-control { text-align: center; font-weight: 900; font-size: 1.1rem; }
.mb-unit-hint { display: block; margin-top: 4px; font-size: .74rem; color: var(--text-muted); min-height: 1em; }
.mb-radio { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--glass-border); cursor: pointer; font-size: .88rem; }
.mb-radio:has(input:checked) { border-color: #00c2ff; background: rgba(0, 194, 255, 0.1); }
.mb-radio small { color: var(--text-muted); }
#modal-unit-selector { flex-wrap: wrap; }
.mb-preview { margin: 12px 0 14px; padding: 12px; border-radius: 16px; border: 1px solid rgba(0, 194, 255, 0.35); background: linear-gradient(160deg, rgba(0, 194, 255, 0.08), transparent); }
.mb-preview:empty { display: none; }
.mb-preview__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.mb-preview__head small { color: var(--text-muted); font-size: .72rem; }
.mb-preview__grid { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.mb-preview__nuts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mb-result img, .mb-result__ph { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: 0 0 36px; display: grid; place-items: center; }
.mb-result { gap: 10px; justify-content: flex-start !important; }
.mb-result__name { flex: 1; }
.mb-result em { font-style: normal; font-size: .75rem; color: var(--text-muted); white-space: nowrap; }

/* ── Information sheet (food indicators and calculators) ─────────────────── */
.nutri-info-modal .modal-content.nutri-info { --a: #00c2ff; --b: #9d00ff; width: min(560px, 92vw); max-width: 560px; padding: 0; border-radius: 26px; overflow: hidden auto; background: var(--bg-dark-alt); border: 1px solid var(--glass-border); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.nutri-info__hero { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 18px; color: #fff; background: linear-gradient(135deg, var(--a), var(--b)); overflow: hidden; }
.nutri-info__hero::after { content: ''; position: absolute; inset-inline-end: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%); pointer-events: none; }
.nutri-info__ico { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; font-weight: 900; background: rgba(255, 255, 255, 0.22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.nutri-info__ico svg { width: 28px; height: 28px; }
.nutri-info__titles, .nutri-info__hero > div { flex: 1; min-width: 0; position: relative; z-index: 1; }
.nutri-info__hero small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; opacity: .9; }
html[lang="fa"] .nutri-info__hero small, html[lang="ar"] .nutri-info__hero small { text-transform: none; letter-spacing: 0; }
.nutri-info__hero h3 { font-size: 1.35rem; line-height: 1.3; margin-top: 2px; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); }
.nutri-info__hero p { font-size: .82rem; opacity: .92; margin-top: 2px; }
.nutri-info__hero p:empty { display: none; }
.nutri-info__close { position: relative; z-index: 1; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff !important; background: rgba(0, 0, 0, 0.22); }
.nutri-info__close svg { width: 18px; height: 18px; }
.nutri-info__close:hover { background: rgba(0, 0, 0, 0.38); }
.nutri-info__body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 12px; }
.nutri-info__value { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--a) 18%, transparent), color-mix(in srgb, var(--b) 12%, transparent)); border: 1px solid color-mix(in srgb, var(--a) 40%, transparent); }
.nutri-info__value[hidden] { display: none; }
.nutri-info__food { font-size: .8rem; color: var(--text-secondary); font-weight: 700; }
.nutri-info__num { font-size: 1.6rem; font-weight: 900; font-family: system-ui, sans-serif; color: var(--text-primary); }
.nutri-info__text { display: flex; flex-direction: column; gap: 10px; color: var(--text-secondary); line-height: 1.9; font-size: .93rem; }
.nutri-info__text p, .nutri-info__text li { margin: 0; }
.nutri-info__text li { list-style: none; position: relative; padding-inline-start: 18px; }
.nutri-info__text li::before { content: ''; position: absolute; inset-inline-start: 2px; top: .8em; width: 7px; height: 7px; border-radius: 50%; background: var(--a); }
.nutri-info__lead { font-size: 1rem; color: var(--text-primary); font-weight: 600; padding-inline-start: 14px; border-inline-start: 3px solid var(--a); }
.nutri-info__sec { padding: 14px 16px; border-radius: 16px; background: rgba(127, 127, 127, 0.07); border: 1px solid var(--glass-border); }
.nutri-info__sec h4 { display: flex; align-items: center; gap: 10px; font-size: .95rem; margin-bottom: 6px; color: var(--text-primary); }
.nutri-info__dot { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: .85rem; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--a), var(--b)); }
.nutri-info__sec p { color: var(--text-secondary); line-height: 1.85; font-size: .9rem; }
.nutri-info__sec code { display: block; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); color: var(--text-primary); font-size: .78rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
[data-theme="light"] .nutri-info__sec code { background: rgba(15, 23, 42, 0.06); }
.nutri-info__sec ul { margin: 0; padding-inline-start: 18px; color: var(--text-secondary); font-size: .8rem; line-height: 1.7; }
.nutri-info__sec.is-means { border-color: color-mix(in srgb, var(--a) 40%, transparent); background: color-mix(in srgb, var(--a) 8%, transparent); }
.nutri-info__fine { font-size: .72rem; color: var(--text-muted); }
.nutri-info-modal.active .nutri-info { animation: ni-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes ni-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

/* ── Notification star + panel ──────────────────────────────────────────── */
/* The sticky controls bar is a .glass-panel (overflow: hidden), which clipped every
   drop-down below it on desktop — the notification panel and the account menu
   (Open my dashboard / Sign out). Its only decoration is a 1 px top line, so it
   may overflow safely. */
.controls-bar.glass-panel { overflow: visible; }
.nutri-inbox-slot { position: relative; display: inline-flex; }
.nutri-inbox-slot:empty { display: none; }
.nutri-inbox-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--glass-border); background: rgba(127, 127, 127, 0.12); color: var(--text-primary); display: grid; place-items: center; cursor: pointer; transition: transform .2s ease, background .2s ease; }
.nutri-inbox-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.nutri-inbox-btn:hover { transform: translateY(-2px); background: rgba(255, 196, 0, 0.16); }
.nutri-inbox-btn.has-unread { color: #ffc400; border-color: rgba(255, 196, 0, 0.6); background: rgba(255, 196, 0, 0.14); }
.nutri-inbox-btn.has-unread svg { fill: #ffc400; stroke: #ffb000; animation: nx-twinkle 2.8s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(255, 196, 0, 0.7)); }
@keyframes nx-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 10% { transform: scale(1.18) rotate(-12deg); } 20% { transform: scale(1) rotate(0); } }
.nutri-inbox-badge { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #ff3d7f; color: #fff; font-size: .68rem; font-weight: 900; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--bg-dark); font-family: system-ui, sans-serif; }
.nutri-inbox-badge[hidden] { display: none; }
.nutri-inbox-pop { position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); z-index: 1300; width: min(400px, 92vw); max-height: 70vh; overflow: auto; border-radius: 20px; background: var(--bg-dark-alt); border: 1px solid var(--glass-border); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); direction: ltr; }
.nutri-inbox-pop[hidden] { display: none; }
html[dir="rtl"] .nutri-inbox-pop .nx { direction: rtl; }
.nx { display: flex; flex-direction: column; }
.nx-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; background: linear-gradient(135deg, rgba(255, 196, 0, 0.16), rgba(255, 61, 127, 0.12)), var(--bg-dark-alt); border-bottom: 1px solid var(--glass-border); }
.nx--pop .nx-head { border-radius: 20px 20px 0 0; }
.nx-head__star svg { width: 22px; height: 22px; fill: #ffc400; filter: drop-shadow(0 0 6px rgba(255, 196, 0, 0.6)); }
.nx-head b { font-size: 1rem; }
.nx-count { padding: 2px 9px; border-radius: 999px; background: #ff3d7f; color: #fff; font-size: .72rem; font-weight: 800; }
.nx-head .nx-btn { margin-inline-start: auto; }
.nx-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(127, 127, 127, 0.15); color: var(--text-primary); cursor: pointer; }
.nx-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.nx-item { --lc: #00c2ff; border-radius: 16px; border: 1px solid var(--glass-border); background: rgba(127, 127, 127, 0.06); border-inline-start: 4px solid var(--lc); overflow: hidden; transition: background .2s ease; }
.nx-item.is-unread { background: linear-gradient(90deg, color-mix(in srgb, var(--lc) 12%, transparent), transparent 70%); }
.nx-item__main { width: 100%; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: start; font: inherit; }
.nx-item__star { flex: 0 0 22px; width: 22px; height: 22px; color: var(--text-muted); margin-top: 2px; }
.nx-item__star svg { width: 100%; height: 100%; }
.nx-item.is-unread .nx-item__star { color: #ffc400; filter: drop-shadow(0 0 5px rgba(255, 196, 0, 0.6)); }
.nx-item.is-unread .nx-item__star svg { fill: #ffc400; }
.nx-item:not(.is-unread) .nx-item__star svg { width: 12px; height: 12px; margin: 5px; opacity: .5; }
.nx-item__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.nx-item__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .7rem; color: var(--text-muted); }
.nx-item__meta time { margin-inline-start: auto; }
.nx-pill { padding: 1px 8px; border-radius: 999px; font-weight: 800; color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, transparent); }
.nx-lock { display: inline-flex; color: #f59e0b; }
.nx-lock svg { width: 13px; height: 13px; }
.nx-item__txt b { font-size: .95rem; line-height: 1.35; }
.nx-item.is-unread .nx-item__txt b { color: var(--text-primary); }
.nx-item:not(.is-unread) .nx-item__txt b { font-weight: 600; color: var(--text-secondary); }
.nx-item__peek { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.nx-item.is-open .nx-item__peek { display: none; }
.nx-item__body { padding: 0 14px 14px 46px; }
[dir="rtl"] .nx-item__body { padding: 0 46px 14px 14px; }
.nx-item__body p { color: var(--text-secondary); line-height: 1.8; font-size: .9rem; overflow-wrap: anywhere; }
.nx-item__body a { color: #00c2ff; }
.nx-item__acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.nx-state { font-size: .72rem; color: var(--text-muted); margin-inline-end: auto; }
.nx-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--glass-border); background: rgba(127, 127, 127, 0.1); color: var(--text-primary); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.nx-btn svg { width: 14px; height: 14px; }
.nx-btn:hover { background: rgba(0, 194, 255, 0.15); }
.nx-btn--del:not(:disabled):hover { background: #ff4d6d; color: #fff; border-color: transparent; }
.nx-btn:disabled { opacity: .45; cursor: not-allowed; }
.nx-lockmsg { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .72rem; color: #f59e0b; }
.nx-lockmsg svg { width: 13px; height: 13px; }
.nx-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 18px; text-align: center; color: var(--text-muted); font-size: .86rem; }
.nx-empty svg { width: 40px; height: 40px; fill: none; stroke: #ffc400; stroke-width: 1.5; }
.nx-skel { height: 64px; margin: 10px 12px; border-radius: 16px; background: linear-gradient(90deg, rgba(127, 127, 127, 0.08), rgba(127, 127, 127, 0.16), rgba(127, 127, 127, 0.08)); background-size: 200% 100%; animation: nx-sk 1.2s linear infinite; }
@keyframes nx-sk { to { background-position: -200% 0; } }
.nx-foot { padding: 0 12px 12px; display: flex; justify-content: center; }
.pd-inbox { padding: 0 !important; overflow: hidden; }
.pd-tab { position: relative; }
.pd-tab__badge { position: absolute; top: 2px; inset-inline-end: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #ff3d7f; color: #fff; font-size: .62rem; font-weight: 900; line-height: 17px; font-style: normal; text-align: center; }
.pd-tab__badge[hidden] { display: none; }

/* ── Advertisements ─────────────────────────────────────────────────────── */
.nutri-ad-modal .modal-content.nutri-ad { position: relative; width: min(560px, 94vw); max-width: 560px; padding: 0; border-radius: 22px; overflow: hidden; background: var(--bg-dark-alt); border: 1px solid var(--glass-border); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.nutri-ad__frame { display: block; width: 100%; height: 200px; border: 0; background: transparent; }
.nutri-ad__close { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; background: rgba(0, 0, 0, 0.45); font-size: .9rem; }
.nutri-ad__close:hover { background: rgba(0, 0, 0, 0.65); }
.nutri-ad__tag { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: .62rem; font-weight: 800; letter-spacing: .4px; }
.nutri-ad-banner { position: relative; padding: 0 !important; overflow: hidden; border-radius: var(--radius-lg); }

/* ── Mobile secure-app card ─────────────────────────────────────────────── */
.nutri-appcard { position: fixed; z-index: 2600; inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom)); animation: ni-in .35s cubic-bezier(.2, .8, .2, 1); }
.nutri-appcard--require { inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(5, 6, 10, 0.88); }
.nutri-appcard__box { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px; border-radius: 22px; background: var(--bg-dark-alt); border: 1px solid rgba(0, 194, 255, 0.35); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); max-width: 520px; margin-inline: auto; }
.nutri-appcard__ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #00c2ff, #7c3aed); }
.nutri-appcard__ico svg { width: 28px; height: 28px; }
.nutri-appcard__txt b { display: block; font-size: 1rem; color: var(--text-primary); }
.nutri-appcard__txt p { margin-top: 4px; font-size: .82rem; line-height: 1.7; color: var(--text-secondary); }
.nutri-appcard__btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.nutri-appcard__store { flex: 1 1 160px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 14px; border-radius: 14px; text-decoration: none; color: #fff; font-weight: 800; font-size: .88rem; background: #000; border: 1px solid rgba(255, 255, 255, 0.25); }
.nutri-appcard__store svg { width: 20px; height: 20px; }
.nutri-appcard__store--play { background: linear-gradient(135deg, #01875f, #0f9d58); }
.nutri-appcard__later { flex: 1 1 100%; min-height: 40px; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; text-decoration: underline; }

/* ── privacy shield also hides the new layers ──────────────────────────── */
html.nutri-shielded .nutri-support,
html.nutri-shielded .nutri-appcard,
html.nutri-shielded .nutri-inbox-pop { visibility: hidden !important; }

/* ── mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .brand-bar.nutri-brandbar { padding: 10px 12px 4px; }
  .nutri-brand { gap: 9px; padding: 6px 14px 6px 6px; }
  .nutri-brand__mark { width: 38px; height: 38px; flex-basis: 38px; }
  .nutri-brand__mark svg { width: 34px; height: 34px; }
  .nutri-brand__name { font-size: .96rem; }
  .nutri-brand__url { font-size: .66rem; letter-spacing: 1.2px; }
  .nutri-support { bottom: max(14px, env(safe-area-inset-bottom)); inset-inline-start: 12px; height: 52px; }
  .nutri-support__icon { width: 44px; height: 44px; flex-basis: 44px; }
  .nutri-support__icon svg { width: 38px; height: 38px; }
  .nutri-support__pulse { width: 44px; }
  .mb-day__grid, .mb-an__grid { grid-template-columns: 1fr; }
  .mb-day .chart-container { height: 210px !important; }
  .mb-meal { padding: 12px !important; }
  .mb-meal__body { grid-template-columns: 1fr; }
  .mb-meal__chart { width: 100%; height: 150px; }
  .mb-item { grid-template-columns: 48px 1fr auto !important; padding: 10px !important; }
  .mb-item__ring { width: 46px; height: 46px; }
  .mb-icon-btn { width: 34px; height: 34px; }
  .mb-an__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mb-preview__grid { grid-template-columns: 80px 1fr; }
  .mb-item__ring--lg { width: 80px; height: 80px; }
  .nutri-inbox-pop { position: fixed; top: 64px; left: 10px; right: 10px; transform: none; width: auto; max-height: 75vh; }
  .nutri-info-modal .modal-content.nutri-info { width: 94vw; border-radius: 22px; max-height: 88vh; }
  .nutri-info__hero { padding: 18px 16px 14px; }
  .nutri-info__body { padding: 14px 16px 18px; }
  .nutri-info__hero h3 { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .nutri-brand__orbit, .nutri-brand__name, .nutri-brand__url::before, .nutri-brand__shine,
  .nutri-support__pulse, .nutri-support__icon svg, .nutri-inbox-btn.has-unread svg, .nx-skel,
  .nutri-info-modal.active .nutri-info, .nutri-appcard { animation: none !important; }
  .mb-ring__val { transition: none; }
}
[dir="rtl"] .nutri-info__hero p[dir="ltr"] { text-align: right; }

/* Narrow phones: the notification star joined the top bar — keep every control on one line */
@media (max-width: 430px) {
  .controls-bar .flag-switcher { gap: 5px; flex-wrap: nowrap; }
  .controls-bar .lang-divider { margin: 0 1px; }
  .controls-bar .lang-btn-mini, .controls-bar .top-btn-icon, .controls-bar .nutri-avatar-btn, .nutri-inbox-btn { width: 32px; height: 32px; }
  .nutri-inbox-btn svg { width: 18px; height: 18px; }
}
@media (max-width: 350px) {
  .controls-bar .flag-switcher { gap: 3px; }
  .controls-bar .lang-btn-mini, .controls-bar .top-btn-icon, .controls-bar .nutri-avatar-btn, .nutri-inbox-btn { width: 29px; height: 29px; }
}
.mb-level--row { flex: 1 1 100%; padding: 0; margin: 2px 0 0; border: 0; background: none; }
