.newsletter-popup {
  width: min(400px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 16px;
  background: #fff;
  color: #111827;
  box-shadow: 0 24px 64px -16px rgba(17,24,39,.24);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.newsletter-popup::backdrop { background: rgba(17,24,39,.42); }
.newsletter-popup[open] { animation: newsletter-popup-in .2s cubic-bezier(.22,1,.36,1) both; }
.newsletter-popup__content { position: relative; min-height: 160px; padding: 32px 28px 0; text-align: center; }
/* Stage floats over the (still invisible) text, centered between popup top and the CTA, so no empty gap and no height jump. */
.newsletter-popup__stage { position: absolute; top: calc(50% + 12px); left: 50%; width: 140px; height: 111px; margin: -55.5px 0 0 -70px; pointer-events: none; }
.newsletter-popup__stage svg { display: block; width: 140px; height: 111px; overflow: visible; }
.newsletter-popup h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; line-height: 1.4; letter-spacing: -.015em; color: #111827; }
.newsletter-popup p { margin: 0; color: #4b5563; font-size: 14px; line-height: 1.65; text-wrap: pretty; }
/* Sequence on open: envelope draws, check pops (~1.6s), stage shrinks away (1.7s), text fades in (1.85s). */
.nl-rect, .nl-flap, .nl-check { stroke-dasharray: 1; stroke-dashoffset: 0; }
.nl-badge { transform-box: fill-box; transform-origin: center; }
.newsletter-popup[open] .nl-rect { animation: nl-draw .6s ease-out .15s both; }
.newsletter-popup[open] .nl-flap { animation: nl-draw .45s ease-out .55s both; }
.newsletter-popup[open] .nl-badge { animation: nl-pop .35s cubic-bezier(.34,1.56,.64,1) 1s both; }
.newsletter-popup[open] .nl-check { animation: nl-draw .3s ease-out 1.25s both; }
.newsletter-popup[open] .newsletter-popup__stage { animation: nl-stage-out .45s cubic-bezier(.4,0,.2,1) 1.7s both; }
.newsletter-popup[open] .newsletter-popup__body { animation: nl-text-in .4s ease-out 1.85s both; }
@keyframes nl-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes nl-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes nl-stage-out { to { opacity: 0; transform: scale(.4); } }
@keyframes nl-text-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Keep the order agreement button's shape, with a seamless popup footer. */
.newsletter-popup__footer { padding: 24px 28px 28px; background: #fff; }
.newsletter-popup__button { width: 100%; min-height: 44px; background: #b10c41; color: #fff; border: none; border-radius: 10px; padding: 12px; font-family: var(--font); font-size: .9rem; font-weight: 700; cursor: pointer; }
.newsletter-popup__button:hover { background: #8f0a34; }
@media (max-width: 480px) {
  .newsletter-popup__content { padding: 28px 24px 0; }
  .newsletter-popup__footer { padding: 24px; }
}
@keyframes newsletter-popup-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .newsletter-popup[open], .newsletter-popup[open] .newsletter-popup__body { animation: none; }
  .newsletter-popup__stage { display: none; }
  .newsletter-popup__content { min-height: 0; }
}