/* ============================================================
   MahziarDev — Design System (Dark Neon / RTL)
   ============================================================ */

/* ---------- Fonts (self-hosted, works offline) ---------- */
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #06060b;
  --bg-2: #0a0a13;
  --surface: #10101b;
  --surface-2: #16162a;
  --surface-3: #1d1d33;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);

  --text: #edeef7;
  --text-2: #c3c8dc;
  --muted: #8e97b5;

  --neon-1: #a855f7;
  --neon-2: #22d3ee;
  --neon-3: #f472b6;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --grad: linear-gradient(135deg, #a855f7 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(168, 85, 247, .18), rgba(34, 211, 238, .14));
  --glow-1: 0 0 0 1px rgba(168, 85, 247, .35), 0 12px 40px -12px rgba(168, 85, 247, .55);
  --glow-2: 0 18px 60px -20px rgba(34, 211, 238, .5);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
  --shadow-2: 0 40px 90px -40px rgba(0, 0, 0, .95);

  --container: 1220px;
  --header-h: 72px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --t: .35s var(--ease);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.45; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
/* پیش‌فرض امن: آیکون درون‌خطی که اندازه‌ی صریح نگرفته، نباید فضای
   متن کنارش را بخورد (SVG بدون width/height در فلکس‌باکس متورم می‌شود
   و متن را به شکستن خط مجبور می‌کند). */
svg { width: 1em; height: 1em; flex: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
/* بسیار مهم: استایل نویسنده بر [hidden] غلبه می‌کند، پس هر کلاسی که
   display می‌دهد (مثل .stack یا .summary-row) عنصر hidden را پنهان
   نمی‌کند و پنل پنهان‌شده هم روی صفحه می‌ماند. این قاعده جلوی آن را می‌گیرد. */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--neon-2); outline-offset: 3px; border-radius: 6px; }

::selection { background: rgba(168, 85, 247, .45); color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #08080f; }
::-webkit-scrollbar-thumb { background: #24244a; border-radius: 99px; border: 3px solid #08080f; }
::-webkit-scrollbar-thumb:hover { background: #35356b; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 22px; }
.section { padding-block: 92px; position: relative; }
.section--tight { padding-block: 60px; }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }

/* ---------- Typography ---------- */
.display { font-size: clamp(2.1rem, 5.4vw, 4.1rem); font-weight: 900; line-height: 1.22; }
.h2 { font-size: clamp(1.5rem, 3vw, 2.35rem); font-weight: 800; }
.h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 800; }
.lead { color: var(--text-2); font-size: 1.06rem; line-height: 2; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em;
  color: var(--neon-2); text-transform: uppercase;
}
.eyebrow::before {
  content: ''; width: 22px; height: 2px; border-radius: 2px; background: var(--grad);
}
.section-head { display: grid; gap: 14px; max-width: 720px; margin-bottom: 46px; }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: 999px;
  /* ⚠️ اینجا `nowrap` نگذار. با `nowrap` دکمه هرگز نمی‌شکند، پس عرض
     کمینه‌اش کل متنِ برچسب می‌شود. روی گوشی، وقتی کاربر متن را ۲۰۰٪
     بزرگ می‌کند، دکمه‌ی «علامت‌گذاری به‌عنوان دیده‌شده» به ۳۹۸ پیکسل
     می‌رسد و کل ردیف درس را از صفحه بیرون می‌برد — و چون `body`
     `overflow-x: hidden` دارد، کاربر نمی‌تواند ببیندش.
     با `normal` هیچ‌چیز در حالت عادی عوض نمی‌شود (برچسب‌ها جا
     می‌شوند و تک‌خطی می‌مانند) و فقط وقتی واقعاً جا نشود می‌شکند. */
  font-weight: 700; font-size: .95rem; white-space: normal;
  background: var(--btn-bg); color: #0a0a12;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s, border-color .25s;
  box-shadow: 0 10px 30px -14px rgba(168, 85, 247, .8);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -14px rgba(168, 85, 247, .95); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--ghost {
  background: rgba(255, 255, 255, .04); color: var(--text);
  border-color: var(--line-2); box-shadow: none; backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .09); border-color: rgba(168, 85, 247, .6); box-shadow: 0 12px 34px -18px rgba(168, 85, 247, .7); }
