/* ============================================================
   VoxMeet — Discord shell (clean)
   Layout & tokens mirror Discord desktop
   ============================================================ */

:root {
  --guild-w: 72px;
  --sidebar-w: 240px;
  --members-w: 240px;
  --header-h: 48px;
  --user-h: 53px;

  --bg-tertiary: #1e1f22;
  --bg-secondary: #2b2d31;
  --bg-primary: #313338;
  --bg-mod: #232428;
  --bg-input: #1e1f22;
  --bg-floating: #111214;
  --bg-modifier-hover: rgba(79, 84, 92, 0.16);
  --bg-modifier-active: rgba(79, 84, 92, 0.24);
  --bg-modifier-selected: rgba(79, 84, 92, 0.32);
  --bg-accent: #4e5058;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);

  --text-normal: #f2f3f5;
  --text-muted: #b5bac1;
  --text-faint: #949ba4;
  --text-link: #00a8fc;
  --channels-default: #949ba4;
  --interactive-normal: #b5bac1;
  --interactive-hover: #dbdee1;
  --interactive-active: #fff;
  --interactive-muted: #4e5058;

  --brand: #5865f2;
  --brand-hover: #4752c4;
  --brand-soft: rgba(88, 101, 242, 0.15);
  --green: #23a559;
  --green-soft: rgba(35, 165, 89, 0.15);
  --red: #f23f43;
  --red-soft: rgba(242, 63, 67, 0.15);
  --yellow: #f0b232;
  --pink: #eb459e;
  --gold: #faa61a;

  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --font: "gg sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* aliases used by older JS/CSS class names */
  --bg-lowest: var(--bg-tertiary);
  --bg-low: var(--bg-secondary);
  --bg-mid: var(--bg-primary);
  --bg-high: #383a40;
  --bg-higher: #404249;
  --bg-float: var(--bg-floating);
  --text: var(--text-normal);
  --link: var(--text-link);
  --brand-glow: rgba(88, 101, 242, 0.4);
  --speak-ring: var(--green);
  --topbar-h: var(--header-h);
  --channels-w: var(--sidebar-w);
}

html[data-theme="green"] { --brand: #23a559; --brand-hover: #1a7f43; --brand-soft: rgba(35,165,89,.15); }
html[data-theme="pink"] { --brand: #eb459e; --brand-hover: #c73a85; --brand-soft: rgba(235,69,158,.15); }
html[data-theme="orange"] { --brand: #f26522; --brand-hover: #d4551a; --brand-soft: rgba(242,101,34,.15); }
html[data-theme="cyan"] { --brand: #00b4d8; --brand-hover: #0096b4; --brand-soft: rgba(0,180,216,.15); }
html[data-theme="gold"] { --brand: #faa61a; --brand-hover: #d48c12; --brand-soft: rgba(250,166,26,.15); }

/* Client DEP-style UI scale */
html {
  --font-scale: 1;
  --ui-radius: 8px;
  --msg-gap: 0px;
}
html body { font-size: calc(16px * var(--font-scale, 1)); }
.app, .modal, .dc-pop, .emoji-panel {
  --radius: var(--ui-radius, 8px);
  --radius-sm: max(3px, calc(var(--ui-radius, 8px) * 0.5));
  --radius-lg: calc(var(--ui-radius, 8px) * 1.5);
}

/* ═══ DEP-style client chat / layout mods ═══ */
body.ui-density-compact .chat-msg { padding-top: 2px; padding-bottom: 2px; }
body.ui-density-compact .chat-meta { margin-bottom: 0; }
body.ui-density-compact .member-item { min-height: 32px; padding: 2px 8px; }
body.ui-density-compact .channel-item { padding: 4px 8px; min-height: 28px; }
body.ui-density-cozy .chat-msg { padding-top: 10px; padding-bottom: 10px; }
body.ui-density-cozy .member-item { min-height: 48px; }

body.ui-chat-bubbles .chat-msg:not(.system) {
  margin: 4px 12px;
  padding: 8px 12px;
  border-radius: calc(var(--ui-radius, 8px) + 4px);
  background: rgba(43, 45, 49, 0.65);
  max-width: min(720px, 92%);
}
body.ui-chat-bubbles .chat-msg.self-msg,
body.ui-chat-bubbles .chat-msg[data-self="1"] {
  margin-left: auto;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
}
body.ui-chat-bubbles .chat-msg:hover { background: rgba(43, 45, 49, 0.85); }

body.ui-chat-compact .chat-msg .avatar { display: none; }
body.ui-chat-compact .chat-msg { padding-left: 16px; grid-template-columns: 1fr; }
body.ui-chat-compact .chat-body { margin: 0; }

body.ui-msg-sep .chat-msg {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

body.ui-glass .channels,
body.ui-glass .members,
body.ui-glass .topbar,
body.ui-glass .user-panel,
body.ui-glass .chat-form {
  background: rgba(30, 31, 34, 0.55) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  border-color: rgba(255, 255, 255, 0.06);
}
body.ui-glass .guild-rail { background: rgba(20, 21, 24, 0.7) !important; backdrop-filter: blur(12px); }
body.ui-glass .channels { background: rgba(30, 31, 34, 0.55) !important; backdrop-filter: blur(12px); }
body.ui-glass .chat-msg:hover { background: rgba(255, 255, 255, 0.04); }

body.ui-nitro-glow .brand-mark,
body.ui-nitro-glow .guild-btn.active,
body.ui-nitro-glow .btn-brand {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent),
    0 0 18px color-mix(in srgb, var(--brand) 35%, transparent);
}
body.ui-nitro-glow .tile.speaking .tile-ring,
body.ui-nitro-glow .voice-users li.speaking .avatar {
  box-shadow: 0 0 0 3px var(--speak-ring), 0 0 16px var(--speak-ring);
}

body.ui-hide-members .members { display: none !important; }
body.ui-hide-members .main { grid-column: span 2; }

/* Tab / nav styles for settings + subnavs */
body.ui-tabs-pills .us-nav-item.active,
body.ui-tabs-pills .ss-nav-item.active,
body.ui-tabs-pills .us-vsub.active {
  border-radius: 999px;
  background: var(--brand) !important;
  color: #fff !important;
}
body.ui-tabs-underline .us-nav-item.active,
body.ui-tabs-underline .ss-nav-item.active {
  background: transparent !important;
  box-shadow: inset 0 -2px 0 var(--brand);
  border-radius: 0;
}
body.ui-tabs-block .us-nav-item.active,
body.ui-tabs-block .ss-nav-item.active {
  border-radius: var(--ui-radius, 8px);
  background: var(--bg-modifier-selected) !important;
  box-shadow: inset 3px 0 0 var(--brand);
}

body.ui-sidebar-solid .channels,
body.ui-sidebar-solid .members {
  background: var(--bg-secondary) !important;
  backdrop-filter: none !important;
}

/* Server theme gallery */
.ss-theme-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}
.ss-theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #1e1f22;
  cursor: pointer;
  text-align: left;
  min-height: 88px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06);
  transition: transform .12s ease, border-color .12s ease;
}
.ss-theme-card:hover { transform: translateY(-1px); filter: brightness(1.06); }
.ss-theme-card.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--brand);
}
.ss-theme-card-swatch {
  height: 48px;
  background: linear-gradient(135deg, var(--t1, #313338), var(--t2, #5865f2));
}
.ss-theme-card-meta {
  padding: 6px 8px 8px;
  min-width: 0;
}
.ss-theme-card-name {
  font-size: 12px;
  font-weight: 700;
  color: #f2f3f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-theme-card-group {
  font-size: 10px;
  color: #949ba4;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ss-wall-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.ss-wall-preset {
  height: 56px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
  background-size: cover;
  background-position: center;
}
.ss-wall-preset.active { border-color: #fff; box-shadow: 0 0 0 2px var(--brand); }
.ss-wall-preset span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 2px 4px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  text-shadow: 0 1px 2px #000;
}
.ss-section-label {
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #b5bac1;
}
.ss-section-label:first-child { margin-top: 0; }
.ss-app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 700px) {
  .ss-app-grid { grid-template-columns: 1fr; }
}
.us-theme-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.us-theme-mini-btn {
  height: 44px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  background: linear-gradient(135deg, var(--t1), var(--t2));
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
  position: relative;
}
.us-theme-mini-btn.active { border-color: #fff; box-shadow: 0 0 0 2px var(--brand); }
.us-theme-mini-btn span {
  position: absolute;
  inset: auto 0 0 0;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 2px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sw, #5865f2);
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15);
  cursor: pointer;
}
.theme-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--brand); }

/* Full-app wallpaper (Theams ports + server wall) — layer behind all columns */
.app.has-wallpaper {
  background: transparent !important;
  isolation: isolate;
}
.app.has-wallpaper::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 100% !important;
  min-height: 100% !important;
  z-index: 0 !important;
  pointer-events: none !important;
  background-color: #0a0a0c;
  /* dim overlay → photo (if any) → gradient fallback (always visible) */
  background-image:
    linear-gradient(
      180deg,
      rgba(10, 12, 16, calc(var(--wall-dim, 0.4) * 0.85)) 0%,
      rgba(20, 24, 32, calc(var(--wall-dim, 0.4) * 0.75)) 50%,
      rgba(10, 12, 16, calc(var(--wall-dim, 0.4) * 0.95)) 100%
    ),
    var(--server-wallpaper, none),
    var(--server-wallpaper-gradient, linear-gradient(135deg, #1a1b2e, #2b2d4a));
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  filter: blur(var(--wall-blur, 0px));
  transform: scale(1.03);
  transform-origin: center;
}
.app.has-wallpaper > * {
  position: relative;
  z-index: 1;
}
.app.has-wallpaper .main {
  background: transparent !important;
  background-image: none !important;
  position: relative;
}
.app.has-wallpaper .main::before {
  display: none;
}
.app.has-wallpaper .guild-rail,
.app.has-wallpaper .channels,
.app.has-wallpaper .members {
  background: color-mix(in srgb, var(--bg-secondary) 72%, transparent) !important;
  backdrop-filter: blur(10px) saturate(1.1);
}
.app.has-wallpaper .user-panel {
  background: color-mix(in srgb, var(--bg-tertiary) 75%, transparent) !important;
  backdrop-filter: blur(8px);
}
.app.has-wallpaper .topbar {
  background: color-mix(in srgb, var(--bg-primary) 70%, transparent) !important;
  backdrop-filter: blur(10px);
}
/* Glass UI: keep theme tokens (was hard-coded Discord gray → themes “disappeared”) */
.app.server-glass .guild-rail,
.app.server-glass .channels,
.app.server-glass .members,
.app.server-glass .topbar,
.app.server-glass .user-panel {
  background: color-mix(in srgb, var(--bg-secondary) 48%, transparent) !important;
  backdrop-filter: blur(14px) saturate(1.12);
}
.app.server-glass.server-glass .guild-rail,
.app.has-wallpaper.server-glass .guild-rail {
  background: color-mix(in srgb, var(--bg-tertiary) 50%, transparent) !important;
}
.app.server-glass .user-panel {
  background: color-mix(in srgb, var(--bg-tertiary) 52%, transparent) !important;
}
.app.server-glass .topbar {
  background: color-mix(in srgb, var(--bg-primary) 50%, transparent) !important;
}
.app.server-chat-bubbles .chat-msg:not(.system) {
  margin: 4px 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(43, 45, 49, 0.7);
}
.app.server-chat-compact .chat-msg .avatar { width: 28px; height: 28px; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg-tertiary);
  color: var(--text-normal);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.375;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
input, textarea, select { outline: none; }
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
* { scrollbar-width: thin; scrollbar-color: #1a1b1e transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: #1a1b1e;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 2px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s, opacity .15s, box-shadow .15s, transform .12s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover:not(:disabled) { background: var(--brand-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-normal);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg-modifier-hover); text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--text-normal);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: var(--bg-modifier-hover); border-color: rgba(255,255,255,.16); }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; font-weight: 600; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-glow { box-shadow: 0 8px 22px rgba(88, 101, 242, .38); }
.btn-brand.btn-glow:hover:not(:disabled) { box-shadow: 0 10px 26px rgba(88, 101, 242, .48); }
.btn-ico { opacity: .9; }
.btn-mini {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-primary);
  color: var(--text-muted);
}
.btn-mini:hover { color: var(--text-normal); background: var(--bg-accent); }
.btn-mini.primary { background: var(--brand); color: #fff; }
.btn-danger-sm {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.btn-danger-sm:hover { color: var(--red); background: var(--red-soft); }
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--interactive-normal);
  font-size: 16px;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--interactive-hover); background: var(--bg-modifier-hover); }
