.hewa-popup .modal-dialog {
    max-width: min(42rem, calc(100% - 1rem));
    margin-inline: auto;
}
.hewa-popup .modal-content, .hewa-popup-preview {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 1rem;
    background: var(--hewa-popup-bg, #fff);
    color: var(--hewa-popup-fg, #262626);
}
.hewa-popup .modal-body {
    padding: 0;
}
.hewa-popup-controls {
    display: flex;
    flex: none;
    justify-content: flex-end;
    padding: .25rem .45rem;
}
.hewa-popup-controls .btn-close {
    padding: .6rem;
}
.hewa-popup-dark .hewa-popup-controls .btn-close {
    filter: invert(1);
}
.hewa-popup-preview .hewa-popup-controls .btn-close {
    pointer-events: none;
}

:is(.hewa-popup .modal-content, .hewa-popup-preview):has(.hewa-popup-image:not([hidden])) > .hewa-popup-controls {
    position: absolute;
    z-index: 1;
    top: .5rem;
    right: .5rem;
    padding: 0;
}

:is(.hewa-popup .modal-content, .hewa-popup-preview):has(.hewa-popup-image:not([hidden])) > .hewa-popup-controls .btn-close {
    box-sizing: border-box;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 1px 5px rgb(0 0 0 / 35%);
    opacity: .94;
    filter: none;
}

:is(.hewa-popup .modal-content, .hewa-popup-preview):has(.hewa-popup-image:not([hidden])) > .hewa-popup-controls .btn-close:is(:hover, :focus-visible) {
    opacity: 1;
}

.hewa-popup .hewa-popup-controls .btn-close:focus-visible {
    outline: 2px solid #18588e;
    outline-offset: -3px;
}
.hewa-popup-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
}
.hewa-popup-copy {
    padding: clamp(1.25rem, 5vw, 2.25rem);
    overflow-wrap: anywhere;
}
.hewa-popup .hewa-popup-title,
.hewa-popup-preview .hewa-popup-title {
    margin: 0 0 .6rem;
    font-size: clamp(1.35rem, 4vw, 1.9rem);
    line-height: 1.2;
}
.hewa-popup-text {
    margin: 0;
    white-space: pre-wrap;
}
.hewa-popup-action { text-align: left; }
.hewa-popup-action[data-alignment="center"] { text-align: center; }
.hewa-popup-action[data-alignment="right"] { text-align: right; }
.hewa-popup-cta {
    max-width: 100%;
    margin-top: 1.1rem;
    white-space: normal;
    overflow-wrap: anywhere;
}
.hewa-popup-frame {
    display: block;
    width: 100%;
    height: 8rem;
    max-height: 58vh;
    border: 0;
}
.hewa-popup [hidden], .hewa-popup-preview [hidden] {
    display: none !important;
}
