/* Installable app prompt + push settings panel (DESIGN_V4 tokens). */

/* ---------------------------------------------------------------- install prompt */
.pwa-install {
  position: fixed; z-index: 60; left: 16px; right: 16px;
  bottom: calc(var(--nav-h, 62px) + var(--safe-b, 0px) + 12px);
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 44px; gap: 12px; align-items: start;
  padding: 14px 8px 14px 14px; border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop, 0 18px 40px rgba(0, 0, 0, .45));
  transform: translateY(16px); opacity: 0; transition: transform .24s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}
.pwa-install.is-in { transform: none; opacity: 1; }
@media (min-width: 768px) {
  .pwa-install { left: auto; right: 20px; bottom: 20px; width: 380px; }
}
.pwa-install-icon { width: 48px; height: 48px; border-radius: 11px; display: block; }
.pwa-install-body { min-width: 0; padding-top: 1px; }
.pwa-install-title { margin: 0; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--text); }
.pwa-install-text { margin: 2px 0 10px; font-size: 13px; line-height: 18px; color: var(--muted); }
.pwa-install-text strong { color: var(--text-2, var(--text)); font-weight: 600; }
.pwa-install-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pwa-install-actions .btn { min-height: 44px; }
.pwa-install-x {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -6px 0 0; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.pwa-install-x:hover { background: var(--surface-2); color: var(--text); }
.pwa-install-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pwa-install-x svg { width: 18px; height: 18px; }
.pwa-share { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; color: var(--accent-text); }

/* ---------------------------------------------------------------- push panel (account settings) */
.push-panel { display: grid; gap: 10px; margin: 4px 0 14px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.push-panel[hidden] { display: none; }
.push-head { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.push-ico { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft, rgba(92, 225, 173, .12)); color: var(--accent-text); }
.push-ico .icon { width: 18px; height: 18px; }
.push-text { display: grid; gap: 2px; min-width: 0; }
.push-text strong { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text); }
.push-text > span { font-size: 13px; line-height: 18px; color: var(--muted); }
.push-state { color: var(--muted); }
.push-state.is-on { color: var(--accent-text); }
.push-state.is-blocked { color: var(--warning, #f5b84b); }
.push-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.push-actions:empty { display: none; }
.push-actions .btn { min-height: 44px; }
.push-note { margin: 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.push-note:empty { display: none; }
.push-note.is-ok { color: var(--accent-text); }
.push-note.is-err { color: var(--danger, #ff6b6b); }
.push-help { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; line-height: 18px; color: var(--muted); }
.push-help[hidden], .push-help [hidden] { display: none; }
.push-help strong { color: var(--text); font-weight: 600; }
.push-sub { margin: 4px 0 6px; font-size: 12px; line-height: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.push-devices .acc-devices { margin: 0; }
.push-devices .acc-device .btn { min-height: 44px; }

/* the settings grid gets a third switch column when push is available */
.np-grid-push .np-row { grid-template-columns: minmax(0, 1fr) 68px 68px 68px; }
@media (max-width: 480px) {
  .np-grid-push .np-row { grid-template-columns: minmax(0, 1fr) 48px 48px 48px; gap: 2px; }
  .np-grid-push .np-headrow { font-size: 11px; letter-spacing: .02em; }
  /* three switch columns: "Always" shrinks to its lock icon (the text stays for screen readers) */
  .np-grid-push .np-always span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .np-grid-push .np-always .icon { width: 16px; height: 16px; }
}
