/* PWA и iPhone: баннер уведомлений, карточка в настройках и правки под iOS.
   Подключается после app.css, поэтому перекрывает его только там, где нужно. */

/* ── iOS / установленное приложение ───────────────────────────────── */
html.is-ios { -webkit-tap-highlight-color: transparent; }
html.is-ios button, html.is-ios [role="button"] { touch-action: manipulation; }

/* Установленное приложение (standalone): без «резинки» при прокрутке
   за пределы страницы, как у нативных приложений. */
html.is-standalone { overscroll-behavior-y: none; }

/* 100vh на iPhone включает область под панелью Safari — берём динамическую высоту */
@supports (height: 100dvh) {
    .app-shell { min-height: 100dvh; }
    .sidebar { height: 100dvh; }
}

/* iOS увеличивает страницу при фокусе на полях, если шрифт меньше 16px.
   Для телефонов и планшетов поднимаем размер до 16px. */
@media (max-width: 900px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    select,
    textarea { font-size: 16px; }
}

/* ── Кнопки ───────────────────────────────────────────────────────── */
.pwa-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 9px 16px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.pwa-btn:hover { opacity: .9; }
.pwa-btn:active { transform: scale(.97); }
.pwa-btn[hidden] { display: none; }

/* ── Баннер «Включить уведомления» ────────────────────────────────── */
.pwa-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px 12px 16px;
    background: var(--block-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
    font-family: 'Onest', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    animation: pwa-banner-in .25s ease-out;
}
.pwa-banner[hidden] { display: none; }
.pwa-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pwa-banner-text b { font-weight: 600; font-size: 15px; line-height: 1.3; }
.pwa-banner-text span { color: var(--text-secondary); font-size: 13px; line-height: 1.4; }
.pwa-banner-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pwa-x {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}
.pwa-x:hover { background: var(--bg-hover); }

@media (min-width: 901px) {
    .pwa-banner { left: auto; right: 24px; bottom: 24px; width: 420px; }
}

@keyframes pwa-banner-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pwa-banner { animation: none; }
}

/* ── Карточка в Настройках → Уведомления ──────────────────────────── */
#pwa-push-card .settings-row { gap: 12px; }
#pwa-push-card #pwa-push-hint { font-size: 13px; color: var(--text-secondary); line-height: 1.4; margin-top: 2px; }
#pwa-push-card #pwa-push-hint[hidden] { display: none; }
