/* Support Chat Widget — BR1 simples */
#support-chat-root {
    position: fixed;
    right: 16px;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    z-index: 100050;
    font-family: Inter, Montserrat, -apple-system, Segoe UI, Roboto, sans-serif;
}

.sc-fab {
    display: none !important;
}

.sc-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    background: #090a0f;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100060;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: 0;
}

.sc-panel[hidden] { display: none !important; }

body.sc-chat-open {
    overflow: hidden !important;
    touch-action: none;
}

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

.sc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #11131a;
    border-bottom: 1px solid #303442;
    flex-shrink: 0;
}

.sc-online {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff6600;
    box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.18);
    flex-shrink: 0;
}

.sc-header-text { flex: 1; min-width: 0; }
.sc-header-title {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}
.sc-header-sub {
    margin: 2px 0 0;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
}

.sc-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sc-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sc-empty {
    margin: auto 0;
    text-align: center;
    padding: 12px 8px 24px;
}
.sc-empty p {
    margin: 0 0 16px;
    color: #d1d5db;
    font-size: 15px;
    font-weight: 600;
}

.sc-subjects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.sc-subject {
    border: 1px solid #303442;
    border-radius: 999px;
    background: #151720;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
}
.sc-subject:hover {
    border-color: #ff6600;
    color: #ff6600;
}

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

.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: #ff6600;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.sc-msg--agent {
    align-self: flex-start;
    background: #151720;
    color: #fff;
    border: 1px solid #303442;
    border-bottom-left-radius: 4px;
}
.sc-msg--system {
    align-self: center;
    background: transparent;
    color: #9ca3af;
    font-size: 11px;
    text-align: center;
    max-width: 95%;
    padding: 4px 8px;
}

.sc-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 11px 20px;
    border-radius: 10px;
    background: #ff6600;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.sc-footer {
    border-top: 1px solid #303442;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #11131a;
    flex-shrink: 0;
}
.sc-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.sc-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}
.sc-attach {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #303442;
    background: #151720;
    color: #9ca3af;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.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 #303442;
    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-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #303442;
    background: #151720;
    color: #fff;
    padding: 0 12px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}
.sc-input:focus {
    border-color: #ff6600;
}
.sc-send {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: #ff6600;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sc-send:disabled { opacity: 0.5; cursor: not-allowed; }

.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: #ff6600;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
}
.footer-support-live-btn i { font-size: 18px; }

@media (max-width: 480px) {
    #support-chat-root {
        right: 12px;
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }
}
