@import url("fonts/IRANSans.css");

:root, html[data-theme="light"] {
  --primary: #395aff;
  --primary-dark: #304dd9;
  --secondary: #5b586e;
  --light: #f4f5f7;
  --dark: #222032;
  --white: #fff;
  --gray-200: #dde1ec;
  --gray-300: #b3b1c3;
  --success: #3eca76;
  --danger: #ff3838;
  --warning: #ffc21d;
  --info: #20bbd3;
  --purple: #a659ff;
  --pink: #e05fc4;
  --bg: #fff;
  --bg-elev: #f4f5f7;
  --card: #fff;
  --ink: #222032;
  --muted: #5b586e;
  --line: #dde1ec;
  --brand: #395aff;
  --brand-dark: #304dd9;
  --brand-soft: rgba(57, 90, 255, .12);
  --ok: #3eca76;
  --ok-soft: rgba(62, 202, 118, .14);
  --shadow: 0 1px 2px rgba(34, 32, 50, .04), 0 8px 20px rgba(34, 32, 50, .06);
  --shadow-lift: 0 10px 28px rgba(34, 32, 50, .12);
  --field: #fff;
  --tab: #fff;
  --radius: 15px;
  --header-h: 56px;
  --tab-h: 56px;
  --glass-bg: color-mix(in srgb, var(--white) 72%, transparent);
  --glass-border: color-mix(in srgb, var(--ink) 8%, transparent);
  --glass-blur: saturate(1.4) blur(18px);
}

html[data-theme="dark"] {
  --white: #222032;
  --secondary: #807d96;
  --light: #2a283b;
  --dark: #dde1ec;
  --gray-200: #353246;
  --gray-300: #5b586e;
  --bg: #222032;
  --bg-elev: #2a283b;
  --card: #222032;
  --ink: #dde1ec;
  --muted: #807d96;
  --line: #353246;
  --brand: #395aff;
  --brand-dark: #6b84ff;
  --brand-soft: rgba(57, 90, 255, .18);
  --ok: #3eca76;
  --ok-soft: rgba(62, 202, 118, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 8px 22px rgba(0, 0, 0, .28);
  --shadow-lift: 0 10px 30px rgba(0, 0, 0, .38);
  --field: #2a283b;
  --tab: #222032;
  --glass-bg: color-mix(in srgb, var(--white) 62%, transparent);
  --glass-border: color-mix(in srgb, var(--ink) 14%, transparent);
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "IRANSans", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  color-scheme: light;
  -webkit-tap-highlight-color: transparent;
  text-align: start;
}
html[data-theme="dark"], html[data-theme="dark"] body { color-scheme: dark; }
button, input, select, textarea { font-family: inherit; }
*, *::before, *::after { box-sizing: border-box; }

.icon { display: inline-block; vertical-align: -0.2em; flex: 0 0 auto; }

/* Boot / route-transition loading screen: centered spinner with a faded mirror
   reflection underneath. Used both by index.html (before Blazor finishes booting)
   and MainLayout's own "not ready yet" state, on both PWA and Android. */
.boot-loading {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg, #fff);
  color: var(--muted, #5b586e);
  font-family: "IRANSans", Tahoma, sans-serif;
}
.main .boot-loading { min-height: 50vh; }
.boot-spinner-stack { display: flex; flex-direction: column; align-items: center; line-height: 0; }
.boot-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--primary, #395aff) 18%, transparent);
  border-top-color: var(--primary, #395aff);
  animation: boot-spin .8s linear infinite;
}
.boot-spinner-reflect {
  width: 38px;
  height: 38px;
  margin-top: 2px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--primary, #395aff) 18%, transparent);
  border-top-color: var(--primary, #395aff);
  opacity: .35;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .6), transparent);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .6), transparent);
  animation: boot-spin-reflect .8s linear infinite;
}
.boot-loading h1 { margin: 0 0 16px; font-size: 1.15rem; font-weight: 700; }
.boot-loading p { margin: 0; font-size: 13px; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes boot-spin-reflect {
  from { transform: scaleY(-1) rotate(0deg); }
  to { transform: scaleY(-1) rotate(360deg); }
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: calc(var(--header-h) + var(--status-bar-inset, env(safe-area-inset-top)));
  /* The bar owns the status bar strip itself instead of relying on a separate spacer element:
     a spacer can only sit above the bar in the flow, so once the page scrolls the sticky bar
     slides underneath it (and under the system status bar with it). */
  padding: var(--status-bar-inset, env(safe-area-inset-top)) 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background-image: linear-gradient(to right, var(--white), #d977a7, #8272e1, var(--white));
  background-size: 100% 100%;
  pointer-events: none;
  transition: height .25s ease, box-shadow .35s ease;
}
/* While requests are in flight the strip turns into a moving rainbow with a soft glow. */
.topbar.is-loading::after {
  height: 3px;
  background-image: linear-gradient(to right, #d977a7, #8272e1, #395aff, #3fc1c9, #8272e1, #d977a7);
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(130, 114, 225, .75), 0 0 16px rgba(217, 119, 167, .45);
  animation: topbar-loading 1.1s linear infinite, topbar-glow 1.4s ease-in-out infinite alternate;
}
@keyframes topbar-loading {
  from { background-position: 0% 0; }
  to { background-position: -200% 0; }
}
@keyframes topbar-glow {
  from { opacity: .75; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .topbar.is-loading::after { animation: topbar-glow 1.4s ease-in-out infinite alternate; }
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
}
.brand-mark .icon { color: var(--primary); }
.brand-mark-img { width: 22px; height: 22px; object-fit: contain; }
.topbar-end {
  display: flex;
  align-items: center;
  flex-direction: row;
  column-gap: 16px;
}
.topbar .muted { color: var(--muted); font-size: 12px; }

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 50%;
  padding: 0;
  transition: background-color .15s ease, transform .1s ease;
}
.icon-btn:hover { background: var(--light); }
.icon-btn:active { transform: scale(.92); }
.avatar-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--light);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
}
.avatar-btn .avatar-circle { width: 100%; height: 100%; font-size: inherit; }

/* آواتار دایره‌ای عمومی: عکس کاربر اگر باشد، وگرنه حرف اول اسمش. */
.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  line-height: 1;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* کارت آواتار در تنظیمات: پیش‌نمایش بزرگ + دکمه‌های تغییر/حذف. */
.avatar-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0;
}
.avatar-editor .avatar-editor-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.week-slot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}
.week-slot:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}
.week-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.device-list {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}
.device-row:last-child {
  border-bottom: none;
}
.device-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-bars {
  width: 19px;
  height: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.menu-bars span {
  display: block;
  height: 2.3px;
  border-radius: 1.15px;
  background: var(--ink);
}

.main {
  flex: 1;
  padding: 18px 0 96px;
}
.page-pad { padding-inline: 20px; }

.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  padding-inline: 20px;
}
.page-title .icon { color: var(--primary); }

