#aibot-widget,
#aibot-widget * {
    box-sizing: border-box;
}

#aibot-widget {
    --aibot-brand: #12336b;
    --aibot-text: #172033;
    --aibot-title: #fff;
    --aibot-header-text: #fff;
    --aibot-chat-bg: #f7f8fb;
    --aibot-bot-bg: #fff;
    --aibot-bot-text: #172033;
    --aibot-user-text: #fff;
    --aibot-input-bg: #f4f6f9;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

#aibot-chat-launcher {
    align-items: center;
    background: linear-gradient(145deg, color-mix(in srgb, var(--aibot-brand), white 12%), var(--aibot-brand));
    border: 0;
    border-radius: 50%;
    bottom: 28px;
    box-shadow: 0 14px 34px color-mix(in srgb, var(--aibot-brand), transparent 65%);
    color: var(--aibot-header-text);
    cursor: pointer;
    display: flex;
    height: 62px;
    justify-content: center;
    padding: 0;
    position: fixed;
    right: 28px;
    transition: transform .2s ease, box-shadow .2s ease;
    width: 62px;
    z-index: 999998;
}

#aibot-chat-launcher:hover {
    box-shadow: 0 17px 38px color-mix(in srgb, var(--aibot-brand), transparent 55%);
    transform: translateY(-3px);
}

#aibot-chat-launcher:focus-visible,
#aibot-close:focus-visible,
#aibot-send-message:focus-visible,
#aibot-user-message:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--aibot-brand), white 55%);
    outline-offset: 2px;
}

#aibot-chat-launcher svg {
    fill: currentColor;
    height: 29px;
    width: 29px;
}

#aibot-chat-tip {
    background: #fff;
    border: 1px solid #e6e9ef;
    border-radius: 11px;
    bottom: 38px;
    box-shadow: 0 9px 26px rgba(21, 32, 54, .13);
    color: var(--aibot-text);
    font-size: 13px;
    font-weight: 600;
    max-width: 240px;
    opacity: 1;
    padding: 9px 13px;
    pointer-events: none;
    position: fixed;
    right: 102px;
    transform: translateX(0);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 999997;
}

#aibot-chat-tip.is-hidden {
    opacity: 0;
    transform: translateX(8px);
}

#aibot-chat-box {
    background: #fff;
    border: 1px solid rgba(23, 32, 51, .1);
    border-radius: 20px;
    bottom: 104px;
    box-shadow: 0 24px 70px rgba(21, 32, 54, .22);
    display: flex;
    flex-direction: column;
    height: min(590px, calc(100vh - 135px));
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    right: 28px;
    transform: translateY(15px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s ease;
    visibility: hidden;
    width: min(390px, calc(100vw - 32px));
    z-index: 999999;
}

#aibot-chat-box.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    visibility: visible;
}

.aibot-header {
    align-items: center;
    background: linear-gradient(135deg, var(--aibot-brand), color-mix(in srgb, var(--aibot-brand), black 20%));
    color: var(--aibot-header-text);
    display: flex;
    min-height: 78px;
    padding: 15px 16px;
}

.aibot-avatar {
    align-items: center;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 13px;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    height: 44px;
    justify-content: center;
    margin-right: 12px;
    width: 44px;
}

.aibot-header > div {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.aibot-header strong {
    color: var(--aibot-title);
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aibot-header small {
    align-items: center;
    display: flex;
    font-size: 12px;
    font-weight: 400;
    opacity: .82;
}

.aibot-header small i {
    background: #6ee7a8;
    border-radius: 50%;
    height: 7px;
    margin-right: 6px;
    width: 7px;
}

#aibot-close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font: 300 29px/1 Arial, sans-serif;
    height: 38px;
    justify-content: center;
    margin-left: 8px;
    padding: 0;
    width: 38px;
}

#aibot-close:hover {
    background: rgba(255,255,255,.12);
}

.aibot-body {
    background: var(--aibot-chat-bg);
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 11px;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 15px;
    scrollbar-color: #cbd1dc transparent;
    scrollbar-width: thin;
}

.aibot-message {
    border-radius: 17px;
    box-shadow: 0 2px 7px rgba(23, 32, 51, .05);
    color: var(--aibot-bot-text);
    font-size: 14px;
    max-width: 84%;
    overflow-wrap: anywhere;
    padding: 10px 13px;
    white-space: pre-wrap;
    width: fit-content;
}

.aibot-message.user {
    align-self: flex-end;
    background: var(--aibot-brand);
    border-bottom-right-radius: 5px;
    color: var(--aibot-user-text);
}

.aibot-message.bot {
    align-self: flex-start;
    background: var(--aibot-bot-bg);
    border: 1px solid #e8ebf0;
    border-bottom-left-radius: 5px;
}

.aibot-message a {
    color: var(--aibot-brand);
    font-weight: 600;
}

.aibot-typing {
    background: var(--aibot-chat-bg);
    height: 27px;
    padding: 2px 20px 8px;
}

.aibot-typing span {
    animation: aibot-bounce 1.25s infinite ease-in-out;
    background: #9ca4b2;
    border-radius: 50%;
    display: inline-block;
    height: 6px;
    margin-right: 3px;
    width: 6px;
}

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

@keyframes aibot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.aibot-input {
    align-items: flex-end;
    background: #fff;
    border-top: 1px solid #e9ebef;
    display: flex;
    gap: 9px;
    margin: 0;
    padding: 12px;
}

#aibot-widget #aibot-user-message {
    background: var(--aibot-input-bg);
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--aibot-bot-text);
    flex: 1 1 auto;
    font-family: inherit;
    font-size: 15px;
    height: 44px !important;
    line-height: 20px;
    margin: 0;
    max-height: 110px !important;
    min-height: 44px !important;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 12px 14px;
    resize: none;
    width: 100%;
}

#aibot-widget #aibot-user-message::placeholder {
    color: #8a93a3;
    line-height: 20px;
    opacity: 1;
}

#aibot-widget #aibot-user-message:focus {
    background: #fff;
    border-color: color-mix(in srgb, var(--aibot-brand), white 45%);
    box-shadow: none;
}

#aibot-widget #aibot-user-message:disabled {
    opacity: .65;
}

#aibot-send-message {
    align-items: center;
    background: var(--aibot-brand);
    border: 0;
    border-radius: 13px;
    color: var(--aibot-header-text);
    cursor: pointer;
    display: flex;
    flex: 0 0 44px;
    height: 44px;
    justify-content: center;
    margin: 0;
    padding: 0;
    transition: opacity .2s ease, transform .2s ease;
}

#aibot-send-message:hover {
    transform: translateY(-1px);
}

#aibot-send-message:disabled {
    cursor: wait;
    opacity: .55;
    transform: none;
}

#aibot-send-message svg {
    fill: currentColor;
    height: 20px;
    width: 20px;
}

.aibot-footer {
    background: #fff;
    color: #87909f;
    font-size: 10px;
    letter-spacing: .02em;
    padding: 0 12px 9px;
    text-align: center;
}

@media (max-width: 600px) {
    #aibot-chat-launcher {
        bottom: 18px;
        height: 56px;
        right: 18px;
        width: 56px;
    }

    #aibot-chat-tip {
        display: none;
    }

    #aibot-chat-box {
        border-radius: 16px;
        bottom: 84px;
        height: calc(100dvh - 104px);
        max-height: 650px;
        right: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #aibot-chat-box,
    #aibot-chat-launcher,
    #aibot-chat-tip {
        transition: none;
    }

    .aibot-typing span {
        animation: none;
    }
}