:root {
  --ml-modal-header-bg: #e45d86;
  --ml-modal-header-bg-strong: #c94973;
  --ml-modal-header-fg: #ffffff;
  --ml-modal-radius: 18px;
  --ml-modal-shadow: 0 28px 72px rgba(22, 8, 14, 0.38);
  --ml-modal-border: 2px solid rgba(234, 110, 137, 0.55);
  --ml-modal-title-size: 1.24rem;
}

body[data-animated-result],
body[data-animated-recovery] {
  --ml-modal-title-size: 1.18rem;
}

body[data-result-mode="delivery"] {
  --ml-modal-title-size: 1.18rem;
}

.template-modal,
.howit-modal,
.warning-modal,
.phone-confirm-modal,
.recovery-modal,
.animated-modal,
.video-modal,
.delivery-preview-modal,
.image-modal,
.upsell-modal,
.admin-modal {
  align-items: center !important;
  justify-content: center !important;
}

.template-modal__content,
.howit-modal__content,
.warning-modal__content,
.phone-confirm-modal__content,
.recovery-modal__card.plan-card__checkout,
.upsell-modal__card,
.delivery-preview-modal__content,
.admin-modal__card {
  height: auto !important;
  max-height: min(92dvh, 860px) !important;
  overflow-x: hidden;
  overflow-y: auto;
  border: var(--ml-modal-border);
  border-radius: var(--ml-modal-radius);
  box-shadow: var(--ml-modal-shadow);
}

.animated-modal__content,
.video-modal__content,
.image-modal__dialog {
  height: auto !important;
  max-height: min(92dvh, 900px) !important;
  overflow-x: hidden;
  border: var(--ml-modal-border);
  border-radius: var(--ml-modal-radius);
  box-shadow: var(--ml-modal-shadow);
}

.template-modal__content > h3,
.howit-modal__content > h3,
.warning-modal__content > h3,
.phone-confirm-modal__content > h3,
.delivery-preview-modal__content > h3,
.image-modal__dialog > h3 {
  --ml-header-bleed-x: 1.25rem;
  --ml-header-bleed-y: 1.25rem;
  margin: calc(-1 * var(--ml-header-bleed-y))
    calc(-1 * var(--ml-header-bleed-x))
    1rem;
  width: auto;
  transform: none;
  padding: 1.22rem 3.75rem 1.22rem 1rem;
  border-radius: calc(var(--ml-modal-radius) - 2px) calc(var(--ml-modal-radius) - 2px) 0 0;
  background: var(--ml-modal-header-bg);
  color: var(--ml-modal-header-fg) !important;
  font-size: var(--ml-modal-title-size);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-align: center !important;
  text-transform: uppercase;
}

.phone-confirm-modal__content > h3 {
  --ml-header-bleed-x: 2rem;
  --ml-header-bleed-y: 2rem;
}

.delivery-preview-modal__content > h3,
.image-modal__dialog > h3 {
  --ml-header-bleed-x: 1rem;
  --ml-header-bleed-y: 1rem;
}

.delivery-admirer-modal .template-modal__content > h3,
.delivery-confirm-modal .template-modal__content > h3 {
  --ml-header-bleed-x: 1.5rem;
  --ml-header-bleed-y: 1.5rem;
  align-self: stretch;
  padding: 1.3rem 3.8rem 1.3rem 1rem;
}