.section-head {
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head .text h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 3px;
  color: var(--ink);
}
.section-head .text p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  font-weight: 400;
}
.section-head.result .text h2 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}
.icon-circle {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-200);
  color: var(--ink);
  border-radius: 50%;
  text-decoration: none;
  border: 0;
  padding: 0;
}

.tabbar {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  min-height: var(--tab-h);
  padding: 0 12px env(safe-area-inset-bottom);
  z-index: 40;
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  position: relative;
  transition: color .15s ease;
}
.tabbar a::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  bottom: 4px;
  opacity: 0;
  transition: opacity .15s ease;
}
.tabbar a.active { color: var(--primary); }
.tabbar a.active::after { opacity: 1; }
.tabbar a:hover { color: var(--ink); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 20px 12px;
  box-shadow: var(--shadow);
}
.card.clickable { cursor: pointer; }
.card.flush { margin-inline: 20px; }
.card .field { margin-inline: 0; }

.btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 18px;
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .65; cursor: not-allowed; }
.btn.secondary {
  background: var(--light);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.secondary:hover { background: var(--gray-200); }
.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.icon-only { width: auto; padding: 8px 10px; }
.btn.pill { border-radius: 50px; }
.btn.inline { width: auto; }

input, select, textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 6px 0;
  font-family: inherit;
  background: var(--field);
  color: var(--ink);
  /* iOS Safari auto-zooms the page on focus for any input font-size under 16px, and in a
     standalone PWA that zoom can stay stuck after the keyboard closes. 16px keeps it from
     triggering at all. */
  font-size: 16px;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(57, 90, 255, .18);
}
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: 50px;
  padding: 0 14px;
  margin: 0 20px 12px;
}
.field .icon { color: var(--muted); }
.field input, .field select {
  border: 0;
  margin: 0;
  background: transparent;
  padding-inline: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input[type="search"]::-webkit-search-cancel-button,
.field input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus { box-shadow: none; }

.form-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 20px 4px;
}
.card .form-label, .page-pad .form-label { margin-inline: 0; }
.macro-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin: 8px 0 4px;
}
.macro-bar {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.macro-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.macro-bar.over > span { background: var(--danger); }

.report-tabs { display: flex; gap: 8px; margin: 10px 0; }
.report-tabs .chip-filter { flex: 1; text-align: center; }
.report-days {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 84px;
  margin: 10px 0 4px;
}
.report-day-bar {
  flex: 1;
  height: 100%;
  background: var(--line);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  min-width: 2px;
}
.report-day-bar > span {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  background: var(--primary);
  border-radius: 2px;
}
.report-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.report-stat { background: var(--gray-200); border-radius: var(--radius); padding: 10px 12px; }
.report-stat .num { font-size: 16px; font-weight: 700; }
.report-stat .lbl { color: var(--muted); font-size: 12px; }

.muted { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 24px 20px; }
.row { display: flex; gap: 8px; align-items: center; }
.badge {
  background: var(--brand-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
h1 { font-size: 22px; margin: 0 0 12px; font-weight: 700; }
h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 500; font-size: 16px; }
.error { color: var(--danger); margin: 8px 20px; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pct { font-weight: 700; color: var(--ok); }

.auth { max-width: 100%; margin: 8px auto 0; padding-inline: 20px; }
.session-choice { margin: 12px 0 16px; }
.session-choice .list-row h2 { font-size: 15px; }
.turnstile-slot { min-height: 68px; margin-top: 12px; }
.captcha-hint { margin: 6px 0 0; font-size: 12px; }
.fallback-captcha { margin-top: 12px; }
.fallback-captcha .captcha-visual {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
}
.fallback-captcha img {
  display: block;
  width: auto;
  max-width: calc(100% - 118px);
  height: 50px;
  margin: 0;
  flex: 0 1 auto;
  border-radius: 8px;
  background: #f8f9fa;
}
.auth .fallback-captcha .captcha-refresh {
  width: auto;
  flex: 0 0 auto;
  height: 50px;
  margin: 0;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}
.auth .error { margin: 8px 0; }
.auth .btn { margin-top: 8px; }
.auth .field { margin-inline: 0; }
.auth-hero { text-align: center; margin-bottom: 22px; }
.auth-hero .mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  display: block;
  object-fit: contain;
}
.auth-hero h1 { font-size: 24px; font-weight: 700; }
.bio-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--primary);
  padding: 0;
}

