:root {
  color-scheme: dark;
  --bg: #05090d;
  --bg-soft: #071018;
  --rail: #061016;
  --side: #0a151d;
  --side-2: #0d1a24;
  --panel: #0f1d28;
  --panel-2: #132636;
  --panel-3: #183348;
  --chat: #071017;
  --composer: #0e1d29;
  --input: #122433;
  --input-2: #173349;
  --text: #f2f8fb;
  --text-soft: #d6e4ea;
  --muted: #8da2ad;
  --muted-2: #687d88;
  --border: rgba(164, 219, 230, .10);
  --border-strong: rgba(164, 219, 230, .18);
  --accent: #12b7a6;
  --accent-2: #20d6c4;
  --accent-3: #38bdf8;
  --accent-dark: #087f78;
  --accent-soft: rgba(18, 183, 166, .18);
  --orange: #f59e0b;
  --green: #32d583;
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, .14);
  --shadow: rgba(0, 0, 0, .55);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --rail-w: 74px;
  --side-w: 300px;
  --members-w: 276px;
  --topbar-h: 70px;
  --mobile-nav-h: 66px;
  font-size: 16px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef7f8;
  --bg-soft: #f7fbfc;
  --rail: #dbeef0;
  --side: #eaf5f7;
  --side-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f0f8fa;
  --panel-3: #dff1f4;
  --chat: #f8fcfd;
  --composer: #ffffff;
  --input: #e8f3f6;
  --input-2: #dceff2;
  --text: #0f1720;
  --text-soft: #273642;
  --muted: #647986;
  --muted-2: #8194a0;
  --border: rgba(15, 23, 32, .10);
  --border-strong: rgba(15, 23, 32, .16);
  --accent-soft: rgba(18, 183, 166, .13);
  --shadow: rgba(15, 23, 32, .18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  min-width: 320px;
  background:
    radial-gradient(circle at 14% -12%, rgba(32, 214, 196, .18), transparent 34rem),
    radial-gradient(circle at 94% 105%, rgba(56, 189, 248, .12), transparent 30rem),
    linear-gradient(145deg, var(--bg), var(--bg-soft));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: 13px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #04201d;
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s ease, opacity .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(18, 183, 166, .16); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: .46; cursor: not-allowed; box-shadow: none; }

input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 12px 13px;
  outline: 0;
  background: var(--input);
  color: var(--text);
}
textarea { min-height: 92px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, textarea:focus, select:focus { border-color: rgba(32, 214, 196, .74); box-shadow: 0 0 0 4px var(--accent-soft); }

.app { width: 100vw; height: 100vh; height: 100dvh; display: grid; place-items: center; overflow: hidden; }

/* AUTH */
.auth-card {
  width: min(1060px, calc(100vw - 36px));
  min-height: min(680px, calc(100dvh - 36px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  background: rgba(10, 21, 29, .88);
  box-shadow: 0 30px 120px var(--shadow);
  backdrop-filter: blur(18px);
}
.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: 52px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    radial-gradient(circle at 20% 18%, rgba(32, 214, 196, .44), transparent 18rem),
    radial-gradient(circle at 90% 82%, rgba(56, 189, 248, .24), transparent 19rem),
    linear-gradient(145deg, #061016, #102737 64%, #071017);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}
.auth-hero::after { content: ""; position: absolute; inset: 24px; border: 1px solid rgba(255,255,255,.09); border-radius: 26px; pointer-events: none; }
.auth-hero > * { position: relative; z-index: 1; }
.app-logo { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, var(--accent-2), var(--accent-3)); color: #04201d; font-weight: 950; box-shadow: 0 18px 42px rgba(32,214,196,.22); }
.app-logo.big { width: 82px; height: 82px; border-radius: 26px; font-size: 34px; }
.eyebrow { margin: 0; color: #b6fff4; font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: .18em; }
.eyebrow.mini { color: var(--muted-2); font-size: 10px; letter-spacing: .14em; }
.auth-hero h1 { margin: 0; font-size: clamp(46px, 8vw, 82px); line-height: .9; letter-spacing: -.08em; }
.auth-hero p:not(.eyebrow) { max-width: 520px; margin: 0; color: #d8edf2; font-weight: 700; line-height: 1.58; }
.auth-form { display: flex; flex-direction: column; justify-content: center; gap: 17px; padding: 46px; background: var(--side-2); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; border-radius: 17px; background: var(--input); }
.tab { background: transparent; color: var(--muted); box-shadow: none; }
.tab:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #04201d; }
.auth-form label, .modal-card label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 850; }
.form-error { min-height: 22px; margin: 0; color: #ffb4bd; font-size: 13px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.api-config-box { display: none !important; }

/* LAYOUT */
.chat-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr) var(--members-w);
  background: var(--chat);
  overflow: hidden;
}
.server-rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  background: linear-gradient(180deg, var(--rail), #05090d);
  border-right: 1px solid var(--border);
  z-index: 30;
}
.server-icons { min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; scrollbar-width: none; }
.server-icons::-webkit-scrollbar { display: none; }
.rail-divider { width: 34px; height: 2px; flex: 0 0 auto; border-radius: 999px; background: var(--border-strong); }
.rail-button {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 20px;
  font-weight: 950;
  overflow: visible;
}
.rail-button:hover, .rail-button.active { border-color: transparent; border-radius: 16px; background: linear-gradient(135deg, var(--accent-2), var(--accent-3)); color: #04201d; box-shadow: 0 12px 34px rgba(32,214,196,.18); }
.rail-button.add { margin-top: auto; background: var(--panel-2); color: var(--green); }
.rail-button.add:hover { background: linear-gradient(135deg, #32d583, #12b76a); color: #04120d; }
.rail-button img, .server-icon img, .avatar img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.rail-unread { position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; border: 2px solid var(--rail); border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 950; }

.channel-panel, .members-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--border); overflow: hidden; }
.members-panel { border-right: 0; border-left: 1px solid var(--border); background: #09131b; }
.workspace-header, .members-header { flex: 0 0 auto; min-height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: rgba(12, 25, 35, .86); }
.workspace-header strong, .members-header strong { display: block; font-size: 15px; font-weight: 950; letter-spacing: -.02em; }
.workspace-header span:not(.connection-dot), .members-header span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 750; }
.connection-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
body.is-connected .connection-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(50,213,131,.13); }
.sidebar-mode { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; padding: 12px; overflow-y: auto; }
.channel-section, .server-card { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(15, 29, 40, .78); box-shadow: 0 10px 24px rgba(0,0,0,.10); }
.channel-section { padding: 12px; }
.section-row, .card-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-label { margin: 0; color: var(--muted-2); font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .12em; }
.section-plus { width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); background: var(--input); color: var(--accent-2); }
.sidebar-action-button { width: 100%; display: flex; justify-content: space-between; align-items: center; margin: 10px 0 8px; background: var(--input); color: var(--text-soft); border: 1px solid var(--border); }
.sidebar-action-button span, .count-chip { min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-size: 12px; }
.users-list, .members-list, .compact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.user-item, .member-item, .compact-item, .channel-button { width: 100%; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 13px; color: var(--muted); background: transparent; border: 1px solid transparent; text-align: left; }
.user-item:hover, .member-item:hover, .compact-item:hover, .channel-button:hover { background: rgba(255,255,255,.045); border-color: var(--border); color: var(--text); transform: none; box-shadow: none; }
.user-item.active, .channel-button.active { background: linear-gradient(135deg, rgba(18,183,166,.20), rgba(56,189,248,.12)); border-color: rgba(32,214,196,.30); color: var(--text); }
.user-copy, .member-copy, .friend-copy, .server-title-copy { min-width: 0; display: grid; gap: 2px; }
.user-copy strong, .member-copy strong, .friend-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); font-size: 14px; font-weight: 900; }
.user-copy span, .member-copy span, .friend-copy span, .server-title-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 700; }
.unread-badge { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 950; }
.empty-state, .friendly-empty { padding: 14px; color: var(--muted); font-size: 13px; line-height: 1.45; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.friendly-empty strong { display: block; margin-bottom: 4px; color: var(--text-soft); }

.server-header-button { width: 100%; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; background: transparent; color: var(--text); box-shadow: none; }
.server-header-button:hover { background: rgba(255,255,255,.04); box-shadow: none; transform: none; }
.server-icon, .avatar { position: relative; width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #04201d; font-weight: 950; }
.server-icon.big { width: 46px; height: 46px; border-radius: 16px; }
.server-icon.huge, .avatar.huge { width: 82px; height: 82px; border-radius: 24px; font-size: 28px; }
.avatar { border-radius: 50%; }
.status-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border: 2px solid var(--side); border-radius: 999px; background: var(--muted-2); }
.status-dot.online { background: var(--green); }
.server-menu { position: relative; margin: 0 10px 10px; padding: 8px; display: grid; gap: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.server-menu button, .ghost-button, .mini-button { background: var(--input); color: var(--text-soft); border: 1px solid var(--border); box-shadow: none; }
.server-menu button:hover, .ghost-button:hover, .mini-button:hover { background: var(--input-2); color: var(--text); box-shadow: none; }
.inline-channel-form { display: grid; gap: 8px; margin-top: 10px; }
.inline-actions, .member-actions-row, .push-actions { display: flex; gap: 8px; }
.inline-actions button, .push-actions button { flex: 1; }
.channels-list { display: grid; gap: 5px; margin-top: 8px; }
.channel-button::before { content: "#"; color: var(--muted-2); font-weight: 950; }
.invite-panel { display: grid; gap: 10px; }
.invite-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.self-card { flex: 0 0 auto; margin: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 20px; background: rgba(6,16,22,.78); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.self-card-main { display: grid; grid-template-columns: 42px minmax(0, 1fr) 38px; gap: 10px; align-items: center; }
.self-copy { min-width: 0; display: grid; gap: 1px; }
.self-copy strong, .self-copy span, .self-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.self-copy strong { font-size: 14px; font-weight: 950; }
.self-copy span, .self-copy small { color: var(--muted); font-size: 11px; font-weight: 750; }
.mini-button { width: 38px; height: 38px; padding: 0; }
.logout-button { width: 100%; margin-top: 9px; background: var(--danger-soft); color: #fecdd3; border: 1px solid rgba(251,113,133,.22); }
.badge-row { display: flex; gap: 4px; flex-wrap: wrap; }
.platform-badge, .role-chip, .mode-badge { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 8px; border-radius: 999px; background: rgba(32,214,196,.12); color: var(--accent-2); font-size: 11px; font-weight: 950; }

/* CHAT */
.chat-panel { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(circle at 70% 0%, rgba(18,183,166,.06), transparent 28rem), var(--chat); overflow: hidden; }
.chat-topbar { flex: 0 0 var(--topbar-h); min-height: var(--topbar-h); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: rgba(7,16,23,.84); backdrop-filter: blur(12px); z-index: 10; }
.mobile-sidebar-btn { display: none; width: 42px; height: 42px; padding: 0; place-items: center; border: 1px solid var(--border); background: var(--input); color: var(--text); }
.chat-topbar strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 950; letter-spacing: -.02em; }
.chat-topbar span:not(.mode-badge) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 750; }
.messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px clamp(16px, 2vw, 28px) 14px; scroll-behavior: smooth; }
.messages::-webkit-scrollbar, .sidebar-mode::-webkit-scrollbar, .members-list::-webkit-scrollbar { width: 8px; }
.messages::-webkit-scrollbar-thumb, .sidebar-mode::-webkit-scrollbar-thumb, .members-list::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(255,255,255,.10); }
.message { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 12px; padding: 8px 10px; border-radius: 16px; }
.message > .avatar { grid-column: 1; grid-row: 1 / span 2; flex: 0 0 auto; }
.message-body { grid-column: 2; min-width: 0; display: block; }
.message-body > * { max-width: 100%; }

.message:hover { background: rgba(255,255,255,.026); }
.message.mine .message-body { border-left: 3px solid var(--accent); padding-left: 10px; }
.meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.meta strong { color: var(--text); font-size: 14px; font-weight: 950; }
.meta span { color: var(--muted-2); font-size: 12px; font-weight: 800; }
.message-text { margin: 0; color: var(--text-soft); font-size: 15px; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }
.system-message { margin: 10px auto; max-width: 70%; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.04); color: var(--muted); font-size: 12px; text-align: center; }
.message-image, .message-gif { display: block; max-width: min(460px, 100%); max-height: 340px; margin-top: 8px; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); }
.file-card { max-width: 430px; display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); color: var(--text); text-decoration: none; }
.file-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--input); }
.typing-indicator { flex: 0 0 22px; padding: 0 clamp(16px, 2vw, 28px); color: var(--muted); font-size: 12px; font-weight: 800; }
.scroll-pill { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 8; padding: 9px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2); color: var(--accent-2); box-shadow: 0 12px 38px var(--shadow); }
.message-form { flex: 0 0 auto; display: grid; gap: 8px; margin: 0 clamp(12px, 2vw, 22px) 14px; padding: 10px; border: 1px solid var(--border); border-radius: 22px; background: rgba(14,29,41,.97); box-shadow: 0 16px 50px rgba(0,0,0,.30); }
.composer-row { display: grid; grid-template-columns: 42px 54px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px; border-radius: 16px; background: var(--input); }
.icon-button, .gif-button { height: 42px; min-width: 42px; padding: 0 12px; border: 1px solid var(--border); background: var(--panel); color: var(--text-soft); }
.gif-button { font-size: 13px; letter-spacing: .04em; }
.composer-row input { border: 0; background: transparent; padding: 10px 8px; box-shadow: none; }
#sendBtn { min-height: 42px; padding: 0 18px; }
.composer-hint { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px; color: var(--muted-2); font-size: 11px; font-weight: 750; }
.attachment-preview { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.attachment-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 13px; }
.attachment-preview strong, .attachment-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview span { color: var(--muted); font-size: 12px; }
.gif-panel { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); }
.gif-search-row, .search-row.big { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.gif-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 250px; overflow: auto; }
.gif-result { padding: 0; border: 1px solid var(--border); background: transparent; overflow: hidden; }
.gif-result img { width: 100%; height: 120px; display: block; object-fit: cover; }
.gif-attribution { margin: 0; color: var(--muted); font-size: 11px; }

/* HUB */
.friends-hub { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px; }
.hub-hero-card, .hub-card, .settings-note-card, .push-box, .admin-box, .member-profile-card { border: 1px solid var(--border); border-radius: 22px; background: rgba(15,29,40,.78); box-shadow: 0 14px 40px rgba(0,0,0,.14); }
.hub-hero-card { min-height: 180px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 22px; background: radial-gradient(circle at 12% 10%, rgba(32,214,196,.20), transparent 19rem), var(--panel); }
.hub-hero-card h2 { margin: 5px 0 8px; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.06em; }
.hub-hero-card p:not(.eyebrow) { margin: 0; max-width: 680px; color: var(--muted); line-height: 1.5; }
.hub-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hub-stats span { padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.04); color: var(--muted); font-weight: 850; }
.hub-stats strong { color: var(--text); }
.friends-dashboard { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr); gap: 16px; }
.hub-card { padding: 18px; }
.hub-card h3 { margin: 4px 0 14px; font-size: 20px; letter-spacing: -.03em; }
.compact-list { margin-top: 12px; }
.compact-item { align-items: flex-start; justify-content: space-between; background: rgba(255,255,255,.03); }
.compact-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.compact-actions button { padding: 8px 10px; font-size: 12px; }

