/* ---------------------------------------------------------------------------
   Trend Hunters — Mini App · «مشکی و طلایی»
   یک تم ثابت (به درخواست مشتری): زمینه‌ی مشکیِ گرم، طلایی برای تأکید و اقدام اصلی.
   سبز/قرمز فقط معنای سود/زیان و وضعیت دارند، نه تزئین.
   ارقام و مبلغ‌ها همیشه لاتین و در «جزیره‌ی چپ‌به‌راست» (.num) تا در متن فارسی جابه‌جا نشوند.
--------------------------------------------------------------------------- */

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/vazirmatn-variable.woff2') format('woff2-variations'), url('/fonts/vazirmatn-variable.woff2') format('woff2');
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-variable.woff') format('woff');
  font-weight: 200 800; font-display: swap;
}
@font-face { font-family: 'Plex Arabic'; src: url('/fonts/plex-arabic-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Arabic'; src: url('/fonts/plex-arabic-600.woff') format('woff'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Plex Arabic'; src: url('/fonts/plex-arabic-700.woff') format('woff'); font-weight: 700 900; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #0B0A08;
  --panel: #13110D;
  --panel-2: #1A1712;
  --panel-3: #221E17;
  --hair: #2A2419;
  --hair-gold: rgba(226, 184, 92, 0.28);
  --text: #F5EFE3;
  --text-2: #BDB3A1;
  --text-3: #8C8374;
  --gold: #E2B85C;
  --gold-hi: #F6E0A4;
  --gold-deep: #A67A2C;
  --on-gold: #1A1408;
  --gain: #58C28F;
  --loss: #E36B5E;
  --gold-grad: linear-gradient(135deg, #F6E0A4 0%, #E2B85C 42%, #B98A34 74%, #E9C878 100%);
  --gold-edge: linear-gradient(135deg, rgba(246, 224, 164, 0.85) 0%, rgba(166, 122, 44, 0.35) 45%, rgba(226, 184, 92, 0.75) 100%);

  --latin: 'Manrope', 'Vazirmatn', system-ui, sans-serif;
  --sans: 'Vazirmatn', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: 20px;
  --tabbar-h: 66px;
  --r: 20px;
  --r-sm: 14px;
}
html[lang="en"] { --sans: 'Manrope', 'Vazirmatn', system-ui, sans-serif; }
html[lang="ar"] { --sans: 'Plex Arabic', 'Vazirmatn', 'Manrope', system-ui, sans-serif; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.7;
  -webkit-text-size-adjust: 100%; overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  /* بدون این، کروم لینوکس فاصله‌ی حروف لاتین ریز را به پیکسل گرد می‌کند («T RX») */
  text-rendering: geometricPrecision;
}
body { padding-bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
/* کروم برای کنترل‌های فرم text-rendering را به auto برمی‌گرداند؛ بدون inherit، متن داخل دکمه‌ها باز به‌هم‌ریخته می‌شود */
button, input, select, textarea { font: inherit; color: inherit; text-rendering: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
svg { display: block; flex: none; }

/* ارقام، مبلغ، هش و آدرس: لاتین، هم‌عرض، و جدا از جهت متن */
.num {
  font-family: var(--latin); font-variant-numeric: tabular-nums lining-nums;
  unicode-bidi: isolate; direction: ltr; white-space: nowrap;
}
.money { display: inline-flex; align-items: baseline; gap: 5px; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.money .v { font-family: var(--latin); font-weight: 800; font-variant-numeric: tabular-nums; }
.money .u { font-family: var(--latin); font-weight: 700; font-size: max(10px, 0.46em); letter-spacing: 0.04em; color: var(--text-3); }
.money.gold .v { color: var(--gold-hi); }
.money.gold .u { color: var(--gold); }
.muted { color: var(--text-3); }
.soft { color: var(--text-2); }
.gold-t { color: var(--gold); }
.green-t { color: var(--gain); }

/* ---------- بوت ---------- */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: 18px; background: var(--ink); z-index: 50; padding: 32px; text-align: center;
}
.boot-mark { width: 64px; height: 64px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; transform: scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .boot-mark { animation: none; } }
.boot-text { color: var(--text-2); max-width: 34ch; }
.boot.is-error .boot-mark { animation: none; opacity: 0.4; }
.boot.is-error .boot-text { color: var(--text); }

/* ---------- نوار بالا ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 64px; padding: 0 var(--pad);
  background: rgba(11, 10, 8, 0.92); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 9px; direction: ltr; text-decoration: none; }
.brand .wordmark {
  font-family: var(--latin); font-weight: 800; font-size: 12px; letter-spacing: 0.2em; color: var(--text); white-space: nowrap;
}
.topbar-actions { position: relative; }
.lang-chip {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--hair);
  color: var(--text-2); font-size: 13px; font-weight: 600;
}
.lang-chip svg { color: var(--gold); }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 30;
  margin: 0; padding: 6px; list-style: none; min-width: 150px;
  background: var(--panel-2); border: 1px solid var(--hair); border-radius: var(--r-sm);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.lang-menu button {
  display: block; width: 100%; text-align: start; background: none; border: 0;
  padding: 10px 12px; border-radius: 10px; color: var(--text);
}
.lang-menu button:hover, .lang-menu button[aria-selected="true"] { background: rgba(226, 184, 92, 0.1); color: var(--gold-hi); }

/* ---------- چیدمان ---------- */
.view { padding: 4px var(--pad) 28px; max-width: 560px; margin-inline: auto; }
.view:focus { outline: none; }
.screen { display: flex; flex-direction: column; gap: 16px; }
.screen-title { font-size: 26px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
html[lang="en"] .screen-title { letter-spacing: -0.02em; }
.screen-note { color: var(--text-2); font-size: 13.5px; line-height: 1.8; margin-top: -8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 -4px; }
.section-head h2 { font-size: 16px; font-weight: 800; }
.section-head a, .section-head button {
  display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--gold);
  background: none; border: 0; padding: 0; text-decoration: none;
}

/* ---------- کارت‌ها ---------- */
.card { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r); padding: 18px; }
.card.gold {
  border: 1px solid transparent;
  background: linear-gradient(160deg, #1C1811 0%, #110F0B 100%) padding-box, var(--gold-edge) border-box;
}
.card.dashed { background: transparent; border-style: dashed; }
.card.tight { padding: 4px 16px; }
.card.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.watermark { position: absolute; top: -28px; inset-inline-end: -34px; width: 170px; height: 170px; opacity: 0.07; pointer-events: none; }
.hero-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; position: relative; }
.hero-label svg { color: var(--gold); }
.hero-figure { font-size: 40px; line-height: 1.1; position: relative; }
.hero-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; position: relative; }
.row { display: flex; align-items: center; gap: 12px; }
.row > .grow { flex: 1 1 0; min-width: 0; }
.row.between { justify-content: space-between; }
.btn-row { display: flex; gap: 10px; position: relative; }
.btn-row > * { flex: 1 1 0; }
.divider { height: 1px; background: var(--hair); border: 0; margin: 0; }

.icon-tile {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: var(--gold);
  background: linear-gradient(160deg, #2A2418 0%, #16130E 100%);
  border: 1px solid var(--hair-gold); box-shadow: inset 0 1px 0 rgba(246, 224, 164, 0.08);
}
.icon-tile.sm { width: 38px; height: 38px; border-radius: 11px; }
.icon-tile.muted { color: var(--text-2); background: var(--panel-2); border-color: var(--hair); box-shadow: none; }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 14px; border: 0;
  background: var(--gold-grad); color: var(--on-gold); font-weight: 700; font-size: 15px; white-space: nowrap;
  box-shadow: 0 10px 28px rgba(226, 184, 92, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--hair-gold); box-shadow: none; }
.btn.dark { background: var(--panel-2); color: var(--text); border: 1px solid var(--hair); box-shadow: none; }
.btn.danger { background: transparent; color: var(--loss); border: 1px solid rgba(227, 107, 94, 0.4); box-shadow: none; }
.btn.quiet { background: none; color: var(--gold); box-shadow: none; height: auto; padding: 4px; }
.btn.sm { height: 38px; padding: 0 14px; border-radius: 11px; font-size: 13px; }
.btn.lg { height: 56px; font-size: 16px; }
.btn.block { width: 100%; }

.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; flex: none; white-space: nowrap;
  background: var(--panel); color: var(--text-2); border: 1px solid var(--hair); font-size: 13px; font-weight: 500;
}
.chip[aria-pressed="true"], .chip[aria-current="true"] {
  background: rgba(226, 184, 92, 0.14); color: var(--gold-hi); border-color: var(--hair-gold); font-weight: 600;
}
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad); }
.chips::-webkit-scrollbar { display: none; }

