.schat-shell {
    font-family: 'Segoe UI', 'IBM Plex Sans', system-ui, sans-serif;
}

.schat-launcher {
    position: fixed;
    /* Sit left of Support Board (.sb-chat-btn is 60px at right: 20px, plus 12px gap). */
    right: 92px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: #028be5;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    z-index: 1000001;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 3px 32px rgba(0, 0, 0, 0.16);
}

.schat-launcher[aria-expanded='true'] {
    display: none;
}

.schat-panel[hidden],
.schat-messages[hidden],
.schat-composer[hidden],
.schat-status[hidden],
.schat-empty[hidden],
.schat-banner[hidden] {
    display: none !important;
}

.schat-panel {
    position: fixed;
    right: 92px;
    bottom: 92px;
    width: min(380px, calc(100vw - 24px));
    height: min(560px, calc(100vh - 112px));
    display: flex;
    flex-direction: column;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1000002;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Both panels open: Live Support sits left of Support Board (360px + 16px gap + 30px SB offset). */
body:has(.sb-main.sb-chat.sb-active):has(#schat-root .schat-panel:not([hidden])) .schat-panel {
    right: 406px;
    bottom: 100px;
    height: min(560px, calc(100vh - 120px));
}

@media (max-width: 860px) {
    body:has(.sb-main.sb-chat.sb-active):has(#schat-root .schat-panel:not([hidden])) .schat-panel {
        right: auto;
        left: 12px;
        width: min(380px, calc(50vw - 18px));
        bottom: 92px;
    }
}

.schat-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    background: #162032;
    border-bottom: 1px solid #334155;
}

.schat-header strong {
    flex: 1;
}

.schat-pill {
    font-size: 0.75rem;
    color: #14b8a6;
    background: rgba(20, 184, 166, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schat-close {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.schat-status,
.schat-empty,
.schat-banner {
    padding: 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.schat-banner {
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
    border-bottom: 1px solid #7f1d1d;
}

.schat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
}

.schat-bubble {
    max-width: 88%;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.schat-meta {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

.schat-customer {
    align-self: flex-end;
    background: #1e3a5f;
}

.schat-ai {
    align-self: flex-start;
    background: #1e293b;
    border: 1px solid #334155;
}

.schat-human {
    align-self: flex-start;
    background: #134e4a;
}

.schat-system {
    align-self: center;
    background: #312e81;
    font-size: 0.8rem;
}

.schat-composer {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem;
    border-top: 1px solid #334155;
    background: #162032;
}

.schat-composer:not([hidden]) {
    display: flex;
}

.schat-composer input {
    flex: 1;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 0.55rem 0.7rem;
}

.schat-composer button {
    border: 0;
    background: #14b8a6;
    color: #042f2e;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}

.schat-composer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
