/* =========================================================================
   آور (AVAR) — سیستم طراحی نسخه‌ی اپلیکیشن (Material You / اندروید)
   اصول:
   ۱) هیچ پس‌زمینه‌ی تصویری، بوم (canvas) یا backdrop-filter وجود ندارد؛ فقط سطوح تخت و رنگی.
   ۲) فقط transform و opacity انیمیشن می‌شوند (کارت گرافیک به‌جای پردازنده).
   ۳) نوار بالا + نوار ناوبری پایین + دکمه‌ی شناور + برگه‌های پایین + اسنک‌بار، مثل یک برنامه‌ی واقعی.
   ۴) فونت وزیرمتن روی خود سرور؛ هیچ درخواست بیرونی وجود ندارد.
   ========================================================================= */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;

  --fs-xs: .75rem;
  --fs-sm: .8125rem;
  --fs-md: .9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.625rem;
  --fs-3xl: 2.125rem;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 28px;

  --appbar-h: 56px;
  --topbar-h: var(--appbar-h);
  --dock-h: 68px;
  --rail-w: 244px;
  --ease: cubic-bezier(.2, 0, 0, 1);
}

/* ---------- تم: فیروزه‌ای (پیش‌فرض) ---------- */
:root, [data-theme="firoozei"] {
  color-scheme: light;
  --bg: #F3F7F8;
  --surface: #FFFFFF;
  --surface-2: #E8F0F3;
  --surface-3: #DAE7EC;
  --dock: #E9F1F4;
  --line: #D8E3E8;
  --outline: #7B939F;
  --ink: #0D1B2A;
  --muted: #506474;
  --primary: #087A99;
  --primary-strong: #065A73;
  --on-primary: #FFFFFF;
  --primary-soft: #C6EBF5;
  --on-soft: #00323F;
  --hl: #FFD23F;
  --on-hl: #241B00;
  --danger: #B93434;
  --danger-soft: #FBE4E4;
  --ok: #1B7F4F;
  --ok-soft: #DDF3E7;
  --warn: #8A5F00;
  --warn-soft: #FFF0C2;
  --shadow: 0 8px 24px -8px rgba(13, 27, 42, .3);
  --scrim: rgba(6, 14, 24, .5);
}

/* ---------- تم: بنفش ---------- */
[data-theme="banafsh"] {
  color-scheme: light;
  --bg: #F6F3FC;
  --surface: #FFFFFF;
  --surface-2: #ECE7F7;
  --surface-3: #E0D8F1;
  --dock: #EEE9F8;
  --line: #DDD5EE;
  --outline: #8D82AD;
  --ink: #1D1635;
  --muted: #5F5779;
  --primary: #6740D4;
  --primary-strong: #4B29A8;
  --on-primary: #FFFFFF;
  --primary-soft: #E4DBFB;
  --on-soft: #21005D;
  --shadow: 0 8px 24px -8px rgba(30, 22, 54, .34);
}

/* ---------- تم: تیره ---------- */
[data-theme="tire"] {
  color-scheme: dark;
  --bg: #050A15;
  --surface: #0C1527;
  --surface-2: #111C36;
  --surface-3: #1B2A4D;
  --dock: #0A1224;
  --line: #1C2C4F;
  --outline: #5F76A6;
  --ink: #EAF1FC;
  --muted: #94A8C9;
  --primary: #38BDF8;
  --primary-strong: #7DD3FC;
  --on-primary: #03202E;
  --primary-soft: #0F3552;
  --on-soft: #CFF1FF;
  --hl: #FFD23F;
  --on-hl: #241B00;
  --danger: #F28B8B;
  --danger-soft: #3B2029;
  --ok: #34D399;
  --ok-soft: #123A2E;
  --warn: #F2C14E;
  --warn-soft: #3A2F10;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, .8);
  --scrim: rgba(0, 0, 0, .66);
}

/* نام‌های قدیمی که پنل مدیریت و بقیه‌ی فایل‌ها استفاده می‌کنند */
:root, [data-theme] {
  --sunken: var(--surface-2);
  --control-line: var(--outline);
  --mark-bg: var(--hl);
}

/* ---------- پایه ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--appbar-h) + 12px);
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-wrap: break-word;
}
body.dialog-open { overflow: hidden; }

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.45; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--primary-strong); text-decoration: none; }
[data-theme="tire"] a { color: var(--primary); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
img { -webkit-user-drag: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, summary, label, select { touch-action: manipulation; }
button { cursor: pointer; -webkit-touch-callout: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
[hidden] { display: none !important; }
main:focus { outline: none; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
::selection { background: var(--hl); color: var(--on-hl); }

.ico { width: 22px; height: 22px; flex: none; }
.num, .time { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--r-sm); z-index: 600; }
.skip-link:focus { top: 8px; }

/* رفتار بومی: متن عناصر کنترلی انتخاب نمی‌شود */
.appbar, .topbar, .dock, .btn, .chip, .fab, .icon-btn, .daytab, .cal-cell, .slot-check, .row-link, .toast, .theme-opt, .filter-tabs a, .admin-nav-item {
  -webkit-user-select: none; user-select: none;
}

/* لایه‌ی فشردن (state layer): روی هر عنصر لمسی فقط opacity تغییر می‌کند */
.btn, .icon-btn, .chip, .row-link, .fab, .slot-main, .cal-cell, .theme-opt, .daytab, .filter-tabs a, .admin-nav-item { position: relative; overflow: hidden; }
.btn::after, .icon-btn::after, .chip::after, .row-link::after, .fab::after, .slot-main::after, .cal-cell::after, .theme-opt::after, .daytab::after, .filter-tabs a::after, .admin-nav-item::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; pointer-events: none;
  transition: opacity .12s linear;
}
.btn:active::after, .icon-btn:active::after, .chip:active::after, .row-link:active::after, .fab:active::after, .slot-main:active::after,
.cal-cell:active::after, .theme-opt:active::after, .daytab:active::after, .filter-tabs a:active::after, .admin-nav-item:active::after { opacity: .12; }
@media (hover: hover) {
  .btn:hover::after, .icon-btn:hover::after, .chip:hover::after, .row-link:hover::after, .fab:hover::after, .slot-main:hover::after,
  .cal-cell:hover::after, .theme-opt:hover::after, .daytab:hover::after, .filter-tabs a:hover::after, .admin-nav-item:hover::after { opacity: .06; }
  .btn:active::after, .icon-btn:active::after, .chip:active::after, .row-link:active::after, .fab:active::after, .slot-main:active::after,
  .cal-cell:active::after, .theme-opt:active::after, .daytab:active::after, .filter-tabs a:active::after, .admin-nav-item:active::after { opacity: .14; }
}

/* نشانگر ماژیکی (فقط برای تاریخ امروز و تیتر معرفی) */
.mark {
  background: linear-gradient(to bottom, transparent 55%, color-mix(in srgb, var(--hl) 70%, transparent) 55% 90%, transparent 90%);
  color: inherit; padding-inline: .28em; margin-inline: -.28em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ---------- نوار بالا (App Bar) ---------- */
.appbar, .topbar {
  position: sticky; top: 0; z-index: 40;
  min-height: calc(var(--appbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 4px;
  background: var(--bg);
  transition: box-shadow .18s linear;
}
.appbar.is-scrolled, .topbar.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 6px 14px -10px rgba(0, 0, 0, .35); }
.appbar-title {
  flex: 1; min-width: 0; margin: 0; padding-inline: 8px;
  font-size: var(--fs-xl); font-weight: 800; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar-mark { width: 32px; height: 32px; border-radius: 10px; margin-inline-start: 8px; flex: none; }
.appbar-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: var(--fs-lg); padding-inline: 8px; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 10px; }
.topbar { justify-content: space-between; }
.topbar-links { display: flex; gap: 8px; }

.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--ink); padding: 0;
}
.icon-btn:hover { text-decoration: none; }
.icon-btn.has-dot::before {
  content: ''; position: absolute; top: 9px; inset-inline-end: 10px; z-index: 1;
  width: 10px; height: 10px; border-radius: 50%; background: var(--hl); border: 2px solid var(--bg);
}
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- قالب صفحه ---------- */
.page { width: 100%; max-width: 44rem; margin-inline: auto; padding: 8px 16px 32px; }
.page--wide { max-width: 68rem; }
.page--narrow { max-width: 30rem; }
body.has-dock .page { padding-bottom: calc(var(--dock-h) + 96px + env(safe-area-inset-bottom)); }

.flashes { max-width: 44rem; margin: 4px auto 0; padding-inline: 16px; width: 100%; }
.flash { border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 10px; font-size: var(--fs-sm); font-weight: 600; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-info { background: var(--primary-soft); color: var(--on-soft); }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; font-size: var(--fs-xl); }
.pagehead .sub { color: var(--muted); font-size: var(--fs-sm); margin: 2px 0 0; }
.subline { color: var(--muted); font-size: var(--fs-sm); margin: 0 4px 14px; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 4px 10px; }
.section-title h2 { margin: 0; font-size: var(--fs-md); color: var(--muted); font-weight: 800; }
.section-title:first-child { margin-top: 4px; }

/* انیمیشن ورود صفحه (فقط وقتی با ناوبری فوری عوض می‌شود) */
#view.view-enter { animation: view-in .2s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* نوار پیشرفت بارگذاری صفحه */
.navprog { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 700; pointer-events: none; opacity: 0; transition: opacity .2s linear; }
.navprog i { display: block; height: 100%; background: var(--primary); transform-origin: right center; transform: scaleX(var(--p, 0)); transition: transform .35s var(--ease); }
.navprog.on { opacity: 1; }

/* ---------- نوار ناوبری پایین ---------- */
.dock {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--dock-h) + env(safe-area-inset-bottom));
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  background: var(--dock);
  box-shadow: 0 -1px 0 var(--line);
}
.dock-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.3; min-width: 0;
}
.dock-item:hover { color: var(--ink); text-decoration: none; }
.dock-ico { position: relative; width: 64px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.dock-ico::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--primary-soft);
  opacity: 0; transform: scaleX(.35); transition: transform .24s var(--ease), opacity .16s linear;
}
.dock-ico::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity .12s linear; }
.dock-item:active .dock-ico::after { opacity: .12; }
.dock-ico .ico { position: relative; z-index: 1; width: 24px; height: 24px; }
.dock-item.is-active { color: var(--ink); font-weight: 800; }
.dock-item.is-active .dock-ico::before { opacity: 1; transform: none; }
.dock-item.is-active .ico { color: var(--on-soft); fill: color-mix(in srgb, currentColor 22%, transparent); }
.dock-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- دسکتاپ: ناوبری کناری ---------- */
@media (min-width: 960px) {
  :root { --dock-h: 0px; }
  body.has-dock {
    display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start;
  }
  body.has-dock > .appbar { grid-column: 1 / -1; grid-row: 1; }
  body.has-dock > #view { grid-column: 2; grid-row: 2; min-width: 0; }
  body.has-dock > .dock {
    grid-column: 1; grid-row: 2;
    position: sticky; top: var(--appbar-h); inset-inline: auto; z-index: 30;
    height: calc(100dvh - var(--appbar-h)); padding: 12px 14px;
    display: flex; flex-direction: column; align-content: start; gap: 4px;
    background: var(--bg); box-shadow: none;
  }
  .dock-item {
    flex-direction: row; justify-content: flex-start; gap: 12px; flex: none;
    height: 52px; padding-inline: 16px; border-radius: 26px; font-size: var(--fs-md); position: relative;
  }
  .dock-item:hover { background: var(--surface-2); }
  .dock-ico { width: 24px; height: 24px; border-radius: 0; }
  .dock-ico::before, .dock-ico::after { display: none; }
  .dock-item.is-active { background: var(--primary-soft); }
  body.has-dock .page { padding-bottom: 96px; }
  .toasts { bottom: 24px !important; }
}

