.support-chat-root {
    position: fixed;
    right: max(1.25rem, env(safe-area-inset-right, 0px));
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
    z-index: 1400;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.75rem;
    pointer-events: none;
}
.support-chat-fab,
.support-chat-panel { pointer-events: auto; }
.support-chat-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem 0.55rem 0.55rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, #f5894a 0%, #F47D31 48%, #d96a20 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 24px rgba(244,125,49,.45);
}
.support-chat-fab img,
.support-chat-header img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #111;
}
.support-chat-fab::after {
    content: '';
    position: absolute;
    top: 0.15rem;
    right: 0.15rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}
.support-chat-panel {
    width: min(380px, calc(100vw - 2rem));
    height: min(520px, calc(100dvh - 8rem));
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(17, 24, 39, .82);
    color: #fff;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 20px 50px rgba(0,0,0,.35);
    overflow: hidden;
}
html[data-theme="light"] .support-chat-panel {
    background: rgba(255,255,255,.9);
    color: #0f172a;
    border-color: rgba(15,23,42,.1);
}
.support-chat-panel[hidden] { display: none !important; }
.support-chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    background: linear-gradient(135deg, rgba(244,125,49,.18), rgba(139,92,246,.12));
}
html[data-theme="light"] .support-chat-header { border-bottom-color: rgba(15,23,42,.08); }
.support-chat-header div { flex: 1; min-width: 0; }
.support-chat-header strong { display: block; }
.support-chat-header span { display: block; font-size: 12px; opacity: .7; }
.support-chat-header button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: inherit;
    font-size: 20px;
    cursor: pointer;
}
.support-chat-messages {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.support-chat-bubble {
    max-width: 86%;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}
.support-chat-bubble-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #F47D31, #e06d25);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.support-chat-bubble-assistant {
    align-self: flex-start;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    border-bottom-left-radius: 4px;
}
html[data-theme="light"] .support-chat-bubble-assistant {
    background: #f8fafc;
    border-color: rgba(15,23,42,.08);
}
.support-chat-bubble.is-typing { opacity: .65; font-style: italic; }
.support-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,.1);
}
html[data-theme="light"] .support-chat-form { border-top-color: rgba(15,23,42,.08); }
.support-chat-form input {
    flex: 1;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: inherit;
    padding: 0.7rem 0.9rem;
}
html[data-theme="light"] .support-chat-form input {
    background: #fff;
    border-color: rgba(15,23,42,.12);
}
.support-chat-form button {
    border: none;
    border-radius: 999px;
    padding: 0 1rem;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #f5894a, #d96a20);
}
.support-chat-whatsapp {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0.75rem 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 14px;
    border: 1px solid rgba(37,211,102,.35);
    background: rgba(37,211,102,.1);
    color: inherit;
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease;
}
.support-chat-whatsapp:hover { background: rgba(37,211,102,.18); border-color: rgba(37,211,102,.6); }
.support-chat-whatsapp-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    box-shadow: 0 4px 12px rgba(37,211,102,.35);
}
.support-chat-whatsapp-icon svg { width: 20px; height: 20px; fill: #fff; }
.support-chat-whatsapp-text { flex: 1; min-width: 0; line-height: 1.3; }
.support-chat-whatsapp-text strong { display: block; font-size: 13px; }
.support-chat-whatsapp-text small { display: block; font-size: 11px; opacity: .7; }
.support-chat-whatsapp-go { font-size: 22px; line-height: 1; color: #25D366; }
body:has(.support-chat-root) .scroll-top-btn { right: auto; left: 28px; bottom: 20px; }
@media (max-width: 768px) {
    .support-chat-root { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
    .support-chat-fab { width: 52px; height: 52px; padding: 0; border-radius: 50%; justify-content: center; }
    .support-chat-fab span { display: none; }
    .support-chat-panel { height: min(520px, calc(100dvh - 190px - env(safe-area-inset-bottom, 0px))); }
}
