.awit-cb-root {
    --awit-primary: #5b5bf0;
    --awit-radius: 18px;
    position: fixed;
    bottom: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.45;
}
.awit-cb-pos-right { right: 24px; }
.awit-cb-pos-left  { left: 24px; }

/* Launcher */
.awit-cb-launcher {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--awit-primary), color-mix(in srgb, var(--awit-primary) 70%, #000 20%));
    box-shadow: 0 8px 24px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .18s ease, box-shadow .18s ease;
}
.awit-cb-launcher:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 28px rgba(0,0,0,0.26);
}
.awit-cb-launcher-icon-close { display: none; }
.awit-cb-root.awit-cb-open .awit-cb-launcher-icon-chat { display: none; }
.awit-cb-root.awit-cb-open .awit-cb-launcher-icon-close { display: inline-flex; }

.awit-cb-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #29c46f;
    border: 2px solid #fff;
}
.awit-cb-root.awit-cb-open .awit-cb-dot { display: none; }

/* Window */
.awit-cb-window {
    position: absolute;
    bottom: 76px;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: var(--awit-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.22), 0 4px 14px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.awit-cb-pos-right .awit-cb-window { right: 0; }
.awit-cb-pos-left  .awit-cb-window { left: 0; }

.awit-cb-root.awit-cb-open .awit-cb-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.awit-cb-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px;
    background: linear-gradient(135deg, var(--awit-primary), color-mix(in srgb, var(--awit-primary) 65%, #000 20%));
    color: #fff;
    flex: 0 0 auto;
}
.awit-cb-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.25);
    flex: 0 0 auto;
}
.awit-cb-header-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.awit-cb-header-text strong { font-size: 14.5px; font-weight: 600; }
.awit-cb-status { display: flex; align-items: center; gap: 5px; font-size: 12px; opacity: .9; }
.awit-cb-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #29ffa0; display: inline-block; }
.awit-cb-header-close {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}
.awit-cb-header-close:hover { background: rgba(255,255,255,0.3); }

/* Messages */
.awit-cb-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f6f7fb;
}
.awit-cb-msg {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: awit-cb-pop .18s ease;
}
@keyframes awit-cb-pop {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.awit-cb-msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #1f2333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.awit-cb-msg-user {
    align-self: flex-end;
    background: var(--awit-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.awit-cb-msg-error {
    align-self: flex-start;
    background: #fdecea;
    color: #a3271d;
    border-bottom-left-radius: 4px;
}

.awit-cb-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.awit-cb-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b6b9c9;
    animation: awit-cb-bounce 1.1s infinite ease-in-out;
}
.awit-cb-typing span:nth-child(2) { animation-delay: .15s; }
.awit-cb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes awit-cb-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Input bar */
.awit-cb-inputbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eceef4;
    background: #fff;
}
.awit-cb-inputbar input {
    flex: 1 1 auto;
    border: 1px solid #e3e5ee;
    background: #f6f7fb;
    border-radius: 22px;
    padding: 10px 15px;
    font-size: 13.5px;
    outline: none;
    color: #1f2333;
}
.awit-cb-inputbar input:focus {
    border-color: var(--awit-primary);
    background: #fff;
}
.awit-cb-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--awit-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
    transition: transform .12s ease;
}
.awit-cb-send:hover { transform: scale(1.06); }
.awit-cb-send:disabled { opacity: .5; cursor: default; transform: none; }

.awit-cb-brand {
    text-align: center;
    font-size: 11px;
    color: #9498a8;
    padding: 6px 0 10px;
    background: #fff;
}
.awit-cb-brand a { color: #9498a8; text-decoration: none; }
.awit-cb-brand a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .awit-cb-window {
        width: calc(100vw - 24px);
        height: calc(100vh - 120px);
        bottom: 76px;
    }
}

.awit-cb-hide-mobile { display: none !important; }