.btn--outline { background: transparent; color: var(--neon-2); border-color: rgba(34, 211, 238, .45); box-shadow: none; }
.btn--outline:hover { background: rgba(34, 211, 238, .1); }
.btn--sm { padding: 9px 18px; font-size: .85rem; }
.btn--lg { padding: 16px 34px; font-size: 1.03rem; }
.btn--block { width: 100%; }
.btn--danger { background: rgba(248, 113, 113, .12); color: var(--danger); border-color: rgba(248, 113, 113, .35); box-shadow: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: background .2s, border-color .2s, color .2s;
}
.chip--neon { background: rgba(168, 85, 247, .14); border-color: rgba(168, 85, 247, .35); color: #d8b4fe; }
.chip--cyan { background: rgba(34, 211, 238, .12); border-color: rgba(34, 211, 238, .32); color: #a5f3fc; }
.chip--ok { background: rgba(52, 211, 153, .13); border-color: rgba(52, 211, 153, .32); color: #6ee7b7; }
.chip--warn { background: rgba(251, 191, 36, .13); border-color: rgba(251, 191, 36, .3); color: #fcd34d; }
.chip--free { background: rgba(52, 211, 153, .16); border-color: rgba(52, 211, 153, .4); color: #6ee7b7; }
.chip--danger { background: rgba(248, 113, 113, .14); border-color: rgba(248, 113, 113, .36); color: #fca5a5; }
button.chip:hover { background: rgba(255, 255, 255, .1); }
.chip svg { width: 14px; height: 14px; }
.chip.is-active { background: var(--grad); color: #0a0a12; border-color: transparent; font-weight: 700; }

/* ⚠️ متن سفید روی گرادیانِ صورتی/قرمز و سبز/فیروزه‌ای خوانا نبود.
   اندازه‌گیری شد: سفید روی #f472b6 → **۲.۶۵ به ۱**، و روی
   #34d399 → **۱.۹۲ به ۱**. هر دو خیلی زیر حد ۴.۵.
   متن تیره روی همان گرادیان‌ها ۵.۲ تا ۱۰.۲ می‌دهد — و این همان
   کاری است که `.chip.is-active` از قبل می‌کرد (`color: #0a0a12`
   روی `var(--grad)`)، پس با زبان طراحی سایت هم‌خوان است. */
.badge-off {
  position: absolute; inset-block-start: 14px; inset-inline-start: 14px;
  padding: 4px 11px; border-radius: 999px;
  background: linear-gradient(135deg, #f472b6, #ef4444);
  color: #0a0a12; font-size: .74rem; font-weight: 800;
  box-shadow: 0 8px 22px -10px rgba(239, 68, 68, .9);
  z-index: 2;
}
.badge-free {
  background: linear-gradient(135deg, #34d399, #06b6d4);
  box-shadow: 0 8px 22px -10px rgba(52, 211, 153, .9);
}

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
  position: relative;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.card--hover:hover { transform: translateY(-6px); border-color: rgba(168, 85, 247, .45); box-shadow: var(--glow-2); }
.card__icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid rgba(168, 85, 247, .28);
  color: var(--neon-2); margin-bottom: 16px;
}
.card__icon svg { width: 24px; height: 24px; }

/* ---------- Media (cover art) ---------- */
.media {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9; background: #0a0a12;
  border-radius: var(--r) var(--r) 0 0;
}
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card--hover:hover .media img { transform: scale(1.06); }
.media__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 6, 11, .92) 0%, rgba(6, 6, 11, .1) 55%, transparent 100%);
}
.media__play {
  position: absolute; inset-block-end: 14px; inset-inline-start: 14px;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10, 10, 18, .72); border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(6px); color: #fff;
}
.media__play svg { width: 17px; height: 17px; }
.media__duration {
  position: absolute; inset-block-end: 16px; inset-inline-end: 14px;
  padding: 3px 9px; border-radius: 8px; font-size: .74rem; font-weight: 600;
  background: rgba(6, 6, 11, .8); border: 1px solid var(--line);
}

/* ---------- Course card ---------- */
.course-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.course-card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.course-card__title { font-size: 1.1rem; font-weight: 800; line-height: 1.6; }
.course-card__title:hover { color: var(--neon-2); }
.course-card__sub { color: var(--muted); font-size: .88rem; line-height: 1.85; min-height: 3.3em; }
.course-card__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: .8rem; }
.course-card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-card__meta svg { width: 14px; height: 14px; }
.course-card__foot {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price__now { font-weight: 800; font-size: 1.06rem; }
.price__old { color: var(--muted); font-size: .82rem; text-decoration: line-through; }
.price--free .price__now { color: var(--ok); }
/* در ستون خرید صفحه‌ی دوره، قیمت قبلی بالای قیمت فعلی بنشیند */
.price--stack { flex-direction: column-reverse; align-items: flex-start; gap: 0; }
.price--stack .price__now { font-size: 1.7rem; line-height: 1.35; }
.price--stack .price__old { font-size: .9rem; }

.rating { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 700; color: var(--warn); }
.rating svg { width: 14px; height: 14px; }

/* ---------- Game card ---------- */
.game-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.game-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.game-card__title { font-size: 1.06rem; font-weight: 800; }
.game-card__title small { display: block; font-size: .78rem; color: var(--muted); font-weight: 500; }
.game-card__platforms { display: flex; flex-wrap: wrap; gap: 6px; }
.game-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 900;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(6, 6, 11, .72);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.site-header.is-scrolled { background: rgba(6, 6, 11, .93); box-shadow: 0 14px 40px -30px #000; }
.site-header .container { display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 900; font-size: 1.16rem; letter-spacing: -.02em; flex: none; }
.brand img { width: 36px; height: 36px; }
.brand span small { display: block; font-size: .62rem; font-weight: 500; color: var(--muted); letter-spacing: .1em; line-height: 1; margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 14px; }
.nav a {
  padding: 8px 15px; border-radius: 999px; font-size: .92rem; font-weight: 600;
  color: var(--text-2); transition: color .2s, background .2s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav a.is-active { color: #fff; background: var(--grad-soft); border: 1px solid rgba(168, 85, 247, .3); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

/* 🔒 میزبانِ عناصر حساب (لینک خریدها، چیپِ نام، دکمه‌ی خروج).
   این‌ها داخل یک `<span data-account-host>` تزریق می‌شوند. `span` به‌طور
   پیش‌فرض inline است، ولی `.icon-btn` با `display: grid` بلوک می‌شود —
   و مرورگر محتوای یک عنصر inline را دور فرزندِ بلوکی به «بلوکِ بی‌نام»
   می‌شکند. نتیجه: آن سه عنصر **زیر هم** می‌چینند، نه در یک ردیف. چون هدر
   ارتفاع ثابت دارد و `align-items: center` است، این ستون از بالا و پایین
   بیرون می‌زند — یعنی همان چیزی که صاحب سایت دید:
   «خروج از حساب از ردیف خارج شده و رفته پایین‌تر» و «ایکونش رفته بالا و
   از کادر زده بیرون». یک flex صریح روی همین میزبان، تمامش می‌کند.
   ⚠️ اگر این را برداری، باگِ چیدمان بی‌صدا برمی‌گردد (هیچ خطایی نمی‌دهد). */
[data-account-host] { display: flex; align-items: center; gap: 8px; flex: none; }

.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  color: var(--text-2); transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .09); color: #fff; border-color: var(--line-2); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn__count {
  position: absolute; inset-block-start: -6px; inset-inline-end: -6px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--grad); color: #0a0a12;
  font-size: .7rem; font-weight: 800; line-height: 1;
  border: 2px solid var(--bg);
}
.icon-btn__count[hidden] { display: none; }
.burger { display: none; }

/* ---------- Drawers & mobile menu ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 950;
  background: rgba(3, 3, 8, .68); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.scrim.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; inset-block: 0; z-index: 960;
  width: min(420px, 92vw);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0d0d18, #08080f);
  transition: transform .45s var(--ease), visibility .45s;
  visibility: hidden;
}
/* توجه: در RTL خصوصیت‌های منطقی برعکس می‌شوند
   (inset-inline-start = راست ، inset-inline-end = چپ) — پس اینجا
   از خصوصیت‌های فیزیکی استفاده می‌کنیم تا لبه‌ی لنگر و جهت پنهان‌شدن
   همیشه با هم هم‌خوان باشند. */
.drawer--cart {
  left: 0; right: auto;
  border-right: 1px solid var(--line-2);
  transform: translateX(-102%);   /* لنگر چپ → بیرون راندن از چپ */
}
.drawer--cart.is-open { transform: none; visibility: visible; }
.drawer--wish {
  right: 0; left: auto;
  border-left: 1px solid var(--line-2);
  transform: translateX(102%);    /* لنگر راست → بیرون راندن از راست */
}
.drawer--wish.is-open { transform: none; visibility: visible; }

.mobile-menu {
  position: fixed; inset-block: 0; right: 0; left: auto; z-index: 960;
  width: min(360px, 88vw);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0d0d18, #08080f);
  border-left: 1px solid var(--line-2);
  padding: 22px;
  transform: translateX(102%);    /* لنگر راست → بیرون راندن از راست */
  transition: transform .45s var(--ease), visibility .45s;
  visibility: hidden;
  overflow-y: auto;
}
.mobile-menu.is-open { transform: none; visibility: visible; }

.drawer__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 22px; border-bottom: 1px solid var(--line); flex: none;
}
.drawer__title { font-size: 1.06rem; font-weight: 800; display: flex; align-items: center; gap: 9px; flex: 1; white-space: nowrap; }
.drawer__title svg { width: 20px; height: 20px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer__foot { flex: none; padding: 20px 22px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .02); }

.mobile-menu__nav { display: grid; gap: 6px; margin-bottom: 26px; }
.mobile-menu__nav a {
  padding: 13px 16px; border-radius: 14px; font-weight: 600;
  background: rgba(255, 255, 255, .03); border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.mobile-menu__nav a:hover, .mobile-menu__nav a.is-active {
  background: var(--grad-soft); border-color: rgba(168, 85, 247, .3); color: #fff;
}
.mobile-menu__foot { margin-top: auto; display: grid; gap: 10px; }

/* ---------- Cart line items ---------- */
.cart-line {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line__img {
  width: 78px; height: 56px; border-radius: 10px; overflow: hidden; flex: none;
  border: 1px solid var(--line); background: #0a0a12;
}
.cart-line__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.cart-line__name { font-weight: 700; font-size: .92rem; }
.cart-line__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.qty button {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-2); font-weight: 800; transition: background .2s, color .2s;
}
.qty button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.qty span { min-width: 26px; text-align: center; font-size: .86rem; font-weight: 700; }
.qty button svg { width: 13px; height: 13px; }
.link-danger { color: var(--danger); font-size: .78rem; font-weight: 600; }
.link-danger:hover { text-decoration: underline; }

.summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; padding: 6px 0; }
.summary-row--total { font-size: 1.08rem; font-weight: 800; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }

.empty-state { text-align: center; padding: 46px 20px; display: grid; gap: 12px; justify-items: center; }
.empty-state svg { width: 54px; height: 54px; color: #3a3a5e; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; inset-block-end: 26px; inset-inline-start: 50%;
  transform: translateX(50%) translateY(24px);
  z-index: 1000;
  display: flex; align-items: center; gap: 11px;
  padding: 13px 22px; border-radius: 999px;
  background: rgba(16, 16, 27, .96);
  border: 1px solid rgba(168, 85, 247, .45);
  box-shadow: var(--shadow-2);
  font-size: .9rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.is-open { opacity: 1; transform: translateX(50%) translateY(0); }
.toast svg { width: 18px; height: 18px; color: var(--neon-2); flex: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: 84px 96px; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero__bg::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 78%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.orb--1 { width: 460px; height: 460px; background: #7c3aed; inset-block-start: -140px; inset-inline-end: -90px; }
.orb--2 { width: 400px; height: 400px; background: #0891b2; inset-block-end: -160px; inset-inline-start: -80px; opacity: .38; }
.orb--3 { width: 300px; height: 300px; background: #db2777; inset-block-start: 40%; inset-inline-start: 45%; opacity: .2; }

.hero__inner { position: relative; z-index: 1; display: grid; gap: 52px; grid-template-columns: 1.08fr .92fr; align-items: center; }
.hero__copy { display: grid; gap: 24px; justify-items: start; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 14px 34px; padding-top: 12px; }
.hero__stat b { display: block; font-size: 1.6rem; font-weight: 900; }
.hero__stat span { font-size: .82rem; color: var(--muted); }

/* hero visual: floating cards */
.hero__visual { position: relative; min-height: 430px; }
.float-card {
  position: absolute; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  background: var(--surface);
  animation: floaty 7s var(--ease) infinite;
}
.float-card img { width: 100%; height: 100%; object-fit: cover; }
.float-card--a { width: 70%; top: 0; right: 0; left: auto; z-index: 2; animation-delay: 0s; }
.float-card--b { width: 48%; bottom: 0; left: 0; right: auto; z-index: 1; animation-delay: 1.4s; }
.float-card--c {
  width: 54%; top: 42%; right: 14%; left: auto; z-index: 3; animation-delay: .7s;
  padding: 16px 18px; display: grid; gap: 10px;
  background: rgba(13, 13, 24, .92); backdrop-filter: blur(14px);
}
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.code-line { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.code-line--w1 { width: 78%; background: rgba(168, 85, 247, .5); }
.code-line--w2 { width: 56%; background: rgba(34, 211, 238, .45); }
.code-line--w3 { width: 88%; }
.code-line--w4 { width: 42%; background: rgba(244, 114, 182, .45); }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: rgba(255, 255, 255, .015); padding-block: 16px; }
.marquee__track { display: flex; gap: 46px; width: max-content; animation: slide 34s linear infinite; }
/* ⚠️ رنگ این نوار قبلاً #4d5474 بود. کنتراستش با پس‌زمینه‌ی صفحه
   اندازه‌گیری شد: **۲.۶۷ به ۱** — یعنی پایین‌تر از حد ۴.۵ برای متن
   معمولی، و حتی پایین‌تر از حد ۳ که برای متن بزرگ لازم است. اسم
   ابزارها (Shader Graph، Blender، Git…) متن است، نه تزئین؛ کسی که
   کم‌بینا باشد اصلاً نمی‌تواند بخواندش.
   `--muted` همان خاکستری استاندارد بقیه‌ی سایت است و روی همین
   پس‌زمینه ۶.۸ به ۱ می‌دهد. ظاهر نوار عوض نمی‌شود، فقط خوانا می‌شود. */
.marquee__track span { font-weight: 800; font-size: .95rem; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 12px; }
.marquee__track span::after { content: '◆'; font-size: .55rem; color: #2f3450; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ---------- Stats band ---------- */
.stats-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.stat-tile {
  padding: 28px 22px; border-radius: var(--r-lg); text-align: center;
  background: linear-gradient(180deg, var(--surface), rgba(10, 10, 19, .4));
  border: 1px solid var(--line);
}
.stat-tile b { display: block; font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 900; line-height: 1.3; }
.stat-tile span { color: var(--muted); font-size: .88rem; }

/* ---------- Steps / timeline ---------- */
.timeline { position: relative; display: grid; gap: 26px; padding-inline-start: 30px; }
.timeline::before {
  content: ''; position: absolute; inset-block: 6px; inset-inline-start: 7px;
  width: 2px; background: linear-gradient(180deg, var(--neon-1), var(--neon-2), transparent);
}
.timeline__item { position: relative; }
.timeline__item::before {
  content: ''; position: absolute; inset-block-start: 10px; inset-inline-start: -30px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--neon-1);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, .14);
}
.timeline__year { font-weight: 900; color: var(--neon-2); font-size: .95rem; }

/* ---------- Skill bars ---------- */
.skill { display: grid; gap: 8px; }
.skill__top { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 600; }
.skill__bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.skill__fill { height: 100%; border-radius: 99px; background: var(--grad); width: 0; transition: width 1.2s var(--ease); }

/* ---------- Testimonials ---------- */
.quote { display: grid; gap: 16px; }
.quote__stars { display: flex; gap: 3px; color: var(--warn); }
.quote__stars svg { width: 16px; height: 16px; }
.quote__text { color: var(--text-2); line-height: 2; font-size: .95rem; }
.quote__who { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; color: #0a0a12;
  font-size: .78rem;
  background: var(--grad);
}
.quote__who b { display: block; font-size: .9rem; }
/* ⚠️ قبلاً اینجا `.quote__who span` بود. ولی ساختار HTML این است:
       <div class="quote__who"><span class="avatar">…</span><span><b>…</b><span>…</span></span></div>
   یعنی آن انتخابگر خودِ `.avatar` را هم می‌گرفت و رنگش را می‌دزدید.
   `.quote__who span` (یک کلاس + یک تگ) از `.avatar` (یک کلاس)
   خاص‌تر است، پس برنده می‌شد و متن آواتار `--muted` می‌شد:
   خاکستری‌آبی روی گرادیان بنفش → **۱.۳۶ به ۱**، عملاً نامرئی.
   حالا فقط فرزندِ مستقیمی که آواتار نیست هدف گرفته می‌شود؛ متنِ نقش
   از همان ارث می‌برد، پس ظاهر عوض نمی‌شود. */
.quote__who > span:not(.avatar) { font-size: .78rem; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq__item {
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface), rgba(10, 10, 19, .5));
  overflow: hidden; transition: border-color .25s;
}
.faq__item.is-open { border-color: rgba(168, 85, 247, .42); }
.faq__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; text-align: start; font-weight: 700; font-size: .98rem;
}
.faq__q svg { width: 20px; height: 20px; color: var(--neon-2); flex: none; transition: transform .35s var(--ease); }
.faq__item.is-open .faq__q svg { transform: rotate(45deg); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height .45s var(--ease); }
.faq__a p { padding: 0 22px 20px; color: var(--text-2); font-size: .92rem; line-height: 2; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; }
.field label { font-size: .86rem; font-weight: 600; color: var(--text-2); }
.input, .textarea, .select {
  width: 100%; padding: 13px 16px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line-2);
  color: var(--text); font-size: .93rem;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.input::placeholder, .textarea::placeholder { color: #5f6889; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: rgba(168, 85, 247, .65);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, .12);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.9; }
.select { appearance: none; cursor: pointer; background-image: none; }
.select option { background: #12121e; color: var(--text); }
.field--ltr { direction: ltr; text-align: left; }

.search-wrap { position: relative; flex: 1; min-width: 220px; }
.search-wrap svg { position: absolute; inset-block-start: 50%; inset-inline-start: 15px; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-wrap .input { padding-inline-start: 44px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 32px; }
.filters__group { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Newsletter / CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: 54px;
  background: linear-gradient(135deg, rgba(168, 85, 247, .16), rgba(34, 211, 238, .12));
  border: 1px solid rgba(168, 85, 247, .3);
  display: grid; gap: 30px; grid-template-columns: 1.2fr .8fr; align-items: center;
}
.cta-band::after {
  content: ''; position: absolute; inset-block-start: -50%; inset-inline-start: -10%;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, .4), transparent 70%);
  pointer-events: none;
}
.newsletter { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.newsletter .input { flex: 1; min-width: 200px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #05050a; padding-block: 62px 30px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-col h4 { font-size: .95rem; margin-bottom: 16px; }
.footer-col ul { display: grid; gap: 10px; }
.footer-col a { color: var(--muted); font-size: .88rem; transition: color .2s, padding-inline-start .2s; }
.footer-col a:hover { color: var(--neon-2); padding-inline-start: 5px; }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--text-2);
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.socials a:hover { background: var(--grad-soft); color: #fff; border-color: rgba(168, 85, 247, .4); transform: translateY(-3px); }
.socials svg { width: 18px; height: 18px; }
.footer-bottom {
  margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: var(--muted); font-size: .82rem;
}

/* ایمیل و نشانی اینترنتی، رشته‌ی بی‌فاصله‌اند و شکسته نمی‌شوند.
   با متن ۲۰۰٪، «mahzyarmorshed6@gmail.com» حدود ۳۹۲ پیکسل عرض
   می‌گیرد — یعنی از عرض گوشی ۳۶۰ پیکسلی بیرون می‌زند و کل صفحه را
   پهن می‌کند. `anywhere` برخلاف `break-word` عرض «کمینه» را هم
   کوچک می‌کند، و همین عرض کمینه بود که ستون شبکه‌ی فوتر را پهن
   می‌کرد (خودِ شبکه ۳۱۶ بود، ستون ۳۹۲ می‌شد).
   هر جای دیگری هم که ایمیل یا نشانی نشان داده می‌شود باید همین
   قاعده را داشته باشد. */
.site-footer p, .site-footer a, .site-footer li, .site-footer span,
.footer-bottom,
#contactInfo b { overflow-wrap: anywhere; }

/* ---------- Breadcrumb ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); margin-bottom: 22px; }
.crumbs a:hover { color: var(--neon-2); }
.crumbs span { opacity: .5; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; padding-block: 62px 46px; overflow: hidden; border-bottom: 1px solid var(--line); }
.page-hero .orb { opacity: .3; }
/* هاله‌ی orb را به پس‌زمینه محو می‌کند تا لبه‌ی بریده‌ی افقی دیده نشود
   (overflow:hidden هاله را وسط ارتفاع می‌بُرد و یک خط سخت می‌ساخت) */
.page-hero::after {
  content: ''; position: absolute; inset-inline: 0; inset-block-end: 0; height: 120px;
  background: linear-gradient(to top, var(--bg) 12%, transparent);
  pointer-events: none; z-index: 0;
}
.page-hero__inner { position: relative; z-index: 1; display: grid; gap: 16px; max-width: 780px; }
.page-hero .container { position: relative; z-index: 1; }

/* ---------- Course detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1.55fr .95fr; gap: 40px; align-items: start; }
.detail-hero { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); }
/* 🚨 `height: auto` این‌جا **حیاتی** است، نه تزئینی. برش نده.
   ------------------------------------------------------------
   کاورِ صفحه‌ی دوره با `width="800" height="450"` ساخته می‌شود
   (`heroMediaHtml` در `page-course.js`) و آن دو **صفتِ HTML** در
   مرورگر به `width/height` تبدیل می‌شوند — یعنی یک ارتفاعِ قطعیِ
   ۴۵۰ پیکسل. `aspect-ratio` فقط وقتی کار می‌کند که یک بُعد `auto`
   باشد؛ این‌جا هیچ‌کدام نبودند، پس نسبت **کامل نادیده گرفته می‌شد**.

   نتیجه روی موبایل: جعبه‌ی ۲۷۴×۴۵۰ برای عکسی با نسبتِ ۱۶:۹ ⇒ عکس
   بی‌رحمانه از دو طرف بریده می‌شد و «از کادر بیرون‌زده» دیده می‌شد.
   روی دسکتاپ عرض ~۷۰۰ پیکسل است و ۷۰۰×۴۵۰ تصادفاً نزدیکِ ۱۶:۹
   می‌شود — پس باگ **فقط روی موبایل** دیده می‌شد و روی دسکتاپ
   سالم به‌نظر می‌رسید. (خواسته‌ی صاحب سایت: «برای موبایل عکس دوره
   خوب نمایش داده نمیشه و از کادر میزنه بیرون».)

   ⚠️ و چرا هارنس‌های قبلی این را نگرفتند: `audit-devices.js` عرضِ
   چیدمان را می‌سنجد و `verify-images.js` وجودِ تصویر را — هیچ‌کدام
   **نسبتِ رندرشده** را نمی‌سنجیدند. باگی که از کادر بیرون نمی‌زند
   ولی تصویر را می‌بُرد، از هر دو سنجه رد می‌شد. حالا
   `audit-devices.js` نسبتِ واقعی را با `aspect-ratio` اعلام‌شده
   مقایسه می‌کند. */
.detail-hero img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }

/* ---------- ویدیوی معرفی روی کاور دوره ----------
   دکمه کل کاور را می‌پوشاند؛ با زدنش عکس و دکمه می‌روند و ویدیو می‌آید. */
.detail-hero__media, .detail-hero__media iframe, .detail-hero__media video {
  display: block; width: 100%; aspect-ratio: 16/9; border: 0; background: #000;
}
.hero-play {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; gap: 12px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(4, 4, 10, .18), rgba(4, 4, 10, .64));
  border: 0; cursor: pointer; color: #fff;
  font: inherit; text-align: center;
  transition: background .2s;
}
.hero-play:hover { background: linear-gradient(180deg, rgba(4, 4, 10, .06), rgba(4, 4, 10, .52)); }
.hero-play:focus-visible { outline: 2px solid var(--neon-1); outline-offset: -4px; }
.hero-play__ico {
  width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #0a0a12;
  box-shadow: 0 18px 46px -18px rgba(168, 85, 247, .9);
  transition: transform .2s;
}
.hero-play__ico svg { width: 26px; height: 26px; }
.hero-play:hover .hero-play__ico { transform: scale(1.07); }
.hero-play__t { font-weight: 700; font-size: .95rem; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.buy-card { position: sticky; inset-block-start: calc(var(--header-h) + 22px); display: grid; gap: 18px; }
.lesson-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; border-radius: var(--r);
  background: rgba(255, 255, 255, .028); border: 1px solid var(--line);
}
.lesson-row__num {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  background: var(--grad-soft); border: 1px solid rgba(168, 85, 247, .3); color: var(--neon-2);
}

/* ردیف سرفصل که خودش دکمه است — روی هر درس می‌زنی.
   ⚠️ `<button>` پیش‌فرض‌های مرورگر را با خودش می‌آورد (فونت سیستم،
   متن وسط‌چین، عرض به‌اندازه‌ی محتوا). بدون این بازنشانی، ردیف در
   حالت RTL وسط‌چین و باریک می‌شد و شبیه بقیه‌ی ردیف‌ها نبود. */
.lesson-row--btn {
  width: 100%; font: inherit; color: inherit; text-align: start;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.lesson-row--btn:hover { border-color: rgba(168, 85, 247, .45); background: rgba(168, 85, 247, .07); }
.lesson-row--btn:focus-visible { outline: 2px solid var(--neon-1); outline-offset: 2px; }
.lesson-row--btn.is-locked:hover { border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .06); }
.lesson-row--btn .lesson-row__num { width: auto; min-width: 34px; padding-inline: 6px; }
.lesson-row--btn.is-locked .lesson-row__num {
  background: rgba(255, 255, 255, .03); border-color: var(--line); color: var(--muted);
}
.lesson-row__t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.lesson-row__t b { font-size: .95rem; font-weight: 700; line-height: 1.7; }
.syl-chapter { display: grid; gap: 10px; }
.syl-chapter__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding-top: 6px;
}
.syl-chapter__head b { font-size: .95rem; color: var(--text-2); }
.check-list { display: grid; gap: 12px; }
.check-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: .93rem; line-height: 1.9; }
.check-list svg { width: 19px; height: 19px; color: var(--ok); flex: none; margin-top: 5px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 26px; flex-wrap: wrap; }
.tab { padding: 12px 20px; font-weight: 700; font-size: .92rem; color: var(--muted); border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.tab:hover { color: var(--text); }
.tab.is-active { color: #fff; border-bottom-color: var(--neon-1); }
.tab-panel[hidden] { display: none; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin-block: 40px; }
.notice {
  display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--r);
  background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .25);
  font-size: .88rem; color: #a5f3fc; line-height: 1.9;
}
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 4px; }
/* ---------- هشدارِ پوشه‌ی اسپم ----------
   سایت با `mail()` پیش‌فرضِ PHP می‌فرستد، پس جیمیل تقریباً همیشه
   اول بار آن را اسپم می‌کند. هرجا قولِ ایمیل می‌دهیم، این کادر هم
   هست تا کاربر بداند کجا را ببیند. رنگش عمداً کهربایی است، نه
   قرمز: خطا نیست، یک راهنماست. */
.spam-hint {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin-top: 12px;
  background: rgba(251, 191, 36, .07);
  border: 1px solid rgba(251, 191, 36, .28);
  border-radius: var(--r);
  font-size: .84rem; color: #fde68a; line-height: 1.9;
}
.spam-hint > svg { width: 20px; height: 20px; flex: none; margin-top: 4px; color: #fbbf24; }
.spam-hint > div { flex: 1; min-width: 0; }
.spam-hint b { color: #fff; }
.spam-hint .ltr { direction: ltr; unicode-bidi: embed; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Scroll reveal (JS-gated so content is never stuck hidden) ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; }
  .float-card, .marquee__track { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero__visual { min-height: 360px; max-width: 560px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .buy-card { position: static; }
  .cta-band { grid-template-columns: minmax(0, 1fr); padding: 40px 30px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: grid; }
  .header-actions .btn--header { display: none; }
}
/* ---------- هدر در موبایل ----------
   🚨 باگِ واقعیِ صاحب سایت: «تو موبایل اون نوار بالایی بزرگ‌تر از صفحه
   می‌شود و باید زوم‌اوت کنی و بقیه‌ی صفحه سیاه می‌شود.»

   اندازه‌گیری‌شده (نه حدس): محتوای هدر در **همه‌ی** عرض‌ها ثابت است و
   کوچک نمی‌شود، چون هیچ‌جای موبایل اندازه‌ی لوگو، دکمه‌های آیکونی،
   چیپِ حساب و فاصله‌ها را کم نمی‌کرد:

     مهمان      → ۲۲ + ۱۵۱ + ۲۰ + ۱۹۲ + ۲۲ = ۳۸۵px
     واردشده    → ۲۲ + ۱۵۱ + ۲۰ + ۲۹۷ + ۲۲ = ۴۹۰px
                  (سه عنصرِ حساب ۱۰۵px اضافه می‌کنند)

   یعنی روی گوشیِ ۳۲۰px صفحه ۳۸۵px می‌شود و مرورگر مجبور است
   زوم‌اوت کند. راه‌حل: در موبایل همه‌چیز را واقعاً کوچک کن، و زیرِ
   ۴۳۰px نامِ نوشتاری برند را بردار و فقط لوگو بگذار (نام در
   `<title>` و در فوتر هست، پس چیزی گم نمی‌شود).

   ⚠️ `min-width: 0` و `flex: 0 1 auto` روی `.brand` عمدی‌اند: تورِ
   اطمینان. اگر روزی چیزی به برند اضافه شد، متن کوتاه می‌شود و صفحه
   سرریز نمی‌کند. (سرریزِ افقی ⇒ زوم‌اوت ⇒ نوارِ سیاه.) */
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .site-header .container { gap: 10px; padding-inline: 14px; }
  .brand { flex: 0 1 auto; min-width: 0; gap: 8px; font-size: 1rem; }
  .brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand img { width: 30px; height: 30px; }
  .brand span small { display: none; }
  .header-actions { gap: 6px; flex: none; }
  [data-account-host] { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; border-radius: 11px; }
  .icon-btn svg { width: 17px; height: 17px; }
  /* ⚠️ با پیشوندِ `.site-header` نوشته شده چون قاعده‌ی اصلیِ
     `.account-chip` **پایین‌تر** در همین فایل است و در برخوردِ
     هم‌وزن، آن یکی برنده می‌شد — یعنی چیپ کوچک نمی‌شد و هیچ خطایی
     هم نمی‌داد. (همان دسته‌ی «تغییر اعمال شد ولی اثر نکرد».) */
  .site-header .account-chip { padding: 3px 5px; }
  .site-header .account-chip__av { width: 24px; height: 24px; font-size: .74rem; }
  .icon-btn__count { inset-block-start: -5px; inset-inline-end: -5px; min-width: 18px; height: 18px; font-size: .64rem; }
}

/* روی باریک‌ترین گوشی‌ها نامِ نوشتاری جا نمی‌شود (۳۰۴px لازم است از
   ۳۲۰px موجود) — پس فقط لوگو می‌ماند. */
@media (max-width: 430px) {
  .site-header .container { gap: 8px; padding-inline: 12px; }
  .header-actions, [data-account-host] { gap: 4px; }
  .brand span { display: none; }
}

@media (max-width: 640px) {
  .section { padding-block: 62px; }
  .hero { padding-block: 52px 66px; }
  .grid { gap: 18px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 22px; }
  .cta-band { padding: 32px 22px; border-radius: var(--r-lg); }
  .hero__visual { min-height: 300px; }
  .float-card--a { width: 74%; }
  .float-card--b { width: 56%; }
  .float-card--c { width: 64%; padding: 13px 15px; }
  .timeline { padding-inline-start: 24px; }
}

/* ============================================================
   لایه‌ی فروش: تسویه حساب، پنل کاربری و پخش‌کننده
   ============================================================ */

/* ---------- مراحل تسویه ---------- */
.stepper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 34px; }
.stepper__item {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03); color: var(--muted);
  font-size: .88rem; font-weight: 600;
}
.stepper__item.is-active { color: #fff; border-color: rgba(168, 85, 247, .5); background: var(--grad-soft); }
.stepper__item.is-done { color: var(--ok); border-color: rgba(52, 211, 153, .35); }
.stepper__num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: .78rem; font-weight: 800; background: rgba(255, 255, 255, .08); flex: none;
}
.stepper__item.is-active .stepper__num { background: var(--grad); color: #0a0a12; }
.stepper__item.is-done .stepper__num { background: rgba(52, 211, 153, .2); color: var(--ok); }
.stepper__sep { flex: 1; height: 1px; background: var(--line); min-width: 12px; }

/* ---------- ردیف‌های سفارش ---------- */
.order-line { display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); align-items: center; }
.order-line:last-child { border-bottom: 0; }
.order-line__img { width: 84px; height: 58px; border-radius: 10px; overflow: hidden; flex: none; border: 1px solid var(--line); }
.order-line__img img { width: 100%; height: 100%; object-fit: cover; }
.order-line__main { flex: 1; min-width: 0; display: grid; gap: 4px; }

/* ---------- درگاه شبیه‌سازی‌شده ---------- */
.gateway { border: 1px solid rgba(168, 85, 247, .35); border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(180deg, #12122a, #0b0b16); }
.gateway__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid var(--line); font-size: .85rem;
}
.gateway__body { padding: 26px; display: grid; gap: 18px; }
.card-visual {
  border-radius: 16px; padding: 20px; display: grid; gap: 22px;
  align-content: space-between; min-height: 158px;
  background: linear-gradient(135deg, #3b1e6e, #0e7490);
  border: 1px solid rgba(255, 255, 255, .16);
}
.card-visual__chip { width: 40px; height: 30px; border-radius: 6px; background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.card-visual__num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1rem; letter-spacing: .1em; direction: ltr; text-align: left; color: #fff; }
.card-visual__row { display: flex; justify-content: space-between; gap: 12px; font-size: .76rem; color: rgba(255, 255, 255, .78); }

/* ---------- نوار پیشرفت ---------- */
.progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress__fill { height: 100%; border-radius: 99px; background: var(--grad); transition: width .5s var(--ease); }

/* ---------- رسید سفارش ---------- */
.receipt { border: 1px solid rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .06); border-radius: var(--r-lg); padding: 30px; display: grid; gap: 20px; }
.receipt__head { display: flex; align-items: center; gap: 14px; }
.receipt__icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(52, 211, 153, .15); color: var(--ok); flex: none; }
.receipt__icon svg { width: 26px; height: 26px; }
.receipt__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.receipt__cell { display: grid; gap: 5px; padding: 14px 16px; border-radius: var(--r); background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.receipt__cell span { font-size: .75rem; color: var(--muted); }
.receipt__cell b { font-size: .95rem; }

/* ---------- جدول سفارش‌ها ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(255, 255, 255, .012); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .87rem; min-width: 600px; }
table.tbl th, table.tbl td { padding: 14px 18px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl th { background: rgba(255, 255, 255, .03); font-weight: 700; color: var(--text-2); font-size: .8rem; }
table.tbl tr:last-child td { border-bottom: 0; }

/* ---------- فاکتورهای خرید (صفحه‌ی دوره‌های خریداری‌شده) ----------
   ⚠️ چرا `<details>` و نه یک جدول ساده: فاکتور باید هم «خلاصه» باشد
      (تا کاربر سریع همه‌ی خریدها را ببیند) و هم «کامل» (اقلام،
      تخفیف، کد پیگیری). اگر همه‌چیز همیشه باز باشد، با پنج خرید
      صفحه یک دیوار متن می‌شود؛ اگر همه بسته باشد، کاربر باید
      بگردد. `<details>` هر دو را می‌دهد و با کیبورد هم کار می‌کند.

   ⚠️ ستون‌ها با عرض ثابت چیده شده‌اند، نه `1fr` تنها. در RTL
      ستونِ `1fr` کوچک‌تر از عرض کمینه‌اش نمی‌شود و جدول از کادر
      بیرون می‌زند — درسی که این پروژه گران پرداختش. */
.invoice-list { display: grid; gap: 10px; }
.invoice {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .012); overflow: hidden;
}
.invoice__head {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr) 92px 138px 104px;
  align-items: center; gap: 12px;
  padding: 14px 18px; font-size: .87rem;
  cursor: pointer; list-style: none;
}
.invoice__head::-webkit-details-marker { display: none; }
.invoice__head--labels {
  cursor: default; background: rgba(255, 255, 255, .03);
  color: var(--text-2); font-weight: 700; font-size: .78rem;
}
.invoice__head:hover { background: rgba(255, 255, 255, .03); }
.invoice__head--labels:hover { background: rgba(255, 255, 255, .03); }
.invoice__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  direction: ltr; text-align: right; font-weight: 700; letter-spacing: .02em;
}
.invoice__date { color: var(--text-2); }
.invoice__qty { color: var(--muted); }
.invoice__total { text-align: left; }
.invoice__body {
  padding: 4px 18px 20px; border-top: 1px solid var(--line);
  display: grid; gap: 18px;
}
.invoice__meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
}
.invoice__meta > div {
  display: grid; gap: 5px; padding: 12px 14px; border-radius: var(--r);
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line);
}
.invoice__meta b { font-size: .92rem; word-break: break-all; }

