.service-tour[hidden],
.service-tour__cursor[hidden] {
    display: none;
}

body.service-tour-open {
    overflow-x: hidden;
}

.service-tour {
    --service-tour-ink: #172033;
    --service-tour-muted: #5b6777;
    --service-tour-accent: #2563eb;
    --service-tour-mint: #0f766e;
    --service-tour-cue: #f59e0b;
    --service-tour-focus-left: 50vw;
    --service-tour-focus-top: 50vh;
    --service-tour-focus-width: 1px;
    --service-tour-focus-height: 1px;
    position: fixed;
    inset: 0;
    z-index: 220;
    pointer-events: none;
}

.service-tour__scrim {
    position: fixed;
    z-index: 220;
    background:
        radial-gradient(circle at var(--service-tour-focus-left) var(--service-tour-focus-top), rgba(255, 255, 255, 0.46), transparent 18rem),
        linear-gradient(135deg, rgba(239, 246, 255, 0.72), rgba(248, 250, 252, 0.8) 48%, rgba(236, 253, 245, 0.7));
    backdrop-filter: blur(6px) saturate(0.82) brightness(1.04);
    pointer-events: auto;
    transition:
        opacity 180ms ease,
        left 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        top 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        width 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        height 280ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.service-tour__halo,
.service-tour__frame {
    position: fixed;
    pointer-events: none;
    will-change: left, top, width, height, opacity, transform;
}

.service-tour__halo {
    z-index: 221;
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.82), transparent 62%),
        linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(15, 118, 110, 0.16) 58%, rgba(245, 158, 11, 0.1));
    filter: blur(14px);
    opacity: 0.92;
    transition:
        opacity 180ms ease,
        left 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        top 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        width 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        height 280ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.service-tour__frame {
    z-index: 222;
    border: 2px solid rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    box-shadow:
        0 0 0 1px rgba(37, 99, 235, 0.78),
        0 0 0 8px rgba(255, 255, 255, 0.5),
        0 0 0 17px rgba(15, 118, 110, 0.13),
        0 22px 68px rgba(37, 99, 235, 0.18);
    transition:
        opacity 180ms ease,
        left 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        top 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        width 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        height 280ms cubic-bezier(0.2, 0.82, 0.2, 1),
        box-shadow 220ms ease,
        transform 220ms ease;
}

.service-tour__cursor {
    position: fixed;
    z-index: 223;
    width: 1.45rem;
    height: 1.45rem;
    margin: -0.72rem 0 0 -0.72rem;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--service-tour-cue);
    box-shadow:
        0 0 0 8px rgba(245, 158, 11, 0.18),
        0 0 0 14px rgba(37, 99, 235, 0.1),
        0 14px 30px rgba(37, 99, 235, 0.18);
    pointer-events: none;
    animation: service-tour-cursor-tap 1500ms ease-in-out infinite;
}

.service-tour__cursor::after {
    content: "";
    position: absolute;
    inset: -0.55rem;
    border: 1px solid rgba(245, 158, 11, 0.55);
    border-radius: inherit;
    opacity: 0;
    animation: service-tour-cursor-ring 1500ms ease-out infinite;
}

.service-tour__popover {
    position: fixed;
    z-index: 224;
    width: min(24rem, calc(100vw - 2rem));
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    padding: 1.05rem;
    color: var(--service-tour-ink);
    box-shadow:
        0 22px 64px rgba(37, 99, 235, 0.18),
        0 10px 30px rgba(15, 23, 42, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.62) inset;
    outline: none;
    pointer-events: auto;
    transform-origin: var(--service-tour-origin, center);
    animation: service-tour-pop 200ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.service-tour__arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    border-left: 1px solid rgba(203, 213, 225, 0.92);
    border-top: 1px solid rgba(203, 213, 225, 0.92);
    background: rgba(255, 255, 255, 0.99);
    transform: rotate(45deg);
    box-shadow: -3px -3px 10px rgba(37, 99, 235, 0.06);
}

.service-tour__popover[data-service-tour-side="top"] .service-tour__arrow {
    border-color: transparent rgba(203, 213, 225, 0.92) rgba(203, 213, 225, 0.92) transparent;
    background: rgba(248, 250, 252, 0.99);
}

.service-tour__popover[data-service-tour-side="left"] .service-tour__arrow,
.service-tour__popover[data-service-tour-side="right"] .service-tour__arrow {
    background: rgba(255, 255, 255, 0.99);
}

.service-tour__popover[data-service-tour-side="sheet"] .service-tour__arrow {
    display: none;
}

.service-tour[data-service-tour-phase="preparing"] .service-tour__frame,
.service-tour[data-service-tour-phase="focusing"] .service-tour__frame {
    opacity: 0.72;
    transform: scale(1.035);
}

.service-tour[data-service-tour-phase="preparing"] .service-tour__popover,
.service-tour[data-service-tour-phase="focusing"] .service-tour__popover {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
}

