/* Chat du BO : fil des messages et réponse — page Messagerie et onglet Chat du panneau des fiches. */
.msg-flux{flex:1;min-height:0;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:8px;background:#f7f8fa}
.dark .msg-flux{background:rgba(0,0,0,.15)}
.msg-row{display:flex;gap:10px;align-items:flex-end;padding:2px 0}
.msg-row.me{justify-content:flex-end}
.msg-jour{display:flex;justify-content:center;margin:6px 0}
.msg-jour span{background:#f3f4f6;color:#374151;border-radius:8px;padding:3px 12px;font-size:.74rem;font-weight:700;text-transform:capitalize}
.dark .msg-jour span{background:rgba(255,255,255,.08);color:#e5e7eb}
.msg-sep{display:flex;align-items:center;gap:10px;color:#ef4444;font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;margin:6px 2px}
.msg-sep::before,.msg-sep::after{content:'';flex:1;height:1px;background:rgba(239,68,68,.35)}
.msg-av{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#dbeafe;color:#3b82f6;align-self:flex-start}
.msg-av svg{width:20px;height:20px}
.msg-av img{width:100%;height:100%;border-radius:50%;object-fit:contain;background:#fff}
.msg-av.me{background:#dcfce7;color:#15803d;font-size:.7rem;font-weight:800;align-self:flex-end;overflow:hidden}
.msg-av.me img{object-fit:cover}
.msg{padding:9px 14px;border-radius:16px;font-size:.9rem;line-height:1.45;text-align:left;max-width:78%;min-width:0}
.msg .msg-nom{font-size:.76rem;font-weight:700;margin-bottom:2px;color:#15803d}
.msg.them .msg-nom{color:#2563eb}.dark .msg.them .msg-nom{color:#93c5fd}
.msg.them{background:#f3f4f6;color:#111827;border-top-left-radius:6px}.dark .msg.them{background:#1f2937;color:#f3f4f6}
.msg.me{background:#dcfce7;color:#14532d;border-bottom-right-radius:6px}.dark .msg.me{background:rgba(22,163,74,.22);color:#dcfce7}
.msg .tx{white-space:pre-wrap;overflow-wrap:anywhere}
.msg .tx a{color:inherit;text-decoration:underline}
.msg-h{font-size:.72rem;color:#6b7280;white-space:nowrap;flex-shrink:0}
.msg.me .msg-h{display:flex;justify-content:flex-end;align-items:center;gap:3px;margin-top:3px;color:#166534}
.msg-pj{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.msg-pj .pjv{width:104px;height:104px;object-fit:cover;border-radius:8px;display:block;cursor:zoom-in;transition:transform .1s}
.msg-pj .pjv:hover{transform:scale(1.03)}
.msg-pj .pjf{display:inline-flex;align-items:center;gap:5px;font-size:.78rem;text-decoration:underline;color:inherit;padding:3px 0}
.msg-reply{border-top:1px solid var(--b);padding:12px 14px;display:flex;gap:10px;align-items:flex-end;background:#fff}
.dark .msg-reply{background:transparent;border-color:rgba(255,255,255,.08)}
.msg-saisie{flex:1;min-width:0;display:flex;align-items:flex-end;gap:6px;border:1px solid #e5e7eb;border-radius:14px;padding:4px 6px 4px 4px;background:#fff}
.dark .msg-saisie{background:#1f2937;border-color:#374151}
.msg-saisie:focus-within{border-color:#16a34a}
.msg-reply textarea{flex:1;min-width:0;border:0;padding:9px 6px;font-size:.9rem;resize:none;font-family:inherit;background:transparent;color:inherit;box-shadow:none}
.msg-reply textarea:focus{outline:0;box-shadow:none}
.msg-envoyer{display:flex;align-items:center;justify-content:center;width:48px;height:46px;border:0;border-radius:12px;background:#16a34a;color:#fff;cursor:pointer;flex-shrink:0}
.msg-envoyer:hover{background:#15803d}.msg-envoyer svg{width:22px;height:22px}
.msg-envoyer[disabled]{opacity:.55;cursor:default}
.msg-clip{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;color:#6b7280;cursor:pointer;flex-shrink:0}
.msg-clip:hover{background:#f3f4f6}.msg-clip svg{width:20px;height:20px}
.msg-chips{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}
.msg-chip{display:inline-flex;align-items:center;gap:6px;background:rgba(31,94,255,.10);border-radius:8px;padding:3px 8px;font-size:.76rem;max-width:200px}
.msg-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.msg-chip b{cursor:pointer;color:#ef4444;font-weight:800}
.msg-chip-err{color:#dc2626;font-size:.76rem;align-self:center}
.msg-ro{border-top:1px solid var(--b);padding:12px;text-align:center;color:#6b7590;font-size:.8rem;background:#fff}
.dark .msg-ro{background:rgba(255,255,255,.02);border-color:rgba(255,255,255,.08)}
/* Onglet Chat du panneau des fiches (App\Livewire\Fiche\Chat) : fil des messages qui défile, réponse en bas. */
.bo-chat{--b:#e6e9f2;--pc:#1f5eff;display:flex;flex-direction:column;height:100%;min-height:340px;border:1px solid #e5e7eb;border-radius:10px;background:#fff;overflow:hidden;font-size:.8rem}
.dark .bo-chat{border-color:rgba(255,255,255,.1);background:#111827}
.bo-chat-tete{margin:0;padding:6px 10px;border-bottom:1px solid var(--b)}
.bo-chat-presence,.bo-chat-lien{font-size:.7rem}
.bo-chat-presence{margin-left:6px;font-weight:500;white-space:nowrap}
.dark .bo-chat-tete{border-color:rgba(255,255,255,.08)}
.bo-chat-presence{color:#6b7280}
.bo-chat-presence.on{color:#16a34a;font-weight:600}
.bo-chat-presence.on::before{content:'';display:inline-block;width:7px;height:7px;margin-right:4px;border-radius:50%;background:#16a34a}
.bo-chat-lien{margin-left:auto;color:var(--pc);font-weight:600}
.bo-chat-lien:hover{text-decoration:underline}
.bo-chat .msg-flux{padding:10px}
.bo-chat-vide{align-items:center;justify-content:center;text-align:center;color:#9ca3af;font-style:italic}
@container bo-fiche (max-width:899px){
    .bo-chat{height:auto}
    .bo-chat .msg-flux{max-height:60vh}
}

/* État de lecture de nos messages (ReponsesChat::lecture) : ✓ envoyé, ✓✓ non lu, ✓✓ bleu lu. */
.msg-lu{margin-left:4px;font-weight:700;letter-spacing:-.18em;color:#9aa4bf}
.msg-lu.lu{color:#1f5eff}
/* Réponses prédéfinies sous la zone de réponse (filament/chat/reponse) : barre lavande repliable, boutons avec dossier. */
.msg-predef{margin:0 14px 12px;border:1px solid #ddd6fe;border-radius:14px;background:#faf8ff;overflow:hidden}
.dark .msg-predef{background:rgba(124,58,237,.08);border-color:rgba(124,58,237,.3)}
.msg-predef-t{display:flex;align-items:center;gap:8px;width:100%;border:0;background:none;padding:9px 14px;font-weight:700;font-size:.86rem;color:#4c1d95;cursor:pointer}
.dark .msg-predef-t{color:#ddd6fe}
.msg-predef-t svg{width:18px;height:18px;color:#7c3aed}.msg-predef-t .chev{margin-left:auto;transition:transform .15s}
.msg-predef-l{display:flex;flex-wrap:wrap;gap:8px;padding:0 12px 12px}
.msg-predef-l button{display:inline-flex;align-items:center;gap:6px;border:1px solid #e5e7eb;background:#fff;color:#111827;border-radius:10px;padding:6px 10px;font-size:.78rem;font-weight:600;cursor:pointer}
.msg-predef-l button svg{width:15px;height:15px;color:#7c3aed}
.msg-predef-l button:hover{border-color:#7c3aed}
.dark .msg-predef-l button{background:#1f2937;border-color:#374151;color:#f3f4f6}
.msg-predef-att{font-size:.72rem;color:#b45309;font-weight:600;align-self:center}
