/* ==================== فونت محلی ==================== */
@font-face {
  font-family: "IRANYekan";
  src: url("fonts/IRANYekan.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ==================== متغیرها ==================== */
:root {
  color-scheme: only light;
  --bg:        #f5f6fa;
  --surface:   #ffffff;
  --fg:        #1a1d2e;
  --muted:     #6b7280;
  --primary:   #0f1f5c;
  --primary-light: rgba(15,31,92,.07);
  --border:    rgba(15,31,92,.1);
  --buy:       #dcfce7;
  --buy-text:  #15803d;
  --buy-btn:   rgba(22,163,74,.09);
  --sell:      #fee2e2;
  --sell-text: #b91c1c;
  --sell-btn:  rgba(220,38,38,.09);
  --gold:      #b45309;
  --radius:    14px;
  --shadow:    0 2px 12px rgba(15,31,92,.07), 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 8px 28px rgba(15,31,92,.12);
  /* ارتفاع نوار پایین (با safe area) */
  --nav-h: calc(66px + env(safe-area-inset-bottom, 0px));
}

*,*::before,*::after { box-sizing: border-box; }

html {
  height: 100%;
  color-scheme: only light;
  /* جلوگیری از تغییر اندازه فونت توسط iOS */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color-scheme: only light;
  font-family: "IRANYekan", Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
  /* جلوگیری از pinch-zoom روی صفحات ثابت */
  touch-action: manipulation;
}

button,
input,
textarea,
select,
option,
.app-shell,
.table-panel,
.trade-v2-wrap,
.trade-flow-page,
.wallet-wrap,
.profile-v2-wrap,
.invite-v2-wrap,
.services-v2-wrap,
.bottom-nav,
.bottom-sheet-content {
  font-family: "IRANYekan", Tahoma, system-ui, sans-serif !important;
}

/* پر کردن viewport بدون 100vhِ بلندتر از نمای موبایل (اندروید کروم) */
#app {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.fullscreen-loading {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--muted);
}

body.mode-login {
  overflow-y: auto;
  overflow-x: hidden;
}

body.mode-login #app {
  min-height: 100dvh;
  overflow: visible;
}

/* ==================== صفحه لاگین ==================== */
.login-shell {
  flex: 1;
  min-height: min(100%, auto);
  display: grid;
  align-content: start;
  justify-items: center;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, #e8edf8 0%, #f0f4fb 50%, #eaf0fb 100%);
}

.login-card {
  width: min(380px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: var(--shadow-md);
}

.login-logo {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: .35rem;
  line-height: 1;
}

.login-logo-img {
  display: block;
  width: min(220px, 88%);
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
}

.login-title-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-title {
  margin: 0 0 .25rem;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.01em;
}

.login-sub {
  margin: 0 0 1.5rem;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
}

.login-field { margin-bottom: .9rem; }

.login-field span {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .3rem;
}

.login-field input {
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  padding: .7rem .85rem;
  font: inherit;
  /* ≥16px جلوگیری از زوم iOS */
  font-size: 1rem;
  color: var(--fg);
  background: #fafbfd;
  transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,31,92,.1);
  background: #fff;
}

.login-err {
  background: #fef2f2;
  color: var(--sell-text);
  border: 1px solid rgba(185,28,28,.2);
  padding: .5rem .7rem;
  border-radius: 8px;
  font-size: .8rem;
  margin-bottom: .9rem;
  font-weight: 600;
}

.login-submit {
  width: 100%;
  padding: .8rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  background: var(--primary);
  color: #fff;
  transition: opacity .15s, transform .1s;
  margin-top: .25rem;
  /* touch-action برای بهتر شدن tap */
  touch-action: manipulation;
}
.login-submit:hover  { opacity: .88; }
.login-submit:active { transform: scale(.99); }
.login-submit:disabled { opacity: .55; cursor: default; }

.login-muted { font-size: .72rem; color: var(--muted); text-align: center; margin: .65rem 0 0; }

.login-toggle-mode {
  display: block;
  width: 100%;
  margin-top: .5rem;
  padding: .55rem;
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
}
.login-ref-hint {
  font-size: .75rem;
  padding: .45rem .6rem;
  border-radius: 8px;
  margin-bottom: .65rem;
  line-height: 1.4;
}
.login-ref-hint-ok { background: #dcfce7; color: #15803d; }
.login-ref-hint-warn { background: #fef3c7; color: #b45309; }
.login-shell-invite .login-card {
  border-color: rgba(245, 158, 11, .35);
  box-shadow: 0 8px 32px rgba(245, 158, 11, .12);
}
.login-profile-block {
  background: var(--primary-light);
  border-radius: 12px;
  padding: .65rem .75rem .1rem;
  margin-bottom: .75rem;
  border: 1px solid var(--border);
}
.login-profile-title {
  margin: 0 0 .5rem;
  font-size: .78rem;
  font-weight: 800;
  color: var(--primary);
}
.login-required-hint {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
}
.login-field .req {
  color: #ef4444;
  font-weight: 800;
}
.login-invite-login { text-align: center; margin: .45rem 0 0; }
.login-sms-hint {
  font-size: .74rem;
  color: var(--muted);
  margin: -.35rem 0 .85rem;
  line-height: 1.45;
}
.login-sms-sent {
  font-size: .78rem;
  color: var(--text);
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .55rem .7rem;
  margin-bottom: .85rem;
  line-height: 1.5;
}
.login-reg-summary {
  margin-bottom: .5rem;
}
.login-reg-name {
  margin: 0 0 .35rem;
  font-size: .88rem;
  text-align: center;
}
.login-reg-summary .login-sms-hint {
  margin-bottom: .85rem;
}
.login-sms-resend {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: .15rem;
  font-size: .76rem;
}
.login-sms-resend:disabled {
  opacity: .45;
  cursor: default;
}
.login-link-btn {
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* ==================== اپ مشتری ==================== */
.app-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---- هدر ---- */
.top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .45rem .85rem .4rem;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(15,31,92,.05);
  position: relative;
  z-index: 300;
  overflow: visible;
}

.top-row-main {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
  min-height: 3rem;
  position: relative;
}

.brand-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  flex: 0 0 auto;
  text-align: center;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(38vw, 7.6rem);
  min-height: 3.25rem;
}

.brand-title {
  cursor: pointer;
  touch-action: manipulation;
}
.brand-logo {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  max-width: 3.25rem;
  max-height: 3.25rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  clip-path: circle(50% at 50% 50%);
  overflow: hidden;
}

html[data-theme="dark"] .brand-logo {
  background: rgba(255, 255, 255, .08);
  box-shadow:
    0 0 0 2px rgba(250, 204, 21, .46),
    0 0 24px rgba(250, 204, 21, .26),
    0 10px 28px rgba(0, 0, 0, .38);
  filter: saturate(1.08) contrast(1.06);
}

.clock-block {
  position: absolute;
  inset-inline-end: 5.45rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .68rem;
  color: var(--muted);
  line-height: 1.4;
  white-space: nowrap;
  max-width: calc(50vw - 8rem);
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
  flex-shrink: 0;
}
.clock-block .lbl {
  display: block;
  font-weight: 600;
  color: var(--fg);
  font-size: .66rem;
}
.clock-line { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .clock-block {
    display: none;
  }
  .top-row-main {
    margin-bottom: 0;
  }
}

.header-actions {
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: .35rem;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  z-index: 3;
}

/* ---- چیپ‌ها ---- */
.chip {
  font-size: .63rem;
  font-weight: 700;
  padding: .24rem .5rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border);
  white-space: nowrap;
  /* حداقل ارتفاع touch */
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}
.chip-spot { font-variant-numeric: tabular-nums; background: #fef3c7; color: var(--gold); border-color: rgba(180,83,9,.15); }
.chip-user { background: var(--primary-light); color: var(--primary); }
.chip-link { text-decoration: none; cursor: pointer; }
.chip-link:hover { opacity: .8; }
.chip-logout {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  font-size: .62rem;
  padding: 0;
  border-radius: 50%;
  transition: background .12s, color .12s;
  min-height: 34px;
  touch-action: manipulation;
  justify-content: center;
}
.chip-logout:hover { background: var(--primary); color: #fff; }

.header-profile-wrap { position: relative; z-index: 3101; }
.header-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .12s, color .12s, border-color .12s;
}
.header-profile-btn:hover,
.header-profile-btn[aria-expanded="true"] {
  background: var(--primary);
  color: #fff;
}
.header-profile-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  inset-inline-end: auto;
  z-index: 3200;
  width: min(320px, calc(100vw - 24px));
  min-width: 0;
  max-width: calc(100vw - 24px);
  max-height: min(78vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(15, 31, 92, .16);
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}
.header-profile-actions {
  display: grid;
  gap: .4rem;
  margin-bottom: 0;
}
.profile-password-wrap {
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid var(--border);
}
.profile-password-wrap[hidden] { display: none !important; }
.header-profile-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  padding: .45rem .65rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  text-align: right;
  text-decoration: none;
  cursor: pointer;
}
.header-profile-action:hover {
  background: var(--primary);
  color: #fff;
}
.header-profile-logout {
  border-color: rgba(220, 38, 38, .22);
  background: #fef2f2;
  color: #b91c1c;
}
.header-profile-logout:hover {
  background: #dc2626;
  color: #fff;
}
.header-profile-menu-user {
  font-size: .72rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: .55rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--border);
}
.profile-password-panel { display: flex; flex-direction: column; gap: .45rem; }
.profile-password-title {
  font-size: .78rem;
  font-weight: 800;
  color: var(--fg);
}
.profile-password-hint {
  font-size: .68rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}
.profile-password-panel .login-field { margin-bottom: .35rem; }
.profile-password-panel .wallet-pass-save { margin-top: .15rem; }

@media (max-width: 768px) {
  .header-profile-menu {
    position: fixed;
    top: 4.1rem;
    left: 12px;
    right: auto;
    inset-inline-start: auto;
    inset-inline-end: auto;
    width: calc(100vw - 24px);
    min-width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    z-index: 9999;
  }
}

/* ---- تیکر اطلاعیه ---- */
.ticker {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .25rem;
  padding: .25rem .5rem;
  border-radius: 7px;
  background: #fffbeb;
  border: 1px solid rgba(180,83,9,.15);
  overflow: hidden;
}
.ticker-label { flex-shrink: 0; font-size: .68rem; font-weight: 700; color: var(--gold); }
.ticker-scroll { flex: 1; overflow: hidden; font-size: .76rem; color: #92400e; font-weight: 500; }
.ticker-scroll span {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-slide 18s linear infinite;
  padding-left: 3rem;
}

@keyframes ticker-slide {
  0%   { transform: translateX(110%); }
  100% { transform: translateX(-110%); }
}

/* ---- ناحیه محتوا ---- */
.main-zone {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: .4rem .4rem 0;
  padding-top: max(.4rem, env(safe-area-inset-top, 0px));
  padding-bottom: var(--nav-h);
}

.content-wrap {
  flex: 1;
  min-height: 0;
  height: auto;
  display: flex;
  justify-content: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.site-footer-root {
  flex-shrink: 0;
  width: 100%;
}
.content-wrap::-webkit-scrollbar,
.main-zone::-webkit-scrollbar,
#tab-content::-webkit-scrollbar,
.wallet-overview::-webkit-scrollbar,
.ledger-wrap::-webkit-scrollbar,
.shop-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.inner {
  width: min(1100px, 100%);
  height: 100%;
  display: flex;
  gap: .5rem;
  align-items: stretch;
}

.table-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* محتوای تب مشتری — اسکرول داخل ناحیهٔ میانی، بالای نوار پایین */
#tab-content.table-panel {
  flex: 1;
  min-height: 0;
}

.panel-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 .3rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---- جدول محصولات ---- */
.table-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

/* تصویر برند در ناحیهٔ خالی زیر جدول قیمت — وسط، اندازهٔ طبیعی، بدون کشیدن */
.trade-panel-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.trade-panel-wrap > .table-scroll.trade-panel-table-only {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(52vh, 72%);
  overflow-y: auto;
  overflow-x: hidden;
  border: none;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--border);
}

.trade-panel-brand-area {
  flex: 1 1 auto;
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.99) 100%);
}

.trade-panel-brand-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---- تب معامله نسخه ۲ ---- */
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .55rem .85rem;
  background: linear-gradient(90deg, #7c2d12, #b45309);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(124, 45, 18, .22);
  z-index: 320;
}

.impersonation-banner-btn {
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border-radius: 999px;
  padding: .35rem .75rem;
  font: inherit;
  font-size: .72rem;
  font-weight: 900;
  cursor: pointer;
}

.trade-v2-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: .35rem;
}

.trade-v2-wrap.trade-panel-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.trade-v2-spot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .9rem;
  border-radius: 12px;
  background: #eef4fb;
  color: #1e3a5f;
  border: 1px solid rgba(30, 58, 95, .08);
}

.trade-v2-spot-label {
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.45;
}

.trade-v2-spot-price {
  display: inline-flex;
  align-items: baseline;
  gap: .25rem;
  flex-shrink: 0;
  font-size: .74rem;
  font-weight: 700;
}

.trade-v2-spot-price strong {
  font-size: .95rem;
  font-weight: 800;
  direction: ltr;
  unicode-bidi: embed;
  font-variant-numeric: tabular-nums;
}

.trade-v2-balance-card {
  position: relative;
  border-radius: 16px;
  padding: .9rem 1rem;
  color: #fff;
  overflow: visible;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: linear-gradient(135deg, #0f1f5c 0%, #1d4ed8 58%, #2563eb 100%);
  box-shadow: 0 10px 28px rgba(15, 31, 92, .18);
}

.trade-v2-balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .45rem;
}

.trade-v2-head-actions,
.history-head-actions {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.privacy-toggle-btn {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.94);
  cursor: pointer;
}

.history-privacy-toggle,
.wallet-privacy-toggle {
  background: #eef2ff;
  color: var(--primary);
}

.privacy-toggle-btn:active {
  transform: scale(.96);
}

.trade-v2-balance-title {
  font-size: .9rem;
  font-weight: 900;
}

.trade-v2-support-link {
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border-radius: 999px;
  padding: .28rem .65rem;
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
}

.trade-v2-account-no {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
  opacity: 1;
}

.trade-v2-account-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .18rem;
  margin: -.15rem 0 .75rem;
  min-width: 0;
  width: 100%;
}

.trade-v2-account-label {
  font-size: .64rem;
  font-weight: 800;
  color: rgba(255,255,255,.78);
}

.trade-v2-account-copy {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0;
  margin-bottom: .18rem;
  font: inherit;
  cursor: pointer;
  flex-wrap: wrap;
}

.trade-v2-copy-icon {
  display: inline-flex;
  line-height: 0;
  color: #fff;
}

.trade-v2-account-owner {
  font-size: .72rem;
  font-weight: 700;
  opacity: .9;
  margin-bottom: .75rem;
}

.trade-v2-balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  width: 100%;
  min-width: 0;
}

.trade-v2-balance-item {
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  padding: .55rem .65rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.trade-v2-balance-value-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: .28rem;
  min-width: 0;
  width: 100%;
  direction: ltr;
  flex-wrap: wrap;
}

.trade-v2-balance-label {
  display: block;
  font-size: .66rem;
  opacity: .86;
  margin-bottom: .15rem;
}

.trade-v2-balance-value {
  display: inline-block;
  font-size: clamp(.78rem, 3.4vw, 1rem);
  font-weight: 800;
  direction: ltr;
  unicode-bidi: embed;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.trade-v2-balance-unit {
  font-size: .68rem;
  margin-right: 0;
  opacity: .9;
  flex-shrink: 0;
  white-space: nowrap;
}

.trade-v2-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}

.trade-v2-menu-row {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  padding: .15rem 0;
  background: var(--bg);
}

.trade-v2-menu-tile {
  min-height: 4.8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .18rem;
  padding: .45rem .25rem;
  box-shadow: 0 5px 18px rgba(15,31,92,.06);
}

.trade-v2-menu-tile:active {
  transform: scale(.98);
}

.trade-v2-menu-icon {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(15, 31, 92, .08);
  font-weight: 900;
}

.trade-v2-menu-tile strong {
  font-size: .78rem;
  font-weight: 900;
}

.trade-v2-menu-tile small {
  font-size: .6rem;
  color: var(--muted);
  line-height: 1.35;
}

.trade-v2-menu-buy .trade-v2-menu-icon { color: #15803d; background: rgba(22, 163, 74, .12); }
.trade-v2-menu-sell .trade-v2-menu-icon { color: #b91c1c; background: rgba(220, 38, 38, .12); }

.trade-flow-page {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.trade-flow-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: .95rem;
  box-shadow: var(--shadow);
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.trade-flow-fields {
  display: grid;
  gap: .75rem;
}

.trade-flow-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin: .65rem 0;
  border-radius: 12px;
  background: #f8fafc;
  padding: .65rem .75rem;
  font-size: .8rem;
}

.trade-flow-balance strong {
  color: var(--primary);
  direction: ltr;
  unicode-bidi: embed;
}

.trade-flow-shortfall {
  border-radius: 12px;
  background: #eef2ff;
  color: var(--primary);
  padding: .65rem .75rem;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.55;
}

.trade-flow-shortfall strong {
  direction: rtl;
  white-space: nowrap;
}

.trade-flow-wallet,
.trade-flow-submit {
  width: 100%;
  margin-top: .45rem;
}

@media (max-width: 820px) {
  .trade-flow-card {
    min-height: auto;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .trade-flow-submit {
    position: sticky;
    bottom: calc(4.65rem + env(safe-area-inset-bottom, 0px));
    z-index: 8;
    box-shadow: 0 14px 30px rgba(15, 31, 92, .18);
  }
}

.trade-flow-wallet {
  flex: none;
  min-height: 46px;
}

.trade-flow-submit {
  flex: none;
  margin-top: 1rem;
}

.trade-flow-fee {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  border-radius: 12px;
  background: #fff7ed;
  color: #92400e;
  padding: .6rem .7rem;
  font-size: .78rem;
  font-weight: 800;
}

.trade-flow-discount-note {
  flex: 0 0 100%;
  color: #b45309;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.55;
}

.trade-flow-fee strong {
  direction: ltr;
  unicode-bidi: embed;
}

.trade-flow-equivalent {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  margin-top: -.35rem;
}

.trade-flow-tooltip {
  margin: .45rem 0 .6rem;
  border-radius: 12px;
  background: #334155;
  color: #fff;
  padding: .75rem .85rem;
  font-size: .75rem;
  line-height: 1.7;
}

.trade-flow-use-balance {
  width: 100%;
  margin-top: .15rem;
}

.wallet-trade-intent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid rgba(234, 88, 12, .18);
  color: #9a3412;
}

.wallet-trade-intent.is-ready {
  background: #ecfdf5;
  border-color: rgba(22, 163, 74, .22);
  color: #166534;
}

.wallet-trade-intent strong {
  display: block;
  margin-bottom: .2rem;
  font-size: .82rem;
}

.wallet-trade-intent p {
  margin: 0;
  font-size: .74rem;
  line-height: 1.55;
}

.wallet-trade-resume {
  width: auto;
  min-width: 9rem;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .wallet-trade-intent {
    flex-direction: column;
    align-items: stretch;
  }

  .wallet-trade-resume {
    width: 100%;
  }
}

.trade-market-closed-banner {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid rgba(234, 88, 12, .22);
  color: #9a3412;
}

.trade-market-closed-title {
  margin: 0;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.55;
}

.trade-market-closed-call {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  align-self: flex-start;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(234, 88, 12, .25);
  color: #c2410c;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}

.trade-market-closed-call svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

html[data-theme="dark"] .trade-market-closed-banner {
  background: rgba(234, 88, 12, .12);
  border-color: rgba(251, 146, 60, .28);
  color: #fdba74;
}

html[data-theme="dark"] .trade-market-closed-call {
  background: rgba(15, 23, 42, .55);
  color: #fdba74;
}

@media (max-width: 768px) {
  .trade-v2-balance-grid {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .trade-v2-balance-card {
    padding: .8rem .75rem;
  }

  .trade-v2-balance-top {
    flex-wrap: wrap;
    gap: .4rem;
  }

  .trade-v2-balance-title {
    font-size: .82rem;
    line-height: 1.35;
    min-width: 0;
    flex: 1 1 auto;
  }

  .trade-v2-account-no {
    font-size: clamp(.68rem, 2.8vw, .78rem);
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .trade-v2-balance-item {
    padding: .62rem .7rem;
  }

  .trade-v2-balance-value {
    font-size: clamp(.84rem, 4.2vw, .98rem);
  }
}

@media (max-width: 640px) {
  .trade-v2-wrap,
  .trade-flow-page {
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
    gap: .65rem;
  }

  .trade-v2-spot-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
  }

  .trade-v2-balance-grid {
    grid-template-columns: 1fr;
    gap: .55rem;
  }

  .trade-v2-menu-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-v2-chart-canvas {
    min-height: 200px;
    max-height: 240px;
  }

  .trade-flow-card {
    padding: .85rem .75rem calc(.85rem + env(safe-area-inset-bottom, 0px));
  }

  .trade-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .ledger-scroll {
    max-height: min(360px, 42vh);
  }

  .ledger-tbl {
    min-width: 720px;
    font-size: .64rem;
  }
}

.deposit-method-list {
  display: grid;
  gap: .65rem;
}

.deposit-method-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: .85rem 1rem;
  text-align: right;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.deposit-method-card strong,
.deposit-method-card span,
.deposit-method-card small {
  display: block;
}

.deposit-method-card strong {
  color: var(--primary);
  font-size: .9rem;
}

.deposit-method-card span {
  margin-top: .25rem;
  color: var(--fg);
  font-size: .78rem;
  font-weight: 700;
}

.deposit-method-card small {
  margin-top: .18rem;
  color: var(--muted);
  font-size: .7rem;
}

.deposit-method-card.is-disabled {
  opacity: .48;
  cursor: not-allowed;
}

.deposit-wire-info {
  display: grid;
  gap: .8rem;
}

.deposit-wire-source {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem;
  background: #f8fafc;
}

.deposit-wire-id-note {
  margin: .35rem 0;
  color: #92400e;
  font-size: .78rem;
  font-weight: 800;
}

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .38);
}

.bottom-sheet-content {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(80vh, 100dvh);
  overflow: hidden;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 60px rgba(15,23,42,.22);
}

.bottom-sheet-handle {
  width: 3.2rem;
  height: .28rem;
  border-radius: 999px;
  background: #cbd5e1;
  margin: .65rem auto .35rem;
}

.trade-account-sheet-body {
  padding: 1rem 1.15rem calc(1rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.trade-account-sheet-label {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.trade-account-sheet-body strong {
  display: block;
  margin-top: .4rem;
  color: #f59e0b;
  font-size: 1.08rem;
  letter-spacing: .02em;
}

.trade-account-sheet-body p {
  margin: .4rem 0 .9rem;
  color: var(--fg);
  font-weight: 800;
}

.history-v2-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .5rem;
}

.history-v2-header .ledger-order-note {
  grid-column: 1 / -1;
}

.history-filter-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: .82rem;
  font-weight: 900;
  cursor: pointer;
  padding: .35rem .5rem;
}

.history-filter-content {
  height: 80vh;
  display: flex;
  flex-direction: column;
}

.history-filter-header {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: #0f172a;
  color: #fff;
  font-weight: 900;
}

.history-filter-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.history-filter-title {
  margin: .35rem 0 .55rem;
  color: var(--primary);
  font-size: .82rem;
  font-weight: 900;
}

.history-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: .9rem;
}

.history-filter-check {
  display: flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .62rem .7rem;
  font-size: .78rem;
  font-weight: 800;
}

.history-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
}

.trade-v2-action .cell-hit {
  min-height: 4.25rem;
  border-radius: 12px;
}

.trade-v2-action .price-main {
  font-size: .95rem;
}

.trade-v2-quick-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}