/* ⚠️ در عرض کم، ستون‌های ثابت سرریز می‌کنند. اینجا به یک ردیفِ
   چندخطی تبدیل می‌شود: شماره‌ی سفارش خط خودش را می‌گیرد و بقیه
   کنار هم می‌نشینند. بدون این، روی موبایل جدول از کادر می‌زد بیرون. */
@media (max-width: 720px) {
  .invoice__head--labels { display: none; }
  .invoice__head {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px 14px; padding: 14px 16px;
  }
  .invoice__id { flex: 1 0 100%; }
  .invoice__date { margin-inline-end: auto; }
  .invoice__total { text-align: right; }
  .invoice__body { padding: 4px 14px 18px; }
}

/* ---------- چاپ فاکتور ----------
   ⚠️ بدون این بخش، کاربر «چاپ» می‌زند و یک صفحه‌ی مشکی با متن
      نامرئی می‌گیرد. دو چیز اینجا حیاتی است:
        ۱) پس‌زمینه‌ی تیره و متن گرادیانی روی کاغذ سفید چاپ
           نمی‌شوند (`.grad-text` با background-clip ساخته شده).
        ۲) هدر، فوتر و دکمه‌ها روی فاکتور معنا ندارند. */
@media print {
  .site-header, .site-footer, .page-hero, #purchasesStats,
  .drawer, .scrim, .toast, .modal, .btn, .icon-btn { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .card, .invoice, .invoice__meta > div {
    background: #fff !important; border-color: #c8c8c8 !important;
    box-shadow: none !important;
  }
  .invoice__head, .invoice__head--labels { background: #f1f1f1 !important; color: #111 !important; }
  .invoice__head--labels { display: grid !important; }
  .chip { background: #f4f4f4 !important; border-color: #c8c8c8 !important; color: #111 !important; }
  .grad-text { background: none !important; -webkit-text-fill-color: #111 !important; color: #111 !important; }
  .muted, .tiny, .small, .invoice__date, .invoice__qty { color: #444 !important; }
  .invoice { break-inside: avoid; page-break-inside: avoid; }
  a { text-decoration: none; color: #111 !important; }
}

/* ---------- کلید فعال‌سازی ---------- */
.license {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr;
  text-align: center; letter-spacing: .1em; padding: 10px 14px;
  border-radius: var(--r-sm); background: rgba(0, 0, 0, .35);
  border: 1px dashed rgba(34, 211, 238, .4); color: #a5f3fc; font-weight: 700;
}

/* ---------- پخش‌کننده‌ی دوره ---------- */
.player-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; align-items: start; }
/* ستونِ چپِ صفحه‌ی درس: ویدیو + دیوارِ پرسش‌وپاسخِ همان درس.
   🚨 چرا یک پوششِ تازه: `player-grid` دو ستون است؛ اگر دیوار را
      فرزندِ مستقیمِ گرید می‌کردیم، می‌رفت در ردیفِ دوم و زیرِ
      ستونِ راست هم کشیده می‌شد. با این پوشش، دیوار زیرِ ویدیو
      می‌ماند و ستونِ سرفصل دست‌نخورده. */
.player-grid__main { display: grid; gap: 18px; min-width: 0; }
.stage { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #05050a; }
.stage__video {
  position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(168, 85, 247, .22), transparent 62%), #05050a;
}
.stage__play {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #0a0a12;
  box-shadow: 0 18px 50px -18px rgba(168, 85, 247, .9);
  transition: transform .25s var(--ease);
}
.stage__play:hover { transform: scale(1.07); }
.stage__play svg { width: 30px; height: 30px; }
.stage__note { position: absolute; inset-block-end: 14px; inset-inline: 14px; font-size: .75rem; color: rgba(255, 255, 255, .45); text-align: center; }
/* پخش‌کننده‌ی واقعی: فایل خودمان با تگ video، سرویس‌های اشتراکی با iframe */
.stage__player { width: 100%; height: 100%; object-fit: contain; background: #05050a; }
.stage__embed { position: absolute; inset: 0; }
.stage__embed iframe { display: block; width: 100%; height: 100%; border: 0; }

/* 🖼 دروازه‌ی «تامنیل» — عکسِ درس + دکمه‌ی پخش، تا وقتی کاربر
   کلیک نکرده. خواسته‌ی صاحب سایت: «تا وقتی کاربر روی ویدیو کلیک
   نکرده تامنیل ویدیو براش پخش بشه... بعد گزینه پخش رو که زد ویدیو
   بیاد بالا».

   ⚠️ `position: absolute; inset: 0` لازم است تا عکس **دقیقاً همان
      کادرِ ۱۶:۹** را پر کند که ویدیو بعداً پر می‌کند. اگر عکس جریانِ
      عادیِ صفحه را می‌گرفت، با آمدنِ ویدیو ارتفاعِ قاب می‌پرید و
      کلِ صفحه یک دفعه جابه‌جا می‌شد.
   ⚠️ `object-fit: cover` تا تامنیلِ مربعی یا عمودی **کشیده نشود**.
      (`contain` حاشیه‌ی سیاه می‌سازد؛ `fill` عکس را دفرمه می‌کند.)
   ⚠️ پرده‌ی نیمه‌تیره (`gate-veil`) فقط برای این است که دکمه‌ی پخش
      روی تامنیلِ روشن دیده شود. بدونِ آن، روی یک عکسِ سفید دکمه
      گم می‌شود. */
.stage__gate { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.stage__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage__gate-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 5, 10, .12), rgba(5, 5, 10, .58));
}
.stage__gate-play {
  position: relative; z-index: 1;
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #0a0a12; border: 0; cursor: pointer; padding: 0;
  box-shadow: 0 18px 50px -16px rgba(168, 85, 247, .95);
  transition: transform .25s var(--ease);
}
.stage__gate-play:hover { transform: scale(1.08); }
.stage__gate-play svg { width: 34px; height: 34px; }
/* روی گوشی دکمه‌ی ۸۴ پیکسلی زیاد بزرگ است و بخشِ زیادی از عکس را
   می‌پوشاند. */
@media (max-width: 620px) {
  .stage__gate-play { width: 62px; height: 62px; }
  .stage__gate-play svg { width: 26px; height: 26px; }
}
.stage__lock { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 30px; }
.stage__lock svg { width: 40px; height: 40px; color: var(--neon-1); }
.stage__lock b { font-size: 1.05rem; }
.stage__lock span { max-width: 42ch; }
.stage__bar { height: 4px; background: rgba(255, 255, 255, .1); }
.stage__bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .4s var(--ease); }
.stage__meta { padding: 20px 22px; border-top: 1px solid var(--line); display: grid; gap: 12px; }

/* 📝 «توضیحات» درس — متنی که صاحب سایت برای هر درس می‌نویسد.
   ⚠️ `white-space: normal` عمدی است: خطوط با `<br>` می‌آیند (نه با
      `pre`)، چون متنِ RTL با `pre` به‌خاطرِ تودرتوییِ جهت‌ها بد
      می‌شکند. `overflow-wrap` هم لازم است تا یک آدرسِ طولانیِ داخلِ
      متن از کادر بیرون نزند. */
.lesson-desc__text { color: var(--text-2); font-size: .92rem; line-height: 2; overflow-wrap: anywhere; }

.playlist {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  max-height: 74vh; overflow-y: auto;
}
.playlist__head { position: sticky; top: 0; z-index: 2; padding: 16px 18px; background: rgba(13, 13, 24, .96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.chapter { border-bottom: 1px solid var(--line); }
.chapter__title { padding: 14px 18px; font-weight: 700; font-size: .87rem; background: rgba(255, 255, 255, .025); display: flex; justify-content: space-between; gap: 10px; }
.lesson { display: flex; align-items: center; gap: 12px; padding: 11px 18px; font-size: .85rem; cursor: pointer; border-inline-start: 3px solid transparent; transition: background .2s, border-color .2s; width: 100%; text-align: start; }
.lesson:hover { background: rgba(255, 255, 255, .045); }
.lesson.is-active { background: var(--grad-soft); border-inline-start-color: var(--neon-1); }
.lesson.is-locked { opacity: .5; cursor: not-allowed; }
.lesson__idx { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: .72rem; font-weight: 700; background: rgba(255, 255, 255, .06); }
.lesson.is-done .lesson__idx { background: rgba(52, 211, 153, .2); color: var(--ok); }
.lesson__t { flex: 1; min-width: 0; }
.lesson__d { font-size: .73rem; color: var(--muted); flex: none; }
.lesson__free { font-size: .65rem; padding: 2px 7px; border-radius: 99px; background: rgba(52, 211, 153, .16); color: #6ee7b7; flex: none; }

/* ============================================================
   📎 فایلِ دوره — ردیفِ آخرِ فهرستِ درس‌ها
   ------------------------------------------------------------
   خواسته‌ی صاحب سایت: «فایلی که برای دوره اپلود میکنم یک قسمت از
   دوره قرار بگیره... و اخر دوره باشه».

   ⚠️ این ردیف **یک درس نیست** (ویدیو و دقیقه ندارد)، ولی عمداً
   همان کلاس `.lesson` را می‌گیرد تا از بقیه‌ی ردیف‌ها جدا به نظر
   نرسد — کاربر باید حس کند «یک بخشِ دوره» است، نه یک ابزارِ
   چسبیده به آخرِ لیست. تفاوتش فقط یک نوارِ رنگیِ بالایی و آیکونِ
   متفاوت است.
   ⚠️ و چرا `.chapter--file` یک خطِ جداکننده‌ی ضخیم‌تر می‌گیرد:
   بدون آن، ردیف دقیقاً شبیه درسِ بعدی می‌شد و کاربر فکر می‌کرد
   یک درسِ دیگر هم مانده. */
.chapter--file { border-top: 2px solid rgba(168, 85, 247, .28); }
.chapter--file .chapter__title { background: rgba(168, 85, 247, .07); }
.lesson--file { font-weight: 700; }
.lesson--file .lesson__idx { background: rgba(168, 85, 247, .18); color: var(--neon-1); }
.lesson--file .lesson__idx svg { width: 15px; height: 15px; }
.lesson--file.is-locked .lesson__idx { background: rgba(255, 255, 255, .06); color: var(--muted); }

/* ✅ حالتِ «فایل آماده است» در جای ویدیو.
   ⚠️ رنگِ سبز عمدی است: کاربر باید با یک نگاه بفهمد این قفل نیست.
   و دکمه‌ی دانلود باید بزرگ باشد — روی گوشی، دکمه‌ی کوچکِ دانلود
   یعنی کاربر چند بار خطا می‌زند. */
.stage__lock--ok svg { color: var(--ok); }
.stage__lock--ok .btn { min-height: 46px; padding-inline: 28px; }

@media (max-width: 1080px) {
  /* ⚠️ اینجا `1fr` نگذار. `1fr` در واقع `minmax(auto, 1fr)` است و
     `auto` یعنی «کوچک‌تر از عرض کمینه‌ی محتوا نشو». روی گوشی، وقتی
     کاربر متن را ۲۰۰٪ بزرگ می‌کند، عرض کمینه‌ی این ستون از عرض صفحه
     بیشتر می‌شود، ستون کوچک نمی‌شود، و کل `.container` را با خودش
     ۸۴ پیکسل از صفحه بیرون می‌برد. آن‌وقت چون `body` هم
     `overflow-x: hidden` دارد، کاربر نمی‌تواند اسکرول کند و
     انتهای مسیر صفحه و متن فوتر برای همیشه بریده می‌ماند.
     با `minmax(0, 1fr)` ستون اجازه دارد کوچک شود. (خط بالاتر، حالت
     دسکتاپ، از اول همین را درست نوشته بود — این یکی جا مانده بود.) */
  .player-grid { grid-template-columns: minmax(0, 1fr); }
  .playlist { max-height: none; }
}

/* ---------- گفت‌وگوی زیر درس (سوال / کامنت) ---------- */

.discuss { margin-top: 18px; padding: 20px 22px; display: grid; gap: 18px; }
.discuss__head { display: flex; align-items: flex-start; gap: 12px; }
.discuss__icon {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  display: grid; place-items: center; background: var(--grad-soft);
  color: var(--neon-1); border: 1px solid rgba(168, 85, 247, .3);
}
.discuss__icon svg { width: 19px; height: 19px; }
.discuss form { display: grid; gap: 14px; }
.discuss__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.discuss__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.discuss__status { min-height: 1.2em; line-height: 1.7; }

@media (max-width: 620px) {
  .discuss { padding: 18px 16px; }
  .discuss__row { grid-template-columns: minmax(0, 1fr); }
}

/* انتخاب بین «سوال» و «کامنت» — رادیوی استایل‌شده، بدون جاوااسکریپت
   برای حالت انتخاب‌شده. این‌طور با reset فرم هم درست کار می‌کند. */
.seg {
  display: inline-flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, .03); width: fit-content;
}
.seg__opt { position: relative; }
.seg__opt input {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.seg__opt span {
  display: block; padding: 7px 16px; border-radius: 9px;
  font-size: .82rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: background .2s, color .2s;
  white-space: nowrap;
}
.seg__opt span:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.seg__opt input:checked + span { background: var(--grad); color: #fff; }
.seg__opt input:focus-visible + span { outline: 2px solid var(--neon-1); outline-offset: 2px; }

/* ---------- تله‌ی ربات ----------
   فیلدی که کاربر واقعی نمی‌بیندش ولی ربات‌های فرم‌پر پرش می‌کنند.
   عمداً با display:none پنهان نشده: بعضی ربات‌ها فیلد
   display:none را نادیده می‌گیرند.

   ⚠️ قبلاً اینجا left:-9999px بود. آن روش صفحه را ۹۹۹۹ پیکسل
      پهن‌تر می‌کرد و در موبایل نوار اسکرول افقی می‌ساخت — یعنی
      خودِ تله، خودِ سایت را خراب می‌کرد. حالا با الگوی استاندارد
      «sr-only» پنهان می‌شود: یک پیکسل، بریده، بدون جابه‌جا کردن
      چیزی و بدون هیچ اثری روی چیدمان. */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

/* ---------- نوار هشدار حالت توسعه ----------
   وقتی صفحه با file:// باز شده یا سرور جواب نمی‌دهد، سایت با
   مقادیر پیش‌فرض data.js کار می‌کند. این نوار توضیح می‌دهد چرا
   تغییرات پنل دیده نمی‌شود. رنگ عمداً «هشدار» است نه «خطا» —
   چیزی خراب نیست، فقط صفحه‌ی اشتباهی باز شده. */

.devbar {
  background: linear-gradient(90deg, rgba(251, 191, 36, .16), rgba(251, 191, 36, .06));
  border-bottom: 1px solid rgba(251, 191, 36, .35);
  color: var(--text);
  font-size: .82rem;
  position: relative;
  z-index: 60;
}

.devbar__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
}

.devbar__ico {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(251, 191, 36, .18);
  color: var(--warn);
}

.devbar__ico svg { width: 17px; height: 17px; }

.devbar__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.6;
}

.devbar__text b { font-size: .84rem; }
.devbar__text span { color: var(--text-2); font-size: .78rem; }
.devbar__btn { flex: none; white-space: nowrap; }

@media (max-width: 720px) {
  .devbar__inner { flex-wrap: wrap; gap: 10px; }
  .devbar__btn { width: 100%; }
}


/* ============================================================
   حساب کاربری و دیوار نظرات
   ============================================================ */

/* ---------- مودال ورود / ثبت‌نام ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 4, 10, .74);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .26s var(--ease);
}
.modal.is-open { opacity: 1; }
.modal[hidden] { display: none; }

.modal__panel {
  position: relative;
  width: min(460px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 26px 24px 24px;
  display: grid;
  gap: 16px;
  transform: translateY(14px) scale(.98);
  transition: transform .26s var(--ease);
}
.modal.is-open .modal__panel { transform: none; }

.modal__x { position: absolute; top: 14px; left: 14px; }

.modal__head { text-align: center; display: grid; gap: 6px; justify-items: center; padding-top: 6px; }
.modal__ico {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad-soft);
  border: 1px solid var(--line-2);
  color: var(--text);
}
.modal__ico svg { width: 24px; height: 24px; }
.modal__head h2 { margin: 4px 0 0; }

/* ---------- مودالِ پرسش (تأیید) ----------
   باریک‌تر از مودالِ ورود؛ دو دکمه‌ی هم‌عرض کنار هم.
   ⚠️ گرید همیشه `minmax(0, 1fr)` — `1fr` تنها با متنِ بلند سرریز می‌کند. */
.modal__panel--sm { width: min(400px, 100%); text-align: center; }
.confirm-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.confirm-actions .btn { justify-content: center; }

/* تب‌های ورود/ثبت‌نام — دکمه‌اند نه رادیو، پس استایل خودشان را دارند */
.seg--auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  /* ⚠️ `.seg` پایه width: fit-content دارد، پس بدون این خط تب‌ها
     به اندازه‌ی متن جمع می‌شوند و وسط مودال نمی‌نشینند. */
  width: 100%;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.seg--auth .seg__opt {
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.seg--auth .seg__opt:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.seg--auth .seg__opt.is-on { background: var(--grad); color: #fff; }

#authForm { display: grid; gap: 14px; }

.check-row { line-height: 1.7; }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--neon-2);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.linkish:hover { color: var(--neon-1); }

.form-error {
  color: var(--danger);
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  margin: 0;
}
.form-error[hidden] { display: none; }

.input.is-bad,
.textarea.is-bad {
  border-color: rgba(248, 113, 113, .65);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .12);
}

/* ---------- دکمه‌ی حساب در هدر ---------- */
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  max-width: 168px;
  transition: border-color var(--t), background var(--t);
}
.account-chip:hover { border-color: rgba(168, 85, 247, .5); background: var(--surface-3); }
.account-chip__av {
  width: 28px; height: 28px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
}
.account-chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) { .account-chip__name { display: none; } }

/* ---------- دیوار نظرات ---------- */
.cmt-wall { display: grid; gap: 26px; }
.cmt-wall__head { margin-bottom: 0; }

.cmt-wall__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
@media (max-width: 940px) {
  .cmt-wall__grid { grid-template-columns: minmax(0, 1fr); }
}

.cmt-wall__list { display: grid; gap: 14px; }
.cmt-wall__side { position: sticky; top: calc(var(--header-h) + 18px); }
@media (max-width: 940px) { .cmt-wall__side { position: static; } }

.cmt {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.cmt__avatar {
  width: 42px; height: 42px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-weight: 700;
  font-size: .95rem;
}
.cmt__avatar--me { background: var(--grad); color: #fff; border-color: transparent; }
.cmt__avatar--admin {
  background: var(--grad-soft);
  border-color: rgba(168, 85, 247, .45);
  color: #d8b4fe;
}
.cmt__avatar--admin svg { width: 20px; height: 20px; }

.cmt__body { min-width: 0; flex: 1; display: grid; gap: 6px; }

.cmt__head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cmt__name { font-size: .9rem; }
.cmt__date { color: var(--muted); font-size: .74rem; margin-inline-start: auto; }

/* نشان اختصاصی مدیر — خواسته‌ی صاحب سایت */
.cmt__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(168, 85, 247, .3), rgba(34, 211, 238, .22));
  border: 1px solid rgba(168, 85, 247, .55);
  color: #e9d5ff;
}
.cmt__badge svg { width: 12px; height: 12px; }

.cmt__text {
  margin: 0;
  color: var(--text-2);
  font-size: .9rem;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cmt__replies {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding-inline-start: 14px;
  border-inline-start: 2px solid rgba(168, 85, 247, .3);
}
.cmt--reply {
  padding: 13px 15px;
  background: var(--surface-2);
  border-color: var(--line-2);
}
/* جوابِ مدیر با ته‌رنگِ بنفش جدا می‌شود؛ جوابِ کاربر خنثی می‌ماند.
   بدونِ این فرق، چشم نمی‌فهمد کدام جواب از صاحبِ سایت است. */
.cmt--reply.cmt--byadmin { border-color: rgba(168, 85, 247, .2); }
.cmt--reply .cmt__avatar { width: 34px; height: 34px; }

/* --- کادر جواب مدیر، روی خود دیوار (فقط وقتی مدیر وارد است) --- */
.cmt-adminbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.cmt-adminbar__hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  color: var(--muted);
}
.cmt-adminbar__hint svg { width: 13px; height: 13px; color: var(--brand); }
.cmt-replybox {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid rgba(168, 85, 247, .25);
}
.cmt-replybox .textarea { min-height: 74px; font-size: .9rem; }
.cmt-replybox__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* --- کادر جواب کاربرِ واردشده (غیرمدیر) --- */
.cmt-userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.cmt-userbar__hint {
  font-size: .72rem;
  color: var(--muted);
}
.cmt-replybox--user { border-color: var(--line-2); }

/* دعوت به ورود */
.cmt-gate {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
}
.cmt-gate__ico {
  width: 40px; height: 40px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--neon-2);
}
.cmt-gate__ico svg { width: 20px; height: 20px; }
.cmt-gate__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cmt-gate > div:not(.cmt-gate__actions) { flex: 1; min-width: 0; }

/* پیام بعد از ثبت */
.cmt-done {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px;
  background: rgba(52, 211, 153, .08);
  border: 1px solid rgba(52, 211, 153, .32);
  border-radius: var(--r);
}
.cmt-done > svg { width: 22px; height: 22px; flex: none; color: var(--ok); margin-top: 2px; }
.cmt-done > div { flex: 1; min-width: 0; }

/* فرم نوشتن */
.cmt-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.cmt-form__who { display: flex; align-items: center; gap: 10px; }
.cmt-form__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.cmt-skel {
  height: 96px;
  border-radius: var(--r);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: cmtShimmer 1.4s linear infinite;
}
@keyframes cmtShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cmt-skel { animation: none; }
}

/* ============================================================
   پرسش و پاسخِ خصوصیِ زیرِ درس (LessonQA)
   ------------------------------------------------------------
   ⚠️ عمداً روی همان کلاس‌های `.cmt-*` سوار شده — کارتِ سوال، آواتار،
   نشانِ مدیر و فرم همه از دیوارِ نظرات می‌آیند. اگر این‌ها را از نو
   می‌ساختم، دو ظاهرِ کمی‌متفاوت برای یک چیز درمی‌آمد و هر تغییرِ
   ظاهری باید دو جا اعمال می‌شد. فقط چیزهایی که **مخصوصِ** این بخش
   است این‌جاست.
   ============================================================ */

/* دو فیلد کنارِ هم (نام و ایمیل). زیر ۶۴۰ پیکسل روی هم می‌افتند —
   در دو ستونِ باریک، متنِ ایمیل بریده می‌شود. */
.qa__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .qa__row { grid-template-columns: 1fr; }
}

