/* Bilal Motors messaging, scoped to .bm-chat-* to avoid altering the marketplace UI */
.bm-chat-page{padding-top:30px;padding-bottom:24px;--chat-accent:#c91f2c;--chat-border:#e4e7ec;--chat-muted:#667085;color:#17212f}
.bm-chat-page h1,.bm-chat-admin h1{font-size:1.5rem;font-weight:700;margin:0}
.bm-chat-shell{display:grid;grid-template-columns:minmax(260px,340px) minmax(0,1fr);min-height:580px;height:min(74vh,760px);background:white;border:1px solid var(--chat-border,#e4e7ec);border-radius:16px;overflow:hidden;box-shadow:0 10px 35px rgba(16,24,40,.07)}
.bm-chat-sidebar{border-right:1px solid #e4e7ec;display:flex;flex-direction:column;min-height:0;background:#fff}
.bm-chat-sidebar-head{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid #edf0f3}
.bm-chat-sidebar-head h1,.bm-chat-sidebar-head h2{font-size:1.2rem;margin:0}
.bm-chat-btn{background:var(--chat-accent,#c91f2c);border:0;border-radius:9px;padding:10px 14px;color:#fff!important;cursor:pointer;font-size:.89rem;font-weight:650;white-space:nowrap}
.bm-chat-btn:disabled{opacity:.5;cursor:not-allowed}
.bm-chat-search-label,.bm-chat-list-heading{font-weight:650;font-size:.8rem;color:#56657a;margin:14px 14px 6px}
.bm-chat-input,.bm-chat-settings input:not([type=checkbox]),.bm-chat-settings textarea,.bm-chat-settings select{width:100%;padding:10px;border:1px solid #d0d5dd;border-radius:8px;background:white;color:#17212f}
.bm-chat-sidebar>.bm-chat-input{width:calc(100% - 28px);margin:0 14px}
.bm-chat-results{padding:0 12px;max-height:180px;overflow-y:auto}
.bm-chat-user{border:0;background:#f7f8fa;padding:8px 12px;text-align:left;width:100%;margin-top:4px;border-radius:6px;cursor:pointer}
.bm-chat-list{overflow:auto;flex:1;min-height:0}
.bm-chat-list-item{display:flex;flex-direction:column;text-align:left;width:100%;padding:13px 16px;background:white;border:0;border-bottom:1px solid #f0f2f5;gap:4px;cursor:pointer;color:#152235}
.bm-chat-list-item:hover,.bm-chat-list-item.is-active{background:#fff4f5}
.bm-chat-list-item strong{font-weight:650;font-size:.95rem}
.bm-chat-list-item small{color:#526075;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.bm-chat-list-sub{font-size:.72rem;color:#838d9d}
.bm-chat-main{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}
.bm-chat-main-head{height:auto;min-height:65px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #edf0f3;padding:11px 16px;gap:8px;background:#fff}
.bm-chat-title{font-weight:700}
.bm-chat-back{display:none;border:0;background:transparent;font-size:2rem;padding:0 8px}
.bm-chat-actions{margin-left:auto;display:flex;gap:8px}
.bm-chat-actions button,.bm-chat-bubble-actions button{border:0;background:transparent;font-size:.78rem;color:#9e3440;cursor:pointer}
.bm-chat-context{padding:9px 17px;border-bottom:1px solid #edf0f3;background:#fff9fa;font-size:.86rem}
.bm-chat-context a{color:#aa1a27;text-decoration:underline}
.bm-chat-stream{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;padding:22px;background:#f7f8fa;gap:12px}
.bm-chat-empty{color:#667085;font-size:.9rem;padding:22px;text-align:center}
.bm-chat-bubble{padding:11px 15px;border-radius:14px;max-width:min(85%,530px);background:var(--chat-received,#fff);word-break:break-word;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.bm-chat-bubble.mine{align-self:flex-end;background:var(--chat-sent,#eaf7ed);border-bottom-right-radius:3px}
.bm-chat-bubble.theirs{align-self:flex-start;border-bottom-left-radius:3px}
.bm-chat-bubble p{margin:7px 0 0;white-space:pre-wrap}
.bm-chat-meta{color:#667085;font-size:.69rem}
.bm-chat-bubble-actions{display:flex;justify-content:flex-end;gap:5px;padding:4px 0 0}
.bm-chat-attachment{display:block;margin-top:8px;font-size:.84rem;text-decoration:underline}
.bm-chat-composer{display:flex;gap:8px;align-items:flex-end;padding:12px;border-top:1px solid #e5e9ed;background:white}
.bm-chat-composer textarea{flex:1;resize:vertical;min-height:44px;max-height:160px;border:1px solid #d5dbe2;border-radius:10px;padding:10px;outline:none;background:#fff;color:#17212f}
.bm-chat-file-label{padding:10px;cursor:pointer;border-radius:6px;font-size:1.2rem}
.bm-chat-error{font-size:.79rem;color:#ad1626;padding:0 12px 5px}
.bm-chat-error:empty,.bm-chat-typing:empty{display:none}
.bm-chat-typing{font-size:.75rem;color:#667085;padding:4px 18px}
.bm-chat-privacy{margin:12px 0;color:#667085;font-size:.8rem}
.bm-chat-guest-form{max-width:560px;padding:25px;background:white;border:1px solid #e4e7ec;border-radius:12px;margin-top:20px}
.bm-chat-guest-form form,.bm-chat-guest-form label{display:flex;flex-direction:column;gap:8px}
.bm-chat-guest-form form{gap:15px}
.bm-chat-honeypot{position:absolute;left:-10000px}
.bm-chat-guest-shell{height:min(70vh,640px);display:flex;flex-direction:column;border:1px solid #e4e7ec;border-radius:14px;overflow:hidden;margin-top:18px}
.bm-chat-filter-group{display:grid;grid-template-columns:1fr 1fr;padding:12px;gap:9px;font-size:.81rem}
.bm-chat-filter-group label:last-child{grid-column:span 2}
.bm-chat-filter-group select{width:100%;padding:7px;border:1px solid #d6dbe3;border-radius:6px;background:#fff}
.bm-chat-admin-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.bm-chat-admin-links{display:flex;gap:14px;flex-wrap:wrap}
.bm-chat-admin-toolbar{padding:10px 15px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:#fff8f9;border-bottom:1px solid #e4e7ec}
.bm-chat-admin-toolbar label{display:flex;align-items:center;gap:5px;font-size:.8rem}
.bm-chat-admin-toolbar select{max-width:160px;padding:6px;background:white;border:1px solid #d5dbe2;border-radius:5px}
.bm-chat-settings{display:flex;flex-direction:column;gap:20px;padding-bottom:25px}
.bm-chat-settings-group{background:white;border:1px solid #e5e9ef;border-radius:12px;padding:20px}
.bm-chat-settings-group h2{font-size:1.1rem;margin:0 0 15px}
.bm-chat-settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:16px}
.bm-chat-setting-field{display:flex;flex-direction:column;align-items:flex-start;gap:7px;font-size:.85rem;color:#334155}
.bm-chat-setting-field input[type=checkbox]{width:21px;height:21px;accent-color:#b51b28}
.bm-chat-widget{position:fixed;bottom:18px;right:18px;z-index:9998;max-width:calc(100vw - 24px)}
.bm-chat-widget.left{left:18px;right:auto}
.bm-chat-widget-toggle{border:0;border-radius:50px;background:var(--chat-accent,#c91f2c);color:white;padding:14px 19px;box-shadow:0 7px 25px #0003;cursor:pointer;font-weight:700}
.bm-chat-widget-panel{position:absolute;right:0;bottom:65px;width:min(370px,calc(100vw - 25px));height:min(550px,calc(100vh - 130px));border:1px solid #e4e7ec;border-radius:15px;background:white;box-shadow:0 10px 35px #0003;overflow:hidden}
.bm-chat-widget.left .bm-chat-widget-panel{right:auto;left:0}
.bm-chat-widget-panel .bm-chat-shell{height:100%;min-height:0;border:0;border-radius:0;display:flex;flex-direction:column}
.bm-chat-widget-panel .bm-chat-sidebar{border-right:0;height:40%;border-bottom:1px solid #edf0f3}
.bm-chat-widget-panel .bm-chat-main{height:60%}
.bm-chat-widget-panel .bm-chat-stream{padding:10px;gap:6px}
.bm-chat-widget-panel .bm-chat-bubble{max-width:95%;font-size:.79rem;padding:7px 9px}
.bm-chat-widget-panel .bm-chat-sidebar-head h2{font-size:.97rem}
.bm-chat-widget-panel .bm-chat-sidebar-head{padding:8px}
.bm-chat-widget-panel .bm-chat-btn{font-size:.7rem;padding:8px}
.bm-chat-widget-panel .bm-chat-composer{padding:6px}
.bm-chat-widget-panel .bm-chat-search-label,.bm-chat-widget-panel .bm-chat-list-heading{margin:5px 8px;font-size:.7rem}
.bm-chat-widget-panel .bm-chat-sidebar>.bm-chat-input{margin:0 8px;width:calc(100% - 16px);padding:6px}
.bm-chat-widget-panel .bm-chat-list-item{padding:6px 10px}
@media(max-width:760px){
 .bm-chat-shell{grid-template-columns:1fr;height:min(76vh,740px);min-height:420px}
 .bm-chat-sidebar{border-right:0}
 .bm-chat-main{display:none}
 .bm-chat-selected .bm-chat-sidebar{display:none}
 .bm-chat-selected .bm-chat-main{display:flex}
 .bm-chat-back{display:block}
 .bm-chat-admin .bm-chat-main{display:flex}
 .bm-chat-admin .bm-chat-shell{display:flex;flex-direction:column;height:auto;min-height:640px}
 .bm-chat-admin .bm-chat-sidebar{height:220px;border-bottom:1px solid #e4e7ec;flex:none}
 .bm-chat-admin .bm-chat-main{height:460px;flex:none}
 .bm-chat-widget-panel .bm-chat-main{display:flex}
 .bm-chat-widget-panel .bm-chat-sidebar{display:flex}
 .bm-chat-widget-panel .bm-chat-selected .bm-chat-sidebar{display:flex}
 .bm-chat-widget-panel .bm-chat-selected .bm-chat-main{display:flex}
}

.bm-chat-admin-stats{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.bm-chat-admin-stats span{background:#fff;border:1px solid #e4e7ec;padding:11px 15px;border-radius:8px;font-size:.85rem}
.bm-chat-older{border:0;border-bottom:1px solid #e4e7ec;background:#f8fafc;cursor:pointer;color:#526075;font-size:.8rem;padding:6px}
.bm-chat-no-desktop{display:none}
@media(max-width:760px){.bm-chat-no-desktop{display:block}.bm-chat-no-mobile{display:none!important}}

.bm-chat-widget .bm-chat-main-head{background:#fff}
