/* ============================================================
   آکادمی وب — سیستم طراحی کامل نسخه PHP (دانشجو)
   پالت سبز/فیروزه‌ای — RTL — تم روشن و تاریک — بدون هیچ وابستگی
   ============================================================ */

/* ---------- فونت‌های محلی: استعداد (FD) و وزیرمتن ---------- */
@font-face { font-family: "Estedad"; src: url("../fonts/Estedad-FD-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Estedad"; src: url("../fonts/Estedad-FD-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Estedad"; src: url("../fonts/Estedad-FD-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Estedad"; src: url("../fonts/Estedad-FD-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Estedad"; src: url("../fonts/Estedad-FD-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Estedad"; src: url("../fonts/Estedad-FD-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Estedad"; src: url("../fonts/Estedad-FD-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

/* ---------- توکن‌های رنگ و اندازه ---------- */
:root {
  --bg: #f4faf7;
  --fg: #1c2b2a;
  --fg-soft: rgba(28, 43, 42, 0.85);
  --card: #ffffff;
  --muted: #ecf4ef;
  --muted-fg: #5d716c;
  --border: #d9e7e0;
  --input: #c9ddd4;
  --primary: #0d9488;
  --primary-strong: #0b7c72;
  --primary-fg: #ffffff;
  --primary-soft: rgba(13, 148, 136, 0.10);
  --primary-ring: rgba(13, 148, 136, 0.45);
  --emerald: #059669;
  --emerald-strong: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.12);
  --amber: #d97706;
  --amber-strong: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --orange: #ea580c;
  --orange-soft: rgba(234, 88, 12, 0.12);
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, 0.12);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);
  --sidebar: #edf5f0;
  --sidebar-border: #dbe8e1;
  --sidebar-accent: #e0ede6;
  --shadow-sm: 0 1px 3px rgba(16, 60, 50, 0.08);
  --shadow-md: 0 4px 14px rgba(16, 60, 50, 0.10);
  --shadow-lg: 0 12px 34px rgba(16, 60, 50, 0.16);
  --radius: 14px;
  --radius-lg: 20px;
  --font-body: "Vazirmatn", "Estedad", Tahoma, sans-serif;
  --font-head: "Estedad", "Vazirmatn", Tahoma, sans-serif;
  --font-mono: Consolas, Menlo, "Courier New", monospace;
}
html.dark {
  --bg: #0c1517;
  --fg: #e3eeea;
  --fg-soft: rgba(227, 238, 234, 0.86);
  --card: #13211f;
  --muted: #1a2b28;
  --muted-fg: #8ba69d;
  --border: #243b36;
  --input: #2b453f;
  --primary: #2dd4bf;
  --primary-strong: #14b8a6;
  --primary-fg: #052723;
  --primary-soft: rgba(45, 212, 191, 0.12);
  --primary-ring: rgba(45, 212, 191, 0.45);
  --emerald: #34d399;
  --emerald-strong: #6ee7b7;
  --emerald-soft: rgba(52, 211, 153, 0.14);
  --amber: #fbbf24;
  --amber-strong: #fcd34d;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --orange: #fb923c;
  --orange-soft: rgba(251, 146, 60, 0.14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);
  --rose: #fb7185;
  --rose-soft: rgba(251, 113, 133, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --sidebar: #0f1c1a;
  --sidebar-border: #1e312d;
  --sidebar-accent: #172925;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.5);
}

/* ---------- ریست و پایه ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { direction: rtl; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 800; line-height: 1.5; margin: 0; }
p { margin: 0; }
button { font-family: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 2px; border-radius: 6px; }

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 130, 120, 0.35); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 130, 120, 0.6); border: 2px solid transparent; background-clip: content-box; }
html.dark ::-webkit-scrollbar-thumb { background: rgba(120, 160, 150, 0.28); border: 2px solid transparent; background-clip: content-box; }

/* ---------- چیدمان کلی: سایدبار ثابت راست + محتوای اصلی ---------- */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.shell { display: flex; flex: 1 0 auto; min-height: 100vh; }
.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; margin-right: 288px; }
.main-area { flex: 1 1 auto; width: 100%; max-width: 1120px; padding: 26px 32px 60px; }

/* ---------- اسکلت بارگذاری ---------- */
.boot-skeleton { display: flex; min-height: 100vh; }
.boot-side { width: 288px; flex-shrink: 0; border-left: 1px solid var(--border); background: var(--sidebar); }
.boot-main { flex: 1; padding: 26px 32px; }
.boot-topbar { height: 64px; border-radius: 16px; background: var(--muted); margin-bottom: 22px; }
.boot-hero { height: 190px; border-radius: 24px; background: var(--muted); margin-bottom: 22px; }
.boot-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.boot-card { height: 96px; border-radius: 18px; background: var(--muted); }
.boot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.boot-chapter { height: 210px; border-radius: 18px; background: var(--muted); }
.boot-note { text-align: center; color: var(--muted-fg); margin-top: 26px; font-size: 13px; }
.skeleton-shimmer { position: relative; overflow: hidden; }
.skeleton-shimmer::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  animation: shimmer 1.6s ease-in-out infinite;
}
html.dark .skeleton-shimmer::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); }
@keyframes shimmer { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* ---------- هدر بالا ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; padding: 0 32px; }
.topbar-title { min-width: 0; }
.topbar-title .t1 { font-family: var(--font-head); font-weight: 900; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .t2 { font-size: 11px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; color: var(--muted-fg);
  transition: background 0.18s, color 0.18s, border-color 0.18s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--muted); color: var(--fg); }
.icon-btn svg { width: 17px; height: 17px; }
.brand-mini { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mini .logo-badge {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--emerald-strong));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; font-family: var(--font-head);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--card);
  border-radius: 12px; padding: 4px 10px 4px 12px; height: 42px;
  max-width: 220px; transition: background 0.18s;
}
.user-chip:hover { background: var(--muted); }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px; font-family: var(--font-head);
}
.user-chip .uname { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu { position: relative; }
.user-pop {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; z-index: 60;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 14px; animation: popIn 0.18s ease both;
}
.user-pop .up-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 4px 0; }
.user-pop .up-row .k { color: var(--muted-fg); }

/* ---------- بنر اعلان ---------- */
.announce {
  background: linear-gradient(to left, var(--amber-soft), transparent);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  color: #92600a; padding: 10px 32px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
html.dark .announce { color: var(--amber); }
.announce .megaphone { font-size: 15px; flex-shrink: 0; }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 800; font-size: 13.5px;
  transition: transform 0.15s, opacity 0.15s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: var(--primary-fg); box-shadow: 0 6px 18px rgba(13, 148, 136, 0.3); }
