:root {
    --nsq-guide-blue: #064a8f;
    --nsq-guide-cyan: #00bddd;
    --nsq-guide-orange: #ff8a00;
    --nsq-guide-ink: #0f2238;
    --nsq-guide-muted: #64748b;
    --nsq-guide-line: #d8e4ef;
    --nsq-guide-ok: #00a651;
    --nsq-guide-warning: #f5b700;
    --nsq-guide-risk: #d92d20;
    --nsq-guide-info: #1683d8;
}

.nsq-guide-root,
.nsq-guide-root * {
    box-sizing: border-box;
}

.nsq-help-launcher {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 15000;
    min-width: 112px;
    min-height: 54px;
    padding: 8px 15px;
    display: grid;
    grid-template-columns: 34px auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 9px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--nsq-guide-blue), var(--nsq-guide-cyan) 58%, var(--nsq-guide-orange));
    box-shadow: 0 18px 44px rgba(6,74,143,.32);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.nsq-help-launcher:hover,
.nsq-help-launcher:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 24px 56px rgba(6,74,143,.40);
    outline: 3px solid rgba(255,138,0,.24);
    outline-offset: 2px;
}

.nsq-help-launcher > i {
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255,255,255,.18);
    font-size: 1.1rem;
}

.nsq-help-launcher span {
    align-self: end;
    font-size: .82rem;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
}

.nsq-help-launcher small {
    align-self: start;
    color: rgba(255,255,255,.78);
    font-size: .68rem;
    font-weight: 800;
}

.nsq-help-backdrop {
    position: fixed;
    inset: 0;
    z-index: 15980;
    background: rgba(4,14,28,.42);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.nsq-help-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.nsq-help-center {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 16000;
    width: min(470px, 100vw);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--nsq-guide-ink);
    background: linear-gradient(180deg, #fff, #f7fbff);
    border-left: 1px solid rgba(6,74,143,.12);
    box-shadow: -28px 0 70px rgba(2,17,34,.22);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform .24s cubic-bezier(.2,.8,.2,1), visibility .24s ease;
}

.nsq-help-center.is-open {
    transform: translateX(0);
    visibility: visible;
}

.nsq-help-head {
    min-height: 112px;
    padding: 22px 22px 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: #fff;
    background: radial-gradient(circle at 90% 0%, rgba(255,138,0,.35), transparent 16rem), linear-gradient(135deg, #052f5e, var(--nsq-guide-blue), #0077b8);
}

.nsq-help-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #ffd9ad;
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .14em;
}

.nsq-help-head h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 950;
    letter-spacing: -.03em;
}

.nsq-help-head p {
    margin: 6px 0 0;
    color: #d9efff;
    font-size: .86rem;
    font-weight: 700;
}

.nsq-icon-button,
.nsq-tour-close {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 13px;
    color: #fff;
    background: rgba(255,255,255,.13);
    cursor: pointer;
}

.nsq-help-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    overscroll-behavior: contain;
}

.nsq-help-primary,
.nsq-help-section,
.nsq-help-details,
.nsq-help-settings {
    margin-bottom: 14px;
    border: 1px solid var(--nsq-guide-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(6,74,143,.07);
}

.nsq-help-primary {
    padding: 16px;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    align-items: center;
    border-color: rgba(255,138,0,.28);
    background: radial-gradient(circle at 100% 0%, rgba(255,138,0,.12), transparent 13rem), #fff;
}

.nsq-help-primary-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--nsq-guide-blue), var(--nsq-guide-cyan));
    font-size: 1.25rem;
}

.nsq-help-primary h3,
.nsq-help-section h3 {
    margin: 0 0 5px;
    color: var(--nsq-guide-blue);
    font-size: .84rem;
    font-weight: 950;
    letter-spacing: .06em;
}

.nsq-help-primary p {
    margin: 0;
    color: var(--nsq-guide-muted);
    font-size: .82rem;
    line-height: 1.45;
}

.nsq-help-primary .nsq-primary-button {
    grid-column: 1 / -1;
    width: 100%;
}

