/*
 * تم میناب — روی Bootstrap 5 RTL.
 * رنگ اصلی مدرسه از پنل می‌آید و در قالب پایه روی :root گذاشته می‌شود (--mnb-accent).
 * فقط ویژگی‌های منطقی (inline-start/end) برای راست‌به‌چپ.
 */

:root {
  --mnb-accent: #2F5BD3;
  --mnb-accent-rgb: 47, 91, 211;
  --mnb-accent-soft: #E3E9F9;
  --mnb-accent-strong: #2447A4;
  --mnb-sun: #FFC83D;
  --mnb-sun-soft: #FFF1C7;
  --mnb-sun-ink: #5A3D00;

  --mnb-ground: #F2F5FA;
  --mnb-surface: #FFFFFF;
  --mnb-surface-2: #F5F7FB;
  --mnb-border: #E3E8F0;
  --mnb-ink: #1C2333;
  --mnb-ink-2: #3A4356;
  --mnb-muted: #5B6475;

  --mnb-danger: #D7263D;
  --mnb-danger-ink: #B4232A;
  --mnb-danger-soft: #FDE7E8;
  --mnb-success: #12A150;
  --mnb-success-ink: #0F7441;
  --mnb-success-soft: #E2F6EA;
  --mnb-warn-soft: #FFF4D6;
  --mnb-warn-ink: #5E4200;

  --mnb-radius-sm: 12px;
  --mnb-radius: 20px;
  --mnb-radius-lg: 28px;
  --mnb-shadow: 0 1px 2px rgba(28, 35, 51, .06);
  --mnb-shadow-pop: 0 14px 30px -10px rgba(28, 35, 51, .35);
  --mnb-tap: 52px;

  --bs-body-font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --bs-body-bg: var(--mnb-ground);
  --bs-body-color: var(--mnb-ink);
  --bs-secondary-color: var(--mnb-muted);
  --bs-border-color: var(--mnb-border);
  --bs-primary: var(--mnb-accent);
  --bs-primary-rgb: var(--mnb-accent-rgb);
  --bs-link-color: var(--mnb-accent);
  --bs-link-color-rgb: var(--mnb-accent-rgb);
  --bs-link-hover-color: var(--mnb-accent-strong);
  --bs-border-radius: 14px;
  --bs-border-radius-sm: 10px;
  --bs-border-radius-lg: 20px;
  --bs-border-radius-xl: 28px;
  --bs-focus-ring-color: rgba(var(--mnb-accent-rgb), .3);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--bs-body-font-family);
  background: var(--mnb-ground);
  color: var(--mnb-ink);
  line-height: 1.75;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
code, kbd, samp, pre, .font-mono { font-family: ui-monospace, 'DejaVu Sans Mono', Consolas, monospace; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
h1, h2, h3, h4, h5, h6 { font-weight: 800; line-height: 1.4; }
:focus-visible { outline: 3px solid rgba(var(--mnb-accent-rgb), .55); outline-offset: 2px; }

/* ---------------------------------------------------------------- آیکن */
.mnb-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mnb-flip { transform: scaleX(-1); }

/* ---------------------------------------------------------------- کارت و سطح */
.mnb-card {
  background: var(--mnb-surface);
  border: 1px solid var(--mnb-border);
  border-radius: var(--mnb-radius);
  box-shadow: var(--mnb-shadow);
  padding: 16px;
}
.mnb-card-lg { border-radius: var(--mnb-radius-lg); padding: 20px; }
.mnb-hero {
  position: relative;
  overflow: hidden;
  background: var(--mnb-accent);
  color: #fff;
  border-radius: var(--mnb-radius-lg);
  padding: 20px;
  box-shadow: 0 10px 24px -12px var(--mnb-accent);
}
.mnb-hero::before, .mnb-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  pointer-events: none;
}
.mnb-hero::before { width: 180px; height: 180px; top: -70px; inset-inline-end: -50px; }
.mnb-hero::after { width: 90px; height: 90px; bottom: -30px; inset-inline-end: 70px; }
.mnb-hero > * { position: relative; }

.mnb-section-title { font-size: 1.06rem; font-weight: 800; margin: 0; }

