.mb-site-chat {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.mb-sc-launcher {
    position: fixed; right: 20px; bottom: 20px; z-index: 99980;
    width: 56px; height: 56px; border-radius: 50%;
    background: #fbbf24; color: #111; border: none; cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, background 0.15s;
}
.mb-sc-launcher:hover { background: #f59e0b; transform: scale(1.04); }
.mb-sc-launcher.is-open { background: #fbbf24; color: #111; }
.mb-sc-badge {
    position: absolute; top: -2px; right: -2px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: #dc2626; color: #fff; font-size: 10px; font-weight: 700;
    display: none; align-items: center; justify-content: center;
    border: 2px solid #fff;
}
.mb-sc-panel {
    position: fixed; right: 20px; left: auto; bottom: 88px; z-index: 99980;
    width: min(380px, calc(100vw - 32px));
    height: min(540px, calc(100vh - 120px));
    background: #fff; border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.22);
    display: none; flex-direction: column; overflow: hidden;
    border: 1px solid #e5e7eb;
}
.mb-sc-panel.open { display: flex; }
.mb-sc-head {
    flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 14px 16px; background: #111; color: #fff;
}
.mb-sc-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.mb-sc-head p { margin: 2px 0 0; font-size: 12px; color: rgba(255,255,255,0.65); }
.mb-sc-close {
    width: 32px; height: 32px; border: none; border-radius: 8px;
    background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; font-size: 20px; line-height: 1;
}
.mb-sc-close:hover { background: rgba(255,255,255,0.18); }
.mb-sc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #f6f7f9; }
.mb-sc-form { padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.mb-sc-form label { font-size: 12px; font-weight: 600; color: #374151; }
.mb-sc-form input,
.mb-sc-form textarea {
    width: 100%; box-sizing: border-box; padding: 10px 12px;
    border: 1px solid #e5e7eb; border-radius: 10px; font-size: 14px; font-family: inherit;
}
.mb-sc-form input:focus,
.mb-sc-form textarea:focus { outline: none; border-color: #111; }
.mb-sc-form textarea { min-height: 88px; resize: vertical; }
.mb-sc-leave-label {
    margin: 8px 0 0; padding-top: 12px; border-top: 1px solid #e5e7eb;
    font-size: 13px; font-weight: 700; color: #111;
}
.mb-sc-err { font-size: 12px; color: #b91c1c; min-height: 16px; }
.mb-sc-start {
    display: block; margin-top: 4px; padding: 11px 14px; border: none; border-radius: 10px;
    background: #111; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
    text-align: center; text-decoration: none; box-sizing: border-box;
}
.mb-sc-start:disabled { opacity: 0.55; cursor: default; }
.mb-sc-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.mb-sc-who { font-size: 11px; font-weight: 700; color: #6b7280; margin: 0 2px 3px; max-width: 85%; }
.mb-sc-who.me { align-self: flex-end; }
.mb-sc-who.them { align-self: flex-start; }
.mb-sc-bubble {    max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; word-break: break-word;
    flex-shrink: 0;
}
.mb-sc-bubble.them { align-self: flex-start; background: #111; color: #fff; border-bottom-left-radius: 4px; }
.mb-sc-bubble.me { align-self: flex-end; background: #fbbf24; color: #111; border-bottom-right-radius: 4px; }
.mb-sc-time { display: block; font-size: 10px; opacity: 0.5; margin-top: 4px; }
.mb-sc-bubble.mb-sc-product {
    max-width: 100%;
    width: 100%;
    padding: 0;
    overflow: hidden;
    background: #fff;
    color: #111;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    min-height: 220px;
}
.mb-sc-pc { display: flex; flex-direction: column; }
.mb-sc-pc img {
    display: block; width: 100%; height: 140px; object-fit: contain;
    background: #f8fafc; padding: 10px; box-sizing: border-box;
}
.mb-sc-pc-body { padding: 10px 12px 12px; }
.mb-sc-pc-name { margin: 0 0 4px; font-size: 13px; font-weight: 700; line-height: 1.35; }
.mb-sc-pc-price { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: #16a34a; }
.mb-sc-pc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mb-sc-pc-add, .mb-sc-pc-view {
    flex: 1; min-width: 0; text-align: center; text-decoration: none;
    font-size: 12px; font-weight: 700; padding: 8px 10px; border-radius: 8px;
    border: none; cursor: pointer; box-sizing: border-box;
}
.mb-sc-pc-add { background: #111; color: #fff; }
.mb-sc-pc-add.added { background: #16a34a; }
.mb-sc-pc-add:disabled { opacity: 0.9; cursor: default; }
.mb-sc-pc-view { background: #f3f4f6; color: #111; border: 1px solid #e5e7eb; }
.mb-sc-bubble.mb-sc-product .mb-sc-time { padding: 0 12px 8px; margin: 0; }
.mb-sc-img {
    display: block; max-width: 220px; max-height: 180px; width: auto; height: auto;
    border-radius: 10px; margin: 0 0 6px; cursor: pointer;
}
.mb-sc-bubble.me .mb-sc-img { border: 1px solid rgba(255,255,255,0.12); }
.mb-sc-file {
    display: flex; align-items: center; gap: 8px; margin: 0 0 6px;
    padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
    text-decoration: none;
}
.mb-sc-bubble.me .mb-sc-file { background: rgba(0,0,0,0.08); color: #111; }
.mb-sc-bubble.them .mb-sc-file { background: rgba(255,255,255,0.12); color: #fff; }
.mb-sc-expired { font-size: 12px; font-style: italic; opacity: 0.55; margin: 0 0 4px; }
.mb-sc-composer {
    flex-shrink: 0; display: flex; flex-direction: column;
    background: #fff; border-top: 1px solid #e5e7eb;
}
.mb-sc-preview {
    display: none; align-items: center; gap: 8px;
    padding: 8px 12px; background: #f9fafb; border-bottom: 1px solid #f3f4f6;
    font-size: 12px; color: #374151;
}
.mb-sc-preview.show { display: flex; }
.mb-sc-preview img {
    width: 36px; height: 36px; object-fit: cover; border-radius: 6px; background: #e5e7eb;
}
.mb-sc-preview span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-sc-preview button {
    width: 28px; height: 28px; border: none; background: transparent;
    color: #6b7280; font-size: 18px; cursor: pointer; line-height: 1;
}
.mb-sc-compose {
    display: flex; gap: 6px; padding: 10px 10px 12px; align-items: center;
}
.mb-sc-compose input[type="text"] {
    flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #e5e7eb;
    border-radius: 12px; font-size: 14px; background: #f9fafb;
}
.mb-sc-compose input[type="text"]:focus { outline: none; border-color: #111; background: #fff; }
.mb-sc-icon {
    width: 40px; height: 40px; flex-shrink: 0; border: 1px solid #e5e7eb; border-radius: 10px;
    background: #fff; color: #374151; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.mb-sc-icon:hover { border-color: #111; color: #111; }
.mb-sc-send {
    width: 40px; height: 40px; flex-shrink: 0; border: none; border-radius: 10px;
    background: #111; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mb-sc-send:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 1024px) {
    body.has-mobile-bottom-nav .mb-sc-launcher { display: none; }
    body.has-mobile-bottom-nav .mb-sc-panel {
        left: 12px;
        right: 12px;
        width: auto;
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
        height: min(70vh, calc(100dvh - 120px - env(safe-area-inset-bottom, 0px)));
    }
    body.has-mobile-bottom-nav .mobile-bottom-nav-icon--chat .mobile-bottom-nav-badge {
        position: absolute;
        top: -2px;
        right: -8px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 999px;
        background: #facc15;
        color: #111;
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
        text-align: center;
        box-sizing: border-box;
        border: 2px solid #fff;
        align-items: center;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    .mb-sc-panel { right: 8px; left: 8px; width: auto; bottom: 80px; height: min(70vh, 560px); }
    .mb-sc-launcher { right: 12px; left: auto; bottom: 12px; }
    body.has-mobile-bottom-nav .mb-sc-panel {
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }
}