.icon-btn.light { color: #fff; }
.mobile-only { display: none !important; }

/* ── Fields ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field > span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text-muted);
}
.field .opt { font-weight: 400; text-transform: none; color: var(--text-faint); }
.field input, .field select, .field textarea,
input[type="text"], input[type="search"], input[type="number"], input[type="color"],
textarea, select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-input);
  color: var(--text-normal);
}
textarea { height: auto; min-height: 72px; padding: 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
input:focus, textarea:focus, select:focus {
  outline: 1px solid var(--brand);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  min-width: 0;
}
.check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ═══ Discord-style toggle switch (рубильник) ═══ */
.vox-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  cursor: pointer;
  vertical-align: middle;
}
.vox-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.vox-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: #80848e;
  transition: background .15s ease;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.vox-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.28);
  transition: transform .15s cubic-bezier(.3,.7,.4,1);
  pointer-events: none;
}
.vox-switch input:checked + .vox-switch-track {
  background: #23a559;
}
.vox-switch input:checked + .vox-switch-track .vox-switch-knob {
  transform: translateX(16px);
}
.vox-switch input:focus-visible + .vox-switch-track {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.vox-switch:hover .vox-switch-track { filter: brightness(1.06); }

.us-toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.us-toggle-row.compact {
  padding: 10px 12px;
  margin: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: #2b2d31;
  border-radius: 0;
}
.us-toggle-row.compact:first-child { border-radius: 8px 8px 0 0; }
.us-toggle-row.compact:last-child { border-bottom: none; border-radius: 0 0 8px 8px; }
.us-toggle-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.us-toggle-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: #dbdee1;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.us-toggle-desc {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: #949ba4;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.role-checks {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
}
.us-kbd-only { padding-top: 4px !important; min-height: 0 !important; }
.banner {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.banner.info { background: var(--brand-soft); color: var(--text-normal); }
.banner.err { background: var(--red-soft); color: #fa777c; }

/* ============================================================
   LANDING — Discord-dark product page
   ============================================================ */
.landing {
  position: relative;
  min-height: 100%;
  overflow: auto;
  padding: 0 24px 36px;
  background:
    radial-gradient(1100px 560px at 8% -12%, rgba(88, 101, 242, .30), transparent 58%),
    radial-gradient(820px 480px at 96% 0%, rgba(0, 180, 216, .14), transparent 52%),
    radial-gradient(700px 400px at 70% 110%, rgba(235, 69, 158, .08), transparent 55%),
    #111214;
}
.landing-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .45;
}
.orb-a { width: 420px; height: 420px; left: -80px; top: -120px; background: #5865f2; }
.orb-b { width: 320px; height: 320px; right: -60px; top: 40px; background: #00b4d8; }
.orb-c { width: 280px; height: 280px; left: 40%; bottom: -80px; background: #eb459e; }
.landing-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 75%);
  opacity: .55;
}
.landing-nav {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
  animation: brand-pulse 3.2s ease-in-out infinite;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 40%, transparent);
}
.brand-mark-logo {
  background: transparent;
  padding: 0;
}
.brand-mark-logo img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}
.brand-mark.sm { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
@keyframes brand-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 0%, transparent); transform: scale(1); }
  50% { box-shadow: 0 0 18px 2px color-mix(in srgb, var(--brand) 45%, transparent); transform: scale(1.04); }
}
.guild-btn {
  transition: border-radius .18s ease, background .15s, transform .15s cubic-bezier(.2,.8,.2,1), box-shadow .15s;
}
.guild-btn:hover { transform: scale(1.06); }
.guild-btn.active { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 50%, transparent); }
.channel {
  transition: background .12s ease, color .12s, transform .1s ease, padding-left .12s;
}
.channel:hover { transform: translateX(2px); }
.channel.private-ch .channel-name { opacity: .92; }
.channel.private-ch .ch-icon,
.channel.private-ch .ch-hash { filter: drop-shadow(0 0 4px rgba(240,178,50,.5)); }
.home-icon {
  display: grid;
  place-items: center;
}
.home-icon svg { display: none; }
.home-btn .home-icon {
  background: url("/assets/icon.svg") center / 70% no-repeat;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.up-btn, .vf-btn, .ch-tool-btn {
  transition: background .12s, color .12s, transform .1s;
}
.up-btn:active, .vf-btn:active, .ch-tool-btn:active {
  transform: scale(0.92);
}
.landing-nav-actions { display: flex; gap: 8px; }
.landing-main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 0 72px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 40px 48px;
  align-items: center;
  text-align: left;
  margin: 28px 0 56px;
}
.hero-copy { min-width: 0; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(88, 101, 242, .16);
  color: #c9cdfb;
  border: 1px solid rgba(88, 101, 242, .28);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 16px;
}
.hero-title { margin: 0; font-size: clamp(40px, 6vw, 64px); font-weight: 800; letter-spacing: -.045em; line-height: 1.02; }
.hero-brand {
  background: linear-gradient(120deg, #fff 10%, #c9cdfb 48%, #57f287 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tagline {
  margin: 14px 0 0;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -.02em;
}
.hero-lead {
  margin: 14px 0 0;
  max-width: 480px;
  color: var(--text-faint);
  font-size: 15px;
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 24px;
}
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}
.hero-points li {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 5px 10px;
}
.hero-stage { min-width: 0; }
.preview {
  display: grid;
  grid-template-columns: 52px 148px minmax(0, 1fr);
  height: 300px;
  border-radius: 16px;
  overflow: hidden;
  background: #1e1f22;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow:
    0 24px 60px rgba(0,0,0,.45),
    0 0 0 1px rgba(88,101,242,.12);
}
.preview-rail {
  background: #111214;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
}
.pv-g {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #313338;
}
.pv-g.home { background: #5865f2; border-radius: 12px; }
.pv-g.add { background: #1e1f22; box-shadow: inset 0 0 0 1px #23a559; }
.preview-side {
  background: #2b2d31;
  padding: 12px 10px;
  font-size: 12px;
  color: #949ba4;
}
.pv-server { color: #fff; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.pv-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 10px 0 4px;
  color: #6d7278;
}
.pv-ch { padding: 4px 6px; border-radius: 4px; }
.pv-ch.on { background: rgba(79,84,92,.4); color: #fff; }
.pv-user {
  margin-top: 18px;
  padding: 8px 6px;
  background: #232428;
  border-radius: 6px;
  color: #dbdee1;
  font-size: 11px;
}
.preview-main {
  background: #313338;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.pv-top {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.pv-msg {
  padding: 10px 14px 0;
  font-size: 13px;
  color: #dbdee1;
  line-height: 1.4;
}
.pv-msg b { color: #fff; margin-right: 6px; }
.pv-input {
  margin: auto 12px 12px;
  height: 36px;
  border-radius: 8px;
  background: #383a40;
  color: #949ba4;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
}
.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 48px;
}
.feature-card {
  padding: 18px 16px 20px;
  border-radius: 14px;
  background: rgba(43, 45, 49, .72);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.feature-ico { font-size: 22px; line-height: 1; margin-bottom: 10px; }
.feature-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.feature-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}
.how { margin: 8px 0 8px; }
.section-title {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.how-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 14px;
  background: rgba(30, 31, 34, .65);
  border: 1px solid var(--border-subtle);
}
.how-steps span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.how-steps strong { display: block; font-size: 15px; margin-bottom: 4px; }
.how-steps p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.landing-footer {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 28px auto 0;
  padding: 18px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 13px;
  border-top: 1px solid var(--border-subtle);
}
.lf-dot { opacity: .5; }
.glass { background: var(--bg-secondary); border: 1px solid rgba(255,255,255,.06); }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-points { justify-content: center; }
  .features { grid-template-columns: 1fr 1fr; }
  .how-steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero-stage { display: none; }
  .features { grid-template-columns: 1fr; }
}

/* ============================================================
   AUTH — Discord login card
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(88,101,242,.28), transparent 50%),
    radial-gradient(700px 420px at 90% 80%, rgba(0,180,216,.10), transparent 48%),
    #0c0d0f;
}
.auth-backdrop { position: absolute; inset: 0; }
.auth-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: min(820px, 100%);
  max-height: min(92vh, 720px);
  animation: pop .18s var(--ease);
}
.auth-card {
  position: relative;
  flex: 1 1 420px;
  min-width: 0;
  max-width: 480px;
  padding: 32px;
  border-radius: 16px;
  background: var(--bg-primary);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 16px;
}
.auth-close:hover { color: var(--text-normal); background: var(--bg-modifier-hover); }
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.auth-brand h2 { margin: 0; font-size: 24px; font-weight: 700; }
.auth-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.auth-actions { display: flex; flex-direction: column; gap: 12px; }
.auth-actions .btn-brand { width: 100%; height: 44px; }
/* join mode: hide server title; create: emphasize create */
body.auth-mode-join #roomTitleField { display: none; }
body.auth-mode-create #createBtn { display: inline-flex; }
body.auth-mode-join .join-row { order: -1; }
.or-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 12px;
}
.or-row::before, .or-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.08);
}
.join-row { display: flex; gap: 8px; }
.join-row input {
  flex: 1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
}
.btn-join {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.btn-join:hover { background: var(--brand-hover); }

/* Recent servers — right panel */
.recent-panel {
  flex: 0 0 280px;
  width: 280px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 20px 16px 16px;
  border-radius: 16px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}
.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.recent-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text-muted);
}
.recent-clear-all {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 2px 6px;
  border-radius: 3px;
}
.recent-clear-all:hover {
  color: var(--red);
  background: var(--red-soft);
}
.recent-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.recent-servers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.recent-empty {
  font-size: 13px;
  color: var(--text-faint);
  padding: 24px 8px;
  text-align: center;
  line-height: 1.4;
}
.recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 6px 8px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid transparent;
}
.recent-item:hover {
  background: var(--bg-modifier-hover);
  color: var(--text-normal);
  border-color: rgba(255, 255, 255, 0.04);
}
.recent-item .ri-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  text-align: left;
  font: inherit;
}
.recent-item .ri-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  line-height: 1;
}
.recent-item .ri-icon.has-img { background: var(--bg-tertiary); padding: 0; }
.recent-item .ri-icon .av-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-item .ri-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  flex: 1;
}
.recent-item .ri-meta strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-normal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-item .ri-meta em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: .04em;
  font-family: ui-monospace, Consolas, monospace;
}
.recent-item .ri-del {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 14px;
  opacity: 0.7;
}
.recent-item:hover .ri-del { opacity: 1; }
.recent-item .ri-del:hover {
  background: var(--red-soft);
  color: var(--red);
}

@media (max-width: 720px) {
  .auth-shell {
    flex-direction: column;
    max-height: 92vh;
    overflow-y: auto;
  }
  .auth-card {
    max-width: none;
    flex: none;
  }
  .recent-panel {
    width: 100%;
    flex: none;
    max-height: 240px;
  }
}

/* ============================================================
   APP SHELL — Discord 4-column
   ============================================================ */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--guild-w) var(--sidebar-w) minmax(0, 1fr) var(--members-w);
  grid-template-rows: 100%;
  background: var(--bg-tertiary);
  overflow: hidden;
  position: relative;
}
/* HUD stripe lives on ::after — never share ::before with wallpaper (height:2px leaked) */
.app::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, #5865f2, #00b4d8 45%, #23a559);
  z-index: 8;
  pointer-events: none;
}

/* Guild rail */
.guild-rail {
  width: var(--guild-w);
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 4;
}
.guild-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.guild-sep {
  width: 32px;
  height: 2px;
  border-radius: 1px;
  background: var(--bg-accent);
  margin: 4px 0;
  flex-shrink: 0;
}
.guild-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-primary);
  color: var(--text-normal);
  display: grid;
  place-items: center;
  transition: border-radius .15s ease, background .15s;
  flex-shrink: 0;
}
.guild-btn:hover, .guild-btn.active {
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
}
.guild-btn.active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent);
}
.guild-btn.home-btn { color: #fff; background: var(--bg-primary); }
.guild-btn.home-btn:hover, .guild-btn.home-btn.active { background: var(--brand); }
.guild-btn.add-guild-btn { color: var(--green); background: var(--bg-primary); font-size: 24px; font-weight: 300; }
.guild-btn.add-guild-btn:hover { background: var(--green); color: #fff; border-radius: 16px; }
.guild-pill {
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: #fff;
  transform: translateY(-50%);
  transition: height .15s;
}
.guild-btn:hover .guild-pill { height: 20px; }
.guild-btn.active .guild-pill { height: 40px; }
.guild-icon {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  border-radius: inherit;
}
.guild-btn .unread-badge,
.guild-btn .unread-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 3px solid var(--bg-tertiary);
}

/* Sidebar channels */
.channels {
  width: var(--sidebar-w);
  min-width: 180px;
  max-width: 420px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 3;
  position: relative;
}
.ch-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px 6px;
  flex-shrink: 0;
}
.ch-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  padding: 0 8px;
  height: 32px;
}
.ch-search-ico { color: var(--text-faint); font-size: 14px; flex-shrink: 0; }
.ch-search {
  flex: 1;
  min-width: 0;
  height: 30px !important;
  border: none !important;
  background: transparent !important;
  color: var(--text-normal);
  font-size: 13px;
  padding: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}
.ch-search::placeholder { color: var(--text-faint); }
.ch-toolbar-actions {
  display: flex;
  gap: 4px;
}
.ch-tool-btn {
  flex: 1;
  height: 28px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
  transition: background .12s, color .12s;
}
.ch-tool-btn:hover {
  background: var(--bg-modifier-hover);
  color: var(--text-normal);
}
.channel-picker {
  margin: 0 8px 8px;
  max-height: 180px;
  overflow-y: auto;
  border-radius: 6px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255,255,255,.04);
  animation: vox-slide-up .18s var(--ease) both;
}
.channel-picker-head {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-faint);
  letter-spacing: .02em;
}
.channel-picker-list {
  display: flex;
  flex-direction: column;
  padding: 4px;
  gap: 2px;
}
.channel-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: left;
  width: 100%;
}
.channel-picker-item:hover {
  background: var(--bg-modifier-hover);
  color: var(--text-normal);
}
.channel-picker-item .cpi-kind {
  font-size: 12px;
  opacity: .7;
  width: 18px;
  text-align: center;
}
.channel-picker-item .cpi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-tree .channel.ch-hidden { display: none !important; }
.channel-tree .cat-block.ch-hidden { display: none !important; }
.channel-tree .voice-users.ch-hidden { display: none !important; }
.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 12;
  background: transparent;
}
.sidebar-resizer:hover,
body.resizing-sidebar .sidebar-resizer {
  background: var(--brand);
  opacity: 0.55;
}
body.resizing-sidebar {
  cursor: col-resize !important;
  user-select: none !important;
}
body.resizing-sidebar * {
  cursor: col-resize !important;
}
.server-header {
  position: relative;
  height: var(--header-h);
  min-height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 1.5px 0 rgba(0,0,0,.04);
  z-index: 2;
  cursor: pointer;
  transition: background .1s;
}
.server-header:hover { background: var(--bg-modifier-hover); }
.server-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.server-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.server-icon.has-img { background: var(--bg-tertiary); }
.server-icon .av-img,
.server-icon .guild-gif-static,
.server-icon .guild-gif-live {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  border-radius: inherit;
  display: block;
}
.server-icon .av-fb { display: none; }
.server-icon.is-gif .guild-gif-static { opacity: 1; z-index: 1; }
.server-icon.is-gif .guild-gif-live { opacity: 0; z-index: 2; }
.server-icon.is-gif:hover .guild-gif-static { opacity: 0; }
.server-icon.is-gif:hover .guild-gif-live { opacity: 1; }
.server-header-meta { flex: 1; min-width: 0; }
.server-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.server-title {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.boost-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--pink);
  font-weight: 600;
  flex-shrink: 0;
}
.boost-tier-badge {
  font-size: 9px;
  font-weight: 800;
  background: linear-gradient(135deg, #f47fff, #5865f2);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 2px;
}
.server-code {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.server-menu-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.server-menu-btn:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }

.server-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 8px;
  right: 8px;
  background: var(--bg-floating);
  border-radius: var(--radius);
  padding: 6px 8px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  animation: pop .12s var(--ease);
}
.server-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  text-align: left;
}
.server-menu-item:hover { background: var(--brand); color: #fff; }
.server-menu-item.danger { color: #da373c; }
.server-menu-item.danger:hover { background: var(--red); color: #fff; }
.server-menu-item.boost { color: var(--pink); }
.server-menu-item.boost:hover { background: var(--pink); color: #fff; }
.server-menu-sep {
  height: 1px;
  margin: 4px 4px;
  background: rgba(255,255,255,.06);
}
.smi-icon { opacity: .75; font-size: 14px; }

.channel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 8px;
}
.channel-tree { display: flex; flex-direction: column; }
.cat-block { margin-top: 16px; }
.cat-block:first-child { margin-top: 8px; }
.cat-head {
  display: flex;
  align-items: center;
  padding: 0 8px 0 2px;
  color: var(--channels-default);
}
.cat-head-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  padding: 4px 0 4px 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: inherit;
  text-align: left;
  border-radius: var(--radius-sm);
}
.cat-head-btn:hover { color: var(--interactive-hover); }
.cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-chevron {
  width: 12px;
  font-size: 9px;
  display: inline-block;
  text-align: center;
  transition: transform .15s;
  flex-shrink: 0;
}
.cat-head.collapsed .cat-chevron { transform: rotate(-90deg); }
.cat-head .ch-add {
  width: 18px;
  height: 18px;
  opacity: 0;
  color: var(--channels-default);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.cat-block:hover .ch-add { opacity: 1; }
.cat-head .ch-add:hover { color: var(--interactive-hover); background: var(--bg-modifier-hover); }
.cat-channels { display: flex; flex-direction: column; padding: 0 8px 0 8px; }
.cat-empty {
  padding: 2px 8px 6px 16px;
  font-size: 12px;
  color: var(--text-faint);
  opacity: .6;
}
.home-side-hint {
  padding: 16px 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-faint);
}
.legacy-hidden, .channel-group.legacy-hidden { display: none !important; }

.channel {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--channels-default);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  position: relative;
  margin-bottom: 1px;
}
.channel:hover {
  background: var(--bg-modifier-hover);
  color: var(--interactive-hover);
}
.channel.active {
  background: var(--bg-modifier-active);
  color: var(--interactive-active);
}
.channel.unread { color: var(--text-normal); font-weight: 600; }
.channel.muted-ch .channel-name { opacity: .7; }
.ch-hash, .ch-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: .8;
  font-size: 18px;
  font-weight: 600;
}
.channel.active .ch-hash, .channel.active .ch-icon { opacity: 1; color: var(--interactive-active); }
.channel-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unread-dot {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--bg-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.channel.unread .unread-dot { background: #fff; color: #1e1f22; }
.ch-voice-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}
.channel.voice-ch {
  display: flex;
  align-items: center;
  gap: 6px;
}
.channel.voice-ch .channel-name { flex: 1; min-width: 0; }
.channel.voice-ch.full .ch-voice-count { color: var(--red); }
.unread-dot.voice-count {
  background: transparent !important;
  color: var(--text-faint) !important;
  font-weight: 500;
  min-width: auto;
}
.ch-nsfw-tag {
  font-size: 9px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: .02em;
}

.voice-users {
  list-style: none;
  margin: 0 0 2px 8px;
  padding: 0 0 0 24px;
}
.voice-users li {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.voice-users li:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.voice-users .vu-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.3);
}
.voice-users .vu-flags { font-size: 11px; opacity: .85; flex-shrink: 0; }
.avatar.xs {
  width: 20px; height: 20px; font-size: 9px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0; font-weight: 700;
  position: relative;
  overflow: hidden;
}
.avatar.xs .av-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.avatar.xs.has-img .av-fb { display: none; }

/* Invite strip — compact, Discord-like subtle */
.invite-box {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-top: 1px solid rgba(0,0,0,.2);
  background: var(--bg-secondary);
}
.invite-box .btn-mini { flex: 1; }