/* ---------------------------------------------------------------- دکمه‌ها (بزرگ و واضح برای کودکان) */
.btn { font-weight: 700; border-radius: 16px; }
.btn-primary {
  --bs-btn-bg: var(--mnb-accent);
  --bs-btn-border-color: var(--mnb-accent);
  --bs-btn-hover-bg: var(--mnb-accent-strong);
  --bs-btn-hover-border-color: var(--mnb-accent-strong);
  --bs-btn-active-bg: var(--mnb-accent-strong);
  --bs-btn-active-border-color: var(--mnb-accent-strong);
  --bs-btn-disabled-bg: var(--mnb-accent);
  --bs-btn-disabled-border-color: var(--mnb-accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--mnb-accent);
  --bs-btn-border-color: var(--mnb-accent);
  --bs-btn-hover-bg: var(--mnb-accent);
  --bs-btn-hover-border-color: var(--mnb-accent);
  --bs-btn-active-bg: var(--mnb-accent-strong);
}
.btn-mnb {
  min-height: var(--mnb-tap);
  padding: 10px 20px;
  border-radius: 18px;
  font-size: 1.05rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .12s ease, background-color .2s ease;
}
.btn-mnb:active { transform: scale(.97); }
.btn-mnb-lg { min-height: 60px; font-size: 1.15rem; border-radius: 20px; }
.btn-white { background: #fff; color: var(--mnb-accent); border: 0; }
.btn-white:hover { background: #fff; color: var(--mnb-accent-strong); }
.btn-soft { background: var(--mnb-accent-soft); color: var(--mnb-accent); border: 0; }
.btn-soft:hover { background: var(--mnb-accent-soft); color: var(--mnb-accent-strong); }
.btn-sun { background: var(--mnb-sun); color: var(--mnb-sun-ink); border: 0; }
.btn-sun:hover { background: var(--mnb-sun); color: var(--mnb-sun-ink); filter: brightness(.97); }
.btn-danger { --bs-btn-bg: var(--mnb-danger); --bs-btn-border-color: var(--mnb-danger); }

.mnb-icon-btn {
  width: var(--mnb-tap);
  height: var(--mnb-tap);
  border-radius: 18px;
  border: 1px solid var(--mnb-border);
  background: var(--mnb-surface);
  color: var(--mnb-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

/* دکمهٔ بزرگ کنترل کلاس با برچسب زیرش */
.mnb-ctrl { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 64px; }
.mnb-ctrl > button, .mnb-ctrl > a {
  width: 62px; height: 62px; border-radius: 22px; border: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--mnb-surface-2); color: var(--mnb-ink-2);
  transition: background-color .2s ease, transform .12s ease;
}
.mnb-ctrl > button:active, .mnb-ctrl > a:active { transform: scale(.95); }
.mnb-ctrl > span { font-size: .78rem; font-weight: 700; color: var(--mnb-muted); }
.mnb-ctrl.is-on > button { background: var(--mnb-accent-soft); color: var(--mnb-accent); }
.mnb-ctrl.is-on > span { color: var(--mnb-accent); }
.mnb-ctrl.is-sun > button { background: var(--mnb-sun); color: var(--mnb-sun-ink); }
.mnb-ctrl.is-danger > button, .mnb-ctrl.is-danger > a { background: var(--mnb-danger); color: #fff; }
.mnb-ctrl.is-danger > span { color: var(--mnb-danger-ink); }

/* ---------------------------------------------------------------- نشان، چیپ، کاشی */
.mnb-badge {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--mnb-danger);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  border: 2px solid var(--mnb-surface);
  box-sizing: content-box;
}
.mnb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  background: var(--mnb-accent-soft);
  color: var(--mnb-accent);
}
.mnb-chip-success { background: var(--mnb-success-soft); color: var(--mnb-success-ink); }
.mnb-chip-danger { background: var(--mnb-danger-soft); color: var(--mnb-danger-ink); }
.mnb-chip-muted { background: #E8EDF5; color: var(--mnb-muted); }
.mnb-chip-sun { background: var(--mnb-sun-soft); color: var(--mnb-sun-ink); }

.mnb-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #E5484D; display: inline-block; animation: mnb-pulse 1.8s ease-out infinite; }

.mnb-tile {
  width: 46px; height: 46px; border-radius: 16px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.mnb-tile-lg { width: 60px; height: 60px; border-radius: 20px; }

/* رنگ‌های درس‌ها (هر درس یکی از این‌ها را می‌گیرد) — همه با کنتراست کافی */
.tone-blue   { background: #E3ECFF; color: #2447A8; }
.tone-green  { background: #DDF5E8; color: #17663F; }
.tone-orange { background: #FFEBD6; color: #9A4A0B; }
.tone-pink   { background: #FDE3EE; color: #A32A61; }
.tone-teal   { background: #DDF3F3; color: #0F6466; }
.tone-purple { background: #ECE6FF; color: #5534A8; }
.tone-sun    { background: #FFF1C7; color: #5A3D00; }
.tone-slate  { background: #E8EDF5; color: #3A4356; }

.mnb-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; overflow: hidden;
}
.mnb-avatar img, .mnb-avatar svg { width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------------- فهرست */
.mnb-list { display: flex; flex-direction: column; }
.mnb-list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EEF1F6; }
.mnb-list-row:last-child { border-bottom: 0; }
.mnb-list-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mnb-list-row .title { font-weight: 700; }
.mnb-list-row .sub { font-size: .82rem; color: var(--mnb-muted); }

/* ---------------------------------------------------------------- چیدمان صفحه */
.mnb-page { max-width: 1200px; margin-inline: auto; padding: 16px; }
.mnb-page-narrow { max-width: 480px; }
.mnb-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 10px; }
.mnb-bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--mnb-surface);
  border-top: 1px solid var(--mnb-border);
  display: flex;
  justify-content: space-around;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
}
.mnb-bottom-nav a {
  text-decoration: none; color: var(--mnb-muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 64px; font-size: .75rem; font-weight: 600;
}
.mnb-bottom-nav a .pill { width: 56px; height: 34px; border-radius: 17px; display: flex; align-items: center; justify-content: center; }
.mnb-bottom-nav a[aria-current="page"] { color: var(--mnb-accent); font-weight: 800; }
.mnb-bottom-nav a[aria-current="page"] .pill { background: var(--mnb-accent-soft); }

/* ---------------------------------------------------------------- فرم */
.form-control, .form-select { min-height: 48px; border-radius: 14px; border-color: var(--mnb-border); background-color: var(--mnb-surface-2); }
.form-control:focus, .form-select:focus { border-color: var(--mnb-accent); box-shadow: 0 0 0 .2rem rgba(var(--mnb-accent-rgb), .2); background-color: #fff; }
.form-label { font-weight: 700; font-size: .92rem; }
input[inputmode="numeric"], input[type="tel"], .ltr-input { direction: ltr; text-align: end; }
.ts-wrapper .ts-control { min-height: 48px; border-radius: 14px; background: var(--mnb-surface-2); }
.ts-dropdown { border-radius: 14px; overflow: hidden; }
.ts-dropdown .create { color: var(--mnb-accent); }

/* ---------------------------------------------------------------- پیام‌ها و اعلان */
.mnb-toasts { position: fixed; inset-inline: 12px; top: 12px; z-index: 1080; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.mnb-toast {
  pointer-events: auto; max-width: 440px; width: 100%;
  background: var(--mnb-ink); color: #fff; border-radius: 18px; padding: 12px 16px;
  display: flex; gap: 10px; align-items: center; box-shadow: var(--mnb-shadow-pop);
  animation: mnb-pop .25s ease-out;
}
.mnb-toast.is-success { background: var(--mnb-success-ink); }
.mnb-toast.is-error { background: var(--mnb-danger-ink); }
.mnb-banner { border-radius: 18px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
.mnb-banner-warn { background: var(--mnb-warn-soft); color: var(--mnb-warn-ink); }

/* ---------------------------------------------------------------- خالی و خطا */
.mnb-empty { text-align: center; padding: 32px 16px; color: var(--mnb-muted); }
.mnb-empty .mnb-icon { color: var(--mnb-accent); opacity: .8; }

/* ---------------------------------------------------------------- انیمیشن‌های سبک */
@keyframes mnb-pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 70% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
@keyframes mnb-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes mnb-pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mnb-spin { to { transform: rotate(-360deg); } }
@keyframes mnb-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(10deg); } }
.mnb-bob { animation: mnb-bob 3.2s ease-in-out infinite; }
.mnb-spin { animation: mnb-spin 1.2s linear infinite; }
.mnb-wave { animation: mnb-wave 1s ease-in-out infinite; transform-origin: 50% 90%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- کمکی */
.text-muted-2 { color: var(--mnb-muted) !important; }
.fw-800 { font-weight: 800 !important; }
.min-w-0 { min-width: 0; }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; }
.skip-link { position: absolute; inset-inline-start: 12px; top: 12px; z-index: 2000; background: #fff; padding: 8px 14px; border-radius: 12px; }

/* ================================================================ پوستهٔ برنامه */
.mnb-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.mnb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mnb-content { flex: 1; width: 100%; max-width: 1200px; margin-inline: auto; padding: 16px 16px 24px; }
.mnb-stack { display: flex; flex-direction: column; gap: 16px; }
.mnb-narrow { max-width: 560px; margin-inline: auto; width: 100%; }
.mnb-sidenav { display: none; }
@media (min-width: 992px) {
  .mnb-sidenav {
    display: flex; flex-direction: column; gap: 4px; width: 248px; flex-shrink: 0;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--mnb-surface); border-inline-end: 1px solid var(--mnb-border); padding: 20px 14px;
  }
  .mnb-bottom-nav { display: none !important; }
  .mnb-content { padding: 28px 28px 40px; }
}
.mnb-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px; color: var(--mnb-ink); text-decoration: none; }
.mnb-brand img { border-radius: 14px; object-fit: contain; }
.mnb-brand-mark { width: 44px; height: 44px; border-radius: 15px; background: var(--mnb-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mnb-brand strong, .mnb-sidenav-user strong { display: block; font-size: .95rem; line-height: 1.5; }
.mnb-brand small, .mnb-sidenav-user small { display: block; font-size: .78rem; color: var(--mnb-muted); }
.mnb-sidenav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 16px; color: var(--mnb-ink-2); font-weight: 600; text-decoration: none; }
.mnb-sidenav-link:hover { background: var(--mnb-surface-2); color: var(--mnb-ink); }
.mnb-sidenav-link[aria-current="page"] { background: var(--mnb-accent-soft); color: var(--mnb-accent); font-weight: 800; }
.mnb-sidenav-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 18px; background: var(--mnb-surface-2); }
.mnb-avatar-img { border-radius: 50%; flex-shrink: 0; display: block; }

.mnb-greeting { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mnb-chip-onhero { background: #fff; color: var(--mnb-accent); }
.mnb-chip-onhero.is-live { color: var(--mnb-danger-ink); }
a.mnb-list-row { color: inherit; text-decoration: none; }
.mnb-tile-onhero { background: rgba(255, 255, 255, .18); color: #fff; }
.mnb-hero-actions { min-width: 220px; }
@media (max-width: 575.98px) { .mnb-hero-actions { width: 100%; } }

.mnb-slot-row { color: inherit; text-decoration: none; }
.mnb-slot-row.is-done { opacity: .6; }
.mnb-slot-row.is-now .title { color: var(--mnb-danger-ink); }

.mnb-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mnb-course-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px;
  background: var(--mnb-surface); border: 1px solid var(--mnb-border); border-radius: 22px;
  color: var(--mnb-ink); text-decoration: none; font-weight: 700; font-size: .9rem; text-align: center;
}
.mnb-columns { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.mnb-course-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.mnb-course-card { display: flex; align-items: center; gap: 14px; color: var(--mnb-ink); text-decoration: none; }
.mnb-course-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mnb-course-actions { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mnb-action-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--mnb-ink); text-decoration: none; }
.mnb-action-card[aria-disabled="true"] { opacity: .65; pointer-events: none; }

/* هفته */
.mnb-week { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.mnb-day { background: var(--mnb-surface); border: 1px solid var(--mnb-border); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.mnb-day.is-today { border-color: var(--mnb-accent); box-shadow: 0 0 0 3px rgba(var(--mnb-accent-rgb), .15); }
.mnb-day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 4px; }
.mnb-day-head span { font-size: .8rem; color: var(--mnb-muted); }
.mnb-day-slot { display: flex; flex-direction: column; border-radius: 12px; padding: 6px 10px; font-size: .82rem; text-decoration: none; }
.mnb-day-slot strong { font-size: .9rem; }
.mnb-day-empty, .mnb-day-holiday { font-size: .82rem; color: var(--mnb-muted); padding: 6px 4px; }
.mnb-day-holiday { color: var(--mnb-success-ink); display: flex; gap: 6px; align-items: center; }

/* ورود */
.mnb-auth-wrap { max-width: 420px; margin: 0 auto; padding-top: 6vh; }
.mnb-auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; text-align: center; }
.mnb-auth-brand img { border-radius: 20px; object-fit: contain; }
.mnb-auth-or { display: flex; align-items: center; gap: 10px; color: var(--mnb-muted); margin: 18px 0 12px; font-size: .85rem; }
.mnb-auth-or::before, .mnb-auth-or::after { content: ""; flex: 1; height: 1px; background: var(--mnb-border); }
.mnb-password { position: relative; }
.mnb-password .form-control { padding-inline-start: 48px; }
.mnb-password-toggle { position: absolute; inset-inline-start: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--mnb-muted); }
.mnb-password-toggle.is-on { color: var(--mnb-accent); }
.mnb-person-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--mnb-border); border-radius: 18px; background: var(--mnb-surface); text-align: start; }
.mnb-person-btn:hover { border-color: var(--mnb-accent); }
.mnb-person-btn strong, .mnb-person-btn small { display: block; }
.mnb-person-btn small { color: var(--mnb-muted); }
.mnb-qr-dialog { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: var(--mnb-radius-lg); padding: 18px; box-shadow: var(--mnb-shadow-pop); }
.mnb-qr-dialog::backdrop { background: rgba(28, 35, 51, .55); }
.mnb-qr-video { position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #1E2638; margin: 10px 0; }
.mnb-qr-video video { width: 100%; height: 100%; object-fit: cover; }
.mnb-qr-frame { position: absolute; inset: 18%; border: 4px solid var(--mnb-sun); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); }

/* آواتار */
.mnb-avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.mnb-avatar-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 18px; border: 2px solid transparent; cursor: pointer; font-size: .8rem; font-weight: 600; }
.mnb-avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.mnb-avatar-option:has(input:checked) { border-color: var(--mnb-accent); background: var(--mnb-accent-soft); }
.mnb-avatar-option:has(input:focus-visible) { outline: 3px solid rgba(var(--mnb-accent-rgb), .55); }

/* ================================================================ اتصال و اعلان */
.mnb-connection {
  position: fixed; z-index: 1090; inset-inline: 12px; top: 12px; margin-inline: auto; max-width: 460px;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px;
  background: var(--mnb-warn-soft); color: var(--mnb-warn-ink); font-weight: 700; box-shadow: var(--mnb-shadow-pop);
  animation: mnb-pop .25s ease-out;
}
.mnb-connection[hidden] { display: none; }
.mnb-connection[data-mode="back"] { background: var(--mnb-success-soft); color: var(--mnb-success-ink); }
.mnb-connection[data-mode="back"] .mnb-icon { display: none; }
.mnb-toast.is-notify { flex-direction: column; align-items: flex-start; gap: 2px; color: #fff; text-decoration: none; background: var(--mnb-accent-strong); }
.mnb-toast.is-notify span { font-size: .88rem; opacity: .92; }
.mnb-nav-badge { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--mnb-danger); color: #fff; font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.mnb-nav-badge[hidden], .mnb-badge[hidden] { display: none; }
.mnb-list-row.is-unread .title { color: var(--mnb-accent); }

/* ================================================================ صفحهٔ درس: کارت کلاس زنده */
.mnb-live-card[data-state="on"] [data-live-off-only], .mnb-live-card[data-state="off"] [data-live-on-only] { display: none !important; }
.mnb-live-card[data-state="on"] { border-color: var(--mnb-danger); box-shadow: 0 0 0 3px var(--mnb-danger-soft); }
.mnb-live-card.is-new { animation: mnb-pop .3s ease-out; }
.mnb-live-wait { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 16px; background: var(--mnb-surface-2); color: var(--mnb-muted); font-weight: 700; }

/* حضور و غیاب */
.mnb-att-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mnb-att-summary .mnb-card { padding: 10px 6px; display: flex; flex-direction: column; align-items: center; }
.mnb-att-summary strong { font-size: 1.4rem; line-height: 1.3; }
.mnb-att-summary span { font-size: .8rem; color: var(--mnb-muted); }
.mnb-att-row { align-items: flex-start; }
.mnb-att-select { width: auto; min-width: 96px; flex-shrink: 0; }

/* ================================================================ کلاس زنده */
.lv-page { background: #0F1522; color: #fff; overflow: hidden; }
.lv-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.lv-top {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: #151C2C;
}
.lv-icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none;
}
.lv-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.lv-title { flex: 1; min-width: 0; line-height: 1.45; }
.lv-title > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-title small { color: rgba(255, 255, 255, .7); }
.lv-live { color: #FF9EA2; font-size: .8rem; font-weight: 700; }
.lv-chips { display: flex; align-items: center; gap: 6px; }
.lv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.lv-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.lv-bars i { width: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.lv-bars i:nth-child(1) { height: 5px; } .lv-bars i:nth-child(2) { height: 9px; } .lv-bars i:nth-child(3) { height: 13px; }
.lv-chip[data-quality="good"] .lv-bars i { background: #3DD68C; }
.lv-chip[data-quality="poor"] .lv-bars i:nth-child(-n+2) { background: var(--mnb-sun); }
.lv-chip[data-quality="lost"] .lv-bars i:nth-child(1) { background: #FF6B70; }
.lv-end { min-height: 44px; padding: 6px 14px; border-radius: 14px; font-size: .95rem; }
@media (max-width: 420px) { .lv-chip [data-quality-text] { display: none; } .lv-top { gap: 8px; padding-inline: 8px; } }

.lv-banner {
  position: fixed; z-index: 45; top: calc(68px + env(safe-area-inset-top)); inset-inline: 12px; margin-inline: auto; max-width: 480px;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px;
  background: var(--mnb-warn-soft); color: var(--mnb-warn-ink); font-weight: 700; box-shadow: var(--mnb-shadow-pop); animation: mnb-pop .25s ease-out;
}
.lv-banner[hidden] { display: none; }
.lv-banner > span { flex: 1; }
.lv-banner[data-mode="ok"] { background: var(--mnb-success-soft); color: var(--mnb-success-ink); }
.lv-banner.is-static > .mnb-icon { display: none; }

.lv-body { flex: 1; min-height: 0; display: flex; }
.lv-stage { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.lv-main {
  flex: 1; min-height: 0; position: relative; overflow: hidden; border-radius: 20px;
  background: #1B2335; display: flex; align-items: center; justify-content: center;
}
.lv-main.is-eco { background: #12352A; }
.lv-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; text-align: center; color: rgba(255, 255, 255, .78); font-weight: 700; }
.lv-placeholder[hidden] { display: none; }
.lv-placeholder p { margin: 0; }
.lv-tile { position: relative; overflow: hidden; border-radius: 14px; background: #000; cursor: pointer; }
.lv-tile video { display: block; width: 100%; height: 100%; object-fit: cover; }
.lv-main .lv-tile { position: absolute; inset: 0; border-radius: 0; background: #0B0F18; display: flex; align-items: center; justify-content: center; }
.lv-main .lv-tile video, .lv-tile video.is-contain { object-fit: contain; }
.is-mirror { transform: scaleX(-1); }
.lv-tile-label { position: absolute; bottom: 6px; inset-inline-start: 6px; max-width: calc(100% - 12px); padding: 1px 9px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-thumbs { display: flex; gap: 8px; flex-shrink: 0; overflow-x: auto; scrollbar-width: none; }
.lv-thumbs[hidden] { display: none; }
.lv-thumbs .lv-tile { width: 132px; aspect-ratio: 16 / 9; flex-shrink: 0; }
.lv-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 16px; background: rgba(255, 255, 255, .08); font-size: .88rem; }
.lv-offer[hidden] { display: none; }
.lv-offer > span { flex: 1; min-width: 140px; }
.lv-eco { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 8px 12px; border-radius: 18px; background: #1B2335; }
.lv-eco .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.lv-eco small { color: rgba(255, 255, 255, .72); }
.lv-switch { position: relative; width: 56px; height: 32px; flex-shrink: 0; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .25); transition: background-color .2s ease; }
.lv-switch span { position: absolute; top: 4px; inset-inline-start: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s ease; }
.lv-switch[aria-checked="true"] { background: var(--mnb-success); }
.lv-switch[aria-checked="true"] span { inset-inline-start: 28px; }

/* پنل کناری: در گوشی برگهٔ پایین‌رونده، در رایانه ستون کنار صحنه */
.lv-side {
  position: fixed; z-index: 40; inset-inline: 0; bottom: 0; height: 78vh; height: 78dvh;
  display: flex; flex-direction: column; background: var(--mnb-surface); color: var(--mnb-ink);
  border-radius: 24px 24px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .35);
  transform: translateY(105%); visibility: hidden; transition: transform .25s ease, visibility .25s;
}
.lv-side.is-open { transform: none; visibility: visible; }
@media (min-width: 992px) {
  .lv-side { position: static; width: 360px; height: auto; flex-shrink: 0; border-radius: 0; box-shadow: none; transform: none; visibility: visible; transition: none; }
  .lv-side-close { display: none !important; }
}
.lv-tabs { display: flex; align-items: center; gap: 6px; padding: 10px; border-bottom: 1px solid var(--mnb-border); }
.lv-tab { flex: 1; min-height: 44px; border: 0; border-radius: 14px; background: transparent; color: var(--mnb-muted); font-weight: 800; font-size: .92rem; }
.lv-tab[aria-selected="true"] { background: var(--mnb-accent-soft); color: var(--mnb-accent); }
.lv-side .lv-icon-btn { background: var(--mnb-surface-2); color: var(--mnb-ink); }
.lv-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px; overflow-y: auto; }
.lv-panel[hidden] { display: none; }
.lv-panel[data-panel="chat"] { padding: 0; gap: 0; }
.lv-panel h3, .lv-h { margin: 6px 0 0; font-size: .85rem; font-weight: 800; color: var(--mnb-muted); }
.lv-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-tools .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.lv-hands { padding: 10px 12px; border-radius: 18px; background: var(--mnb-sun-soft); }
.lv-hands[hidden] { display: none; }
.lv-hands h3 { color: var(--mnb-sun-ink); margin: 0 0 4px; }
.lv-hand, .lv-person { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.lv-hand .grow, .lv-person .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; font-weight: 700; }
.lv-hand small { color: var(--mnb-muted); font-weight: 400; }
.lv-act { width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--mnb-accent); color: #fff; }
.lv-act.is-muted { background: var(--mnb-surface-2); color: var(--mnb-ink-2); }
.lv-act.is-on { background: var(--mnb-danger-soft); color: var(--mnb-danger-ink); }
.lv-person-avatar { position: relative; flex-shrink: 0; }
.lv-net { position: absolute; bottom: -1px; inset-inline-end: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: #B8C0CC; }
.lv-net.is-good { background: var(--mnb-success); }
.lv-net.is-poor { background: var(--mnb-sun); }
.lv-net.is-lost { background: var(--mnb-danger); }
.lv-person.is-speaking .mnb-avatar-img { box-shadow: 0 0 0 3px var(--mnb-success); }
.lv-absent, .lv-empty { margin: 0; font-size: .86rem; color: var(--mnb-muted); }
.lv-chat { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.lv-msg { align-self: flex-start; max-width: 88%; padding: 6px 12px; border-radius: 16px; background: var(--mnb-surface-2); }
.lv-msg.is-me { align-self: flex-end; background: var(--mnb-accent-soft); }
.lv-msg.is-teacher { background: var(--mnb-sun-soft); }
.lv-msg-head { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.lv-msg-head time { color: var(--mnb-muted); }
.lv-msg p { margin: 0; overflow-wrap: anywhere; }
.lv-msg p.is-deleted { color: var(--mnb-muted); font-style: italic; }
.lv-role { padding: 0 6px; border-radius: 999px; background: var(--mnb-sun); color: var(--mnb-sun-ink); font-size: .7rem; font-weight: 800; }
.lv-msg-del { margin-inline-start: auto; padding: 2px; border: 0; border-radius: 8px; background: transparent; color: var(--mnb-muted); }
.lv-chat-locked { display: flex; align-items: center; gap: 6px; margin: 0 12px 8px; padding: 8px 12px; border-radius: 14px; background: var(--mnb-warn-soft); color: var(--mnb-warn-ink); font-size: .86rem; font-weight: 700; }
.lv-chat-locked[hidden] { display: none; }
.lv-chat-form { display: flex; gap: 8px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--mnb-border); }
.lv-send { width: 48px; height: 48px; flex-shrink: 0; border: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--mnb-accent); color: #fff; }

/* دکمه‌های پایین کلاس روی زمینهٔ تیره */
.lv-controls {
  display: flex; justify-content: safe center; gap: 4px; flex-shrink: 0; overflow-x: auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #151C2C;
}
.lv-controls .mnb-ctrl > button, .lv-split > button:first-child, .pc-controls .mnb-ctrl > button {
  position: relative; width: 62px; height: 62px; border: 0; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .1); color: #fff; transition: background-color .2s ease, transform .12s ease;
}
.lv-controls .mnb-ctrl > span, .pc-controls .mnb-ctrl > span { color: rgba(255, 255, 255, .75); white-space: nowrap; }
.lv-controls .mnb-ctrl.is-on > button, .lv-controls .mnb-ctrl.is-on .lv-split > button:first-child { background: #fff; color: var(--mnb-accent); }
.lv-controls .mnb-ctrl.is-on > span { color: #fff; }
.lv-controls .mnb-ctrl.is-sun > button, .pc-controls .mnb-ctrl.is-sun > button, .lv-controls .lv-chat-ctrl.has-hands > button { background: var(--mnb-sun); color: var(--mnb-sun-ink); }
.lv-controls .mnb-ctrl.is-danger > button, .pc-controls .mnb-ctrl.is-danger > button { background: var(--mnb-danger); color: #fff; }
.lv-controls .mnb-ctrl.is-invite > button { background: var(--mnb-sun); color: var(--mnb-sun-ink); animation: lv-invite 1.4s ease-out infinite; }
.lv-controls .mnb-ctrl.is-locked > button, .lv-controls .mnb-ctrl.is-locked .lv-split > button:first-child { color: rgba(255, 255, 255, .55); }
.lv-controls .mnb-badge { border-color: #151C2C; }
.lv-split { display: flex; align-items: stretch; }
.lv-split > button:first-child { border-start-end-radius: 8px; border-end-end-radius: 8px; }
.lv-split-more {
  width: 26px; margin-inline-start: 2px; border: 0; background: rgba(255, 255, 255, .1); color: #fff;
  border-start-start-radius: 8px; border-end-start-radius: 8px; border-start-end-radius: 22px; border-end-end-radius: 22px;
}
.lv-lock { position: absolute; top: 4px; inset-inline-end: 4px; width: 20px; height: 20px; border-radius: 50%; display: none; align-items: center; justify-content: center; background: var(--mnb-sun); color: var(--mnb-sun-ink); }
.is-locked .lv-lock { display: flex; }
@keyframes lv-invite { 0% { box-shadow: 0 0 0 0 rgba(255, 200, 61, .7); } 70% { box-shadow: 0 0 0 12px rgba(255, 200, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 200, 61, 0); } }
@media (max-width: 420px) {
  .lv-controls { gap: 2px; padding-inline: 4px; }
  .lv-controls .mnb-ctrl { min-width: 54px; }
  .lv-controls .mnb-ctrl > button, .lv-split > button:first-child { width: 52px; height: 52px; border-radius: 18px; }
  .lv-split-more { width: 22px; }
  .lv-controls .mnb-ctrl > span { font-size: .7rem; }
}
@media (min-width: 992px) { .lv-controls { gap: 10px; } }

.lv-hint {
  position: fixed; z-index: 55; bottom: calc(112px + env(safe-area-inset-bottom)); inset-inline: 12px; margin-inline: auto; max-width: 440px;
  padding: 12px 16px; border-radius: 18px; background: var(--mnb-ink); color: #fff; text-align: center; font-weight: 700;
  box-shadow: var(--mnb-shadow-pop); animation: mnb-pop .25s ease-out; pointer-events: none;
}
.lv-hint[hidden] { display: none; }

.lv-overlay { position: fixed; z-index: 60; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; background: rgba(15, 21, 34, .94); }
.lv-overlay[hidden] { display: none; }
.lv-card { width: min(460px, 100%); margin: auto; padding: 20px; border-radius: 28px; background: #fff; color: var(--mnb-ink); box-shadow: var(--mnb-shadow-pop); }
.lv-preview { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 18px; background: #1B2335; display: flex; align-items: center; justify-content: center; }
.lv-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.lv-preview-empty { position: relative; color: rgba(255, 255, 255, .65); font-weight: 700; }
.lv-preview-empty[hidden] { display: none; }
.lv-check { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 16px; background: var(--mnb-success-soft); color: var(--mnb-success-ink); font-weight: 700; cursor: pointer; }
.lv-check input { width: 22px; height: 22px; margin-top: 3px; flex-shrink: 0; accent-color: var(--mnb-success); }
.lv-dialog { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 24px; padding: 18px; color: var(--mnb-ink); box-shadow: var(--mnb-shadow-pop); }
.lv-dialog::backdrop { background: rgba(15, 21, 34, .6); }
.lv-radio-list { display: flex; flex-direction: column; gap: 6px; }
.lv-radio { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--mnb-border); border-radius: 14px; cursor: pointer; }
.lv-radio:has(input:checked) { border-color: var(--mnb-accent); background: var(--mnb-accent-soft); }
.lv-radio input { accent-color: var(--mnb-accent); width: 18px; height: 18px; flex-shrink: 0; }
.lv-qr svg { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 10px; }
.lv-audio { display: none; }
.lv-dialog-wide { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); }
.lv-icon-btn-light { background: var(--mnb-surface-2); color: var(--mnb-ink); }
.lv-icon-btn-light:hover { background: var(--mnb-border); color: var(--mnb-ink); }

/* اسلاید همگام */
.lv-slide-tile { background: #0B0F18; }
.lv-slide-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lv-main .lv-slide-tile .lv-slide-img { background: transparent; }
.lv-slide-tile .lv-tile-label { top: 6px; bottom: auto; }
.lv-slide-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .8); pointer-events: none; }
.lv-slide-loading[hidden] { display: none; }
.lv-slide-nav {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 20px;
  background: rgba(15, 21, 34, .78); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.lv-slide-nav button { width: 46px; height: 46px; border: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .12); color: #fff; }
.lv-slide-nav button:hover { background: rgba(255, 255, 255, .22); }
.lv-slide-page { min-width: 64px; text-align: center; font-weight: 800; font-size: .95rem; white-space: nowrap; }
.lv-thumbs .lv-slide-nav { display: none; }
.lv-decks { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.lv-deck { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 1px solid var(--mnb-border); border-radius: 16px; background: var(--mnb-surface); text-align: start; }
.lv-deck:hover:not(:disabled) { border-color: var(--mnb-accent); }
.lv-deck.is-active { border-color: var(--mnb-accent); background: var(--mnb-accent-soft); }
.lv-deck:disabled { opacity: .7; cursor: default; }
.lv-deck .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.lv-deck small { color: var(--mnb-muted); }
.lv-deck-thumb, .mnb-slide-thumb {
  width: 72px; height: 48px; flex-shrink: 0; overflow: hidden; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--mnb-surface-2); color: var(--mnb-muted);
}
.lv-deck-thumb img, .mnb-slide-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lv-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 65vh; overflow-y: auto; }
.lv-page-thumb { position: relative; padding: 0; border: 2px solid var(--mnb-border); border-radius: 12px; overflow: hidden; background: var(--mnb-surface-2); }
.lv-page-thumb.is-active { border-color: var(--mnb-accent); }
.lv-page-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #fff; }
.lv-page-thumb span { position: absolute; bottom: 4px; inset-inline-start: 4px; padding: 0 7px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .75rem; font-weight: 700; }

/* صفحهٔ اسلایدهای درس */
.mnb-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--mnb-border); border-radius: 22px; transition: border-color .2s ease, background-color .2s ease;
}
.mnb-drop:hover, .mnb-drop.is-over, .mnb-drop:focus-within { border-color: var(--mnb-accent); background: var(--mnb-accent-soft); }
.mnb-uploads { display: flex; flex-direction: column; gap: 10px; }
.mnb-uploads:not(:empty) { margin-top: 12px; }
.mnb-upload { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 16px; background: var(--mnb-surface-2); }
.mnb-upload strong { overflow-wrap: anywhere; }
.mnb-upload.is-error { background: var(--mnb-danger-soft); }
.mnb-progress { height: 10px; border-radius: 5px; overflow: hidden; background: var(--mnb-border); }
.mnb-progress[hidden] { display: none; }
.mnb-progress span { display: block; width: 0; height: 100%; border-radius: 5px; background: var(--mnb-accent); transition: width .3s ease; }
.mnb-slide-row .grow .sub { overflow-wrap: anywhere; }
.mnb-icon-btn-sm { width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0; }
.mnb-viewer { max-width: 960px; margin-inline: auto; }
.mnb-slide-page { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--mnb-border); }
.mnb-slide-page img { display: block; width: 100%; height: auto; }
.mnb-slide-page figcaption { position: absolute; bottom: 8px; inset-inline-start: 8px; padding: 0 9px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .8rem; font-weight: 700; }

/* ================================================================ گوشی به‌عنوان دوربین دوم */
.pc-page { background: #000; }
.pc-shell { position: fixed; inset: 0; display: flex; flex-direction: column; }
.pc-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.pc-top {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgba(0, 0, 0, .65), transparent);
  color: #fff; font-size: .85rem; font-weight: 700;
}
.pc-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pc-status { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .5); }
.pc-dot { width: 9px; height: 9px; border-radius: 50%; background: #9AA3B2; }
.pc-status[data-status="live"] .pc-dot { background: #E5484D; animation: mnb-pulse 1.8s ease-out infinite; }
.pc-status[data-status="reconnecting"] .pc-dot, .pc-status[data-status="connecting"] .pc-dot { background: var(--mnb-sun); }
.pc-status[data-status="paused"] .pc-dot { background: #fff; }
.pc-start, .pc-done { position: relative; z-index: 2; flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 21, 34, .88); overflow-y: auto; }
.pc-start[hidden], .pc-done[hidden], .pc-controls[hidden] { display: none; }
.pc-controls {
  position: absolute; z-index: 2; inset-inline: 0; bottom: 0; display: flex; justify-content: center; gap: 10px;
  padding: 16px 12px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}
.pc-choice { flex: 1; cursor: pointer; }
.pc-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pc-choice span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border: 2px solid var(--mnb-border); border-radius: 16px; font-weight: 700; }
.pc-choice input:checked + span { border-color: var(--mnb-accent); background: var(--mnb-accent-soft); color: var(--mnb-accent); }
.pc-choice input:focus-visible + span { outline: 3px solid rgba(var(--mnb-accent-rgb), .55); }

/* ================================================================ کانال و پیام‌ها */
.ch-row.is-unread .title { color: var(--mnb-accent); }
.ch-row .grow { gap: 2px; }
.ch-person { border: 0; background: transparent; text-align: start; color: inherit; }
.ch-page { background: #EEF2F8; }
.ch-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 860px; margin-inline: auto; background: #EEF2F8; }
@media (min-width: 900px) { .ch-shell { border-inline: 1px solid var(--mnb-border); } }
.ch-top {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--mnb-surface); border-bottom: 1px solid var(--mnb-border);
}
.ch-top .mnb-icon-btn { width: 44px; height: 44px; border-radius: 14px; }
.ch-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.ch-title strong, .ch-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-title small { color: var(--mnb-muted); }
.ch-pinned {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; width: 100%; padding: 8px 14px; border: 0;
  border-bottom: 1px solid var(--mnb-border); background: var(--mnb-sun-soft); color: var(--mnb-sun-ink); text-align: start;
}
.ch-pinned[hidden] { display: none; }
.ch-pinned .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; font-size: .88rem; }
.ch-pinned .grow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 10px 12px; }
.ch-list { display: flex; flex-direction: column; gap: 4px; }
.ch-older { align-self: center; margin: 4px 0 8px; }
.ch-older[hidden] { display: none; }
.ch-empty { margin-top: 15vh; }
.ch-day { align-self: center; margin: 10px 0 6px; }
.ch-day span { padding: 3px 12px; border-radius: 999px; background: rgba(28, 35, 51, .08); color: var(--mnb-ink-2); font-size: .78rem; font-weight: 700; }
.ch-msg { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; margin-top: 6px; position: relative; }
.ch-msg.is-compact { margin-top: 0; padding-inline-start: 40px; }
.ch-msg.is-me { flex-direction: row-reverse; padding-inline-start: 0; }
.ch-msg .mnb-avatar-img { flex-shrink: 0; }
.ch-bubble {
  max-width: min(82%, 520px); padding: 6px 12px 4px; border-radius: 18px; background: var(--mnb-surface);
  box-shadow: 0 1px 1px rgba(28, 35, 51, .06); border-start-start-radius: 6px; min-width: 64px;
}
.ch-msg.is-compact .ch-bubble { border-start-start-radius: 18px; }
.ch-msg.is-me .ch-bubble { background: var(--mnb-accent-soft); border-start-start-radius: 18px; border-start-end-radius: 6px; }
.ch-msg.is-teacher:not(.is-me) .ch-bubble { background: var(--mnb-sun-soft); }
.ch-msg.is-deleted .ch-bubble { background: transparent; box-shadow: none; border: 1px dashed var(--mnb-border); }
.ch-msg.is-flash .ch-bubble { box-shadow: 0 0 0 3px var(--mnb-sun); }
.ch-msg.is-pending .ch-bubble { opacity: .85; }
.ch-msg.is-failed .ch-bubble { box-shadow: 0 0 0 2px var(--mnb-danger-soft); }
.ch-name { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 800; color: var(--mnb-accent-strong); }
.ch-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.ch-text.is-deleted { color: var(--mnb-muted); font-style: italic; font-size: .9rem; }
.ch-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 2px; color: var(--mnb-muted); font-size: .72rem; }
.ch-msg.is-me .ch-meta .mnb-icon { color: var(--mnb-accent); }
.ch-retry { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 0; border-radius: 999px; background: var(--mnb-danger-soft); color: var(--mnb-danger-ink); font-size: .76rem; font-weight: 700; }
.ch-more {
  align-self: center; width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--mnb-muted); opacity: .55;
}
.ch-more:hover, .ch-more:focus-visible { opacity: 1; background: rgba(28, 35, 51, .06); }
.ch-att { display: block; margin: 4px 0; border-radius: 14px; overflow: hidden; }
.ch-image { padding: 0; border: 0; background: var(--mnb-surface-2); max-width: 100%; }
.ch-image img { display: block; max-width: 100%; width: 300px; height: auto; max-height: 360px; object-fit: cover; }
.ch-video { display: block; width: 300px; max-width: 100%; max-height: 420px; background: #000; }
.ch-file { display: flex; align-items: center; gap: 10px; padding: 8px; background: rgba(255, 255, 255, .7); color: var(--mnb-ink); text-decoration: none; min-width: 220px; }
.ch-file .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.ch-file-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-file small { color: var(--mnb-muted); }
.ch-processing, .ch-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(255, 255, 255, .6); font-size: .86rem; min-width: 220px; }
.ch-processing .mnb-progress { flex-basis: 100%; height: 6px; }
.ch-failed { color: var(--mnb-danger-ink); background: var(--mnb-danger-soft); }
.ch-voice { display: flex; align-items: center; gap: 10px; padding: 4px 2px; min-width: 220px; overflow: visible; }
.ch-play { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--mnb-accent); color: #fff; }
.ch-voice-bar { position: relative; flex: 1; height: 8px; border-radius: 4px; background: rgba(28, 35, 51, .12); cursor: pointer; overflow: hidden; }
.ch-voice-bar span { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--mnb-accent); border-radius: 4px; }
.ch-voice small { min-width: 36px; color: var(--mnb-muted); font-weight: 700; }
.ch-jump {
  position: fixed; z-index: 20; bottom: calc(96px + env(safe-area-inset-bottom)); inset-inline-end: max(16px, calc(50vw - 414px));
  display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border: 0; border-radius: 999px;
  background: var(--mnb-surface); color: var(--mnb-accent); font-weight: 800; box-shadow: var(--mnb-shadow-pop);
}
.ch-jump[hidden] { display: none; }
.ch-composer { flex-shrink: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--mnb-surface); border-top: 1px solid var(--mnb-border); }
.ch-bar, .ch-rec { display: flex; align-items: flex-end; gap: 6px; }
.ch-bar[hidden], .ch-rec[hidden], .ch-locked[hidden] { display: none; }
.ch-input {
  flex: 1; min-width: 0; min-height: 48px; max-height: 140px; resize: none; padding: 11px 14px; border-radius: 24px;
  border: 1px solid var(--mnb-border); background: var(--mnb-surface-2); line-height: 1.6; font: inherit;
}
.ch-input:focus { outline: none; border-color: var(--mnb-accent); background: #fff; box-shadow: 0 0 0 .2rem rgba(var(--mnb-accent-rgb), .15); }
.ch-btn { width: 48px; height: 48px; flex-shrink: 0; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--mnb-surface-2); color: var(--mnb-ink-2); }
.ch-btn[hidden] { display: none; }
.ch-send, .ch-mic { background: var(--mnb-accent); color: #fff; }
.ch-locked { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 10px; border-radius: 16px; background: var(--mnb-surface-2); color: var(--mnb-muted); font-weight: 700; font-size: .9rem; }
.ch-rec { align-items: center; padding: 0 4px; min-height: 48px; }
.ch-rec .grow { flex: 1; color: var(--mnb-muted); }
.ch-rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mnb-danger); animation: mnb-pulse 1.4s ease-out infinite; }
.ch-rec-time { font-weight: 800; min-width: 44px; }
.ch-sheet { width: min(460px, calc(100vw - 24px)); }
.ch-attach-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ch-attach-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border: 1px solid var(--mnb-border); border-radius: 20px; background: var(--mnb-surface); font-weight: 700; }
.ch-attach-grid button[hidden] { display: none; }
.ch-video-dialog { width: min(480px, calc(100vw - 24px)); }
.ch-video-box { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #111; }
.ch-video-box video { width: 100%; height: 100%; object-fit: cover; }
.ch-video-box video[hidden] { display: none; }
.ch-video-timer { position: absolute; top: 8px; inset-inline-start: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-weight: 800; }
.ch-lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .92); }
.ch-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.ch-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ch-lightbox-close { position: fixed; top: calc(12px + env(safe-area-inset-top)); inset-inline-end: 12px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; }
.ch-menu { display: flex; flex-direction: column; gap: 6px; }
.ch-menu-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border: 0; border-radius: 16px; background: var(--mnb-surface-2); font-weight: 700; text-align: start; }
.ch-menu-item.is-danger { color: var(--mnb-danger-ink); }
.ch-switch-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--mnb-surface-2); cursor: pointer; }
.ch-switch-row .grow { flex: 1; }
.ch-switch-row input { width: 48px; height: 28px; accent-color: var(--mnb-success); flex-shrink: 0; }
