/* VantaChat UI Preview — tech-protect blue brand */

:root {
  --vanta-blue: #2b6cff;
  --vanta-blue-dark: #1e5ae8;
  --vanta-blue-deep: #0f3db8;
  --vanta-blue-soft: #e8f0ff;
  --self-bubble: #a8c8ff;
  --peer-bubble: #ffffff;
  --bg: #e8eef8;
  --bg-list: #f5f7fb;
  --bar: #f5f7fb;
  --border: #e2e8f0;
  --text: #191919;
  --text-secondary: #888888;
  --text-hint: #b2b2b2;
  --unread: #fa5151;
  --safety: #1e5ae8;
  --safety-bg: #e8f0ff;
  --safety-border: rgba(43, 108, 255, 0.35);
  --shell-max: 390px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(160deg, #0a1628 0%, #12233f 40%, #0d1f4a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 16px;
  -webkit-font-smoothing: antialiased;
}

/* —— Phone shell —— */
.phone-shell {
  width: 100%;
  max-width: 420px;
  height: min(880px, calc(100vh - 24px));
  background: var(--bg-list);
  border-radius: 24px;
  box-shadow:
    0 0 0 3px #1a2744,
    0 0 0 6px #2a3a5c,
    0 24px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Status bar */
.status-bar {
  flex: 0 0 28px;
  background: var(--bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  z-index: 5;
  letter-spacing: 0.02em;
}

.page-splash .status-bar,
.page-login ~ .status-bar {
  /* status bar sits outside pages */
}

.phone-shell:has(.page-splash.active) .status-bar,
.phone-shell:has(.page-login.active) .status-bar,
.phone-shell:has(.page-auth.active) .status-bar,
.phone-shell:has(.page-register.active) .status-bar {
  background: transparent;
  color: #fff;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.phone-shell:has(.page-splash.active) .status-icons .sig,
.phone-shell:has(.page-splash.active) .status-icons .bat,
.phone-shell:has(.page-login.active) .status-icons .sig,
.phone-shell:has(.page-login.active) .status-icons .bat,
.phone-shell:has(.page-auth.active) .status-icons .sig,
.phone-shell:has(.page-auth.active) .status-icons .bat,
.phone-shell:has(.page-register.active) .status-icons .sig,
.phone-shell:has(.page-register.active) .status-icons .bat {
  background: #fff;
}

.phone-shell:has(.page-splash.active) .status-icons .wifi,
.phone-shell:has(.page-login.active) .status-icons .wifi,
.phone-shell:has(.page-auth.active) .status-icons .wifi,
.phone-shell:has(.page-register.active) .status-icons .wifi {
  border-color: #fff;
}

.phone-shell:has(.page-splash.active) .status-icons .wifi::after,
.phone-shell:has(.page-login.active) .status-icons .wifi::after,
.phone-shell:has(.page-auth.active) .status-icons .wifi::after,
.phone-shell:has(.page-register.active) .status-icons .wifi::after {
  background: #fff;
}

.phone-shell:has(.page-splash.active) .status-icons .bat::before,
.phone-shell:has(.page-login.active) .status-icons .bat::before,
.phone-shell:has(.page-auth.active) .status-icons .bat::before,
.phone-shell:has(.page-register.active) .status-icons .bat::before {
  background: #fff;
}

.phone-shell:has(.page-splash.active) .status-icons .bat::after,
.phone-shell:has(.page-login.active) .status-icons .bat::after,
.phone-shell:has(.page-auth.active) .status-icons .bat::after,
.phone-shell:has(.page-register.active) .status-icons .bat::after {
  background: #fff;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-icons .sig,
.status-icons .wifi,
.status-icons .bat {
  display: inline-block;
  background: var(--text);
  opacity: 0.85;
}

.status-icons .sig {
  width: 14px;
  height: 10px;
  clip-path: polygon(0 100%, 20% 70%, 20% 100%, 40% 50%, 40% 100%, 60% 30%, 60% 100%, 80% 10%, 80% 100%, 100% 0, 100% 100%, 0 100%);
}

.status-icons .wifi {
  width: 12px;
  height: 10px;
  border-radius: 50% 50% 0 0;
  background: transparent;
  border: 2px solid var(--text);
  border-bottom: none;
  position: relative;
}

.status-icons .wifi::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text);
}

.status-icons .bat {
  width: 20px;
  height: 10px;
  border-radius: 2px;
  border: 1.5px solid var(--text);
  background: transparent;
  position: relative;
}

.status-icons .bat::before {
  content: "";
  position: absolute;
  inset: 1.5px 3px 1.5px 1.5px;
  background: var(--vanta-blue);
  border-radius: 1px;
}

.status-icons .bat::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: var(--text);
  border-radius: 0 1px 1px 0;
}

/* Pages */
.page {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-list);
}

.page.active {
  display: flex;
}

.page[hidden] {
  display: none !important;
}

/* —— Splash —— */
.page-splash {
  background: linear-gradient(165deg, #2b6cff 0%, #1e5ae8 45%, #0f3db8 100%);
  align-items: center;
  justify-content: center;
  position: relative;
}

.splash-hit {
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 24px;
  width: 100%;
  height: 100%;
  justify-content: center;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.splash-logo {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  object-fit: cover;
}

.splash-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}

.splash-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.06em;
}

.splash-tap {
  margin-top: 28px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  animation: splashPulse 1.6s ease-in-out infinite;
}

@keyframes splashPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.85; }
}