/* MODALS */
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.62); backdrop-filter: blur(12px); z-index: 100; }
.modal-card { width: min(560px, 100%); max-height: min(760px, calc(100dvh - 36px)); display: grid; gap: 14px; overflow-y: auto; padding: 18px; border: 1px solid var(--border-strong); border-radius: 24px; background: var(--side-2); box-shadow: 0 28px 90px rgba(0,0,0,.44); }
.profile-editor, .server-settings-editor { width: min(680px, 100%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.modal-header strong { display: block; font-size: 20px; font-weight: 950; letter-spacing: -.03em; }
.modal-header span { color: var(--muted); font-size: 13px; font-weight: 750; }
.ghost-button.small { padding: 8px 10px; }
.profile-avatar-row, .member-profile-card { display: flex; align-items: center; gap: 14px; padding: 14px; }
.file-picker-button { width: max-content; display: inline-flex !important; padding: 10px 12px; border-radius: 13px; background: var(--input); color: var(--text-soft) !important; cursor: pointer; }
.status-form-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; }
.modal-divider { height: 1px; background: var(--border); margin: 4px 0; }
.push-box, .admin-box, .settings-note-card { display: grid; gap: 10px; padding: 14px; }
.push-status, .settings-note-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* MOBILE */
@media (max-width: 1260px) {
  .chat-shell { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); }
  .members-panel { display: none; }
}

@media (max-width: 920px) {
  .auth-card { width: 100vw; height: 100dvh; min-height: 0; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-hero { min-height: 220px; padding: calc(28px + env(safe-area-inset-top)) 22px 24px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-hero::after { inset: 14px; border-radius: 22px; }
  .app-logo.big { width: 62px; height: 62px; border-radius: 20px; font-size: 28px; }
  .auth-hero h1 { font-size: 44px; }
  .auth-form { justify-content: flex-start; padding: 20px 16px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; }
}

@media (max-width: 820px) {
  :root { --topbar-h: 74px; --mobile-nav-h: 66px; }
  body { background: #050b10; }
  .chat-shell { display: block; position: relative; height: 100dvh; overflow: hidden; }
  .chat-panel {
    position: fixed;
    inset: 0 0 calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)) 0;
    width: 100vw;
    height: auto;
    z-index: 1;
  }
  .server-rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
    min-height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
    flex-direction: row;
    align-items: center;
    gap: 9px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--border);
    background: rgba(5, 11, 16, .97);
    backdrop-filter: blur(16px);
    z-index: 80;
  }
  .server-icons { flex: 1 1 auto; min-width: 0; flex-direction: row; gap: 9px; overflow-x: auto; overflow-y: hidden; }
  .rail-divider { width: 2px; height: 34px; }
  .rail-button { width: 48px; height: 48px; border-radius: 17px; }
  .rail-button.add { margin: 0 0 0 auto; }
  .channel-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
    width: min(86vw, 330px);
    max-width: 330px;
    border-right: 1px solid var(--border-strong);
    box-shadow: 24px 0 70px rgba(0,0,0,.38);
    transform: translateX(0);
    transition: transform .22s ease;
    z-index: 70;
  }
  body.sidebar-hidden .channel-panel { transform: translateX(calc(-100% - 18px)); }
  body:not(.sidebar-hidden) .chat-panel::after {
    content: "";
    position: fixed;
    inset: 0 0 calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)) 0;
    background: rgba(0,0,0,.28);
    pointer-events: none;
    z-index: 2;
  }
  .workspace-header { min-height: calc(68px + env(safe-area-inset-top)); padding: calc(12px + env(safe-area-inset-top)) 14px 12px; }
  .sidebar-mode { padding: 10px; }
  .self-card { margin: 10px; padding: 9px; border-radius: 18px; }
  .logout-button { display: none; }
  .chat-topbar {
    flex-basis: calc(var(--topbar-h) + env(safe-area-inset-top));
    min-height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
  }
  .mobile-sidebar-btn { display: grid; }
  .chat-topbar strong { font-size: 17px; }
  .chat-topbar span:not(.mode-badge) { font-size: 12px; }
  .mode-badge { padding: 4px 9px; font-size: 11px; }
  .messages { padding: 12px 10px 8px; }
  .message { grid-template-columns: 38px minmax(0, 1fr); gap: 9px; padding: 7px 6px; }
  .message .avatar { width: 38px; height: 38px; }
  .message-text { font-size: 15px; line-height: 1.44; }
  .meta { gap: 7px; }
  .meta strong { font-size: 14px; }
  .system-message { max-width: 94%; }
  .typing-indicator { flex-basis: 18px; padding: 0 12px; font-size: 11px; }
  .scroll-pill { bottom: 84px; }
  .message-form {
    margin: 0 8px 7px;
    padding: 7px;
    gap: 6px;
    border-radius: 19px;
    box-shadow: 0 10px 34px rgba(0,0,0,.30);
  }
  .composer-row { grid-template-columns: 38px 42px minmax(0, 1fr) 44px; gap: 5px; padding: 5px; border-radius: 15px; }
  .icon-button, .gif-button { height: 38px; min-width: 38px; padding: 0 9px; border-radius: 13px; }
  .gif-button { font-size: 12px; }
  .composer-row input { height: 38px; padding: 7px 6px; font-size: 15px; }
  #sendBtn { width: 44px; height: 38px; min-height: 38px; padding: 0; font-size: 0; border-radius: 13px; }
  #sendBtn::before { content: "➤"; font-size: 18px; line-height: 1; }
  .composer-hint { display: none; }
  .attachment-preview { grid-template-columns: 46px minmax(0, 1fr) auto; padding: 7px; }
  .attachment-preview img, .attachment-preview .file-icon { width: 46px; height: 46px; }
  .gif-panel { max-height: 230px; overflow: auto; padding: 8px; }
  .gif-search-row { grid-template-columns: 1fr; }
  .gif-results { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 160px; }
  .gif-result img { height: 96px; }
  .friends-hub { padding: 12px; }
  .hub-hero-card { min-height: unset; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 12px; padding: 16px; border-radius: 20px; }
  .hub-hero-card h2 { font-size: 28px; }
  .friends-dashboard { grid-template-columns: 1fr; gap: 12px; }
  .hub-card { padding: 14px; border-radius: 20px; }
  .search-row.big { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal-card { width: 100%; max-height: calc(100dvh - 22px); border-radius: 24px 24px 18px 18px; padding: 16px; }
  .status-form-row { grid-template-columns: 1fr; }
  .push-actions, .inline-actions, .member-actions-row { flex-direction: column; }
}

@media (max-width: 420px) {
  :root { --mobile-nav-h: 64px; }
  .rail-button { width: 46px; height: 46px; }
  .server-rail { gap: 7px; padding-left: 8px; padding-right: 8px; }
  .composer-row { grid-template-columns: 36px 40px minmax(0, 1fr) 42px; }
  .icon-button, .gif-button { height: 36px; min-width: 36px; }
  #sendBtn { width: 42px; height: 36px; min-height: 36px; }
  .chat-topbar { padding-left: 10px; padding-right: 10px; }
  .messages { padding-left: 8px; padding-right: 8px; }
}

/* Voice channels */
.channel-section-voice { margin-top: 10px; }
.voice-channels-list .empty-row.compact { margin: 6px 8px; padding: 8px; font-size: 12px; color: var(--muted); }
.voice-channel-button { position: relative; }
.voice-channel-button em { margin-left: auto; min-width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(48, 209, 162, .14); color: var(--accent); font-style: normal; font-size: 12px; }
.voice-channel-button.voice-active { background: rgba(48, 209, 162, .16); color: var(--text); border-color: rgba(48, 209, 162, .35); }
.voice-dock { flex: 0 0 auto; margin: 0 clamp(12px, 2vw, 22px) 10px; padding: 12px; border: 1px solid rgba(48, 209, 162, .28); border-radius: 18px; background: linear-gradient(135deg, rgba(10, 29, 35, .96), rgba(16, 38, 52, .96)); box-shadow: 0 16px 40px rgba(0,0,0,.24); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; }
.voice-dock-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.voice-dock-main div { min-width: 0; display: grid; gap: 2px; }
.voice-dock-main strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-dock-main small { color: var(--muted); }
.voice-pulse { width: 22px; height: 22px; border-radius: 999px; display: inline-grid; place-items: center; color: #30d1a2; background: rgba(48, 209, 162, .12); box-shadow: 0 0 0 6px rgba(48, 209, 162, .06); font-size: 10px; }
.voice-participants { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; min-height: 0; }
.voice-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 210px; padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--text-soft); font-size: 12px; }
.voice-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-chip em { font-style: normal; opacity: .85; }
.voice-chip.muted { opacity: .7; }
.avatar.tiny { width: 22px; height: 22px; font-size: 10px; }
.voice-actions { display: flex; gap: 8px; align-items: center; }
.voice-actions button { white-space: nowrap; }
.danger-button { background: rgba(255, 87, 87, .14) !important; color: #ffb4b4 !important; border: 1px solid rgba(255, 87, 87, .26) !important; }
.remote-audio-mount { display: none; }

@media (max-width: 820px) {
  .voice-dock { margin: 0 10px 8px; grid-template-columns: 1fr; padding: 10px; border-radius: 16px; }
  .voice-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .voice-actions button { width: 100%; min-height: 42px; }
  .voice-participants { max-height: 84px; overflow-y: auto; }
  .voice-chip { max-width: 46%; }
}

/* Refinements requested after voice update: roomier lists and Discord-like voice rows */
.friends-hub {
  padding-left: clamp(28px, 4vw, 56px);
  padding-right: clamp(24px, 3.5vw, 48px);
}
.friends-dashboard {
  align-items: start;
}
.hub-card,
.hub-hero-card {
  padding-left: clamp(20px, 2.6vw, 34px);
  padding-right: clamp(20px, 2.6vw, 34px);
}
.friend-request-list-main,
.search-results-main,
.compact-list {
  padding-left: 2px;
  padding-right: 2px;
}
.friend-request-list-main .compact-item,
.search-results-main .compact-item {
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.025);
  border-color: rgba(255,255,255,.045);
}
.friend-request-list-main .compact-item + .compact-item,
.search-results-main .compact-item + .compact-item {
  margin-top: 8px;
}
.empty-row,
.friendly-empty {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
}
.users-list {
  padding: 4px 2px 4px 4px;
}
.user-item,
.member-item,
.channel-button {
  padding-left: 12px;
  padding-right: 12px;
}
.channel-button::before,
.voice-channel-button::before {
  content: none !important;
}
.voice-channel-block {
  border-radius: 15px;
  margin: 3px 0;
  overflow: hidden;
}
.voice-channel-block.active {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.055);
}
.voice-channel-block .voice-channel-button {
  margin: 0;
  border-radius: 15px;
}
.voice-channel-block.active .voice-channel-button {
  border-color: transparent;
  background: rgba(18,183,166,.12);
}
.voice-channel-icon {
  width: 18px;
  display: inline-grid;
  place-items: center;
  opacity: .9;
}
.voice-channel-users {
  display: grid;
  gap: 3px;
  padding: 2px 8px 9px 36px;
}
.voice-channel-user {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.voice-channel-user:hover {
  background: rgba(255,255,255,.04);
  color: var(--text-soft);
}
.voice-channel-user span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-channel-user em {
  font-style: normal;
  opacity: .78;
}
.voice-channel-user.muted {
  opacity: .72;
}
.voice-dock {
  grid-template-columns: minmax(0,1fr) auto;
}
.voice-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.voice-actions #shareScreenBtn.active {
  background: rgba(56, 189, 248, .16) !important;
  color: #bfeeff !important;
  border: 1px solid rgba(56, 189, 248, .34) !important;
}
.screen-share-stage {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding-top: 4px;
}
.screen-tile {
  position: relative;
  min-height: 130px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #02070b;
}
.screen-tile video {
  width: 100%;
  height: 100%;
  min-height: 130px;
  display: block;
  object-fit: contain;
  background: #02070b;
}
.screen-tile span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.58);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.local-screen-tile {
  border-color: rgba(18,183,166,.35);
}

@media (max-width: 820px) {
  .friends-hub {
    padding: 16px 14px 18px 18px;
  }
  .hub-card,
  .hub-hero-card {
    padding-left: 18px;
    padding-right: 18px;
  }
  .friend-request-list-main .compact-item,
  .search-results-main .compact-item {
    padding: 12px;
  }
  .voice-channel-users {
    padding-left: 34px;
    padding-right: 7px;
  }
  .voice-dock {
    margin: 0 10px 8px;
    grid-template-columns: 1fr;
  }
  .voice-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .screen-share-stage {
    grid-template-columns: 1fr;
  }
  .screen-tile,
  .screen-tile video {
    min-height: 155px;
  }
}

/* --- Oliver polish pass: cleaner lists, compact stream controls, prettier member cards --- */
:root {
  --panel-glass: rgba(13, 23, 33, .78);
  --hover-soft: rgba(255, 255, 255, .055);
}

.users-list,
.members-list {
  gap: 8px;
  padding: 8px 8px 12px;
}

.user-item,
.member-item {
  position: relative;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 16px;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.user-item:hover,
.member-item:hover,
.member-item.clickable-member:hover {
  background: var(--hover-soft);
  border-color: var(--border);
  color: var(--text);
}

.user-item.active {
  background: linear-gradient(135deg, rgba(18,183,166,.20), rgba(56,189,248,.10));
  border-color: rgba(32,214,196,.28);
  color: var(--text);
  box-shadow: inset 3px 0 0 rgba(32,214,196,.78);
}

.user-item .avatar-wrap,
.member-item .avatar-wrap {
  width: 38px;
  height: 38px;
}

.user-item .avatar,
.member-item .avatar {
  width: 38px;
  height: 38px;
}

.user-copy,
.member-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-copy strong,
.member-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -.01em;
}

.user-copy small,
.member-copy small,
.user-copy span,
.member-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.members-panel {
  background:
    radial-gradient(circle at 50% 0%, rgba(18,183,166,.05), transparent 18rem),
    #08121a;
}

.members-header {
  padding-left: 18px;
  padding-right: 18px;
}

.request-row.main-request {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.035);
}

.request-row.main-request + .request-row.main-request {
  margin-top: 10px;
}

.request-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.request-copy strong,
.request-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-copy strong {
  color: var(--text-soft);
  font-weight: 950;
}

.request-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.voice-dock {
  position: relative;
  border-color: rgba(18,183,166,.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(32,214,196,.16), transparent 18rem),
    linear-gradient(135deg, rgba(8, 19, 28, .98), rgba(15, 29, 41, .98));
}

.screen-share-toolbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
}

.screen-share-toolbar select {
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.18);
}

