/* PWA notices: install, update, offline. Uses the design tokens from sdz.css. */
.pwa-banner {
  position: fixed; left: 12px; right: 12px; z-index: 1085;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  max-width: 520px; margin: 0 auto; padding: .7rem .9rem;
  background: var(--sdz-surface, #fff); color: var(--sdz-ink, #1b2236);
  border: 1px solid var(--sdz-line, #e4e8f2); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(14, 18, 38, .22);
  font-size: .9rem; line-height: 1.35;
}
.pwa-banner__text { flex: 1 1 200px; }
.pwa-btn {
  min-height: 40px; padding: 0 .95rem; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--sdz-line, #e4e8f2); background: transparent; color: var(--sdz-ink, #1b2236); font-weight: 600;
}
.pwa-btn--primary { background: var(--sdz-primary, #4f46e5); border-color: var(--sdz-primary, #4f46e5); color: #fff; }
.pwa-btn:focus-visible { outline: 3px solid var(--sdz-accent, #f5b301); outline-offset: 2px; }

/* Install buttons stay hidden until the browser says the app can be installed (beats Bootstrap's d-md-inline-flex). */
[data-pwa-install][hidden] { display: none !important; }

/* Offline / back online: a slim bar across the top, under the phone status bar. */
.pwa-banner--offline, .pwa-banner--online {
  top: env(safe-area-inset-top, 0px); bottom: auto; left: 0; right: 0; max-width: none;
  justify-content: center; text-align: center; border-radius: 0; border-width: 0 0 1px; padding: .45rem .75rem; font-weight: 600;
}
.pwa-banner--offline { background: var(--sdz-warning, #d97706); color: #fff; border-color: transparent; }
.pwa-banner--online  { background: var(--sdz-success, #16a34a); color: #fff; border-color: transparent; }

/* Keep the install and update cards above the phone bottom bar. */
@media (max-width: 991.98px) {
  body:has(.sdz-bottomnav) .pwa-banner--install,
  body:has(.sdz-bottomnav) .pwa-banner--update { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* Installed app: no browser chrome, so respect the notch and hide the install buttons. */
@media (display-mode: standalone) {
  [data-pwa-install] { display: none !important; }
  body { overscroll-behavior-y: none; }
}
@media print { .pwa-banner { display: none !important; } }
