.aiChatbot {
    bottom: 18px;
    position: fixed;
    right: 82px;
    z-index: 350;
}

.aiChatbotOpenButton {
    align-items: center;
    background: var(--wcfButtonPrimaryBackground);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgb(0 0 0 / 24%);
    color: var(--wcfButtonPrimaryText);
    cursor: pointer;
    display: inline-flex;
    height: 54px;
    justify-content: center;
    padding: 0;
    transition: box-shadow 120ms ease, transform 120ms ease;
    width: 54px;
}

.aiChatbotOpenButton:hover {
    box-shadow: 0 10px 28px rgb(0 0 0 / 30%);
    transform: translateY(-1px);
}

.aiChatbotOpenButton:focus-visible,
.aiChatbotIconButton:focus-visible {
    outline: 2px solid var(--wcfButtonPrimaryBackground);
    outline-offset: 3px;
}

.aiChatbotOpenButton .aiChatbotIcon {
    height: 27px;
    width: 27px;
}

.aiChatbotIcon {
    display: block;
    height: 20px;
    width: 20px;
}

.aiChatbotPanel {
    background: var(--wcfContentBackground);
    border: 1px solid var(--wcfContentBorderInner);
    border-radius: 18px;
    bottom: 84px;
    box-shadow: 0 14px 48px rgb(0 0 0 / 26%);
    display: flex;
    flex-direction: column;
    height: min(660px, calc(100vh - 112px));
    max-width: calc(100vw - 32px);
    overflow: hidden;
    position: fixed;
    right: 18px;
    width: 420px;
}

.aiChatbotPanel[hidden] {
    display: none;
}

.aiChatbot--embedded {
    bottom: auto;
    position: static;
    right: auto;
    width: 100%;
    z-index: auto;
}

.aiChatbot--embedded .aiChatbotPanel {
    bottom: auto;
    box-shadow: 0 8px 30px rgb(0 0 0 / 14%);
    height: min(720px, calc(100vh - 220px));
    min-height: 520px;
    max-width: none;
    position: relative;
    right: auto;
    width: 100%;
}

.aiChatbotPageContent {
    margin-bottom: 20px;
}

.aiChatbotPageMount {
    width: 100%;
}

.aiChatbotPageOpenButton {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
    margin: 0 auto;
}

.aiChatbotPageOpenButton .aiChatbotIcon {
    height: 18px;
    width: 18px;
}

.aiChatbotEmbeddedMinimizeButton {
    display: none;
}

.aiChatbotHeader {
    align-items: center;
    background: var(--wcfContentContainerBackground);
    border-bottom: 1px solid var(--wcfContentBorderInner);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 58px;
    padding: 10px 12px 10px 14px;
}

.aiChatbotHeaderBrand {
    align-items: center;
    display: flex;
    gap: 9px;
    min-width: 0;
}