.trade-v2-quick-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  border-radius: 12px;
  padding: .62rem .75rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}

.trade-v2-chart {
  position: relative;
  z-index: 2;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: .85rem .9rem 1rem;
  box-shadow: var(--shadow);
}

.trade-v2-chart-head {
  display: grid;
  gap: .2rem;
  margin-bottom: .65rem;
}

.trade-v2-chart-product {
  font-size: .76rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.5;
}

.trade-v2-chart-price-row strong {
  font-size: 1.35rem;
  font-weight: 900;
  direction: ltr;
  unicode-bidi: embed;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  letter-spacing: -.02em;
}

.trade-v2-chart-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  font-size: .72rem;
  line-height: 1.5;
}

.trade-v2-chart-summary-label {
  color: var(--muted);
  font-weight: 700;
}

.trade-v2-chart-date {
  color: var(--muted);
  font-weight: 800;
  direction: ltr;
  unicode-bidi: embed;
}

.trade-v2-chart-change {
  font-size: .72rem;
  font-weight: 900;
  direction: ltr;
  unicode-bidi: embed;
}

.trade-v2-chart-change.is-up {
  color: #15803d;
}

.trade-v2-chart-change.is-down {
  color: #b91c1c;
}

.trade-v2-chart-canvas {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 140px;
  border-radius: 12px;
  overflow: visible;
  background: transparent;
  border: none;
}

.trade-v2-chart-stage {
  position: relative;
  z-index: 4;
  width: 100%;
  height: 140px;
  overflow: visible;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.trade-v2-chart-svg {
  display: block;
  width: 100%;
  height: 140px;
  shape-rendering: geometricPrecision;
}

.trade-v2-chart-bg {
  fill: transparent;
}

.trade-v2-chart-grid-line {
  stroke: rgba(148, 163, 184, .18);
  stroke-width: 1;
  stroke-dasharray: 4 7;
}

.trade-v2-chart-grid-line.is-base {
  stroke: rgba(37, 99, 235, .18);
  stroke-dasharray: none;
}

.trade-v2-chart-axis-label,
.trade-v2-chart-time-label {
  fill: rgba(71, 85, 105, .68);
  font-size: 10px;
  font-weight: 800;
  font-family: "IRANYekan", Tahoma, system-ui, sans-serif;
}

.trade-v2-chart-area {
  stroke: none;
}

.trade-v2-chart-line {
  stroke: #5467FF;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trade-v2-chart-crosshair {
  stroke: rgba(84, 103, 255, .55);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.trade-v2-chart-stage.is-active .trade-v2-chart-crosshair {
  stroke: #5467FF;
}

.trade-v2-chart-dot {
  fill: #5467FF;
  stroke: #fff;
  stroke-width: 2;
}

.trade-v2-chart-hit-area {
  fill: transparent;
}

.trade-v2-chart-svg [data-trade-chart-hit] {
  pointer-events: all;
}

.trade-v2-chart-tooltip {
  position: absolute;
  z-index: 60;
  width: max-content;
  max-width: 11rem;
  transform: translateX(-50%);
  border-radius: 10px;
  background: rgba(15, 23, 42, .94);
  color: #fff;
  padding: .38rem .62rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .24);
  pointer-events: none;
  font-size: .7rem;
  line-height: 1.45;
  white-space: nowrap;
}

.trade-v2-chart-tooltip span {
  display: block;
  direction: ltr;
  unicode-bidi: embed;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.trade-v2-chart-empty {
  min-height: 140px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.6;
}

.trade-v2-chart-ranges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: .85rem;
  border-top: 1px solid var(--border);
  padding-top: .55rem;
}

.trade-v2-range-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: .5rem .35rem;
  font: inherit;
  font-size: .74rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
}

.trade-v2-range-btn.is-active {
  color: var(--primary);
}

.trade-v2-range-btn.is-active::after {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -.55rem;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.trade-v2-more-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

html[data-theme="dark"] .trade-v2-spot-header {
  background: rgba(15, 23, 42, .72);
  color: #dbeafe;
  border-color: rgba(148, 163, 184, .18);
}

html[data-theme="dark"] .trade-v2-quick-btn,
html[data-theme="dark"] .trade-v2-chart,
html[data-theme="dark"] .trade-v2-more-panel {
  background: #0f172a;
}

html[data-theme="dark"] .trade-v2-chart-canvas {
  background: transparent;
}

html[data-theme="dark"] .trade-v2-chart-line {
  stroke: #ffffff;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, .42));
}

html[data-theme="dark"] .trade-v2-chart-area {
  opacity: .35;
}

html[data-theme="dark"] .trade-v2-chart-crosshair {
  stroke: rgba(255, 255, 255, .72);
}

html[data-theme="dark"] .trade-v2-chart-stage.is-active .trade-v2-chart-crosshair,
html[data-theme="dark"] .trade-v2-chart-dot {
  stroke: #ffffff;
}

html[data-theme="dark"] .trade-v2-chart-dot {
  fill: #ffffff;
}

html[data-theme="dark"] .trade-v2-chart-axis-label,
html[data-theme="dark"] .trade-v2-chart-time-label {
  fill: rgba(226, 232, 240, .68);
}

html[data-theme="dark"] .trade-v2-chart-grid-line {
  stroke: rgba(148, 163, 184, .16);
}

html[data-theme="dark"] .trade-v2-range-btn {
  background: #111827;
  color: #cbd5e1;
}

html[data-theme="dark"] .trade-v2-menu-row {
  background: #0f172a;
}

html[data-theme="dark"] .trade-v2-menu-tile {
  background: linear-gradient(145deg, rgba(30, 41, 59, .96), rgba(15, 23, 42, .98));
  color: #f8fafc;
  border-color: rgba(148, 163, 184, .28);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .05);
}

html[data-theme="dark"] .trade-v2-menu-tile small {
  color: #cbd5e1;
}

html[data-theme="dark"] .trade-v2-menu-icon {
  background: rgba(255, 255, 255, .08);
  color: #f8fafc;
}

html[data-theme="dark"] .trade-v2-menu-buy .trade-v2-menu-icon {
  color: #86efac;
  background: rgba(34, 197, 94, .18);
}

html[data-theme="dark"] .trade-v2-menu-sell .trade-v2-menu-icon {
  color: #fca5a5;
  background: rgba(248, 113, 113, .16);
}

/* ---- خدمات، انتقال و پروفایل نسخه ۲ ---- */
.services-v2-wrap,
.profile-v2-wrap,
.wallet-v2-overview {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.services-v2-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.05rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--fg);
  padding: .85rem 1rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.services-v2-chevron,
.wallet-product-chevron {
  color: var(--muted);
  font-size: 1.4rem;
}

.transfer-v2-panel,
.profile-v2-invite,
.profile-v2-user,
.profile-v2-menu,
.profile-v2-password {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: .9rem;
  box-shadow: var(--shadow);
}

.transfer-v2-panel h2,
.profile-v2-head h2,
.wallet-v2-head h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
}

.transfer-v2-panel p,
.profile-v2-head p {
  margin: .3rem 0 .8rem;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.7;
}

.transfer-v2-summary {
  display: grid;
  gap: .45rem;
  margin: .7rem 0;
}

.transfer-v2-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  border-radius: 12px;
  background: #f8fafc;
  padding: .55rem .65rem;
  font-size: .76rem;
}

.transfer-v2-summary strong {
  color: var(--primary);
  direction: ltr;
  unicode-bidi: embed;
}

.transfer-v2-recipient {
  border-radius: 12px;
  background: #ecfdf5;
  color: #166534;
  padding: .6rem .7rem;
  font-size: .78rem;
  font-weight: 800;
  margin: .55rem 0;
}

.transfer-v2-amount-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin: .65rem 0 .3rem;
  color: var(--primary);
  font-size: .82rem;
  font-weight: 900;
}

.transfer-v2-max {
  border: 1px solid rgba(15, 31, 92, .18);
  background: rgba(15, 31, 92, .06);
  color: var(--primary);
  border-radius: 999px;
  padding: .3rem .75rem;
  font: inherit;
  font-size: .74rem;
  font-weight: 900;
  cursor: pointer;
}

.transfer-v2-submit {
  width: 100%;
}

.transfer-v2-change {
  width: 100%;
  flex: none;
  margin-top: .5rem;
}

.profile-v2-head,
.wallet-v2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.profile-v2-support,
.wallet-v2-support {
  background: var(--primary);
}

.profile-v2-invite {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  color: #92400e;
  text-align: right;
  font: inherit;
  cursor: pointer;
  width: 100%;
}

.profile-v2-invite span,
.profile-v2-invite strong {
  display: block;
}

.profile-v2-invite span {
  font-size: .75rem;
  font-weight: 800;
}

.profile-v2-invite strong {
  margin-top: .2rem;
  font-size: .86rem;
}

.profile-v2-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.profile-v2-avatar {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  flex: 0 0 3.2rem;
}

.profile-v2-user strong,
.profile-v2-user span,
.profile-v2-user em {
  display: block;
}

.profile-v2-user span {
  margin-top: .15rem;
  color: var(--muted);
  font-size: .78rem;
}

.profile-v2-user em {
  margin-top: .25rem;
  color: #15803d;
  font-style: normal;
  font-size: .72rem;
  font-weight: 800;
}

.profile-v2-menu {
  display: grid;
  padding: 0;
  overflow: hidden;
}

.profile-v2-menu button {
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  padding: .9rem 1rem;
  text-align: right;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.profile-v2-menu button:last-child {
  border-bottom: 0;
}

.profile-v2-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.profile-v2-menu-label {
  flex: 1;
  text-align: right;
}

.profile-v2-menu-end {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
}

.profile-v2-menu-chevron {
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 400;
  opacity: .72;
}

.profile-v2-menu-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1.35rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.nav-badge {
  position: absolute;
  top: .15rem;
  left: 50%;
  transform: translateX(.85rem);
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 .24rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  line-height: 1.1rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
  z-index: 2;
}

.invite-v2-wrap {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  max-width: 40rem;
  margin-inline: auto;
  width: 100%;
}

.invite-v2-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 3.5rem;
  background: var(--bg);
}

.invite-v2-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 1rem;
}

.invite-v2-banner,
.invite-v2-code-panel,
.invite-v2-stats,
.invite-v2-rules {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.invite-v2-banner {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #0f1f5c 0%, #1d4ed8 52%, #2563eb 100%);
  border-color: rgba(255, 255, 255, .12);
}

.invite-v2-banner-glow {
  position: absolute;
  inset: -20% auto auto -10%;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, .45), transparent 68%);
  pointer-events: none;
}

.invite-v2-banner-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  padding: .28rem .65rem;
  font-size: .68rem;
  font-weight: 900;
  margin-bottom: .55rem;
}

.invite-v2-banner h3 {
  margin: 0 0 .45rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.invite-v2-banner p {
  margin: 0;
  font-size: .8rem;
  line-height: 1.85;
  opacity: .95;
}

.invite-v2-code-panel {
  display: grid;
  gap: .75rem;
}

.invite-v2-code-label {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.invite-v2-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border-radius: 14px;
  background: #f8fafc;
  padding: .8rem .85rem;
}

.invite-v2-code-box strong {
  color: var(--primary);
  font-size: 1.15rem;
  letter-spacing: .08em;
}

.invite-v2-copy-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: .35rem .8rem;
  font: inherit;
  font-size: .74rem;
  font-weight: 900;
  cursor: pointer;
}

.invite-v2-share-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f1f5c, #2563eb);
  color: #fff;
  padding: .85rem 1rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
}

.invite-v2-stats {
  display: grid;
  gap: .7rem;
}

.invite-v2-stat-card {
  display: grid;
  gap: .45rem;
}

.invite-v2-stat-card > span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.invite-v2-stat-card > strong {
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 900;
}

.invite-v2-stat-card > strong small {
  margin-right: .25rem;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 800;
}

.invite-v2-progress-track {
  margin-top: .15rem;
}

.invite-v2-stat-card > p {
  margin: 0;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.7;
}

.invite-v2-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}

.invite-v2-stat-mini {
  border-radius: 14px;
  background: #f8fafc;
  padding: .7rem .75rem;
}

.invite-v2-stat-mini span {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}

.invite-v2-stat-mini strong {
  display: block;
  margin-top: .2rem;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 900;
}

.invite-v2-rules h3 {
  margin: 0 0 .45rem;
  font-size: .92rem;
  color: var(--primary);
}

.invite-v2-rules p {
  margin: .35rem 0 0;
  font-size: .78rem;
  line-height: 1.85;
  color: var(--fg);
}

.invite-v2-repeat {
  color: var(--muted);
}

html[data-theme="dark"] .transfer-v2-summary div {
  background: #111827;
}

table.products {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

table.products thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--muted);
  font-weight: 700;
  padding: .65rem .5rem;
  font-size: .65rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
table.products thead th.th-product { color: var(--muted); width: 36%; }
table.products thead th.th-buy     { color: #15803d; }
table.products thead th.th-sell    { color: #b91c1c; }

table.products td {
  padding: .45rem .3rem;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(15,31,92,.05);
}
table.products tbody tr:last-child td { border-bottom: none; }
table.products tbody tr:hover td { background: rgba(15,31,92,.02); }

.col-name {
  font-weight: 600;
  color: var(--fg);
  font-size: .82rem;
  text-align: right;
  padding-right: .6rem !important;
  line-height: 1.3;
}

/* ---- دکمه قیمت ---- */
.cell-hit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  width: 100%;
  min-height: 3.8rem;
  padding: .5rem .3rem;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, background .12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cell-buy .cell-hit {
  background: var(--buy-btn);
  color: var(--buy-text);
  border-color: rgba(22,163,74,.15);
}
.cell-buy .cell-hit:active  { background: rgba(22,163,74,.2); }
.cell-sell .cell-hit {
  background: var(--sell-btn);
  color: var(--sell-text);
  border-color: rgba(220,38,38,.15);
}
.cell-sell .cell-hit:active { background: rgba(220,38,38,.18); }
.cell-hit-buy {
  background: rgba(15,31,92,.08);
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.cell-hit-sell {
  background: #fff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
}
.cell-buy .cell-hit-buy:active { background: rgba(15,31,92,.14); }
.cell-sell .cell-hit-sell:active { background: #f1f5f9; }
.cell-hit:active            { transform: scale(.97); }

.tx-status-chip {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}
.tx-status-times { font-size: .68rem; color: var(--muted); margin-top: .2rem; line-height: 1.35; }
.tx-status-sub { opacity: .85; }

.wallet-action-row { display: flex; gap: .5rem; margin: .65rem 0; }
.wallet-action-row #btn-charge-wallet {
  flex: 7 1 0;
  width: auto;
}

.wallet-action-row #btn-withdraw-wallet {
  flex: 3 1 0;
  width: auto;
}

.wallet-withdraw-btn {
  flex: 1;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: var(--primary);
  border-radius: 12px;
  padding: .75rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.wallet-withdraw-form { margin-bottom: .75rem; }
.wallet-withdraw-panel {
  padding: .75rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.wallet-withdraw-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}
.wallet-withdraw-modal {
  position: relative;
  width: min(460px, 100%);
  max-height: min(720px, 92dvh);
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.24);
  padding: 1rem;
}
.wallet-withdraw-close { top: 0.65rem; left: 0.65rem; }
.wallet-withdraw-modal-head { padding-left: 2.2rem; margin-bottom: 0.75rem; }
.wallet-withdraw-modal-head h3 { margin: 0.35rem 0 0.25rem; font-size: 1rem; color: var(--primary); }
.wallet-withdraw-modal-head p { margin: 0; color: #64748b; font-size: 0.78rem; line-height: 1.7; }
.wallet-withdraw-icon {
  display: inline-flex;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
}
.wallet-withdraw-balance-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
}
.wallet-withdraw-balance-card strong { color: var(--primary); }
.iban-bank-info { margin: -0.3rem 0 0.55rem; min-height: 1.7rem; display: flex; align-items: center; }
.iban-bank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  padding: 0.22rem 0.52rem;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 700;
}
.iban-bank-logo {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bank-color, #64748b);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  flex: 0 0 1.35rem;
  font-family: "IRANYekan", Tahoma, system-ui, sans-serif;
  overflow: hidden;
}
.iban-bank-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}
.iban-bank-empty { color: #94a3b8; font-size: 0.72rem; }
.wc-sub-line {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  margin-top: .35rem;
  color: var(--muted);
}
.wc-sub-highlight strong { color: var(--primary); }

.price-main {
  font-size: .88rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  direction: ltr;
  unicode-bidi: embed;
  line-height: 1.2;
}
.per-gram {
  font-size: .58rem;
  font-weight: 500;
  opacity: .65;
  direction: ltr;
  unicode-bidi: embed;
}

.trade-cell-msg {
  min-height: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .3rem .2rem;
  border-radius: 8px;
  border: 1px dashed var(--border);
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}
.trade-cell-msg-buy  { border-color: rgba(22,163,74,.3);  background: rgba(22,163,74,.05); color: var(--buy-text); }
.trade-cell-msg-sell { border-color: rgba(220,38,38,.3);  background: rgba(220,38,38,.05); color: var(--sell-text); }
.trade-cell-contact {
  gap: .28rem;
  padding: .45rem .25rem;
}
.trade-contact-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}
.trade-contact-call svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
.trade-contact-call:active { transform: scale(.98); }
.trade-cell-contact small {
  display: block;
  max-width: 11rem;
  font-size: .58rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--muted);
}

/* ==================== نصب روی صفحه اصلی ==================== */
.pwa-install-prompt {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem max(1rem, env(safe-area-inset-bottom, 0px));
}
.pwa-install-prompt[hidden] { display: none !important; }
.pwa-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pwa-install-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: .95rem;
  border: 1px solid rgba(15, 31, 92, .12);
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 56%, #eef2ff 100%);
  box-shadow: 0 22px 60px rgba(15, 23, 42, .28);
}
.pwa-install-dialog-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .75rem;
}
.pwa-install-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: 0 0 54px;
  box-shadow: 0 5px 16px rgba(15, 31, 92, .16);
}
.pwa-install-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: .12rem;
}
.pwa-install-copy strong {
  font-size: .95rem;
  color: var(--primary);
}
.pwa-install-copy span,
.pwa-install-copy p {
  margin: 0;
  font-size: .78rem;
  line-height: 1.55;
  color: #64748b;
}
.pwa-install-ios-hint {
  color: #92400e !important;
  font-weight: 700;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: .55rem .65rem;
  margin: .55rem 0 .75rem !important;
}
.pwa-install-ios-steps {
  margin: .55rem 0 .75rem;
  padding: .65rem .75rem .65rem 1.35rem;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: .76rem;
  line-height: 1.65;
  color: #78350f;
}
.pwa-install-ios-steps li + li { margin-top: .35rem; }
.pwa-ios-share-ico {
  display: inline-block;
  font-size: .95rem;
  vertical-align: middle;
  margin-inline: .15rem;
}
.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: stretch;
}
.pwa-install-btn,
.pwa-install-dismiss {
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}
.pwa-install-btn {
  flex: 1 1 180px;
  background: var(--primary);
  color: #fff;
  padding: .62rem .9rem;
  box-shadow: 0 5px 14px rgba(15, 31, 92, .18);
}
.pwa-install-dismiss {
  flex: 1 1 90px;
  background: transparent;
  color: #64748b;
  padding: .58rem .55rem;
}

/* ==================== نوار پایین ==================== */
.bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  width: 100%;
  min-height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  padding: .28rem .35rem;
  padding-bottom: max(.28rem, env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  box-shadow: 0 -2px 14px rgba(15,31,92,.08);
  z-index: 90;
  transform: translateZ(0);
  will-change: transform;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  font-size: .58rem;
  padding: .35rem .08rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  min-height: 54px;
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  position: relative;
  touch-action: manipulation;
}
.nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  opacity: .88;
}
.nav-ico svg {
  width: 1.28rem;
  height: 1.28rem;
  display: block;
}
.nav-lbl {
  display: block;
  line-height: 1.1;
  letter-spacing: -.01em;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
  white-space: nowrap;
}
@keyframes nav-offer-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: .85; }
}
.nav-btn:active { transform: scale(.96); background: var(--primary-light); }
.nav-btn.active {
  background: linear-gradient(180deg, rgba(15,31,92,.09), rgba(15,31,92,.04));
  color: var(--primary);
  font-weight: 800;
}
.nav-btn.active .nav-ico { color: var(--primary); opacity: 1; }
.nav-lbl-2 {
  font-size: .5rem;
  line-height: 1.08;
  white-space: normal;
  text-align: center;
  max-width: 4.5rem;
}

/* دکمه‌های شناور چپ — پیشنهاد ویژه پایین، سبد خرید کمی بالاتر */
.customer-left-fabs {
  position: fixed;
  z-index: 120;
  left: max(var(--fab-stack-x, .55rem), env(safe-area-inset-left));
  bottom: calc(var(--nav-h) + .5rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column-reverse;
  gap: 0.45rem;
  align-items: stretch;
  width: 3.5rem;
}

/* دکمهٔ شناور پیشنهاد ویژه */
.nav-offers-fab {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 3.5rem;
  padding: .28rem .2rem .32rem;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  background: linear-gradient(160deg, #fde68a 0%, #f59e0b 45%, #d97706 100%);
  color: #78350f;
  box-shadow: 0 6px 22px rgba(217, 119, 6, .45), inset 0 1px 0 rgba(255,255,255,.35);
  touch-action: manipulation;
  transition: transform .12s, box-shadow .15s;
}
.nav-offers-fab-glow {
  position: absolute;
  inset: -2px;
  border-radius: 17px;
  background: radial-gradient(circle at 50% 0%, rgba(251, 191, 36, .55), transparent 70%);
  pointer-events: none;
  opacity: .85;
}
.nav-offers-fab-ico {
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.15));
  position: relative;
  z-index: 1;
}
.nav-offers-fab-lbl {
  font-size: .46rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
  text-align: center;
  position: relative;
  z-index: 1;
}
.nav-offers-fab-dot {
  position: absolute;
  top: -.2rem;
  right: -.2rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 .22rem;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px #fbbf24, 0 0 10px rgba(239, 68, 68, .7);
  animation: nav-offer-pulse 1.4s ease-in-out infinite;
  z-index: 2;
}
.nav-offers-fab-dot::before { content: '1'; }
.nav-offers-fab:active { transform: scale(.94); }
.nav-offers-fab.active {
  box-shadow: 0 2px 12px rgba(146, 64, 14, .55), inset 0 2px 6px rgba(0,0,0,.12);
  outline: 2px solid rgba(15, 31, 92, .28);
  outline-offset: 1px;
}
.nav-offers-fab.is-hot {
  animation: nav-special-attention 4.2s ease-in-out infinite;
}
@keyframes nav-special-attention {
  0%, 72%, 100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
  78% { transform: scale(1.08) rotate(-2deg); filter: brightness(1.08); }
  84% { transform: scale(0.98) rotate(2deg); }
  90% { transform: scale(1.06) rotate(0deg); }
}

