:root {
    --chatbot-bg: #0b1220;
    --chatbot-panel: rgba(15, 23, 42, 0.96);
    --chatbot-border: rgba(255, 255, 255, 0.08);
    --chatbot-text: #e2e8f0;
    --chatbot-muted: #94a3b8;
    --chatbot-surface: rgba(255, 255, 255, 0.03);
    --chatbot-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
    --chatbot-radius: 18px;
}

.chatbot-root {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 40;
    display: grid;
    gap: 10px;
    color: var(--chatbot-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.chatbot-root.is-left {
    left: 18px;
    right: auto;
}

.chatbot-root.is-center {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.chatbot-launcher,
.chatbot-sticky {
    border: 1px solid var(--chatbot-border);
    background: var(--chatbot-panel);
    color: var(--chatbot-text);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}

.chatbot-launcher:hover,
.chatbot-sticky:hover {
    transform: translateY(-1px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.chatbot-launcher-avatar,
.chatbot-sticky-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1)), var(--assistant-color, #22d3ee);
    color: #0b1220;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.chatbot-launcher-text {
    display: grid;
    gap: 4px;
    align-items: center;
}

.chatbot-launcher-title {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.chatbot-launcher-bubble {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--chatbot-border);
    font-size: 13px;
    color: var(--chatbot-muted);
}

.chatbot-sticky {
    display: none;
    min-height: 58px;
    justify-content: center;
    padding: 10px 16px;
}

.chatbot-sticky-label {
    display: none;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.chatbot-window {
    position: fixed;
    inset-inline-end: 18px;
    bottom: 88px;
    width: min(360px, calc(100vw - 24px));
    max-height: 72vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(140deg, rgba(10, 15, 30, 0.98), rgba(12, 18, 32, 0.95));
    border: 1px solid var(--chatbot-border);
    border-radius: var(--chatbot-radius);
    box-shadow: var(--chatbot-shadow);
    overflow: hidden;
}

.chatbot-window[hidden] {
    display: none;
}

.chatbot-window-header {
    padding: 16px 18px 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.chatbot-eyebrow {
    font-size: 12px;
    color: var(--assistant-color, #22d3ee);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.chatbot-headline {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.chatbot-subtitle {
    margin: 6px 0 0;
    color: var(--chatbot-muted);
    font-size: 14px;
    line-height: 1.4;
}

.chatbot-close {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--chatbot-border);
    background: var(--chatbot-surface);
    color: var(--chatbot-text);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.02);
}

.chatbot-window-body {
    padding: 0 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-messages {
    min-height: 200px;
    max-height: 42vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px;
}

.chatbot-message {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: flex-start;
}

.chatbot-message .avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #0b1220;
    background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1)), var(--assistant-color, #22d3ee);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.chatbot-message.user .avatar {
    background: rgba(255, 255, 255, 0.08);
    color: var(--chatbot-text);
}

.chatbot-bubble {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--chatbot-border);
    background: rgba(255, 255, 255, 0.04);
    line-height: 1.5;
    font-size: 15px;
}

.chatbot-message.bot .chatbot-bubble {
    background: linear-gradient(120deg, var(--assistant-color, #22d3ee), #6366f1);
    color: #0b1220;
    font-weight: 600;
    border: none;
}

.chatbot-options {
    display: grid;
    gap: 8px;
}

.chatbot-option {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--chatbot-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--chatbot-text);
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.18s ease, background 0.18s ease;
}

.chatbot-option:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.07);
}

.chatbot-window-footer {
    padding: 10px 16px 16px;
    border-top: 1px solid var(--chatbot-border);
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    gap: 10px;
}

.chatbot-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.chatbot-input-row input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--chatbot-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--chatbot-text);
    font-size: 15px;
}

.chatbot-input-row input:focus {
    outline: 2px solid var(--assistant-color, #22d3ee);
    outline-offset: 2px;
    border-color: transparent;
}

.chatbot-submit {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--chatbot-border);
    background: var(--assistant-color, #22d3ee);
    color: #0b1220;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.18s ease;
}

.chatbot-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(34, 211, 238, 0.3);
}

.chatbot-helper {
    margin: 0;
    font-size: 13px;
    color: var(--chatbot-muted);
    min-height: 18px;
}

.chatbot-helper.is-error {
    color: #f43f5e;
}

.chatbot-typing {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.chatbot-typing span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0.5;
    animation: chatbot-bounce 1.2s ease-in-out infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.12s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.24s;
}

@keyframes chatbot-bounce {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .chatbot-root {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        padding: 0 14px calc(env(safe-area-inset-bottom, 0) + 12px);
        display: flex;
        justify-content: center;
        transform: none;
    }

    .chatbot-root.is-left {
        justify-content: flex-start;
    }

    .chatbot-root.is-right {
        justify-content: flex-end;
    }

    .chatbot-root.is-center {
        justify-content: center;
    }

    .chatbot-launcher {
        display: none;
    }

    .chatbot-sticky {
        display: inline-flex;
        width: min(520px, 100%);
        gap: 12px;
        padding: 14px 18px;
        border-radius: 16px;
        background: linear-gradient(120deg, var(--assistant-color, #22d3ee), #6366f1);
        color: #0b1220;
        box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
    }

    .chatbot-sticky-avatar {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.18);
    }

    .chatbot-sticky-label {
        display: inline-flex;
        align-items: center;
    }

    .chatbot-window {
        width: calc(100vw - 24px);
        inset-inline: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0) + 88px);
    }
}
