.cb-website-chat {
    --chat-purple: #2c8fe5;
    --chat-purple-dark: #1474c5;
    --chat-navy: #0c2a5e;
    --chat-ink: #0c2a5e;
    --chat-muted: #697493;
    --chat-line: #e3e7f2;
    --chat-surface: #f7f8fc;
    --chat-green: #00a878;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1400;
    font-family: inherit;
    letter-spacing: 0;
}

.cb-chat-launcher {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    margin-left: auto;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--chat-purple);
    box-shadow: 0 14px 34px rgba(11, 34, 53, 0.28);
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.cb-chat-launcher:hover {
    background: var(--chat-purple-dark);
    box-shadow: 0 16px 38px rgba(11, 34, 53, 0.34);
    transform: translateY(-2px);
}

.cb-chat-launcher:focus-visible,
.cb-chat-teaser-open:focus-visible,
.cb-chat-teaser-close:focus-visible,
.cb-chat-panel button:focus-visible,
.cb-chat-panel input:focus-visible,
.cb-chat-panel textarea:focus-visible,
.cb-chat-panel a:focus-visible {
    outline: 3px solid rgba(44, 143, 229, 0.28);
    outline-offset: 2px;
}

.cb-chat-launcher img {
    width: 31px;
    height: 31px;
    filter: brightness(0) invert(1);
}

.cb-chat-launcher > span {
    position: absolute;
    top: -4px;
    right: -3px;
    display: grid;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef476f;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.cb-chat-teaser {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: flex;
    width: 292px;
    padding: 8px;
    align-items: center;
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 46px rgba(12, 42, 94, 0.18);
    color: var(--chat-ink);
    animation: cb-chat-teaser-in 420ms cubic-bezier(.22, 1, .36, 1) both;
}

.cb-chat-teaser-open {
    display: grid;
    min-width: 0;
    flex: 1;
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 4px;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cb-chat-teaser-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    background: #f3f9fe;
}

.cb-chat-teaser-mark img {
    width: 24px;
    height: 24px;
}

.cb-chat-teaser strong,
.cb-chat-teaser small {
    display: block;
    letter-spacing: 0;
}

.cb-chat-teaser strong {
    font-size: 14px;
    line-height: 1.25;
}

.cb-chat-teaser small {
    margin-top: 3px;
    color: var(--chat-muted);
    font-size: 12px;
}

.cb-chat-teaser-close {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8c95ac;
    font-family: inherit;
    font-size: 19px;
    cursor: pointer;
}

.cb-chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: flex;
    width: min(390px, calc(100vw - 32px));
    height: min(650px, calc(100vh - 118px));
    min-height: 480px;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 64px rgba(12, 42, 94, 0.24);
    color: var(--chat-ink);
    animation: cb-chat-panel-in 240ms cubic-bezier(.22, 1, .36, 1) both;
}

.cb-chat-panel[hidden],
.cb-chat-teaser[hidden],
.cb-chat-human-form[hidden],
.cb-chat-typing[hidden],
.cb-chat-launcher > span[hidden] {
    display: none;
}

.cb-chat-header {
    display: flex;
    min-height: 76px;
    padding: 15px 16px;
    align-items: center;
    justify-content: space-between;
    background: var(--chat-navy);
    color: #fff;
}

.cb-chat-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.cb-chat-brand > span {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 8px;
    background: #fff;
}

.cb-chat-brand img {
    width: 26px;
    height: 26px;
}

.cb-chat-brand strong,
.cb-chat-brand small {
    display: block;
    letter-spacing: 0;
}

.cb-chat-brand strong {
    font-size: 15px;
    line-height: 1.3;
}

.cb-chat-brand small {
    margin-top: 3px;
    overflow: hidden;
    color: #cbd1e6;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cb-chat-brand small i {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: #2ed6a1;
}

.cb-chat-icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.cb-chat-body {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 16px;
    background: var(--chat-surface);
    scrollbar-width: thin;
}

.cb-chat-message {
    width: fit-content;
    max-width: 88%;
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(12, 42, 94, 0.05);
}

.cb-chat-message:first-child,
.cb-chat-message.is-intro {
    margin-top: 0;
}

.cb-chat-message.is-visitor {
    margin-left: auto;
    border-color: var(--chat-purple);
    background: var(--chat-purple);
    color: #fff;
}

.cb-chat-message.is-staff {
    border-left: 3px solid var(--chat-green);
}

.cb-chat-message.is-system {
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
    border-style: dashed;
    background: #f0f2f7;
    box-shadow: none;
    text-align: center;
}

