.dk-ai-chat {
    position: fixed !important;
    right: 22px !important;
    bottom: 22px !important;
    z-index: 5000 !important;
    font-family: inherit;
}

/* Nút AI tròn */
.dk-ai-chat-toggle {
    width: 58px !important;
    height: 58px !important;
    border: 0 !important;
    border-radius: 20px !important;
    display: grid !important;
    place-items: center !important;
    gap: 1px !important;
    color: #03131d !important;
    background: linear-gradient(135deg, var(--accent, #2dd4bf), var(--accent-2, #38bdf8)) !important;
    box-shadow: 0 16px 42px rgba(45, 212, 191, 0.28) !important;
    font-weight: 950 !important;
    cursor: pointer !important;
    transition: 0.2s ease !important;
}

.dk-ai-chat-toggle:hover {
    transform: translateY(-2px) scale(1.02) !important;
}

.dk-ai-chat-toggle i {
    font-size: 19px !important;
}

.dk-ai-chat-toggle span {
    font-size: 11px !important;
    line-height: 1 !important;
}

/* Khung chat chính - nhỏ gọn */
.dk-ai-chat-panel {
    position: fixed !important;
    right: 22px !important;
    bottom: 88px !important;
    width: 350px !important;
    max-width: calc(100vw - 28px) !important;
    height: 430px !important;
    max-height: calc(100vh - 130px) !important;
    display: none !important;
    overflow: hidden !important;
    border-radius: 24px !important;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22)) !important;
    color: var(--text, #f8fbff) !important;
    background: rgba(8, 20, 38, 0.96) !important;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38) !important;
    backdrop-filter: blur(20px) !important;
}

html[data-theme="light"] .dk-ai-chat-panel {
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.16) !important;
}

.dk-ai-chat.open .dk-ai-chat-panel {
    display: flex !important;
    flex-direction: column !important;
}

/* Header */
.dk-ai-chat-header {
    flex: 0 0 auto !important;
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.18)) !important;
    background: rgba(148, 163, 184, 0.08) !important;
}

.dk-ai-chat-title {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
}

.dk-ai-chat-title strong {
    display: block !important;
    font-size: 14px !important;
    font-weight: 950 !important;
    line-height: 1.2 !important;
}

.dk-ai-chat-title small {
    display: block !important;
    margin-top: 2px !important;
    max-width: 210px !important;
    overflow: hidden !important;
    color: var(--muted, #94a3b8) !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.dk-ai-chat-avatar {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 15px !important;
    color: #03131d !important;
    background: linear-gradient(135deg, var(--accent, #2dd4bf), var(--accent-2, #38bdf8)) !important;
}

.dk-ai-chat-close {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22)) !important;
    border-radius: 13px !important;
    color: var(--muted, #94a3b8) !important;
    background: rgba(148, 163, 184, 0.10) !important;
    cursor: pointer !important;
}

/* Tin nhắn */
.dk-ai-chat-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.dk-ai-message {
    display: flex !important;
}

.dk-ai-message.bot {
    justify-content: flex-start !important;
}

.dk-ai-message.user {
    justify-content: flex-end !important;
}

.dk-ai-bubble {
    max-width: 86% !important;
    padding: 10px 12px !important;
    border-radius: 16px !important;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.2)) !important;
    color: var(--text, #f8fbff) !important;
    background: rgba(148, 163, 184, 0.11) !important;
    font-size: 12.8px !important;
    line-height: 1.45 !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

.dk-ai-message.user .dk-ai-bubble {
    color: #03131d !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--accent, #2dd4bf), var(--accent-2, #38bdf8)) !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .dk-ai-bubble {
    color: #0f172a !important;
    background: rgba(241, 245, 249, 0.96) !important;
}

/* Gợi ý */
.dk-ai-chat-suggestions {
    flex: 0 0 auto !important;
    padding: 8px 10px !important;
    display: flex !important;
    gap: 7px !important;
    overflow-x: auto !important;
    border-top: 1px solid var(--border, rgba(148, 163, 184, 0.14)) !important;
}

.dk-ai-chat-suggestions button {
    flex: 0 0 auto !important;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22)) !important;
    border-radius: 999px !important;
    padding: 7px 10px !important;
    color: var(--text, #f8fbff) !important;
    background: rgba(148, 163, 184, 0.10) !important;
    font-size: 11.5px !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

html[data-theme="light"] .dk-ai-chat-suggestions button {
    color: #0f172a !important;
    background: rgba(248, 250, 252, 0.94) !important;
}

/* Form nhập */
.dk-ai-chat-form {
    flex: 0 0 auto !important;
    padding: 10px !important;
    display: grid !important;
    grid-template-columns: 1fr 44px !important;
    gap: 9px !important;
    border-top: 1px solid var(--border, rgba(148, 163, 184, 0.16)) !important;
}

.dk-ai-chat-form input {
    width: 100% !important;
    height: 44px !important;
    min-width: 0 !important;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.26)) !important;
    border-radius: 15px !important;
    padding: 0 12px !important;
    color: var(--text, #f8fbff) !important;
    background: rgba(148, 163, 184, 0.10) !important;
    outline: none !important;
    font-size: 12.8px !important;
    font-weight: 750 !important;
}

.dk-ai-chat-form input::placeholder {
    color: var(--muted, #94a3b8) !important;
}

html[data-theme="light"] .dk-ai-chat-form input {
    color: #0f172a !important;
    background: rgba(248, 250, 252, 0.96) !important;
}

.dk-ai-chat-form button {
    width: 44px !important;
    height: 44px !important;
    border: 0 !important;
    border-radius: 16px !important;
    display: grid !important;
    place-items: center !important;
    color: #03131d !important;
    background: linear-gradient(135deg, var(--accent, #2dd4bf), var(--accent-2, #38bdf8)) !important;
    cursor: pointer !important;
}

.dk-ai-chat-form button:disabled,
.dk-ai-chat-form input:disabled {
    opacity: 0.65 !important;
    cursor: wait !important;
}

/* Laptop màn hình thấp */
@media (max-height: 760px) {
    .dk-ai-chat-panel {
        height: 380px !important;
        bottom: 82px !important;
    }

    .dk-ai-chat-title small {
        max-width: 190px !important;
    }

    .dk-ai-bubble {
        font-size: 12.3px !important;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .dk-ai-chat {
        right: 14px !important;
        bottom: 14px !important;
    }

    .dk-ai-chat-toggle {
        width: 56px !important;
        height: 56px !important;
        border-radius: 20px !important;
    }

    .dk-ai-chat-panel {
        right: 9px !important;
        bottom: 78px !important;
        width: calc(100vw - 18px) !important;
        height: 68vh !important;
        max-height: 68vh !important;
        border-radius: 22px !important;
    }

    .dk-ai-chat-title small {
        max-width: 180px !important;
    }
}