.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; flex: none;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: rgba(226, 184, 92, 0.12); color: var(--gold-hi); border: 1px solid var(--hair-gold);
}
.badge.green { background: rgba(88, 194, 143, 0.12); color: #8FE0B8; border-color: rgba(88, 194, 143, 0.35); }
.badge.muted { background: var(--panel-2); color: var(--text-2); border-color: var(--hair); }
.badge.red { background: rgba(227, 107, 94, 0.12); color: #F2A097; border-color: rgba(227, 107, 94, 0.35); }

.progress { height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--gold-grad); }

/* ---------- خانه ---------- */
.hello h1 { font-size: 26px; font-weight: 800; line-height: 1.3; }
.hello p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick button, .quick a {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 12px;
  border-radius: 18px; background: var(--panel); border: 1px solid var(--hair); color: var(--text);
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.quick svg { color: var(--gold); }
.kpis { display: flex; }
.kpis > div { flex: 1 1 0; min-width: 0; }
.kpis > div + div { padding-inline-start: 12px; border-inline-start: 1px solid var(--hair); }
.kpis b { display: block; font-size: 18px; font-weight: 800; line-height: 1.4; }
.kpis > div > span { display: block; font-size: 11.5px; color: var(--text-3); }
.spark { width: 100%; height: 74px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.list-row + .list-row { border-top: 1px solid var(--hair); }
.list-row .t { display: block; font-weight: 700; font-size: 14.5px; }
.list-row .s { display: block; font-size: 12px; color: var(--text-3); }
.list-row > svg { color: var(--text-3); }
a.list-row { color: inherit; text-decoration: none; }

/* ---------- محصولات ---------- */
.products { display: grid; gap: 12px; }
.product { display: flex; flex-direction: column; gap: 12px; }
.product-head { display: flex; align-items: flex-start; gap: 12px; }
.product-title { font-size: 15.5px; font-weight: 800; line-height: 1.5; }
.product-summary { color: var(--text-2); font-size: 13px; line-height: 1.7; margin-top: 4px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { display: flex; align-items: baseline; gap: 6px; }
.price .money { font-size: 22px; }
.price .per { color: var(--text-3); font-size: 12.5px; }
.state {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 11px;
  background: var(--panel-2); border: 1px solid var(--hair); color: var(--text-2); font-size: 12.5px; font-weight: 600;
}
.state svg { color: var(--gold); }

/* ---------- پرداخت ---------- */
.coin-list { display: flex; flex-direction: column; gap: 10px; }
.coin {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: start;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--hair);
}
.coin[aria-pressed="true"] { background: rgba(226, 184, 92, 0.08); border-color: var(--gold); }
.coin:disabled { opacity: 0.5; cursor: not-allowed; }
.coin .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #4A4234; display: grid; place-items: center; flex: none; }
.coin[aria-pressed="true"] .radio { border-color: var(--gold); }
.coin[aria-pressed="true"] .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.coin .end { text-align: end; }
.coin .end .money { font-size: 16px; }
.coin-badge {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(160deg, #2A2418 0%, #15120D 100%); border: 1px solid var(--hair-gold);
  font-family: var(--latin); font-size: 10px; font-weight: 800; color: var(--gold-hi); letter-spacing: 0.02em;
}
.coin-badge.lg { width: 44px; height: 44px; font-size: 11px; }
.pay-top { display: flex; align-items: center; gap: 14px; }
.qr { padding: 8px; border-radius: 14px; background: var(--text); flex: none; line-height: 0; }
.qr svg { width: 112px; height: 112px; }
.pay-amount .money { font-size: 24px; }
.addr {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--hair);
}
.addr .v { display: block; font-family: var(--latin); font-size: 13px; font-weight: 700; color: var(--gold-hi); word-break: break-all; direction: ltr; text-align: left; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; flex: none;
  border-radius: 10px; background: transparent; border: 1px solid var(--hair-gold); color: var(--gold); font-size: 12.5px; font-weight: 700;
}
.timer { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }
.timer svg { color: var(--gold); }
.timer.expired { color: var(--loss); }
.note { color: var(--text-3); font-size: 12px; line-height: 1.7; }
.note.center { text-align: center; }

/* ---------- فرم ---------- */
.field { display: grid; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--hair); color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--hair-gold); }
.field input[dir="ltr"] { font-family: var(--latin); text-align: left; }
.field textarea { padding: 12px 14px; min-height: 96px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--text-3); }

