.qs-tour {
    position: fixed;
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 270;
    width: min(360px, calc(100vw - 36px));
    border-radius: 16px;
    background: #ffffff;
    border: 0;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(2px);
    overflow: hidden;
    display: none;
    animation: qsTourIn .18s ease-out;
}

.qs-tour.is-compact {
    width: min(290px, calc(100vw - 36px));
}

.qs-tour__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #eef2f7;
}

.qs-tour__title {
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qs-tour__muted {
    font-size: 12px;
    color: #64748b;
}

.qs-tour__close {
    border: 0;
    background: transparent;
    color: #5f6f86;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
    border-radius: 6px;
}

.qs-tour__body {
    padding: 10px 12px 12px;
}

.qs-tour__progress {
    height: 8px;
    width: 100%;
    border-radius: 999px;
    background: #e6eefc;
    overflow: hidden;
    margin: 0 0 10px;
}

.qs-tour__progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2B69E7 0%, #2B69E7 100%);
    transition: width .22s ease;
}

.qs-tour__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    overflow: auto;
}

.qs-tour__step {
    border: 0;
    border-radius: 9px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
}

.qs-tour__step.current {
    background: #f1f5f9;
}

.qs-tour__step.done {
    border-color: #56c271;
    background: #effdf2;
}

.qs-tour__step input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #2B69E7;
}

.qs-tour__step.done input[type="checkbox"] {
    accent-color: #1a9b44;
}

.qs-tour__link {
    text-decoration: none;
    color: #334155;
    font-size: 12.5px;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qs-tour__step.done .qs-tour__link {
    color: #0f7a35;
    font-weight: 500;
}

.qs-tour__link:hover {
    color: #2B69E7;
    text-decoration: underline;
}

.qs-tour__note {
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
    margin-top: 8px;
}

.qs-tour__compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.qs-tour__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.qs-tour__btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1;
    transition: border-color .14s ease, color .14s ease;
}

.qs-tour__btn.primary {
    background: #2B69E7;
    border-color: #2B69E7;
    color: #fff;
}

.qs-tour__btn.primary:hover {
    border-color: #1e40af;
    color: #fff;
}

.qs-tour__btn:hover {
    border-color: #cbd5e1;
    color: #1e293b;
}

.qs-tour__btn.danger:hover {
    border-color: #fca5a5;
    color: #b91c1c;
}

.qs-tour__compact-meta {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.qs-tour__btn:focus-visible,
.qs-tour__close:focus-visible,
.qs-tour__link:focus-visible {
    outline: 2px solid #2B69E7;
    outline-offset: 2px;
}

body.darkside .qs-tour {
    background: #333333;
    border-color: #4b5b73;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
}

body.darkside .qs-tour__head {
    border-bottom-color: #4b5b73;
}

body.darkside .qs-tour__title {
    color: #f2f5f9;
}

body.darkside .qs-tour__muted,
body.darkside .qs-tour__note,
body.darkside .qs-tour__compact-meta {
    color: #c7d1dc;
}

body.darkside .qs-tour__close {
    color: #c7d1dc;
}

body.darkside .qs-tour__btn {
    background: #262626;
    border-color: #475569;
    color: #e5e7eb;
}

body.darkside .qs-tour__btn:hover {
    border-color: #2B69E7;
    color: #8db5ff;
}

body.darkside .qs-tour__btn.danger:hover {
    border-color: #ef4444;
    color: #fca5a5;
}

body.darkside .qs-tour__step {
    background: #333333;
    border-color: #445066;
}

body.darkside .qs-tour__step.done {
    border-color: #1f7a3a;
    background: rgba(19, 98, 44, .35);
}

body.darkside .qs-tour__link {
    color: #e5e7eb;
}

body.darkside .qs-tour__step.done .qs-tour__link {
    color: #7ae79f;
}

body.darkside .qs-tour__link:hover {
    color: #8db5ff;
}

@keyframes qsTourIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.qs-tour-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .82);
    backdrop-filter: blur(2px);
    padding: 16px;
}

.qs-tour-modal.open {
    display: flex;
    animation: qsTourModalFade .18s ease-out;
}

.qs-tour-modal__card {
    width: min(540px, calc(100vw - 24px));
    border-radius: 18px;
    border: 0;
    box-shadow: 0 22px 58px rgba(15, 23, 42, .35);
    background: #ffffff;
    overflow: hidden;
    transform: translateY(0);
    display: flex;
    flex-direction: column;
}

.qs-tour-modal__hero {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
}

.qs-tour-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .45);
    background: rgba(255, 255, 255, .88);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

.qs-tour-modal__close:hover {
    background: #ffffff;
    border-color: rgba(100, 116, 139, .55);
    color: #0f172a;
}

.qs-tour-modal__close .mdi {
    font-size: 18px;
    line-height: 1;
}

.qs-tour-modal__close:focus-visible {
    outline: 2px solid #2B69E7;
    outline-offset: 2px;
}

.qs-tour-modal__hero img {
    width: 100%;
    height: auto;
    object-fit: initial;
    object-position: center;
    display: block;
}

.qs-tour-modal__content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.qs-tour-modal__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    border-radius: 999px;
    background: #eef2f7;
    padding: 7px 12px;
    width: fit-content;
    margin-bottom: 10px;
}

.qs-tour-modal__badge .mdi {
    font-size: 16px;
    color: #475569;
}

.qs-tour-modal__title {
    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px 0;
}

.qs-tour-modal__body {
    font-size: 16px;
    line-height: 1.7;
    color: #334155;
    margin: 0 0 14px 0;
    flex: 1;
}

.qs-tour-modal__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

