.canvas_personal {
    touch-action: none;
    position: fixed;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    background-color: rgb(247, 247, 247);
    height: 100%;
    width: 50%;
    box-shadow: rgba(0, 0, 0, 0.13) 3px 0px 3px;
    opacity: 0;
    left: -100%;
    overflow-y: auto;
}

.close_popup {
    position: absolute;
    right: 0;
    top: 0;
    margin: 1rem;
    z-index: 100;
}

.preview_outer {
    position: relative;
    width: 100%;
    height: 100%;
}

.preview_inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.preview_header {
    margin-bottom: 0px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.preview_title {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
    padding-top: 10px;
    padding-left: 20px;
}

.preview_subtitle {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: #666;
}

.preview_content_wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.preview_content_wrapper_test {
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
}

.preview_test_banner {
    margin: 8px 20px 0;
    padding: 8px 12px;
    font-size: 12px;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    text-align: left;
}

.preview_all_cards_stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    width: 100%;
    padding-bottom: 2rem;
}

.preview_card_block {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview_card_label {
    margin-bottom: 0.75rem;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview_card_row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.preview_content p {
    font-family: 'NeuzeitGrotesk-Reg';
}

/* Preview on-screen — A5 portrait */
.giftcard_container {
    position: relative;
    width: 105mm;
    height: 148mm;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
}

.giftcard_container .giftcard_image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* PDF capture — A5, no scale/transform (html2canvas-safe) */
.giftcard_container_capture {
    position: relative;
    width: 105mm;
    height: 148mm;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: none;
}

.capture_source {
    position: fixed;
    left: 0;
    top: 0;
    width: 105mm;
    height: 148mm;
    visibility: hidden;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.giftcard_container_capture .giftcard_image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.giftcard_overlay_capture {
    position: absolute;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    /* padding: 20px; */
    display: flex;
    align-items: center;
    justify-content: center;
}

.giftcard_overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    overflow-y: auto;
    /* padding: 20px; */
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview_body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    width: 100%;
    padding: 0 10px;
}

.preview_title_body {
    width: 100%;
    text-wrap: wrap;
    text-align: center;
    line-height: 1;
    margin-top: 15%;
    /* height: 120px; */
}

.preview_title_body > div {
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.preview_content {
    flex: 0 0 60%;
    width: 100%;
    padding: 0 10px;
    overflow-y: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.giftcard_overlay::-webkit-scrollbar {
    width: 6px;
}

.giftcard_overlay::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.giftcard_overlay::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.giftcard_overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.preview_content > div {
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.preview_content p:not([style*='margin']) {
    margin: 0.5em 0;
}

.preview_content ul:not([style*='text-align']),
.preview_content ol:not([style*='text-align']) {
    padding-left: 1.5em;
    margin: 0.5em 0;
}

@media only screen and (max-width: 768px) {
    .canvas_personal {
        width: 100%;
    }

    .preview_outer {
        padding: 60px 20px 20px 20px;
    }

    .preview_title {
        font-size: 20px;
    }

    .preview_content_wrapper {
        padding: 10px;
    }

    .giftcard_container {
        max-width: 100%;
    }

    .giftcard_overlay {
        width: 80%;
        padding: 15px;
    }

    .preview_title_body {
        flex: 0 0 30%;
    }

    .preview_content {
        flex: 0 0 50%;
        padding: 0 5px;
    }

    .giftcard_image {
        object-fit: contain;
    }

    .close_popup {
        margin: 0.5rem;
    }
}