.field-row { display: flex; align-items: stretch; gap: 8px; margin: 0 0 12px; }
.field-row .field { flex: 1; min-width: 0; margin-bottom: 0; }
.referrer-toggle {
  flex: 0 0 auto;
  width: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.referrer-toggle:active { transform: scale(.92); }
.referrer-toggle.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 20px; margin-bottom: 12px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.tile .icon { color: var(--primary); }

.menu-list { padding: 4px 20px 20px; }
.menu-link {
  padding: 12px 16px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  color: var(--ink);
  background: var(--card);
  cursor: pointer;
  width: 100%;
  font: inherit;
  text-align: start;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.menu-link:hover { border-color: var(--brand); box-shadow: var(--shadow-lift); }
.menu-link:active { transform: scale(.99); }
.menu-link .item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.menu-link .ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--primary);
}
.menu-link .ttl { font-size: 15px; font-weight: 500; margin: 0; }
.menu-link .chev { color: var(--muted); }

.nft-featured {
  position: relative;
  display: block;
  margin: 0 20px 12px;
  cursor: pointer;
}
.nft-featured .cover {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  height: 355px;
  background: linear-gradient(160deg, #8272e1, #222032);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
}
.nft-featured .cover img,
.nft-featured .cover .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nft-featured .cover .ph {
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.7);
}
.chip-time {
  position: absolute;
  top: 15px;
  inset-inline-start: 15px;
  padding: 8px 12px;
  border-radius: 50px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
/* قلب (علاقه‌مندی) و انگشت‌شست (پیشنهاد) کنار هم روی کاور کارت. */
.pill-stack {
  position: absolute;
  top: 15px;
  inset-inline-end: 15px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.pill-stack .like-pill {
  position: static;
  top: auto;
  left: auto;
}
.like-pill {
  position: absolute;
  top: 15px;
  inset-inline-end: 15px;
  background: var(--white);
  padding: 4px 12px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  z-index: 2;
  box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.like-pill:active { transform: scale(.9); }
.like-pill.on { color: var(--danger); }
.like-pill.on .icon { color: var(--danger); }
.like-pill.thumb.on,
.like-pill.thumb.on .icon { color: var(--brand); }
.like-pill.plan,
.like-pill.plan .icon { color: var(--brand); }
.week-plan-title { margin: 0 0 12px; font-weight: 700; }
.add-week-btn { margin: 4px 0 12px; }
.week-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.week-switch .range { font-size: 12px; font-weight: 600; text-align: center; }

/* شمارنده‌های بازدید / علاقه‌مندی / پیشنهاد زیر عنوان کارت. */
.info-card .stats,
.nft-sm .foot .stats {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 500;
}
.info-card .stats { color: var(--muted); }
/* ---- بخش نظرها ---- */
.community > .muted { margin: 4px 0 10px; }

/* ---- گالری: عکس‌های خودِ آشپز + عکس‌های تاییدشدهٔ کاربران، یکجا با تگ ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  padding: 4px 0 12px;
}
.gallery-thumb {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: var(--bg);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb .user-tag {
  position: absolute;
  bottom: 4px;
  inset-inline-end: 4px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
}

/* پیش‌نمایش + کپشن قبل از ارسال، مثل فرم پست اینستاگرام. */
.photo-composer {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin: 4px 0 8px;
}
.photo-composer img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
}
.photo-composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  resize: vertical;
}
.photo-composer textarea:focus { outline: none; border-color: var(--brand); }
.photo-composer .row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.photo-composer .row .btn { width: auto; padding-inline: 16px; }

/* ---- لایت‌باکس تمام‌صفحه با اطلاعات ارسال‌کننده، شبیه پست اینستاگرام ---- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: sheet-overlay-in .15s ease;
}
.lightbox {
  position: relative;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius);
}
.lightbox-close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 1;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  cursor: pointer;
}
.lightbox-img { width: 100%; max-height: 65vh; object-fit: contain; background: #000; display: block; }
.lightbox-info { padding: 12px 14px; }
.lightbox-info .uploader { display: flex; align-items: flex-start; gap: 10px; }
.lightbox-info .posted-by { font-size: 13px; }
.lightbox-info .upload-date { display: block; font-size: 11px; margin-top: 2px; }
.lightbox-caption {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
}
.caption-toggle {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-inline-start: 4px;
}

/* دکمهٔ آپلود: input فایل خام پنهان است و لیبل، دکمهٔ واقعی را می‌سازد. */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  color: var(--brand);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.upload-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload-btn.busy { opacity: .6; cursor: default; pointer-events: none; }
.upload-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* باکس «این را شما نوشتید و در انتظار تایید است». */
.my-comment {
  border: 1px solid var(--line);
  border-inline-start-width: 3px;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 12px 0;
}
.my-comment .head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.my-comment p { margin: 0; font-size: 13px; }
.my-comment.pending { border-inline-start-color: var(--brand); }
.my-comment.pending .head { color: var(--brand); }
.my-comment.rejected { border-inline-start-color: var(--danger); }
.my-comment.rejected .head { color: var(--danger); }

.comment-form { margin: 12px 0; }
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--brand); }
.comment-form .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.comment-form .row .muted { font-size: 11px; }

