.hce-chat-root,
.hce-chat-root * {
    box-sizing: border-box;
}

.hce-chat-root {
    position: fixed;
    bottom: 22px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hce-chat-right { right: 22px; }
.hce-chat-left { left: 22px; }

.hce-chat-launcher {
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .24);
    transition: transform .2s ease, box-shadow .2s ease;
}

.hce-chat-launcher:hover,
.hce-chat-launcher:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 15px 36px rgba(0, 0, 0, .28);
    outline: none;
}

.hce-chat-launcher img {
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent !important;
}

.hce-chat-panel {
    position: absolute;
    bottom: 76px;
    width: min(360px, calc(100vw - 32px));
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 20px 55px rgba(0, 0, 0, .25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.hce-chat-right .hce-chat-panel { right: 0; }
.hce-chat-left .hce-chat-panel { left: 0; transform-origin: bottom left; }

.hce-chat-root.is-open .hce-chat-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.hce-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 19px 20px;
    color: #fff;
    background: var(--hce-chat-accent) !important;
}

.hce-chat-header strong {
    display: block;
    font-size: 18px;
    line-height: 1.3;
}

.hce-chat-status {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    font-size: 13px;
    opacity: .92;
}

.hce-chat-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffd54f;
}

.hce-chat-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    font-size: 25px;
    line-height: 28px;
    cursor: pointer;
}

.hce-chat-body {
    min-height: 250px;
    padding: 20px;
    background: #f5f7fb;
}

.hce-chat-step { display: none; }
.hce-chat-step.is-active { display: block; animation: hceChatFade .22s ease; }

@keyframes hceChatFade {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.hce-chat-agent-message {
    position: relative;
    max-width: 92%;
    margin: 0 0 16px;
    padding: 13px 15px;
    border-radius: 4px 15px 15px 15px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(16, 24, 40, .08);
    font-size: 14px;
    line-height: 1.55;
}

.hce-chat-agent-message strong,
.hce-chat-agent-message span {
    display: block;
}

.hce-chat-agent-message strong { margin-bottom: 4px; }

.hce-chat-email-form,
.hce-chat-message-form {
    display: grid;
    gap: 10px;
}

.hce-chat-root input,
.hce-chat-root textarea {
    width: 100%;
    margin: 0;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 12px 13px;
    color: #1f2937;
    background: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: none;
    outline: none;
}

.hce-chat-root textarea {
    resize: vertical;
    min-height: 112px;
}

.hce-chat-root input:focus,
.hce-chat-root textarea:focus {
    border-color: var(--hce-chat-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hce-chat-accent) 16%, transparent);
}

.hce-chat-root form > button {
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    color: #fff;
    background: var(--hce-chat-accent) !important;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease;
}

.hce-chat-root form > button:hover { transform: translateY(-1px); }
.hce-chat-root form > button:disabled { opacity: .65; cursor: wait; }
.hce-chat-root form > button.is-loading::after { content: "…"; }

.hce-chat-error {
    min-height: 18px;
    margin: -3px 0 0;
    color: #b42318;
    font-size: 12px;
}

.hce-chat-root small {
    display: block;
    color: #667085;
    font-size: 11px;
    line-height: 1.45;
}

.hce-chat-success-message {
    color: #166534;
    background: #ecfdf3;
}

.hce-chat-root .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .hce-chat-root {
        bottom: 16px;
    }

    .hce-chat-right { right: 16px; }
    .hce-chat-left { left: 16px; }

    .hce-chat-panel {
        position: fixed;
        left: 16px !important;
        right: 16px !important;
        bottom: 88px;
        width: auto;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
    }
}