.screen-share-toolbar button {
  min-height: 40px;
  padding: 0 12px;
  background: var(--input);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.screen-share-stage {
  max-height: min(34vh, 280px);
  overflow: hidden;
}

.screen-tile {
  min-height: 180px;
  max-height: 280px;
}

.screen-tile video {
  min-height: 180px;
  max-height: 280px;
}

.voice-channel-block.active {
  background: linear-gradient(135deg, rgba(18,183,166,.10), rgba(56,189,248,.045));
}

.voice-channel-users {
  padding-top: 4px;
  padding-bottom: 10px;
}

.voice-channel-user {
  background: transparent;
  border: 1px solid transparent;
}

.voice-channel-user:hover {
  border-color: var(--border);
}

@media (max-width: 1260px) {
  .members-list {
    padding: 8px 10px 14px;
  }
}

@media (max-width: 820px) {
  .users-list,
  .members-list {
    padding: 8px 10px 14px;
  }

  .user-item,
  .member-item {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
    border-radius: 15px;
  }

  .user-item .avatar-wrap,
  .member-item .avatar-wrap,
  .user-item .avatar,
  .member-item .avatar {
    width: 36px;
    height: 36px;
  }

  .request-row.main-request {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    padding: 12px;
  }

  .request-row.main-request .request-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .request-row.main-request .request-actions button {
    flex: 1 1 0;
  }

  .screen-share-toolbar {
    grid-template-columns: 1fr;
    padding: 7px;
  }

  .screen-share-toolbar select,
  .screen-share-toolbar button {
    width: 100%;
  }

  .screen-share-stage {
    max-height: 190px;
  }

  .screen-tile,
  .screen-tile video {
    min-height: 150px;
    max-height: 190px;
  }

  .voice-dock {
    margin-bottom: 7px;
  }
}

/* --- Layout stability pass v2: consistent spacing, unread markers, opt-in stream view --- */
.chat-shell {
  isolation: isolate;
}

.channel-panel,
.members-panel,
.chat-panel {
  min-width: 0;
}

.sidebar-mode {
  padding: 14px 14px 16px;
  gap: 14px;
}

.channel-section,
.server-card,
.self-card,
.hub-card,
.hub-hero-card,
.member-profile-card,
.settings-note-card,
.push-box,
.admin-box {
  border-color: rgba(164,219,230,.115);
  background: linear-gradient(180deg, rgba(18,33,45,.90), rgba(11,22,32,.88));
}

.server-card,
.channel-section {
  overflow: visible;
}

.section-row,
.channel-heading-row {
  min-height: 34px;
  padding: 0 2px;
}

.section-label {
  color: #78909d;
}

.channels-list {
  gap: 6px;
}

.channel-button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 12px;
}

.channel-button > span:first-child,
.channel-button .voice-channel-icon {
  width: 20px;
  min-width: 20px;
  display: inline-grid;
  place-items: center;
  color: var(--muted-2);
  font-weight: 950;
}

.channel-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 850;
}

.channel-button.active strong,
.channel-button:hover strong {
  color: var(--text);
}

.channel-unread-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 950;
  box-shadow: 0 0 0 2px rgba(7,16,23,.86);
}

.channel-button:has(.channel-unread-badge) strong {
  color: var(--text-soft);
}

.friends-hub {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(22px, 4vw, 58px) 32px;
}

.friends-dashboard {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 420px);
}

.hub-hero-card {
  align-items: center;
  min-height: 158px;
}

.hub-card {
  min-width: 0;
}

.friend-request-list-main,
.search-results-main,
.compact-list,
.users-list,
.members-list {
  width: 100%;
}

.search-result-row,
.request-row.main-request,
.compact-item,
.user-item,
.member-item {
  min-width: 0;
  box-shadow: none;
}

.search-result-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(164,219,230,.095);
  border-radius: 16px;
  background: rgba(255,255,255,.032);
}

.search-result-row + .search-result-row {
  margin-top: 8px;
}

.search-result-row button,
.request-actions button {
  min-height: 34px;
  padding: 7px 11px;
  white-space: nowrap;
}

.request-row.main-request {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  background: rgba(255,255,255,.032);
}

.empty-row,
.friendly-empty {
  width: 100%;
  margin: 0;
}

.members-list {
  overflow-y: auto;
}

.member-item,
.user-item {
  overflow: hidden;
}

.member-item .badge-row,
.user-item .badge-row {
  min-width: 0;
  overflow: hidden;
}

.message {
  width: min(100%, 980px);
  margin: 0 auto 2px;
  padding: 9px 12px;
}

.message.system {
  display: block;
  width: fit-content;
  max-width: min(740px, 88%);
  margin: 10px auto;
  padding: 8px 12px;
  border: 1px solid rgba(164,219,230,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.message-body {
  min-width: 0;
}

.meta {
  min-width: 0;
}

.meta strong {
  max-width: min(360px, 60vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-form {
  width: min(980px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}

.typing-indicator {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
}

.voice-channel-block {
  border: 1px solid transparent;
}

.voice-channel-block.active {
  border-color: rgba(32,214,196,.17);
}

.voice-channel-users {
  padding-left: 38px;
  padding-right: 8px;
}

.voice-channel-user {
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  min-height: 32px;
  cursor: default;
}

.voice-channel-user.has-stream {
  color: var(--text-soft);
}

.voice-stream-button,
.stream-watch-chip {
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(56,189,248,.28);
  border-radius: 999px;
  background: rgba(56,189,248,.10);
  color: #c8f3ff;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.voice-stream-button:hover,
.stream-watch-chip:hover {
  background: rgba(56,189,248,.18);
  box-shadow: none;
  transform: none;
}

.voice-chip {
  min-height: 32px;
  max-width: min(260px, 100%);
}

.voice-chip .stream-watch-chip {
  margin-left: 2px;
}

.screen-share-toolbar {
  margin-top: 2px;
}

.screen-share-stage {
  max-height: min(32vh, 250px);
}

.screen-tile,
.screen-tile video {
  min-height: 150px;
  max-height: 250px;
}

@media (max-width: 1260px) {
  .friends-dashboard {
    grid-template-columns: 1fr;
  }

  .hub-hero-card {
    align-items: flex-start;
  }
}

@media (max-width: 820px) {
  .chat-shell {
    background: var(--chat);
  }

  .chat-panel {
    inset: 0 0 calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)) 0;
  }

  .channel-panel {
    width: min(86vw, 340px);
    box-shadow: 26px 0 70px rgba(0,0,0,.44);
  }

  .server-rail {
    box-shadow: 0 -18px 55px rgba(0,0,0,.35);
  }

  .sidebar-mode {
    padding: 12px 12px 14px;
  }

  .chat-topbar {
    min-height: 66px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    gap: 9px;
  }

  .chat-topbar strong {
    font-size: 16px;
  }

  .chat-topbar span:not(.mode-badge) {
    max-width: 62vw;
  }

  .messages {
    padding: 10px 9px 8px;
  }

  .message {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    padding: 8px 7px;
    border-radius: 14px;
  }

  .message > .avatar {
    width: 34px;
    height: 34px;
  }

  .meta {
    gap: 6px;
  }

  .meta strong {
    max-width: 48vw;
    font-size: 13px;
  }

  .message-text {
    font-size: 14px;
    line-height: 1.44;
  }

  .message-image,
  .message-gif {
    max-width: 100%;
    max-height: 260px;
    border-radius: 14px;
  }

  .file-card {
    max-width: 100%;
  }

  .voice-dock {
    width: calc(100% - 20px);
    margin: 0 auto 7px;
    padding: 9px;
    gap: 8px;
  }

  .voice-dock-main {
    align-items: flex-start;
  }

  .voice-participants {
    display: grid;
    grid-template-columns: 1fr;
    max-height: 76px;
    overflow-y: auto;
  }

  .voice-chip {
    max-width: 100%;
    justify-content: flex-start;
  }

  .voice-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .voice-actions button {
    min-height: 38px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .screen-share-toolbar {
    grid-template-columns: 1fr auto;
  }

  .screen-share-stage {
    max-height: 170px;
  }

  .screen-tile,
  .screen-tile video {
    min-height: 128px;
    max-height: 170px;
  }

  .message-form {
    width: calc(100% - 16px);
    margin-bottom: 7px;
    padding: 8px;
    border-radius: 18px;
  }

  .composer-row {
    grid-template-columns: 38px 42px minmax(0, 1fr) 42px;
    gap: 6px;
    padding: 6px;
  }

  .friends-hub {
    max-width: none;
    padding: 14px 14px 20px;
  }

  .hub-hero-card,
  .hub-card {
    padding: 16px;
    border-radius: 20px;
  }

  .hub-hero-card h2 {
    font-size: 26px;
    letter-spacing: -.04em;
  }

  .request-row.main-request,
  .search-result-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .request-actions,
  .search-result-row button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .request-actions button {
    flex: 1 1 0;
  }

  .user-item,
  .member-item {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .voice-channel-user {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  .voice-channel-user .voice-stream-button {
    grid-column: 2 / -1;
    justify-self: start;
    margin-top: 2px;
  }
}

@media (max-width: 420px) {
  .chat-topbar span:not(.mode-badge) {
    max-width: 54vw;
  }

  .mode-badge {
    display: none;
  }

  .voice-actions {
    grid-template-columns: 1fr;
  }

  .composer-row {
    grid-template-columns: 36px 39px minmax(0, 1fr) 40px;
  }
}

/* ---- Polish pass: compact voice dock, member ranking, friend removal ---- */
.channel-panel > .voice-dock.voice-dock-mini {
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 8px 12px 8px !important;
  padding: 9px 10px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(52, 211, 153, .28) !important;
  background: linear-gradient(135deg, rgba(8, 26, 31, .92), rgba(11, 33, 45, .92)) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.22) !important;
}
.channel-panel > .voice-dock.voice-dock-mini[hidden] { display: none !important; }
.voice-dock-mini .voice-dock-main {
  min-width: 0;
  display: grid !important;
  grid-template-columns: 16px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: center !important;
}
.voice-dock-mini .voice-pulse {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  color: transparent;
  background: #35e09a;
  box-shadow: 0 0 0 5px rgba(53,224,154,.12), 0 0 18px rgba(53,224,154,.46);
}
.voice-dock-mini .voice-dock-main strong {
  display: block;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.15;
}
.voice-dock-mini .voice-dock-main small {
  display: block;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}
.voice-dock-mini .voice-participants { display: none !important; }
.voice-dock-mini .voice-actions.compact,
.voice-dock-mini .voice-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 5px !important;
}
.voice-dock-mini .voice-actions button,
.voice-dock-mini .voice-icon-action {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  border: 1px solid rgba(255,255,255,.085) !important;
  background: rgba(255,255,255,.055) !important;
  color: var(--text) !important;
}
.voice-dock-mini .voice-actions button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.09) !important;
}
.voice-dock-mini #shareScreenBtn.active {
  border-color: rgba(45,212,191,.42) !important;
  background: rgba(45,212,191,.16) !important;
  box-shadow: inset 0 0 0 1px rgba(45,212,191,.08);
}
.voice-dock-mini #leaveVoiceBtn {
  color: #fecaca !important;
  background: rgba(248,113,113,.12) !important;
  border-color: rgba(248,113,113,.22) !important;
}

.screen-share-viewer {
  flex: 0 0 auto;
  width: min(760px, calc(100% - 28px));
  margin: 0 auto 10px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.075);
  background: rgba(3, 9, 14, .78);
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.screen-share-viewer[hidden] { display: none !important; }
.screen-share-viewer .screen-share-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 9px;
  padding: 0;
  background: transparent;
  border: 0;
}
.screen-share-viewer .screen-share-toolbar[hidden] { display: none !important; }
.screen-share-viewer .screen-share-stage {
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
}
.screen-share-viewer .screen-share-stage[hidden] { display: none !important; }
.screen-share-viewer .screen-tile {
  min-height: 190px;
  max-height: min(46vh, 360px);
}
.screen-share-viewer .screen-tile video {
  min-height: 190px;
  max-height: min(46vh, 360px);
}

.friend-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: max-content;
}
.friend-remove-button {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: rgba(226,232,240,.48);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  opacity: .55;
  transition: .16s ease;
}
.user-item:hover .friend-remove-button,
.friend-remove-button:focus-visible {
  opacity: 1;
  color: #fecaca;
  border-color: rgba(248,113,113,.2);
  background: rgba(248,113,113,.11);
}
.friend-remove-button:hover { transform: scale(1.04); }

.members-list {
  padding: 8px 8px 14px !important;
  gap: 3px !important;
}
.member-group-label {
  list-style: none;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin: 12px 4px 5px;
  padding: 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.member-group-label:first-child { margin-top: 4px; }
.member-group-label em {
  font-style: normal;
  color: rgba(226,232,240,.42);
  font-size: 10px;
}
.member-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(148,163,184,.65);
  box-shadow: 0 0 14px currentColor;
}
.member-item {
  border-radius: 14px !important;
  padding: 8px !important;
}
.member-copy strong {
  transition: color .16s ease;
}
.member-badges {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.server-role-badge {
  display: inline-flex;
  align-items: center;
  max-width: 110px;
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  font-size: 10px;
  font-weight: 900;
  font-style: normal;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.members-panel .status-dot.online { box-shadow: 0 0 0 2px var(--side), 0 0 15px rgba(34,197,94,.35); }

.server-invite-card.joined {
  opacity: .82;
  border-color: rgba(45,212,191,.16);
  background: rgba(45,212,191,.055);
}
.server-invite-card button:disabled {
  cursor: not-allowed;
  color: rgba(226,232,240,.58);
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.045);
}

@media (max-width: 820px) {
  .channel-panel > .voice-dock.voice-dock-mini {
    margin: 8px 10px 7px !important;
    padding: 8px !important;
    border-radius: 15px !important;
  }
  .voice-dock-mini .voice-dock-main strong,
  .voice-dock-mini .voice-dock-main small {
    max-width: 44vw;
  }
  .voice-dock-mini .voice-actions button,
  .voice-dock-mini .voice-icon-action {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
  }
  .screen-share-viewer {
    width: calc(100% - 16px);
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 16px;
  }
  .screen-share-viewer .screen-share-toolbar {
    grid-template-columns: 1fr;
  }
  .screen-share-viewer .screen-tile,
  .screen-share-viewer .screen-tile video {
    min-height: 155px;
    max-height: 230px;
  }
  .friend-row-actions { gap: 4px; }
  .friend-remove-button {
    opacity: .9;
    color: rgba(226,232,240,.7);
    background: rgba(255,255,255,.04);
  }
  .member-group-label {
    margin-left: 6px;
    margin-right: 6px;
  }
}

/* === UX polish update: server management, voice presence, stream viewer === */
:root {
  --panel-pad: clamp(14px, 1.8vw, 22px);
  --soft-card: rgba(15, 23, 42, .72);
  --soft-card-2: rgba(8, 15, 29, .88);
  --line-soft: rgba(148, 163, 184, .16);
}

.friends-hub,
.hub-card,
.friend-request-list-main,
.search-results-main,
.members-list,
.users-list {
  min-width: 0;
}

.friends-dashboard,
.hub-card,
.requests-card,
.add-friend-card {
  padding-left: clamp(14px, 1.2vw, 20px);
  padding-right: clamp(14px, 1.2vw, 20px);
}

.request-row.main-request,
.user-item,
.member-item,
.role-preview-row,
.member-role-chip-row {
  box-sizing: border-box;
}

.friend-row-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.friend-remove-button {
  position: static !important;
  opacity: .82 !important;
  transform: none !important;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  margin-left: 0;
}

.user-item {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
}

.user-copy,
.member-copy,
.request-copy {
  min-width: 0;
}

.user-copy strong,
.member-copy strong,
.request-copy strong,
.user-copy small,
.member-copy small,
.request-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-card.server-settings-v2,
.modal-card.profile-editor-v2,
.modal-card.member-editor {
  width: min(920px, calc(100vw - 28px));
  max-height: min(88vh, 840px);
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, .18);
  background:
    radial-gradient(circle at top left, rgba(52, 211, 153, .10), transparent 30%),
    linear-gradient(180deg, rgba(15, 23, 42, .98), rgba(2, 6, 23, .98));
  box-shadow: 0 30px 80px rgba(0,0,0,.48);
}