.comment-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.comment {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.comment:first-child { border-top: 0; padding-top: 0; }
.comment .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.comment .head .who { display: flex; align-items: center; gap: 6px; }
.comment .head .muted { font-size: 11px; }
.comment p { margin: 4px 0 8px; font-size: 13px; line-height: 1.7; }
.comment .votes { display: flex; gap: 8px; }
.comment .vote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.comment .vote.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.comment .vote.down.on { border-color: var(--danger); color: var(--danger); background: transparent; }

/* همان شمارنده‌ها در صفحهٔ دستور پخت، زیر عنوان. */
.engagement {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 2px 0 6px;
  font-size: 12px;
}
.engagement > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nft-sm .foot .stats { opacity: .92; }
.info-card .stats > span,
.nft-sm .foot .stats > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.info-card {
  background: var(--white);
  border-radius: 6px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: absolute;
  bottom: 15px;
  inset-inline: 15px;
  box-shadow: var(--shadow-lift);
}
.info-card h4 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 4px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}
.info-card .sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.info-card .right { text-align: end; flex: 0 0 auto; }
.info-card .right h6 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 3px;
}
.info-card .right p {
  font-size: 15px;
  color: var(--ok);
  font-weight: 500;
  margin: 0;
}

.nft-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 20px 8px;
}
.nft-sm {
  position: relative;
  display: block;
  text-decoration: none;
  cursor: pointer;
}
.nft-sm .pill-stack {
  top: 8px;
  inset-inline-end: 8px;
  gap: 4px;
  max-width: calc(100% - 16px);
  flex-wrap: wrap;
}
.nft-sm .pill-stack .like-pill {
  padding: 3px 7px;
  gap: 3px;
  font-size: 11px;
}
.nft-sm .cover {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  height: 320px;
  background: linear-gradient(160deg, #395aff, #222032);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.nft-sm .cover img,
.nft-sm .cover .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nft-sm .cover .ph {
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.75);
}
.nft-sm .cover::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 75%;
  /* Eased multi-stop scrim: solid enough behind the text block that busy photos stay readable,
     fading out smoothly before it reaches the pills at the top. */
  background-image: linear-gradient(to top,
    rgba(20, 18, 32, .92) 0%,
    rgba(20, 18, 32, .8) 30%,
    rgba(20, 18, 32, .5) 55%,
    rgba(20, 18, 32, .18) 80%,
    rgba(20, 18, 32, 0) 100%);
  pointer-events: none;
  /* Must sit above the <img>: the dark-theme grayscale filter gives the image its own
     stacking context, which otherwise paints over this scrim and leaves the text unreadable. */
  z-index: 1;
}
.nft-sm .foot {
  position: absolute;
  bottom: 12px;
  inset-inline: 12px;
  color: #fff;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 0 8px rgba(0, 0, 0, .35);
}
.nft-sm .foot .name {
  font-size: 13px;
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nft-sm .foot .meta {
  font-size: 12px;
  font-weight: 500;
  opacity: .92;
}

.hero-detail {
  position: relative;
  margin: 0 20px 16px;
}
.hero-detail .cover {
  position: relative;
  height: 280px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #8272e1, #222032);
}
.hero-detail .cover-corner {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: calc(100% - 24px);
}
.hero-detail .cover-corner .chip-time,
.hero-detail .cover-corner .pill-stack {
  position: static;
}
.hero-detail .cover-corner .pill-stack { flex-wrap: wrap; justify-content: flex-start; }
.hero-detail .cover img,
.hero-detail .cover .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-detail .cover .ph {
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.7);
}
.detail-body { padding-inline: 20px; }
.detail-body p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.detail-body .card { margin-inline: 0; }
.detail-body ul, .detail-body ol { padding-inline-start: 18px; margin: 8px 0 0; }
.detail-body li { margin: 6px 0; font-size: 14px; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 0 20px 12px;
  background: var(--card);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .15s ease;
}
.list-row:hover { box-shadow: var(--shadow-lift); }
.list-row:active { transform: scale(.99); }
.list-row .thumb {
  width: 60px;
  height: 50px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--light);
  flex: 0 0 auto;
}
.list-row .txt { flex: 1; min-width: 0; }
.list-row .txt h2 {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 2px;
  color: var(--ink);
}
.list-row .txt p { margin: 0; font-size: 12px; color: var(--muted); }

