/* =====================================================================
   mobile.css — سایت عمومی روی موبایل: نوار تب پایین داشبورد، کاشی‌های خانه، هدف لمس ≥۴۴px
   بدون inset و بدون تکیه بر gap در flex (Safari 13 سازگار)
===================================================================== */
.dash-bottom, .dash-sheet { display: none; }

/* ---- کاشی‌های صفحه‌ی «خانه»ی داشبورد ---- */
.dash-home__hello h3 { margin: 0 0 4px; font-size: 20px; color: var(--color-primary-dark); }
.dash-home__hello p { margin: 0 0 14px; color: var(--color-ink-soft); font-size: 14px; }
.dash-home__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-gap: 12px; }
.dash-home__tile { display: block; text-align: right; width: 100%; box-sizing: border-box; min-height: 96px; padding: 14px; border: 1.5px solid var(--color-border); border-radius: 18px; background: #fff; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dash-home__tile .ic { display: block; font-size: 28px; line-height: 1.2; margin-bottom: 4px; }
.dash-home__tile b { display: block; font-size: 15.5px; color: var(--color-ink); }
.dash-home__tile small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--color-ink-soft); line-height: 1.6; }
.dash-home__tile.is-hot { border-color: #f59e0b; background: #fffbeb; }
.dash-home__tile.is-chat { border-color: #93c5fd; background: linear-gradient(135deg, #eff6ff, #fdf2f8); }

/* ---- تب «گفتگو با همکلاس» در فضای کلاس: برجسته ---- */
.cs-tab-chat { background: linear-gradient(135deg, #1d4ed8, #7c3aed); color: #fff; border-color: transparent; font-weight: 800; }
.cs-tab-chat:hover { background: linear-gradient(135deg, #1e40af, #6d28d9); }
.cs-tab-chat.is-active { box-shadow: 0 0 0 3px rgba(124,58,237,.35); }

@media (max-width: 992px) {
  :root { --bn-h: 62px; }
  .dash-nav { display: none; }
  .dash-side .who { padding-bottom: 8px; }
  body.has-bottombar { padding-bottom: calc(var(--bn-h) + 6px + env(safe-area-inset-bottom)); }
  .dash-bottom {
    display: flex; position: fixed; bottom: 0; right: 0; left: 0; z-index: 900; background: #fff; border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(15,23,42,.1); height: calc(var(--bn-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  }
  .dash-bottom__it { position: relative; flex: 1 1 0; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; background: transparent; font: inherit; font-size: 11.5px; color: #475569; cursor: pointer; padding: 4px 2px; -webkit-tap-highlight-color: transparent; }
  .dash-bottom__it .ic { font-size: 22px; line-height: 1.1; }
  .dash-bottom__it .lb { max-width: 100%; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dash-bottom__it.is-active { color: #1d4ed8; font-weight: 800; background: #eff6ff; box-shadow: inset 0 3px 0 #1d4ed8; }
  .dash-bottom__badge { position: absolute; top: 4px; left: 50%; margin-left: 6px; }
  .dash-sheet { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 950; }
  .dash-sheet[hidden] { display: none; }
  .dash-sheet__bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15,23,42,.5); }
  .dash-sheet__box { position: absolute; bottom: 0; right: 0; left: 0; max-height: 80%; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fff; border-radius: 22px 22px 0 0; padding: 8px 14px calc(18px + env(safe-area-inset-bottom)); }
  .dash-sheet__grip { width: 44px; height: 5px; border-radius: 3px; background: #cbd5e1; margin: 4px auto 12px; }
  .dash-sheet__grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; }
  .dash-sheet__tile { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 92px; padding: 10px 6px; border: 1.5px solid #e2e8f0; border-radius: 16px; background: #f8fafc; font: inherit; font-size: 13px; color: #0f172a; cursor: pointer; }
  .dash-sheet__tile .ic { font-size: 28px; margin-bottom: 4px; }
  .dash-sheet__tile.is-danger { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
  .dash-main .card, .dash-main .admin-card { overflow-x: auto; max-width: 100%; }
}
@media (max-width: 360px) { .dash-sheet__grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- هدف‌های لمسی ≥۴۴px و فرم‌های بزرگ‌تر در سایت عمومی ---- */
@media (max-width: 900px) {
  .cs-tab-btn, .chip, .filter-select, .cs-back, .btn { min-height: 44px; }
  .cs-tab-btn { display: inline-flex; align-items: center; }
  .cs-back { display: inline-flex; align-items: center; }
  .chip { display: inline-flex; align-items: center; }
  select, input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=hidden]), textarea { min-height: 44px; font-size: 16px; }
  .footer-social a, footer .social a, .social-links a, a[aria-label] { min-width: 44px; min-height: 44px; }
  footer a[href*="instagram"], footer a[href*="t.me"], footer a[href*="wa.me"], footer a[href*="aparat"] { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .hw-week-card textarea, .hw-answer textarea, .dash-main textarea { min-height: 140px; }
}
@media (max-width: 700px) {
  .cs-tabbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .cs-tabbar .cs-tab-btn { flex: none; }
  img, video { max-width: 100%; height: auto; }
}
@media (prefers-reduced-motion: reduce) { .cs-card, .dash-home__tile { transition: none; } }

/* ---- اعلان (toast): در حالت پنهان اصلاً دیده/لمس نشود؛ بالای نوار پایین بنشیند ---- */
#toast { visibility: hidden; opacity: 0; pointer-events: none; transition: transform .3s, opacity .3s, visibility 0s linear .3s; }
#toast.show { visibility: visible; opacity: 1; transition: transform .3s, opacity .3s; }
@media (max-width: 992px) {
  body.has-bottombar #toast { bottom: calc(var(--bn-h) + 16px + env(safe-area-inset-bottom)); max-width: 92vw; }
  .dash-home__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 10px; }
  .dash-home__tile { min-height: 88px; padding: 12px; }
  .dash-home__tile .ic { font-size: 24px; }
  .dash-bottom__badge { top: 2px; left: auto; right: 50%; margin: 0 -26px 0 0; padding: 0 5px; min-width: 0; font-size: 10px; height: 16px; line-height: 16px; }
}

/* ---- پنل مدیریت (CMS) روی موبایل ---- */
@media (max-width: 900px) {
  .admin-subtab, .admin-main .btn-sm, .admin-main .filter-select { min-height: 44px; }
  .admin-subtab { display: inline-flex; align-items: center; }
  .admin-main select, .admin-main input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), .admin-main textarea { min-height: 44px; }
  .admin-main input[type=time] { min-width: 120px; }
  .chat-g-row { display: block; margin: 10px 0; line-height: 1.8; }
}

/* r38: کارنامهٔ ماهانهٔ ساده برای اولیا */
.mc-help { font-size: 14px; color: var(--color-ink-soft); margin: 4px 0 12px; line-height: 1.8; }
.mc-chips { display: flex; flex-wrap: wrap; margin: 0 0 14px; }
.mc-chip { min-width: 84px; min-height: 48px; margin: 0 0 8px 8px; padding: 8px 14px; border-radius: 14px; border: 2px solid var(--color-border); background: #fff; color: #9aa3b5; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.mc-chip.has { color: var(--color-ink); border-color: #9dd9c8; background: #f1fbf8; }
.mc-chip.is-on { background: var(--color-primary, #0A6847); border-color: var(--color-primary, #0A6847); color: #fff; }
.mc-chip:disabled { cursor: default; opacity: .55; }
.mc-sheet { border: 1.5px solid var(--color-border); border-radius: 18px; padding: 14px 16px; background: #fff; }
.mc-who { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin-bottom: 6px; }
.mc-who span { color: var(--color-ink-soft); font-size: 14px; }
.mc-title { font-size: 20px; font-weight: 800; margin: 6px 0 10px; }
.mc-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.mc-row:last-child { border-bottom: 0; }
.mc-c { font-size: 17px; }
.mc-s { min-width: 64px; text-align: center; font-size: 22px; font-weight: 800; border-radius: 12px; padding: 4px 10px; background: #eef1f6; }
.mc-s.hi { background: #dcfce7; color: #166534; } .mc-s.mid { background: #dbeafe; color: #1e40af; } .mc-s.low { background: #ffedd5; color: #9a3412; } .mc-s.abs { background: #f3f4f6; color: #555; }
.mc-avg { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #f1fbf8; font-size: 17px; font-weight: 700; }
.mc-avg b { font-size: 26px; }
.mc-empty { padding: 18px; text-align: center; color: var(--color-ink-soft); }