/* ---------- دعوت ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; position: relative; }
.stats div { padding: 12px 8px; border-radius: 14px; background: rgba(11, 10, 8, 0.55); border: 1px solid var(--hair); text-align: center; }
.stats b { display: block; font-size: 20px; font-weight: 800; line-height: 1.4; }
.stats > div > span { display: block; font-size: 11.5px; color: var(--text-3); }
.link-box { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--hair); overflow: hidden; }
.link-box .num { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; font-weight: 600; color: var(--gold-hi); text-align: left; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.steps li + li { border-top: 1px solid var(--hair); }
.steps .n {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: rgba(226, 184, 92, 0.12); border: 1px solid var(--hair-gold); color: var(--gold-hi); font-size: 13px; font-weight: 800;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--hair); color: var(--text-2); font-weight: 800; font-size: 14px;
}

/* ---------- دفتر حساب ---------- */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.ledger li + li { border-top: 1px solid var(--hair); }
.ledger .main { flex: 1 1 0; min-width: 0; }
.ledger .main b { display: block; font-size: 14px; }
.ledger .main > span { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.ledger .main > .status.pending { color: var(--gold); }
.ledger .main > .status.rejected, .ledger .main > .status.cancelled { color: #F2A097; }
.ledger .main > .extra { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ledger .money { font-size: 15px; }
.ledger .ico {
  width: 36px; height: 36px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--hair); color: var(--text-2);
}
.ledger .ico.gold { background: rgba(226, 184, 92, 0.1); border-color: var(--hair-gold); color: var(--gold); }
.ledger .ico.green { background: rgba(88, 194, 143, 0.1); border-color: rgba(88, 194, 143, 0.35); color: var(--gain); }
.ledger .ico.red { background: rgba(227, 107, 94, 0.1); border-color: rgba(227, 107, 94, 0.35); color: var(--loss); }
.ledger .extra { display: flex; gap: 8px; margin-top: 8px; }

.status { font-size: 12px; font-weight: 600; }
.status.pending { color: var(--gold); }
.status.confirmed, .status.paid { color: var(--gain); }
.status.rejected, .status.cancelled { color: var(--loss); }

/* ---------- پروفایل ---------- */
.avatar-ring { width: 58px; height: 58px; border-radius: 50%; padding: 2px; background: var(--gold-grad); flex: none; }
.avatar-ring span {
  width: 100%; height: 100%; border-radius: 50%; background: #16130E; display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: var(--gold-hi);
}
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 5px; border-radius: 16px; background: var(--panel); border: 1px solid var(--hair); }
.seg button { height: 42px; border-radius: 12px; background: transparent; border: 1px solid transparent; color: var(--text-2); font-size: 14px; }
.seg button[aria-pressed="true"] { background: rgba(226, 184, 92, 0.14); border-color: var(--hair-gold); color: var(--gold-hi); font-weight: 700; }
.seg button[lang="en"] { font-family: 'Manrope', sans-serif; }
.seg button[lang="ar"] { font-family: 'Plex Arabic', sans-serif; }
.grid-modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid-modules button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 6px 14px;
  border-radius: 18px; background: var(--panel); border: 1px solid var(--hair); color: var(--text); font-size: 13px; font-weight: 700;
}
.grid-modules button svg { color: var(--gold); }
.grid-modules button.is-soon { color: var(--text-2); }
.grid-modules button.is-soon svg { color: var(--text-2); }
.foot-note { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-3); font-size: 12px; }
.risk { color: var(--text-3); font-size: 11.5px; line-height: 1.8; text-align: center; }