/* —— Login —— */
.page-login {
  background: linear-gradient(180deg, #1a3a8a 0%, #f5f7fb 42%);
  align-items: center;
  justify-content: flex-start;
  padding: 48px 24px 24px;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 320px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(30, 90, 232, 0.35);
  object-fit: cover;
  margin-bottom: 14px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 28px;
}

.login-form {
  width: 100%;
  background: #fff;
  border-radius: 14px;
  padding: 20px 18px 18px;
  box-shadow: 0 8px 28px rgba(15, 61, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.login-field input {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input:focus {
  border-color: var(--vanta-blue);
  box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.15);
  background: #fff;
}

.login-error {
  font-size: 12px;
  color: var(--unread);
  margin: -4px 0 0;
}

.login-btn {
  height: 44px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2b6cff, #1e5ae8);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(43, 108, 255, 0.35);
  transition: opacity 0.15s, transform 0.1s;
}

.login-btn:active {
  transform: scale(0.98);
  opacity: 0.92;
}

/* Top bar */
.top-bar {
  flex: 0 0 auto;
  position: relative;
  overflow: visible;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 7px 10px 8px 16px;
  background: var(--bar);
  border-bottom: 0;
  gap: 8px;
}

.top-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  flex: 1;
}

.page-list .top-bar {
  overflow: visible;
  justify-content: flex-start;
  gap: 9px;
}

.page-list .top-title {
  flex: 0 0 auto;
  font-size: 18px;
  letter-spacing: 0;
}

.brand-word {
  flex: 1;
  color: #a0a0a0;
  font-size: 11px;
  letter-spacing: .06em;
}

.chat-top-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.chat-top .top-title {
  font-size: 16px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.icon-btn:hover,
.icon-btn:active {
  background: rgba(0, 0, 0, 0.06);
}

.icon-btn.accent {
  color: var(--text);
  font-weight: 500;
  font-size: 27px;
}

.icon-btn.back {
  font-size: 34px;
  font-weight: 300;
  width: 40px;
  padding-bottom: 2px;
}

/* Search */
.search-wrap {
  padding: 4px 12px 9px;
  background: var(--bar);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ededed;
  border-radius: 6px;
  padding: 7px 11px;
  height: 34px;
}

.search-icon {
  width: 13px;
  height: 13px;
  border: 1.8px solid #999;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.8px;
  background: #999;
  right: -5px;
  bottom: -2px;
  transform: rotate(45deg);
  border-radius: 2px;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  margin-left: 3px;
}

.search-bar input::placeholder {
  color: var(--text-hint);
}

/* Chat list */
.chat-list {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 14px;
  border-bottom: 0.5px solid #ededed;
  cursor: pointer;
  transition: background 0.12s;
  list-style: none;
  width: 100%;
  border-left: none;
  border-right: none;
  border-top: none;
  background: #fff;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.chat-item:last-child {
  border-bottom: none;
}

.chat-item:hover,
.chat-item:active {
  background: #f5f5f5;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  user-select: none;
  box-shadow: none;
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 55%);
}

.chat-meta {
  flex: 1;
  min-width: 0;
}

.chat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.chat-name {
  font-size: 16px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-time {
  font-size: 11px;
  color: #b1b1b1;
  flex-shrink: 0;
}

.chat-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-preview {
  font-size: 13px;
  color: #9a9a9a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--unread);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(250, 81, 81, 0.35);
}

.badge.muted {
  background: #c8c8c8;
  box-shadow: none;
}

.preview-hint {
  flex: 0 0 auto;
  text-align: center;
  font-size: 10px;
  color: var(--text-hint);
  padding: 7px 12px 8px;
  background: #fff;
  border-top: 0;
}

/* Bottom tab bar */
.bottom-tabbar {
  flex: 0 0 auto;
  display: flex;
  height: 62px;
  padding-bottom: var(--safe-bottom);
  background: #f7f7f7;
  border-top: 0.5px solid #d9d9d9;
}

.bottom-tabbar .tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: #777;
  padding: 7px 2px 4px;
  font: 400 10px/1.2 var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
}

.bottom-tabbar .tab svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-tabbar .tab.active {
  color: var(--vanta-blue);
  font-weight: 600;
}

.bottom-tabbar .tab.active::after {
  display: none;
}

/* —— Me profile —— */
.me-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-list);
  -webkit-overflow-scrolling: touch;
}

