/* Support Chat — Pixganha Central de Atendimento (index 11) */
:root {
    --sc-bg: #0b1620;
    --sc-panel: #0f1c28;
    --sc-panel-2: #132433;
    --sc-line: #1b3340;
    --sc-green: #00d68a;
    --sc-green-2: #00e4a3;
    --sc-green-soft: #26c4a0;
    --sc-green-dim: rgba(0, 214, 138, 0.12);
    --sc-green-border: rgba(0, 228, 163, 0.34);
    --sc-text: #eef5f8;
    --sc-muted: #8fa3b0;
    --sc-radius: 20px;
}

#support-chat-root {
    position: fixed;
    inset: 0;
    z-index: 100050;
    pointer-events: none;
    font-family: Montserrat, Inter, Arial, Helvetica, sans-serif;
    color: var(--sc-text);
}

#support-chat-root.is-open { pointer-events: auto; }
.sc-fab { display: none !important; }

#support-chat-root.is-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100055;
    pointer-events: none;
}

.sc-panel {
    pointer-events: auto;
    position: fixed;
    right: 16px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    width: min(420px, calc(100vw - 16px));
    height: min(820px, calc(100dvh - 88px));
    min-height: min(560px, calc(100dvh - 88px));
    max-height: calc(100dvh - 72px);
    background: linear-gradient(180deg, #0f1c28 0%, #0b1620 42%, #09131c 100%);
    border: 1px solid rgba(0, 214, 138, 0.22);
    border-radius: var(--sc-radius);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 214, 138, 0.08),
        0 0 36px rgba(0, 214, 138, 0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100060;
}

.sc-panel--min {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

.sc-header {
    position: relative;
    padding: 14px 14px 12px;
    background:
        radial-gradient(ellipse 70% 90% at 0% 0%, rgba(0, 214, 138, 0.14) 0%, transparent 55%),
        linear-gradient(180deg, #122433 0%, #0e1b27 100%);
    border-bottom: 1px solid var(--sc-line);
    flex-shrink: 0;
}

.sc-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.sc-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sc-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(160deg, var(--sc-green-2) 0%, var(--sc-green) 100%);
    color: #07131c;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 22px;
    font-style: italic;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(0, 214, 138, 0.28);
}

.sc-brand-name {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1.1;
}
.sc-brand-main { color: #fff; }
.sc-brand-accent { color: var(--sc-green-2); }

.sc-brand-sub {
    margin: 3px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #b7c5ce;
}

.sc-online-pill {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(7, 24, 32, 0.85);
    border: 1px solid var(--sc-green-border);
    color: var(--sc-green-2);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    width: fit-content;
}

.sc-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sc-green-2);
    box-shadow: 0 0 0 3px rgba(0, 228, 163, 0.2);
    animation: sc-pulse 1.8s ease-in-out infinite;
}

@keyframes sc-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(0, 228, 163, 0.16); }
    50% { box-shadow: 0 0 0 5px rgba(0, 228, 163, 0.06); }
}

.sc-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sc-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    border: 1px solid #2a3d4a;
    background: #12202b;
    color: #c5d0d6;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.sc-icon-btn:hover {
    color: #fff;
    border-color: var(--sc-green);
}

.sc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 9px 12px;
    background: #0a1520;
    border-bottom: 1px solid var(--sc-line);
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 700;
    flex-wrap: nowrap;
}

.sc-meta-protocol {
    color: #a9b6bc;
    letter-spacing: 0.01em;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-meta-subject {
    color: #a9b6bc;
    text-align: right;
    white-space: nowrap;
    flex: 0 0 auto;
}
.sc-meta-subject strong {
    color: var(--sc-green-2);
    font-weight: 800;
}

.sc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--sc-bg);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.sc-body::-webkit-scrollbar { width: 4px; }
.sc-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.14);
    border-radius: 999px;
}

.sc-welcome { text-align: center; padding: 2px 4px 0; }

.sc-welcome-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.25;
}
.sc-welcome-title span { color: var(--sc-green-2); }

.sc-welcome-text {
    margin: 0 auto;
    max-width: 34ch;
    color: var(--sc-muted);
    font-size: 13px;
    line-height: 1.45;
}

.sc-choose-label {
    margin: 16px 0 0;
    text-align: left;
    color: #cfd8dc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.sc-topics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sc-topic {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    min-height: 54px;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid #24384a;
    background: linear-gradient(180deg, #152839 0%, #102130 100%);
    color: var(--sc-text);
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.sc-topic:hover {
    border-color: rgba(0, 214, 138, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 214, 138, 0.12);
    transform: translateY(-1px);
}

.sc-topic-icon {
    width: 28px;
    height: 28px;
    color: var(--sc-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sc-topic-icon svg { width: 20px; height: 20px; display: block; }

.sc-topic-label {
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.25;
}

.sc-agent-preview { margin-top: 2px; }

.sc-agent-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.sc-agent-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sc-green-2);
    color: #07131c;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 15px;
    flex-shrink: 0;
}

.sc-agent-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.sc-agent-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--sc-muted);
    padding-left: 2px;
}

