.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(22, 48, 44, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px));
  animation: popup-fade 160ms ease;
}
.popup-overlay[hidden] { display: none; }
.popup {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  width: 100%;
  max-width: 380px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 20px;
  animation: popup-in 200ms ease;
}
.popup-header { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.popup-close { flex: 0 0 44px; height: 44px; font-size: 24px; border-radius: 999px; }
.popup-close:hover { background: var(--mist); }
.popup-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-16); line-height: 1.3; }
.popup-message { flex-shrink: 0; max-height: 25vh; overflow-y: auto; margin-top: 8px; font-size: var(--fs-14); line-height: 1.5; color: var(--text-muted); }
.popup-actions {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
.popup-actions .btn { flex-shrink: 0; overflow-wrap: anywhere; }
@keyframes popup-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes popup-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