/* ---------- خالی / خطا ---------- */
.empty { text-align: center; color: var(--text-2); padding: 36px 16px; }
.empty p { margin: 0 0 14px; }
.prose { white-space: pre-wrap; line-height: 1.9; color: var(--text-2); }

/* ---------- نوار پایین ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 6px env(safe-area-inset-bottom);
  display: flex; background: rgba(11, 10, 8, 0.95); border-top: 1px solid var(--hair); backdrop-filter: blur(10px);
}
.tabbar button {
  flex: 1 1 0; border: 0; background: none; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 2px; font-size: 11px; font-weight: 500;
}
.tabbar button::before { content: ''; width: 18px; height: 3px; border-radius: 3px; background: transparent; margin-bottom: 4px; }
.tabbar button[aria-current="page"] { color: var(--gold-hi); font-weight: 700; }
.tabbar button[aria-current="page"]::before { background: var(--gold); }
.tabbar button[aria-current="page"] svg { color: var(--gold); }

/* ---------- شیت ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(5, 4, 3, 0.72); display: grid; align-items: end; }
.sheet-panel {
  background: #12100C; border-top: 1px solid var(--hair-gold); border-radius: 26px 26px 0 0;
  padding: 22px var(--pad) calc(24px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto; position: relative; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.55); animation: rise 0.22s ease-out;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel { animation: none; } }
.sheet-close {
  position: absolute; inset-inline-end: 14px; top: 14px; width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--hair); color: var(--text-2);
}
.sheet h2 { font-size: 19px; font-weight: 800; margin-inline-end: 44px; }

/* ---------- توست ---------- */
.toast {
  position: fixed; inset-inline: 16px; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
  z-index: 60; background: var(--panel-3); color: var(--text); border: 1px solid var(--hair-gold);
  padding: 12px 16px; border-radius: 14px; text-align: center; font-weight: 600; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.toast.is-error { background: #2A1512; border-color: rgba(227, 107, 94, 0.5); color: #F2A097; }

/* ---------- پنل ادمین ---------- */
.admin-row { display: grid; gap: 10px; padding: 14px 0; }
.admin-row + .admin-row { border-top: 1px solid var(--hair); }
.admin-row .r-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.admin-row .r-title { font-weight: 700; }
.admin-row .r-meta { color: var(--text-3); font-size: 12px; word-break: break-word; }
.admin-row .btn-row > * { flex: 0 0 auto; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-grid .card { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.stat-grid .k { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; }
.stat-grid .k svg { color: var(--text-3); }
.stat-grid .card.gold .k svg { color: var(--gold); }
.stat-grid b { font-size: 22px; font-weight: 800; }
.switch {
  position: relative; width: 46px; height: 28px; border-radius: 999px; flex: none; padding: 0;
  background: var(--panel-3); border: 1px solid var(--hair);
}
.switch::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-3); transition: inset-inline-start 0.15s;
}
.switch[aria-pressed="true"] { background: var(--gold-grad); border-color: var(--hair-gold); }
.switch[aria-pressed="true"]::after { inset-inline-start: 21px; background: var(--on-gold); }
.mini-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 8px; }
.mini-field { padding: 8px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--hair); }
.mini-field > span { display: block; font-size: 11px; color: var(--text-3); }
.mini-field input { width: 100%; background: none; border: 0; outline: none; color: var(--text); font-weight: 700; font-size: 14px; padding: 2px 0 0; }
.mini-field input[dir="ltr"] { font-family: var(--latin); text-align: left; }
.cur-card.is-off { opacity: 0.62; }