/* ==================== مودال معامله ==================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* همیشه bottom sheet */
  justify-content: center;
  background: rgba(10,16,40,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.trade-dialog {
  width: 100%;
  max-width: 520px;
  /* ارتفاع کافی ولی نه بیشتر از صفحه */
  max-height: min(88dvh, 88vh);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* دستگیره کشیدن (drag handle) */
.trade-dialog-title {
  margin: 0;
  padding: .7rem 1rem .4rem;
  text-align: center;
  color: rgba(255,255,255,.9);
  font-size: .94rem;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  position: relative;
}
.trade-dialog-title::before {
  content: '';
  position: absolute;
  top: .4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.4);
}

.trade-sheet {
  background: var(--surface);
  border-radius: 0;
  padding: .9rem 1rem 1rem;
  box-shadow: var(--shadow-md);
}

.trade-profit-tier-hint {
  font-size: .78rem; color: #475569; margin: .15rem 0 .55rem; line-height: 1.5;
  padding: .45rem .6rem; background: #f1f5f9; border-radius: 8px;
}
.trade-profit-tier-upsell {
  font-size: .76rem; color: #0f766e; margin-top: .25rem;
}

.trade-wallet-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .65rem;
  padding: .55rem .75rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  border: 1px solid rgba(59,130,246,.28);
  font-size: .78rem;
}
.trade-gold-banner {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: rgba(217, 119, 6, .28);
}
.twb-fill-gold {
  font: inherit;
  cursor: pointer;
  border: none;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: .35rem .55rem;
  margin: 0;
  box-shadow: 0 1px 2px rgba(15, 31, 92, 0.08);
  transition: background 0.15s ease, transform 0.1s ease;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
.twb-fill-gold:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
}
.twb-fill-gold:active:not(:disabled) {
  transform: scale(0.98);
}
.twb-fill-gold:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.twb-label { font-weight: 700; color: #1e3a5f; }
.twb-fill-wallet {
  font: inherit;
  cursor: pointer;
  border: none;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: .35rem .55rem;
  margin: 0;
  box-shadow: 0 1px 2px rgba(15, 31, 92, 0.08);
  transition: background 0.15s ease, transform 0.1s ease;
}
.twb-fill-wallet:hover:not(:disabled) {
  background: #fff;
}
.twb-fill-wallet:active:not(:disabled) {
  transform: scale(0.98);
}
.twb-fill-wallet:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.trade-price-wrap {
  position: relative;
  border-radius: 11px;
  padding: 2px;
  transition: box-shadow .15s, border-color .15s;
  border: 2px solid transparent;
}
.trade-price-wrap .trade-input {
  border-radius: 9px;
  border-width: 1.5px;
  padding-left: 4.6rem;
}
.trade-price-unit {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(15,31,92,.08), rgba(15,31,92,.02));
  border: 1px solid rgba(15,31,92,.12);
  border-radius: 999px;
  padding: .28rem .42rem;
}
.trade-price-wrap.is-neutral { border-color: transparent; }
.trade-price-wrap.is-ok {
  border-color: rgba(59, 130, 246, 0.42);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.trade-price-wrap.is-over {
  border-color: rgba(239,68,68,.65);
  box-shadow: 0 0 0 3px rgba(239,68,68,.14);
}

.tm-err-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

#service-vip-open {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: rgba(245, 158, 11, .38);
  color: #fff7ed;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .42), transparent 24%),
    linear-gradient(115deg, #7c2d12 0%, #b45309 28%, #f59e0b 52%, #92400e 76%, #451a03 100%);
  background-size: 160% 160%, 240% 240%;
  box-shadow: 0 18px 42px rgba(146, 64, 14, .26), inset 0 1px 0 rgba(255, 255, 255, .34);
  animation: vipLuxuryFlow 6s ease-in-out infinite;
}

#service-vip-open::before {
  content: "";
  position: absolute;
  inset: -45% -20%;
  z-index: -1;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, .48) 45%, transparent 65%);
  transform: translateX(60%);
  animation: vipLuxuryShine 3.8s ease-in-out infinite;
}

#service-vip-open span:first-child {
  font-weight: 900;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .28);
}

#service-vip-open .services-v2-chevron {
  color: #fff7ed;
}

@keyframes vipLuxuryFlow {
  0%, 100% { background-position: 0% 50%, 0% 50%; }
  50% { background-position: 100% 50%, 100% 50%; }
}

@keyframes vipLuxuryShine {
  0%, 42% { transform: translateX(70%) rotate(8deg); opacity: 0; }
  55% { opacity: .95; }
  100% { transform: translateX(-70%) rotate(8deg); opacity: 0; }
}
.trade-goto-wallet-btn {
  padding: .4rem .8rem;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: .78rem;
  cursor: pointer;
  touch-action: manipulation;
}

/* واحد تومان: آیکون بعد از عدد در چیدمان راست‌به‌چپ */
.money-rtl-line {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  flex-direction: row;
  direction: rtl;
  unicode-bidi: isolate;
}
.money-rtl-num { font-weight: 800; font-variant-numeric: tabular-nums; }
.money-rtl-unit { font-weight: 600; font-size: .85em; color: var(--muted); white-space: nowrap; }
.money-rtl-unit.toman-icon-wrap {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  color: var(--muted);
}
.toman-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  color: inherit;
  vertical-align: middle;
}
.toman-icon svg { display: block; }
.per-gram-unit {
  display: inline-flex;
  align-items: center;
  gap: .12rem;
  line-height: 0;
  color: inherit;
  opacity: .85;
}
.per-gram-slash { font-size: .6rem; line-height: 1.2; opacity: .85; }
.price-unit-icon { display: inline-flex; align-items: center; line-height: 0; color: var(--muted); }

.wc-value-money { font-size: 1.06rem; line-height: 1.35; }
.wallet-card-rial .wc-value-negative,
.wc-value-negative { color: #b91c1c !important; }
.wc-negative-hint {
  font-size: .68rem;
  color: var(--muted);
  margin: .4rem 0 0;
  line-height: 1.55;
  text-align: center;
}

.wallet-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .25rem .4rem;
  margin-bottom: .55rem;
  padding: .48rem .55rem;
  background: rgba(15,31,92,.04);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.wps-cell {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  opacity: .42;
  font-size: .72rem;
  font-weight: 700;
}
.wps-cell.active { opacity: 1; color: var(--primary); }
.wps-cell.done { opacity: .88; color: #15803d; }
.wps-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15,31,92,.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
}
.wps-cell.active .wps-dot { background: var(--primary); color: #fff; }
.wps-cell.done .wps-dot { background: #22c55e; color: #fff; }
.wps-arrow { color: var(--muted); font-size: .85rem; opacity: .45; padding: 0 .15rem; }

.wallet-step-explainer {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.55;
}
.wallet-next-hint {
  font-size: .74rem;
  color: #166534;
  background: #ecfdf5;
  border: 1px solid rgba(21,128,61,.22);
  border-radius: 10px;
  padding: .55rem .65rem;
  line-height: 1.45;
}
.wallet-next-hint-tag {
  display: inline-block;
  font-weight: 800;
  font-size: .62rem;
  background: #15803d;
  color: #fff;
  padding: .12rem .4rem;
  border-radius: 6px;
  margin-left: .35rem;
}
.wallet-step-banner {
  font-size: .8rem;
  color: var(--fg);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid rgba(217,119,6,.28);
  border-radius: 12px;
  padding: .62rem .78rem;
  line-height: 1.55;
}
.wallet-banner-amt { display: inline; }

.trade-field { display: block; margin-bottom: .65rem; }

.trade-money-input-wrap {
  position: relative;
  display: block;
}

.trade-money-input-wrap .trade-input-money {
  padding-left: 5.8rem;
}

.trade-input-unit {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  pointer-events: none;
}

.trade-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .4rem;
  margin-bottom: .3rem;
}
.trade-mg-label-row { align-items: center; }
.trade-label-side {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  direction: ltr;
}
.trade-label { font-size: .78rem; font-weight: 700; color: var(--primary); }
.trade-sub   { font-size: .64rem; color: var(--muted); }

/* ≥ 16px برای جلوگیری از زوم iOS */
.trade-input, .trade-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .65rem .85rem;
  font: inherit;
  font-size: 1rem;
  background: #fafbfd;
  color: var(--fg);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.trade-input:focus, .trade-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,31,92,.1);
  background: #fff;
}

.trade-mg-input-wrap {
  position: relative;
  direction: ltr;
}
.trade-input-mg {
  padding-left: .85rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.trade-mg-input-wrap.has-value .trade-input-mg {
  padding-left: 5.7rem;
}
.trade-mg-unit {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0;
  font-size: .82rem;
  font-weight: 800;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(15,31,92,.08), rgba(15,31,92,.02));
  border: 1px solid rgba(15,31,92,.12);
  border-radius: 999px;
  padding: .18rem .48rem;
  white-space: nowrap;
  transition: opacity .15s ease;
}
.trade-mg-input-wrap.has-value .trade-mg-unit {
  opacity: 1;
}
.trade-gram-hint {
  margin: 0.28rem 0 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  direction: rtl;
}
html[data-theme="dark"] .trade-gram-hint {
  color: #cbd5e1;
}

.trade-actions { display: flex; gap: .5rem; margin-top: .85rem; }

.trade-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: .8rem;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  touch-action: manipulation;
  min-height: 48px;
}
.trade-btn:active { transform: scale(.98); }