/* کاربرِ واردشده فیلد ایمیل نمی‌بیند؛ به‌جایش می‌گوید جواب کجا می‌رود.
   بدونِ این خط، کاربر نمی‌داند جواب به کدام ایمیل می‌آید. */
.qa__account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  font-size: .8rem;
  color: var(--muted);
}
.qa__account svg { width: 16px; height: 16px; flex: none; color: var(--brand); }
.qa__account b { color: var(--text-2); }

/* یادداشت‌های ریز زیرِ سوال/جواب — آیکن و متن کنارِ هم */
.qa__waiting,
.qa__mailed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.qa__waiting svg,
.qa__mailed svg { width: 13px; height: 13px; flex: none; }
.qa__mailed { color: var(--ok); }

/* ============================================================
   دستگاه لمسی — اندازه‌ی هدف انگشت
   ============================================================
   روی موبایل و تبلت، کنترل‌های ریز با انگشت به‌سختی خورده می‌شوند.
   اندازه‌گیری واقعی نشان داد دو جا مشکل داشت:
     • چیپ‌های فیلتر (دسته‌ها، سطح، «فقط رایگان‌ها») ارتفاع ۳۵px
       داشتند — ۲۹ عدد در صفحه‌ی دوره‌ها و فروشگاه.
     • لینک‌های نانخرده (خانه / دوره‌های آموزشی / دسته) ۲۵px بودند.
   هر دو زیر پیشنهاد ۴۴ پیکسلی اپل و اندروید.

   چرا `(hover: none) and (pointer: coarse)` و نه `max-width`؟
   چون این شرط دقیقاً یعنی «دستگاهی که ماوس ندارد». اگر با عرض
   صفحه شرط می‌گذاشتیم، پنجره‌ی باریک روی دسکتاپ هم عوض می‌شد و
   ظاهر کامپیوتر خراب می‌شد. این‌طوری دسکتاپ دست‌نخورده می‌ماند.

   چرا فقط ارتفاع و نه عرض؟ عرض چیپ به طول متنش بسته است؛
   کشیدنش چیدمان را می‌شکند. بلند کردن ارتفاع، سطح لمس را بزرگ
   می‌کند بدون اینکه چیزی جابه‌جا شود. */