.modal-header-hero {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 16px;
}

.settings-tabs-static {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 16px;
}
.settings-tabs-static span {
  padding: 8px 12px;
  border: 1px solid rgba(52, 211, 153, .18);
  background: rgba(52, 211, 153, .08);
  color: #d1fae5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.settings-grid {
  display: grid;
  gap: 14px;
}
.settings-grid.two-col,
.server-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.server-help-card,
.profile-status-card,
.push-box,
.admin-box {
  grid-column: span 2;
}
.settings-card {
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(15, 23, 42, .72), rgba(8, 13, 25, .68));
  border-radius: 22px;
  padding: clamp(14px, 1.4vw, 18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.settings-card h3 { margin: 2px 0 0; }
.settings-card label { display: grid; gap: 7px; }
.profile-avatar-row.pro { align-items: center; gap: 14px; margin: 0 0 14px; }
.profile-avatar-row.pro > div { display: grid; gap: 8px; min-width: 0; }
.profile-avatar-row.pro strong { color: var(--text); }
.profile-avatar-row.pro small { color: var(--muted); }

.role-create-row {
  grid-template-columns: minmax(0,1fr) 84px;
  align-items: end;
}
.role-list-box {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.roles-preview-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.role-preview-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(2, 6, 23, .32);
  border-radius: 14px;
}
.role-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(255,255,255,.04);
}
.settings-help-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.45;
}
.settings-help-list span {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(2, 6, 23, .32);
  border: 1px solid rgba(148, 163, 184, .12);
}
.modal-footer-actions.sticky-actions {
  position: sticky;
  bottom: -1px;
  margin: 16px -2px -2px;
  padding: 12px 2px 2px;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, .96) 35%);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
.modal-footer-actions .form-error { margin-right: auto; }

.invite-panel-pro {
  border: 1px solid rgba(52, 211, 153, .20);
  background: linear-gradient(180deg, rgba(6, 78, 59, .18), rgba(2, 6, 23, .26));
  border-radius: 18px;
  padding: 12px;
}
.invite-panel-head {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 10px;
  align-items: center;
}
.invite-panel-head .invite-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(52, 211, 153, .14);
}
.invite-panel-head strong,
.invite-panel-head small { display: block; min-width: 0; }
.invite-panel-head small { color: var(--muted); line-height: 1.35; }
.invite-code-label,
.invite-send-label { display: grid; gap: 7px; font-size: 12px; font-weight: 850; color: var(--muted); }
.wide-action { width: 100%; }

.member-role-manager {
  display: grid;
  gap: 12px;
}
.member-role-list {
  display: grid;
  gap: 8px;
}
.member-role-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(2, 6, 23, .28);
}
.role-assign-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.big-role-badge { padding: 6px 10px; border-radius: 999px; font-size: 12px; }
.danger-soft { color: #fecaca !important; border-color: rgba(248, 113, 113, .28) !important; }

.voice-channel-block { padding: 3px 4px 6px; }
.voice-channel-button { min-height: 34px; }
.voice-channel-users {
  margin: 4px 0 0 28px;
  padding-left: 8px;
  border-left: 2px solid rgba(52, 211, 153, .16);
  display: grid;
  gap: 4px;
}
.voice-channel-user {
  min-height: 30px;
  border-radius: 10px;
  padding: 4px 6px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto auto;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.voice-channel-user span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-stream-button {
  border: 1px solid rgba(56, 189, 248, .25);
  background: rgba(56, 189, 248, .10);
  color: #bae6fd;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.voice-channel-button em {
  background: rgba(52, 211, 153, .15) !important;
  color: #86efac !important;
}

.screen-share-viewer {
  margin: 10px 14px 0;
  border: 1px solid rgba(56, 189, 248, .22);
  background: linear-gradient(180deg, rgba(8, 47, 73, .38), rgba(2, 6, 23, .92));
  border-radius: 18px;
  overflow: hidden;
  z-index: 20;
}
.screen-share-viewer.floating {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: min(420px, calc(100vw - 28px));
  max-height: min(42vh, 310px);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  border-color: rgba(56, 189, 248, .42);
}
.screen-share-toolbar {
  display: grid !important;
  grid-template-columns: auto minmax(120px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}
.screen-share-toolbar[hidden] { display: none !important; }
.screen-share-title { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 900; }
.screen-share-stage {
  padding: 10px;
  max-height: 48vh;
  display: grid;
  place-items: center;
}
.screen-share-viewer.floating .screen-share-stage { max-height: 250px; }
.screen-share-stage .screen-tile,
.screen-share-stage video {
  width: 100%;
  max-height: inherit;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
}

.members-list {
  padding: 10px !important;
  gap: 8px !important;
}
.member-group-label {
  margin: 12px 2px 5px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 11px;
  font-weight: 950;
}
.member-group-label em { margin-left: auto; font-style: normal; opacity: .75; }
.member-group-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.member-item {
  padding: 9px 10px !important;
  border-radius: 15px !important;
  background: rgba(2, 6, 23, .20);
  border: 1px solid transparent;
}
.member-item:hover {
  background: rgba(15, 23, 42, .65);
  border-color: rgba(148, 163, 184, .12);
}
.member-badges { margin-top: 4px; }
.server-role-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  background: rgba(255,255,255,.04);
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 760px) {
  .settings-grid.two-col,
  .server-settings-grid { grid-template-columns: 1fr; }
  .server-help-card,
  .profile-status-card,
  .push-box,
  .admin-box { grid-column: auto; }
  .modal-card.server-settings-v2,
  .modal-card.profile-editor-v2,
  .modal-card.member-editor {
    width: min(100vw - 16px, 620px);
    max-height: 90vh;
    padding: 14px;
  }
  .role-create-row,
  .role-assign-row { grid-template-columns: 1fr; }
  .screen-share-viewer { margin: 8px 8px 0; }
  .screen-share-viewer.floating {
    right: 8px;
    left: 8px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
  .screen-share-toolbar {
    grid-template-columns: 1fr auto auto;
  }
  .screen-share-title { display: none; }
  .screen-share-toolbar select { grid-column: 1 / -1; }
  .voice-channel-users { margin-left: 20px; }
  .voice-channel-user { grid-template-columns: auto minmax(0,1fr) auto; }
  .voice-channel-user .voice-stream-button { grid-column: 2 / -1; justify-self: start; }
  .user-item { grid-template-columns: auto minmax(0,1fr) auto; padding: 10px; }
  .friend-remove-button { width: 34px; height: 34px; opacity: 1 !important; }
}

/* --- Patch: current project alignment + profile/message UX --- */
.chat-topbar .mode-badge,
.mode-badge {
  flex: 0 0 auto;
  width: auto;
  max-width: max-content;
  min-width: 0;
  justify-content: center;
  padding: 5px 10px;
  letter-spacing: .08em;
  line-height: 1;
  align-self: center;
}
.section-label,
.eyebrow.mini {
  width: auto;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  line-height: 1.15;
}
.workspace-header,
.chat-topbar,
.members-header { min-width: 0; }
.workspace-header > div,
.chat-topbar > div,
.members-header > div { min-width: 0; }

.message {
  position: relative;
  padding-right: 82px !important;
}
.message-actions {
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  pointer-events: auto;
}
.message-action-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 29, 40, .92);
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 10px 26px rgba(0,0,0,.24);
}
.message-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(32,214,196,.35);
  background: var(--input-2);
  color: var(--text);
}
.message-action-btn.danger {
  color: #fecdd3;
  border-color: rgba(251,113,133,.24);
  background: rgba(251,113,133,.10);
}
.message-action-btn.danger:hover {
  background: rgba(251,113,133,.18);
  border-color: rgba(251,113,133,.38);
}
.message.deleted .message-actions { display: none; }

.ui-dialog-card { width: min(520px, 100%); }
.ui-dialog-body { display: grid; gap: 12px; }
.ui-dialog-text { margin: 0; color: var(--text-soft); line-height: 1.55; }
.ui-dialog-textarea { min-height: 150px; resize: vertical; }
.ui-dialog-hint { justify-self: end; color: var(--muted); font-weight: 800; }
.ui-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.compact-hero { padding-bottom: 12px; }

.profile-view-card.member-editor {
  width: min(640px, calc(100vw - 28px));
  overflow: hidden auto;
}
.profile-view-card .member-profile-card {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 14% 4%, rgba(32,214,196,.18), transparent 18rem),
    linear-gradient(145deg, rgba(19,38,54,.96), rgba(10,21,29,.96));
}
.profile-view-card .member-profile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 72px;
  background: linear-gradient(90deg, rgba(18,183,166,.35), rgba(56,189,248,.18));
  opacity: .8;
  pointer-events: none;
}
.profile-view-card .member-profile-card > * { position: relative; z-index: 1; }
.profile-view-card #memberProfileAvatar {
  width: 84px;
  height: 84px;
  border-radius: 28px;
  border: 5px solid rgba(10,21,29,.96);
  box-shadow: 0 16px 40px rgba(0,0,0,.32);
}
.profile-view-card #memberProfileName {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: -.04em;
  font-weight: 950;
}
.profile-view-card #memberProfileHandle,
.profile-view-card #memberProfileStatus,
.member-profile-bio {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.member-profile-bio {
  max-width: 100%;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.035);
  color: var(--text-soft);
}
.profile-view-card .badge-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-badge {
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.045);
  font-size: 12px;
}
.profile-badge.owner { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.13); }
.profile-badge.support { border-color: rgba(56,189,248,.45); background: rgba(56,189,248,.13); }
.profile-badge.premium { border-color: rgba(32,214,196,.45); background: rgba(32,214,196,.13); }
.member-actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}
.member-actions-row .ghost-button,
.profile-primary-action {
  min-height: 40px;
  border-radius: 13px;
}
.profile-primary-action {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
  color: #04201d !important;
  border-color: transparent !important;
}

.friend-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: max-content;
}
.friend-remove-button {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  line-height: 1 !important;
  border-radius: 12px !important;
  transform: none !important;
}
.user-item { grid-template-columns: 38px minmax(0, 1fr) auto; }

@media (max-width: 820px) {
  .mode-badge { display: none !important; }
  .message { padding-right: 64px !important; }
  .message-actions {
    top: 7px;
    right: 7px;
    opacity: 1;
    pointer-events: auto;
  }
  .message-action-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 13px;
  }
  .profile-view-card.member-editor {
    width: 100%;
    max-height: calc(100dvh - 18px);
  }
  .profile-view-card .member-profile-card {
    grid-template-columns: 70px minmax(0,1fr);
    padding: 14px;
    border-radius: 20px;
  }
  .profile-view-card #memberProfileAvatar {
    width: 70px;
    height: 70px;
    border-radius: 23px;
  }
  .profile-view-card #memberProfileName { font-size: 20px; }
  .member-actions-row { display: grid; grid-template-columns: 1fr; }
  .member-actions-row button { width: 100%; }
  .user-item { grid-template-columns: 36px minmax(0, 1fr) auto; }
}

/* --- Vibecord minimal polish based on the supplied style.css and reference screenshot --- */
:root {
  --bg: #0b0b15;
  --bg-soft: #111124;
  --rail: #0b0b15;
  --side: #141427;
  --side-2: #17172d;
  --panel: #1c1c37;
  --panel-2: #222243;
  --panel-3: #2b2b55;
  --chat: #20203e;
  --composer: #2a2a56;
  --input: #2a2a56;
  --input-2: #333364;
  --text: #f4f2ff;
  --text-soft: #d9d5ee;
  --muted: #9691b6;
  --muted-2: #706b91;
  --border: rgba(255,255,255,.065);
  --border-strong: rgba(255,255,255,.105);
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-3: #7c3aed;
  --accent-dark: #6d28d9;
  --accent-soft: rgba(139,92,246,.18);
  --green: #3ddc97;
  --danger: #ff5c7a;
  --danger-soft: rgba(255,92,122,.14);
  --shadow: rgba(0,0,0,.38);
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --rail-w: 56px;
  --side-w: 240px;
  --members-w: 236px;
  --topbar-h: 48px;
}

body {
  background: var(--chat) !important;
}

button {
  border-radius: 7px;
  background: #2b2b55;
  color: var(--text-soft);
  box-shadow: none;
}
button:hover:not(:disabled) {
  transform: none;
  background: #36366a;
  color: var(--text);
  box-shadow: none;
}
input, textarea, select {
  border-radius: 7px;
  background: var(--input);
  border-color: transparent;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(167,139,250,.60);
  box-shadow: 0 0 0 3px rgba(139,92,246,.16);
}

.chat-shell {
  grid-template-columns: var(--rail-w) var(--side-w) minmax(0,1fr) var(--members-w);
  background: var(--chat) !important;
}
.server-rail {
  padding: 8px 7px;
  gap: 9px;
  background: var(--rail) !important;
  border-right: 1px solid rgba(255,255,255,.055);
}
.server-icons { gap: 9px; }
.rail-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #1b1b34;
  color: #cfcaf0;
  font-size: 15px;
  box-shadow: none;
}
.rail-button:hover,
.rail-button.active {
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
  box-shadow: none;
}
.rail-button.add {
  background: #1b1b34;
  color: #51e29e;
}
.rail-button.add:hover {
  background: rgba(61,220,151,.16);
  color: #72f4b4;
}
.rail-divider {
  width: 30px;
  height: 1px;
  background: rgba(255,255,255,.10);
}
.rail-unread {
  background: var(--danger);
  border-color: var(--rail);
}

