.newsletter-dialog { --newsletter-max-height: calc(100dvh - 64px - env(safe-area-inset-bottom)); position: fixed; inset: auto max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) auto; z-index: 10001; width: min(600px, calc(100vw - 48px)); max-width: none; max-height: var(--newsletter-max-height); margin: 0; padding: 0; border: 0; border-radius: 0; background: white; overflow: visible; box-shadow: 0 12px 48px rgb(0 0 0 / .25); }
.newsletter-dialog[open] { animation: newsletter-slide-in .4s ease-out; }
.newsletter-dialog::backdrop { background: rgb(0 0 0 / .65); }
html.newsletter-open { overflow: hidden; }
@keyframes newsletter-slide-in { from { transform: translateX(calc(100% + 48px)); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.newsletter-dialog .newsletter-close { position: absolute; top: -16px; right: -16px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; padding: 8px; border: 0; border-radius: 50%; background: black; color: white; cursor: pointer; box-shadow: 0 2px 4px rgb(0 0 0 / .25); }
.newsletter-close svg { display: block; width: 100%; height: 100%; }
.newsletter-dialog iframe { display: block; width: 100%; height: min(420px, var(--newsletter-max-height)); max-height: var(--newsletter-max-height); aspect-ratio: auto; border: 0; background: white; }
/* Keep a measurable frame while the provider loads, without opening a modal,
   starting its animation, taking focus or covering the page. */
.newsletter-dialog.is-preparing { display: block; visibility: hidden; pointer-events: none; }
@media (max-width: 960px) {
  /* Leave room for the chat greeting below the newsletter on narrow screens. */
  .newsletter-dialog { --newsletter-max-height: calc(100dvh - 148px - env(safe-area-inset-bottom)); bottom: calc(108px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .newsletter-dialog[open] { animation: none; }
}
