.local-ai-chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: "Inter", "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.local-ai-chat__launcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #2f6fed, #4c8dff);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 12px 24px rgba(47, 111, 237, 0.25);
    cursor: pointer;
}

.local-ai-chat__launcher-icon {
    font-size: 18px;
}

.local-ai-chat__panel {
    width: 360px;
    max-height: 520px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(17, 24, 39, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: all 0.25s ease;
}

.local-ai-chat--open .local-ai-chat__panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.local-ai-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #111827;
    color: #fff;
}

.local-ai-chat__header-title {
    font-weight: 600;
    font-size: 14px;
}

.local-ai-chat__close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.local-ai-chat__messages {
    flex: 1;
    padding: 16px 18px;
    background: #f8fafc;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.local-ai-chat__message {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.4;
}

.local-ai-chat__message--user {
    align-self: flex-end;
    background: #2f6fed;
    color: #fff;
}

.local-ai-chat__message--assistant {
    align-self: flex-start;
    background: #e2e8f0;
    color: #111827;
}

.local-ai-chat__composer {
    padding: 16px 18px 18px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.local-ai-chat__label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.local-ai-chat__input-row {
    display: flex;
    gap: 8px;
}

.local-ai-chat__input {
    flex: 1;
    border: 1px solid #cbd5f5;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
}

.local-ai-chat__send {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    background: #111827;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.local-ai-chat__status {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.local-ai-chat__status--error {
    color: #b91c1c;
}

.local-ai-chat__composer--loading .local-ai-chat__send {
    opacity: 0.6;
    cursor: wait;
}

@media (max-width: 768px) {
    .local-ai-chat {
        right: 16px;
        bottom: 16px;
    }

    .local-ai-chat__panel {
        width: min(90vw, 360px);
        max-height: 70vh;
    }
}
