:root {
  color-scheme: light;
  font-family: "Noto Sans SC", "Source Han Sans CN", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1f24;
  background: #f7f6f3;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: #f7f6f3; }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 42%) 1fr;
}

.brand-panel {
  min-height: 100vh;
  padding: clamp(32px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  color: #fff;
  background: #0f2f4e;
}

.brand-lockup, .workspace-brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.brand-name { margin: 0; font-size: 24px; font-weight: 700; }
.brand-cn { margin: 2px 0 0; color: #c5d2dc; font-size: 14px; }
.brand-message { margin: auto 0; max-width: 460px; }
.eyebrow { margin: 0 0 12px; color: #168f45; font-size: 13px; font-weight: 700; }
.brand-message .eyebrow { color: #75d897; }
.brand-message h1 { margin: 0; font-size: 40px; line-height: 1.2; }
.brand-message p:last-child { margin: 18px 0 0; color: #c5d2dc; font-size: 16px; line-height: 1.75; }
.security-state { display: flex; align-items: center; gap: 10px; color: #dce6ec; font-size: 14px; }
.security-dot { width: 9px; height: 9px; border-radius: 50%; background: #43c875; box-shadow: 0 0 0 4px rgba(67, 200, 117, .14); }

.auth-panel { display: grid; place-items: center; padding: 40px; }
.auth-box { width: min(100%, 430px); }
.mobile-brand { display: none; }
.auth-box h2 { margin: 0; color: #102638; font-size: 28px; line-height: 1.3; }
.auth-subtitle { min-height: 24px; margin: 10px 0 26px; color: #64727d; line-height: 1.5; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 24px; background: #e8ecee; border-radius: 8px; }
.auth-tab { min-height: 42px; border: 0; border-radius: 6px; color: #596874; background: transparent; font-weight: 650; }
.auth-tab.is-active { color: #0f2f4e; background: #fff; box-shadow: 0 1px 3px rgba(15, 47, 78, .12); }
.auth-tab:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(22, 163, 74, .28); outline-offset: 2px; }
form { display: flex; flex-direction: column; }
label { margin: 0 0 7px; color: #273640; font-size: 14px; font-weight: 650; }
input { width: 100%; min-height: 46px; margin-bottom: 18px; padding: 10px 12px; border: 1px solid #c9d1d5; border-radius: 7px; color: #1a1f24; background: #fff; }
input:hover { border-color: #94a1a9; }
input:focus { border-color: #168f45; outline: 3px solid rgba(22, 163, 74, .14); }
.field-hint { margin: -12px 0 16px; color: #75818a; font-size: 12px; }
.primary-button { min-height: 48px; margin-top: 4px; border: 1px solid #0f2f4e; border-radius: 7px; color: #fff; background: #0f2f4e; font-weight: 700; }
.primary-button:hover { background: #173f61; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.notice { margin: 0 0 18px; padding: 11px 12px; border-left: 3px solid #b42318; color: #842018; background: #fcecea; font-size: 14px; line-height: 1.5; }
.notice[data-type="success"] { border-color: #168f45; color: #126b31; background: #eaf7ee; }

.workspace { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 100vh; min-height: 100dvh; background: #eef1f2; }
.workspace-header { flex: 0 0 auto; height: 68px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #d9dfe2; background: #fff; }
.workspace-brand img { width: 38px; height: 38px; border-radius: 7px; }
.workspace-brand strong { color: #0f2f4e; font-size: 18px; }
.workspace-brand small { margin-left: 5px; color: #5c6972; font-weight: 500; }
.account-menu { display: flex; align-items: center; gap: 18px; color: #52606a; font-size: 14px; }
.online-state { display: inline-flex; align-items: center; gap: 7px; color: #168f45; }
.online-state > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.online-state[data-state="connecting"] { color: #7b681d; }
.online-state[data-state="connecting"] > span:first-child { background: #b79824; }
.online-state[data-state="offline"] { color: #9a3b34; }
.online-state[data-state="offline"] > span:first-child { background: #b94a42; }
.text-button { min-height: 36px; padding: 0 10px; border: 0; color: #0f2f4e; background: transparent; font-weight: 650; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Round 1 P0 修复：聊天工作区高度严格约束在可视区域内。
 * - .workspace 用 flex-column + height:100dvh(+ 100vh 回退)；
 * - 动态视口单位 100dvh 在软键盘弹起时会自动收缩，避免输入区被遮蔽；
 * - .chat-shell 改为 flex:1; min-height:0 占据剩余高度，
 *   与 .workspace-header / .vault-disabled-notice 的固定尺寸一同约束总高度；
 * - grid-template-rows 用 minmax(0, 1fr) 允许行内子项收缩到 0，
 *   这是让 .message-history 的 overflow-y:auto 起作用的关键；
 * - flex/grid 容器默认 min-content 是子项最小尺寸，会导致内部消息列表撑开父级。
 */
.chat-shell {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: #fff;
}
.conversation-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #d9dfe2; background: #f9faf9; }
.pane-heading { height: 86px; padding: 18px 20px 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pane-heading h1 { margin: 0; color: #102638; font-size: 27px; line-height: 1.1; }
.pane-eyebrow { margin: 0 0 5px; color: #168f45; font-size: 11px; font-weight: 750; }
.conversation-count { min-width: 28px; height: 28px; padding: 0 8px; display: inline-grid; place-items: center; border: 1px solid #d6dde0; border-radius: 14px; color: #52616b; background: #fff; font-size: 12px; font-weight: 700; }

/* 三标签页：联系人 / 会话 / 申请 */
.pane-tabs { min-height: 0; display: flex; gap: 0; padding: 0 16px; border-bottom: 1px solid #e2e6e8; background: #f9faf9; }
.pane-tab { min-height: 42px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #52616b; font-size: 14px; font-weight: 700; cursor: pointer; }
.pane-tab.is-active { border-bottom-color: #168f45; color: #102638; }
.pane-tab:focus-visible { outline: 2px solid #168f45; outline-offset: -2px; }
.pane-tab .tab-badge { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; margin-left: 6px; border: 1px solid #b42318; border-radius: 10px; color: #fff; background: #b42318; font-size: 12px; font-weight: 700; }
.tab-panel { min-height: 0; flex: 1; display: none; flex-direction: column; }
.tab-panel.is-active { display: flex; }
.tab-panel[hidden] { display: none; }

/* 联系人列表 */
.contacts-feedback, .requests-section-feedback { margin: 12px 16px; padding: 9px 10px; border-left: 3px solid #b42318; color: #842018; background: #fcecea; font-size: 13px; line-height: 1.45; }
.contacts-loading, .requests-section-loading { padding: 24px; display: grid; place-items: center; gap: 4px; }
.contacts-loading span, .requests-section-loading span { width: 8px; height: 8px; border-radius: 50%; background: #168f45; display: inline-block; animation: contacts-bounce 1.2s infinite ease-in-out; }
.contacts-loading span:nth-child(2), .requests-section-loading span:nth-child(2) { animation-delay: .15s; }
.contacts-loading span:nth-child(3), .requests-section-loading span:nth-child(3) { animation-delay: .30s; }
@keyframes contacts-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }
.contacts-list, .requests-list { min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; border-top: 1px solid #e2e6e8; flex: 1; }
.contacts-list li, .requests-list li { padding: 14px 16px; border-bottom: 1px solid #e2e6e8; background: #fff; cursor: pointer; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.contacts-list li:hover, .requests-list li:hover { background: #f3faf5; }
.contact-item-button { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.contact-item-avatar { width: 40px; height: 40px; border-radius: 50%; background: #e7f4ec; color: #168f45; font-weight: 800; display: grid; place-items: center; font-size: 16px; }
.contact-item-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.contact-item-name { color: #102638; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-item-username { color: #52616b; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-item-status { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; background: #eaf7ee; color: #126b31; white-space: nowrap; }
.contact-item-actions { display: flex; gap: 8px; margin-top: 6px; }
.contact-item-actions button { flex: 1; min-height: 34px; border-radius: 6px; font-weight: 650; font-size: 13px; }
.contact-item-actions button[data-action="approve"] { border: 1px solid #168f45; color: #fff; background: #168f45; }
.contact-item-actions button[data-action="reject"] { border: 1px solid #b42318; color: #b42318; background: #fff; }
.contact-item-actions button:disabled { opacity: .55; cursor: progress; }
.contact-item-status[data-status="pending"] { background: #fff8e9; color: #8a5a11; }
.contact-item-status[data-status="rejected"] { background: #fcecea; color: #842018; }
.contact-item-status[data-status="revoked"] { background: #e7eaee; color: #52616b; }
.requests-section { display: flex; flex-direction: column; flex: 1; min-height: 0; border-top: 1px solid #e2e6e8; }
.requests-section-header { padding: 10px 16px 6px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.requests-section-header h3 { margin: 0; color: #102638; font-size: 13px; font-weight: 800; text-transform: none; letter-spacing: 0; }
.requests-section-count { min-width: 22px; padding: 1px 8px; border: 1px solid #d6dde0; border-radius: 10px; color: #52616b; background: #fff; font-size: 12px; font-weight: 700; }
.requests-list { border-top: 0; }
.requests-list li { grid-template-columns: 40px 1fr; }
.requests-section-empty { padding: 14px 16px; color: #8a96a0; font-size: 13px; }
.contacts-empty, .requests-section-empty-empty { padding: 28px 16px; text-align: center; color: #52616b; }
.contacts-empty img { width: 56px; height: 56px; opacity: 0.4; margin-bottom: 8px; }
.contacts-empty h2 { margin: 0 0 6px; color: #102638; font-size: 16px; font-weight: 800; }
.contacts-empty p { margin: 0; font-size: 13px; line-height: 1.5; }
.user-search { padding: 0 16px 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.user-search input { min-width: 0; min-height: 42px; margin: 0; background: #fff; }
.user-search button { min-width: 60px; min-height: 42px; padding: 0 12px; border: 1px solid #0f2f4e; border-radius: 7px; color: #fff; background: #0f2f4e; font-weight: 700; }
.user-search button:active, .search-result button:active, .conversation-item:active { transform: translateY(1px); }
.search-feedback, .conversation-feedback { margin: 0 16px 12px; padding: 9px 10px; border-left: 3px solid #b42318; color: #842018; background: #fcecea; font-size: 13px; line-height: 1.45; }
.search-feedback[data-type="success"] { border-color: #168f45; color: #126b31; background: #eaf7ee; }
.search-result { min-height: 64px; margin: 0 16px 14px; padding: 9px 10px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; border: 1px solid #d6dde0; border-radius: 7px; background: #fff; }
.search-identity, .conversation-identity { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.search-identity strong, .conversation-identity strong { overflow: hidden; color: #20313d; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.search-identity small, .conversation-identity small { overflow: hidden; color: #6e7b84; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.search-result button { min-height: 34px; padding: 0 10px; border: 1px solid #0f2f4e; border-radius: 6px; color: #0f2f4e; background: #fff; font-size: 12px; font-weight: 700; }
.search-result button:disabled { cursor: default; border-color: #d6dde0; color: #7b878f; background: #f2f4f4; }
.avatar { width: 42px; height: 42px; flex: 0 0 auto; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: #0f2f4e; font-size: 15px; font-weight: 750; }
.conversation-list { min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; border-top: 1px solid #e2e6e8; }
.conversation-list li { border-bottom: 1px solid #e2e6e8; }
.conversation-item { width: 100%; min-height: 74px; padding: 12px 16px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 11px; border: 0; color: inherit; background: transparent; text-align: left; }
.conversation-item:hover { background: #f0f3f3; }
.conversation-item.is-selected { background: #e5edf1; box-shadow: inset 3px 0 #168f45; }
.conversation-item time { align-self: start; padding-top: 3px; color: #859098; font-size: 10px; white-space: nowrap; }
.conversation-loading { padding: 0 16px; }
.conversation-loading span { height: 68px; display: block; border-bottom: 1px solid #e2e6e8; background: linear-gradient(90deg, transparent 0%, rgba(15, 47, 78, .05) 50%, transparent 100%); background-size: 200% 100%; animation: skeleton 1.4s ease-in-out infinite; }
.conversation-empty { margin: auto 0; padding: 32px 24px; text-align: center; }
.conversation-empty img { width: 58px; height: 58px; border-radius: 8px; opacity: .82; }
.conversation-empty h2 { margin: 16px 0 5px; color: #263640; font-size: 17px; }
.conversation-empty p { margin: 0; color: #72808a; font-size: 13px; line-height: 1.5; }
.conversation-detail { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f7f6f3; }
.detail-header { height: 68px; padding: 0 22px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #dfe3e5; background: rgba(255, 255, 255, .88); }
.detail-header .avatar { width: 38px; height: 38px; }
.detail-header h2 { margin: 0; color: #20313d; font-size: 15px; }
.detail-header p { margin: 3px 0 0; color: #75818a; font-size: 11px; }
.back-button { display: none; min-height: 36px; padding: 0 8px; border: 0; color: #0f2f4e; background: transparent; font-weight: 700; }
.detail-empty { margin: auto; padding: 32px; text-align: center; }
.detail-empty img { width: 76px; height: 76px; border-radius: 8px; opacity: .72; }
.detail-empty h2, .message-empty h2 { margin: 18px 0 5px; color: #263640; font-size: 20px; }
.detail-empty p, .message-empty p { margin: 0; color: #738089; font-size: 14px; }
.selected-mark { width: 48px; height: 48px; margin: 0 auto; border: 1px solid #99b1a2; border-radius: 50%; background: radial-gradient(circle at center, #168f45 0 5px, transparent 6px); }
.detail-selected { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.message-feedback { margin: 10px 18px 0; padding: 9px 10px; border-left: 3px solid #b42318; color: #842018; background: #fcecea; font-size: 13px; }
.message-history { min-height: 0; flex: 1; overflow-y: auto; padding: 18px clamp(16px, 4vw, 52px); }
.load-older-messages { min-height: 34px; margin: 0 auto 16px; padding: 0 12px; display: block; border: 1px solid #c9d2d6; border-radius: 7px; color: #42535e; background: #fff; font-size: 12px; font-weight: 650; }
.message-loading { max-width: 520px; margin: auto; }
.message-loading span { width: 58%; height: 46px; margin: 12px 0; display: block; border-radius: 7px; background: #e8ecee; }
.message-loading span:nth-child(2) { margin-left: auto; background: #dce8ee; }
.message-loading span:nth-child(3) { width: 42%; }
.message-list { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; list-style: none; }
.message-row { max-width: min(72%, 620px); align-self: flex-start; display: flex; flex-direction: column; align-items: flex-start; }
.message-row.is-own { align-self: flex-end; align-items: flex-end; }
.message-bubble { padding: 9px 12px; border: 1px solid #d9dfe2; border-radius: 8px 8px 8px 2px; color: #24343e; background: #fff; line-height: 1.48; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-row.is-own .message-bubble { border-color: #1d5f99; border-radius: 8px 8px 2px 8px; color: #fff; background: #1d5f99; }
.message-row.is-sending { opacity: .68; }
.message-row.is-failed .message-bubble { border-color: #c9827d; }
.message-meta { min-height: 18px; margin-top: 3px; display: flex; align-items: center; gap: 7px; color: #7b878f; font-size: 10px; }
.message-row.is-own .message-meta { color: rgba(255, 255, 255, .78); }
.message-state[data-state="failed"] { color: #a43730; }
.message-row.is-own .message-state[data-state="failed"], .message-row.is-own .retry-message { color: #fff; }
.retry-message { padding: 0; border: 0; color: #8d302a; background: transparent; font-size: 10px; font-weight: 700; text-decoration: underline; }
.message-empty { min-height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; }
.message-form { min-height: 70px; padding: 10px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; border-top: 1px solid #d9dfe2; background: #fff; }
.message-form textarea { width: 100%; min-height: 44px; max-height: 112px; margin: 0; padding: 10px 12px; resize: none; border: 1px solid #c9d1d5; border-radius: 7px; color: #1a1f24; background: #fff; font: inherit; line-height: 1.4; }
.message-form textarea:focus { border-color: #168f45; outline: 3px solid rgba(22, 163, 74, .14); }
.message-form button { min-width: 64px; height: 44px; border: 1px solid #0f2f4e; border-radius: 7px; color: #fff; background: #0f2f4e; font-weight: 700; }
.message-form button:disabled { cursor: default; opacity: .45; }

@keyframes skeleton { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (max-width: 760px) {
  .auth-layout { display: block; min-height: 100vh; }
  .brand-panel { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px 22px 40px; place-items: start center; }
  .auth-box { max-width: 480px; }
  .mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 44px; color: #0f2f4e; font-size: 19px; font-weight: 750; }
  .mobile-brand img { width: 46px; height: 46px; border-radius: 8px; }
  .mobile-brand small { margin-left: 4px; color: #697781; font-size: 13px; font-weight: 500; }
  .auth-box h2 { font-size: 25px; }
  .workspace-header { flex: 0 0 auto; height: auto; min-height: 64px; padding: 10px 16px; }
  .workspace-brand strong { font-size: 16px; }
  .workspace-brand small, #current-user { display: none; }
  .chat-shell { display: block; flex: 1 1 auto; min-height: 0; }
  .conversation-pane, .conversation-detail { width: 100%; height: 100%; border: 0; min-height: 0; }
  .conversation-detail { display: none; }
  .chat-shell.is-detail-open .conversation-pane { display: none; }
  .chat-shell.is-detail-open .conversation-detail { display: flex; }
  .back-button { display: inline-flex; align-items: center; }
  .pane-heading { height: 78px; }
  .conversation-item { min-height: 76px; }
  .detail-header { padding: 0 10px; }
  .message-history { padding: 14px 12px; }
  .message-row { max-width: 84%; }
  .message-form { padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; }
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #0f2f4e;
  background: #eef1f2;
  font-weight: 650;
  font-size: 14px;
}
.icon-button:hover { background: #e1e6e9; }
.icon-button.has-pending {
  color: #fff;
  background: #b42318;
  border-color: #8c1b13;
}
.icon-button .badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #fff;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-status {
  padding: 6px 12px;
  border-radius: 999px;
  color: #126b31;
  background: #eaf7ee;
  font-size: 13px;
  font-weight: 600;
}

.contact-requests-panel {
  position: fixed;
  top: 68px;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  background: #fff;
  border-left: 1px solid #d9dfe2;
  box-shadow: -10px 0 30px rgba(15, 47, 78, .08);
  z-index: 30;
}
.contact-requests-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.contact-requests-header h2 { margin: 0; font-size: 18px; color: #0f2f4e; }
.contact-requests-feedback {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-left: 3px solid #b42318;
  color: #842018;
  background: #fcecea;
  font-size: 13px;
}
.contact-requests-empty {
  margin: auto;
  color: #75818a;
  font-size: 14px;
  text-align: center;
}
.contact-requests-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.contact-request-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e3e7e9;
  border-radius: 10px;
  background: #fbfcfb;
}
.contact-request-identity { display: flex; align-items: center; gap: 12px; }
.contact-request-identity strong { display: block; color: #0f2f4e; }
.contact-request-identity small { color: #75818a; font-size: 12px; }
.contact-request-message {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: #1a1f24;
  background: #f1f4f5;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.contact-request-actions { display: flex; gap: 8px; }
.contact-request-actions button {
  flex: 1;
  min-height: 36px;
  border-radius: 7px;
  font-weight: 650;
}
.contact-request-actions button[data-action="approve"] {
  border: 1px solid #168f45;
  color: #fff;
  background: #168f45;
}
.contact-request-actions button[data-action="reject"] {
  border: 1px solid #b42318;
  color: #b42318;
  background: #fff;
}

.contact-modal {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  box-shadow: 0 24px 48px rgba(15, 47, 78, .24);
  color: #1a1f24;
  background: #fff;
}
.contact-modal::backdrop { background: rgba(15, 47, 78, .42); }
.contact-modal form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px 20px;
}
.contact-modal h2 { margin: 0; color: #0f2f4e; font-size: 20px; }
.contact-modal-target { margin: 0; color: #52606a; font-size: 14px; line-height: 1.5; }
.contact-modal-target strong { color: #0f2f4e; margin-right: 6px; }
.contact-modal-username { color: #75818a; font-size: 13px; }
.contact-modal textarea {
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid #c9d1d5;
  border-radius: 7px;
  font: inherit;
  resize: vertical;
}
.contact-modal textarea:focus {
  border-color: #168f45;
  outline: 3px solid rgba(22, 163, 74, .14);
}
.contact-modal-feedback {
  padding: 10px 12px;
  border-left: 3px solid #b42318;
  color: #842018;
  background: #fcecea;
  font-size: 13px;
}
.contact-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-modal-actions button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 7px;
  font-weight: 650;
}
.contact-modal-actions #contact-modal-cancel {
  border: 1px solid #c9d1d5;
  color: #52606a;
  background: #fff;
}
.contact-modal-actions button[type="submit"] {
  border: 1px solid #0f2f4e;
  color: #fff;
  background: #0f2f4e;
}
.contact-modal-actions button[type="submit"]:hover { background: #173f61; }

@media (max-width: 640px) {
  .contact-requests-panel {
    top: 68px;
    left: 0;
    width: 100vw;
    border-left: 0;
  }
  .icon-button span:first-child { display: none; }
}

.vault-gate {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(15, 47, 78, .22);
  z-index: 40;
}
.vault-gate header h2 { margin: 0 0 8px; color: #0f2f4e; font-size: 20px; }
.vault-gate-help { margin: 0 0 16px; color: #52606a; font-size: 14px; line-height: 1.6; }
.vault-feedback {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 3px solid #b42318;
  color: #842018;
  background: #fcecea;
  font-size: 13px;
}
.vault-feedback[data-type="success"] {
  border-color: #168f45;
  color: #126b31;
  background: #eaf7ee;
}
.vault-panel {
  padding: 14px 0;
  border-top: 1px solid #e3e7e9;
}
.vault-panel:first-of-type { border-top: 0; padding-top: 0; }
.vault-panel h3 { margin: 0 0 8px; color: #0f2f4e; font-size: 16px; }
.vault-help { margin: 0 0 12px; color: #52606a; font-size: 13px; line-height: 1.5; }
.vault-warning { color: #842018; }
.vault-panel input { width: 100%; min-height: 44px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid #c9d1d5; border-radius: 7px; font: inherit; }
.vault-panel input:focus { border-color: #168f45; outline: 3px solid rgba(22, 163, 74, .14); }
.vault-panel label { display: block; margin-bottom: 4px; color: #273640; font-size: 13px; font-weight: 650; }
.vault-panel .primary-button { width: 100%; min-height: 44px; border: 1px solid #0f2f4e; border-radius: 7px; color: #fff; background: #0f2f4e; font-weight: 700; }
.vault-panel .danger-button { width: 100%; min-height: 44px; border: 1px solid #b42318; border-radius: 7px; color: #fff; background: #b42318; font-weight: 700; }
.retention-controls select { width: 100%; min-height: 44px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid #c9d1d5; border-radius: 7px; font: inherit; }
.retention-controls input[type="number"] { width: 100%; min-height: 44px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid #c9d1d5; border-radius: 7px; font: inherit; }
.delete-conversation-bar { padding: 8px 16px; border-top: 1px solid #e2e2e2; text-align: center; }
.delete-conversation-bar .danger-button,
.delete-conversation-bar .primary-button { width: auto; min-height: 36px; padding: 6px 18px; margin: 0 4px; }
.delete-conversation-bar .burn-help { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid #0f2f4e; background: rgba(15, 47, 78, .06); color: #20313d; font-size: 12px; line-height: 1.5; }
.message-delete-btn { margin-left: 8px; padding: 2px 8px; border: 1px solid #d0d0d0; border-radius: 4px; background: transparent; color: #888; font-size: 11px; cursor: pointer; }
.message-delete-btn:hover { border-color: #b42318; color: #b42318; }
.multi-select-bar { padding: 8px 16px; border-top: 1px solid #e2e2e2; display: flex; align-items: center; gap: 8px; }
.multi-select-count { font-size: 13px; color: #555; }
.multi-select-bar button { min-height: 32px; padding: 4px 12px; }
.message-row.is-selected { background-color: rgba(15, 47, 78, 0.08); }
.message-row .message-checkbox { margin-right: 8px; cursor: pointer; }
.detail-header .detail-more-button { margin-left: auto; min-height: 32px; padding: 4px 12px; font-size: 13px; }
.detail-header .detail-more-button:disabled,
.release-contact-confirm-submit:disabled { opacity: .55; cursor: progress; }
.release-contact-confirm .release-contact-confirm-warning { padding: 8px 12px; border-left: 3px solid #b42318; background: rgba(180, 35, 24, .06); color: #5a1a14; font-size: 13px; line-height: 1.5; }
.release-contact-confirm .contact-modal-actions { display: flex; gap: 12px; justify-content: flex-end; padding: 12px 0 0; }