.me-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
  background: #fff;
  border-bottom: 0.5px solid var(--border);
}

.me-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(43, 108, 255, 0.25);
  flex-shrink: 0;
}

.me-info {
  flex: 1;
  min-width: 0;
}

.me-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.me-id {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.me-rows {
  margin-top: 10px;
  background: #fff;
}

.me-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 0.5px solid #f0f0f0;
  font-size: 15px;
}

.me-row:last-child {
  border-bottom: none;
}

.me-row-label {
  color: var(--text);
}

.me-row-value {
  color: var(--text-secondary);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.me-row-value.e2ee {
  color: var(--vanta-blue-dark);
  font-weight: 600;
}

.me-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-hint);
  padding: 16px 18px;
}

/* —— Conversation —— */
.page-chat {
  background: var(--bg);
}

.page-chat .top-bar {
  border-bottom: 0.5px solid #d9d9d9;
}

.page-chat .chat-top-center .top-title {
  font-size: 16px;
  font-weight: 500;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 9px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  -webkit-overflow-scrolling: touch;
}

.e2ee-notice {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 2px 0 3px;
  padding: 1px 6px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  color: #b2b2b2;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.e2ee-notice:hover,
.e2ee-notice:active {
  color: #8e8e8e;
  background: rgba(0, 0, 0, 0.04);
}

.e2ee-notice-lock {
  display: inline-flex;
  line-height: 0;
  color: inherit;
  opacity: 0.9;
}

.e2ee-notice-text {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.msg-day {
  align-self: center;
  font-size: 11px;
  color: #aaa;
  background: transparent;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 1px 0 3px;
}

.msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 86%;
}

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

.msg.peer {
  align-self: flex-start;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: none;
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 55%);
}

.bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.msg.self .bubble-wrap {
  align-items: flex-end;
}

.msg.peer .bubble-wrap {
  align-items: flex-start;
}

.bubble {
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 15px;
  line-height: 1.42;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.msg.peer .bubble {
  background: var(--peer-bubble);
}

.msg.self .bubble {
  background: var(--self-bubble);
}

.msg.peer .bubble::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 11px;
  border: 5px solid transparent;
  border-right-color: var(--peer-bubble);
  border-left: 0;
}

.msg.self .bubble::before {
  content: "";
  position: absolute;
  right: -5px;
  top: 11px;
  border: 5px solid transparent;
  border-left-color: var(--self-bubble);
  border-right: 0;
}

/* Media bubbles */
.bubble.media-bubble {
  padding: 0;
  overflow: hidden;
  background: transparent !important;
  box-shadow: none;
  max-width: 220px;
}

.bubble.media-bubble::before {
  display: none !important;
}