/* ===========================================================================
   اجزای صفحه‌های اپ (خانه، پرداخت، پروفایل، مدیریت)
=========================================================================== */

/* ---------- چیدمان کمکی ---------- */
.grow { flex: 1 1 0; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row.tight { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.pad { padding: 16px 0; }
.red-t { color: var(--loss) !important; }
.gold-hi { color: var(--gold-hi); }
.label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); }
.line-title { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.55; color: var(--text); }
.line-sub { display: block; font-size: 12.5px; color: var(--text-3); line-height: 1.65; }
.line-sub.soft { color: var(--text-2); }
.card-title { font-size: 15px; font-weight: 800; line-height: 1.5; }
.card-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
.brand-inline { font-weight: 800; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head .screen-note { margin-top: 0; }
.card.row { display: flex; align-items: center; gap: 12px; }
button.card { width: 100%; font: inherit; color: inherit; text-align: start; }

/* ---------- نوار بالا ---------- */
.brand-btn { display: flex; align-items: center; background: none; border: 0; padding: 0; color: inherit; }
.topbar-back { display: flex; align-items: center; gap: 10px; min-width: 0; }
.back-btn {
  width: 36px; height: 36px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--hair); color: var(--text-2);
}
.topbar-title { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.no-tabbar { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
body.no-tabbar .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }

.loading { display: grid; place-items: center; padding: 72px 0; }
.loading svg { animation: breathe 1.6s ease-in-out infinite; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--hair); border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading svg, .spinner { animation: none; } }