@media (hover: none) and (pointer: coarse) {
  .chip { min-height: 44px; }
  /* نانخرده: پدینگ عمودی سطح لمس را به ~۴۵px می‌رساند. پدینگ افقی
     هم لازم است، چون «خانه» به‌تنهایی ۲۳ پیکسل عرض دارد و استاندارد
     WCAG حداقل ۲۴ می‌خواهد — یعنی یک پیکسل کم بود. */
  .crumbs { gap: 2px 2px; }
  .crumbs a { padding-block: 10px; padding-inline: 6px; }
}

/* ============================================================
   گفتگوی پشتیبانی (صفحه‌ی support.html)
   ------------------------------------------------------------
   خواسته‌ی صاحب سایت: «صفحه‌ی پشتیبانی مثل تلگرام باشه، یک نوار
   برای تایپ و ارسال و عکس فرستادن.»

   سه قاعده‌ی چیدمانی که کلِ «مثل پیام‌رسان بودن» روی آن‌هاست:

   ۱) ارتفاع از `--chat-h` می‌آید که **جاوااسکریپت** از
      `visualViewport.height` پر می‌کند، نه از `vh`. دلیلش کیبوردِ
      موبایل است: `vh` با باز شدن کیبورد عوض نمی‌شود، پس نوارِ تایپ
      زیرِ کیبورد می‌رفت و کاربر کورکورانه تایپ می‌کرد.

   ۲) ناحیه‌ی پیام‌ها `flex: 1` **و** `min-height: 0` دارد.
      🚨 `min-height: 0` تزئینی نیست: در فلکس‌باکس، `min-height`
      پیش‌فرضِ یک آیتم `auto` است، یعنی «کوچک‌تر از محتوایش نشو».
      نتیجه: ناحیه به‌جای اسکرول شدن، ظرف را می‌کشد و بزرگ می‌کند و
      نوارِ تایپ از پایینِ صفحه بیرون می‌زند. این تله یک بار کلِ
      صفحه را خراب کرد و هیچ خطایی هم نداد.

   ۳) `overflow-wrap: anywhere` روی متنِ پیام. یک آدرسِ طولانی یا
      یک کلمه‌ی بی‌فاصله، بدون این، کلِ صفحه را افقی می‌کشد و
      `audit-devices` قرمز می‌شود.
   ============================================================ */

