/* messages.css */
.right-panel {
  width: 290px; flex-shrink: 0;
  background: var(--bg1); border-left: 1px solid var(--border);
  display: none; flex-direction: column; overflow: hidden;
}
.right-panel.open { display: flex; }
.rp-head { padding: 14px 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.rp-title { font-size: 15px; font-weight: 800; }
.rp-close { width: 26px; height: 26px; border-radius: 50%; background: var(--bg3); border: none; cursor: pointer; font-size: 12px; color: var(--text); display: flex; align-items: center; justify-content: center; }
.dm-list { flex: 1; overflow-y: auto; }
.dmi { display: flex; align-items: center; gap: 10px; padding: 10px 13px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.12s; }
.dmi:hover { background: var(--bg2); }
.dmi.unread { background: rgba(123,94,167,0.06); }
.dmi-av { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; position: relative; }
.dmi-av img { width: 100%; height: 100%; object-fit: cover; }
.dm-on { position: absolute; bottom: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg1); }
.dmi-info { flex: 1; min-width: 0; }
.dmi-name { font-size: 13px; font-weight: 700; }
.dmi-prev { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmi-meta { text-align: right; flex-shrink: 0; }
.dmi-time { font-family: var(--font-mono); font-size: 9px; color: var(--text3); }
.dmi-unread-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); font-size: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; margin: 4px 0 0 auto; }
.chat-view { display: none; flex-direction: column; height: 100%; }
.chat-view.open { display: flex; }
.chat-head { padding: 11px 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.chat-back { width: 26px; height: 26px; border-radius: 50%; background: var(--bg3); border: none; cursor: pointer; font-size: 12px; color: var(--text); display: flex; align-items: center; justify-content: center; }
.chat-av { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.chat-name { font-size: 14px; font-weight: 700; }
.chat-status { font-size: 11px; color: var(--green); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.chat-msgs::-webkit-scrollbar { width: 3px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.msg.theirs { background: var(--bg2); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 3px; }
.msg.mine { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.msg-t { font-family: var(--font-mono); font-size: 9px; color: var(--text3); margin-top: 3px; }
.msg-t.r { text-align: right; }
.chat-inp-row { padding: 9px 11px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.chat-field { flex: 1; padding: 9px 12px; border-radius: 20px; border: 1px solid var(--border2); background: var(--bg0); font-size: 13px; color: var(--text); outline: none; }
.chat-field:focus { border-color: var(--accent2); }
.chat-send { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); border: none; color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: background 0.15s; cursor: pointer; }
.chat-send:hover { background: var(--accent2); }