/* ---------- وقتی وارد دوره یا درس می‌شوید، نوار پایین محو می‌شود (بدون تغییر چیدمان) ---------- */
.dock { transition: opacity .28s var(--ease), transform .28s var(--ease), visibility 0s linear 0s; }
body.dock-away .dock {
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(20px);
  transition: opacity .28s var(--ease), transform .28s var(--ease), visibility 0s linear .28s;
}
@media (min-width: 960px) {
  /* ناوبری کناری هم محو می‌شود؛ محتوا جای آن را می‌گیرد */
  body.dock-away.has-dock > #view { grid-column: 1 / -1; }
  body.dock-away .dock { transform: translateX(-16px); }
}
@media (prefers-reduced-motion: reduce) {
  .dock, body.dock-away .dock { transition-duration: 0s !important; }
}

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px;
  border: 1.5px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: var(--fs-md); line-height: 1.2; white-space: nowrap;
  text-decoration: none !important;
  transition: transform .12s var(--ease), background-color .15s linear;
}
.btn .ico { width: 20px; height: 20px; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-busy="true"], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { color: var(--on-primary); }
.btn-secondary { background: var(--primary-soft); color: var(--on-soft); }
.btn-secondary:hover { color: var(--on-soft); }
.btn-ghost { background: transparent; color: var(--primary-strong); padding-inline: 14px; }
[data-theme="tire"] .btn-ghost { color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
[data-theme="tire"] .btn-danger { color: #2b0a0a; }
.btn-danger-quiet { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: var(--fs-sm); }
.btn-block { width: 100%; min-height: 52px; font-size: var(--fs-lg); }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* دکمه‌ی شناور */
.fab {
  position: fixed; z-index: 45;
  inset-inline-end: max(16px, env(safe-area-inset-left));
  bottom: calc(var(--dock-h) + 16px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 18px; border: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, .38), 0 2px 4px rgba(0, 0, 0, .15);
  transition: transform .15s var(--ease);
  animation: fab-in .28s var(--ease) .06s both;
}
.fab .ico { width: 26px; height: 26px; stroke-width: 2.2; }
.fab:active { transform: scale(.93); }
@media (min-width: 960px) { .fab { bottom: 28px; inset-inline-end: 32px; } }
@keyframes fab-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* ---------- فرم‌ها ---------- */
.field { margin-bottom: 16px; min-width: 0; }
.field > label, .label { display: block; margin: 0 4px 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.field .opt { font-weight: 500; opacity: .8; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"],
.field input[type="time"], .field input[type="datetime-local"], .field input[type="search"], .field input[type="tel"],
.field select, .field textarea, .input {
  width: 100%; min-height: 52px; padding: 10px 16px; font-size: 16px;
  background: var(--surface-2); color: var(--ink);
  border: 2px solid transparent; border-radius: var(--r-md);
  transition: border-color .15s linear, background-color .15s linear;
  -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 100px; resize: vertical; line-height: 1.8; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .7; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.field input:disabled { opacity: .6; cursor: not-allowed; }
.field input[type="time"], .field input[type="datetime-local"], .field input[type="number"], .ltr { direction: ltr; text-align: right; }
.field .hint { margin: 6px 4px 0; color: var(--muted); font-size: var(--fs-xs); }
.field .error-msg { margin: 6px 4px 0; color: var(--danger); font-size: var(--fs-xs); font-weight: 700; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.select { position: relative; }
.select select { padding-inline-end: 44px; }
.select::after {
  content: ''; position: absolute; inset-inline-end: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 20px; height: 20px; margin: 0; flex: none; }
.check { display: flex; align-items: center; gap: 12px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
input[type="file"] { width: 100%; padding: 14px; border: 2px dashed var(--outline); border-radius: var(--r-md); background: var(--surface-2); font-size: 14px; }

.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { position: relative; display: inline-block; }
.swatch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.swatch span { display: block; width: 38px; height: 38px; border-radius: 50%; background: var(--c); transition: transform .15s var(--ease), box-shadow .15s linear; }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--c); transform: scale(.92); }
.swatch input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 4px; }

/* ---------- سطوح ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.panel + .panel { margin-top: 12px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.row-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 8px 16px; color: var(--ink); font-weight: 600; text-decoration: none !important;
  background: none; border: 0; border-bottom: 1px solid var(--line); width: 100%; text-align: start; border-radius: 0;
}
.row-link:last-child { border-bottom: 0; }
.row-link > .ico:last-child { color: var(--muted); width: 20px; height: 20px; }
.row-link .lead { display: inline-flex; align-items: center; gap: 14px; }
.row-link .lead .ico {
  box-sizing: content-box; padding: 9px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-soft); color: var(--on-soft);
}
.row-link.danger { color: var(--danger); }
.row-link.danger .lead .ico { background: var(--danger-soft); color: var(--danger); }
.row-link small { display: block; color: var(--muted); font-weight: 500; font-size: var(--fs-xs); line-height: 1.5; }
[data-install], [data-install-ios] { display: none; }
.can-install [data-install] { display: flex; }
.is-ios:not(.is-standalone) [data-install-ios] { display: flex; }
.is-standalone [data-install], .is-standalone [data-install-ios] { display: none !important; }

.empty {
  text-align: center; padding: 36px 20px; color: var(--muted);
  border-radius: var(--r-lg); background: var(--surface); border: 1px dashed var(--outline);
}
.empty strong { display: block; color: var(--ink); font-size: var(--fs-md); margin-bottom: 4px; }
.empty p { margin-inline: auto; }
.empty .btn { margin-top: 8px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; line-height: 1.8; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-ok, .badge-approved, .badge-active { background: var(--ok-soft); color: var(--ok); }
.badge-warn, .badge-pending, .badge-suspended { background: var(--warn-soft); color: var(--warn); }
.badge-danger, .badge-rejected, .badge-banned { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--on-soft); }

.meter { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 100%; background: var(--c, var(--primary)); border-radius: 8px; transform-origin: right center; transform: scaleX(calc(var(--pn, 0) / 100)); transition: transform .35s var(--ease); }

/* ---------- بازه‌ی مطالعه (مشترک) ---------- */
.slot {
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; gap: 10px 10px; align-items: stretch;
  padding: 8px; border-radius: var(--r-lg); background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px -12px color-mix(in srgb, var(--c, var(--primary)) 60%, transparent);
  transition: box-shadow .18s var(--ease);
}
[data-theme="tire"] .slot { box-shadow: 0 1px 0 rgba(255,255,255,.02), 0 8px 20px -12px rgba(0,0,0,.55); }
.slot + .slot { margin-top: 10px; }
.slot-time { display: flex; flex-direction: column; justify-content: center; text-align: end; line-height: 1.35; font-size: var(--fs-sm); font-weight: 700; }
.slot-time span:last-child { color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.slot-time.is-empty { color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.slot-main {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 58px;
  padding: 10px 15px; text-align: start;
  background: var(--surface-2);
  border: 0; border-inline-start: 5px solid var(--c, var(--primary));
  border-radius: var(--r-md);
  color: var(--ink);
}
@supports (background: color-mix(in srgb, red 10%, white)) {
  .slot-main { background: color-mix(in srgb, var(--c, var(--primary)) 15%, var(--surface)); }
}
button.slot-main { width: 100%; font-weight: inherit; }
.slot-title { font-weight: 700; font-size: var(--fs-md); overflow-wrap: anywhere; line-height: 1.5; }
.slot-note { color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; line-height: 1.5; }
.slot-check {
  width: 44px; height: 44px; align-self: center; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 2px solid var(--outline); color: transparent;
  transition: background-color .15s linear, border-color .15s linear, transform .18s var(--ease);
}
.slot-check .ico { width: 20px; height: 20px; stroke-width: 2.8; transform: scale(.4); transition: transform .2s var(--ease); }
.slot-check:active { transform: scale(.9); }
.slot.is-done .slot-check { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 3px 10px -3px color-mix(in srgb, var(--ok) 65%, transparent); }
.slot.is-done .slot-check .ico { transform: none; }
[data-theme="tire"] .slot.is-done .slot-check { color: #06281a; }
.slot.is-done .slot-title, .slot.is-done .slot-note { opacity: .6; }
.slot.is-done .slot-title { text-decoration: line-through; text-decoration-thickness: 2px; }
.slot.is-readonly .slot-main { opacity: .85; }

/* ---------- کرنومتر بازه (فقط برنامه‌ی امروز) ---------- */
.slot-timer { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; padding: 10px 4px 2px; border-top: 1px dashed var(--line); }
.slot-timer.is-complete { padding: 2px 4px 0; border-top: 0; }
.timer-row { display: flex; align-items: center; gap: 10px; }
.timer-btn {
  width: 40px; height: 40px; flex: none; padding: 0; border-radius: 50%; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c, var(--primary)); color: var(--on-primary);
  transition: background-color .15s linear, transform .15s var(--ease);
}
.timer-btn:active { transform: scale(.92); }
.timer-btn .ico { width: 18px; height: 18px; }
.timer-ico-stop { display: none; }
.slot-timer.is-running .timer-ico-play { display: none; }
.slot-timer.is-running .timer-ico-stop { display: inline-flex; }
.slot-timer.is-running .timer-btn { background: var(--danger); }
.timer-clock { font-weight: 800; font-size: var(--fs-lg); min-width: 4.6ch; }
.timer-remaining { font-size: var(--fs-xs); flex: 1; text-align: end; }
.slot-timer .meter { height: 6px; }
.timer-confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; }
.timer-confirm span { color: var(--ink); font-size: var(--fs-sm); font-weight: 600; flex: 1 1 100%; }
.timer-confirm .btn-sm { flex: 1; }

/* ---------- ورود / ثبت‌نام ---------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); }
.auth-box { width: 100%; max-width: 24rem; }
.auth-box .logo { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 18px; box-shadow: var(--shadow); }
.auth-box h1 { text-align: center; font-size: var(--fs-2xl); margin-bottom: 4px; }
.auth-box .sub { text-align: center; color: var(--muted); font-size: var(--fs-sm); margin: 0 auto 24px; }
.auth-box .panel { padding: 0; border: 0; background: transparent; }
.auth-links { text-align: center; margin: 20px auto 0; font-size: var(--fs-sm); color: var(--muted); }
.auth-links a { font-weight: 800; }
@media (min-width: 640px) {
  .auth-box .panel { padding: 24px; border: 1px solid var(--line); background: var(--surface); }
}

/* ---------- صفحه‌ی خوش‌آمد ---------- */
.landing { max-width: 68rem; margin-inline: auto; padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.landing-top .brand { padding: 0; }
.hero { display: grid; gap: 28px; align-items: center; padding: 12px 0 28px; flex: 1; }
.hero h1 { font-size: clamp(1.9rem, 7vw, 3rem); line-height: 1.35; font-weight: 900; letter-spacing: -.02em; margin-bottom: 12px; }
.hero .lead { color: var(--muted); font-size: var(--fs-lg); max-width: 34rem; margin-bottom: 20px; line-height: 1.9; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 18px 16px 20px; box-shadow: var(--shadow); }
.demo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.demo-head strong { font-size: var(--fs-lg); font-weight: 800; }
.demo-head span { color: var(--muted); font-size: var(--fs-sm); }
.demo .meter { margin-bottom: 14px; }
.facts { display: grid; gap: 10px; }
.fact { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.fact .ico { box-sizing: content-box; padding: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--on-soft); }
.fact h3 { font-size: var(--fs-md); margin-bottom: 2px; }
.fact p { color: var(--muted); margin: 0; font-size: var(--fs-sm); }
.landing-foot { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-top: 24px; color: var(--muted); font-size: var(--fs-sm); }
.landing-foot nav { display: flex; gap: 18px; }
.landing-cta { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; margin-inline: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -1px 0 var(--line); }
.landing-cta .btn { flex: 1; min-height: 52px; font-size: var(--fs-lg); }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr .95fr; gap: 56px; }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .landing-cta { display: none; }
}
@media (max-width: 899.98px) { .hero .cta { display: none; } }

/* ---------- داشبورد ---------- */
.today-card {
  display: flex; align-items: center; gap: 18px; padding: 20px;
  background: var(--primary-soft); color: var(--on-soft); border-radius: var(--r-xl); margin-bottom: 20px;
}
.today-card .dateline { margin: 0 0 2px; font-size: var(--fs-sm); font-weight: 700; opacity: .8; }
.today-card h1 { margin: 0 0 4px; font-size: var(--fs-2xl); font-weight: 900; color: inherit; }
.today-card .count { margin: 0; font-size: var(--fs-sm); font-weight: 700; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: 3.6; }
.ring-bg { stroke: color-mix(in srgb, currentColor 20%, transparent); }
.ring-fg { stroke: var(--primary); stroke-linecap: round; stroke-dasharray: calc(var(--pn, 0) * 1px) 100px; transition: stroke-dasharray .5s var(--ease); }
[data-theme="tire"] .ring-fg { stroke: var(--primary-strong); }
.ring-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: var(--fs-lg); }
.dash-grid { display: grid; gap: 20px; }
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 10px; }
.today-head h2 { margin: 0; font-size: var(--fs-lg); }
.today-head .count { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.side-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.side-list > div { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.side-list dt { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.side-list dd { margin: 2px 0 0; font-weight: 900; font-size: var(--fs-xl); line-height: 1.4; }
.side-list dd small { font-size: var(--fs-xs); font-weight: 600; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-lg); background: var(--warn-soft); color: var(--warn); font-size: var(--fs-sm); font-weight: 600; margin-bottom: 14px; }
.notice .ico { margin-top: 2px; width: 20px; height: 20px; }
.notice.info { background: var(--primary-soft); color: var(--on-soft); }
.notice a { font-weight: 800; color: inherit; text-decoration: underline; }
@media (min-width: 960px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 21rem; gap: 32px; align-items: start; }
  .side-list { grid-template-columns: 1fr; }
}

/* ---------- برنامه‌ی هفتگی ---------- */
.subject-bar { display: flex; gap: 8px; align-items: center; margin: 0 -16px 14px; padding: 2px 16px 4px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.subject-bar::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; flex: none;
  background: var(--surface); border: 1px solid var(--outline); border-radius: 12px;
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink);
}
.chip::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--primary)); flex: none; }
.chip-add { border-style: dashed; color: var(--primary-strong); }
[data-theme="tire"] .chip-add { color: var(--primary); }
.chip-add::before { display: none; }
.chip-add .ico { width: 18px; height: 18px; }

.daytabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 14px; padding: 6px 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.daytab {
  min-width: 0; padding: 6px 0 4px; text-align: center; background: transparent; border: 0; border-radius: var(--r-md);
  color: var(--muted); line-height: 1.4; font-weight: 700;
}
.daytab .dn { display: block; font-size: var(--fs-xs); margin-bottom: 4px; }
.daytab small { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-inline: auto; border-radius: 50%; font-size: var(--fs-md); font-weight: 800; color: var(--ink); transition: background-color .18s linear, color .18s linear; }
.daytab.is-today small { box-shadow: inset 0 0 0 2px var(--primary); }
.daytab[aria-selected="true"] .dn { color: var(--primary-strong); }
[data-theme="tire"] .daytab[aria-selected="true"] .dn { color: var(--primary); }
.daytab[aria-selected="true"] small { background: var(--primary); color: var(--on-primary); box-shadow: none; }

.week { display: grid; gap: 14px; }
.dayplan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
.dayplan-head h3 { margin: 0; font-size: var(--fs-lg); }
.dayplan .empty-day { color: var(--muted); font-size: var(--fs-sm); padding: 26px 16px; text-align: center; background: var(--surface); border: 1px dashed var(--outline); border-radius: var(--r-lg); margin: 0; }
.dayplan-head .icon-btn { display: none; }
@media (max-width: 959.98px) {
  .dayplan:not(.is-active) { display: none; }
  .dayplan.is-active { animation: view-in .18s var(--ease) both; }
}
@media (min-width: 960px) {
  .daytabs { display: none; }
  .week { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 16px; align-items: start; }
  .dayplan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
  .dayplan.is-today { border-color: var(--primary); box-shadow: 0 0 0 1.5px var(--primary); }
  .dayplan .slot { grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 8px; background: var(--surface-2); box-shadow: none; padding: 6px; }
  .dayplan-head .icon-btn { display: inline-flex; }
}

/* ---------- تقویم ---------- */
.cal-layout { display: grid; gap: 18px; }
.cal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 12px 10px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 6px 8px; }
.cal-head h2 { margin: 0; font-size: var(--fs-xl); }
.cal-tools { display: flex; align-items: center; gap: 2px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; padding: 6px 0; }
.cal-wd.is-friday { color: var(--danger); }
.cal-cell {
  aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: transparent; border: 0; border-radius: 50%; font-weight: 700; font-size: var(--fs-md); color: var(--ink); padding: 0; min-width: 0;
}
.cal-cell.is-empty { pointer-events: none; }
.cal-cell.is-friday .cal-num { color: var(--danger); }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-cell.is-selected { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.cal-cell.is-selected .cal-num { color: var(--on-primary); }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--primary)); }
.cal-cell.is-selected .cal-dots i { box-shadow: 0 0 0 1.5px var(--on-primary); }
.cal-cell.is-all-done .cal-dots i { opacity: .4; }
.cal-cell:disabled { opacity: .3; cursor: not-allowed; }
.day-panel { min-width: 0; }
.day-panel h2 { font-size: var(--fs-xl); margin-bottom: 0; }
.day-panel .weekday { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; margin: 0 0 12px; }
.day-panel h3 { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; margin: 20px 4px 10px; }
.day-panel .panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-inline: 4px; }
@media (min-width: 960px) {
  .cal-layout { grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); gap: 40px; align-items: start; }
  .day-panel { position: sticky; top: calc(var(--appbar-h) + 16px); }
}

/* ---------- پیشرفت ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.kpi:first-child { background: var(--primary-soft); border-color: transparent; color: var(--on-soft); }
.kpi .v { font-size: var(--fs-3xl); font-weight: 900; line-height: 1.2; letter-spacing: -.02em; }
.kpi .v small { font-size: var(--fs-md); font-weight: 700; opacity: .7; margin-inline-start: 3px; }
.kpi .l { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; line-height: 1.6; }
.kpi:first-child .l { color: inherit; opacity: .85; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.weekbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; padding-top: 8px; }
.wbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; text-align: center; font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }
.wbar .col { width: 100%; max-width: 40px; flex: 1; min-height: 0; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.wbar .col i { display: block; width: 100%; height: 100%; background: var(--primary); border-radius: 12px; transform-origin: center bottom; transform: scaleY(calc(var(--pn, 0) / 100)); transition: transform .5s var(--ease); }
.wbar.is-today .lbl { background: var(--primary); color: var(--on-primary); padding: 0 8px; border-radius: 999px; }
.subject-rows > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.subject-rows > div:last-child { border-bottom: 0; }
.subject-rows .top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: var(--fs-sm); font-weight: 700; }
.subject-rows .top span:last-child { color: var(--muted); font-weight: 600; }

/* ---------- بیشتر / تنظیمات ---------- */
.me { display: flex; align-items: center; gap: 14px; padding: 18px; margin-bottom: 14px; background: var(--primary-soft); color: var(--on-soft); border-radius: var(--r-xl); }
.me .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: var(--fs-xl); flex: none; }
.me strong { display: block; font-size: var(--fs-lg); }
.me span { opacity: .8; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.plan-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 14px; }
.plan-strip .name { font-weight: 800; font-size: var(--fs-lg); }
.plan-strip .meta { color: var(--muted); font-size: var(--fs-sm); }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-opt { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); text-align: center; font-weight: 700; font-size: var(--fs-sm); color: var(--ink); }
.theme-opt[aria-pressed="true"] { border-color: var(--primary); }
.theme-swatch { display: flex; height: 46px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(128, 128, 128, .25); }
.theme-swatch i { flex: 1; background: var(--s); }
.theme-swatch i:first-child { flex: 2; }