.nsq-primary-button,
.nsq-secondary-button,
.nsq-link-button,
.nsq-help-actions button {
    min-height: 42px;
    padding: 0 15px;
    border-radius: 13px;
    font-size: .78rem;
    font-weight: 950;
    cursor: pointer;
}

.nsq-primary-button {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, var(--nsq-guide-blue), #0879c8, var(--nsq-guide-orange));
    box-shadow: 0 12px 25px rgba(6,74,143,.20);
}

.nsq-secondary-button,
.nsq-help-actions button {
    border: 1px solid var(--nsq-guide-line);
    color: var(--nsq-guide-blue);
    background: #fff;
}

.nsq-link-button {
    border: 0;
    color: var(--nsq-guide-muted);
    background: transparent;
}

.nsq-help-section {
    padding: 16px;
}

.nsq-semaphore-grid {
    display: grid;
    gap: 9px;
}

.nsq-semaphore {
    min-height: 64px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 12px 92px 1fr;
    gap: 9px;
    align-items: center;
    border-radius: 14px;
    background: #f8fbff;
}

.nsq-semaphore > i {
    width: 10px;
    height: 10px;
    border-radius: 99px;
    box-shadow: 0 0 0 5px rgba(0,0,0,.05);
}

.nsq-semaphore strong {
    font-size: .71rem;
    font-weight: 950;
}

.nsq-semaphore span {
    color: var(--nsq-guide-muted);
    font-size: .74rem;
    line-height: 1.35;
}

.nsq-semaphore-ok > i { background: var(--nsq-guide-ok); }
.nsq-semaphore-warning > i { background: var(--nsq-guide-warning); }
.nsq-semaphore-risk > i { background: var(--nsq-guide-risk); }
.nsq-semaphore-info > i { background: var(--nsq-guide-info); }

.nsq-context-tips {
    margin: 0;
    padding-left: 20px;
    color: var(--nsq-guide-muted);
    font-size: .82rem;
    line-height: 1.5;
}

.nsq-context-tips li + li {
    margin-top: 7px;
}

.nsq-help-details {
    overflow: hidden;
}

.nsq-help-details summary {
    padding: 15px 16px;
    color: var(--nsq-guide-blue);
    font-size: .82rem;
    font-weight: 950;
    letter-spacing: .05em;
    cursor: pointer;
}

.nsq-help-details dl {
    margin: 0;
    padding: 0 16px 16px;
}

.nsq-help-details dl > div {
    padding: 10px 0;
    border-top: 1px solid #edf2f7;
}

.nsq-help-details dt {
    color: var(--nsq-guide-ink);
    font-size: .79rem;
    font-weight: 900;
}

.nsq-help-details dd {
    margin: 3px 0 0;
    color: var(--nsq-guide-muted);
    font-size: .76rem;
    line-height: 1.4;
}

.nsq-help-settings {
    padding: 15px;
}

.nsq-help-settings label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--nsq-guide-muted);
    font-size: .78rem;
    line-height: 1.4;
}

.nsq-help-settings input {
    margin-top: 3px;
}

.nsq-help-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 13px;
}

.nsq-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

.nsq-tour-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.nsq-tour-spotlight {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255,255,255,.96);
    border-radius: 18px;
    box-shadow: 0 0 0 9999px rgba(2,10,22,.72), 0 0 0 7px rgba(0,189,221,.30), 0 18px 48px rgba(0,0,0,.30);
    transition: left .24s ease, top .24s ease, width .24s ease, height .24s ease, border-radius .24s ease;
}

