.cbt-chat {
    --chat-edge: 24px;
    --chat-right: calc(var(--chat-edge) + env(safe-area-inset-right, 0px));
    --chat-bottom: calc(var(--chat-edge) + env(safe-area-inset-bottom, 0px));
    --chat-ink: #183e34;
    --chat-green: #076940;
    --chat-border: #cddfd4;
    position: fixed;
    right: var(--chat-right);
    bottom: var(--chat-bottom);
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--chat-ink);
    font: 500 14px/1.5 Inter, system-ui, -apple-system, sans-serif;
    letter-spacing: normal;
}

.cbt-chat, .cbt-chat * { box-sizing: border-box; }
.cbt-chat [hidden] { display: none !important; }

.cbt-chat button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    font: inherit;
    line-height: 1.3;
    cursor: pointer;
    appearance: none;
}

.cbt-chat a { text-decoration: none; }
.cbt-chat svg {
    display: block;
    flex: none;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cbt-chat .cbt-chat__whatsapp-icon {
    width: 21px;
    height: 21px;
    stroke: none;
}
.cbt-chat :is(button, a):focus-visible {
    outline: 2px solid #138259;
    outline-offset: 3px;
}

.cbt-chat .cbt-chat__launch {
    min-height: 52px;
    padding: 0 19px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--chat-green);
    color: #fff;
    box-shadow: 0 6px 21px #102b2450;
    font-weight: 700;
    white-space: nowrap;
}

.cbt-chat .cbt-chat__top {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #a9c8ba;
    border-radius: 50%;
    background: #f9fdfa;
    color: #215a48;
    box-shadow: 0 4px 15px #102b2430;
}

.cbt-chat__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(360px, calc(100vw - var(--chat-right) - var(--chat-edge) - env(safe-area-inset-left, 0px)));
    max-height: calc(100vh - var(--chat-bottom) - 76px);
    max-height: calc(100dvh - var(--chat-bottom) - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    background: #f4f8f5;
    box-shadow: 0 16px 46px #132b2338;
}

.cbt-chat__header {
    position: sticky;
    z-index: 1;
    top: 0;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 6px;
    padding: 18px 13px 17px 20px;
    background: #18483d;
    color: #fff;
}

.cbt-chat__header h2 {
    margin: 0;
    color: #fff;
    font: 700 19px/1.25 Inter, system-ui, -apple-system, sans-serif;
    letter-spacing: -.02em;
}
.cbt-chat__header p {
    margin: 4px 0 0;
    color: #dcece5;
    font-size: 12.5px;
    line-height: 1.45;
}
.cbt-chat .cbt-chat__close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin-top: -6px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
}
.cbt-chat .cbt-chat__close:focus-visible { outline-color: #c4f0d6; }

.cbt-chat__content { padding: 18px 19px 10px; }
.cbt-chat .cbt-chat__sales {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--chat-border);
    border-radius: 14px;
    background: #fff;
    color: var(--chat-ink);
}
.cbt-chat__sales img {
    display: block;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e3eee7;
    object-fit: cover;
}
.cbt-chat__sales strong { display: block; font-weight: 700; }
.cbt-chat__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--chat-green);
    font-size: 13.5px;
}
.cbt-chat__link svg { width: 13px; height: 13px; }
.cbt-chat__guidance {
    margin: 15px 0;
    color: #456559;
    font-size: 14px;
    line-height: 1.55;
}
.cbt-chat__contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0 19px;
    padding-top: 6px;
    border-top: 1px solid var(--chat-border);
}
.cbt-chat__contact a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    color: #255747;
    font-size: 13px;
}
.cbt-chat__contact svg { width: 16px; height: 16px; }

@media (hover: hover) {
    .cbt-chat .cbt-chat__launch:hover { background: #075934; }
    .cbt-chat .cbt-chat__top:hover { background: #e7f3ec; }
    .cbt-chat .cbt-chat__close:hover { background: #ffffff22; }
    .cbt-chat .cbt-chat__sales:hover { border-color: #80af9b; }
    .cbt-chat .cbt-chat__sales:hover .cbt-chat__link,
    .cbt-chat__contact a:hover { text-decoration: underline; text-underline-offset: 3px; }
}

@media (max-width: 600px) {
    .cbt-chat { --chat-edge: 14px; }
    .cbt-chat__header { padding-left: 16px; }
    .cbt-chat__content { padding-inline: 15px; }
}

@media (prefers-reduced-motion: no-preference) {
    .cbt-chat__panel:not([hidden]) { animation: cbt-chat-enter 160ms ease-out; }
    @keyframes cbt-chat-enter {
        from { opacity: 0; transform: translateY(5px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
