/* Messages — inbox, thread, composer. */

.msg-head-row { display: flex; align-items: center; gap: 10px; }

.msg-list { list-style: none; margin: 0; padding: 0; }

.msg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(35,35,35,.9);
  cursor: pointer;
}
.msg-row:last-child { border-bottom: 0; }
.msg-row:hover .msg-who { color: var(--gold); }

.msg-row-left { min-width: 0; flex: 1; }

.msg-who { font-size: 15px; color: var(--cream); transition: color .15s; }

.msg-preview {
  margin-top: 2px;
  font-size: 13px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-row.is-unread .msg-preview { color: var(--cream); }

.msg-badge {
  min-width: 22px;
  padding: 2px 7px;
  background: var(--gold);
  border-radius: 100px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  flex-shrink: 0;
}

/* --- thread --------------------------------------------------------- */

.msg-with {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}

.msg-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px 12px;
  margin-bottom: 12px;
}

.bubble { max-width: 78%; }

/* Mine right, theirs left — the one convention nobody needs taught. */
.bubble--mine   { align-self: flex-end; }
.bubble--theirs { align-self: flex-start; }

.bubble-body {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble--mine .bubble-body {
  background: var(--gold);
  color: var(--ink);
  border-bottom-right-radius: 4px;
}
.bubble--theirs .bubble-body {
  background: var(--panel-2);
  color: var(--cream);
  border-bottom-left-radius: 4px;
}

.bubble-meta {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
}
.bubble--mine .bubble-meta { text-align: right; }

/* --- composer ------------------------------------------------------- */

.composer { display: flex; gap: 8px; align-items: flex-end; }

.composer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 140px;
  padding: 10px 12px;
  background: var(--field);
  border: 1px solid var(--panel-2);
  border-radius: var(--r);
  color: var(--cream);
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.45;
  resize: vertical;
}
.composer textarea:focus { outline: none; border-color: var(--gold); }
.composer textarea::placeholder { color: var(--dimmer); }

@media (max-width: 520px) {
  .bubble { max-width: 88%; }
  .msg-log { max-height: 340px; }
}
