/* ===== Fonts ===== */
@font-face {
  font-family: 'Yekan';
  src: url('../fonts/Yekan/Yekan.eot');
  src: url('../fonts/Yekan/Yekan.eot?#iefix') format('embedded-opentype'),
       url('../fonts/Yekan/Yekan.woff2') format('woff2'),
       url('../fonts/Yekan/Yekan.woff') format('woff'),
       url('../fonts/Yekan/Yekan.otf') format('opentype'),
       url('../fonts/Yekan/Yekan.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===== Tokens ===== */
:root{
  --bg: #05080A;        /* brand guide: --bg-base */
  --bg-soft: #090E10;   /* brand guide: --surface-input */
  --card-bg: #0C1114;   /* brand guide: --surface-1 */
  --card-border: #1B2327; /* brand guide: --border-subtle */
  --text: #f3f6f4;
  --text-muted: #a9b8b1;
  --accent: #16d97e;
  --accent-dark: #0fae64;
  --accent-contrast: #04140c;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container: 1180px;
  --mono-font: ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* عکس‌های لندینگ: آدرس نسبی به این فایل CSS (../images)؛ با آپلود پوشه images روی سرور خودبه‌خود پیدا می‌شوند.
     هر بخش دو عکس جدا دارد: دسکتاپ و موبایل (موبایل داخل @media پایین عوض می‌شود). */
  --hero-bg-image: url('../images/hero-desktop.webp');   /* بخش اول: 1672×941 (WebP ~۱۲۰KB؛ PNG اصلی در images/original) */
  /* توکن‌های مشترک وضعیت (همه صفحات style.css را بار می‌کنند؛ جای تعریف تکراری در trade.css و auth.css) */
  --error: #E5484D;            /* brand guide: --state-error؛ رنگ «فروش» هم همین است */
  --error-dark: #C93A3F;
  --error-contrast: #1A0507;   /* متن روی زمینه قرمز پر (کنتراست ۴٫۸:۱) */
  --error-soft: rgba(229, 72, 77, .12);
  --market-up: #2FD98A;
  --market-down: #FF5C6C;
  --header-gap: 5px;           /* فاصله نوار هدر از لبه بالای صفحه */
}

/* ===== Reset ===== */
*, *::before, *::after{ box-sizing: border-box; margin: 0; padding: 0; }
html{ scroll-behavior: smooth; }
/* ویژگی hidden همیشه پنهان کند، حتی روی عناصری با display صریح (مثل .btn) */
[hidden]{ display: none !important; }
body{
  font-family: 'Yekan', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul{ list-style: none; }

/* ===== دسترس‌پذیری ===== */
/* فقط برای صفحه‌خوان و موتور جست‌وجو (مثلاً h1 صفحه اصلی که تیتر بصری‌اش داخل تصویر است) */
.sr-only{ position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0; }
/* حلقه فوکوس برای کاربر صفحه‌کلید؛ فیلدهایی که :focus خودشان را دارند (مثلاً .text-input:focus) همان را نگه می‌دارند */
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.container{
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Buttons ===== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: bold;
  font-size: 15px;
  transition: transform .15s ease, opacity .15s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active{ transform: scale(.97); }

.btn-primary{
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover{ background: var(--accent-dark); }

.btn-outline{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn-outline:hover{ border-color: var(--accent); color: var(--accent); }

.btn-block{ width: 100%; }

/* فیلد رمز با دکمه چشم (نمایش/پنهان): مشترک صفحه ورود و پروفایل. رفتار در js/format.js (TH.bindPasswordEyes) */
.pw-wrap{ position: relative; display: block; }
.pw-wrap > input{ width: 100%; padding-right: 44px; }
.pw-eye{
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.pw-eye:hover{ color: var(--text); }
.pw-eye:focus-visible{ outline: 2px solid var(--accent); outline-offset: -2px; }
.pw-eye.is-on{ color: var(--accent); }
.btn-lg{ padding: 15px 30px; font-size: 16px; }

/* ===== Header =====
   نوار هدر --header-gap (۵ پیکسل) پایین‌تر از لبه بالای صفحه می‌نشیند و هنگام اسکرول هم همین فاصله را نگه می‌دارد.
   فاصله فقط همین‌جا تعریف شده (margin بالا برای حالت ابتدای صفحه + top برای حالت چسبان)؛ نوار ثابت body::before همان ۵ پیکسل
   را هم‌رنگ صفحه می‌پوشاند تا محتوای در حال اسکرول از بالای هدر دیده نشود. */
body::before{
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-gap);
  background: var(--bg);
  z-index: 100;
  pointer-events: none;
}
.site-header{
  position: sticky;
  top: var(--header-gap);
  margin-top: var(--header-gap);
  z-index: 100;
  background: rgba(5, 8, 10, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}
/* نوار باریک قیمت تتر، داخل هدر چسبان و زیر آن (فقط لندینگ؛ js/layout.js و js/market.js) */
.rate-bar{
  border-top: 1px solid var(--card-border);
  background: rgba(9, 14, 16, .9);
  font-size: 13px;
  line-height: 1.4;
}
.rate-bar-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
}
.rate-bar-coin{ display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.rate-bar-logo{ flex-shrink: 0; display: block; }
.rate-bar-coin strong{ font-size: 13.5px; }
.rate-bar-sym{ color: var(--text-muted); font-size: 12px; letter-spacing: .4px; }
.rate-bar-prices{ display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.rate-bar-item{ color: var(--text-muted); }
.rate-bar-item b{ font-variant-numeric: tabular-nums; font-size: 14px; margin-inline-start: 4px; }
.rate-bar-item.is-buy b{ color: var(--market-up); }
.rate-bar-item.is-sell b{ color: var(--market-down); }
.rate-bar-item small{ font-size: 11.5px; }
.rate-bar.is-unavailable .rate-bar-item b{ color: var(--text-muted); }

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.header-brand{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.logo{
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo-img{
  height: 34px;
  width: auto;
  display: block;
}

.main-nav{
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a{
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color .2s ease;
}
/* دسکتاپ باریک: منوی کاربر واردشده (پنج لینک با عنوان‌های بلندتر) کنار سه آیکون و «خروج» فشرده می‌شود تا در یک خط جا شود */
@media (min-width: 861px) and (max-width: 1000px){
  .main-nav{ gap: 14px; }
  .main-nav a{ font-size: 13px; }
  /* کاربر واردشده شش لینک دارد (با «بررسی سند معامله»)؛ فاصله‌ها کمتر تا «خروج» از کادر بیرون نزند */
  .main-nav:has(.nav-panel){ gap: 8px; }
  .header-actions:has(#logoutBtn){ gap: 6px; }
  .header-actions #logoutBtn{ padding: 8px 12px; }
}
@media (min-width: 1001px) and (max-width: 1100px){
  .main-nav:has(.nav-panel){ gap: 20px; }
}
.main-nav a:hover{ color: var(--text); }
.main-nav a.is-active{ color: var(--accent); }

/* بنر پذیرش نسخه جدید قوانین */
.terms-banner{ display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: rgba(239, 146, 28, .1); border-bottom: 1px solid #EF921C; font-size: 14px; }
.terms-banner a{ color: var(--accent); text-decoration: underline; }
.terms-banner .btn{ padding: 6px 14px; font-size: 13px; }
/* خروج در منوی موبایل؛ در دسکتاپ دکمه خروج در هدر است */
.main-nav .nav-logout{ display: none; text-align: right; color: var(--error, #E5484D); font-size: 14px; }

.header-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-actions .btn{ padding: 8px 18px; }

/* آیکون‌های هدر کاربر واردشده: پروفایل، پشتیبانی، اعلان‌ها (محدوده کلیک ۴۰×۴۰) */
.header-icon{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  color: var(--text);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.header-icon:hover, .header-icon[aria-expanded="true"]{ color: var(--accent); border-color: var(--accent); }
.header-icon:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }
.header-icon.is-active{ color: var(--accent); border-color: var(--accent); background: rgba(22, 217, 126, .08); }
.header-badge{
  position: absolute;
  top: -6px;
  inset-inline-start: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--error);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.header-badge[hidden]{ display: none; }

/* پنل اعلان‌ها زیر زنگوله */
.notice-wrap{ position: relative; }
.notice-panel{
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 440px;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  z-index: 120;
  text-align: right;
}
.notice-panel[hidden]{ display: none; }
.notice-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-border);
  font-weight: bold;
  font-size: 14px;
}
.notice-head button{ font-size: 12.5px; color: var(--accent); font-weight: normal; }
.notice-head button:disabled{ color: var(--text-muted); cursor: default; }
.notice-list{ overflow-y: auto; overscroll-behavior: contain; }
.notice-item{
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
  overflow-wrap: anywhere;   /* شناسه تراکنش یا نشانی بلند از کادر بیرون نزند */
}
.notice-item:last-child{ border-bottom: none; }
a.notice-item:hover{ background: var(--bg-soft); }
.notice-item strong{ display: block; color: var(--text); font-size: 13.5px; }
.notice-item.is-unread strong::before{
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.notice-item time{ display: block; font-size: 11.5px; margin-top: 2px; }
.notice-empty, .notice-error{ padding: 22px 14px; font-size: 13px; color: var(--text-muted); text-align: center; }
.notice-error{ color: var(--error); }
.notice-more{ padding: 10px 14px; font-size: 13px; color: var(--accent); border-top: 1px solid var(--card-border); }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
}
.nav-toggle span{
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* ===== Hero + Features (پس‌زمینه‌ی مشترک) ===== */
.hero-features{
  position: relative;
}

.hero{
  position: relative;
  min-height: 440px;
  padding: 24px 0;
  background-image: var(--hero-bg-image);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
  background-color: var(--bg);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero::after{
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, var(--bg) 92%);
  pointer-events: none;
}
.hero-inner{
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: flex-end; /* چون dir=rtl است، flex-end یعنی سمت چپ صفحه */
}

/* در دسکتاپ/تبلت پنهان است؛ عکس همان پس‌زمینه‌ی .hero است. فقط در موبایل به‌عنوان بلوک جدا نمایش داده می‌شود */
.hero-image{
  display: none;
}

/* فقط این کارت کدنویسی شده؛ بقیه بخش هیرو تصویر پس‌زمینه است */
.calculator-card{
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

.calc-tabs{
  display: flex;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 14px;
}
.calc-tab{
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 14px;
  color: var(--text-muted);
  transition: background .2s ease, color .2s ease;
}
.calc-tab.is-active{
  background: var(--accent);
  color: var(--accent-contrast);
}
/* تب فروش همیشه قرمز است: انتخاب‌نشده کم‌رنگ، انتخاب‌شده پر (تب خرید سبز می‌ماند) */
.calc-tab[data-type="sell"]{ color: var(--error); background: var(--error-soft); }
.calc-tab[data-type="sell"]:hover{ background: rgba(229, 72, 77, .2); }
.calc-tab[data-type="sell"].is-active{ background: var(--error); color: var(--error-contrast); }
.calc-tab:focus-visible{ outline: 2px solid var(--text); outline-offset: 2px; }
/* دکمه ماشین‌حساب در تب فروش («فروش تتر») هم‌رنگ تب فروش (درخواست مالک ۱۴۰۵/۰۷/۲۴) */
#calcGo.is-sell{ background: var(--error); color: var(--error-contrast); }
#calcGo.is-sell:hover{ background: var(--error-dark); }

.calc-field label{
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.calc-input{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  transition: border-color .2s ease;
}
.calc-input:focus-within{ border-color: var(--accent); }
.calc-input input{
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  font-weight: bold;
}
/* متن راهنمای کادر خالی (بدون عدد پیش‌فرض، تصمیم مالک ۱۴۰۵/۰۷/۲۶) */
.calc-input input::placeholder{ color: var(--text-muted); font-size: 14px; font-weight: normal; opacity: 1; }
.calc-unit{
  font-size: 13px;
  color: var(--text-muted);
  font-weight: bold;
  flex-shrink: 0;
}

/* ترتیب دو کادر را تب تعیین می‌کند (خرید: تومان ← تتر | فروش: تتر ← تومان)؛ دکمه «جابجایی» حذف شده است */
.calc-fields{ display: flex; flex-direction: column; gap: 12px; }

.calculator-card .btn-block{ margin-top: 14px; }
.calc-rate{ margin-top: 12px; font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; }

.calc-note{
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.calc-note-icon{
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-style: italic;
}

/* ===== Features ===== */
.features{
  padding: 90px 0;
  text-align: center;
}
.section-title{ font-size: 28px; margin-bottom: 12px; }
.section-subtitle{ color: var(--text-muted); font-size: 15px; margin-bottom: 56px; }

.features-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.feature-item{
  padding: 0 30px;
  border-inline-start: 1px solid var(--card-border);
}
.feature-item:first-child{ border-inline-start: none; }

.feature-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(22, 217, 126, .12);
  color: var(--accent);
  margin-bottom: 18px;
}
.feature-item h3{ font-size: 17px; margin-bottom: 8px; }
.feature-item p{ font-size: 13.5px; color: var(--text-muted); }

/* ===== بخش دوم لندینگ: نحوه انجام معامله + کارت تتر + چرا تترهاب =====
   فقط HTML و CSS (بدون تصویر پس‌زمینه). رنگ‌ها و گردی‌ها همان توکن‌های سایت‌اند.
   دسکتاپ: مراحل (۲×۲) کنار کارت تتر | تبلت: زیر هم، مراحل ۲×۲ | موبایل: همه تک‌ستونه. */
.home-info{
  position: relative;
  background-color: var(--bg);
  border-top: 1px solid var(--card-border);
}
.home-info-inner{
  padding-top: 48px;
  padding-bottom: 56px;
}
.home-top{ display: block; }   /* کارت قیمت تتر به نوار زیر هدر رفت؛ «نحوه انجام معامله» تمام عرض است */

.subsection{ margin-top: 56px; }
.subsection-title{
  font-size: 20px;
  margin-bottom: 20px;
}

/* کارت پایه این بخش (مات، هم‌رنگ کارت‌های سایت) */
.info-card{
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
}

/* ----- چرا تترهاب (کارت‌های اعتماد) ----- */
.trust-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.trust-card{
  padding: 22px 18px;
  text-align: right;
}
.trust-card .feature-icon{
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: rgba(22, 217, 126, .12);
  margin-bottom: 14px;
}
.trust-card h4{ font-size: 15px; margin-bottom: 7px; }
.trust-card p{ font-size: 13px; color: var(--text-muted); line-height: 1.75; }

/* ----- نحوه انجام معامله (نام کلاس‌ها جدا از «.steps» صفحه واریز در order.css) ----- */
.how{ text-align: right; }
.how .section-title{ font-size: 26px; margin-bottom: 8px; }
.how .section-subtitle{ margin-bottom: 22px; }
.how-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.how-step{
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
}
.how-num{
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(22, 217, 126, .12);
  border: 1px solid rgba(22, 217, 126, .35);
  color: var(--accent);
  font-weight: bold;
  font-size: 15px;
}
.how-step h4{ font-size: 15px; margin-bottom: 6px; }
.how-step p{ font-size: 13px; color: var(--text-muted); line-height: 1.75; }


/* ===== Footer ===== */
.site-footer{
  padding: 12px 0 8px;
  line-height: 1.4;
  border-top: 1px solid var(--card-border);
}
.footer-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--card-border);
}
.footer-nav{
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-nav a{
  font-size: 14px;
  color: var(--text-muted);
}
.footer-nav a:hover{ color: var(--text); }

/* بخش دوم فوتر: آیکون شبکه‌های اجتماعی، زیر منو و همیشه وسط صفحه */
.footer-social{
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
}
.footer-social a{
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color .2s ease, border-color .2s ease;
}
.footer-social a:hover{ color: var(--accent); border-color: var(--accent); }

.footer-bottom{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 900px){
  .features-grid{
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .feature-item{
    border-inline-start: none;
    border-top: 1px solid var(--card-border);
    padding: 40px 20px 0;
  }
  .feature-item:first-child{ border-top: none; padding-top: 0; }
}

/* بخش دوم لندینگ: تبلت = مراحل و کارت تتر زیر هم؛ کارت‌های اعتماد دوتایی */
@media (max-width: 960px){
  .trust-grid, .how-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px){
  .trust-grid, .how-grid{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px){
  .main-nav{
    position: absolute;
    top: 100%;
    inset-inline: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--card-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }
  .main-nav.is-open{ max-height: 260px; }
  .main-nav a{
    width: 100%;
    padding: 14px 24px;
    border-top: 1px solid var(--card-border);
  }
  .header-actions .btn-outline{ display: none; }
  .header-actions{ gap: 8px; }
  .main-nav.is-open{ max-height: 80vh; overflow-y: auto; }
  .main-nav .nav-logout{ display: block; width: 100%; padding: 14px 24px; border-top: 1px solid var(--card-border); }
  .nav-toggle{ display: flex; }
}

/* محدوده لمس دکمه‌های متنی کوچک (ارتفاع حدود ۲۰ پیکسل) در صفحه لمسی، بدون تغییر چیدمان، بزرگ‌تر می‌شود */
@media (max-width: 860px), (pointer: coarse){
  .link-btn, .row-action, .dest-delete, .auth-link, .auth-forgot, .notice-head button{ position: relative; }
  .link-btn::after, .row-action::after, .dest-delete::after, .auth-link::after, .auth-forgot::after, .notice-head button::after{
    content: '';
    position: absolute;
    inset: -8px -6px;
  }
}

@media (max-width: 640px){
  /* پنل اعلان‌ها تمام‌عرض زیر هدر باز می‌شود: زنگوله در موبایل سمت چپ هدر است و پنل ۳۴۰ پیکسلی از لبه راست صفحه بیرون می‌زد.
     با static شدن .notice-wrap مبنای جای‌گیری پنل خود .site-header است. */
  .notice-wrap{ position: static; }
  .notice-panel{
    top: calc(100% + 8px);
    inset-inline: 12px;
    width: auto;
    max-width: none;
    max-height: min(440px, calc(100vh - 90px));
    max-height: min(440px, calc(100dvh - 90px));
  }
  /* فیلد ورودی با متن کوچک‌تر از ۱۶ پیکسل در سافاری آیفون با هر لمس کل صفحه را بزرگ‌نمایی می‌کند */
  html .text-input, html .textarea, html .select, html .saved-select,
  html .wallet-input input, html .sheba-input input, html .verify-code{ font-size: 16px; }

  /* عکس‌های اختصاصی موبایل (جدا از دسکتاپ) */
  :root{
    --hero-bg-image: url('../images/hero-mobile.webp');    /* بخش اول: 1448×1086 */
  }
  /* در موبایل کارت زیر عکس می‌آید، نه روی آن؛ پس بک‌گراند مشترک خاموش و به‌جایش بلوک .hero-image استفاده می‌شود */
  .hero-features{
    background-image: none;
  }
  .hero{
    background-image: none;   /* عکس در موبایل فقط در بلوک .hero-image است، نه دوباره پشت ماشین‌حساب */
    min-height: auto;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-image{
    display: block;
    width: 100%;
    /* عکس موبایل از پایین کمی بریده می‌شود: ~۲۰٪ پایین عکس فقط تیرگی خالی است و فاصله تا ماشین‌حساب را زیاد می‌کرد */
    aspect-ratio: 1448 / 860;
    background-image: var(--hero-bg-image);
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
  }

  .hero-inner{
    justify-content: center;
    padding-top: 0;
    margin-top: -46px;   /* کارت ماشین‌حساب کمی روی لبه تیره پایین عکس بالا می‌آید */
  }

  .calculator-card{ max-width: 100%; }
  .section-title{ font-size: 23px; }
  .how .section-title{ font-size: 22px; }
  .home-info{ margin-top: 20px; }
  .home-info-inner{ padding-top: 32px; padding-bottom: 40px; }
  .subsection{ margin-top: 40px; }
  .subsection-title{ font-size: 18px; }
  .trust-card, .how-step{ padding: 16px; }
  /* موبایل: لوگو و منوی فوتر زیر هم و وسط؛ لینک‌ها با محدوده لمس بزرگ‌تر */
  .footer-top{ flex-direction: column; align-items: center; gap: 8px; }
  .footer-nav{ justify-content: center; gap: 0 20px; }
  .footer-nav a{ padding: 10px 0; }
  .footer-bottom{ flex-direction: column; align-items: center; text-align: center; }
}

/* گوشی‌های باریک (۳۲۰ پیکسل): سه آیکون هدر کاربر واردشده کنار لوگو و دکمه منو جا شوند */
@media (max-width: 359px){
  .header-inner{ gap: 8px; }
  .header-brand{ gap: 10px; }
  .header-actions{ gap: 4px; }
}

/* ابزارک گفتینو (js/goftino.js). لندینگ: آیکون شناور روی دکمه یا فیلد کم‌رنگ و غیرفعال می‌شود؛ فضای خالی پایین فوتر تا
   انتهای صفحه زیر آیکون نماند. پشتیبانی: دکمه «گفتگوی آنلاین» با شمارنده پیام خوانده‌نشده. */
#goftino_w{ transition: opacity .15s ease; }
#goftino_w.chat-bubble-off{ opacity: 0 !important; pointer-events: none !important; }
body.has-chat-bubble .site-footer{ padding-bottom: 104px; }
.chat-open{ gap: 6px; }
.chat-unread{ min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--error); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.chat-unread:empty{ display: none; }

/* نوار قیمت تتر در موبایل: یک خط، فشرده */
@media (max-width: 480px){
  .rate-bar{ font-size: 12px; }
  .rate-bar-sym{ display: none; }
  .rate-bar-prices{ gap: 12px; }
  .rate-bar-item b{ font-size: 13px; margin-inline-start: 3px; }
  .rate-bar-item small{ display: none; }
}
