/* Selfcare Support Chat widget */
.scai-fab {
    position: fixed;
    right: 16px;
    bottom: 88px;
    z-index: 1085;
    width: 54px;
    height: 54px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, #e31e24, #b81419);
    color: #fff;
    box-shadow: 0 8px 24px rgba(227, 30, 36, 0.35);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.35rem;
}
.scai-fab:hover { filter: brightness(1.06); }
.scai-fab.is-open { background: #1e2a4a; box-shadow: 0 8px 24px rgba(30, 42, 74, 0.35); }

.scai-panel {
    position: fixed;
    right: 16px;
    bottom: 152px;
    z-index: 1086;
    width: min(380px, calc(100vw - 24px));
    height: min(560px, calc(100dvh - 180px));
    display: none;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: #0f1115;
    color: #f2f2f2;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.scai-panel.is-open { display: flex; }

.scai-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #1a1d24, #12141a);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.scai-head-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(227, 30, 36, 0.2);
    color: #ff6b6f;
    display: grid;
    place-items: center;
    font-size: 1rem;
}
.scai-head-text { flex: 1; min-width: 0; }
.scai-head-text strong { display: block; font-size: 0.92rem; }
.scai-head-text span { display: block; font-size: 0.7rem; color: #9aa0a6; }
.scai-close {
    border: none;
    background: transparent;
    color: #aaa;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

.scai-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background:
        radial-gradient(600px 200px at 10% 0%, rgba(227, 30, 36, 0.08), transparent 60%),
        #0f1115;
}
.scai-msg { display: flex; }
.scai-msg-user { justify-content: flex-end; }
.scai-msg-bot { justify-content: flex-start; }
.scai-bubble {
    max-width: 88%;
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}
.scai-msg-user .scai-bubble {
    background: rgba(227, 30, 36, 0.22);
    border: 1px solid rgba(227, 30, 36, 0.35);
    border-bottom-right-radius: 4px;
}
.scai-msg-bot .scai-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}
.scai-typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 3px;
    border-radius: 50%;
    background: #888;
    animation: scai-dot 1s infinite ease-in-out;
}
.scai-typing span:nth-child(2) { animation-delay: 0.15s; }
.scai-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes scai-dot {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.scai-composer {
    padding: 10px 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #12141a;
}
.scai-composer-inner {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
}
.scai-input {
    flex: 1;
    border: none;
    background: transparent;
    color: #f2f2f2;
    resize: none;
    min-height: 36px;
    max-height: 100px;
    padding: 8px;
    font-size: 0.82rem;
    font-family: inherit;
}
.scai-input:focus { outline: none; }
.scai-input::placeholder { color: #666; }
.scai-send {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: #e31e24;
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.scai-send:disabled { opacity: 0.4; cursor: not-allowed; }
.scai-hint {
    margin: 6px 2px 0;
    font-size: 0.68rem;
    color: #8b9198;
    min-height: 1em;
}
.scai-hint.is-error { color: #ff8a8a; }
.scai-resend {
    display: none;
    margin-top: 8px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #ddd;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
}
.scai-resend.is-visible { display: block; }
.scai-resend:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 575.98px) {
    .scai-fab { right: 12px; bottom: 76px; width: 50px; height: 50px; }
    .scai-panel {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 136px;
        height: min(70dvh, 520px);
    }
}
