/* Shared commission type preview modal for direct commission and Artmug forms. */
body.type-preview-open:not(.is-iframe-embed) {
    overflow: hidden;
}

.type-preview-modal {
    --type-preview-bg: #fff;
    --type-preview-border: #dedfe1;
    display: none;
    position: fixed;
    inset: 0;
    z-index: 12000;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
}
.type-preview-modal.type-standard {
    --type-preview-bg: #f8faf8;
    --type-preview-border: #d5e0d6;
}
.type-preview-modal.type-premium {
    --type-preview-bg: #fbf9f4;
    --type-preview-border: #e2d9bd;
}
.type-preview-modal.type-master {
    --type-preview-bg: #f9f7fa;
    --type-preview-border: #d9d0e1;
}
.type-preview-modal.is-open {
    display: flex;
}
.type-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(34, 38, 43, .48);
    backdrop-filter: blur(2px);
}
.type-preview-dialog {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(760px, calc(100vw - 36px));
    max-height: min(82vh, 620px);
    padding: 14px;
    overflow: auto;
    border: 1px solid var(--type-preview-border, #dedfe1);
    border-radius: 20px;
    background: var(--type-preview-bg, #fff);
    box-shadow: 0 24px 70px rgba(26, 32, 38, .24);
    overscroll-behavior: contain;
}
.type-preview-content {
    min-height: 180px;
}
.type-preview-content .artmug-gallery-section {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.type-preview-loading,
.type-preview-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    margin: 0;
    color: #7c858e;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}
.type-preview-empty {
    grid-column: 1 / -1;
}
.type-preview-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 12px;
}
.type-preview-pagination .nav-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.type-preview-pagination .dot {
    padding: 0;
    border: 0;
}

/* Artmug is embedded by the platform: keep the preview attached to the clicked help button. */
.type-preview-modal.is-anchored {
    display: block;
    padding: 0;
    pointer-events: none;
}
.type-preview-modal.is-anchored .type-preview-backdrop {
    background: transparent;
    backdrop-filter: none;
    pointer-events: auto;
}
.type-preview-modal.is-anchored .type-preview-dialog {
    position: fixed;
    width: min(650px, calc(100vw - 16px));
    max-height: min(520px, calc(100vh - 16px));
    border-radius: 16px;
    box-shadow: 0 18px 46px rgba(26, 32, 38, .25);
    pointer-events: auto;
}
.type-preview-modal.is-anchored .type-preview-dialog::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    border-right: 1px solid var(--type-preview-border, #dedfe1);
    border-bottom: 1px solid var(--type-preview-border, #dedfe1);
    background: var(--type-preview-bg, #fff);
    transform: rotate(45deg);
}

@media screen and (max-width: 640px) {
    .type-preview-modal {
        padding: 10px;
    }
    .type-preview-dialog {
        width: min(100%, calc(100vw - 20px));
        max-height: 86vh;
        padding: 9px;
        border-radius: 16px;
    }
    .type-preview-modal.is-anchored .type-preview-dialog {
        width: calc(100vw - 16px);
    }
}

/* 2026-09-02: keep modal scrollable without showing native scrollbars. */
.type-preview-dialog {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.type-preview-dialog::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.type-preview-content .thumb-img-wrap video {
    opacity: 0;
    transition: opacity .28s ease;
}
