#sfChatRoot {
    --sf-chat-primary: #d10024;
    --sf-chat-primary-dark: #b8001e;
    --sf-chat-bg: #ffffff;
    --sf-chat-panel-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 10040;
    font-family: 'Plus Jakarta Sans', 'Montserrat', sans-serif;
}

.sf-chat-fab {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--sf-chat-primary) 0%, var(--sf-chat-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 12px 28px rgba(209, 0, 36, 0.42);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sf-chat-fab:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 16px 34px rgba(209, 0, 36, 0.5);
}

.sf-chat-panel {
    position: absolute;
    left: 0;
    bottom: 76px;
    width: min(390px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 120px));
    background: var(--sf-chat-bg);
    border-radius: 20px;
    box-shadow: var(--sf-chat-panel-shadow);
    border: 1px solid #e8edf5;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.sf-chat-panel.is-open {
    display: flex;
}

.sf-chat-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sf-chat-header__info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sf-chat-header__avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(209, 0, 36, 0.2);
    color: #fecdd3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.sf-chat-header__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.sf-chat-header__sub {
    margin: 2px 0 0;
    font-size: 12px;
    color: #cbd5e1;
}

.sf-chat-header__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #86efac;
    margin-top: 4px;
}

.sf-chat-header__status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}

.sf-chat-header__actions {
    display: flex;
    gap: 6px;
}

.sf-chat-header__btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
}

.sf-chat-header__btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.sf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.sf-chat-msg {
    display: flex;
    margin-bottom: 14px;
    gap: 8px;
}

.sf-chat-msg--bot .sf-chat-bubble {
    background: #fff;
    color: #0f172a;
    border: 1px solid #e8edf5;
    border-radius: 16px 16px 16px 4px;
}

.sf-chat-msg--user {
    justify-content: flex-end;
}

.sf-chat-msg--user .sf-chat-bubble {
    background: linear-gradient(135deg, var(--sf-chat-primary) 0%, var(--sf-chat-primary-dark) 100%);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}

.sf-chat-bubble {
    max-width: 88%;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.sf-chat-bubble strong {
    font-weight: 700;
}

.sf-chat-products {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.sf-chat-product {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e8edf5;
    text-decoration: none;
    color: inherit;
}

.sf-chat-product:hover {
    border-color: #fecaca;
    background: #fff5f5;
}

.sf-chat-product__img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    background: #e2e8f0;
    flex-shrink: 0;
}

.sf-chat-product__body strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 4px;
}

.sf-chat-product__body span {
    font-size: 12px;
    color: var(--sf-chat-primary);
    font-weight: 700;
}

.sf-chat-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.sf-chat-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #d10024;
    color: #d10024;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.sf-chat-link:hover {
    background: #fff5f5;
    color: #b8001e;
}

.sf-chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px 0;
    background: #f8fafc;
}

.sf-chat-quick__btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.sf-chat-quick__btn:hover {
    border-color: #d10024;
    color: #d10024;
}

.sf-chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid #e8edf5;
    background: #fff;
}

.sf-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 100px;
}

.sf-chat-input:focus {
    outline: none;
    border-color: #d10024;
    box-shadow: 0 0 0 3px rgba(209, 0, 36, 0.1);
}

.sf-chat-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--sf-chat-primary);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.sf-chat-send:hover {
    background: var(--sf-chat-primary-dark);
}

.sf-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sf-chat-typing {
    display: none;
    padding: 0 14px 8px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
}

.sf-chat-typing.is-visible {
    display: block;
}

@media (max-width: 575px) {
    #sfChatRoot {
        left: 12px;
        bottom: 12px;
    }

    .sf-chat-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 100px);
    }
}
