.wk-wonderbot-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100070;
    min-height: 54px;
    padding: 11px 18px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, #6337d5, #8d4ce8);
    color: #fff;
    font: 800 14px/1.1 Nunito, Arial, sans-serif;
    box-shadow: 0 14px 32px rgba(80, 42, 177, .34);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.wk-wonderbot-launcher:hover,
.wk-wonderbot-launcher:focus-visible {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 17px 36px rgba(80, 42, 177, .42);
}

.wk-wonderbot-launcher i {
    font-size: 21px;
}

.wk-wonderbot-backdrop[hidden],
.wk-wonderbot-widget[hidden] {
    display: none !important;
}

.wk-wonderbot-widget {
    position: fixed;
    z-index: 100090;
    top: 82px;
    right: 20px;
    width: min(410px, calc(100vw - 32px));
    height: min(650px, calc(100vh - 104px));
    overflow: hidden;
    border: 1px solid rgba(98, 66, 191, .18);
    border-radius: 23px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #fff;
    color: #303650;
    font-family: Nunito, Arial, sans-serif;
    box-shadow: 0 28px 70px rgba(31, 22, 74, .3);
    animation: wkWonderBotEnter .2s ease-out;
}

@keyframes wkWonderBotEnter {
    from { opacity: 0; transform: translateY(-9px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.wk-wonderbot-widget__header {
    min-height: 72px;
    padding: 10px 12px;
    border-bottom: 1px solid #ece9f3;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 38px 38px;
    align-items: center;
    gap: 7px;
    background: #fff;
}

.wk-wonderbot-widget__avatar {
    position: relative;
    width: 46px;
    height: 46px;
    padding: 4px;
    border: 2px solid #e6ddff;
    border-radius: 15px;
    background: #f3efff;
}

.wk-wonderbot-widget__avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wk-wonderbot-widget__avatar i {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #2acb8a;
}

.wk-wonderbot-widget__identity strong,
.wk-wonderbot-widget__identity small {
    display: block;
}

.wk-wonderbot-widget__identity strong {
    color: #152141;
    font-size: 18px;
    font-weight: 900;
}

.wk-wonderbot-widget__identity small {
    margin-top: 1px;
    color: #77809b;
    font-size: 12px;
    font-weight: 700;
}

.wk-wonderbot-widget__identity small i {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 50%;
    background: #2acb8a;
}

.wk-wonderbot-widget__reset,
.wk-wonderbot-widget__close {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #e9e4f2;
    border-radius: 12px;
    background: #fff;
    color: #69647c;
    cursor: pointer;
}

.wk-wonderbot-widget__close {
    color: #433b5a;
}

.wk-wonderbot-widget__reset:focus-visible,
.wk-wonderbot-widget__close:focus-visible,
.wk-wonderbot-widget__composer button:focus-visible,
.wk-wonderbot-widget__suggestions button:focus-visible,
.wk-wonderbot-widget__choice:focus-visible,
.wk-wonderbot-widget__action:focus-visible {
    outline: 3px solid rgba(112, 67, 222, .2);
    outline-offset: 2px;
}

.wk-wonderbot-widget__messages {
    min-height: 0;
    overflow-y: auto;
    padding: 16px 14px;
    background: linear-gradient(180deg, #fff 0%, #fcfbff 100%);
    overscroll-behavior: contain;
}

.wk-wonderbot-widget__message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 13px;
}

.wk-wonderbot-widget__message > div {
    max-width: 84%;
    padding: 10px 12px;
    border-radius: 8px 17px 17px 17px;
    background: #f0eef8;
    color: #363c58;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.48;
    overflow-wrap: anywhere;
}

.wk-wonderbot-widget__message p {
    margin: 0 0 6px;
}

.wk-wonderbot-widget__message p:last-child {
    margin-bottom: 0;
}

.wk-wonderbot-widget__message ol,
.wk-wonderbot-widget__message ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

.wk-wonderbot-widget__message.is-user {
    justify-content: flex-end;
}

.wk-wonderbot-widget__message.is-user > div {
    border-radius: 17px 8px 17px 17px;
    background: linear-gradient(135deg, #7040dd, #8b46e5);
    color: #fff;
    box-shadow: 0 8px 17px rgba(112, 64, 221, .17);
}

.wk-wonderbot-widget__mini-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 9px;
    background: linear-gradient(135deg, #7a3bd8, #e13e94);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.wk-wonderbot-widget__suggestions,
.wk-wonderbot-widget__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 5px 0 15px 36px;
}

.wk-wonderbot-widget__suggestions button,
.wk-wonderbot-widget__choice {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #ded4f5;
    border-radius: 999px;
    background: #fff;
    color: #6840c9;
    font: 800 11px/1.25 Nunito, Arial, sans-serif;
    text-align: left;
    cursor: pointer;
}

.wk-wonderbot-widget__action {
    display: inline-flex;
    min-height: 36px;
    margin-top: 9px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    align-items: center;
    background: #7040dd;
    color: #fff !important;
    font: 800 12px/1.2 Nunito, Arial, sans-serif;
    text-decoration: none !important;
    cursor: pointer;
}

.wk-wonderbot-widget__typing > div {
    display: flex;
    gap: 4px;
    padding: 13px 15px;
}

.wk-wonderbot-widget__typing b {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8a80a5;
    animation: wkWonderBotTyping .9s infinite alternate;
}

.wk-wonderbot-widget__typing b:nth-child(2) { animation-delay: .15s; }
.wk-wonderbot-widget__typing b:nth-child(3) { animation-delay: .3s; }

@keyframes wkWonderBotTyping {
    to { opacity: .35; transform: translateY(-3px); }
}

.wk-wonderbot-widget__composer-wrap {
    padding: 10px 12px 8px;
    border-top: 1px solid #ece9f3;
    background: #fff;
}

.wk-wonderbot-widget__composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: end;
    gap: 7px;
    padding: 5px 5px 5px 12px;
    border: 2px solid #bda4fa;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(97, 62, 183, .1);
}

.wk-wonderbot-widget__composer textarea {
    width: 100%;
    max-height: 88px;
    min-height: 38px;
    padding: 9px 0 6px;
    border: 0;
    outline: 0;
    resize: none;
    color: #31364e;
    background: transparent;
    font: 700 13px/1.35 Nunito, Arial, sans-serif;
}

.wk-wonderbot-widget__composer button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #7142df, #8645e8);
    color: #fff;
    cursor: pointer;
}

.wk-wonderbot-widget__composer button:disabled,
.wk-wonderbot-widget__composer textarea:disabled {
    cursor: wait;
    opacity: .62;
}

.wk-wonderbot-widget__composer-wrap > small {
    display: block;
    margin-top: 5px;
    color: #9694a4;
    font-size: 9px;
    text-align: center;
}

@media (max-width: 767.98px) {
    .wk-wonderbot-launcher {
        display: none !important;
    }

    .wk-wonderbot-backdrop {
        position: fixed;
        inset: 0;
        z-index: 100080;
        background: rgba(22, 18, 55, .54);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .wk-wonderbot-widget {
        top: max(10px, env(safe-area-inset-top, 0px));
        right: 10px;
        bottom: calc(82px + var(--wk-mobile-nav-safe-bottom, 0px));
        left: 10px;
        width: auto;
        height: auto;
        max-height: none;
        border-radius: 20px;
    }

    body.wk-wonderbot-open {
        overflow: hidden !important;
    }

    .wk-wonderbot-widget__message > div {
        max-width: 87%;
    }
}

@media (max-width: 380px) {
    .wk-wonderbot-widget {
        right: 6px;
        left: 6px;
    }

    .wk-wonderbot-widget__header {
        grid-template-columns: 44px minmax(0, 1fr) 35px 35px;
        min-height: 64px;
        padding: 8px;
    }

    .wk-wonderbot-widget__avatar {
        width: 42px;
        height: 42px;
    }

    .wk-wonderbot-widget__messages {
        padding: 12px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wk-wonderbot-widget,
    .wk-wonderbot-launcher,
    .wk-wonderbot-widget__typing b {
        animation: none;
        transition: none;
    }
}
