.bbai-wrap,
.bbai-wrap * {
    box-sizing: border-box;
}

.bbai-wrap {
    position: relative;
    z-index: 40;
    display: flex;
    justify-content: flex-end;
    margin: 0 0 18px;
    font-family: inherit;
}

.bbai-button {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #9bb4ff;
    border-radius: 12px;
    background: #ffffff;
    color: #24262c;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(94, 128, 255, .13), 0 4px 14px rgba(33, 49, 90, .08);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.bbai-button:hover,
.bbai-button:focus-visible {
    border-color: #6388ff;
    background: #fbfcff;
    box-shadow: 0 0 0 4px rgba(94, 128, 255, .16), 0 5px 16px rgba(33, 49, 90, .11);
    outline: none;
}

.bbai-button:active {
    transform: translateY(1px);
}

.bbai-button-icon {
    display: inline-flex;
    color: #6388ff;
}

.bbai-chevron {
    display: inline-flex;
    transition: transform .18s ease;
}

.bbai-wrap.is-open .bbai-chevron {
    transform: rotate(180deg);
}

.bbai-menu {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    width: 184px;
    padding: 7px;
    border: 1px solid #e2e5eb;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 14px 36px rgba(22, 29, 46, .16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px) scale(.985);
    transform-origin: top right;
    transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.bbai-wrap.is-open .bbai-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.bbai-item {
    width: 100%;
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #2d3036;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.bbai-item:hover,
.bbai-item:focus-visible {
    background: #f2f4f8;
    color: #111318;
    outline: none;
}

.bbai-provider-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    color: #3f4148;
}


.bbai-provider-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.bbai-provider-chatgpt {
    color: #111111;
}

.bbai-provider-claude {
    color: #d97745;
}

.bbai-provider-grok {
    color: #111111;
}

.bbai-provider-perplexity {
    color: #0f766e;
}

.bbai-title-parent {
    position: relative !important;
}

.bbai-wrap.bbai-in-title {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
}

.bbai-title-parent > .bbai-title-target {
    padding-right: 178px !important;
}

.bbai-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 999999;
    max-width: calc(100vw - 32px);
    padding: 11px 15px;
    border-radius: 10px;
    background: rgba(21, 24, 31, .94);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 12px);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.bbai-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

@media (max-width: 782px) {
    .bbai-title-parent > .bbai-title-target {
        padding-right: 0 !important;
    }

    .bbai-wrap.bbai-in-title {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        justify-content: flex-start;
        margin: 14px 0 8px;
    }

    .bbai-button {
        min-height: 42px;
    }

    .bbai-menu {
        left: 0;
        right: auto;
        width: min(220px, calc(100vw - 36px));
        transform-origin: top left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bbai-button,
    .bbai-chevron,
    .bbai-menu,
    .bbai-item,
    .bbai-toast {
        transition: none !important;
    }
}