/* Unified voice status card — sidebar above user panel */
@keyframes voice-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.voice-conn.voice-conn-panel {
  display: block;
  padding: 6px 8px 0;
  background: transparent;
  border: none;
  animation: voice-slide-in .22s var(--ease) both;
  flex-shrink: 0;
}
.voice-status-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px;
  background: #14161a;
  border: 1px solid rgba(35, 165, 89, 0.55);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0 0 1px rgba(35,165,89,.12), 0 8px 18px rgba(0, 0, 0, 0.4);
  transition: border-color .15s, background .15s;
}
.voice-status-card:hover {
  background: #202225;
  border-color: rgba(35, 165, 89, 0.65);
}
.voice-float-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  flex-shrink: 0;
  animation: vox-pulse-soft 1.6s ease-in-out infinite;
}
.voice-float-meta { flex: 1; min-width: 0; }
.voice-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.voice-float-state {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  line-height: 1.2;
}
.ping-ms {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #23a559;
  flex-shrink: 0;
}
.ping-ms.good { color: #23a559; }
.ping-ms.mid { color: #f0b232; }
.ping-ms.bad { color: #f23f43; }
.voice-float-channel {
  font-size: 14px;
  font-weight: 600;
  color: #f2f3f5;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-float-server {
  font-size: 11px;
  color: #949ba4;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-leave-ico {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #b5bac1;
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1;
}
.voice-leave-ico:hover {
  background: rgba(242, 63, 67, 0.2);
  color: #f23f43;
}

/* Changelog */
.us-build-tag {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #5865f2, #9b59b6);
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-align: left;
  transition: filter .12s, transform .12s;
}
.us-build-tag:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.changelog-modal { z-index: 450 !important; }
.changelog-card {
  width: min(480px, 100%) !important;
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
}
.changelog-card .settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.changelog-card .settings-head h3 {
  margin: 0;
  font-size: 18px;
}
.changelog-scroll {
  overflow-y: auto;
  padding: 12px 16px 20px;
  min-height: 0;
  flex: 1;
}
.changelog-entry {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.changelog-entry:last-child { border-bottom: none; }
.changelog-v {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
  background: var(--brand);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.changelog-entry h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #f2f3f5;
}
.changelog-entry ul {
  margin: 0;
  padding-left: 18px;
  color: #b5bac1;
  font-size: 13px;
  line-height: 1.45;
}
.changelog-entry li { margin-bottom: 4px; }

/* User panel — Discord exact height */
.user-panel {
  height: var(--user-h);
  min-height: var(--user-h);
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1a1b1e;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(88,101,242,.22);
}
.user-panel-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.user-panel-left:hover { background: var(--bg-modifier-hover); }
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  flex-shrink: 0;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.avatar.sm { width: 32px; height: 32px; }
.avatar.lg { width: 80px; height: 80px; font-size: 28px; border: 6px solid var(--bg-floating); }
.avatar .av-fb {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.avatar.has-img .av-fb { display: none; }
.avatar .av-img,
.guild-icon .av-img,
.ss-icon .av-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block !important;
  /* NO transform/translateZ — freezes GIF decode in Chromium */
  image-rendering: auto;
  visibility: visible !important;
}
/* Full opacity for normal photos / always-on GIF (profile card, settings).
   MUST NOT force .av-gif-live in hover/speak dual-layer mode — that broke freeze. */
.avatar .av-img:not(.av-gif-live),
.guild-icon .av-img:not(.av-gif-live),
.ss-icon .av-img:not(.av-gif-live) {
  opacity: 1 !important;
}
.avatar.is-gif-av:not(.is-speak-gif):not(.is-hover-gif) .av-img,
.avatar.is-gif-av:not(.is-speak-gif):not(.is-hover-gif) img.vox-gif-live {
  opacity: 1 !important;
  visibility: visible !important;
  animation-play-state: running !important;
  contain: none !important;
}
.avatar.has-img { background: var(--bg-tertiary) !important; }
.guild-icon.has-img {
  position: relative;
  overflow: hidden;
  padding: 0;
}
.guild-icon.has-img .av-img {
  border-radius: inherit;
}
.status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid #232428;
  background: var(--green);
}
.status-dot.online, .member-status.online { background: var(--green); }
.status-dot.idle, .member-status.idle { background: var(--yellow); }
.status-dot.dnd, .member-status.dnd { background: var(--red); }
.status-dot.invisible, .member-status.invisible { background: var(--text-faint); }
.user-panel-meta { min-width: 0; flex: 1; }
.user-panel-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.user-panel-status {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.user-panel-custom {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-panel-actions { display: flex; align-items: center; flex-shrink: 0; }
.up-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--interactive-normal);
}
.up-btn:hover { background: var(--bg-modifier-hover); color: var(--interactive-hover); }
.up-btn.off, .up-btn.muted, .up-btn.danger { color: var(--red); }
.ptt-hint {
  position: absolute;
  top: -22px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-floating);
  color: var(--text-faint);
}
.ptt-hint.live { color: #fff; background: var(--green); }

/* Main */
.main {
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  z-index: 1;
}
.tab-bar {
  height: 36px;
  min-height: 36px;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(0,0,0,.15);
  overflow: hidden;
}
.tabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  gap: 2px;
  padding: 4px 8px 0;
}
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 6px 6px 0 0;
  font-size: 13px;
  color: var(--text-faint);
  max-width: 160px;
  white-space: nowrap;
}
.tab:hover { background: rgba(255,255,255,.04); color: var(--text-muted); }
.tab.active { background: var(--bg-primary); color: var(--text-normal); }
.tab.unread .tab-label { font-weight: 700; color: var(--text-normal); }
.tab-label { overflow: hidden; text-overflow: ellipsis; }
.tab-close { opacity: .5; font-size: 14px; padding: 0 2px; }
.tab-close:hover { opacity: 1; color: var(--red); }

.topbar {
  height: var(--header-h);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 16px;
  box-shadow: 0 1px 0 rgba(88,101,242,.28), 0 1.5px 0 rgba(0,0,0,.04);
  z-index: 2;
  gap: 8px;
  background: linear-gradient(180deg, #35373d 0%, var(--bg-primary) 70%);
}
.hud-new-btn {
  position: relative;
  width: auto !important;
  min-width: 64px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff !important;
  background: var(--brand) !important;
  border-radius: 999px;
}
.hud-new-btn:hover { filter: brightness(1.08); }
.hud-new-dot {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #23a559;
  box-shadow: 0 0 0 0 rgba(35,165,89,.7);
  animation: hud-new-pulse 1.4s ease-out infinite;
}
body.seen-hud .hud-new-dot { display: none; }
@keyframes hud-new-pulse {
  0% { box-shadow: 0 0 0 0 rgba(35,165,89,.55); }
  100% { box-shadow: 0 0 0 8px rgba(35,165,89,0); }
}
.whats-new-card { width: min(520px, 94vw) !important; }
.whats-new-body { padding: 8px 20px 20px; }
.whats-new-lead { margin: 0 0 14px; color: var(--text-muted); font-size: 14px; line-height: 1.45; }
.whats-new-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.whats-new-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
}
.whats-new-list span { font-size: 18px; line-height: 1.2; }
.whats-new-list b { display: block; margin-bottom: 2px; }
.whats-new-list div { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.whats-new-list div b { color: var(--text-normal); }
.whats-new-card .btn-brand { width: 100%; height: 42px; }
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-right { flex-shrink: 0; }
.topbar-icon {
  font-size: 22px;
  color: var(--text-faint);
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1;
}
.topbar-titles { display: flex; flex-direction: column; min-width: 0; }
#topbarTitle, .topbar-titles h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-topic {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.topbar-sep {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,.08);
  flex-shrink: 0;
  margin: 0 4px;
}
.topbar-sub {
  font-size: 14px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
}
.pill.bad, .pill.warn { background: var(--red-soft); color: var(--red); }
.ping-ms { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.ping-ms.ok { color: var(--green); }
.ping-ms.mid { color: var(--yellow); }
.ping-ms.bad { color: var(--red); }

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(0,0,0,.15);
}
.search-bar input {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: none;
  padding: 0 10px;
}
.search-count { font-size: 12px; color: var(--text-faint); }

/* Views */
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.view-text { background: var(--bg-primary); }

.pins-banner {
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.pins-banner-btn {
  width: 100%;
  text-align: left;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.pins-banner-btn:hover { color: var(--text-normal); }

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0 8px;
}
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 100%;
  padding: 16px 16px 24px;
  max-width: 560px;
}
.chat-empty-ico {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-accent);
  display: grid;
  place-items: center;
  font-size: 32px;
  color: #fff;
  margin-bottom: 8px;
}
.chat-empty h3 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.chat-empty p { margin: 0; color: var(--text-muted); font-size: 16px; line-height: 1.375; }
.chat-empty-ico {
  box-shadow: 0 0 0 8px rgba(79, 84, 92, 0.18);
}
.chat-msg.grouped {
  margin-top: 0;
  min-height: 0;
  padding-top: 1px;
  padding-bottom: 1px;
}
.chat-msg.grouped .avatar {
  visibility: hidden;
  height: 0;
  margin: 0;
}
.chat-msg.grouped .chat-meta { display: none; }
.chat-msg.grouped:hover .time-hover { display: inline; }

.link-card {
  display: flex;
  flex-direction: column;
  max-width: min(420px, 92%);
  margin: 6px 0 4px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  text-decoration: none !important;
  color: inherit;
}
.link-card:hover { border-color: rgba(255,255,255,.12); filter: brightness(1.04); }
.link-card-media {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  background: #111;
}
.link-card-meta { padding: 8px 10px 10px; }
.link-card-host {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
}
.link-card-url {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-link);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 16px 6px;
  font-size: 12px;
  color: var(--text-faint);
}
.composer-meta[hidden] { display: none !important; }
#charHint.warn { color: var(--yellow); font-weight: 700; }

.sig-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  margin: 0 4px 1px;
  padding: 2px 5px 2px 4px;
  border-radius: 4px;
  background: rgba(0,0,0,.35);
}
.sig-bars i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: rgba(255,255,255,.18);
}
.sig-bars i:nth-child(1) { height: 4px; }
.sig-bars i:nth-child(2) { height: 6px; }
.sig-bars i:nth-child(3) { height: 9px; }
.sig-bars i:nth-child(4) { height: 12px; }
.sig-bars.n1 i:nth-child(-n+1),
.sig-bars.n2 i:nth-child(-n+2),
.sig-bars.n3 i:nth-child(-n+3),
.sig-bars.n4 i:nth-child(-n+4) { background: currentColor; }
.sig-bars.ok { color: var(--green); }
.sig-bars.mid { color: var(--yellow); }
.sig-bars.bad { color: var(--red); }

.invite-card {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(440px, 94%);
  margin: 8px 0 4px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.invite-card-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.invite-card-body { min-width: 0; flex: 1; }
.invite-card-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
}
.invite-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invite-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.invite-card-join { flex-shrink: 0; }
.invite-card-hidden {
  font-size: 13px;
  color: var(--text-faint);
  padding: 4px 2px;
}

.streamer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  background: linear-gradient(90deg, #9146ff, #5865f2);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.streamer-bar[hidden] { display: none !important; }
.streamer-bar-off {
  background: rgba(0,0,0,.25);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 4px 10px;
  font-weight: 600;
  cursor: pointer;
}
.streamer-bar-off:hover { background: rgba(0,0,0,.38); }
body.streamer-hide-inv .server-code,
body.streamer-hide-inv .invite-code,
body.streamer-hide-inv #inviteLinkInput,
body.streamer-hide-inv #inviteCodeInput,
body.streamer-hide-inv #inviteQr,
body.streamer-hide-inv .invite-card-sub {
  filter: blur(7px);
  user-select: none;
  pointer-events: none;
}
body.streamer-hide-pii #youName,
body.streamer-hide-pii .user-panel-custom {
  filter: blur(6px);
  user-select: none;
}

.chat-msg {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  padding: 2px 48px 2px 16px;
  margin-top: 1.0625rem;
  min-height: 2.75rem;
}
.chat-msg.msg-in {
  animation: vox-msg-in .22s var(--ease) both;
}
.chat-msg:hover, .chat-msg:focus-within { background: rgba(0,0,0,.06); }
.chat-msg.system {
  grid-template-columns: 1fr;
  padding: 4px 16px;
  margin-top: .5rem;
  color: var(--text-faint);
  font-size: 14px;
  text-align: center;
}
.chat-msg.hit {
  background: rgba(88,101,242,.12);
  box-shadow: inset 2px 0 0 var(--brand);
}
.chat-msg.has-mention, .chat-msg.mention-msg {
  background: rgba(250,166,26,.06);
  box-shadow: inset 2px 0 0 var(--gold);
}
.chat-msg .avatar {
  width: 40px;
  height: 40px;
  margin-top: 2px;
  font-size: 14px;
  cursor: pointer;
}
.chat-body { min-width: 0; padding-right: 8px; }
.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.375;
}
.chat-meta .name, .name-role {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-normal);
  cursor: pointer;
  /* soft outline — readable on light bg, not heavy */
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.35);
}
.chat-meta .name:hover { text-decoration: underline; }
.chat-meta .time {
  font-size: .75rem;
  color: var(--text-faint);
  font-weight: 400;
}
.edited-tag, .forwarded-tag {
  font-size: .625rem;
  color: var(--text-faint);
}
.host-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--brand);
  color: #fff;
  margin-left: 4px;
  vertical-align: middle;
}
.chat-text {
  font-size: 1rem;
  color: var(--text-normal);
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.375;
}
.chat-reply {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text-faint);
  cursor: pointer;
  border-left: 2px solid var(--bg-accent);
  padding-left: 8px;
}
.chat-reply .rn { font-weight: 600; color: var(--text-muted); }
.chat-img {
  max-width: min(400px, 100%);
  max-height: 350px;
  border-radius: var(--radius);
  margin-top: 6px;
  cursor: zoom-in;
  display: block;
}
.spoiler-img { filter: blur(20px); cursor: pointer; transition: filter .2s; }
.spoiler-img.revealed { filter: none; }
.mention, .mention-everyone {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 500;
}
.mention-everyone { background: rgba(250,166,26,.15); color: var(--gold); }
.channel-mention {
  color: var(--text-link);
  background: rgba(0,168,252,.12);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 500;
}
.custom-emoji { width: 22px; height: 22px; vertical-align: -5px; object-fit: contain; }
.md-code {
  background: var(--bg-tertiary);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: Consolas, "Courier New", monospace;
  font-size: .875em;
}
.md-pre {
  background: var(--bg-tertiary);
  border: 1px solid rgba(0,0,0,.2);
  border-radius: var(--radius-sm);
  padding: 8px;
  overflow-x: auto;
  margin: 6px 0;
  font-size: 14px;
  font-family: Consolas, monospace;
}
.md-quote {
  border-left: 4px solid var(--bg-accent);
  padding: 0 8px 0 12px;
  margin: 4px 0;
  color: var(--text-muted);
}
.md-spoiler {
  background: #1e1f22;
  color: transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: color .1s, background .1s;
}
.md-spoiler.revealed, .md-spoiler:hover {
  background: rgba(0,0,0,.2);
  color: var(--text-normal);
}
.md-heading { font-weight: 700; font-size: 20px; margin: 8px 0 4px; }
.md-timestamp {
  background: rgba(88,101,242,.15);
  color: var(--text-link);
  border-radius: 3px;
  padding: 0 2px;
  cursor: help;
}
.md-link { color: var(--text-link); }
.hl-word { background: rgba(250,166,26,.35); border-radius: 2px; padding: 0 1px; }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--bg-modifier-hover);
  border: 1px solid transparent;
  font-size: 14px;
  color: var(--text-muted);
}
.reaction:hover { border-color: rgba(255,255,255,.1); background: var(--bg-modifier-active); }
.reaction.mine {
  background: var(--brand-soft);
  border-color: rgba(88,101,242,.4);
  color: var(--text-normal);
}
.reaction .cnt { font-size: 12px; font-weight: 500; }

.msg-actions {
  position: absolute;
  top: -16px;
  right: 14px;
  display: none;
  align-items: center;
  gap: 0;
  background: var(--bg-floating);
  border: 1px solid rgba(0,0,0,.25);
  border-radius: 4px;
  box-shadow: var(--shadow);
  z-index: 6;
  padding: 0 2px;
  overflow: hidden;
}
.chat-msg:hover .msg-actions, .chat-msg:focus-within .msg-actions { display: flex; }
.msg-actions button {
  width: 32px;
  height: 32px;
  border-radius: 0;
  font-size: 14px;
  color: var(--interactive-normal);
}
.msg-actions button:hover {
  background: var(--bg-modifier-hover);
  color: var(--interactive-hover);
}
.msg-actions .ma-sep {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,.08);
  margin: 0 2px;
  flex-shrink: 0;
}
.msg-actions .ma-more {
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 12px;
}
.msg-actions button {
  display: grid;
  place-items: center;
}

.date-sep, .unread-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1.5rem 1rem 0.5rem;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
}
.date-sep::before, .date-sep::after,
.unread-sep::before, .unread-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.06);
}
.unread-sep { color: var(--red); }
.unread-sep::before, .unread-sep::after { background: rgba(242,63,67,.35); }

