/* BinanceChat — WhatsApp dark-ish theme */
:root {
  --bg: #0b141a;
  --panel: #111b21;
  --panel-2: #202c33;
  --panel-3: #2a3942;
  --hover: #182229;
  --border: #222d34;
  --text: #e9edef;
  --text-2: #d1d7db;
  --muted: #8696a0;
  --accent: #00a884;
  --accent-2: #008069;
  --accent-soft: rgba(0, 168, 132, 0.14);
  --out-bubble: #005c4b;
  --in-bubble: #202c33;
  --danger: #f15c6d;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: 0.2px; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
code, .mono { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.block { width: 100%; }
.danger { color: var(--danger) !important; }

/* ---------------- buttons ---------------- */
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 18px;
  background: var(--panel-2);
  color: var(--text);
  transition: background 0.15s, transform 0.05s, border-color 0.15s;
  font-weight: 550;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #06231d; }
.btn.primary:hover { background: #08c09a; }
.btn.ghost { background: transparent; border-color: #2c3b44; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

/* ---------------- avatar ---------------- */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #37474f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #eaf6f3;
  flex: 0 0 auto;
  overflow: hidden;
  user-select: none;
  position: relative;
}
.avatar.small { width: 36px; height: 36px; font-size: 14px; }
.avatar.large { width: 84px; height: 84px; font-size: 30px; }
.avatar-btn { border: 0; cursor: pointer; }
.avatar .online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #31d158;
  border: 2.5px solid var(--panel);
}

/* ---------------- toast ---------------- */
.toast-root {
  position: fixed;
  z-index: 999;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: #233138;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: toast-in 0.18s ease-out;
  max-width: 80vw;
}
.toast.error { background: #4a2229; color: #ffd7dc; }
.toast.ok { background: #0d3d33; color: #b6f5e4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------------- auth ---------------- */
.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 600px at 15% 10%, rgba(0, 168, 132, 0.16), transparent 60%),
    radial-gradient(900px 700px at 85% 90%, rgba(240, 185, 11, 0.1), transparent 60%),
    #07110f;
  overflow-y: auto;
  padding: 28px 16px;
}
.auth-orbs { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.auth-orbs i {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}
.auth-orbs i:nth-child(1) { width: 340px; height: 340px; background: #00a88433; top: -80px; left: -60px; }
.auth-orbs i:nth-child(2) { width: 280px; height: 280px; background: #f0b90b26; bottom: -60px; right: -40px; }
.auth-orbs i:nth-child(3) { width: 220px; height: 220px; background: #1d6feb22; top: 40%; right: 30%; }

.auth-panel {
  position: relative;
  width: min(460px, 100%);
  background: rgba(17, 27, 33, 0.88);
  border: 1px solid #22323a;
  border-radius: 22px;
  padding: 30px 28px 26px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.brand-logo {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(145deg, #00c39a, #008069);
  color: #04120f;
  font-weight: 800;
  font-size: 25px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(0, 168, 132, 0.35);
}
.brand-text h1 { font-size: 21px; }
.brand-text p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.auth-step h2 { font-size: 18px; margin-bottom: 8px; }
.auth-step > p { margin-bottom: 14px; font-size: 13.5px; }
.auth-step .btn.block { margin-top: 10px; }
.auth-features { list-style: none; padding: 0; margin: 18px 0 10px; display: grid; gap: 8px; }
.auth-features li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 9px;
  padding: 8px 10px;
}
.auth-features li span { flex: 0 0 auto; }

.field { display: block; margin: 12px 0; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  background: #0d171c;
  border: 1px solid #26363e;
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.15); }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); margin: 12px 0; }
.check input { margin-top: 3px; accent-color: var(--accent); }

.address-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #0d171c;
  border: 1px solid #26363e;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.address-box.compact { margin-bottom: 12px; }
.address-box code { font-size: 12.5px; word-break: break-all; color: #c9f5e8; flex: 1; }
.badge-bsc {
  background: linear-gradient(140deg, #f0b90b, #d69e00);
  color: #241a00;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 7px;
  border-radius: 6px;
  flex: 0 0 auto;
}
.auth-status {
  background: #4a2229;
  color: #ffd7dc;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.auth-status.ok { background: #0d3d33; color: #b6f5e4; }

/* ---------------- app layout ---------------- */
.app-screen {
  display: grid;
  grid-template-columns: 372px minmax(0, 1fr);
  height: 100%;
  background: var(--bg);
}
.app-screen.info-open { grid-template-columns: 372px minmax(0, 1fr) 320px; }

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 62px;
}
.sidebar-title { flex: 1; min-width: 0; }
.sidebar-title h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-title span { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-actions { display: flex; gap: 2px; }

.search-wrap { padding: 8px 12px; position: relative; }
.search-icon { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; }
.search-wrap input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 12px 9px 34px;
  outline: none;
  font-size: 13.5px;
}
.search-wrap input:focus { border-color: #2f4650; background: #16232a; }

.tabs { display: flex; gap: 4px; padding: 2px 10px 6px; }
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab:hover { background: rgba(255, 255, 255, 0.04); }
.tab.active { color: var(--accent); background: var(--accent-soft); }
.tab-badge {
  font-style: normal;
  background: var(--accent);
  color: #04120f;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 20px;
}

.list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 16px; }
.list::-webkit-scrollbar, .messages::-webkit-scrollbar, .info-panel::-webkit-scrollbar { width: 7px; }
.list::-webkit-scrollbar-thumb, .messages::-webkit-scrollbar-thumb { background: #34434c; border-radius: 4px; }
.list::-webkit-scrollbar-track { background: transparent; }

.chat-item, .contact-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.12s;
}
.chat-item:hover, .contact-item:hover { background: var(--hover); }
.chat-item.active { background: #1f2c33; }
.chat-item-main, .contact-main { flex: 1; min-width: 0; }
.chat-item-top { display: flex; align-items: baseline; gap: 8px; }
.chat-item-top h4 {
  font-size: 14.5px;
  font-weight: 550;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item-top time { font-size: 11.5px; color: var(--muted); flex: 0 0 auto; }
.chat-item-bottom { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.chat-item-bottom p {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unread-pill {
  background: var(--accent);
  color: #04120f;
  font-size: 11px;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex: 0 0 auto;
}
.list-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 20px; line-height: 1.8; }

/* wallet tab */
.wallet-card {
  margin: 8px 6px 12px;
  background: linear-gradient(150deg, #15242b, #101c22);
  border: 1px solid #24343d;
  border-radius: 16px;
  padding: 16px;
}
.wallet-card .addr { margin: 12px 0; font-size: 13px; word-break: break-all; color: #c9f5e8; }
.wallet-actions { display: grid; gap: 8px; margin: 0 6px; }
.wallet-actions button {
  text-align: left;
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13.5px;
  color: var(--text-2);
}
.wallet-actions button:hover { background: var(--panel-3); }
.wallet-actions button.danger { color: #ff9aa6; }
.wallet-foot { margin: 16px 6px; padding: 12px; background: rgba(255, 255, 255, 0.025); border-radius: 12px; font-size: 12px; }
.wallet-foot code { display: block; margin: 6px 0 8px; color: var(--accent); letter-spacing: 0.5px; }

/* ---------------- chat area ---------------- */
.chat-area { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: #0b141a; }
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 30px;
  background:
    radial-gradient(700px 400px at 50% 0%, rgba(0, 168, 132, 0.07), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 22px);
}
.empty-logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(145deg, #00c39a, #008069);
  color: #04120f;
  font-size: 36px;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  box-shadow: 0 14px 40px rgba(0, 168, 132, 0.3);
}
.chat-empty h2 { font-size: 22px; }
.chat-empty > p { max-width: 420px; }
.empty-tips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.empty-tips div {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.empty-tips b { color: var(--accent); margin-right: 6px; }
.e2ee-badge {
  margin-top: 22px;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 20px;
}

.chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  min-height: 62px;
}
.back-btn { display: none; }
.chat-title { flex: 1; min-width: 0; }
.chat-title h3 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title span.typing { color: var(--accent); }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(0, 168, 132, 0.05), transparent 70%),
    radial-gradient(700px 500px at 90% 100%, rgba(240, 185, 11, 0.04), transparent 70%);
  scroll-behavior: smooth;
}
.day-divider { text-align: center; margin: 14px 0 8px; }
.day-divider span {
  background: #182229;
  color: var(--muted);
  font-size: 11.5px;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.sys-msg { text-align: center; margin: 8px 0; }
.sys-msg span {
  display: inline-block;
  background: #182229;
  color: #9fb0b8;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 12px;
  max-width: 80%;
}
.msg { display: flex; margin: 1px 0; }
.msg.out { justify-content: flex-end; }
.msg.cont { margin-top: 0; }
.msg.cont .bubble .sender { display: none; }
.msg.cont .bubble { border-top-left-radius: 4px; }
.msg.cont.out .bubble { border-top-left-radius: 10px; border-top-right-radius: 4px; }
.msg .bubble {
  max-width: min(560px, 78%);
  background: var(--in-bubble);
  border-radius: 10px;
  padding: 7px 10px 6px;
  position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
  animation: bubble-in 0.14s ease-out;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.msg.out .bubble { background: var(--out-bubble); }
.msg .sender {
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 2px;
  color: #7ad9c0;
}
.msg .text {
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.46;
}
.msg .text a { color: #7ad9c0; }
.msg .meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(233, 237, 239, 0.55);
  margin-top: 2px;
  user-select: none;
}
.msg.out .meta { color: rgba(233, 237, 239, 0.7); }
.msg .tick { font-size: 12px; letter-spacing: -2px; }
.msg .tick.read { color: #53bdeb; }
.msg .bubble.failed { border: 1px solid rgba(241, 92, 109, 0.5); }
.msg .bubble.undecryptable { color: #ffb4bd; font-style: italic; font-size: 13px; }
.msg img.attach {
  max-width: 320px;
  max-height: 320px;
  border-radius: 8px;
  display: block;
  margin-bottom: 4px;
  cursor: zoom-in;
  background: #0d171c;
}
.msg .file-attach {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 9px;
  padding: 9px 11px;
  margin-bottom: 4px;
  min-width: 200px;
}
.msg .file-icon { font-size: 22px; }
.msg .file-name { font-size: 13.5px; word-break: break-all; }
.msg .file-size { font-size: 11.5px; color: rgba(233, 237, 239, 0.6); }
.msg .file-attach button {
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
  margin-left: auto;
}

/* composer */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 9px 14px 12px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  position: relative;
}
.composer textarea {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 13px;
  max-height: 140px;
  min-height: 40px;
  outline: none;
  resize: none;
  line-height: 1.45;
}
.composer textarea:focus { border-color: #2f4650; }
.send-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #04120f;
  font-size: 17px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background 0.15s, transform 0.08s;
}
.send-btn:hover { background: #08c09a; }
.send-btn:active { transform: scale(0.95); }
.emoji-panel {
  position: absolute;
  bottom: 64px;
  left: 12px;
  width: min(340px, 90vw);
  max-height: 240px;
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  box-shadow: var(--shadow);
  z-index: 5;
}
.emoji-panel button {
  border: 0;
  background: transparent;
  font-size: 20px;
  padding: 5px 0;
  border-radius: 7px;
}
.emoji-panel button:hover { background: rgba(255, 255, 255, 0.08); }

/* ---------------- info panel ---------------- */
.info-panel {
  background: var(--panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding-bottom: 24px;
}
.info-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
}
.info-head h3 { font-size: 15px; flex: 1; }
.info-profile { text-align: center; padding: 24px 18px 16px; border-bottom: 1px solid var(--border); }
.info-profile .avatar { margin: 0 auto 12px; }
.info-profile h4 { font-size: 17px; }
.info-profile .addr { font-size: 11.5px; color: var(--muted); word-break: break-all; margin-top: 4px; }
.info-profile .about { font-size: 13px; color: var(--text-2); margin-top: 10px; }
.info-section { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.info-section h5 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; font-weight: 600; }
.info-section .kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; }
.info-section .kv span:last-child { color: var(--text-2); text-align: right; word-break: break-all; }
.info-section .fingerprint { font-size: 12px; letter-spacing: 1px; color: var(--accent); word-break: break-all; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.member-row .name { flex: 1; font-size: 13.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-row .tag { font-size: 11px; color: var(--muted); }
.member-row .icon-btn { width: 30px; height: 30px; font-size: 14px; }
.info-actions { display: grid; gap: 8px; padding: 14px 18px; }
.info-actions .btn { text-align: center; }

/* ---------------- modal ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 10, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 18px;
  backdrop-filter: blur(3px);
  animation: fade-in 0.12s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel);
  border: 1px solid #26363e;
  border-radius: 18px;
  width: min(440px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modal-in 0.16s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: none; } }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal header h3 { font-size: 16px; flex: 1; }
.modal .modal-body { padding: 4px 18px 10px; overflow-y: auto; }
.modal footer { padding: 12px 18px 16px; display: flex; gap: 8px; justify-content: flex-end; }
.modal footer .btn { min-width: 88px; }
.modal .select-list { max-height: 260px; overflow-y: auto; margin: 6px 0; }
.modal .select-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
.modal .select-row:hover { background: var(--hover); }
.modal .select-row input { accent-color: var(--accent); }
.modal .select-row .name { flex: 1; font-size: 13.5px; }
.modal .select-row .sub { font-size: 11.5px; color: var(--muted); }
.modal .hint { font-size: 12px; color: var(--muted); margin: 8px 0; }
.modal .key-box {
  background: #0d171c;
  border: 1px solid #26363e;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  word-break: break-all;
  color: #ffd98a;
}
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: zoom-out;
}
.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 8px; }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.avatar-picker button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--panel-2);
  font-size: 19px;
}
.avatar-picker button.active { border-color: var(--accent); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b6b73; display: inline-block; }
.status-dot.on { background: #31d158; }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .app-screen { grid-template-columns: 320px minmax(0, 1fr); }
  .app-screen.info-open { grid-template-columns: 320px minmax(0, 1fr); }
  .info-panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 88vw); z-index: 40; box-shadow: var(--shadow); }
}
@media (max-width: 760px) {
  .app-screen { grid-template-columns: 1fr; }
  .app-screen.info-open { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; }
  .chat-area { display: none; }
  .app-screen.chat-open .sidebar { display: none; }
  .app-screen.chat-open .chat-area { display: flex; }
  .back-btn { display: inline-flex; }
  .messages { padding: 12px 10px 8px; }
  .msg .bubble { max-width: 86%; }
  .chat-header { padding: 8px 8px; }
  .composer { padding: 8px 8px 10px; }
  .auth-panel { padding: 24px 20px 20px; border-radius: 18px; }
  .empty-tips { display: none; }
}