.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-inline: 20px;
  margin-bottom: 18px;
}
.search-row.above-filters { margin-bottom: 10px; }
.search-row .field { flex: 1; margin: 0; }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.chip-filter {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.chip-filter.on {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.group-tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.group-tabs::-webkit-scrollbar { display: none; }
.group-tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.group-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* شیت دسته‌بندی: سردسته یک عنوان است، نه یک چیپ — تا با زیرشاخه‌ها اشتباه نشود. */
.cat-group + .cat-group { margin-top: 18px; }
.cat-group > .head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cat-group > .head > h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .2px;
  flex: 0 0 auto;
}
.cat-group > .head > .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.cat-group > .filter-chips { margin-bottom: 0; }

.page-lead { padding: 0 20px 12px; }

.lang-switch {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.lang-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.lang-btn.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.lang-btn:disabled { opacity: .6; cursor: not-allowed; }

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawer-in {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 60;
  animation: overlay-in .18s ease;
}
.nav-drawer-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(82vw, 340px);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-inline-start: 1px solid var(--glass-border);
  z-index: 61;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-lift);
  animation: drawer-in .22s cubic-bezier(.22, 1, .36, 1);
}
.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.nav-drawer-head h3 { margin: 0; font-size: 16px; }

.settings-section-title {
  padding: 0 20px;
  margin: 20px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.settings-section-title:first-child { margin-top: 0; }

/* Filled snackbar, same idea as MudBlazor / toastr: a wide bar, small radius, color by kind. */
.app-toast {
  position: fixed;
  left: 12px;
  right: auto;
  bottom: calc(var(--tab-h) + 12px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: calc(100vw - 24px);
  max-width: 440px;
  min-height: 52px;
  margin: 0;
  padding: 10px 4px 12px 12px;
  border: 0;
  border-radius: 4px;
  background: #1a73e8;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-align: start;
  box-shadow: 0 3px 5px -1px rgba(0, 0, 0, .2), 0 6px 10px rgba(0, 0, 0, .14), 0 1px 18px rgba(0, 0, 0, .12);
  opacity: 1;
  overflow: hidden;
  pointer-events: auto;
  animation: app-toast-in .18s ease;
}
@keyframes app-toast-in { from { opacity: .2; } to { opacity: 1; } }
.app-toast.info { background: #1a73e8; color: #fff; }
.app-toast.error { background: #d32f2f; color: #fff; }
.app-toast.warn { background: #ffc21d; color: #3a2a00; }
.app-toast.ok { background: #1b8f4a; color: #fff; }
.app-toast-mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-toast-text { flex: 1 1 auto; min-width: 0; }
.app-toast-close {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.app-toast-close .icon { pointer-events: none; }
.app-toast-close:hover { background: rgba(0, 0, 0, .12); }
.app-toast-time {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, .55);
  transform-origin: right center;
  transform: scaleX(1);
  pointer-events: none;
}
.app-toast.warn .app-toast-time { background: rgba(58, 42, 0, .35); }
@keyframes toast-life { to { transform: scaleX(0); } }
.pantry-combo { position: relative; }
.pantry-combo > input { margin-top: 0; }
.pantry-menu {
  position: absolute;
  z-index: 6;
  inset-inline: 0;
  top: calc(100% - 4px);
  max-height: 220px;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
}
.pantry-menu button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
}
.pantry-menu button:last-child { border-bottom: 0; }
.pantry-menu button:hover,
.pantry-menu button:focus { background: var(--brand-soft); }
.pantry-menu-note { padding: 10px 12px; color: var(--muted); font-size: 13px; }
.pantry-amount { display: flex; align-items: center; gap: 8px; }
.pantry-amount input { flex: 1 1 auto; width: 1%; min-width: 0; }
.pantry-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 20px 8px;
}
.pantry-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 6px 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.pantry-cell-text { flex: 1 1 auto; min-width: 0; }
.pantry-cell-text .name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pantry-cell-text .amt {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pantry-edit {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.pantry-edit input {
  width: 72px;
  min-width: 0;
  padding: 4px 6px;
  font-size: 13px;
}
.pantry-edit span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.fav-folder-bar { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.fav-folder-bar input { flex: 1; margin: 0; }
.fav-folder-bar .btn { width: auto; }
.fav-folder-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 4px;
}
.fav-folder-head h3 { margin: 0; flex: 1; font-size: 15px; }
.fav-folder-head .btn { width: auto; padding: 6px 10px; }
.fav-checks { display: flex; flex-direction: column; gap: 8px; }
.fav-checks label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pantry-cell .btn.icon-only { padding: 6px; }
.pantry-suggest-wrap { margin-bottom: 16px; }
.pantry-unit {
  flex: 0 1 auto;
  max-width: 46%;
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
.persian-date-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 6px 0;
  font-family: inherit;
  background: var(--field);
  color: var(--ink);
  font-size: 16px;
  text-align: start;
  cursor: pointer;
}
.row .persian-date-btn { flex: 1; width: auto; margin: 0; }
.persian-date-btn:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(57, 90, 255, .18);
}
.persian-date-pop {
  position: fixed;
  z-index: 90;
  width: 280px;
  box-sizing: border-box;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
  padding: 10px;
  direction: rtl;
}
.pd-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-title { font-weight: 700; font-size: 14px; }
.pd-nav, .pd-today, .pd-day {
  font-family: inherit;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
}
.pd-nav { padding: 6px 8px; }
.pd-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 8px; }
.pd-head, .pd-empty, .pd-day { text-align: center; font-size: 13px; height: 32px; line-height: 32px; }
.pd-head { color: var(--muted); }
.pd-day { border-radius: 8px; color: var(--ink); padding: 0; }
.pd-day.on { background: var(--primary); color: #fff; }
.pd-day.today { box-shadow: inset 0 0 0 1px var(--primary); }
.pd-today { display: block; width: 100%; margin-top: 8px; padding: 8px; }
.trend-chart {
  direction: ltr;
  width: 100%;
  height: 180px;
  color: var(--primary);
  margin-top: 8px;
}
.trend-chart circle { fill: var(--primary); cursor: pointer; }
.trend-chart circle.on { fill: var(--ink); }
.trend-axis {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.bmi-chart { margin-top: 14px; }
.bmi-track {
  direction: ltr;
  position: relative;
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
}
.bmi-zone.low { width: 14%; background: #5b8def; }
.bmi-zone.ok { width: 26%; background: var(--ok); }
.bmi-zone.high { width: 20%; background: var(--warning); }
.bmi-zone.obese { width: 40%; background: var(--danger); }
.bmi-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--white);
  transform: translateY(-50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.bmi-labels {
  direction: ltr;
  display: flex;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.bmi-labels span:nth-child(1) { width: 14%; }
.bmi-labels span:nth-child(2) { width: 26%; }
.bmi-labels span:nth-child(3) { width: 20%; }
.bmi-labels span:nth-child(4) { width: 40%; }

.update-gate-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.update-gate-card {
  max-width: 340px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 28px 22px;
  text-align: center;
}
.update-gate-card .icon { color: var(--primary); }
.update-gate-card h3 { margin: 12px 0 6px; font-size: 17px; }
.update-gate-card p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.update-gate-card .btn { width: 100%; }

.update-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 12px);
  transform: translateX(-50%);
  width: min(92vw, 400px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 10px 14px;
  z-index: 65;
  font-size: 13px;
}
.update-banner .icon { color: var(--primary); flex: 0 0 auto; }
.update-banner span { flex: 1; }
.update-banner .btn.inline { width: auto; padding: 6px 14px; font-size: 12px; }

@media (min-width: 768px) {
  .update-banner { left: 50%; }
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.filter-bar .chip-filter { gap: 4px; }

@keyframes sheet-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 60;
  animation: sheet-overlay-in .18s ease;
}
.sheet-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lift);
  animation: sheet-in .22s cubic-bezier(.22, 1, .36, 1);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.sheet-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px;
  flex: 1 1 auto;
}
.sheet-body .page-pad { padding-inline: 0; }
.sheet-body .field, .sheet-body .card, .sheet-body .error { margin-inline: 0; }
.sheet-body .filter-chips { padding: 0; }
.sheet-foot {
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
  background: var(--bg);
}
.sheet-foot .btn { width: auto; flex: 1; }

.servings-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 20px 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
}
.servings-note .icon { color: var(--brand); flex: 0 0 auto; }

/* استپر «تعداد نفرات» در صفحهٔ دستور پخت. */
.servings-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.servings-picker > .muted { font-size: 13px; }
.servings-picker .stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}
.servings-picker .stepper > span {
  min-width: 1.5em;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
}
.servings-picker .stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--brand-soft);
  color: var(--brand);
  cursor: pointer;
  transition: opacity .15s ease;
}
.servings-picker .stepper button:disabled { opacity: .4; cursor: default; }

@media (min-width: 768px) {
  .sheet-overlay, .sheet-panel { left: max(50% - 215px, 0px); width: 430px; right: auto; }
}

@media (min-width: 768px) {
  body { background: var(--light); }
  .app-shell {
    max-width: 430px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(34, 32, 50, .12);
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  .app-shell.app-shell-auth {
    max-width: 760px;
  }
  .app-shell.app-shell-auth .auth {
    max-width: 520px;
  }
  .main {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 24px;
  }
  /* داخل قاب ۴۳۰ پیکسل بماند؛ left:50% + translate در RTL و با اسکرول‌بار دسکتاپ کج می‌شد. */
  .tabbar {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    width: auto;
    max-width: none;
    transform: none;
    flex-shrink: 0;
  }
  .app-toast {
    left: 50%;
    width: 390px;
    margin-left: -195px;
  }
  .nav-drawer-overlay, .nav-drawer-panel {
    left: max(50% - 215px, 0px);
    right: auto;
    inset-inline: auto;
    width: min(82vw, 340px);
  }
  .nav-drawer-overlay { width: 430px; }
}

html[data-theme="dark"] .nft-sm .cover::before {
  background-image: linear-gradient(to top,
    rgba(17, 16, 24, .95) 0%,
    rgba(17, 16, 24, .82) 30%,
    rgba(17, 16, 24, .52) 55%,
    rgba(17, 16, 24, .18) 80%,
    rgba(17, 16, 24, 0) 100%);
}
html[data-theme="dark"] img:not([src*=".svg"]) { filter: grayscale(12%); }
.icon.like-on { color: var(--danger); }

/* دکمه شناور «چی بپزم؟» وسط تب‌بار */
.tabbar a.fab-mid {
  gap: 4px;
  padding-top: 0;
}
.tabbar a.fab-mid .fab-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  box-shadow: var(--shadow-lift);
  transform: translateY(-16px);
  transition: transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .18s ease;
}
.tabbar a.fab-mid span:last-child { margin-top: -10px; }
.tabbar a.fab-mid:active .fab-circle { transform: translateY(-16px) scale(.9); }
.tabbar a.fab-mid.active { color: var(--primary); }
.tabbar a.fab-mid.active .fab-circle {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent), var(--shadow-lift);
}
.tabbar a.fab-mid::after { display: none; }

