/* ── MESSAGES ── */
.messages-header { padding: 16px 20px 12px; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.convo-list { display: flex; flex-direction: column; }
.convo-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; cursor: pointer; transition: background 0.1s; border-bottom: 1px solid var(--border); }
.convo-item:hover { background: var(--bg); }
.convo-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; font-family: var(--font-body); color: #fff; }
.convo-body { flex: 1; min-width: 0; }
.convo-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.convo-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.convo-name.bold { font-weight: 700; }
.convo-time { font-size: 11px; color: var(--ink-faint); }
.convo-route { font-size: 11px; color: var(--accent-mid); font-weight: 500; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-preview { font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-pill { width: 17px; height: 17px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── CHAT VIEW ── */
#chat-view {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: calc(var(--bottom) + var(--safe-bottom));
  z-index: 50;
  background: var(--bg); display: none; flex-direction: column;
}
#chat-view.open { display: flex; }
.chat-header { height: var(--nav); flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.back-btn { width: 30px; height: 30px; border-radius: 5px; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; color: var(--ink-mid); transition: background 0.12s; flex-shrink: 0; }
.back-btn:hover { background: var(--surface2); }
.chat-header-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.chat-header-route { font-size: 11px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-route-banner { background: var(--accent-light); border-bottom: 1px solid rgba(26,58,92,0.09); padding: 8px 16px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.banner-text { font-size: 11px; color: var(--accent-mid); font-weight: 500; line-height: 1.4; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-messages::-webkit-scrollbar { width: 2px; }
.msg { display: flex; flex-direction: column; max-width: 74%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.msg-bubble { padding: 9px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.msg.mine .msg-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
.msg.theirs .msg-bubble { background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.msg-time { font-size: 10px; color: var(--ink-faint); margin-top: 3px; padding: 0 2px; }
.chat-input-bar { flex-shrink: 0; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface); display: flex; align-items: flex-end; gap: 8px; }
.chat-input { flex: 1; min-height: 36px; max-height: 110px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-family: var(--font-body); font-size: 14px; color: var(--ink); outline: none; resize: none; line-height: 1.4; }
.chat-input:focus { border-color: var(--accent-mid); background: var(--surface); }
.send-btn { width: 36px; height: 36px; border-radius: 6px; background: var(--accent); color: #fff; border: none; display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; flex-shrink: 0; transition: background 0.12s; }
.send-btn:hover { background: var(--accent-dark); }
.send-btn:active { transform: scale(0.92); }

