.gallery-heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-tour-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(8, 8, 10, .58);
    backdrop-filter: blur(1px);
}

.gallery-tour-spotlight {
    position: fixed;
    z-index: 9001;
    border: 3px solid var(--phi-admin-border, var(--phi-border, #fff));
    border-radius: 10px;
    box-shadow:
        0 0 0 5px color-mix(in srgb, var(--phi-admin-border, var(--phi-border, #fff)) 30%, transparent),
        0 8px 30px rgba(0, 0, 0, .38);
    pointer-events: none;
    transition:
        top .38s cubic-bezier(.22, 1, .36, 1),
        left .38s cubic-bezier(.22, 1, .36, 1),
        width .38s cubic-bezier(.22, 1, .36, 1),
        height .38s cubic-bezier(.22, 1, .36, 1),
        border-color .24s ease,
        box-shadow .24s ease;
}

.gallery-tour-pointer {
    position: fixed;
    z-index: 9002;
    width: 54px;
    height: 30px;
    color: var(--phi-admin-border, var(--phi-border, #fff));
    font: 900 38px/30px Arial, sans-serif;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .65);
    pointer-events: none;
    transform-origin: center;
    animation: gallery-tour-point 900ms ease-in-out infinite alternate;
    transition: top .38s cubic-bezier(.22, 1, .36, 1), left .38s cubic-bezier(.22, 1, .36, 1), color .24s ease;
}

.gallery-tour-pointer.is-right {
    transform: rotate(180deg);
}

.gallery-tour-card {
    position: fixed;
    z-index: 9003;
    width: min(360px, calc(100vw - 28px));
    padding: 18px;
    border: 1px solid var(--phi-admin-border, var(--phi-border, #fff));
    border-radius: 12px;
    background: var(--phi-admin-surface-soft, var(--phi-surface-soft, #171719));
    color: var(--phi-admin-text, var(--phi-text, #fff));
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    touch-action: pan-y;
    transition:
        top .38s cubic-bezier(.22, 1, .36, 1),
        left .38s cubic-bezier(.22, 1, .36, 1),
        border-color .24s ease,
        background-color .24s ease,
        color .24s ease;
    animation: gallery-tour-card-in .28s ease-out;
}

.gallery-tour-card.gallery-tour-card-step {
    animation: gallery-tour-card-step .3s ease-out;
}

.gallery-tour-kicker {
    margin: 0 0 7px;
    color: var(--phi-admin-border, var(--phi-border, #fff));
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-tour-title {
    margin: 0 0 8px;
    color: inherit;
    font-size: 1.22rem;
    line-height: 1.2;
}

.gallery-tour-copy {
    margin: 0;
    color: var(--phi-admin-muted, var(--phi-muted, var(--phi-admin-text, #fff)));
    font-size: .95rem;
    line-height: 1.5;
}

.gallery-tour-swipe-hint {
    display: none;
    margin: 10px 0 0;
    color: var(--phi-admin-muted, var(--phi-muted, var(--phi-admin-text, #fff)));
    font-size: .78rem;
    text-align: center;
}

.gallery-tour-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.gallery-tour-actions button {
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--phi-admin-border, var(--phi-border, #fff));
    border-radius: 6px;
    background: transparent;
    color: var(--phi-admin-text, var(--phi-text, #fff));
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.gallery-tour-actions .gallery-tour-next {
    margin-left: auto;
    border-color: var(--phi-admin-border, var(--phi-border, #fff));
    background: var(--phi-admin-border, var(--phi-border, #fff));
    color: var(--phi-admin-bg, var(--phi-background, #000));
}

.gallery-tour-actions button:focus-visible {
    outline: 3px solid var(--phi-admin-text, var(--phi-text, #fff));
    outline-offset: 2px;
}

.gallery-tour-target-pulse {
    animation: gallery-tour-tap 500ms ease-out;
}

.gallery-tour-live-target {
    position: relative !important;
    z-index: 9002 !important;
}

body.gallery-tour-active {
    overflow: hidden;
}

@keyframes gallery-tour-point {
    from { margin-left: -5px; }
    to { margin-left: 5px; }
}

@keyframes gallery-tour-tap {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(.88); }
}

@keyframes gallery-tour-card-in {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gallery-tour-card-step {
    from { opacity: .68; transform: translateY(5px) scale(.992); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 620px) {
    .gallery-tour-card {
        left: 14px !important;
        right: 14px;
        width: auto;
    }

    .gallery-tour-pointer {
        width: 42px;
        font-size: 31px;
    }

    .gallery-tour-swipe-hint {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-tour-pointer,
    .gallery-tour-target-pulse,
    .gallery-tour-card,
    .gallery-tour-card.gallery-tour-card-step {
        animation: none;
    }

    .gallery-tour-spotlight,
    .gallery-tour-pointer,
    .gallery-tour-card {
        transition: none;
    }
}