/* ویزارد پیشنهاد وعده غذایی */
.wizard-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.wizard-dot {
  height: 4px;
  flex: 1;
  border-radius: 99px;
  background: var(--gray-200);
  transition: background .2s ease;
}
.wizard-dot.on { background: var(--primary); }

@keyframes wizard-step-in {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}
.wizard-step { animation: wizard-step-in .28s cubic-bezier(.22, 1, .36, 1); }

.wizard-question { margin: 0 0 14px; font-size: 17px; font-weight: 700; }

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 14px;
}
.wizard-nav .btn { width: auto; margin: 0; padding: 8px 12px; }
.wizard-back-btn .icon { transform: scaleX(-1); }
.app-shell[dir="ltr"] .wizard-back-btn .icon { transform: none; }
.app-shell[dir="ltr"] .wizard-next-btn .icon { transform: scaleX(-1); }
.wizard-next-btn { margin-inline-start: auto; }

.wizard-choice-row {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
}
.wizard-choice {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, transform .12s ease, color .15s ease, background .15s ease;
}
.wizard-choice:hover { border-color: var(--primary); color: var(--primary); }
.wizard-choice:active { transform: scale(.97); }

.wizard-meal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.wizard-meal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, transform .12s ease, color .15s ease, background .15s ease;
}
.wizard-meal-card .icon { color: var(--primary); }
.wizard-meal-card:hover { border-color: var(--primary); background: var(--brand-soft); }
.wizard-meal-card:active { transform: scale(.96); }