.chat-page { padding: 26px 0 60px; }
.chat-page__head { margin-bottom: 20px; }
.chat-page__head .lead { max-width: 62ch; }

.chat-page__help {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 26px;
}
.chat-page__list { margin: 0; padding-inline-start: 18px; display: grid; gap: 8px; }
.chat-page__list li { color: var(--text-2); font-size: .9rem; line-height: 1.9; }
.chat-page__list b { color: var(--text); }

/* ---------- ظرفِ چت ---------- */
.chat {
  display: flex;
  flex-direction: column;
  /* ⚠️ مقدارِ پیش‌فرض فقط برای «قبل از اجرای جاوااسکریپت» است.
     بعدش `--chat-h` می‌آید و مقدارِ درست را می‌گذارد. */
  height: var(--chat-h, min(72vh, 620px));
  /* 🚨 این‌جا قبلاً `min-height: 320px` بود و یک تله‌ی خاموش داشت:
     روی پنجره‌ی کوتاه (یا گوشیِ کوچک، قبل از اینکه قاعده‌ی موبایل
     برسد) هر مقدارِ کمتر از ۳۲۰ را **بالا می‌کشید** و کادر را از
     صفحه بیرون می‌زد. ارتفاع را حالا فقط جاوااسکریپت تعیین می‌کند و
     آن هم هرگز از فضای موجود بیشتر نمی‌شود. */
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- سرِ چت ---------- */
.chat__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex: none;
}
.chat__top__av {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
}
.chat__top__av svg { width: 22px; height: 22px; }
.chat__top__who { display: grid; gap: 2px; min-width: 0; }
.chat__top__who b { font-size: .98rem; }
.chat__top__st { color: var(--muted); font-size: .78rem; }
/* دکمه‌ی اعلان به انتهای سر می‌چسبد (در RTL: سمت چپ). */
.chat__notify {
  margin-inline-start: auto;
  min-height: 44px;
  padding: 8px 14px;
  font: inherit; font-size: .82rem;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.chat__notify:hover { background: var(--surface-2); border-color: var(--neon-2); }
.chat__notify.is-on { color: var(--ok); border-color: rgba(52, 211, 153, .4); cursor: default; }
.chat__notify[hidden] { display: none; }

/* ---------- ناحیه‌ی پیام‌ها ----------
   `min-height: 0` حیاتی است — توضیحش در سرصفحه‌ی همین بخش. */
.chat__stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
}
.chat__stream::-webkit-scrollbar { width: 8px; }
.chat__stream::-webkit-scrollbar-thumb {
  background: var(--surface-3); border-radius: 999px;
}

