.pwa-install-banner {
  position: fixed;
  left: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(24, 38, 52, 0.18);
  padding: var(--space-3);
  max-width: 480px;
  margin: 0 auto;
}

.pwa-install-banner__text {
  flex: 1 1 auto;
  min-width: 0;
}

.pwa-install-banner__text strong {
  display: block;
  color: var(--color-text);
  font-size: 0.9rem;
}

.pwa-install-banner__text p {
  margin: 2px 0 0;
  color: var(--color-muted);
  font-size: 0.8rem;
}

.pwa-install-banner__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.pwa-install-banner__install {
  min-height: 44px;
  white-space: nowrap;
}

.pwa-install-banner__dismiss {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-banner__dismiss:hover {
  color: var(--color-text);
}

@media (max-width: 480px) {
  .pwa-install-banner {
    flex-wrap: wrap;
  }
}

/* iOS step-by-step install walkthrough (2026-08-03) — iOS Safari has no
   equivalent of Android's real one-tap beforeinstallprompt flow, so the
   "Install" button here opens this instead: a real, permanent WebKit
   gap, not something worked around, just given an equally real action
   to take (clear directions) rather than left as a dead button. */
.pwa-install-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(24, 38, 52, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.pwa-install-modal {
  position: relative;
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 30px 70px -30px rgba(24, 38, 52, 0.4);
  padding: var(--space-4);
  max-width: 360px;
  width: 100%;
}

.pwa-install-modal h2 {
  margin: 0 var(--space-4) var(--space-3) 0;
  color: var(--color-text);
  font-size: 1.1rem;
}

.pwa-install-modal__close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-modal__close:hover {
  color: var(--color-text);
}

.pwa-install-instructions {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pwa-install-instructions__step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  font-size: 0.9rem;
}

.pwa-install-instructions__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--color-accent);
}

.pwa-install-modal__done {
  width: 100%;
  min-height: 44px;
}

/* Persistent toggle left behind when the banner auto-hides after 5s
   (2026-08-03, user-requested), so the prompt can be brought back. Kept
   deliberately small — it sits on the login screen indefinitely while the
   app isn't installed, so it has to stay out of the way in a way the full
   banner doesn't. Bottom-right rather than the banner's centred position:
   the login card's own content runs down the middle, and a corner pill
   doesn't need the scroll-reservation dance the full-width banner does. */
.pwa-install-toggle {
  position: fixed;
  right: var(--space-3);
  bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: 0 6px 18px rgba(24, 38, 52, 0.16);
  color: var(--color-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 130ms ease, color 130ms ease;
}

.pwa-install-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pwa-install-toggle:focus-visible {
  outline: 3px solid rgba(156, 34, 34, 0.28);
  outline-offset: 2px;
}
