.sc {
    --sc-w: 360px;
    font-family: var(--dc-sans);
    color: var(--dc-fg);
}
.sc-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: var(--dc-primary);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(18, 22, 31, .22), 0 2px 6px rgba(18, 22, 31, .14);
    transition: transform .18s ease, background .18s ease;
}
.sc-launcher:hover { transform: scale(1.06); background: var(--dc-primary-dark); }
.sc-launcher:focus-visible { outline: 2px solid var(--dc-primary); outline-offset: 3px; }
.sc-launcher svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sc-ico-close, .sc.is-open .sc-ico-open { display: none; }
.sc.is-open .sc-ico-close { display: block; }

.sc-panel {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 1000;
    width: var(--sc-w);
    max-height: min(620px, calc(100vh - 120px));
    max-height: min(620px, calc(100dvh - 120px));
    display: flex;
    flex-direction: column;
    background: var(--dc-card);
    border: 1px solid var(--dc-border);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(18, 22, 31, .18), 0 4px 14px rgba(18, 22, 31, .08);
    overflow: hidden;
    transform-origin: bottom right;
    animation: sc-in .2s ease-out;
}
.sc-panel[hidden] { display: none; }
@keyframes sc-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.sc-panel.is-closing { animation: sc-out .2s ease-in forwards; pointer-events: none; }
@keyframes sc-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .sc-panel, .sc-panel.is-closing { animation: none; } }

.sc-teaser {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 999;
    display: flex;
    align-items: flex-start;
    max-width: 280px;
    background: var(--dc-card);
    border: 1px solid var(--dc-border);
    border-radius: 14px 14px 4px 14px;
    box-shadow: 0 10px 28px rgba(18, 22, 31, .14);
    animation: sc-in .25s ease-out;
}
.sc-teaser[hidden], .sc.is-open .sc-teaser { display: none; }
.sc-teaser-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px 10px 12px;
    border: 0;
    background: none;
    font: 400 13.5px/1.4 var(--dc-sans);
    color: var(--dc-fg);
    text-align: left;
    cursor: pointer;
}
.sc-teaser-body img { flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.sc-teaser-body strong { font-weight: 600; color: var(--dc-primary); }
.sc-teaser-x {
    flex: none;
    width: 26px;
    height: 26px;
    margin: 4px 4px 0 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--dc-muted-fg);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.sc-teaser-x:hover { background: var(--dc-hover); color: var(--dc-fg); }
.sc-teaser-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) { .sc-teaser { animation: none; } }

.sc-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 18px;
    border-bottom: 1px solid var(--dc-border);
}
.sc-avatar {
    position: relative;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dc-primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 16px;
}
.sc-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.sc-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--dc-card);
}
.sc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sc-who strong { font-size: 15px; font-weight: 600; }
.sc-who span { font-size: 12.5px; color: var(--dc-muted-fg); }
.sc-icon-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--dc-muted-fg);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.sc-icon-btn:hover { background: var(--dc-hover); color: var(--dc-fg); }
.sc-icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.sc-log {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sc-sub { margin: 0 0 4px; text-align: center; font-size: 13px; color: var(--dc-muted-fg); }
.sc-msg {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.sc-msg p { margin: 0; }
.sc-msg p + p, .sc-msg p + ul, .sc-msg ul + p { margin-top: 8px; }
.sc-msg ul { margin: 6px 0 0; padding-left: 18px; list-style: disc; }
.sc-msg li { display: list-item; margin: 2px 0; }
.sc-msg a { color: var(--dc-primary); font-weight: 600; text-decoration: none; }
.sc-msg a:hover { text-decoration: underline; text-underline-offset: 2px; }
.sc-msg a.sc-wa {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    background: var(--dc-card);
    border: 1px solid var(--dc-border);
    transition: border-color .15s ease;
}
.sc-msg a.sc-wa:hover { text-decoration: none; border-color: var(--dc-primary); }
.sc-wa svg { width: 16px; height: 16px; flex: none; fill: #25d366; }
.sc-wa-arrow { transition: transform .15s ease; }
.sc-wa:hover .sc-wa-arrow { transform: translateX(3px); }
.sc-msg--bot { align-self: flex-start; background: var(--dc-muted); color: var(--dc-fg); border-bottom-left-radius: 4px; }
.sc-msg--user { align-self: flex-end; background: var(--dc-primary); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.sc-faq-title { font-weight: 600; }
.sc-faqs { list-style: disc; }
.sc-faqs button {
    display: block;
    text-align: left;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--dc-primary);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.sc-faqs button:hover { text-decoration: underline; text-underline-offset: 2px; }
.sc-meta { font-size: 11.5px; color: var(--dc-subtle); margin: -4px 0 4px 2px; }

.sc-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.sc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--dc-subtle); animation: sc-blink 1s infinite ease-in-out; }
.sc-typing i:nth-child(2) { animation-delay: .15s; }
.sc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sc-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.sc-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 8px 12px 12px;
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--dc-border);
    border-radius: 12px;
    background: var(--dc-card);
}
.sc-form:focus-within { border-color: var(--dc-primary); }
.sc-form textarea {
    flex: 1;
    min-height: 24px;
    max-height: 120px;
    padding: 6px 0;
    border: 0;
    outline: 0;
    resize: none;
    background: transparent;
    font: 400 15px/1.45 var(--dc-sans);
    color: var(--dc-fg);
}
.sc-send {
    flex: none;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--dc-primary);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.sc-send:disabled { background: var(--dc-border); cursor: default; }
.sc-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 767px) {
    .sc-launcher { right: 16px; bottom: 16px; width: 52px; height: 52px; }
    .sc-teaser { right: 16px; bottom: 80px; max-width: calc(100vw - 32px); }
    .sc-panel {
        inset: 0;
        width: auto;
        height: auto;
        border: 0;
        border-radius: 0;
    }
    .sc.is-open .sc-launcher { display: none; }
}