.channel-panel,
.members-panel {
  background: var(--side) !important;
  border-color: rgba(255,255,255,.055);
}
.members-panel {
  background: #151529 !important;
}
.workspace-header,
.chat-topbar,
.members-header {
  min-height: var(--topbar-h);
  height: var(--topbar-h);
  padding: 0 14px;
  background: transparent !important;
  border-bottom: 1px solid rgba(255,255,255,.055);
  backdrop-filter: none;
}
.workspace-header strong,
.members-header strong,
.chat-topbar strong {
  font-size: 14px;
  letter-spacing: 0;
}
.workspace-header span:not(.connection-dot),
.members-header span,
.chat-topbar span:not(.mode-badge) {
  color: var(--muted-2);
  font-size: 11px;
}
.connection-dot {
  width: 7px;
  height: 7px;
  box-shadow: none;
}
.sidebar-mode {
  padding: 14px 10px;
  gap: 12px;
}
.server-card,
.channel-section,
.self-card,
.hub-card,
.hub-hero-card,
.settings-card,
.settings-note-card,
.push-box,
.admin-box {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.channel-section {
  padding: 4px 0 8px;
}
.section-row,
.channel-heading-row {
  min-height: 24px;
  padding: 0 8px;
}
.section-label,
.eyebrow.mini {
  width: auto !important;
  display: inline-flex !important;
  color: #7f7aa1;
  font-size: 10px;
  letter-spacing: .11em;
  line-height: 1;
}
.section-plus {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #8f89b3;
}
.section-plus:hover {
  background: rgba(255,255,255,.06);
  color: white;
}
.server-header-button {
  min-height: 48px;
  grid-template-columns: minmax(0,1fr) auto;
  padding: 0 10px;
  border-radius: 0;
}
.server-header-button .server-icon { display: none; }
.server-header-button:hover {
  background: rgba(255,255,255,.035);
}
.server-title-copy strong {
  color: #fff;
  font-size: 14px;
}
.server-title-copy small { display: none; }
.server-menu {
  margin: 6px 8px 10px;
  padding: 6px;
  border-radius: 10px;
  background: #1d1d39;
  border-color: rgba(255,255,255,.07);
}
.server-menu button {
  justify-content: flex-start;
  padding: 9px 10px;
  background: transparent;
  color: var(--text-soft);
}
.server-menu button:hover { background: rgba(255,255,255,.06); }
.channels-list { gap: 2px; margin-top: 5px; }
.channel-button,
.voice-channel-button {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #9b96bd;
  display: grid;
  grid-template-columns: 18px minmax(0,1fr) auto;
}
.channel-button strong,
.voice-channel-button strong {
  font-size: 13px;
  font-weight: 750;
}
.channel-button:hover,
.voice-channel-button:hover {
  background: rgba(255,255,255,.055);
  color: #f3f0ff;
}
.channel-button.active,
.voice-channel-button.voice-active {
  background: rgba(139,92,246,.30);
  color: white;
  border: 0;
}
.channel-button > span:first-child,
.voice-channel-icon {
  color: #8580a5;
}
.channel-unread-badge,
.unread-badge {
  background: var(--danger);
  color: white;
}
.voice-channel-block.active {
  border: 0;
  background: rgba(255,255,255,.03);
}
.voice-channel-users {
  padding: 2px 5px 6px 28px;
}
.voice-channel-user {
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #a29dc1;
}
.voice-stream-button,
.stream-watch-chip {
  background: rgba(139,92,246,.18);
  border-color: rgba(139,92,246,.35);
  color: #ddd4ff;
}

.self-card {
  margin: auto 0 0;
  padding: 8px 9px;
  border-radius: 0;
  border-top: 1px solid rgba(255,255,255,.06) !important;
  background: #111123 !important;
}
.self-card-main {
  grid-template-columns: 34px minmax(0,1fr) 30px;
  gap: 8px;
}
.self-copy strong { font-size: 12px; }
.self-copy span,
.self-copy small { font-size: 10px; }
.self-card .avatar { width: 34px; height: 34px; }
.mini-button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}
.logout-button {
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 6px;
}

.chat-panel {
  background: var(--chat) !important;
}
.chat-topbar {
  grid-template-columns: auto minmax(0,1fr) max-content;
  gap: 10px;
}
.chat-topbar strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chat-topbar .mode-badge,
.mode-badge {
  width: auto !important;
  min-width: 0 !important;
  max-width: max-content !important;
  padding: 4px 7px !important;
  border-radius: 999px !important;
  background: transparent !important;
  border: 0 !important;
  color: #8d87ad !important;
  font-size: 10px !important;
  letter-spacing: .08em !important;
  line-height: 1 !important;
}
.messages {
  padding: 18px 16px 12px;
}
.empty-chat {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  color: #817b9f;
}
.empty-chat h2 {
  color: #f5f2ff;
  font-size: 16px;
  margin: 10px 0 4px;
}
.empty-chat p { margin: 0; font-size: 12px; }
.message {
  width: 100%;
  max-width: none;
  margin: 0 0 2px;
  padding: 6px 72px 6px 8px !important;
  border-radius: 6px;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 10px;
}
.message:hover { background: rgba(255,255,255,.035); }
.message.mine .message-body {
  border-left: 0;
  padding-left: 0;
}
.meta { margin-bottom: 2px; gap: 7px; }
.meta strong {
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}
.meta span { font-size: 11px; color: #8d87ad; }
.message-text {
  color: #dedaf2;
  font-size: 14px;
  line-height: 1.42;
}
.message-author-click,
.profile-click-target { cursor: pointer; }
.message-author-click:hover { text-decoration: underline; }
.message-actions {
  top: 5px;
  right: 8px;
  gap: 4px;
}
.message-action-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 6px;
  background: #17172d;
  border-color: rgba(255,255,255,.08);
  color: #c9c3e7;
  box-shadow: none;
}
.message-action-btn:hover {
  background: #2f2f5e;
  border-color: rgba(139,92,246,.35);
}
.private-chip,
.edited-chip {
  border-radius: 999px;
  background: rgba(139,92,246,.20);
  color: #d6ccff;
  padding: 2px 6px;
}
.message-form {
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
.composer-row {
  grid-template-columns: 34px 44px minmax(0,1fr) auto;
  gap: 6px;
  padding: 0 8px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--composer);
}
.icon-button,
.gif-button {
  height: 32px;
  min-width: 32px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #a8a2c7;
}
.icon-button:hover,
.gif-button:hover { background: rgba(255,255,255,.06); }
.composer-row input {
  height: 40px;
  padding: 0 6px;
  background: transparent;
  color: #f4f2ff;
}
#sendBtn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(139,92,246,.40);
  color: white;
}
#sendBtn:not(:disabled):hover { background: rgba(139,92,246,.62); }
.composer-hint { display: none; }
.typing-indicator {
  width: calc(100% - 24px);
  margin: 0 12px;
  color: #8d87ad;
}

.members-header {
  text-transform: uppercase;
  color: #8d87ad;
}
.members-list,
.users-list {
  padding: 8px !important;
  gap: 4px !important;
}
.member-group-label {
  margin: 12px 4px 4px;
  color: #7f7aa1;
  font-size: 10px;
}
.member-item,
.user-item {
  grid-template-columns: 34px minmax(0,1fr) auto !important;
  min-height: 42px;
  padding: 7px 8px !important;
  border-radius: 6px !important;
  background: transparent !important;
  border: 0 !important;
}
.member-item:hover,
.user-item:hover,
.user-item.active {
  background: rgba(255,255,255,.055) !important;
}
.user-item.active { box-shadow: inset 3px 0 0 #8b5cf6; }
.user-item .avatar,
.member-item .avatar,
.user-item .avatar-wrap,
.member-item .avatar-wrap {
  width: 34px !important;
  height: 34px !important;
}
.user-copy strong,
.member-copy strong {
  font-size: 13px;
  color: #eeeaff;
}
.user-copy small,
.member-copy small,
.user-copy span,
.member-copy span {
  font-size: 11px;
  color: #8d87ad;
}
.friend-row-actions {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.friend-remove-button {
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border-radius: 6px !important;
  display: inline-grid !important;
  place-items: center !important;
  line-height: 1 !important;
  background: transparent !important;
  color: #9d97bd !important;
  border: 0 !important;
  opacity: 0;
}
.user-item:hover .friend-remove-button,
.friend-remove-button:focus-visible {
  opacity: 1;
}
.friend-remove-button:hover {
  background: rgba(255,92,122,.14) !important;
  color: #ffb3c0 !important;
}

.friends-hub {
  max-width: 1120px;
  padding: 28px 38px;
}
.hub-hero-card,
.hub-card {
  background: #1a1a33 !important;
  border: 1px solid rgba(255,255,255,.055) !important;
  border-radius: 10px;
}
.hub-hero-card { min-height: 126px; }
.hub-hero-card h2 { font-size: 32px; letter-spacing: -.04em; }
.compact-item,
.request-row.main-request,
.search-result-row {
  background: rgba(255,255,255,.035) !important;
  border-color: rgba(255,255,255,.055) !important;
  border-radius: 8px !important;
}

.modal-backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(6px); }
.modal-card {
  border-radius: 12px;
  background: #181830;
  border-color: rgba(255,255,255,.09);
  box-shadow: 0 24px 70px rgba(0,0,0,.46);
}
.profile-view-card.member-editor {
  width: min(620px, calc(100vw - 30px));
}
.profile-view-card .member-profile-card {
  position: relative;
  display: grid !important;
  grid-template-columns: 84px minmax(0,1fr);
  gap: 16px;
  align-items: end;
  min-height: 152px;
  padding: 62px 18px 18px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, #33256b 0 58px, #20203e 58px 100%) !important;
  border: 1px solid rgba(255,255,255,.08);
}
.profile-view-card .member-profile-card::before { display: none !important; }
.profile-view-card #memberProfileAvatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 6px solid #20203e;
  background: #8b5cf6;
}
.profile-view-card #memberProfileName {
  display: block;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
}
.profile-view-card #memberProfileHandle,
.profile-view-card #memberProfileStatus,
.member-profile-bio {
  display: block;
  margin-top: 3px;
  color: #a59fc4;
  font-size: 13px;
}
.profile-badge,
.platform-badge,
.role-chip,
.server-role-badge {
  border-radius: 999px;
  background: rgba(139,92,246,.18);
  border: 1px solid rgba(139,92,246,.28);
  color: #ddd4ff;
  font-size: 11px;
  padding: 3px 7px;
}
.member-actions-row {
  justify-content: flex-end;
  gap: 8px;
}
.profile-primary-action {
  background: #8b5cf6 !important;
  color: white !important;
}
.ui-dialog-card { background: #181830; }
.ui-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.auth-card {
  background: #151529;
  border-color: rgba(255,255,255,.08);
}
.auth-hero {
  background:
    radial-gradient(circle at 18% 12%, rgba(139,92,246,.30), transparent 22rem),
    linear-gradient(145deg, #151529, #20203e);
}
.auth-form { background: #181830; }
.tab.active,
#authSubmitBtn { background: #8b5cf6; color: white; }

@media (max-width: 1260px) {
  .chat-shell { grid-template-columns: var(--rail-w) var(--side-w) minmax(0,1fr); }
}

@media (max-width: 820px) {
  :root { --mobile-nav-h: 60px; --topbar-h: 60px; }
  .chat-panel { inset: 0 0 calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)) 0; }
  .server-rail {
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
    min-height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  }
  .rail-button { width: 42px; height: 42px; }
  .channel-panel { width: min(84vw, 320px); }
  .chat-topbar {
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
    min-height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  }
  .messages { padding: 10px 8px 8px; }
  .message {
    grid-template-columns: 34px minmax(0,1fr);
    padding: 7px 62px 7px 6px !important;
  }
  .message-actions { opacity: 1; pointer-events: auto; }
  .message-form {
    width: calc(100% - 16px);
    margin: 0 8px 8px;
  }
  .composer-row {
    grid-template-columns: 34px 40px minmax(0,1fr) 40px;
    min-height: 42px;
  }
  #sendBtn {
    width: 38px;
    min-width: 38px;
    padding: 0;
    font-size: 0;
  }
  #sendBtn::before { content: '➤'; font-size: 16px; }
  .friends-hub { padding: 14px; }
  .hub-hero-card h2 { font-size: 26px; }
  .profile-view-card .member-profile-card {
    grid-template-columns: 72px minmax(0,1fr);
    padding: 54px 14px 14px;
  }
  .profile-view-card #memberProfileAvatar {
    width: 72px;
    height: 72px;
    border-width: 5px;
  }
}

