/*
 * A63 Card Preview
 * Stable fixed-aspect preview card. Front and Inside views share the same
 * stage dimensions so toggling between them never changes the panel size.
 */

:root {
    --a63-preview-ink: #1f2a37;
    --a63-preview-muted: #607184;
    --a63-preview-brand: #173a52;
    --a63-preview-paper: #ffffff;
    --a63-preview-border: #dde4ea;
    --a63-preview-warn: #b3381c;
    --a63-preview-accent: #c59a4a;
    --a63-preview-shadow-sm: 0 6px 14px rgba(15, 39, 58, 0.10);
    --a63-preview-shadow-md: 0 10px 24px rgba(15, 39, 58, 0.12);
}

/* ==============================
 * Desktop two-column layout: preview | options
 * ============================== */
.a63-card-preview-stack {
    display: block;
}

@media (min-width: 900px) {
    .a63-card-preview-stack {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 32px;
        align-items: start;
    }

    .a63-card-preview-stack > .a63-card-preview {
        position: sticky;
        top: 24px;
        margin-bottom: 0;
    }

    .a63-card-preview-stack > form.cart {
        margin: 0;
    }
}

/* ==============================
 * Outer preview panel
 * ============================== */
.a63-card-preview {
    margin: 0 0 16px;
    padding: 18px 16px 16px;
    border: 1px solid #d8dde5;
    border-radius: 14px;
    background: linear-gradient(168deg, #fdfdfd 0%, #f6f8fb 45%, #ebeff5 100%);
    box-shadow:
        0 12px 28px rgba(15, 39, 58, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

/* Thin gold accent stripe along the top edge — adds a card-shop / luxe feel
 * without leaning into anything overtly Christmas-themed. */
.a63-card-preview::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        rgba(197, 154, 74, 0.25) 0%,
        var(--a63-preview-accent) 30%,
        var(--a63-preview-accent) 70%,
        rgba(197, 154, 74, 0.25) 100%);
    z-index: 1;
    pointer-events: none;
}

@media (min-width: 900px) {
    .a63-card-preview-stack > .a63-card-preview {
        max-width: none;
    }
}

.a63-card-preview[hidden],
.a63-card-preview.a63-card-preview--hidden {
    display: none !important;
}

/* Header with tabs */
.a63-card-preview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 6px;
}

.a63-card-preview__title {
    margin: 0;
    color: var(--a63-preview-brand);
    font-family: 'Trebuchet MS', sans-serif;
    font-size: 1.05rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
    font-weight: 700;
}

/* Two title variants swapped via data-a63-view on the section root.
 * display:none keeps the inactive variant out of the accessibility tree. */
.a63-card-preview__title-front,
.a63-card-preview__title-inside {
    display: none;
}

.a63-card-preview[data-a63-view="front"] .a63-card-preview__title-front,
.a63-card-preview[data-a63-view="inside"] .a63-card-preview__title-inside {
    display: inline;
}

/* Tab pill group */
.a63-card-preview__tabs {
    display: inline-flex;
    background: #ffffff;
    border: 1px solid var(--a63-preview-border);
    border-radius: 999px;
    padding: 3px;
    box-shadow: 0 2px 6px rgba(15, 39, 58, 0.06);
}

/*
 * Tabs — neutralised against theme / Elementor button styles. Using `!important`
 * here because the host theme (and Elementor's default button.elementor-button
 * ruleset) win on specificity and paint buttons red on hover/focus.
 */
