.chatbot-root {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: Arial, sans-serif;
}

.chatbot-toggle {
    border: none;
    border-radius: 999px;
    padding: 14px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    background: #111827;
    color: #ffffff;
}

.chatbot-panel {
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 110px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
}

.chatbot-hidden {
    display: none;
}

.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.chatbot-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.chatbot-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.chatbot-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #ffffff;
}

.chatbot-message {
    margin-bottom: 12px;
    display: flex;
}

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

.chatbot-message-bot {
    justify-content: flex-start;
}

.chatbot-bubble {
    max-width: 85%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.chatbot-message-user .chatbot-bubble {
    background: #111827;
    color: #ffffff;
    border-bottom-right-radius: 6px;
}

.chatbot-message-bot .chatbot-bubble {
    background: #f3f4f6;
    color: #111827;
    border-bottom-left-radius: 6px;
}

.chatbot-sources {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
}

.chatbot-sources-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #374151;
}

.chatbot-source-item {
    margin-bottom: 4px;
}

.chatbot-source-link {
    color: #2563eb;
    text-decoration: none;
}

.chatbot-source-link:hover {
    text-decoration: underline;
}

.chatbot-footer {
    border-top: 1px solid #e5e7eb;
    padding: 12px;
    background: #ffffff;
}

.chatbot-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

.chatbot-input:focus {
    border-color: #111827;
}

.chatbot-send {
    border: none;
    border-radius: 12px;
    padding: 11px 14px;
    cursor: pointer;
    background: #111827;
    color: #ffffff;
    font-weight: 600;
}

.chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-typing {
    font-style: italic;
    color: #6b7280;
}

@media (max-width: 640px) {
    .chatbot-root {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }

    .chatbot-panel {
        width: 100%;
        height: 70vh;
        max-height: 70vh;
    }

    .chatbot-toggle {
        float: right;
    }
}

.chatbot-hidden {
  display: none !important;
}