/* Smart PWA install popup (top) + iOS guide */
#pw-pwa-install-btn {
  position: fixed;
  z-index: 10050;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 12px;
  width: calc(100% - 24px);
  max-width: 420px;
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.25;
  text-align: start;
}

#pw-pwa-install-btn.is-visible {
  display: flex;
}

#pw-pwa-install-btn .pw-pwa-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

#pw-pwa-install-btn .pw-pwa-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#pw-pwa-install-btn .pw-pwa-app-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

#pw-pwa-install-btn .pw-pwa-app-sub {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

#pw-pwa-install-btn .pw-pwa-action {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #1a73e8;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
}

#pw-pwa-install-btn .pw-pwa-close {
  position: absolute;
  top: 6px;
  inset-inline-end: 8px;
  opacity: 0.55;
  font-size: 18px;
  line-height: 1;
  background: transparent;
  border: 0;
  color: #64748b;
  cursor: pointer;
  padding: 2px 4px;
}

body.day-mode #pw-pwa-install-btn {
  background: #fff;
}

.pw-pwa-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

.pw-pwa-modal-overlay.is-open {
  display: flex;
}

.pw-pwa-modal {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 16px;
  padding: 20px 18px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  direction: inherit;
}

.pw-pwa-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pw-pwa-modal-head img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.pw-pwa-modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.pw-pwa-modal-head .pw-pwa-modal-app {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

body.day-mode .pw-pwa-modal {
  background: #fff;
  color: #1e2329;
}

.pw-pwa-modal p {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.55;
}

.pw-pwa-modal ol {
  margin: 0 0 16px;
  padding-inline-start: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

.pw-pwa-modal .pw-pwa-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.pw-pwa-modal button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
}

.pw-pwa-modal .pw-pwa-ok {
  background: #1a73e8;
  color: #fff;
}

.pw-pwa-modal .pw-pwa-later {
  background: transparent;
  color: #8b95a8;
}

.pw-app-btn-pwa-install {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
  height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(95, 160, 255, 0.45);
  background: rgba(95, 160, 255, 0.12);
  color: #5fa0ff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.pw-app-btn-pwa-install.is-visible {
  display: inline-flex;
}
