/* PWA chrome (F8) -- connectivity + install banners. Token-only, both themes.
   Loaded on all widths (offline matters everywhere); the phone @media lifts the
   banners above the F1 tab bar. No service worker -- install + connectivity UI
   only (the app installs + runs standalone; offline caching is intentionally
   out of scope given the no-build / no-cache setup). */

.strata-pwa-banner {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  /* Above dock/tool overlays + module content, but BELOW sheets (8800/8801) and
     modals (9000/9001) + toast (9999) so the banner never covers a dialog's
     action buttons. */
  z-index: 8700;
  display: none;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 13px;
}
.strata-pwa-banner.is-visible { display: flex; }
.strata-pwa-banner-text { flex: 1; min-width: 0; }
.strata-pwa-banner-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.strata-pwa-offline .strata-pwa-banner-dot { background: var(--warning); }
.strata-pwa-online .strata-pwa-banner-dot { background: var(--success); }
/* Reconnecting: amber dot that pulses to signal an in-flight retry. Distinct
   from the steady offline dot and the steady green online dot. */
.strata-pwa-reconnecting .strata-pwa-banner-dot {
  background: var(--warning);
  animation: strata-pwa-dot-pulse 1s ease-in-out infinite;
}
/* Syncing (S4): draining the capture outbox. Accent dot that pulses like the
   reconnecting state but reads as progress, not a warning. */
.strata-pwa-syncing .strata-pwa-banner-dot {
  background: var(--accent);
  animation: strata-pwa-dot-pulse 1s ease-in-out infinite;
}
@keyframes strata-pwa-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Dead-letter badge (S4): captures that failed to sync. Danger-toned pill that
   opens the review list. Kept reachable even after an online transition. */
.strata-pwa-banner-badge {
  flex-shrink: 0;
  padding: 3px 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--danger, var(--warning));
  background: var(--danger-soft, var(--warning-soft));
  border: 1px solid var(--danger, var(--warning));
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.strata-pwa-banner-badge[hidden] { display: none; }

.strata-pwa-install-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--button-radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.strata-pwa-dismiss {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}

@media (max-width: 640px) {
  .strata-pwa-banner {
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
    bottom: calc(49px + env(safe-area-inset-bottom, 0px) + 12px);
  }
  .strata-pwa-install-btn { min-height: 44px; }
  .strata-pwa-dismiss { width: 44px; height: 44px; }
}
