/* ─────────────────────────────────────────────────────────────
   دیزاین‌سیستم آموزشگاه — لایهٔ کامپوننت
   همهٔ مقادیر از tokens.css می‌آیند. رنگ خام اینجا ننویس.
   ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: var(--lh-ui);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; }
img, video { display: block; height: auto; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }
hr { border: none; border-top: var(--bw) solid var(--line); margin: var(--s6) 0; }

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 800; line-height: var(--lh-title); letter-spacing: -.015em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 700; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; line-height: var(--lh-prose); color: var(--ink-2); }
ul, ol { line-height: var(--lh-prose); color: var(--ink-2); }
small { font-size: var(--fs-xs); }
b, strong { font-weight: 700; }

.mono, .num { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.prose { line-height: var(--lh-prose); }
.muted { color: var(--ink-3); }
.tiny { font-size: var(--fs-xs); color: var(--ink-3); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.push { margin-inline-start: auto; }
.nowrap { white-space: nowrap; }
.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;
}

:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-100); color: var(--brand-900); }

.skip-link {
  position: absolute; inset-inline-start: -999px; top: 8px; z-index: 100;
  background: var(--brand-700); color: var(--on-brand); padding: 10px 18px; border-radius: var(--r-md);
}
.skip-link:focus { inset-inline-start: 8px; }

/* ─── چیدمان ─── */
.container { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s5); }
.container-sm { max-width: 780px; }
.container-xs { max-width: 480px; }
.section { padding: clamp(32px, 6vw, 68px) 0; }
.section-tight { padding-top: 0; }
.grid { display: grid; gap: var(--s5); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.split { display: grid; gap: var(--s6); grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6);
}
.section-head h2, .section-head h1 { margin: 0; }
.section-head p { margin: var(--s2) 0 0; font-size: var(--fs-ui); }
.more-link { font-size: var(--fs-ui); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }

/* ─── آیکون ─── */
.i { flex-shrink: 0; vertical-align: -.15em; }
.i-btn {
  width: var(--tap); height: var(--tap); border-radius: var(--r-md);
  border: var(--bw) solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer; position: relative;
  font-family: var(--font); transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.i-btn:hover { border-color: var(--brand-500); text-decoration: none; }

/* ─── دکمه ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--ctl-h); padding: 0 22px; border-radius: var(--r-md);
  border: var(--bw) solid transparent; cursor: pointer;
  font-family: var(--font); font-size: var(--fs-ui); font-weight: 700; line-height: 1.4;
  text-decoration: none !important; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-700); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-900); color: var(--on-brand); }
.btn-secondary { background: var(--surface); color: var(--brand-700); border-color: var(--brand-100); }
.btn-secondary:hover { border-color: var(--brand-500); color: var(--brand-700); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand-500); color: var(--brand-700); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: transparent; padding: 0 14px; }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--clay-600); color: #fff; }
.btn-danger:hover { background: var(--clay-700); color: #fff; }
/* طلایی فقط روی زمینهٔ برند، به‌عنوان اقدام دستاورد */
.btn-gold { background: var(--gold-500); color: #23211D; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 1rem; border-radius: 14px; }
.btn-sm { min-height: var(--ctl-h-sm); padding: 0 15px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* ─── سربرگ ─── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: var(--bw) solid var(--line);
}
.header-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s5);
  min-height: var(--header-h); display: flex; align-items: center; gap: var(--s4);
}
.brand-mark { display: flex; align-items: center; gap: 10px; text-decoration: none !important; color: var(--ink); }
.brand-logo { width: 40px; height: 40px; flex-shrink: 0; border-radius: 13px; display: block; }
.brand-name {
  font-size: 1rem; font-weight: 800; line-height: 1.25; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.brand-name small { display: block; font-size: .68rem; font-weight: 500; color: var(--ink-3); }
@media (max-width: 559px) {
  /* دو خط: با یک خط، «آکادمی رادمانا» کنار دکمه‌های سربرگ در ۳۹۰px به «آکاد…» بریده می‌شد */
  .brand-name { font-size: .86rem; line-height: 1.2; -webkit-line-clamp: 2; }
  .brand-name small { display: none; }
  .header-inner { gap: var(--s3); padding: 0 var(--s4); }
}
/* زیر ~۳۸۰px جمعِ نشان + نام (کمینه = طولانی‌ترین واژه) و چهار دکمهٔ سربرگ از عرضِ صفحه بیشتر بود و کلِ صفحه
   ۱۸px اسکرولِ افقی می‌خورد (سنجیده در ۳۶۰px: 378 در برابر 360). دکمهٔ «ورود/میزکار» این‌جا تکراری است:
   زبانهٔ «حساب» در نوارِ پایین (زیر ۷۶۰px همیشه پیداست) همان‌جا می‌رود. */
@media (max-width: 380px) {
  .header-actions > .btn { display: none; }
}

.main-nav { display: none; gap: 2px; }
.main-nav a {
  padding: 9px 14px; border-radius: var(--r-md); font-size: var(--fs-ui);
  font-weight: 600; color: var(--ink);
}
.main-nav a:hover { background: var(--surface-2); text-decoration: none; }
.main-nav a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: var(--s2); margin-inline-start: auto; }
.header-search {
  display: none; align-items: center; gap: 9px; height: 42px; width: 220px;
  border: var(--bw) solid var(--line); background: var(--surface);
  border-radius: var(--r-pill); padding: 0 16px; color: var(--ink-3); font-size: var(--fs-sm);
}
.header-search:hover { border-color: var(--brand-500); text-decoration: none; }
.badge-dot {
  position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px;
  background: var(--gold-500); color: #23211D; border-radius: var(--r-pill);
  font-size: .68rem; font-weight: 800; display: grid; place-items: center; padding: 0 5px;
}
@media (min-width: 960px) {
  .main-nav { display: flex; }
  .header-search { display: flex; }
  .mobile-toggle { display: none; }
}
.mobile-menu {
  display: none; flex-direction: column; gap: 2px;
  padding: var(--s3) var(--s5) var(--s5); border-top: var(--bw) dashed var(--line);
}
.mobile-menu[data-open] { display: flex; }
.mobile-menu a {
  min-height: var(--tap); display: flex; align-items: center;
  padding: 0 var(--s3); border-radius: var(--r-md); font-weight: 600; color: var(--ink);
}
.mobile-menu a:hover { background: var(--surface-2); text-decoration: none; }