.wizard-upsell {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--brand-soft);
}
.wizard-upsell p { margin: 0 0 10px; color: var(--ink); font-size: 13.5px; }

.wizard-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.wizard-actions .btn { width: auto; flex: 1; }

.wizard-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.wizard-results-header h3 { margin: 0; }
.cook-flag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 14px;
  font-weight: 600;
}
.cook-flag input { width: 18px; height: 18px; margin: 0; }
.cook-pick { position: relative; }
.cook-pick-toggle {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  color: transparent;
  cursor: pointer;
}
.cook-pick.on .cook-pick-toggle {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.cook-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--field);
  color: transparent;
}
.cook-check.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cook-menu-hint { margin-top: 0; }
.cook-shop-title { margin: 14px 0 8px; font-size: 15px; }
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-list li { border-top: 1px solid var(--line); }
.shop-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 14px;
}
.shop-list input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.shop-list span { flex: 1 1 auto; min-width: 0; }
.shop-list strong { flex: 0 0 auto; font-size: 13px; }
.shop-list li.bought span { text-decoration: line-through; color: var(--muted); }

/* روش پخت کنار شمارندهٔ «پیشنهاد»: یکی فقط آیکن، چندتا دراپ‌داون بازشونده. */
.method-inline { position: relative; display: inline-flex; }
.method-inline .method-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  line-height: 1;
}
.method-inline button.method-icons { cursor: pointer; }
.method-inline .method-icons .chev { transition: transform .15s ease; opacity: .7; }
.method-inline.open .method-icons { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.method-inline.open .method-icons .chev { transform: rotate(180deg); }
.method-menu {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.method-menu .m-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--ink);
}
.method-menu .m-row .m-min { color: var(--muted); font-size: 12px; }
.method-menu .m-note { padding: 0 8px 6px; font-size: 12px; color: var(--muted); }

