.geist-chatbot {
    --geist-accent: #202b25;
    --geist-paper: #fff;
    --geist-edge-bottom: 22px;
    --geist-bottom: max(var(--geist-edge-bottom), var(--geist-obstacle-bottom, 0px));
    bottom: var(--geist-bottom);
    font-family: inherit;
    position: fixed;
    right: 22px;
    z-index: 999;
}

.geist-chatbot__launcher {
    align-items: center;
    background: var(--geist-accent);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-weight: 600;
    gap: 8px;
    padding: 13px 18px;
}

.geist-chatbot__panel {
    background: var(--geist-paper);
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 18px;
    bottom: calc(100% + 12px);
    box-sizing: border-box;
    box-shadow: 0 16px 50px rgba(0, 0, 0, .22);
    display: flex;
    flex-direction: column;
    max-height: min(650px, calc(100vh - var(--geist-bottom) - var(--geist-launcher-height, 50px) - 24px));
    overflow: hidden;
    position: absolute;
    right: 0;
    width: min(390px, calc(100vw - 30px));
}

.geist-chatbot__panel[hidden] {
    display: none;
}

.geist-chatbot__panel[data-expanded="true"] {
    width: calc(100vw - 44px);
    height: min(760px, calc(100vh - var(--geist-bottom) - var(--geist-launcher-height, 50px) - 24px));
    max-height: min(760px, calc(100vh - var(--geist-bottom) - var(--geist-launcher-height, 50px) - 24px));
}

.geist-chatbot__window-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    margin-left: 12px;
}

.geist-chatbot__header {
    align-items: center;
    background: var(--geist-accent);
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 16px 18px;
}

.geist-chatbot__close,
.geist-chatbot__resize {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    padding: 0;
    min-width: 32px;
    min-height: 32px;
}

.geist-chatbot__messages {
    background: #f6f5f1;
    display: flex;
    flex: 1 1 350px;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 16px;
}

.geist-chatbot__message {
    border-radius: 14px;
    line-height: 1.45;
    max-width: 86%;
    padding: 10px 13px;
    white-space: pre-wrap;
}

.geist-chatbot__message--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    box-sizing: border-box;
    margin-left: 44px;
    max-width: calc(100% - 44px);
    min-width: 0;
    overflow-wrap: anywhere;
    position: relative;
    text-align: left;
}

/* Decorative brand avatar: applies to the welcome, answers and status messages. */
.geist-chatbot__message--bot::before {
    background: #fff url('../images/geist-avatar.avif') center / 30px auto no-repeat;
    border: 1px solid #dce1dd;
    border-radius: 50%;
    box-sizing: border-box;
    content: '';
    height: 36px;
    left: -45px;
    position: absolute;
    top: 0;
    width: 36px;
}

.geist-chatbot__message--user {
    align-self: flex-end;
    background: var(--geist-accent);
    color: #fff;
}

.geist-chatbot__sources {
    border-top: 1px solid rgba(0, 0, 0, .1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 9px;
    padding-top: 7px;
}

.geist-chatbot__sources a {
    color: #315f48;
    font-size: 12px;
    text-decoration: underline;
}

.geist-chatbot__form {
    display: flex;
    gap: 8px;
    padding: 12px;
}

.geist-chatbot__form textarea {
    border: 1px solid #ccc;
    border-radius: 10px;
    flex: 1;
    min-height: 44px;
    padding: 10px;
    resize: none;
}

.geist-chatbot__form button {
    background: var(--geist-accent);
    border: 0;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    padding: 0 14px;
}

.geist-chatbot__notice {
    color: #666;
    padding: 0 12px 10px;
    text-align: center;
}

.geist-chatbot__sr-only {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

@media (max-width: 520px) {
    .geist-chatbot {
        --geist-edge-bottom: 12px;
        right: 12px;
    }

    .geist-chatbot__panel[data-expanded="true"] {
        width: calc(100vw - 24px);
    }

}

.geist-chatbot__product { border-bottom: 1px solid #ddd; padding: 10px 0; white-space: normal; overflow-wrap: anywhere; }
.geist-chatbot__product:last-child { border-bottom: 0; }
.geist-chatbot__product a { display: block; font-size: 14px; font-weight: 600; }
.geist-chatbot__product img { display: block; object-fit: contain; margin: 8px 0; }
.geist-chatbot__product p { margin: 8px 0; font-size: 13px; }
.geist-chatbot__product strong { display: block; }

.geist-chatbot__guides { margin-top: 16px; white-space: normal; overflow-wrap: anywhere; }
.geist-chatbot__guide { border-top: 1px solid #ddd; padding: 10px 0; }
.geist-chatbot__guide h4 { margin: 0 0 8px; }
.geist-chatbot__guide-text, .geist-chatbot__clarification { white-space: pre-wrap; overflow-wrap: anywhere; }
.geist-chatbot__guide-warning { white-space: pre-wrap; border-left: 3px solid #9b6000; padding: 8px 12px; background: #fff5df; color: #583600; }

.geist-chatbot__colours { margin-top: 16px; padding-top: 12px; border-top: 1px solid #d9dedb; }
.geist-chatbot__colours h3 { margin: 0 0 10px; font-size: 16px; }
.geist-chatbot__colour { padding: 10px 0; }
.geist-chatbot__colour h4 { margin: 0 0 6px; font-size: 14px; overflow-wrap: anywhere; }
.geist-chatbot__colour-swatch { display: inline-block; width: 24px; height: 24px; border: 1px solid #767676; border-radius: 4px; vertical-align: middle; margin-right: 8px; }
.geist-chatbot__colour a { text-decoration: underline; }
.geist-chatbot__colour-warning { font-size: 12px; line-height: 1.5; }

.geist-chatbot__colours p { white-space: pre-line; }