/* ─── نوار پایین موبایل ─── */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  background: var(--surface); border-top: var(--bw) solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a {
  min-height: 60px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; font-size: .69rem; font-weight: 600;
  color: var(--ink-3); text-decoration: none !important; position: relative;
}
.tabbar a.active { color: var(--brand-700); font-weight: 700; }
@media (min-width: 760px) { .tabbar { display: none; } }
body.has-tabbar { padding-bottom: 76px; }
@media (min-width: 760px) { body.has-tabbar { padding-bottom: 0; } }

/* ─── کارت‌ها ─── */
.card, .hero-card {
  background: var(--surface); border: var(--bw) solid var(--line);
  border-radius: var(--r-lg); padding: var(--s5);
}
a.card:hover, a.hero-card:hover { border-color: var(--brand-500); text-decoration: none; }
.card-lg { border-radius: var(--r-xl); padding: var(--s6); }
.card-flush { padding: 0; overflow: hidden; }
.card-quiet { background: var(--surface-2); border-color: transparent; }
.card-brand { background: var(--brand-700); color: var(--on-brand); border-color: transparent; }
.card-brand h1, .card-brand h2, .card-brand h3 { color: var(--on-brand); }
.card-brand p { color: var(--brand-100); }
.card-head {
  display: flex; align-items: center; gap: var(--s3);
  margin: 0 0 var(--s4);
}
.card-head h3, .card-head h2 { margin: 0; }

/* ─── کارت دوره ─── */
.course-card {
  background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-xl);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--e1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--e2); border-color: var(--brand-100); }
