.site-chat-launcher { background: #a80f21; }
.site-chat-launcher[hidden], .site-chat-box[hidden], .site-chat-invite[hidden], .site-chat-form [hidden] { display: none; }

.site-chat-invite, .site-chat-box {
    position: absolute;
    right: 0;
    bottom: calc(100% + .65rem);
    pointer-events: auto;
    border: 1px solid #ead7d9;
    box-shadow: 0 12px 40px #2a161f29;
    background: #fff;
    color: #272124;
}

.site-chat-invite {
    width: min(310px, calc(100vw - 1.5rem));
    padding: .65rem .8rem;
    border-radius: .75rem;
    text-align: left;
    font-size: .875rem;
    font-weight: 600;
}

.site-chat-box {
    display: flex;
    flex-direction: column;
    width: min(370px, calc(100vw - 1.5rem));
    max-height: min(530px, calc(100vh - 5.5rem));
    max-height: min(530px, calc(100dvh - 5.5rem));
    bottom: 3.6rem;
    border-radius: 1rem;
    overflow: auto;
    font-size: .9rem;
}

.site-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .7rem .55rem 1rem;
    background: #9b1021;
    color: #fff;
}

.site-chat-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.site-chat-location { color: #ffe5e8; font-size: .75rem; }
.site-chat-head button { min-width: 44px; min-height: 44px; border: 0; border-radius: .45rem; background: transparent; color: #fff; font-size: 1.55rem; }
.site-chat-head button:hover { background: #ffffff26; }
.site-chat-log { min-height: 72px; max-height: 245px; overflow-y: auto; padding: .75rem; background: #faf6f5; }
.site-chat-message { width: fit-content; max-width: 92%; margin: 0 0 .5rem; padding: .5rem .65rem; border: 1px solid #eee3e1; border-radius: .65rem; background: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }
.site-chat-message--visitor { margin-left: auto; background: #f6e4e6; border-color: #f6e4e6; }
.site-chat-form { display: grid; gap: .5rem; padding: .75rem; }
.site-chat-form label { display: grid; gap: .2rem; font-weight: 600; }
.site-chat-form small { color: #67575f; font-weight: 400; }
.site-chat-form input, .site-chat-form textarea { display: block; width: 100%; padding: .45rem .55rem; border: 1px solid #cbbdc4; border-radius: .45rem; color: inherit; font: inherit; font-weight: 400; }
.site-chat-form textarea { resize: vertical; }
.site-chat-status { margin: 0; min-height: 1em; color: #5b414d; font-size: .8rem; }
.site-chat-form button { justify-self: end; min-height: 44px; padding: .4rem .8rem; border: 0; border-radius: .45rem; background: #a80f21; color: #fff; font-weight: 700; }
.site-chat-form button:disabled { opacity: .65; }
.site-chat-box :focus-visible, .site-chat-invite:focus-visible { outline: 2px solid #a80f21; outline-offset: 2px; }
.site-chat-head button:focus-visible { outline-color: #fff; }
