.aca-chat {
    --aca-color: #2563eb;
    position: fixed;
    z-index: 999999;
    right: 20px;
    bottom: 20px;
    font-family: inherit;
}

.aca-launcher {
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--aca-color);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .26);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
}

.aca-launcher:hover,
.aca-launcher:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .32);
}

.aca-launcher-icon {
    font-size: 24px;
    line-height: 1;
}

.aca-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(370px, calc(100vw - 32px));
    min-height: 440px;
    max-height: min(600px, calc(100vh - 115px));
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
    display: none;
    flex-direction: column;
}

.aca-panel.is-open {
    display: flex;
    animation: aca-fade-in .18s ease-out;
}

.aca-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px;
    background: var(--aca-color);
    color: #fff;
}

.aca-header strong,
.aca-header span {
    display: block;
}

.aca-header strong {
    font-size: 16px;
    line-height: 1.25;
}

.aca-header span {
    margin-top: 3px;
    font-size: 12px;
    opacity: .9;
}

.aca-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 5px;
}

.aca-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aca-message {
    max-width: 84%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.aca-message--bot {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    background: #e2e8f0;
    color: #0f172a;
}

.aca-message--user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    background: var(--aca-color);
    color: #fff;
}

.aca-message--typing {
    font-style: italic;
    opacity: .7;
}

.aca-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.aca-form input {
    min-width: 0;
    flex: 1;
    padding: 10px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.aca-form input:focus {
    outline: 2px solid color-mix(in srgb, var(--aca-color) 30%, transparent);
    outline-offset: 1px;
    border-color: var(--aca-color);
}

.aca-form button {
    border: 0;
    padding: 10px 13px;
    border-radius: 9px;
    background: var(--aca-color);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.aca-form button:disabled {
    cursor: wait;
    opacity: .65;
}

@keyframes aca-fade-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .aca-chat { right: 12px; bottom: 12px; }
    .aca-panel { bottom: 68px; min-height: 390px; }
}
