/* In-flow install prompt (2026-08-03, rewritten — was a `position: fixed`
   bottom overlay that covered the legal-links footer outright on mobile;
   see pwa-install-prompt.js's header comment for the measurements and why
   two rounds of JS clearance math couldn't fix it). Rendered into
   [data-pwa-install-slot] between the auth card and the legal footer, so
   it participates in normal layout and cannot overlap a sibling at any
   viewport size. No z-index, no box-shadow, no fixed offsets — it's page
   content now, not a floating panel. */
.pwa-install-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--hairline);
  /* Teal edge marks it as a secondary/supporting action, distinct from the
     brand-red primary "Sign in" button directly above it. */
  border-left: 3px solid var(--color-accent-2);
  border-radius: 12px;
  padding: var(--space-3);
}

.pwa-install-banner__icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--field-bg);
  color: var(--color-accent-2);
}

.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);
}

/* Below ~380px the icon + text + Install + dismiss row runs out of room and
   the Install button starts squeezing its own label. Dropping the decorative
   icon buys back 48px (its own width plus the gap) — the only element here
   carrying no information the text doesn't already give. */
@media (max-width: 380px) {
  .pwa-install-banner {
    gap: var(--space-2);
  }

  .pwa-install-banner__icon {
    display: none;
  }
}

/* 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;
}

/* NOTE: the `.pwa-install-toggle` pill that used to live here is gone
   (2026-08-03). It only ever existed because the prompt was a floating
   panel that auto-hid after 5s and therefore needed a way to be summoned
   back. Now that the prompt is in normal document flow and simply stays
   put, there is nothing to summon — the timer and the pill were both
   removed rather than left as dead code. */
