.comly-adpopup-lock {
    overflow: hidden;
}

dialog.comly-adpopup {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 16px;
    border: 0;
    background: transparent;
    color: inherit;
    overflow: hidden;
}

dialog.comly-adpopup[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

dialog.comly-adpopup::backdrop {
    background: rgba(0, 0, 0, .55);
}

.comly-adpopup__window {
    position: relative;
    width: min(var(--comly-adpopup-width, 600px), 100%);
    max-height: 100%;
    transition: opacity .2s ease;
}

.comly-adpopup__window--loading {
    opacity: 0;
}

.comly-adpopup__frame {
    display: block;
    width: 100%;
    height: 0;
    max-height: calc(100dvh - 32px);
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color-scheme: normal;
}

.comly-adpopup__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    color: #222;
    font: 22px/32px Arial, sans-serif;
    text-align: center;
    cursor: pointer;
}

.comly-adpopup__close:focus-visible {
    outline: 2px solid #2463eb;
    outline-offset: 2px;
}

dialog.comly-adpopup--fullscreen {
    padding: 0;
}

dialog.comly-adpopup--fullscreen::backdrop {
    background: transparent;
}

.comly-adpopup--fullscreen .comly-adpopup__window {
    width: 100%;
    height: 100%;
}

.comly-adpopup--fullscreen .comly-adpopup__frame {
    height: 100%;
    max-height: none;
}

.comly-adpopup--fullscreen .comly-adpopup__close {
    position: fixed;
    top: 16px;
    right: 16px;
}

dialog.comly-adpopup--corner,
dialog.comly-adpopup--bar {
    inset: auto 16px 16px auto;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
}

.comly-adpopup--corner .comly-adpopup__window {
    width: min(var(--comly-adpopup-width, 360px), calc(100vw - 32px));
}

dialog.comly-adpopup--bar {
    inset: auto 0 0 0;
    width: 100%;
}

.comly-adpopup--bar .comly-adpopup__window {
    width: 100%;
}
