.site-chat {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    font-family: inherit;
}

.site-chat__launcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: var(--primary-color, #37AF24);
    color: #fff;
    box-shadow: 0 14px 35px rgba(31, 126, 16, 0.26);
    cursor: pointer;
    font-weight: 700;
}

.site-chat__launcher-icon {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.site-chat__panel {
    display: none;
    width: min(380px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid #d9efd6;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.site-chat--open .site-chat__launcher {
    display: none;
}

.site-chat--open .site-chat__panel {
    display: block;
}

.site-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: var(--primary-color, #37AF24);
    color: #fff;
}

.site-chat__header strong,
.site-chat__header span {
    display: block;
}

.site-chat__header strong {
    font-size: 15px;
    line-height: 1.2;
}

.site-chat__header span {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
}

.site-chat__header button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.site-chat__messages {
    display: flex;
    flex-direction: column;
    gap: 9px;
    height: 300px;
    overflow-y: auto;
    padding: 14px;
    background: #f8fff6;
}

.site-chat__message {
    max-width: 86%;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 14px;
    line-height: 1.35;
}

.site-chat__message--inbound {
    align-self: flex-end;
    background: var(--primary-color, #37AF24);
    color: #fff;
}

.site-chat__message--outbound {
    align-self: flex-start;
    border: 1px solid #d9efd6;
    background: #fff;
    color: #1f2937;
}

.site-chat__welcome {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.site-chat__message--welcome {
    max-width: 92%;
    border-color: #ccebc6;
}

.site-chat__quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    max-width: 96%;
}

.site-chat__quick-replies button {
    border: 1px solid #ccebc6;
    border-radius: 999px;
    padding: 6px 10px;
    background: #fff;
    color: var(--green-700, #15803D);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.site-chat__quick-replies button:hover {
    border-color: var(--primary-color, #37AF24);
    background: #f0ffe9;
}

.site-chat__message-time {
    margin-top: 4px;
    opacity: 0.68;
    font-size: 11px;
}

.site-chat__attachment {
    display: block;
    margin-top: 6px;
    color: inherit;
    text-decoration: underline;
}

.site-chat__form {
    padding: 12px;
    border-top: 1px solid #d9efd6;
    background: #fff;
}

.site-chat__visitor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.site-chat__visitor input:first-child {
    grid-column: 1 / -1;
}

.site-chat input,
.site-chat textarea {
    width: 100%;
    border: 1px solid #cfe4cb;
    border-radius: 6px;
    padding: 8px 10px;
    color: #111827;
    font: inherit;
    font-size: 14px;
    outline: none;
}

.site-chat textarea {
    min-height: 64px;
    resize: vertical;
}

.site-chat input:focus,
.site-chat textarea:focus {
    border-color: var(--primary-color, #37AF24);
    box-shadow: 0 0 0 3px rgba(55, 175, 36, 0.16);
}

.site-chat__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 9px;
}

.site-chat__footer span {
    min-height: 18px;
    color: #64746e;
    font-size: 12px;
}

.site-chat__footer span[data-type="error"] {
    color: #b42318;
}

.site-chat__footer span[data-type="ok"] {
    color: var(--green-700, #15803D);
}

.site-chat__footer button {
    border: 0;
    border-radius: 6px;
    padding: 9px 14px;
    background: var(--primary-color, #37AF24);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.site-chat__launcher:hover,
.site-chat__footer button:hover {
    background: var(--primary-color-hovered, #1f7e10);
}

.site-chat__footer button:disabled {
    cursor: wait;
    opacity: 0.7;
}

@media (max-width: 520px) {
    .site-chat {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }

    .site-chat__panel {
        width: 100%;
    }

    .site-chat__messages {
        height: min(52vh, 320px);
    }
}
