.pwa-install-nudge,
.pwa-update-notice {
  position: fixed;
  z-index: 104;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(390px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  color: #263342;
  background: #fff;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(24, 42, 67, .16);
}
.pwa-install-nudge[hidden],
.pwa-update-notice[hidden],
.pwa-dialog-overlay[hidden] { display: none; }
.pwa-install-nudge > span,
.pwa-update-notice > span { width: 42px; height: 42px; display: grid; place-items: center; color: #1d4ed8; background: #eef4ff; border-radius: 8px; }
.pwa-update-notice > span { color: #087c4f; background: #eaf8f1; }
.pwa-install-nudge svg,
.pwa-update-notice svg { width: 21px; height: 21px; }
.pwa-install-nudge p,
.pwa-update-notice p { display: grid; gap: 2px; min-width: 0; margin: 0; }
.pwa-install-nudge strong,
.pwa-update-notice strong { color: #172231; font-size: 14px; line-height: 1.4; }
.pwa-install-nudge small,
.pwa-update-notice small { color: #66758a; font-size: 12px; line-height: 1.5; }
.pwa-nudge-actions { display: flex; align-items: center; gap: 5px; }
.pwa-action,
.pwa-close { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 11px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.pwa-action { color: #fff; background: #1d4ed8; }
.pwa-action:hover { background: #173fae; }
.pwa-update-notice .pwa-action { background: #087c4f; }
.pwa-update-notice .pwa-action:hover { background: #06643f; }
.pwa-close { width: 36px; padding: 0; color: #657386; background: transparent; border-color: #e1e7ee; }
.pwa-close:hover { color: #273444; background: #f5f7fa; }
.pwa-close svg { width: 17px; height: 17px; }

body.pwa-dialog-open { overflow: hidden; }
.pwa-dialog-overlay { position: fixed; z-index: 130; inset: 0; background: rgba(20, 31, 46, .42); backdrop-filter: blur(2px); }
.pwa-dialog { position: fixed; z-index: 140; top: 50%; left: 50%; width: min(440px, calc(100vw - 32px)); max-height: min(680px, calc(100vh - 32px)); overflow-y: auto; color: #273444; background: #fff; border: 1px solid #dce4ed; border-radius: 10px; box-shadow: 0 24px 60px rgba(18, 31, 49, .24); transform: translate(-50%, -50%); }
.pwa-dialog[hidden] { display: none; }
.pwa-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 17px; border-bottom: 1px solid #e6ebf1; }
.pwa-dialog-header > div { min-width: 0; }
.pwa-dialog-header span { display: inline-flex; align-items: center; gap: 6px; color: #1d4ed8; font-size: 12px; font-weight: 700; }
.pwa-dialog-header span svg { width: 16px; height: 16px; }
.pwa-dialog-header h2 { margin: 6px 0 0; color: #172231; font-size: 21px; line-height: 1.35; }
.pwa-dialog-body { padding: 20px 22px 22px; }
.pwa-dialog-intro { margin: 0 0 17px; color: #5d6c80; font-size: 13px; line-height: 1.7; }
.pwa-install-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pwa-install-steps li { display: grid; grid-template-columns: 29px minmax(0, 1fr); align-items: start; gap: 10px; padding: 11px; background: #f7f9fc; border: 1px solid #e5eaf0; border-radius: 8px; }
.pwa-install-steps li > span { width: 29px; height: 29px; display: grid; place-items: center; color: #1d4ed8; background: #e8f0ff; border-radius: 7px; font-size: 12px; font-weight: 800; }
.pwa-install-steps strong { display: block; color: #263342; font-size: 13px; }
.pwa-install-steps p { margin: 3px 0 0; color: #657386; font-size: 12px; line-height: 1.6; }
.pwa-dialog-note { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 0; padding: 11px 12px; color: #526273; background: #f2f7f6; border-left: 3px solid #16836f; font-size: 12px; line-height: 1.65; }
.pwa-dialog-note svg { flex: 0 0 17px; width: 17px; height: 17px; margin-top: 1px; color: #16836f; }
.pwa-dialog-primary { width: 100%; min-height: 42px; margin-top: 17px; }
.pwa-dialog-primary[hidden] { display: none; }
.pwa-help-button { width: 100%; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin-top: 15px; padding: 8px 12px; color: #1d4ed8; background: #f5f8ff; border: 1px solid #ccdafe; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.pwa-help-button:hover { background: #ebf1ff; border-color: #9db7fb; }
.pwa-help-button svg { width: 17px; height: 17px; }
.parent-pwa-help { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 8px 10px; color: #d8e8e6; background: transparent; border: 0; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.parent-pwa-help:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.parent-pwa-help svg { width: 18px; height: 18px; }
.footer-pwa-link { padding: 0; color: inherit; background: transparent; border: 0; cursor: pointer; font: inherit; }
.footer-pwa-link:hover { color: #2f6fec; }

@media (max-width: 560px) {
  .pwa-install-nudge,
  .pwa-update-notice { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; grid-template-columns: 38px minmax(0, 1fr) auto; padding: 11px; }
  .pwa-install-nudge > span,
  .pwa-update-notice > span { width: 38px; height: 38px; }
  .pwa-install-nudge small,
  .pwa-update-notice small { font-size: 11px; }
  .pwa-action { padding-inline: 9px; }
  .pwa-dialog { inset: 0; width: 100%; max-height: none; border: 0; border-radius: 0; transform: none; }
  .pwa-dialog-header { padding: 20px 16px 16px; }
  .pwa-dialog-body { padding: 18px 16px 22px; }
  .parent-pwa-help span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-action,
  .pwa-close,
  .pwa-help-button { transition: none; }
}
