.rs-chat-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 10040;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #064e3b 0%, #0f6b4f 100%);
    color: #fbf7ea;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px -6px rgba(6, 78, 59, 0.42);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.rs-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px -6px rgba(6, 78, 59, 0.5);
}
.rs-chat-fab-ico {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e51c23;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.rs-chat-unread {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e51c23;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}
.rs-chat-unread.has-unread {
    display: inline-flex;
}
.rs-chat-panel {
    position: fixed;
    right: 22px;
    bottom: 84px;
    width: min(390px, calc(100vw - 24px));
    height: min(560px, calc(100vh - 110px));
    background: #fbf7ea;
    border: 1.5px solid #dfd6be;
    border-radius: 20px;
    box-shadow: 0 24px 56px -12px rgba(6, 78, 59, 0.32);
    z-index: 10050;
    display: none;
    flex-direction: column;
    overflow: hidden;
    color: #142821;
}
.rs-chat-panel.is-open {
    display: flex;
}
.rs-chat-head {
    background: linear-gradient(135deg, #064e3b 0%, #0e5a44 100%);
    color: #fbf7ea;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.rs-chat-head-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.2;
}
.rs-chat-head-sub {
    margin: 2px 0 0;
    font-size: 0.74rem;
    color: #a3e635;
    font-weight: 600;
}
.rs-chat-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.rs-chat-head-btn {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.rs-chat-head-btn.close-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
}
.rs-chat-guest-bar {
    padding: 8px 12px;
    background: #f3ecda;
    border-bottom: 1px solid #e3dac1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.rs-chat-guest-bar input {
    width: 100%;
    padding: 6px 9px;
    border-radius: 9px;
    border: 1px solid #d4c9ab;
    background: #fffdf7;
    font-size: 0.78rem;
    color: #142821;
    outline: none;
}
.rs-chat-stock-drawer {
    display: none;
    padding: 10px 12px;
    background: #fffdf7;
    border-bottom: 1px solid #e3dac1;
    max-height: 220px;
    overflow-y: auto;
}
.rs-chat-stock-drawer.is-open {
    display: block;
}
.rs-chat-stock-search {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.rs-chat-stock-search input {
    flex: 1;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid #d4c9ab;
    font-size: 0.8rem;
}
.rs-chat-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fbf7ea;
}
.rs-msg-row {
    display: flex;
    flex-direction: column;
    max-width: 88%;
}
.rs-msg-row.customer {
    align-self: flex-end;
    align-items: flex-end;
}
.rs-msg-row.admin,
.rs-msg-row.assistant {
    align-self: flex-start;
    align-items: flex-start;
}
.rs-msg-meta {
    font-size: 0.69rem;
    font-weight: 700;
    color: #5d6f67;
    margin-bottom: 3px;
    padding: 0 4px;
}
.rs-msg-bubble {
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
}
.rs-msg-row.customer .rs-msg-bubble {
    background: #064e3b;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}
.rs-msg-row.admin .rs-msg-bubble {
    background: #ffffff;
    color: #142821;
    border: 1.5px solid #e51c23;
    border-bottom-left-radius: 4px;
}
.rs-msg-row.assistant .rs-msg-bubble {
    background: #ecf5f0;
    color: #113428;
    border: 1px solid #c5dfd1;
    border-bottom-left-radius: 4px;
}
.rs-msg-products {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 2px 6px;
    margin-top: 6px;
    width: 100%;
    max-width: 344px;
    scrollbar-width: thin;
}
.rs-chat-card-grid .product-card {
    flex: 0 0 162px;
    width: 162px;
    margin: 0 !important;
    background: #ffffff;
    border: 1px solid #e3dac1;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 16px -8px rgba(6, 78, 59, 0.16);
}
.rs-chat-card-grid .product-card .product-card-img-wrap {
    height: 108px;
    background: #fbf7ea;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.rs-chat-card-grid .product-card .card-img-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rs-chat-card-grid .product-card .product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.rs-chat-card-grid .product-card .card-discount-hang {
    top: 0;
    left: 8px;
    transform: scale(0.78);
    transform-origin: top left;
}
.rs-chat-card-grid .product-card .card-wishlist-pill {
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
}
.rs-chat-card-grid .product-card .product-card-body {
    padding: 8px 9px 9px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}
.rs-chat-card-grid .product-card .product-title {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.25;
}
.rs-chat-card-grid .product-card .product-title a {
    color: #064e3b;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rs-chat-card-grid .product-card .product-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    font-size: 0.67rem;
}
.rs-chat-card-grid .product-card .card-size-select {
    font-size: 0.66rem;
    padding: 2px 16px 2px 6px;
    max-width: 78px;
}
.rs-chat-card-grid .product-card .product-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
}
.rs-chat-card-grid .product-card .product-price-current {
    font-size: 0.82rem;
    font-weight: 800;
    color: #e51c23;
}
.rs-chat-card-grid .product-card .product-price-old {
    font-size: 0.66rem;
    color: #94a3b8;
    margin-left: 3px;
}
.rs-chat-card-grid .product-card .card-action-plus-btn {
    width: 28px;
    height: 28px;
    font-size: 0.74rem;
    flex-shrink: 0;
}
.rs-chat-stock-pill-mini {
    font-size: 0.63rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    background: #e6f4ea;
    color: #064e3b;
    align-self: flex-start;
}
.rs-chat-stock-pill-mini.out {
    background: #fee2e2;
    color: #991b1b;
}
.rs-chat-quick {
    padding: 7px 10px;
    background: #f5eedb;
    border-top: 1px solid #e3dac1;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.rs-chat-quick::-webkit-scrollbar {
    display: none;
}
.rs-quick-btn {
    border: 1px solid #cbbd99;
    background: #fffdf7;
    color: #064e3b;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;
}
.rs-quick-btn:hover {
    background: #064e3b;
    color: #fff;
    border-color: #064e3b;
}
.rs-chat-foot {
    padding: 9px 10px;
    background: #fffdf7;
    border-top: 1px solid #e3dac1;
    display: flex;
    align-items: flex-end;
    gap: 7px;
}
.rs-chat-foot textarea {
    flex: 1;
    resize: none;
    min-height: 38px;
    max-height: 92px;
    padding: 8px 11px;
    border-radius: 12px;
    border: 1.5px solid #d5cab0;
    background: #fbf7ea;
    color: #142821;
    font-family: inherit;
    font-size: 0.84rem;
    outline: none;
}
.rs-chat-foot textarea:focus {
    border-color: #064e3b;
    background: #fff;
}
.rs-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: none;
    background: #e51c23;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rs-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
@media (max-width: 768px) {
    .rs-chat-fab {
        right: 14px;
        bottom: 16px;
        padding: 10px 14px;
        font-size: 0.82rem;
    }
    .rs-chat-fab.has-sticky-bar {
        bottom: 78px;
    }
    .rs-chat-panel {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 74px;
        height: min(500px, calc(100vh - 100px));
    }
}