/* Napeeto — messaging (agency ↔ Napeeto ↔ property) */

.chat {
  display: grid; grid-template-columns: 300px 1fr;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--panel); height: calc(100vh - 210px); min-height: 440px;
}
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-list .ct { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.chat-list .ct:hover { background: var(--panel-2); }
.chat-list .ct.active { background: var(--nav-active-bg); }
.chat-list .ct-sub { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; }
.chat-list .ct-sub .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-left: 0.45rem; flex: none; }
.chat-list .ct-last { font-size: 11.5px; color: var(--ink-soft); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list .ct-meta { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--ink-faint); margin-top: 4px; display: flex; justify-content: space-between; gap: 0.5rem; }
.chat-list .ct-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list .ct-meta span:last-child { flex: none; }

.chat-conv { display: flex; flex-direction: column; min-width: 0; }
.chat-conv > header { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
.chat-conv > header h3 { font-size: 0.98rem; }
.chat-conv > header .who { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.chat-back { display: none; margin-bottom: 0.55rem; }

.chat-log { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.msg { max-width: 78%; }
.msg .m-who { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--ink-faint); margin-bottom: 3px; letter-spacing: 0.03em; }
.msg .m-body { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 11px; border-top-left-radius: 3px; padding: 0.55rem 0.8rem; font-size: 13px; line-height: 1.5; }
.msg .m-ts { font-family: "IBM Plex Mono", monospace; font-size: 9.5px; color: var(--ink-faint); margin-top: 4px; }
.msg.me { align-self: flex-end; text-align: right; }
.msg.me .m-body { background: color-mix(in srgb, var(--teal) 15%, var(--panel)); border-color: color-mix(in srgb, var(--teal) 28%, var(--line-soft)); border-radius: 11px; border-top-right-radius: 3px; text-align: left; }

.chat-compose { border-top: 1px solid var(--line-soft); padding: 0.7rem; display: flex; gap: 0.5rem; align-items: flex-end; }
.chat-compose textarea {
  flex: 1; resize: none; font: inherit; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.7rem;
  background: var(--panel); color: var(--ink); min-height: 40px; max-height: 120px; overflow-y: auto;
}
.chat-compose textarea:focus { outline: 2px solid color-mix(in srgb, var(--teal) 45%, transparent); outline-offset: 1px; border-color: transparent; }

.chat-empty { flex: 1; display: grid; place-items: center; color: var(--ink-faint); font-size: 13px; padding: 2rem; text-align: center; }

@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 180px); }
  .chat-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .chat.viewing .chat-list { display: none; }
  .chat:not(.viewing) .chat-conv { display: none; }
  .chat-back { display: inline-flex; }
}
