/* Shared PWA presentation, loaded with js/pwa.js on every entry point.
   Extracted from mobile.css; no install/session/worker behavior lives here. */
.bh-pwa-install {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--bhc-panel, #fcf9f1);
  color: var(--bhc-ink, #231d14);
  border: 1px solid var(--bhc-border-strong, rgba(35,29,20,0.20));
  border-radius: 999px;
  font-family: var(--bhc-font-body, 'Inter', system-ui, sans-serif);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.18s ease;
}
.bh-pwa-install:hover { background: var(--bhc-panel-alt, #f1eadb); }
.bh-pwa-install:focus-visible,
.bh-pwa-ios-hint__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--bhc-panel, #fcf9f1);
}
.bh-pwa-install > svg { flex-shrink: 0; }
.bh-pwa-install--floating {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  width: auto;
  max-width: calc(100% - max(16px, env(safe-area-inset-left, 0px)) - max(16px, env(safe-area-inset-right, 0px)));
  z-index: var(--bh-z-pwa-chip, 70);
  box-shadow: 0 8px 24px rgba(10, 21, 32, 0.18);
}
@media (max-width: 920px) {
  body.has-bottomtabs .bh-pwa-install--floating {
    bottom: calc(var(--bh-bottomtabs-height, 69px) + env(safe-area-inset-bottom, 0px) + 16px);
  }
}
/* The shell's mobile navigation owns interaction while its drawer is open.
   Hide this background action without removing/recreating the install prompt. */
@media (max-width: 960px) {
  html.bhr-shell-active:has(.bhr-shell-sidebar.is-open) .bh-pwa-install--floating {
    visibility: hidden;
  }
  /* Keep document actions clear on phones; retain the same install prompt
     when the user leaves Statements or Builder. No eligibility is dismissed. */
  html.bhr-shell-active:has(.bh-view[data-view="statements"]:not([hidden])) .bh-pwa-install--floating,
  html.bhr-shell-active:has(.bh-view[data-view="stmtbuilder"]:not([hidden])) .bh-pwa-install--floating {
    visibility: hidden;
  }
  /* Admin forms and directory actions need the same clear mobile workspace.
     The visible-view condition preserves the prompt in other categories. */
  html.bhr-shell-active:has(.bh-view:not([hidden]) .bh-admin-nav) .bh-pwa-install--floating {
    visibility: hidden;
  }
}

/* Existing iOS hint presentation, previously unavailable on standalone pages. */
.bh-pwa-ios-hint {
  position: fixed;
  left: 12px; right: 12px;
  /* Sits above the bottom-tab bar (76px) AND the safe-area inset */
  bottom: calc(96px + env(safe-area-inset-bottom, 0));
  z-index: 95;
  display: flex; justify-content: center;
}
.bh-pwa-ios-hint__body {
  background: #0a1520;
  color: #faf5e9;
  padding: 14px 16px;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 16px 40px rgba(10, 21, 32, 0.3);
  max-width: 360px;
  width: 100%;
}
.bh-pwa-ios-hint__body strong { color: var(--gold-500, #c9a06a); display: block; margin-bottom: 4px; font-size: 14px; }
.bh-pwa-ios-hint__body p { margin: 0 0 8px; color: rgba(244, 234, 214, 0.85); }
.bh-pwa-ios-hint__body p em { color: var(--gold-500, #c9a06a); font-style: normal; font-weight: 600; }
.bh-pwa-ios-hint__close {
  background: var(--gold-500, #c9a06a); color: #0a1520;
  border: 0; border-radius: 999px;
  padding: 8px 14px;
  min-height: 44px;
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .bh-pwa-install { transition: none; }
}

/* Owner-requested browser-only UI: hide install controls on every entry point.
   Include the staff-login selector to outrank its responsive display rules. */
#bh-pwa-install,
#bh-pwa-ios-hint,
html body.bh-stafflogin #bh-pwa-install {
  display: none;
}