.msg.peer .bubble.media-bubble.file-bubble,
.msg.self .bubble.media-bubble.file-bubble {
  background: var(--peer-bubble) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.msg.self .bubble.media-bubble.file-bubble {
  background: var(--self-bubble) !important;
}

.media-image {
  position: relative;
  width: 190px;
  height: 142px;
  border-radius: 5px;
  overflow: hidden;
  background: #c4d0e0;
  display: block;
  padding: 0;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.media-image-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(255, 255, 255, 0.35), transparent 50%),
    linear-gradient(145deg, #5b9aff 0%, #2b6cff 40%, #1e5ae8 100%);
  display: block;
}

.media-image-art.media-failed {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.media-image-art.variant-b {
  background:
    radial-gradient(circle at 70% 30%, rgba(180, 210, 255, 0.5), transparent 45%),
    linear-gradient(160deg, #7eb8f0 0%, #3a7ae0 50%, #1a4a9a 100%);
}

.media-image-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.04em;
}

.media-enc-badge {
  display: none !important;
}

.media-video {
  position: relative;
  width: 202px;
  height: 114px;
  border-radius: 5px;
  overflow: hidden;
  background: #1a1a1a;
  display: block;
}

.media-video-art {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(135deg, #3a4a5c 0%, #1e2832 50%, #0f1419 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color: #1a1a1a;
  z-index: 1;
}

.media-play svg {
  margin-left: 2px;
}

.media-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}

/* File card */
.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-width: 200px;
  max-width: 240px;
  border-radius: 8px;
  position: relative;
}

.file-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.file-icon.pdf {
  background: linear-gradient(145deg, #e74c3c, #c0392b);
}

.file-icon.doc,
.file-icon.docx {
  background: linear-gradient(145deg, #2b7cd3, #1a5a9e);
}

.file-icon.zip {
  background: linear-gradient(145deg, #f0a020, #d4890a);
}

.file-icon.generic {
  background: linear-gradient(145deg, #6b7280, #4b5563);
}

.file-icon-glyph {
  font-size: 16px;
  line-height: 1;
  margin-bottom: 1px;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.file-size {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.file-dl {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.file-dl:hover,
.file-dl:active {
  background: rgba(43, 108, 255, 0.15);
  color: var(--vanta-blue);
}

.msg.self .file-dl {
  background: rgba(0, 0, 0, 0.08);
}

.file-enc-row,
.msg-lock {
  display: none !important;
}

/* Upload progress */
.media-progress-wrap {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 3;
  border-radius: inherit;
}

.media-progress-wrap.on-file {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.media-progress-label {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.media-progress-wrap.on-file .media-progress-label {
  color: var(--text);
  text-shadow: none;
}

.media-progress-track {
  width: 70%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.media-progress-wrap.on-file .media-progress-track {
  background: rgba(0, 0, 0, 0.1);
}

.media-progress-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--vanta-blue);
  width: 0%;
  transition: width 0.3s ease;
}

.file-card.has-progress {
  position: relative;
}

.msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #aaa;
  padding: 0 2px;
  line-height: 1;
}

.msg-time {
  font-variant-numeric: tabular-nums;
}

.msg-ticks {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #7a9aaa;
  letter-spacing: -2px;
  font-size: 12px;
  font-weight: 600;
}

.msg-ticks.read {
  color: #2b6cff;
}

/* Typing indicator */
.typing-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  align-self: flex-start;
  max-width: 86%;
}

.typing-bubble {
  background: var(--peer-bubble);
  border-radius: 5px;
  padding: 12px 14px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  display: flex;
  gap: 4px;
  align-items: center;
  position: relative;
}

.typing-bubble::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 11px;
  border: 5px solid transparent;
  border-right-color: var(--peer-bubble);
  border-left: 0;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b0b0b0;
  animation: typingPulse 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingPulse {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* Composer */
.composer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px calc(7px + var(--safe-bottom));
  background: #f7f7f7;
  border-top: 0.5px solid var(--border);
}

.composer-icon {
  width: 34px;
  height: 35px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 22px;
  color: #555;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer-icon:active {
  background: rgba(0, 0, 0, 0.06);
}

.composer-input {
  flex: 1;
  min-width: 0;
  height: 35px;
  border: none;
  border-radius: 5px;
  background: #fff;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  box-shadow: inset 0 0 0 0.5px var(--border);
}

.composer-input:focus {
  box-shadow: inset 0 0 0 1px var(--vanta-blue);
}

.send-btn {
  flex-shrink: 0;
  height: 35px;
  padding: 0 13px;
  border: none;
  border-radius: 5px;
  background: var(--vanta-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.send-btn:hover {
  background: var(--vanta-blue-dark);
}

.send-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.send-btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* Empty / tab placeholders */
.tab-panel-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  background: #fff;
  padding: 48px 28px;
  text-align: center;
  min-height: 220px;
}

.tab-panel-empty .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--vanta-blue-soft);
  color: var(--vanta-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 4px;
  box-shadow: 0 2px 8px rgba(43, 108, 255, 0.12);
}

.tab-panel-empty .empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.tab-panel-empty .empty-desc {
  font-size: 13px;
  color: var(--text-hint);
  line-height: 1.45;
  max-width: 220px;
}

/* E2EE bottom sheet */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
  animation: fadeIn 0.18s ease;
}

.sheet-backdrop[hidden],
.sheet[hidden] {
  display: none !important;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 10px 20px calc(18px + var(--safe-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  animation: sheetUp 0.22s ease;
  text-align: center;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #d0d0d0;
  margin: 0 auto 14px;
}

.sheet-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 9px;
  border-radius: 50%;
  background: var(--vanta-blue-soft);
  color: var(--vanta-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.sheet-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 14px;
  text-align: center;
}

.sheet-close {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--vanta-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.sheet-close:active {
  background: var(--vanta-blue-dark);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 420px) {
  body {
    padding: 0;
    background: var(--bg-list);
  }

  .phone-shell {
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}


/* —— Auth hub / register extras —— */
.auth-hub-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.login-btn-secondary {
  background: rgba(255, 255, 255, 0.92);
  color: var(--vanta-blue-deep);
  box-shadow: 0 4px 14px rgba(15, 61, 184, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.login-btn-secondary:active {
  opacity: 0.9;
}

.login-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-hub-hint {
  margin-top: 18px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  line-height: 1.4;
  max-width: 280px;
}

.auth-hub-hint.is-error {
  color: #ffd0d0;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.link-btn {
  border: none;
  background: none;
  color: var(--vanta-blue);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0 2px;
}

.link-btn:active {
  opacity: 0.75;
}

.logout-btn {
  display: block;
  width: calc(100% - 36px);
  margin: 18px 18px 0;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #fa5151;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  border: 0.5px solid var(--border);
}

.logout-btn:active {
  background: #fff5f5;
}

.empty-action {
  margin-top: 16px;
  height: 40px;
  padding: 0 22px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #2b6cff, #1e5ae8);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(43, 108, 255, 0.3);
}

.empty-action:active {
  transform: scale(0.98);
}

.sheet-field {
  width: 100%;
  padding: 0 4px 12px;
  text-align: left;
}

.sheet-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: #fafbfc;
}

.sheet-field input:focus {
  border-color: var(--vanta-blue);
  box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.15);
  background: #fff;
}

.sheet .login-error {
  text-align: left;
  width: 100%;
  padding: 0 4px 8px;
}

.sheet-close-ghost {
  margin-top: 8px;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  font-weight: 500;
}

.e2ee-notice.demo-notice {
  background: #fff8e8;
  border-color: rgba(250, 157, 59, 0.45);
  color: #9a5b00;
}

.e2ee-notice.demo-notice .e2ee-notice-lock {
  color: #fa9d3b;
}

/* —— File helper / group / register hint (v2) —— */
.avatar.avatar--img,
.msg-avatar.msg-avatar--img {
  padding: 0;
  overflow: hidden;
  background: #14b8a6 !important;
}
.avatar.avatar--img img,
.msg-avatar.msg-avatar--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-item--pinned {
  background: #f7fffb;
}
.chat-pin {
  flex-shrink: 0;
  font-size: 10px;
  color: #0d9488;
  background: #ccfbf1;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
}
.chat-tag {
  font-size: 11px;
  color: #576b95;
  font-weight: 500;
}
.field-hint {
  display: block;
  min-height: 1.2em;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-secondary, #888);
}
.field-hint--ok { color: #0d9488; }
.field-hint--bad { color: #e11d48; }
.field-hint--pending { color: #64748b; }
.field-hint--muted { color: #94a3b8; }
.sheet-action {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 14px 16px;
  border: none;
  border-radius: 10px;
  background: #f3f4f6;
  font-size: 16px;
  font-weight: 600;
  color: #111;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.sheet-action:active { background: #e5e7eb; }
.sheet-tall { max-height: min(88vh, 640px); overflow: auto; }
.invite-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0 8px;
}
.invite-qr-wrap canvas {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.invite-meta {
  margin: 8px 0 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
.media-image img.media-image-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #c4d0e0;
}

.preview-hint.is-error {
  color: #e11d48;
}
.me-avatar-btn {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: none;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  background: transparent;
}
.me-avatar-btn.me-avatar-fallback {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.me-avatar-img {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 12px;
  background: #e8e8e8;
}
.me-avatar-link {
  margin-top: 6px;
  border: none;
  background: none;
  color: #2b6cff;
  font-size: 13px;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.me-row-btn {
  width: 100%;
  border-left: none;
  border-right: none;
  border-top: none;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
}
.me-about {
  background: #fafafa;
  border-radius: 8px;
  margin: 4px 0 8px;
  overflow: hidden;
}
.e2ee-notice,
.e2ee-notice.demo-notice {
  display: none !important;
}
#myQrCanvas { border-radius: 12px; border: 1px solid #e5e7eb; background: #fff; }



/* —— WeChat-like contacts —— */
.contacts-panel {
  flex: 1;
  overflow-y: auto;
  background: #f5f5f5;
  -webkit-overflow-scrolling: touch;
}
.contacts-block {
  margin: 0 0 10px;
  background: #fff;
}
.contacts-shortcuts { margin-bottom: 0; }
.contact-item {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 0.5px solid #ededed;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.contact-item:last-child { border-bottom: 0; }
.contact-item:hover,
.contact-item:active { background: #f5f5f5; }
.contact-item .avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  font-size: 15px;
}
.contact-meta { flex: 1; min-width: 0; }
.contact-name {
  font-size: 16px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-sub {
  margin-top: 3px;
  color: #9a9a9a;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contacts-shortcut-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #fff;
  font-size: 20px;
}
.contacts-shortcut-icon--orange { background: #fa9d3b; }
.contacts-shortcut-icon--blue { background: #576b95; }
.contacts-shortcut-icon--green { background: #07c160; }
.contacts-section-label {
  padding: 9px 16px 6px;
  color: #8c8c8c;
  font-size: 12px;
  background: #f5f5f5;
}
.contacts-empty-hint {
  padding: 22px 16px;
  color: #aaa;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  background: #fff;
}
.contacts-subhead {
  height: 48px;
  display: flex;
  align-items: center;
  background: var(--bar);
  border-bottom: 0.5px solid #d9d9d9;
}
.contacts-back {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 300 34px/1 var(--font);
  cursor: pointer;
}
.contacts-subhead-title {
  font-size: 17px;
  font-weight: 600;
}

.contacts-section {
  margin: 10px 0 0;
  background: #fff;
}
.contacts-section:first-child { margin-top: 0; }
.contacts-section-title {
  padding: 9px 16px 7px;
  color: #8c8c8c;
  font-size: 12px;
  font-weight: 400;
  background: #f5f5f5;
}
.contact-row {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 0.5px solid #ededed;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.contact-row:last-child { border-bottom: 0; }
.contact-row:hover,
.contact-row:active { background: #f5f5f5; }
.contact-row-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #fff;
  font-size: 18px;
  background: var(--vanta-blue);
}
.contact-row-icon.friend { background: #07c160; }
.contact-row-icon.tag { background: #fa9d3b; }
.contact-row-icon.group { background: #576b95; }
.contact-row-icon.person { background: #2b6cff; font-size: 15px; font-weight: 600; }
.contact-row-copy { flex: 1; min-width: 0; }
.contact-row-title {
  font-size: 16px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-row-sub {
  margin-top: 3px;
  color: #9a9a9a;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-row-arrow {
  color: #b2b2b2;
  font-size: 22px;
  line-height: 1;
}
.contacts-empty {
  padding: 16px;
  color: #aaa;
  font-size: 13px;
  background: #fff;
}
.contacts-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 14px;
  background: #fff;
}
.contacts-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  color: #64748b;
  background: #f1f5f9;
  font-size: 12px;
}

/* —— WeChat-like top-right + popover —— */
.plus-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 10px;
  z-index: 70;
  min-width: 188px;
  padding: 6px 0;
  border-radius: 10px;
  background: rgba(54, 54, 54, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  animation: fadeIn 0.12s ease-out;
}
.plus-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: rgba(54, 54, 54, 0.96);
  transform: rotate(45deg);
  border-radius: 2px;
}
.plus-menu[hidden] { display: none !important; }
.plus-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px 10px 12px;
  border: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.plus-menu-item + .plus-menu-item {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.plus-menu-item:active {
  background: rgba(255, 255, 255, 0.08);
}
.plus-menu-icon {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.plus-menu-icon img,
.plus-menu-icon svg {
  width: 35px;
  height: 35px;
  display: block;
}
.plus-menu-label {
  flex: 1;
  line-height: 1.2;
}

/* —— 扫一扫 —— */
.scan-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 360px;
  margin: 8px 0 12px;
  border-radius: 14px;
  overflow: hidden;
  background: #0b0b0b;
}
.scan-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}
.scan-frame {
  position: absolute;
  inset: 18% 14%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.scan-viewport.scan-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 13px;
  text-align: center;
  padding: 24px;
}


/* —— Create group picker (WeChat-like) —— */
.sheet-create-group {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 720px);
  padding-bottom: 12px;
  overflow: hidden;
  text-align: left;
}
.sheet-create-group .sheet-title,
.sheet-create-group .sheet-body {
  text-align: center;
}
.sheet-create-group .sheet-close {
  text-align: center;
}
.sheet-create-group .sheet-body {
  flex: 0 0 auto;
  margin-bottom: 8px;
}
.cg-selected {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin: 0 0 4px;
  -webkit-overflow-scrolling: touch;
}
.cg-selected[hidden] { display: none !important; }
.cg-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 140px;
  padding: 4px 8px 4px 4px;
  border: none;
  border-radius: 999px;
  background: #f0f0f0;
  color: #111;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.cg-chip:active { background: #e5e5e5; }
.cg-chip .avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  font-size: 12px;
  border-radius: 4px;
}
.cg-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 88px;
}
.cg-search-field { margin-bottom: 6px; }
.cg-picker {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  margin: 0 0 10px;
  border: 1px solid #ededed;
  border-radius: 10px;
  background: #f5f5f5;
  -webkit-overflow-scrolling: touch;
}
.cg-picker-empty {
  padding: 28px 16px;
  text-align: center;
  color: #8c8c8c;
  font-size: 14px;
  line-height: 1.5;
  background: #f5f5f5;
}
.cg-pick-item {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 0.5px solid #ededed;
  background: #fff;
  color: var(--text, #111);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.cg-pick-item:last-child { border-bottom: 0; }
.cg-pick-item:hover,
.cg-pick-item:active { background: #f7f7f7; }
.cg-pick-item.is-selected { background: #f0faf4; }
.cg-check {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  border: 1.5px solid #c8c8c8;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-sizing: border-box;
}
.cg-pick-item.is-selected .cg-check {
  border-color: #07c160;
  background: #07c160;
}
.cg-pick-item .avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  font-size: 14px;
}
.cg-section-label {
  padding: 8px 12px 4px;
  color: #8c8c8c;
  font-size: 12px;
  background: #f5f5f5;
}


/* Authenticated avatar/media load failure */
.avatar--img img.media-failed,
.msg-avatar--img img.media-failed,
.me-avatar-img.media-failed {
  opacity: 0.45;
  filter: grayscale(0.5);
}


/* —— Contact sheets: phone region + OTP (v1.3.4) —— */
.phone-region-select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fafbfc;
  outline: none;
}
.phone-region-select:focus {
  border-color: var(--vanta-blue);
  box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.15);
  background: #fff;
}
.phone-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.phone-dial {
  flex: 0 0 auto;
  min-width: 44px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 8px;
  background: #f0f2f5;
  color: #576b95;
  font-size: 14px;
  font-weight: 600;
}
.phone-input-row input {
  flex: 1;
  width: auto;
  min-width: 0;
}
.phone-e164-preview {
  margin: -4px 4px 10px;
  font-size: 12px;
  color: #8a8a8a;
  text-align: left;
  min-height: 16px;
}
.otp-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  padding: 0 4px 4px;
}
.otp-code-field {
  flex: 1;
  min-width: 0;
  padding-bottom: 0;
}
.otp-send-btn {
  flex: 0 0 auto;
  height: 42px;
  margin-bottom: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #2b6cff;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.otp-send-btn:disabled {
  background: #c8c8c8;
  cursor: not-allowed;
}
.otp-hint {
  margin: 0 4px 8px;
  font-size: 12px;
  color: #576b95;
  text-align: left;
}
.me-perf-debug {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #666;
  word-break: break-all;
  white-space: pre-wrap;
  line-height: 1.35;
}
