:root {
  --bg-rail: #000000;
  --bg-sidebar: #070708;
  --bg-chat: #000000;
  --bg-members: #070708;
  --bg-input: #121214;
  --bg-hover: #141417;
  --bg-active: #1c1c20;
  --bg-float: #0c0c0e;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --green: #23a559;
  --yellow: #f0b232;
  --text: #dbdee1;
  --text-muted: #8a8d93;
  --text-faint: #6c6f76;
  --text-bright: #f2f3f5;
  --danger: #da373c;
  --danger-text: #f23f42;
  --divider: #000000;
  --line: #1b1b1e;
  --link: #00a8fc;
}

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

/* line icons */
.ic { width: 20px; height: 20px; flex-shrink: 0; display: inline-block;
  vertical-align: middle; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }

html, body {
  height: 100%;
  font-family: "gg sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg-chat);
  color: var(--text);
  overflow: hidden;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; color: inherit;
  background: none; }
input { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-rail); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===================== AUTH ===================== */
.auth-screen {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: #000000;
}
.auth-card {
  width: 420px; max-width: 92vw; background: var(--bg-float);
  border-radius: 8px; padding: 32px; box-shadow: 0 8px 24px rgba(0,0,0,.6);
  border: 1px solid var(--line);
}
.auth-logo { text-align: center; font-size: 28px; color: var(--text-bright);
  letter-spacing: -.5px; }
.auth-sub { text-align: center; color: var(--text-muted); margin: 6px 0 22px;
  font-size: 15px; }
.auth-card label, .modal label {
  display: block; text-transform: uppercase; font-size: 12px; font-weight: 700;
  color: var(--text-muted); margin: 14px 0 6px; letter-spacing: .4px;
}
.auth-card input, .modal input {
  width: 100%; padding: 10px 12px; border-radius: 4px; border: none;
  background: var(--divider); color: var(--text-bright); font-size: 15px;
  outline: none;
}
.auth-card input:focus, .modal input:focus { box-shadow: 0 0 0 1px var(--accent); }
.auth-error, .modal-error { color: var(--danger-text); font-size: 13px;
  min-height: 18px; margin-top: 10px; }
