#ai-assistant-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* FAB */
#ai-assistant-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ai-primary) 0%, #a78bfa 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}

#ai-assistant-fab:hover {
    transform: scale(1.1);
}

#ai-assistant-fab .ai-fab-icon {
    font-size: 30px;
    color: white;
}

#ai-assistant-fab .ai-fab-close {
    font-size: 24px;
    color: white;
    display: none;
}

#ai-assistant-fab.active .ai-fab-icon { display: none; }
#ai-assistant-fab.active .ai-fab-close { display: block; }

/* Panel */
#ai-assistant-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#ai-assistant-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Header */
#ai-assistant-header {
    background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-secondary) 100%);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-header-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ai-header-info h4 { margin: 0; font-size: 16px; font-weight: 700; }
.ai-header-info p { margin: 2px 0 0; font-size: 12px; opacity: 0.9; display: flex; align-items: center; }

.ai-status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
}

/* Messages */
#ai-assistant-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-msg.bot {
    background: #fff;
    color: #1f2937;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ai-msg.user {
    background: var(--ai-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Markdown specific styles */
.ai-msg.bot strong { font-weight: 700; }
.ai-msg.bot a { color: var(--ai-primary); text-decoration: underline; }
.ai-msg.bot ul { padding-left: 20px; margin: 8px 0; }

/* Typing indicator */
#ai-assistant-typing {
    display: none;
    align-self: flex-start;
    padding: 12px 16px;
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    gap: 4px;
}

#ai-assistant-typing span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: ai-typing 1.4s infinite ease-in-out;
}

#ai-assistant-typing span:nth-child(2) { animation-delay: 0.2s; }
#ai-assistant-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ai-typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Chips */
#ai-assistant-chips {
    padding: 10px 15px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid #f3f4f6;
}

#ai-assistant-chips::-webkit-scrollbar { display: none; }

.ai-chip {
    padding: 8px 16px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-chip:hover {
    background: var(--ai-primary);
    color: white;
}

/* Input Area */
#ai-assistant-input-area {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#ai-assistant-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
    transition: border-color 0.2s;
}

#ai-assistant-input:focus {
    border-color: var(--ai-primary);
}

#ai-assistant-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ai-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#ai-assistant-send:hover {
    transform: scale(1.1);
}

/* Footer */
#ai-assistant-footer {
    padding: 10px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    background: #fff;
}

/* Responsive */
@media (max-width: 480px) {
    #ai-assistant-panel {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        bottom: 0;
        right: -24px;
        border-radius: 0;
    }
}
