/* 訊息頁（批 2b）——對話清單 + 系統訊息；氣泡色跟 app chat 主題 */

.msg-tabs {
  display: flex; gap: 6px; background: #fff; border-radius: 10px;
  padding: 4px; margin-bottom: 12px; border: 1px solid var(--divider);
}
.msg-tabs button {
  flex: 1; font: inherit; font-size: 14px; padding: 9px 0;
  background: none; border: 0; border-radius: 8px;
  color: var(--text-secondary); cursor: pointer;
}
.msg-tabs button[aria-selected="true"] {
  background: var(--brand-blue, #0056B3); color: #fff; font-weight: 700;
}

.msg-list { display: flex; flex-direction: column; gap: 8px; }

/* 對話列 */
.conv {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff; border-radius: 12px; padding: 10px 12px;
  text-decoration: none; color: inherit;
}
.conv img, .conv .ph {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  background: var(--bg-light, #F0F2F5); flex: 0 0 auto;
}
.conv .mid { flex: 1; min-width: 0; }
.conv .who { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.conv .prop { font-size: 12px; color: var(--brand-blue, #0056B3); margin-top: 2px; }
.conv .last {
  font-size: 13px; color: var(--text-secondary); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv .right { flex: 0 0 auto; text-align: right; }
.conv .when { font-size: 11px; color: var(--text-tertiary); }
.conv .badge {
  display: inline-block; min-width: 18px; margin-top: 6px;
  background: #D93025; color: #fff; border-radius: 9px;
  font-size: 11px; font-weight: 700; line-height: 18px; padding: 0 5px;
}

/* 系統訊息列 */
.sysmsg {
  background: #fff; border-radius: 12px; padding: 12px;
  display: block; text-decoration: none; color: inherit; position: relative;
}
.sysmsg .t { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.sysmsg .c {
  font-size: 13px; color: var(--text-secondary); margin-top: 6px;
  white-space: pre-wrap; line-height: 1.6;
}
.sysmsg .d { font-size: 11px; color: var(--text-tertiary); margin-top: 8px; }
.sysmsg .go { font-size: 12px; color: var(--brand-blue, #0056B3); margin-top: 6px; }
.sysmsg.unread { border-left: 3px solid var(--red, #FF8000); }
.sysmsg .dot {
  position: absolute; top: 12px; right: 12px;
  width: 8px; height: 8px; border-radius: 4px; background: #D93025;
}

/* 對話頁（chat.html） */
.chat-main { max-width: 640px; margin: 0 auto; padding: 12px 12px 84px; }
.chat-prop {
  display: flex; gap: 10px; align-items: center; background: #fff;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
  text-decoration: none; color: inherit;
}
.chat-prop img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.chat-prop .pt { font-size: 14px; font-weight: 700; }
.chat-prop .pp { font-size: 13px; color: var(--red, #FF8000); margin-top: 2px; }
.bubbles { display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 78%; padding: 9px 12px; border-radius: 14px;
  font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.bubble.mine { align-self: flex-end; background: var(--brand-blue, #0056B3); color: #fff; border-bottom-right-radius: 4px; }
.bubble.other { align-self: flex-start; background: #fff; color: var(--text-primary); border-bottom-left-radius: 4px; }
.bubble .ts { display: block; font-size: 10px; opacity: .7; margin-top: 4px; }
.composer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 25;
  display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--divider);
}
.composer input {
  flex: 1; font: inherit; font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--divider); border-radius: 20px; outline: none;
}
.composer button {
  font: inherit; font-size: 15px; font-weight: 700; color: #fff;
  background: var(--brand-blue, #0056B3); border: 0; border-radius: 20px;
  padding: 0 18px; cursor: pointer;
}
.composer button[disabled] { opacity: .5; cursor: default; }
/* 私訊 Tier-0 預檢（app ChatTextGuard 鏡像）：擋／提示都喺輸入框上面出，唔會靜靜失敗 */
.guard-note {
  position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 26;
  margin: 0 12px; padding: 10px 12px; border-radius: 10px;
  font-size: 13px; line-height: 1.6;
  background: #fff; border: 1px solid var(--divider); box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.guard-note.block { background: #FFF3F3; border-color: #E53935; color: #B71C1C; }
.guard-note.warn { background: #FFF8EE; border-color: #FF8000; color: #A95100; }
.guard-note[hidden] { display: none; }
/* 對話列／系統訊息列嘅小修正：span 要當 block 排版 */
.conv .mid > span { display: block; }
.conv .right > span { display: inline-block; }
.sysmsg .t, .sysmsg .c, .sysmsg .d, .sysmsg .go { display: block; }
