:root {
    --cg-chatbot-z-index: 9999;
    --cg-chatbot-bg: #ffffff;
    --cg-chatbot-surface: #f7f8fb;
    --cg-chatbot-surface-2: #eef2f8;
    --cg-chatbot-text: #101828;
    --cg-chatbot-text-soft: #475467;
    --cg-chatbot-border: rgba(16, 24, 40, 0.08);
    --cg-chatbot-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    --cg-chatbot-accent: #3b82f6;
    --cg-chatbot-accent-2: #2563eb;
    --cg-chatbot-accent-soft: rgba(59, 130, 246, 0.12);
    --cg-chatbot-user-bubble: #111827;
    --cg-chatbot-user-text: #ffffff;
    --cg-chatbot-bot-bubble: #f3f6fb;
    --cg-chatbot-bot-text: #111827;
    --cg-chatbot-success: #12b76a;
    --cg-chatbot-radius: 22px;
    --cg-chatbot-radius-sm: 14px;
    --cg-chatbot-launcher-size: 64px;
    --cg-chatbot-bottom: 16px;
    --cg-chatbot-right: 16px;
    --cg-chatbot-desktop-width: 390px;
    --cg-chatbot-desktop-height: 680px;
    --cg-chatbot-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cg-chatbot,
.cg-chatbot *,
.cg-chatbot *::before,
.cg-chatbot *::after {
    box-sizing: border-box;
}

.cg-chatbot {
    font-family: var(--cg-chatbot-font);
}

.cg-chatbot__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.cg-chatbot__launcher {
    position: fixed;
    right: var(--cg-chatbot-right);
    bottom: var(--cg-chatbot-bottom);
    z-index: var(--cg-chatbot-z-index);
    width: var(--cg-chatbot-launcher-size);
    height: var(--cg-chatbot-launcher-size);
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.cg-chatbot__launcher-orb {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.22) 22%, transparent 24%),
        linear-gradient(135deg, var(--cg-chatbot-accent), var(--cg-chatbot-accent-2));
    box-shadow:
        0 18px 35px rgba(37, 99, 235, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.cg-chatbot__launcher-orb-inner {
    position: absolute;
    inset: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background:
        radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.06) 45%, transparent 60%);
}

.cg-chatbot__launcher:hover .cg-chatbot__launcher-orb,
.cg-chatbot__launcher:focus-visible .cg-chatbot__launcher-orb {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 24px 44px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.cg-chatbot__launcher:focus-visible {
    outline: none;
}

.cg-chatbot__launcher:focus-visible .cg-chatbot__launcher-orb {
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.2),
        0 24px 44px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.cg-chatbot__launcher-ping {
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    border: 2px solid rgba(59, 130, 246, 0.18);
    animation: cg-chatbot-ping 2.8s ease-out infinite;
    pointer-events: none;
}

@keyframes cg-chatbot-ping {
    0% {
        transform: scale(0.96);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.12);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

.cg-chatbot__teaser {
    position: fixed;
    right: calc(var(--cg-chatbot-right) + 4px);
    bottom: calc(var(--cg-chatbot-bottom) + var(--cg-chatbot-launcher-size) + 12px);
    z-index: calc(var(--cg-chatbot-z-index) - 1);
    max-width: min(300px, calc(100vw - 32px));
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.cg-chatbot__teaser.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cg-chatbot__teaser-content {
    background: var(--cg-chatbot-bg);
    color: var(--cg-chatbot-text);
    border: 1px solid var(--cg-chatbot-border);
    border-radius: 18px;
    box-shadow: var(--cg-chatbot-shadow);
    padding: 14px 14px 12px;
}

.cg-chatbot__teaser-text {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.45;
}

.cg-chatbot__teaser-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cg-chatbot__teaser-open,
.cg-chatbot__teaser-close {
    border: 0;
    cursor: pointer;
}

.cg-chatbot__teaser-open {
    background: var(--cg-chatbot-accent);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 12px;
}

.cg-chatbot__teaser-close {
    width: 32px;
    height: 32px;
    background: var(--cg-chatbot-surface);
    color: var(--cg-chatbot-text);
    border-radius: 999px;
    font-size: 20px;
    line-height: 1;
}

.cg-chatbot__modal {
    position: fixed;
    inset: 0;
    z-index: calc(var(--cg-chatbot-z-index) + 1);
    display: flex;
    flex-direction: column;
    background: var(--cg-chatbot-bg);
    color: var(--cg-chatbot-text);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 180ms ease;
}

.cg-chatbot__modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.cg-chatbot__header {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--cg-chatbot-border);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(140%) blur(14px);
}

.cg-chatbot__header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cg-chatbot__header-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cg-chatbot-accent), var(--cg-chatbot-accent-2));
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
    flex: 0 0 auto;
}

