.ai-assistant-launcher {
    position: fixed;
    z-index: 9998;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: #F0460E;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(240, 70, 14, .35);
    transition: transform .15s ease;
}

.ai-assistant-launcher:hover {
    transform: translateY(-2px);
}

.ai-assistant-launcher svg {
    width: 26px;
    height: 26px;
}

.ai-assistant-launcher .ai-assistant-launcher__close {
    display: none;
}

.ai-assistant-launcher[data-open="true"] .ai-assistant-launcher__open {
    display: none;
}

.ai-assistant-launcher[data-open="true"] .ai-assistant-launcher__close {
    display: block;
}

.ai-assistant-panel {
    position: fixed;
    z-index: 9999;
    bottom: 94px;
    right: 24px;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.ai-assistant-panel[data-open="true"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ai-assistant-panel__header {
    background: #101010;
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-assistant-panel__header-info {
    flex: 1;
}

.ai-assistant-panel__voice-toggle {
    border: 1px solid rgba(255, 255, 255, .25);
    background: transparent;
    color: rgba(255, 255, 255, .7);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.ai-assistant-panel__voice-toggle svg {
    width: 15px;
    height: 15px;
}

.ai-assistant-panel__voice-toggle[data-active="true"] {
    background: #F0460E;
    border-color: #F0460E;
    color: #fff;
}

.ai-assistant-panel__handoff {
    border: 1px solid rgba(255, 255, 255, .25);
    background: transparent;
    color: rgba(255, 255, 255, .85);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 7px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    white-space: nowrap;
}

.ai-assistant-panel__handoff svg {
    width: 12px;
    height: 12px;
}

.ai-assistant-panel__handoff:hover {
    border-color: #F0460E;
    color: #fff;
}

.ai-assistant-panel__handoff:disabled {
    opacity: .5;
    cursor: default;
}

.ai-assistant-msg--system {
    align-self: center;
    background: transparent;
    color: #8a8681;
    font-size: 11.5px;
    text-align: center;
    max-width: 100%;
}

.ai-assistant-panel__header-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3ddc84;
    flex-shrink: 0;
}

.ai-assistant-panel__header-title {
    font-weight: 700;
    font-size: 15px;
}

.ai-assistant-panel__header-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
}

.ai-assistant-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #F7F7F5;
}

.ai-assistant-msg {
    max-width: 85%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.ai-assistant-msg--user {
    align-self: flex-end;
    background: #F0460E;
    color: #fff;
    border-bottom-right-radius: 3px;
}

.ai-assistant-msg--assistant {
    align-self: flex-start;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #ece9e6;
    border-bottom-left-radius: 3px;
}

.ai-assistant-msg--typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 14px;
}

.ai-assistant-msg--typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #bbb;
    animation: aiAssistantTyping 1.2s infinite ease-in-out;
}

.ai-assistant-msg--typing span:nth-child(2) { animation-delay: .15s; }
.ai-assistant-msg--typing span:nth-child(3) { animation-delay: .3s; }

@keyframes aiAssistantTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.ai-assistant-refs {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 85%;
}

.ai-assistant-refs a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #ece9e6;
    color: #F0460E;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease;
}

.ai-assistant-refs a:hover {
    border-color: #F0460E;
}

.ai-assistant-panel__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #ece9e6;
    background: #fff;
}

.ai-assistant-panel__input {
    flex: 1;
    border: 1px solid #e0ddd9;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13.5px;
    font-family: inherit;
    resize: none;
}

.ai-assistant-panel__input:focus {
    outline: none;
    border-color: #F0460E;
}

.ai-assistant-panel__send,
.ai-assistant-panel__mic {
    border: none;
    background: #F0460E;
    color: #fff;
    width: 40px;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-panel__mic {
    background: #fff;
    border: 1px solid #e0ddd9;
    color: #6b6b6b;
}

.ai-assistant-panel__mic[data-listening="true"] {
    background: #F0460E;
    border-color: #F0460E;
    color: #fff;
    animation: aiAssistantPulse 1.2s infinite;
}

@keyframes aiAssistantPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 70, 14, .4); }
    50% { box-shadow: 0 0 0 6px rgba(240, 70, 14, 0); }
}

.ai-assistant-panel__send:disabled {
    opacity: .5;
    cursor: default;
}

@media (max-width: 480px) {
    .ai-assistant-panel {
        right: 16px;
        bottom: 88px;
        width: calc(100vw - 32px);
    }

    .ai-assistant-launcher {
        right: 16px;
        bottom: 16px;
    }
}
