/* Izan chat box. Sits above #scrollTop (bottom-right) and, on phones, above the mobile nav bar. */
.izan-chat {
    position: fixed;
    right: 1rem;
    bottom: 4rem;
    z-index: 1040;
}

@media (max-width: 767.98px) {
    .izan-chat {
        bottom: 7rem;
    }
}

/* A pill with words, not just an icon, so customers know what it does */
.izan-chat__toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    height: 3.25rem;
    padding: 0 1.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--bk-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.izan-chat__toggle .bi {
    font-size: 1.4rem;
}

.izan-chat__toggle:hover,
.izan-chat__toggle:focus-visible {
    background: var(--bk-primary-dark);
}

.izan-chat__panel {
    position: absolute;
    right: 0;
    bottom: 4rem;
    width: min(22rem, calc(100vw - 2rem));
    max-height: min(32rem, calc(100vh - 12rem));
    display: flex;
    flex-direction: column;
    background: var(--bk-bg);
    border-radius: .75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
    overflow: hidden;
}

/* display: flex would otherwise override the hidden attribute */
.izan-chat__panel[hidden] {
    display: none;
}

.izan-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    background: var(--bk-primary-dark);
    color: #fff;
}

.izan-chat__close {
    border: 0;
    background: none;
    color: inherit;
}

.izan-chat__actions {
    align-self: flex-start;
    font-size: .85rem;
    color: var(--bk-brown);
}

.izan-chat__offer-items {
    margin: 0 0 .5rem;
    padding: 0;
    list-style: none;
}

.izan-chat__offer {
    padding: .4rem .9rem;
    border: 1px solid var(--bk-primary-dark);
    border-radius: 2rem;
    background: var(--bk-bg);
    color: var(--bk-primary-dark);
}

.izan-chat__offer:hover {
    background: var(--bk-accent-light);
}

.izan-chat__offer:disabled {
    opacity: .5;
}

.izan-chat__link {
    color: var(--bk-primary-dark);
    text-decoration: underline;
}


.izan-chat__form input:focus {
    outline: 2px solid var(--bk-primary);
    outline-offset: 1px;
    border-color: transparent;
}


.izan-chat__messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin: 0;
    padding: 1rem;
    list-style: none;
    overflow-y: auto;
}

.izan-chat__message {
    max-width: 85%;
    padding: .5rem .75rem;
    border-radius: .75rem;
    font-size: .9rem;
    line-height: 1.4;
    white-space: pre-line;
    /* keep the model's line breaks */
    overflow-wrap: anywhere;
}

.izan-chat__message--assistant {
    align-self: flex-start;
    background: var(--bk-accent-light);
    color: var(--bk-brown);
}

.izan-chat__message--user {
    align-self: flex-end;
    background: var(--bk-primary-dark);
    color: #fff;
}

.izan-chat__message--waiting {
    opacity: .6;
}

.izan-chat__form {
    display: flex;
    gap: .5rem;
    padding: .75rem;
    border-top: 1px solid var(--bk-accent-light);
}

.izan-chat__form input {
    flex: 1;
    min-width: 0;
    padding: .5rem .9rem;
    border: 1px solid var(--bk-accent);
    border-radius: 2rem;
    font-size: 16px;
    /* stops iPhones zooming in on focus */
}

.izan-chat__form button {
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 50%;
    background: var(--bk-primary-dark);
    color: #fff;
}

.izan-chat__form button:disabled {
    opacity: .5;
}

.izan-chat__note {
    margin: 0;
    padding: 0 .75rem .6rem;
    font-size: .75rem;
    color: var(--bk-brown-light);
}