/* MyBillingApp PWA: install entry, install dialog, offline / update status bar. Shared by every layout. */

[data-pwa-install][hidden] { display: none !important; }

/* Sidebar (desktop sidebar and mobile drawer) entry, styled like the other footer links. */
.sidebar-foot .pwa-install-link {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px;
  padding: 6px 8px; border: 0; border-radius: 8px; background: transparent;
  color: var(--sidebar-muted, #cbd5e1); font: inherit; font-size: 13px; font-weight: 600; text-align: start; cursor: pointer;
}
.sidebar-foot .pwa-install-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-foot .pwa-install-link .icon { width: 18px; height: 18px; }

/* More screen entry, matches .quick-actions a */
.quick-actions .pwa-install-tile {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--primary, #ff6b00); background: var(--primary-soft, #fff1e6); color: var(--primary-ink, #9a3d00);
  font: inherit; font-weight: 700; text-align: start; cursor: pointer;
}
.quick-actions .pwa-install-tile small { display: block; font-weight: 500; color: var(--text-muted, #6b7280); }

.pwa-install-link:focus-visible,
.pwa-install-tile:focus-visible,
.pwa-bar button:focus-visible,
.pwa-dialog button:focus-visible {
  outline: 3px solid var(--primary, #ff6b00); outline-offset: 2px;
}

/* Status bar: sits above the mobile bottom navigation, never over the page's own actions. */
.pwa-bar {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px;
  border-radius: 14px; background: #0b1220; color: #f5f0e8;
  box-shadow: 0 12px 32px rgba(11, 18, 32, 0.28);
  font-size: 14px; line-height: 1.4;
}
.pwa-bar[hidden] { display: none; }
.pwa-bar-text { flex: 1; min-width: 0; }
.pwa-bar-offline { background: #7c2d12; }
.pwa-bar-action {
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; flex: none;
  background: var(--primary, #ff6b00); color: #fff; font: inherit; font-weight: 800; cursor: pointer;
}
.pwa-bar-close {
  width: 40px; height: 40px; border: 0; border-radius: 10px; flex: none;
  background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
@media (max-width: 768px) {
  .app-body .pwa-bar { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* Install dialog */
.pwa-dialog {
  width: min(400px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 22px;
  background: var(--surface, #fff); color: var(--text, #111827);
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.3);
}
.pwa-dialog::backdrop { background: rgba(11, 18, 32, 0.55); }
.pwa-dialog-body { padding: 24px; }
.pwa-dialog-icon { display: block; border-radius: 14px; margin-bottom: 12px; }
.pwa-dialog h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.2px; }
.pwa-dialog p { margin: 0 0 12px; color: var(--text-muted, #6b7280); line-height: 1.5; font-size: 14px; }
.pwa-dialog-steps { margin: 0 0 16px; padding-inline-start: 20px; line-height: 1.7; font-size: 14px; }
.pwa-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.pwa-dialog-actions .btn { min-height: 44px; padding: 0 18px; }

@media (prefers-reduced-motion: no-preference) {
  .pwa-bar:not([hidden]) { animation: pwa-in 180ms ease-out; }
  @keyframes pwa-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
}