.aiChatbotHeaderBrand strong {
    font-size: 1.05rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aiChatbotHeaderIcon {
    align-items: center;
    background: var(--wcfButtonPrimaryBackground);
    border-radius: 50%;
    color: var(--wcfButtonPrimaryText);
    display: inline-flex;
    flex: 0 0 auto;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.aiChatbotHeaderIcon .aiChatbotIcon {
    height: 18px;
    width: 18px;
}

.aiChatbotHeaderActions {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
}

.aiChatbotIconButton {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    opacity: 0.72;
    padding: 0;
    width: 36px;
}

.aiChatbotIconButton:hover {
    background: var(--wcfContentBackground);
    opacity: 1;
}

.aiChatbotMessages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 16px 14px;
    scroll-behavior: smooth;
}

.aiChatbotMessage {
    align-items: flex-end;
    display: flex;
    gap: 8px;
    max-width: 94%;
}

.aiChatbotMessage-user {
    align-self: flex-end;
    justify-content: flex-end;
}

.aiChatbotMessage-assistant {
    align-self: flex-start;
}

.aiChatbotMessageStack {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.aiChatbotMessageSender {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    margin-left: 3px;
    max-width: 100%;
    opacity: 0.68;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aiChatbotMessageAvatar {
    align-items: center;
    background: var(--wcfContentContainerBackground);
    border: 1px solid var(--wcfContentBorderInner);
    border-radius: 50%;
    display: inline-flex;
    flex: 0 0 auto;
    height: 30px;
    justify-content: center;
    margin-bottom: 2px;
    width: 30px;
}

.aiChatbotMessageAvatar .aiChatbotIcon {
    height: 15px;
    width: 15px;
}

.aiChatbotMessageBody {
    background: var(--wcfContentContainerBackground);
    border: 1px solid var(--wcfContentBorderInner);
    border-radius: 16px 16px 16px 5px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    padding: 10px 12px;
}

.aiChatbotMessage-user .aiChatbotMessageBody {
    background: var(--wcfButtonPrimaryBackground);
    border-color: transparent;
    border-radius: 16px 16px 5px 16px;
    color: var(--wcfButtonPrimaryText);
    white-space: pre-wrap;
}

.aiChatbotMessageBody p {
    margin: 0 0 0.65em;
}

.aiChatbotMessageBody p:last-child {
    margin-bottom: 0;
}

.aiChatbotAnswerBlock + .aiChatbotAnswerBlock {
    margin-top: 0.75em;
}

.aiChatbotInlineSources {
    display: inline-flex;
    gap: 3px;
    margin-left: 2px;
    vertical-align: text-bottom;
}

.aiChatbotInlineSourceLink {
    align-items: center;
    border-radius: 4px;
    display: inline-flex;
    opacity: 0.72;
    padding: 1px;
    text-decoration: none !important;
}

.aiChatbotInlineSourceLink:hover {
    opacity: 1;
}

.aiChatbotInlineSourceLink .aiChatbotIcon {
    height: 0.9em;
    width: 0.9em;
}

.aiChatbotMessageBody a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.aiChatbotMessageBody code {
    background: var(--wcfContentBackground);
    border-radius: 4px;
    font-size: 0.92em;
    padding: 0.08em 0.28em;
}

.aiChatbotMessageBody pre {
    background: var(--wcfContentBackground);
    border: 1px solid var(--wcfContentBorderInner);
    border-radius: 8px;
    margin: 0.6em 0 0;
    overflow-x: auto;
    padding: 8px 10px;
    white-space: pre;
}

.aiChatbotMessageBody pre code {
    background: transparent;
    padding: 0;
}

.aiChatbotMarkdownHeading {
    display: block;
    font-size: 1em;
    margin: 0.15em 0 0.5em;
}

.aiChatbotMarkdownList {
    margin: 0.25em 0 0.25em 1.35em;
    padding: 0;
}

.aiChatbotMarkdownList li + li {
    margin-top: 0.35em;
}

.aiChatbotMessageBody blockquote {
    border-left: 3px solid var(--wcfContentBorderInner);
    margin: 0.35em 0;
    padding-left: 0.7em;
}

.aiChatbotMessage-status {
    max-width: 88%;
}

.aiChatbotStatusBody,
.aiChatbotTypingBody {
    font-size: 0.9rem;
    padding: 8px 10px;
}

.aiChatbotStatusBody {
    white-space: pre-line;
}

.aiChatbotSearchProgress {
    min-width: min(300px, calc(100vw - 112px));
    white-space: normal;
}

.aiChatbotSearchProgressIntro {
    line-height: 1.4;
    margin-bottom: 7px;
}

.aiChatbotSearchProgressList {
    display: flex;
    flex-direction: column;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.aiChatbotSearchProgressItem {
    align-items: center;
    display: grid;
    gap: 7px;
    grid-template-columns: 8px minmax(0, 1fr);
}

.aiChatbotSearchProgressPulse {
    animation: aiChatbotSearchPulse 1.2s infinite ease-in-out;
    background: currentColor;
    border-radius: 50%;
    height: 6px;
    opacity: 0.38;
    width: 6px;
}

.aiChatbotSearchProgressLabel {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aiChatbotSearchProgressState {
    font-size: 0.86em;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
}

.aiChatbotSearchProgressItem:not(.aiChatbotSearchProgressItem-searching) .aiChatbotSearchProgressPulse {
    animation: none;
    opacity: 0.52;
    transform: none;
}

.aiChatbotSearchProgressItem-empty .aiChatbotSearchProgressState {
    opacity: 0.68;
}

.aiChatbotSearchProgressItem-failed .aiChatbotSearchProgressState {
    opacity: 0.78;
}

.aiChatbotSearchProgressSummary {
    font-size: 0.86em;
    line-height: 1.4;
    margin-top: 8px;
    opacity: 0.78;
    white-space: pre-line;
}

@keyframes aiChatbotSearchPulse {
    0%, 100% {
        opacity: 0.28;
        transform: scale(0.8);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.15);
    }
}

.aiChatbotStatusLink {
    display: inline-block;
    font-size: 0.94em;
    margin-top: 4px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.aiChatbotMessage-status-searching .aiChatbotStatusBody,
.aiChatbotMessage-typing .aiChatbotTypingBody {
    opacity: 0.78;
}

.aiChatbotMessage-status-found .aiChatbotStatusBody {
    border-style: dashed;
}

.aiChatbotMessage-status-empty .aiChatbotStatusBody,
.aiChatbotMessage-status-failed .aiChatbotStatusBody {
    border-style: dashed;
    opacity: 0.82;
}

.aiChatbotTypingBody {
    align-items: center;
    display: inline-flex;
    gap: 7px;
}

.aiChatbotTypingDots {
    align-items: center;
    display: inline-flex;
    gap: 3px;
    min-width: 24px;
}

.aiChatbotTypingDots span {
    animation: aiChatbotTypingDot 1.15s infinite ease-in-out;
    background: currentColor;
    border-radius: 50%;
    height: 5px;
    opacity: 0.35;
    width: 5px;
}

.aiChatbotTypingDots span:nth-child(2) {
    animation-delay: 0.15s;
}

.aiChatbotTypingDots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes aiChatbotTypingDot {
    0%, 70%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    35% {
        opacity: 0.9;
        transform: translateY(-3px);
    }
}

.aiChatbotFailureCallToActions {
    border-top: 1px solid var(--wcfContentBorderInner);
    font-size: 0.86rem;
    margin-top: 7px;
    padding-top: 7px;
}

.aiChatbotFailureCallToActionsTitle {
    display: block;
    margin-bottom: 4px;
}

.aiChatbotFailureCallToActions ul {
    margin: 0;
    padding-left: 18px;
}

.aiChatbotFailureCallToActions li + li {
    margin-top: 3px;
}

.aiChatbotFailureCallToActions a {
    overflow-wrap: anywhere;
}

.aiChatbotSources {
    font-size: 0.86rem;
    margin-top: 2px;
    padding-left: 2px;
}

.aiChatbotSources summary {
    cursor: pointer;
    user-select: none;
}

.aiChatbotSources ul {
    margin: 7px 0 0;
    padding-left: 18px;
}

.aiChatbotSources li {
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.aiChatbotSources li + li {
    margin-top: 5px;
}

.aiChatbotSourceTitle {
    font-weight: 600;
}

.aiChatbotSources a {
    font-size: 0.95em;
}

.aiChatbotSourceNotice {
    display: block;
    font-size: 0.72rem;
    line-height: 1.35;
    margin-top: 2px;
    max-width: 34rem;
    opacity: 0.68;
    padding-left: 2px;
}

.aiChatbotPrivacyInfo {
    display: block;
    font-size: 0.72rem;
    line-height: 1.4;
    margin-top: 1px;
    max-width: 34rem;
    opacity: 0.68;
    padding-left: 2px;
}

.aiChatbotPrivacyInfo p {
    margin: 0 0 0.35em;
}

.aiChatbotPrivacyInfo p:last-child {
    margin-bottom: 0;
}

.aiChatbotPrivacyInfo ul,
.aiChatbotPrivacyInfo ol {
    margin: 0.25em 0 0.25em 1.2em;
    padding: 0;
}

.aiChatbotPrivacyInfo a {
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.aiChatbotForm {
    align-items: flex-end;
    background: var(--wcfContentContainerBackground);
    border-top: 1px solid var(--wcfContentBorderInner);
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
}

.aiChatbotInput {
    background: var(--wcfContentBackground);
    border-radius: 12px;
    flex: 1;
    max-height: 160px;
    min-height: 44px;
    resize: none;
}

.aiChatbotMessageMeta {
    align-items: baseline;
    display: flex;
    gap: 6px;
    margin-left: 3px;
    min-width: 0;
}

.aiChatbotMessage-user .aiChatbotMessageMeta {
    justify-content: flex-end;
    margin-left: 0;
    margin-right: 3px;
}

.aiChatbotMessageTimestamp {
    font-size: 0.68rem;
    opacity: 0.48;
    white-space: nowrap;
}

.aiChatbotSendButton {
    align-items: center;
    border-radius: 11px;
    display: inline-flex;
    flex: 0 0 44px;
    justify-content: center;
    min-height: 42px;
    padding: 0;
    width: 44px;
}

html.aiChatbotViewportLocked,
body.aiChatbotViewportLocked {
    overflow: hidden;
    overscroll-behavior: none;
}

@media (max-width: 600px) {
    .aiChatbot {
        bottom: max(14px, env(safe-area-inset-bottom));
        right: max(76px, calc(env(safe-area-inset-right) + 70px));
    }

    .aiChatbot.aiChatbot--embedded {
        bottom: auto;
        right: auto;
    }

    .aiChatbot--embedded .aiChatbotPanel {
        border-radius: 12px;
        height: min(680px, calc(100dvh - 150px));
        min-height: 480px;
    }

    .aiChatbot--embedded .aiChatbotPageOpenButton:not([hidden]) {
        display: inline-flex;
    }

    .aiChatbot.aiChatbot--embedded.aiChatbot-mobileOpen .aiChatbotPanel {
        min-height: 0;
        position: fixed;
        z-index: 1000;
    }

    .aiChatbot.aiChatbot--embedded.aiChatbot-mobileOpen .aiChatbotEmbeddedMinimizeButton {
        display: inline-flex;
    }

    .aiChatbotOpenButton {
        height: 50px;
        width: 50px;
    }

    .aiChatbot.aiChatbot-mobileOpen .aiChatbotPanel {
        border: 0;
        border-radius: 0;
        bottom: auto;
        height: 100vh;
        height: var(--ai-chatbot-viewport-height, 100dvh);
        left: var(--ai-chatbot-viewport-left, 0);
        max-height: none;
        max-width: none;
        right: auto;
        top: var(--ai-chatbot-viewport-top, 0);
        width: 100vw;
        width: var(--ai-chatbot-viewport-width, 100vw);
    }

    .aiChatbot.aiChatbot-mobileOpen .aiChatbotHeader {
        flex: 0 0 auto;
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .aiChatbot.aiChatbot-mobileOpen .aiChatbotMessages {
        -webkit-overflow-scrolling: touch;
        min-height: 0;
        overscroll-behavior: contain;
        padding: 12px 10px;
    }

    .aiChatbot.aiChatbot-mobileOpen .aiChatbotForm {
        flex: 0 0 auto;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .aiChatbot.aiChatbot-mobileOpen .aiChatbotInput {
        max-height: 120px;
        resize: none;
    }

    .aiChatbotMessage {
        max-width: 96%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aiChatbotSearchProgressPulse,
    .aiChatbotTypingDots span {
        animation: none;
    }
}

.aiChatbotSupplementalHtml {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--wcfContentBackground, rgba(0, 0, 0, 0.04));
    font-size: 0.88rem;
    line-height: 1.45;
}

.aiChatbotSupplementalHtml > :first-child {
    margin-top: 0;
}

.aiChatbotSupplementalHtml > :last-child {
    margin-bottom: 0;
}