.btn-primary:hover { opacity: 0.92; }
.btn-emerald { background: var(--emerald); color: #fff; box-shadow: 0 6px 18px rgba(5, 150, 105, 0.3); }
.btn-emerald:hover { opacity: 0.92; }
.btn-amber { background: var(--amber-strong); color: #fff; box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3); }
.btn-amber:hover { opacity: 0.92; }
.btn-outline { background: var(--card); border-color: var(--border); color: var(--fg); }
.btn-outline:hover { background: var(--muted); }
.btn-soft-amber { background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.4); color: var(--amber); }
.btn-soft-amber:hover { background: rgba(245, 158, 11, 0.2); }
.btn-soft-emerald { background: var(--emerald-soft); border-color: rgba(16, 185, 129, 0.4); color: var(--emerald); }
.btn-danger-ghost { background: transparent; border-color: var(--border); color: var(--muted-fg); }
.btn-danger-ghost:hover { color: var(--danger); border-color: var(--danger); }
.btn-lg { height: 48px; padding: 0 26px; font-size: 14px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- نشان‌ها و چیپ‌ها ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; border: 1px solid transparent; }
.badge svg { width: 12px; height: 12px; }
.badge-teal { background: var(--primary-soft); color: var(--primary); }
.badge-emerald { background: var(--emerald-soft); color: var(--emerald); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-rose { background: var(--rose-soft); color: var(--rose); }
.badge-muted { background: var(--muted); color: var(--muted-fg); border-color: var(--border); }

/* ---------- کارت‌ها ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.section-title { font-family: var(--font-head); font-weight: 900; font-size: 19px; margin-bottom: 4px; }
.section-sub { color: var(--muted-fg); font-size: 13.5px; margin-bottom: 18px; }

/* ---------- هیرو داشبورد ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 24px; border: 1px solid rgba(13, 148, 136, 0.25);
  background: linear-gradient(to left, var(--primary-soft), rgba(16, 185, 129, 0.05), transparent);
  padding: 30px 28px; margin-bottom: 26px;
}
.hero-pattern {
  background-image: radial-gradient(rgba(13, 148, 136, 0.16) 1px, transparent 1.5px);
  background-size: 22px 22px;
}
.hero .bubble { position: absolute; border-radius: 50%; filter: blur(46px); pointer-events: none; }
.hero .b1 { width: 220px; height: 220px; top: -60px; left: -60px; background: rgba(13, 148, 136, 0.14); }
.hero .b2 { width: 190px; height: 190px; bottom: -80px; right: -40px; background: rgba(16, 185, 129, 0.12); }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid rgba(13, 148, 136, 0.3); color: var(--primary); border-radius: 999px; padding: 6px 16px; font-size: 12px; font-weight: 800; margin-bottom: 16px; }
.hero h1 { font-size: clamp(22px, 3.4vw, 34px); font-weight: 900; margin-bottom: 10px; line-height: 1.6; }
.hero h1 .hello { color: var(--primary); }
.hero .hero-sub { color: var(--muted-fg); max-width: 620px; font-size: 15px; }
.hero .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero-float { position: absolute; opacity: 0.07; font-family: var(--font-mono); font-weight: 900; pointer-events: none; user-select: none; animation: heroFloat 7s ease-in-out infinite; }
@keyframes heroFloat { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12px) rotate(5deg); } }

/* نوار پیشرفت کلی */
.overall-progress { max-width: 620px; margin-top: 22px; }
.overall-progress .op-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 8px; }
.overall-progress .op-row b { color: var(--primary); }

/* ---------- نوار پیشرفت ---------- */
.progress { height: 12px; border-radius: 999px; background: var(--muted); border: 1px solid var(--border); overflow: hidden; }
.progress.thin { height: 8px; border: 0; }
.progress.xthin { height: 6px; border: 0; }
.progress > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(to left, var(--primary), var(--emerald-strong));
  transition: width 0.9s cubic-bezier(0.2, 0.7, 0.3, 1);
  position: relative; min-width: 0;
}
.progress > span.stripes::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.25) 50%, rgba(255,255,255,.25) 75%, transparent 75%);
  background-size: 16px 16px; animation: stripes 0.9s linear infinite;
}
.progress > span.bg-emerald { background: linear-gradient(to left, var(--emerald), var(--emerald-strong)); }
.progress > span.bg-amber { background: linear-gradient(to left, var(--amber-strong), #fbbf24); }
.progress > span.bg-rose { background: linear-gradient(to left, var(--rose), #fb923c); }
@keyframes stripes { from { background-position: 0 0; } to { background-position: 16px 0; } }

/* ---------- کارت‌های آمار ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat-card .s-icon { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-card .s-icon.tone-teal { background: var(--primary-soft); }
.stat-card .s-icon.tone-emerald { background: var(--emerald-soft); }
.stat-card .s-icon.tone-orange { background: var(--orange-soft); }
.stat-card .s-icon.tone-violet { background: var(--violet-soft); }
.stat-card .s-value { font-family: var(--font-head); font-weight: 900; font-size: 21px; line-height: 1.3; }
.stat-card .s-label { font-size: 11.5px; color: var(--muted-fg); }

/* ---------- شبکه فصل‌ها ---------- */
.chapters-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.chapter-card {
  position: relative; overflow: hidden; text-align: right;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px 20px 18px; display: flex; flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.chapter-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(13, 148, 136, 0.45); }
.chapter-card .cc-bar { position: absolute; top: 0; right: 0; left: 0; height: 6px; opacity: 0.85; }
.chapter-card .cc-num {
  position: absolute; bottom: -18px; left: -6px; font-family: var(--font-head);
  font-size: 86px; font-weight: 900; opacity: 0.06; pointer-events: none; line-height: 1;
}
.chapter-card .cc-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.chapter-card .cc-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; }
.chapter-card .cc-kicker { font-size: 11px; font-weight: 800; color: var(--muted-fg); }
.chapter-card .cc-title { font-weight: 900; font-size: 15px; line-height: 1.55; }
.chapter-card .cc-desc { font-size: 12.5px; color: var(--muted-fg); margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chapter-card .cc-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-fg); margin-bottom: 6px; }
.chapter-card .cc-done { position: absolute; top: 14px; left: 14px; }
.chip-complete { border-radius: 999px; background: var(--emerald-soft); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.35); font-size: 10px; font-weight: 800; padding: 2px 10px; }
/* رنگ نوار فصل‌ها */
.bar-teal { background: #14b8a6; } .bar-orange { background: #f97316; } .bar-green { background: #22c55e; }
.bar-amber { background: #f59e0b; } .bar-violet { background: #8b5cf6; } .bar-rose { background: #f43f5e; }
.chip-teal { background: rgba(20, 184, 166, 0.12); color: #0d9488; }
.chip-orange { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.chip-green { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.chip-amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.chip-violet { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.chip-rose { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
html.dark .chip-teal { color: #5eead4; } html.dark .chip-orange { color: #fdba74; }
html.dark .chip-green { color: #86efac; } html.dark .chip-amber { color: #fcd34d; }
html.dark .chip-violet { color: #c4b5fd; } html.dark .chip-rose { color: #fda4af; }

/* ---------- سایدبار ---------- */
.sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: 288px; z-index: 40;
  background: var(--sidebar); border-left: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
}
.sb-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--sidebar-border); }
.sb-head button.sb-home { display: flex; align-items: center; gap: 12px; width: 100%; text-align: right; background: none; border: 0; padding: 0; }
.sb-head .logo-badge { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--emerald-strong)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-family: var(--font-head); box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35); flex-shrink: 0; }
.sb-head .sb-name { display: block; font-family: var(--font-head); font-weight: 900; font-size: 16px; line-height: 1.4; color: var(--fg); }
.sb-head .sb-tag { display: block; font-size: 11px; color: var(--muted-fg); }
.sb-links { padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 4px; }
.sb-action {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: right;
  border: 0; background: none; border-radius: 12px; padding: 10px 12px;
  font-size: 13px; font-weight: 800; color: var(--fg-soft); transition: background 0.15s;
}
.sb-action:hover { background: var(--sidebar-accent); }
.sb-action.active { background: var(--primary); color: var(--primary-fg); box-shadow: 0 5px 14px rgba(13, 148, 136, 0.3); }
.sb-action .ico { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.sb-nav { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px 14px; }
.sb-caption { font-size: 11px; font-weight: 800; color: var(--muted-fg); padding: 8px 8px; }
.sb-ch { border-radius: 14px; border: 1px solid transparent; margin-bottom: 6px; }
.sb-ch[open] { border-color: var(--sidebar-border); background: color-mix(in srgb, var(--card) 55%, transparent); }
.sb-ch > summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px; cursor: pointer; user-select: none;
}
.sb-ch > summary::-webkit-details-marker { display: none; }
.sb-ch > summary:hover { background: var(--sidebar-accent); }
.sb-ch .ch-ico { width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.sb-ch .ch-t { flex: 1 1 auto; min-width: 0; }
.sb-ch .ch-t .l1 { display: block; font-size: 12.5px; font-weight: 800; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ch .ch-t .l2 { display: block; font-size: 10.5px; color: var(--muted-fg); }
.sb-ch .chev { width: 14px; height: 14px; transition: transform 0.2s; color: var(--muted-fg); flex-shrink: 0; }
.sb-ch[open] .chev { transform: rotate(180deg); }
.sb-items { list-style: none; margin: 0; padding: 2px 8px 10px; }
.sb-items button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: right;
  border: 0; background: none; border-radius: 9px; padding: 7px 9px;
  font-size: 12.5px; color: var(--fg-soft); transition: background 0.14s;
}
.sb-items button:hover { background: var(--sidebar-accent); }
.sb-items button.active { background: var(--primary); color: var(--primary-fg); font-weight: 800; }
.sb-items .it-ico { font-size: 12px; width: 16px; text-align: center; flex-shrink: 0; opacity: 0.8; }
.sb-items .it-t { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-items .it-check { color: var(--emerald); flex-shrink: 0; }
.sb-items button.active .it-check { color: var(--primary-fg); }
.sb-final { padding: 4px 12px 14px; }
.sb-final button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: right;
  border-radius: 14px; border: 1px solid var(--sidebar-border); background: color-mix(in srgb, var(--card) 55%, transparent);
  padding: 10px 12px; transition: background 0.16s, border-color 0.16s;
}
.sb-final button:hover { background: var(--sidebar-accent); }
.sb-final button.unlocked { border-color: rgba(245, 158, 11, 0.45); background: var(--amber-soft); }
.sb-final button.done { border-color: rgba(16, 185, 129, 0.4); background: var(--emerald-soft); }
.sb-final button.active { background: var(--amber-strong); color: #fff; border-color: var(--amber-strong); }
.sb-final .f-ico { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; background: var(--muted); }
.sb-final button.unlocked .f-ico { background: rgba(245, 158, 11, 0.18); }
.sb-final button.done .f-ico { background: rgba(16, 185, 129, 0.18); }
.sb-final button.active .f-ico { background: rgba(255, 255, 255, 0.2); }
.sb-final .l1 { display: block; font-size: 12.5px; font-weight: 800; }
.sb-final .l2 { display: block; font-size: 10.5px; color: var(--muted-fg); }
.sb-final button.active .l2 { color: rgba(255, 255, 255, 0.85); }
.sb-foot { padding: 12px 18px; border-top: 1px solid var(--sidebar-border); text-align: center; font-size: 11px; color: var(--muted-fg); }

/* دراور موبایل */
.drawer-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); animation: fadeIn 0.2s ease both; }
.drawer-close { position: absolute; top: 14px; left: -52px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--fg); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); z-index: 5; }

/* ---------- محتوای درس ---------- */
.item-header { margin-bottom: 22px; animation: fadeUp 0.4s ease both; }
.item-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted-fg); margin-bottom: 10px; }
.item-crumbs .sep { opacity: 0.4; }
.item-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.item-title-row h1 { font-size: clamp(20px, 3vw, 28px); font-weight: 900; }
.item-meta { display: flex; align-items: center; gap: 6px; color: var(--muted-fg); font-size: 13px; margin-top: 8px; }
.btn-done { background: var(--primary); color: var(--primary-fg); box-shadow: 0 6px 18px rgba(13, 148, 136, 0.3); }
.btn-done.is-done { background: var(--emerald-soft); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.45); box-shadow: none; }

/* رندر بلوک‌های درس */
.lesson-prose { animation: fadeUp 0.4s ease both; }
.lesson-prose > * + * { margin-top: 14px; }
.lesson-prose h3 { font-size: 17.5px; font-weight: 800; margin-top: 28px; display: flex; align-items: center; gap: 10px; }
.lesson-prose h3::before { content: ""; width: 6px; height: 20px; border-radius: 999px; background: var(--primary); flex-shrink: 0; }
.lesson-prose p { line-height: 2.1; font-size: 15.5px; color: var(--fg-soft); }
.lesson-prose strong { color: var(--fg); }
.lesson-prose ul, .lesson-prose ol { margin: 12px 0; padding-right: 26px; }
.lesson-prose ul li, .lesson-prose ol li { margin-bottom: 7px; line-height: 2; font-size: 15px; }
.lesson-prose ul { list-style: disc; }
.lesson-prose ol { list-style: decimal; }
.lesson-prose ul li::marker { color: var(--primary); }
.lesson-prose ol li::marker { color: var(--primary); font-weight: 800; }
.lesson-prose code.inline {
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 7px; padding: 1px 7px; font-family: var(--font-mono);
  font-size: 12.5px; direction: ltr; unicode-bidi: embed; display: inline-block;
}
.code-block { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); margin: 18px 0; box-shadow: var(--shadow-sm); }
.code-block .cb-bar { background: #24303b; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; }
.code-block .cb-dots { display: flex; gap: 6px; }
.code-block .cb-dots i { width: 11px; height: 11px; border-radius: 50%; }
.code-block .cb-dots i:nth-child(1) { background: #f87171; }
.code-block .cb-dots i:nth-child(2) { background: #fbbf24; }
.code-block .cb-dots i:nth-child(3) { background: #34d399; }
.code-block .cb-caption { color: #a8b6c4; font-size: 11px; }
.code-block pre { background: #141c24; color: #e7eef4; margin: 0; padding: 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.9; direction: ltr; text-align: left; }
.tip-box { border-radius: 14px; border: 1px solid; padding: 13px 16px; display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; }
.tip-box .tip-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.tip-box .tip-title { font-weight: 800; font-size: 13px; margin-bottom: 3px; }
.tip-box .tip-text { font-size: 13.5px; line-height: 1.95; color: var(--fg-soft); }
.tip-box.kind-tip { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.06); }
.tip-box.kind-tip .tip-ico { background: var(--emerald-soft); }
.tip-box.kind-warn { border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.06); }
.tip-box.kind-warn .tip-ico { background: var(--amber-soft); }
.tip-box.kind-info { border-color: rgba(20, 184, 166, 0.4); background: rgba(20, 184, 166, 0.06); }
.tip-box.kind-info .tip-ico { background: var(--primary-soft); }
.table-wrap { border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; margin: 18px 0; background: var(--card); }
.lesson-prose table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lesson-prose thead tr { background: var(--muted); }
.lesson-prose th { text-align: right; font-weight: 800; font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.lesson-prose td { padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); line-height: 1.9; }
.lesson-prose tbody tr:nth-child(even) { background: color-mix(in srgb, var(--muted) 35%, transparent); }
.lesson-prose tbody tr:last-child td { border-bottom: 0; }

/* ---------- نوار پخش صوتی درس ---------- */
.audio-bar {
  border: 1px solid rgba(124, 58, 237, 0.35);
  background: linear-gradient(to left, rgba(124, 58, 237, 0.08), rgba(217, 70, 239, 0.04), transparent);
  border-radius: 16px; padding: 12px 16px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  animation: fadeUp 0.4s ease both;
}
.audio-bar .a-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--violet-soft); color: var(--violet); display: flex; align-items: center; justify-content: center; font-size: 17px; position: relative; flex-shrink: 0; }
.audio-bar .a-ico.on { background: var(--violet); color: #fff; }
.audio-bar .a-ico .pulse-dot { position: absolute; top: -3px; left: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(0.7); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.audio-bar .a-title { font-size: 13.5px; font-weight: 900; }
.audio-bar .a-status { font-size: 11px; color: var(--muted-fg); }
.audio-bar .a-fa-badge { display: inline-flex; align-items: center; gap: 3px; border-radius: 999px; background: var(--emerald-soft); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.3); font-size: 9.5px; font-weight: 900; padding: 1px 8px; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.eq i { width: 3.5px; border-radius: 999px; background: rgba(124, 58, 237, 0.3); }
.eq.on i { background: rgba(124, 58, 237, 0.75); animation: eqBounce 0.9s ease-in-out infinite; transform-origin: bottom; }
@keyframes eqBounce { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.audio-controls { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.audio-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; transition: opacity 0.15s; }
.audio-btn.play { background: var(--violet); color: #fff; }
.audio-btn.play:hover { opacity: 0.9; }
.audio-btn.stop { background: var(--card); border: 1px solid var(--border); color: var(--muted-fg); }
.audio-btn.stop:hover { background: var(--muted); }
.audio-progress { width: 100%; height: 6px; border-radius: 999px; background: rgba(124, 58, 237, 0.12); overflow: hidden; margin-top: 10px; }
.audio-progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(to left, var(--violet), #d946ef); transition: width 0.4s; }

/* ---------- دفترچه یادداشت ---------- */
.notepad { border: 1px solid rgba(245, 158, 11, 0.35); background: linear-gradient(to left, rgba(245, 158, 11, 0.07), transparent); border-radius: 16px; overflow: hidden; margin-top: 30px; }
.notepad .np-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: none; border: 0; text-align: right; }
.notepad .np-head:hover { background: rgba(245, 158, 11, 0.05); }
.notepad .np-ico { width: 36px; height: 36px; border-radius: 11px; background: var(--amber-soft); color: var(--amber); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.notepad .np-title { font-weight: 900; font-size: 13.5px; display: block; }
.notepad .np-sub { font-size: 11px; color: var(--muted-fg); display: block; }
.notepad .np-status { font-size: 11px; color: var(--muted-fg); margin-right: auto; display: flex; align-items: center; gap: 4px; }
.notepad .np-status.saved { color: var(--emerald); }
.notepad .np-body { padding: 0 18px 16px; animation: fadeUp 0.3s ease both; }
.notepad textarea { width: 100%; min-height: 120px; border-radius: 12px; border: 1px solid rgba(245, 158, 11, 0.35); background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 12px 14px; font-size: 13.5px; line-height: 2; resize: vertical; outline: none; }
.notepad textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.notepad .np-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--muted-fg); }
.notepad .np-clear { background: none; border: 0; color: var(--muted-fg); font-size: 11px; display: inline-flex; gap: 4px; align-items: center; }
.notepad .np-clear:hover { color: var(--danger); }

/* ---------- ناوبری قبلی/بعدی ---------- */
.item-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); }
.item-nav .nav-btn { border-radius: 14px; border: 1px solid var(--border); background: var(--card); padding: 12px 16px; text-align: right; max-width: 46%; transition: background 0.15s; }
.item-nav .nav-btn:hover { background: var(--muted); }
.item-nav .nav-btn.next { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); text-align: left; box-shadow: 0 5px 16px rgba(13, 148, 136, 0.25); }
.item-nav .nav-btn.next:hover { opacity: 0.92; background: var(--primary); }
.item-nav .nav-btn .nb-k { display: block; font-size: 10.5px; opacity: 0.75; }
.item-nav .nav-btn .nb-t { display: block; font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- تمرین کدنویسی ---------- */
.exercise-scenario { border: 2px solid rgba(13, 148, 136, 0.35); background: var(--primary-soft); border-radius: 18px; padding: 20px; margin-bottom: 18px; }
.exercise-scenario .es-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.exercise-scenario .es-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.exercise-scenario h3 { font-size: 16px; font-weight: 900; }
.exercise-scenario .es-text { font-size: 15px; line-height: 2.05; color: var(--fg-soft); }
.tasks-box { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-top: 16px; }
.tasks-box .tb-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.tasks-box ol { margin: 0; padding-right: 20px; font-size: 13.5px; }
.tasks-box ol li { margin-bottom: 5px; line-height: 1.95; }

/* زمین بازی کد */
.playground { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--card); box-shadow: var(--shadow-sm); }
.playground .pg-bar { background: var(--muted); border-bottom: 1px solid var(--border); padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.playground .pg-dots { display: flex; align-items: center; gap: 6px; direction: ltr; }
.playground .pg-dots i { width: 11px; height: 11px; border-radius: 50%; }
.playground .pg-dots i:nth-child(1) { background: #f87171; }
.playground .pg-dots i:nth-child(2) { background: #fbbf24; }
.playground .pg-dots i:nth-child(3) { background: #34d399; }
.playground .pg-dots .pg-name { color: var(--muted-fg); font-family: var(--font-mono); font-size: 11.5px; margin-right: 8px; }
.playground .pg-actions { display: flex; align-items: center; gap: 6px; }
.pg-btn { height: 32px; padding: 0 12px; border-radius: 9px; border: 0; background: none; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; color: var(--muted-fg); transition: background 0.15s; }
.pg-btn:hover { background: var(--muted); }
.pg-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.pg-btn.on { background: var(--primary-soft); color: var(--primary); }
.pg-btn.on .dot { background: var(--emerald); animation: pulse 1.6s ease-out infinite; }
.pg-btn.run { background: var(--primary); color: var(--primary-fg); }
.playground .pg-body { display: grid; grid-template-columns: 1fr 1fr; min-height: 420px; }
.playground .pg-editor { background: #141c24; position: relative; }
.playground textarea.code-editor {
  width: 100%; height: 100%; min-height: 300px; display: block;
  background: #141c24; color: #d7f5ea; border: 0; outline: none; resize: none;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.8;
  direction: ltr; text-align: left; padding: 16px; tab-size: 2; color-scheme: dark;
}
.playground textarea.code-editor::placeholder { color: #5b6b78; }
.playground .pg-preview { position: relative; background: repeating-conic-gradient(#eef1f0 0% 25%, #ffffff 0% 50%); background-size: 16px 16px; display: flex; justify-content: center; align-items: flex-start; overflow: auto; border-right: 1px solid var(--border); }
html.dark .playground .pg-preview { background: repeating-conic-gradient(#182624 0% 25%, #10201d 0% 50%); background-size: 16px 16px; }
.device-toggle { position: absolute; top: 8px; right: 8px; z-index: 5; display: flex; gap: 2px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 3px; box-shadow: var(--shadow-sm); }
.device-toggle button { border: 0; background: none; width: 30px; height: 26px; border-radius: 7px; font-size: 13px; color: var(--muted-fg); display: inline-flex; align-items: center; justify-content: center; }
.device-toggle button.on { background: var(--primary-soft); color: var(--primary); }
.preview-frame { background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); margin: 42px 16px 16px; transition: width 0.3s; }

/* دکمه‌های کنترل تمرین */
.exercise-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.hints-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.hint-item { border: 1px solid rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.06); border-radius: 12px; padding: 11px 15px; font-size: 13px; line-height: 2; animation: fadeUp 0.3s ease both; }
.hint-item b { color: var(--amber); margin-left: 6px; }
.hint-item code { background: var(--amber-soft); border-radius: 6px; padding: 1px 7px; direction: ltr; display: inline-block; font-family: var(--font-mono); font-size: 12px; unicode-bidi: embed; }
.solution-box { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 16px; animation: fadeUp 0.3s ease both; }
.solution-box .sol-bar { background: var(--muted); padding: 9px 16px; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.solution-box pre { background: #141c24; color: #e7eef4; margin: 0; padding: 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.85; direction: ltr; text-align: left; }
.solution-blur { filter: blur(7px); user-select: none; pointer-events: none; transition: filter 0.4s; }

/* نتایج بررسی */
.check-results { border: 2px solid rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.05); border-radius: 18px; padding: 20px; animation: fadeUp 0.35s ease both; }
.check-results.all-passed { border-color: rgba(16, 185, 129, 0.55); background: var(--emerald-soft); }
.check-results .cr-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.check-results .cr-ico { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; background: var(--amber-strong); }
.check-results.all-passed .cr-ico { background: var(--emerald); }
.check-results .cr-title { font-weight: 900; font-size: 16px; font-family: var(--font-head); }
.check-results .cr-sub { font-size: 12.5px; color: var(--muted-fg); }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; background: var(--card); border: 1px solid var(--border); color: var(--fg-soft); }
.check-list li.pass { background: var(--emerald-soft); border-color: rgba(16, 185, 129, 0.3); color: var(--emerald); font-weight: 700; }
.check-list li .cl-ico { flex-shrink: 0; font-size: 15px; }

/* ---------- سناریو ---------- */
.scenario-head { border: 2px solid rgba(13, 148, 136, 0.28); background: linear-gradient(to left, var(--primary-soft), transparent); border-radius: 18px; padding: 20px; margin-bottom: 18px; }
.scenario-head .sh-row { display: flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 800; font-size: 13.5px; margin-bottom: 8px; flex-wrap: wrap; }
.scenario-head .sh-step { background: var(--primary-soft); border-radius: 999px; padding: 2px 12px; font-size: 11.5px; }
.scenario-head .sh-intro { font-size: 15px; line-height: 2.05; color: var(--fg-soft); }
.scenario-situation { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.scenario-situation .ss-k { font-size: 11.5px; font-weight: 800; color: var(--muted-fg); margin-bottom: 6px; }
.scenario-situation .ss-q { background: var(--primary-soft); border: 1px solid rgba(13, 148, 136, 0.25); border-radius: 12px; padding: 12px 16px; font-weight: 800; color: var(--primary); margin-top: 14px; }
.scenario-options { display: flex; flex-direction: column; gap: 12px; }
.opt-btn { text-align: right; border: 2px solid var(--border); background: var(--card); border-radius: 16px; padding: 15px 17px; display: flex; gap: 12px; align-items: flex-start; transition: border-color 0.18s, background 0.18s, transform 0.18s; }
.opt-btn:not(:disabled):hover { border-color: rgba(13, 148, 136, 0.5); background: var(--primary-soft); transform: translateY(-2px); }
.opt-btn:disabled { cursor: default; }
.opt-btn.correct { border-color: var(--emerald); background: var(--emerald-soft); }
.opt-btn.wrong { border-color: var(--danger); background: var(--danger-soft); }
.opt-btn.dim { opacity: 0.5; }
.opt-btn .opt-num { width: 32px; height: 32px; border-radius: 11px; background: var(--muted); color: var(--muted-fg); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; flex-shrink: 0; margin-top: 2px; }
.opt-btn.correct .opt-num { background: var(--emerald); color: #fff; }
.opt-btn.wrong .opt-num { background: var(--danger); color: #fff; }
.opt-btn .opt-text { font-weight: 800; font-size: 14.5px; display: block; }
.opt-btn .opt-feedback { display: block; margin-top: 8px; font-size: 13px; line-height: 1.95; color: var(--emerald); }
.opt-btn.wrong .opt-feedback { color: var(--danger); }
.scenario-success { border: 2px solid rgba(16, 185, 129, 0.45); background: var(--emerald-soft); border-radius: 20px; padding: 36px 24px; text-align: center; animation: popIn 0.4s ease both; }
.scenario-success .ss-ico { width: 78px; height: 78px; border-radius: 24px; background: var(--emerald); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 36px; margin-bottom: 16px; box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4); }
.scenario-success h3 { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.scenario-success .ss-score { color: var(--muted-fg); margin-bottom: 6px; }
.scenario-success .ss-score b { color: var(--emerald); font-size: 18px; }
.scenario-success .ss-msg { font-size: 13.5px; color: var(--muted-fg); max-width: 440px; margin: 0 auto 20px; line-height: 2; }

/* ---------- آزمون ---------- */
.exam-start { border: 2px solid rgba(13, 148, 136, 0.3); background: linear-gradient(to bottom, var(--primary-soft), transparent); border-radius: 24px; padding: 32px 24px; text-align: center; animation: fadeUp 0.4s ease both; }
.exam-start .es-ico { width: 78px; height: 78px; border-radius: 24px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 36px; margin-bottom: 14px; position: relative; }
.exam-start h3 { font-size: 23px; font-weight: 900; margin-bottom: 8px; }
.exam-start .es-desc { color: var(--muted-fg); font-size: 13.5px; max-width: 520px; margin: 0 auto 20px; line-height: 2.1; }
.exam-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.exam-chips .xchip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 800; color: var(--muted-fg); }
.exam-chips .xchip b { color: var(--fg); }
.exam-status { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.exam-qnums { display: flex; flex-wrap: wrap; gap: 6px; }
.exam-qnums button { width: 32px; height: 32px; border-radius: 9px; border: 0; background: var(--muted); color: var(--muted-fg); font-size: 12px; font-weight: 800; transition: transform 0.15s, background 0.15s; }
.exam-qnums button:hover { background: var(--muted); filter: brightness(0.96); }
.exam-qnums button.answered { background: var(--emerald-soft); color: var(--emerald); }
.exam-qnums button.current { background: var(--primary); color: var(--primary-fg); transform: scale(1.12); box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35); }
.exam-answer-count { font-size: 13px; color: var(--muted-fg); }
.exam-answer-count b { color: var(--fg); }
.exam-question { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-sm); animation: fadeUp 0.3s ease both; margin-bottom: 16px; }
.exam-question .eq-text { font-weight: 800; font-size: 15.5px; line-height: 2.1; margin-bottom: 18px; }
.exam-options { display: flex; flex-direction: column; gap: 10px; }
.exam-opt { text-align: right; border: 2px solid var(--border); background: var(--card); border-radius: 13px; padding: 13px 16px; display: flex; align-items: center; gap: 12px; font-size: 14px; line-height: 1.9; transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.exam-opt:hover { border-color: rgba(13, 148, 136, 0.45); background: var(--muted); transform: translateY(-1px); }
.exam-opt.selected { border-color: var(--primary); background: var(--primary-soft); font-weight: 800; }
.exam-opt .eo-letter { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--input); color: var(--muted-fg); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 900; flex-shrink: 0; }
.exam-opt.selected .eo-letter { border-color: var(--primary); background: var(--primary); color: var(--primary-fg); }
.exam-nav { display: flex; justify-content: space-between; gap: 12px; }
.exam-review { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.exam-review .er-bar { background: var(--muted); padding: 12px 20px; font-weight: 800; font-size: 13.5px; }
.exam-review .er-item { padding: 20px; border-top: 1px solid var(--border); }
.exam-review .er-q { display: flex; gap: 12px; align-items: flex-start; }
.exam-review .er-badge { width: 28px; height: 28px; border-radius: 9px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; margin-top: 2px; }
.exam-review .er-badge.ok { background: var(--emerald); }
.exam-review .er-badge.bad { background: #f87171; }
.exam-review .er-text { font-weight: 800; font-size: 14.5px; line-height: 1.95; margin-bottom: 6px; }
.exam-review .er-ans { font-size: 13px; color: var(--muted-fg); line-height: 2; }
.exam-review .er-ans b.ok { color: var(--emerald); }
.exam-review .er-ans b.bad { color: var(--danger); }
.exam-review .er-expl { margin-top: 8px; background: var(--muted); border-radius: 10px; padding: 9px 14px; font-size: 12.5px; line-height: 1.95; color: var(--fg-soft); }
.score-panel { border: 2px solid rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.05); border-radius: 24px; padding: 28px 24px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; animation: fadeUp 0.4s ease both; }
.score-panel.passed { border-color: rgba(16, 185, 129, 0.55); background: var(--emerald-soft); }
.score-ring { position: relative; width: 128px; height: 128px; flex-shrink: 0; margin: 0 auto; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .sr-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .sr-pct { font-family: var(--font-head); font-weight: 900; font-size: 27px; }
.score-ring .sr-lbl { font-size: 10px; font-weight: 800; color: var(--muted-fg); }
.score-panel .sp-title { font-family: var(--font-head); font-weight: 900; font-size: 22px; margin-bottom: 6px; }
.score-panel .sp-sub { font-size: 13.5px; color: var(--muted-fg); }
.score-panel .sp-sub b.ok { color: var(--emerald); }
.score-panel .sp-sub b.bad { color: var(--amber); }
.confetti-piece { position: fixed; top: 0; z-index: 999; pointer-events: none; animation: confettiFall linear forwards; }
@keyframes confettiFall { 0% { transform: translateY(-10vh) rotate(0); opacity: 1; } 100% { transform: translateY(110vh) rotate(720deg); opacity: 0.55; } }

/* قفل آزمون نهایی / گواهی */
.lock-panel { border: 2px dashed rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.05); border-radius: 24px; padding: 40px 24px; text-align: center; animation: fadeUp 0.4s ease both; }
.lock-panel .lk-ico { width: 62px; height: 62px; border-radius: 18px; background: var(--card); border: 1px solid rgba(245, 158, 11, 0.35); color: var(--amber); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 14px; }
.lock-panel h3 { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.lock-panel p { font-size: 13.5px; color: var(--muted-fg); max-width: 520px; margin: 0 auto 20px; line-height: 2.1; }
.req-list { list-style: none; max-width: 480px; margin: 0 auto; padding: 0; text-align: right; display: flex; flex-direction: column; gap: 8px; }
.req-list li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--card); border-radius: 13px; padding: 11px 15px; font-size: 13.5px; font-weight: 700; transition: background 0.15s; }
.req-list li:hover { background: var(--muted); }
.req-list button.req-btn { background: none; border: 0; padding: 0; font: inherit; display: flex; align-items: center; gap: 10px; width: 100%; text-align: right; cursor: pointer; }
.req-list .req-state { margin-right: auto; font-size: 11px; font-weight: 800; color: var(--muted-fg); }
.req-list li.ok .req-state { color: var(--emerald); }

/* ---------- گزارش ---------- */
.report-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; animation: fadeUp 0.4s ease both; }
.report-head h1 { font-size: clamp(20px, 3vw, 27px); display: flex; align-items: center; gap: 12px; }
.report-head .rh-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.report-head .rh-meta { font-size: 12.5px; color: var(--muted-fg); margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.activity-chart { display: flex; align-items: flex-end; gap: 5px; height: 130px; padding: 10px 4px 0; }
.activity-chart .ac-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.activity-chart .ac-bar { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: linear-gradient(to top, var(--primary), var(--emerald-strong)); min-height: 3px; transition: height 0.8s cubic-bezier(0.2, 0.7, 0.3, 1); }
.activity-chart .ac-col.zero .ac-bar { background: var(--muted); }
.activity-chart .ac-day { font-size: 9px; color: var(--muted-fg); }
.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th { text-align: right; font-weight: 800; font-size: 12px; color: var(--muted-fg); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--muted); white-space: nowrap; }
.history-table td { padding: 11px 14px; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.history-table tbody tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

/* ---------- گواهی ---------- */
.certificate-sheet {
  border: 5px double rgba(245, 158, 11, 0.65); border-radius: 24px;
  background: linear-gradient(180deg, #fffbeb, #ffffff 45%, #f0fdfa);
  color: #1f2937; padding: 44px 34px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg); text-align: center;
}
html.dark .certificate-sheet { background: linear-gradient(180deg, #2a2416, #1c201e 45%, #10201e); color: #e5e7eb; }
.certificate-sheet .cert-inner-border { position: absolute; inset: 12px; border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 16px; pointer-events: none; }
.certificate-sheet .cert-org { color: var(--primary); font-weight: 900; font-size: 18px; font-family: var(--font-head); }
.certificate-sheet .cert-tag { font-size: 11px; letter-spacing: 3px; color: var(--muted-fg); margin: 4px 0 24px; }
.certificate-sheet .cert-kind { font-size: 14px; color: var(--muted-fg); margin-bottom: 8px; }
.certificate-sheet .cert-name { font-size: clamp(24px, 4.5vw, 38px); font-weight: 900; font-family: var(--font-head); margin-bottom: 14px; }
.certificate-sheet .cert-body { font-size: 14.5px; line-height: 2.3; max-width: 620px; margin: 0 auto 26px; color: var(--fg-soft); }
.cert-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 460px; margin: 0 auto 26px; }
.cert-stats .cs-box { background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: 16px; padding: 12px; }
html.dark .cert-stats .cs-box { background: rgba(255, 255, 255, 0.06); }
.cert-stats .cs-val { font-family: var(--font-head); font-weight: 900; font-size: 23px; }
.cert-stats .cs-lbl { font-size: 11px; color: var(--muted-fg); }
.cert-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 30px; }
.cert-chips .cc-chip { display: inline-flex; gap: 5px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 11px; font-weight: 800; }
.cert-foot { display: flex; align-items: flex-end; justify-content: space-between; max-width: 640px; margin: 10px auto 0; gap: 14px; }
.cert-foot .cf-sign .cf-line { width: 110px; border-top: 2px solid rgba(107, 114, 128, 0.4); margin: 0 auto 6px; }
.cert-foot .cf-sign .cf-t { font-size: 12px; font-weight: 800; }
.cert-foot .cf-sign .cf-s { font-size: 11px; color: var(--muted-fg); }
.cert-seal { width: 58px; height: 58px; border-radius: 16px; background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 4px; box-shadow: 0 8px 22px rgba(217, 119, 6, 0.4); transform: rotate(4deg); }
.cert-foot .cf-seal-lbl { font-size: 10px; color: var(--muted-fg); }

/* ---------- واژه‌نامه ---------- */
.glossary-hero { position: relative; overflow: hidden; border: 1px solid rgba(13, 148, 136, 0.25); background: linear-gradient(to left, var(--primary-soft), transparent); border-radius: 24px; padding: 26px; margin-bottom: 22px; display: flex; align-items: center; gap: 16px; }
.glossary-hero .gh-ico { width: 54px; height: 54px; border-radius: 16px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 25px; flex-shrink: 0; }
.glossary-hero h1 { font-size: 22px; margin-bottom: 4px; }
.glossary-hero p { color: var(--muted-fg); font-size: 13.5px; }
.search-input { position: relative; margin-bottom: 14px; }
.search-input input { width: 100%; height: 48px; border-radius: 16px; border: 1px solid var(--input); background: var(--card); padding: 0 46px 0 16px; font-size: 14.5px; outline: none; transition: box-shadow 0.18s; }
.search-input input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-input .si-ico { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: var(--muted-fg); font-size: 15px; pointer-events: none; }
.cat-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.cat-filters button { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--fg-soft); font-size: 12.5px; font-weight: 800; transition: all 0.16s; }
.cat-filters button:hover { border-color: rgba(13, 148, 136, 0.45); }
.cat-filters button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3); }
.glossary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.term-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px; transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s; display: flex; flex-direction: column; }
.term-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(13, 148, 136, 0.4); }
.term-card .tc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.term-card h3 { font-size: 15px; font-weight: 900; }
.term-card .tc-en { direction: ltr; text-align: left; font-family: var(--font-mono); font-size: 11px; color: var(--muted-fg); margin-bottom: 8px; }
.term-card .tc-def { font-size: 13px; line-height: 2; color: var(--fg-soft); }
.empty-panel { border: 2px dashed var(--border); background: var(--card); border-radius: 22px; padding: 44px 20px; text-align: center; }
.empty-panel .ep-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--muted); color: var(--muted-fg); display: inline-flex; align-items: center; justify-content: center; font-size: 23px; margin-bottom: 12px; }
.empty-panel h3 { font-weight: 900; margin-bottom: 4px; }
.empty-panel p { font-size: 13px; color: var(--muted-fg); }

/* ---------- دیالوگ (مودال) ثبت‌نام ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn 0.2s ease both; }
.modal-overlay .mo-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); }
.modal { position: relative; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg); animation: popIn 0.25s ease both; }
.modal-head { position: relative; text-align: center; padding: 26px 26px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(to left, var(--primary-soft), transparent); border-radius: 24px 24px 0 0; }
.modal-head .mh-ico { width: 54px; height: 54px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 10px; }
.modal-head h3 { font-size: 19px; font-weight: 900; margin-bottom: 4px; }
.modal-head p { font-size: 12.5px; color: var(--muted-fg); line-height: 1.9; }
.modal-close { position: absolute; top: 14px; left: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--muted-fg); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.modal-close:hover { background: var(--muted); }
.modal-body { padding: 22px 26px 26px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--muted); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tabs button { height: 40px; border: 0; background: none; border-radius: 9px; font-size: 13px; font-weight: 900; color: var(--muted-fg); transition: all 0.18s; }
.tabs button.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm); }
.form-error { border: 1px solid rgba(220, 38, 38, 0.35); background: var(--danger-soft); color: var(--danger); border-radius: 12px; padding: 11px 15px; font-size: 13px; font-weight: 700; margin-bottom: 14px; animation: fadeUp 0.25s ease both; }
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label { display: block; font-size: 11.5px; font-weight: 800; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted-fg); }
.field input, .field select {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--input);
  background: var(--bg); padding: 0 14px; font-size: 13.5px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { width: 100%; border-radius: 12px; border: 1px solid var(--input); background: var(--bg); padding: 10px 14px; font-size: 13.5px; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.field input[dir="ltr"] { text-align: left; direction: ltr; }
.form-note { font-size: 11px; color: var(--muted-fg); text-align: center; line-height: 1.9; margin-top: 10px; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- توست ---------- */
.toast-wrap { position: fixed; bottom: 18px; right: 50%; transform: translateX(50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1c2b2a; color: #f1f7f4; border-radius: 13px; padding: 11px 20px;
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px; animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  max-width: min(480px, 90vw); pointer-events: auto;
}
html.dark .toast { background: #1e3230; }
.toast.success::before { content: "✅"; }
.toast.error::before { content: "⛔"; }
.toast.out { animation: toastOut 0.3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.96); } }

/* ---------- فوتر ---------- */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--card) 60%, transparent); padding-bottom: 68px; }
.site-footer .f-in { padding: 22px 32px 8px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 768px) { .site-footer .f-in { flex-direction: row; align-items: center; justify-content: space-between; } }
.site-footer .f-brand { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted-fg); }
.site-footer .f-brand .logo-badge { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--emerald-strong)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; flex-shrink: 0; }
.site-footer .f-brand b { color: var(--fg); font-size: 13px; display: block; }
.site-footer .f-links { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.site-footer .f-links button { border: 0; background: none; border-radius: 9px; padding: 6px 11px; font-size: 12px; font-weight: 800; color: var(--muted-fg); transition: background 0.15s, color 0.15s; }
.site-footer .f-links button:hover { background: var(--muted); color: var(--fg); }
.site-footer .f-admin { border: 1px solid var(--border); background: none; border-radius: 9px; padding: 6px 12px; font-size: 12px; font-weight: 800; color: var(--muted-fg); transition: all 0.15s; }
.site-footer .f-admin:hover { background: var(--muted); color: var(--fg); }
.site-footer .f-note { text-align: center; font-size: 11px; color: color-mix(in srgb, var(--muted-fg) 80%, transparent); padding: 0 20px 14px; }

/* ---------- انیمیشن‌ها ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.94); } 100% { opacity: 1; transform: scale(1); } }
.anim-fade-up { animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-pop-in { animation: popIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
.d1 { animation-delay: 0.05s; } .d2 { animation-delay: 0.1s; } .d3 { animation-delay: 0.16s; } .d4 { animation-delay: 0.22s; }

/* ---------- حالت چاپ (گواهی/گزارش) ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #ffffff !important; color: #1f2937 !important; }
  .sidebar, .topbar, .announce, .site-footer, .drawer-overlay, .toast-wrap,
  .report-actions, .print-hide, .audio-bar, .notepad, .item-nav { display: none !important; }
  .main-col { margin-right: 0 !important; }
  .main-area { padding: 0 !important; max-width: none !important; }
  .certificate-sheet { border-width: 6px !important; box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1180px) {
  .chapters-grid { grid-template-columns: repeat(2, 1fr); }
  .glossary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .main-col { margin-right: 0; }
  .sidebar { transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1); box-shadow: var(--shadow-lg); width: 300px; max-width: 85vw; }
  .sidebar.open { transform: translateX(0); }
  .topbar-in, .announce, .main-area, .site-footer .f-in { padding-right: 16px; padding-left: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .boot-side { display: none; }
  .boot-row { grid-template-columns: repeat(2, 1fr); }
  .playground .pg-body { grid-template-columns: 1fr; }
  .playground .pg-preview { border-right: 0; border-top: 1px solid var(--border); min-height: 320px; }
}
@media (max-width: 640px) {
  .main-area { padding: 18px 14px 90px; }
  .hero { padding: 22px 18px; }
  .chapters-grid, .glossary-grid { grid-template-columns: 1fr; }
  .boot-grid { grid-template-columns: 1fr; }
  .item-nav .nav-btn { max-width: 100%; flex: 1 1 100%; }
  .cert-foot { flex-direction: column; gap: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .topbar-title .t2 { display: none; }
  .btn { height: 40px; }
  .btn-lg { height: 46px; }
  .score-panel { padding: 20px 16px; }
  .hero .hello { display: inline; }
}

/* کدهای دوجهته داخل متن فارسی */
bdo { unicode-bidi: bidi-override; }
.muted { color: var(--muted-fg); }
.small { font-size: 12px; }
.text-center { text-align: center; }
