:root {
    --jzm-radius: 22px;
    --jzm-gap: 12px;
    --jzm-shadow: 0 24px 80px rgba(15, 23, 42, .28), 0 4px 18px rgba(15, 23, 42, .12);
    --jzm-surface: var(--main-bg-color, #fff);
    --jzm-body: var(--body-bg-color, #fff);
    --jzm-line: var(--main-border-color, rgba(15, 23, 42, .1));
    --jzm-text: var(--main-color, #273142);
    --jzm-muted: var(--muted-color, #6b7280);
    --jzm-accent: var(--focus-color, #26a17b);
}

.modal.jzm-enhanced {
    box-sizing: border-box;
    overflow: hidden !important;
    padding:
        max(var(--jzm-gap), env(safe-area-inset-top))
        max(var(--jzm-gap), env(safe-area-inset-right))
        max(var(--jzm-gap), env(safe-area-inset-bottom))
        max(var(--jzm-gap), env(safe-area-inset-left));
}

.modal.jzm-enhanced.in,
.modal.jzm-enhanced.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal.jzm-enhanced .modal-dialog {
    width: min(760px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 0 auto !important;
    color: var(--jzm-text);
}

.modal.jzm-enhanced.jzm-shop .modal-dialog,
.modal.jzm-enhanced.jzm-purchase .modal-dialog {
    width: min(780px, calc(100vw - 24px)) !important;
}

.modal.jzm-enhanced.jzm-vip .modal-dialog {
    width: min(980px, calc(100vw - 24px)) !important;
}

.modal.jzm-enhanced .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 24px) !important;
    min-height: 0;
    overflow: hidden !important;
    border: 1px solid color-mix(in srgb, var(--jzm-line) 88%, transparent);
    border-radius: var(--jzm-radius) !important;
    background: var(--jzm-surface);
    box-shadow: var(--jzm-shadow) !important;
}

.modal.jzm-enhanced .modal-header {
    position: relative;
    z-index: 8;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 13px 58px;
    border-bottom: 1px solid var(--jzm-line);
    background: color-mix(in srgb, var(--jzm-surface) 94%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.modal.jzm-enhanced .modal-title,
.modal.jzm-enhanced .modal-header h4,
.modal.jzm-enhanced .modal-header h5 {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
    margin: 0;
    color: var(--jzm-text);
    text-align: center;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.45;
}

.modal.jzm-enhanced .jzm-scroll-region {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.modal.jzm-enhanced .jzm-scroll-region > .mini-scrollbar,
.modal.jzm-enhanced .jzm-scroll-region .mini-scrollbar:not(.jzm-scroll-region) {
    max-height: none !important;
    overflow: visible !important;
}

.modal.jzm-enhanced .modal-body {
    min-height: 0;
}

.modal.jzm-enhanced .modal-full-footer,
.modal.jzm-enhanced .modal-footer {
    position: sticky;
    z-index: 7;
    bottom: -1px;
    margin-bottom: 0;
    border-top: 1px solid var(--jzm-line);
    background: color-mix(in srgb, var(--jzm-surface) 94%, transparent);
    box-shadow: 0 -12px 28px rgba(15, 23, 42, .08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.modal.jzm-enhanced .jzm-close {
    position: absolute;
    z-index: 20;
    top: 11px;
    right: 11px;
    display: inline-grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--jzm-line) 88%, transparent);
    border-radius: 11px;
    color: var(--jzm-muted);
    background: color-mix(in srgb, var(--jzm-surface) 90%, transparent);
    box-shadow: 0 5px 18px rgba(15, 23, 42, .08);
    cursor: pointer;
    transition: transform .16s ease, color .16s ease, border-color .16s ease, background .16s ease;
}

.modal.jzm-enhanced .jzm-close:hover {
    color: var(--jzm-text);
    border-color: color-mix(in srgb, var(--jzm-accent) 42%, var(--jzm-line));
    background: var(--jzm-surface);
    transform: translateY(-1px);
}

.modal.jzm-enhanced .jzm-close:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--jzm-accent) 22%, transparent);
    outline-offset: 2px;
}

.modal.jzm-enhanced .jzm-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
}

.modal.jzm-enhanced .modal-header > .close,
.modal.jzm-enhanced .modal-content > .close,
.modal.jzm-enhanced [data-dismiss="modal"].close {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Purchase and cart panels */
.modal.jzm-enhanced .payment-method-radio,
.modal.jzm-enhanced .payment-methods {
    border-radius: 12px;
}

.modal.jzm-enhanced .jiuliu-crypto-route-selector {
    margin-top: 10px;
    border-radius: 16px;
}

.modal.jzm-enhanced .jiuliu-crypto-selector-controls {
    gap: 12px;
}

.modal.jzm-enhanced .jiuliu-crypto-price-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}


/* 1.0.2: Zibll VIP markup has no .modal-body. Keep the shell fixed and
 * scroll only .payvip-modal so the desktop payment button is always reachable. */
.modal.jzm-enhanced.jzm-vip .payvip-modal.jzm-scroll-region {
    box-sizing: border-box;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

@media (min-width: 901px) {
    .modal.jzm-enhanced.jzm-vip .modal-dialog {
        height: min(820px, calc(100dvh - 24px));
    }

    .modal.jzm-enhanced.jzm-vip .modal-content {
        height: 100%;
        max-height: 100% !important;
    }
}

/* VIP layout: keep the sales panel on roomy desktops, compact it elsewhere. */
.modal.jzm-enhanced.jzm-vip .pay-vip-form-row {
    display: grid !important;
    grid-template-columns: minmax(220px, .32fr) minmax(0, .68fr);
    align-items: stretch;
    gap: 18px !important;
}

.modal.jzm-enhanced.jzm-vip .pay-vip-info,
.modal.jzm-enhanced.jzm-vip .pay-vip-products {
    min-width: 0;
    margin: 0 !important;
}

.modal.jzm-enhanced.jzm-vip .pay-vip-info {
    max-width: none;
    padding: 18px 14px;
    border-radius: 18px;
}

.modal.jzm-enhanced.jzm-vip .pay-vip-products {
    width: auto;
}

.modal.jzm-enhanced.jzm-vip .jzm-vip-benefits {
    display: none;
    margin: 0 0 12px;
    padding: 0;
    border: 1px solid var(--jzm-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--jzm-body) 94%, transparent);
}

.modal.jzm-enhanced.jzm-vip .jzm-vip-benefits summary {
    padding: 12px 14px;
    color: var(--jzm-text);
    font-weight: 700;
    cursor: pointer;
}

.modal.jzm-enhanced.jzm-vip .jzm-vip-benefits-body {
    padding: 0 14px 14px;
    color: var(--jzm-muted);
    line-height: 1.8;
}

.modal.jzm-enhanced.jzm-vip .payvip-button {
    position: sticky;
    z-index: 6;
    bottom: 0;
    width: 100%;
    min-height: 42px;
    border-radius: 999px;
}

/* Desktop window controls */
.modal.jzm-enhanced.jzm-desktop-window .jzm-drag-handle {
    cursor: move;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.modal.jzm-enhanced.jzm-desktop-window .jzm-drag-handle:active {
    cursor: grabbing;
}

.modal.jzm-enhanced .jzm-resize-handle {
    display: none;
}

.modal.jzm-enhanced.jzm-desktop-window .jzm-resize-handle {
    position: absolute;
    z-index: 21;
    right: 4px;
    bottom: 4px;
    display: block;
    width: 22px;
    height: 22px;
    cursor: nwse-resize;
    touch-action: none;
}

.modal.jzm-enhanced.jzm-desktop-window .jzm-resize-handle::before,
.modal.jzm-enhanced.jzm-desktop-window .jzm-resize-handle::after {
    content: '';
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 10px;
    height: 1.5px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--jzm-muted) 62%, transparent);
    transform: rotate(-45deg);
    transform-origin: right center;
}

.modal.jzm-enhanced.jzm-desktop-window .jzm-resize-handle::after {
    right: 8px;
    bottom: 8px;
    width: 7px;
}

.modal.jzm-enhanced .modal-dialog.jzm-manual-window {
    position: fixed !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    transform: none !important;
    transition: none !important;
}

.modal.jzm-enhanced .modal-dialog.jzm-manual-window .modal-content {
    width: 100%;
    height: 100%;
    max-height: none !important;
}

@media (max-width: 900px) {
    .modal.jzm-enhanced.jzm-vip .modal-dialog {
        width: min(760px, calc(100vw - 24px)) !important;
    }

    .modal.jzm-enhanced.jzm-vip .pay-vip-form-row {
        grid-template-columns: 1fr;
    }

    .modal.jzm-enhanced.jzm-vip .pay-vip-info {
        display: none !important;
    }

    .modal.jzm-enhanced.jzm-vip .jzm-vip-benefits {
        display: block;
    }
}

@media (max-width: 680px) {
    :root {
        --jzm-radius: 18px;
        --jzm-gap: 7px;
    }

    .modal.jzm-enhanced {
        align-items: center;
        padding:
            max(7px, env(safe-area-inset-top))
            max(7px, env(safe-area-inset-right))
            max(7px, env(safe-area-inset-bottom))
            max(7px, env(safe-area-inset-left));
    }

    .modal.jzm-enhanced .modal-dialog,
    .modal.jzm-enhanced.jzm-shop .modal-dialog,
    .modal.jzm-enhanced.jzm-purchase .modal-dialog,
    .modal.jzm-enhanced.jzm-vip .modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(
            100dvh
            - max(7px, env(safe-area-inset-top))
            - max(7px, env(safe-area-inset-bottom))
        ) !important;
    }

    .modal.jzm-enhanced .modal-content {
        max-height: calc(
            100dvh
            - max(7px, env(safe-area-inset-top))
            - max(7px, env(safe-area-inset-bottom))
        ) !important;
        border-radius: 18px !important;
    }

    .modal.jzm-enhanced .modal-header {
        min-height: 50px;
        padding: 12px 54px;
    }

    .modal.jzm-enhanced .jzm-close {
        top: 9px;
        right: 9px;
        width: 34px;
        height: 34px;
    }

    .modal.jzm-enhanced .modal-body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .modal.jzm-enhanced .jiuliu-crypto-selector-controls,
    .modal.jzm-enhanced .jiuliu-crypto-price-summary {
        grid-template-columns: 1fr !important;
    }

    .modal.jzm-enhanced .modal-full-footer,
    .modal.jzm-enhanced .modal-footer {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal.jzm-enhanced .modal-dialog,
    .modal.jzm-enhanced .jzm-close {
        transition: none !important;
    }
}


/* 1.0.3: promoted body titles and live countdowns share the centered title bar. */
.modal.jzm-enhanced .modal-title [int-second],
.modal.jzm-enhanced .modal-title .countdown-box,
.modal.jzm-enhanced .touch.border-title [int-second],
.modal.jzm-enhanced .touch.border-title .countdown-box {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-left: 9px !important;
    padding: 4px 10px !important;
    font-size: 15px !important;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .03em;
    border-radius: 999px;
}

@media (max-width: 680px) {
    .modal.jzm-enhanced .modal-title [int-second],
    .modal.jzm-enhanced .modal-title .countdown-box,
    .modal.jzm-enhanced .touch.border-title [int-second],
    .modal.jzm-enhanced .touch.border-title .countdown-box {
        min-height: 30px;
        padding: 5px 11px !important;
        font-size: 16px !important;
    }
}


/* The original Zibll title node is promoted into the fixed title bar at runtime. */
.modal.jzm-enhanced .jzm-title-source-hidden {
    display: none !important;
}

.modal.jzm-enhanced .modal-title.jzm-promoted-title > .flex,
.modal.jzm-enhanced .modal-title.jzm-promoted-title > b {
    display: contents;
}

/* 1.0.5: load the real cashier data before opening the modal.
 * The live balance is still fetched on every click, but the visitor sees a
 * compact inline indicator on the clicked button instead of a tall empty
 * modal. Once the response is ready, the modal opens at its natural content
 * height and remains constrained by the normal viewport rules above. */
.jzm-cashier-requesting {
    cursor: wait !important;
    opacity: .82;
}

.jzm-cashier-requesting .jzm-cashier-inline-loader {
    display: inline-block;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: jzm-cashier-spin .72s linear infinite;
}

.modal.jzm-cashier-prefetched .loading-mask {
    display: none !important;
}

.modal.jzm-cashier-prefetched .modal-body {
    display: block !important;
}

.modal.jzm-cashier-prefetched .modal-dialog,
.modal.jzm-cashier-prefetched .modal-content {
    height: auto !important;
    min-height: 0 !important;
}

@keyframes jzm-cashier-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .jzm-cashier-requesting .jzm-cashier-inline-loader {
        animation-duration: 1.4s;
    }
}

/* 1.0.6: complete Zibll dark-theme adaptation.
 * Zibll toggles body.dark-theme and updates its global color variables.
 * These scoped overrides keep all enhanced modal layers consistent while
 * preserving the original colorful VIP cards and payment brand colors. */
body:not(.dark-theme) .modal.jzm-enhanced {
    color-scheme: light;
}

body.dark-theme .modal.jzm-enhanced {
    --jzm-surface: var(--main-bg-color, #323335);
    --jzm-body: var(--body-bg-color, #292a2d);
    --jzm-soft: var(--muted-bg-color, #2d2e31);
    --jzm-soft-2: var(--muted-bg-2-color, #37383a);
    --jzm-line: var(--main-border-color, rgba(255, 255, 255, .10));
    --jzm-line-strong: rgba(255, 255, 255, .16);
    --jzm-text: var(--main-color, #e5eef7);
    --jzm-muted: var(--muted-color, #b4b6bb);
    --jzm-shadow: 0 28px 90px rgba(0, 0, 0, .56), 0 5px 22px rgba(0, 0, 0, .34);
    color: var(--jzm-text);
    color-scheme: dark;
}

body.dark-theme .modal.jzm-enhanced .modal-content {
    border-color: var(--jzm-line-strong);
    color: var(--jzm-text);
    background: var(--jzm-surface);
}

body.dark-theme .modal.jzm-enhanced .modal-header,
body.dark-theme .modal.jzm-enhanced .modal-full-footer,
body.dark-theme .modal.jzm-enhanced .modal-footer {
    border-color: var(--jzm-line);
    background: rgba(50, 51, 53, .94);
}

body.dark-theme .modal.jzm-enhanced .modal-full-footer,
body.dark-theme .modal.jzm-enhanced .modal-footer {
    box-shadow: 0 -14px 34px rgba(0, 0, 0, .24);
}

body.dark-theme .modal.jzm-enhanced .modal-body,
body.dark-theme .modal.jzm-enhanced .payvip-modal,
body.dark-theme .modal.jzm-enhanced .jzm-scroll-region {
    color: var(--jzm-text);
    background-color: var(--jzm-surface);
}

body.dark-theme .modal.jzm-enhanced .jzm-close {
    border-color: var(--jzm-line-strong);
    color: #c5cad3;
    background: #3a3b3f;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}

body.dark-theme .modal.jzm-enhanced .jzm-close:hover {
    border-color: color-mix(in srgb, var(--jzm-accent) 48%, var(--jzm-line-strong));
    color: #fff;
    background: #424348;
}

body.dark-theme .modal.jzm-enhanced .jzm-scroll-region {
    scrollbar-color: #5b5e65 transparent;
}

body.dark-theme .modal.jzm-enhanced .jzm-scroll-region::-webkit-scrollbar-thumb {
    background: #5b5e65;
}

body.dark-theme .modal.jzm-enhanced .jzm-scroll-region::-webkit-scrollbar-track {
    background: transparent;
}

/* Zibll purchase and shop controls. */
body.dark-theme .modal.jzm-enhanced .payment-method-radio,
body.dark-theme .modal.jzm-enhanced .payment-methods,
body.dark-theme .modal.jzm-enhanced .hollow-radio,
body.dark-theme .modal.jzm-enhanced .order-item,
body.dark-theme .modal.jzm-enhanced .confirm-group,
body.dark-theme .modal.jzm-enhanced .border-box {
    border-color: var(--jzm-line-strong);
    color: var(--jzm-text);
}

body.dark-theme .modal.jzm-enhanced .payment-method-radio,
body.dark-theme .modal.jzm-enhanced .payment-methods,
body.dark-theme .modal.jzm-enhanced .hollow-radio {
    background: rgba(255, 255, 255, .025);
}

body.dark-theme .modal.jzm-enhanced .payment-method-radio.active,
body.dark-theme .modal.jzm-enhanced .payment-methods.active,
body.dark-theme .modal.jzm-enhanced .hollow-radio.active {
    border-color: var(--jzm-accent);
    background: color-mix(in srgb, var(--jzm-accent) 15%, transparent);
}

body.dark-theme .modal.jzm-enhanced .zib-widget {
    color: var(--jzm-text);
    background-color: var(--jzm-surface);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .025), 0 8px 24px rgba(0, 0, 0, .10);
}

body.dark-theme .modal.jzm-enhanced .muted-box,
body.dark-theme .modal.jzm-enhanced .pay-attr,
body.dark-theme .modal.jzm-enhanced .pay-details,
body.dark-theme .modal.jzm-enhanced .paid-info-box {
    color: var(--jzm-muted);
    background: var(--jzm-soft);
}

body.dark-theme .modal.jzm-enhanced .form-control,
body.dark-theme .modal.jzm-enhanced input:not([type]),
body.dark-theme .modal.jzm-enhanced input[type="text"],
body.dark-theme .modal.jzm-enhanced input[type="input"],
body.dark-theme .modal.jzm-enhanced input[type="password"],
body.dark-theme .modal.jzm-enhanced input[type="number"],
body.dark-theme .modal.jzm-enhanced input[type="email"],
body.dark-theme .modal.jzm-enhanced input[type="tel"],
body.dark-theme .modal.jzm-enhanced input[type="url"],
body.dark-theme .modal.jzm-enhanced input[type="search"],
body.dark-theme .modal.jzm-enhanced textarea,
body.dark-theme .modal.jzm-enhanced select {
    border-color: var(--jzm-line);
    color: var(--jzm-text);
    background-color: var(--jzm-body);
}

body.dark-theme .modal.jzm-enhanced .form-control::placeholder,
body.dark-theme .modal.jzm-enhanced input::placeholder,
body.dark-theme .modal.jzm-enhanced textarea::placeholder {
    color: #8f9299;
    opacity: 1;
}

body.dark-theme .modal.jzm-enhanced select option {
    color: var(--jzm-text);
    background: var(--jzm-body);
}

/* Crypto route selector inside Zibll purchase, cart and VIP dialogs. */
body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-route-selector {
    border-color: rgba(66, 203, 159, .22);
    background:
        radial-gradient(circle at 100% 0, rgba(49, 201, 155, .15), transparent 42%),
        linear-gradient(180deg, rgba(58, 60, 64, .96), rgba(42, 44, 48, .98));
    box-shadow: 0 12px 34px rgba(0, 0, 0, .20);
}

body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-smart-trigger,
body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-smart-menu {
    border-color: rgba(66, 203, 159, .20);
    color: var(--jzm-text);
    background: var(--jzm-body);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-smart-menu {
    box-shadow: 0 22px 52px rgba(0, 0, 0, .46);
}

body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-smart-chevron {
    color: var(--jzm-muted);
}

body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-smart-option:hover,
body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-smart-option:focus-visible,
body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-smart-option[aria-selected="true"] {
    background: rgba(49, 201, 155, .13);
}

body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-price-summary {
    border-color: rgba(66, 203, 159, .16);
    background: rgba(38, 161, 123, .10);
}

body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-price-summary .jiuliu-crypto-price-item {
    color: var(--jzm-text);
    background: rgba(255, 255, 255, .045);
}

body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-price-summary .jiuliu-crypto-price-estimate {
    border-color: rgba(66, 203, 159, .22);
    background: rgba(38, 161, 123, .15);
}

body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-price-summary .jiuliu-crypto-price-item em,
body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-smart-trigger-text strong,
body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-option-copy strong,
body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-selector-title {
    color: var(--jzm-text);
}

body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-smart-trigger-text small,
body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-option-copy small,
body.dark-theme .modal.jzm-enhanced .jiuliu-crypto-reference-note {
    color: var(--jzm-muted);
}

/* VIP dialog: retain the gold/purple cards, darken only neutral containers. */
body.dark-theme .modal.jzm-enhanced.jzm-vip .jzm-vip-benefits {
    border-color: var(--jzm-line-strong);
    background: var(--jzm-soft);
}

body.dark-theme .modal.jzm-enhanced.jzm-vip .jzm-vip-benefits summary {
    color: var(--jzm-text);
}

body.dark-theme .modal.jzm-enhanced.jzm-vip .jzm-vip-benefits-body {
    color: var(--jzm-muted);
}

body.dark-theme .modal.jzm-enhanced.jzm-vip .vip-product {
    border-color: var(--jzm-line-strong);
    color: var(--jzm-text);
    background-color: rgba(255, 255, 255, .025);
}

body.dark-theme .modal.jzm-enhanced.jzm-vip .vip-product.active,
body.dark-theme .modal.jzm-enhanced.jzm-vip .vip-product-input:checked ~ .vip-product {
    border-color: var(--jzm-accent);
    background: color-mix(in srgb, var(--jzm-accent) 14%, transparent);
}

/* Keep live title/countdown readable in both color modes. */
body.dark-theme .modal.jzm-enhanced .modal-title [int-second],
body.dark-theme .modal.jzm-enhanced .modal-title .countdown-box {
    border: 1px solid rgba(255, 255, 255, .10);
    color: #f1f4f8;
    background: rgba(255, 255, 255, .07);
}

body.dark-theme .jzm-cashier-requesting {
    color: inherit;
}

/* 1.0.7: Zibll close-order dialog.
 * RefreshModal reuses the purchase modal shell, so the old “立即支付 + 倒计时”
 * header must be replaced and the compact cancellation form receives its own
 * width, reason cards, radio states, textarea and action button styling. */
.modal.jzm-enhanced.jzm-cancel-order .modal-dialog {
    width: min(480px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
}

.modal.jzm-enhanced.jzm-cancel-order .modal-content {
    height: auto !important;
    min-height: 0 !important;
}

.modal.jzm-enhanced.jzm-cancel-order .modal-header {
    min-height: 54px;
    padding-right: 58px;
    padding-left: 58px;
}

.modal.jzm-enhanced.jzm-cancel-order .modal-title {
    color: #e7612d;
    font-size: 16px;
    font-weight: 800;
}

.modal.jzm-enhanced.jzm-cancel-order .modal-body,
.modal.jzm-enhanced.jzm-cancel-order .jzm-scroll-region {
    padding: 19px 20px 20px !important;
    background: var(--jzm-surface);
}

.modal.jzm-enhanced.jzm-cancel-order .touch-close,
.modal.jzm-enhanced.jzm-cancel-order .jzm-resize-handle {
    display: none !important;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-form,
.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-form > .mb20 {
    margin: 0 !important;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-form > .mb20 > .mb10 {
    margin: 0 0 12px !important;
    color: var(--jzm-muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.6;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label {
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-width: 0;
    min-height: 46px;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid var(--jzm-line);
    border-radius: 13px;
    color: var(--jzm-text);
    background: color-mix(in srgb, var(--jzm-body) 68%, var(--jzm-surface));
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label:hover {
    border-color: color-mix(in srgb, #ff7b43 46%, var(--jzm-line));
    background: color-mix(in srgb, #ff7b43 6%, var(--jzm-surface));
    transform: translateY(-1px);
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label.is-selected {
    border-color: #ff7a3d;
    background: color-mix(in srgb, #ff7a3d 10%, var(--jzm-surface));
    box-shadow: 0 0 0 3px color-mix(in srgb, #ff7a3d 12%, transparent);
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label > span {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.45;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin: 0 0 0 10px !important;
    border: 1.7px solid color-mix(in srgb, var(--jzm-muted) 52%, transparent);
    border-radius: 50%;
    background: var(--jzm-surface);
    box-shadow: inset 0 0 0 4px var(--jzm-surface);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons input[type="radio"]:checked {
    border-color: #ff6f35;
    background: #ff6f35;
    box-shadow: inset 0 0 0 4px var(--jzm-surface);
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons input[type="radio"]:focus-visible {
    outline: 3px solid color-mix(in srgb, #ff7a3d 24%, transparent);
    outline-offset: 2px;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-other {
    margin-top: 10px !important;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-other textarea {
    display: block;
    width: 100%;
    min-height: 92px;
    padding: 11px 12px;
    resize: vertical;
    border: 1px solid var(--jzm-line);
    border-radius: 12px;
    color: var(--jzm-text);
    background: var(--jzm-body);
    box-shadow: none;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-other textarea:focus {
    border-color: #ff7a3d;
    box-shadow: 0 0 0 3px color-mix(in srgb, #ff7a3d 14%, transparent);
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-actions {
    margin: 16px 0 0 !important;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-actions .wp-ajax-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 47px;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 13px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #ff9a4a, #ff6833) !important;
    box-shadow: 0 10px 24px rgba(255, 104, 51, .22);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-actions .wp-ajax-submit:hover {
    filter: brightness(1.035);
    box-shadow: 0 13px 30px rgba(255, 104, 51, .30);
    transform: translateY(-1px);
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-actions .wp-ajax-submit:active {
    box-shadow: 0 6px 16px rgba(255, 104, 51, .22);
    transform: translateY(0);
}

.modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-actions .wp-ajax-submit i {
    margin-right: 6px;
}

body.dark-theme .modal.jzm-enhanced.jzm-cancel-order .modal-title {
    color: #ffad80;
}

body.dark-theme .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label {
    border-color: var(--jzm-line-strong);
    background: rgba(255, 255, 255, .025);
}

body.dark-theme .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label:hover {
    border-color: rgba(255, 151, 100, .48);
    background: rgba(255, 122, 61, .07);
}

body.dark-theme .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label.is-selected {
    border-color: #ff8a52;
    background: rgba(255, 122, 61, .13);
    box-shadow: 0 0 0 3px rgba(255, 122, 61, .12);
}

body.dark-theme .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons input[type="radio"] {
    border-color: #6f737c;
    background: var(--jzm-body);
    box-shadow: inset 0 0 0 4px var(--jzm-body);
}

body.dark-theme .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons input[type="radio"]:checked {
    border-color: #ff8a52;
    background: #ff8a52;
    box-shadow: inset 0 0 0 4px var(--jzm-body);
}

@media (max-width: 640px) {
    .modal.jzm-enhanced.jzm-cancel-order {
        padding:
            max(8px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
    }

    .modal.jzm-enhanced.jzm-cancel-order .modal-dialog {
        width: min(460px, calc(100vw - 16px)) !important;
        max-width: calc(100vw - 16px) !important;
    }

    .modal.jzm-enhanced.jzm-cancel-order .modal-body,
    .modal.jzm-enhanced.jzm-cancel-order .jzm-scroll-region {
        padding: 16px !important;
    }

    .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label {
        min-height: 44px;
        padding: 9px 11px !important;
    }

    .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-actions .wp-ajax-submit {
        min-height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label,
    .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-actions .wp-ajax-submit {
        transition: none;
    }

    .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-reasons > label:hover,
    .modal.jzm-enhanced.jzm-cancel-order .jzm-cancel-actions .wp-ajax-submit:hover {
        transform: none;
    }
}
