/* Support Chat — Borabet Central de Atendimento (index 10) */
:root {
    --sc-bg: #0f0f0f;
    --sc-panel: #151515;
    --sc-panel-2: #1a1a1a;
    --sc-line: #2a2a2a;
    --sc-orange: #ff6a00;
    --sc-orange-2: #ff791a;
    --sc-text: #ffffff;
    --sc-muted: #9a9a9a;
    --sc-green: #22c55e;
    --sc-radius: 18px;
}

#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(780px, calc(100dvh - 88px));
    min-height: min(560px, calc(100dvh - 88px));
    max-height: calc(100dvh - 72px);
    background: var(--sc-bg);
    border: 1px solid #242424;
    border-radius: var(--sc-radius);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    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: linear-gradient(180deg, #1a1a1a 0%, #121212 100%);
    border-bottom: 1px solid var(--sc-line);
    flex-shrink: 0;
}
.sc-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--sc-orange);
}

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

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

.sc-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--sc-orange);
    color: #111;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 22px;
    font-style: italic;
    flex-shrink: 0;
}

.sc-brand-name {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1.1;
}
.sc-brand-main { color: #fff; }
.sc-brand-accent { color: var(--sc-orange); }

.sc-brand-sub {
    margin: 3px 0 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--sc-muted);
}

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

.sc-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #d7dee8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.sc-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sc-green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.sc-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #cfcfcf;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.sc-icon-btn:hover { color: #fff; border-color: var(--sc-orange); }

.sc-protocol {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 10px 14px;
    background: #141414;
    border-bottom: 1px solid var(--sc-line);
    flex-shrink: 0;
}

.sc-protocol-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sc-protocol-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--sc-muted);
}

.sc-protocol-code {
    font-size: 13px;
    font-weight: 800;
    color: var(--sc-orange);
    letter-spacing: 0.02em;
    word-break: break-all;
}

.sc-copy-btn {
    border: 1px solid #3a3a3a;
    background: #1a1a1a;
    color: #eee;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}
.sc-copy-btn:hover {
    border-color: var(--sc-orange);
    color: var(--sc-orange);
}

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

.sc-hero {
    text-align: center;
    padding: 4px 6px 2px;
}

.sc-hero-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: var(--sc-orange);
    background: rgba(255, 106, 0, 0.06);
    border: 1px solid rgba(255, 106, 0, 0.4);
    box-shadow: 0 0 22px rgba(255, 106, 0, 0.14);
}
.sc-hero-icon svg { width: 30px; height: 30px; }

.sc-hero-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.02em;
}
.sc-hero-title span { color: var(--sc-orange); }

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

.sc-choose {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 0 2px;
    width: 100%;
}

.sc-choose-label {
    margin: 0;
    color: #cfcfcf;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    white-space: nowrap;
    flex-shrink: 0;
}

.sc-choose-line {
    display: block;
    height: 1px;
    flex: 1;
    background: #2a2a2a;
}

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

.sc-topic {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
    min-height: 96px;
    padding: 12px 12px 12px 16px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    color: var(--sc-text);
    cursor: pointer;
    font-family: inherit;
    overflow: hidden;
    transition: border-color .15s ease, transform .15s ease;
}
.sc-topic::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--sc-orange);
}
.sc-topic:hover {
    border-color: rgba(255, 106, 0, 0.65);
    transform: translateY(-1px);
}

.sc-topic-top { display: flex; }

.sc-topic-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 106, 0, 0.08);
    border: 1px solid rgba(255, 106, 0, 0.2);
    color: var(--sc-orange);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sc-topic-icon svg { width: 18px; height: 18px; display: block; }

.sc-topic-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

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

.sc-topic-arrow {
    color: #777;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.sc-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #2a2a2a;
    background: #1a1a1a;
    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-orange); }

.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-orange);
    color: #111;
    border-bottom-right-radius: 4px;
    font-weight: 700;
}
.sc-msg--agent {
    align-self: flex-start;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #2a2a2a;
    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: 12px 14px 14px;
    background: #121212;
    border-top: 1px solid var(--sc-line);
    flex-shrink: 0;
}

.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 #2a2a2a;
    background: #1a1a1a;
    padding: 4px;
}

.sc-attach {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #9a9a9a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.sc-attach:hover { color: var(--sc-orange); }

.sc-input {
    width: 100%;
    min-height: 40px;
    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: #6f6f6f; }

.sc-send {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: var(--sc-orange);
    color: #111;
    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 #2a313c;
    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-meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #7a7a7a;
    font-size: 11px;
    font-weight: 600;
}

.sc-secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sc-secure i { font-size: 10px; color: var(--sc-orange); }

.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-orange);
    color: #111;
    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(800px, 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-hero-title { font-size: 18px; }
    .sc-topic { min-height: 86px; padding: 11px 11px 11px 13px; }
    .sc-topic-label { font-size: 12px; }
}

@media (min-width: 481px) {
    .sc-panel {
        right: 20px;
        bottom: 24px;
        left: auto;
        width: 420px;
        height: min(780px, 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; }
}