.a63-card-preview__tabs .a63-card-preview__tab {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 none !important;
    color: var(--a63-preview-muted) !important;
    padding: 5px 14px !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    border-radius: 999px !important;
    cursor: pointer !important;
    box-shadow: none !important;
    outline: none !important;
    outline-offset: 0 !important;
    text-decoration: none !important;
    min-height: 0 !important;
    min-width: 0 !important;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.a63-card-preview__tabs .a63-card-preview__tab:hover,
.a63-card-preview__tabs .a63-card-preview__tab:focus,
.a63-card-preview__tabs .a63-card-preview__tab:active {
    background: transparent !important;
    background-image: none !important;
    color: var(--a63-preview-brand) !important;
    border: 0 none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.a63-card-preview__tabs .a63-card-preview__tab:focus-visible {
    box-shadow: 0 0 0 2px var(--a63-preview-accent) !important;
}

.a63-card-preview__tabs .a63-card-preview__tab.is-active,
.a63-card-preview__tabs .a63-card-preview__tab.is-active:hover,
.a63-card-preview__tabs .a63-card-preview__tab.is-active:focus,
.a63-card-preview__tabs .a63-card-preview__tab.is-active:active {
    background: var(--a63-preview-brand) !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 0 none !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(15, 39, 58, 0.18) !important;
}

.a63-card-preview__subtitle {
    margin: 0 0 12px;
    color: var(--a63-preview-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

/* ==============================
 * STAGE — fixed-aspect surface.
 * Both panels sit absolutely inside and share the same height.
 * Default is portrait 3:4; landscape products override to 4:3.
 * ============================== */
.a63-card-preview__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    background: var(--a63-preview-paper);
    box-shadow:
        0 16px 36px rgba(15, 39, 58, 0.18),
        0 2px 8px rgba(15, 39, 58, 0.08),
        inset 0 0 0 1px rgba(15, 25, 38, 0.06);
    isolation: isolate;
}

.a63-card-preview--landscape .a63-card-preview__stage {
    aspect-ratio: 4 / 3;
}

.a63-card-preview__panel {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
    pointer-events: none;
}

.a63-card-preview__panel.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.22s ease, visibility 0s linear 0s;
    pointer-events: auto;
}

/* --- Front panel: image fills stage --- */
.a63-card-preview__panel--front {
    background: var(--a63-preview-paper);
}

/* Card-fold cue: subtle shadow on the right edge of Front. Suggests the rest of
 * the folded card is tucked behind. Pointer-events:none so it never interferes
 * with the cover image or zoom button. */
.a63-card-preview__panel--front::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(90deg, transparent 0%, rgba(15, 25, 38, 0.10) 100%);
    pointer-events: none;
    z-index: 3;
}

/*
 * Cover image MUST fill the stage edge-to-edge. Bumping specificity AND using
 * !important so theme rules like `.entry-content img { height: auto }` don't
 * shrink the image and leave a white strip below it inside the stage.
 */
.a63-card-preview .a63-card-preview__cover-image {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.a63-card-preview__cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--a63-preview-muted);
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: repeating-linear-gradient(45deg, #f7f9fb, #f7f9fb 10px, #eef2f6 10px, #eef2f6 20px);
}

/* --- Inside panel: centred greeting + absolutely-positioned logo --- */
.a63-card-preview__panel--inside {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Balanced top/bottom padding so the message stays visually centred no matter
     * which corner the logo lives in. The logo is absolutely positioned and lives
     * INSIDE this padding band when at top/bottom. */
    padding: 48px 22px;
    background: var(--a63-preview-paper);
}

/* Card-fold cue: subtle binding shadow on the LEFT edge of Inside. Suggests
 * this is the right-hand page of an open card. Pointer-events:none so it
 * never blocks clicks on the inside content. */
.a63-card-preview__panel--inside::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 10px;
    background: linear-gradient(90deg, rgba(15, 25, 38, 0.09) 0%, transparent 100%);
    pointer-events: none;
    z-index: 3;
}

.a63-card-preview__inside-content {
    width: 100%;
    max-width: 28ch;
    text-align: center;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.a63-card-preview__message {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--a63-preview-ink);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0;
}

/* --- Empty state CTA inside the Inside panel --- */
.a63-card-preview__empty-state {
    text-align: center;
    color: var(--a63-preview-muted);
    padding: 4px 4px 6px;
}

.a63-card-preview__empty-icon {
    color: #b6c2cf;
    margin: 0 auto 12px;
    display: block;
}

.a63-card-preview__empty-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--a63-preview-ink);
    font-family: 'Trebuchet MS', sans-serif;
    letter-spacing: 0.01em;
}

.a63-card-preview__empty-help {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--a63-preview-muted);
}

/* Toggle visibility of empty-state vs live message based on data-a63-state */
.a63-card-preview__panel--inside[data-a63-state="empty"] .a63-card-preview__message {
    display: none;
}