.cb-chat-message-author {
    display: block;
    margin-bottom: 5px;
    color: var(--chat-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cb-chat-message.is-visitor .cb-chat-message-author {
    color: #eaf5ff;
}

.cb-chat-message p {
    margin: 0;
    color: inherit;
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.cb-chat-message time {
    display: block;
    margin-top: 7px;
    color: #98a0b6;
    font-size: 9px;
}

.cb-chat-message.is-visitor time {
    color: #eaf5ff;
}

.cb-chat-source {
    display: flex;
    margin-top: 9px;
    padding-top: 8px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--chat-line);
    color: var(--chat-purple-dark);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.cb-chat-quick {
    display: grid;
    margin-top: 13px;
    gap: 7px;
}

.cb-chat-quick button {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid #eaf5ff;
    border-radius: 8px;
    background: #fff;
    color: #0b2235;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.cb-chat-quick button:hover {
    border-color: var(--chat-purple);
    background: #f3f9fe;
}

.cb-chat-typing {
    display: flex;
    width: fit-content;
    margin-top: 12px;
    padding: 10px 12px;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    background: #fff;
    color: var(--chat-muted);
    font-size: 10px;
}

.cb-chat-typing i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--chat-purple);
    animation: cb-chat-dot 900ms infinite ease-in-out;
}

.cb-chat-typing i:nth-child(2) { animation-delay: 120ms; }
.cb-chat-typing i:nth-child(3) { animation-delay: 240ms; }
.cb-chat-typing span { margin-left: 4px; }
.cb-chat-typing.is-staff i { background: #00a878; }

.cb-chat-composer {
    flex: 0 0 auto;
    padding: 10px 12px 11px;
    border-top: 1px solid var(--chat-line);
    background: #fff;
}

.cb-chat-composer > form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: end;
    gap: 8px;
}

.cb-chat-input-wrap {
    display: block;
}

.cb-chat-input-wrap textarea {
    display: block;
    width: 100%;
    min-height: 42px;
    max-height: 96px;
    padding: 11px 12px;
    resize: none;
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    background: var(--chat-surface);
    color: var(--chat-ink);
    font: inherit;
    font-size: 13px;
    line-height: 1.4;
}

.cb-chat-send {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: var(--chat-purple);
    color: #fff;
    cursor: pointer;
}

.cb-chat-send svg {
    width: 17px;
    height: 17px;
}

.cb-chat-send:disabled,
.cb-chat-primary:disabled {
    opacity: .55;
    cursor: wait;
}

.cb-chat-human-button {
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--chat-purple-dark);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.cb-chat-composer > small {
    display: block;
    margin-top: 7px;
    color: #8a93aa;
    font-size: 9px;
    text-align: center;
}

.cb-chat-composer > small a {
    color: inherit;
}

.cb-chat-human-form {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    background: #fff;
}

.cb-chat-human-heading > span {
    display: block;
    color: #e56712;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cb-chat-human-heading strong {
    display: block;
    margin-top: 5px;
    font-size: 18px;
}

.cb-chat-human-heading p {
    margin: 6px 0 17px;
    color: var(--chat-muted);
    font-size: 12px;
    line-height: 1.45;
}

.cb-chat-human-form label {
    display: block;
    margin-top: 12px;
}

.cb-chat-human-form label > span {
    display: block;
    margin-bottom: 5px;
    color: var(--chat-navy);
    font-size: 11px;
    font-weight: 800;
}

.cb-chat-human-form input,
.cb-chat-human-form textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    color: var(--chat-ink);
    font: inherit;
    font-size: 12px;
}

.cb-chat-human-form textarea {
    resize: vertical;
}

.cb-chat-human-actions {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    margin-top: 16px;
    gap: 8px;
}

.cb-chat-primary,
.cb-chat-secondary {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.cb-chat-primary {
    border: 1px solid var(--chat-purple);
    background: var(--chat-purple);
    color: #fff;
}

.cb-chat-secondary {
    border: 1px solid var(--chat-line);
    background: #fff;
    color: var(--chat-navy);
}

.cb-chat-form-error {
    margin: 10px 0 0;
    padding: 8px 10px;
    border: 1px solid #ffc5d2;
    border-radius: 8px;
    background: #fff3f6;
    color: #b3264a;
    font-size: 11px;
}

@keyframes cb-chat-teaser-in {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cb-chat-panel-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cb-chat-dot {
    0%, 60%, 100% { opacity: .3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 560px) {
    .cb-website-chat {
        right: 14px;
        bottom: 14px;
    }

    .cb-chat-panel {
        position: fixed;
        right: 10px;
        bottom: 80px;
        left: 10px;
        width: auto;
        height: min(680px, calc(100dvh - 94px));
        min-height: 0;
    }

    .cb-chat-teaser {
        width: min(292px, calc(100vw - 28px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .cb-chat-teaser,
    .cb-chat-panel,
    .cb-chat-typing i {
        animation: none;
    }
}