/* Vibecord v2 polish: minimalist dark-blue theme, tighter Discord-like panels, safer overflow */
:root {
  --bg: #060b14;
  --rail: #080d17;
  --side: #0d1221;
  --side-2: #111827;
  --panel: #141b2e;
  --panel-2: #19223a;
  --panel-3: #1f2b49;
  --chat: #151b33;
  --composer: #1b2440;
  --input: #202b4a;
  --input-2: #273556;
  --text: #f6f8ff;
  --text-soft: #dce5ff;
  --muted: #9ba8c8;
  --muted-2: #727f9f;
  --border: rgba(149, 171, 255, .10);
  --border-strong: rgba(149, 171, 255, .18);
  --accent: #38bdf8;
  --accent-2: #60e6ff;
  --accent-3: #6d5dfc;
  --accent-dark: #1688c4;
  --accent-soft: rgba(56, 189, 248, .16);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, .16);
  --green: #34d399;
  --shadow: rgba(0, 0, 0, .42);
}
:root[data-theme="light"] {
  --bg: #edf5ff;
  --rail: #dceaff;
  --side: #eef5ff;
  --side-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f3f8ff;
  --panel-3: #e6f0ff;
  --chat: #f6f9ff;
  --composer: #ffffff;
  --input: #ecf3ff;
  --input-2: #ddeaff;
  --text: #142033;
  --text-soft: #24334d;
  --muted: #63708b;
  --muted-2: #7a87a0;
  --border: rgba(25, 39, 65, .12);
  --border-strong: rgba(25, 39, 65, .20);
  --accent-soft: rgba(56, 189, 248, .13);
  --shadow: rgba(26, 42, 70, .18);
}
html, body { background: var(--bg); }
body {
  background: linear-gradient(135deg, var(--bg), var(--chat));
}
button, .rail-button, .channel-button, .user-item, .member-item, .compact-item {
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease, opacity .16s ease;
}
.svg-icon { display: inline-block; vertical-align: -0.16em; pointer-events: none; }
.chat-shell { grid-template-columns: 72px 292px minmax(0, 1fr) 268px; }
.server-rail { padding: 12px 8px; gap: 10px; background: var(--rail); }
.rail-button { width: 50px; height: 50px; border-radius: 18px; background: #12182b; color: #b8c3e0; }
.rail-button.active, .rail-button:hover { background: linear-gradient(135deg, #3947ff, #38bdf8); color: white; border-radius: 16px; }
.channel-panel, .members-panel { background: var(--side); }
.workspace-header, .members-header, .chat-topbar {
  background: rgba(17, 24, 39, .88);
  border-color: var(--border);
}
.workspace-header { padding-left: 18px; }
.server-card, .channel-section, .self-card, .hub-card, .hub-hero-card, .modal-card, .settings-card {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: none;
}
.sidebar-mode { padding: 14px; gap: 14px; }
.section-label, .eyebrow.mini { letter-spacing: .12em; color: #8793b5; }
.channel-button { min-height: 38px; padding: 8px 10px; color: #aeb9d6; }
.channel-button:hover, .channel-button.active { background: var(--panel-2); color: var(--text); border-color: transparent; }
.channel-button.active { box-shadow: inset 3px 0 0 var(--accent); }
.channel-button.dragging { opacity: .5; transform: scale(.98); }
.channel-button.drop-target { outline: 2px solid rgba(56,189,248,.55); outline-offset: 2px; }
.server-menu { padding: 8px; border-radius: 14px; background: #11182b; animation: vibecord-pop .14s ease; }
.server-menu button { justify-content: flex-start; }
.message { position: relative; border-radius: 8px; }
.message:hover { background: rgba(255,255,255,.035); }
.message-actions { position: absolute; top: 4px; right: 8px; display: none; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); box-shadow: 0 10px 28px rgba(0,0,0,.24); }
.message:hover .message-actions, .message:focus-within .message-actions { display: flex; }
.message-action-btn { width: 30px; height: 28px; min-width: 30px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px; background: transparent; color: var(--muted); box-shadow: none; }
.message-action-btn:hover { color: var(--text); background: rgba(255,255,255,.08); transform: none; }
.message-action-btn.danger:hover { color: #fecdd3; background: var(--danger-soft); }
.meta { padding-right: 78px; }
.file-card { min-width: 0; max-width: min(470px, 100%); overflow: hidden; }
.file-card-copy { min-width: 0; display: grid; gap: 2px; }
.file-card-copy strong, .file-card-copy small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--input); color: var(--accent); }
.message-video-preview { display: block; width: min(560px, 100%); max-height: 360px; margin-top: 8px; border-radius: 14px; background: #030712; border: 1px solid var(--border); }
.message-audio-preview { width: min(460px, 100%); margin-top: 8px; padding: 12px; display: grid; gap: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.message-audio-preview strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-audio-preview audio { width: 100%; }
.friends-hub { max-width: 1180px; padding-left: clamp(30px, 4vw, 58px); padding-right: clamp(30px, 4vw, 58px); }
.user-item, .member-item, .request-row.main-request, .search-result-row, .compact-item { border-radius: 12px; }
.friend-row-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.friend-remove-button { width: 32px; height: 32px; min-width: 32px; padding: 0; display: inline-grid; place-items: center; border: 1px solid rgba(251,113,133,.26); border-radius: 10px; background: rgba(251,113,133,.10); color: #fecdd3; }
.friend-remove-button:hover { background: rgba(251,113,133,.18); transform: none; }
.member-copy small, .user-copy small { color: var(--muted); }
.member-badges:empty { display: none; }
.member-group-label { padding: 14px 10px 6px; display: flex; align-items: center; gap: 8px; color: #8491b4; font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .11em; }
.member-group-label em { margin-left: auto; font-style: normal; opacity: .8; }
.member-group-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted-2); }
.profile-view-card .member-profile-card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border-radius: 18px; }
.member-profile-bio { margin: -4px 0 2px; padding: 12px; border-radius: 12px; background: var(--input); color: var(--text-soft); line-height: 1.5; }
.profile-badge { border: 1px solid rgba(56,189,248,.28); background: rgba(56,189,248,.12); color: #bcefff; }
.settings-grid { display: grid; gap: 14px; }
.settings-grid.two-col, .profile-settings-grid, .server-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-card { padding: 16px; border-radius: 18px; display: grid; gap: 12px; }
.settings-card label { gap: 7px; }
.settings-muted { color: var(--muted); line-height: 1.4; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin: 8px 0; }
.permission-grid label { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--input); color: var(--text-soft); font-size: 12px; }
.permission-grid input { width: auto; }
.floating-context-menu { position: fixed; z-index: 9999; min-width: 160px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--panel-2); box-shadow: 0 18px 50px rgba(0,0,0,.35); animation: vibecord-pop .12s ease; }
.floating-context-menu button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; background: transparent; color: var(--text-soft); box-shadow: none; }
.floating-context-menu button:hover { background: rgba(255,255,255,.08); transform: none; }
.floating-context-menu .danger-item { color: #fecdd3; }
.voice-dock { background: var(--panel); border-color: rgba(56,189,248,.22); }
.voice-actions.compact { gap: 6px; }
.voice-icon-action { width: 34px; height: 34px; min-width: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; background: var(--input); color: var(--text-soft); border: 1px solid var(--border); }
.voice-icon-action.active { background: var(--accent-soft); color: var(--accent-2); }
.voice-chip { border-radius: 12px; padding: 6px 8px; }
.voice-local-mute { width: 24px; height: 24px; padding: 0; border-radius: 7px; background: var(--input); color: var(--muted); }
.voice-volume-range { width: 74px; padding: 0; accent-color: var(--accent); }
.screen-share-viewer.floating { position: absolute; right: 18px; bottom: 98px; z-index: 20; width: min(420px, calc(100% - 36px)); border: 1px solid var(--border-strong); border-radius: 18px; background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,.42); }
.modal-card { animation: vibecord-pop .16s ease; }
@keyframes vibecord-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 1260px) { .chat-shell { grid-template-columns: 72px 292px minmax(0, 1fr); } }
@media (max-width: 820px) {
  .chat-shell { display: block; }
  .chat-panel { inset: 0 0 calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)) 0; }
  .server-rail { height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .channel-panel { width: min(86vw, 340px); }
  .chat-topbar { min-height: calc(64px + env(safe-area-inset-top)); padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  .message { grid-template-columns: 34px minmax(0, 1fr); padding-right: 72px; }
  .meta { padding-right: 0; }
  .message-actions { display: flex; top: 6px; right: 6px; opacity: .72; }
  .settings-grid.two-col, .profile-settings-grid, .server-settings-grid { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .voice-volume-range { width: 62px; }
  .screen-share-viewer.floating { left: 10px; right: 10px; bottom: 96px; width: auto; }
}

/* Vibecord hotfix pass: pingi, voice view, draggable stream, context menus */
.mention-token {
  display: inline-flex;
  align-items: center;
  padding: 0 .28em;
  border-radius: 5px;
  background: rgba(88, 166, 255, .16);
  color: #9bd7ff;
  font-weight: 800;
}
.message.mentioned {
  background: rgba(56, 189, 248, .08);
  box-shadow: inset 3px 0 0 rgba(56, 189, 248, .78);
}
.message-actions {
  margin-left: auto;
  opacity: 0;
  transition: opacity .14s ease, transform .14s ease;
}
.message:hover .message-actions,
.message:focus-within .message-actions { opacity: 1; }
.message-action-button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  border: 1px solid transparent;
}
.message-action-button:hover { color: var(--text); border-color: var(--border); box-shadow: none; transform: none; }
.message-action-button.danger:hover { color: var(--danger); background: var(--danger-soft); }
.floating-context-menu {
  position: fixed;
  z-index: 9999;
  min-width: 210px;
  padding: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #111827;
  box-shadow: 0 20px 80px rgba(0,0,0,.45);
}
.floating-context-menu button,
.floating-context-menu label {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  border: 0;
  box-shadow: none;
  text-align: left;
  font-size: 13px;
}
.floating-context-menu button:hover { background: rgba(255,255,255,.07); transform: none; box-shadow: none; }
.floating-context-menu .danger-item { color: #fecdd3; }
.context-menu-title { display: block; padding: 8px 10px 6px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.context-volume-control { display: grid !important; align-items: stretch !important; color: var(--muted) !important; }
.context-volume-control input { padding: 0; accent-color: var(--accent-3); }
.screen-share-viewer {
  position: relative;
  width: min(920px, calc(100% - 28px));
  margin: 0 auto 10px;
  z-index: 20;
}
.screen-share-viewer.manual-position {
  position: fixed !important;
  margin: 0 !important;
  max-width: calc(100vw - 16px);
  z-index: 120;
}
.screen-share-toolbar { cursor: move; user-select: none; }
#streamFloatingBtn { display: none !important; }
.voice-room-grid {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.voice-room-card {
  position: relative;
  min-height: 190px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(19, 31, 48, .95), rgba(10, 15, 26, .95));
}
.voice-room-card.speaking {
  border-color: rgba(56, 189, 248, .75);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .12), 0 18px 55px rgba(0,0,0,.25);
}
.voice-room-card video {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}
.voice-room-card > .avatar { width: 84px; height: 84px; font-size: 28px; }
.voice-room-card-footer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.50);
  backdrop-filter: blur(8px);
}
.voice-room-card-footer strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-room-card-footer span { display: inline-flex; gap: 6px; color: var(--muted); }
.voice-room-streams {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.03);
}
.voice-room-streams h3 { width: 100%; margin: 0 0 4px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.voice-room-stream-button { background: var(--input); color: var(--text-soft); border: 1px solid var(--border); box-shadow: none; }
.voice-chip.speaking,
.voice-channel-user.speaking {
  color: var(--text);
  background: rgba(56, 189, 248, .10);
  box-shadow: inset 3px 0 0 rgba(56,189,248,.75);
}
.topbar-icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 11px;
  background: var(--input);
  color: var(--text-soft);
  border: 1px solid var(--border);
  box-shadow: none;
}
.topbar-icon-button:hover { color: var(--text); background: var(--input-2); transform: none; box-shadow: none; }
.file-card-copy { min-width: 0; overflow: hidden; }
.file-card-copy strong,
.file-card-copy small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-profile-card > div { min-width: 0; }
.member-profile-card strong,
.member-profile-card span,
.member-profile-card small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.server-menu button { display: flex; align-items: center; gap: 8px; }
@media (max-width: 820px) {
  .voice-room-grid { width: calc(100% - 18px); grid-template-columns: 1fr; gap: 10px; padding: 12px 0 22px; }
  .voice-room-card { min-height: 170px; border-radius: 16px; }
  .voice-room-card video { min-height: 170px; }
  .screen-share-viewer { width: calc(100% - 18px); }
  .message-actions { opacity: 1; }
}

:root[data-theme="light"] .floating-context-menu { background: #ffffff; }
:root[data-theme="light"] .voice-room-card { background: linear-gradient(160deg, #ffffff, #eaf5f8); }

/* Server menu moved to the workspace header */
.server-card.has-menu { display: none !important; }
.workspace-header-menu-trigger { cursor: pointer; transition: background .15s ease; }
.workspace-header-menu-trigger:hover { background: rgba(255,255,255,.045); }
.channel-panel > .server-menu {
  margin: 10px 12px 0;
  position: relative;
  z-index: 20;
}
.rail-button.dragging, .channel-button.dragging { opacity: .45; transform: scale(.96); }
.rail-button.drop-target, .channel-button.drop-target { outline: 2px solid var(--accent-3); outline-offset: 2px; }

/* Vibecord polish patch: voice state, role-only channels, context menus, settings spacing */
.voice-channel-user.speaking,
.voice-chip.speaking,
.voice-room-card.speaking {
  box-shadow: inset 3px 0 0 var(--accent-3), 0 0 0 1px rgba(56,189,248,.28);
  background: rgba(56,189,248,.10) !important;
  color: var(--text) !important;
}
.voice-channel-user.speaking::after,
.voice-chip.speaking::after,
.voice-room-card.speaking::after {
  content: "mówi";
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(56,189,248,.18);
  color: #c8f3ff;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.voice-channel-user.deafened,
.voice-chip.deafened,
.voice-room-card.deafened {
  opacity: .78;
}
.voice-channel-user em,
.voice-chip em,
.voice-room-card-footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.server-muted-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #111827;
  color: #9ca3af;
  border: 2px solid var(--rail);
}
.rail-button.server-muted {
  opacity: .68;
  filter: saturate(.72);
}
.inline-visibility-box,
.channel-visibility-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}
.inline-visibility-toggle {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: rgba(255,255,255,.055) !important;
  color: var(--text-soft) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: none !important;
}
.inline-role-grid,
.role-visibility-grid {
  grid-template-columns: 1fr;
  gap: 6px;
}
.inline-role-grid label,
.role-visibility-grid label,
.permission-grid label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  color: var(--text-soft);
}
.floating-context-menu {
  min-width: 220px;
  max-width: min(320px, calc(100vw - 20px));
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(18, 20, 40, .98);
  box-shadow: 0 18px 70px rgba(0,0,0,.45);
  backdrop-filter: blur(16px);
  z-index: 1000;
}
.context-menu-title {
  display: block;
  padding: 8px 10px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.floating-context-menu button,
.floating-context-menu select,
.context-volume-control {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  border: 0;
  box-shadow: none;
  text-align: left;
}
.floating-context-menu button:hover {
  background: rgba(255,255,255,.07);
  transform: none;
  box-shadow: none;
}
.context-divider {
  height: 1px;
  margin: 4px 2px;
  background: rgba(255,255,255,.08);
}
.context-volume-control {
  display: grid;
  grid-template-columns: 1fr;
  font-size: 12px;
  color: var(--muted);
}
.context-volume-control input {
  padding: 0;
}
.context-select {
  background: rgba(255,255,255,.06) !important;
  color: var(--text) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
.profile-editor-v2,
.server-settings-v2 {
  width: min(780px, calc(100vw - 24px));
  gap: 18px;
}
.settings-grid,
.server-settings-grid,
.profile-settings-grid {
  gap: 16px !important;
}
.settings-card {
  padding: 18px !important;
  border-radius: 18px !important;
}
.modal-header-hero {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.member-item .member-badges {
  display: none;
}
.member-copy small,
.user-copy small {
  max-width: 100%;
}
@media (max-width: 820px) {
  .profile-editor-v2,
  .server-settings-v2 {
    width: 100%;
  }
  .settings-grid,
  .server-settings-grid,
  .profile-settings-grid {
    grid-template-columns: 1fr !important;
  }
  .voice-channel-user.speaking::after,
  .voice-chip.speaking::after {
    content: "";
    width: 8px;
    height: 8px;
    padding: 0;
    background: var(--accent-3);
  }
}

/* --- Bugfix patch: context menus, speaking border, safer voice DnD --- */
.floating-context-menu {
  pointer-events: auto;
  user-select: none;
}
.floating-context-menu button,
.floating-context-menu select,
.context-volume-control input {
  pointer-events: auto;
}
.voice-channel-user.speaking,
.voice-chip.speaking,
.voice-room-card.speaking {
  border-color: rgba(34, 197, 94, .95) !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .24) !important;
  background: inherit !important;
  color: var(--text) !important;
}
.voice-channel-user.speaking::after,
.voice-chip.speaking::after,
.voice-room-card.speaking::after {
  content: none !important;
  display: none !important;
}
.voice-chip.speaking {
  outline: 2px solid rgba(34, 197, 94, .38);
  outline-offset: 1px;
}
.voice-user-draggable {
  cursor: grab;
}
.voice-user-draggable.dragging {
  opacity: .52;
  cursor: grabbing;
}
.voice-channel-button.drop-target,
.voice-channel-block.drop-target {
  outline: 2px solid rgba(34, 197, 94, .85) !important;
  outline-offset: 2px;
}
.edited-chip:empty { display: none; }

/* --- DM call / Discord-like active call panel --- */
.dm-call-banner {
  width: min(1120px, calc(100% - 28px));
  margin: 12px auto 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(52, 211, 153, .28);
  border-radius: 20px;
  background:
    radial-gradient(circle at 16px 10px, rgba(52, 211, 153, .16), transparent 34%),
    linear-gradient(135deg, rgba(9, 26, 36, .96), rgba(13, 20, 34, .96));
  box-shadow: 0 18px 54px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.045);
}
.dm-call-banner[hidden] { display: none !important; }
.dm-call-banner.incoming {
  border-color: rgba(96, 165, 250, .42);
  background:
    radial-gradient(circle at 16px 10px, rgba(96, 165, 250, .20), transparent 34%),
    linear-gradient(135deg, rgba(12, 26, 48, .97), rgba(10, 17, 32, .97));
}
.dm-call-banner-main {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dm-call-pulse {
  width: 11px;
  height: 11px;
  display: inline-grid;
  place-items: center;
  color: transparent;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 6px rgba(52,211,153,.12), 0 0 20px rgba(52,211,153,.46);
}
.dm-call-banner.incoming .dm-call-pulse,
.dm-call-banner.calling .dm-call-pulse {
  background: #60a5fa;
  box-shadow: 0 0 0 6px rgba(96,165,250,.12), 0 0 20px rgba(96,165,250,.45);
  animation: dmCallPulse 1.25s infinite ease-in-out;
}
@keyframes dmCallPulse {
  0%, 100% { transform: scale(.86); opacity: .7; }
  50% { transform: scale(1.08); opacity: 1; }
}
.dm-call-copy { min-width: 0; display: grid; gap: 3px; }
.dm-call-copy strong,
.dm-call-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-call-copy strong { color: var(--text); font-size: 14px; }
.dm-call-copy small { color: var(--muted); font-size: 12px; }
.dm-call-people {
  display: flex;
  align-items: center;
  min-width: 0;
}
.dm-call-people .avatar {
  border: 2px solid rgba(15, 23, 42, .95);
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
}
.dm-call-people .avatar + .avatar { margin-left: -9px; }
.dm-call-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.dm-call-actions button {
  min-height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.dm-call-actions .primary-action,
.dm-call-accept-btn,
.dm-call-join-btn {
  border: 1px solid rgba(52, 211, 153, .32);
  color: #d1fae5;
  background: linear-gradient(135deg, rgba(16, 185, 129, .92), rgba(20, 184, 166, .84));
  box-shadow: 0 10px 24px rgba(20,184,166,.20);
}
.dm-call-stream-btn {
  border-color: rgba(96,165,250,.28) !important;
  background: rgba(96,165,250,.11) !important;
  color: #dbeafe !important;
}
.dm-call-list-pill {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #d1fae5;
  background: rgba(16, 185, 129, .16);
  border: 1px solid rgba(52, 211, 153, .28);
  box-shadow: 0 0 0 3px rgba(52,211,153,.06);
}
.user-item.has-dm-call .user-copy small { color: #a7f3d0; }

.voice-room-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid rgba(52, 211, 153, .20);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(52, 211, 153, .13), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(8, 13, 25, .92));
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
.voice-room-hero h2 { margin: 2px 0 4px; font-size: clamp(20px, 3vw, 30px); }
.voice-room-hero span { color: var(--muted); }
.voice-room-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.voice-room-card.sharing-screen { border-color: rgba(96, 165, 250, .42); }
.voice-room-card-stream {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(96,165,250,.35);
  color: #dbeafe;
  background: rgba(96,165,250,.16);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dm-voice-room-grid { padding-top: 14px; }

/* --- Cleaner user settings and member management UI --- */
.modal-card.profile-editor-v2,
.modal-card.member-editor {
  border-radius: 28px !important;
  padding: clamp(16px, 2.2vw, 24px) !important;
}
.profile-editor-v2 .modal-header-hero,
.member-editor .modal-header {
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 22px;
  padding: clamp(14px, 2vw, 18px);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, .12), transparent 32%),
    linear-gradient(135deg, rgba(15, 23, 42, .80), rgba(2, 6, 23, .55));
}
.profile-settings-grid {
  align-items: stretch;
}
.profile-preview-card,
.member-profile-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(56, 189, 248, .18) !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, .18), transparent 34%),
    linear-gradient(160deg, rgba(15, 23, 42, .86), rgba(8, 13, 25, .86)) !important;
}
.profile-preview-card::before,
.member-profile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 76px;
  background: linear-gradient(90deg, rgba(56,189,248,.28), rgba(52,211,153,.20), transparent);
  opacity: .55;
  pointer-events: none;
}
.profile-preview-card > *,
.member-profile-card > * { position: relative; z-index: 1; }
.profile-basic-card,
.profile-status-card,
.appearance-box,
.audio-device-box,
.account-actions-box,
.push-box,
.badge-admin-box,
.member-role-manager,
.member-actions-row,
.moderation-row {
  border-radius: 20px !important;
}
.profile-editor-v2 input,
.profile-editor-v2 textarea,
.profile-editor-v2 select,
.member-editor input,
.member-editor select {
  border-radius: 14px !important;
  min-height: 42px;
  background: rgba(2, 6, 23, .42) !important;
  border-color: rgba(148, 163, 184, .16) !important;
}
.profile-editor-v2 textarea { min-height: 96px; resize: vertical; }
.profile-editor-v2 .settings-card:hover,
.member-editor .member-profile-card:hover,
.member-role-manager:hover {
  border-color: rgba(56,189,248,.28) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 42px rgba(0,0,0,.18);
}
.member-editor {
  display: grid;
  gap: 14px;
}
.member-editor > label,
.member-role-manager,
.member-actions-row,
#memberModalError {
  margin-inline: 2px;
}
.member-actions-row {
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .12);
  background: rgba(15, 23, 42, .42);
}
.member-role-list {
  display: grid;
  gap: 8px;
}
.member-role-list > * {
  border-radius: 14px;
}

