.sf-chat {
    position: fixed;
    right: 18px;
    bottom: 86px;
    z-index: 110;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sf-chat__fab {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 0;
    border-radius: 999px;
    padding: .85rem 1.1rem;
    background: #0D47A1;
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 18px 36px -18px rgba(13, 71, 161, .9);
    transition: background .18s, transform .18s;
}

.sf-chat__fab:hover {
    background: #1769E0;
    transform: translateY(-2px);
}

.sf-chat__fab i {
    font-size: 1.1rem;
}

.sf-chat__panel {
    position: fixed;
    right: 18px;
    bottom: 150px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: 70vh;
    overflow: hidden;
    background: #fff;
    border: 1px solid #DCE7F7;
    border-radius: 22px;
    box-shadow: 0 30px 70px -20px rgba(8, 18, 34, .45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.98);
    transition: opacity .2s, visibility .2s, transform .2s;
}

.sf-chat__panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.sf-chat__head {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    background: linear-gradient(135deg, #0D47A1, #1769E0);
    color: #fff;
}

.sf-chat__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    font-size: 1rem;
}

.sf-chat__head strong {
    display: block;
    font-size: .82rem;
    font-weight: 900;
}

.sf-chat__head span {
    display: block;
    font-size: .65rem;
    opacity: .8;
}

.sf-chat__close {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: .9rem;
    cursor: pointer;
}

.sf-chat__messages {
    flex: 1;
    min-height: 220px;
    max-height: 46vh;
    overflow-y: auto;
    padding: 1rem;
    background: #F3F7FD;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.sf-chat__msg {
    max-width: 86%;
    padding: .65rem .8rem;
    border-radius: 16px;
    font-size: .8rem;
    line-height: 1.45;
    white-space: pre-line;
    word-break: break-word;
}

.sf-chat__msg p {
    margin: 0;
}

.sf-chat__msg p + p,
.sf-chat__msg p + .sf-chat__list,
.sf-chat__msg .sf-chat__list + p,
.sf-chat__msg .sf-chat__list + .sf-chat__list {
    margin-top: .4rem;
}

.sf-chat__msg strong {
    font-weight: 800;
    color: #0F172A;
}

.sf-chat__list {
    margin: .15rem 0 0;
    padding-left: 1.15rem;
}

.sf-chat__list li {
    margin: .12rem 0;
    padding-left: .1rem;
}

.sf-chat__list li::marker {
    color: #1769E0;
}

.sf-chat__msg--bot {
    align-self: flex-start;
    background: #fff;
    color: #1E293B;
    border: 1px solid #E2E8F0;
    border-bottom-left-radius: 6px;
}

.sf-chat__msg--user {
    align-self: flex-end;
    background: #1769E0;
    color: #fff;
    border-bottom-right-radius: 6px;
}

.sf-chat__msg a {
    display: inline-block;
    margin-top: .45rem;
    font-weight: 800;
    color: #0D47A1;
    text-decoration: underline;
}

.sf-chat__msg p a {
    display: inline;
    margin-top: 0;
    word-break: break-all;
}

.sf-chat__msg--user a {
    color: #fff;
}

.sf-chat__products {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .6rem;
}

.sf-chat__msg .sf-chat__product {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-top: 0;
    padding: .5rem;
    border: 1px solid #DCE7F5;
    border-radius: 12px;
    background: #F8FBFF;
    color: inherit;
    text-decoration: none;
    white-space: normal;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.sf-chat__msg .sf-chat__product:hover {
    border-color: #1769E0;
    box-shadow: 0 4px 14px rgba(23, 105, 224, .12);
}

.sf-chat__product-img {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 9px;
    border: 1px solid #E2E8F0;
    background: #fff;
}

.sf-chat__product-body {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.sf-chat__product-name {
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.25;
    color: #0F172A;
}

.sf-chat__product-meta {
    font-size: .63rem;
    color: #64748B;
}

.sf-chat__product-price {
    font-size: .78rem;
    font-weight: 800;
    color: #1769E0;
}

.sf-chat__product-status {
    font-size: .62rem;
    font-weight: 700;
    color: #0E9F6E;
}

.sf-chat__product-cta {
    margin-top: .1rem;
    font-size: .63rem;
    font-weight: 800;
    color: #0D47A1;
    text-decoration: underline;
}

.sf-chat__typing {
    align-self: flex-start;
    display: inline-flex;
    gap: .25rem;
    padding: .7rem .85rem;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
}

.sf-chat__typing span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #94A3B8;
    animation: sf-chat-blink 1.1s infinite ease-in-out;
}

.sf-chat__typing span:nth-child(2) { animation-delay: .15s; }
.sf-chat__typing span:nth-child(3) { animation-delay: .3s; }

@keyframes sf-chat-blink {
    0%, 80%, 100% { opacity: .35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.sf-chat__options {
    padding: .55rem 1rem 0;
    background: #F3F7FD;
}

.sf-chat__options:empty {
    display: none;
}

.sf-chat__options label {
    display: block;
    margin-bottom: .35rem;
    color: #475569;
    font-size: .65rem;
    font-weight: 800;
}

.sf-chat__option-row {
    display: flex;
    gap: .4rem;
}

.sf-chat__option-row select {
    min-width: 0;
    flex: 1;
    border: 1px solid #C9DBF5;
    border-radius: 10px;
    padding: .5rem .6rem;
    background: #fff;
    color: #0F172A;
    font-size: .75rem;
}

.sf-chat__option-row button {
    border: 0;
    border-radius: 10px;
    padding: .5rem .7rem;
    background: #1769E0;
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    cursor: pointer;
}

.sf-chat__option-row button:hover {
    background: #0D47A1;
}

.sf-chat__quick {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .5rem 1rem 0;
    background: #F3F7FD;
}

.sf-chat__quick button {
    border: 1px solid #C9DBF5;
    border-radius: 999px;
    padding: .35rem .6rem;
    background: #fff;
    color: #0D47A1;
    font-size: .68rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.sf-chat__quick button:hover {
    background: #EAF2FF;
    border-color: #1769E0;
}

.sf-chat__form {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .7rem;
    background: #fff;
    border-top: 1px solid #E2E8F0;
}

.sf-chat__form input[type="text"] {
    min-width: 0;
    flex: 1;
    border: 1px solid #DCE7F7;
    border-radius: 12px;
    padding: .6rem .7rem;
    font-size: .78rem;
    outline: none;
}

.sf-chat__form input[type="text"]:focus {
    border-color: #1769E0;
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .12);
}

.sf-chat__attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #DCE7F7;
    border-radius: 12px;
    color: #64748B;
    cursor: pointer;
}

.sf-chat__attach:hover {
    background: #F3F7FD;
    color: #0D47A1;
}

.sf-chat__send {
    border: 0;
    border-radius: 12px;
    padding: .6rem .8rem;
    background: #1769E0;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
}

.sf-chat__send:disabled {
    opacity: .55;
    cursor: wait;
}

.sf-chat__note {
    margin: 0;
    padding: 0 .9rem .7rem;
    background: #fff;
    font-size: .6rem;
    color: #94A3B8;
    text-align: center;
}

@media (max-width: 760px) {
    .sf-chat {
        right: 14px;
        bottom: 140px;
    }

    .sf-chat__fab span {
        display: none;
    }

    .sf-chat__panel {
        top: 8px;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        max-height: none;
        border-radius: 18px;
        z-index: 300;
    }

    .sf-chat__messages {
        max-height: none;
        flex: 1;
    }

    body.sf-chat-open {
        overflow: hidden;
    }
}
