.ace-chatbot-root,
.ace-chatbot-root * {
    box-sizing: border-box;
}

.ace-chatbot-root {
    position: fixed;
    z-index: 120;
    right: 20px;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: 0;
    height: 0;
    color: #172d44;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.ace-chatbot-trigger {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    padding: 0;
    transition: opacity .2s ease, transform .2s ease;
}

.ace-chatbot-trigger:hover {
    transform: translateY(-3px) scale(1.03);
}

.ace-chatbot-trigger:focus-visible {
    border-radius: 50%;
    outline: 3px solid rgba(20, 86, 217, .42);
    outline-offset: 2px;
}

.ace-chatbot-trigger img {
    width: 100%;
    height: 100%;
    display: block;
}

.ace-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(428px, calc(100vw - 40px));
    height: min(620px, calc(100vh - 40px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid #d7c2fb;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 62px rgba(40, 25, 77, .24), 0 8px 24px rgba(20, 86, 217, .12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(.97);
    transform-origin: bottom right;
    visibility: hidden;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.ace-chatbot-root.is-open .ace-chatbot-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    visibility: visible;
}

.ace-chatbot-root.is-open .ace-chatbot-trigger {
    opacity: 0;
    pointer-events: none;
    transform: scale(.82);
}

.ace-chatbot-header {
    position: relative;
    min-height: 116px;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    background: linear-gradient(120deg, #a93ee4 0%, #9136dd 48%, #bd35df 100%);
    color: #fff;
    padding: 20px 20px 18px;
}

.ace-chatbot-header::before {
    content: "";
    position: absolute;
    width: 250px;
    height: 250px;
    top: -168px;
    right: 58px;
    border: 2px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    box-shadow: 0 0 0 62px rgba(79, 24, 151, .18);
    pointer-events: none;
}

.ace-chatbot-header::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 102px;
    width: 100px;
    opacity: .22;
    background: repeating-linear-gradient(120deg, transparent 0 10px, rgba(255, 255, 255, .42) 10px 12px);
    pointer-events: none;
}

.ace-chatbot-avatar,
.ace-chatbot-heading,
.ace-chatbot-close {
    position: relative;
    z-index: 1;
}

.ace-chatbot-avatar {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
}

.ace-chatbot-avatar img {
    width: 54px;
    height: 44px;
    display: block;
}

.ace-chatbot-heading h2 {
    margin: 0;
    color: #fff;
    font-size: 21px;
    line-height: 1.2;
}

.ace-chatbot-heading p {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 7px 0 0;
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
}

.ace-chatbot-heading p::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border: 2px solid rgba(255, 255, 255, .8);
    border-radius: 50%;
    background: #f6c84b;
}

.ace-chatbot-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    padding: 0;
    font-size: 25px;
}

.ace-chatbot-close:hover,
.ace-chatbot-close:focus-visible {
    background: rgba(255, 255, 255, .22);
}

.ace-chatbot-body {
    min-height: 0;
    overflow-y: auto;
    background: linear-gradient(135deg, #f2f7ff 0%, #fff8fd 100%);
    padding: 24px;
    overscroll-behavior: contain;
}

.ace-chatbot-date {
    width: fit-content;
    margin: 0 auto 20px;
    border-radius: 999px;
    background: #eee8ff;
    color: #7240dc;
    padding: 7px 24px;
    font-size: 12px;
    font-weight: 750;
}

.ace-chatbot-message {
    width: min(340px, 94%);
    border: 1px solid #dfc9ff;
    border-radius: 18px 18px 18px 6px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(69, 44, 112, .06);
    padding: 16px 18px;
}

.ace-chatbot-message p {
    margin: 0;
    color: #263c53;
    font-size: 14px;
    line-height: 1.55;
}

.ace-chatbot-coming-soon {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    margin-top: 14px;
    border-left: 3px solid #8650e6;
    background: #f0eaff;
    padding: 12px 13px;
}

.ace-chatbot-coming-soon > i {
    color: #7447d8;
    font-size: 22px;
}

.ace-chatbot-coming-soon strong,
.ace-chatbot-coming-soon span {
    display: block;
}

.ace-chatbot-coming-soon strong {
    color: #4d2b95;
    font-size: 13px;
}

.ace-chatbot-coming-soon span {
    margin-top: 3px;
    color: #665c78;
    font-size: 12px;
    line-height: 1.45;
}

.ace-chatbot-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}

.ace-chatbot-shortcuts a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8c8fa;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    color: #6d35d8;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}

.ace-chatbot-shortcuts a:hover,
.ace-chatbot-shortcuts a:focus-visible {
    border-color: #8650e6;
    background: #fff;
    color: #5223b3;
}

.ace-chatbot-footer {
    background: #b734df;
    padding: 18px 20px 14px;
}

.ace-chatbot-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 50px;
    align-items: center;
    gap: 10px;
}

.ace-chatbot-composer input {
    width: 100%;
    min-width: 0;
    height: 48px;
    border: 2px solid rgba(116, 71, 216, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #718497;
    padding: 0 18px;
    font-size: 13px;
}

.ace-chatbot-composer input:disabled {
    cursor: not-allowed;
    opacity: 1;
}

.ace-chatbot-send {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border: 2px solid #4f93f7;
    border-radius: 50%;
    background: #7745e6;
    color: #fff;
    padding: 0;
    font-size: 24px;
}

.ace-chatbot-send:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.ace-chatbot-footer small {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, .88);
    font-size: 12px;
    text-align: center;
}

.ace-chatbot-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

@media (max-width: 520px) {
    .ace-chatbot-root {
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
    }

    .ace-chatbot-trigger {
        width: 80px;
        height: 80px;
    }

    .ace-chatbot-panel {
        position: fixed;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: calc(100% - 20px);
        height: min(650px, calc(100vh - 20px));
        border-radius: 18px;
    }

    .ace-chatbot-header {
        min-height: 104px;
        grid-template-columns: 58px minmax(0, 1fr) 36px;
        gap: 11px;
        padding: 16px;
    }

    .ace-chatbot-avatar {
        width: 58px;
        height: 58px;
    }

    .ace-chatbot-avatar img {
        width: 45px;
        height: 37px;
    }

    .ace-chatbot-heading h2 {
        font-size: 18px;
    }

    .ace-chatbot-body {
        padding: 18px;
    }

    .ace-chatbot-shortcuts {
        grid-template-columns: 1fr;
    }

    .ace-chatbot-footer {
        padding: 14px 16px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ace-chatbot-trigger,
    .ace-chatbot-panel {
        transition: none;
    }
}

@media print {
    .ace-chatbot-root {
        display: none !important;
    }
}