/* ---------- حبابِ پیام ----------
   ⚠️ در RTL، محورِ عرضِ یک ستونِ فلکس برعکس است: `flex-start` یعنی
   **راست** و `flex-end` یعنی **چپ**. پس پیامِ خودم (`me`) که در
   چپ‌به‌راست سمت راست است، این‌جا سمت چپ می‌نشیند — همان کاری که
   تلگرام فارسی می‌کند. اگر جابه‌جا شود، چشمِ کاربر می‌گوید «این
   پیام من نیست». */
.bub {
  display: flex;
  gap: 8px;
  max-width: 78%;
  min-width: 0;
}
.bub--me { align-self: flex-end; flex-direction: row-reverse; }
.bub--them { align-self: flex-start; }

.bub__av {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text-2);
  margin-top: 2px;
}
.bub__av svg { width: 16px; height: 16px; }
.bub--them .bub__av { background: var(--grad-soft); border-color: rgba(168, 85, 247, .35); color: var(--text); }

.bub__col { min-width: 0; }
.bub__meta {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 5px;
  font-size: .76rem;
  color: var(--muted);
}
.bub__meta b { color: var(--text-2); font-size: .8rem; }
.bub--me .bub__meta { flex-direction: row-reverse; }
.bub__badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .7rem;
  color: #fff;
  background: var(--grad);
}
.bub__badge svg { width: 11px; height: 11px; }
.bub__time { font-variant-numeric: tabular-nums; }

.bub__text {
  margin: 0;
  padding: 10px 13px;
  border-radius: var(--r);
  font-size: .92rem;
  line-height: 1.95;
  /* 🚨 بدون این، یک آدرسِ بلند کلِ صفحه را افقی می‌کشد. */
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.bub--me .bub__text {
  background: var(--grad);
  color: #fff;
  border-end-end-radius: 5px;
}
.bub--them .bub__text {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-end-start-radius: 5px;
}

/* ---------- پیوست ---------- */
.bub__att { display: block; margin-top: 7px; }
.bub__att--img { line-height: 0; }
.bub__att--img img {
  display: block;
  /* ⚠️ `max-width: 100%` روی خودِ تصویر کافی نیست؛ والدش هم باید
     کوچک‌شدنی باشد وگرنه تصویرِ پهن، ستون را پهن می‌کند. */
  max-width: 100%;
  height: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
}
.bub__att audio, .bub__att video {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
}
.bub__att--file {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  color: var(--text);
  font-size: .84rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.bub__att--file svg { width: 16px; height: 16px; flex: none; }

/* ---------- حالت‌های خالی و بارگذاری ---------- */
.chat__skel {
  height: 46px; border-radius: var(--r);
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: chatShimmer 1.4s linear infinite;
  max-width: 62%;
}
.chat__skel--sm { max-width: 40%; }
@keyframes chatShimmer { to { background-position: -200% 0; } }

.chat__empty {
  margin: auto;
  text-align: center;
  display: grid; gap: 8px; justify-items: center;
  padding: 20px 10px;
  max-width: 44ch;
}
.chat__empty__ico {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad-soft);
  color: var(--neon-2);
}
.chat__empty__ico svg { width: 26px; height: 26px; }
.chat__empty p { margin: 0; }

/* ---------- نوارِ تایپ ---------- */
.chat__bar {
  flex: none;
  padding: 10px 12px 8px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: grid;
  gap: 8px;
}
.chat__row { display: flex; align-items: flex-end; gap: 7px; }

.chat__ico {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--t), border-color var(--t);
}
.chat__ico:hover:not(:disabled) { color: var(--neon-2); border-color: var(--neon-2); }
.chat__ico:disabled { opacity: .45; cursor: default; }
.chat__ico svg { width: 20px; height: 20px; }

.chat__input {
  flex: 1;
  min-width: 0;
  /* ⚠️ `resize: none` چون ارتفاعش را خودمان با اسکرول‌هشت تنظیم
     می‌کنیم؛ دستگیره‌ی مرورگر چیدمان را می‌شکند. */
  resize: none;
  min-height: 44px;
  max-height: 132px;
  padding: 11px 14px;
  font: inherit;
  font-size: .92rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow-y: auto;
}
.chat__input:focus { outline: none; border-color: var(--neon-2); }
.chat__input::placeholder { color: var(--muted); }

.chat__send {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  border: none;
  background: var(--grad);
  color: #fff;
  cursor: pointer;
  transition: filter var(--t);
}
.chat__send:hover:not(:disabled) { filter: brightness(1.12); }
.chat__send:disabled { opacity: .5; cursor: default; }
.chat__send svg { width: 20px; height: 20px; }

/* ---------- پیوستِ آماده‌ی ارسال ---------- */
.chat__pending {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--line-2);
  background: var(--surface-3);
  font-size: .82rem;
  min-width: 0;
}
.chat__pending__ico { color: var(--neon-2); display: grid; place-items: center; }
.chat__pending__ico svg { width: 17px; height: 17px; }
.chat__pending__name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat__pending__x {
  margin-inline-start: auto;
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: transparent; color: var(--muted);
  cursor: pointer;
}
.chat__pending__x svg { width: 14px; height: 14px; }

/* ---------- ضبطِ صدا: حذف شد ----------
   🚨 قاعده‌های `.chat__rec`، `.chat__rec__dot`، `@keyframes chatRec` و
   `.chat__retry` این‌جا بودند. با حذفِ ضبطِ صدا (خواسته‌ی مهزیار)
   هیچ عنصری آن کلاس‌ها را نمی‌گیرد، پس پاک شدند تا CSSِ مرده نماند.
   ⚠️ اگر ضبط برگشت، این‌ها هم باید برگردند — وگرنه نوارِ «در حال
   ضبط» بی‌استایل و بی‌چراغ می‌شود. */

/* ---------- راهنما و خطا ---------- */
.chat__hint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .76rem;
  color: var(--muted);
  min-height: 16px;
}
.chat__hint__sp { margin-inline-start: auto; }
.chat__err { color: var(--danger); }

.chat__closed {
  flex: none;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .84rem;
  color: var(--text-2);
}
.chat__closed svg { width: 18px; height: 18px; flex: none; color: var(--ok); }

/* ---------- دعوت به روشن‌کردنِ اعلان ---------- */
.chat__nudge {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: var(--grad-soft);
  font-size: .78rem;
  color: var(--text-2);
}
.chat__nudge svg { width: 15px; height: 15px; flex: none; color: var(--neon-2); }