.jump-bottom {
  position: absolute;
  bottom: 100px;
  right: 24px;
  z-index: 5;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.typing-bar {
  min-height: 24px;
  padding: 0 16px 4px;
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
.typing-bar[hidden] { display: none !important; }
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
  flex-shrink: 0;
}
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  display: block;
  animation: vox-typing-dot 1.2s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
.typing-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-left: 3px solid var(--brand);
}
.reply-bar-body { flex: 1; min-width: 0; }
.reply-bar-label { font-size: 12px; font-weight: 700; color: var(--brand); margin-right: 6px; }
.reply-bar-preview {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px;
  padding: 8px;
  background: var(--bg-secondary);
}
.image-preview img {
  max-height: 80px;
  max-width: 160px;
  border-radius: 6px;
  object-fit: cover;
}

/* Composer */
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin: 0 16px 24px;
  padding: 0 8px 0 4px;
  background: var(--bg-high);
  border-radius: 10px;
  position: relative;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.04);
}
.chat-form:focus-within { box-shadow: 0 0 0 1px rgba(88,101,242,.28); }
.chat-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 200px;
  padding: 11px 8px;
  background: transparent;
  border: none;
  resize: none;
  line-height: 1.375;
  font-size: 1rem;
  height: auto;
}
.chat-form textarea::placeholder { color: var(--text-faint); }
.emoji-btn, .send-btn {
  width: 36px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--interactive-normal);
  font-size: 18px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}
.emoji-btn:hover, .send-btn:hover { color: var(--interactive-hover); }
.send-btn { color: var(--brand); }
.send-btn:hover { color: var(--brand-hover); }

.ac-box {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-floating);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: 8px;
}
.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  text-align: left;
}
.ac-item:hover, .ac-item.active { background: var(--brand); color: #fff; }
.ac-ico { width: 20px; text-align: center; }

.emoji-panel, .sticker-panel, .soundboard, .slash-hints {
  position: absolute;
  bottom: 72px;
  right: 16px;
  width: min(360px, calc(100% - 32px));
  max-height: 320px;
  background: var(--bg-floating);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 40;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.emoji-panel:not(.emoji-panel-full):empty,
.sticker-panel:empty { display: none !important; }

/* Fluxer-like expression picker (GIF / stickers / emoji) */
.expr-picker {
  position: absolute;
  bottom: 72px;
  right: 12px;
  width: min(428px, calc(100% - 24px));
  height: min(460px, calc(100vh - 160px));
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  z-index: 45;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.expr-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #2b2d31;
}
.expr-tabs {
  display: flex;
  gap: 6px;
}
.expr-tab {
  border: 0;
  background: transparent;
  color: #b5bac1;
  font: 600 13px/1.2 inherit;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.expr-tab:hover { background: rgba(255, 255, 255, 0.06); color: #f2f3f5; }
.expr-tab.active { background: rgba(255, 255, 255, 0.1); color: #fff; }
.expr-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.expr-search {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #1e1f22;
  color: #dbdee1;
  padding: 0 10px;
  font-size: 14px;
}
.expr-back {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b5bac1;
  cursor: pointer;
  font-size: 16px;
}
.expr-back:hover { background: rgba(255,255,255,.08); color: #fff; }
.expr-body {
  min-height: 0;
  overflow: hidden;
  background: #2b2d31;
  position: relative;
}
.expr-pane {
  display: none;
  height: 100%;
  min-height: 0;
}
.expr-pane.is-on { display: flex; }
.expr-pane[data-expr-pane="emoji"].is-on {
  display: grid;
  grid-template-columns: 44px 1fr;
}
.expr-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: #1e1f22;
}
.expr-rail .emoji-cat-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.expr-pane[data-expr-pane="emoji"] .emoji-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  align-content: start;
}
.expr-pane[data-expr-pane="emoji"] .emoji-grid button {
  width: 100%;
  aspect-ratio: 1;
  font-size: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.expr-pane[data-expr-pane="emoji"] .emoji-grid button:hover,
.expr-pane[data-expr-pane="emoji"] .emoji-grid button.is-hot {
  background: rgba(78, 80, 88, 0.55);
}
.expr-inspector {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  background: #1e1f22;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.expr-insp-ico {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}
.expr-insp-ico img { width: 28px; height: 28px; object-fit: contain; }
.expr-insp-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #dbdee1;
  font-size: 14px;
  font-weight: 600;
}
.expr-empty {
  padding: 28px 16px;
  text-align: center;
  color: #949ba4;
  font-size: 13px;
}
.gif-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  width: 100%;
  align-content: start;
}
.gif-cat {
  position: relative;
  height: 88px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #111214;
  color: #fff;
  font: 700 14px/1.2 inherit;
  text-align: left;
  padding: 0;
}
.gif-cat .gif-media,
.gif-cat img,
.gif-cat video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .88;
}
.gif-cat span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 8px 10px;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.72));
  z-index: 1;
}
.gif-cat:hover .gif-media,
.gif-cat:hover img { opacity: 1; }
.gif-18 {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  background: #ed4245;
  color: #fff;
  font: 800 10px/1 inherit;
  font-style: normal;
  letter-spacing: .05em;
  padding: 4px 6px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.gif-cat.is-nsfw .gif-media,
.gif-cat.is-nsfw img,
.gif-cat.is-nsfw video {
  filter: blur(16px) brightness(.62) saturate(1.45);
  transform: scale(1.28);
  opacity: 1;
}
.gif-masonry {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  width: 100%;
  align-content: start;
}
.gif-masonry.is-on { display: grid; }
.gif-item {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #111214;
  cursor: pointer;
  min-height: 90px;
  user-select: none;
}
.gif-item-fallback {
  background:
    linear-gradient(135deg, #2b2d31, #1a1b1e);
}
.gif-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 1;
  font: 700 10px/1 inherit;
  letter-spacing: .04em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  padding: 3px 5px;
  pointer-events: none;
}
.gif-item img, .gif-item video, .gif-item .gif-media {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  pointer-events: none;
}
.gif-item:hover { outline: 2px solid #5865f2; outline-offset: -2px; }
.gif-item.is-nsfw img,
.gif-item.is-nsfw video,
.gif-item.is-nsfw .gif-media {
  filter: blur(13px) brightness(.68) saturate(1.3);
  transform: scale(1.18);
}
.gif-item.is-nsfw:hover img,
.gif-item.is-nsfw:hover video,
.gif-item.is-nsfw:hover .gif-media {
  filter: none;
  transform: none;
}
.gif-item .gif-18 {
  top: auto;
  bottom: 6px;
  right: 6px;
  left: auto;
}
.gif-star {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: rgba(0,0,0,.45);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}
.gif-star.on { color: #fee75c; }
.expr-pane[data-expr-pane="stickers"] .sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  width: 100%;
  align-content: start;
}
.chat-gif, .chat-img.is-gif {
  max-width: min(320px, 100%);
  border-radius: 8px;
  display: block;
  margin-top: 6px;
  background: #111214;
}
.chat-img.is-broken {
  display: none;
}
.chat-text:empty { display: none; }
.emoji-panel-head, .soundboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.emoji-grid, .sticker-grid, .soundboard-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 8px;
  overflow-y: auto;
}
.sticker-grid { grid-template-columns: repeat(4, 1fr); }
.emoji-grid button, .sticker-btn, .sb-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  font-size: 22px;
  display: grid;
  place-items: center;
}
.emoji-grid button:hover, .sticker-btn:hover, .sb-btn:hover { background: var(--bg-modifier-hover); }
.sticker-btn img { width: 100%; height: 100%; object-fit: contain; }
.sb-btn {
  aspect-ratio: auto;
  font-size: 12px;
  padding: 8px 4px;
  color: var(--text-muted);
  flex-direction: column;
}
.soundboard-grid { grid-template-columns: repeat(4, 1fr); }
.emoji-upload-btn {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  background: var(--bg-accent); color: #fff; font-weight: 700;
}
.slash-hints {
  left: 16px;
  right: 16px;
  width: auto;
  bottom: 72px;
  max-height: 200px;
  padding: 6px;
}
.sticker-empty { grid-column: 1/-1; color: var(--text-faint); font-size: 13px; padding: 12px; }

/* Voice stage — column: [screen?] → tiles → controls (always bottom) */
.view-voice {
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.voice-stage-bg {
  position: absolute;
  inset: 0;
  /* NEVER paint server wallpaper here — .app::before already has it once.
     Double-draw caused ghosted / duplicated backgrounds (2026-08-08). */
  background-image: none !important;
  background-size: cover;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity .2s ease;
  will-change: opacity;
}
.view-voice > *:not(.voice-stage-bg) {
  position: relative;
  z-index: 1;
}
/* Screen share block — isolated layer (no theme blur / wallpaper bleed) */
.screen-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.08);
  z-index: 2;
  /* GPU isolation: speaking GIF/rings below must not composite into video */
  isolation: isolate;
  contain: layout style paint;
  transform: translateZ(0);
  backface-visibility: hidden;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.screen-stage[hidden] {
  display: none !important;
  flex: 0 0 0 !important;
  min-height: 0 !important;
  height: 0 !important;
  border: none !important;
  overflow: hidden !important;
}
.view-voice:not(.has-screen) .screen-stage {
  display: none !important;
}
.screen-stage > video#screenVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: #000;
  z-index: 1;
  /* kill scaling artifacts / theme filters */
  filter: none !important;
  image-rendering: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
  pointer-events: none;
}
/* Fullscreen demo — pure black, no chrome glitches */
.screen-stage:fullscreen,
.screen-stage:-webkit-full-screen,
.screen-stage:-moz-full-screen,
.screen-stage:-ms-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  background: #000 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}
.screen-stage:fullscreen > video#screenVideo,
.screen-stage:-webkit-full-screen > video#screenVideo {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000 !important;
  filter: none !important;
}
.screen-stage:fullscreen .screen-thumbs,
.screen-stage:-webkit-full-screen .screen-thumbs {
  display: none !important;
}
.screen-stage:fullscreen .screen-bar,
.screen-stage:-webkit-full-screen .screen-bar {
  z-index: 10;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.screen-stage:fullscreen:hover .screen-bar,
.screen-stage:-webkit-full-screen:hover .screen-bar {
  opacity: 1;
}
/* While watching share: light speaking indicator (no heavy GIF pulse = less GPU thrash) */
.view-voice.has-screen .tile.speaking .tile-ring {
  animation: none !important;
  box-shadow: 0 0 0 2px var(--green) !important;
}
.view-voice.has-screen .avatar.is-speak-gif .av-gif-live {
  /* keep crossfade but cheaper while screen is up */
  will-change: auto;
}
body.is-screen-fs .voice-center,
body.is-screen-fs .voice-controls,
body.is-screen-fs .guild-rail,
body.is-screen-fs .channels,
body.is-screen-fs .members,
body.is-screen-fs .user-panel {
  /* optional: reduce work under FS (some GPUs composite wrong) */
  content-visibility: auto;
}
/* Tiles strip under screen (or full center when no screen) */
.view-voice:not(.has-screen) .voice-center {
  flex: 1 1 auto;
  min-height: 0;
  justify-content: center;
}
.view-voice.has-screen .voice-center {
  flex: 0 0 auto;
  min-height: 88px;
  max-height: 140px;
  padding: 8px 12px 4px;
  justify-content: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255,255,255,.06);
  z-index: 3;
}
.view-voice.has-screen .tiles {
  flex: 0 0 auto;
  max-height: 110px;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 10px;
  padding: 4px 8px;
  display: flex !important;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  grid-template-columns: none !important;
}
.view-voice.has-screen .tiles.circle-mode .tile {
  width: 72px !important;
  min-width: 72px;
  padding: 6px 4px;
}
.view-voice.has-screen .tiles.circle-mode .tile-ring {
  width: 52px !important;
  height: 52px !important;
}
.view-voice.has-screen .tiles.video-mode .tile {
  width: 120px !important;
  min-width: 120px;
  max-width: 120px;
}
.view-voice.has-screen .tiles .tile-name {
  font-size: 11px;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-voice.has-screen .voice-room-label,
.view-voice.has-screen .empty-voice {
  display: none !important;
}
.screen-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  z-index: 4;
  pointer-events: none;
}
.screen-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.screen-bar #screenLabel { pointer-events: none; }
.screen-peer-select {
  background: rgba(0,0,0,.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  max-width: 180px;
}
.screen-thumbs {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
  max-height: calc(100% - 52px);
  overflow: auto;
  pointer-events: auto;
}
.screen-thumbs[hidden] { display: none !important; }
.screen-thumb {
  width: 96px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #111;
  cursor: pointer;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}
.screen-thumb.active { border-color: var(--brand, #5865f2); }
.screen-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.screen-thumb span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 10px;
  padding: 2px 4px;
  background: rgba(0,0,0,.65);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Guild rail icon: GIF plays only on hover */
.guild-icon {
  position: relative;
  overflow: hidden;
}
.guild-icon .guild-gif-static,
.guild-icon .guild-gif-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  pointer-events: none;
}
.guild-icon .guild-gif-live { opacity: 0; }
.guild-btn:hover .guild-icon.is-gif .guild-gif-static,
.guild-btn:focus-visible .guild-icon.is-gif .guild-gif-static {
  opacity: 0;
}
.guild-btn:hover .guild-icon.is-gif .guild-gif-live,
.guild-btn:focus-visible .guild-icon.is-gif .guild-gif-live {
  opacity: 1;
}
.guild-btn:hover .guild-icon:not(.is-gif) {
  animation: guild-icon-pop 0.45s ease;
}
@keyframes guild-icon-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Mod action modal polish */
#modActionModal .modal-card {
  width: min(420px, 94vw);
}
#modActionModal .field span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
#modActionModal textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
}
#modActionSub {
  margin: 0 0 12px;
  color: var(--text-normal);
  font-size: 14px;
}
.voice-center {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 8px;
  overflow: hidden;
}
.voice-room-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  align-self: flex-start;
  padding-left: 8px;
}
.vrl-icon { font-size: 28px; opacity: .9; }
.vrl-name { font-size: 20px; font-weight: 700; }
.vrl-sub { font-size: 13px; color: var(--text-faint); margin-top: 2px; }
.tiles {
  width: 100%;
  max-width: 920px;
  display: grid;
  gap: 16px;
  padding: 8px;
  align-content: center;
  justify-content: center;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.tiles.circle-mode {
  grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
}
.tiles.video-mode {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-width: 1100px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  cursor: default;
  padding: 12px 10px 10px;
  border-radius: var(--radius-lg);
  transition: background .12s, box-shadow .12s;
  overflow: hidden;
  isolation: isolate;
}
.tile:hover { background: var(--bg-modifier-hover); }
/* personal member backdrop (custom image or DEP-style gradient) */
.tile.has-pbg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--tile-pbg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.92;
  z-index: 0;
  pointer-events: none;
  filter: saturate(1.05);
}
/* GIF profile bg: single live <img>, not CSS background (no freeze / no ghost stack) */
.tile.has-pbg-gif::before {
  background-image: none !important;
  opacity: 0 !important;
}
.tile > img.tile-pbg-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  opacity: 0.92;
  border-radius: inherit;
  filter: none;
}
.tile.has-pbg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%);
  z-index: 0;
  pointer-events: none;
}
.tile.has-pbg .tile-ring,
.tile.has-pbg .tile-meta {
  position: relative;
  z-index: 1;
}
.tile.has-pbg .tile-name {
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.55),
    0 1px 3px rgba(0, 0, 0, 0.45);
}
.tile-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--bg-secondary);
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow .12s;
  overflow: hidden;
  flex-shrink: 0;
}
.tiles.video-mode .tile-ring {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  border-radius: var(--radius);
}
.tile.speaking .tile-ring {
  box-shadow: 0 0 0 3px var(--green), 0 0 20px rgba(35, 165, 89, .35);
  animation: vox-speak-pulse 1.2s ease-in-out infinite;
}
.voice-users li.speaking .avatar {
  animation: vox-speak-ring .9s ease-in-out infinite;
}
.tile-av, .tile .avatar.tile-av {
  width: 100% !important;
  height: 100% !important;
  max-width: 100px;
  max-height: 100px;
  font-size: 32px !important;
  border: none !important;
  position: relative !important;
  z-index: 1;
  overflow: hidden !important;
}
.tile-av .av-img,
.tile .avatar.tile-av .av-img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  display: block !important;
  z-index: 2;
}
.tile-av.has-img .av-fb { display: none !important; }