.service-tour[data-service-tour-phase="explaining"] .service-tour__frame {
    animation: service-tour-frame-settle 520ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.service-tour--closing .service-tour__scrim,
.service-tour--closing .service-tour__frame,
.service-tour--closing .service-tour__halo,
.service-tour--closing .service-tour__cursor,
.service-tour--closing .service-tour__popover {
    opacity: 0;
}

.service-tour__progress {
    display: inline-flex;
    min-height: 1.7rem;
    align-items: center;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    padding: 0 0.58rem;
    color: var(--service-tour-accent);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0;
}

.service-tour__title {
    margin: 0.55rem 0 0;
    color: var(--service-tour-ink);
    font-size: 1.24rem;
    font-weight: 950;
    line-height: 1.28;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.service-tour__body {
    margin: 0.55rem 0 0;
    color: var(--service-tour-muted);
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.55;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.service-tour__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.service-tour__button {
    min-width: 4.35rem;
    min-height: 2.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    padding: 0 0.86rem;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    transition:
        background 150ms ease,
        border-color 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}

.service-tour__button:hover {
    border-color: var(--service-tour-accent);
    color: var(--service-tour-accent);
    transform: translateY(-1px);
}

.service-tour__button:focus-visible {
    outline: 2px solid var(--service-tour-accent);
    outline-offset: 2px;
}

.service-tour__button:disabled {
    cursor: not-allowed;
    border-color: #e2e8f0;
    background: #f1f5f9;
    color: #94a3b8;
    transform: none;
}

.service-tour__button--primary {
    border-color: var(--service-tour-accent);
    background: var(--service-tour-accent);
    color: #ffffff;
}

.service-tour__button--primary:hover {
    border-color: var(--service-tour-mint);
    background: var(--service-tour-mint);
    color: #ffffff;
}

.service-tour__button--ghost {
    border-color: transparent;
    background: transparent;
    color: #64748b;
}

.service-tour-active-target {
    border-radius: var(--service-tour-target-radius, 16px);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.94),
        0 0 0 10px rgba(37, 99, 235, 0.13),
        0 0 0 16px rgba(15, 118, 110, 0.09),
        0 0 34px rgba(37, 99, 235, 0.28);
    filter: saturate(1.06) contrast(1.02);
    scroll-margin: calc(var(--main-nav-height, 80px) + 2.5rem);
    transition:
        box-shadow 180ms ease,
        filter 180ms ease;
}

.service-tour-active-target--locked {
    cursor: default;
}

@keyframes service-tour-pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes service-tour-frame-settle {
    0% {
        transform: scale(1.035);
    }
    58% {
        transform: scale(0.992);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes service-tour-cursor-tap {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    45% {
        transform: translate3d(-2px, -2px, 0) scale(0.92);
    }
    64% {
        transform: translate3d(0, 0, 0) scale(1.04);
    }
}

@keyframes service-tour-cursor-ring {
    0% {
        opacity: 0.7;
        transform: scale(0.72);
    }
    80%,
    100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

@media (max-width: 680px) {
    .service-tour__scrim {
        backdrop-filter: blur(4px) saturate(0.9);
    }

    .service-tour__halo {
        border-radius: 18px;
        filter: blur(9px);
    }

    .service-tour__frame {
        border-radius: 16px;
        box-shadow:
            0 0 0 1px rgba(37, 99, 235, 0.78),
            0 0 0 7px rgba(255, 255, 255, 0.48),
            0 0 0 13px rgba(15, 118, 110, 0.12),
            0 18px 52px rgba(37, 99, 235, 0.16);
    }

    .service-tour__cursor {
        width: 1.24rem;
        height: 1.24rem;
        margin: -0.62rem 0 0 -0.62rem;
    }

    .service-tour__popover {
        left: max(0.75rem, env(safe-area-inset-left)) !important;
        right: max(0.75rem, env(safe-area-inset-right)) !important;
        bottom: max(0.9rem, env(safe-area-inset-bottom)) !important;
        top: auto !important;
        width: auto;
        max-height: min(42vh, 20rem);
        overflow-y: auto;
        border-radius: 18px;
        padding: 0.92rem;
    }

    .service-tour__actions {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.45rem;
        margin-top: 0.82rem;
    }

    .service-tour__title {
        font-size: 1.08rem;
    }

    .service-tour__body {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .service-tour__button {
        min-width: 0;
        min-height: 2.18rem;
        padding: 0 0.52rem;
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .service-tour__scrim,
    .service-tour__frame,
    .service-tour__halo,
    .service-tour__button,
    .service-tour-active-target {
        transition: none;
    }

    .service-tour__popover,
    .service-tour[data-service-tour-phase="explaining"] .service-tour__frame,
    .service-tour__cursor,
    .service-tour__cursor::after {
        animation: none;
    }
}
