.aces-ai-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 3000;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #0F172A, #06B6D4);
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.35);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.aces-ai-launcher:hover {
    transform: translateY(-3px) scale(1.05);
}

.aces-ai-launcher.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.aces-ai-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 3001;
    width: 360px;
    height: min(560px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    font-family: 'Space Grotesk', sans-serif;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.aces-ai-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.aces-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #0F172A;
    color: #FFFFFF;
}

.aces-ai-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.aces-ai-title img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.aces-ai-title strong {
    color: #06B6D4;
}

.aces-ai-close {
    border: none;
    background: transparent;
    color: #FFFFFF;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.aces-ai-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.aces-ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F8FAFC;
}

.aces-ai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 8px 4px 16px;
}

.aces-ai-welcome img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    padding: 8px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.aces-ai-welcome h3 {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    color: #0F172A;
}

.aces-ai-welcome p {
    font-size: 13px;
    line-height: 1.5;
    color: #64748B;
}

.aces-ai-suggestions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.aces-ai-chip {
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #334155;
    font-family: inherit;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aces-ai-chip:hover {
    border-color: #06B6D4;
    color: #0F172A;
    background: rgb(211, 224, 241);
}

.aces-ai-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.aces-ai-message.user {
    align-self: flex-end;
    background: #0F172A;
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.aces-ai-message.assistant {
    align-self: flex-start;
    background: #FFFFFF;
    color: #334155;
    border: 1px solid #E2E8F0;
    border-bottom-left-radius: 4px;
}

.aces-ai-message.assistant a {
    color: #0891B2;
}

.aces-ai-message.error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #B91C1C;
}

.aces-ai-message.typing {
    display: flex;
    gap: 4px;
    padding: 14px;
}

.aces-ai-message.typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94A3B8;
    animation: aces-ai-bounce 1.2s infinite ease-in-out;
}

.aces-ai-message.typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.aces-ai-message.typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes aces-ai-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.aces-ai-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
}

.aces-ai-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    color: #0F172A;
    outline: none;
}

.aces-ai-input:focus {
    border-color: #06B6D4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.aces-ai-send {
    width: 44px;
    border: none;
    border-radius: 12px;
    background: #06B6D4;
    color: #FFFFFF;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.aces-ai-send:hover {
    background: #0891B2;
}

.aces-ai-send:disabled {
    background: #94A3B8;
    cursor: not-allowed;
}

@media screen and (max-width: 480px) {
    .aces-ai-launcher {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
        font-size: 22px;
    }

    .aces-ai-panel {
        right: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
        border-radius: 16px;
    }

    .aces-ai-input {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aces-ai-panel,
    .aces-ai-launcher {
        transition: none;
    }

    .aces-ai-message.typing span {
        animation: none;
    }
}
