/* Inbox, compact email notes, not a full-screen chat */

.msg-page {
  background: var(--ed-paper, #f8fafc);
  min-height: calc(100vh - 60px);
}

.msg-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.msg-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.msg-page-head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ed-ink, #0f172a);
}

.msg-help {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #64748b;
}

.msg-shell {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 0;
  background: #fff;
  border: 1px solid var(--ed-line, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  min-height: 0;
}

.msg-sidebar,
.msg-chat {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.msg-sidebar {
  border-right: 1px solid var(--ed-line, #e2e8f0);
  background: #f8fafc;
}

.msg-side-head,
.msg-chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--ed-line, #e2e8f0);
  background: #fff;
}

.msg-side-head h2,
.msg-chat-head h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.msg-chat-head h2 {
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ed-ink, #0f172a);
}

.msg-thread-sub {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

.msg-side-head .ed-action,
.msg-chat-head .ed-action {
  min-height: 32px;
  font-size: 0.78rem;
}

.msg-conversation-list,
.msg-conversation-list.conversation-list,
.conversation-list.msg-conversation-list {
  flex: 1;
  min-height: 0;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  height: auto !important;
}

.msg-messages,
.msg-messages.messages-container,
.messages-container.msg-messages {
  flex: 1;
  min-height: 200px;
  max-height: 360px;
  overflow-y: auto;
  height: auto !important;
  padding: 0.85rem 1rem;
  background: #fff;
}

.msg-conversation-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--ed-line, #e2e8f0);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.msg-conversation-item:hover {
  background: #fff;
}

.msg-conversation-item.active {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--ed-blue, #2563eb);
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.msg-conversation-copy {
  min-width: 0;
  flex: 1;
}

.msg-conversation-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.msg-conversation-name {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-conversation-date {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: #94a3b8;
}

.msg-conversation-preview {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-empty,
.msg-how {
  padding: 1.5rem 1.1rem;
  text-align: center;
  color: #64748b;
}

.msg-empty i,
.msg-how i {
  color: #cbd5e1;
  margin-bottom: 0.65rem;
}

.msg-empty h5,
.msg-how h5 {
  margin: 0 0 0.35rem;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 700;
}

.msg-how p,
.msg-empty p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #64748b;
}

.msg-note {
  padding: 0.7rem 0.15rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}

.msg-note:last-child {
  border-bottom: 0;
}

.msg-note-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.msg-note-who {
  font-size: 0.8rem;
  font-weight: 750;
  color: #0f172a;
}

.msg-note.is-mine .msg-note-who {
  color: #2563eb;
}

.msg-note-time {
  font-size: 0.7rem;
  color: #94a3b8;
}

.msg-note-body {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #1e293b;
  white-space: pre-wrap;
}

.msg-composer {
  flex: 0 0 auto;
  border-top: 1px solid var(--ed-line, #e2e8f0);
  padding: 0.75rem 0.9rem 0.9rem;
  background: #f8fafc;
}

.msg-composer label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.4rem;
}

.msg-composer textarea {
  border: 1px solid var(--ed-line, #e2e8f0) !important;
  border-radius: 10px !important;
  resize: vertical;
  min-height: 72px;
  max-height: 160px;
  box-shadow: none !important;
  background: #fff !important;
}

.msg-composer-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.msg-composer .btn,
.msg-composer .ed-action.is-primary {
  border-radius: 10px !important;
  background: var(--ed-blue, #2563eb) !important;
  border-color: var(--ed-blue, #2563eb) !important;
  color: #fff !important;
  min-height: 36px;
  padding: 0.4rem 0.95rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .msg-page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .msg-shell {
    grid-template-columns: 1fr;
  }

  .msg-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--ed-line, #e2e8f0);
  }

  .msg-conversation-list {
    max-height: 200px;
  }

  .msg-messages {
    max-height: 280px;
    min-height: 160px;
  }

  .msg-composer textarea {
    font-size: 16px;
  }

  .msg-composer .btn,
  .msg-composer .ed-action.is-primary {
    min-height: 44px;
    width: 100%;
  }
}