.course-cover {
  position: relative; display: block; aspect-ratio: 16 / 9;
  background: var(--sunk); overflow: hidden;
}
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.cc-badge {
  position: absolute; top: 12px; inset-inline-start: 12px;
  background: var(--gold-500); color: #23211D; font-size: .7rem; font-weight: 800;
  padding: 5px 11px; border-radius: var(--r-pill);
}
.cc-badge-quiet { background: var(--paper); color: var(--ink); }
.cc-time {
  position: absolute; bottom: 12px; inset-inline-end: 12px;
  background: rgba(19, 21, 19, .74); color: #fff; font-size: .74rem; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-sm);
}
.course-body { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); flex: 1; }
.course-body h3 { margin: 0; font-size: 1.06rem; line-height: 1.5; }
.course-body h3 a { color: var(--ink); }
.course-body > p { margin: 0; font-size: var(--fs-sm); line-height: 1.7; }
.course-meta, .meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  font-size: var(--fs-xs); color: var(--ink-3);
}
.meta { font-size: var(--fs-sm); }
/* جداکننده: نقطهٔ «·» در فارسی دقیقاً شکل صفر (۰) است و «۶ · ۱» را «۶۰ ۱» نشان می‌دهد.
   پس جداکننده یک دایرهٔ رسم‌شده است، نه یک نویسه. */
.course-meta > span + span, .meta > span + span { display: inline-flex; align-items: center; }
.course-meta > span + span::before, .meta > span + span::before {
  content: ''; display: inline-block; flex-shrink: 0;
  width: 3px; height: 3px; border-radius: 999px;
  background: var(--ink-4); margin-inline-end: 10px;
}
.byline { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--ink-2); }
.avatar {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--r-pill);
  background: var(--brand-50); color: var(--brand-700);
  display: grid; place-items: center; font-size: .78rem; font-weight: 800;
}
.avatar-lg { width: 46px; height: 46px; font-size: 1.05rem; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: var(--fs-sm); color: var(--ink); }
.course-price {
  margin-top: auto; padding-top: var(--s4); border-top: var(--bw) solid var(--line-soft);
  display: flex; align-items: baseline; gap: var(--s2); font-weight: 800; font-size: 1.14rem;
}
.course-price .unit { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.course-price .old { font-size: var(--fs-sm); font-weight: 400; color: var(--ink-3); text-decoration: line-through; }
.course-price .free { color: var(--brand-700); }
.off-badge {
  margin-inline-start: auto; background: var(--err-bg); color: var(--err-fg);
  font-size: .7rem; font-weight: 800; padding: 4px 9px; border-radius: 7px;
}

/* ─── نشان ─── */
.chip, .badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--brand-50); color: var(--brand-700);
  font-size: .74rem; font-weight: 700; padding: 5px 11px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.chip-quiet { background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.chip-gold { background: var(--gold-50); color: var(--gold-700); }
.chip-danger { background: var(--err-bg); color: var(--err-fg); }
.chip-ink { background: var(--ink); color: var(--paper); }
.chip-line { background: transparent; border: var(--bw) solid var(--line); color: var(--ink-2); font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── فرم ─── */
.field { display: grid; gap: 6px; margin-bottom: var(--s4); }
.field label { font-weight: 600; font-size: var(--fs-sm); }
.field .hint { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.7; }
.field-row { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; }
input[type=text], input[type=tel], input[type=number], input[type=search], input[type=url],
input[type=email], input[type=password], input[type=date], input[type=datetime-local],
select, textarea {
  width: 100%; min-height: var(--ctl-h); padding: 11px 14px;
  border: var(--bw) solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-ui); line-height: var(--lh-ui);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8378' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-inline-start: 40px;
}
:root[data-theme="dark"] select, .theatre select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239AA79F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
}
textarea { min-height: 120px; resize: vertical; line-height: var(--lh-prose); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-500); outline: none;
  box-shadow: 0 0 0 3px var(--brand-50);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--brand-700); }
.choice {
  display: flex; align-items: center; gap: var(--s3); cursor: pointer;
  min-height: var(--tap); padding: 6px 12px; border-radius: var(--r-md);
  border: var(--bw) solid var(--line); background: var(--surface);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
}
.choice:hover { border-color: var(--brand-500); }
.otp-input {
  font-family: var(--font-mono); font-size: 1.6rem; letter-spacing: .7em;
  text-align: center; direction: ltr; font-weight: 700; padding-inline-start: .7em;
}
.ltr { direction: ltr; text-align: left; }