/* ── GIF avatars: frozen frame until speak / hover (Discord-style) ──
   Idle: solid canvas on top, live fully invisible (no 0.02 ghost duplicate).
   Speak/hover: live opacity 1, static off — CSS only, never restart src. */
.avatar.is-speak-gif,
.avatar.is-hover-gif {
  position: relative !important;
  overflow: hidden !important;
  contain: none !important;
}
.avatar.is-speak-gif .av-gif-static,
.avatar.is-speak-gif .av-gif-live,
.avatar.is-hover-gif .av-gif-static,
.avatar.is-hover-gif .av-gif-live {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: inherit;
  display: block !important;
  pointer-events: none;
}
.avatar.is-speak-gif .av-gif-static,
.avatar.is-hover-gif .av-gif-static {
  opacity: 1 !important;
  z-index: 3;
  transition: opacity 0.1s ease;
}
.avatar.is-speak-gif .av-gif-live,
.avatar.is-hover-gif .av-gif-live {
  /* Fully transparent when idle (not 0.02 — that ghosted a second copy).
     Keep in layout so Chrome still decodes; static canvas covers it. */
  opacity: 0 !important;
  z-index: 2;
  transition: opacity 0.1s ease;
}
/* Voice: speaking → play GIF, freeze when quiet */
.tile.speaking .avatar.is-speak-gif .av-gif-static,
.voice-users li.speaking .avatar.is-speak-gif .av-gif-static {
  opacity: 0 !important;
  transition: opacity 0.08s ease;
}
.tile.speaking .avatar.is-speak-gif .av-gif-live,
.voice-users li.speaking .avatar.is-speak-gif .av-gif-live {
  opacity: 1 !important;
  z-index: 4;
  transition: opacity 0.08s ease;
}
/* Voice + list: hover avatar → play */
.avatar.is-speak-gif:hover .av-gif-static,
.avatar.is-hover-gif:hover .av-gif-static,
.member-item:hover .avatar.is-hover-gif .av-gif-static,
.chat-msg:hover .avatar.is-hover-gif .av-gif-static,
.voice-users li:hover .avatar.is-speak-gif .av-gif-static,
.user-panel:hover .avatar.is-hover-gif .av-gif-static {
  opacity: 0 !important;
}
.avatar.is-speak-gif:hover .av-gif-live,
.avatar.is-hover-gif:hover .av-gif-live,
.member-item:hover .avatar.is-hover-gif .av-gif-live,
.chat-msg:hover .avatar.is-hover-gif .av-gif-live,
.voice-users li:hover .avatar.is-speak-gif .av-gif-live,
.user-panel:hover .avatar.is-hover-gif .av-gif-live {
  opacity: 1 !important;
  z-index: 4;
  transition: opacity 0.08s ease;
}
.tile.speaking .tile-ring {
  transition: box-shadow 0.12s ease;
}
.avatar.is-speak-gif.has-img .av-fb,
.avatar.is-hover-gif.has-img .av-fb {
  display: none !important;
}

/* Profile / settings banner: animated GIF as layered img (CSS bg freezes GIF) */
.has-banner-gif,
#profileBanner.has-banner-gif,
.us-hero-banner.has-banner-gif,
.pe-banner-preview.has-banner-gif,
.dc-pop-banner.has-banner-gif,
.us-live-banner.has-banner-gif {
  position: relative !important;
  overflow: hidden !important;
  /* contain:paint freezes GIF in Chromium — never use on animated banners */
  contain: none !important;
  isolation: auto !important;
}
.has-banner-gif > img.banner-gif-live,
img.banner-gif-live,
img.vox-gif-live.banner-gif-live {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  z-index: 0;
  pointer-events: none;
  /* no transform — Chromium freezes GIF under GPU layers */
  opacity: 1 !important;
  visibility: visible !important;
  animation-play-state: running !important;
  contain: none !important;
}
/* Profile pop / settings cards must not paint-contain GIFs */
.dc-pop-banner,
.us-hero-banner,
.pe-banner-preview,
#profileAvatar,
#usAvatarPreview,
#usAvatarPreview2,
#usLiveAvatar {
  contain: none !important;
}
.dc-pop-avatar-ring .profile-av .av-img,
#profileAvatar .av-img,
#usAvatarPreview .av-img,
#usAvatarPreview2 .av-img,
#usLiveAvatar .av-img {
  opacity: 1 !important;
  transform: translateZ(0);
}
/* xs list under channel */
.voice-users .avatar.is-speak-gif.xs .av-gif-static,
.voice-users .avatar.is-speak-gif.xs .av-gif-live {
  border-radius: 50%;
}
.tile-ring .tile-av {
  position: relative;
  z-index: 1;
}
.tiles.video-mode .tile-av { display: none !important; }
/* NEVER flash speaking on right members rail */
#peerList .member-item.speaking,
.member-item.speaking {
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}
#peerList .member-item.speaking .member-av,
#peerList .member-item.speaking .avatar,
.member-item.speaking .member-av,
.member-item.speaking .avatar {
  box-shadow: none !important;
  outline: none !important;
}
.tile-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.tile-meta { text-align: center; max-width: 100%; }
.tile-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  color: #fff;
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.4);
}
.tile-flags { display: flex; gap: 4px; justify-content: center; margin-top: 2px; min-height: 16px; }
.tf { font-size: 12px; opacity: .9; }
.tile.muted .tile-name { opacity: .75; }
.empty-voice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}
.empty-art { font-size: 56px; margin-bottom: 12px; opacity: .85; }
.empty-voice h3 { margin: 0 0 8px; color: var(--text-normal); font-size: 22px; font-weight: 700; }
.empty-voice p { margin: 0; max-width: 320px; color: var(--text-faint); font-size: 14px; }
.stage-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(90deg, rgba(88,101,242,.2), transparent);
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 13px;
  font-weight: 600;
}
.voice-controls, .discord-vc {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 14px 16px 20px;
  flex: 0 0 auto;
  flex-shrink: 0;
  z-index: 6;
  background: linear-gradient(transparent, rgba(0,0,0,.45));
  border-top: 1px solid rgba(255,255,255,.06);
}
.view-voice.has-screen .voice-controls {
  background: rgba(15, 16, 18, 0.92);
  backdrop-filter: blur(8px);
}
.vc-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.vc-btn.round {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background: var(--bg-secondary);
  padding: 0;
  justify-content: center;
  gap: 0;
}
.vc-btn.round span { display: none; }
.vc-btn:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.vc-btn.round:hover { background: var(--bg-accent); }
.vc-btn.on, .vc-btn.active { background: var(--brand-soft); color: var(--brand); }
.vc-btn.round.on, .vc-btn.round.active { background: var(--brand); color: #fff; }
.vc-btn.danger { color: #fff; }
.vc-btn.round.danger { background: var(--red); color: #fff; }
.vc-btn.danger:hover, .vc-btn.round.danger:hover { background: #d83c3e; color: #fff; }

/* Wallpaper content areas (chat / voice) */
.app.has-wallpaper .view-text,
.app.has-wallpaper .view-voice,
.app.has-wallpaper .view-home {
  background: transparent !important;
}
.app.has-wallpaper .chat-log {
  background: transparent !important;
}
.app.has-wallpaper .chat-msg:not(.system),
.app.has-wallpaper .msg {
  background: rgba(43, 45, 49, 0.5);
  border-radius: 4px;
  backdrop-filter: blur(2px);
}
.app.has-wallpaper .chat-msg:hover,
.app.has-wallpaper .msg:hover {
  background: rgba(43, 45, 49, 0.72);
}
.app.has-wallpaper .chat-form,
.app.has-wallpaper .composer,
.app.has-wallpaper .chat-input-wrap {
  backdrop-filter: blur(12px);
  background: rgba(30, 31, 34, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.app.has-wallpaper .voice-center {
  background: transparent !important;
}
.app.has-wallpaper .tiles .tile:not(.has-pbg) {
  background: rgba(0, 0, 0, 0.22);
}
/* Soft nick glow on light server wallpaper */
.app.has-wallpaper .chat-meta .name,
.app.has-wallpaper .name-role,
.app.has-wallpaper .member-name,
.app.has-wallpaper .vu-name,
.app.has-wallpaper .tile-name,
.app.has-wallpaper .user-panel-name {
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.5),
    0 1px 3px rgba(0, 0, 0, 0.4);
}
.app.has-wallpaper .empty-voice {
  background: rgba(0, 0, 0, 0.28);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(6px);
}
.app.has-wallpaper .server-header,
.app.has-wallpaper .channel-scroll {
  background: transparent !important;
}

/* ═══ Profile editor — centered CMD-style ═══ */
.pe-modal {
  place-items: center !important;
  padding: 24px !important;
  z-index: 420;
}
.pe-modal .pe-backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  animation: vox-fade-in .18s var(--ease) both;
}
.pe-card {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  max-height: min(86vh, 640px);
  display: flex;
  flex-direction: column;
  background: #2b2d31;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
  animation: pe-pop .22s var(--ease) both;
  box-sizing: border-box;
}
@keyframes pe-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.pe-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.pe-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #f2f3f5;
}
.pe-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: #b5bac1;
}
.pe-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #6d6f78;
  color: #6d6f78;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 13px;
}
.pe-close:hover { border-color: #fff; color: #fff; }
.pe-body {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 280px);
  gap: 16px;
  padding: 16px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-width: 100%;
}
.pe-form { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.pe-preview { min-width: 0; max-width: 100%; }
.pe-block { min-width: 0; }
.pe-block { margin-bottom: 14px; }
.pe-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #b5bac1;
  margin-bottom: 6px;
}
.pe-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #232428;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .pe-body { grid-template-columns: 1fr; }
  .pe-preview { order: -1; }
  .pe-preview .us-live-card { max-width: 100%; }
}

/* ═══ User Settings — Fluxer-like floating window ═══ */
.modal.usettings-modal,
.dsettings-modal.usettings-modal {
  padding: 20px !important;
  place-items: center !important;
  align-content: center !important;
  justify-items: center !important;
  z-index: 410 !important;
  overflow: auto !important;
  overscroll-behavior: contain;
}
.modal.usettings-modal .modal-backdrop,
.dsettings-modal.usettings-modal .modal-backdrop {
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(8px) saturate(1.05);
  animation: vox-fade-in .16s var(--ease) both;
}
.modal.usettings-modal .dsettings.dc-user-settings,
.dsettings-modal.usettings-modal .dsettings.dc-user-settings,
.modal.usettings-modal .dsettings.usettings {
  position: relative !important;
  z-index: 1 !important;
  width: min(1100px, calc(100vw - 40px)) !important;
  height: min(720px, calc(100vh - 40px)) !important;
  max-width: 1100px !important;
  max-height: calc(100vh - 40px) !important;
  min-height: 480px;
  margin: 0 !important;
  border-radius: 16px !important;
  background: #1e1f22 !important;
  display: grid !important;
  grid-template-columns: 248px minmax(0, 1fr) !important;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden !important;
  animation: pe-pop .2s var(--ease) both;
  pointer-events: auto;
  contain: layout style;
}
.usettings .dsettings-nav.us-nav {
  padding: 16px 10px 14px 12px;
  background: #111214;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: hidden;
  overflow-y: auto;
  gap: 2px;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}
.usettings .dsettings-main.us-main {
  background: #1e1f22;
  padding: 28px 36px 36px;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  min-height: 0;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
}
.usettings .dsettings-close {
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #b5bac1;
}
.usettings .dsettings-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}
.usettings .dsettings-nav-title {
  margin: 14px 0 4px;
  padding: 4px 10px 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6d6f78;
  flex-shrink: 0;
}
.usettings .dsettings-nav-title:first-of-type { margin-top: 6px; }

.us-nav-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #f2f3f5;
  text-align: left;
  background: rgba(88, 101, 242, 0.14);
  border: 1px solid rgba(88, 101, 242, 0.28);
}
.us-nav-edit:hover {
  background: rgba(88, 101, 242, 0.22);
  color: #fff;
}
.us-nav-edit-ico { opacity: .9; }
.us-nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #6d6f78;
  font-size: 13px;
  pointer-events: none;
}
.us-nav-search-ico { font-size: 14px; }

