/* Keep stored legacy modals out of the conversation, even before JS loads. */
.msjtext .modal .checkbox, .msjtext .modal .modal-overlay { display:none !important; }
.msjtext .att_container { float:none; width:auto; margin:16px 0 0; padding:0; background:transparent; border:0; }
.msjtext .att_container > br { display:none; }
.msjtext .bh-attachments { display:flex; flex-wrap:wrap; gap:12px; clear:both; margin:16px 0 0; }
.msjtext .bh-attachment { box-sizing:border-box; width:210px; max-width:100%; padding:0; margin:0; float:none; border:1px solid var(--line,#c8d6cf); border-radius:10px; overflow:hidden; background:var(--subtle,#edf3f0); text-align:left; }
.msjtext .bh-attachment a { display:block; padding:10px 12px; color:var(--accent,#0b6b3d); font-size:13px; text-decoration:none; overflow-wrap:anywhere; }
.msjtext .bh-attachment .bh-attachment-open { padding:0; }
.msjtext .bh-attachment img { display:block; width:100%; height:120px; object-fit:contain; background:var(--surface,#fff); }
.bh-attachment-name { display:block; padding:10px 12px 0; font-size:13px; font-weight:700; color:var(--text,#15382a); overflow-wrap:anywhere; }
.bh-attachment-type { display:block; padding:16px 12px; font-size:20px; font-weight:700; color:var(--muted,#4d695b); }
.msjtext .bh-attachment a:focus-visible, #bh-attachment-viewer :focus-visible { outline:3px solid #48a978; outline-offset:-3px; }
body.bh-viewer-open { overflow:hidden; }
#bh-attachment-viewer { box-sizing:border-box; width:calc(100% - 32px); max-width:1200px; height:calc(100% - 32px); max-height:900px; padding:0; border:1px solid var(--line,#c8d6cf); border-radius:14px; background:var(--surface,#fff); color:var(--text,#15382a); }
#bh-attachment-viewer:not([open]) { display:none; }
#bh-attachment-viewer[open] { display:flex; flex-direction:column; }
#bh-attachment-viewer::backdrop { background:rgba(0,0,0,.8); }
#bh-attachment-viewer .bh-viewer-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:12px; flex-shrink:0; border-bottom:1px solid var(--line,#c8d6cf); }
#bh-attachment-title { flex:1 1 200px; margin:0; font-size:14px; overflow-wrap:anywhere; }
#bh-attachment-viewer button, #bh-attachment-viewer a { box-sizing:border-box; width:auto; margin:0; padding:9px 12px; min-height:40px; border:1px solid var(--line,#c8d6cf); border-radius:7px; background:var(--subtle,#edf3f0); color:var(--text,#15382a); font:inherit; font-size:13px; text-decoration:none; cursor:pointer; }
#bh-attachment-viewer button:disabled { opacity:.4; cursor:default; }
#bh-attachment-stage { flex:1; min-height:0; overflow:auto; display:flex; background:var(--page,#e8efeb); padding:12px; }
#bh-attachment-image { display:block; margin:auto; max-width:100%; max-height:100%; object-fit:contain; cursor:zoom-in; }
#bh-attachment-stage.bh-zoomed { display:block; }
#bh-attachment-stage.bh-zoomed img { max-width:none; max-height:none; cursor:zoom-out; }
#bh-attachment-error { margin:auto; padding:24px; text-align:center; }
#bh-attachment-viewer [hidden] { display:none !important; }
#bh-attachment-viewer .bh-viewer-footer { justify-content:center; border-top:1px solid var(--line,#c8d6cf); border-bottom:0; }
@media(max-width:520px) { .msjtext .bh-attachment { width:100%; } #bh-attachment-viewer { width:100%; height:100%; max-height:none; border-radius:0; } }