@media (max-width: 760px) {
  .dm-call-banner {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .dm-call-people { display: none; }
  .dm-call-actions { justify-content: stretch; }
  .dm-call-actions button { flex: 1 1 auto; }
  .voice-room-hero { align-items: flex-start; flex-direction: column; }
  .voice-room-hero-actions { width: 100%; }
  .voice-room-hero-actions button { flex: 1 1 auto; }
}

/* --- Vibecord logo slots and refreshed invite UI --- */
.app-logo {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.app-logo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  z-index: 2;
}
.app-logo > span {
  position: relative;
  z-index: 1;
}
.rail-button.home {
  overflow: hidden;
}
.rail-button.home .rail-logo-img {
  position: absolute;
  inset: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  border-radius: 14px;
  object-fit: cover;
  z-index: 2;
}
.rail-button.home .rail-logo-img + [data-icon] {
  opacity: 0;
}
.workspace-header {
  justify-content: flex-start;
}
.workspace-header > div {
  flex: 1 1 auto;
}
.workspace-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid !important;
  place-items: center;
  margin-top: 0 !important;
  border-radius: 14px;
  border: 1px solid rgba(45, 212, 191, .22);
  background: linear-gradient(135deg, rgba(20, 184, 166, .24), rgba(56, 189, 248, .16));
  color: var(--accent-2) !important;
  font-size: 16px !important;
  font-weight: 950;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(20, 184, 166, .12);
}
.workspace-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.workspace-logo img + span {
  display: none;
}
.primary-action {
  border: 1px solid rgba(52, 211, 153, .34);
  color: #d1fae5;
  background: linear-gradient(135deg, rgba(16, 185, 129, .95), rgba(20, 184, 166, .86));
  box-shadow: 0 12px 26px rgba(20,184,166,.18);
}
.primary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(20,184,166,.24);
}
.invite-modal-card-v2 {
  width: min(620px, calc(100vw - 28px));
  overflow: hidden;
  border-radius: 28px !important;
  border-color: rgba(45, 212, 191, .18) !important;
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 212, 191, .16), transparent 35%),
    linear-gradient(180deg, rgba(15, 23, 42, .98), rgba(7, 13, 23, .98)) !important;
}
.invite-hero-header {
  align-items: center;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
}
.invite-server-preview {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.invite-server-preview > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.invite-server-preview strong,
.invite-server-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invite-modal-content-v2 {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.invite-code-showcase-v2,
.invite-send-card-v2,
.server-invite-card-v2 {
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 22px;
  background: rgba(2, 6, 23, .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.invite-code-showcase-v2 {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
}
.invite-code-showcase-v2 .invite-icon.big {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(45, 212, 191, .12);
  box-shadow: 0 12px 30px rgba(45, 212, 191, .12);
}
.invite-code-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.invite-code-copy small,
.invite-send-card-v2 small {
  color: var(--muted);
  line-height: 1.45;
}
.invite-code-row input {
  min-width: 0;
  height: 44px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .08em;
  text-align: center;
  color: var(--text);
  border-color: rgba(45, 212, 191, .22);
  background: rgba(15, 23, 42, .72);
}
.invite-code-row button {
  min-height: 44px;
  border-color: rgba(45, 212, 191, .26);
  color: var(--accent-2);
  background: rgba(45, 212, 191, .10);
}
.invite-send-card-v2 {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.invite-send-card-v2 > div {
  display: grid;
  gap: 4px;
}
.invite-send-card-v2 strong {
  font-size: 15px;
}
.invite-send-card-v2 select {
  min-height: 44px;
  border-radius: 14px;
  background: rgba(15, 23, 42, .76);
}
.server-invite-card-v2 {
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  margin-top: 6px;
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, .13), transparent 42%),
    rgba(2, 6, 23, .36);
}
.server-invite-top {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}
.server-invite-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.server-invite-copy small {
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.server-invite-copy strong,
.server-invite-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-invite-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.server-invite-card-v2 > button {
  min-height: 38px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.dm-call-banner.active .dm-call-pulse,
.dm-call-banner.joined .dm-call-pulse {
  background: #34d399;
}
@media (max-width: 640px) {
  .workspace-logo { width: 34px; height: 34px; border-radius: 12px; }
  .invite-code-showcase-v2,
  .server-invite-card-v2 { grid-template-columns: 1fr; }
  .server-invite-card-v2 > button { width: 100%; justify-content: center; }
}

/* Targeted fixes: image preview + platform admin dashboard */
.message-image-button {
  display: inline-block;
  max-width: min(460px, 100%);
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}
.message-image-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.message-image-button .message-image,
.message-image-button .message-gif {
  margin-top: 0;
}
.image-file-card {
  cursor: default;
}
.file-preview-button {
  margin-left: auto;
  white-space: nowrap;
}
.image-viewer-modal {
  z-index: 120;
  padding: 18px;
}
.image-viewer-card {
  width: min(1100px, 100%);
  height: min(780px, calc(100dvh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: rgba(3, 7, 18, .94);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
}
.image-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.image-viewer-toolbar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.image-viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.image-viewer-stage.dragging {
  cursor: grabbing;
}
.image-viewer-stage img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform .08s ease-out;
  will-change: transform;
}
.admin-dashboard-mini {
  min-width: 38px;
  font-size: 10px;
  letter-spacing: .06em;
  font-weight: 950;
}
.admin-dashboard-card {
  width: min(900px, 100%);
}
.admin-dashboard-grid {
  align-items: start;
}
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-stat-item {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}
.admin-stat-item strong {
  font-size: 22px;
}
.admin-stat-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.admin-badge-list {
  display: grid;
  gap: 9px;
  max-height: 280px;
  overflow: auto;
}
.admin-badge-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.admin-badge-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
@media (max-width: 720px) {
  .image-viewer-toolbar { align-items: flex-start; flex-direction: column; }
  .image-viewer-actions { justify-content: flex-start; }
  .admin-stats-grid { grid-template-columns: 1fr; }
  .admin-badge-row { grid-template-columns: 1fr; }
  .file-preview-button { margin-left: 0; }
}

/* --- Settings/Admin layout hotfix: calmer UI, no overflow for platform admin --- */
.modal-card.profile-editor-v2 {
  width: min(940px, calc(100vw - 28px));
  max-height: min(900px, calc(100dvh - 28px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-editor-v2 .modal-header-hero {
  flex: 0 0 auto;
}

.profile-editor-v2 .profile-settings-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 2px 4px 8px 2px;
  scrollbar-width: thin;
}

.profile-settings-grid {
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr);
  align-items: start;
}

.profile-settings-grid .settings-card {
  min-width: 0;
}

.profile-preview-card,
.profile-basic-card,
.profile-status-card,
.audio-device-box,
.push-box,
.appearance-box,
.account-actions-box {
  align-self: stretch;
}

.profile-preview-card .profile-avatar-row.pro {
  align-items: center;
  min-width: 0;
}

.profile-preview-card .profile-avatar-row.pro > div {
  min-width: 0;
}

.profile-preview-card .profile-avatar-row.pro strong,
.profile-preview-card .profile-avatar-row.pro small {
  overflow-wrap: anywhere;
}

.profile-editor-v2 .status-form-row,
.member-editor .status-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.profile-editor-v2 label,
.member-editor label,
.admin-dashboard-card label {
  min-width: 0;
}

.profile-editor-v2 input,
.profile-editor-v2 textarea,
.profile-editor-v2 select,
.member-editor input,
.member-editor select,
.admin-dashboard-card input,
.admin-dashboard-card select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.badge-admin-box {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.profile-editor-v2 > .badge-admin-box {
  flex: 0 0 auto;
  max-height: 320px;
  overflow: auto;
  margin-top: 0;
  border-color: rgba(56, 189, 248, .20) !important;
  background: rgba(15, 23, 42, .58) !important;
}

.badge-admin-box .badge-create-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.badge-admin-box .badge-create-row label:first-child,
.badge-admin-box .badge-create-row label:nth-child(3) {
  grid-column: span 2;
}

.badge-admin-box input[type="color"],
.admin-dashboard-card input[type="color"] {
  min-height: 42px;
  padding: 5px;
}

.badge-admin-box .inline-actions,
.admin-dashboard-card .inline-actions,
.member-actions-row,
.moderation-row,
.role-assign-row,
.push-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.badge-admin-box .inline-actions button,
.push-actions button,
.member-actions-row button,
.moderation-row button {
  min-width: max-content;
}

.profile-editor-v2 .sticky-actions {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -4px -4px;
  padding: 12px 4px 0;
  border-top: 1px solid rgba(148, 163, 184, .14);
  background: linear-gradient(180deg, rgba(15, 23, 42, .20), rgba(15, 23, 42, .94) 35%);
}

.profile-editor-v2 .sticky-actions .form-error {
  min-width: 0;
  overflow-wrap: anywhere;
}

.modal-card.member-editor {
  width: min(620px, calc(100vw - 28px));
  max-height: min(840px, calc(100dvh - 28px));
  overflow: auto;
}

.member-profile-card {
  grid-template-columns: auto minmax(0, 1fr);
}

.member-profile-card > div {
  min-width: 0;
}

#memberProfileName,
#memberProfileHandle,
#memberProfileStatus {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role-manager,
.member-actions-row,
.moderation-row {
  min-width: 0;
  box-sizing: border-box;
}

.member-role-list {
  max-height: 230px;
  overflow: auto;
  padding-right: 2px;
}

.role-assign-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-dashboard-card {
  width: min(900px, calc(100vw - 28px));
  max-height: min(860px, calc(100dvh - 28px));
  overflow: auto;
}

.admin-dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.admin-badge-row {
  min-width: 0;
}

.admin-badge-row > * {
  min-width: 0;
}

@media (max-width: 860px) {
  .modal-card.profile-editor-v2,
  .modal-card.member-editor,
  .admin-dashboard-card {
    width: min(100%, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    border-radius: 22px !important;
  }

  .profile-settings-grid,
  .profile-editor-v2 .status-form-row,
  .member-editor .status-form-row,
  .badge-admin-box .badge-create-row,
  .admin-dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .badge-admin-box .badge-create-row label:first-child,
  .badge-admin-box .badge-create-row label:nth-child(3) {
    grid-column: auto;
  }

  .role-assign-row {
    grid-template-columns: 1fr;
  }

  .badge-admin-box .inline-actions button,
  .push-actions button,
  .member-actions-row button,
  .moderation-row button,
  .role-assign-row button,
  .profile-editor-v2 .sticky-actions button {
    width: 100%;
    justify-content: center;
  }

  .profile-editor-v2 .sticky-actions {
    margin-inline: 0;
  }
}


/* --- Server settings + friends polish patch --- */
#platformBadgeAdmin.badge-admin-box {
  display: none !important;
}

.modal-card.server-settings-v2 {
  width: min(820px, calc(100vw - 28px)) !important;
  max-height: min(820px, calc(100dvh - 28px)) !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.server-settings-v2 .modal-header-hero {
  margin-bottom: 8px;
  padding-bottom: 12px;
}

.server-settings-v2 .modal-header-hero strong {
  font-size: 17px;
}

.server-settings-v2 .modal-header-hero span {
  font-size: 12px;
  line-height: 1.35;
}

.server-settings-v2 .settings-tabs-static {
  margin: 0 0 8px;
  gap: 6px;
}

.server-settings-v2 .settings-tabs-static span {
  padding: 6px 10px;
  font-size: 11px;
}

.server-settings-v2 .server-settings-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 2px 4px 8px 2px;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr) !important;
  gap: 12px !important;
  align-items: start;
  scrollbar-width: thin;
}

.server-settings-v2 .settings-card {
  padding: 14px !important;
  border-radius: 16px !important;
  gap: 10px;
  min-width: 0;
}

.server-settings-v2 .profile-avatar-row.pro {
  gap: 12px;
  margin-bottom: 8px;
}

.server-settings-v2 .server-icon.huge {
  width: 68px;
  height: 68px;
  min-width: 68px;
  border-radius: 20px;
  font-size: 24px;
}

.server-settings-v2 input,
.server-settings-v2 select,
.server-settings-v2 button,
.server-settings-v2 .file-picker-button {
  min-height: 38px;
}

.server-settings-v2 .role-create-row {
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 8px;
}

.server-settings-v2 .permission-grid {
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 4px 0;
}

.server-settings-v2 .permission-grid label {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
}

.server-settings-v2 .role-list-box {
  margin-top: 6px;
}

.server-settings-v2 .roles-preview-list {
  max-height: 170px;
  overflow: auto;
  padding-right: 2px;
}

.server-help-card,
.server-danger-card {
  grid-column: span 2;
}

.server-danger-card {
  border-color: rgba(251, 113, 133, .24) !important;
  background: linear-gradient(180deg, rgba(127, 29, 29, .16), rgba(15, 23, 42, .70)) !important;
}

.danger-label {
  color: #fecdd3 !important;
}

.server-danger-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.server-danger-copy strong {
  color: var(--text);
  font-size: 14px;
}

.server-danger-copy small {
  color: var(--muted);
  line-height: 1.4;
}

.server-danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.server-danger-actions button {
  width: auto;
  min-width: 150px;
}

.request-row.main-request.outgoing-request {
  border-color: rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .46);
}

.request-row.main-request .request-actions .ghost-button.small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.friend-row-actions {
  flex: 0 0 auto;
}

.friend-remove-button {
  font-size: 17px;
  line-height: 1;
}

.search-result-row .danger-button.soft,
.request-actions .danger-soft {
  border-color: rgba(251, 113, 133, .26) !important;
  background: rgba(251, 113, 133, .10) !important;
  color: #fecdd3 !important;
  box-shadow: none !important;
}

.search-result-row .danger-button.soft:hover,
.request-actions .danger-soft:hover {
  background: rgba(251, 113, 133, .18) !important;
}

@media (max-width: 860px) {
  .modal-card.server-settings-v2 {
    width: min(100%, calc(100vw - 16px)) !important;
    max-height: calc(100dvh - 16px) !important;
  }

  .server-settings-v2 .server-settings-grid,
  .server-help-card,
  .server-danger-card {
    grid-template-columns: 1fr !important;
    grid-column: auto;
  }

  .server-danger-actions button {
    width: 100%;
  }
}

/* --- Home news + admin news manager --- */
.home-news-panel {
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(15, 29, 40, .70);
  box-shadow: 0 14px 40px rgba(0,0,0,.12);
}
.home-news-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.home-news-heading h3 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: -.035em;
}
.home-news-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}
.home-news-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.home-news-card,
.home-news-empty {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
}
.home-news-card.important {
  border-color: rgba(32, 214, 196, .28);
  background: radial-gradient(circle at 8% 0%, rgba(32, 214, 196, .14), transparent 15rem), rgba(255,255,255,.035);
}
.home-news-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.home-news-tag {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 8px;
  border: 1px solid rgba(32, 214, 196, .22);
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(32, 214, 196, .08);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.home-news-card time {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.home-news-card h3 {
  margin: 0 0 7px;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.home-news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.home-news-pin {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(250, 204, 21, .11);
  color: #facc15;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.home-news-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  color: var(--muted);
}
.home-news-empty strong {
  color: var(--text);
}
.admin-news-create-card textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
  box-sizing: border-box;
}
.checkbox-line.admin-news-important {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--input);
  color: var(--text-soft);
  font-weight: 850;
}
.checkbox-line.admin-news-important input {
  width: auto;
  min-width: auto;
}
.admin-news-list {
  display: grid;
  gap: 9px;
  max-height: 330px;
  overflow: auto;
  scrollbar-width: thin;
}
.admin-news-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}
.admin-news-row.important {
  border-color: rgba(250, 204, 21, .22);
}
.admin-news-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.admin-news-copy small,
.admin-news-copy span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-news-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .home-news-list { grid-template-columns: 1fr; }
  .home-news-heading { align-items: flex-start; flex-direction: column; }
  .home-news-heading > span { text-align: left; }
}
@media (max-width: 720px) {
  .home-news-panel { padding: 14px; border-radius: 20px; }
  .admin-news-row { grid-template-columns: 1fr; }
}

/* --- DM sidebar / Discord-like cleanup --- */
.messages { scroll-behavior: auto !important; }
.dm-discord-sidebar {
  gap: 10px;
  padding: 12px 10px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 180px),
    var(--side);
}
.dm-search-button {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(0,0,0,.24);
  color: var(--text-soft);
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}
.dm-search-button:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(255,255,255,.055);
}
.dm-nav-list {
  display: grid;
  gap: 3px;
  padding: 4px 0 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.dm-nav-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  text-align: left;
}
.dm-nav-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 850;
}
.dm-nav-item svg,
.dm-nav-item > span:first-child {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  color: currentColor;
}
.dm-nav-item em {
  min-width: 22px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}