.us-nav-item {
  text-align: left;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: #b5bac1;
  width: 100%;
  min-height: 34px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
}
.us-nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.us-nav-ico { width: 18px; text-align: center; font-size: 14px; opacity: .9; flex-shrink: 0; }
.us-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f2f3f5;
}
.us-nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: inset 3px 0 0 #5865f2;
}
.us-nav-item.admin { color: #f0b232; font-weight: 600; }
.us-nav-item.admin:hover { background: rgba(240, 178, 50, 0.12); }
.us-nav-item.us-done { color: #f23f43; margin-top: 4px; }
.us-nav-item.us-done:hover { background: rgba(242, 63, 67, 0.1); color: #f23f43; }
.us-nav-version {
  padding: 8px 10px 0;
  font-size: 11px;
  color: #6d6f78;
  line-height: 1.3;
}
.us-admin-block {
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 12px;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dsettings-nav-foot { margin-top: auto; padding-top: 12px; }

.us-panel {
  max-width: 740px;
  animation: usFade .12s ease;
}
.us-panel-profile { max-width: none; }
@keyframes usFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.us-page-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f2f3f5;
}
/* .us-build-tag defined above (clickable changelog) */
.us-section-h {
  margin: 24px 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #b5bac1;
}
.us-panel .ss-hint {
  margin: 0 0 16px;
  font-size: 14px;
  color: #b5bac1;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.us-panel .us-row-stack {
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  gap: 8px;
  min-width: 0;
}
.us-panel .us-row-stack .us-row-value,
.us-panel .us-row-stack .muted {
  white-space: normal !important;
  overflow: visible;
  text-overflow: unset;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Account hero = same visual model as member profile pop (banner photo + ava photo) */
.us-hero-card,
.us-profile-card {
  --us-hero-bg: #2b2d31;
  background: var(--us-hero-bg);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  position: relative;
  /* isolation:isolate freezes nested GIF animation in Chrome — disabled */
  isolation: auto;
  contain: none;
}
.us-hero-banner-wrap {
  position: relative;
  height: 100px;
  width: 100%;
  overflow: hidden;
}
.us-hero-banner {
  width: 100%;
  height: 100%;
  min-height: 100px;
  background: #5865f2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
}
.us-hero-banner.host-banner {
  background-image: linear-gradient(135deg, #f04747, #faa61a) !important;
}
.us-hero-body {
  position: relative;
  padding: 48px 16px 16px;
  min-height: 72px;
  background: var(--us-hero-bg);
  z-index: 1;
}
/* Avatar sits half on banner, half on body — like dc-pop */
.us-hero-avatar-outer {
  position: absolute;
  left: 16px;
  top: -40px;
  width: 92px;
  height: 92px;
  z-index: 3;
  pointer-events: none;
}
.us-hero-avatar-outer .avatar.lg,
.us-hero-avatar-outer #usAvatarPreview {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 80px !important;
  height: 80px !important;
  font-size: 28px !important;
  border: 6px solid var(--us-hero-bg) !important;
  border-radius: 50% !important;
  box-sizing: content-box !important;
  margin: 0 !important;
  pointer-events: auto;
  overflow: hidden;
}
.us-hero-status {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid var(--us-hero-bg);
  box-sizing: content-box;
  background: #23a559;
  z-index: 4;
}
.us-hero-status.idle { background: #f0b232; }
.us-hero-status.dnd { background: #f23f43; }
.us-hero-status.invisible,
.us-hero-status.offline { background: #80848e; }
.us-hero-meta {
  margin-left: 100px;
  margin-right: 168px;
  min-width: 0;
  min-height: 44px;
  padding: 2px 0 0;
  overflow: hidden;
}
.us-acc-name {
  font-size: 20px;
  font-weight: 700;
  color: #f2f3f5;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  overflow-wrap: normal;
}
.us-acc-tag {
  font-size: 14px;
  color: #b5bac1;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.us-hero-body > .btn,
.us-hero-body > button.btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
  z-index: 2;
}
@media (max-width: 560px) {
  .us-hero-meta {
    margin-right: 12px;
  }
  .us-hero-body > .btn,
  .us-hero-body > button.btn {
    position: static;
    transform: none;
    display: inline-flex;
    margin: 12px 0 0 100px;
  }
}

/* Discord account rows (prototype field-group) */
.us-rows,
.us-field-group {
  background: #2b2d31;
  border-radius: 8px;
  overflow: hidden;
}
.us-row,
.us-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 56px;
}
.us-row:last-child,
.us-field:last-child { border-bottom: none; }
.us-field-left { min-width: 0; flex: 1; }
.us-row-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #b5bac1;
}
.us-field-sub {
  font-size: 15px;
  color: #dbdee1;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.us-row-value {
  font-size: 15px;
  color: #dbdee1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.us-row-value.muted,
.us-field-sub.muted { color: #949ba4; white-space: normal; font-size: 14px; }
.us-row-btn {
  height: 32px;
  padding: 0 16px;
  border-radius: 3px;
  background: #4e5058;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.us-row-btn:hover { background: #6d6f78; }
.us-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: #6d6f78;
  line-height: 1.4;
  max-width: 520px;
}
.us-row-stack {
  grid-template-columns: 1fr;
  gap: 8px;
}
.us-row-stack .us-row-value { text-align: left; }
.us-row-check {
  grid-template-columns: 1fr auto;
  cursor: pointer;
}
.us-row-check input { width: 20px; height: 20px; accent-color: #5865f2; }
/* toggle rows replace checkboxes */
.us-row.us-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  min-height: 56px;
}
.us-page-title,
.us-field-sub,
.member-name,
.dc-pop-displayname,
.dc-pop-username,
.dc-pop-about,
.chat-text,
.channel-name {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.member-meta,
.member-name-row {
  min-width: 0;
  overflow: hidden;
}
.member-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: inline-block;
  vertical-align: bottom;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.28);
}
.member-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-hint,
.us-note,
.us-toggle-desc {
  overflow-wrap: anywhere;
}
.us-color-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 6px;
  border: 1px solid rgba(255,255,255,.15);
}
.us-select {
  width: 100%;
  max-width: 280px;
  height: 40px;
  background: #1e1f22;
  border: none;
  border-radius: 4px;
  color: #dbdee1;
  padding: 0 10px;
}
.us-file-btn { cursor: pointer; width: fit-content; display: inline-flex; align-items: center; }

/* Profile 3-column editor */
.us-profile-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(280px, 340px) minmax(200px, 1fr);
  gap: 20px;
  align-items: start;
  min-height: 0;
}
.us-profile-controls {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 4px;
}
.us-ctrl-block { margin-bottom: 18px; }
.us-ctrl-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #b5bac1;
  margin-bottom: 8px;
}
.us-live-input {
  width: 100%;
  background: #1e1f22 !important;
  border: none !important;
  border-radius: 4px;
  color: #dbdee1;
  height: 40px;
  padding: 0 10px;
}
textarea.us-live-input {
  height: auto;
  min-height: 88px;
  padding: 10px;
  resize: vertical;
}
.us-banner-color {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 4px;
  background: #1e1f22;
  cursor: pointer;
  padding: 4px;
}

/* Discord-style banner + color picker in profile editor */
.pe-banner-editor { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pe-banner-preview {
  position: relative;
  width: 100%;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: #5865f2;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,.2);
}
.pe-banner-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.pe-banner-overlay .pe-banner-btn {
  pointer-events: auto;
}
.pe-banner-preview:hover .pe-banner-overlay,
.pe-banner-preview:focus-within .pe-banner-overlay { opacity: 1; }
.pe-banner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 3px;
  background: #4e5058;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.pe-banner-btn:hover { background: #6d6f78; }
.pe-banner-btn.ghost { background: rgba(0,0,0,.45); }
.pe-banner-btn.ghost:hover { background: rgba(0,0,0,.65); }
.pe-banner-color-block {
  background: #1e1f22;
  border-radius: 8px;
  padding: 10px 12px;
}
.pe-banner-color-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #b5bac1;
}
.pe-banner-color-hex {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: #dbdee1;
  text-transform: none;
  letter-spacing: 0;
}
.pe-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pe-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
  transition: transform .12s ease, box-shadow .12s ease;
}
.pe-swatch:hover { transform: scale(1.08); }
.pe-swatch.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #5865f2;
}
.pe-swatch-custom {
  position: relative;
  display: grid;
  place-items: center;
  background: conic-gradient(from 90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
}
.pe-swatch-custom input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
}
.pe-swatch-custom span { pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.us-avatar-upload-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.us-avatar-btns { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.us-wall-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Live card preview */
.us-profile-preview-col { position: sticky; top: 0; }
.us-preview-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #b5bac1;
  margin-bottom: 8px;
}
.us-live-card {
  background: #111214;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  width: 100%;
  max-width: 340px;
}
.us-live-banner {
  position: relative;
  height: 105px;
  min-height: 105px;
  background: #5865f2;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  contain: none !important;
}
.us-live-banner.has-banner-gif,
.us-live-banner.has-img {
  background-image: none !important;
}
.us-live-banner > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 0 !important;
}
.us-live-avatar-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  margin: -40px 0 0 16px;
  border-radius: 50%;
  background: #111214;
  display: grid;
  place-items: center;
}
.us-live-av,
#usLiveAvatar.avatar.lg {
  width: 80px !important;
  height: 80px !important;
  border: none !important;
  border-radius: 50%;
  font-size: 28px !important;
}
.us-live-status {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid #111214;
  background: #23a559;
  box-sizing: border-box;
}
.us-live-body { padding: 12px 16px 16px; }
.us-live-status-bubble {
  display: inline-block;
  background: #2b2d31;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  color: #dbdee1;
  margin-bottom: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.us-live-status-bubble[hidden] { display: none !important; }
.us-live-name {
  font-size: 20px;
  font-weight: 700;
  color: #f2f3f5;
  line-height: 1.2;
}
.us-live-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  color: #dbdee1;
  margin-top: 2px;
}
.us-live-pronouns { color: #b5bac1; }
.us-live-pronouns:not([hidden])::before { content: "· "; color: #4e5058; }
.us-live-pronouns[hidden] { display: none !important; }
.us-live-badges { margin-top: 6px; min-height: 8px; font-size: 14px; }
.us-live-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.us-mini-ico {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #2b2d31;
  color: #b5bac1;
}
.us-live-about {
  font-size: 14px;
  color: #dbdee1;
  line-height: 1.4;
  white-space: pre-wrap;
  margin-bottom: 12px;
  word-break: break-word;
}
.us-live-about[hidden] { display: none !important; }
.us-live-member-since { margin-bottom: 12px; }
.us-live-ms-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #b5bac1;
  margin-bottom: 2px;
}
.us-live-ms-val { font-size: 14px; color: #dbdee1; }
.us-live-note-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #b5bac1;
}
.us-live-note-label span { font-weight: 400; text-transform: none; color: #6d6f78; }
.us-live-note-hint {
  margin-top: 4px;
  font-size: 13px;
  color: #6d6f78;
}

/* Widgets column */
.us-profile-widgets {
  background: transparent;
  min-width: 0;
}
.us-widget-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 16px;
}
.us-wtab {
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: #b5bac1;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.us-wtab.active { color: #f2f3f5; border-bottom-color: #f2f3f5; }
.us-widget-empty {
  text-align: center;
  padding: 24px 12px;
  color: #b5bac1;
}
.us-widget-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #f2f3f5;
  margin-bottom: 8px;
}
.us-widget-empty p { font-size: 13px; line-height: 1.4; margin: 0 0 16px; }
.us-widget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.us-widget-tile {
  background: #2b2d31;
  border-radius: 8px;
  min-height: 72px;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #b5bac1;
  border: 1px solid rgba(255,255,255,.04);
}
.us-widget-add {
  border-style: dashed;
  border-color: rgba(255,255,255,.12);
  font-size: 22px;
  color: #6d6f78;
}

/* Voice subnav — pill tabs */
.us-voice-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border-left: none;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}
.us-vsub {
  font-size: 13px;
  font-weight: 500;
  color: #b5bac1;
  padding: 6px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.us-vsub:hover { color: #f2f3f5; background: rgba(255, 255, 255, 0.06); }
.us-vsub.active { color: #fff; font-weight: 600; background: rgba(88, 101, 242, 0.28); }
.us-vpane { min-width: 0; max-width: 100%; }
.us-select-wide { max-width: 100% !important; width: 100%; }
.us-meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.us-range {
  flex: 1;
  min-width: 0;
  accent-color: #5865f2;
  height: 6px;
}
.us-range-val {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #b5bac1;
  min-width: 40px;
  text-align: right;
}
.us-mic-meter {
  height: 8px;
  border-radius: 4px;
  background: #1e1f22;
  overflow: hidden;
  margin-top: 6px;
}
.us-mic-meter i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #23a559, #57f287);
  border-radius: 4px;
  transition: width .06s linear;
}
.us-cam-preview-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 16/10;
  border-radius: 8px;
  overflow: hidden;
  background: #1e1f22;
  border: 1px solid rgba(255,255,255,.08);
}
.us-cam-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.us-cam-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: #949ba4;
  pointer-events: none;
}
.us-cam-preview-empty[hidden] { display: none !important; }
.us-cam-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.us-text-wrap {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal !important;
  max-width: 100%;
  line-height: 1.45;
  font-size: 14px;
  color: #b5bac1;
  margin: 0;
}
.us-text-wrap.muted { color: #949ba4; }
.us-privacy-rows .us-privacy-block {
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  gap: 6px;
  min-height: 0;
}
.us-privacy-rows .us-row-label { flex-shrink: 0; }
.us-privacy-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start !important;
}
.pe-micro {
  margin: 0 0 8px;
  font-size: 12px;
  color: #949ba4;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.pe-bg-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-width: 100%;
}
.pe-bg-preset {
  position: relative;
  height: 52px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
  background-size: cover;
  background-position: center;
}
.pe-bg-preset:hover { filter: brightness(1.08); }
.pe-bg-preset.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #5865f2;
}
.pe-bg-preset span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2px 4px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Full emoji panel (Discord-like) */
.emoji-panel-full {
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, 70vh);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.emoji-panel-full .emoji-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 6px;
  flex-shrink: 0;
}
.emoji-search {
  flex: 1;
  min-width: 0;
  height: 28px;
  border-radius: 4px;
  border: none;
  background: #1e1f22;
  color: #dbdee1;
  padding: 0 8px;
  font-size: 13px;
}
.emoji-cats {
  display: flex;
  gap: 2px;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
}
.emoji-cat-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  font-size: 16px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: .75;
}
.emoji-cat-btn:hover { background: rgba(78,80,88,.4); opacity: 1; }
.emoji-cat-btn.active { background: #404249; opacity: 1; }
.emoji-panel-full .emoji-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  align-content: start;
}
.emoji-panel-full .emoji-grid button {
  width: 100%;
  aspect-ratio: 1;
  font-size: 22px;
  border-radius: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.emoji-panel-full .emoji-grid button:hover { background: rgba(78,80,88,.55); }
.emoji-panel-full .emoji-grid .custom-emoji-btn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.emoji-sec-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #949ba4;
  padding: 8px 4px 4px;
  letter-spacing: .02em;
}

.us-check {
  padding: 4px 0;
  margin: 0;
  color: #dbdee1;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.us-check input { width: 18px; height: 18px; accent-color: #5865f2; }
.us-kbd-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 13px;
  color: #b5bac1;
}
.us-kbd-row kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  margin-right: 4px;
  border-radius: 3px;
  background: #1e1f22;
  border: 1px solid #4e5058;
  font-size: 11px;
  font-family: inherit;
  color: #dbdee1;
  text-align: center;
}
.legacy-hidden { display: none !important; }

@media (max-width: 1100px) {
  .us-profile-layout {
    grid-template-columns: 1fr 1fr;
  }
  .us-profile-widgets { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .modal.usettings-modal .dsettings.dc-user-settings,
  .dsettings-modal.usettings-modal .dsettings.dc-user-settings {
    grid-template-columns: 1fr !important;
    width: min(100%, calc(100vw - 16px)) !important;
    height: min(92vh, 720px) !important;
    max-height: calc(100vh - 16px) !important;
    border-radius: 14px !important;
    min-height: 360px;
  }
  .usettings .dsettings-nav.us-nav {
    max-height: 132px;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px 8px;
    overflow-y: auto;
  }
  .usettings .dsettings-main.us-main { padding: 20px 16px 24px; }
  .us-profile-layout { grid-template-columns: 1fr; }
  .us-row { grid-template-columns: 1fr; gap: 6px; }
  .us-row-value { text-align: left; }
}

/* Soundboard floating fixed */
#soundboard.soundboard {
  position: fixed;
  z-index: 500;
  width: 320px;
  max-height: 280px;
  background: var(--bg-floating);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#soundboard[hidden] { display: none !important; }
.soundboard-hint { font-size: 11px; font-weight: 500; color: var(--text-faint); }
.sb-btn {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 10px 6px !important;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  transition: background .12s, transform .1s;
}
.sb-btn:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.sb-btn.sb-flash { background: var(--brand) !important; transform: scale(0.96); }
.sb-ico { font-size: 22px; line-height: 1; }
.sb-lab { font-size: 11px; color: var(--text-muted); font-weight: 600; }
#soundboardBtnVoice.active,
#soundboardBtnVoice.on {
  background: var(--brand) !important;
  color: #fff !important;
}

/* Appearance + boost UI */
.ss-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text-muted);
  margin: 16px 0 8px;
}
.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.theme-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sw, #313338);
  border: 3px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.theme-swatch.active { border-color: #fff; }
.ss-wall-row { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.ss-wall-preview {
  width: 160px;
  height: 90px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.ss-wall-preview.has-img { border-color: var(--brand); }
.boost-nav { color: var(--pink) !important; font-weight: 700 !important; }
.boost-status-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(244,127,255,.15), rgba(88,101,242,.2));
  margin-bottom: 16px;
}
.boost-tier-big {
  font-size: 36px;
  font-weight: 800;
  color: var(--pink);
  min-width: 64px;
  text-align: center;
}
.boost-count-line { font-size: 16px; font-weight: 700; }
.boost-next { font-size: 13px; color: var(--text-faint); margin-top: 2px; }
.boost-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.boost-tier-card {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,.06);
  opacity: .55;
}
.boost-tier-card.unlocked {
  opacity: 1;
  border-color: var(--pink);
  box-shadow: 0 0 0 1px rgba(235,69,158,.25);
}
.btc-lvl { font-weight: 700; font-size: 14px; }
.btc-need { font-size: 12px; color: var(--text-faint); margin: 2px 0 8px; }
.boost-tier-card ul {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.boost-buy-row { display: flex; flex-wrap: wrap; gap: 8px; }
.boost-cta-lg {
  background: linear-gradient(90deg, #f47fff, #5865f2) !important;
  border: none;
  font-weight: 700;
}
.boost-pay-card { width: min(400px, 100%); }
.boost-pay-head { text-align: center; margin-bottom: 12px; }
.boost-pay-logo { font-size: 40px; margin-bottom: 4px; }
.boost-pay-plan {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  margin-bottom: 14px;
  text-align: center;
}
.bpp-name { font-weight: 700; }
.bpp-price { font-size: 28px; font-weight: 800; margin: 4px 0; color: var(--pink); }
.bpp-period { font-size: 12px; color: var(--text-faint); }
@media (max-width: 760px) {
  .boost-tiers { grid-template-columns: 1fr; }
  .tiles.circle-mode { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

/* Members — Discord-style right rail */
.members {
  width: var(--members-w);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 2;
}
.members-panel-head {
  flex-shrink: 0;
  padding: 16px 12px 10px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.members-panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--channels-default);
  margin-bottom: 6px;
}
.members-total {
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  font-weight: 600;
}
.members-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.members-stats .ms-online { color: var(--green); font-weight: 600; }
.members-stats .ms-voice { color: var(--text-muted); }
.members-stats .ms-sep { opacity: 0.5; }
.members-filter {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-normal);
  font-size: 13px;
}
.members-filter::placeholder { color: var(--text-faint); }
.members-filter:focus { outline: 1px solid var(--brand); }
.members-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.members-head, .role-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 8px 2px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--channels-default);
  user-select: none;
}
.role-head:first-child { padding-top: 10px; }
.role-head.offline-head {
  color: #6d6f78;
  margin-top: 8px;
  opacity: 0.95;
}
.role-head.offline-head .role-title { color: #6d6f78 !important; }
.role-head.online-head .role-title { color: var(--green); }
.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.95;
}
.role-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.role-count {
  color: var(--text-faint);
  font-weight: 600;
  flex-shrink: 0;
}
.member-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 20px;
}
.members-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
}
.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  color: var(--text-muted);
  transition: background 0.1s, opacity 0.1s;
}
.member-item:hover {
  background: var(--bg-modifier-hover);
  color: var(--text-normal);
}
.member-item.is-self {
  background: rgba(88, 101, 242, 0.08);
}
.member-item.is-self:hover {
  background: rgba(88, 101, 242, 0.14);
}
.member-item.is-host .member-name {
  font-weight: 600;
}
.member-item.is-offline {
  opacity: 0.45;
}
.member-item.is-offline:hover {
  opacity: 0.75;
}
.member-item.in-voice .member-sub.sub-voice {
  color: var(--green);
}
.member-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}
.member-av {
  width: 32px !important;
  height: 32px !important;
  font-size: 12px !important;
}
.member-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-secondary);
  background: var(--green);
  z-index: 1;
  box-sizing: border-box;
}
.member-status.online { background: var(--green); }
.member-status.idle { background: var(--yellow); }
.member-status.dnd { background: var(--red); }
.member-status.invisible,
.member-status.offline {
  background: #80848e;
  box-shadow: inset 0 0 0 2px var(--bg-secondary);
}
.member-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-content: center;
}
.member-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.member-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.you-tag {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  margin-left: 2px;
}
.crown {
  font-size: 12px;
  flex-shrink: 0;
  line-height: 1;
  filter: drop-shadow(0 0 2px rgba(250, 166, 26, 0.5));
}
.member-sub {
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-faint);
  min-height: 14px;
}
.member-sub.empty { min-height: 0; }
.member-sub.sub-activity { color: var(--green); }
.member-sub.sub-custom { color: var(--text-muted); }
.member-sub.sub-voice { color: var(--green); }
.member-sub.sub-host { color: var(--gold); font-weight: 500; }
.member-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0.9;
}
.member-item:not(:hover) .member-icons .mi:not(.mi-mute):not(.mi-deaf):not(.mi-stream) {
  opacity: 0.85;
}
.mi {
  font-size: 12px;
  line-height: 1;
  width: 16px;
  text-align: center;
}
.mi-mute, .mi-deaf, .mi-to { filter: grayscale(0.2); }
.mi-boost { color: var(--pink); }
.member-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 1px;
}
.badge, .member-flags span {
  font-size: 10px;
  font-weight: 600;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--bg-modifier-active);
  color: var(--text-faint);
  line-height: 16px;
}
.badge.mute, .badge.deaf { color: var(--red); }
.badge.share { color: var(--green); }
.host-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 3px;
  background: linear-gradient(135deg, #faa61a, #f04747);
  color: #fff;
  margin-left: 4px;
  vertical-align: middle;
}
.user-panel.is-host .user-panel-name::after {
  content: " 👑";
  font-size: 11px;
}