/* ---------- دیوارِ ورود ---------- */
.chat__gate {
  margin: auto;
  display: grid; gap: 10px; justify-items: center;
  text-align: center;
  padding: 26px 16px;
  max-width: 46ch;
}
.chat__gate__ico {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--text-2);
}
.chat__gate__ico svg { width: 24px; height: 24px; }
.chat__gate p { margin: 0; }
.chat__gate__row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* ---------- موبایل ---------- */
@media (max-width: 640px) {
  .chat-page { padding: 10px 0 26px; }
  /* 🚨 سرِ صفحه روی گوشی **جمع** می‌شود، و دلیلش اندازه‌گیری است نه
     سلیقه: روی iPhone SE (۳۲۰×۴۵۴) هدرِ سایت + تیترِ صفحه ۲۴۹px از
     ۴۵۴px را می‌خورد (۵۵٪ صفحه!) و کادرِ گفتگو مجبور می‌شد کوتاه
     شود یا بیرون بزند.
     `eyebrow` و `lead` هر دو تزئینی‌اند: `lead` همان چیزی را می‌گوید
     که داخلِ خودِ چت نوشته شده، و `eyebrow` فقط برچسبِ «پشتیبانی»
     است. عنوانِ اصلی (`h1`) می‌ماند چون ساختار و SEO به آن نیاز
     دارد. این کار حدود ۱۰۰px به کادر برمی‌گرداند. */
  .chat-page__head { margin-bottom: 12px; }
  .chat-page__head .eyebrow { display: none; }
  .chat-page__head .lead { display: none; }
  .chat-page__head .h2 { font-size: 1.2rem; line-height: 1.5; }
  /* 🚨 باگِ واقعیِ موبایل: مهزیار گفت «کادر بیرون می‌زنه».
     دو علت داشت و **هر دو** باید بسته شوند:
       ۱) جاوااسکریپت ارتفاع را با کفِ ۳۰۰ حساب می‌کرد (در
          `support.js` ← `fit()` توضیح داده شده).
       ۲) همین خط: `min-height: 260px` هر مقدارِ کوچک‌تری که
          جاوااسکریپت می‌گذاشت را **بالا می‌کشید** و کادر را دوباره
          از صفحه بیرون می‌زد. حالا صفر است — ارتفاع را فقط
          جاوااسکریپت تعیین می‌کند و آن هم هرگز از فضای موجود
          بیشتر نمی‌شود.
     `100dvh` پشتوانه‌ی CSS است برای وقتی که جاوااسکریپت دیر برسد:
     ارتفاعِ واقعیِ موبایل است (برخلاف `vh` که با نوارِ آدرسِ مرورگر
     عوض نمی‌شود). */
  .chat {
    height: var(--chat-h, calc(100dvh - 140px));
    min-height: 0;
  }
  /* حباب پهن‌تر: روی صفحه‌ی باریک، ۷۸٪ آن‌قدر جا کم می‌آورد که
     متن به ستونِ باریکِ چند حرفی تبدیل می‌شود. */
  .bub { max-width: 90%; }
  .chat__stream { padding: 14px 12px; }
  /* ⚠️ آواتار در حباب روی موبایل حذف می‌شود. با ۳۰px آواتار و
     ۸px فاصله، از عرضِ ۳۶۰ پیکسلی حدود ۴۰px برای متن کم می‌شود
     و حباب به ستونِ باریک تبدیل می‌شود. نامِ فرستنده در
     `bub__meta` هست، پس اطلاعاتی گم نمی‌شود. */
  .bub__av { display: none; }
  .chat__top { padding: 10px 12px; }
  .chat__top__av { width: 38px; height: 38px; }
  /* نوارِ تایپ روی گوشیِ باریک فشرده‌تر: هر ۴px این‌جا یعنی ۴px
     بیشتر برای متنِ پیام‌ها. */
  .chat__bar { padding: 8px 10px 6px; gap: 6px; }
  .chat__row { gap: 6px; }
  .chat__ico, .chat__send { width: 40px; height: 40px; }
  .chat__input { min-height: 40px; padding: 9px 12px; }
  /* ⚠️ راهنمای «Enter = خط جدید» روی موبایل بی‌معنی است (کیبوردِ
     لمسی Enter ندارد) و فقط یک خطِ اضافه از کادر می‌خورد. */
  .chat__hint__sp { display: none; }
  /* 🚨 نوارِ «اعلان‌ها را روشن کن» روی گوشی **حذف** می‌شود.
     دلیلش اندازه‌گیری است: متنش روی صفحه‌ی ۳۲۰px به چهار خط
     می‌شکند و حدود ۸۰px از ارتفاعِ کارت را می‌خورد — یعنی از ۳۳۱px
     کارت، فقط ۳۹px برای پیام‌ها می‌ماند.
     ⚠️ و چیزی از دست نمی‌رود: دکمه‌ی «روشن کردن اعلان‌ها» در سرِ
     خودِ چت (`.chat__notify`) همان کار را می‌کند و همان‌جا همیشه
     دیده می‌شود. یعنی این نوار روی گوشی **تکرارِ** یک دکمه‌ی
     موجود بود، نه تنها راه. */
  .chat__nudge { display: none; }
  /* دکمه‌ی اعلان در سرِ چت فشرده‌تر تا روی صفحه‌ی ۳۲۰px جا شود. */
  .chat__notify { min-height: 40px; padding: 6px 10px; font-size: .74rem; }
}

/* ============================================================
   نشانِ کنارِ صفحه — «سوالی داشتی؟»
   ------------------------------------------------------------
   خواسته‌ی صاحب سایت: «از کنارِ صفحه بیاد بگه اگه سوالی داشتی
   پیام بزن تا به بخش پشتیبانی منتقل بشی.»

   ⚠️ چرا `position: fixed` و پایین-چپ (نه راست):
      در سایت راست‌به‌چپ، گوشه‌ی پایین-چپ همان جایی است که چشم
      «کنارِ صفحه» می‌فهمدش و هیچ‌چیزِ مهمی آنجا نیست. سمت راست
      در RTL جای شروعِ خواندن است و نشان آنجا مزاحم می‌شود.

   ⚠️ و چرا `z-index` بالاتر از کشوها نیست: اگر نشان روی کشوی سبد
      خرید بیفتد، کاربر دکمه‌ی «تکمیل خرید» را گم می‌کند. پس زیرِ
      لایه‌ی کشوها می‌ماند. */
.fab-wrap {
  position: fixed;
  inset-inline-start: 18px;
  inset-block-end: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  /* ⚠️ خودِ ظرف نباید لمس را بگیرد، وگرنه روی صفحه‌ی باریک جلوی
     کلیک‌های زیرش را می‌گیرد. فقط فرزندها لمس‌پذیر می‌شوند. */
  pointer-events: none;
}
.fab-wrap[hidden] { display: none; }

.fab {
  pointer-events: auto;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 14px 34px -12px rgba(168, 85, 247, .75), 0 0 0 1px rgba(255, 255, 255, .08);
  position: relative;
  transition: transform var(--t);
}
.fab:hover { transform: translateY(-3px) scale(1.04); }
.fab svg { width: 26px; height: 26px; }

/* هاله‌ی نبض — می‌گوید «اینجا زنده است»، بدونِ اینکه چیزی بپرد. */
.fab__ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--neon-2);
  animation: fabPing 2.6s ease-out infinite;
}
@keyframes fabPing {
  0% { transform: scale(1); opacity: .55; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
/* ⚠️ احترام به «کم‌کردن انیمیشن» در تنظیمات سیستم. انیمیشنِ بی‌وقفه
   برای بعضی کاربران آزاردهنده است و مرورگر از این تنظیم خبر می‌دهد. */
@media (prefers-reduced-motion: reduce) {
  .fab__ping { animation: none; opacity: 0; }
  .fab { transition: none; }
}

.fab-nudge {
  pointer-events: auto;
  position: relative;
  width: min(272px, calc(100vw - 36px));
  padding: 14px 15px 15px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  /* ⚠️ حباب از پایین می‌آید. `translateY(8px)` با `opacity: 0` شروع
     می‌کند؛ بدونِ آن، حباب بی‌حرکت ظاهر می‌شود و چشم متوجه نمی‌شود. */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.fab-nudge[hidden] { display: none; }
.fab-nudge.is-in { opacity: 1; transform: translateY(0); }

/* دنباله‌ی کوچکِ حباب که به دکمه اشاره می‌کند. */
.fab-nudge::after {
  content: '';
  position: absolute;
  inset-block-end: -7px;
  inset-inline-start: 22px;
  width: 12px; height: 12px;
  background: var(--surface);
  border-inline-end: 1px solid var(--line-2);
  border-block-end: 1px solid var(--line-2);
  transform: rotate(45deg);
}

.fab-nudge__title { display: block; font-size: .95rem; margin-bottom: 5px; }
.fab-nudge__text {
  margin: 0 0 12px;
  font-size: .82rem;
  line-height: 1.85;
  color: var(--text-2);
}
.fab-nudge__go { width: 100%; justify-content: center; }

.fab-nudge__x {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.fab-nudge__x:hover { color: var(--text); background: var(--surface-3); }
.fab-nudge__x svg { width: 15px; height: 15px; }

@media (max-width: 480px) {
  .fab-wrap { inset-inline-start: 12px; inset-block-end: 12px; }
  .fab { width: 52px; height: 52px; }
  .fab svg { width: 24px; height: 24px; }
}

/* ============================================================
   🎁 پکیج‌ها — فهرستِ دوره‌های داخلِ هر بسته
   ------------------------------------------------------------
   چرا داخلِ کارتِ دوره است و نه یک صفحه‌ی جدا:
   کاربر باید **پیش از** زدنِ دکمه ببیند دقیقاً چه چیزی می‌گیرد.
   اگر فقط می‌نوشتیم «۵ دوره»، باید اول می‌گرفت و بعد می‌فهمید —
   و اگر بابِ میلش نبود، باید با پشتیبانی کلنجار می‌رفت.
   ============================================================ */
.pkg-members {
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-2, rgba(255, 255, 255, .03));
  border: 1px solid var(--line-2, rgba(255, 255, 255, .08));
}
.pkg-members > b { color: var(--text-2); font-weight: 600; }

.pkg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.pkg-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .84rem;
  color: var(--text-2);
  min-width: 0;
}
.pkg-list li svg { width: 15px; height: 15px; flex: 0 0 auto; color: #6ee7b7; }
.pkg-list li span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pkg-has {
  flex: 0 0 auto;
  font-style: normal;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(52, 211, 153, .14);
  border: 1px solid rgba(52, 211, 153, .3);
  color: #6ee7b7;
}

/* ============================================================
   📎 فایل‌های دوره — بخشِ زیرِ هر دوره
   ------------------------------------------------------------
   سه حالت دارد و هر سه باید **از هم قابل تشخیص** باشند:
     ۱) باز    → دکمه‌ی دانلود
     ۲) قفل    → پیامِ «باید دوره را بخری» + دکمه‌ی دیدنِ دوره
     ۳) خالی   → صاحب سایت هنوز فایلی نگذاشته
   اگر هر سه یک شکل باشند، کاربر نمی‌فهمد کدام است.
   ============================================================ */
.files-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.file-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--surface-2, rgba(255, 255, 255, .03));
  border: 1px solid var(--line-2, rgba(255, 255, 255, .08));
  min-width: 0;
}
.file-row__ico {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(168, 85, 247, .14);
  border: 1px solid rgba(168, 85, 247, .3);
  color: #d8b4fe;
}
.file-row__ico svg { width: 18px; height: 18px; }
.file-row__t { flex: 1; min-width: 0; font-size: .9rem; }
.file-row__t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__btn { flex: 0 0 auto; }
.file-row--locked .file-row__ico {
  background: rgba(251, 191, 36, .13);
  border-color: rgba(251, 191, 36, .3);
  color: #fcd34d;
}

@media (max-width: 520px) {
  .file-row { flex-wrap: wrap; }
  .file-row__btn { width: 100%; justify-content: center; }
}