/* ─── پیام ─── */
.alert {
  display: flex; align-items: flex-start; gap: 11px;
  border-radius: var(--r-md); padding: 13px 16px; margin-bottom: var(--s4);
  font-size: var(--fs-ui); line-height: 1.7;
}
.alert .i { margin-top: 3px; }
.alert-ok { background: var(--ok-bg); color: var(--ok-fg); }
.alert-warn { background: var(--warn-bg); color: var(--warn-fg); }
.alert-error { background: var(--err-bg); color: var(--err-fg); }
.alert-info { background: var(--info-bg); color: var(--info-fg); }

/* ─── توست ─── */
.toasts {
  position: fixed; z-index: 200; bottom: 20px; inset-inline-start: 20px;
  display: flex; flex-direction: column; gap: var(--s2); pointer-events: none;
}
@media (max-width: 759px) { .toasts { bottom: 88px; inset-inline: 16px; } }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper); border-radius: var(--r-md);
  padding: 12px 18px; font-size: var(--fs-ui); font-weight: 600; box-shadow: var(--e3);
  animation: toast-in var(--dur) var(--ease);
}
.toast-error { background: var(--clay-700); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ─── پیشرفت ─── */
.bar { height: 8px; background: var(--sunk); border-radius: var(--r-pill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-500); border-radius: var(--r-pill); }
.bar-gold > i { background: var(--gold-500); }
.bar-thin { height: 5px; }
.ring { display: block; flex-shrink: 0; }
.ring-track { fill: none; stroke: var(--sunk); }
.ring-fill { fill: none; stroke: var(--brand-500); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
.ring-fill.done { stroke: var(--gold-500); }
.ring text { font-family: var(--font); font-weight: 800; fill: var(--ink); }

/* ─── حالت خالی ─── */
.empty-state {
  text-align: center; padding: clamp(32px, 6vw, 56px) var(--s6);
  border: 2px dashed var(--line); border-radius: var(--r-xl); color: var(--ink-2);
}
.empty-state .i { color: var(--ink-4); margin-bottom: var(--s3); }
.empty-state h2, .empty-state h3 { margin: 0 0 var(--s2); font-size: 1.1rem; }
.empty-state p { margin: 0 0 var(--s4); font-size: var(--fs-ui); }
.empty-state .btn-row { justify-content: center; }

/* ─── جدول ─── */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: var(--bw) solid var(--line); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); line-height: var(--lh-ui); }
table.data th, table.data td { padding: 12px 14px; text-align: start; border-bottom: var(--bw) solid var(--line-soft); }
table.data th { background: var(--paper); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--paper); }

/* ─── فهرست ساده ─── */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: var(--s3);
  min-height: var(--tap); padding: 10px 0; border-bottom: var(--bw) solid var(--line-soft);
  font-size: var(--fs-ui);
}
.list-row:last-child { border-bottom: none; }

/* ─── سرفصل ─── */
.curriculum { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ch-item { border-bottom: var(--bw) solid var(--line-soft); }
.ch-item:last-child { border-bottom: none; }
.ch-item > summary {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 56px; padding: 10px var(--s5); cursor: pointer; list-style: none;
  font-weight: 700; font-size: var(--fs-ui);
}
.ch-item > summary::-webkit-details-marker { display: none; }
.ch-item > summary::marker { content: ''; }
.ch-item > summary:hover { background: var(--paper); }
.ch-item > summary .i-chev { transition: transform var(--dur) var(--ease); }
.ch-item[open] > summary .i-chev { transform: rotate(-90deg); }
.ch-count { margin-inline-start: auto; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-3); }
.ch-body { padding: 2px var(--s3) var(--s3); }
.ls-row {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 48px; padding: 6px 12px; border-radius: 11px;
  font-size: var(--fs-ui); color: var(--ink);
}
a.ls-row:hover { background: var(--brand-50); text-decoration: none; }
.ls-row .ls-title { flex: 1; min-width: 0; }
.ls-row .ls-time { font-family: var(--font-mono); direction: ltr; font-size: var(--fs-xs); color: var(--ink-3); }
.ls-row.preview { background: var(--brand-50); }
.ls-row.current { background: var(--brand-700); color: var(--on-brand); }
.ls-row.current .ls-time { color: var(--brand-100); }
.ls-row.done .i { color: var(--brand-500); }
/* درس قفل: رنگ عمدی، نه شفافیت — تا کنتراست حفظ شود */
.ls-row.locked { color: var(--ink-3); cursor: not-allowed; }
.ls-row.locked .i { color: var(--ink-4); }
.ls-type-badge {
  font-size: .68rem; background: var(--surface-2); color: var(--ink-2);
  border-radius: 6px; padding: 3px 8px; flex-shrink: 0;
}
.ls-row.current .ls-type-badge { background: rgba(255, 255, 255, .18); color: #fff; }

/* ─── پنل حساب و مدیریت ─── */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 1000px) { .shell { grid-template-columns: 248px minmax(0, 1fr); } }
.shell-aside {
  background: var(--surface); border-inline-end: var(--bw) solid var(--line);
  padding: var(--s5) var(--s4); position: sticky; top: 0; align-self: start;
  max-height: 100vh; overflow-y: auto;
}
@media (max-width: 999px) {
  .shell-aside { position: static; max-height: none; border-inline-end: none; border-bottom: var(--bw) solid var(--line); }
}
.shell-main { min-width: 0; padding: var(--s6) clamp(16px, 3vw, 40px) var(--s9); }
.shell-dark { background: var(--ink); }