.cg-chatbot__header-avatar-inner {
    position: absolute;
    inset: 8px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.2) 28%, transparent 30%),
        radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.22), transparent 62%);
}

.cg-chatbot__header-copy {
    min-width: 0;
}

.cg-chatbot__title {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
}

.cg-chatbot__subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.3;
    color: var(--cg-chatbot-text-soft);
}

.cg-chatbot__header-actions {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cg-chatbot__icon-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: var(--cg-chatbot-surface);
    color: var(--cg-chatbot-text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.cg-chatbot__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.cg-chatbot__messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.cg-chatbot__message {
    display: flex;
}

.cg-chatbot__message--bot {
    justify-content: flex-start;
}

.cg-chatbot__message--user {
    justify-content: flex-end;
}

.cg-chatbot__bubble {
    max-width: 85%;
    border-radius: 18px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.cg-chatbot__message--bot .cg-chatbot__bubble {
    background: var(--cg-chatbot-bot-bubble);
    color: var(--cg-chatbot-bot-text);
    border-top-left-radius: 8px;
}

.cg-chatbot__message--user .cg-chatbot__bubble {
    background: var(--cg-chatbot-user-bubble);
    color: var(--cg-chatbot-user-text);
    border-top-right-radius: 8px;
}

.cg-chatbot__quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 16px 16px;
}

.cg-chatbot__quick-action {
    border: 1px solid var(--cg-chatbot-border);
    background: var(--cg-chatbot-bg);
    color: var(--cg-chatbot-text);
    border-radius: 999px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.cg-chatbot__quick-action:hover,
.cg-chatbot__quick-action:focus-visible {
    background: var(--cg-chatbot-accent-soft);
    border-color: rgba(59, 130, 246, 0.22);
    transform: translateY(-1px);
    outline: none;
}

.cg-chatbot__footer {
    border-top: 1px solid var(--cg-chatbot-border);
    padding: 12px 16px 16px;
    background: rgba(255, 255, 255, 0.95);
}

.cg-chatbot__form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cg-chatbot__input-wrap {
    flex: 1 1 auto;
    display: block;
}

.cg-chatbot__input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--cg-chatbot-border);
    border-radius: 999px;
    background: var(--cg-chatbot-surface);
    color: var(--cg-chatbot-text);
    padding: 0 16px;
    font-size: 14px;
    outline: none;
}

.cg-chatbot__input:focus {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.cg-chatbot__submit {
    flex: 0 0 auto;
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    background: var(--cg-chatbot-accent);
    color: #fff;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.cg-chatbot__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.cg-chatbot-open {
    overflow: hidden;
}

.cg-chatbot__launcher-label {
    position: absolute;
    right: 72px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: #ffffff;
    color: var(--cg-chatbot-text);
    border: 1px solid var(--cg-chatbot-border);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.cg-chatbot__launcher.has-hint .cg-chatbot__launcher-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.cg-chatbot__launcher-chat-mark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.cg-chatbot__launcher-wave {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--cg-chatbot-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    opacity: 0;
    transform: scale(0.8) rotate(-8deg);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}

.cg-chatbot__launcher.has-hint .cg-chatbot__launcher-wave {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    animation: cg-chatbot-wave 1.6s ease-in-out 2;
}

@keyframes cg-chatbot-wave {
    0% {
        transform: scale(1) rotate(0deg);
    }

    20% {
        transform: scale(1) rotate(12deg);
    }

    40% {
        transform: scale(1) rotate(-8deg);
    }

    60% {
        transform: scale(1) rotate(10deg);
    }

    80% {
        transform: scale(1) rotate(-4deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

@media (max-width: 767px) {
    .cg-chatbot__launcher-label {
        right: 68px;
        padding: 7px 10px;
        font-size: 12px;
    }
}

@media (min-width: 768px) {
    body.cg-chatbot-open {
        overflow: auto;
    }

    .cg-chatbot__modal {
        inset: auto;
        right: 24px;
        bottom: 96px;
        width: min(var(--cg-chatbot-desktop-width), calc(100vw - 32px));
        height: min(var(--cg-chatbot-desktop-height), calc(100vh - 120px));
        border: 1px solid var(--cg-chatbot-border);
        border-radius: var(--cg-chatbot-radius);
        box-shadow: var(--cg-chatbot-shadow);
        overflow: hidden;
    }

    .cg-chatbot__header {
        padding: 18px 18px 16px;
    }

    .cg-chatbot__messages {
        padding: 18px;
    }

    .cg-chatbot__quick-actions {
        padding: 0 18px 18px;
    }

    .cg-chatbot__footer {
        padding: 12px 18px 18px;
    }
}

@media (max-width: 767px) {
    .cg-chatbot__modal {
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .cg-chatbot__launcher-orb,
    .cg-chatbot__teaser,
    .cg-chatbot__modal,
    .cg-chatbot__quick-action,
    .cg-chatbot__launcher-ping {
        transition: none;
        animation: none;
    }
}

.cg-chatbot__lead-modal {
    position: fixed;
    inset: 0;
    z-index: calc(var(--cg-chatbot-z-index) + 20);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.cg-chatbot__lead-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cg-chatbot__lead-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
}

.cg-chatbot__lead-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid var(--cg-chatbot-border);
    border-radius: 22px;
    box-shadow: var(--cg-chatbot-shadow);
}

.cg-chatbot__lead-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--cg-chatbot-border);
}

.cg-chatbot__lead-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.cg-chatbot__lead-form {
    padding: 18px;
    display: grid;
    gap: 14px;
}

.cg-chatbot__lead-field {
    display: grid;
    gap: 8px;
}

.cg-chatbot__lead-field span {
    font-size: 13px;
    font-weight: 600;
    color: var(--cg-chatbot-text);
}

.cg-chatbot__lead-field input,
.cg-chatbot__lead-field textarea {
    width: 100%;
    border: 1px solid var(--cg-chatbot-border);
    border-radius: 14px;
    background: var(--cg-chatbot-surface);
    color: var(--cg-chatbot-text);
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    resize: vertical;
}

.cg-chatbot__lead-field input:focus,
.cg-chatbot__lead-field textarea:focus {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.cg-chatbot__lead-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

.cg-chatbot__lead-cancel,
.cg-chatbot__lead-submit {
    min-height: 44px;
    border-radius: 999px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.cg-chatbot__lead-cancel {
    border: 1px solid var(--cg-chatbot-border);
    background: #fff;
    color: var(--cg-chatbot-text);
}

.cg-chatbot__lead-submit {
    border: 0;
    background: var(--cg-chatbot-accent);
    color: #fff;
}

@media (max-width: 767px) {
    .cg-chatbot__lead-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 18px;
    }

    .cg-chatbot__lead-header,
    .cg-chatbot__lead-form {
        padding-left: 14px;
        padding-right: 14px;
    }
}