.nsq-tour-card {
    position: fixed;
    z-index: 20010;
    width: min(430px, calc(100vw - 24px));
    max-height: min(560px, calc(100dvh - 24px));
    overflow-y: auto;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 22px;
    color: var(--nsq-guide-ink);
    background: linear-gradient(180deg, #fff, #f7fbff);
    box-shadow: 0 28px 80px rgba(0,0,0,.38);
    pointer-events: auto;
}

.nsq-tour-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.nsq-tour-meta > span {
    color: var(--nsq-guide-orange);
    font-size: .69rem;
    font-weight: 950;
    letter-spacing: .12em;
}

.nsq-tour-close {
    width: 34px;
    height: 34px;
    color: var(--nsq-guide-blue);
    border-color: var(--nsq-guide-line);
    background: #fff;
}

.nsq-tour-card h2 {
    margin: 10px 0 7px;
    color: var(--nsq-guide-blue);
    font-size: 1.28rem;
    font-weight: 950;
    letter-spacing: -.02em;
}

.nsq-tour-card > p {
    margin: 0;
    color: #334155;
    font-size: .92rem;
    line-height: 1.55;
}

.nsq-tour-interpretation {
    margin-top: 12px;
    padding: 11px 12px;
    border-left: 4px solid var(--nsq-guide-orange);
    border-radius: 10px;
    color: #5b3b00;
    background: #fff7e9;
    font-size: .80rem;
    line-height: 1.45;
}

.nsq-tour-interpretation:empty {
    display: none;
}

.nsq-tour-progress {
    display: flex;
    gap: 6px;
    margin: 16px 0 12px;
}

.nsq-tour-progress i {
    height: 5px;
    flex: 1;
    border-radius: 99px;
    background: #dbe6ef;
}

.nsq-tour-progress i.is-active,
.nsq-tour-progress i.is-complete {
    background: linear-gradient(90deg, var(--nsq-guide-blue), var(--nsq-guide-cyan), var(--nsq-guide-orange));
}

.nsq-tour-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
}

.nsq-guide-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 21000;
    max-width: min(520px, calc(100vw - 28px));
    padding: 12px 16px;
    border-radius: 14px;
    color: #fff;
    background: #082d55;
    box-shadow: 0 18px 44px rgba(0,0,0,.24);
    font-size: .84rem;
    font-weight: 800;
    opacity: 0;
    transform: translate(-50%, 20px);
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.nsq-guide-toast.is-open {
    opacity: 1;
    transform: translate(-50%, 0);
    visibility: visible;
}

body.nsq-guide-lock {
    overflow: hidden !important;
}

html[data-theme="dark"] .nsq-help-center,
html[data-theme="dark"] .nsq-tour-card {
    color: #eef7ff;
    background: linear-gradient(180deg, #0f1d2e, #0a1523);
    border-color: rgba(255,255,255,.12);
}

html[data-theme="dark"] .nsq-help-primary,
html[data-theme="dark"] .nsq-help-section,
html[data-theme="dark"] .nsq-help-details,
html[data-theme="dark"] .nsq-help-settings {
    background: #132235;
    border-color: rgba(255,255,255,.10);
}

html[data-theme="dark"] .nsq-semaphore {
    background: #0d1b2c;
}

html[data-theme="dark"] .nsq-tour-card > p,
html[data-theme="dark"] .nsq-context-tips,
html[data-theme="dark"] .nsq-help-primary p,
html[data-theme="dark"] .nsq-help-details dd,
html[data-theme="dark"] .nsq-help-settings label,
html[data-theme="dark"] .nsq-semaphore span {
    color: #aebed0;
}

@media (max-width: 680px) {
    .nsq-help-launcher {
        min-width: 54px;
        width: 54px;
        padding: 8px;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .nsq-help-launcher > i {
        grid-row: auto;
        width: 36px;
        height: 36px;
        margin: auto;
    }

    .nsq-help-launcher span,
    .nsq-help-launcher small {
        display: none;
    }

    .nsq-help-center {
        width: 100vw;
    }

    .nsq-tour-card {
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        top: auto !important;
        width: auto;
        max-height: 48dvh;
    }

    .nsq-tour-actions {
        grid-template-columns: 1fr 1fr;
    }

    .nsq-tour-actions .nsq-link-button {
        order: 3;
        grid-column: 1 / -1;
    }

    .nsq-help-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nsq-help-launcher,
    .nsq-help-backdrop,
    .nsq-help-center,
    .nsq-tour-overlay,
    .nsq-tour-spotlight,
    .nsq-guide-toast {
        transition: none !important;
    }
}
