/* دانشجو پرو — PWA: نوار نصب/به‌روزرسانی/آفلاین + اصلاحات iOS و حالت standalone */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: transparent; }
button, [role="button"], a, input, select, textarea, label, summary { touch-action: manipulation; }

/* iOS Safari: فوکوس روی فیلد با فونت کوچک‌تر از ۱۶px صفحه را زوم می‌کند */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select, textarea { font-size: 16px !important; }
}
/* اپِ نصب‌شده: بدون کشیدن-برای-بارگذاری و لرزش rubber-band */
html.is-standalone body { overscroll-behavior-y: none; }
@media (display-mode: standalone), (display-mode: window-controls-overlay) { .pwa-hide-standalone { display: none !important; } }

#pwaBars { position: fixed; z-index: 2147483000; inset-inline: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 12px 0; pointer-events: none; font-family: Vazirmatn, system-ui, sans-serif; }
.pwa-card { pointer-events: auto; width: min(560px, 100%); display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: #fff; color: #1C1C1E; border: 1px solid rgba(0,0,0,.08); border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  animation: pwaIn .22s ease-out; direction: rtl; }
@keyframes pwaIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.pwa-card .ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #007AFF center/cover no-repeat url('/icons/icon-96.png'); }
.pwa-card .txt { flex: 1; min-width: 0; font-size: 13px; line-height: 1.7; }
.pwa-card .txt b { display: block; font-size: 14px; }
.pwa-card .txt span { color: #6B7280; font-size: 12px; }
.pwa-card button { flex: none; font: inherit; font-weight: 700; font-size: 13px; border: 0; border-radius: 12px; padding: 9px 14px; cursor: pointer; }
.pwa-card .go { background: #007AFF; color: #fff; }
.pwa-card .x { background: transparent; color: #6B7280; padding: 9px 8px; font-size: 18px; line-height: 1; }
.pwa-card.warn { background: #FFF4E5; border-color: #FFD8A8; }
.pwa-card.warn .ico { background: #FF9500; }
.pwa-offline { pointer-events: none; font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: #FF3B30; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.2); }

.pwa-sheet-bg { position: fixed; inset: 0; z-index: 2147483001; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.pwa-sheet { width: min(520px, 100%); background: #fff; color: #1C1C1E; border-radius: 24px 24px 0 0; direction: rtl;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); font-family: Vazirmatn, system-ui, sans-serif; animation: pwaUp .25s ease-out; }
@keyframes pwaUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.pwa-sheet h3 { margin: 0 0 6px; font-size: 17px; }
.pwa-sheet p { margin: 0 0 14px; color: #6B7280; font-size: 13px; line-height: 1.9; }
.pwa-sheet ol { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: s; }
.pwa-sheet li { counter-increment: s; display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 14px; }
.pwa-sheet li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: #007AFF; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.pwa-sheet li svg { width: 22px; height: 22px; stroke: #007AFF; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pwa-sheet .close { width: 100%; font: inherit; font-weight: 700; padding: 13px; border: 0; border-radius: 14px; background: #007AFF; color: #fff; cursor: pointer; }

@media (prefers-color-scheme: dark) {
  .pwa-card, .pwa-sheet { background: #1C1C1E; color: #F2F2F7; border-color: rgba(255,255,255,.1); }
  .pwa-card .txt span, .pwa-sheet p { color: #9CA3AF; }
  .pwa-card.warn { background: #3A2A12; border-color: #6B4A12; }
  .pwa-sheet li { border-color: rgba(255,255,255,.08); }
}
