:root {
    --product-tour-accent: #2f86df;
    --product-tour-accent-dark: #1769b5;
    --product-tour-overlay: rgba(15, 30, 48, 0.62);
}

.product-tour-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1045;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0 0.9rem;
    color: var(--product-tour-accent-dark);
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(47, 134, 223, 0.38);
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(31, 58, 86, 0.2);
    font-size: 0.86rem;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.product-tour-launcher:hover,
.product-tour-launcher:focus-visible {
    color: #0f579b;
    background: #fff;
    box-shadow: 0 12px 32px rgba(31, 58, 86, 0.28);
    transform: translateY(-2px);
}

.product-tour-launcher[hidden] {
    display: none !important;
}

.product-tour-launcher.is-suspended {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
}

body.grammar-task-dock-visible .product-tour-launcher {
    bottom: 120px;
}

.product-tour-shield {
    position: fixed;
    inset: 0;
    z-index: 2049;
    display: none;
    background: transparent;
}

.product-tour-shield.is-visible {
    display: block;
}

.product-tour-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2050;
    width: 0;
    height: 0;
    pointer-events: none;
    border: 2px solid rgba(112, 181, 247, 0.98);
    border-radius: 14px;
    box-shadow:
        0 0 0 9999px var(--product-tour-overlay),
        0 0 0 5px rgba(47, 134, 223, 0.2),
        0 10px 30px rgba(15, 30, 48, 0.18);
    opacity: 0;
    transition:
        top 0.24s ease,
        left 0.24s ease,
        width 0.24s ease,
        height 0.24s ease,
        opacity 0.18s ease;
}

.product-tour-spotlight.is-visible {
    opacity: 1;
}

.product-tour-spotlight.is-center {
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: var(--product-tour-overlay);
    box-shadow: none;
}

.product-tour-popover {
    position: fixed;
    z-index: 2060;
    display: grid;
    width: min(390px, calc(100vw - 24px));
    gap: 0.7rem;
    padding: 1.05rem;
    color: #263544;
    background: #fff;
    border: 1px solid #d9e3ed;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(13, 34, 56, 0.3);
    opacity: 0;
    transform: translateY(8px) scale(0.985);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.product-tour-popover[hidden] {
    display: none !important;
}

.product-tour-popover.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.product-tour-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.product-tour-count {
    color: #748494;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.product-tour-icon-button {
    display: inline-grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    color: #72808e;
    background: transparent;
    border: 0;
    border-radius: 50%;
}

.product-tour-icon-button:hover,
.product-tour-icon-button:focus-visible {
    color: #32485d;
    background: #eef4f9;
}

.product-tour-progress {
    height: 4px;
    overflow: hidden;
    background: #e8eef4;
    border-radius: 999px;
}

.product-tour-progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #2f86df, #61b6f2);
    border-radius: inherit;
    transition: width 0.24s ease;
}

.product-tour-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #2f86df, #54a8e8);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(47, 134, 223, 0.25);
}

.product-tour-popover h2 {
    margin: 0;
    color: #1e3449;
    font-size: 1.08rem;
    font-weight: 750;
    line-height: 1.4;
}

.product-tour-popover p {
    margin: 0;
    color: #576879;
    font-size: 0.9rem;
    line-height: 1.7;
}

.product-tour-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.15rem;
}

.product-tour-actions .btn {
    min-height: 36px;
    border-radius: 9px;
    font-weight: 600;
}

body.product-tour-active .product-tour-launcher:not([hidden]) {
    z-index: 2055;
}

@media (max-width: 575px) {
    .product-tour-launcher {
        right: 12px;
        bottom: 12px;
        width: 42px;
        padding: 0;
        justify-content: center;
    }

    .product-tour-launcher span {
        display: none;
    }

    body.grammar-task-dock-visible .product-tour-launcher {
        bottom: 82px;
    }

    .product-tour-popover {
        padding: 0.95rem;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-tour-launcher,
    .product-tour-spotlight,
    .product-tour-popover,
    .product-tour-progress-bar {
        transition: none !important;
    }
}
