:root{--gold:#b9821f;--gold2:#e3ad45;--red:#bd2730;--ink:#22272e;--muted:#66707a;--line:#dfd7ca;--green:#159947;--bg:#f4efe7;--white:#fff;--shadow:0 10px 30px rgba(38,31,22,.10)}
*{box-sizing:border-box}html,body{margin:0;height:100%;font-family:Arial,Helvetica,sans-serif;color:var(--ink);background:var(--bg)}body{overflow:hidden}.chat-app{height:100dvh;display:flex;flex-direction:column;background:linear-gradient(180deg,#faf8f4,#eee7dc)}
.chat-topbar{height:78px;flex:0 0 78px;padding:0 18px;display:flex;align-items:center;gap:18px;background:rgba(255,255,255,.98);border-bottom:1px solid var(--line);box-shadow:0 3px 14px rgba(0,0,0,.05);z-index:20}.chat-brand{display:flex;align-items:center;gap:11px;color:inherit;text-decoration:none;min-width:230px}.chat-logo{width:58px;height:62px;border:2px solid #d58e93;border-radius:13px 13px 18px 18px;background:#fff;display:grid;place-items:center;text-align:center;font-weight:900;line-height:.9;font-size:14px}.chat-logo span{display:block;color:var(--gold);font-size:17px}.chat-brand-text{display:grid}.chat-brand-text strong{font-size:18px}.chat-brand-text small{color:#886015;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.chat-site-menu{margin-left:auto;display:flex;align-items:center;gap:8px}.chat-site-menu a{color:#74500e;text-decoration:none;font-size:12px;font-weight:900;text-transform:uppercase;padding:10px 12px;border-radius:999px}.chat-site-menu a:hover{background:#fff2d7}.chat-site-menu .back-site{background:#fff4dd;border:1px solid #e6c477}.chat-menu-btn{display:none;margin-left:auto;border:1px solid #dcccae;background:#fff7e8;border-radius:11px;width:44px;height:44px;font-size:22px}
.chat-titlebar{flex:0 0 54px;min-height:54px;padding:7px 18px;display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid #e9e1d5}.chat-titlebar>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.chat-titlebar strong{font-size:15px}.chat-titlebar small{color:var(--muted)}.online-dot{width:9px;height:9px;border-radius:50%;background:var(--green);box-shadow:0 0 0 4px rgba(21,153,71,.12)}.scroll-bottom{border:0;background:#f6ead4;color:#775212;border-radius:999px;padding:8px 12px;font-size:12px;font-weight:800;cursor:pointer}
.chat-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:20px max(18px,calc((100vw - 980px)/2)) 28px;scroll-behavior:smooth}.chat-loading,.chat-empty{text-align:center;color:var(--muted);padding:28px}.message-row{display:flex;margin:8px 0}.message-card{max-width:min(720px,82%);background:#fff;border:1px solid #e4dcd0;border-radius:17px 17px 17px 5px;padding:10px 12px 8px;box-shadow:0 5px 18px rgba(48,39,27,.06);position:relative}.message-card.staff-message{border-color:#dfc17e;background:#fffaf0}.message-head{display:flex;gap:8px;align-items:center;margin-bottom:4px}.message-author{font-weight:900;font-size:13px;color:#7c5512}.staff-badge{font-size:9px;padding:3px 6px;border-radius:999px;background:var(--red);color:#fff;font-weight:900}.message-time{margin-left:auto;color:#8b8175;font-size:10px}.message-text{white-space:pre-wrap;word-break:break-word;font-size:15px;line-height:1.38}.message-photo{display:block;max-width:min(480px,100%);max-height:430px;margin-top:8px;border-radius:12px;object-fit:cover;cursor:zoom-in;background:#eee}.reply-quote{border-left:3px solid var(--gold);background:#f7f2ea;border-radius:8px;padding:6px 8px;margin-bottom:7px;font-size:12px;color:#655b50}.reply-quote strong{display:block;color:#8a5d0e;margin-bottom:2px}.reply-btn{border:0;background:transparent;color:#91630f;font-size:11px;font-weight:800;padding:5px 0 0;cursor:pointer}.reply-btn:hover{text-decoration:underline}.date-separator{text-align:center;margin:14px 0 10px}.date-separator span{display:inline-block;background:#e9dfd0;color:#74695c;border-radius:999px;padding:5px 10px;font-size:10px;font-weight:900;text-transform:uppercase}
.reply-panel,.photo-preview{flex:0 0 auto;margin:0 auto;width:min(980px,100%);background:#fff6e4;border-top:1px solid #e3c98e;padding:8px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px}.reply-panel>div{display:grid;min-width:0}.reply-panel small{color:#8e651d}.reply-panel strong{font-size:12px}.reply-panel span{font-size:12px;color:#655f57;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reply-panel button{border:0;background:transparent;font-size:24px;cursor:pointer}.photo-preview{justify-content:flex-start}.photo-preview img{height:54px;width:70px;object-fit:cover;border-radius:8px}.photo-preview button{border:0;background:#f7e0e0;color:#9a2929;border-radius:8px;padding:7px 10px;font-weight:800;cursor:pointer}
.chat-composer{flex:0 0 auto;background:#fff;border-top:1px solid var(--line);padding:9px max(18px,calc((100vw - 980px)/2)) max(9px,env(safe-area-inset-bottom));box-shadow:0 -4px 18px rgba(0,0,0,.04)}.chat-identity{display:flex;align-items:center;gap:7px;margin-bottom:6px;font-size:11px;color:var(--muted)}.chat-identity strong{color:#775312}.chat-identity em{font-style:normal;background:var(--red);color:#fff;padding:2px 6px;border-radius:999px;font-size:9px;font-weight:900}.chat-name-wrap{display:flex;align-items:center;gap:8px;margin-bottom:6px;font-size:11px;color:#746b61}.chat-name-wrap input{height:34px;max-width:220px;border:1px solid #d8cfc2;border-radius:9px;padding:0 10px}.composer-row{display:grid;grid-template-columns:46px 1fr auto;gap:8px;align-items:end}.photo-button{width:46px;height:46px;border-radius:12px;border:1px solid #decfae;background:#fff6e6;display:grid;place-items:center;cursor:pointer;font-size:20px}.chat-composer textarea{width:100%;max-height:120px;min-height:46px;resize:none;border:1px solid #d8d0c5;border-radius:14px;padding:12px 13px;font-size:15px;outline:none;background:#fbfaf8}.chat-composer textarea:focus{border-color:#d6a94e;box-shadow:0 0 0 3px rgba(214,169,78,.13)}.send-button{height:46px;border:0;border-radius:12px;padding:0 18px;background:var(--red);color:#fff;font-weight:900;cursor:pointer}.send-button:disabled{opacity:.55}.composer-help{margin:4px 0 0 55px;color:#958a7d;font-size:9px}
.chat-lightbox{position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:1000;display:grid;place-items:center;padding:25px}.chat-lightbox img{max-width:96vw;max-height:90vh;object-fit:contain}.chat-lightbox button{position:absolute;right:18px;top:12px;border:0;background:rgba(255,255,255,.14);color:#fff;width:44px;height:44px;border-radius:50%;font-size:30px;cursor:pointer}
[hidden]{display:none!important}
@media(max-width:850px){.chat-topbar{height:64px;flex-basis:64px;padding:0 10px}.chat-logo{width:44px;height:48px;font-size:11px}.chat-logo span{font-size:13px}.chat-brand-text strong{font-size:15px}.chat-brand-text small{font-size:9px}.chat-menu-btn{display:block}.chat-site-menu{display:none;position:absolute;top:64px;left:8px;right:8px;flex-direction:column;align-items:stretch;background:#fff;border:1px solid var(--line);border-radius:13px;padding:8px;box-shadow:var(--shadow)}.chat-site-menu.open{display:flex}.chat-site-menu a{text-align:center;padding:11px}.chat-titlebar{padding:6px 10px}.chat-messages{padding:12px 9px 18px}.message-card{max-width:92%;padding:9px 10px}.message-text{font-size:14px}.chat-composer{padding:7px 8px max(7px,env(safe-area-inset-bottom))}.composer-row{grid-template-columns:42px 1fr auto;gap:6px}.photo-button{width:42px;height:42px}.chat-composer textarea{min-height:42px;padding:10px;font-size:16px}.send-button{height:42px;padding:0 12px;font-size:12px}.composer-help{display:none}.reply-panel,.photo-preview{width:100%}.scroll-bottom{font-size:10px;padding:7px 9px}}
@media(max-width:480px){.chat-brand{min-width:0}.chat-brand-text small{display:none}.chat-titlebar small{display:none}.message-card{max-width:96%}.message-photo{max-height:330px}.chat-name-wrap span{display:none}.chat-name-wrap input{max-width:100%;width:100%}}

/* V5.5 - statut Envoyé/Lu + recherche du site */
.message-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:3px}.delivery-status{font-size:10px;color:#8b8175;font-weight:800;white-space:nowrap}.delivery-status.is-read{color:#2b78c5}.mine-row{justify-content:flex-end}.mine-message{border-radius:17px 17px 5px 17px;background:#fff9ec;border-color:#e4c987}
.chat-global-search{display:flex;align-items:center;border:1px solid #ddcda9;border-radius:999px;overflow:hidden;height:36px;background:#fff;min-width:170px}.chat-global-search input{min-width:0;width:145px;border:0;outline:0;background:transparent;padding:0 9px 0 12px;font-size:12px}.chat-global-search button{height:36px;width:36px;border:0;background:#e0a638;font-size:18px;font-weight:900;cursor:pointer}
@media(max-width:850px){.chat-global-search{order:-1;width:100%;min-width:0;border-radius:10px;height:40px;margin-bottom:4px}.chat-global-search input{width:100%;flex:1;font-size:16px}.chat-global-search button{height:40px;width:42px}.message-foot{margin-top:4px}}

/* V5.5.1 - suppression de ses propres messages */
.message-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.delete-btn{border:0;background:transparent;color:#a42626;font-size:11px;font-weight:800;padding:5px 0 0;cursor:pointer}.delete-btn:hover{text-decoration:underline}.mine-message .delete-btn{color:#b3262e}@media(max-width:520px){.message-actions{gap:9px}.delete-btn,.reply-btn{font-size:10px}}


/* V5.3.7 - fiabilité, administration et message épinglé */
.chat-title-actions{display:flex;align-items:center;gap:8px}.clear-chat{border:1px solid #efc4c6;background:#fff2f2;color:#a51f26;border-radius:999px;padding:8px 12px;font-size:11px;font-weight:900;cursor:pointer}.clear-chat:hover{background:#ffe6e6}
.pinned-panel{flex:0 0 auto;width:min(980px,calc(100% - 24px));margin:8px auto 0;padding:9px 12px;display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;background:#fff8df;border:1px solid #e2c36c;border-radius:12px;color:#3b3428}.pinned-icon{font-size:20px}.pinned-copy{display:grid;min-width:0}.pinned-copy small{font-size:9px;font-weight:900;color:#946812;letter-spacing:.08em}.pinned-copy strong{font-size:12px}.pinned-copy span{font-size:12px;color:#6a6156;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pinned-panel button{border:0;background:#e0a638;color:#21180a;border-radius:9px;padding:8px 11px;font-size:11px;font-weight:900;cursor:pointer}
.pinned-badge{font-size:8px;padding:3px 6px;border-radius:999px;background:#f0c95e;color:#4d3810;font-weight:900}.pinned-message{border-color:#d7b34b;box-shadow:0 0 0 2px rgba(215,179,75,.12),0 5px 18px rgba(48,39,27,.06)}.pin-btn{border:0;background:transparent;color:#8d6816;font-size:11px;font-weight:800;padding:5px 0 0;cursor:pointer}.pin-btn.is-pinned{color:#a94812}.pin-btn:hover{text-decoration:underline}.pin-flash{animation:pinFlash 1.2s ease}@keyframes pinFlash{0%,100%{box-shadow:0 0 0 2px rgba(215,179,75,.12)}50%{box-shadow:0 0 0 5px rgba(224,166,56,.38)}}
@media(max-width:850px){.chat-title-actions{gap:5px}.clear-chat,.scroll-bottom{font-size:9px;padding:7px 8px}.pinned-panel{width:calc(100% - 16px);margin-top:6px;padding:8px 9px}.pinned-copy span{max-width:54vw}}
@media(max-width:520px){.pin-btn{font-size:10px}.pinned-panel{grid-template-columns:auto 1fr}.pinned-panel button{grid-column:1/-1;padding:7px}.clear-chat{max-width:92px;white-space:normal;line-height:1.05}}