/* ── Discord user popout (from Карточка.txt structure) ── */
.profile-scrim {
  position: fixed;
  inset: 0;
  z-index: 520;
  background: transparent;
  cursor: default;
}
.dc-pop,
.profile-pop.dc-pop {
  position: fixed;
  z-index: 530;
  width: min(300px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(92vh, 640px);
  display: flex;
  flex-direction: column;
  background: #111214;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  animation: pop 0.12s var(--ease);
  left: auto;
  top: auto;
  transform: none;
  /* layout only — paint contain freezes GIF avatars/banners */
  contain: layout style;
}
/* Override: allow animated media to paint freely inside pop */
.dc-pop .av-img,
.dc-pop .banner-gif-live,
.dc-pop .av-anim {
  contain: none !important;
}
.dc-pop[hidden] { display: none !important; }
.dc-pop-close-x {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  z-index: 5;
  opacity: 0;
  transition: opacity .12s;
}
.dc-pop:hover .dc-pop-close-x { opacity: 1; }
.dc-pop-close-x:hover { background: rgba(0, 0, 0, 0.7); }

.dc-pop-header { position: relative; flex-shrink: 0; }
.dc-pop-banner-wrap { position: relative; height: 105px; overflow: hidden; }
.dc-pop-banner {
  position: relative;
  width: 100%;
  height: 105px;
  min-height: 105px;
  background: #5865f2;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  contain: none !important;
}
/* Photo/GIF banner — img layer (never freeze under host gradient) */
.dc-pop-banner.has-banner-gif,
.dc-pop-banner.has-img {
  background-image: none !important;
}
.dc-pop-banner.has-banner-gif > img,
.dc-pop-banner.has-img > img,
#profileBanner > img.banner-gif-live,
#profileBanner > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  z-index: 0 !important;
}
.dc-pop-banner.host-banner:not(.has-banner-gif):not(.has-img) {
  background-image: linear-gradient(135deg, #f04747, #faa61a) !important;
}
.dc-pop-banner-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 3;
}
.dc-pop-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
}
.dc-pop-icon-btn:hover { background: rgba(0, 0, 0, 0.75); }
.dc-pop-icon-btn[hidden] { display: none !important; }

/* Avatar sits on banner cutout like Discord */
.dc-pop-avatar-outer {
  position: absolute;
  left: 16px;
  bottom: -40px;
  z-index: 2;
}
.dc-pop-avatar-ring {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #111214;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 0 transparent;
}
.dc-pop-avatar-ring .profile-av,
#profileAvatar.avatar.lg {
  width: 80px !important;
  height: 80px !important;
  font-size: 28px !important;
  border: none !important;
  border-radius: 50%;
  overflow: hidden;
  box-sizing: border-box;
}
.dc-pop-status {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid #111214;
  box-sizing: border-box;
  background: #23a559;
  z-index: 3;
}
.dc-pop-status.online { background: #23a559; }
.dc-pop-status.idle { background: #f0b232; }
.dc-pop-status.dnd { background: #f23f43; }
.dc-pop-status.invisible,
.dc-pop-status.offline { background: #80848e; }

.dc-pop-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 52px 16px 12px;
  scrollbar-width: thin;
}
.dc-pop-card {
  background: #1e1f22;
  border-radius: 8px;
  padding: 12px;
}
.dc-pop-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dc-pop-displayname {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: #f2f3f5;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1;
}
.dc-pop-displayname .crown { display: none; } /* crown only in badges — no duplicate */
.dc-pop-badges {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.dc-pop-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 4px;
  background: #2b2d31;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06);
}
.dc-pop-badge.crown-badge { font-size: 13px; background: rgba(240,178,50,.12); }
.dc-pop-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.dc-pop-username {
  font-size: 14px;
  color: #dbdee1;
  font-weight: 500;
}
.dc-pop-pronouns {
  font-size: 12px;
  color: #b5bac1;
}
.dc-pop-pronouns:not([hidden])::before { content: "· "; color: #4e5058; }
.dc-pop-server-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #2b2d31;
  font-size: 11px;
  font-weight: 700;
  color: #dbdee1;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.dc-pop-server-tag[hidden],
.dc-pop-pronouns[hidden],
.dc-pop-badges[hidden] { display: none !important; }
.dc-pop-custom-status {
  margin-top: 8px;
  font-size: 14px;
  color: #dbdee1;
  line-height: 1.3;
}
.dc-pop-custom-status[hidden] { display: none !important; }
.dc-pop-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 12px 0;
}
.dc-pop-section { margin-bottom: 14px; }
.dc-pop-section:last-child { margin-bottom: 0; }
.dc-pop-section[hidden] { display: none !important; }
.dc-pop-section-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #b5bac1;
}
.dc-pop-about {
  font-size: 14px;
  color: #dbdee1;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.dc-pop-about a { color: #00a8fc; text-decoration: none; }
.dc-pop-about a:hover { text-decoration: underline; }

.dc-pop-activity {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: #2b2d31;
  border-radius: 8px;
}
.dc-pop-activity-icon {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: #1e1f22;
  display: grid;
  place-items: center;
  font-size: 28px;
  flex-shrink: 0;
}
.dc-pop-activity-head {
  font-size: 12px;
  font-weight: 600;
  color: #f2f3f5;
  margin-bottom: 2px;
}
.dc-pop-activity-name {
  font-size: 14px;
  font-weight: 600;
  color: #dbdee1;
}
.dc-pop-voice {
  font-size: 14px;
  color: #23a559;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dc-pop-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.dc-pop-roles .role-pill,
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #3f4147;
  background: transparent;
  color: #dbdee1;
  line-height: 1.2;
  max-width: 100%;
}
.role-pill.muted { color: #b5bac1; border-color: #3f4147; }
.role-pill .role-dot,
.role-pill i.role-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  font-style: normal;
  flex-shrink: 0;
}
.dc-pop-note {
  font-size: 13px;
  color: #b5bac1;
  padding: 8px 10px;
  background: #2b2d31;
  border-radius: 4px;
  line-height: 1.35;
  white-space: pre-wrap;
}
.dc-pop-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.dc-pop-actions[hidden] { display: none !important; }
.dc-pop-actions .btn { width: 100%; justify-content: center; height: 32px; font-size: 13px; }

/* footer message like Discord */
.dc-pop-footer {
  flex-shrink: 0;
  padding: 0 16px 16px;
  background: #111214;
}
.dc-pop-msgbox {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1e1f22;
  border-radius: 8px;
  padding: 0 4px 0 12px;
  min-height: 44px;
  border: 1px solid transparent;
}
.dc-pop-msgbox:focus-within { border-color: #5865f2; }
.dc-pop-msg-input {
  flex: 1;
  min-width: 0;
  height: 40px !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #dbdee1;
  font-size: 14px;
  padding: 0 !important;
}
.dc-pop-msg-input::placeholder { color: #6d6f78; }
.dc-pop-msg-send {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  color: #b5bac1;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.dc-pop-msg-send:hover { color: #fff; background: rgba(255,255,255,.06); }
.dc-pop-footer[hidden] { display: none !important; }

.danger-text { color: var(--red) !important; }
.danger-text:hover { background: var(--red-soft) !important; }

/* legacy profile class aliases */
.profile-pop { /* handled by .dc-pop */ }
.profile-close { display: none; }

/* Discord server settings (windowed; user settings use .usettings-modal overrides) */
.dsettings-modal:not(.usettings-modal) {
  place-items: center;
  padding: 24px;
}
.dsettings-modal:not(.usettings-modal) .modal-backdrop { background: rgba(0, 0, 0, 0.75); }
.dsettings {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  width: min(960px, calc(100vw - 48px));
  height: min(720px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  margin: 0 auto;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: pop 0.15s var(--ease);
}
.dsettings-nav {
  background: var(--bg-secondary);
  padding: 60px 8px 20px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dsettings-nav-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  padding: 0 10px 8px;
}
.ss-nav-item {
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  width: 100%;
}
.ss-nav-item:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.ss-nav-item.active { background: var(--bg-modifier-active); color: var(--text-normal); }
.ss-nav-item.danger { color: var(--red); margin-top: auto; }
.dsettings-nav-foot { margin-top: auto; padding-top: 16px; }
.dsettings-main {
  position: relative;
  padding: 60px 40px 40px;
  overflow-y: auto;
  background: var(--bg-primary);
}
.dsettings-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--text-faint);
  color: var(--text-faint);
  font-size: 16px;
  display: grid;
  place-items: center;
}
.dsettings-close:hover { color: var(--text-normal); border-color: var(--text-normal); }
.ss-panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}
.ss-hint {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-faint);
  line-height: 1.4;
  max-width: 480px;
}
.ss-micro {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-faint);
}
.ss-icon-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.ss-icon {
  width: 80px !important;
  height: 80px !important;
  border-radius: 16px !important;
  font-size: 28px !important;
  border: none !important;
}
.ss-roles-list, .ss-bans-list, .ss-emoji-list, .ss-channels-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.ss-channels-list {
  max-height: min(60vh, 520px);
  overflow: auto;
  padding-right: 4px;
}
.ss-channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ss-channel-row .ss-ch-meta {
  flex: 1;
  min-width: 0;
}
.ss-channel-row .ss-ch-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-channel-row .ss-ch-kind {
  font-size: 11px;
  opacity: 0.65;
  margin-top: 2px;
}
.ss-channel-row .ss-ch-del {
  flex-shrink: 0;
}
.ss-channel-row.is-locked {
  opacity: 0.55;
}
.ss-roles-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 16px;
  margin-top: 8px;
  min-height: 360px;
  max-height: min(70vh, 640px);
}
.ss-roles-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.ss-roles-side .ss-roles-list {
  margin-top: 0;
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding-right: 4px;
}
.ss-roles-editor {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 14px 16px;
  overflow: auto;
  min-height: 0;
  border: 1px solid rgba(255,255,255,.06);
}
.ss-role-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ss-role-edit-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.ss-subh {
  margin: 16px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.ss-role-perms, .ss-role-perms.role-checks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: none;
}
.ss-perm-group-title {
  margin: 12px 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.ss-perm-row .us-toggle-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.ss-perm-hint {
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.3;
}
.ss-perm-row.danger-perm .us-toggle-title {
  color: #ed4245;
}
.ss-role-row, .ss-ban-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
.ss-ban-row { cursor: default; }
.ss-ban-meta { flex: 1; min-width: 0; }
.ss-ban-reason {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
button.ss-role-row:hover {
  background: var(--bg-modifier-hover, rgba(255,255,255,.04));
}
button.ss-role-row.active {
  border-color: var(--brand, #5865f2);
  background: rgba(88, 101, 242, 0.12);
}
.ss-role-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-role-pos { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.modal-card-wide {
  width: min(560px, 94vw);
  max-height: min(88vh, 720px);
  overflow: auto;
}
@media (max-width: 720px) {
  .ss-roles-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }
}

/* Channel settings / invite extras / a11y */
.invite-advanced {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invite-net {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invite-net-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}
.invite-net-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invite-net-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-secondary, rgba(0,0,0,.2));
  border: 1px solid rgba(255,255,255,.06);
}
.invite-net-row.porthole {
  border-color: rgba(88, 101, 242, 0.45);
  background: rgba(88, 101, 242, 0.08);
}
.invite-net-row.porthole .invite-net-tag { color: #a5b4fc; }
.invite-net-note {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.invite-net-row.radmin {
  border-color: rgba(59, 165, 93, 0.45);
  background: rgba(59, 165, 93, 0.08);
}
.invite-net-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.invite-net-tag {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.invite-net-row.radmin .invite-net-tag { color: #3ba55d; }
.invite-net-ip { font-size: 12px; color: var(--text-normal); }
.invite-net-link {
  width: 100%;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.08);
  background: var(--bg-tertiary, #1e1f22);
  color: var(--text-muted);
}
.invite-net-row .btn { align-self: flex-start; margin-top: 2px; }
.invite-adv-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.invite-extra-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow: auto;
}
.invite-extra-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.invite-extra-row code {
  font-size: 11px;
  background: var(--bg-tertiary, rgba(0,0,0,.25));
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-normal);
}
.inline-edit-ta {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  background: var(--bg-tertiary, #1e1f22);
  border: 1px solid var(--brand, #5865f2);
  border-radius: 6px;
  color: var(--text-normal, #dbdee1);
  padding: 8px 10px;
  font: inherit;
  line-height: 1.375;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
body.ui-reduce-motion *,
body.ui-reduce-motion *::before,
body.ui-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
body.ui-high-contrast .sidebar,
body.ui-high-contrast .channels,
body.ui-high-contrast .members,
body.ui-high-contrast .chat-log,
body.ui-high-contrast .modal-card,
body.ui-high-contrast .dsettings {
  outline: 1px solid rgba(255,255,255,.22);
}
body.ui-high-contrast .channel,
body.ui-high-contrast .member-item,
body.ui-high-contrast .us-row {
  border: 1px solid rgba(255,255,255,.08);
}
.ss-emoji-list {
  flex-direction: row;
  flex-wrap: wrap;
}
.ss-emoji-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-faint);
  width: 72px;
}
.ss-emoji-item img { width: 40px; height: 40px; object-fit: contain; }
.ss-empty { color: var(--text-faint); font-size: 14px; padding: 12px 0; }
.ss-locked { opacity: 0.45; pointer-events: none; }

@media (max-width: 760px) {
  .dsettings-modal:not(.usettings-modal) .dsettings {
    grid-template-columns: 1fr;
    height: min(92vh, 640px);
    border-radius: 12px;
    width: min(100%, calc(100vw - 24px));
  }
  .dsettings-modal:not(.usettings-modal) .dsettings-nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 48px 8px 8px;
    max-height: 120px;
  }
  .dsettings-modal:not(.usettings-modal) .dsettings-main { padding: 24px 16px 40px; }
  .profile-pop, .dc-pop { width: min(300px, 92vw); }
}

/* Home */
.view-home {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg-primary);
}
.home-wrap { max-width: 1000px; margin: 0 auto; padding: 24px 20px 48px; }
.home-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.home-sub { margin: 0 0 20px; color: var(--text-faint); font-size: 14px; }
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr .9fr;
  gap: 16px;
}
.home-col {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 200px;
}
.home-sec-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--channels-default);
}
.home-friends, .dm-list, .home-guilds {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
  overflow-y: auto;
}
.home-friend, .dm-item, .home-guild-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-align: left;
}
.home-friend:hover, .dm-item:hover, .home-guild-item:hover {
  background: var(--bg-modifier-hover);
  color: var(--text-normal);
}
.home-friend-name, .dm-name { font-size: 14px; font-weight: 600; }
.home-friend-sub, .dm-preview {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-friend-meta, .dm-meta { min-width: 0; flex: 1; }
.home-guild-item .g-ico {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.dm-chat {
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}
.dm-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 700;
}
.dm-log, .thread-log {
  flex: 1;
  overflow-y: auto;
  max-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 10px;
}
.dm-msg, .thread-msg { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.dm-msg .n, .thread-msg .n { font-weight: 700; color: var(--text-normal); margin-right: 6px; }
.dm-msg.own .n, .thread-msg.own .n { color: var(--brand); }
.dm-form, .thread-form { display: flex; gap: 8px; }
.dm-form input, .thread-form input {
  flex: 1;
  height: 36px;
  background: var(--bg-input);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 10px;
}

/* Polls / embeds / stickers in chat */
.poll-card {
  margin-top: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  max-width: 400px;
}
.poll-q { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.poll-opt {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-modifier-hover);
  color: var(--text-muted);
  text-align: left;
  position: relative;
  overflow: hidden;
  font: inherit;
  font-size: 13px;
  border: none;
  cursor: pointer;
}
.poll-opt:hover { color: var(--text-normal); }
.poll-opt.mine { outline: 1px solid var(--brand); }
.poll-bar {
  position: absolute; inset: 0 auto 0 0;
  background: var(--brand-soft);
  z-index: 0;
  transition: width .25s;
}
.poll-opt-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.poll-actions { margin-top: 4px; }
.poll-actions button {
  font-size: 12px;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
}
.thread-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--bg-modifier-hover);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-link);
  border: none;
  cursor: pointer;
  font: inherit;
}
.thread-badge:hover { background: var(--bg-modifier-active); }
.thread-sub { font-size: 12px; color: var(--text-faint); margin: 2px 0 0; }
.embed-card {
  display: flex;
  margin-top: 6px;
  max-width: 420px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(0,0,0,.15);
}
.embed-bar { width: 4px; flex-shrink: 0; background: var(--brand); }
.embed-body { padding: 8px 12px; }
.embed-title { font-weight: 600; font-size: 14px; color: var(--text-link); }
.embed-desc { font-size: 12px; color: var(--text-faint); margin-top: 2px; word-break: break-all; }
.chat-sticker { max-width: 160px; max-height: 160px; margin-top: 6px; border-radius: 6px; }
.forum-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.forum-tag {
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
}
.webhook-badge {
  font-size: 10px; font-weight: 800; background: var(--bg-accent);
  color: var(--text-faint); padding: 0 5px; border-radius: 3px; margin-left: 4px;
}
.event-card {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin: 0 12px 8px;
}
.event-title { font-weight: 700; margin-bottom: 4px; }
.event-meta { font-size: 12px; color: var(--text-faint); margin-bottom: 6px; }
.event-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.event-actions { display: flex; gap: 8px; }
.event-actions button {
  font-size: 12px; padding: 4px 10px; border-radius: 4px;
  background: var(--bg-modifier-hover); color: var(--text-muted); border: none; cursor: pointer;
}
.event-actions button:hover { background: var(--brand); color: #fff; }

/* Modals / drawers — always centered, never spill off-screen */
.modal, .drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}
.modal:not([hidden]) {
  /* ensure backdrop + card stack inside viewport */
  box-sizing: border-box;
}
.modal-backdrop, .drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
}
.modal-card, .drawer-card, .settings-card, .help-card, .invite-card {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  max-height: min(90vh, 720px);
  overflow: auto;
  overflow-wrap: anywhere;
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-lg);
  animation: pop .15s var(--ease);
  box-sizing: border-box;
  border: 1px solid var(--border-subtle);
}
.drawer { place-items: stretch end; padding: 0; }
.drawer-card {
  width: min(400px, 100%);
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
  flex-shrink: 0;
}
.drawer-head h3, .modal-card h3, .settings-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
}
.settings-card { width: min(520px, 100%); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.settings-head {
  padding: 16px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.settings-sub { font-size: 12px; color: var(--text-faint); }
.settings-scroll {
  padding: 8px 16px 16px;
  overflow-y: auto;
  max-height: 60vh;
}
.settings-section { margin: 16px 0; }
.settings-section h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text-muted);
}
.role-mgmt { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.role-mgmt-title { margin: 8px 0 0 !important; }
.role-mgmt-hint { margin: 0; font-size: 12px; color: var(--text-faint); }
.role-checks { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.boost-cta { width: 100%; margin-top: 8px; }

/* Invite friends — floating pop (Discord-style) */
.invite-pop-modal {
  place-items: center !important;
  z-index: 460 !important;
}
.invite-card {
  text-align: left;
  width: min(420px, 100%) !important;
  padding: 0 !important;
  overflow: hidden;
  animation: pe-pop .22s var(--ease) both;
}
.invite-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.invite-head h3 { margin: 0; font-size: 18px; }
.invite-logo img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: block;
  animation: brand-pulse 3s ease-in-out infinite;
}
.invite-sub { color: var(--text-faint); font-size: 13px; margin: 4px 0 0; }
.invite-server-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 18px 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
}
.invite-server-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.invite-server-icon.has-img { color: transparent; }
.invite-server-name { font-weight: 700; font-size: 16px; color: #f2f3f5; }
.invite-server-hint { font-size: 12px; color: #949ba4; margin-top: 2px; }
.invite-field {
  display: block;
  padding: 8px 18px;
}
.invite-field > span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #b5bac1;
  margin-bottom: 6px;
}
.invite-code-row,
.invite-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.invite-code-row input,
.invite-link-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  background: #1e1f22 !important;
  border: none !important;
  border-radius: 4px;
  color: #dbdee1;
  padding: 0 10px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}
