.site-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 240;
    font-family: inherit;
}

.site-chatbot[hidden] {
    display: none;
}

.site-chatbot-toggle {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    color: #fff;
    border: 0;
    border-radius: 50%;
    background: var(--brand, #13366f);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
    cursor: pointer;
}

.site-chatbot-toggle svg {
    width: 26px;
    height: 26px;
}

.site-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(380px, calc(100vw - 32px));
    max-height: min(620px, calc(100vh - var(--site-header-height, 0px) - 104px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(19, 54, 111, 0.16);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 72px rgba(15, 23, 42, 0.2);
}

.site-chatbot-panel[hidden] {
    display: none;
}

.site-chatbot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    color: #fff;
    background: var(--brand, #13366f);
}

.site-chatbot-head > div:first-child {
    display: grid;
    gap: 2px;
}

.site-chatbot-head strong {
    font-size: 1rem;
}

.site-chatbot-head span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.78rem;
    font-weight: 700;
}

.site-chatbot-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.site-chatbot-clear {
    min-height: 34px;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 0 12px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
}

.site-chatbot-close {
    width: 34px;
    height: 34px;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.site-chatbot-messages {
    height: min(320px, calc(100vh - var(--site-header-height, 0px) - 236px));
    min-height: 180px;
    display: grid;
    align-content: start;
    gap: 10px;
    overflow-y: auto;
    padding: 16px;
    background: #f7f9fc;
}

.site-chatbot-message {
    width: fit-content;
    max-width: 86%;
    padding: 10px 12px;
    color: var(--text, #102033);
    border: 1px solid rgba(19, 54, 111, 0.1);
    border-radius: 8px;
    background: #fff;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    unicode-bidi: plaintext;
}

.site-chatbot-message a {
    color: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-chatbot-message.is-typing {
    color: rgba(16, 32, 51, 0.72);
    font-style: italic;
}

.site-chatbot-message[data-role="user"] {
    justify-self: end;
    color: #fff;
    background: var(--brand, #13366f);
}

.site-chatbot-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid rgba(19, 54, 111, 0.12);
}

.site-chatbot-form input {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(19, 54, 111, 0.18);
    border-radius: 8px;
    font: inherit;
    unicode-bidi: plaintext;
}

.site-chatbot-form button {
    padding: 0 16px;
    color: #fff;
    border: 0;
    border-radius: 8px;
    background: var(--brand, #13366f);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 640px) {
    .site-chatbot {
        right: 16px;
        bottom: 16px;
    }

    .site-chatbot-panel {
        bottom: 70px;
    }

    .site-chatbot-head {
        padding-inline: 14px;
    }

    .site-chatbot-clear {
        padding-inline: 10px;
    }
}