.dm-nav-item.active,
.dm-nav-item:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(255,255,255,.10);
  color: var(--text);
}
.dm-nav-item.muted:disabled {
  opacity: .78;
  cursor: default;
}
.dm-private-section {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.dm-private-section .section-row {
  padding: 0 8px 6px;
}
.dm-private-section .section-label {
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: none;
}
.dm-users-list {
  display: grid;
  gap: 2px;
}
.dm-users-list .user-item {
  min-height: 44px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.dm-users-list .user-item:hover,
.dm-users-list .user-item.active {
  background: rgba(255,255,255,.09);
  transform: none;
  box-shadow: none;
}
.dm-users-list .avatar-wrap,
.dm-users-list .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
.dm-users-list .status-dot {
  right: -1px;
  bottom: -1px;
  border-width: 3px;
}
.dm-users-list .user-copy strong {
  font-size: 14px;
  font-weight: 750;
}
.dm-users-list .user-copy small {
  font-size: 11px;
  color: var(--muted-2);
}
.self-card {
  margin: 8px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 86% 20%, rgba(168,85,247,.34), transparent 7rem),
    linear-gradient(135deg, rgba(88,28,135,.82), rgba(42,18,69,.90));
  border-color: rgba(216,180,254,.24);
}
.self-card .mini-button,
.self-card .logout-button {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.14);
}

/* --- Registration invites --- */
.auth-invite-info {
  min-height: 38px;
  display: grid;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(56,189,248,.20);
  border-radius: 14px;
  background: rgba(56,189,248,.08);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
.invite-only-auth:has(#registerTab[hidden]) {
  grid-template-columns: 1fr;
}
.registration-invite-box {
  display: grid;
  gap: 10px;
}
.registration-invite-list,
.admin-registration-invite-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}
.registration-invite-row,
.admin-registration-invite-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}
.registration-invite-row.used,
.admin-registration-invite-row.used {
  opacity: .72;
}
.registration-invite-copy,
.admin-registration-invite-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.registration-invite-copy strong,
.admin-registration-invite-copy strong {
  font-size: 13px;
}
.registration-invite-copy small,
.admin-registration-invite-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
.registration-invite-actions {
  display: inline-flex;
  gap: 6px;
}
.status-pill {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-pill.active {
  background: rgba(50,213,131,.12);
  color: #86efac;
}
.status-pill.used {
  background: rgba(148,163,184,.12);
  color: #cbd5e1;
}
.admin-registration-invites-card {
  grid-column: 1 / -1;
}

/* --- Right members list closer to Discord: roles + offline --- */
.members-panel {
  background: #070d13;
}
.member-group-label {
  margin: 12px 8px 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
  letter-spacing: .02em;
}
.member-group-label em {
  margin-left: auto;
  font-size: 11px;
  font-style: normal;
  opacity: .7;
}
.member-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  flex: 0 0 auto;
}
.member-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.member-item:hover {
  background: rgba(255,255,255,.08);
  transform: none;
  box-shadow: none;
}
.member-item:not(.online) {
  opacity: .45;
  filter: saturate(.65);
}
.member-item:not(.online) .status-dot {
  background: #111827;
}
.voice-channel-user.speaking,
.voice-chip.speaking,
.voice-room-card.speaking,
.member-item.speaking {
  box-shadow: 0 0 0 2px rgba(50,213,131,.55), 0 0 18px rgba(50,213,131,.18) !important;
  background: rgba(50,213,131,.08) !important;
}

@media (max-width: 820px) {
  .dm-search-button { min-height: 38px; }
  .registration-invite-row,
  .admin-registration-invite-row { grid-template-columns: 1fr; align-items: start; }
  .registration-invite-actions { width: 100%; }
  .registration-invite-actions button { flex: 1; }
}

/* --- Settings window + DM unread polish patch --- */
.dm-nav-list { gap: 6px; }
.dm-nav-item:not(.muted) { cursor: pointer; }
.dm-nav-item em, .dm-rail-unread { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: #ef4444; color: #fff; font-size: 11px; font-weight: 950; line-height: 1; }
.rail-button.home.has-dm-unread { box-shadow: 0 0 0 2px rgba(239,68,68,.25), 0 0 22px rgba(239,68,68,.22); }
.rail-button .dm-rail-unread { position: absolute; right: -7px; bottom: -5px; border: 3px solid var(--bg); }

.settings-backdrop { align-items: stretch; justify-items: stretch; padding: 24px; }
.modal-card.profile-editor-v3 {
  width: min(1280px, calc(100vw - 48px));
  height: min(860px, calc(100dvh - 48px));
  max-height: none;
  margin: auto;
  padding: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #0f1015;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 30px 120px rgba(0,0,0,.62);
}
.settings-left-nav {
  min-width: 0;
  padding: 12px;
  background: #15161c;
  border-right: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.settings-user-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.06);
}
.settings-user-card .avatar { width: 44px; height: 44px; }
.settings-user-card strong { display: block; color: var(--text); font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-user-card small { color: var(--muted); font-size: 12px; font-weight: 750; }
.settings-nav-item {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #b5bac1;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}
.settings-nav-item svg, .settings-nav-item [data-icon] { width: 18px; height: 18px; opacity: .9; }
.settings-nav-item:hover { background: rgba(255,255,255,.06); color: #eef2ff; }
.settings-nav-item.active { background: rgba(255,255,255,.12); color: #fff; }
.settings-nav-item.danger { color: #fca5a5; }
.settings-nav-separator { height: 1px; margin: 10px 4px; background: rgba(255,255,255,.08); }
.settings-main-panel {
  position: relative;
  min-width: 0;
  overflow-y: auto;
  padding: 58px 42px 42px;
  background: #0b0c10;
}
.settings-close-button {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b5bac1;
  font-size: 22px;
  cursor: pointer;
}
.settings-close-button:hover { background: rgba(255,255,255,.08); color: #fff; }
.settings-pane {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}
.settings-pane[hidden] { display: none !important; }
.settings-page-title { margin-bottom: 10px; }
.settings-page-title h2 {
  margin: 0 0 8px;
  color: #f2f3f5;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -.02em;
}
.settings-page-title p { margin: 0; color: #a5adba; line-height: 1.45; font-size: 14px; max-width: 640px; }
.profile-editor-v3 .settings-card.compact-card,
.profile-editor-v3 .settings-card {
  width: 100%;
  padding: 18px;
  border-radius: 10px;
  background: #15161c;
  border: 1px solid rgba(255,255,255,.075);
  box-shadow: none;
  display: grid;
  gap: 14px;
}
.profile-editor-v3 .settings-card:hover { transform: none; border-color: rgba(255,255,255,.11); }
.profile-editor-v3 .section-label { margin: 0; font-size: 11px; letter-spacing: .08em; color: #8d96a6; }
.profile-editor-v3 label { color: #dbdee1; font-size: 13px; font-weight: 750; display: grid; gap: 8px; }
.profile-editor-v3 input,
.profile-editor-v3 textarea,
.profile-editor-v3 select {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: #0b0c10;
  color: #f2f3f5;
  box-shadow: none;
  font-size: 14px;
}
.profile-editor-v3 textarea { min-height: 92px; resize: vertical; }
.profile-editor-v3 button:not(.settings-close-button):not(.settings-nav-item) {
  min-height: 38px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
}
.profile-avatar-row.pro { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.profile-avatar-row.pro > div { min-width: 0; display: grid; gap: 4px; }
.profile-avatar-row.pro strong { color: #f2f3f5; }
.profile-avatar-row.pro small { color: #a5adba; }
.status-form-row.two-compact { grid-template-columns: 92px minmax(0, 1fr); }
.settings-row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.settings-row-between strong { display: block; margin-top: 4px; color: #f2f3f5; font-size: 15px; }
.settings-actions-row {
  position: sticky;
  bottom: -42px;
  margin-top: 6px;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: linear-gradient(180deg, rgba(11,12,16,0), #0b0c10 22%);
}
.settings-actions-row .form-error { margin-right: auto; }
.danger-zone-clean {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: rgba(69,26,38,.28) !important;
  border-color: rgba(248,113,113,.28) !important;
}
.danger-zone-clean strong { display: block; color: #fecaca; margin: 3px 0; }
.danger-zone-clean small { color: #fca5a5; }
.danger-zone-clean .danger-button { width: auto; min-width: 116px; padding: 0 16px; }
.registration-invite-list,
.admin-registration-invite-list { display: grid; gap: 8px; }
.registration-invite-row,
.admin-registration-invite-row {
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.registration-invite-copy,
.admin-registration-invite-copy { min-width: 0; display: grid; gap: 3px; }
.registration-invite-copy strong,
.admin-registration-invite-copy strong { color: #f2f3f5; }
.registration-invite-copy small,
.admin-registration-invite-copy small { color: #a5adba; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-actions-box .danger-button { max-width: 180px; }
.profile-editor-v3 #platformBadgeAdmin { display: none !important; }

.member-group-label { opacity: .95; }
.member-group-label em { margin-left: auto; color: var(--muted); font-style: normal; }
.member-item:not(.online) { opacity: .62; }
.member-item:not(.online) .status-dot { background: transparent; border-color: #6b7280; }

@media (max-width: 860px) {
  .settings-backdrop { padding: 0; }
  .modal-card.profile-editor-v3 {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    grid-template-columns: 1fr;
  }
  .settings-left-nav {
    min-height: 0;
    max-height: 146px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    overflow-x: auto;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
  }
  .settings-user-card { display: none; }
  .settings-nav-separator { display: none; }
  .settings-main-panel { padding: 58px 16px 24px; }
  .settings-pane { width: 100%; }
  .status-form-row.two-compact { grid-template-columns: 1fr; }
  .settings-row-between, .danger-zone-clean { grid-template-columns: 1fr; display: grid; align-items: start; }
}
