.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(30, 64, 175, 0.24);
  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;
  color: #1E293B;
  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: #EFF6FF; color: #1E40AF; }
.popup-close:focus-visible, .popup-actions .btn:focus-visible, .popup-choice:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }
.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: #64748B; }
.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; }
.popup-actions .btn-primary { background: #2563EB; border-color: #2563EB; }
.popup-choices { display: flex; flex-direction: column; gap: 8px; }
.popup-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: #1E293B;
  text-align: left;
}
.popup-choice:hover { background: #F8FAFC; border-color: #93C5FD; }
.popup-choice.is-selected { border: 2px solid #2563EB; padding: 10px 11px; background: #EFF6FF; }
.popup-choice-icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 999px; background: #EFF6FF; color: #2563EB; }
.popup-choice-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.popup-choice-label { font-size: var(--fs-14); font-weight: 600; }
.popup-choice-description { color: #64748B; font-size: var(--fs-12); line-height: 1.35; }
.popup-choice-indicator { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border: 2px solid #94A3B8; border-radius: 50%; }
.popup-choice.is-selected .popup-choice-indicator { border-color: #2563EB; }
.popup-choice.is-selected .popup-choice-indicator::after { width: 10px; height: 10px; border-radius: 50%; background: #2563EB; content: ""; }
.popup-actions-starting-point { gap: 8px; }
.popup-actions-starting-point .btn-primary { margin-top: 6px; min-height: 46px; }
.popup-actions-starting-point .btn:disabled { opacity: 0.55; cursor: not-allowed; }
@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; } }
@media (prefers-reduced-motion: reduce) {
  .popup-overlay, .popup { animation: none; }
}
@media (max-width: 420px) {
  .popup { padding: 16px; }
  .popup-overlay { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
}