.invite-code {
  letter-spacing: .06em;
  font-weight: 700;
  text-transform: uppercase;
}
.invite-qr-wrap {
  text-align: center;
  padding: 8px 18px 20px;
}
.invite-qr {
  width: 180px;
  height: 180px;
  margin: 0 auto 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.invite-qr-hint {
  margin: 0;
  font-size: 12px;
  color: #949ba4;
}
.invite-box.legacy-hidden { display: none !important; }

/* Invite pop — docks above user panel (where Code/QR were) */
.invite-sidebar-pop {
  flex-shrink: 0;
  margin: 0 8px 8px;
  padding: 10px;
  background: #1e1f22;
  border: 1px solid rgba(88, 101, 242, 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  animation: voice-slide-in .22s var(--ease) both;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  z-index: 5;
}
.invite-sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.invite-sidebar-logo {
  border-radius: 8px;
  flex-shrink: 0;
}
.invite-sidebar-titles { flex: 1; min-width: 0; }
.invite-sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: #f2f3f5;
}
.invite-sidebar-sub {
  font-size: 11px;
  color: #949ba4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.invite-sidebar-x {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #b5bac1;
  font-size: 14px;
}
.invite-sidebar-x:hover { background: rgba(255,255,255,.08); color: #fff; }
.invite-field.tight { padding: 4px 0; }
.invite-qr-wrap.tight { padding: 6px 0 0; }
.invite-sidebar-pop .invite-qr {
  width: 140px;
  height: 140px;
}
.invite-sidebar-pop .invite-server-row.compact {
  margin: 0 0 8px;
  padding: 8px;
}
.invite-sidebar-pop .invite-code-row .btn,
.invite-sidebar-pop .invite-link-row .btn {
  flex-shrink: 0;
  min-width: 64px;
}

/* Channel drag-and-drop */
.channel.ch-draggable { cursor: grab; }
.channel.ch-dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.channel.ch-drop-before {
  box-shadow: inset 0 2px 0 0 var(--brand);
}
.channel.ch-drop-after {
  box-shadow: inset 0 -2px 0 0 var(--brand);
}
.channel.ch-drop-peer {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  background: rgba(35, 165, 89, 0.12) !important;
}
.cat-head.cat-drop-over,
.cat-channels.cat-drop-over {
  outline: 2px dashed var(--brand);
  outline-offset: -2px;
  background: rgba(88, 101, 242, 0.08);
  border-radius: 6px;
}
body.ch-dnd-active .channel:not(.ch-dragging) {
  transition: box-shadow .08s ease, background .08s;
}
.vu-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.vu-draggable * {
  pointer-events: none; /* grab always hits the <li>, not avatar img */
}
.vu-dragging {
  opacity: 0.45;
  cursor: grabbing !important;
}
body.vu-dnd-active {
  cursor: grabbing !important;
  user-select: none;
}
body.vu-dnd-active .channel.voice-ch {
  transition: box-shadow 0.08s ease, background 0.08s;
}
.cat-empty {
  font-size: 12px;
  color: var(--text-faint);
  padding: 6px 10px;
  font-style: italic;
}
.help-grid { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.help-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.help-row kbd {
  min-width: 28px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  font-family: inherit;
  text-align: center;
  color: var(--text-normal);
}
.help-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.45;
}
.help-note code {
  background: var(--bg-tertiary);
  padding: 1px 4px;
  border-radius: 3px;
}
.audit-list, .bans-list, .pins-list, .events-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}
.ss-audit-list.audit-list {
  padding: 0;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}
.ss-audit-list .audit-item {
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.audit-item, .ban-item {
  padding: 10px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.audit-item .a-meta { font-size: 11px; color: var(--text-faint); margin-bottom: 2px; }
.dsettings-modal:not(.usettings-modal) { z-index: 400 !important; }
.dsettings-modal.usettings-modal { z-index: 410 !important; }
.drawer { z-index: 340; }
.ban-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ban-item button {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--red-soft);
  color: var(--red);
  border: none;
  cursor: pointer;
}
.thread-drawer .drawer-card { background: var(--bg-primary); }
.thread-drawer .thread-log { flex: 1; max-height: none; padding: 12px; }
.thread-form { padding: 12px; border-top: 1px solid rgba(0,0,0,.15); }

/* Context / status / toast */
.ctx-menu {
  position: fixed;
  z-index: 400;
  min-width: 188px;
  max-width: 280px;
  background: var(--bg-floating);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  box-shadow: var(--shadow-lg);
  animation: pop .1s var(--ease);
}
.ctx-menu button, .ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--text-muted);
}
.ctx-menu button:hover, .ctx-item:hover { background: var(--brand); color: #fff; }
.ctx-menu button.danger, .ctx-item.danger { color: #da373c; }
.ctx-menu button.danger:hover, .ctx-item.danger:hover { background: var(--red); color: #fff; }
.ctx-sep {
  height: 1px;
  margin: 4px 6px;
  background: rgba(255, 255, 255, 0.06);
}
.ctx-title, .ctx-head, .ctx-vol {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-normal);
}
.ctx-menu input[type="range"] {
  width: calc(100% - 16px);
  margin: 4px 8px 8px;
  accent-color: var(--brand);
  height: auto;
  background: transparent;
}

.status-picker {
  position: fixed;
  z-index: 350;
  min-width: 220px;
  background: var(--bg-floating);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.status-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  text-align: left;
  width: 100%;
}
.status-opt:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.status-opt .status-dot { position: static; border: none; width: 10px; height: 10px; }
.status-picker-sep {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 6px 0;
}
.status-custom-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px 8px;
  font-size: 11px;
  color: var(--text-faint);
}
.status-custom-field input {
  height: 32px;
  background: var(--bg-input);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-size: 13px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.9);
  display: grid;
  place-items: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-floating);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 500;
  max-width: min(90vw, 400px);
  text-align: center;
  animation: vox-toast-in .18s var(--ease) both;
}

.remote-audio {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Command palette */
.cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 550;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: start center;
  padding-top: 12vh;
}
.cmd-card {
  width: min(520px, 92vw);
  background: var(--bg-floating);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop .15s var(--ease);
}
.cmd-card input, #cmdInput {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 15px;
}
.cmd-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  text-align: left;
}
.cmd-item:hover, .cmd-item.active { background: var(--brand); color: #fff; }
.cmd-item kbd { opacity: .7; font-size: 11px; }

/* Speaking — only voice list + tiles (never members rail) */
.voice-users li.speaking .avatar {
  box-shadow: 0 0 0 2px var(--speak-ring);
}
.tile.speaking .avatar {
  box-shadow: 0 0 0 2px var(--speak-ring);
}
/* hard block members panel speaking ring */
#peerList .member-item .avatar,
#peerList .member-item.speaking .avatar {
  box-shadow: none !important;
  animation: none !important;
}

/* ============================================================
   Motion — Discord-inspired keyframes (local names, no dump CSS)
   ============================================================ */
@keyframes vox-typing-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0) scale(0.9); }
  30% { opacity: 1; transform: translateY(-2px) scale(1); }
}
@keyframes vox-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes vox-speak-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--green), 0 0 12px rgba(35, 165, 89, .25); }
  50% { box-shadow: 0 0 0 4px var(--green), 0 0 22px rgba(35, 165, 89, .45); }
}
@keyframes vox-speak-ring {
  0%, 100% { box-shadow: 0 0 0 2px var(--speak-ring); }
  50% { box-shadow: 0 0 0 3px var(--speak-ring), 0 0 8px rgba(35, 165, 89, .4); }
}
@keyframes vox-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes vox-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes vox-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes vox-spin {
  to { transform: rotate(1turn); }
}
@keyframes vox-pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes vox-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes vox-unread-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
@keyframes vox-inbox-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(88, 101, 242, 0); }
}

/* Utility motion classes */
.vox-fade-in { animation: vox-fade-in .18s var(--ease) both; }
.vox-slide-up { animation: vox-slide-up .2s var(--ease) both; }
.vox-spin {
  animation: vox-spin .8s linear infinite;
  display: inline-block;
}
.vox-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: vox-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.vox-pulse { animation: vox-pulse-soft 1.4s ease-in-out infinite; }

/* Unread badge pulse */
.unread-dot:not(.voice-count) {
  animation: vox-unread-pulse 2s ease-in-out infinite;
}
.guild-unread {
  animation: vox-inbox-pulse 2s ease-out infinite;
}

/* Connecting / busy */
.pill.connecting,
.pill.bad {
  animation: vox-pulse-soft 1.2s ease-in-out infinite;
}
body.is-connecting .auth-card::after,
body.is-connecting .lobby-card::after {
  content: "";
  display: block;
  height: 3px;
  margin: 12px -32px -32px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  background-size: 200% 100%;
  animation: vox-shimmer 1s linear infinite;
}

/* Empty / loading skeletons */
.chat-empty .chat-empty-ico {
  animation: vox-pulse-soft 2s ease-in-out infinite;
}
.jump-bottom {
  animation: vox-slide-up .2s var(--ease) both;
}

/* Profile / modal already use pop — strengthen */
.dc-pop:not([hidden]),
.profile-pop:not([hidden]) {
  animation: pop .14s var(--ease) both;
}
/* Server settings only — user settings use pe-pop via .usettings rules above */
.dsettings-modal:not(.usettings-modal):not([hidden]) .dsettings {
  animation: pop .16s var(--ease) both;
}

/* Reaction hover micro bounce */
.reaction:active {
  transform: scale(0.92);
  transition: transform .1s var(--ease);
}
.msg-actions button:active {
  transform: scale(0.9);
}

/* Reduced motion — respect system setting */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .typing-dots i,
  .tile.speaking .tile-ring,
  .voice-users li.speaking .avatar,
  .unread-dot,
  .guild-unread,
  .vox-shimmer,
  .vox-spin,
  .vox-pulse,
  .chat-empty .chat-empty-ico {
    animation: none !important;
  }
  .chat-msg.msg-in {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* Responsive */
@media (max-width: 1100px) {
  .app { grid-template-columns: var(--guild-w) var(--sidebar-w) minmax(0, 1fr); }
  .members {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 40;
    transform: translateX(100%);
    transition: transform .2s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .members.open { transform: translateX(0); }
  .mobile-only { display: inline-flex !important; }
  .topbar-sub, .topbar-sep, .topbar-topic { display: none; }
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: var(--guild-w) minmax(0, 1fr); }
  .channels {
    position: fixed;
    top: 0; left: var(--guild-w); bottom: 0;
    z-index: 35;
    transform: translateX(-110%);
    transition: transform .2s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .channels.open { transform: translateX(0); }
  .chat-form { margin: 0 8px 12px; }
  .pill, .ping-ms, #leaveBtn { display: none; }
  .chat-msg { padding-right: 12px; }
  .landing-nav-actions .btn-ghost { display: none; }
  .hero-cta { flex-direction: column; align-items: stretch; }
}