.btn-primary {
  width: 100%; margin-top: 18px; padding: 11px; background: var(--accent);
  color: #fff; border-radius: 4px; font-size: 15px; font-weight: 600;
  transition: background .15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.auth-switch { margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.auth-switch a { color: var(--link); text-decoration: none; margin-left: 4px; }
.auth-switch a:hover { text-decoration: underline; }

/* ===================== LAYOUT ===================== */
.app { display: flex; height: 100%; }

.guild-rail {
  width: 72px; background: var(--bg-rail); display: flex; flex-direction: column;
  align-items: center; padding: 12px 0; gap: 8px; overflow-y: auto;
  border-right: 1px solid var(--line);
}
.guild-rail::-webkit-scrollbar { width: 0; }
.rail-sep { width: 32px; height: 1px; background: var(--line);
  flex-shrink: 0; }

.guild-icon {
  width: 48px; height: 48px; border-radius: 24px; background: var(--bg-sidebar);
  color: var(--text-bright); font-size: 18px; font-weight: 600; display: flex;
  align-items: center; justify-content: center;
  transition: border-radius .15s, background .15s; position: relative;
  flex-shrink: 0; overflow: hidden; text-align: center; line-height: 1.1;
}
.guild-icon:hover { border-radius: 16px; background: var(--accent); }
.guild-icon.active { border-radius: 16px; background: var(--accent); }
.guild-icon.active::before, .guild-icon.home.active::before {
  content: ""; position: absolute; left: -12px; top: 50%;
  transform: translateY(-50%); width: 4px; height: 40px; background: #fff;
  border-radius: 0 4px 4px 0;
}
.guild-icon.home { color: var(--text-bright); }
.guild-icon.home.active { background: var(--accent); }
.guild-icon.add { color: var(--green); font-size: 24px; }
.guild-icon.add:hover { background: var(--green); color: #fff; }

/* sidebar */
.sidebar { width: 240px; background: var(--bg-sidebar); display: flex;
  flex-direction: column; border-right: 1px solid var(--line); }
.sidebar > div:not(.user-panel):not(.voice-bar) { flex: 1; display: flex; flex-direction: column;
  min-height: 0; }
.sidebar > .voice-bar { flex: 0 0 auto; }
.sidebar-header {
  height: 48px; padding: 0 16px; display: flex; align-items: center;
  justify-content: space-between; font-weight: 600; color: var(--text-bright);
  border-bottom: 1px solid var(--line); font-size: 15px; cursor: pointer;
  flex-shrink: 0;
}
.sidebar-header:hover { background: var(--bg-hover); }
.sidebar-header .chevron { font-size: 16px; color: var(--text-muted); }
.guild-sidebar-wrap { position: relative; }
.guild-menu {
  position: absolute; top: 50px; left: 8px; right: 8px; background: var(--bg-float);
  border-radius: 6px; padding: 6px; z-index: 30; box-shadow: 0 8px 16px rgba(0,0,0,.5);
  border: 1px solid var(--line);
}
.guild-menu-item { padding: 8px 10px; border-radius: 4px; font-size: 14px;
  color: var(--text); cursor: pointer; }
.guild-menu-item:hover { background: var(--accent); color: #fff; }
.guild-menu-item.danger:hover { background: var(--danger); }

.channel-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 4px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; color: var(--text-muted); letter-spacing: .4px;
  cursor: pointer;
}
.channel-section-head:hover { color: var(--text); }
.channel-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }

.cat-head {
  display: flex; align-items: center; gap: 4px; padding: 16px 8px 4px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: .4px; cursor: pointer;
}
.cat-head:hover { color: var(--text); }
.cat-head .cat-caret { font-size: 10px; transition: transform .15s; }
.cat-head.collapsed .cat-caret { transform: rotate(-90deg); }
.cat-head .cat-add { margin-left: auto; font-size: 16px; }

.icon-btn { display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 4px; color: var(--text-muted);
  font-size: 18px; }
.icon-btn:hover { color: var(--text-bright); background: var(--bg-hover); }

.channel {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px; margin: 1px 0;
  border-radius: 4px; color: var(--text-muted); font-size: 15px; cursor: pointer;
}
.channel:hover { background: var(--bg-hover); color: var(--text); }
.channel.active { background: var(--bg-active); color: var(--text-bright); }
.channel .ch-icon { display: flex; align-items: center; justify-content: center;
  width: 20px; opacity: .75; }
.channel .ch-name { flex: 1; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.voice-members { padding: 0 8px 4px 30px; }
.voice-member { display: flex; align-items: center; gap: 8px; padding: 3px 6px;
  border-radius: 4px; color: var(--text-muted); font-size: 14px; }
.voice-member .vm-avatar { width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
  color: #fff; font-weight: 600; }
.voice-member.speaking { color: var(--green); }
.voice-member.speaking .vm-avatar { box-shadow: 0 0 0 2px var(--green); }

/* DM sidebar */
.dm-search { padding: 10px; }
.dm-search input { width: 100%; background: var(--bg-float); border: none;
  border-radius: 4px; padding: 7px 8px; color: var(--text); font-size: 14px;
  outline: none; cursor: pointer; }
.dm-nav { padding: 0 8px; }
.dm-nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 4px; color: var(--text-muted); font-weight: 600; cursor: pointer;
  font-size: 15px; }
.dm-nav-item:hover { background: var(--bg-hover); color: var(--text); }
.dm-nav-item.active { background: var(--bg-active); color: var(--text-bright); }
.dm-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px;
  border-radius: 4px; cursor: pointer; }
.dm-row:hover { background: var(--bg-hover); }
.dm-row.active { background: var(--bg-active); }
.dm-row .dm-text { min-width: 0; }
.dm-row .dm-name { font-size: 15px; color: var(--text); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-row .dm-last { font-size: 12px; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

/* avatars */
.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; flex-shrink: 0; position: relative;
}
.presence-dot {
  position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px;
  border-radius: 50%; border: 3px solid var(--bg-sidebar);
  background: var(--text-faint);
}
.presence-dot.online { background: var(--green); }

/* user panel */
.user-panel {
  height: 52px; background: var(--bg-rail); display: flex; align-items: center;
  gap: 8px; padding: 0 8px; flex-shrink: 0; border-top: 1px solid var(--line);
}
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 600;
  color: #fff; font-size: 14px; flex-shrink: 0; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; color: var(--text-bright);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-status { font-size: 12px; color: var(--text-muted); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-status:hover { color: var(--text); }

/* chat */
.chat { flex: 1; display: flex; flex-direction: column; background: var(--bg-chat);
  min-width: 0; }
.chat-header {
  height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  border-bottom: 1px solid var(--line); color: var(--text-bright); font-weight: 600;
  flex-shrink: 0; z-index: 5;
}
.chat-hash { display: flex; align-items: center; color: var(--text-muted); }
.channel-topic { font-size: 13px; color: var(--text-muted); font-weight: 400;
  border-left: 1px solid var(--bg-active); padding-left: 10px; margin-left: 2px; }
.chat-header-spacer { flex: 1; }
.header-icon { display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 4px; color: var(--text-muted); }
.header-icon:hover { background: var(--bg-hover); color: var(--text-bright); }

.messages { flex: 1; overflow-y: auto; padding: 16px 0 24px;
  display: flex; flex-direction: column; }
/* anchor content to the bottom (Discord-style) until it overflows */
.messages > .welcome { margin-top: auto; }
.empty-hint { color: var(--text-muted); text-align: center; margin-top: 80px;
  font-size: 15px; line-height: 1.6; }

/* channel welcome banner */
.welcome { padding: 16px 16px 8px; }
.welcome-icon { width: 68px; height: 68px; border-radius: 50%;
  background: var(--bg-active); display: flex; align-items: center;
  justify-content: center; font-size: 36px; color: var(--text-bright);
  margin-bottom: 8px; }
.welcome-icon .ic { width: 36px; height: 36px; }
.welcome h2 { color: var(--text-bright); font-size: 30px; font-weight: 800;
  margin-bottom: 6px; }
.welcome p { color: var(--text-muted); font-size: 15px; }

/* message */
.msg { display: flex; gap: 16px; padding: 2px 48px 2px 16px; position: relative; }
/* Discord-style breathing room between message groups (a new author or a
   time gap starts a fresh group with the avatar + timestamp). */
.msg:not(.grouped) { margin-top: 17px; padding-top: 4px; }
.messages > .welcome + .msg:not(.grouped),
.messages > .date-divider + .msg:not(.grouped) { margin-top: 2px; }
.msg:hover { background: rgba(2,2,2,.06); }
.msg-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 600; flex-shrink: 0; margin-top: 2px; font-size: 15px; }
.msg.grouped { padding-top: 1px; padding-bottom: 1px; }
.msg.grouped .msg-avatar { visibility: hidden; height: 0; margin: 0; }
.msg.grouped .msg-gutter-time { visibility: hidden; position: absolute; left: 0;
  width: 56px; text-align: center; font-size: 10px; color: var(--text-faint);
  margin-top: 4px; }
.msg.grouped:hover .msg-gutter-time { visibility: visible; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-author { font-weight: 600; color: var(--text-bright); font-size: 15px;
  cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-time { font-size: 11px; color: var(--text-faint); }
.msg-content { color: var(--text); font-size: 15px; line-height: 1.375;
  white-space: pre-wrap; word-wrap: break-word; }
.msg-content .edited { font-size: 10px; color: var(--text-faint); margin-left: 4px; }
.msg-content code { background: var(--bg-rail); padding: 1px 4px; border-radius: 4px;
  font-family: Consolas, monospace; font-size: 13px; }
.msg-content pre { background: var(--bg-rail); padding: 8px 10px; border-radius: 4px;
  margin: 4px 0; overflow-x: auto; border: 1px solid var(--divider); }
.msg-content pre code { background: none; padding: 0; }
.msg-content a { color: var(--link); text-decoration: none; }
.msg-content a:hover { text-decoration: underline; }
.msg-content blockquote { border-left: 4px solid var(--bg-active);
  padding-left: 10px; margin: 2px 0; color: var(--text); }
.msg-content strong { font-weight: 700; }
.msg-content .spoiler { background: var(--bg-float); color: transparent;
  border-radius: 4px; cursor: pointer; }
.msg-content .spoiler.revealed { color: var(--text); background: var(--bg-rail); }

.msg-actions {
  position: absolute; top: -12px; right: 12px; background: var(--bg-float);
  border: 1px solid var(--line); border-radius: 6px; display: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.msg:hover .msg-actions { display: flex; }
.msg-action { display: flex; align-items: center; justify-content: center;
  padding: 6px 7px; color: var(--text-muted); }
.msg-action:hover { color: var(--text-bright); background: var(--bg-hover); }

.msg-edit-box { width: 100%; background: var(--bg-input); border: none;
  border-radius: 6px; padding: 8px 10px; color: var(--text-bright); font-size: 15px;
  outline: none; margin: 2px 0; }
.edit-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.reaction { display: flex; align-items: center; gap: 4px; background: var(--bg-rail);
  border: 1px solid transparent; border-radius: 8px; padding: 1px 7px; font-size: 13px;
  cursor: pointer; color: var(--text); }
.reaction:hover { border-color: var(--text-faint); }
.reaction.mine { background: rgba(88,101,242,.18); border-color: var(--accent); }
.reaction .r-count { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.reaction.mine .r-count { color: #c9cdfb; }

.date-divider { display: flex; align-items: center; margin: 14px 16px 6px;
  color: var(--text-faint); font-size: 12px; font-weight: 600; }
.date-divider::before, .date-divider::after { content: ""; flex: 1;
  height: 1px; background: var(--line); }
.date-divider span { padding: 0 8px; }

/* composer */
.composer { display: flex; align-items: center; gap: 10px; margin: 0 16px 24px;
  background: var(--bg-input); border-radius: 8px; padding: 0 16px; flex-shrink: 0;
  border: 1px solid var(--line); }
.composer input { flex: 1; padding: 12px 0; border: none; background: none;
  color: var(--text-bright); font-size: 15px; outline: none; }
.composer input::placeholder { color: var(--text-muted); }
.composer-icon { display: flex; align-items: center; color: var(--text-muted); }
.composer-icon:hover { color: var(--text-bright); }

/* friends view */
.friends-view { flex: 1; overflow-y: auto; padding: 16px 24px; }
.friends-head { font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: .4px; margin-bottom: 10px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px;
  border-top: 1px solid var(--line); }
.friend-row:hover { background: var(--bg-hover); }
.friend-info { flex: 1; min-width: 0; }
.friend-name { color: var(--text-bright); font-weight: 600; font-size: 15px; }
.friend-status { color: var(--text-muted); font-size: 13px; }
.friend-btn { background: var(--bg-rail); color: var(--text); padding: 8px 14px;
  border-radius: 20px; font-size: 14px; font-weight: 500; }
.friend-btn:hover { background: var(--accent); color: #fff; }

/* voice stage */
.voice-stage { flex: 1; display: flex; flex-direction: column;
  background: #000; }
.voice-stage-inner { flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 30px; padding: 24px; }
.voice-tiles { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.voice-tile { width: 180px; height: 130px; background: var(--bg-rail);
  border-radius: 10px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; border: 3px solid transparent; }
.voice-tile.speaking { border-color: var(--green); }
.voice-tile .vt-avatar { width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  color: #fff; font-weight: 600; }
.voice-tile .vt-name { color: var(--text-bright); font-size: 14px; font-weight: 600; }
.voice-tile .vt-muted { color: var(--danger-text); font-size: 12px; }
.voice-controls { display: flex; gap: 14px; }
.voice-ctl { width: 54px; height: 54px; border-radius: 50%; background: var(--bg-sidebar);
  font-size: 22px; display: flex; align-items: center; justify-content: center;
  color: var(--text-bright); }
.voice-ctl:hover { background: var(--bg-active); }
.voice-ctl.active { background: #fff; color: #000; }
.voice-ctl.leave { background: var(--danger); color: #fff; }
.voice-ctl.leave:hover { background: #a12828; }

/* members */
.members { width: 240px; background: var(--bg-members); padding: 16px 8px;
  overflow-y: auto; border-left: 1px solid var(--line); }
.members.hidden { display: none; }
.member-group-head { font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); padding: 16px 8px 4px; letter-spacing: .4px; }
.member { display: flex; align-items: center; gap: 10px; padding: 5px 8px;
  border-radius: 4px; cursor: pointer; }
.member:hover { background: var(--bg-hover); }
.member-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 600; font-size: 13px; position: relative; flex-shrink: 0; }
.member-dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px;
  border-radius: 50%; border: 3px solid var(--bg-members); background: var(--text-faint); }
.member-dot.online { background: var(--green); }
.member-text { min-width: 0; }
.member-name { font-size: 15px; color: var(--text); font-weight: 500; }
.member-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.member.offline { opacity: .45; }

/* emoji picker */
.emoji-picker { position: fixed; background: var(--bg-float); border-radius: 8px;
  padding: 10px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6); z-index: 90; max-width: 340px;
  border: 1px solid var(--line); }
.emoji-picker.react { grid-template-columns: repeat(6, 1fr); }
.emoji-opt { font-size: 20px; width: 34px; height: 34px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; }
.emoji-opt:hover { background: var(--bg-hover); }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 120; }
.modal { width: 440px; max-width: 92vw; background: var(--bg-float);
  border-radius: 8px; padding: 24px; box-shadow: 0 8px 24px rgba(0,0,0,.6);
  border: 1px solid var(--line); }
.modal h2 { color: var(--text-bright); font-size: 20px; margin-bottom: 8px; }
.modal p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.btn-ghost { background: transparent; color: var(--text); padding: 10px 16px;
  font-size: 14px; font-weight: 600; }
.btn-ghost:hover { text-decoration: underline; }
.btn-go { background: var(--accent); color: #fff; padding: 10px 20px;
  border-radius: 4px; font-size: 14px; font-weight: 600; }
.btn-go:hover { background: var(--accent-hover); }
.seg { display: flex; gap: 8px; margin: 6px 0 2px; }
.seg button { flex: 1; padding: 10px; border-radius: 6px; background: var(--divider);
  color: var(--text-muted); font-weight: 600; font-size: 14px; }
.seg button.active { background: var(--accent); color: #fff; }
.invite-code { background: var(--divider); color: var(--green); font-weight: 700;
  padding: 10px 12px; border-radius: 4px; font-family: monospace; font-size: 16px;
  user-select: all; letter-spacing: 1px; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #fff; padding: 10px 20px; border-radius: 6px;
  font-size: 14px; font-weight: 600; z-index: 140; box-shadow: 0 4px 14px rgba(0,0,0,.4); }

@media (max-width: 820px) {
  .members { display: none; }
  .sidebar { width: 200px; }
}

/* ===================== v3: status, profile, settings, friends ===================== */

/* status dot colors */
.presence-dot.dot-online, .sdot.dot-online { background: var(--green); }
.presence-dot.dot-idle, .sdot.dot-idle { background: var(--yellow); }
.presence-dot.dot-dnd, .sdot.dot-dnd { background: var(--danger-text); }
.presence-dot.dot-offline, .sdot.dot-offline { background: var(--text-faint); }
.member-dot.dot-online { background: var(--green); }

/* avatar as image */
.avatar.has-img, .member-avatar.has-img, .msg-avatar.has-img { color: transparent; }
.avatar.group-av { background: var(--accent) !important; color: #fff;
  display: flex; align-items: center; justify-content: center; }

/* user panel area clickable */
.user-id-area { display: flex; align-items: center; gap: 8px; flex: 1;
  min-width: 0; padding: 2px 4px; border-radius: 4px; cursor: pointer; }
.user-id-area:hover { background: var(--bg-hover); }
.owner-crown { font-size: 11px; }

/* ---- friends tabs ---- */
.friends-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.friends-tabs { display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ftab { padding: 4px 10px; border-radius: 4px; color: var(--text-muted);
  font-weight: 500; font-size: 15px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.ftab:hover { background: var(--bg-hover); color: var(--text); }
.ftab.active { background: var(--bg-active); color: var(--text-bright); }
.ftab .badge { background: var(--danger); color: #fff; border-radius: 8px;
  font-size: 11px; padding: 0 5px; font-weight: 700; }
.ftab-add { padding: 4px 10px; border-radius: 4px; background: var(--green);
  color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.ftab-add.active { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.friends-content { flex: 1; overflow-y: auto; padding: 8px 16px 24px; }

.friend-ico-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-rail);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center; margin-left: 8px; }
.friend-ico-btn:hover { background: var(--bg-active); color: var(--text-bright); }
.friend-ico-btn.accept:hover { color: var(--green); }
.friend-row .avatar .presence-dot { border-color: var(--bg-chat); }
.friend-row:hover .friend-ico-btn { background: var(--bg-float); }

/* add friend */
.add-friend { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 8px; }
.af-title { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--text-bright); margin: 8px 0 6px; }
.af-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }
.af-row { display: flex; gap: 10px; background: var(--bg-rail); border-radius: 8px;
  padding: 8px; border: 1px solid var(--line); }
.af-input { flex: 1; background: none; border: none; outline: none; color: var(--text-bright); font-size: 15px; }
.af-tag { color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 6px 10px; }

/* ---- profile popup / card ---- */
.profile-pop { position: fixed; z-index: 95; width: 320px; }
.pcard { background: var(--bg-float); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.pcard-banner { height: 60px; }
.pcard-avatar { width: 80px; height: 80px; border-radius: 50%; margin: -40px 0 0 16px;
  border: 6px solid var(--bg-float); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
  font-size: 24px; position: relative; }
.pcard-avatar .presence-dot { width: 18px; height: 18px; right: 2px; bottom: 2px; border-width: 4px;
  border-color: var(--bg-float); }
.pcard-body { padding: 10px 16px 16px; }
.pcard-name { font-size: 20px; font-weight: 700; color: var(--text-bright); }
.pcard-handle { font-size: 14px; color: var(--text-muted); }
.pcard-custom { font-size: 14px; color: var(--text); margin-top: 8px; }
.pcard-divider { height: 1px; background: var(--line); margin: 12px 0; }
.pcard-label { font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--text-muted);
  text-transform: uppercase; margin-bottom: 2px; }
.pcard-text { font-size: 14px; color: var(--text); margin-bottom: 8px; white-space: pre-wrap; }
.pcard-msg-btn { width: 100%; margin-top: 12px; padding: 9px; background: var(--accent);
  color: #fff; border-radius: 6px; font-weight: 600; font-size: 14px; }
.pcard-msg-btn:hover { background: var(--accent-hover); }
.status-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px;
  cursor: pointer; font-size: 14px; color: var(--text); }
.status-opt:hover { background: var(--bg-hover); }
.status-opt.active { background: var(--bg-active); }
.sdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pcard-action { padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 14px; color: var(--text); }
.pcard-action:hover { background: var(--bg-hover); }
.pcard-action.danger { color: var(--danger-text); }
.pcard-action.danger:hover { background: var(--danger); color: #fff; }

/* ---- settings overlay ---- */
.settings { position: fixed; inset: 0; z-index: 100; display: flex; background: var(--bg-chat); }
.settings-sidebar { flex: 1; background: var(--bg-sidebar); display: flex; justify-content: flex-end;
  border-right: 1px solid var(--line); }
.settings-sidebar-inner { width: 220px; padding: 60px 8px 20px 20px; }
.settings-cat { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--text-muted);
  text-transform: uppercase; padding: 6px 10px; }
.settings-item { padding: 8px 10px; border-radius: 4px; color: var(--text-muted); font-weight: 500;
  font-size: 15px; cursor: pointer; margin: 1px 0; }
.settings-item:hover { background: var(--bg-hover); color: var(--text); }
.settings-item.active { background: var(--bg-active); color: var(--text-bright); }
.settings-item.danger { color: var(--danger-text); }
.settings-item.danger:hover { background: var(--danger); color: #fff; }
.settings-sep { height: 1px; background: var(--line); margin: 8px 10px; }
.settings-main { flex: 2.2; position: relative; overflow-y: auto; }
.settings-content { max-width: 660px; padding: 60px 40px; }
.settings-close { position: absolute; top: 60px; right: 40px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; color: var(--text-muted); width: 44px; }
.settings-close:hover { color: var(--text-bright); }
.settings-close span { font-size: 11px; font-weight: 700; }
.settings-close .ic { border: 2px solid currentColor; border-radius: 50%; padding: 4px; width: 36px; height: 36px; }
.settings-h1 { color: var(--text-bright); font-size: 20px; margin-bottom: 20px; }
.settings-h2 { color: var(--text-bright); font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  margin: 28px 0 10px; }
.settings-p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* account card */
.account-card { background: var(--bg-rail); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.account-banner { height: 80px; }
.account-head { display: flex; align-items: center; gap: 16px; padding: 0 16px 16px; margin-top: -30px; }
.account-avatar { width: 80px; height: 80px; border-radius: 50%; border: 6px solid var(--bg-rail);
  background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 24px; position: relative; }
.account-avatar .presence-dot { border-color: var(--bg-rail); width: 18px; height: 18px; border-width: 4px; }
.account-name { flex: 1; font-size: 20px; font-weight: 700; color: var(--text-bright); margin-top: 30px; }
.account-head .btn-go { margin-top: 30px; }
.account-fields { background: var(--bg-float); margin: 0 16px 16px; border-radius: 8px; padding: 16px; }
.account-field { margin-bottom: 14px; }
.af-k { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--text-muted); text-transform: uppercase; }
.af-v { color: var(--text-bright); font-size: 15px; margin-top: 2px; }

.pw-form label { display: block; text-transform: uppercase; font-size: 12px; font-weight: 700;
  color: var(--text-muted); margin: 10px 0 6px; }
.pw-form input { width: 100%; max-width: 400px; padding: 10px 12px; border-radius: 4px; border: none;
  background: var(--divider); color: var(--text-bright); font-size: 15px; outline: none; display: block; }
.pw-form .btn-go { margin-top: 14px; }

/* profile settings */
.profile-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.profile-form label { display: block; text-transform: uppercase; font-size: 12px; font-weight: 700;
  color: var(--text-muted); margin: 14px 0 6px; }
.profile-form input[type=text], .profile-form input:not([type]), .profile-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 4px; border: none; background: var(--divider);
  color: var(--text-bright); font-size: 15px; outline: none; resize: vertical; font-family: inherit; }
.profile-form input[type=color] { width: 60px; height: 40px; border: none; background: none; border-radius: 6px; cursor: pointer; }
.avatar-row { display: flex; gap: 10px; }
.profile-preview { }
.pp-label { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--text-muted);
  text-transform: uppercase; margin: 14px 0 8px; }
.pp-holder .pcard { box-shadow: none; }

/* appearance swatches */
.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.swatch.active { border-color: var(--text-bright); box-shadow: 0 0 0 2px var(--bg-chat) inset; }
.custom-color { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.custom-color label { text-transform: uppercase; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.custom-color input { width: 60px; height: 40px; border: none; background: none; cursor: pointer; }

/* ---- new message modal ---- */
.nm-modal .nm-search { width: 100%; padding: 10px 12px; border-radius: 4px; border: none;
  background: var(--divider); color: var(--text-bright); font-size: 15px; outline: none; margin-bottom: 10px; }
.nm-list { max-height: 320px; overflow-y: auto; margin-bottom: 8px; }
.nm-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; cursor: pointer; }
.nm-row:hover { background: var(--bg-hover); }
.nm-row.sel { background: var(--bg-active); }
.nm-info { flex: 1; min-width: 0; }
.nm-name { color: var(--text-bright); font-weight: 600; font-size: 15px; }
.nm-handle { color: var(--text-muted); font-size: 12px; }
.nm-check { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--text-faint);
  display: flex; align-items: center; justify-content: center; color: #fff; }
.nm-check.on { background: var(--accent); border-color: var(--accent); }

/* ---- channel modal ---- */
.channel-modal .cm-sub { color: var(--text-muted); font-size: 13px; margin: -6px 0 16px; }
.cm-label { text-transform: uppercase; font-size: 12px; font-weight: 700; color: var(--text-muted); margin: 14px 0 8px; }
.cm-opt { text-transform: none; font-weight: 400; }
.cm-types { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.cm-type { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-rail);
  border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.cm-type:hover { background: var(--bg-hover); }
.cm-type.active { background: var(--bg-hover); border-color: var(--accent); }
.cm-type-ic { color: var(--text-muted); }
.cm-type.active .cm-type-ic { color: var(--text-bright); }
.cm-type-txt { flex: 1; }
.cm-type-name { color: var(--text-bright); font-weight: 600; font-size: 15px; }
.cm-type-desc { color: var(--text-muted); font-size: 13px; }
.cm-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-faint); flex-shrink: 0; }
.cm-type.active .cm-radio { border-color: var(--accent); background:
  radial-gradient(circle, var(--accent) 0 5px, transparent 6px); }
.cm-name-row { display: flex; align-items: center; gap: 6px; background: var(--divider);
  border-radius: 4px; padding: 0 12px; }
.cm-hash { color: var(--text-muted); font-size: 18px; }
.cm-name-row input { flex: 1; padding: 10px 0; border: none; background: none; color: var(--text-bright);
  font-size: 15px; outline: none; }
.channel-modal #cm-topic { width: 100%; padding: 10px 12px; border-radius: 4px; border: none;
  background: var(--divider); color: var(--text-bright); font-size: 15px; outline: none; }
.cm-private { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; gap: 12px; }
.cm-priv-title { color: var(--text-bright); font-weight: 600; font-size: 15px; }
.cm-priv-sub { color: var(--text-muted); font-size: 12px; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: var(--text-faint); border-radius: 24px; transition: .2s; cursor: pointer; }
.slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.ch-lock { margin-left: auto; opacity: .6; display: flex; align-items: center; }

@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }

.auth-card .opt, label .opt { text-transform: none; font-weight: 400; color: var(--text-faint); font-size: 11px; }

/* ===================== v4: group DM + account rows ===================== */
.welcome-actions { display: flex; gap: 10px; margin-top: 16px; }
.wa-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px;
  background: var(--bg-active); color: var(--text-bright); font-size: 14px; font-weight: 500; }
.wa-btn.primary { background: var(--accent); color: #fff; }
.wa-btn:hover { filter: brightness(1.12); }
.wa-btn .ic { width: 16px; height: 16px; }

.invite-group-btn { display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 16px); margin: 12px 8px; padding: 10px; border-radius: 6px;
  background: var(--bg-active); color: var(--text-bright); font-size: 14px; font-weight: 500; }
.invite-group-btn:hover { background: var(--accent); color: #fff; }
.invite-group-btn .ic { width: 16px; height: 16px; }

.acct-section { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 6px; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.acct-row + .acct-row { border-top: 1px solid var(--line); }
.acct-row-main { min-width: 0; }
.acct-k { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--text-muted);
  text-transform: uppercase; margin-bottom: 3px; }
.acct-v { color: var(--text-bright); font-size: 15px; }
.acct-v-wrap { display: flex; align-items: center; gap: 10px; }
.acct-reveal { color: var(--link); font-size: 13px; font-weight: 600; }
.acct-reveal:hover { text-decoration: underline; }
.acct-btns { display: flex; gap: 8px; flex-shrink: 0; }
.acct-edit { background: var(--bg-active); color: var(--text-bright); padding: 7px 18px;
  border-radius: 4px; font-size: 14px; font-weight: 500; }
.acct-edit:hover { background: var(--bg-hover); }
.btn-ghost.danger-text { color: var(--danger-text); }

/* ===================== v5: voice UI, context menu, profile card, server settings ===================== */

/* voice connection bar (above user panel) */
.voice-bar { background: var(--bg-rail); border-top: 1px solid var(--line); padding: 8px 8px 0; }
.vb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #0d0d0f; border-radius: 8px; padding: 8px 10px; }
.vb-info { min-width: 0; flex: 1; }
.vb-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 13px; font-weight: 700; }
.vb-status .ic { stroke: var(--green); width: 16px; height: 16px; }
.vb-sub { color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; margin-top: 2px; }
.vb-timer { color: var(--text-muted); font-size: 12px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.vb-disc { width: 34px; height: 34px; border-radius: 8px; background: var(--bg-active); color: var(--text-bright);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vb-disc:hover { background: var(--danger); color: #fff; }

/* persistent panel controls */
.panel-ctls { display: flex; gap: 1px; }
.panel-ic { width: 32px; height: 32px; border-radius: 4px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; }
.panel-ic:hover { background: var(--bg-hover); color: var(--text-bright); }
.panel-ic.danger-on { color: var(--danger-text); }
.panel-ic.danger-on:hover { background: rgba(218,55,60,.16); color: var(--danger-text); }

/* stage buttons red when active */
.voice-ctl.muted { background: var(--danger); color: #fff; }
.voice-ctl.muted:hover { background: #b52e32; }

/* speaking rings */
.user-avatar.speaking, .vt-avatar.speaking,
.voice-member.speaking .vm-avatar { box-shadow: 0 0 0 3px var(--green); }
.voice-member.speaking { color: var(--text-bright); }
.vt-mic { color: var(--danger-text); display: flex; align-items: center; }
.call-timer { color: var(--text-muted); font-size: 13px; }

/* active voice channel = green */
.channel.in-voice .ch-icon, .channel.in-voice .ch-name { color: var(--green) !important; opacity: 1; }

/* context menu */
.ctx-menu { position: fixed; z-index: 150; background: var(--bg-float); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px; min-width: 190px; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.ctx-item { padding: 8px 10px; border-radius: 4px; font-size: 14px; color: var(--text); cursor: pointer; }
.ctx-item:hover { background: var(--accent); color: #fff; }
.ctx-item.danger { color: var(--danger-text); }
.ctx-item.danger:hover { background: var(--danger); color: #fff; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---- profile card redesign ---- */
.pcard { background: var(--bg-float); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; box-shadow: 0 12px 34px rgba(0,0,0,.65); width: 300px; }
.pcard-banner { height: 105px; background-size: cover; background-position: center; }
.pcard-avatar-wrap { position: relative; width: 84px; height: 84px; margin: -48px 0 0 16px; }
.pcard-avatar { width: 84px; height: 84px; margin: 0; border-radius: 50%; border: 6px solid var(--bg-float);
  background-size: cover; background-position: center; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; font-size: 26px; }
.pcard-dot { position: absolute; right: 1px; bottom: 1px; width: 26px; height: 26px; border-radius: 50%;
  border: 6px solid var(--bg-float); box-sizing: border-box; }
.pcard-body { padding: 10px 16px 16px; }
.pcard-inner { background: var(--bg-rail); border-radius: 8px; padding: 12px 14px; }
.pcard-name { font-size: 20px; font-weight: 700; color: var(--text-bright); line-height: 1.2; }
.pcard-handle { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.pcard-custom { font-size: 13px; color: var(--text); margin-top: 8px; }
.pcard-inner .pcard-divider { height: 1px; background: var(--line); margin: 10px 0; }
.pcard-label { font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--text-muted);
  text-transform: uppercase; margin-bottom: 3px; }
.pcard-text { font-size: 13px; color: var(--text); white-space: pre-wrap; line-height: 1.4; }
.pcard-msg-btn { width: 100%; margin-top: 10px; }
.pcard-body > .status-opt:first-of-type { margin-top: 10px; }

/* guild icon image */
.guild-icon.has-img { background-size: cover; background-position: center; color: transparent; }

/* ---- server settings modal ---- */
.srv-modal .srv-banner { height: 120px; border-radius: 8px; background: var(--bg-active);
  background-size: cover; background-position: center; }
.srv-icon-row { display: flex; align-items: flex-end; gap: 16px; padding: 0 2px; margin-top: -40px; }
.srv-icon { width: 84px; height: 84px; border-radius: 50%; border: 6px solid var(--bg-float);
  background-size: cover; background-position: center; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; font-size: 26px; flex-shrink: 0; }
.srv-icon-btns { display: flex; gap: 8px; padding-bottom: 12px; }
.srv-icon-btns .btn-go { padding: 8px 12px; font-size: 13px; }
.srv-icon-btns .btn-go:disabled { opacity: .4; cursor: default; }
.srv-modal label { display: block; text-transform: uppercase; font-size: 12px; font-weight: 700;
  color: var(--text-muted); margin: 14px 0 6px; }
.srv-modal input { width: 100%; padding: 10px 12px; border-radius: 4px; border: none;
  background: var(--divider); color: var(--text-bright); font-size: 15px; outline: none; }

/* ===================== v6: profile fixes + full profile ===================== */
/* status dot now actually lights up on the profile cards */
.pcard-dot.dot-online, .fp-dot.dot-online { background: var(--green); }
.pcard-dot.dot-idle,   .fp-dot.dot-idle   { background: var(--yellow); }
.pcard-dot.dot-dnd,    .fp-dot.dot-dnd    { background: var(--danger-text); }
.pcard-dot.dot-offline,.fp-dot.dot-offline{ background: var(--text-faint); }

/* name/handle sit directly on the card now (no black box) */
.pcard-body { padding: 12px 16px 16px; }
.pcard-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pcard-msg-btn { margin-top: 0; }
.pcard-view-btn { width: 100%; padding: 9px; background: var(--bg-active); color: var(--text-bright);
  border-radius: 6px; font-weight: 600; font-size: 14px; }
.pcard-view-btn:hover { background: var(--bg-hover); }

/* full centered profile */
#modal-title:empty { display: none; margin: 0; }
.modal:has(.fullprofile) { width: 600px; max-width: 94vw; padding: 0; overflow: hidden; }
.fp-banner { height: 150px; background: var(--bg-active); }
.fp-avatar-wrap { position: relative; width: 120px; height: 120px; margin: -70px 0 0 24px; }
.fp-avatar { width: 120px; height: 120px; border-radius: 50%; border: 7px solid var(--bg-float);
  background-size: cover; background-position: center; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; font-size: 40px; }
.fp-dot { position: absolute; right: 7px; bottom: 7px; width: 32px; height: 32px; border-radius: 50%;
  border: 7px solid var(--bg-float); box-sizing: border-box; }
.fp-panel { padding: 8px 24px 24px; }
.fp-name { font-size: 24px; font-weight: 700; color: var(--text-bright); }
.fp-handle { font-size: 15px; color: var(--text-muted); margin-top: 2px; }
.fp-custom { font-size: 14px; color: var(--text); margin-top: 10px; }
.fp-divider { height: 1px; background: var(--line); margin: 14px 0; }
.fp-label { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--text-muted);
  text-transform: uppercase; margin-bottom: 4px; }
.fp-text { font-size: 14px; color: var(--text); white-space: pre-wrap; line-height: 1.45; }
.fp-btns { margin-top: 18px; }
.fp-btns .btn-go { width: 100%; padding: 11px; }

/* voice stage controls: cleaner Discord-like pill */
.voice-controls { background: var(--bg-rail); border-radius: 32px; padding: 8px; gap: 8px; }

/* ===================== v7: profile badges ===================== */
.pcard { position: relative; }
.fullprofile { position: relative; }
.badge-row { display: flex; gap: 2px; align-items: center; }
.badge { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.badge svg { border-radius: 5px; display: block; }
.pcard-badges { position: absolute; top: 112px; right: 14px; background: var(--bg-rail);
  border-radius: 8px; padding: 4px 6px; display: flex; gap: 3px; z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.fp-badges { position: absolute; top: 160px; right: 24px; background: var(--bg-rail);
  border-radius: 8px; padding: 5px 8px; display: flex; gap: 4px; z-index: 2; }
.fp-badges .badge { width: 26px; height: 26px; }
.badge img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ===================== v8: file attachments ===================== */
.attach-tray { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 16px 8px; padding: 10px;
  background: var(--bg-input); border-radius: 8px; border: 1px solid var(--line); }
.attach-chip { display: flex; align-items: center; gap: 8px; background: var(--bg-rail);
  border-radius: 6px; padding: 6px 8px; }
.attach-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.attach-fileicon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-active); border-radius: 4px; color: var(--text-muted); }
.attach-meta { min-width: 0; }
.attach-name { font-size: 13px; color: var(--text-bright); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 130px; }
.attach-sub { font-size: 11px; color: var(--text-muted); }
.attach-rm { width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff;
  font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.msg-attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; align-items: flex-start; }
.msg-image { max-width: 400px; max-height: 320px; border-radius: 8px; display: block; cursor: pointer;
  background: var(--bg-rail); }
.file-chip { display: flex; align-items: center; gap: 12px; background: var(--bg-sidebar);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; max-width: 420px;
  text-decoration: none; color: inherit; }
.file-chip:hover { background: var(--bg-hover); }
.file-chip-ic { color: var(--accent); display: flex; }
.file-chip-meta { flex: 1; min-width: 0; }
.file-chip-name { color: var(--link); font-size: 15px; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.file-chip-size { color: var(--text-muted); font-size: 12px; }
.file-chip-dl { color: var(--text-muted); display: flex; }
.file-chip:hover .file-chip-dl { color: var(--text-bright); }

/* ===================== v9: @mentions ===================== */
.mention { background: rgba(88,101,242,.28); color: #c9cdfb; border-radius: 4px;
  padding: 0 2px; font-weight: 600; cursor: default; }
.mention:hover { background: var(--accent); color: #fff; }
.mention-all { background: rgba(240,178,50,.22); color: #f0b232; }
.mention-all:hover { background: var(--yellow); color: #000; }
.mention.mention-me { background: rgba(240,178,50,.3); color: #f6d479; }
/* message that pings you: yellow tint + left bar, like Discord */
.msg.mentioned { background: rgba(240,178,50,.08); box-shadow: inset 2px 0 0 var(--yellow); }
.msg.mentioned:hover { background: rgba(240,178,50,.12); }

/* ===================== v10: splash, wither logo + theme ===================== */
@font-face { font-family: 'Afraid'; src: url('/afraid.ttf') format('truetype'); font-display: swap; }

.splash { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #191430 0%, transparent 60%), #0b0d10;
  transition: opacity .4s ease; }
.splash.gone { opacity: 0; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.splash-logo { width: 96px; height: 96px; border-radius: 24px; object-fit: cover;
  box-shadow: 0 10px 40px rgba(139,92,246,.4); animation: splashpulse 1.6s ease-in-out infinite; }
.splash-name { font-family: 'Afraid', 'gg sans', sans-serif; font-size: 36px; font-weight: 700;
  letter-spacing: 1px; background: linear-gradient(135deg, #8b5cf6, #5865f2);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-bar { width: 190px; height: 4px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.splash-bar-fill { width: 40%; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #8b5cf6, #5865f2); animation: splashbar 1.1s ease-in-out infinite; }
@keyframes splashpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes splashbar { 0% { transform: translateX(-120%); } 100% { transform: translateX(350%); } }

.guild-icon.home { padding: 0; overflow: hidden; }
.home-logo { width: 100%; height: 100%; object-fit: cover; }
.auth-logo-img { width: 76px; height: 76px; border-radius: 20px; object-fit: cover; display: block;
  margin: 0 auto 12px; box-shadow: 0 6px 24px rgba(139,92,246,.35); }
.auth-screen { background: radial-gradient(1200px 600px at 50% -10%, #191430 0%, transparent 60%), #0b0d10; }
.auth-logo { font-family: 'Afraid', 'gg sans', sans-serif; letter-spacing: 1px;
  background: linear-gradient(135deg, #8b5cf6, #5865f2); -webkit-background-clip: text;
  background-clip: text; color: transparent; }

/* ===================== v11: mention badges + bigger picker ===================== */
.guild-wrap { position: relative; display: flex; justify-content: center; width: 100%; }
.mention-badge { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; padding: 0 5px; }
.guild-wrap > .mention-badge { position: absolute; bottom: -2px; right: 10px; border: 3px solid var(--bg-rail); }
.channel > .mention-badge, .dm-row > .mention-badge { margin-left: auto; flex-shrink: 0; }
.channel.has-mention .ch-name { color: var(--text-bright); font-weight: 600; }
.emoji-picker { max-height: 300px; overflow-y: auto; }