/* کارت‌های بسته‌شونده در صفحهٔ دستور پخت (ارزش غذایی). */
.detail-body details.collapsible { padding: 0; }
.detail-body details.collapsible > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
}
.detail-body details.collapsible > summary::-webkit-details-marker { display: none; }
.detail-body details.collapsible > summary .chev { margin-inline-start: auto; opacity: .7; transition: transform .15s ease; }
.detail-body details.collapsible[open] > summary .chev { transform: rotate(180deg); }
.detail-body details.collapsible > .collapsible-body { padding: 0 16px 14px; font-size: 14px; }

/* استپر تعداد نفرات در صفحهٔ دستور پخت جمع‌وجورتر است تا جای مواد لازم را نگیرد. */
.servings-picker.compact { margin: 8px 0; padding: 5px 10px; }
.servings-picker.compact > .muted { font-size: 12px; }
.servings-picker.compact .stepper { gap: 8px; }
.servings-picker.compact .stepper > span { font-size: 13px; }
.servings-picker.compact .stepper button { width: 24px; height: 24px; }
.ingredient-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ingredient-head .stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.ingredient-head .stepper > span {
  min-width: 1.5em;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}
.ingredient-head .stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--brand-soft);
  color: var(--brand);
  cursor: pointer;
}
.ingredient-head .stepper button:disabled { opacity: .4; cursor: default; }
.meal-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 10px;
}

/* ---- lazy-media.js: عکسی که هنوز src نگرفته نه آیکون عکس خراب نشان می‌دهد نه متن alt ---- */
img[data-src]:not([src]) { visibility: hidden; }

.recipe-steps { margin: 8px 0 0; padding-inline-start: 1.2rem; }
.recipe-steps p { margin: 6px 0 0; white-space: pre-wrap; }
.step-photo {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 8px;
  background: var(--light);
}
