.ai-chat-box {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 440px;
    height: 640px;
    max-height: calc(100vh - 100px);
    border-radius: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: rgba(14, 17, 28, 0.97);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.09);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}

.ai-chat-box.ai-fullscreen {
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    z-index: 999999 !important;
    transition: all 0.2s ease;
}

@media (max-width: 600px) {
    .ai-chat-box {
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        z-index: 999999 !important;
    }
    .ai-fab-hidden-mobile { display: none !important; }
}

/* ── FAB ── */
.ai-fab-custom {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35), 0 0 0 2px rgba(79,172,254,0.25);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #0d1117;
    border: 2px solid rgba(255,255,255,0.12);
    display: flex;
    justify-content: center;
    align-items: center;
}
.ai-fab-custom:hover {
    transform: scale(1.07);
    box-shadow: 0 12px 28px rgba(0,0,0,0.45), 0 0 0 2px rgba(79,172,254,0.4);
}
.ai-fab-custom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 600px) {
    .ai-fab-custom {
        bottom: 12px;
        right: 12px;
        width: 52px;
        height: 52px;
    }
}

/* ── Typing indicator ── */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
}
.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    animation: typing-bounce 1.3s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%            { transform: translateY(-7px); opacity: 1; }
}

/* ── Horizontal scroll bars (agent bar & quick actions) ── */
.ai-hscroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;   /* smooth momentum on iOS */
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.22) transparent;
}
.ai-hscroll::-webkit-scrollbar          { height: 4px; }
.ai-hscroll::-webkit-scrollbar-track    { background: transparent; }
.ai-hscroll::-webkit-scrollbar-thumb    { background: rgba(255,255,255,0.22); border-radius: 4px; }
.ai-hscroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.45); }

/* Fade-out trên cạnh phải để báo còn nội dung */
.ai-hscroll-wrap {
    position: relative;
    flex-shrink: 0;
}
.ai-hscroll-wrap::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 4px;   /* 4px = scrollbar height */
    width: 28px;
    background: linear-gradient(to right, transparent, rgba(14,17,28,0.95));
    pointer-events: none;
    border-radius: 0 8px 8px 0;
}

/* Quick action pills — messages area scrollbar */
#aiFloatingChatBox::-webkit-scrollbar       { width: 3px; }
#aiFloatingChatBox::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