.nav-group { margin-bottom: var(--s5); }
.nav-group > h4 {
  margin: 0 0 var(--s2); padding: 0 12px;
  font-size: .68rem; font-weight: 700; letter-spacing: .14em; color: var(--ink-3);
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  min-height: var(--tap); padding: 0 12px; border-radius: 11px;
  font-size: var(--fs-ui); font-weight: 600; color: var(--ink);
}
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item.active { background: var(--brand-700); color: var(--on-brand); font-weight: 700; }
.nav-item .count {
  margin-inline-start: auto; background: var(--surface-2); color: var(--ink-2);
  font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill);
}
.nav-item .count-hot { background: var(--gold-500); color: #23211D; }
.nav-item .count-alert { background: var(--clay-600); color: #fff; }
.nav-item.active .count { background: rgba(255, 255, 255, .2); color: #fff; }

/* سایدبار تیرهٔ پنل مدیریت */
.shell-aside.dark { background: #131513; border-color: #2C332F; }
.shell-aside.dark .nav-group > h4 { color: #5F6B65; }
.shell-aside.dark .nav-item { color: #C9DED4; }
.shell-aside.dark .nav-item:hover { background: rgba(255, 255, 255, .06); }
.shell-aside.dark .nav-item.active { background: var(--brand-600); color: #fff; }
.shell-aside.dark .nav-item .count { background: #2C332F; color: #C9DED4; }
.shell-aside.dark .brand-name { color: #fff; }
.shell-aside.dark .brand-name small { color: #7E8A83; }

/* نوار قرص — هنوز برای فیلترهای کوتاه به‌کار می‌رود */
.panel-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: var(--s2); margin-bottom: var(--s5); }
.panel-nav a {
  white-space: nowrap; min-height: var(--ctl-h-sm); display: inline-flex; align-items: center;
  padding: 0 15px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600;
  color: var(--ink-2); background: var(--surface); border: var(--bw) solid var(--line);
}
.panel-nav a:hover { border-color: var(--brand-500); text-decoration: none; }
.panel-nav a.active { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 700; }

.topbar {
  display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap;
  margin-bottom: var(--s6);
}
.topbar h1 { margin: 0; font-size: 1.28rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--s4); }
.stat-card { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.stat-card > span { font-size: var(--fs-sm); color: var(--ink-3); }
.stat-card > b { display: block; margin-top: 6px; font-size: 1.6rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.stat-card .trend { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: var(--fs-xs); }
.trend-up { color: var(--brand-500); font-weight: 700; }
.trend-down { color: var(--clay-600); font-weight: 700; }

/* ─── هیرو ─── */
.hero { position: relative; overflow: hidden; border-bottom: var(--bw) solid var(--line); }
.hero-grid { display: grid; gap: var(--s7); align-items: center; padding: clamp(40px, 7vw, 76px) 0; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 64px; } }
.hero h1 { font-size: var(--fs-display); font-weight: 900; line-height: 1.22; letter-spacing: -.025em; text-wrap: pretty; }
.hero .lede { font-size: 1.06rem; line-height: var(--lh-prose); color: var(--ink-2); max-width: 34rem; text-wrap: pretty; }
.hero-underline { position: relative; color: var(--brand-700); white-space: nowrap; }
.hero-underline svg { position: absolute; inset-inline: 0; bottom: -.18em; width: 100%; height: .22em; }
.hero-stats { display: flex; flex-wrap: wrap; gap: var(--s7); margin-top: var(--s7); padding-top: var(--s6); border-top: var(--bw) solid var(--line); }
.hero-stats b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.hero-stats span { font-size: var(--fs-sm); color: var(--ink-3); }

/* ─── مسیر یادگیری: امضای بصری ─── */
.path-track { display: grid; gap: var(--s6); }
.path-step { display: flex; gap: var(--s5); }
.path-rail { display: flex; flex-direction: column; align-items: center; width: 48px; flex-shrink: 0; }
.path-dot {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: var(--r-pill);
  background: var(--brand-700); color: var(--on-brand);
  display: grid; place-items: center; font-size: 1.05rem; font-weight: 800;
}
.path-dot-gold { background: var(--gold-500); color: #23211D; }
.path-line { width: 0; flex: 1; border-inline-start: 2px dotted var(--brand-100); margin: var(--s2) 0; min-height: 20px; }
.path-body { padding-bottom: var(--s5); min-width: 0; }
.path-body h3 { margin: 0 0 3px; font-size: 1rem; }
.path-body p { margin: 0; font-size: var(--fs-sm); line-height: 1.75; }
.path-step:last-child .path-body { padding-bottom: 0; }

/* ─── فوتر ─── */
.site-footer { background: #131513; color: #9AA79F; margin-top: var(--s9); padding: var(--s8) 0 var(--s6); }
.site-footer a { color: #9AA79F; }
.site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; font-size: var(--fs-ui); margin-bottom: var(--s3); }
.footer-grid { display: grid; gap: var(--s7); grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }
.footer-links { display: flex; flex-direction: column; gap: 9px; font-size: var(--fs-sm); }
.footer-bottom {
  border-top: var(--bw) solid #2C332F; margin-top: var(--s7); padding-top: var(--s5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  font-size: var(--fs-xs); color: #7E8A83;
}
.trust-mark {
  min-height: var(--tap); padding: 0 14px; border: var(--bw) solid #2C332F;
  border-radius: var(--r-sm); display: inline-flex; align-items: center; font-size: var(--fs-xs);
}

/* ─── صفحهٔ دوره ─── */
.course-hero { background: var(--brand-700); color: var(--on-brand); position: relative; overflow: hidden; }
.course-hero h1 { color: var(--on-brand); font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 900; }
.course-hero .lede { color: var(--brand-100); font-size: 1.04rem; line-height: var(--lh-prose); max-width: 40rem; }
.course-hero a { color: var(--brand-100); }
.course-hero-rings { position: absolute; inset-inline-end: -80px; top: -100px; opacity: .3; pointer-events: none; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: var(--s6); font-size: var(--fs-ui); color: var(--brand-100); }
.hero-meta > span { display: inline-flex; align-items: center; gap: var(--s2); }
.hero-meta .i { color: var(--gold-500); }
.teacher-row {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  margin-top: var(--s6); padding-top: var(--s5); border-top: var(--bw) solid rgba(255, 255, 255, .15);
}
.teacher-row .avatar { background: var(--gold-500); color: #23211D; }

.course-layout { display: grid; grid-template-columns: 1fr; gap: var(--s7); }
@media (min-width: 1000px) { .course-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s8); align-items: start; } }
.buy-card {
  background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-xl);
  overflow: hidden; box-shadow: var(--e3);
}
@media (min-width: 1000px) { .buy-wrap { position: sticky; top: calc(var(--header-h) + 16px); margin-top: -160px; } }
.buy-preview { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--brand-700); }
.buy-preview img { width: 100%; height: 100%; object-fit: cover; }
.buy-play {
  position: absolute; inset: 0; display: grid; place-items: center; gap: var(--s3);
  align-content: center; color: #fff; font-size: var(--fs-sm); font-weight: 700;
  background: linear-gradient(to top, rgba(19, 21, 19, .55), transparent 55%);
}
.buy-play i {
  width: 64px; height: 64px; border-radius: var(--r-pill); background: var(--paper); color: var(--brand-700);
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.buy-body { padding: var(--s6); }
.buy-price { display: flex; align-items: baseline; gap: 10px; }
.buy-price b { font-size: 2rem; font-weight: 900; letter-spacing: -.02em; }
.buy-price .unit { font-size: var(--fs-ui); font-weight: 600; color: var(--ink-2); }
.includes { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s6); padding-top: var(--s5); border-top: var(--bw) solid var(--line-soft); }
.include { display: flex; align-items: flex-start; gap: 11px; }
.include .i { margin-top: 2px; color: var(--brand-500); }
.include b { display: block; font-size: var(--fs-ui); font-weight: 700; }
.include span { display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; line-height: 1.6; }
.buy-note { margin-top: var(--s5); padding: 13px 15px; background: var(--paper); border-radius: var(--r-md); font-size: var(--fs-xs); line-height: 1.75; color: var(--ink-2); }
.outcomes { display: grid; gap: 10px 24px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.outcomes li { display: flex; gap: 11px; align-items: flex-start; font-size: var(--fs-ui); line-height: 1.8; color: var(--ink); }
.outcomes .i { margin-top: 3px; color: var(--brand-500); flex-shrink: 0; }
.faq-item { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; }
.faq-item > summary {
  display: flex; align-items: center; gap: var(--s3); list-style: none; cursor: pointer;
  min-height: 56px; padding: 12px var(--s5); font-size: var(--fs-ui); font-weight: 700;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary .i { margin-inline-start: auto; transition: transform var(--dur) var(--ease); }
.faq-item[open] > summary .i { transform: rotate(180deg); }
.faq-item p { margin: 0; padding: 0 var(--s5) var(--s5); font-size: var(--fs-ui); }
.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-3); }
.breadcrumb .i { opacity: .7; }

/* ─── محیط یادگیری ─── */
.theatre { background: var(--paper); color: var(--ink); min-height: 100vh; }
.theatre-bar {
  min-height: 62px; border-bottom: var(--bw) solid var(--line);
  display: flex; align-items: center; gap: var(--s4); padding: 8px var(--s5); flex-wrap: wrap;
}
.theatre-title { min-width: 0; flex: 1; }
.theatre-title .meta { flex-wrap: nowrap; }
.theatre-title .meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theatre-title b { display: block; font-size: var(--fs-ui); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theatre-title span { display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 1px; }
.learn-layout { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1080px) { .learn-layout { grid-template-columns: minmax(0, 1fr) 372px; } }
.learn-main { padding: var(--s5) var(--s5) var(--s8); min-width: 0; }
.learn-rail {
  border-top: var(--bw) solid var(--line); background: var(--sunk); min-width: 0;
}
@media (min-width: 1080px) {
  .learn-rail {
    border-top: none; border-inline-start: var(--bw) solid var(--line);
    position: sticky; top: 0; align-self: start;
    height: 100vh; display: flex; flex-direction: column;
  }
}
.rail-tabs { display: flex; border-bottom: var(--bw) solid var(--line); padding: 0 var(--s3); }
.rail-tab {
  flex: 1; min-height: var(--tap); display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3);
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: var(--font);
}
.rail-tab[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--gold-500); }
.rail-panel { padding: var(--s3); overflow-y: auto; }
@media (min-width: 1080px) { .rail-panel { flex: 1; } }
.rail-panel[hidden] { display: none; }
.rail-group {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap);
  padding: 8px 10px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2);
  background: none; border: none; width: 100%; cursor: pointer; font-family: var(--font); text-align: start;
}
.rail-group .i-chev { transition: transform var(--dur) var(--ease); }
.rail-group[aria-expanded="true"] .i-chev { transform: rotate(-90deg); }

/* پلیر */
.player-shell { position: relative; background: #0B0E0C; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--e2); }
.player-stage { position: relative; }
.player-shell video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #0B0E0C; }
.audio-mode video { aspect-ratio: auto; height: 120px; }
.player-watermark {
  position: absolute; top: 14px; inset-inline-end: 18px; z-index: 5;
  color: rgba(255, 255, 255, .34); font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .12em; direction: ltr; pointer-events: none; user-select: none;
}
.player-overlay-msg {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 6;
  background: rgba(11, 14, 12, .93); color: #fff; text-align: center; padding: var(--s6);
  font-size: var(--fs-ui); line-height: 1.8;
}
.player-error { color: #E79C93; }
.pseek {
  position: relative; height: 26px; display: flex; align-items: center;
  padding: 0 var(--s4); background: #1B1F1D; cursor: pointer;
}
.pseek-track { position: absolute; inset-inline: var(--s4); height: 6px; background: rgba(255, 255, 255, .16); border-radius: var(--r-pill); }
.pseek .fill { position: absolute; inset-inline-start: var(--s4); height: 6px; background: var(--gold-500); border-radius: var(--r-pill); width: 0; }
.pseek .knob {
  position: absolute; inset-inline-start: var(--s4); top: 50%;
  width: 15px; height: 15px; margin-top: -7.5px; transform: translateX(50%);
  background: #fff; border-radius: var(--r-pill); box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.pseek .mark { position: absolute; top: 50%; margin-top: -6px; width: 3px; height: 12px; border-radius: 2px; background: rgba(255, 255, 255, .5); }
.pcontrols {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2);
  padding: 10px var(--s4) 14px; background: #1B1F1D; color: #EAE7E0;
}
.pcontrols button, .pcontrols select {
  background: rgba(255, 255, 255, .08); color: #EAE7E0; border: none; border-radius: 11px;
  min-width: var(--tap); height: var(--tap); cursor: pointer;
  display: inline-grid; place-items: center; font-family: var(--font); font-size: var(--fs-sm);
}
.pcontrols button:hover, .pcontrols select:hover { background: rgba(255, 255, 255, .18); }
.pcontrols select { padding: 0 12px; width: auto; min-height: var(--tap); appearance: none; background-image: none; }
.pcontrols .pplay { width: 50px; height: 50px; background: var(--gold-500); color: #23211D; border-radius: 14px; }
.pcontrols .pplay:hover { background: var(--gold-500); filter: brightness(1.06); }
.pcontrols .ptime { font-family: var(--font-mono); font-size: .8rem; direction: ltr; color: #9AA79F; margin-inline: 6px; }
.pcontrols .pvol { width: 80px; accent-color: var(--gold-500); min-height: 0; height: auto; }
.pcontrols .pright { display: flex; align-items: center; gap: var(--s2); margin-inline-start: auto; flex-wrap: wrap; }
.pcontrols .on { background: var(--gold-500); color: #23211D; }
.shortcuts {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5);
  margin-top: var(--s5); padding: 12px var(--s4); background: var(--surface);
  border: var(--bw) solid var(--line); border-radius: var(--r-md); font-size: var(--fs-xs); color: var(--ink-3);
}
.shortcuts kbd {
  font-family: var(--font-mono); font-size: .7rem; background: var(--surface-2); color: var(--ink-2);
  padding: 3px 7px; border-radius: 5px; margin-inline-end: 5px;
}

/* ─── گواهی ─── */
.certificate-card {
  background: var(--surface); border: 3px double var(--brand-700); border-radius: var(--r-xl);
  padding: clamp(24px, 5vw, 48px); text-align: center; position: relative;
}
.certificate-card::before { content: '✦'; position: absolute; top: 14px; inset-inline-start: 18px; color: var(--gold-500); font-size: 1.4rem; }
.cert-serial {
  font-family: var(--font-mono); font-size: var(--fs-sm); background: var(--surface-2);
  border-radius: var(--r-sm); display: inline-block; padding: 7px 16px; direction: ltr; letter-spacing: .2em;
}

/* ─── کاهش حرکت ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ─── چاپ ─── */
@media print {
  .site-header, .site-footer, .tabbar, .panel-nav, .shell-aside, .btn, .no-print, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
  .shell { grid-template-columns: 1fr; }
  .certificate-card { border-color: #000; }
}

/* ─── صفحه‌های پنل داخل پوستهٔ سایدباردار ─── */
.shell-main .container { max-width: none; padding: 0; }
.shell-main .section { padding: 0 0 var(--s7); }
.shell-main > section:first-child > h1:first-child,
.shell-main .section > h1:first-child { margin-top: 0; }