.a63-card-preview__panel--inside[data-a63-state="filled"] .a63-card-preview__empty-state,
.a63-card-preview__panel--inside[data-a63-state="blank"] .a63-card-preview__empty-state {
    display: none;
}

/* Blank-card notice: muted italic so it reads as a system message ("this
 * inside is intentionally blank"), not as an actual greeting in the
 * customer's chosen font. Overrides the per-font family applied to .message. */
.a63-card-preview__panel--inside[data-a63-state="blank"] .a63-card-preview__message {
    font-family: 'Trebuchet MS', sans-serif !important;
    font-style: italic;
    font-size: 0.88rem;
    color: var(--a63-preview-muted);
    letter-spacing: 0.01em;
}

/* Logo row is absolutely positioned within the inside panel; the 9-cell grid
 * classes below set top/bottom/left/right + transform per position. */
.a63-card-preview__logo-row {
    position: absolute;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    /* Default falls through to .a63-logo-bottom-center on the panel */
}

.a63-card-preview__logo {
    max-height: 42px;
    max-width: 120px;
    object-fit: contain;
}

.a63-card-preview__logo[hidden] {
    display: none;
}

/* --- Character count --- */
.a63-card-preview__char-count {
    margin: 10px 2px 0;
    font-size: 0.78rem;
    color: var(--a63-preview-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-height: 0;
}

.a63-card-preview__char-count.is-over-limit {
    color: var(--a63-preview-warn);
    font-weight: 600;
}

.a63-card-preview[data-a63-view="front"] .a63-card-preview__char-count {
    opacity: 0;
    pointer-events: none;
}

/* --- Font family overrides on the inside panel --- */
.a63-font-flemish-script .a63-card-preview__message {
    font-family: 'A63 Flemish Script', 'Times New Roman', serif;
    font-size: 1.12rem;
    line-height: 1.5;
}

.a63-font-classic-serif .a63-card-preview__message {
    font-family: 'A63 Classic Serif', Georgia, serif;
}

.a63-font-modern-sans .a63-card-preview__message {
    font-family: 'A63 Modern Sans', 'Helvetica Neue', Arial, sans-serif;
}

.a63-font-bembo-italic .a63-card-preview__message {
    font-family: 'Bembo', 'Times New Roman', Georgia, serif;
    font-style: italic;
}

/* ==============================
 * Upload field "max file size" screen-tip
 * TM EPO renders a visible <small class="tc-max-file-size">(max file size NN MB)</small>
 * under each file field. card-preview.js hides it and injects an
 * .a63-upload-tip info marker showing the same text as a tooltip on hover/focus.
 * ============================== */
.a63-upload-hint--hidden {
    display: none !important;
}

.a63-upload-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #607184;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
    text-align: center;
    cursor: help;
    vertical-align: middle;
    user-select: none;
}

.a63-upload-tip::before {
    content: "i";
}

