.chatbot-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 45;
    font-family: inherit;
}

.chatbot-toggle {
    position: relative;
    min-width: 58px;
    min-height: 58px;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.34);
}

.chatbot-toggle:hover {
    background: var(--primary-dark);
    box-shadow: 0 22px 42px rgba(37, 99, 235, 0.38);
}

.chatbot-toggle svg {
    width: 24px;
    height: 24px;
}

.chatbot-notification {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--green);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(380px, calc(100vw - 32px));
    max-height: min(640px, calc(100vh - 118px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(213, 222, 234, 0.95);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.chatbot-widget.is-open .chatbot-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    background: var(--sidebar);
    color: #ffffff;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chatbot-title-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(96, 165, 250, 0.18);
    color: #bfdbfe;
}

.chatbot-title-icon svg {
    width: 18px;
    height: 18px;
}

.chatbot-title strong,
.chatbot-title span {
    display: block;
}

.chatbot-title strong {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.2;
}

.chatbot-title span {
    margin-top: 2px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 650;
}

.chatbot-close {
    width: 32px;
    min-height: 32px;
    padding: 0;
    flex: 0 0 auto;
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    box-shadow: none;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.chatbot-close svg {
    width: 17px;
    height: 17px;
}

.chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 190px;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.chatbot-message {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 12px;
    color: #334155;
    font-size: 13px;
    line-height: 1.45;
}

.chatbot-message.assistant {
    align-self: flex-start;
    border: 1px solid var(--border);
    border-top-left-radius: 5px;
    background: #ffffff;
}

.chatbot-message.user {
    align-self: flex-end;
    border-top-right-radius: 5px;
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.chatbot-questions {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: #ffffff;
}

.chatbot-category {
    position: sticky;
    top: -12px;
    z-index: 1;
    margin: 6px 0 0;
    padding: 8px 2px 4px;
    background: #ffffff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.chatbot-category:first-child {
    margin-top: 0;
}

.chatbot-question {
    width: 100%;
    min-height: 36px;
    justify-content: flex-start;
    padding: 8px 10px;
    border-color: var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    box-shadow: none;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
}

.chatbot-question:hover {
    border-color: #bfdbfe;
    background: var(--surface-blue);
    color: var(--primary-dark);
    box-shadow: none;
    transform: translateY(-1px);
}

.chatbot-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}

.chatbot-footer span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.chatbot-reset {
    min-height: 30px;
    padding: 6px 9px;
    border-color: var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    box-shadow: none;
    font-size: 12px;
}

.chatbot-reset:hover {
    background: #ffffff;
    border-color: var(--border-strong);
    color: var(--text);
    box-shadow: none;
}

@media (max-width: 760px) {
    .chatbot-widget {
        right: 14px;
        bottom: 14px;
        left: 14px;
        display: flex;
        justify-content: flex-end;
        pointer-events: none;
    }

    .chatbot-widget > * {
        pointer-events: auto;
    }

    .chatbot-panel {
        right: 0;
        left: 0;
        width: auto;
        max-height: calc(100vh - 102px);
    }

    .chatbot-widget.is-open .chatbot-toggle {
        transform: scale(0.94);
    }

    .chatbot-messages {
        min-height: 170px;
    }
}
