/* The install prompt, and nothing else.
 *
 * Its own file because the prompt appears on all three shells and only ONE of
 * them loads mobile.css: the public site deliberately does not, since a
 * marketing page has no bottom tab bar. Keeping these rules there meant the
 * offer to install rendered unstyled on the very page most first-time visitors
 * see. Loaded by _pwa_head.html, so the styles travel with the markup that
 * needs them rather than depending on which shell happened to include what.
 */

/* --------------------------------------------------------------------------
 * Install prompt
 * --------------------------------------------------------------------------
 * Sits above the tab bar rather than over it: covering the navigation to offer
 * an install is the kind of thing that makes people close a site.
 */
.pwa-install {
  position: fixed;
  left: 12px;
  right: 12px;
  /* Clears the bottom tab bar (56px + its own safe-area padding) with a gap.
     On desktop, where there is no tab bar, this is simply a bottom margin. */
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 1035;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

@media (max-width: 991px) {
  /* Above the tab bar when there is one. */
  .pwa-install {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
}

.pwa-install[hidden] { display: none; }

.pwa-install-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.pwa-install-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;          /* lets the text truncate instead of pushing the buttons off */
  flex: 1 1 auto;
}
.pwa-install-copy strong {
  font-size: 14px;
  color: #0f172a;
  line-height: 1.3;
}
.pwa-install-copy span {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.4;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.pwa-install-go {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: var(--tabbar-active, #1a237e);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.pwa-install-no {
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
}

/* On a narrow phone the two buttons and the copy do not fit on one line, and
   squeezing them turns "Not now" into a two-character target. */
@media (max-width: 420px) {
  .pwa-install {
    flex-wrap: wrap;
  }
  .pwa-install-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
