.zf-client-chat {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147482000;
    font-family: inherit;
}

.zf-client-chat-toggle {
    position: relative;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: #103b2d;
    color: #fff;
    box-shadow: 0 10px 32px rgba(16, 59, 45, .24);
    transition: transform .16s ease, box-shadow .16s ease;
}

.zf-client-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 38px rgba(16, 59, 45, .3);
}

.zf-client-chat-toggle svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zf-client-chat-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #d9363e;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.zf-client-chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(390px, calc(100vw - 28px));
    height: min(570px, calc(100vh - 120px));
    min-height: 390px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(16, 59, 45, .12);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(17, 34, 28, .22);
}

.zf-client-chat-panel[hidden] { display: none; }

.zf-client-chat-head {
    flex: 0 0 auto;
    min-height: 66px;
    padding: 14px 14px 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #103b2d;
    color: #fff;
}

.zf-client-chat-head strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
}

.zf-client-chat-head small {
    display: block;
    margin-top: 4px;
    color: rgba(255,255,255,.72);
    font-size: 12px;
}

.zf-client-chat-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 24px;
    line-height: 1;
}

.zf-client-chat-body {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    background: #f5f7f5;
}

.zf-client-chat-auth {
    margin: auto;
    width: 100%;
    padding: 24px;
}

.zf-client-chat-auth h3 {
    margin: 0 0 8px;
    color: #173d31;
    font-size: 19px;
}

.zf-client-chat-auth p {
    margin: 0 0 18px;
    color: #5f6d67;
    font-size: 13px;
    line-height: 1.45;
}

.zf-client-chat-auth label {
    display: block;
    margin: 0 0 12px;
    color: #33443d;
    font-size: 12px;
    font-weight: 700;
}

.zf-client-chat-auth input[type="text"],
.zf-client-chat-auth input[type="tel"] {
    box-sizing: border-box;
    width: 100%;
    margin-top: 6px;
    padding: 12px 13px;
    border: 1px solid #d7dfdb;
    border-radius: 12px;
    background: #fff;
    color: #1f2c27;
    font: inherit;
    outline: none;
}

.zf-client-chat-auth input:focus,
.zf-client-chat-compose textarea:focus {
    border-color: #618c78;
    box-shadow: 0 0 0 3px rgba(97,140,120,.12);
}

.zf-client-chat-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    line-height: 1.35;
}

.zf-client-chat-consent input { margin-top: 2px; }
.zf-client-chat-consent a { color: #245c46; }

.zf-client-chat-primary,
.zf-client-chat-secondary {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
}

.zf-client-chat-primary {
    border: 0;
    background: #103b2d;
    color: #fff;
}

.zf-client-chat-secondary {
    margin-top: 8px;
    border: 1px solid #cbd6d0;
    background: #fff;
    color: #244b3c;
}

.zf-client-chat-primary:disabled,
.zf-client-chat-secondary:disabled { opacity: .55; cursor: default; }

.zf-client-chat-error {
    margin: 10px 0 0;
    color: #b52b35;
    font-size: 12px;
    line-height: 1.35;
}

.zf-client-chat-call-number {
    display: block;
    margin: 14px 0;
    padding: 14px;
    border-radius: 14px;
    background: #e8f0ec;
    color: #103b2d;
    text-align: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: 850;
}

.zf-client-chat-messages {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    padding: 16px 14px 12px;
    scroll-behavior: smooth;
}

.zf-client-chat-empty {
    margin: 34px auto;
    max-width: 270px;
    color: #7a8781;
    text-align: center;
    font-size: 13px;
    line-height: 1.45;
}

.zf-client-chat-message {
    width: fit-content;
    max-width: 84%;
    margin: 0 0 10px;
    padding: 10px 12px 8px;
    border-radius: 15px 15px 15px 5px;
    background: #fff;
    color: #24312c;
    box-shadow: 0 2px 10px rgba(20,44,34,.06);
}

.zf-client-chat-message.is-client {
    margin-left: auto;
    border-radius: 15px 15px 5px 15px;
    background: #dfece5;
}

.zf-client-chat-message-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.42;
}

.zf-client-chat-message-text.is-muted { color: #7d8984; font-style: italic; }

.zf-client-chat-message-file {
    margin-top: 8px;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
}

.zf-client-chat-message-file-link {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid rgba(70,96,84,.14);
    border-radius: 10px;
    background: rgba(255,255,255,.58);
    color: #234b3b;
    text-decoration: none;
}

.zf-client-chat-message-file-link:hover { border-color: rgba(36,92,70,.32); background: #fff; }
.zf-client-chat-message-file-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.zf-client-chat-message-file-link small { color: #7c8983; font-size: 10px; }

.zf-client-chat-message-time {
    margin-top: 5px;
    color: #849089;
    text-align: right;
    font-size: 10px;
}

.zf-client-chat-compose {
    flex: 0 0 auto;
    padding: 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    border-top: 1px solid #e1e6e3;
    background: #fff;
}

.zf-client-chat-compose textarea {
    min-height: 44px;
    max-height: 110px;
    resize: none;
    padding: 10px 11px;
    border: 1px solid #d5ddd9;
    border-radius: 12px;
    color: #24312c;
    font: inherit;
    line-height: 1.35;
    outline: none;
}

.zf-client-chat-attach,
.zf-client-chat-send {
    align-self: end;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.zf-client-chat-attach {
    padding: 0;
    border: 1px solid #d5ddd9;
    background: #fff;
    color: #315d4a;
}

.zf-client-chat-attach:hover { border-color: #618c78; background: #f4f8f6; }
.zf-client-chat-attach svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.zf-client-chat-send {
    border: 0;
    background: #103b2d;
    color: #fff;
    font-size: 20px;
}

.zf-client-chat-send:disabled { opacity: .5; cursor: default; }
.zf-client-chat-selected-file { grid-column: 1 / -1; min-width: 0; color: #66756e; font-size: 11px; overflow-wrap: anywhere; }

@media (max-width: 640px) {
    .zf-client-chat { right: 12px; bottom: 12px; }
    .zf-client-chat-toggle { width: 54px; height: 54px; }
    .zf-client-chat-panel {
        position: fixed;
        inset: 10px 10px 76px 10px;
        width: auto;
        height: auto;
        min-height: 0;
        border-radius: 18px;
    }
}
