/* messaging feature styles. Loaded after styles.css. */

/* Compose tools: attach and quick replies */
.msg-tools{position:relative;display:flex;gap:6px;flex:none;align-items:center}
.msg-tool{min-height:42px;padding:0 11px;gap:6px}
.msg-tool .icon{color:var(--teal)}
.msg-tool:disabled{opacity:.5}
@media(max-width:650px){.msg-tools{gap:4px}.msg-tool-label{display:none}.msg-tool{width:38px;padding:0}}
.msg-quick-pop{position:absolute;left:0;bottom:calc(100% + 8px);z-index:50;width:min(340px,calc(100vw - 72px));max-height:min(360px,60vh);max-height:min(360px,60dvh);overflow:auto;
 background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:8px}
.msg-quick-head{font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);padding:8px 8px 4px}
.msg-quick-item{display:block;width:100%;text-align:left;border:0;background:none;border-radius:10px;padding:8px;color:var(--ink)}
.msg-quick-item:hover,.msg-quick-item:focus-visible{background:var(--mint)}
.msg-quick-item b{display:block;font-size:13px}
.msg-quick-item span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;color:var(--muted)}
.msg-quick-manage{display:block;padding:8px;font-size:12px;color:var(--teal);font-weight:800}

/* Status line under the messages */
.msg-typing{display:flex;align-items:center;gap:8px;color:var(--navy);font-weight:700}
.msg-dots{display:inline-flex;gap:3px}
.msg-dots i{width:5px;height:5px;border-radius:50%;background:var(--teal);opacity:.35;animation:msg-dot 1.2s infinite}
.msg-dots i:nth-child(2){animation-delay:.2s}.msg-dots i:nth-child(3){animation-delay:.4s}
@keyframes msg-dot{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}
@media(prefers-reduced-motion:reduce){.msg-dots i{animation:none;opacity:.7}}
.msg-receipt{display:flex;align-items:center;justify-content:flex-end;gap:4px;font-weight:700}
.msg-receipt.is-seen{color:var(--teal)}
.msg-uploading{display:flex;align-items:center;gap:6px;justify-content:flex-end;font-weight:700;color:var(--navy)}

/* Attachments in the conversation */
.msg-attachment{max-width:min(77%,320px)}
.msg-photo{display:block;border:0;padding:0;background:#edf3f1;border-radius:12px;overflow:hidden;cursor:zoom-in;max-width:100%}
.msg-photo img{display:block;width:100%;height:auto;max-height:320px;object-fit:cover}
.msg-file{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:12px;background:#edf3f1;color:var(--ink);min-width:0}
.chat-message.mine .msg-file,.chat-message.mine .msg-photo{background:#d9efe9}
.msg-file>.icon{color:var(--teal);flex:none}
/* .chat-message span (the sender line) would otherwise style the file label */
.chat-message .msg-file-text{display:grid;min-width:0;flex:1;margin:0;font-size:13px;color:var(--ink)}
.msg-file-text b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.msg-file-text small{font-size:11px;color:var(--muted)}
.msg-file:hover{background:#e2efea}
.modal.msg-photo-modal{max-width:min(960px,100%);padding:62px 16px 16px}
.msg-photo-modal img{width:100%;height:auto;max-height:calc(100vh - 160px);max-height:calc(100dvh - 160px);object-fit:contain;border-radius:10px;background:#f2f5f4}
.msg-photo-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px;min-width:0}

/* Account panels */
.msg-panel .msg-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:4px 0 14px}
.msg-panel .toggle-line{margin:8px 0}
.msg-note{display:flex;gap:9px;align-items:flex-start;background:var(--mint);color:#286e63;border-radius:12px;padding:11px 14px;font-size:13px;font-weight:700;margin:6px 0 14px}
.msg-note .icon{flex:none;margin-top:2px}
.msg-left{text-align:left}
.msg-panel .list-row{gap:12px;flex-wrap:wrap}
.msg-replies{margin:6px 0 16px}
.msg-replies .list-row{flex-wrap:nowrap}
.msg-clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.msg-count{margin-left:10px}