/* ---------- پلن‌ها و پرداخت ---------- */
.plans { display: grid; gap: 12px; }
.plan { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-xl); }
.plan.is-featured { border-color: var(--primary); box-shadow: 0 0 0 1.5px var(--primary); }
.plan .name { font-weight: 800; font-size: var(--fs-lg); display: flex; align-items: center; gap: 8px; }
.plan .price { font-size: var(--fs-3xl); font-weight: 900; letter-spacing: -.02em; line-height: 1.3; }
.plan .price small { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; margin-inline-start: 4px; }
.plan .desc { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.plan ul { display: grid; gap: 6px; font-size: var(--fs-sm); margin: 6px 0 10px; }
.plan li { display: flex; gap: 8px; align-items: center; }
.plan li .ico { width: 18px; height: 18px; color: var(--ok); }
.plan .btn { margin-top: auto; }
@media (min-width: 720px) { .plans { grid-template-columns: repeat(3, 1fr); } }

.bank-card { position: relative; background: linear-gradient(135deg, var(--primary-strong), var(--primary)); color: var(--on-primary); border-radius: var(--r-xl); padding: 22px 22px 20px; margin-bottom: 16px; max-width: 26rem; overflow: hidden; box-shadow: var(--shadow); }
[data-theme="tire"] .bank-card { background: linear-gradient(135deg, #0E3B4C, #1B6B84); color: #E6EDF8; }
.bank-card .bank { font-weight: 800; font-size: var(--fs-md); display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 26px; }
.bank-card .chipmark { width: 40px; height: 30px; border-radius: 7px; background: var(--hl); }
.bank-card .card-number { direction: ltr; text-align: right; font-size: 1.3rem; letter-spacing: .09em; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 18px; word-spacing: .15em; -webkit-user-select: text; user-select: text; }
.bank-card .holder { font-size: var(--fs-sm); opacity: .9; }
.bank-card .copy { position: absolute; inset-inline-end: 16px; bottom: 14px; background: rgba(255, 255, 255, .2); color: inherit; }

.notif { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif > .ico { box-sizing: content-box; padding: 9px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--on-soft); }
.notif p { margin: 0; }
.notif .when { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }

.devices { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.device { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.device:last-child { border-bottom: 0; }
.device strong { margin-inline-end: 8px; }

/* ---------- انتخاب‌گر تاریخ شمسی ---------- */
.datepick { position: relative; }
.datepick input { padding-inline-end: 50px; cursor: pointer; }
.datepick .ico { position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.time-pair { display: flex; align-items: center; gap: 10px; direction: ltr; }
.time-pair .select { flex: 1; }
.time-pair > span { font-weight: 800; font-size: var(--fs-lg); color: var(--muted); }
.time-pair select { min-height: 52px; width: 100%; padding: 10px 16px; font-size: 16px; background: var(--surface-2); color: var(--ink); border: 2px solid transparent; border-radius: var(--r-md); -webkit-appearance: none; appearance: none; }
.time-pair select:focus { outline: none; border-color: var(--primary); background: var(--surface); }

/* ---------- برگه‌ی پایین (Bottom Sheet) ---------- */
dialog.sheet {
  border: 0; padding: 0; background: var(--surface); color: var(--ink);
  width: 100%; max-width: 32rem; max-height: 92dvh;
  margin: auto auto 0; border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow); overflow: hidden;
  overscroll-behavior: contain;
}
dialog.sheet::before { content: ''; display: block; flex: none; width: 36px; height: 4px; border-radius: 4px; background: var(--outline); opacity: .5; margin: 10px auto 0; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .26s var(--ease); }
dialog.sheet.is-closing { animation: sheet-out .18s ease-in forwards; }
dialog.sheet::backdrop { background: var(--scrim); animation: fade-in .2s linear; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 4px; padding-inline: 20px 8px; touch-action: none; }
.sheet-head h2 { margin: 0; font-size: var(--fs-xl); }
.sheet-body { padding: 8px 20px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.sheet-body .form-actions .btn-primary { flex: 1; }
.sheet-error { color: var(--danger); font-size: var(--fs-sm); font-weight: 700; margin: 0 0 12px; }
.sheet-error:empty { display: none; }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; border-radius: var(--r-xl); }
  dialog.sheet::before { display: none; }
  dialog.sheet[open] { animation: sheet-in-c .22s var(--ease); }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes sheet-in-c { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- اسنک‌بار ---------- */
.toasts {
  position: fixed; inset-inline: 0; z-index: 500;
  bottom: calc(var(--dock-h) + 12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding-inline: 12px;
}
.toast {
  pointer-events: auto; width: 100%; max-width: 30rem; min-height: 48px; display: flex; align-items: center;
  padding: 10px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--bg);
  font-size: var(--fs-sm); font-weight: 700; box-shadow: var(--shadow); animation: toast-in .22s var(--ease);
}
.toast.is-leaving { animation: toast-out .18s ease-in forwards; }
.toast-error { background: var(--danger); color: #fff; }
[data-theme="tire"] .toast-error { color: #2b0a0a; }
.toast-success { background: var(--ok); color: #fff; }
[data-theme="tire"] .toast-success { color: #06281a; }
body:not(.has-dock) .toasts { bottom: calc(24px + env(safe-area-inset-bottom)); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- صفحه‌بندی (مشترک با پنل) ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: var(--fs-sm); }
.pager .is-current { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .dock, .appbar, .topbar, .toasts, .fab, .navprog { display: none !important; }
  body { background: #fff; }
}

/* ---------- افزوده‌ها ---------- */
.cal-grid.is-entering { animation: view-in .16s var(--ease) both; }
.sheet-confirm .sheet-body { padding-top: 18px; }
.confirm-msg { margin: 0 0 18px; font-size: var(--fs-lg); font-weight: 700; line-height: 1.8; max-width: none; }
.sheet-confirm .form-actions { flex-direction: row-reverse; }
.sheet-confirm .form-actions .btn { flex: 1; }
.install-steps { margin: 0 0 8px; padding-inline-start: 22px; list-style: decimal; display: grid; gap: 10px; font-size: var(--fs-md); }
.install-steps li { padding-inline-start: 4px; }
.today-card .hello { margin: 0 0 4px; font-size: var(--fs-2xl); font-weight: 900; line-height: 1.4; max-width: none; }
.today-card .dateline { max-width: none; }

/* =========================================================================
   نسخه‌ی ۴ — پشتیبانی تیکتی، اعلان‌ها، نشانگر خوانده‌نشده
   همان اصول: سطح تخت، فقط transform و opacity انیمیشن می‌شوند، بدون blur و تصویر.
   ========================================================================= */

/* شمارنده و نشانگرهای مشترک */
.count-pill { min-width: 22px; height: 22px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--hl); color: var(--on-hl); font-size: var(--fs-xs); font-weight: 800; }
.row-end { display: inline-flex; align-items: center; gap: 8px; }
.row-end .ico { color: var(--muted); width: 20px; height: 20px; }
.dock-dot { position: absolute; z-index: 2; top: 2px; inset-inline-end: 14px; width: 11px; height: 11px; border-radius: 50%; background: var(--hl); border: 2.5px solid var(--dock); }
@media (min-width: 960px) { .dock-dot { top: -3px; inset-inline-end: -3px; border-color: var(--bg); } }

/* ---------- پشتیبانی: صفحه‌ی فهرست ---------- */
.sup-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  padding: 20px; margin-bottom: 4px; border-radius: var(--r-xl); background: var(--primary-soft); color: var(--on-soft);
}
.sup-hero::after { content: ''; position: absolute; top: -46px; inset-inline-start: -46px; width: 150px; height: 150px; border-radius: 50%; border: 24px solid color-mix(in srgb, var(--primary) 12%, transparent); pointer-events: none; }
.sup-copy { position: relative; z-index: 1; }
.sup-copy h2 { margin: 0 0 4px; font-size: var(--fs-xl); font-weight: 900; color: inherit; }
.sup-copy p { margin: 0; font-size: var(--fs-sm); font-weight: 600; opacity: .88; max-width: 36ch; line-height: 1.9; }
.slots { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 800; }
.slots-bar { display: flex; gap: 6px; width: 136px; }
.slots-bar i { flex: 1; height: 10px; border-radius: 6px; background: color-mix(in srgb, currentColor 18%, transparent); }
.slots-bar i.on { background: var(--primary); animation: slot-pop .32s var(--ease) both; }
@keyframes slot-pop { from { transform: scaleX(.3); opacity: 0; } to { transform: none; opacity: 1; } }

.tk-list { display: grid; gap: 10px; }
.tk {
  --st: var(--outline);
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--st); border-radius: var(--r-lg);
  color: var(--ink); text-decoration: none !important; overflow: hidden;
  transition: transform .12s var(--ease);
}
.tk[data-st="open"] { --st: var(--hl); }
.tk[data-st="answered"] { --st: var(--ok); }
.tk:active { transform: scale(.985); }
.tk[data-st="closed"] .tk-msg, .tk[data-st="closed"] .tk-top { opacity: .7; }
.tk-ico { flex: none; display: inline-flex; box-sizing: content-box; width: 22px; height: 22px; padding: 10px; border-radius: 50%; background: var(--primary-soft); color: var(--on-soft); }
.tk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tk-top strong { font-weight: 800; }
.tk-id { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.tk-msg { color: var(--muted); font-size: var(--fs-sm); line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tk-msg b { color: var(--ink); font-weight: 700; }
.tk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.tk-when { color: var(--muted); font-size: var(--fs-xs); }
.tk-new { flex: none; padding: 2px 11px; border-radius: 999px; background: var(--hl); color: var(--on-hl); font-size: var(--fs-xs); font-style: normal; font-weight: 800; }

.fab-ext { width: auto; min-width: 58px; padding: 0 22px 0 20px; gap: 10px; font-weight: 800; font-size: var(--fs-md); }
.fab-ext .ico { width: 24px; height: 24px; }

/* فرم تیکت جدید */
.cat-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pill { position: relative; }
.cat-pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cat-pill span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--outline); border-radius: 12px; background: var(--surface); font-size: var(--fs-sm); font-weight: 700; transition: background-color .15s linear, border-color .15s linear; }
.cat-pill input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--on-soft); }
.cat-pill input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }
.cnt-line { display: flex; align-items: center; gap: 12px; margin: 8px 4px 0; }
.cnt-line .meter { flex: 1; height: 6px; }
.cnt { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.cnt b { font-weight: 800; color: var(--ink); }
.cnt.is-warn b { color: var(--warn); }
.cnt.is-max b { color: var(--danger); }
.meter.is-warn > span { background: var(--hl); }
.meter.is-max > span { background: var(--danger); }

/* ---------- گفتگوی تیکت ---------- */
.page.chat { display: flex; flex-direction: column; padding: 0; min-height: calc(100dvh - var(--appbar-h) - env(safe-area-inset-top)); }
body.chat-page.has-dock .page.chat { padding-bottom: 0; }
@media (max-width: 959.98px) {
  body.chat-page .dock { display: none; }
  body.chat-page .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
.chat-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 4px 16px 10px; }
.chat-cat { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 800; }
.chat-cat .ico { width: 18px; height: 18px; color: var(--primary-strong); }
[data-theme="tire"] .chat-cat .ico { color: var(--primary); }
.chat-since { font-size: var(--fs-xs); }
.chat-close { margin-inline-start: auto; }

.msgs { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 6px 14px 18px; }
.day-sep { align-self: center; margin: 12px 0 6px; }
.day-sep span { display: inline-block; padding: 2px 14px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 90%; animation: msg-in .2s var(--ease) both; }
.msg.is-me { align-self: flex-start; }
.msg.is-them { align-self: flex-end; }
.msg-av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--on-soft); font-size: var(--fs-sm); font-weight: 800; }
.msg-av .ico { width: 18px; height: 18px; }
.msg-bubble { min-width: 0; padding: 8px 14px 6px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.msg.is-me .msg-bubble { background: var(--primary); color: var(--on-primary); border-color: transparent; border-end-start-radius: 6px; }
.msg.is-them .msg-bubble { border-end-end-radius: 6px; }
.msg-who { display: block; font-size: var(--fs-xs); font-weight: 800; color: var(--primary-strong); }
[data-theme="tire"] .msg-who { color: var(--primary); }
.msg-text { margin: 0; max-width: none; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; }
.msg-time { display: block; text-align: end; font-size: 11px; opacity: .7; margin-top: 1px; }
.msg.is-pending { opacity: .6; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.composer { position: sticky; bottom: 0; z-index: 20; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -1px 0 var(--line); }
.composer-in { display: flex; align-items: flex-end; gap: 10px; }
.composer textarea {
  flex: 1; min-width: 0; min-height: 48px; max-height: 132px; padding: 11px 18px; overflow-y: auto; resize: none;
  background: var(--surface-2); border: 2px solid transparent; border-radius: 24px; font-size: 16px; line-height: 1.7;
  -webkit-appearance: none; appearance: none; transition: border-color .15s linear, background-color .15s linear;
}
.composer textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.composer textarea::placeholder { color: var(--muted); opacity: .7; }
.composer-foot { display: flex; justify-content: space-between; gap: 12px; padding: 5px 12px 0; color: var(--muted); font-size: var(--fs-xs); }
/* دکمه‌ی ارسال با حلقه‌ی شمارنده: هرچه به سقف حرف نزدیک می‌شوی حلقه پُرتر می‌شود */
.send {
  position: relative; flex: none; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: var(--on-primary);
  transition: transform .12s var(--ease), background-color .15s linear;
}
.send .ico { position: relative; width: 22px; height: 22px; }
.send:active:not(:disabled) { transform: scale(.92); }
.send:disabled { background: var(--surface-3); color: var(--muted); cursor: default; }
.send-ring { position: absolute; top: -5px; left: -5px; width: 58px; height: 58px; transform: rotate(-90deg); pointer-events: none; opacity: 0; transition: opacity .15s linear; }
.send-ring circle { fill: none; stroke-width: 2; }
.send-ring .ring-bg { stroke: var(--surface-3); }
.send-ring .ring-fg { stroke: var(--primary); stroke-linecap: round; stroke-dasharray: calc(var(--pn, 0) * 1px) 100px; transition: stroke-dasharray .12s linear, stroke .2s linear; }
.composer.has-text .send-ring { opacity: 1; }
.composer.is-warn .send-ring .ring-fg { stroke: var(--warn); }
.composer.is-max .send-ring .ring-fg { stroke: var(--danger); }
.composer.is-warn .cnt b { color: var(--warn); }
.composer.is-max .cnt b { color: var(--danger); }

.chat-closed { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 12px; margin: 0 14px calc(14px + env(safe-area-inset-bottom)); padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface-2); }
.chat-closed > .ico { width: 24px; height: 24px; color: var(--muted); }
.chat-closed > div { flex: 1; min-width: 0; }
.chat-closed strong { display: block; font-size: var(--fs-sm); }
.chat-closed p { margin: 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.7; }

/* ---------- اعلان‌ها ---------- */
.nt-list { display: grid; gap: 10px; }
.nt {
  --k: var(--primary-strong);
  position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); text-decoration: none !important;
}
[data-theme="tire"] .nt { --k: var(--primary); }
.nt[data-kind="success"] { --k: var(--ok); }
.nt[data-kind="warn"] { --k: var(--warn); }
.nt-ico { flex: none; display: inline-flex; box-sizing: content-box; width: 22px; height: 22px; padding: 9px; border-radius: 50%; background: color-mix(in srgb, var(--k) 15%, var(--surface)); color: var(--k); }
.nt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nt-title { font-size: var(--fs-md); font-weight: 800; line-height: 1.7; }
.nt-body { color: var(--muted); font-size: var(--fs-sm); line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.nt-when { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.nt.is-new { border-color: color-mix(in srgb, var(--k) 50%, var(--line)); background: color-mix(in srgb, var(--k) 6%, var(--surface)); }
.nt-dot { position: absolute; top: 16px; inset-inline-end: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--hl); }
.nt-link { align-items: center; }
.nt-link > .ico { color: var(--muted); width: 20px; height: 20px; }

/* ---------- ورود: لینک‌های کمکی ---------- */
.forgot-link { display: block; text-align: end; margin: -6px 4px 16px; font-size: var(--fs-sm); font-weight: 700; }

/* =====================================================================
   نسخه‌ی ۵ — ظاهر «شیشه‌ای/درخشان» (الهام‌گرفته از طرح مرجع) + بخش آموزش
   فقط گرادیان، سایه‌ی ثابت و transform/opacity؛ بدون backdrop-filter و بدون تصویر سنگین.
   ===================================================================== */
:root, [data-theme="firoozei"] {
  --g1: #19b4d6; --g2: #087A99; --glow: rgba(8, 122, 153, .35);
  --card-bg: linear-gradient(160deg, #FFFFFF 0%, #EEF7FA 100%);
  --card-bd: rgba(8, 122, 153, .16);
  --card-sh: 0 10px 26px -16px rgba(8, 82, 108, .45);
  --dock-bg: rgba(255, 255, 255, .96);
  --inset: #E8F0F3;
}
[data-theme="banafsh"] {
  --g1: #8b6af0; --g2: #5b34c9; --glow: rgba(103, 64, 212, .35);
  --card-bg: linear-gradient(160deg, #FFFFFF 0%, #F1ECFB 100%);
  --card-bd: rgba(103, 64, 212, .16);
  --card-sh: 0 10px 26px -16px rgba(75, 41, 168, .45);
  --dock-bg: rgba(255, 255, 255, .96);
  --inset: #ECE7F7;
}
[data-theme="tire"] {
  --g1: #0ea5e9; --g2: #2563eb; --glow: rgba(56, 189, 248, .45);
  --card-bg: linear-gradient(150deg, rgba(31, 56, 108, .55) 0%, rgba(10, 19, 40, .94) 70%);
  --card-bd: rgba(110, 160, 255, .2);
  --card-sh: 0 14px 32px -18px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .05);
  --dock-bg: linear-gradient(180deg, #0d1830, #080f20);
  --inset: rgba(3, 8, 20, .55);
}
[data-theme="tire"] body, body[data-theme="tire"] { background: radial-gradient(120% 60% at 50% -10%, #0b2447 0%, #050A15 55%) fixed; }
[data-theme="tire"] .appbar { background: transparent; }
[data-theme="tire"] .appbar.is-scrolled { background: rgba(5, 10, 21, .96); }

/* دکمه‌ی اصلی: گرادیان درخشان */
.btn-primary { background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px var(--glow); }
[data-theme="tire"] .btn-primary { color: #fff; }
.btn-primary:disabled { box-shadow: none; }

/* کارت‌های شیشه‌ای مشترک */
.panel, .rows, .plan-strip, .stat-card, .ac-strip, .ac-hero, .ac-cat, .ac-card, .ac-hero-card, .ac-lesson-row, .ac-locked, .ac-complete, .cal-card, .notif, .nt, .req-card {
  background: var(--card-bg); border: 1px solid var(--card-bd); box-shadow: var(--card-sh);
}
.rows { overflow: hidden; }

/* نوار بالا: دکمه‌ی منو (بالا-راست) */
.appbar-menu { width: 42px; height: 42px; border-radius: 14px; background: var(--card-bg); border: 1px solid var(--card-bd); color: var(--ink); flex: none; }
.appbar-menu .ico { width: 22px; height: 22px; }
.appbar-menu.is-current { border-color: var(--primary); color: var(--primary); }
.appbar-mark { margin-inline-start: 4px; border-radius: 12px; }
.appbar-title { font-weight: 900; }

/* ---------- کارت امروز (هیرو) ---------- */
.today-card {
  position: relative; overflow: hidden; color: #EAF4FF; padding: 22px 20px; min-height: 140px;
  background: linear-gradient(100deg, rgba(4, 10, 22, .1) 0%, rgba(4, 10, 22, .72) 62%), url('../images/hero-bg.svg') center / cover no-repeat, #071a30;
  border: 1px solid rgba(120, 190, 255, .28); box-shadow: 0 18px 40px -22px var(--glow);
}
.today-card .hello { margin: 0 0 4px; font-size: 1.9rem; font-weight: 900; line-height: 1.3; letter-spacing: -.01em; }
.today-card .dateline { opacity: .85; }
.today-card .ring { width: 96px; height: 96px; }
.today-card .ring-bg, .ac-hero .ring-bg { stroke: rgba(125, 211, 252, .22); }
.today-card .ring-fg, .ac-hero .ring-fg { stroke: #38BDF8; filter: drop-shadow(0 0 5px rgba(56, 189, 248, .8)); }
.today-card .ring-txt { color: #fff; font-size: var(--fs-xl); }
.today-card .count { opacity: .92; }

/* ---------- بازه‌ی مطالعه (مثل طرح مرجع) ---------- */
.slot {
  --cx: var(--c, var(--primary));
  grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 16px 16px 14px; border-radius: 26px;
  background: var(--card-bg); border: 1px solid var(--card-bd); box-shadow: var(--card-sh);
}
@supports (background: color-mix(in srgb, red 10%, white)) {
  .slot {
    background: linear-gradient(145deg, color-mix(in srgb, var(--cx) 26%, var(--surface)) 0%, var(--surface) 78%);
    border-color: color-mix(in srgb, var(--cx) 55%, transparent);
    box-shadow: 0 14px 30px -18px var(--cx), inset 0 1px 0 rgba(255, 255, 255, .05);
  }
}
.slot-time { display: grid; grid-template-columns: auto auto; column-gap: 10px; align-content: center; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); text-align: start; min-width: 4.6rem; }
.slot-time > span { grid-column: 1; font-size: var(--fs-md); font-weight: 800; }
.slot-time > span:last-of-type { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.slot-time > .ico { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 22px; height: 22px; color: var(--muted); }
.slot-time.is-empty { display: flex; align-items: center; }
.slot-main { position: relative; background: transparent !important; border: 0; border-radius: 0; padding: 4px 6px; min-height: 52px; gap: 6px; }
.slot-main::after { content: ''; position: absolute; inset-inline-end: -6px; top: 50%; width: 4px; height: 42px; margin-top: -21px; border-radius: 4px; background: var(--cx); box-shadow: 0 0 12px var(--cx); }
.slot-title { font-size: var(--fs-lg); font-weight: 800; }
.slot-note { display: inline-flex; align-items: center; gap: 8px; }
.slot-note .ico { width: 18px; height: 18px; flex: none; }
.slot-check { width: 48px; height: 48px; border-color: color-mix(in srgb, var(--cx) 70%, #fff); border-width: 2px; }
.slot-timer {
  grid-column: 1 / -1; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  padding: 8px 12px 8px 8px; margin-top: 2px; border: 0; border-radius: 22px; background: var(--inset);
  box-shadow: inset 0 0 0 1px var(--line);
}
.slot-timer .timer-row { display: contents; }
.timer-alarm { order: 1; display: inline-flex; color: var(--muted); }
.timer-alarm .ico { width: 22px; height: 22px; }
.timer-remaining { order: 2; flex: 1; text-align: start; font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.timer-clock { order: 3; display: none; min-width: 0; font-size: var(--fs-md); color: var(--cx); }
.slot-timer.is-running .timer-clock { display: inline; }
.slot-timer .meter { order: 4; flex: none; width: 112px; height: 12px; border-radius: 0; background: none; overflow: visible; position: relative; }
.slot-timer .meter::before, .slot-timer .meter > span {
  content: ''; position: absolute; inset: 0; display: block; height: 12px; width: 100%; border-radius: 0; transform: none; transition: none;
  background-repeat: repeat-x; background-size: 22.4px 12px; background-position: right center;
}
.slot-timer .meter::before { background-image: radial-gradient(circle at center, var(--surface-3) 0 4px, transparent 4.6px); }
.slot-timer .meter > span { background-color: transparent; background-image: radial-gradient(circle at center, var(--cx) 0 4.5px, transparent 5.2px); clip-path: inset(0 0 0 calc(100% - var(--pn, 0) * 1%)); filter: drop-shadow(0 0 3px var(--cx)); }
.timer-btn { order: 5; width: 54px; height: 54px; background: linear-gradient(145deg, color-mix(in srgb, var(--cx) 78%, #fff), var(--cx)); color: #fff; box-shadow: 0 8px 20px -8px var(--cx); }
.timer-btn .ico { width: 22px; height: 22px; }
.timer-confirm { order: 9; flex: 1 1 100%; background: var(--surface-2); }
.slot-timer.is-complete { padding: 8px 14px; }
.slot-timer.is-complete .meter { width: 112px; }

/* ---------- آمار داشبورد ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card { position: relative; display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 14px; border-radius: 24px; color: var(--ink); min-width: 0; }
a.stat-card:hover { text-decoration: none; }
.stat-card > div { min-width: 0; text-align: start; flex: 1; }
.stat-card small { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.stat-card b { display: block; margin-top: 2px; font-size: var(--fs-2xl); font-weight: 900; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card em { display: block; font-style: normal; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; margin-top: 2px; }
.stat-ico { width: 54px; height: 54px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(145deg, var(--t1, var(--g1)), var(--t2, var(--g2))); box-shadow: 0 8px 18px -8px var(--t2, var(--g2)); }
.stat-ico .ico { width: 26px; height: 26px; }
.tone-green { --t1: #34d399; --t2: #047857; } .tone-violet { --t1: #a78bfa; --t2: #4f46e5; } .tone-cyan { --t1: #22d3ee; --t2: #0284c7; }
.tone-indigo { --t1: #818cf8; --t2: #4338ca; } .tone-amber { --t1: #fbbf24; --t2: #d97706; }
.ac-strip { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px; border-radius: 24px; color: var(--ink); }
.ac-strip:hover { text-decoration: none; }
.ac-strip .stat-ico { width: 46px; height: 46px; }
.ac-strip-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ac-strip-txt small { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.ac-strip-txt b { font-size: var(--fs-md); font-weight: 800; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-strip .meter { height: 6px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }

/* ---------- نوار پایین شناور (موبایل) ---------- */
@media (max-width: 959.98px) {
  :root { --dock-h: 70px; }
  .dock {
    inset-inline: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--dock-h); padding: 6px; gap: 4px;
    border-radius: 30px; background: var(--dock-bg); border: 1px solid var(--card-bd);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .06);
  }
  .dock-item { border-radius: 24px; border: 1px solid transparent; gap: 2px; transition: background-color .18s linear, border-color .18s linear, box-shadow .18s linear; }
  .dock-ico { width: 40px; height: 30px; }
  .dock-ico::before, .dock-ico::after { display: none; }
  .dock-item.is-active { color: var(--primary); background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 22%, transparent), color-mix(in srgb, var(--primary) 6%, transparent)); border-color: color-mix(in srgb, var(--primary) 55%, transparent); box-shadow: 0 0 22px -6px var(--primary); }
  .dock-item.is-active .ico { color: var(--primary); fill: color-mix(in srgb, currentColor 18%, transparent); }
  body.has-dock .page { padding-bottom: calc(var(--dock-h) + 40px + env(safe-area-inset-bottom)); }
  body.has-dock .toasts { bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom)) !important; }
}
@media (min-width: 960px) { .dock-item.is-active { background: var(--primary-soft); } }

/* =====================================================================
   آموزش (آکادمی)
   ===================================================================== */
.ac-page { max-width: 56rem; }
.ac-hero { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: 28px; overflow: hidden; color: #EAF4FF; background: linear-gradient(100deg, rgba(4, 10, 22, .1), rgba(4, 10, 22, .75) 65%), url('../images/hero-bg.svg') center / cover no-repeat, #071a30; border-color: rgba(120, 190, 255, .28); }
.ac-hero .ring { width: 88px; height: 88px; }
.ac-hero .ring-txt { flex-direction: column; line-height: 1.1; color: #fff; font-size: var(--fs-xl); }
.ac-hero .ring-txt small { font-size: 10px; font-weight: 600; opacity: .8; }
.ac-hero-txt .dateline { margin: 0 0 2px; font-size: var(--fs-xs); font-weight: 700; opacity: .8; }
.ac-hero-txt .hello { margin: 0 0 4px; font-size: var(--fs-xl); font-weight: 900; }
.ac-hero-txt .count { margin: 0; font-size: var(--fs-sm); font-weight: 600; opacity: .92; }
.ac-mini { display: flex; gap: 10px; margin: 10px 0 0; flex-wrap: wrap; }
.ac-mini > * { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; border: 1px solid var(--line); }
.ac-mini a:hover { text-decoration: none; border-color: var(--primary); }
.ac-mini .ico { width: 17px; height: 17px; color: var(--primary); }

.ac-search { position: relative; display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; padding: 0 14px; height: 52px; border-radius: 18px; background: var(--surface-2); border: 1.5px solid var(--line); }
.ac-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.ac-search > .ico { color: var(--muted); width: 22px; height: 22px; flex: none; }
.ac-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-md); }
.ac-search input:focus { outline: none; }
.ac-search input::-webkit-search-cancel-button { display: none; }
.ac-res-status { margin: 12px 4px; font-size: var(--fs-sm); }
.ac-res-lessons { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.ac-res-lesson { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 16px; background: var(--card-bg); border: 1px solid var(--card-bd); color: var(--ink); }
.ac-res-lesson:hover { text-decoration: none; border-color: var(--primary); }
.ac-res-lesson small { color: var(--muted); }

/* دسته‌بندی‌ها */
.ac-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ac-cat { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 128px; padding: 16px; border-radius: 24px; color: var(--ink); isolation: isolate; transition: transform .18s var(--ease); }
.ac-cat:hover { text-decoration: none; } .ac-cat:active { transform: scale(.98); }
.ac-cat::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--cc) 38%, transparent), transparent 62%); }
.ac-cat-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .35; }
.ac-cat-emoji { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 18px; color: color-mix(in srgb, var(--cc) 62%, var(--ink)); background: color-mix(in srgb, var(--cc) 30%, var(--surface-2)); box-shadow: 0 8px 18px -10px var(--cc); flex: none; }
.ac-cat-name { margin-top: auto; font-size: var(--fs-md); font-weight: 900; line-height: 1.5; }
.ac-cat-count { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.ac-cat-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.ac-cat-head > div { flex: 1; min-width: 0; } .ac-cat-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 900; } .ac-cat-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }

/* کارت دوره (نسخه‌ی کوچک‌شده‌ی کارت مرجع) */
.ac-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ac-grid { grid-template-columns: 1fr 1fr; } .ac-cats { grid-template-columns: repeat(3, 1fr); } }
.ac-grid-one { grid-template-columns: 1fr; }
.ac-card { display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; color: var(--ink); content-visibility: auto; contain-intrinsic-size: auto 300px; transition: transform .18s var(--ease); }
.ac-card:hover { text-decoration: none; } .ac-card:active { transform: scale(.985); }
.ac-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--cc, #2f80ed) 78%, #000), color-mix(in srgb, var(--cc, #2f80ed) 30%, #0b1220)); }
.ac-card .ac-cover { aspect-ratio: 2.1 / 1; }
.ac-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ac-cover.is-gen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; text-align: center; padding: 10px; }
.ac-cover.is-gen::after { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 90% at 15% 10%, rgba(255, 255, 255, .22), transparent 60%); }
.ac-cat-emoji .ico { width: 56%; height: 56%; }
.ac-gen-emoji { display: inline-flex; line-height: 1; position: relative; z-index: 1; } .ac-gen-emoji .ico { width: 2.4rem; height: 2.4rem; stroke-width: 1.6; } .ac-gen-title { font-weight: 800; font-size: var(--fs-sm); opacity: .95; position: relative; z-index: 1; }
.ac-cover-lg { aspect-ratio: 16 / 9; max-height: 260px; width: 100%; }
.ac-card-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 12px; flex: 1; }
.ac-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-b { display: inline-flex; align-items: center; gap: 4px; padding: 3px 11px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 700; line-height: 1.7; }
.ac-b .ico { width: 13px; height: 13px; }
.ac-b-free { background: #DDF6E6; color: #137a45; } .ac-b-plan { background: #FFF0C7; color: #8a5a00; } .ac-b-hot { background: #FFE9CF; color: #b45309; }
.ac-b-st-completed { background: #E3ECFF; color: #2751c8; } .ac-b-st-ongoing { background: #DFF4FF; color: #0a72a8; } .ac-b-st-upcoming { background: #EFE7FF; color: #6d3fd0; }
.ac-b-cat { background: color-mix(in srgb, var(--cc, #2f80ed) 20%, var(--surface-2)); color: var(--ink); }
[data-theme="tire"] .ac-b-free { background: rgba(52, 211, 153, .16); color: #6ee7b7; } [data-theme="tire"] .ac-b-plan { background: rgba(251, 191, 36, .16); color: #fcd34d; }
[data-theme="tire"] .ac-b-hot { background: rgba(251, 146, 60, .18); color: #fdba74; } [data-theme="tire"] .ac-b-st-completed { background: rgba(96, 165, 250, .18); color: #93c5fd; }
[data-theme="tire"] .ac-b-st-ongoing { background: rgba(56, 189, 248, .16); color: #7dd3fc; } [data-theme="tire"] .ac-b-st-upcoming { background: rgba(167, 139, 250, .18); color: #c4b5fd; }
.ac-card-title { margin: 0; font-size: var(--fs-md); font-weight: 900; line-height: 1.6; }
.ac-card-desc { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: none; }
.ac-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.ac-chip .ico { width: 15px; height: 15px; }
.ac-like { background: #FDE4EA; color: #d6254d; } [data-theme="tire"] .ac-like { background: rgba(244, 63, 94, .16); color: #fda4af; }
.ac-xp { background: #FFF1C9; color: #8a5a00; } [data-theme="tire"] .ac-xp { background: rgba(251, 191, 36, .16); color: #fcd34d; }
.ac-xp.is-got { background: #DDF6E6; color: #137a45; } [data-theme="tire"] .ac-xp.is-got { background: rgba(52, 211, 153, .16); color: #6ee7b7; }
.ac-chip.is-done { background: #DDF6E6; color: #137a45; } .ac-chip.is-draft { background: #FFE4E4; color: #b93434; }
.ac-prog { display: flex; align-items: center; gap: 10px; } .ac-prog .meter { flex: 1; height: 7px; } .ac-prog small { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.ac-prog-lg { margin: 12px 0 4px; } .ac-prog-lg .meter { height: 10px; }
.ac-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.ac-price { font-size: var(--fs-lg); font-weight: 900; color: var(--primary); } .ac-price.is-plan { font-size: var(--fs-sm); color: var(--warn); }
.ac-go { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-size: var(--fs-sm); font-weight: 800; } .ac-go .ico { width: 18px; height: 18px; }

/* صفحه‌ی دوره */
.ac-hero-card { border-radius: 28px; overflow: hidden; }
.ac-hero-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.ac-hero-body h1 { margin: 0; font-size: var(--fs-xl); font-weight: 900; line-height: 1.6; }
.ac-lead { margin: 0; color: var(--muted); line-height: 1.9; max-width: none; }
.ac-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ac-stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.ac-stats b { font-size: var(--fs-md); font-weight: 900; } .ac-stats span { color: var(--muted); font-size: 11px; font-weight: 700; }
.ac-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.ac-cta .btn-primary { flex: 1 1 10rem; }
.ac-like-btn { gap: 6px; } .ac-like-btn .ico { transition: transform .2s var(--ease); }
.ac-like-btn.is-on { color: #e11d48; } .ac-like-btn.is-on .ico { fill: currentColor; transform: scale(1.12); }
.ac-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 4px 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.8; max-width: none; }
.ac-note .ico { width: 18px; height: 18px; flex: none; margin-top: 4px; color: var(--primary); }
.ac-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 16px 0 12px; padding: 5px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); position: sticky; top: calc(var(--appbar-h) + env(safe-area-inset-top)); z-index: 20; }
.ac-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 0; border-radius: 15px; background: transparent; color: var(--muted); font-weight: 800; font-size: var(--fs-sm); transition: background-color .15s linear, color .15s linear; }
.ac-tab .ico { width: 18px; height: 18px; } .ac-tab b { font-size: 11px; opacity: .8; }
.ac-tab[aria-selected="true"] { background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; box-shadow: 0 8px 18px -10px var(--glow); }
.ac-panel[hidden] { display: none; }

.ac-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ac-lesson-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; color: var(--ink); content-visibility: auto; contain-intrinsic-size: auto 68px; }
a.ac-lesson-row:hover { text-decoration: none; border-color: var(--primary); }
.ac-lesson-state { flex: none; width: 40px; height: 40px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--primary); font-weight: 900; }
.ac-lesson-row.is-done .ac-lesson-state { background: var(--ok); color: #fff; } .ac-lesson-row.is-locked { opacity: .72; } .ac-lesson-row.is-locked .ac-lesson-state { color: var(--muted); }
.ac-lesson-state .ico { width: 20px; height: 20px; }
.ac-lesson-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .ac-lesson-main strong { font-size: var(--fs-md); line-height: 1.6; overflow-wrap: anywhere; } .ac-lesson-main small { color: var(--muted); font-size: var(--fs-xs); }

/* پرسش و پاسخ */
.ac-chat-intro { display: flex; gap: 8px; align-items: center; margin: 0 4px 10px; color: var(--muted); font-size: var(--fs-sm); max-width: none; } .ac-chat-intro .ico { width: 18px; height: 18px; color: var(--primary); flex: none; }
.ac-msgs { padding: 6px 2px 12px; min-height: 120px; }
.ac-empty-chat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 12px; text-align: center; color: var(--muted); } .ac-empty-chat[hidden] { display: none; } .ac-empty-chat .ico { width: 34px; height: 34px; color: var(--primary); }
.ac-composer { position: sticky; bottom: calc(var(--dock-h) + 20px + env(safe-area-inset-bottom)); z-index: 25; padding: 8px 10px; border-radius: 24px; background: var(--dock-bg); border: 1px solid var(--card-bd); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .55); }
@media (min-width: 960px) { .ac-composer { bottom: 16px; } }
.ac-replying { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px 8px; font-size: var(--fs-xs); color: var(--muted); } .ac-replying[hidden] { display: none; } .ac-replying span { display: inline-flex; align-items: center; gap: 6px; } .ac-replying .ico { width: 15px; height: 15px; }
.msg-reply-ref { display: block; width: 100%; text-align: start; margin: 2px 0 6px; padding: 5px 10px; border: 0; border-inline-start: 3px solid var(--primary); border-radius: 8px; background: color-mix(in srgb, currentColor 10%, transparent); color: inherit; font-size: var(--fs-xs); line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .msg-reply-ref b { display: block; font-weight: 800; }
.msg-pin { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; opacity: .8; } .msg-pin .ico { width: 12px; height: 12px; }
.msg-foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 2px; }
.msg-foot .msg-time { margin: 0; }
.msg-act { border: 0; background: transparent; color: inherit; opacity: .65; font: inherit; font-size: 11px; font-weight: 700; padding: 2px 4px; cursor: pointer; } .msg-act:hover { opacity: 1; } .msg-act.is-danger { color: var(--danger); }
.msg.is-me .msg-act.is-danger { color: inherit; }
.msg-text.is-deleted { opacity: .55; font-style: italic; }
.msg.is-pinned .msg-bubble { box-shadow: 0 0 0 2px color-mix(in srgb, var(--hl) 70%, transparent); }
.msg.is-flash .msg-bubble { animation: acflash 1.2s ease; }
@keyframes acflash { 0%, 60% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: 0 0 0 0 transparent; } }
.msg-av.is-admin { background: var(--hl); color: var(--on-hl); }
.ac-adm { font-style: normal; font-size: 10px; padding: 1px 7px; border-radius: 8px; background: var(--hl); color: var(--on-hl); font-weight: 800; }

/* صفحه‌ی درس */
.ac-crumb { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin: 2px 0 10px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.ac-crumb:hover { text-decoration: none; color: var(--ink); } .ac-crumb .ico { width: 15px; height: 15px; flex: none; } .ac-crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-lesson-head { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.ac-lesson-no { color: var(--primary); font-size: var(--fs-xs); font-weight: 800; }
.ac-lesson-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 900; line-height: 1.6; }
.ac-blocks { display: flex; flex-direction: column; gap: 16px; }
.ac-video, .ac-fig { margin: 0; border-radius: 22px; overflow: hidden; background: #000; border: 1px solid var(--card-bd); box-shadow: var(--card-sh); }
.ac-video video { display: block; width: 100%; max-height: 70vh; background: #000; aspect-ratio: 16 / 9; }
.ac-fig { background: var(--surface); } .ac-fig img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.ac-video figcaption, .ac-fig figcaption { padding: 8px 14px; color: var(--muted); font-size: var(--fs-sm); background: var(--surface); }
.ac-audio { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 22px; background: var(--card-bg); border: 1px solid var(--card-bd); box-shadow: var(--card-sh); }
.ac-audio > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; } .ac-audio audio { width: 100%; }
.ac-audio-ico { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(145deg, #a78bfa, #4f46e5); flex: none; } .ac-audio-ico .ico { width: 22px; height: 22px; }
.ac-prose { padding: 4px 4px; line-height: 2; font-size: var(--fs-md); overflow-wrap: anywhere; }
.ac-prose > :first-child { margin-top: 0; } .ac-prose p, .ac-prose ul, .ac-prose ol, .ac-prose blockquote { max-width: none; margin: 0 0 12px; }
.ac-prose h2, .ac-prose h3, .ac-prose h4 { margin: 18px 0 8px; font-weight: 900; line-height: 1.6; } .ac-prose h2 { font-size: var(--fs-xl); } .ac-prose h3 { font-size: var(--fs-lg); } .ac-prose h4 { font-size: var(--fs-md); }
.ac-prose ul, .ac-prose ol { padding-inline-start: 1.4em; } .ac-prose li { margin-bottom: 4px; }
.ac-prose blockquote { padding: 10px 14px; border-inline-start: 4px solid var(--primary); background: var(--surface-2); border-radius: 12px; color: var(--muted); }
.ac-prose code { padding: 1px 7px; border-radius: 7px; background: var(--surface-2); font-size: .9em; direction: ltr; unicode-bidi: embed; }
.ac-code { margin: 0 0 12px; padding: 14px; border-radius: 16px; background: #050b16; color: #d6e4ff; overflow-x: auto; font-size: 13px; line-height: 1.8; text-align: left; border: 1px solid var(--line); } .ac-code code { background: none; padding: 0; }
.ac-lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 10px; }
.ac-complete { position: sticky; bottom: calc(var(--dock-h) + 18px + env(safe-area-inset-bottom)); z-index: 25; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 24px; background: var(--dock-bg); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .55); }
@media (min-width: 960px) { .ac-complete { bottom: 16px; } }
.ac-complete-info { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ac-complete-info strong { font-size: var(--fs-sm); } .ac-complete-info small { color: var(--muted); font-size: var(--fs-xs); }
.ac-complete [hidden] { display: none !important; } .ac-complete .btn { flex: none; }
.ac-locked { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 32px 18px; border-radius: 28px; }
.ac-locked h2 { margin: 0; font-size: var(--fs-lg); } .ac-locked p { margin: 0 0 8px; color: var(--muted); }
.ac-locked-ico { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(145deg, #fbbf24, #d97706); box-shadow: 0 10px 24px -10px #d97706; } .ac-locked-ico .ico { width: 30px; height: 30px; }
.ac-zoom .sheet-body { padding: 0; } .ac-zoom img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; }
.ac-reward-body { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 22px; }
.ac-reward-body h2 { margin: 0; font-size: var(--fs-xl); font-weight: 900; } .ac-reward-xp { margin: 0; font-size: var(--fs-3xl); font-weight: 900; color: var(--hl); text-shadow: 0 0 22px rgba(255, 210, 63, .5); }
.ac-reward-burst { width: 84px; height: 84px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #2b1a00; background: radial-gradient(circle at 30% 25%, #ffe38a, #f59e0b); box-shadow: 0 0 0 8px rgba(251, 191, 36, .18), 0 0 40px rgba(251, 191, 36, .55); animation: acpop .6s var(--ease) both; } .ac-reward-burst .ico { width: 40px; height: 40px; }
@keyframes acpop { 0% { transform: scale(.4) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.12) rotate(4deg); opacity: 1; } 100% { transform: none; } }
.ac-level { width: 100%; max-width: 20rem; display: flex; flex-direction: column; gap: 6px; } .ac-level .meter { height: 10px; } .ac-level small { color: var(--muted); } .ac-level-no { font-weight: 900; color: var(--primary); }
.ac-reward .form-actions { width: 100%; flex-direction: column; margin-top: 8px; }
.ac-certs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ac-cert-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: var(--card-bg); border: 1px solid var(--card-bd); color: var(--ink); } .ac-cert-row:hover { text-decoration: none; border-color: var(--primary); }
.ac-cert-ico { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(145deg, #fbbf24, #d97706); flex: none; }
.kv { margin: 10px 0 0; } .kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 2px; border-top: 1px solid var(--line); } .kv dt { color: var(--muted); font-size: var(--fs-sm); } .kv dd { margin: 0; font-weight: 700; font-size: var(--fs-sm); text-align: end; }

/* ---------- صفحه‌ی گواهی ---------- */
.cert-body { background: #050A15; min-height: 100vh; }
.cert-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; max-width: 70rem; margin: 0 auto; }
.cert-wrap { max-width: 70rem; margin: 0 auto; padding: 8px 12px 40px; }
.cert { container-type: inline-size; aspect-ratio: 1.414 / 1; border-radius: 18px; padding: 2.4cqw; color: #fff; background: radial-gradient(90% 60% at 50% 0%, rgba(56, 189, 248, .28), transparent 70%), linear-gradient(135deg, #071229, #0c2a45); box-shadow: 0 30px 70px -30px rgba(56, 189, 248, .45); }
.cert-frame { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; padding: 3.2cqw 5cqw 3cqw; border: .35cqw solid #38bdf8; border-radius: 1.2cqw; outline: .12cqw solid rgba(250, 204, 21, .8); outline-offset: -1.4cqw; }
.cert-head { display: flex; flex-direction: column; align-items: center; gap: .6cqw; } .cert-head img { width: 6cqw; height: 6cqw; border-radius: 1.4cqw; } .cert-head strong { font-size: 2.2cqw; }
.cert-kicker { margin: 0; font-size: 4.6cqw; font-weight: 900; color: #facc15; max-width: none; }
.cert-line { margin: 0; font-size: 1.9cqw; color: #9fb3d1; max-width: none; }
.cert-name { margin: 0; font-size: 6cqw; font-weight: 900; line-height: 1.5; color: #fff; overflow-wrap: anywhere; }
.cert-course { margin: 0; font-size: 3.6cqw; font-weight: 900; color: #38bdf8; line-height: 1.6; overflow-wrap: anywhere; }
.cert-foot { width: 100%; display: flex; justify-content: space-between; align-items: center; padding-top: 1.6cqw; border-top: .1cqw solid rgba(255, 255, 255, .18); }
.cert-foot > div { display: flex; flex-direction: column; gap: .3cqw; min-width: 24cqw; } .cert-foot small { color: #9fb3d1; font-size: 1.6cqw; } .cert-foot b { font-size: 2.2cqw; }
.cert-seal { min-width: 0 !important; width: 8cqw; height: 8cqw; border-radius: 50%; align-items: center; justify-content: center; background: #facc15; color: #071229; } .cert-seal .ico { width: 4.6cqw; height: 4.6cqw; }
.cert-verify { text-align: center; color: #9fb3d1; font-size: var(--fs-xs); margin: 14px auto 0; max-width: none; word-break: break-all; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  .no-print { display: none !important; } .cert-body, body { background: #fff !important; }
  .cert-wrap { max-width: none; padding: 0; } .cert { border-radius: 0; box-shadow: none; width: 100vw; height: 100vh; aspect-ratio: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ======================================================================
   v7 — ثابت‌ماندن نوار پایین + ریسپانسیو کامل
   ====================================================================== */

/* جلوگیری از لرزش/جابه‌جایی صفحه و نوار پایین هنگام اسکرول و کشیدن بیش‌ازحد (rubber-band) */
html { overflow-x: clip; overscroll-behavior-y: none; }
body { overflow-x: clip; max-width: 100%; overscroll-behavior-y: none; }

@media (max-width: 959.98px) {
  /* نوار پایین روی لایه‌ی گرافیکی جدا می‌ماند و با تغییر ارتفاع نوار آدرس مرورگر تکان نمی‌خورد */
  .dock {
    position: fixed;
    -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
    will-change: transform;
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
    touch-action: manipulation;
  }
}

/* پایه‌ی ریسپانسیو */
img, video, canvas, iframe { max-width: 100%; height: auto; }
input, select, textarea, button { max-width: 100%; }
.page > *, .page--wide > *, .admin-cols > *, .dash-grid > * { min-width: 0; }
pre, code, .table-wrap { max-width: 100%; }
table { max-width: 100%; }

/* اندازه‌ی متن‌ها بر اساس عرض صفحه تنظیم می‌شود */
:root {
  --fs-xl: clamp(1.125rem, 1.02rem + .5vw, 1.3rem);
  --fs-2xl: clamp(1.3rem, 1.1rem + 1vw, 1.7rem);
  --fs-3xl: clamp(1.6rem, 1.25rem + 1.8vw, 2.2rem);
}

/* جلوگیری از زوم خودکار iOS روی فیلدها */
@media (max-width: 959.98px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: max(16px, 1em); }
}

/* گوشی‌های کوچک (≤ ۳۸۰px) */
@media (max-width: 380px) {
  :root { --dock-h: 62px; }
  .page { padding-inline: 12px; }
  .dock { inset-inline: 8px; padding: 4px; gap: 2px; border-radius: 26px; }
  .dock-item { font-size: 10.5px; border-radius: 20px; }
  .dock-ico { width: 34px; height: 26px; }
  .dock-ico .ico { width: 22px; height: 22px; }
  .slot-check { width: 42px; height: 42px; }
  .timer-btn { width: 48px; height: 48px; }
  .slot-timer { gap: 8px; padding: 6px 10px 6px 6px; }
  .slot-timer .meter { width: 90px; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px 10px; border-radius: 20px; }
  .pagehead { gap: 8px; }
  .btn { padding-inline: 14px; }
}
@media (max-width: 340px) {
  .stat-grid { grid-template-columns: 1fr; }
  .dock-item { font-size: 10px; }
  .slot-timer .meter { display: none; }
}

/* تبلت و صفحه‌های بزرگ */
@media (min-width: 640px) and (max-width: 959.98px) {
  .page { max-width: 46rem; padding-inline: 24px; }
  .dock { inset-inline: max(12px, calc(50% - 22rem)); }
}
@media (min-width: 1280px) {
  .page { max-width: 50rem; }
  .page--wide { max-width: 76rem; }
}

/* حالت افقی گوشی: ارتفاع کم */
@media (max-height: 460px) and (orientation: landscape) and (max-width: 959.98px) {
  :root { --dock-h: 54px; }
  .dock-label { display: none; }
  .dock-ico { height: 34px; }
}


/* =========================================================================
   پلیر سفارشی آموزش (فقط روی درس‌های ویدیویی) + نظرات هر قسمت
   فقط transform/opacity انیمیشن می‌شوند؛ بلور فقط روی پنل‌های باز (سرعت/تنظیمات) است.
   ========================================================================= */
.ac-video.vp { overflow: visible; background: transparent; border: 0; box-shadow: none; border-radius: 0; }
.ac-video.vp figcaption { margin-top: 8px; padding: 0 6px; background: transparent; }
.vp-stage {
  --vp-acc: #ff8a3d; --vp-acc2: #ffc15e; --vp-on-acc: #1b1206; --vp-ink: #0b1017;
  position: relative; direction: rtl; color: #fff; font-family: var(--font);
}
.vp-stage [hidden] { display: none !important; }
.vp-frame { position: relative; overflow: hidden; border-radius: 22px; background: #000; border: 1px solid var(--card-bd); box-shadow: var(--card-sh); isolation: isolate; }
.vp-stage .vp-video { display: block; width: 100%; max-height: 70vh; aspect-ratio: 16 / 9; background: #000; object-fit: contain; }
.vp-ui { position: absolute; inset: 0; z-index: 2; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.vp-hit { position: absolute; inset: 0; z-index: 0; touch-action: manipulation; }
.vp-stage.is-idle .vp-hit { cursor: none; }
.vp-ui::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent); pointer-events: none; opacity: 1; transition: opacity .25s; z-index: 0; }
.vp-stage.is-idle .vp-ui::after { opacity: 0; }

/* دکمه‌ی بزرگ وسط */
.vp-center { position: absolute; z-index: 1; top: 50%; left: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.4); background: rgba(10,15,20,.55); color: #fff; cursor: pointer; transition: transform .22s var(--ease), opacity .22s; }
.vp-center .ico { width: 30px; height: 30px; margin-inline-start: 3px; }
.vp-center::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--vp-acc); opacity: 0; animation: vp-ring 1.6s ease-out 3; }
.vp-stage.is-playing .vp-center, .vp-stage.is-waiting .vp-center { opacity: 0; transform: scale(.8); pointer-events: none; }
.vp-stage.is-playing .vp-center::after { animation: none; }
.vp-spin { position: absolute; z-index: 1; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--vp-acc); opacity: 0; pointer-events: none; }
.vp-stage.is-waiting .vp-spin { opacity: 1; animation: vp-rot .8s linear infinite; }
.vp-err { position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: rgba(0,0,0,.74); color: #fff; font-size: var(--fs-sm); line-height: 2; }

/* پرش ۱۰ ثانیه با دوبار لمس */
.vp-fx { position: absolute; z-index: 1; top: 0; bottom: 0; width: 32%; display: grid; place-items: center; opacity: 0; pointer-events: none; color: #fff; font-size: 15px; }
.vp-fx::before { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.16); border-radius: 50%; transform: scale(.7); }
.vp-fx-r { right: 0; } .vp-fx-l { left: 0; }
.vp-fx b { position: relative; font-weight: 900; }
.vp-fx.is-on { animation: vp-fx .55s ease-out; }
.vp-fx.is-on::before { animation: vp-fxbg .55s ease-out; }

/* نوار کنترل: [سرعت] [تنظیمات] [نوار زمان] [توقف/پخش] — از راست به چپ */
.vp-bar { position: absolute; z-index: 3; left: 10px; right: 10px; bottom: 10px; height: 54px; display: flex; align-items: center; gap: 6px; padding: 0 7px; border-radius: 18px; background: linear-gradient(180deg, rgba(20,27,35,.86), rgba(9,13,18,.92)); border: 1px solid rgba(255,255,255,.11); box-shadow: 0 12px 32px -12px rgba(0,0,0,.8); transition: transform .26s var(--ease), opacity .26s; }
.vp-stage.is-idle .vp-bar { transform: translateY(18px); opacity: 0; pointer-events: none; }
.vp-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.vp-btn:hover { background: rgba(255,255,255,.1); }
.vp-btn:focus-visible, .vp-row:focus-visible, .vp-chip:focus-visible, .vp-faq-q:focus-visible, .vp-back:focus-visible, .vp-track:focus-visible, .vp-center:focus-visible { outline: 2px solid var(--vp-acc); outline-offset: 2px; }
.vp-btn .ico { width: 22px; height: 22px; }
.vp-speed { width: auto; min-width: 48px; padding: 0 9px; font-size: 13px; font-weight: 800; border: 1px solid rgba(255,255,255,.2); border-radius: 11px; height: 36px; font-variant-numeric: tabular-nums; }
.vp-speed.is-changed { background: var(--vp-acc); color: var(--vp-on-acc); border-color: transparent; }
.vp-gear .ico { transition: transform .4s var(--ease); }
.vp-gear[aria-expanded="true"] .ico { transform: rotate(60deg); }
.vp-gear[aria-expanded="true"], .vp-speed[aria-expanded="true"] { box-shadow: 0 0 0 2px rgba(255,138,61,.55); }
.vp-stop { width: 42px; height: 42px; border-radius: 50%; background: var(--vp-acc); color: var(--vp-on-acc); transition: transform .15s; }
.vp-stop:hover { background: var(--vp-acc2); } .vp-stop:active { transform: scale(.92); }
.vp-stop .ico { width: 20px; height: 20px; }
.vp-i-pause { display: none; } .vp-i-play { display: grid; }
.vp-stage.is-playing .vp-i-play { display: none; } .vp-stage.is-playing .vp-i-pause { display: grid; }

.vp-timeline { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.vp-times { display: flex; justify-content: space-between; font-size: 11px; line-height: 1.2; color: rgba(255,255,255,.8); }
.vp-track { position: relative; height: 20px; cursor: pointer; touch-action: none; outline-offset: 0; }
.vp-track::before, .vp-buf, .vp-fill { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; transition: scale .15s; }
.vp-track::before { background: rgba(255,255,255,.2); }
.vp-buf, .vp-fill { transform-origin: 100% 50%; transform: scaleX(0); }
.vp-buf { background: rgba(255,255,255,.3); }
.vp-fill { background: linear-gradient(270deg, var(--vp-acc), var(--vp-acc2)); }
.vp-track:hover::before, .vp-track:hover .vp-buf, .vp-track:hover .vp-fill, .vp-stage.is-scrub .vp-track::before, .vp-stage.is-scrub .vp-buf, .vp-stage.is-scrub .vp-fill { scale: 1 1.7; }
.vp-thumb { position: absolute; right: 0; top: 50%; width: 14px; height: 14px; margin-right: -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,138,61,.55), 0 2px 6px rgba(0,0,0,.5); transform: translate3d(0,-50%,0); transition: scale .15s; scale: .85; }
.vp-track:hover .vp-thumb, .vp-stage.is-scrub .vp-thumb, .vp-track:focus-visible .vp-thumb { scale: 1.2; }
.vp-tip { position: absolute; right: 0; bottom: 24px; width: 46px; margin-right: -23px; padding: 3px 0; text-align: center; border-radius: 7px; background: rgba(0,0,0,.85); color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .12s; }
.vp-track:hover .vp-tip, .vp-stage.is-scrub .vp-tip { opacity: 1; }

/* پنل‌های بلور (سرعت و تنظیمات): رسمی، ساده، بدون رنگ‌های شاد */
.vp-pop { position: absolute; z-index: 6; right: 10px; bottom: 72px; width: min(310px, calc(100% - 20px)); max-height: min(400px, 74vh); overflow: auto; overscroll-behavior: contain; padding: 4px; border-radius: 16px; color: #f2f5f7; background: rgba(14,19,26,.6); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); border: 1px solid rgba(255,255,255,.15); box-shadow: 0 20px 54px -18px rgba(0,0,0,.85); transform-origin: 100% 100%; animation: vp-pop .2s var(--ease); scrollbar-width: thin; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .vp-pop { background: rgba(14,19,26,.95); } }
@media (prefers-reduced-transparency: reduce) { .vp-pop { background: rgba(14,19,26,.96); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.vp-pop-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 9px; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.vp-pop-head strong { font-weight: 800; } .vp-pop-head > span { margin-inline-start: auto; color: var(--vp-acc2); font-weight: 800; }
.vp-back { display: grid; place-items: center; width: 30px; height: 30px; margin-inline-start: -4px; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; } .vp-back .ico { width: 17px; height: 17px; }
.vp-menu { list-style: none; margin: 0; padding: 4px 0 2px; }
.vp-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 13.5px; text-align: start; text-decoration: none; cursor: pointer; }
.vp-row:hover { background: rgba(255,255,255,.08); }
.vp-row .ico { width: 19px; height: 19px; flex: none; opacity: .88; }
.vp-row-t { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; } .vp-row-t small { color: rgba(255,255,255,.55); font-size: 11.5px; }
.vp-row-v { color: rgba(255,255,255,.64); font-size: 12.5px; }
.vp-check { position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.35); }
.vp-check::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--vp-on-acc); border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0; }
.vp-row.is-on .vp-check { background: var(--vp-acc); border-color: var(--vp-acc); } .vp-row.is-on .vp-check::after { opacity: 1; }
.vp-row.is-on .vp-row-t b { color: var(--vp-acc2); }
.vp-i-port { display: none; } .vp-stage.is-land .vp-i-land { display: none; } .vp-stage.is-land .vp-i-port { display: block; }
.vp-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px; }
.vp-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 48px; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; background: rgba(255,255,255,.05); color: #fff; font: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer; }
.vp-chip small { font-size: 10px; font-weight: 500; opacity: .7; }
.vp-chip:hover { background: rgba(255,255,255,.12); }
.vp-chip.is-on { background: var(--vp-acc); color: var(--vp-on-acc); border-color: transparent; }

/* سوالات متداول: آکاردئون با آیکون + چرخان */
.vp-faq { padding: 2px 6px 8px; } .vp-note { margin: 0; padding: 14px 8px; color: rgba(255,255,255,.7); font-size: 12.5px; }
.vp-faq-item { border-bottom: 1px solid rgba(255,255,255,.09); } .vp-faq-item:last-child { border-bottom: 0; }
.vp-faq-q { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 6px; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.8; text-align: start; cursor: pointer; }
.vp-faq-qt { flex: 1; min-width: 0; }
.vp-plus { position: relative; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.35); color: var(--vp-acc); transition: transform .38s var(--ease), background .2s, color .2s, border-color .2s; }
.vp-plus::before, .vp-plus::after { content: ''; position: absolute; left: 50%; top: 50%; border-radius: 2px; background: currentColor; transform: translate(-50%, -50%); }
.vp-plus::before { width: 10px; height: 2px; } .vp-plus::after { width: 2px; height: 10px; }
.vp-faq-item.is-open .vp-plus { transform: rotate(135deg); background: var(--vp-acc); color: var(--vp-on-acc); border-color: transparent; }
.vp-faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.vp-faq-item.is-open .vp-faq-a { grid-template-rows: 1fr; }
.vp-faq-ai { min-height: 0; overflow: hidden; padding: 0 6px; font-size: 12.5px; line-height: 2; color: rgba(255,255,255,.82); overflow-wrap: anywhere; }
.vp-faq-ai > :first-child { margin-top: 0; } .vp-faq-ai > :last-child { margin-bottom: 12px; } .vp-faq-ai p, .vp-faq-ai ul, .vp-faq-ai ol { margin: 0 0 8px; } .vp-faq-ai a { color: var(--vp-acc2); }

/* حالت‌های افقی: تمام‌صفحه‌ی واقعی یا چرخش CSS (برای مرورگرهایی که تمام‌صفحه را نمی‌دهند) */
.vp-stage:fullscreen, .vp-stage:-webkit-full-screen { width: 100%; height: 100%; background: #000; }
.vp-stage:fullscreen .vp-frame, .vp-stage:-webkit-full-screen .vp-frame, .vp-stage.is-pseudo .vp-frame { width: 100%; height: 100%; border-radius: 0; border: 0; box-shadow: none; }
.vp-stage:fullscreen .vp-video, .vp-stage:-webkit-full-screen .vp-video, .vp-stage.is-pseudo .vp-video { height: 100%; max-height: none; aspect-ratio: auto; }
.vp-stage:fullscreen .vp-pop, .vp-stage.is-pseudo .vp-pop { max-height: calc(100% - 96px); }
.vp-stage.is-pseudo { position: fixed; z-index: 2147483000; top: 0; left: 0; width: 100vh; height: 100vw; transform-origin: top left; transform: translateX(100vw) rotate(90deg); background: #000; }
@supports (width: 100dvh) { .vp-stage.is-pseudo { width: 100dvh; } }
.vp-stage.is-pseudo.is-flat { width: 100vw; height: 100vh; transform: none; }
@supports (height: 100dvh) { .vp-stage.is-pseudo.is-flat { height: 100dvh; } }
html.vp-lock, html.vp-lock body { overflow: hidden; }
.vp-ph { width: 100%; }
@media (max-width: 380px) { .vp-bar { left: 6px; right: 6px; bottom: 6px; gap: 2px; } .vp-btn { width: 36px; } .vp-speed { min-width: 42px; padding: 0 6px; } .vp-timeline { padding: 0 5px; } }
@media (prefers-reduced-motion: reduce) { .vp-stage *, .vp-stage *::before, .vp-stage *::after { animation: none !important; transition: none !important; } }
@keyframes vp-rot { to { transform: rotate(360deg); } }
@keyframes vp-ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes vp-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes vp-fx { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
@keyframes vp-fxbg { from { transform: scale(.7); } to { transform: scale(1.15); } }

/* ---------- نظرات هر قسمت ---------- */
.cm { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.cm-head { display: flex; align-items: center; gap: 10px; }
.cm-head h2 { flex: 1; margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--fs-lg); font-weight: 900; } .cm-head h2 .ico { width: 20px; height: 20px; color: var(--primary); }
.cm-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.cm-form textarea { width: 100%; min-height: 56px; max-height: 180px; padding: 8px 10px; resize: none; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: var(--fs-md); line-height: 1.9; outline: none; }
.cm-form textarea:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.cm-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .cm-form-foot small { color: var(--muted); }
.cm-form-foot.is-warn small { color: #c2410c; }
.cm-replying { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px; border-radius: 10px; background: var(--primary-soft); color: var(--on-soft); font-size: var(--fs-sm); } .cm-replying .ico { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 4px; }
.cm-list { display: flex; flex-direction: column; gap: 10px; }
.cm-item { display: flex; gap: 10px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.cm-item.is-flash { animation: vp-fx 1.2s ease-out; }
.cm-av { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--on-soft); font-weight: 900; }
.cm-av.is-admin { background: var(--primary); color: var(--on-primary); }
.cm-main { flex: 1; min-width: 0; }
.cm-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: var(--fs-sm); } .cm-meta strong { font-weight: 800; } .cm-meta small { color: var(--muted); }
.cm-text { margin: 4px 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.95; font-size: var(--fs-md); } .cm-text.is-deleted { color: var(--muted); font-style: italic; }
.cm-acts { display: flex; gap: 14px; } .cm-act { padding: 2px 0; border: 0; background: none; color: var(--primary); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; } .cm-act.is-danger { color: #c0392b; }
.cm-replies { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-inline-start: 10px; border-inline-start: 2px solid var(--line); }
.cm-replies .cm-item { padding: 8px 10px; background: var(--surface-2); border: 0; } .cm-replies .cm-av { width: 28px; height: 28px; font-size: var(--fs-sm); }
.cm-more { align-self: center; } .cm-empty { text-align: center; margin: 6px 0; }

/* ---------- محتوای عمومی صفحه‌ی اول (سئو): مراحل کار و سوالات متداول ---------- */
.how, .faq-pub { margin-top: 26px; }
.how h2, .faq-pub h2 { font-size: var(--fs-lg); font-weight: 900; margin: 0 0 12px; }
.how ol { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 10px; }
.how li { counter-increment: s; position: relative; padding: 14px 54px 14px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--muted); font-size: var(--fs-sm); line-height: 1.9; }
.how li::before { content: counter(s, persian); position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--on-soft); font-weight: 900; }
.how li b { color: var(--ink); }
.faq-pub details { margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.faq-pub summary { padding: 14px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.faq-pub summary::-webkit-details-marker { display: none; }
.faq-pub summary::after { content: '+'; float: left; color: var(--primary); font-weight: 900; }
.faq-pub details[open] summary::after { content: '−'; }
.faq-pub p { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.95; }

/* ---------- صفحه‌های محتوایی (راهنما / درباره) ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; color: var(--muted); font-size: var(--fs-sm); }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--ink); font-weight: 700; }
.guide-body { max-width: 46rem; }
.guide-body h1 { font-size: var(--fs-2xl); font-weight: 900; line-height: 1.5; margin: 0 0 10px; }
.guide-body .lead { color: var(--muted); font-size: var(--fs-lg); line-height: 2; margin: 0 0 8px; }
.guide-body section { margin-top: 26px; }
.guide-body h2 { font-size: var(--fs-xl); font-weight: 900; line-height: 1.6; margin: 0 0 8px; }
.guide-body h3 { font-size: var(--fs-lg); font-weight: 800; margin: 16px 0 4px; }
.guide-body p, .guide-body li { line-height: 2.05; color: var(--ink); }
.guide-body ul, .guide-body ol { padding-inline-start: 22px; margin: 8px 0; }
.guide-body .table-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.guide-body table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: var(--fs-sm); text-align: center; }
.guide-body th, .guide-body td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.guide-body th { background: var(--surface-2); font-weight: 800; }
.guide-body tr:last-child td { border-bottom: 0; }
.guide-cta { display: grid; gap: 8px; justify-items: start; margin-top: 30px; padding: 18px; border-radius: var(--r-lg); background: var(--primary-soft); color: var(--on-soft); }
.guide-cta span { font-size: var(--fs-sm); }
.related { margin-top: 26px; }
.related h2 { font-size: var(--fs-lg); font-weight: 900; margin: 0 0 8px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.related a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-weight: 700; }
.related a:hover { text-decoration: none; border-color: var(--primary); }
.brand-en { font-weight: 600; color: var(--muted); font-size: var(--fs-sm); letter-spacing: .02em; }
.home-guides { margin-top: 26px; }

/* ---------- پیشرفت تحصیلی: زبانه‌ها، نمودار تراز/رتبه، فهرست آزمون‌ها ---------- */
:root { --rank-c: #E0801A; }
.exam-chart-panel { padding: 14px 12px 12px; }
.exam-chart { display: block; width: 100%; height: auto; overflow: visible; }
.exam-chart .ch-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.exam-chart .ch-tick, .exam-chart .ch-xlabel { font-family: var(--font); font-size: 12px; fill: var(--muted); font-weight: 700; }
.exam-chart .ch-tick-r { fill: var(--rank-c); opacity: .9; }
.exam-chart .ch-line { stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.exam-chart .ch-line.ch-taraz { stroke: var(--primary); }
.exam-chart .ch-line.ch-rank { stroke: var(--rank-c); }
.exam-chart .ch-dot { stroke: var(--surface); stroke-width: 2; }
.exam-chart circle.ch-taraz { fill: var(--primary); }
.exam-chart circle.ch-rank { fill: var(--rank-c); }
.exam-chart text.ch-val { font-family: var(--font); font-size: 11.5px; font-weight: 800; }
.exam-chart text.ch-val.ch-taraz { fill: var(--primary); }
.exam-chart text.ch-val.ch-rank { fill: var(--rank-c); }
.exam-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 4px 8px; font-size: var(--fs-sm); font-weight: 800; color: var(--ink); }
.exam-legend span { display: inline-flex; align-items: center; gap: 6px; }
.exam-legend small { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); }
.exam-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 4px; }
.exam-legend .lg-taraz { background: var(--primary); }
.exam-legend .lg-rank { background: var(--rank-c); }
.exam-chart-note { margin: 8px 4px 0; }
.exam-next { margin-bottom: 12px; }
.exam-next-meta { display: block; margin-top: 2px; font-size: var(--fs-xs); opacity: .85; }
.exam-kpis .kpi .v { font-size: var(--fs-2xl); }
.exam-list { padding: 4px 12px; }
.exam-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.exam-row:last-child { border-bottom: 0; }
.exam-main { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.exam-main strong { font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-main small { color: var(--muted); font-size: var(--fs-xs); }
.exam-vals { display: flex; gap: 6px; font-weight: 800; font-size: var(--fs-sm); }
.exam-vals span { display: inline-flex; min-width: 52px; justify-content: center; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); }
.exam-actions { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.exam-actions form { margin: 0; }
.icon-btn.danger { color: var(--danger); }
.exam-empty { margin: 8px 0; }

/* ---------- درس‌ها و درصد هر درس در فرم آزمون ---------- */
.exam-subj-count { margin-top: 4px; }
.subj-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.subj-list:empty { display: none; }
.subj-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; }
.subj-row input { min-width: 0; }
.exam-subs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.exam-subs span { font-size: var(--fs-xs); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 700; }

/* ---------- تب‌های پیشرفت: بخش‌ها (درسی/تحصیلی) و بازه‌ی نمودار (ماهانه/هفتگی/سالانه) ---------- */
.seg-tabs {
  display: flex; gap: 4px; padding: 4px; margin: 0 0 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.seg-tabs a {
  flex: 1 1 0; min-width: 0; min-height: 42px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; color: var(--muted); font-size: var(--fs-sm); font-weight: 800;
  text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.seg-tabs a:hover { color: var(--ink); text-decoration: none; }
.seg-tabs a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.seg-tabs a.is-active {
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}
.seg-tabs--sm { margin-bottom: 12px; padding: 3px; }
.seg-tabs--sm a { min-height: 36px; padding: 0 8px; font-size: var(--fs-xs); }
@media (prefers-reduced-motion: reduce) { .seg-tabs a { transition: none; } }