.sc-agent-bubble {
    position: relative;
    background: #152839;
    border: 1px solid rgba(0, 214, 138, 0.26);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    padding: 11px 12px 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #eef5f8;
}
.sc-agent-bubble small {
    display: block;
    margin-top: 6px;
    text-align: right;
    opacity: 0.55;
    font-size: 10px;
}

.sc-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #24384a;
    background: #152839;
    color: var(--sc-muted);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.sc-back:hover { color: #fff; border-color: var(--sc-green); }

.sc-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sc-msg {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}
.sc-msg small {
    display: block;
    margin-top: 4px;
    opacity: 0.55;
    font-size: 10px;
}
.sc-msg--user {
    align-self: flex-end;
    background: var(--sc-green);
    color: #07131c;
    border-bottom-right-radius: 4px;
    font-weight: 700;
}
.sc-msg--agent {
    align-self: flex-start;
    background: #152839;
    color: #fff;
    border: 1px solid rgba(0, 214, 138, 0.26);
    border-bottom-left-radius: 4px;
}
.sc-msg--system {
    align-self: center;
    background: transparent;
    color: var(--sc-muted);
    font-size: 11px;
    text-align: center;
    max-width: 95%;
    padding: 4px 8px;
}

.sc-footer {
    padding: 10px 14px 12px;
    background: #0c1822;
    border-top: 1px solid var(--sc-line);
    flex-shrink: 0;
}

.sc-footer-hint {
    margin: 0 0 8px;
    color: var(--sc-muted);
    font-size: 11px;
    font-weight: 600;
}

.sc-composer { display: block; }

.sc-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.sc-input-shell {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 4px;
    min-height: 50px;
    border-radius: 16px;
    border: 1px solid #24384a;
    background: #122433;
    padding: 4px;
}

.sc-attach {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 11px;
    background: #17303a;
    color: #7eb8ad;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.sc-attach:hover { color: var(--sc-green-2); filter: brightness(1.08); }

.sc-input {
    width: 100%;
    min-height: 38px;
    max-height: 100px;
    resize: none;
    border: none;
    background: transparent;
    color: var(--sc-text);
    padding: 10px 4px;
    font-size: 13px;
    line-height: 1.35;
    outline: none;
    font-family: inherit;
}
.sc-input::placeholder { color: #6f7d84; }

.sc-send {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: var(--sc-green-2);
    color: #07131c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.sc-send:disabled { opacity: 0.5; cursor: not-allowed; }
.sc-send:hover:not(:disabled) { filter: brightness(1.06); }

.sc-preview {
    position: relative;
    display: inline-flex;
    margin: 0 0 8px;
    max-width: 140px;
}
.sc-preview img {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #24343c;
    display: block;
}
.sc-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 11px;
}
.sc-msg-image-link { display: block; margin: 0 0 6px; }
.sc-msg-image {
    display: block;
    max-width: min(220px, 70vw);
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}

.sc-footer-secure {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--sc-green-soft);
    font-size: 11px;
    font-weight: 700;
}
.sc-footer-secure i { font-size: 10px; color: var(--sc-green-soft); }
.sc-footer-dot { opacity: 0.7; }
.sc-footer-brand { color: #d7e4ea; font-weight: 800; }

.footer-support-live-btn {
    margin-top: 18px;
    width: min(420px, calc(100% - 32px));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    border: none;
    border-radius: 12px;
    background: var(--sc-green);
    color: #07131c;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
}

@media (max-width: 480px) {
    .sc-panel {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        height: min(820px, calc(100dvh - 84px));
        min-height: min(540px, calc(100dvh - 84px));
        max-height: calc(100dvh - 76px);
        border-radius: 16px;
    }
    .sc-panel--min {
        left: 8px;
        right: 8px;
        width: auto;
        height: auto !important;
        min-height: 0 !important;
    }
    .sc-welcome-title { font-size: 18px; }
    .sc-topic { min-height: 50px; padding: 11px; }
    .sc-topic-label { font-size: 12px; }
    .sc-meta {
        gap: 8px;
        font-size: 10px;
    }
}

@media (min-width: 481px) {
    .sc-panel {
        right: 20px;
        bottom: 24px;
        left: auto;
        width: 420px;
        height: min(820px, calc(100dvh - 48px));
        min-height: min(600px, calc(100dvh - 48px));
        max-height: calc(100dvh - 48px);
    }
}

@media (max-width: 360px) {
    .sc-topics { grid-template-columns: 1fr; }
}
