/* Page tours — dark glass top-center bubble (no cream slab, no spotlight hole). Prefix: cu-tour-* */

.cu-tour--offer {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0 1rem;
}

.cu-tour__offer-card {
    width: min(22rem, calc(100vw - 2rem));
    max-width: 22rem;
    padding: 0.9rem 1rem 1rem;
    border-radius: 0.65rem;
    box-sizing: border-box;
    /* Dark glass — matches active bubble; one tour surface only. */
    background: rgba(18, 18, 18, 0.92);
    color: var(--cu-cream, #f5f0e6);
    border: 1px solid rgba(245, 240, 230, 0.14);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 12px 32px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(245, 240, 230, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cu-tour--active {
    position: fixed;
    inset: 0;
    /* Above page chrome; keep the whole tour layer above any target highlight. */
    z-index: 1400;
    pointer-events: none;
}

.cu-tour__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 18, 18, 0.55);
    pointer-events: auto;
    /* Full dim — no cutout mask. */
}

.cu-tour__card {
    position: fixed;
    z-index: 1402;
    /* Top-center fixed bubble — not card-below-target left slab. */
    top: max(0.75rem, env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: min(22rem, calc(100vw - 2rem));
    max-width: 22rem;
    padding: 0.85rem 0.95rem 1rem;
    border-radius: 0.65rem;
    pointer-events: auto;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(18, 18, 18, 0.92);
    color: var(--cu-cream, #f5f0e6);
    border: 1px solid rgba(245, 240, 230, 0.14);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 12px 32px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(245, 240, 230, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Leave room above bottom tabs + safe-area. */
    max-height: calc(
        100dvh
        - var(--cu-tabs-h, 4.25rem)
        - env(safe-area-inset-top, 0px)
        - env(safe-area-inset-bottom, 0px)
        - 1.5rem
    );
}

.cu-tour__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.25;
    color: var(--cu-cream, #f5f0e6);
}

.cu-tour__body {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.45;
    color: rgba(245, 240, 230, 0.88);
}

.cu-tour__progress {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(245, 240, 230, 0.62);
}

.cu-tour__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.cu-tour__actions .cu-cta,
.cu-tour__actions .cu-chip-btn,
.cu-tour__offer-card .cu-cta,
.cu-tour__offer-card .cu-chip-btn {
    min-height: 44px;
    min-width: 44px;
    padding-inline: 0.85rem;
    touch-action: manipulation;
}

/* Target ring — 2px teal; stays in page paint order (never above tour CTAs). */
.cu-tour-target-active {
    outline: 2px solid var(--cu-teal, #0d9488);
    outline-offset: 3px;
    border-radius: 0.25rem;
    /* Do not raise stacking: a raised target was intercepting Next/Back/Skip under the card. */
}

/* Scroll target below the fixed top bubble (JS also sets this when measuring). */
[data-cu-tour-target] {
    scroll-margin-top: calc(
        0.75rem
        + env(safe-area-inset-top, 0px)
        + 12.5rem
        + 0.75rem
    );
}

@media (prefers-reduced-motion: reduce) {
    .cu-tour__card,
    .cu-tour__backdrop,
    .cu-tour-target-active,
    .cu-tour__offer-card {
        transition: none !important;
        animation: none !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Phone / 390 — readable type, safe-area; keep ≤22rem (no edge-to-edge cream). */
@media (max-width: 420px) {
    .cu-tour__card,
    .cu-tour__offer-card {
        width: min(22rem, calc(100vw - 1rem));
        max-width: 22rem;
        padding: 0.9rem 0.85rem 1rem;
    }

    .cu-tour__card {
        top: max(0.5rem, env(safe-area-inset-top, 0px));
        max-height: calc(
            100dvh
            - var(--cu-tabs-h, 4.25rem)
            - env(safe-area-inset-top, 0px)
            - env(safe-area-inset-bottom, 0px)
            - 1.25rem
        );
    }

    .cu-tour__title {
        font-size: 1.08rem;
        line-height: 1.3;
    }

    .cu-tour__body {
        font-size: 0.98rem;
        line-height: 1.5;
    }

    .cu-tour__progress {
        font-size: 0.8rem;
    }

    .cu-tour__actions {
        gap: 0.5rem;
    }

    .cu-tour__actions .cu-cta,
    .cu-tour__actions .cu-chip-btn,
    .cu-tour__offer-card .cu-cta,
    .cu-tour__offer-card .cu-chip-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .cu-tour--offer {
        margin-inline: 0;
        max-width: 100%;
        overflow-x: hidden;
    }
}