.qs-tour-modal__actions .qs-tour__btn {
    height: 40px;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background-color .14s ease, color .14s ease;
}

.qs-tour-success-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(2px);
    padding: 16px;
}

.qs-tour-success-modal.open {
    display: flex;
    animation: qsTourModalFade .18s ease-out;
}

.qs-tour-success-modal__card {
    position: relative;
    width: min(460px, calc(100vw - 24px));
    border-radius: 18px;
    border: 0;
    box-shadow: 0 22px 58px rgba(15, 23, 42, .35);
    background: #ffffff;
    padding: 26px 24px 22px;
    text-align: center;
}

.qs-tour-success-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #d2dbe8;
    background: #ffffff;
    color: #5f6f86;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qs-tour-success-modal__close:hover {
    border-color: #b8c5d8;
    color: #334155;
}

.qs-tour-success-modal__icon {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    margin: 0 auto 12px;
    background: #eafaf1;
    color: #15803d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qs-tour-success-modal__icon .mdi {
    font-size: 30px;
    line-height: 1;
}

.qs-tour-success-modal__title {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    color: #0f172a;
}

.qs-tour-success-modal__body {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.65;
    color: #334155;
}

.qs-tour-success-modal__actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.qs-tour-success-modal__actions .qs-tour__btn {
    min-width: 140px;
    height: 40px;
}

.qs-tour-modal__actions .qs-tour__btn.primary {
    background: #2B69E7;
    border-color: #2B69E7;
    color: #fff;
    box-shadow: 0 6px 14px rgba(43, 105, 231, .28);
}

.qs-tour-modal__actions .qs-tour__btn.primary:hover {
    border-color: #1e40af;
    color: #fff;
    box-shadow: 0 8px 16px rgba(43, 105, 231, .32);
    transform: translateY(-1px);
}

.qs-tour-modal__actions .qs-tour__btn:not(.primary):not(.danger) {
    background: #ffffff;
    border-color: #d1d9e6;
    color: #334155;
}

.qs-tour-modal__actions .qs-tour__btn:not(.primary):not(.danger):hover {
    background: #f8fafc;
    border-color: #b8c5d8;
    color: #0f172a;
}

.qs-tour-modal__actions .qs-tour__btn.danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #b42336;
}

.qs-tour-modal__actions .qs-tour__btn.danger:hover {
    background: #ffe4e8;
    border-color: #fda4af;
    color: #9f1239;
}

body.darkside .qs-tour-modal__card {
    background: #2b2f35;
    border-color: #3d4b63;
}

body.darkside .qs-tour-modal__hero {
    background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(30,58,138,.1));
}

body.darkside .qs-tour-modal__close {
    background: rgba(30, 41, 59, .8);
    border-color: rgba(148, 163, 184, .35);
    color: #e2e8f0;
}

body.darkside .qs-tour-modal__close:hover {
    background: rgba(15, 23, 42, .94);
    border-color: rgba(148, 163, 184, .55);
    color: #f8fafc;
}

body.darkside .qs-tour-modal__badge {
    background: rgba(59,130,246,.2);
    color: #dbeafe;
}

body.darkside .qs-tour-modal__badge .mdi {
    color: #93c5fd;
}

body.darkside .qs-tour-modal__title {
    color: #f8fafc;
}

body.darkside .qs-tour-modal__body {
    color: #d1d5db;
}

body.darkside .qs-tour-modal__actions .qs-tour__btn:not(.primary):not(.danger) {
    background: #22272f;
    border-color: #3a4759;
    color: #e2e8f0;
}

body.darkside .qs-tour-modal__actions .qs-tour__btn:not(.primary):not(.danger):hover {
    background: #2a3340;
    border-color: #4b5f77;
    color: #f8fafc;
}

body.darkside .qs-tour-modal__actions .qs-tour__btn.danger {
    background: rgba(190, 24, 93, .18);
    border-color: rgba(244, 114, 182, .38);
    color: #fda4af;
}

body.darkside .qs-tour-modal__actions .qs-tour__btn.danger:hover {
    background: rgba(190, 24, 93, .28);
    border-color: rgba(251, 113, 133, .46);
    color: #fecdd3;
}

body.darkside .qs-tour-success-modal__card {
    background: #2b2f35;
}

body.darkside .qs-tour-success-modal__close {
    background: #1f2937;
    border-color: #3f4b5f;
    color: #c7d1dc;
}

body.darkside .qs-tour-success-modal__close:hover {
    background: #111827;
    border-color: #56657f;
    color: #f3f4f6;
}

body.darkside .qs-tour-success-modal__icon {
    background: rgba(22, 163, 74, .2);
    color: #86efac;
}

body.darkside .qs-tour-success-modal__title {
    color: #f8fafc;
}

body.darkside .qs-tour-success-modal__body {
    color: #d1d5db;
}

@keyframes qsTourModalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 640px) {
    .qs-tour {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100vw - 24px);
    }

    .qs-tour__body {
        padding: 10px 12px;
    }

    .qs-tour-modal__card {
        width: calc(100vw - 16px);
    }

    .qs-tour-modal__hero {
        height: auto;
    }

    .qs-tour-modal__content {
        padding: 20px;
    }

    .qs-tour-modal__title {
        font-size: 20px;
    }

    .qs-tour-modal__body {
        font-size: 15px;
    }

    .qs-tour-modal__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .qs-tour-modal__actions .qs-tour__btn {
        width: 100%;
    }

    .qs-tour-success-modal__card {
        width: calc(100vw - 16px);
        padding: 24px 18px 18px;
    }

    .qs-tour-success-modal__title {
        font-size: 21px;
    }
}