.recovery-modal__title,
.upsell-modal__title {
  --ml-header-bleed-x: 1rem;
  --ml-header-bleed-y: 1rem;
  margin: calc(-1 * var(--ml-header-bleed-y))
    calc(-1 * var(--ml-header-bleed-x))
    1rem !important;
  width: auto;
  transform: none;
  padding: 1.12rem 3.75rem 1.12rem 1rem;
  border-radius: calc(var(--ml-modal-radius) - 2px) calc(var(--ml-modal-radius) - 2px) 0 0;
  background: var(--ml-modal-header-bg);
  color: var(--ml-modal-header-fg) !important;
  font-size: var(--ml-modal-title-size) !important;
  font-weight: 800;
  line-height: 1.2;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center !important;
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.recovery-modal__title {
  display: block !important;
}

.recovery-modal {
  background: transparent !important;
}

.recovery-modal__card.plan-card__checkout {
  overflow-x: hidden !important;
  overflow-y: hidden !important;
}

.recovery-modal__card.plan-card__checkout .recovery-modal__title {
  position: relative;
  top: auto;
  z-index: auto;
}

.recovery-modal__card.plan-card__checkout .recovery-modal__close {
  position: absolute !important;
  top: 0.7rem !important;
  right: 0.55rem !important;
  margin-left: 0;
  margin-bottom: 0;
  z-index: 8;
}

.upsell-modal[data-admirer-unlock-modal] .upsell-modal__card.plan-card__checkout {
  overflow-x: hidden !important;
  overflow-y: hidden !important;
}

.upsell-modal[data-admirer-unlock-modal][data-pix-visible="true"] .upsell-modal__card.plan-card__checkout {
  overflow-y: auto !important;
}

.upsell-modal[data-admirer-unlock-modal] .upsell-modal__card.plan-card__checkout .plan-card__highlight,
.upsell-modal[data-admirer-unlock-modal] .upsell-modal__card.plan-card__checkout .plan-card__price,
.upsell-modal[data-admirer-unlock-modal] .upsell-modal__card.plan-card__checkout .checkout-pix,
.upsell-modal[data-admirer-unlock-modal] .upsell-modal__card.plan-card__checkout .checkout-code,
.upsell-modal[data-admirer-unlock-modal] .upsell-modal__card.plan-card__checkout .checkout-status,
.upsell-modal[data-admirer-unlock-modal] .upsell-modal__card.plan-card__checkout .checkout-feedback,
.upsell-modal[data-admirer-unlock-modal] .upsell-modal__card.plan-card__checkout .checkout-submit {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.upsell-modal[data-admirer-unlock-modal] .upsell-modal__title {
  --ml-header-bleed-x: 1.2rem;
  --ml-header-bleed-y: 1.2rem;
}

.upsell-modal[data-admirer-unlock-modal] .upsell-modal__close {
  top: calc((64px - 42px) / 2) !important;
  right: 0.55rem !important;
  margin-left: 0;
  margin-bottom: 0;
  z-index: 8;
}

.animated-modal__header,
.video-modal__header {
  --ml-header-bleed-x: 1.5rem;
  --ml-header-bleed-y: 1rem;
  margin: calc(-1 * var(--ml-header-bleed-y))
    calc(-1 * var(--ml-header-bleed-x))
    1rem;
  width: auto;
  transform: none;
  padding: 1.12rem 3.75rem 1.12rem 1rem;
  min-height: 64px;
  border-radius: calc(var(--ml-modal-radius) - 2px) calc(var(--ml-modal-radius) - 2px) 0 0;
  background: var(--ml-modal-header-bg);
  justify-content: flex-start !important;
  align-items: center !important;
  text-align: left !important;
}

.animated-modal__header h3,
.video-modal__header h3,
.video-modal__kicker,
.animated-modal__status,
.video-modal__status {
  color: var(--ml-modal-header-fg) !important;
}

.animated-modal__header h3,
.video-modal__header h3 {
  margin: 0;
  font-size: var(--ml-modal-title-size) !important;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-align: center !important;
  text-transform: uppercase;
}

.template-modal__close,
.howit-modal__close,
.warning-modal__close,
.phone-confirm-modal__close,
.delivery-preview-modal__close,
.recovery-modal__close,
.animated-modal__close,
.video-modal__close,
.image-modal__close,
.upsell-modal__close {
  position: absolute !important;
  z-index: 6;
  top: 0.7rem !important;
  right: 0.55rem !important;
  width: 42px !important;
  height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border-radius: 12px !important;
  border: 2px solid var(--ml-modal-header-bg) !important;
  background: #fff !important;
  color: var(--ml-modal-header-bg-strong) !important;
  font-size: 0 !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.delivery-admirer-modal .template-modal__close,
.delivery-confirm-modal .template-modal__close {
  top: 0.7rem !important;
}

.template-modal__content:has(> h3 br) .template-modal__close,
.howit-modal__content:has(> h3 br) .howit-modal__close,
.warning-modal__content:has(> h3 br) .warning-modal__close,
.phone-confirm-modal__content:has(> h3 br) .phone-confirm-modal__close,
.delivery-preview-modal__content:has(> h3 br) .delivery-preview-modal__close,
.image-modal__dialog:has(> h3 br) .image-modal__close,
.recovery-modal__card.plan-card__checkout:has(.recovery-modal__title br) .recovery-modal__close,
.upsell-modal__card:has(.upsell-modal__title br) .upsell-modal__close,
.animated-modal__content:has(.animated-modal__header h3 br) .animated-modal__close,
.video-modal__content:has(.video-modal__header h3 br) .video-modal__close {
  top: 1.12rem !important;
}

.template-modal__close:hover,
.howit-modal__close:hover,
.warning-modal__close:hover,
.phone-confirm-modal__close:hover,
.delivery-preview-modal__close:hover,
.recovery-modal__close:hover,
.animated-modal__close:hover,
.video-modal__close:hover,
.image-modal__close:hover,
.upsell-modal__close:hover {
  background: #fff5f8 !important;
}

.template-modal__close::before,
.howit-modal__close::before,
.warning-modal__close::before,
.phone-confirm-modal__close::before,
.delivery-preview-modal__close::before,
.recovery-modal__close::before,
.animated-modal__close::before,
.video-modal__close::before,
.image-modal__close::before,
.upsell-modal__close::before {
  content: none !important;
}

.template-modal__close i,
.howit-modal__close i,
.warning-modal__close i,
.phone-confirm-modal__close i,
.delivery-preview-modal__close i,
.recovery-modal__close i,
.animated-modal__close i,
.video-modal__close i,
.image-modal__close i,
.upsell-modal__close i {
  display: inline-block !important;
  font-size: 1.52rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ml-modal-header-bg-strong);
  pointer-events: none;
}

.editor-actions,
.animated-modal__actions,
.video-modal__actions,
.delivery-confirm-modal__actions,
.warning-actions,
.manual-paid-actions {
  margin-top: auto;
}

.image-modal__dialog {
  width: min(94vw, 980px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding: 1rem !important;
  background: #fff;
}

.image-modal__canvas {
  width: 100%;
  height: auto;
  max-height: min(75dvh, 740px);
  border-radius: 14px;
}

.delivery-preview-modal__content {
  width: min(94vw, 780px) !important;
  height: auto !important;
  pointer-events: auto !important;
  padding: 1rem !important;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: #fff;
  border-radius: var(--ml-modal-radius);
  box-shadow: var(--ml-modal-shadow);
}

.delivery-preview-card {
  pointer-events: auto !important;
}

.delivery-preview-image {
  border-radius: 14px;
}

.admin-modal__card .admin-card__title,
.admin-modal__card > h3,
.admin-modal__card > .remarketing-section__header .admin-card__title,
.admin-modal__card > .buyer-modal__header h3,
.admin-modal__card > .template-preview-modal__header h3,
.admin-modal__card > .refund-modal__header h3 {
  color: #fff !important;
}

.admin-modal__card > h3 {
  margin: -1.5rem -1.5rem 1rem;
  padding: 1.12rem 1rem;
  background: var(--ml-modal-header-bg);
  border-radius: calc(var(--ml-modal-radius) - 2px) calc(var(--ml-modal-radius) - 2px) 0 0;
  font-size: 1.12rem;
  line-height: 1.2;
  text-align: left !important;
}

.admin-modal__card > .remarketing-section__header,
.admin-modal__card > .buyer-modal__header,
.admin-modal__card > .template-preview-modal__header,
.admin-modal__card > .refund-modal__header {
  margin: -1.5rem -1.5rem 1rem;
  padding: 1.12rem 1rem;
  background: var(--ml-modal-header-bg);
  border-radius: calc(var(--ml-modal-radius) - 2px) calc(var(--ml-modal-radius) - 2px) 0 0;
}

@media (max-width: 640px) {
  .template-modal,
  .howit-modal,
  .warning-modal,
  .phone-confirm-modal,
  .recovery-modal,
  .animated-modal,
  .video-modal,
  .delivery-preview-modal,
  .image-modal,
  .upsell-modal,
  .admin-modal {
    padding: 0.55rem !important;
  }

  .template-modal__content,
  .howit-modal__content,
  .warning-modal__content,
  .phone-confirm-modal__content,
  .recovery-modal__card.plan-card__checkout,
  .animated-modal__content,
  .video-modal__content,
  .delivery-preview-modal__content,
  .image-modal__dialog,
  .upsell-modal__card,
  .admin-modal__card {
    max-height: 92dvh !important;
  }
}