/* ---------- خانه ---------- */
.home { gap: 18px; }
.hero .money .v { font-size: 1em; }
.hero-figure .money { font-size: 40px; }
.hero .btn-row { margin-top: 4px; }
.access { display: flex; flex-direction: column; gap: 14px; }
.record { display: flex; flex-direction: column; gap: 12px; border-radius: 22px; }
.record .row.tight svg { color: var(--gold); }
.link-row {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0;
  background: none; border: 0; color: var(--gold); font-size: 13.5px; font-weight: 700;
}
.list-row { width: 100%; background: none; border: 0; text-align: start; color: inherit; font: inherit; }
.list-row .t, .list-row .s { display: block; }
.card.tight > .list-row:first-child { border-top: 0; }
.invest-soon { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; }
.invest-soon > svg { color: var(--text-3); }
.card.dashed.invest-soon { background: transparent; }

/* ---------- محصولات ---------- */
.product .product-head .grow .row { margin-bottom: 2px; }
.product-foot .row.tight { flex-wrap: wrap; justify-content: flex-end; }
.state.wide { width: 100%; justify-content: center; height: 48px; }

/* ---------- پرداخت ---------- */
.checkout { gap: 16px; }
.summary { padding: 14px 16px; border-radius: 18px; }
.summary-price .money { font-size: 22px; }
.coin { color: inherit; font: inherit; }
.coin-name { font-size: 14.5px; font-weight: 800; }
.coin-net { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-3); margin-top: 2px; }
.coin .end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.coin .end.sub, .coin .end .sub { font-size: 11.5px; color: var(--text-3); display: inline-flex; align-items: baseline; gap: 2px; }
.coin .end .sub .money { font-size: 11.5px; }
.coin .end .sub .money .v { font-weight: 600; color: var(--text-3); }
.pay { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.pay-info { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pay-amount {
  display: inline-flex; align-items: center; gap: 8px; padding: 0; background: none; border: 0; color: var(--gold);
}
.pay-amount .money { font-size: 24px; }
.addr .k { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; }
.note.warn-soft { display: flex; align-items: flex-start; gap: 8px; color: var(--text-2); }
.note.warn-soft svg { color: var(--gold); margin-top: 3px; }
.note.warn { display: flex; align-items: flex-start; gap: 8px; color: #F2A097; }
.note.warn svg { margin-top: 3px; }
.expired-row:has(> [hidden] + [hidden]) { display: none; }
.expired-row .note { flex: 1 1 0; }
.btn.quiet.cancel { align-self: center; color: var(--text-3); font-weight: 600; font-size: 13px; }
.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 20px; }
.done-ico {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--on-gold);
  background: var(--gold-grad); box-shadow: 0 10px 28px rgba(226, 184, 92, 0.25);
}
.done .card-title { font-size: 19px; }
.kv {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: baseline; width: 100%;
  margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--hair); text-align: start;
}
.kv .k { font-size: 12.5px; color: var(--text-3); }
.kv .money { font-size: 18px; justify-self: end; }
.kv .hash { justify-self: end; }
.hash { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.prose.small { font-size: 13px; }
.prose-card .prose { color: var(--text); }

/* ---------- فرم ---------- */
.field.has-error input, .field.has-error select, .field.has-error textarea, .mini-field.has-error { border-color: rgba(227, 107, 94, 0.7); }
.field.has-error .hint { color: #F2A097; }
.field textarea.code, textarea.code { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 12.5px; direction: ltr; text-align: left; }
.field input[type="search"] { -webkit-appearance: none; appearance: none; }
.field select { -webkit-appearance: none; appearance: none; }

/* ---------- دعوت، کیف پول، سفارش‌ها ---------- */
.btn-row > .grow-2 { flex: 1.4 1 0; }
.steps li > span:last-child { font-size: 13.5px; line-height: 1.8; padding-top: 2px; }
.ledger li.more { justify-content: center; font-size: 12.5px; color: var(--text-3); padding: 10px 0 12px; }
.ledger .amounts, .amounts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.amounts .money.sub, .amounts .sub { font-size: 12px; }
.amounts .money.sub .v { font-weight: 600; color: var(--text-3); }
.ledger .main .hash-line { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.ledger .main .extra { flex-wrap: wrap; }
.ledger.orders li { align-items: flex-start; }
.ledger.orders .amounts { padding-top: 2px; }

/* ---------- پروفایل ---------- */
.user-card { padding: 16px; border-radius: 22px; }
.user-name { display: block; font-size: 17px; font-weight: 800; }
.user-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--text-2); }
.grid-modules button { position: relative; gap: 9px; }
.grid-modules .sp { display: block; height: 24px; }
.list-row .s + .t { margin-top: 2px; }

/* ---------- سرمایه‌گذاری ---------- */
.invest { align-items: center; text-align: center; gap: 18px; padding-top: 18px; }
.invest-ring {
  position: relative; width: 188px; height: 188px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(226, 184, 92, 0.16), rgba(226, 184, 92, 0) 70%);
}
.invest-ring .lock {
  position: absolute; bottom: 14px; inset-inline-start: 22px; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; color: var(--gold); background: #16130E; border: 1px solid var(--hair-gold);
}
.invest-title { font-size: 24px; font-weight: 800; line-height: 1.4; }
.invest-desc { font-size: 14px; color: var(--text-2); line-height: 1.9; max-width: 34ch; }
.invest .card { width: 100%; text-align: start; }
.invest .btn, .invest .state { width: 100%; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: center; gap: 10px; padding: 11px 0; font-size: 13.5px; }
.checks li + li { border-top: 1px solid var(--hair); }
.checks svg { color: var(--gold); }