.trade-btn-cancel { background: #f1f5f9; color: var(--primary); }
.trade-btn-cancel:active { background: #e2e8f0; }

.trade-btn-submit { background: var(--primary); color: #fff; }
.trade-btn-submit:not(:disabled):active { opacity: .88; }
.trade-btn-submit:disabled { opacity: .45; cursor: default; }

html[data-theme="dark"] .trade-btn-cancel {
  background: #0f172a;
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .trade-btn-submit {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
}

/* ---- مودال رسید ---- */
.receipt-dialog {
  width: 100%;
  max-width: 420px;
  max-height: min(85dvh, 85vh);
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-md);
  background: var(--surface);
}

.receipt-top-bar { height: 4px; width: 100%; }
.receipt-buy  .receipt-top-bar { background: linear-gradient(90deg, #16a34a, #22c55e); }
.receipt-sell .receipt-top-bar { background: linear-gradient(90deg, #b91c1c, #dc2626); }

.receipt-body { padding: .9rem 1rem 1rem; overflow-y: auto; max-height: calc(85vh - 4px); padding-bottom: env(safe-area-inset-bottom, 1rem); }

.receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem .75rem;
  margin-bottom: .65rem;
}
.receipt-label { color: var(--muted); font-weight: 600; font-size: .74rem; display: block; margin-bottom: .15rem; }
.receipt-val   { font-weight: 700; font-size: .88rem; direction: ltr; unicode-bidi: embed; display: inline-flex; align-items: baseline; gap: .2rem; }
.receipt-grid-span2 { grid-column: 1 / -1; }
.receipt-val-spot {
  flex-direction: column;
  align-items: flex-start;
  gap: .14rem;
}
.receipt-spot-hint {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  direction: rtl;
  unicode-bidi: embed;
}
.rv-unit       { font-size: .7rem; font-weight: 500; color: var(--muted); }

.side-buy  { color: var(--buy-text);  font-weight: 800; }
.side-sell { color: var(--sell-text); font-weight: 800; }

.receipt-status {
  margin: .65rem 0 .5rem;
  padding: .5rem .6rem;
  border-radius: 9px;
  font-weight: 800;
  text-align: center;
  font-size: .86rem;
}
.st-pending  { background: #fef3c7; color: #b45309; }
.st-approved { background: #dcfce7; color: #15803d; }
.st-rejected { background: #fee2e2; color: #b91c1c; }

.receipt-status-wrap { margin: .65rem 0 .5rem; text-align: center; }
.receipt-status-chip {
  display: inline-block;
  padding: .35rem .85rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: .82rem;
  pointer-events: none;
}
.receipt-status-note,
.receipt-pending-hint {
  margin: .55rem 0 0;
  font-size: .78rem;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 600;
  text-align: right;
  direction: rtl;
}
.receipt-val-muted { font-size: .72rem; color: var(--muted); font-weight: 600; }

.receipt-close {
  width: 100%;
  margin-top: .35rem;
  padding: .8rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  background: var(--primary);
  color: #fff;
  transition: opacity .15s;
  touch-action: manipulation;
  min-height: 48px;
}
.receipt-close:active { opacity: .88; }

/* ==================== تب معاملات مشتری ==================== */
.tx-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: .2rem 0 calc(.5rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tx-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .85rem;
  margin-bottom: .55rem;
  box-shadow: var(--shadow);
}

.tx-filter-title { margin: 0 0 .45rem; font-size: .9rem; font-weight: 800; color: var(--primary); }
.tx-filter-row   { margin-bottom: .4rem; }
.tx-filter-label { display: block; font-size: .7rem; font-weight: 700; color: var(--muted); margin-bottom: .25rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: .3rem; }

.chip-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: .3rem .7rem;
  font: inherit;
  font-weight: 600;
  font-size: .74rem;
  cursor: pointer;
  color: var(--muted);
  transition: border-color .12s, background .12s, color .12s;
  touch-action: manipulation;
  min-height: 32px;
}
.chip-btn:active { border-color: var(--primary); color: var(--primary); }
.chip-btn.on    { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 800; }

.tx-groups { display: flex; flex-direction: column; gap: .55rem; }

.tx-shop-detail {
  margin-top: .65rem;
  padding: .85rem .75rem;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}
.tx-shop-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .55rem;
}
.tx-shop-detail-head h3 {
  margin: 0;
  font-size: .88rem;
  color: var(--primary);
}
.tx-shop-detail-close {
  border: none;
  background: #f1f5f9;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  color: #64748b;
}
.tx-shop-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  font-size: .76rem;
  color: #64748b;
  margin-bottom: .65rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid #eef2f6;
}
.tx-shop-items { display: flex; flex-direction: column; gap: .55rem; }
.tx-shop-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
}
.tx-shop-item img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}
.tx-shop-item-body { flex: 1; min-width: 0; }
.tx-shop-item-name { font-size: .82rem; font-weight: 700; color: #1e293b; }
.tx-shop-item-meta { font-size: .72rem; color: #64748b; margin-top: .15rem; }
.tx-shop-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .3rem;
  font-size: .64rem;
  color: #475569;
}
.view-btn-active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

.tx-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tx-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  padding: .45rem .75rem;
  font-weight: 700;
  background: rgba(15,31,92,.04);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  line-height: 1.45;
}
.tx-day-toggle {
  width: 100%;
  border: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  text-align: right;
}
.tx-day-toggle:hover { background: rgba(15,31,92,.07); }
.tx-day-arrow {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 1.25rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 0;
  transition: transform .15s ease;
}
.tx-day-arrow::before {
  content: '';
  width: .42rem;
  height: .42rem;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}
.tx-day-closed .tx-day-arrow { transform: rotate(90deg); }
.tx-day-head > span:nth-child(2) {
  flex: 1;
  min-width: min(100%, 220px);
}
.tx-day-closed .tx-day-head { border-bottom: none; }
.tx-day-meta { font-size: .7rem; font-weight: 600; color: var(--muted); }

/* جدول معاملات — اسکرول افقی */
.tx-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tx-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  table-layout: fixed;
  min-width: 100%;
}
.tx-tbl col.tx-colg-side    { width: 11%; }
.tx-tbl col.tx-colg-product { width: 26%; }
.tx-tbl col.tx-colg-weight  { width: 14%; }
.tx-tbl col.tx-colg-price   { width: 22%; }
.tx-tbl col.tx-colg-status  { width: 14%; }
.tx-tbl col.tx-colg-action  { width: 13%; }

.tx-tbl th {
  padding: .38rem .45rem;
  text-align: center;
  background: rgba(15,31,92,.04);
  font-weight: 700;
  color: var(--muted);
  font-size: .68rem;
  white-space: nowrap;
}
.tx-tbl td {
  padding: .42rem .45rem;
  border-top: 1px solid rgba(15,31,92,.06);
  vertical-align: middle;
  white-space: nowrap;
  text-align: center;
}
.tx-tbl .tx-col-product {
  direction: rtl;
  text-align: right;
  white-space: normal;
  word-break: break-word;
  font-weight: 600;
}
.tx-tbl .tx-col-side .side-buy { color: #15803d; font-weight: 800; }
.tx-tbl .tx-col-side .side-sell { color: #b45309; font-weight: 800; }
.tx-tbl .tx-col-num { font-variant-numeric: tabular-nums; }
.tx-tbl .tx-unit { font-size: .62rem; color: var(--muted); font-weight: 600; margin-right: .15rem; }
.tx-tbl .tx-col-price { text-align: center; }
.tx-tbl .tx-col-price .money-rtl-line { justify-content: center; }
.tx-tbl .tx-col-action { text-align: center; }

.status-pending  { color: #b45309; font-weight: 700; }
.status-approved { color: #15803d; font-weight: 700; }
.status-rejected { color: #b91c1c; font-weight: 700; }

.view-btn {
  padding: .3rem .6rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  font: inherit;
  font-weight: 700;
  font-size: .72rem;
  cursor: pointer;
  background: var(--surface);
  color: var(--primary);
  transition: background .12s;
  touch-action: manipulation;
  min-height: 32px;
}
.view-btn:active { background: var(--primary-light); }

/* ==================== گزارش دفتر ==================== */
.ledger-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: .2rem 0 calc(.5rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ledger-header { text-align: center; margin-bottom: .55rem; }
.ledger-header h2 { margin: 0; font-size: .95rem; }
.ledger-order-note { margin: .25rem 0 0; color: var(--muted); font-size: .72rem; }

.ledger-summary { margin-bottom: .55rem; }

.ledger-box {
  border-radius: var(--radius);
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.ledger-box-title { margin: 0 0 .4rem; font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.ledger-sum-line  { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .28rem; font-size: .82rem; align-items: baseline; }
.ledger-sum-k     { color: var(--muted); font-weight: 500; }
.ledger-sum-v     { font-weight: 800; font-variant-numeric: tabular-nums; direction: rtl; text-align: left; max-width: 58%; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: .2rem; }
.ledger-sum-warning { color: #b45309 !important; }
.ledger-sum-diff {
  margin-top: .2rem;
  padding-top: .4rem;
  border-top: 1px dashed var(--border);
}

/* جدول دفتر — اسکرول افقی */
.ledger-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(440px, 48vh);
  border-radius: 10px;
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.ledger-tbl { width: 100%; border-collapse: collapse; font-size: .68rem; min-width: 840px; table-layout: fixed; }
.ledger-tbl thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .42rem .4rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  background: var(--primary);
  color: #f0f4ff;
  border-bottom: 2px solid rgba(15,31,92,.2);
}
.ledger-tbl tbody td {
  padding: .32rem .4rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(15,31,92,.06);
}
.ledger-tbl tbody td:not(.td-desc) {
  white-space: nowrap;
}
.ledger-tbl tbody td.td-when {
  white-space: normal;
  word-break: break-word;
  font-size: .62rem;
  line-height: 1.35;
  text-align: center;
  vertical-align: top;
  max-width: 7rem;
}
.ledger-tbl tbody td.td-doc { text-align: center; width: 2.2rem; }
.ledger-tbl tbody td.col-num {
  direction: ltr;
  unicode-bidi: embed;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ledger-tbl tbody td.col-money {
  direction: rtl;
  text-align: center;
  font-size: .66rem;
}
.td-doc { text-align: center; vertical-align: top; font-variant-numeric: tabular-nums; }
.td-desc {
  text-align: right;
  min-width: 0;
  font-size: .67rem;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  direction: rtl !important;
}
.ledger-tbl thead th.th-when {
  font-size: .72rem;
  font-weight: 700;
  max-width: 6.5rem;
  white-space: normal;
  line-height: 1.25;
}
.ledger-tbl thead th.th-desc {
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  max-width: 10rem;
}
.ledger-col-doc { width: 2.6rem; }
.ledger-col-when { width: 6.5rem; min-width: 5rem; }
.ledger-col-desc { width: 28%; min-width: 120px; }
.ledger-col-gnum { width: 8%; }
.ledger-col-money { width: 11%; }

.ledger-print-btn {
  width: 100%;
  margin-top: .55rem;
  padding: .7rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  background: var(--primary);
  color: #f0f4ff;
  transition: opacity .15s;
  touch-action: manipulation;
  min-height: 48px;
}
.ledger-print-btn:active { opacity: .88; }

.copy-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(130%);
  z-index: 999999;
  padding: .55rem 1.15rem;
  border-radius: 10px;
  background: rgba(15, 31, 92, 0.92);
  color: #f0f4ff;
  font-weight: 700;
  font-size: .82rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .22s ease;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}
.copy-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* placeholder */
.placeholder-view {
  display: grid;
  place-items: center;
  width: 100%;
  flex: 1;
  min-height: 0;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  padding: 2rem;
}

.error-banner {
  padding: .6rem .85rem;
  border-radius: 9px;
  background: #fee2e2;
  color: var(--sell-text);
  font-weight: 600;
  border: 1px solid rgba(185,28,28,.15);
  font-size: .82rem;
  margin: .5rem 0;
}

/* ==================== موبایل — ≤640px ==================== */
@media (max-width: 640px) {
  /* پنهان کردن ساعت تاریخ در موبایل */
  .clock-block { display: none; }

  .top-bar { padding: .4rem .75rem .35rem; }

  .brand-title { font-size: .95rem; }

  .pwa-install-prompt {
    padding: max(.75rem, env(safe-area-inset-top, 0px)) .75rem max(.75rem, env(safe-area-inset-bottom, 0px));
  }
  .pwa-install-dialog {
    border-radius: 18px;
    padding: .8rem;
  }
  .pwa-install-logo {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
  .pwa-install-actions {
    width: 100%;
    justify-content: stretch;
  }
  .pwa-install-btn,
  .pwa-install-dismiss {
    flex: 1;
  }

  .main-zone {
    padding: .3rem .3rem 0;
    padding-bottom: var(--nav-h);
  }

  /* جدول محصولات — فاصله کمتر */
  table.products thead th { padding: .55rem .25rem; font-size: .6rem; }
  table.products td       { padding: .38rem .2rem; }
  .col-name               { font-size: .78rem; padding-right: .45rem !important; }
  .price-main             { font-size: .82rem; }
  .cell-hit               { min-height: 3.6rem; padding: .4rem .2rem; }
  table.products thead th.th-product { width: 32%; }

  /* داخل جدول معاملات اسکرول می‌شود */
  .tx-tbl { min-width: 380px; }

  /* bottom nav بزرگتر برای انگشت */
  .bottom-nav {
    padding: .24rem .12rem;
    padding-bottom: max(.24rem, env(safe-area-inset-bottom, 0px));
  }
  .nav-btn {
    font-size: clamp(.5rem, 2.35vw, .58rem);
    min-height: 56px;
    padding: .32rem .03rem;
  }
  .nav-ico { font-size: 1.08rem; }
  .nav-ico svg { width: 1.18rem; height: 1.18rem; }
}

/* ==================== موبایل کوچک — ≤380px ==================== */
@media (max-width: 380px) {
  .price-main { font-size: .76rem; }
  .col-name   { font-size: .72rem; }
  table.products thead th.th-product { width: 30%; }
  .header-actions .chip-user { display: none; }
}

/* ==================== پیشنهادات ویژه ==================== */
.offers-v2-wrap,
.subpage-v2-header {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.subpage-v2-header {
  position: sticky;
  top: 0;
  z-index: 4;
  flex-direction: row;
  align-items: center;
  gap: .75rem;
  min-height: 3.25rem;
  margin: -.15rem 0 .15rem;
  padding: .35rem 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.subpage-v2-header h2 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: .95rem;
  font-weight: 900;
  color: var(--fg);
}

.subpage-v2-header .wallet-back-btn {
  flex-shrink: 0;
}

.offers-wrap {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 0 0 .5rem;
}
.offers-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.offers-empty-title { font-weight: 700; color: var(--fg); margin: 0 0 .35rem; }
.offers-empty-sub { font-size: .82rem; margin: 0; line-height: 1.5; }
.offers-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: var(--shadow);
}
.offers-card.is-active,
.offers-grant.is-active { border-color: rgba(22, 163, 74, .35); }
.offers-card-title { font-weight: 800; font-size: .92rem; margin-bottom: .35rem; }
.offers-card-desc, .offers-card-meta, .offers-invite-hint {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 .4rem;
}
.offers-invite-code {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin: .25rem 0 .5rem;
  color: var(--primary);
}
.offers-invite-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.offers-btn {
  border: none;
  border-radius: 10px;
  padding: .45rem .85rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}
.offers-btn-secondary { background: var(--primary-light); color: var(--primary); }
.offers-section-title {
  font-size: .8rem;
  font-weight: 800;
  color: var(--muted);
  margin: .25rem 0 0;
}
.offers-progress { margin-top: .5rem; }
.offers-progress-label { font-size: .78rem; font-weight: 600; }
.offers-progress-pending { display: block; font-size: .72rem; color: var(--muted); margin: .2rem 0 .35rem; }
.offers-progress-cycle-hint,
.offers-progress-ready {
  display: block;
  font-size: .72rem;
  line-height: 1.45;
  margin: .25rem 0 .35rem;
}
.offers-progress-cycle-hint { color: #64748b; }
.offers-progress-ready { color: #047857; font-weight: 600; }
.offers-progress-track {
  height: 6px;
  background: var(--primary-light);
  border-radius: 99px;
  overflow: hidden;
}
.offers-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  border-radius: 99px;
}
.offers-grant-status { font-size: .75rem; font-weight: 600; margin: .35rem 0 0; color: #15803d; }

.offers-promo-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.offers-card-promo {
  border-width: 1.5px;
  padding: 1rem 1rem .9rem;
}
.offers-card-global {
  border-color: rgba(22, 163, 74, .32);
  background: linear-gradient(180deg, rgba(236, 253, 245, .96), var(--surface));
}
.offers-card-referral { border-color: rgba(59, 130, 246, .24); }
.offers-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .45rem;
}
.offers-badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  background: var(--primary-light);
  color: var(--primary);
}
.offers-badge-hot {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}
.offers-disc-chip {
  font-size: .95rem;
  font-weight: 900;
  color: #7c2d12;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  padding: .2rem .58rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fffbeb, #facc15);
  border: 1px solid rgba(180, 83, 9, .22);
  box-shadow: 0 6px 16px rgba(180, 83, 9, .18);
  transform: translateZ(0);
}
.offers-card-highlight {
  font-size: .78rem;
  line-height: 1.55;
  margin: .35rem 0 .55rem;
  color: #475569;
}
.offers-card-highlight strong { color: #b45309; }
.offers-card-global .offers-badge-hot {
  background: linear-gradient(135deg, #dcfce7, #86efac);
  color: #166534;
}
.offers-card-global .offers-disc-chip {
  color: #14532d;
  background: linear-gradient(135deg, #ecfdf5, #22c55e);
  border-color: rgba(22, 163, 74, .24);
  box-shadow: 0 6px 16px rgba(22, 163, 74, .18);
}
.offers-card-global .offers-card-highlight strong { color: #15803d; }
.offers-card-highlight-success { color: #047857; font-weight: 700; }
.offers-countdown {
  margin: .55rem 0 .65rem;
  padding: .75rem .85rem .65rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(15, 31, 92, 0.08);
  box-shadow: 0 2px 10px rgba(15, 31, 92, 0.04);
  text-align: center;
}
.offers-countdown-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.offers-countdown-label {
  font-size: .72rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: -.01em;
}
.offers-countdown-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .28rem .55rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.offers-countdown-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
  unicode-bidi: embed;
  font-variant-numeric: tabular-nums;
  gap: .12rem;
}
.offers-countdown-part {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  min-width: 1.5ch;
  text-align: center;
}
.offers-countdown-sep {
  font-size: 1.15rem;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
  padding: 0 .38rem;
}
.offers-countdown.is-urgent {
  background: #fff;
  border-color: rgba(239, 68, 68, .35);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12), 0 4px 16px rgba(239, 68, 68, 0.1);
  animation: offers-urgent-pulse 1.1s ease-in-out infinite;
}
.offers-countdown.is-urgent .offers-countdown-label {
  color: #dc2626;
  font-weight: 800;
}
.offers-countdown.is-urgent .offers-countdown-part {
  color: #dc2626;
}
.offers-countdown.is-urgent .offers-countdown-sep {
  color: #f87171;
}
.offers-countdown.is-urgent .offers-countdown-timer {
  animation: offers-clock-shake 1.1s ease-in-out infinite;
}
.offers-countdown.is-expired { opacity: .72; }
.offers-countdown.is-expired .offers-countdown-part { color: #94a3b8; }
.offers-countdown-urgency {
  margin: .55rem 0 0;
  font-size: .7rem;
  line-height: 1.55;
  color: #64748b;
}
.offers-countdown.is-urgent .offers-countdown-urgency {
  color: #b91c1c;
  font-weight: 700;
}
@keyframes offers-urgent-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.28);
  }
  50% {
    transform: scale(1.012);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}
@keyframes offers-clock-shake {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.offers-btn-cta {
  width: 100%;
  margin-top: .15rem;
  padding: .62rem .85rem;
  font-size: .82rem;
  box-shadow: 0 8px 20px rgba(180, 83, 9, .18);
}

.trade-offer-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  font-size: .8rem;
  font-weight: 700;
  padding: .62rem .75rem;
  border: 1px solid rgba(217, 119, 6, .26);
  border-radius: 12px;
  margin-bottom: .65rem;
  line-height: 1.4;
  box-shadow: 0 8px 22px rgba(217, 119, 6, .16);
}
.trade-offer-banner strong {
  display: block;
  color: #78350f;
  font-size: .86rem;
  margin-bottom: .12rem;
}
.trade-profit-discount-note {
  display: block;
  margin-top: .22rem;
  color: #b45309;
  font-weight: 900;
}

/* ==================== کیف پول مشتری ==================== */
.wallet-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: .3rem 0 calc(.75rem + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.wallet-loading {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-weight: 600;
}

/* ---- نمای کلی ---- */
.wallet-overview { display: flex; flex-direction: column; gap: .65rem; }

.wallet-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
  align-items: stretch;
}

.wallet-card {
  border-radius: var(--radius);
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 5.4rem;
}

.wallet-card-core {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.wallet-card-rial {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: rgba(22,163,74,.2);
}

.wallet-card-rial-centered .wc-value-block-centered {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  min-height: 2rem;
}

.wallet-card-gold {
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border-color: rgba(180,83,9,.2);
}

.wc-label {
  font-size: .66rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 .3rem;
  min-height: 1.1rem;
  line-height: 1.1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.wc-value-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.wallet-card-rial-centered .wc-value-block-centered .wc-value {
  text-align: start;
  width: auto;
}

.wc-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--fg);
  direction: ltr;
  unicode-bidi: embed;
  font-variant-numeric: tabular-nums;
}

.wc-unit {
  font-size: .62rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: .15rem;
}

.wallet-card-rial .wc-value { color: #15803d; }
.wallet-card-gold .wc-value { color: var(--gold); }

.wallet-password-card {
  margin-top: .35rem;
  padding: .85rem .9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--primary-light);
}
.wallet-password-title {
  font-size: .82rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: .35rem;
}
.wallet-password-hint {
  font-size: .72rem;
  color: var(--muted);
  margin: 0 0 .65rem;
  line-height: 1.45;
}
.wallet-password-card .login-field { margin-bottom: .65rem; }
.wallet-pass-save {
  width: 100%;
  padding: .65rem;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
}

.wallet-charge-btn {
  width: 100%;
  padding: .85rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  background: var(--primary);
  color: #fff;
  transition: opacity .15s, transform .1s;
  touch-action: manipulation;
  min-height: 48px;
}
.wallet-charge-btn:active { transform: scale(.99); opacity: .88; }

.dep-list-title {
  font-size: .78rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 .15rem;
}

.wallet-history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  align-items: start;
}
.wallet-history-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.wallet-history-col .dep-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 720px) {
  .wallet-history-grid {
    grid-template-columns: 1fr;
  }
  .wallet-history-col .dep-list {
    max-height: none;
    overflow: visible;
  }
}

.dep-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.dep-row {
  display: grid;
  grid-template-columns: auto 1fr;
  direction: rtl;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.dep-row-right {
  grid-column: 1;
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .1rem;
  min-width: 0;
  text-align: right;
}

.dep-badge {
  grid-column: 2;
  justify-self: end;
  font-size: .68rem;
  font-weight: 700;
  padding: .22rem .55rem;
  border-radius: 999px;
}

.dep-amount {
  display: block;
  width: auto;
  max-width: 100%;
  font-weight: 800;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.dep-amount .money-rtl-line {
  display: inline-flex;
  direction: rtl;
  unicode-bidi: isolate;
  width: auto;
}
.dep-meta { font-size: .66rem; color: var(--muted); text-align: right; white-space: nowrap; }

.dep-pending  { background: #fef3c7; color: #b45309; }
.dep-approved { background: #dcfce7; color: #15803d; }
.dep-rejected { background: #fee2e2; color: #b91c1c; }

.wallet-empty {
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  padding: 1rem;
}

/* ---- مراحل wizard ---- */
.wallet-step {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: .15rem 0;
}

.wallet-step-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .1rem;
}

.wallet-step-header h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  color: var(--primary);
  flex: 1;
}

.wallet-back-btn {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  font-size: .78rem;
  padding: .35rem .7rem;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}
.wallet-back-btn:active { background: var(--primary-light); }
.wallet-back-link {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0.25rem 0;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--primary);
}
.wallet-back-link:active {
  background: transparent;
  opacity: 0.75;
}
.wallet-back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--primary-light);
  font-size: 1.1rem;
  line-height: 1;
}

.wallet-step-sub {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
}

.wallet-next-btn {
  width: 100%;
  padding: .85rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  background: var(--primary);
  color: #fff;
  transition: opacity .15s, transform .1s;
  touch-action: manipulation;
  min-height: 48px;
  margin-top: .3rem;
}
.wallet-next-btn:active { transform: scale(.99); opacity: .88; }
.wallet-next-btn:disabled { opacity: .4; cursor: default; transform: none; }

/* ---- ورود مبلغ ---- */
.amount-field-wrap {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.amount-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary);
}

.amount-input {
  width: 100%;
  border: 1.5px solid rgba(15, 31, 92, 0.22);
  border-radius: 12px;
  padding: .85rem 1rem;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  direction: ltr;
  color: var(--fg);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  font-variant-numeric: tabular-nums;
}
.amount-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 31, 92, 0.08);
  background: #fff;
}

.preset-row {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.preset-btn {
  border: 1px solid var(--border);
  background: rgba(15, 31, 92, 0.05);
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  font-size: .8rem;
  padding: .38rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  touch-action: manipulation;
  min-height: 34px;
}
.preset-btn:active { background: rgba(15, 31, 92, 0.1); }

/* ---- انتخاب بانک ---- */
.bank-cards-list { display: flex; flex-direction: column; gap: .35rem; }

.bank-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: .45rem .65rem;
  cursor: pointer;
  transition: border-color .15s, background .12s;
  touch-action: manipulation;
  width: 100%;
}
.bank-card:active { background: var(--primary-light); }
.bank-card-selected { border-color: var(--primary); background: rgba(15,31,92,.04); }

.bank-card-name {
  font-weight: 800;
  font-size: .82rem;
  color: var(--primary);
  margin-bottom: .2rem;
}

.bank-card-meta {
  font-size: .7rem;
  color: var(--muted);
  margin-bottom: .08rem;
  font-weight: 600;
}

.bank-card-details {
  margin-top: .22rem;
  display: flex;
  flex-direction: column;
  gap: .82rem;
  width: 100%;
}

.bank-copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  direction: rtl;
  align-items: center;
  width: 100%;
  gap: .65rem;
  font-size: .72rem;
  padding-block: .08rem;
}
.upload-bank-info .bank-copy-row + .bank-copy-row {
  margin-top: .35rem;
}
.bank-copy-label {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  grid-column: 1;
  justify-self: start;
}
.bank-copy-val-wrap {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: .28rem;
  grid-column: 2;
  justify-self: end;
  direction: ltr;
  text-align: left;
  max-width: 100%;
}
.bank-copy-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}
.bank-copy-tap {
  cursor: pointer;
  border-radius: 6px;
  padding: .12rem .22rem;
  margin: -.12rem -.22rem;
  -webkit-tap-highlight-color: transparent;
}
.bank-copy-tap:active { background: rgba(15, 31, 92, 0.06); }
.bank-copy-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: .28rem .52rem;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  touch-action: manipulation;
}
.bank-copy-btn:active { opacity: .88; }

.upload-copy-hint {
  font-size: .72rem;
  color: var(--muted);
  margin: .25rem 0 0;
}

.card-number {
  font-size: .88rem;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}

/* ---- آپلود رسید ---- */
.upload-bank-info {
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
}

.upload-bank-name {
  font-weight: 800;
  font-size: .95rem;
  color: var(--primary);
  margin-bottom: .5rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

.upload-bank-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  margin-bottom: .28rem;
  gap: .5rem;
}
.upload-bank-line span { color: var(--muted); font-weight: 600; }
.upload-bank-line strong { font-weight: 800; color: var(--fg); text-align: left; }

.upload-amount-line {
  margin-top: .4rem;
  padding-top: .4rem;
  border-top: 1px solid var(--border);
}
.upload-amount-line strong { color: #15803d; font-size: .92rem; }

/* ---- لایهٔ تمام‌صفحه هنگام آپلود رسید ---- */
.wallet-upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  background: rgba(10, 16, 40, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.wallet-upload-overlay-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.wallet-upload-overlay-card {
  width: min(340px, 100%);
  background: var(--surface);
  border-radius: 18px;
  padding: 1.35rem 1.25rem 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  text-align: center;
}
.wallet-upload-status-line {
  font-size: .92rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 1rem;
}
.wallet-upload-progress-row { margin-bottom: .25rem; }
.wallet-upload-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 31, 92, 0.09);
  overflow: hidden;
}
.wallet-upload-bar {
  height: 100%;
  width: 6%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1e3a8a, #3b82f6);
  transition: width .32s ease-out;
}
.wallet-upload-success-row {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  animation: wallet-upload-pop .45s ease;
}
.wallet-upload-check-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcfce7;
  border: 3px solid #15803d;
  display: grid;
  place-items: center;
}
.wallet-upload-check {
  font-size: 1.75rem;
  font-weight: 800;
  color: #15803d;
  line-height: 1;
}
.wallet-upload-done-msg {
  margin: 0;
  font-size: .88rem;
  font-weight: 700;
  color: var(--fg);
}
.wallet-upload-ack-btn {
  width: 100%;
  max-width: 260px;
  margin-top: .15rem;
  padding: .72rem 1rem;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  font-size: .88rem;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  touch-action: manipulation;
  box-shadow: var(--shadow);
}
.wallet-upload-ack-btn:active { opacity: .9; }
@keyframes wallet-upload-pop {
  0%   { transform: scale(.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.upload-area {
  border: 2px dashed rgba(15,31,92,.2);
  border-radius: var(--radius);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  cursor: default;
  transition: border-color .15s, background .12s, box-shadow .12s;
  overflow: hidden;
  touch-action: manipulation;
  margin-bottom: .55rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 22px rgba(15,31,92,.05);
}
.upload-area.upload-area-valid {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15);
}
.upload-area.upload-area-invalid {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}
.upload-area-title {
  margin: 0 0 .5rem;
  font-size: .92rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem .65rem;
}
.upload-area-hint {
  margin: 0 0 .65rem;
  font-size: .76rem;
  line-height: 1.55;
  color: var(--muted);
}
.upload-bank-info-compact {
  margin-top: .85rem;
  padding: .65rem .75rem;
}

.wallet-step > .upload-bank-info-compact {
  margin-top: 0;
  margin-bottom: .85rem;
}
.upload-bank-info-compact .upload-bank-name {
  margin-bottom: .35rem;
  padding-bottom: .3rem;
  font-size: .84rem;
}
.upload-bank-info-compact .upload-bank-line {
  font-size: .76rem;
  margin-bottom: .2rem;
}
.upload-bank-info-compact .upload-copy-hint {
  display: none;
}
.upload-bank-summary-label {
  margin: .85rem 0 .35rem;
  font-size: .78rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem .65rem;
}

.upload-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .55rem;
}

.upload-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
  width: 100%;
  padding: 0 .35rem .45rem;
}

.upload-action-btn {
  border: 1.5px solid var(--border);
  background: #ffffff;
  border-radius: 11px;
  padding: .58rem .45rem;
  font: inherit;
  font-weight: 800;
  font-size: .74rem;
  color: var(--primary);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}

.upload-action-btn:active {
  border-color: rgba(15, 31, 92, 0.35);
  background: var(--primary-light);
}

.upload-action-btn-camera {
  background: rgba(15, 31, 92, 0.06);
}

.upload-placeholder {
  text-align: center;
  padding: 1.5rem;
  color: #334155;
}
.upload-icon { font-size: 2rem; display: block; margin-bottom: .4rem; }
.upload-placeholder p,
.upload-placeholder-main { margin: 0 0 .25rem; font-size: .82rem; font-weight: 600; }
.upload-placeholder small,
.upload-placeholder-sub { font-size: .68rem; }

.upload-receipt-purpose {
  margin: .35rem 0 .55rem;
  padding: .55rem .65rem;
  border-radius: 10px;
  background: rgba(15, 31, 92, 0.06);
  border: 1px solid var(--border);
  font-size: .82rem;
  line-height: 1.55;
  color: var(--fg);
  text-align: center;
}
.upload-receipt-purpose strong {
  font-weight: 800;
  color: var(--primary);
}

.receipt-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
}

/* ---- تأیید ارسال ---- */
.wallet-submitted {
  text-align: center;
  padding: 2rem .5rem;
}
.submitted-icon { font-size: 3.5rem; margin-bottom: .75rem; }
.wallet-submitted h3 { margin: 0 0 .6rem; font-size: 1.1rem; color: var(--primary); }
.wallet-submitted p  { margin: 0 0 1.5rem; font-size: .84rem; color: var(--muted); line-height: 1.7; }

/* ==================== چاپ ==================== */
@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }
  .no-print, .bottom-nav, .nav-offers-fab, .customer-left-fabs, .top-bar { display: none !important; }
  /* جدول دفتر نباید مخفی شود؛ فقط اسکرول روی صفحه محدود می‌شود */
  .app-shell, .main-zone, .content-wrap, .inner, #tab-content, #ledger-wrap, .ledger-wrap {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .ledger-scroll {
    max-height: none !important;
    overflow: visible !important;
    border: 1px solid #d7dce8 !important;
    border-radius: 0 !important;
  }
  #reports-print-zone {
    width: 100%;
    direction: rtl;
    color: #111827;
  }
  #reports-print-zone .ledger-header {
    margin-bottom: 5mm;
    text-align: center;
  }
  #reports-print-zone .ledger-header h2 {
    font-size: 13pt !important;
  }
  #reports-print-zone .ledger-summary {
    margin-bottom: 5mm !important;
  }
  #reports-print-zone .ledger-box {
    box-shadow: none !important;
    border: 1px solid #d7dce8 !important;
    padding: 4mm 5mm !important;
  }
  #reports-print-zone .ledger-tbl {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    font-size: 7.5pt !important;
    border-collapse: collapse !important;
  }
  #reports-print-zone .ledger-tbl thead {
    display: table-header-group;
  }
  #reports-print-zone .ledger-tbl thead th {
    position: static !important;
    background: #eef2ff !important;
    color: #111827 !important;
    border: 1px solid #cbd5e1 !important;
    padding: 3px 4px !important;
    line-height: 1.25 !important;
  }
  #reports-print-zone .ledger-tbl tbody td {
    border: 1px solid #e5e7eb !important;
    padding: 3px 4px !important;
    line-height: 1.35 !important;
  }
  #reports-print-zone .ledger-tbl tbody tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  #reports-print-zone .td-desc {
    font-size: 7.2pt !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
  }
  #reports-print-zone .col-money,
  #reports-print-zone .col-num,
  #reports-print-zone .td-when {
    font-size: 7pt !important;
  }
  body { background: white !important; overflow: visible !important; margin: 0 !important; }
  html, body, #app { height: auto; }
  #tab-content { overflow: visible !important; max-height: none !important; }
  .ledger-wrap { overflow: visible !important; height: auto !important; min-height: 0 !important; }
}

/* ---- پاپ‌آپ اطلاع‌رسانی (مشتری) ---- */
.customer-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 31, 92, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 1;
  pointer-events: none;
}
.customer-popup-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.connection-status-bar {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  line-height: 1.4;
  transition: background 0.2s ease, color 0.2s ease;
}
.connection-status-bar.is-offline {
  background: #fef2f2;
  color: #b91c1c;
  border-bottom: 1px solid #fecaca;
}
.connection-status-bar.is-reconnected {
  background: #ecfdf5;
  color: #047857;
  border-bottom: 1px solid #a7f3d0;
}

/* کارت سفید متمرکز؛ دکمه بستن روی همان کارت */
.customer-popup-dialog {
  position: relative;
  max-width: 440px;
  width: 100%;
  max-height: min(82vh, 560px);
  overflow: auto;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 31, 92, 0.1);
  box-shadow:
    0 4px 6px rgba(15, 31, 92, 0.04),
    0 18px 48px rgba(15, 31, 92, 0.14);
  padding: 1.35rem 1.25rem 1.25rem;
  margin: 0;
}
.customer-popup-overlay.is-open .customer-popup-dialog {
  opacity: 1;
}

