/* BEST-DONE V19 · Boîte de réception Marketplace + Emploi & Talents · Mobile first */
:root{--bd-blue:#175db6;--bd-blue-deep:#143e7b;--bd-ink:#16283d;--bd-muted:#617186;--bd-border:#e4eaf2;--bd-surface:#fff;--bd-cloud:#f5f8fc;--bd-shadow:0 12px 36px rgba(28,57,104,.08)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body.bd-messenger-page{margin:0;background:#f3f6fb;color:var(--bd-ink);font:15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input,textarea{font:inherit}button{cursor:pointer}a{color:var(--bd-blue);text-decoration:none}a:focus-visible,button:focus-visible,textarea:focus-visible,input:focus-visible{outline:3px solid #5a9dec;outline-offset:3px}button:disabled{cursor:not-allowed;opacity:.55}[hidden]{display:none!important}
.bd-test-banner{min-height:32px;padding:6px 20px;background:#fff3cf;border-bottom:1px solid #f4d98d;text-align:center;color:#6d5100;font-size:11px;font-weight:500}.bd-test-banner strong{font-weight:800}
.bd-messenger-topbar{height:76px;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border-bottom:1px solid var(--bd-border);padding:0 clamp(15px,4vw,70px)}.bd-messenger-brand{display:flex;align-items:center;gap:10px;color:var(--bd-ink)}.bd-brand-emblem{width:40px;height:40px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(145deg,#215fb2,#102f67);color:#fff;font-size:25px;font-weight:800;box-shadow:0 5px 13px #215fb23b}.bd-messenger-brand strong,.bd-messenger-brand small{display:block;line-height:1.12}.bd-messenger-brand strong{font-size:16px;letter-spacing:.07em}.bd-messenger-brand small{font-size:11px;color:var(--bd-muted);margin-top:5px}.bd-messenger-topbar nav{display:flex;flex-wrap:wrap;gap:clamp(10px,2vw,24px)}.bd-messenger-topbar nav a{font-size:13px;color:#3d536c;font-weight:700}.bd-messenger-topbar nav a:hover{color:var(--bd-blue)}
.bd-messenger-main{max-width:1340px;margin:0 auto;padding:clamp(15px,3vw,32px)}.bd-messenger-intro{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:0 0 20px}.bd-messenger-intro h1{font-size:clamp(24px,3vw,32px);line-height:1.16;margin:6px 0 8px;font-weight:850;letter-spacing:-.035em}.bd-messenger-intro p{margin:0;color:var(--bd-muted);font-size:13px}.bd-messenger-eyebrow{color:var(--bd-blue);font-size:10px;letter-spacing:.14em;font-weight:850}.bd-messenger-status-dot{display:inline-flex;align-items:center;gap:6px;color:#266c4c;font-size:11px;font-weight:800;background:#e9f7ef;border-radius:16px;padding:5px 11px;white-space:nowrap}.bd-messenger-status-dot>span{color:#20a06e}
.bd-messenger-layout{display:grid;grid-template-columns:minmax(255px,365px) minmax(0,1fr);height:min(690px,calc(100dvh - 248px));min-height:480px;background:var(--bd-surface);border:1px solid #dde5ee;border-radius:20px;overflow:hidden;box-shadow:var(--bd-shadow)}.bd-messenger-sidebar{display:flex;flex-direction:column;min-width:0;background:#fff;border-right:1px solid var(--bd-border)}.bd-sidebar-header{display:flex;justify-content:space-between;align-items:center;padding:24px 21px 16px;gap:10px}.bd-sidebar-header h2{font-size:20px;letter-spacing:-.035em;margin:3px 0 0}.bd-sidebar-header h2 span{display:inline-flex;align-items:center;justify-content:center;min-width:24px;border-radius:20px;padding:1px 7px;background:#edf4ff;color:#1c5ca6;font-size:12px;vertical-align:middle}.bd-sidebar-label{font-size:10px;color:var(--bd-muted);letter-spacing:.13em;font-weight:850}.bd-icon-button{width:38px;height:38px;border:1px solid #e6ebf2;border-radius:11px;background:#fff;color:#47617e;font-weight:750;font-size:21px;display:grid;place-items:center;transition:background .15s}.bd-icon-button:hover{background:#edf4ff}
.bd-chat-search{margin:0 18px 14px;display:flex;align-items:center;gap:9px;background:var(--bd-cloud);border:1px solid #e8edf4;border-radius:12px;padding:0 12px;color:#667d99}.bd-chat-search>span{font-size:23px}.bd-chat-search input{width:100%;background:transparent;border:0;outline:0;padding:11px 0;font-size:13px;color:var(--bd-ink)}.bd-chat-search:focus-within{border-color:#85aee0}.bd-chat-filters{display:flex;gap:7px;padding:0 18px 14px;overflow-x:auto}.bd-chat-filters button{border:1px solid var(--bd-border);border-radius:30px;padding:6px 13px;background:#fff;color:#63758a;font-size:12px;font-weight:720;white-space:nowrap}.bd-chat-filters button.active{background:#eaf2ff;color:#1255aa;border-color:#c7dcfc}.bd-chat-list{overflow-y:auto;flex:1;min-height:80px}.bd-chat-item{width:100%;border:0;border-left:3px solid transparent;border-bottom:1px solid #f0f3f7;padding:14px 18px 14px 14px;display:flex;align-items:center;gap:11px;text-align:left;background:#fff;color:var(--bd-ink)}.bd-chat-item:hover,.bd-chat-item:focus-visible{background:#f6faff}.bd-chat-item.active{background:#eff6ff;border-left-color:#1b63b8}.bd-chat-avatar{width:47px;height:47px;flex:0 0 47px;border-radius:16px;background:linear-gradient(160deg,#e3efff,#bbd8ff);color:#265c9a;display:grid;place-items:center;font-weight:850;font-size:16px}.bd-chat-avatar.employment{background:linear-gradient(160deg,#e5f6eb,#c9ead8);color:#287554}.bd-chat-item-main{min-width:0;flex:1}.bd-chat-row{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.bd-chat-title{display:block;font-size:14px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.bd-chat-time{font-size:10px;color:#8795a5;white-space:nowrap}.bd-chat-details{display:block;font-size:11px;color:#56728f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:2px 0}.bd-chat-subtitle{font-size:11px;color:#8290a2;display:flex;gap:6px;align-items:center}.bd-chat-subtitle .bd-chat-unread{margin-left:auto;display:inline-grid;place-items:center;min-width:20px;height:20px;border-radius:13px;background:#1b66bf;color:#fff;font-size:11px;font-weight:850}.bd-chat-empty{padding:34px 24px;text-align:center;color:var(--bd-muted);font-size:13px}.bd-chat-empty strong{display:block;color:#23476f;font-size:15px;margin-bottom:7px}.bd-sidebar-hint{padding:0 18px;font-size:11px;color:#8a5960;margin:5px 0}.bd-sidebar-hint:empty{display:none}.bd-sidebar-footer{background:#fafcff;padding:11px 18px;border-top:1px solid var(--bd-border);font-size:10px;color:var(--bd-muted)}
.bd-messenger-thread{display:flex;min-width:0;min-height:0;background:#f8faff;flex-direction:column}.bd-chat-welcome{margin:auto;text-align:center;padding:36px 22px;max-width:430px;color:#567089}.bd-chat-welcome-icon{width:84px;height:84px;border-radius:27px;background:#e5f0ff;display:grid;place-items:center;color:#1c64b4;font-size:41px;margin:0 auto 17px}.bd-chat-welcome h2{font-size:23px;letter-spacing:-.02em;color:#284568;margin:0 0 9px}.bd-chat-welcome p{font-size:13px;line-height:1.7;margin:0}.bd-chat-welcome-links{margin-top:22px;display:flex;justify-content:center;flex-wrap:wrap;gap:12px}.bd-chat-welcome-links a{font-size:12px;font-weight:800;background:#fff;border:1px solid #dce8f7;border-radius:9px;padding:9px 12px}.bd-chat-active{display:flex;min-height:0;flex:1;flex-direction:column}.bd-thread-header{height:84px;display:flex;align-items:center;gap:12px;padding:14px 24px;background:#fff;border-bottom:1px solid var(--bd-border);flex-shrink:0}.bd-thread-avatar{width:47px;height:47px;border-radius:16px;display:grid;place-items:center;color:#1d5f9d;background:#e6f1ff;font-weight:900;flex:0 0 47px}.bd-thread-title{min-width:0;flex:1}.bd-thread-title h2{font-size:16px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bd-thread-title p{font-size:12px;color:#75869b;margin:2px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bd-thread-secure{font-size:11px;font-weight:700;color:#6c8095;white-space:nowrap}.bd-thread-messages{padding:22px clamp(12px,3vw,32px);flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:7px;overscroll-behavior:contain}.bd-message-day{text-align:center;color:#8d9aaa;font-size:11px;font-weight:700;margin:12px auto;background:#eaf0f7;padding:4px 12px;border-radius:18px}.bd-message-row{display:flex;align-items:flex-end;gap:7px;max-width:85%}.bd-message-row.mine{align-self:flex-end;flex-direction:row-reverse}.bd-message-row.theirs{align-self:flex-start}.bd-message-bubble{background:#fff;box-shadow:0 1px 4px rgba(35,62,92,.05);border:1px solid #e9edf4;padding:10px 13px 7px;border-radius:16px 16px 16px 5px;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;color:#243b53}.bd-message-row.mine .bd-message-bubble{background:#2167bd;border-color:#2167bd;color:white;border-radius:16px 16px 5px 16px}.bd-message-time{display:block;text-align:right;font-size:10px;color:#97a7b9;margin-top:4px}.bd-message-row.mine .bd-message-time{color:#d9eafa}.bd-thread-bottom{padding:12px clamp(12px,3vw,28px) 15px;background:#fff;border-top:1px solid var(--bd-border);flex-shrink:0}.bd-chat-compose{display:flex;gap:11px;align-items:end}.bd-chat-compose textarea{flex:1;min-width:0;min-height:45px;max-height:135px;resize:none;border:1px solid #dce5ef;background:#f6f9fd;border-radius:15px;padding:12px 13px;color:#152d47;line-height:1.5;outline:none}.bd-chat-compose textarea:focus{border-color:#4385d1;box-shadow:0 0 0 3px #d9eaff}.bd-chat-compose button{width:47px;height:47px;border:0;border-radius:14px;background:#1c63b7;color:white;font-size:19px;display:grid;place-items:center;flex-shrink:0}.bd-chat-compose button:hover:not(:disabled){background:#114e9b}.bd-thread-bottom small{display:block;font-size:10px;color:#98a2af;margin:6px 0 0 2px}.bd-thread-status{margin:0 0 7px;font-size:12px;color:#516a82;min-height:0}.bd-thread-status:empty{display:none}.bd-thread-status.error{color:#a62832}.bd-thread-status.success{color:#287049}.bd-chat-inline-note{margin:12px auto;color:#7b8ca0;font-size:12px;text-align:center;max-width:350px}.bd-chat-back{display:none}.bd-messenger-disclaimer{font-size:11px;color:#8797a8;text-align:center;margin:15px 0 0}.bd-messenger-gate{background:#fff;border-radius:15px;border:1px solid #e1e9f3;box-shadow:var(--bd-shadow);padding:38px;text-align:center;color:#587086;font-size:13px}.bd-messenger-gate a{font-weight:750}.bd-loading-spinner{margin:auto auto 15px;width:30px;height:30px;border:3px solid #d7e8fa;border-top-color:#246bb7;border-radius:50%;animation:bdRotate .7s linear infinite}@keyframes bdRotate{to{transform:rotate(360deg)}}.bd-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
@media (max-width:760px){.bd-messenger-topbar{height:60px;padding:0 14px}.bd-messenger-topbar nav a{font-size:11px}.bd-messenger-topbar nav a:nth-child(2){display:none}.bd-brand-emblem{width:34px;height:34px;border-radius:10px;font-size:21px}.bd-messenger-brand strong{font-size:13px}.bd-messenger-brand small{font-size:9px}.bd-messenger-main{padding:10px 0 0}.bd-messenger-intro{padding:12px 16px;margin:0}.bd-messenger-intro h1{font-size:23px}.bd-messenger-intro p{font-size:11px}.bd-messenger-status-dot{display:none}.bd-messenger-layout{height:calc(100dvh - 170px);min-height:460px;border-radius:14px 14px 0 0;border-right:0;border-left:0;grid-template-columns:1fr}.bd-messenger-sidebar{grid-column:1;grid-row:1;border-right:0}.bd-messenger-thread{display:none;grid-column:1;grid-row:1}.bd-messenger-layout.bd-mobile-thread .bd-messenger-sidebar{display:none}.bd-messenger-layout.bd-mobile-thread .bd-messenger-thread{display:flex}.bd-thread-header{height:69px;padding:9px 13px;gap:9px}.bd-chat-back{display:grid}.bd-thread-avatar{width:39px;height:39px;flex-basis:39px;border-radius:12px}.bd-thread-title h2{font-size:14px}.bd-thread-title p{font-size:11px}.bd-thread-secure span{display:none}.bd-thread-messages{padding:14px 13px}.bd-message-row{max-width:91%}.bd-thread-bottom{padding:10px 12px calc(10px + env(safe-area-inset-bottom))}.bd-thread-bottom small{font-size:9px}.bd-chat-list{padding-bottom:env(safe-area-inset-bottom)}.bd-messenger-disclaimer{display:none}.bd-sidebar-header{padding:17px 18px 12px}}
@media (max-width:390px){.bd-messenger-topbar nav a:nth-child(3){display:none}.bd-chat-filters button{padding:6px 9px}.bd-thread-title h2{font-size:13px}}
@media (prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important}}

.bd-messenger-logo{width:75px;height:43px;object-fit:contain;flex:0 0 75px}
@media(max-width:760px){.bd-messenger-logo{width:58px;height:34px;flex-basis:58px}}

/* BEST-DONE V20 - fiche annonce et interlocuteur en contexte, accessibles en mobile */
.bd-thread-extras{background:#fff;border-bottom:1px solid #e1e8f2;padding:10px 17px;flex:0 0 auto;overflow:auto;max-height:min(36vh,275px)}
.bd-item-context{display:flex;align-items:center;gap:12px;border:1px solid #e0eafa;background:#f7faff;border-radius:14px;padding:9px 12px}
.bd-item-image,.bd-item-placeholder{width:76px;height:76px;border-radius:11px;flex:0 0 76px;object-fit:cover;background:#e7eef7}
.bd-item-placeholder{display:grid;place-items:center;font-size:27px}
.bd-item-info{min-width:0;display:flex;flex-direction:column;gap:2px;flex:1}
.bd-item-kicker,.bd-member-kicker{font-size:10px;font-weight:820;letter-spacing:.08em;color:#6482a4}
.bd-item-info strong{color:#203d60;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bd-item-price{font-weight:800;color:#1357a8;font-size:12px}
#bd-item-area{font-size:11px;color:#677b8e;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bd-item-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:3px}
.bd-item-actions a,.bd-item-actions button,.bd-member-context a{font-size:11px;color:#135dad;font-weight:750;text-decoration:none}
.bd-item-actions button{border:0;padding:0;background:transparent;cursor:pointer}
.bd-item-description{font-size:12px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;margin:10px 4px 0;color:#415875;max-height:120px;overflow:auto}
.bd-member-context{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:8px 5px 0}
.bd-member-summary{display:flex;flex-direction:column;gap:3px;min-width:0}
.bd-member-summary strong{font-size:12px;color:#183e6d;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bd-member-rating{font-size:11px;color:#69809a}
.bd-member-context a{text-align:right;min-width:120px}
@media(max-width:760px){.bd-thread-extras{padding:8px 10px;max-height:34vh}.bd-item-image,.bd-item-placeholder{width:59px;height:59px;flex-basis:59px}.bd-item-context{gap:8px;padding:7px 8px}.bd-member-context{align-items:flex-start}.bd-member-context a{min-width:90px;max-width:116px}.bd-item-actions{gap:8px}}

/* V21 — Transactions dialoguées Marketplace, cartes chronologiques mobiles */
.bd-commerce-bar{border-bottom:1px solid var(--bd-border);padding-bottom:9px;margin-bottom:10px}
.bd-commerce-head{display:flex;gap:10px;align-items:center;justify-content:space-between}
#bd-offer-toggle{border:1px solid #1762b6;border-radius:12px;background:#eaf3ff;color:#1756a2;padding:8px 12px;font-size:12px;font-weight:800;flex-shrink:0}
#bd-commerce-summary{color:#71849a;font-size:11px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
#bd-commerce-status{color:#5c7185;font-size:11px;margin:5px 0 0}#bd-commerce-status:empty{display:none}
.bd-offer-form{display:flex;flex-wrap:wrap;align-items:end;gap:8px;margin-top:10px;padding:10px;border:1px solid #d6e4f4;background:#f6faff;border-radius:12px}
.bd-offer-form label{display:flex;flex-direction:column;gap:3px;color:#415a79;font-size:11px;font-weight:750;min-width:100px;flex:1}
.bd-offer-form input{background:#fff;border:1px solid #ccdaf0;border-radius:7px;padding:8px;width:100%;min-width:0;color:#173454}
.bd-deal-card{margin:9px auto;max-width:min(93%,460px);width:100%;background:#fff;border:1px solid #dbe6f4;border-radius:15px;padding:13px 15px;box-shadow:0 3px 13px rgba(34,65,112,.06)}
.bd-offer-card{border-left:4px solid #1f70cd}.bd-order-card{border-left:4px solid #0b8a70}.bd-review-card{border-left:4px solid #e9a21b;background:#fffdf7}
.bd-event-card{border-style:dashed;padding:8px 12px;background:#f6f9ff}
.bd-deal-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bd-deal-head strong{font-size:12px;color:#23507e}.bd-deal-head time{font-size:10px;color:#8191a5;white-space:nowrap}
.bd-deal-amount{font-size:18px;color:#113e7e;font-weight:900;line-height:1.4;margin:6px 0}.bd-deal-detail{font-size:12px;color:#516680;white-space:pre-wrap;overflow-wrap:anywhere;margin:5px 0}.bd-deal-small{color:#8191a5;font-size:10px;line-height:1.5}
.bd-deal-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}
.bd-deal-btn{background:#eff5fc;border:1px solid #cbdced;border-radius:9px;padding:8px 11px;font-size:11px;color:#215a93;font-weight:750}
.bd-deal-btn:hover:not(:disabled){background:#ddecff}.bd-deal-primary,.bd-deal-actions .bd-deal-btn:first-child{background:#1763bd;border-color:#1763bd;color:#fff}
.bd-deal-review-stars{display:block;color:#dd9515;letter-spacing:3px;margin:7px 0}
.bd-deal-review-form{margin-top:12px;display:flex;flex-direction:column;gap:7px;padding:10px;background:#f4f9ff;border-radius:9px}
.bd-deal-review-form label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;font-weight:700}
.bd-deal-review-form select,.bd-deal-review-form textarea{border:1px solid #cddced;border-radius:8px;padding:8px;color:#244666;background:white;font:inherit}
.bd-deal-review-form textarea{width:100%;resize:vertical}.bd-deal-review-form .bd-deal-btn{align-self:flex-start}
@media(max-width:760px){.bd-offer-form{max-height:27dvh;overflow:auto}.bd-commerce-head{gap:7px}.bd-commerce-head #bd-commerce-summary{font-size:10px}.bd-deal-card{max-width:100%;padding:11px 12px}}
/* V21 mobile: keep composer inside the visual viewport, including safe-area padding. */
@media (max-width:760px){
 .bd-messenger-layout{height:calc(100dvh - 238px);min-height:350px}
 .bd-messenger-intro{padding-bottom:10px}
 .bd-thread-extras{max-height:min(28dvh,190px)}
 .bd-commerce-bar{max-height:30dvh;overflow-y:auto;overscroll-behavior:contain}
}
@media (max-width:760px) and (max-height:650px){
 .bd-messenger-intro p{display:none}
 .bd-messenger-intro{padding:5px 16px}
 .bd-messenger-layout{height:calc(100dvh - 195px);min-height:310px}
}

/* V25 : Immobilier et véhicules dans la boîte de réception unique */
.bd-chat-avatar.classified{background:linear-gradient(150deg,#edf8ef,#c1e8d0);color:#216846}
.bd-chat-filters{flex-wrap:wrap;overflow-x:visible;row-gap:7px}.bd-chat-filters button{flex-shrink:0;padding:6px 10px;font-size:11px}

/* V25 mobile: messages and offers share one independently scrollable region.
   Never let offer panels squeeze chat history to zero height. */
.bd-thread-scroll{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;}
.bd-thread-scroll>.bd-thread-messages{flex:0 0 auto;min-height:95px;overflow:visible;}
.bd-thread-scroll>#bd-property-deal{flex:0 0 auto;max-height:none;overflow:visible;}
.bd-thread-scroll>#bd-property-deal[hidden]{display:none!important;}
@media(max-width:760px){
 .bd-thread-extras{max-height:min(20dvh,140px);flex-shrink:0;}
 .bd-thread-scroll{min-height:100px;}
 .bd-thread-scroll>.bd-thread-messages{min-height:105px;padding:12px 13px;}
 .bd-thread-scroll>#bd-property-deal{max-height:none;}
 .bd-thread-bottom{position:relative;z-index:2;flex-shrink:0;}
}

.bd-conversations-more{margin:8px 18px;padding:10px;border:1px solid #c7dcfc;border-radius:10px;background:#eaf2ff;color:#1255aa;font:inherit;font-size:12px;cursor:pointer}.bd-conversations-more:disabled{opacity:.6;cursor:wait}.bd-conversations-more[hidden]{display:none}

/* Consolidation: fit the visible viewport when the mobile keyboard is open. */
@media(max-width:760px){
 body.bd-conversation-open .bd-messenger-layout{position:fixed;left:0;right:0;top:var(--bd-viewport-offset,0px);height:var(--bd-visible-height,100dvh);min-height:0;border-radius:0;z-index:70;}
 body.bd-conversation-open .bd-thread-header{padding-right:62px;padding-top:calc(9px + env(safe-area-inset-top,0px));height:calc(69px + env(safe-area-inset-top,0px));}
 body.bd-conversation-open .bd-thread-secure{display:none;}
 body.bd-conversation-open .bd-thread-scroll{min-height:0;}
 body.bd-keyboard-open .bd-thread-extras{display:none;}
 body.bd-chat-typing #bd-commerce-bar{display:none;}
 body.bd-keyboard-open #bd-compose-hint{display:none;}
 body.bd-keyboard-open .bd-thread-bottom{padding-top:6px;padding-bottom:calc(6px + env(safe-area-inset-bottom,0px));}
}
