[hidden] { display: none !important; }

.pwa-install-prompt,
.pwa-update-notice {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 10000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.8rem;
  width: min(34rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid rgba(216,181,125,0.42);
  border-radius: 12px;
  background: rgba(25,20,24,0.97);
  color: #f4efe8;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  font: 400 0.9rem/1.45 "Inter", sans-serif;
}

.pwa-install-copy { display: grid; gap: 0.2rem; min-width: 0; }
.pwa-install-copy strong { color: #f1d7a2; font-size: 0.95rem; }
.pwa-install-copy span { color: rgba(255,255,255,0.72); font-size: 0.8rem; }

.pwa-install-action,
.pwa-install-dismiss,
.pwa-help-close {
  min-height: 44px;
  border: 1px solid rgba(216,181,125,0.55);
  border-radius: 7px;
  padding: 0.55rem 0.85rem;
  font: 700 0.75rem/1.2 "Inter", sans-serif;
  cursor: pointer;
}

.pwa-install-action { background: linear-gradient(135deg,#d8b57d,#f1d7a2); color: #1d171a; }
.pwa-install-dismiss { background: transparent; color: #f4efe8; }

.pwa-help-dialog {
  width: min(28rem, calc(100vw - 2rem));
  padding: 1.4rem;
  border: 1px solid rgba(216,181,125,0.42);
  border-radius: 12px;
  background: #1d171a;
  color: #f4efe8;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  font-family: "Inter", sans-serif;
}

.pwa-help-dialog::backdrop { background: rgba(0,0,0,0.72); }
.pwa-help-dialog h2 { margin: 0 0 0.7rem; color: #f1d7a2; font-size: 1.2rem; }
.pwa-help-dialog p { margin: 0 0 0.9rem; color: rgba(255,255,255,0.78); font-size: 0.9rem; line-height: 1.6; }
.pwa-help-close { display: block; margin-left: auto; background: transparent; color: #f4efe8; }

@media (max-width: 520px) {
  .pwa-install-prompt,
  .pwa-update-notice {
    left: max(0.65rem, env(safe-area-inset-left));
    right: max(0.65rem, env(safe-area-inset-right));
    bottom: max(0.65rem, env(safe-area-inset-bottom));
    grid-template-columns: minmax(0, 1fr) auto;
    width: auto;
    gap: 0.5rem;
    padding: 0.8rem;
  }

  .pwa-install-copy { grid-column: 1 / -1; }
  .pwa-install-action { justify-self: start; }
  .pwa-install-dismiss { justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-prompt { scroll-behavior: auto; }
}
