/* ===== 메신저 ===== */
.ms-app {
  display: flex;
  height: 100%;
  background: #fff;
}

.ms-sidebar {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e3e3e3;
  background: #f7f8fa;
  min-width: 0;
}

.ms-me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e3e3e3;
  font-weight: 600;
  font-size: 13px;
}

.ms-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #8fa3b7;
  color: #fff;
  font-size: 14px;
  flex: 0 0 auto;
}

.ms-avatar-me {
  background: linear-gradient(135deg, #4a7fc1, #8fc3ff);
}

.ms-me-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ms-me-sub {
  font-size: 11px;
  font-weight: 400;
  color: #8e8e93;
}

.ms-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.ms-threads {
  flex: 1 1 auto;
  overflow-y: auto;
}

.ms-thread {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: default;
}

.ms-thread:hover {
  background: #eceff3;
}

.ms-thread.is-active {
  background: #dfe8f3;
}

.ms-thread-body {
  flex: 1 1 auto;
  min-width: 0;
}

.ms-thread-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ms-thread-name {
  font-size: 13px;
  font-weight: 600;
}

.ms-thread-time {
  font-size: 11px;
  color: #888;
  flex: 0 0 auto;
}

.ms-thread-snippet {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e81123;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  flex: 0 0 auto;
}

.ms-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #e9ecef;
}

.ms-header {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  background: #3b4a5a;
  color: #fff;
}

.ms-header-name {
  font-size: 15px;
  font-weight: 600;
}

.ms-header-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.ms-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ms-date {
  align-self: center;
  padding: 3px 12px;
  border-radius: 12px;
  background: #d7dce2;
  color: #555;
  font-size: 11px;
  margin: 6px 0;
}

.ms-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 78%;
}

.ms-msg-them {
  align-self: flex-start;
}

.ms-msg-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ms-msg-body {
  min-width: 0;
}

.ms-msg-sender {
  font-size: 11px;
  color: #555;
  margin: 0 0 3px 4px;
}

.ms-msg-team {
  margin-left: 4px;
  color: #8a9099;
}

.ms-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  background: #fff;
  color: #222;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: anywhere;
  user-select: text;
}

.ms-msg-me .ms-bubble {
  background: #ffe14d;
}

.ms-msg-time {
  font-size: 10px;
  color: #777;
  flex: 0 0 auto;
  white-space: nowrap;
}

.ms-compose {
  flex: 0 0 auto;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e3e3e3;
}

.ms-input {
  width: 100%;
  height: 32px;
  border-radius: 16px;
  border: 1px solid #e0e0e0;
  background: #f1f3f5;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
}

.win--messenger .win-titlebar {
  background: #3b4a5a;
  color: #fff;
  border-bottom: none;
}

.win--messenger:not(.is-active) .win-titlebar {
  background: #56657a;
  color: rgba(255, 255, 255, 0.85);
}

.win--messenger .win-ctrl:hover {
  background: rgba(255, 255, 255, 0.15);
}

.win--messenger .win-ctrl-close:hover {
  background: #e81123;
}

@media (max-width: 720px) {
  .ms-sidebar { flex-basis: 100px; }
  .ms-thread-snippet, .ms-thread-time, .ms-me-name { display: none; }
}

.ms-placeholder {
  margin: auto;
  text-align: center;
  color: #8e8e93;
  font-size: 13px;
}
.ms-placeholder-icon svg { width: 48px; height: 48px; margin: 0 auto 10px; opacity: 0.5; }

/* 후일담 선택 단추 (js/followups.js) */
.ms-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ms-choice {
  border: 1px solid var(--accent, #2f6fde); background: #fff; color: var(--accent, #2f6fde);
  border-radius: 14px; padding: 5px 12px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.ms-choice:hover { background: var(--accent, #2f6fde); color: #fff; }
.ms-choice-done { font-size: 11px; color: #777; }