/* ---------- مدیریت ---------- */
.admin .chips { margin-bottom: 2px; }
.admin-body { min-height: 200px; }
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shortcuts button {
  display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 18px; text-align: start;
  background: var(--panel); border: 1px solid var(--hair-gold); color: inherit; font: inherit; min-width: 0;
}
.shortcuts b { display: block; font-size: 14px; font-weight: 800; }
.shortcuts span span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.shortcuts button > span:last-child { min-width: 0; }
.module-cta { padding: 16px; border-radius: 20px; }
.module-cta > svg { color: var(--gold); }
.stat-grid .card b .money { font-size: 20px; }
.card.tight > .admin-row:first-child { border-top: 0; }
.admin-row .avatar { width: 34px; height: 34px; font-size: 13px; }
.admin-row.is-off, .price-row.is-off { opacity: 0.55; }
.tx-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-3); }
.tx-line .k { font-family: var(--latin); font-weight: 700; font-size: 11.5px; letter-spacing: 0.04em; }
.tx-line .copy-btn { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-row.end { justify-content: flex-end; flex-wrap: wrap; }
.btn-row.end > * { flex: 0 0 auto; }
.price-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.price-row + .price-row { border-top: 1px solid var(--hair); }
.price-meta { background: none; border: 0; padding: 0; text-align: start; color: inherit; font: inherit; }
.price-input {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: 12px; flex: none;
  background: var(--panel-2); border: 1px solid var(--hair-gold); direction: ltr;
}
.price-input input {
  width: 58px; background: none; border: 0; outline: none; color: var(--text); text-align: right;
  font-family: var(--latin); font-weight: 800; font-size: 15px; padding: 0;
}
.price-input .u { font-family: var(--latin); font-size: 10.5px; font-weight: 700; color: var(--gold); letter-spacing: 0.04em; }
.cur-card { padding: 14px; border-radius: 18px; }
.mini-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-field { display: block; min-width: 0; }
details.more { border-top: 1px solid var(--hair); padding-top: 10px; }
details.more > summary {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 700; color: var(--text-2);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary svg { transform: rotate(180deg); }
details.more > .stack-sm { margin-top: 12px; }
.btn.sm.block { width: 100%; }

/* ---------- اصلاحات بعد از اجرای واقعی ---------- */
.view.sub .page-head .screen-title { display: none; }
.view.sub .page-head:not(:has(.screen-note)) { display: none; }
.topbar-back .badge { margin-inline-start: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip .count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--gold); color: var(--on-gold); font-size: 11.5px; font-weight: 800; line-height: 1;
}
.shortcuts b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.shortcuts button { padding: 12px; }
.num.wrap { white-space: normal; overflow-wrap: anywhere; }
.price-row { align-items: flex-start; }
.price-row > .icon-tile { margin-top: 2px; }
.price-row > .switch { margin-top: 4px; }
.price-row .price-input { align-self: flex-start; }
.btn-row > * { min-width: 0; }
.btn > span { overflow: hidden; text-overflow: ellipsis; }
.btn-row > .btn { padding: 0 14px; }
.coin .grow .row { flex-wrap: wrap; row-gap: 4px; }
.coin-name { white-space: nowrap; }
.pay-amount .money { font-size: clamp(17px, 5.6vw, 24px); }
.pay-info { min-width: 0; }

/* گوشی‌های باریک (۳۲۰ تا ۳۷۰): QR بالای مبلغ، نشان ارز حذف */
@media (max-width: 370px) {
  :root { --pad: 16px; }
  .coin { padding: 12px; gap: 10px; }
  .coin .coin-badge { display: none; }
  .pay-top { flex-direction: column; align-items: stretch; }
  .pay-top .qr { align-self: center; }
  .pay-info { align-items: center; text-align: center; }
  .hero-figure .money { font-size: 34px; }
  .quick { gap: 8px; }
  .quick button, .quick a { font-size: 11.5px; padding: 12px 2px 10px; }
  .kpis b { font-size: 16px; }
}
.hero .btn-row .btn { padding: 0 10px; gap: 6px; font-size: 14px; }
details.more-card { padding: 14px 16px; }
details.more-card > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; font-weight: 700; color: var(--text-2); font-size: 13.5px; }
details.more-card > summary::-webkit-details-marker { display: none; }
details.more-card[open] > summary { margin-bottom: 12px; }
details.more-card[open] > summary svg { transform: rotate(180deg); }
.admin-row.unpaid { opacity: 0.6; }
