/* ================================================================
   Floating AI Button
   ================================================================ */
.aura-floating-actions {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    max-height: calc(100dvh - 24px);
}
.aura-float-ai {
    background: linear-gradient(135deg, #9333ea, #4f46e5);
    color: #fff;
    box-shadow: 0 10px 20px rgba(79,70,229,0.24);
}
.aura-float-ai:hover { transform: scale(1.05); }
.aura-float-top {
    background: rgba(255,255,255,0.9);
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}
.aura-float-top:hover {
    color: #2563eb;
    border-color: #93c5fd;
}
#ai-chat-box {
    transition: transform 0.2s, opacity 0.2s;
    display: none;
}
#ai-chat-box:not(.hidden) {
    display: flex;
    animation: auraFadeIn 0.2s ease;
}
.aura-ai-chat {
    width: 380px;
    max-width: calc(100vw - 32px);
    height: min(520px, calc(100dvh - 112px));
    max-height: calc(100dvh - 112px);
    min-height: 320px;
    margin-bottom: 12px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ede9fe;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.aura-ai-header {
    flex-shrink: 0;
    padding: 12px 14px;
    color: #fff;
    background: linear-gradient(to right,#7c3aed,#4f46e5);
}
.aura-ai-row,
.aura-ai-title,
.aura-ai-tools,
.aura-ai-inputbar,
.aura-ai-quota {
    display: flex;
    align-items: center;
}
.aura-ai-row { justify-content: space-between; }
.aura-ai-title,
.aura-ai-tools { gap: 8px; }
.aura-ai-title {
    min-width: 0;
    flex: 1;
}
.aura-ai-title h4 {
    max-width: 190px;
    margin: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aura-ai-tools { flex-shrink: 0; }
.aura-ai-tools select {
    padding: 2px 6px;
    border: 0;
    border-radius: 6px;
    outline: 0;
    color: #fff;
    background: rgba(255,255,255,.2);
    font-size: 10px;
    cursor: pointer;
}
.aura-ai-tools option { color: #333; }
.aura-ai-tools .aura-icon-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.18);
}
.aura-ai-quota {
    gap: 8px;
    margin-top: 8px;
    color: rgba(255,255,255,.8);
    font-size: 10px;
}
.aura-ai-quota-track {
    flex: 1;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.2);
}
.aura-ai-quota-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: #fff;
    transition: width .3s;
}
.aura-ai-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    flex-shrink: 0;
    max-height: 106px;
    overflow-y: auto;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
.aura-ai-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: #f8fafc;
    font-size: 12px;
}
.aura-ai-message {
    max-width: 85%;
    padding: 10px 12px;
    border: 1px solid #ede9fe;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    color: #334155;
    line-height: 1.65;
}
.aura-ai-inputbar {
    gap: 8px;
    flex-shrink: 0;
    padding: 10px 14px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}
.aura-ai-inputbar input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    outline: 0;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
}
.aura-ai-inputbar input:focus {
    border-color: #a78bfa;
    background: #fff;
}
.aura-ai-send {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #7c3aed;
    color: #fff;
}
.aura-ai-send:hover { background: #6d28d9; }

@supports not (height: 100dvh) {
    .aura-floating-actions {
        max-height: calc(100vh - 24px);
    }
    .aura-ai-chat {
        height: min(520px, calc(100vh - 112px));
        max-height: calc(100vh - 112px);
    }
}

@media (max-width: 640px) {
    .aura-floating-actions {
        right: 12px;
        bottom: 12px;
        max-height: calc(100dvh - 24px);
        gap: 10px;
    }
    .aura-ai-chat {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        height: min(500px, calc(100dvh - 88px));
        max-height: calc(100dvh - 88px);
        min-height: 300px;
        margin-bottom: 8px;
        border-radius: 14px;
    }
    .aura-ai-header {
        padding: 10px 12px;
    }
    .aura-ai-title h4 {
        max-width: 160px;
        font-size: 12px;
    }
    .aura-ai-tools select {
        max-width: 92px;
    }
    .aura-ai-quota {
        margin-top: 6px;
    }
    .aura-ai-prompts {
        max-height: 96px;
        padding: 8px 12px;
    }
    .aura-ai-messages {
        gap: 8px;
        padding: 12px;
    }
    .aura-ai-inputbar {
        padding: 9px 12px;
    }
}