.customer-popup-title {
  margin: 0 0 0.85rem;
  padding-inline-end: 2.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.45;
}

.customer-popup-close {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 10px;
  background: #eef2fb;
  color: #475569;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.customer-popup-close:hover {
  background: #e2e8f7;
  color: var(--primary);
}

.customer-popup-body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.75;
  color: #1e293b;
  white-space: normal;
  word-break: break-word;
}
.customer-popup-body .faq-accordion,
.customer-popup-body .faq-accordion * {
  white-space: normal;
}

/* سازگاری با نام قدیمی کلاس */
.customer-popup-box {
  position: relative;
  max-width: 440px;
  width: 100%;
  max-height: min(82vh, 560px);
  overflow: auto;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 31, 92, 0.1);
  box-shadow: 0 18px 48px rgba(15, 31, 92, 0.14);
  padding: 1.35rem 1.25rem 1.25rem;
}

/* ---- فروشگاه محصولات (مشتری) — الهام از storefrontهای موبایل (ivoryglitch / e-commerce-ui) ---- */
:root {
  --shop-bg: #f4efe7;
  --shop-surface: #fffaf2;
  --shop-muted: #e9dfd1;
  --shop-text: #1e293b;
  --shop-text-muted: #64748b;
  --shop-gold: #b98a2f;
  --shop-gold-soft: rgba(185, 138, 47, 0.14);
  --shop-border: rgba(15, 31, 92, 0.1);
  --shop-shadow: 0 2px 12px rgba(15, 31, 92, 0.055);
  --shop-shadow-hover: 0 10px 28px rgba(15, 31, 92, 0.1);
  --shop-modal-backdrop: rgba(244, 239, 231, 0.92);
  --shop-modal-border: rgba(15, 31, 92, 0.12);
}

/* تب محصولات — پس‌زمینه گرم یکدست در کل لایه‌ها (جلوگیری از خاکستری --bg) */
html.mode-shop-tab,
body.mode-shop-tab {
  color-scheme: only light;
  background: var(--shop-bg) !important;
}

body.mode-shop-tab #app,
body.mode-shop-tab .app-shell,
body.mode-shop-tab .main-zone,
body.mode-shop-tab .content-wrap,
body.mode-shop-tab .inner,
body.mode-shop-tab #tab-content,
body.mode-shop-tab .top-bar,
body.mode-shop-tab .bottom-nav {
  background: var(--shop-bg) !important;
}

body.mode-shop-tab .main-zone {
  padding: 0 !important;
}

body.mode-shop-tab .inner {
  max-width: none;
  width: 100%;
}

.shop-shell {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--shop-bg);
  color-scheme: only light;
  forced-color-adjust: none;
  isolation: isolate;
}
.shop-render-reset {
  background: var(--shop-bg) !important;
}

.shop-scroll,
.shop-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  background: var(--shop-bg);
  /* -webkit-overflow-scrolling: touch حذف شد — روی iOS با overlay ثابت تداخل compositing دارد */
}

.shop-page {
  padding: 0.65rem 0.75rem calc(5.75rem + env(safe-area-inset-bottom, 0px));
  max-width: 1100px;
  margin: 0 auto;
  background: var(--shop-bg);
  color: var(--shop-text);
}

.shop-page-site-footer {
  margin-top: 1.35rem;
  padding-top: 0.35rem;
}
.shop-page-site-footer .site-footer {
  margin-top: 0;
  margin-bottom: 0.15rem;
}

.shop-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--shop-gold-soft);
}

.shop-page-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.shop-page-sub {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--shop-text-muted);
}

.shop-spot-chip {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
  border: 1px solid rgba(217, 119, 6, 0.2);
  white-space: nowrap;
}

/* اسکلتون لودینگ — همان رنگ صفحه تا پرش رنگ نداشته باشیم */
@keyframes shop-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.shop-loading-state { padding: 0.65rem 0.75rem 1rem; }

.shop-skeleton-hero,
.shop-skeleton-cats,
.shop-skeleton-card {
  border-radius: 16px;
  background: linear-gradient(90deg, var(--shop-muted) 25%, #f5f1ea 50%, var(--shop-muted) 75%);
  background-size: 200% 100%;
  animation: shop-shimmer 1.35s ease infinite;
}

.shop-skeleton-hero {
  aspect-ratio: 16 / 7;
  margin-bottom: 1rem;
}

.shop-skeleton-cats {
  height: 88px;
  margin-bottom: 1rem;
  border-radius: 14px;
}

.shop-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.shop-skeleton-card { aspect-ratio: 0.72; }

.shop-section { margin-bottom: 1.35rem; }
.shop-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.75rem;
}
.shop-section-head-no-wage {
  align-items: flex-start;
}
.shop-section-head-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.shop-sort-chip {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 0.4rem 0.75rem;
  font-family: "IRANYekan", Tahoma, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}
