.bw-ai-chat-root {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    font-family: Roboto, sans-serif;
}

.bw-ai-chat-toggle {
    background: #3a5795;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    font-size: 15px;
}

.bw-ai-chat-toggle:hover {
    background: #2d4370;
}

.bw-ai-chat-panel {
    position: absolute;
    right: 0;
    bottom: 56px;
    width: 340px;
    max-width: calc(100vw - 36px);
    height: 420px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bw-ai-chat-panel.hide {
    display: none;
}

.bw-ai-chat-header {
    background: #3a5795;
    color: #fff;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bw-ai-chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.bw-ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f5f7fa;
    min-height: 180px;
}

.bw-ai-chat-topics {
    padding: 6px 10px 4px;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    max-height: 88px;
    overflow-y: auto;
}

.bw-ai-chat-topic-btn {
    display: inline-block;
    margin: 3px 4px 3px 0;
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #3a5795;
    border-radius: 14px;
    background: #fff;
    color: #3a5795;
    cursor: pointer;
}

.bw-ai-chat-topic-btn:hover {
    background: #3a5795;
    color: #fff;
}

.bw-ai-chat-msg {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.bw-ai-chat-msg-bot {
    background: #fff;
    border: 1px solid #e0e0e0;
    margin-right: 24px;
}

.bw-ai-chat-msg-user {
    background: #dce8f7;
    border: 1px solid #c5d8ef;
    margin-left: 24px;
    text-align: right;
}

.bw-ai-chat-msg-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #a94442;
}

.bw-ai-chat-footer {
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.bw-ai-chat-input {
    width: 100%;
    resize: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    font-size: 13px;
}

.bw-ai-chat-actions {
    margin-top: 8px;
    text-align: right;
}

.bw-ai-chat-actions .btn {
    margin-left: 6px;
}

.bw-ai-chat-typing {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

@media (max-width: 480px) {
    .bw-ai-chat-panel {
        width: calc(100vw - 24px);
        height: 70vh;
        right: -6px;
    }
}
