.slotscope-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    pointer-events: none;
}

.slotscope-chat-widget,
.slotscope-chat-widget * {
    box-sizing: border-box;
}

.slotscope-chat-launcher {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 250px;
    padding: 14px 18px 14px 16px;
    border: 1px solid rgba(168, 179, 220, 0.22);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(22, 28, 42, 0.98), rgba(14, 18, 28, 0.98)),
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.18) 0%, rgba(139, 92, 246, 0) 36%);
    color: #fff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    text-align: left;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.slotscope-chat-launcher:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.38);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.4);
}

.slotscope-chat-launcher__icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(139, 92, 246, 0.16));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

.slotscope-chat-launcher__icon svg {
    width: 24px;
    height: 24px;
}

.slotscope-chat-launcher__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.slotscope-chat-launcher__text strong {
    font-family: var(--font-heading);
    font-size: 15px;
    line-height: 1.1;
    color: #fff;
}

.slotscope-chat-launcher__text span {
    font-size: 12px;
    color: var(--text-secondary);
}

.slotscope-chat-launcher__pulse {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 12px;
    background: var(--accent-emerald);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    animation: slotscope-chat-pulse 1.6s infinite;
}

.slotscope-chat-panel {
    pointer-events: auto;
    width: min(390px, calc(100vw - 48px));
    max-height: min(72vh, 680px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(168, 179, 220, 0.2);
    background:
        linear-gradient(180deg, rgba(18, 23, 35, 0.98), rgba(10, 14, 22, 0.98)),
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.18) 0%, rgba(139, 92, 246, 0) 40%);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.48);
    transform-origin: bottom right;
    animation: slotscope-chat-enter 0.24s ease;
}

.slotscope-chat-panel[hidden] {
    display: none;
}

.slotscope-chat-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.slotscope-chat-panel__eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.18);
    color: #b7f8df;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.slotscope-chat-panel__title {
    margin: 0;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 18px;
    line-height: 1.2;
}

.slotscope-chat-panel__close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.slotscope-chat-panel__close:hover {
    background: rgba(255, 255, 255, 0.1);
}
.slotscope-chat-guide {
    position: sticky;
    top: 0;
    z-index: 2;
    flex: 0 0 auto;
    align-self: stretch;
    border-radius: 20px;
    border: 1px solid rgba(168, 179, 220, 0.16);
    background: rgba(14, 18, 28, 0.98);
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.slotscope-chat-guide[open] {
    background: rgba(255, 255, 255, 0.04);
}

.slotscope-chat-guide__summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    user-select: none;
}

.slotscope-chat-guide__summary-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.slotscope-chat-guide__summary-arrow {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(223, 253, 244, 0.9);
    transition: transform 0.22s ease;
}

.slotscope-chat-guide__summary-arrow svg {
    width: 18px;
    height: 18px;
}

.slotscope-chat-guide[open] .slotscope-chat-guide__summary-arrow {
    transform: rotate(180deg);
}

.slotscope-chat-guide__summary::-webkit-details-marker {
    display: none;
}

.slotscope-chat-guide__summary-label {
    color: #dffdf4;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.slotscope-chat-guide__summary-hint {
    color: var(--text-secondary);
    font-size: 12px;
}

.slotscope-chat-guide__content {
    padding: 0 16px 16px;
}


.slotscope-chat-panel__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 16px 14px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.slotscope-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding-right: 2px;
}

.slotscope-chat-message {
    display: flex;
}

.slotscope-chat-message--assistant {
    justify-content: flex-start;
}

.slotscope-chat-message--user {
    justify-content: flex-end;
}

.slotscope-chat-bubble {
    max-width: 86%;
    padding: 14px 14px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #f3f7f5;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.slotscope-chat-message--user .slotscope-chat-bubble {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.26), rgba(139, 92, 246, 0.18));
    border-color: rgba(139, 92, 246, 0.26);
}

.slotscope-chat-message--kind-welcome .slotscope-chat-bubble,
.slotscope-chat-message--kind-guide .slotscope-chat-bubble {
    background:
        linear-gradient(180deg, rgba(32, 41, 60, 0.96), rgba(18, 23, 35, 0.98)),
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0));
    border-color: rgba(139, 92, 246, 0.22);
}

.slotscope-chat-message--kind-guide .slotscope-chat-bubble__title {
    color: #87f0c8;
}

.slotscope-chat-bubble__title {
    margin-bottom: 8px;
    color: #d8c9ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.slotscope-chat-bubble__text {
    font-size: 14px;
    line-height: 1.6;
    color: #f4f7f7;
    white-space: pre-wrap;
}

.slotscope-chat-bubble__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.slotscope-chat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.slotscope-chat-link:hover {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.22);
}

.slotscope-chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.slotscope-chat-chip {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(168, 179, 220, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.slotscope-chat-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.36);
    background: rgba(139, 92, 246, 0.14);
}

.slotscope-chat-composer {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 0 16px 16px;
}

.slotscope-chat-input {
    flex: 1;
    min-height: 52px;
    max-height: 120px;
    resize: vertical;
    border-radius: 18px;
    border: 1px solid rgba(168, 179, 220, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    padding: 14px 14px;
    font: inherit;
    outline: none;
}

.slotscope-chat-input::placeholder {
    color: rgba(231, 241, 236, 0.55);
}

.slotscope-chat-input:focus {
    border-color: rgba(139, 92, 246, 0.42);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.slotscope-chat-send {
    flex: 0 0 auto;
    min-height: 52px;
    padding: 0 18px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-purple));
    color: #04130f;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.slotscope-chat-send:hover {
    transform: translateY(-1px);
}

.slotscope-chat-send:disabled {
    opacity: 0.65;
    cursor: progress;
}

.slotscope-chat-widget.is-open .slotscope-chat-launcher {
    display: none;
}

.slotscope-chat-widget.is-open .slotscope-chat-launcher__pulse {
    display: none;
}

html.slotscope-chat-lock,
html.slotscope-chat-lock body {
    overflow: hidden;
}

@keyframes slotscope-chat-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.42); }
    70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes slotscope-chat-enter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 767px) {
    .slotscope-chat-widget {
        right: 12px;
        left: 12px;
        bottom: 12px;
        align-items: stretch;
    }

    .slotscope-chat-launcher {
        min-width: 0;
        width: 100%;
    }

    .slotscope-chat-panel {
        width: 100%;
        max-height: 72vh;
        border-radius: 24px;
    }

    .slotscope-chat-bubble {
        max-width: 92%;
    }

    .slotscope-chat-composer {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .slotscope-chat-launcher,
    .slotscope-chat-panel,
    .slotscope-chat-chip,
    .slotscope-chat-send {
        transition: none;
    }

    .slotscope-chat-launcher__pulse {
        animation: none;
    }

    .slotscope-chat-panel {
        animation: none;
    }
}