.shop-sort-chip-icon {
  display: inline-flex;
  color: #64748b;
}
.shop-sort-chip:active {
  transform: translateY(1px);
}
.shop-sort-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: "IRANYekan", Tahoma, system-ui, sans-serif;
}
.shop-sort-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.shop-sort-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
  animation: shop-sort-sheet-in 0.22s ease;
}
@keyframes shop-sort-sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.shop-sort-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 0.55rem auto 0.35rem;
}
.shop-sort-sheet-header {
  padding: 0.55rem 1rem 0.75rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
}
.shop-sort-sheet-list {
  padding: 0 1rem 0.85rem;
}
.shop-sort-sheet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: transparent;
  color: #334155;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 0.85rem 0;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  text-align: right;
}
.shop-sort-sheet-option:last-child {
  border-bottom: none;
}
.shop-sort-sheet-option.is-active {
  color: #0f766e;
  font-weight: 700;
}
.shop-see-all,
.shop-luxury-see-all {
  border: none;
  background: transparent;
  color: #92400e;
  font-family: "IRANYekan", Tahoma, system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  padding: 0.25rem 0;
  white-space: nowrap;
}
.shop-product-row-luxury .shop-see-all,
.shop-product-row-luxury .shop-luxury-see-all {
  color: #78350f;
}
.shop-product-row-luxury .shop-luxury-all-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  padding-inline: var(--shop-row-nav-inset);
  box-sizing: border-box;
}
@media (max-width: 520px) {
  .shop-product-row-luxury .shop-luxury-all-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.shop-sort-sheet-check {
  color: #0f766e;
  font-size: 0.95rem;
  font-weight: 900;
}
body.shop-sort-sheet-open {
  overflow: hidden;
}
.shop-product-row-no-wage .shop-sort-chip {
  border-color: rgba(22, 163, 74, 0.18);
  color: #166534;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.08);
}
.shop-product-row-no-wage .shop-sort-chip-icon {
  color: #16a34a;
}
.shop-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
  position: relative;
  padding-bottom: 0.35rem;
}
.shop-section-title::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--shop-gold), #f59e0b);
}
.shop-section-count, .shop-section-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--shop-gold-soft);
  color: #92400e;
}
.shop-section-badge { background: #dcfce7; color: #166534; }
.shop-section-subtitle {
  margin: 0.18rem 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #64748b;
  font-weight: 600;
}

.shop-empty {
  text-align: center;
  color: var(--shop-text-muted);
  font-size: 0.85rem;
  padding: 2rem 0;
  grid-column: 1 / -1;
}

.shop-hero { margin-bottom: 1rem; }
.shop-hero-frame {
  border-radius: 18px;
  overflow: hidden;
  background: var(--shop-muted);
  aspect-ratio: 16 / 7;
  box-shadow: var(--shop-shadow);
  border: 1px solid var(--shop-border);
}
.shop-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shop-hero-link { display: block; height: 100%; }
.shop-hero-dots { display: flex; justify-content: center; gap: 0.35rem; margin-top: 0.5rem; }
.shop-hero-dot {
  width: 7px; height: 7px; border-radius: 50%; border: none;
  background: #d4cbb8; padding: 0; cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.shop-hero-dot.active { background: var(--shop-gold); transform: scale(1.15); }

.shop-cat-slider {
  position: relative;
}
.shop-cat-grid {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0 2.75rem 0.25rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.shop-cat-grid::-webkit-scrollbar { display: none; }
.shop-cat-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  cursor: pointer;
  font-size: 0;
  padding: 0;
  transform: translateY(-50%);
}
.shop-cat-nav::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-top: 2px solid #333;
  border-right: 2px solid #333;
  margin: auto;
}
.shop-cat-prev { left: 0; }
.shop-cat-prev::after { transform: rotate(-135deg); }
.shop-cat-next { right: 0; }
.shop-cat-next::after { transform: rotate(45deg); }

.shop-cat-card {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: center;
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.shop-cat-circle {
  display: flex; align-items: center; justify-content: center;
  width: 62px; height: 62px;
  margin: 0 auto 0.3rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--shop-surface);
  border: 2px solid transparent;
  box-shadow: var(--shop-shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.shop-cat-card:hover .shop-cat-circle,
.shop-cat-card:focus-visible .shop-cat-circle {
  transform: scale(1.05);
  border-color: var(--shop-gold);
}
.shop-cat-card-active .shop-cat-circle {
  border-color: var(--shop-gold);
  box-shadow: 0 0 0 3px var(--shop-gold-soft);
}
.shop-cat-circle img { width: 100%; height: 100%; object-fit: cover; }
.shop-cat-all {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}
.shop-cat-name {
  display: block;
  font-size: 0.68rem;
  color: #475569;
  line-height: 1.3;
  max-width: 72px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-featured-track {
  display: flex; gap: 0.65rem; overflow-x: auto; padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.shop-featured-track .shop-product-card {
  flex: 0 0 42%; max-width: 160px; scroll-snap-align: start;
}
.shop-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}
@media (min-width: 480px) {
  .shop-product-grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .shop-skeleton-grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
}
@media (min-width: 768px) {
  .shop-product-grid { grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
  .shop-skeleton-grid { grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
  .shop-featured-track .shop-product-card { flex-basis: 28%; max-width: 200px; }
  .shop-hero-frame { aspect-ratio: 16 / 6; }
}

@media (max-width: 380px) {
  .shop-page { padding-inline: 0.55rem; padding-bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px)); }
  .shop-cat-circle { width: 56px; height: 56px; }
  .shop-featured-track .shop-product-card { flex: 0 0 58%; max-width: none; }
  .shop-product-name { font-size: 0.72rem; }
  .shop-skeleton-grid { grid-template-columns: repeat(2, 1fr); }
}
.shop-product-card {
  border: 1px solid var(--shop-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--shop-surface);
  cursor: pointer;
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
  box-shadow: var(--shop-shadow);
}
@media (hover: hover) and (pointer: fine) {
  .shop-product-card:hover {
    box-shadow: var(--shop-shadow-hover);
    transform: translateY(-3px);
    border-color: rgba(201, 162, 39, 0.45);
  }
  .shop-product-card:active { transform: translateY(-1px); }
}
.shop-product-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(180deg, #f8f3eb 0%, #f1eadf 100%);
  overflow: hidden;
  isolation: isolate;
  color-scheme: only light;
  -webkit-color-scheme: only light;
}
body.mode-shop-tab .shop-product-img-wrap {
  color-scheme: only light;
  -webkit-color-scheme: only light;
  background: linear-gradient(180deg, #f8f3eb 0%, #f1eadf 100%) !important;
}

.shop-product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  color-scheme: only light;
  -webkit-color-scheme: only light;
  filter: none !important;
  -webkit-filter: none !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  transition: none !important;
  transform: none !important;
  forced-color-adjust: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  background-color: #f6f0e8;
}
.shop-product-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(244, 239, 231, 0.10), rgba(226, 216, 202, 0.16)),
    radial-gradient(circle at 50% 100%, rgba(201, 162, 39, 0.06), transparent 42%);
  z-index: 1;
}
.shop-product-img-shade { display: none; }

/* سامسونگ / اندروید — فقط تصاویر محصول؛ بدون تغییر پس‌زمینه کل صفحه */
@media (prefers-color-scheme: dark) {
  html, body {
    color-scheme: only light !important;
    -webkit-color-scheme: only light !important;
  }
  .shop-product-img-wrap,
  .shop-product-img-wrap img,
  .shop-product-img-wrap-row,
  .shop-product-img-wrap-row img {
    color-scheme: only light !important;
    -webkit-color-scheme: only light !important;
    background-color: #f6f0e8 !important;
    filter: none !important;
    -webkit-filter: none !important;
    mix-blend-mode: normal !important;
    opacity: 1 !important;
  }
}
.shop-new-badge {
  position: absolute; top: 8px; inset-inline-end: 8px;
  z-index: 2;
  font-size: 0.6rem; font-weight: 900;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7d6 0%, #f5c861 42%, #b7791f 100%);
  color: #4a2c0a;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 18px rgba(180, 83, 9, 0.28), inset 0 1px 0 rgba(255,255,255,.7);
  letter-spacing: -0.01em;
}
.shop-disc-badge {
  position: absolute; top: 8px; inset-inline-start: 8px;
  z-index: 2;
  min-width: 34px; height: 34px; padding: 0 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; font-size: 0.6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.shop-product-body { padding: 0.55rem 0.6rem 0.65rem; background: var(--shop-surface); }
.shop-product-name {
  font-size: 0.74rem; font-weight: 700; color: #1e293b;
  line-height: 1.4; min-height: 2.05em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shop-product-meta {
  display: flex; flex-wrap: wrap; gap: 0.25rem 0.45rem;
  font-size: 0.64rem; color: #64748b; margin-top: 0.25rem;
}
.shop-profit-net { color: #334155; font-weight: 600; }
.shop-profit-sum {
  font-size: 0.58rem; font-weight: 700;
  color: #b45309; background: #fef3c7;
  padding: 0.05rem 0.35rem; border-radius: 999px;
}
.shop-product-wage { font-size: 0.64rem; color: #64748b; margin-top: 0.2rem; }
.shop-wage-lbl { font-weight: 600; color: #475569; }
.shop-no-wage { color: var(--primary); font-weight: 800; }
.shop-product-price {
  font-size: 0.78rem; font-weight: 800; margin-top: 0.35rem;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(201,162,39,0.08), transparent);
  padding: 0.15rem 0;
  border-radius: 6px;
}
.shop-in-cart-lbl {
  display: inline-block; margin-top: 0.3rem;
  font-size: 0.64rem; font-weight: 900; color: #047857;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  border: 1px solid rgba(5, 150, 105, 0.24);
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.12);
}

html[data-theme="dark"] .shop-in-cart-lbl {
  color: #dcfce7 !important;
  background: linear-gradient(135deg, #064e3b, #047857) !important;
  border: 1px solid rgba(134, 239, 172, 0.72);
  box-shadow: 0 0 0 1px rgba(5, 46, 22, 0.45), 0 5px 14px rgba(34, 197, 94, 0.22);
}

html[data-theme="dark"] .shop-cat-grid {
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 0.55rem 2.75rem 0.45rem;
}
html[data-theme="dark"] .shop-cat-nav {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(250, 204, 21, 0.28);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .shop-cat-nav::after {
  border-color: #fde68a;
}
html[data-theme="dark"] .shop-cat-circle {
  background: #1e293b !important;
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
html[data-theme="dark"] .shop-cat-all {
  color: #f8fafc !important;
  background: linear-gradient(135deg, #b7791f, #f5c861) !important;
}
html[data-theme="dark"] .shop-cat-name {
  color: #f8fafc !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .shop-cat-card-active .shop-cat-circle {
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18), 0 8px 22px rgba(0, 0, 0, 0.28);
}
.shop-cart-fab {
  position: relative;
  width: 100%;
  min-height: 3.35rem;
  padding: 0.45rem 0.35rem;
  border: none;
  border-radius: 16px;
  background: linear-gradient(160deg, #1e3a8a 0%, var(--primary) 55%, #0f1f5c 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(15, 31, 92, 0.35), inset 0 1px 0 rgba(255,255,255,.12);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.52rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  touch-action: manipulation;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.shop-cart-fab:active { transform: scale(0.94); }
.shop-cart-fab-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.shop-cart-fab-lbl { line-height: 1.1; text-align: center; }
.shop-cart-badge {
  position: absolute; top: -4px; inset-inline-end: -2px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 0.62rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--primary);
}
.shop-cart-backdrop, .shop-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: var(--shop-modal-backdrop);
  display: flex; align-items: flex-end; justify-content: center;
  color-scheme: only light;
  contain: layout paint;
}
.shop-cart-panel, .shop-modal {
  width: 100%; max-width: 480px; max-height: 92vh; overflow: auto;
  background: linear-gradient(180deg, #fffaf2 0%, #ffffff 100%); border-radius: 16px 16px 0 0;
  padding: 1rem 1rem 1.25rem;
  border: 1px solid var(--shop-modal-border);
  box-shadow: 0 -12px 34px rgba(15, 31, 92, 0.16);
  color-scheme: only light;
}
.shop-cart-panel {
  background:
    radial-gradient(circle at top right, rgba(201, 162, 39, 0.2), transparent 34%),
    linear-gradient(180deg, #fff7df 0%, #fffaf0 46%, #ffffff 100%);
  border-color: rgba(201, 162, 39, 0.34);
  box-shadow: 0 18px 48px rgba(120, 53, 15, 0.22);
}
@media (min-width: 640px) {
  .shop-cart-backdrop, .shop-modal-backdrop { align-items: center; padding: 1rem; }
  .shop-cart-panel, .shop-modal { border-radius: 16px; }
}
.shop-cart-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(15, 31, 92, 0.08);
}
.shop-cart-head h2, .shop-modal-title {
  margin: 0; font-size: 1rem; color: var(--primary);
}
.shop-cart-close, .shop-modal-close {
  border: none; background: #eef2fb; width: 2rem; height: 2rem;
  border-radius: 8px; font-size: 1.25rem; cursor: pointer; color: #475569;
}
.shop-cart-item {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.65rem; border: 1px solid #eef2f6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 31, 92, 0.055);
  margin-bottom: 0.5rem;
}
.shop-cart-item-info { flex: 1; min-width: 0; }
.shop-cart-notices {
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.shop-cart-notice {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: #9a3412;
}
.shop-cart-notice + .shop-cart-notice { margin-top: 0.35rem; }
.shop-cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.12rem;
}
.shop-cart-qty-btn {
  width: 1.65rem;
  height: 1.65rem;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.shop-cart-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.shop-cart-qty-btn:not(:disabled):active { background: var(--primary-light); }
.shop-cart-qty-val {
  min-width: 1.25rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
}
.shop-cart-item img {
  width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #f1f5f9;
}
.shop-cart-item-name { font-size: 0.82rem; font-weight: 600; }
.shop-cart-item-meta { font-size: 0.72rem; color: #64748b; margin-top: 0.15rem; }
.shop-cart-remove {
  flex-shrink: 0;
  border: none; background: transparent;
  color: #94a3b8; font-size: 1.25rem; cursor: pointer;
  padding: 0.15rem 0.25rem;
}
.shop-cart-summary {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #eef2f6;
  border-radius: 14px;
  background: #f8fafc;
}
.shop-cart-sum-row {
  display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.82rem; margin-bottom: 0.42rem;
  align-items: center;
}
.shop-ok { color: #059669; }
.shop-bad { color: #dc2626; }
.shop-shortfall { color: #dc2626; font-size: 0.78rem; margin: 0.25rem 0 0.5rem; }
.shop-cart-actions { margin-top: 0.75rem; }
.shop-cart-actions .trade-profit-tier-hint { display: none; }
.shop-block-wrap { border-radius: 0; }
.shop-cart-pay-btn, .shop-cart-topup-btn, .shop-add-cart-btn {
  width: 100%; border: none; border-radius: 10px; padding: 0.75rem;
  font-family: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.shop-cart-pay-btn, .shop-add-cart-btn { background: var(--primary); color: #fff; }
.shop-cart-topup-btn { background: #eef2fb; color: var(--primary); }
.shop-product-modal {
  background:
    linear-gradient(180deg, #fffaf2 0%, #ffffff 62%),
    var(--shop-surface);
}
.shop-modal-img-frame {
  position: relative;
  width: 100%;
  max-height: 232px;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(15, 31, 92, 0.08);
  margin-bottom: 0.75rem;
  isolation: isolate;
}
.shop-modal-img {
  width: 100%;
  height: min(232px, 52vw);
  max-height: 232px;
  object-fit: contain;
  display: block;
  filter: none !important;
  -webkit-filter: none !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  transition: none !important;
  transform: none !important;
  background: transparent;
}
.shop-modal-sub { font-size: 0.82rem; color: #64748b; margin: 0.25rem 0 0.75rem; }
.shop-modal-img-zoomable { cursor: zoom-in; }
.shop-modal-thumb-row {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.35rem 0 0;
  scrollbar-width: none;
}
.shop-modal-thumb-row::-webkit-scrollbar { display: none; }
.shop-modal-thumb {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}
.shop-modal-thumb.is-active { border-color: var(--primary); }
.shop-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shop-bd-live-spot-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.shop-live-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: shop-live-pulse 1.4s ease-in-out infinite;
}
@keyframes shop-live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  50% { opacity: 0.55; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
.shop-bd-section-weights-compact .shop-bd-section-title { display: none; }
.shop-gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(2, 6, 23, 0.82);
  color-scheme: only light;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
}
.shop-gallery-viewer {
  display: flex;
  flex-direction: column;
  width: min(94vw, 680px);
  height: min(78vh, 760px);
  max-height: calc(100dvh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.38);
  position: relative;
}
.shop-gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.45rem 0.55rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
  border-bottom: 1px solid rgba(15, 31, 92, 0.08);
  flex-shrink: 0;
  z-index: 5;
}
.shop-gallery-close {
  position: static;
  width: 2.35rem;
  height: 2.35rem;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}
.shop-gallery-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.65rem 0.75rem 0.45rem;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #f8fafc;
}
.shop-gallery-main {
  max-width: min(100%, 560px);
  max-height: min(68vh, 620px);
  width: auto;
  height: auto;
  object-fit: contain;
  touch-action: pinch-zoom;
}
.shop-gallery-footer {
  padding: 0.5rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eef2f6;
}
.shop-gallery-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
  margin-bottom: 0.45rem;
}
.shop-gallery-thumb-row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.shop-gallery-thumb-row::-webkit-scrollbar { display: none; }
.shop-gallery-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.shop-gallery-thumb.is-active { border-color: var(--primary); }
.shop-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-gallery-viewer--grid .shop-gallery-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0.75rem 0.5rem;
}
.shop-gallery-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e293b;
}
.shop-gallery-title span { color: #64748b; font-weight: 600; margin-inline-start: 0.35rem; }
.shop-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.65rem;
  overflow-y: auto;
}
.shop-gallery-grid-item {
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
  aspect-ratio: 1;
}
.shop-gallery-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.site-footer-root:not([hidden]) {
  display: block;
}
.site-footer-root[hidden] {
  display: none !important;
}
.site-footer {
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  padding: 1.15rem 0.85rem 0.75rem;
  border-top: 1px solid rgba(15, 31, 92, 0.1);
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.65), rgba(244, 239, 231, 0.95));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}
body.mode-shop-tab .site-footer {
  border-top-color: rgba(185, 138, 47, 0.18);
}
.site-footer-logo {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(15, 31, 92, 0.12);
}
.site-footer-logo-fallback {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
}
.site-footer-address {
  margin: 0;
  max-width: 22rem;
  font-size: 0.74rem;
  line-height: 1.65;
  color: #475569;
}
.site-footer-phones,
.contact-panel-phone-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}
.contact-phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 31, 92, 0.12);
  background: #fff;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(15, 31, 92, 0.06);
  transition: background .15s, color .15s, transform .12s;
}
.contact-phone-chip svg { flex: 0 0 auto; opacity: 0.85; }
.contact-phone-chip:active { transform: scale(.98); }
.contact-phone-chip:hover {
  background: var(--primary);
  color: #fff;
}
.site-footer-social,
.contact-panel-social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}
.site-footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(15, 31, 92, 0.12);
  background: #fff;
  color: var(--primary);
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(15, 31, 92, 0.08);
  transition: transform .14s, background .14s, color .14s, box-shadow .14s;
}
.site-footer-social-icon:hover {
  transform: translateY(-2px);
  color: #fff;
}
.site-footer-social-instagram:hover { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); border-color: transparent; }
.site-footer-social-whatsapp { color: #25d366; }
.site-footer-social-whatsapp:hover { background: #25d366; border-color: transparent; }
.site-footer-social-bale { color: #12bfa0; }
.site-footer-social-bale:hover { background: rgba(18, 191, 160, 0.12); border-color: rgba(18, 191, 160, 0.35); }
.site-footer-social-telegram:hover { background: #0088cc; border-color: transparent; }
.site-footer-social-link:hover { background: var(--primary); border-color: transparent; }
.site-footer-credit {
  margin: -0.1rem 0 0;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.7;
}
.site-footer-credit a {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}
.site-footer-credit a:hover { text-decoration: underline; }

.contact-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: right;
}
.contact-panel-title {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
}
.contact-panel-about {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(180, 83, 9, 0.18);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background:
    radial-gradient(circle at 12% 10%, rgba(250, 204, 21, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(255, 251, 235, 0.94), rgba(255, 255, 255, 0.98));
  color: #334155;
  box-shadow: 0 10px 28px rgba(146, 64, 14, 0.08);
}
.contact-panel-about strong {
  display: block;
  margin-bottom: 0.5rem;
  color: #92400e;
  font-size: 0.92rem;
  line-height: 1.7;
}
.contact-panel-about p {
  margin: 0.34rem 0;
  font-size: 0.8rem;
  line-height: 1.85;
}
.contact-panel-about b {
  color: #0f1f5c;
}
.contact-panel-address {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(15, 31, 92, 0.04);
  font-size: 0.82rem;
  line-height: 1.65;
  color: #334155;
}
html[data-theme="dark"] .contact-panel-about {
  background:
    radial-gradient(circle at 12% 10%, rgba(250, 204, 21, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
  border-color: rgba(250, 204, 21, 0.24);
  color: #e2e8f0;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .contact-panel-about strong {
  color: #facc15;
}
html[data-theme="dark"] .contact-panel-about b {
  color: #bfdbfe;
}
html[data-theme="dark"] .contact-panel-address {
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
}
.contact-panel-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.35rem;
}
.contact-panel-phones,
.contact-panel-social {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.shop-price-breakdown {
  border: 1px solid #eef2f6; border-radius: 10px; padding: 0.65rem 0.75rem; margin-bottom: 0.85rem;
}
.shop-bd-row {
  display: flex; justify-content: space-between; font-size: 0.78rem; padding: 0.25rem 0;
}
.shop-bd-value-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.08rem;
  text-align: left;
}
.shop-bd-value-stack small {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
}
.shop-bd-value-stack strong {
  color: var(--primary);
  font-size: 0.8rem;
}
.shop-bd-final-weight span:last-child { color: var(--primary); font-weight: 700; }
.shop-bd-total {
  font-weight: 700; border-top: 1px solid #eef2f6;
  margin-top: 0.35rem; padding-top: 0.45rem; color: var(--primary);
}
.shop-purch-list { margin-top: 0.35rem; display: grid; gap: 0.55rem; }
.shop-purch-row { color: inherit; }
.shop-purch-name { font-size: 0.82rem; font-weight: 600; }
.shop-purch-meta { font-size: 0.72rem; color: #64748b; }

/* Swiper hero */
.shop-hero-swiper { border-radius: 18px; overflow: hidden; position: relative; }
.shop-hero-swiper .swiper-slide { height: auto; }
.shop-hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.92); box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  cursor: pointer; font-size: 0; padding: 0;
}
.shop-hero-nav::after {
  content: ''; display: block; width: 8px; height: 8px;
  border-top: 2px solid #333; border-right: 2px solid #333; margin: auto;
}
.shop-hero-prev { left: 10px; }
.shop-hero-prev::after { transform: rotate(-135deg); }
.shop-hero-next { right: 10px; }
.shop-hero-next::after { transform: rotate(45deg); }

/* Campaign / product row */
.shop-campaign {
  border-radius: 14px; padding: 0.85rem 0.65rem 1rem; margin-bottom: 0.75rem;
  color: #fff;
}
.shop-campaign-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.65rem; padding: 0 0.35rem;
}
.shop-campaign-title { font-size: 0.95rem; font-weight: 800; margin: 0; color: #fff; }
.shop-campaign-timer {
  display: flex; align-items: center; gap: 0.25rem;
  font-size: 0.78rem; font-weight: 700; direction: ltr;
}
.shop-cd-part { display: flex; flex-direction: column; align-items: center; min-width: 2rem; }
.shop-cd-part small { font-size: 0.55rem; font-weight: 500; opacity: 0.85; }
.shop-cd-sep { opacity: 0.7; padding-bottom: 0.5rem; }
.shop-cart-sum-highlight { font-weight: 700; }
.shop-cart-sum-highlight span:last-child { color: var(--primary); }
.shop-grapes-body { width: 100%; }
.shop-layout-custom { display: none !important; }
.wallet-min-gold-hint {
  margin: 0.55rem 0 0;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.7;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: .45rem .65rem;
}
.wallet-min-gold-hint strong { color: var(--primary); }
.wallet-amount-error {
  margin: .45rem 0 0;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: .45rem .65rem;
  font-size: .78rem;
  font-weight: 800;
}

.shop-product-row-white {
  background: #fff; border-radius: 12px; padding: 0.75rem 0.5rem;
  border: 1px solid var(--shop-border, #e8e2d8); margin-bottom: 0.65rem;
}
.shop-product-row-luxury,
.shop-product-row-no-wage {
  --shop-row-pad-x: 0.75rem;
  --shop-row-nav-inset: calc(36px + 0.35rem);
  padding-inline: var(--shop-row-pad-x);
  box-sizing: border-box;
}
.shop-product-row-no-wage {
  position: relative;
  overflow: hidden;
  padding-block: 0.9rem 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background:
    radial-gradient(circle at 8% 0%, rgba(220, 252, 231, 0.95), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f0fdf4 55%, #ecfdf5 100%);
  box-shadow: 0 10px 28px rgba(22, 163, 74, 0.1);
}
.shop-product-row-no-wage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.55) 45%, transparent 70%);
  opacity: 0.6;
}
.shop-product-row-no-wage > * { position: relative; z-index: 1; }
.shop-product-row-no-wage .shop-section-title {
  color: #14532d;
  font-size: 1rem;
}
.shop-product-row-no-wage .shop-section-title::before {
  content: '✦';
  display: inline-block;
  margin-inline-end: 0.35rem;
  color: #16a34a;
  font-size: 0.85rem;
}
.shop-product-row-no-wage .shop-section-title::after {
  background: linear-gradient(90deg, #16a34a, #86efac, transparent);
}
.shop-product-row-no-wage .shop-section-subtitle {
  color: #15803d;
  font-weight: 600;
}
.shop-product-row-no-wage .shop-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.shop-product-row-no-wage .shop-no-wage-section-body {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-inline: var(--shop-row-nav-inset);
}
.shop-product-row-no-wage .shop-product-card {
  border-color: rgba(34, 197, 94, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(22, 163, 74, 0.1);
}
.shop-product-row-no-wage .shop-product-img-wrap {
  border-bottom: 1px solid rgba(34, 197, 94, 0.12);
}
.shop-product-row-no-wage .shop-product-name {
  color: #14532d;
}
.shop-product-row-no-wage .shop-product-price {
  color: #166534;
  font-weight: 800;
}
.shop-product-row-no-wage .shop-product-row-track-paged {
  flex-wrap: wrap;
  overflow: visible;
  padding-bottom: 0;
}
.shop-product-row-no-wage .shop-product-row-track-paged .shop-product-card-row {
  flex: 0 0 calc((100% - 1rem) / 3);
  min-width: calc((100% - 1rem) / 3);
  max-width: calc((100% - 1rem) / 3);
}
.shop-no-wage-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 0.85rem;
}
.shop-no-wage-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: #166534;
  padding: 0.55rem 1.15rem;
  font-family: "IRANYekan", Tahoma, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.12);
}
.shop-no-wage-more:active {
  transform: translateY(1px);
}
.shop-product-grid-paged .shop-product-card[hidden] {
  display: none;
}
.shop-product-row-luxury {
  position: relative;
  overflow: hidden;
  padding-block: 1.05rem 0.95rem;
  border-radius: 20px;
  border: 1px solid rgba(201, 162, 39, 0.42);
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 0.82), transparent 34%),
    radial-gradient(ellipse at 86% 95%, rgba(251, 191, 36, 0.14), transparent 42%),
    linear-gradient(145deg, #fffaf0 0%, #f6e7c3 38%, #ead3a6 68%, #fdf7e8 100%);
  box-shadow:
    0 14px 32px rgba(146, 64, 14, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.shop-product-row-luxury::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.35) 38%, transparent 60%),
    radial-gradient(circle at 78% 12%, rgba(251, 191, 36, 0.16), transparent 34%);
  opacity: 0.68;
  animation: shop-luxury-shimmer 6s ease-in-out infinite;
}
.shop-product-row-luxury::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 19px;
  pointer-events: none;
  border: 1px solid rgba(180, 83, 9, 0.10);
}
@keyframes shop-luxury-shimmer {
  0%, 100% { opacity: 0.55; transform: translateX(0); }
  50% { opacity: 0.95; transform: translateX(2%); }
}
.shop-product-row-luxury > * {
  position: relative;
  z-index: 1;
}
.shop-product-row-luxury .shop-section-title {
  color: #78350f;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
.shop-product-row-luxury .shop-section-title::before {
  content: 'VIP';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-end: 0.45rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde68a, #d97706);
  color: #451a03;
  font-size: 0.62rem;
  font-weight: 900;
  vertical-align: middle;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.shop-product-row-luxury .shop-section-title::after {
  background: linear-gradient(90deg, #fde68a, #f59e0b, transparent);
}
.shop-product-row-luxury .shop-section-subtitle {
  color: #92400e;
}
.shop-product-row-luxury .shop-prod-nav {
  background: rgba(255, 251, 235, 0.92);
  border-color: rgba(251, 191, 36, 0.45);
  color: #78350f;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.shop-product-row-luxury .shop-product-card-row {
  border-color: rgba(180, 83, 9, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 251, 235, 0.94) 100%);
  border-radius: 15px;
  box-shadow:
    0 10px 24px rgba(146, 64, 14, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.shop-product-row-luxury .shop-product-name {
  color: #451a03;
  font-weight: 800;
}
.shop-product-row-luxury .shop-product-meta-row,
.shop-product-row-luxury .shop-product-meta {
  color: #92400e;
}
.shop-product-row-luxury .shop-product-price {
  color: #78350f;
  font-weight: 900;
}
.shop-product-row-luxury .shop-new-badge {
  background: linear-gradient(135deg, #451a03, #b45309);
  color: #fef3c7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.shop-product-row-slider {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  padding: 0;
  box-sizing: border-box;
  direction: ltr;
}
.shop-product-row-slider-no-nav {
  display: block;
  direction: rtl;
}
.shop-product-row-slider .shop-prod-nav {
  position: static;
  top: auto;
  transform: none;
  z-index: 2;
  justify-self: center;
}
.shop-product-row-slider .shop-prod-prev {
  grid-column: 1;
}
.shop-product-row-slider .shop-prod-prev::after {
  transform: rotate(-135deg);
}
.shop-product-row-slider .shop-product-row-track {
  grid-column: 2;
  direction: rtl;
  min-width: 0;
}
.shop-product-row-slider .shop-prod-next {
  grid-column: 3;
}
.shop-product-row-slider .shop-prod-next::after {
  transform: rotate(45deg);
}
.shop-product-row-track {
  display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.shop-product-row-track::-webkit-scrollbar { display: none; }
.shop-product-row-track-carousel .shop-product-card-row {
  flex: 0 0 calc((100% - 1rem) / 3);
  min-width: calc((100% - 1rem) / 3);
  max-width: calc((100% - 1rem) / 3);
  scroll-snap-align: start;
}
@media (max-width: 520px) {
  .shop-product-row-no-wage .shop-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shop-product-row-no-wage .shop-product-row-track-paged .shop-product-card-row {
    flex-basis: calc((100% - 0.5rem) / 2);
    min-width: calc((100% - 0.5rem) / 2);
    max-width: calc((100% - 0.5rem) / 2);
  }
  .shop-product-row-track-carousel .shop-product-card-row {
    flex: 0 0 calc((100% - 0.5rem) / 2);
    min-width: calc((100% - 0.5rem) / 2);
    max-width: calc((100% - 0.5rem) / 2);
  }
}
.shop-product-card-row {
  flex: 0 0 140px; min-width: 140px; scroll-snap-align: start;
  background: var(--shop-surface); border: 1px solid var(--shop-border); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
}
.shop-product-img-wrap-row { aspect-ratio: 1; max-height: 110px; }
.shop-product-body-row { padding: 0.45rem 0.5rem 0.55rem; flex: 1; display: flex; flex-direction: column; gap: 0.2rem; }
.shop-product-meta-row { font-size: 0.62rem; color: #64748b; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.shop-campaign .shop-product-card-row { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.95); }
.shop-campaign .shop-product-name { color: #1f2937; }
.shop-product-price-disc { display: flex; flex-direction: column; gap: 0.1rem; }
.shop-price-old { font-size: 0.68rem; color: #94a3b8; text-decoration: line-through; }
.shop-price-new { font-size: 0.82rem; font-weight: 800; color: #dc2626; }
.shop-disc-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  background: #dc2626; color: #fff; font-size: 0.62rem; font-weight: 700;
  padding: 0.12rem 0.35rem; border-radius: 4px;
}

.shop-inline-banner-wrap { margin: 0 0.65rem; }
.shop-inline-banner-link { display: block; }
.shop-inline-banner-img {
  width: 100%; aspect-ratio: 5 / 2; object-fit: cover;
  border-radius: 8px; border: 1px solid rgba(12,12,12,0.07);
}

.shop-cart-item-quote { font-size: 0.68rem; color: #059669; margin-top: 0.15rem; }
.shop-cart-topup-secondary { margin-top: 0.45rem; background: #fff7ed; color: #c2410c; }

.shop-holding-list { margin-top: 0.35rem; display: grid; gap: 0.55rem; }
.shop-holding-row { color: inherit; }
.shop-holding-thumb { object-fit: cover; background: #f1f5f9; }
.shop-holding-info { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; }
.shop-holding-name { font-size: 0.82rem; font-weight: 600; color: inherit; }
.shop-holding-meta { font-size: 0.72rem; color: #64748b; }

.wallet-product-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.68rem;
  border: 1px solid #e8eef7;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 8px 22px rgba(15, 31, 92, 0.06);
  cursor: pointer;
  text-align: right;
  font-family: inherit;
}
.wallet-product-card:active { transform: scale(0.995); }
.wallet-product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: #f1f5f9;
  flex: 0 0 auto;
}
.wallet-product-thumb-empty {
  display: grid;
  place-items: center;
  color: #94a3b8;
}
.wallet-product-info { display: flex; flex-direction: column; gap: 0.14rem; flex: 1; min-width: 0; }
.wallet-product-chevron { color: #94a3b8; font-size: 1.4rem; transform: rotate(180deg); }
.wallet-product-delivered,
.wallet-product-status,
.wallet-product-delivered-modal {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.18rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
}
.wallet-product-status-pending { background: #fff7ed; color: #c2410c; }
.wallet-product-status-approved { background: #ecfdf5; color: #047857; }
.wallet-product-status-rejected { background: #fef2f2; color: #b91c1c; }
.wallet-product-kind {
  display: inline-flex;
  vertical-align: middle;
  margin-inline-start: .2rem;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 700;
  padding: .08rem .38rem;
  line-height: 1.2;
}
.wallet-product-kind-vitrine { background: #fef3c7; color: #b45309; }
.wallet-product-kind-nowage { background: #ecfdf5; color: #047857; }
.wallet-product-vitrine-note {
  margin: .35rem 0 0;
  font-size: .72rem;
  color: #b45309;
  font-weight: 600;
}
.wallet-empty-card {
  width: 100%;
  min-height: 70px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  font-family: inherit;
  cursor: pointer;
}
.wallet-product-modal-kicker { color: #64748b; font-size: 0.72rem; font-weight: 700; }
.wallet-product-price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font-size: 0.8rem;
}

/* ==================== آموزش اولیه (Onboarding) ==================== */
body.onboarding-active { overflow: hidden; }

.onboarding-root {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}
.onboarding-root:not([hidden]) {
  pointer-events: auto;
}

.onboarding-hole {
  position: fixed;
  z-index: 1101;
  pointer-events: none;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(10, 16, 40, 0.55);
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.onboarding-card {
  position: fixed;
  z-index: 1102;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100vw - 2rem));
  background: #fff;
  border-radius: 16px;
  padding: 0.85rem 1rem 0.9rem;
  box-shadow: 0 12px 40px rgba(15, 31, 92, 0.22);
  direction: rtl;
  text-align: right;
}

.onboarding-progress {
  font-size: 0.68rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.onboarding-title {
  margin: 0 0 0.32rem;
  font-size: 0.94rem;
  font-weight: 800;
  color: #0f172a;
}

.onboarding-body {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #475569;
}
.onboarding-body p {
  margin: 0 0 0.28rem;
}
.onboarding-points {
  margin: 0;
  padding: 0 1.05rem 0 0;
}
.onboarding-points li {
  margin: 0.12rem 0;
}

.onboarding-hint {
  display: none;
  margin: 0;
}

.onboarding-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.onboarding-skip {
  align-self: flex-start;
  font: inherit;
  font-size: 0.76rem;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.onboarding-skip:hover { color: #334155; }

.onboarding-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.onboarding-back,
.onboarding-next {
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: none;
}

.onboarding-back {
  background: #f1f5f9;
  color: #334155;
}
.onboarding-back:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.onboarding-next {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  min-width: 5.5rem;
}
.onboarding-next:hover { filter: brightness(1.05); }

body.mode-wallet-tab #nav-offers-fab {
  display: none !important;
}

body.onboarding-active .customer-left-fabs {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
body.onboarding-active.onboarding-show-offers-fab .customer-left-fabs {
  opacity: 1;
  pointer-events: auto;
}

/* آموزش اولیه — بهینه موبایل (اکثر مشتریان) */
@media (max-width: 768px) {
  body.onboarding-active {
    touch-action: none;
  }

  .onboarding-card--sheet {
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 18px 18px 0 0;
    padding: 0.55rem 0.85rem calc(0.62rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 36px rgba(15, 31, 92, 0.2);
    max-height: none;
    overflow: visible;
  }

  .onboarding-card--sheet::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 99px;
    margin: 0 auto 0.38rem;
  }

  .onboarding-card--nav-step .onboarding-hint {
    display: block;
    margin: 0.3rem 0 0;
    padding: 0.34rem 0.45rem;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.08);
    font-size: 0.72rem;
    font-weight: 700;
    color: #1d4ed8;
    line-height: 1.35;
  }

  .onboarding-hole--pulse {
    outline: 2px solid rgba(37, 99, 235, 0.9);
    outline-offset: 2px;
    animation: onboarding-pulse 1.35s ease-in-out infinite;
  }

  .onboarding-hole--nav.onboarding-hole--pulse {
    outline-color: rgba(37, 99, 235, 0.95);
    animation-duration: 1.1s;
  }

  @keyframes onboarding-pulse {
    0%, 100% { outline-color: rgba(37, 99, 235, 0.95); }
    50% { outline-color: rgba(37, 99, 235, 0.25); }
  }

  .onboarding-nav {
    flex: 1;
  }

  .onboarding-back,
  .onboarding-next {
    min-height: 44px;
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
  }

  .onboarding-skip {
    min-height: 32px;
    padding: 0.2rem 0;
    white-space: nowrap;
  }

  .onboarding-title {
    font-size: 0.88rem;
  }

  .onboarding-body {
    font-size: 0.76rem;
    line-height: 1.38;
    margin-bottom: 0.42rem;
  }

  .onboarding-body p {
    margin-bottom: 0.22rem;
  }

  .onboarding-points li {
    margin: 0.08rem 0;
  }
}

/* ---- toast / پشتیبانی / راهنمای بخش‌ها ---- */
.app-toast {
  position: fixed;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 420px);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.82rem;
  line-height: 1.45;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}
.app-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.app-toast-error { background: #7f1d1d; }

.header-support-wrap { position: relative; z-index: 3101; }
.header-support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
}
.header-support-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 11rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15,23,42,0.18);
  padding: 0.35rem;
  z-index: 3102;
}
.header-support-item {
  display: block;
  width: 100%;
  text-align: right;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font: inherit;
  color: #1e293b;
  cursor: pointer;
}
.header-support-item:hover { background: #f1f5f9; }

.section-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-inline-start: 0.35rem;
  padding: 0;
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff 0%, #f5f3ff 100%);
  color: #6366f1;
  vertical-align: middle;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.12);
}
.section-info-btn:hover {
  background: #eef2ff;
  border-color: rgba(99, 102, 241, 0.45);
  transform: scale(1.04);
}
.section-info-btn:active { transform: scale(0.97); }
.section-info-icon { display: block; }

.faq-accordion {
  display: flex;
  flex-direction: column;
  margin-top: 0.15rem;
  border: 1px solid #e8ecf4;
  border-radius: 10px;
  overflow: hidden;
  background: #fafbfc;
}
.faq-accordion-item {
  border: 0;
  border-bottom: 1px solid #e8ecf4;
  background: transparent;
}
.faq-accordion-item:last-child { border-bottom: 0; }
.faq-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  padding: 0 0.85rem;
  border: 0;
  background: transparent;
  text-align: right;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
}
.faq-accordion-trigger:hover { background: #f1f5f9; }
.faq-accordion-q { flex: 1; line-height: 1.45; }
.faq-accordion-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: -0.15rem;
}
.faq-accordion-item.is-open .faq-accordion-chevron {
  transform: rotate(-135deg);
  margin-top: 0.1rem;
}
.faq-accordion-panel {
  display: block;
  max-height: 0;
  overflow: hidden;
  padding: 0 0.85rem;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease, visibility 0.2s ease;
}
.faq-accordion-item:not(.is-open) .faq-accordion-panel {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.faq-accordion-item.is-open .faq-accordion-panel {
  max-height: 24rem;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  padding: 0.35rem 0.85rem 0.85rem;
  border-top: 1px solid rgba(226, 232, 240, 0.75);
  background: #fff;
}
.faq-accordion-a {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #475569;
  font-weight: 400;
}
.support-rules-box {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid #e8ecf4;
  border-radius: 12px;
  background: #fafbfc;
  white-space: pre-wrap;
}
.support-rules-box p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.75;
  color: #475569;
}
.support-rules-box strong {
  color: var(--primary);
  margin-inline-end: 0.25rem;
}

.cell-hit-sell-empty {
  cursor: pointer;
  opacity: 0.92;
}
.cell-hit-sell-empty:active {
  transform: scale(0.98);
}
.cell-sell .cell-hit-sell-empty {
  background: rgba(220, 38, 38, 0.1);
}

.tab-section-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.15rem 0 0.35rem;
}
.tab-section-head-spacer { flex: 1; }

.login-otp-loading {
  text-align: center;
  font-size: 0.82rem;
  color: #6366f1;
  margin: 0.25rem 0 0.5rem;
}

.shop-cart-gold-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.shop-block-inline-cfg {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.82rem;
}
.shop-block-inline-cfg label { display: grid; gap: 0.15rem; }
.shop-block-inline-cfg input { width: 100%; padding: 0.35rem 0.5rem; border: 1px solid #cbd5e1; border-radius: 6px; }

/* شعار: طلای موجود → محصول واقعی */
.gold-use-promo {
  margin: 0.65rem 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 48%, #fff7ed 100%);
  border: 1px solid rgba(217, 119, 6, 0.28);
  box-shadow: 0 6px 18px rgba(180, 83, 9, 0.08);
}
.gold-use-promo--banner { position: relative; overflow: hidden; }
.gold-use-promo--banner::after {
  content: '';
  position: absolute;
  inset: -40% auto auto -20%;
  width: 55%;
  height: 140%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.22), transparent 68%);
  pointer-events: none;
}
.gold-use-promo-badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #92400e;
  background: rgba(251, 191, 36, 0.35);
}
.gold-use-promo-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  line-height: 1.55;
  font-weight: 800;
  color: #78350f;
}
.gold-use-promo-body {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #92400e;
}
.gold-use-promo-points {
  margin: 0;
  padding: 0 1.1rem 0 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #a16207;
}
.gold-use-promo-points li + li { margin-top: 0.2rem; }
.gold-use-promo--compact,
.gold-use-promo--wallet {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.gold-use-promo--wallet {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #a16207;
  font-weight: 600;
}
.gold-use-promo--compact .gold-use-promo-title {
  margin: 0;
  font-size: 0.82rem;
}
.gold-use-promo-mini {
  margin: 0.35rem 0 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 0.76rem;
  line-height: 1.55;
  color: #78350f;
}
.gold-use-promo-mini--new {
  background: #fefce8;
  border-color: #facc15;
}
.shop-bd-gold-sum {
  font-weight: 700;
  color: #92400e;
  background: #fffbeb;
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  margin: 0.15rem 0;
}

/* ==================== تم روشن/تاریک ==================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #1e293b;
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --primary: #93c5fd;
  --primary-light: rgba(147, 197, 253, 0.12);
  --border: rgba(148, 163, 184, 0.22);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] body {
  color-scheme: dark;
  background: var(--bg);
  color: var(--fg);
}
html[data-theme="dark"] .top-bar,
html[data-theme="dark"] .bottom-nav,
html[data-theme="dark"] .tx-filters,
html[data-theme="dark"] .tx-day,
html[data-theme="dark"] .trade-sheet,
html[data-theme="dark"] .wallet-withdraw-modal,
html[data-theme="dark"] .shop-modal {
  background: var(--surface);
  color: var(--fg);
}
html[data-theme="dark"] .chip-btn {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
}
html[data-theme="dark"] .chip-btn.on {
  background: var(--primary-light);
  color: var(--primary);
}
html[data-theme="dark"].mode-shop-tab,
html[data-theme="dark"] body.mode-shop-tab {
  --shop-bg: #f4efe7;
  --shop-surface: #fffaf2;
  --shop-text: #1e293b;
  --shop-text-muted: #64748b;
  --shop-border: rgba(15, 31, 92, 0.1);
  color-scheme: only light !important;
  -webkit-color-scheme: only light !important;
}

.header-theme-btn {
  position: absolute;
  inset-inline-end: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-inline-end: 0;
  border: 1.5px solid rgba(147, 197, 253, 0.38);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.9), rgba(147,197,253,.16) 42%, rgba(15,31,92,.08));
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 31, 92, 0.1), inset 0 1px 0 rgba(255,255,255,.65);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease;
}
.header-theme-btn:hover {
  transform: translateY(calc(-50% - 1px));
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.35), var(--primary));
  color: #fff;
  box-shadow: 0 8px 22px rgba(15, 31, 92, 0.18);
}
.header-cart-btn {
  position: absolute;
  inset-inline-end: 2.65rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1.5px solid rgba(201, 162, 39, 0.45);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .92), rgba(254, 243, 199, .75) 44%, rgba(201, 162, 39, .18));
  color: #92400e;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(146, 64, 14, 0.12), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease;
}
.header-cart-btn:hover {
  transform: translateY(calc(-50% - 1px));
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.45), #c9a227);
  color: #fff;
  box-shadow: 0 8px 22px rgba(146, 64, 14, 0.18);
}
.header-cart-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.header-cart-ico svg {
  width: 19px;
  height: 19px;
}
.header-cart-badge {
  top: -5px;
  inset-inline-end: -5px;
}
.theme-toggle-svg { display: block; filter: drop-shadow(0 1px 1px rgba(15, 31, 92, 0.16)); }
html[data-theme="dark"] .header-theme-btn {
  border-color: rgba(251, 191, 36, 0.38);
  background: radial-gradient(circle at 35% 30%, rgba(253,224,71,.35), rgba(251,191,36,.16) 46%, rgba(15,23,42,.85));
  color: #fde68a;
}
html[data-theme="dark"] .header-cart-btn {
  border-color: rgba(251, 191, 36, 0.38);
  background: radial-gradient(circle at 35% 30%, rgba(253,224,71,.35), rgba(251,191,36,.16) 46%, rgba(15,23,42,.85));
  color: #fde68a;
}
html[data-theme="dark"] .header-profile-action {
  background: #0f172a;
  color: #dbeafe;
  border-color: rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .header-profile-action:hover {
  background: #2563eb;
  color: #fff;
}
html[data-theme="dark"] .header-profile-logout {
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.28);
}
html[data-theme="dark"] .header-profile-logout:hover {
  background: #dc2626;
  color: #fff;
}

.header-profile-menu-user-label {
  font-weight: 600;
  color: var(--muted);
  margin-inline-end: 0.25rem;
}

.password-input-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.password-input-row input { flex: 1; min-width: 0; }
.password-toggle-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trade-shortfall-panel {
  margin: 0.5rem 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fdba74;
}
html[data-theme="dark"] .trade-shortfall-panel {
  background: rgba(251, 146, 60, 0.12);
  border-color: rgba(251, 146, 60, 0.35);
}
.trade-shortfall-text {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  line-height: 1.65;
  color: #9a3412;
}
html[data-theme="dark"] .trade-shortfall-text { color: #fdba74; }

.wallet-max-amount-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}
.wallet-max-amount-btn:hover { background: var(--primary-light); }

.main-zone,
#tab-content,
.wallet-overview,
.ledger-wrap,
.shop-scroll,
.tx-wrap {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.main-zone::-webkit-scrollbar,
#tab-content::-webkit-scrollbar,
.wallet-overview::-webkit-scrollbar,
.ledger-wrap::-webkit-scrollbar,
.shop-scroll::-webkit-scrollbar,
.tx-wrap::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html[data-theme="dark"] .wallet-withdraw-btn {
  background: #0f172a !important;
  color: #dbeafe !important;
  border-color: rgba(147, 197, 253, 0.32) !important;
}

html[data-theme="dark"] .tx-shop-detail,
html[data-theme="dark"] .tx-shop-item {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
html[data-theme="dark"] .tx-shop-item-name,
html[data-theme="dark"] .tx-shop-item-tags {
  color: #f8fafc !important;
}
html[data-theme="dark"] .tx-shop-item-meta,
html[data-theme="dark"] .tx-shop-detail-summary {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .tx-shop-detail-close {
  background: #0f172a !important;
  color: #dbeafe !important;
}

html[data-theme="dark"] .wallet-step {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .wallet-step .wallet-step-explainer,
html[data-theme="dark"] .wallet-step .wallet-step-sub,
html[data-theme="dark"] .wallet-step .amount-label,
html[data-theme="dark"] .wallet-step .wallet-next-hint {
  color: #334155;
}
html[data-theme="dark"] .wallet-step h3,
html[data-theme="dark"] .wallet-step .wallet-step-header h3,
html[data-theme="dark"] .wallet-step .wps-dot,
html[data-theme="dark"] .wallet-step .wps-arrow {
  color: #0f1f5c;
}
html[data-theme="dark"] .wallet-step .wallet-back-btn {
  background: #eef2ff;
  color: #0f1f5c;
  border-color: #c7d2fe;
}
html[data-theme="dark"] .wallet-step .wallet-back-link {
  background: transparent !important;
  border-color: transparent !important;
  color: #0f1f5c !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .wallet-step .wallet-back-icon {
  background: rgba(15, 31, 92, 0.08);
}
html[data-theme="dark"] .wallet-step .amount-input {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 31, 92, 0.18) !important;
}
html[data-theme="dark"] .wallet-step .amount-input::placeholder {
  color: #64748b !important;
}
html[data-theme="dark"] .wallet-step .preset-btn,
html[data-theme="dark"] .wallet-step .bank-card,
html[data-theme="dark"] .wallet-step .upload-area,
html[data-theme="dark"] .wallet-step .wallet-next-hint,
html[data-theme="dark"] .wallet-step .wallet-step-banner,
html[data-theme="dark"] .wallet-step .wallet-min-gold-hint {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 31, 92, 0.14) !important;
}
html[data-theme="dark"] .wallet-step .preset-btn {
  background: rgba(15, 31, 92, 0.05) !important;
  color: #0f1f5c !important;
}
html[data-theme="dark"] .wallet-step .bank-card-selected {
  background: rgba(15, 31, 92, 0.04) !important;
  border-color: #0f1f5c !important;
}
html[data-theme="dark"] .wallet-step .bank-card-meta,
html[data-theme="dark"] .wallet-step .bank-card-details,
html[data-theme="dark"] .wallet-step .wallet-min-gold-hint {
  color: #64748b !important;
}
html[data-theme="dark"] .wallet-step .wallet-next-btn,
html[data-theme="dark"] .wallet-step .wallet-charge-btn {
  background: #0f1f5c !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .wallet-step .wallet-min-gold-hint {
  background: #fffbeb !important;
  color: #334155 !important;
  border-color: #fde68a !important;
}
html[data-theme="dark"] .wallet-step .upload-area-title,
html[data-theme="dark"] .wallet-step .upload-bank-summary-label {
  background: rgba(15, 31, 92, 0.07) !important;
  color: #0f1f5c !important;
  border-color: rgba(15, 31, 92, 0.14) !important;
}
html[data-theme="dark"] .wallet-step .upload-area {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  color: #334155 !important;
}
html[data-theme="dark"] .wallet-step .upload-placeholder,
html[data-theme="dark"] .wallet-step .upload-placeholder-main,
html[data-theme="dark"] .wallet-step .upload-placeholder-sub,
html[data-theme="dark"] .wallet-step .upload-area-hint {
  color: #334155 !important;
}
html[data-theme="dark"] .wallet-step .upload-action-btn {
  background: #ffffff !important;
  color: #0f1f5c !important;
  border-color: rgba(15, 31, 92, 0.18) !important;
}

html[data-theme="dark"] .trade-btn-cancel {
  background: #0f172a;
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .trade-btn-submit {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
}

.wallet-max-amount-btn {
  font-family: inherit;
  font-size: 0.76rem;
  line-height: 1.8;
}

.shop-bd-section { margin-bottom: 0.55rem; }
.shop-bd-section:last-child { margin-bottom: 0; }
.shop-bd-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
}
.shop-bd-section-weights .shop-bd-row span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.shop-bd-section-money .shop-bd-row { border-top: none; }

.shop-cart-shortfall-detail {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #9a3412;
}
.shop-cart-topup-secondary {
  margin-top: 0.35rem;
  background: transparent !important;
  color: var(--primary) !important;
  border: 1px solid var(--border) !important;
}

.tx-mobile-list { display: none; }
.tx-desktop-only { display: block; }

@media (max-width: 640px) {
  .tx-filters { padding: 0.55rem 0.65rem; }
  .tx-filter-row { margin-bottom: 0.3rem; }
  .chip-row { gap: 0.25rem; }
  .chip-btn { font-size: 0.68rem; padding: 0.22rem 0.45rem; }
  .tx-day-head { font-size: 0.78rem; padding: 0.45rem 0.5rem; }
  .tx-desktop-only { display: none !important; }
  .tx-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.35rem 0.15rem 0.5rem;
  }
  .tx-mobile-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .tx-mc-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.2rem 0;
    font-size: 0.74rem;
  }
  .tx-mc-k { color: var(--muted); font-weight: 700; flex-shrink: 0; }
  .tx-mc-v { text-align: left; font-weight: 600; word-break: break-word; }
  .tx-mc-actions { justify-content: flex-end; padding-top: 0.35rem; }
  .tx-panel .tx-groups { overflow: visible; }
}

/* تکمیل دارک‌مود برای همه صفحات مشتری */
.brand-logo {
  width: 3.25rem;
  height: 3.25rem;
  max-width: 3.25rem;
  max-height: 3.25rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

html[data-theme="dark"] #app,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .main-zone,
html[data-theme="dark"] .content-wrap,
html[data-theme="dark"] .inner,
html[data-theme="dark"] #tab-content,
html[data-theme="dark"] .table-panel {
  background: var(--bg) !important;
  color: var(--fg) !important;
}

html[data-theme="dark"] .trade-panel-wrap,
html[data-theme="dark"] .trade-panel-brand-area,
html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] table.products thead th {
  background: #111827 !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] table.products td {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}
html[data-theme="dark"] table.products tbody tr:hover td {
  background: rgba(147, 197, 253, 0.07);
}
html[data-theme="dark"] .col-name,
html[data-theme="dark"] .price-main,
html[data-theme="dark"] .per-gram {
  color: #f8fafc !important;
}
html[data-theme="dark"] .cell-hit-buy,
html[data-theme="dark"] .cell-buy .cell-hit {
  background: rgba(34, 197, 94, 0.14) !important;
  border-color: rgba(134, 239, 172, 0.42) !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .cell-hit-sell,
html[data-theme="dark"] .cell-sell .cell-hit {
  background: rgba(248, 113, 113, 0.12) !important;
  border-color: rgba(252, 165, 165, 0.35) !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .cell-hit-sell-empty {
  opacity: 1;
}

html[data-theme="dark"] .login-field input,
html[data-theme="dark"] .trade-input,
html[data-theme="dark"] .trade-select,
html[data-theme="dark"] .amount-input {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.36) !important;
}
html[data-theme="dark"] .login-field input::placeholder,
html[data-theme="dark"] .trade-input::placeholder,
html[data-theme="dark"] .amount-input::placeholder {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .password-toggle-btn {
  background: #0f172a;
  color: #bfdbfe;
  border-color: rgba(148, 163, 184, 0.36);
}
html[data-theme="dark"] .trade-offer-banner {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.32), rgba(120, 53, 15, 0.42)) !important;
  color: #fef3c7 !important;
  border-color: rgba(251, 191, 36, 0.36) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
html[data-theme="dark"] .trade-offer-banner strong,
html[data-theme="dark"] .trade-profit-discount-note {
  color: #fde68a !important;
}
html[data-theme="dark"] .offers-card-global {
  background: linear-gradient(180deg, rgba(22, 101, 52, .30), rgba(15, 23, 42, .95)) !important;
  border-color: rgba(74, 222, 128, .30) !important;
}
html[data-theme="dark"] .offers-card-highlight,
html[data-theme="dark"] .offers-countdown-urgency {
  color: #fcd34d !important;
}
html[data-theme="dark"] .offers-card-highlight strong {
  color: #fbbf24 !important;
}
html[data-theme="dark"] .offers-card-global .offers-card-highlight,
html[data-theme="dark"] .offers-card-global .offers-countdown-urgency {
  color: #bbf7d0 !important;
}
html[data-theme="dark"] .offers-card-global .offers-card-highlight strong {
  color: #86efac !important;
}
html[data-theme="dark"] .offers-disc-chip {
  background: linear-gradient(135deg, rgba(251, 191, 36, .35), rgba(245, 158, 11, .22)) !important;
  color: #fff7ed !important;
  border-color: rgba(251, 191, 36, .45) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28) !important;
}
html[data-theme="dark"] .offers-card-global .offers-disc-chip {
  background: linear-gradient(135deg, rgba(34, 197, 94, .38), rgba(21, 128, 61, .24)) !important;
  color: #dcfce7 !important;
  border-color: rgba(74, 222, 128, .42) !important;
}
html[data-theme="dark"] .offers-countdown {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
html[data-theme="dark"] .offers-countdown-clock {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}
html[data-theme="dark"] .offers-countdown-label { color: #94a3b8 !important; }
html[data-theme="dark"] .offers-countdown-part { color: #f1f5f9 !important; }
html[data-theme="dark"] .offers-countdown-sep { color: #64748b !important; }
html[data-theme="dark"] .offers-countdown.is-urgent .offers-countdown-part { color: #fca5a5 !important; }
html[data-theme="dark"] .offers-badge-hot {
  background: linear-gradient(135deg, rgba(180, 83, 9, .45), rgba(251, 191, 36, .25)) !important;
  color: #fef3c7 !important;
}
html[data-theme="dark"] .offers-card-global .offers-badge-hot {
  background: linear-gradient(135deg, rgba(22, 163, 74, .45), rgba(74, 222, 128, .25)) !important;
  color: #dcfce7 !important;
}

html[data-theme="dark"] body.mode-shop-tab,
html[data-theme="dark"] body.mode-shop-tab #app,
html[data-theme="dark"] body.mode-shop-tab .app-shell,
html[data-theme="dark"] body.mode-shop-tab .main-zone,
html[data-theme="dark"] body.mode-shop-tab .content-wrap,
html[data-theme="dark"] body.mode-shop-tab .inner,
html[data-theme="dark"] body.mode-shop-tab #tab-content,
html[data-theme="dark"] body.mode-shop-tab .top-bar,
html[data-theme="dark"] body.mode-shop-tab .bottom-nav,
html[data-theme="dark"] .shop-shell,
html[data-theme="dark"] .shop-scroll,
html[data-theme="dark"] .shop-wrap,
html[data-theme="dark"] .shop-page {
  background: #0f172a !important;
  color: #f8fafc !important;
  color-scheme: dark !important;
}
html[data-theme="dark"] .shop-page-title,
html[data-theme="dark"] .shop-product-body,
html[data-theme="dark"] .shop-product-card,
html[data-theme="dark"] .shop-product-card *:not(.shop-spot-chip) {
  color: #f8fafc !important;
}
html[data-theme="dark"] .shop-product-card,
html[data-theme="dark"] .shop-product-body {
  background: #1e293b !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}
html[data-theme="dark"] .shop-modal-backdrop,
html[data-theme="dark"] .shop-cart-backdrop {
  background: rgba(2, 6, 23, 0.78) !important;
  color-scheme: dark !important;
}
html[data-theme="dark"] .shop-modal,
html[data-theme="dark"] .shop-cart-panel,
html[data-theme="dark"] .shop-product-modal {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
html[data-theme="dark"] .shop-cart-panel {
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 34%),
    linear-gradient(180deg, #2b2114 0%, #1e293b 58%, #0f172a 100%) !important;
  border-color: rgba(251, 191, 36, 0.28) !important;
}
html[data-theme="dark"] .shop-cart-head {
  border-bottom-color: rgba(148, 163, 184, 0.2) !important;
}
html[data-theme="dark"] .shop-cart-head h2,
html[data-theme="dark"] .shop-cart-item-name {
  color: #f8fafc !important;
}
html[data-theme="dark"] .shop-cart-item,
html[data-theme="dark"] .shop-cart-summary {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2) !important;
}
html[data-theme="dark"] .shop-cart-item-meta,
html[data-theme="dark"] .shop-cart-gold-hint {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .shop-cart-item-quote {
  color: #86efac !important;
}
html[data-theme="dark"] .shop-cart-qty {
  background: #1e293b !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
html[data-theme="dark"] .shop-cart-qty-btn {
  background: #334155 !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .shop-cart-qty-val {
  color: #f8fafc !important;
}
html[data-theme="dark"] .shop-cart-remove,
html[data-theme="dark"] .shop-cart-close {
  color: #dbeafe !important;
}
html[data-theme="dark"] .shop-bad {
  color: #fca5a5 !important;
}
html[data-theme="dark"] .shop-cart-sum-highlight span:last-child {
  color: #fca5a5 !important;
}
html[data-theme="dark"] .shop-cart-shortfall-detail {
  color: #fee2e2 !important;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
}
html[data-theme="dark"] .shop-cart-shortfall-detail strong {
  color: #fecaca !important;
}
html[data-theme="dark"] .shop-cart-topup-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
  color: #111827 !important;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.24);
}
html[data-theme="dark"] .shop-cart-topup-secondary {
  background: #0f172a !important;
  color: #dbeafe !important;
  border: 1px solid rgba(147, 197, 253, 0.3) !important;
  box-shadow: none;
}
html[data-theme="dark"] .shop-price-breakdown,
html[data-theme="dark"] .shop-bd-gold-sum {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
html[data-theme="dark"] .shop-bd-value-stack small {
  color: #fcd34d !important;
}
html[data-theme="dark"] .shop-bd-value-stack strong {
  color: #fde68a !important;
}

html[data-theme="dark"] .ledger-box,
html[data-theme="dark"] .ledger-scroll,
html[data-theme="dark"] .ledger-tbl,
html[data-theme="dark"] .ledger-tbl tbody td,
html[data-theme="dark"] .ledger-print-btn {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
html[data-theme="dark"] .ledger-tbl thead th {
  background: #0f172a !important;
  color: #dbeafe !important;
  border-bottom-color: rgba(148, 163, 184, 0.3) !important;
}
html[data-theme="dark"] .ledger-sum-k,
html[data-theme="dark"] .ledger-box-title,
html[data-theme="dark"] .ledger-order-note {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .tx-panel,
html[data-theme="dark"] .tx-tbl,
html[data-theme="dark"] .tx-tbl td,
html[data-theme="dark"] .tx-tbl th,
html[data-theme="dark"] .tx-status-times,
html[data-theme="dark"] .tx-mobile-card {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}
html[data-theme="dark"] .tx-day-head,
html[data-theme="dark"] .tx-tbl th {
  background: #0f172a !important;
}
html[data-theme="dark"] .tx-tbl .tx-col-side .side-buy,
html[data-theme="dark"] .side-buy,
html[data-theme="dark"] .receipt-val.side-buy {
  color: #86efac !important;
}
html[data-theme="dark"] .tx-tbl .tx-col-side .side-sell,
html[data-theme="dark"] .side-sell,
html[data-theme="dark"] .receipt-val.side-sell {
  color: #fca5a5 !important;
}
html[data-theme="dark"] .status-approved,
html[data-theme="dark"] .tx-status-chip.status-approved {
  color: #86efac !important;
}
html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .tx-status-chip.status-pending {
  color: #fde68a !important;
}
html[data-theme="dark"] .status-rejected,
html[data-theme="dark"] .tx-status-chip.status-rejected {
  color: #fca5a5 !important;
}
html[data-theme="dark"] .receipt-dialog,
html[data-theme="dark"] .receipt-body,
html[data-theme="dark"] .receipt-grid {
  background: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .wallet-card,
html[data-theme="dark"] .wallet-card-rial,
html[data-theme="dark"] .wallet-card-gold,
html[data-theme="dark"] .dep-row,
html[data-theme="dark"] .wallet-product-card,
html[data-theme="dark"] .wallet-empty-card {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
html[data-theme="dark"] .wallet-card-rial .wc-value,
html[data-theme="dark"] .wallet-card-gold .wc-value,
html[data-theme="dark"] .dep-list-title,
html[data-theme="dark"] .dep-amount,
html[data-theme="dark"] .shop-purch-name,
html[data-theme="dark"] .shop-holding-name {
  color: #f8fafc !important;
}
html[data-theme="dark"] .shop-purch-meta,
html[data-theme="dark"] .shop-holding-meta,
html[data-theme="dark"] .wallet-product-delivered {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .wallet-product-delivered,
html[data-theme="dark"] .wallet-product-delivered-modal,
html[data-theme="dark"] .wallet-product-status-approved {
  background: rgba(34, 197, 94, 0.16) !important;
  color: #86efac !important;
  border: 1px solid rgba(74, 222, 128, 0.28);
}
html[data-theme="dark"] .wallet-product-status-pending {
  background: rgba(251, 191, 36, 0.14) !important;
  color: #fde68a !important;
}
html[data-theme="dark"] .wallet-product-status-rejected {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #fca5a5 !important;
}
html[data-theme="dark"] .gold-use-promo {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.32), rgba(15, 23, 42, 0.92)) !important;
  border-color: rgba(251, 191, 36, 0.28) !important;
}
html[data-theme="dark"] .gold-use-promo-badge {
  color: #fef3c7 !important;
  background: rgba(251, 191, 36, 0.22) !important;
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
html[data-theme="dark"] .gold-use-promo-title,
html[data-theme="dark"] .gold-use-promo-mini {
  color: #fde68a !important;
}
html[data-theme="dark"] .gold-use-promo-body,
html[data-theme="dark"] .gold-use-promo-points,
html[data-theme="dark"] .gold-use-promo--wallet {
  color: #fcd34d !important;
}
html[data-theme="dark"] .gold-use-promo-points strong {
  color: #fef08a !important;
}
html[data-theme="dark"] .site-footer {
  border-color: rgba(148, 163, 184, 0.22) !important;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.75)) !important;
}
html[data-theme="dark"] .site-footer-address {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .site-footer-credit {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .site-footer-credit a {
  color: #fcd34d !important;
}
html[data-theme="dark"] .contact-phone-chip,
html[data-theme="dark"] .site-footer-social-icon {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #fde68a !important;
}
html[data-theme="dark"] .shop-gallery-overlay {
  background: rgba(2, 6, 23, 0.9) !important;
}
html[data-theme="dark"] .shop-gallery-viewer {
  background: #1e293b !important;
  color-scheme: dark !important;
  border: 1px solid rgba(148, 163, 184, 0.24);
}
html[data-theme="dark"] .shop-gallery-toolbar {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(30, 41, 59, 0.92)) !important;
  border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}
html[data-theme="dark"] .shop-gallery-stage {
  background: #0f172a !important;
}
html[data-theme="dark"] .shop-gallery-close {
  background: rgba(248, 250, 252, 0.94) !important;
  color: #0f172a !important;
}
html[data-theme="dark"] .shop-gallery-title { color: #f8fafc !important; }
html[data-theme="dark"] .shop-gallery-footer { border-color: rgba(148, 163, 184, 0.22) !important; }
html[data-theme="dark"] .wallet-withdraw-modal,
html[data-theme="dark"] .wallet-withdraw-panel {
  background: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .wallet-withdraw-modal-head p,
html[data-theme="dark"] .wallet-withdraw-balance-card span,
html[data-theme="dark"] .wallet-withdraw-hint {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .wallet-withdraw-balance-card,
html[data-theme="dark"] .iban-bank-badge {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.26) !important;
}

.wallet-withdraw-dest-list {
  display: grid;
  gap: 0.4rem;
  margin: 0.25rem 0 0.6rem;
}
.wallet-withdraw-dest-title,
.wallet-withdraw-dest-empty {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  margin: 0;
}
.wallet-withdraw-dest {
  width: 100%;
  display: grid;
  gap: 0.15rem;
  text-align: right;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  cursor: pointer;
}
.wallet-withdraw-dest:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.wallet-withdraw-dest-holder {
  font-weight: 800;
  font-size: 0.78rem;
}
.wallet-withdraw-dest-iban {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: left;
}

@media (max-width: 640px) {
  .shop-cart-backdrop,
  .shop-modal-backdrop {
    align-items: flex-start !important;
    padding: calc(4.5rem + env(safe-area-inset-top, 0px)) 0.75rem 0.75rem;
  }
  .shop-cart-panel,
  .shop-modal {
    max-height: calc(100dvh - 5.25rem - env(safe-area-inset-top, 0px)) !important;
    border-radius: 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .shop-modal-close {
    position: sticky;
    top: 0;
    z-index: 5;
    float: left;
  }
}

/* ---- کانال VIP (تلگرامی) ---- */
.vip-channel-shell {
  --vip-blue: #2481cc;
  --vip-blue-dark: #1e6bab;
  --vip-bubble: rgba(255, 255, 255, 0.96);
  --vip-bubble-shadow: 0 1px 1px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border: 1px solid rgba(36, 129, 204, 0.18);
  border-radius: 18px;
  overflow: hidden;
  background: #0e1621;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  position: relative;
}

.vip-channel-shell--loading .vip-channel-header { pointer-events: none; }

.vip-channel-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .72rem .85rem calc(.72rem + env(safe-area-inset-top, 0px));
  padding-top: calc(.72rem + env(safe-area-inset-top, 0px));
  background: linear-gradient(180deg, var(--vip-blue) 0%, var(--vip-blue-dark) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 12;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 4px 14px rgba(15, 23, 42, 0.18);
}

.vip-back-btn,
.vip-search-toggle {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, transform .12s;
}
.vip-search-toggle {
  display: grid;
  place-items: center;
  font-size: 0;
}
.vip-search-icon { display: block; }
.vip-back-btn:hover,
.vip-search-toggle:hover { background: rgba(255, 255, 255, 0.22); }
.vip-back-btn:active,
.vip-search-toggle:active { transform: scale(.96); }

.vip-channel-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}
.vip-channel-avatar--pulse { animation: vipPulse 1.2s ease-in-out infinite; }

.vip-channel-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .12rem;
}
.vip-channel-title-wrap strong {
  font-size: .96rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vip-channel-title-wrap span {
  font-size: .72rem;
  opacity: .9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vip-pinned-bar {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  text-align: right;
  border: 0;
  border-bottom: 1px solid rgba(36, 129, 204, 0.22);
  background: linear-gradient(180deg, rgba(36, 129, 204, 0.14), rgba(36, 129, 204, 0.08));
  padding: .58rem .85rem;
  cursor: pointer;
  position: sticky;
  top: calc(3.6rem + env(safe-area-inset-top, 0px));
  z-index: 11;
}
.vip-pinned-bar::before {
  content: '';
  position: absolute;
  right: 0;
  top: .35rem;
  bottom: .35rem;
  width: 3px;
  border-radius: 999px;
  background: var(--vip-blue);
}
.vip-pinned-icon { font-size: .95rem; flex-shrink: 0; }
.vip-pinned-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .08rem; }
.vip-pinned-label { font-size: .7rem; color: var(--vip-blue); font-weight: 800; }
.vip-pinned-text {
  font-size: .78rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vip-pinned-chevron { color: var(--muted); font-size: 1.1rem; flex-shrink: 0; }

.vip-search-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: .75rem;
}
.vip-search-panel {
  width: min(100%, 520px);
  padding: .7rem .75rem;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--border);
}
.vip-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .55rem;
  font-size: .82rem;
  font-weight: 800;
}
.vip-search-close {
  border: 0;
  background: rgba(15, 23, 42, 0.06);
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  cursor: pointer;
}
.vip-search-panel input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .62rem .75rem;
  font: inherit;
  background: var(--bg);
}
.vip-search-results {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .55rem;
  max-height: min(50vh, 320px);
  overflow: auto;
}
.vip-search-item {
  border: 1px solid var(--border);
  background: var(--surface-2, #f8fafc);
  border-radius: 12px;
  padding: .52rem .65rem;
  text-align: right;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: .18rem;
}
.vip-search-item-text { font-size: .78rem; line-height: 1.55; }
.vip-search-item-time { font-size: .68rem; color: var(--muted); align-self: flex-end; }
.vip-search-empty,
.vip-search-status { color: var(--muted); font-size: .76rem; padding: .35rem .15rem; }

.vip-messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.vip-bg-preset {
  position: absolute;
  top: .55rem;
  left: .65rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
  font-size: .64rem;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.vip-bg-preset-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #2481cc, #60a5fa);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.vip-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 1rem 2.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .62rem;
  min-height: 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  background-attachment: local;
  background-position: center;
}
.vip-messages.vip-bg-pattern,
.vip-messages.vip-bg-image,
.vip-messages.vip-bg-gradient {
  background-attachment: local;
}

.vip-load-older {
  align-self: center;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 999px;
  padding: .38rem .85rem;
  font-size: .72rem;
  cursor: pointer;
  margin-bottom: .35rem;
  backdrop-filter: blur(4px);
}
.vip-load-older:disabled { opacity: .65; cursor: wait; }

.vip-day-sep {
  display: flex;
  justify-content: center;
  align-self: center;
  margin: .45rem 0;
}
.vip-day-sep span {
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: .68rem;
  padding: .24rem .62rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.vip-empty {
  margin: auto;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  padding: 2rem 1rem;
}
.vip-empty-icon { font-size: 2rem; margin-bottom: .45rem; }
.vip-empty p { margin: 0; font-size: .82rem; line-height: 1.7; }

.vip-msg {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  max-width: min(100%, 560px);
  align-self: flex-start;
  animation: vipMsgIn .28s ease;
}
.vip-msg.vip-msg-highlight {
  position: relative;
  z-index: 1;
}
.vip-msg.vip-msg-highlight::before {
  content: '';
  position: absolute;
  inset: -.35rem -.55rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.42);
  animation: vipMsgHighlightFade 2.5s ease-out forwards;
  pointer-events: none;
  z-index: -1;
}
.vip-msg.vip-msg-highlight .vip-msg-bubble {
  position: relative;
  z-index: 1;
}

.vip-msg-bubble {
  max-width: min(100%, 560px);
  background: var(--vip-bubble);
  border-radius: 16px 16px 16px 4px;
  padding: .58rem .68rem .48rem;
  box-shadow: var(--vip-bubble-shadow);
  position: relative;
}
.vip-msg-pin-badge {
  position: absolute;
  top: .35rem;
  left: .45rem;
  font-size: .75rem;
}

.vip-msg-text {
  font-size: .84rem;
  line-height: 1.68;
  word-break: break-word;
}
.vip-msg-text a { color: var(--vip-blue); text-decoration: underline; }

.vip-gallery {
  display: grid;
  gap: .22rem;
  margin-top: .4rem;
  border-radius: 12px;
  overflow: hidden;
}
.vip-gallery--1 { grid-template-columns: 1fr; }
.vip-gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vip-gallery--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vip-gallery--3 .vip-gallery-item:first-child { grid-row: span 2; }
.vip-gallery--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.vip-gallery-item {
  position: relative;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.08);
  cursor: zoom-in;
  overflow: hidden;
  min-height: 88px;
}
.vip-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 88px;
  object-fit: cover;
}
.vip-gallery-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.52);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}

.vip-msg-media video {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  margin-top: .4rem;
  background: #000;
}
.vip-voice-player {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .4rem;
  padding: .5rem .6rem;
  border-radius: 14px;
  background: rgba(36, 129, 204, 0.1);
  min-width: min(100%, 240px);
}
.vip-voice-play {
  flex: 0 0 2.1rem;
  width: 2.1rem;
  height: 2.1rem;
  border: none;
  border-radius: 50%;
  background: #2481cc;
  color: #fff;
  font-size: .72rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.vip-voice-wave {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 1.6rem;
  min-width: 0;
  overflow: hidden;
}
.vip-voice-bar {
  flex: 1;
  max-width: 4px;
  height: calc(var(--h, 4) * 0.12rem);
  border-radius: 2px;
  background: rgba(36, 129, 204, 0.45);
  transition: background .2s ease, transform .2s ease;
}
.vip-voice-player.is-playing .vip-voice-bar {
  background: #2481cc;
  animation: vip-voice-bounce 1s ease-in-out infinite;
}
.vip-voice-player.is-playing .vip-voice-bar:nth-child(odd) { animation-delay: .12s; }
.vip-voice-player.is-playing .vip-voice-bar:nth-child(3n) { animation-delay: .24s; }
@keyframes vip-voice-bounce {
  0%, 100% { transform: scaleY(.55); }
  50% { transform: scaleY(1); }
}
.vip-voice-dur {
  flex: 0 0 auto;
  font-size: .7rem;
  font-weight: 700;
  color: #1e6bab;
  font-variant-numeric: tabular-nums;
  min-width: 2.4rem;
  text-align: end;
}
.vip-voice-player audio { display: none; }

.vip-msg-file {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .4rem;
  padding: .48rem .58rem;
  border-radius: 12px;
  background: rgba(36, 129, 204, 0.1);
  color: #1e6bab;
  font-size: .78rem;
  text-decoration: none;
}
.vip-msg-file-ext {
  min-width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(36, 129, 204, 0.18);
  font-size: .62rem;
  font-weight: 800;
}
.vip-msg-file-info { display: flex; flex-direction: column; gap: .08rem; min-width: 0; }
.vip-msg-file-info strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vip-msg-file-info small { color: var(--muted); font-size: .66rem; }

.vip-link-card {
  display: flex;
  gap: .5rem;
  margin-top: .45rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.78);
}
.vip-link-card img { width: 76px; height: 76px; object-fit: cover; flex-shrink: 0; }
.vip-link-card-body { padding: .45rem .5rem .5rem 0; min-width: 0; }
.vip-link-card-body strong,
.vip-link-card-body span,
.vip-link-card-body p {
  display: block;
  font-size: .72rem;
  line-height: 1.45;
}
.vip-link-card-body p {
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vip-poll-card {
  margin-top: .45rem;
  display: flex;
  flex-direction: column;
  gap: .42rem;
  padding-top: .15rem;
  border-top: 1px dashed rgba(36, 129, 204, 0.18);
}
.vip-poll-head { display: flex; align-items: flex-start; gap: .35rem; }
.vip-poll-icon { font-size: .95rem; line-height: 1.2; }
.vip-poll-q { font-weight: 800; font-size: .82rem; line-height: 1.55; }
.vip-poll-options { display: flex; flex-direction: column; gap: .35rem; }
.vip-poll-opt {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(36, 129, 204, 0.24);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 12px;
  padding: .48rem .58rem;
  text-align: right;
  cursor: pointer;
  font: inherit;
}
.vip-poll-opt.voted { border-color: var(--vip-blue); background: rgba(36, 129, 204, 0.08); }
.vip-poll-opt-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.vip-poll-check {
  width: 1.1rem;
  flex-shrink: 0;
  color: var(--vip-blue);
  font-size: .82rem;
}
.vip-poll-opt-text { flex: 1; font-size: .78rem; line-height: 1.5; }
.vip-poll-pct { font-size: .72rem; font-weight: 800; color: var(--vip-blue); }
.vip-poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(36, 129, 204, 0.14);
  z-index: 0;
  transition: width .25s ease;
}
.vip-poll-meta {
  position: relative;
  z-index: 1;
  display: block;
  font-size: .66rem;
  color: var(--muted);
  margin-top: .18rem;
  padding-right: 1.55rem;
}
.vip-poll-foot { font-size: .68rem; color: var(--muted); }

.vip-msg-meta {
  display: flex;
  gap: .45rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: .38rem;
  font-size: .66rem;
  color: var(--muted);
}
.vip-msg-edited { opacity: .85; }
.vip-msg-time { font-variant-numeric: tabular-nums; }

.vip-msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  margin-top: .38rem;
  position: relative;
  z-index: 1;
}
.vip-msg:has(.vip-react-picker) {
  position: relative;
  z-index: 7;
}
.vip-react-chip,
.vip-react-add {
  border: 0;
  background: rgba(36, 129, 204, 0.1);
  border-radius: 999px;
  padding: .18rem .5rem;
  font-size: .72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .22rem;
}
.vip-react-chip.mine { background: rgba(36, 129, 204, 0.24); }
.vip-react-add {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
  font-size: .95rem;
  line-height: 1;
  font-weight: 600;
}
.vip-react-picker {
  position: absolute;
  bottom: calc(100% + .35rem);
  right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .12rem;
  max-width: min(100%, 280px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .35rem .45rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  z-index: 20;
}
.vip-react-picker button,
.vip-react-picker-opt {
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
  padding: .12rem .18rem;
  border-radius: 8px;
}
.vip-react-picker button:hover,
.vip-react-picker-opt:hover { background: rgba(36, 129, 204, 0.1); }

.vip-scroll-bottom {
  position: absolute;
  left: 1rem;
  bottom: 1.15rem;
  z-index: 5;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: rgba(36, 129, 204, 0.92);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: opacity .2s, transform .12s;
}
.vip-scroll-bottom.is-hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }

.vip-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(15, 23, 42, 0.88);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.vip-lightbox-img {
  max-width: min(100%, 920px);
  max-height: calc(100dvh - 4rem);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.vip-lightbox-close,
.vip-lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.35rem;
}
.vip-lightbox-close { top: 1rem; left: 1rem; }
.vip-lightbox-prev { right: 1rem; top: 50%; transform: translateY(-50%); }
.vip-lightbox-next { left: 1rem; top: 50%; transform: translateY(-50%); }
.vip-lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: .78rem;
  background: rgba(15, 23, 42, 0.45);
  padding: .28rem .65rem;
  border-radius: 999px;
}

.vip-loading,
.vip-blocked {
  padding: 2rem 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.vip-loading-spinner {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  animation: vipSpin .8s linear infinite;
  margin-bottom: .65rem;
}
.vip-loading p { margin: 0 0 .75rem; font-size: .84rem; }
.vip-loading-bubbles {
  display: flex;
  gap: .35rem;
}
.vip-loading-bubbles span {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  animation: vipBubble 1s ease-in-out infinite;
}
.vip-loading-bubbles span:nth-child(2) { animation-delay: .15s; }
.vip-loading-bubbles span:nth-child(3) { animation-delay: .3s; }

.vip-skeleton-line {
  display: inline-block;
  height: .72rem;
  width: 8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
.vip-skeleton-line--sm { width: 5rem; height: .58rem; margin-top: .15rem; }

.vip-blocked-shell { background: var(--surface); }
.vip-blocked-shell .vip-channel-header { position: relative; }
.vip-blocked { color: var(--fg); }
.vip-blocked-icon { font-size: 2.2rem; margin-bottom: .55rem; }
.vip-blocked h2 { margin: 0 0 .35rem; font-size: 1.02rem; }
.vip-blocked p { margin: .25rem 0; color: var(--muted); font-size: .82rem; line-height: 1.65; max-width: 28rem; }
.vip-blocked-hint { font-size: .75rem !important; }
.vip-request-btn,
.vip-blocked-back {
  margin-top: .85rem;
  border: 0;
  border-radius: 12px;
  padding: .62rem 1rem;
  background: linear-gradient(180deg, var(--vip-blue), var(--vip-blue-dark));
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.vip-request-btn {
  margin-inline-end: .45rem;
  background: linear-gradient(135deg, #b45309, #f59e0b, #92400e);
  box-shadow: 0 12px 26px rgba(180, 83, 9, .24);
  font-weight: 900;
}

@keyframes vipSpin { to { transform: rotate(360deg); } }
@keyframes vipBubble {
  0%, 100% { transform: translateY(0); opacity: .45; }
  50% { transform: translateY(-4px); opacity: 1; }
}
@keyframes vipMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes vipMsgHighlightFade {
  0%, 55% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes vipPulse {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}

html[data-theme="dark"] .vip-channel-shell { border-color: rgba(96, 165, 250, 0.18); }
html[data-theme="dark"] .vip-msg-bubble { background: rgba(17, 24, 39, 0.94); color: #e5e7eb; --vip-bubble: rgba(17, 24, 39, 0.94); }
html[data-theme="dark"] .vip-msg.vip-msg-highlight::before { background: rgba(0, 0, 0, 0.58); }
html[data-theme="dark"] .vip-day-sep span { background: rgba(255, 255, 255, 0.12); }
html[data-theme="dark"] .vip-pinned-text { color: #e5e7eb; }
html[data-theme="dark"] .vip-react-picker { background: #111827; }
html[data-theme="dark"] .vip-poll-opt { background: rgba(17, 24, 39, 0.72); color: #e5e7eb; }
html[data-theme="dark"] .vip-link-card { background: rgba(17, 24, 39, 0.72); }

@media (max-width: 720px) {
  .vip-channel-shell {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-left: -.65rem;
    margin-right: -.65rem;
    margin-bottom: .25rem;
    width: calc(100% + 1.3rem);
  }
  .vip-messages {
    padding: 1.45rem .85rem calc(2.85rem + env(safe-area-inset-bottom, 0px));
  }
  .vip-channel-header { border-radius: 0; }
  .vip-msg-bubble { max-width: 100%; border-radius: 14px 14px 14px 4px; }
  .vip-search-overlay { padding: .55rem .45rem; align-items: stretch; }
  .vip-search-panel { width: 100%; max-height: calc(100dvh - 7rem); overflow: auto; }
  .vip-bg-preset { top: .45rem; left: .45rem; font-size: .6rem; }
  .vip-lightbox-nav,
  .vip-lightbox-close { width: 2.2rem; height: 2.2rem; }
  .vip-gallery-item { min-height: 72px; }
  .vip-gallery-item img { min-height: 72px; }
  .vip-pinned-bar { top: calc(3.45rem + env(safe-area-inset-top, 0px)); }
}

@media (max-width: 420px) {
  .vip-channel-title-wrap strong { font-size: .88rem; }
  .vip-msg-text { font-size: .82rem; }
  .vip-react-picker { max-width: 100%; right: auto; left: 0; }
}