.a63-upload-tip::after {
    content: attr(data-a63-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    /* Anchor to the tip's right edge and expand leftwards. The tip sits near the
     * right of the upload row, so a centred bubble runs off-screen on mobile.
     * Right-anchoring plus a viewport-relative max-width keeps it on screen
     * without horizontal scrolling. */
    right: 0;
    left: auto;
    transform: none;
    width: max-content;
    max-width: min(220px, 68vw);
    white-space: normal;
    text-align: left;
    background: #1f2a37;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 500;
    font-style: normal;
    line-height: 1.2;
    padding: 5px 8px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(15, 25, 38, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, visibility 0.12s ease;
    z-index: 20;
}

.a63-upload-tip:hover::after,
.a63-upload-tip:focus::after,
.a63-upload-tip:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

/* ==============================
 * Logo position grid
 * 9 cells: {top|middle|bottom} × {left|center|right}
 * Each class lives on .a63-card-preview__panel--inside and is added/removed by JS.
 * ============================== */
.a63-logo-top-left    .a63-card-preview__logo-row { top: 16px;    bottom: auto; left: 16px;  right: auto; transform: none; }
.a63-logo-top-center  .a63-card-preview__logo-row { top: 16px;    bottom: auto; left: 50%;   right: auto; transform: translateX(-50%); }
.a63-logo-top-right   .a63-card-preview__logo-row { top: 16px;    bottom: auto; left: auto;  right: 16px; transform: none; }

.a63-logo-middle-left   .a63-card-preview__logo-row { top: 50%;   bottom: auto; left: 16px;  right: auto; transform: translateY(-50%); }
.a63-logo-middle-center .a63-card-preview__logo-row { top: 50%;   bottom: auto; left: 50%;   right: auto; transform: translate(-50%, -50%); }
.a63-logo-middle-right  .a63-card-preview__logo-row { top: 50%;   bottom: auto; left: auto;  right: 16px; transform: translateY(-50%); }

.a63-logo-bottom-left   .a63-card-preview__logo-row { top: auto;  bottom: 16px; left: 16px;  right: auto; transform: none; }
.a63-logo-bottom-center .a63-card-preview__logo-row { top: auto;  bottom: 16px; left: 50%;   right: auto; transform: translateX(-50%); }
.a63-logo-bottom-right  .a63-card-preview__logo-row { top: auto;  bottom: 16px; left: auto;  right: 16px; transform: none; }

/* Legacy single-axis aliases — map to bottom row so existing custom CSS / older
 * filter overrides keep producing a sensible "logo at bottom" result. */
.a63-logo-left   .a63-card-preview__logo-row { top: auto; bottom: 16px; left: 16px;  right: auto; transform: none; }
.a63-logo-center .a63-card-preview__logo-row { top: auto; bottom: 16px; left: 50%;   right: auto; transform: translateX(-50%); }
.a63-logo-right  .a63-card-preview__logo-row { top: auto; bottom: 16px; left: auto;  right: 16px; transform: none; }

/* Debug panel (retained, opt-in) */
.a63-card-preview__debug {
    margin-top: 14px;
    border: 1px solid #d7dde4;
    border-radius: 8px;
    padding: 12px;
    background: #f7fafc;
    color: #1f2a37;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.45;
}

.a63-card-preview__debug-title {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.a63-card-preview__debug-grid {
    display: grid;
    gap: 6px;
}

.a63-card-preview__debug pre {
    margin: 4px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: #ffffff;
    border: 1px solid #e1e8ef;
    border-radius: 4px;
    padding: 6px;
}

/* ==============================
 * Mobile: single column, slightly tighter
 * ============================== */
@media (max-width: 600px) {
    .a63-card-preview {
        margin: 0 0 14px;
        padding: 14px;
        max-width: 100%;
    }

    .a63-card-preview__title {
        font-size: 1rem;
    }

    .a63-card-preview__tab {
        padding: 4px 12px;
        font-size: 0.76rem;
    }

    .a63-card-preview__subtitle {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .a63-card-preview__panel--inside {
        padding: 16px 18px;
    }

    .a63-card-preview__message {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .a63-font-flemish-script .a63-card-preview__message {
        font-size: 1.05rem;
    }

    .a63-card-preview__logo {
        max-height: 36px;
        max-width: 100px;
    }
}

/* ==============================
 * Mobile form tightening
 * Scoped to the stack wrapper so only the WooCommerce product form below our
 * preview is affected. Targets select / text / number / textarea controls and
 * their labels to keep the options section from feeling oversized on phones.
 * ============================== */
@media (max-width: 600px) {
    .a63-card-preview-stack form.cart select,
    .a63-card-preview-stack form.cart input[type="text"],
    .a63-card-preview-stack form.cart input[type="number"],
    .a63-card-preview-stack form.cart input[type="email"],
    .a63-card-preview-stack form.cart textarea,
    .a63-card-preview-stack form.cart .qty {
        font-size: 0.92rem;
        padding: 8px 10px;
        min-height: 0;
        line-height: 1.35;
    }

    .a63-card-preview-stack form.cart select {
        background-position: right 8px center;
        padding-right: 28px;
    }

    .a63-card-preview-stack form.cart label,
    .a63-card-preview-stack form.cart .tm-epo-field-label,
    .a63-card-preview-stack form.cart .tc-label-text,
    .a63-card-preview-stack form.cart h3 {
        font-size: 0.95rem;
        line-height: 1.35;
        margin-bottom: 4px;
    }

    .a63-card-preview-stack form.cart h2,
    .a63-card-preview-stack form.cart .product_title {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .a63-card-preview-stack form.cart .tm-extra-product-options .tmcp-field-wrap,
    .a63-card-preview-stack form.cart .tc-epo-field,
    .a63-card-preview-stack form.cart .cpf-element,
    .a63-card-preview-stack form.cart .tm-epo-field-container {
        margin-bottom: 10px;
    }
}

/* ==============================
 * Zoom button + close button (overlaid on the stage)
 * Both !important-hardened against theme button rules.
 * ============================== */
.a63-card-preview__zoom-btn,
.a63-card-preview__zoom-close {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 none !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.88) !important;
    background-image: none !important;
    color: var(--a63-preview-brand) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(15, 25, 38, 0.22) !important;
    z-index: 5;
    line-height: 1 !important;
    text-decoration: none !important;
    transition: background-color 0.15s ease, transform 0.15s ease;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.a63-card-preview__zoom-btn:hover,
.a63-card-preview__zoom-btn:focus,
.a63-card-preview__zoom-close:hover,
.a63-card-preview__zoom-close:focus {
    background: #ffffff !important;
    background-image: none !important;
    color: var(--a63-preview-brand) !important;
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(15, 25, 38, 0.28) !important;
    border: 0 none !important;
    outline: none !important;
}

.a63-card-preview__zoom-btn:focus-visible,
.a63-card-preview__zoom-close:focus-visible {
    outline: 2px solid var(--a63-preview-accent) !important;
    outline-offset: 2px !important;
}

.a63-card-preview__zoom-btn svg,
.a63-card-preview__zoom-close svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
    display: block;
}

/* Default visibility — zoom button visible, close button hidden */
.a63-card-preview__zoom-close {
    display: none !important;
}

.a63-card-preview.is-zoomed .a63-card-preview__zoom-btn {
    display: none !important;
}

.a63-card-preview.is-zoomed .a63-card-preview__zoom-close {
    display: inline-flex !important;
}

/* ==============================
 * Zoom modal — preview goes position:fixed and centred
 * Backdrop is appended to <body> by JS; lives outside the stack wrapper
 * so it can sit above any theme stacking contexts.
 * ============================== */
.a63-card-preview-zoom-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 38, 0.78);
    z-index: 99998;
    cursor: zoom-out;
    animation: a63-zoom-fade-in 0.18s ease-out;
}

.a63-card-preview-zoom-backdrop[hidden] {
    display: none;
}

html.a63-card-preview-zoom-locked,
html.a63-card-preview-zoom-locked body {
    overflow: hidden;
}

.a63-card-preview.is-zoomed {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: min(700px, 92vw) !important;
    max-width: none !important;
    max-height: 92vh !important;
    margin: 0 !important;
    padding: 24px !important;
    z-index: 99999 !important;
    overflow: auto;
    box-shadow: 0 30px 80px rgba(15, 25, 38, 0.45);
    animation: a63-zoom-in 0.22s ease-out;
}

/* Inside the zoomed panel the stage gets a touch more breathing room */
.a63-card-preview.is-zoomed .a63-card-preview__stage {
    box-shadow: var(--a63-preview-shadow-md), inset 0 0 0 1px rgba(15, 25, 38, 0.06);
}

.a63-card-preview.is-zoomed .a63-card-preview__zoom-close {
    top: 12px !important;
    right: 12px !important;
    width: 36px !important;
    height: 36px !important;
}

@keyframes a63-zoom-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes a63-zoom-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Mobile: the modal becomes near-fullscreen, padding shrinks */
@media (max-width: 600px) {
    .a63-card-preview.is-zoomed {
        width: 96vw !important;
        max-height: 94vh !important;
        padding: 16px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .a63-card-preview__panel {
        transition: none !important;
    }

    .a63-card-preview.is-zoomed,
    .a63-card-preview-zoom-backdrop {
        animation: none !important;
    }

    .a63-card-preview__zoom-btn:hover,
    .a63-card-preview__zoom-close:hover {
        transform: none;
    }
}
