:root {
  --rail-width: 72px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --bg: #1e1f22;
  --bg-elevated: #2b2d31;
  --bg-soft: #313338;
  --bg-subtle: #232428;
  --line: rgba(255, 255, 255, 0.06);
  --text: #f2f3f5;
  --muted: #b5bac1;
  --low: #949ba4;
  --accent: #5865f2;
  --accent-soft: rgba(88, 101, 242, 0.16);
  --success: #23a55a;
  --danger: #f23f43;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

html,
body {
  min-height: 100%;
  min-height: 100dvh;
}

@supports (-webkit-touch-callout: none) {
  html,
  body {
    min-height: -webkit-fill-available;
  }
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(88, 101, 242, 0.24), transparent 42%),
    radial-gradient(circle at bottom right, rgba(0, 168, 252, 0.14), transparent 34%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 95%);
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-width) 280px minmax(0, 1fr) 260px;
  min-height: 100vh;
  min-height: 100dvh;
}

.server-rail,
.channel-panel,
.member-panel {
  border-right: 1px solid var(--line);
}

.server-rail {
  position: relative;
  padding: max(14px, var(--safe-top)) 10px max(14px, var(--safe-bottom));
  background: rgba(19, 20, 22, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 0;
}

.rail-home,
.server-button {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-radius 180ms ease,
    background 160ms ease;
}

.rail-home {
  background: linear-gradient(135deg, var(--accent), #7b84f7);
  box-shadow: 0 10px 26px rgba(88, 101, 242, 0.28);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: inherit;
}

.rail-home:hover,
.rail-tool:hover,
.server-button:hover,
.chat-header-right button:hover,
.composer button:hover {
  transform: translateY(-1px);
}

.server-button:hover,
.server-button.is-active {
  border-radius: 14px;
}

.server-button::before {
  content: "";
  position: absolute;
  left: -16px;
  width: 4px;
  height: 0;
  border-radius: 999px;
  background: white;
  transition: height 160ms ease;
}

.server-button:hover::before {
  height: 18px;
}

.server-button.is-active::before {
  height: 36px;
}

.server-button.is-active {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent), white 22%));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent), transparent 72%);
}

.server-button span,
.chat-header-right button,
.composer button {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.rail-tool {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  transition:
    transform 160ms ease,
    border-radius 180ms ease,
    background 160ms ease;
}

.rail-tool--join {
  background: rgba(35, 165, 90, 0.2);
  color: #66d18f;
}

.rail-tool--create {
  background: rgba(88, 101, 242, 0.22);
  color: #b7bcff;
}

.rail-tool--dm {
  background: rgba(250, 204, 21, 0.16);
  color: #facc6a;
  font-size: 1.15rem;
}

.rail-tool.is-active {
  outline: 2px solid color-mix(in srgb, var(--accent), white 28%);
  outline-offset: 2px;
}

.server-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  align-items: center;
}

.channel-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(42, 43, 48, 0.97) 0%, rgba(35, 36, 40, 0.94) 100%);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.workspace-header,
.member-header {
  min-height: 60px;
  padding: max(0px, var(--safe-top)) 16px 0;
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.workspace-header h1,
.member-header h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--low);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-header-right button,
.mobile-toggle,
.composer button {
  background: var(--bg-subtle);
  color: var(--muted);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.mobile-toggle {
  width: 32px;
  height: 32px;
}

.channel-groups {
  flex: 1;
  min-height: 0;
  padding: 8px 10px max(16px, var(--safe-bottom));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.channel-section {
  margin-bottom: 12px;
}

.channel-section h3 {
  margin: 0 0 8px;
  padding: 0 8px;
  color: var(--low);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.channel-section--requests {
  padding: 10px 8px 12px;
  border-radius: 10px;
  background: rgba(250, 168, 26, 0.06);
  border: 1px solid rgba(250, 168, 26, 0.22);
  margin-bottom: 14px;
}

.channel-section--requests h3 {
  color: #f0b232;
}

.message-request-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.message-request-row:last-child {
  margin-bottom: 0;
}

.message-request-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.message-request-open:hover {
  background: rgba(255, 255, 255, 0.06);
}

.message-request-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.message-request-meta strong {
  font-size: 0.9rem;
}

.message-request-meta .dm-preview {
  font-size: 0.78rem;
  color: var(--low);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-button {
  width: 100%;
  border-radius: 10px;
  padding: 9px 10px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.channel-button span:first-child {
  color: var(--low);
  font-size: 1.1rem;
  font-weight: 700;
}

.channel-button small {
  margin-left: auto;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--low);
  font-size: 0.68rem;
  font-weight: 700;
}

.channel-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transform: translateX(2px);
}

.channel-button.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.channel-button.is-active span:first-child {
  color: color-mix(in srgb, var(--accent), white 35%);
}

.channel-voice-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-voice-glyph svg {
  display: block;
}

.channel-button--voice.channel-button.is-active .channel-voice-glyph {
  color: color-mix(in srgb, var(--accent), white 35%);
}

.channel-pill span svg {
  display: block;
  width: 1.15em;
  height: 1.15em;
}

.profile-card {
  position: relative;
  padding: 12px max(12px, var(--safe-right)) max(12px, var(--safe-bottom)) max(12px, var(--safe-left));
  padding-right: max(44px, var(--safe-right));
  background: rgba(17, 18, 20, 0.7);
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-settings-cog {
  position: absolute;
  top: 50%;
  right: max(8px, var(--safe-right));
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #b5bac1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.profile-settings-cog:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.profile-settings-cog svg {
  display: block;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  overflow: hidden;
  color: white;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-user {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.profile-copy {
  flex: 1;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.profile-name-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-badge {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.2;
}

.profile-badge--admin {
  color: #d9f2ff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.34), rgba(8, 145, 178, 0.42));
  border: 1px solid rgba(125, 211, 252, 0.34);
}

.profile-badge--owner {
  color: #f6e9a6;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.35), rgba(180, 83, 9, 0.45));
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.profile-status {
  display: block;
  color: var(--low);
  font-size: 0.8rem;
}

.profile-login-cta {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #95a9ff;
  text-decoration: none;
}

.profile-login-cta:hover {
  text-decoration: underline;
}

.profile-login-cta[hidden] {
  display: none !important;
}

.chat-panel {
  min-width: 0;
  min-height: 0;
  background: linear-gradient(165deg, rgba(36, 37, 42, 0.96) 0%, rgba(49, 51, 56, 0.88) 48%);
  display: flex;
  flex-direction: column;
}

.guest-signin-banner {
  flex-shrink: 0;
  padding: 10px max(18px, var(--safe-right)) 10px max(18px, var(--safe-left));
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.2), rgba(35, 165, 90, 0.12));
  border-bottom: 1px solid rgba(88, 101, 242, 0.35);
}

.guest-signin-banner[hidden] {
  display: none !important;
}

.guest-signin-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
}

.guest-signin-banner p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.guest-signin-banner a {
  color: #95a9ff;
  font-weight: 600;
}

.guest-signin-dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.guest-signin-dismiss:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.4);
}

.chat-header {
  min-height: 60px;
  padding: max(0px, var(--safe-top)) max(18px, var(--safe-right)) 0 max(18px, var(--safe-left));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.voice-toolbar {
  padding: 10px max(18px, var(--safe-right)) 12px max(18px, var(--safe-left));
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #2b2d31 0%, #26282c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.voice-toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.voice-ctl {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #4e5058;
  color: #f2f3f5;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  padding: 8px 16px;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.voice-ctl:hover {
  background: #5c5f66;
  border-color: rgba(255, 255, 255, 0.12);
}

.voice-ctl.is-active {
  background: color-mix(in srgb, #ed4245 42%, #3f4147);
  border-color: rgba(237, 66, 69, 0.55);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(237, 66, 69, 0.2);
}

.voice-ctl--screen.is-active {
  background: color-mix(in srgb, #23a559 38%, #3f4147);
  border-color: rgba(35, 165, 89, 0.5);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(35, 165, 89, 0.2);
}

.voice-encrypt {
  margin: 0 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6d7278;
  max-width: min(42ch, 100%);
  line-height: 1.35;
}

.voice-participants {
  padding: 10px max(18px, var(--safe-right)) 12px max(18px, var(--safe-left));
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}

.voice-participants-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.voice-participants-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--low);
}

.voice-participants-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.voice-participants-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-participants-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e8eaed;
  background: rgba(88, 101, 242, 0.18);
  border: 1px solid rgba(88, 101, 242, 0.35);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-participants-hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--low);
  line-height: 1.45;
}

.voice-activity {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.voice-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.voice-activity-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--low);
}

.voice-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.voice-activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.voice-activity-item--join {
  border-color: rgba(35, 165, 89, 0.28);
}

.voice-activity-item--leave {
  border-color: rgba(237, 66, 69, 0.25);
}

.voice-activity-event {
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #eef1f6;
}

.voice-activity-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 700px) {
  .voice-encrypt {
    margin-left: 0;
    flex-basis: 100%;
  }

  .chat-guide {
    margin-left: max(16px, var(--safe-left));
    margin-right: max(16px, var(--safe-right));
    padding: 18px;
  }

  .chat-guide-steps {
    grid-template-columns: 1fr;
  }
}

.voice-screen-dock {
  position: fixed;
  right: max(12px, var(--safe-right));
  bottom: max(12px, var(--safe-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.voice-screen-dock > * {
  pointer-events: auto;
}

.voice-local-screen,
.voice-remote-screen {
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  background: #0b0c0f;
}

.voice-local-screen {
  width: 200px;
  max-width: 38vw;
  aspect-ratio: 16 / 10;
}

.voice-remote-screen {
  width: min(720px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  aspect-ratio: 16 / 9;
}

.voice-local-screen-video,
.voice-remote-screen-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  vertical-align: middle;
  background: #000;
}

.message-head .message-author {
  font: inherit;
  font-weight: 800;
  color: var(--text);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
}

.message-head .message-author:hover:not(:disabled) {
  text-decoration: underline;
  color: color-mix(in srgb, var(--text), white 12%);
}

.message-head .message-author--plain {
  cursor: default;
  text-decoration: none;
}

.message-head .message-author--plain:hover {
  text-decoration: none;
  color: var(--text);
}

.member-row.member-row-card {
  cursor: pointer;
}

.user-card-popover-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.user-card-popover-root .user-card-popover {
  pointer-events: auto;
  position: fixed;
  z-index: 201;
  width: min(340px, calc(100vw - 24px));
  border-radius: 16px;
  overflow: hidden;
  background: #2b2d31;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #f2f3f5;
  font-family: inherit;
}

.user-card-popover--error {
  padding: 16px;
  color: #fecaca;
}

.user-card-loading {
  margin: 0;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.user-card-banner {
  height: 64px;
  width: 100%;
}

.user-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px 0;
  margin-top: -28px;
  position: relative;
  z-index: 2;
}

.user-card-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.user-card-icon-btn:hover {
  background: rgba(0, 0, 0, 0.65);
}

.user-card-icon-btn.is-active {
  background: color-mix(in srgb, #22c55e 35%, #111);
}

.user-card-body {
  padding: 0 16px 16px;
  position: relative;
}

.user-card-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin-top: -44px;
  margin-bottom: 8px;
}

.user-card-avatar-trigger {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 50%;
}

.user-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 800;
  font-size: 1.35rem;
  color: #fff;
  border: 4px solid #2b2d31;
  box-sizing: border-box;
}

.user-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-card-status {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #23a559;
  border: 3px solid #2b2d31;
  box-sizing: border-box;
}

.user-card-status.offline {
  background: #6d6f78;
}

.user-card-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.user-card-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-card-badge {
  margin-top: 1px;
}

.user-card-handle {
  margin: 2px 0 12px;
  font-size: 0.9rem;
  color: #b5bac1;
}

.user-card-mutual {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #b5bac1;
}

.user-card-mutual-stack {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.user-card-server-ico {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #404249;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  margin-right: -8px;
  border: 2px solid #2b2d31;
  box-sizing: border-box;
}

.user-card-mutual-none {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--low);
}

.user-card-msg-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e1f22;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.user-card-msg-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #f2f3f5;
  font: inherit;
  font-size: 0.9rem;
}

.user-card-msg-input::placeholder {
  color: #6d6f78;
}

.user-card-msg-input:focus {
  outline: none;
}

.user-card-emoji {
  border: none;
  background: transparent;
  color: #b5bac1;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
}

.user-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  pointer-events: auto;
}

.user-profile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 13, 0.8);
  backdrop-filter: blur(8px);
}

.user-profile-modal {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  border-radius: 26px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(360px, 1fr);
  background: #313338;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #f2f3f5;
}

.user-profile-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: none;
  background: rgba(17, 18, 22, 0.6);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}

.user-profile-close:hover {
  background: rgba(17, 18, 22, 0.8);
}

.user-profile-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, #3a3c46 0%, #353740 100%);
}

.user-profile-banner {
  min-height: 188px;
}

.user-profile-sidebar-body {
  padding: 0 20px 24px;
}

.user-profile-avatar-shell {
  position: relative;
  width: 140px;
  height: 140px;
  margin-top: -72px;
  margin-bottom: 18px;
}

.user-profile-avatar-large {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 2.5rem;
  font-weight: 900;
  border: 8px solid #353740;
  box-sizing: border-box;
  color: #fff;
}

.user-profile-avatar-large img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.user-profile-status {
  position: absolute;
  right: 6px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #23a559;
  border: 5px solid #353740;
  box-sizing: border-box;
}

.user-profile-status.offline {
  background: #6d6f78;
}

.user-profile-headline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(47, 49, 54, 0.92);
  color: #f5f7fa;
  font-size: 0.98rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.user-profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-profile-name {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1;
  font-weight: 900;
}

.user-profile-handle {
  margin: 6px 0 22px;
  color: #dbdee1;
  font-size: 1.12rem;
}

.user-profile-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.user-profile-primary,
.user-profile-secondary {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.user-profile-primary {
  background: linear-gradient(135deg, #6d7cff, #5865f2);
  color: #fff;
}

.user-profile-primary:hover {
  filter: brightness(1.06);
}

.user-profile-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #f2f3f5;
}

.user-profile-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
}

.user-profile-secondary:disabled {
  opacity: 0.78;
  cursor: default;
}

.user-profile-side-section + .user-profile-side-section {
  margin-top: 22px;
}

.user-profile-section-label {
  margin: 0 0 8px;
  color: #d7dadc;
  font-size: 0.95rem;
  font-weight: 800;
}

.user-profile-meta {
  margin: 0;
  color: #f2f3f5;
  font-size: 1.02rem;
}

.user-profile-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #2f3136;
}

.user-profile-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 28px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.user-profile-tab {
  border: none;
  background: transparent;
  color: #b8bbc0;
  padding: 0 0 14px;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.user-profile-tab.is-active {
  color: #fff;
  border-bottom-color: #fff;
}

.user-profile-panels {
  padding: 22px 28px 28px;
  overflow: auto;
}

.user-profile-panel[hidden] {
  display: none;
}

.user-profile-section + .user-profile-section {
  margin-top: 18px;
}

.user-profile-card {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile-card--muted {
  background: rgba(255, 255, 255, 0.04);
}

.user-profile-card-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.user-profile-card-text {
  margin: 0;
  color: #d0d4d7;
  line-height: 1.55;
}

.user-profile-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.user-profile-fact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-profile-fact-label {
  color: #a9afb8;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-profile-server-list {
  display: grid;
  gap: 12px;
}

.user-profile-server-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile-server-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #404249;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 900;
  color: #fff;
}

.user-profile-server-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.user-profile-server-copy strong {
  font-size: 1rem;
}

.user-profile-server-copy span {
  color: #b5bac1;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .user-profile-modal {
    grid-template-columns: 1fr;
    width: min(96vw, 720px);
    max-height: min(92vh, 920px);
  }

  .user-profile-sidebar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .user-profile-banner {
    min-height: 148px;
  }

  .user-profile-avatar-shell {
    width: 112px;
    height: 112px;
    margin-top: -56px;
  }

  .user-profile-avatar-large {
    width: 112px;
    height: 112px;
    font-size: 2rem;
  }
}

.chat-header-left,
.chat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.channel-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.channel-pill span {
  color: var(--low);
  font-size: 1.3rem;
}

.channel-topic {
  margin: 0;
  color: var(--low);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-right .mobile-toggle {
  width: 36px;
  height: 36px;
}

.header-call {
  width: auto;
  min-width: 56px;
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #248046;
  color: #fff;
  cursor: pointer;
  border: 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  transition:
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.header-call:hover {
  background: #1a6334;
  transform: translateY(-1px);
}

.header-call--end {
  background: #da373c;
  color: #fff;
}

.header-call--end:hover {
  background: #bc2f33;
}

.header-call--guide {
  background: rgba(255, 255, 255, 0.08);
  color: #eef1f6;
}

.header-call--guide:hover {
  background: rgba(255, 255, 255, 0.15);
}

.header-call--guide.is-active {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.9), rgba(123, 132, 247, 0.9));
  color: #fff;
}

.dm-hint {
  margin: 8px 12px 16px;
  color: var(--low);
  font-size: 0.88rem;
  line-height: 1.45;
}

.dm-actions {
  padding: 0 10px 12px;
}

.dm-add-friend {
  width: 100%;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 160ms ease;
}

.dm-add-friend:hover {
  background: rgba(88, 101, 242, 0.28);
}

.friend-request-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.12);
}

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

.friend-request-meta strong,
.friend-request-meta span {
  display: block;
}

.friend-request-meta span {
  font-size: 0.76rem;
  color: var(--low);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-request-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.friend-out-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.chip-btn {
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
  background: var(--bg-subtle);
  color: var(--muted);
}

.chip-btn--ok {
  background: rgba(35, 165, 90, 0.25);
  color: #86efac;
}

.chip-btn--muted {
  opacity: 0.85;
}

.dm-thread-btn .dm-thread-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.dm-thread-btn .dm-preview {
  font-size: 0.72rem;
  color: var(--low);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}

.channel-hero {
  margin: 20px 20px 8px;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(88, 101, 242, 0.18), transparent 62%),
    rgba(17, 18, 20, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
}

.hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent), white 24%));
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 14px 24px color-mix(in srgb, var(--accent), transparent 74%);
}

.hero-icon svg {
  width: 32px;
  height: 32px;
  opacity: 0.95;
}

.channel-hero h2,
.channel-hero p {
  margin: 0;
}

.channel-hero h2 {
  font-size: clamp(1.4rem, 2vw, 1.8rem);
}

.channel-hero p:last-child {
  margin-top: 6px;
  color: var(--muted);
  max-width: 62ch;
}

.message-feed {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 18px;
}

.chat-guide {
  margin: 8px 20px 0;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(88, 101, 242, 0.2), transparent 32%),
    linear-gradient(145deg, rgba(16, 18, 23, 0.92), rgba(30, 33, 40, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: var(--shadow);
}

.chat-guide-hero h3,
.chat-guide-hero p {
  margin: 0;
}

.chat-guide-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b9c0ff;
}

.chat-guide-kicker::before {
  content: "→";
  font-size: 0.95rem;
}

.chat-guide-hero h3 {
  font-size: clamp(1.45rem, 2.1vw, 2rem);
}

.chat-guide-hero p {
  margin-top: 10px;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.55;
}

.chat-guide-steps {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.chat-guide-step {
  position: relative;
  min-height: 180px;
  padding: 18px 18px 18px 52px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-guide-step strong,
.chat-guide-step p {
  display: block;
}

.chat-guide-step strong {
  font-size: 1rem;
}

.chat-guide-step p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.chat-guide-step-num {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.chat-guide-arrow {
  position: absolute;
  right: 16px;
  top: 14px;
  font-size: 1.5rem;
  color: color-mix(in srgb, var(--accent), white 28%);
  opacity: 0.92;
}

.chat-guide-step--servers {
  background:
    linear-gradient(145deg, rgba(250, 204, 21, 0.11), transparent 70%),
    rgba(255, 255, 255, 0.045);
}

.chat-guide-step--channels {
  background:
    linear-gradient(145deg, rgba(88, 101, 242, 0.16), transparent 72%),
    rgba(255, 255, 255, 0.045);
}

.chat-guide-step--messages {
  background:
    linear-gradient(145deg, rgba(35, 165, 90, 0.14), transparent 72%),
    rgba(255, 255, 255, 0.045);
}

.chat-guide-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-guide-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #eef1f6;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.chat-guide-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

.chat-guide-btn--primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent), white 18%));
  color: #fff;
}

.chat-guide-active .server-rail,
.chat-guide-active .channel-panel {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.chat-guide-active .server-rail::after,
.chat-guide-active .channel-panel::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--accent), white 20%);
  pointer-events: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent), transparent 75%);
}

.voice-room-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
  gap: 16px;
  margin: 8px 20px 0;
}

.voice-room-shell--chat-closed {
  grid-template-columns: 1fr;
}

.voice-room-stage,
.voice-room-text {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(135deg, rgba(88, 101, 242, 0.1), transparent 48%),
    rgba(16, 18, 23, 0.58);
  box-shadow: var(--shadow);
}

.voice-room-stage {
  padding: 22px;
}

.voice-room-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.voice-room-stage-head h3,
.voice-room-stage-head p,
.voice-room-text-head strong {
  margin: 0;
}

.voice-room-stage-head h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.voice-room-stage-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 56ch;
}

.voice-room-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: #a9bbff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.voice-room-toggle {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #f2f3f5;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.voice-room-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.voice-room-stage-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.voice-room-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.voice-room-card-label {
  display: inline-block;
  color: var(--low);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.voice-room-card strong,
.voice-room-card p {
  display: block;
}

.voice-room-card strong {
  margin-top: 12px;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1.3;
}

.voice-room-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.voice-room-join-btn,
.voice-room-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 16px;
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(135deg, #23a559, #2ecb72);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(35, 165, 89, 0.22);
}

.voice-room-join-btn:hover,
.voice-room-signin:hover {
  filter: brightness(1.05);
}

.voice-room-join-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.voice-room-text {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.voice-room-text-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.voice-room-text-head strong {
  display: block;
  color: #fff;
  font-size: 1rem;
}

.voice-room-text-count {
  color: var(--low);
  font-size: 0.78rem;
  font-weight: 700;
}

.voice-room-text-feed {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 6px 0 14px;
}

.voice-room-text-feed .message-group {
  padding-left: 18px;
  padding-right: 18px;
}

.empty-feed-msg {
  margin: 24px 20px;
  color: var(--low);
  line-height: 1.5;
  max-width: 52ch;
}

.feed-banner-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 20px 0;
  padding: 12px 12px 12px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(237, 66, 69, 0.14), rgba(237, 66, 69, 0.06));
  border: 1px solid rgba(237, 66, 69, 0.35);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
}

.feed-banner {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: #fecaca;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}

.feed-banner-dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.2);
  color: #fca5a5;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.feed-banner-dismiss:hover {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.message-group {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 20px;
  animation: feed-in 220ms ease;
}

.message-group:hover {
  background: rgba(255, 255, 255, 0.02);
}

.message-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.message-head strong {
  font-size: 0.97rem;
}

.message-time {
  color: var(--low);
  font-size: 0.76rem;
}

.message-body p {
  margin: 0;
  color: #dbdee1;
  line-height: 1.58;
}

.message-body p + p {
  margin-top: 8px;
}

.invite-embed {
  --invite-accent: #5865f2;
  margin-top: 12px;
  width: min(100%, 480px);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(58, 59, 66, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.invite-embed--loading {
  opacity: 0.82;
}

.invite-embed-banner {
  height: 74px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--invite-accent), white 40%), color-mix(in srgb, var(--invite-accent), black 8%)),
    linear-gradient(120deg, rgba(255, 255, 255, 0.14), transparent);
}

.invite-embed-main {
  padding: 16px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.invite-embed-avatar {
  width: 64px;
  height: 64px;
  margin-top: -34px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--invite-accent), color-mix(in srgb, var(--invite-accent), white 22%));
  border: 4px solid rgba(58, 59, 66, 0.98);
  color: white;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.invite-embed-copy {
  min-width: 0;
}

.invite-embed-copy strong,
.invite-embed-copy span {
  display: block;
}

.invite-embed-copy strong {
  font-size: 1.08rem;
}

.invite-embed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  color: #c6c8cf;
  font-size: 0.84rem;
}

.invite-embed-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.invite-embed-link {
  margin-top: 8px;
  color: var(--low);
  font-size: 0.78rem;
}

.invite-embed-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #9a9ca6;
}

.invite-embed-dot--online {
  background: #23a55a;
}

.invite-embed-join {
  min-width: 112px;
  height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  background: #148046;
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.invite-embed-join:hover {
  transform: translateY(-1px);
  background: #169652;
}

.invite-embed-join:disabled {
  cursor: default;
  opacity: 0.75;
  background: rgba(255, 255, 255, 0.1);
}

.invite-embed-topline {
  margin: 0;
  padding: 16px 16px 0;
  color: #f2f3f5;
  font-size: 0.98rem;
  font-weight: 800;
}

.invite-embed-invalid-row {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.invite-embed-invalid-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(242, 168, 170, 0.12);
  color: #f6a8aa;
  font-size: 1.6rem;
}

.invite-embed-invalid-copy strong,
.invite-embed-invalid-copy span {
  display: block;
}

.invite-embed-invalid-copy strong {
  color: #f6a8aa;
  font-size: 1rem;
}

.invite-embed-invalid-copy span {
  margin-top: 4px;
  color: #d1d4db;
}

.invite-embed--invalid {
  border-color: rgba(246, 168, 170, 0.16);
}

.message-tagline {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.message-tagline span {
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.composer {
  margin: 0 max(20px, var(--safe-right)) max(20px, var(--safe-bottom)) max(20px, var(--safe-left));
  padding: 0;
  border-radius: 20px;
  background: rgba(43, 45, 49, 0.98);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  position: relative;
}

.composer-dm-tools[hidden],
.composer-dm-pending[hidden],
.composer-dm-hint[hidden],
.composer-jump-latest[hidden],
.composer-picker-panel[hidden],
.composer-picker-emoji[hidden],
.composer-picker-empty[hidden] {
  display: none !important;
}

.composer-jump-latest {
  position: absolute;
  right: 16px;
  bottom: calc(100% + 12px);
  z-index: 4;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #5865f2, #7380ff);
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(31, 41, 123, 0.3);
}

.composer-jump-latest:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(31, 41, 123, 0.34);
}

.composer-dm-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: absolute;
  inset: 0;
  padding: 0 18px;
  pointer-events: none;
  z-index: 2;
}

.composer-tool {
  flex: 0 0 auto;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  background: transparent;
  color: #c7cad1;
  cursor: pointer;
  pointer-events: auto;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.composer-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.composer-tool-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-tool--attach {
  font-size: 2.25rem;
  font-weight: 300;
  padding: 0;
}

.composer-tool--gif {
  min-width: 40px;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  color: #292b31;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.composer-tool--gif:hover {
  background: #fff;
  color: #17181c;
}

.composer-tool--icon {
  font-size: 1.55rem;
}

.composer-dm-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  padding: 0 18px 12px;
}

.composer-dm-hint {
  margin: 0;
  color: var(--low);
  font-size: 0.88rem;
  line-height: 1.4;
  padding: 0 18px 14px;
}

.dm-pending-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dm-pending-chip img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
}

.dm-pending-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.composer-picker-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 14px);
  padding: 14px 14px 16px;
  border-radius: 18px;
  background: #23232a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 4;
}

.composer-picker-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.composer-picker-tab {
  height: 58px;
  padding: 0 20px;
  border-radius: 16px;
  background: transparent;
  color: #f2f3f5;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.composer-picker-tab.is-active {
  background: rgba(255, 255, 255, 0.08);
}

.composer-picker-search {
  position: relative;
}

.composer-picker-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #f5f7fb;
  font-size: 2rem;
  font-weight: 300;
  pointer-events: none;
}

.composer-picker-panel input[type="search"] {
  width: 100%;
  height: 82px;
  padding: 0 20px 0 54px;
  border-radius: 16px;
  border: 4px solid color-mix(in srgb, var(--accent), white 12%);
  background: rgba(23, 24, 29, 0.8);
  color: var(--text);
  font-size: 1.15rem;
}

.composer-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  overflow: auto;
  max-height: min(56vh, 640px);
  -webkit-overflow-scrolling: touch;
}

.composer-gif-item {
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid transparent;
  position: relative;
}

.composer-gif-item:hover {
  border-color: var(--accent);
}

.composer-gif-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: brightness(0.62);
}

.composer-gif-item span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
}

.composer-picker-emoji {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.composer-emoji-item {
  height: 74px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 2rem;
}

.composer-emoji-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.composer-picker-empty {
  min-height: 180px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.message-attachment-img {
  display: block;
  max-width: min(420px, 100%);
  max-height: 320px;
  border-radius: 12px;
  margin-top: 8px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

.message-reaction-pill,
.message-reaction-quick {
  font-size: 0.85rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  border: 1px solid transparent;
}

.message-reaction-pill:hover,
.message-reaction-quick:hover {
  background: rgba(255, 255, 255, 0.14);
}

.message-reaction-pill.is-me {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.message-reaction-quick {
  padding: 6px 8px;
  font-size: 1rem;
}

.composer input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  min-width: 0;
  width: 100%;
  height: 78px;
  padding: 0 18px;
  font-size: clamp(1.06rem, 2vw, 1.18rem);
  border-radius: 20px;
}

.composer.is-dm-mode input {
  padding: 0 154px 0 76px;
}

.composer input::placeholder {
  color: var(--low);
}

.composer.is-uploading {
  opacity: 0.88;
}

.composer.is-uploading button,
.composer.is-uploading input {
  cursor: progress;
}

.composer.is-dragover {
  border-color: color-mix(in srgb, var(--accent), white 18%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent), transparent 30%), 0 16px 32px rgba(0, 0, 0, 0.22);
  background: rgba(52, 57, 70, 0.98);
}

.composer button {
  height: 44px;
  padding: 0 16px;
}

.composer-send {
  display: none;
}

.member-panel {
  background: rgba(35, 36, 40, 0.9);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.member-groups {
  flex: 1;
  min-height: 0;
  padding: 16px 12px 20px;
  padding-bottom: max(20px, var(--safe-bottom));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.member-section + .member-section {
  margin-top: 18px;
}

.member-section h3 {
  margin: 0 0 10px;
  padding: 0 8px;
  color: var(--low);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.member-row {
  width: 100%;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease;
}

.member-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

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

.member-meta strong,
.member-meta span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-meta span {
  color: var(--low);
  font-size: 0.8rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--bg-elevated);
}

.status-dot.offline {
  background: #747f8d;
}

.screen-overlay {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.mobile-toggle {
  display: none;
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: var(--rail-width) 280px minmax(0, 1fr);
  }

  .member-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, calc(100vw - 16px));
    max-width: 88vw;
    height: 100vh;
    height: 100dvh;
    padding-top: var(--safe-top);
    padding-right: var(--safe-right);
    transform: translateX(100%);
    transition: transform 220ms ease;
    z-index: 20;
    box-shadow: var(--shadow);
  }

  body.members-open .member-panel {
    transform: translateX(0);
  }

  body.members-open .screen-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-toggle[data-toggle="members"] {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    width: auto;
    height: auto;
    padding: 0 8px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
  }

  .channel-panel {
    position: fixed;
    top: 0;
    left: var(--rail-width);
    width: min(320px, calc(100vw - var(--rail-width) - var(--safe-right)));
    max-width: calc(100vw - var(--rail-width));
    height: 100vh;
    height: 100dvh;
    padding-right: var(--safe-right);
    transform: translateX(-110%);
    transition: transform 220ms ease;
    z-index: 21;
    box-shadow: var(--shadow);
  }

  body.channels-open .channel-panel {
    transform: translateX(0);
  }

  body.channels-open .screen-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-toggle[data-toggle="channels"] {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    width: auto;
    height: auto;
    padding: 0 8px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .channel-topic,
  .member-panel .eyebrow {
    display: none;
  }

  .channel-hero {
    margin: 16px max(16px, var(--safe-left)) 6px max(16px, var(--safe-right));
    padding: 18px;
  }

  .message-group {
    padding: 10px max(16px, var(--safe-left)) 10px max(16px, var(--safe-right));
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .empty-feed-msg {
    margin-left: max(20px, var(--safe-left));
    margin-right: max(20px, var(--safe-right));
  }

  .voice-room-shell {
    margin-left: max(16px, var(--safe-left));
    margin-right: max(16px, var(--safe-right));
    grid-template-columns: 1fr;
  }

  .voice-room-stage-body {
    grid-template-columns: 1fr;
  }

  .feed-banner-wrap {
    margin-left: max(20px, var(--safe-left));
    margin-right: max(20px, var(--safe-right));
  }

  .composer {
    margin: 0 max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
  }

  .composer input {
    font-size: 16px;
    line-height: 1.45;
  }

  .invite-embed-main {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .invite-embed-join {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .chat-header {
    padding: max(0px, var(--safe-top)) max(12px, var(--safe-right)) 0 max(12px, var(--safe-left));
    gap: 10px;
  }

  .chat-header-right {
    gap: 8px;
  }

  .header-call--guide {
    min-width: 0;
    padding: 0 12px;
  }

  .channel-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .voice-room-stage-head,
  .voice-room-text-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .composer button[type="submit"] {
    grid-column: 1 / -1;
  }

  .chat-guide-step {
    min-height: 0;
    padding-right: 18px;
  }
}

/* Server icon context menu (Discord-style) */
.server-ctx {
  position: fixed;
  z-index: 10050;
  min-width: 228px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 6px 0;
  border-radius: 8px;
  background: #2b2d31;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.35);
  font-size: 0.875rem;
  color: #dbdee1;
}

.server-ctx__sep {
  height: 1px;
  margin: 4px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 0;
}

.server-ctx__item {
  display: block;
  width: calc(100% - 8px);
  margin: 0 4px;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  line-height: 1.25;
}

.server-ctx__item:hover,
.server-ctx__item:focus-visible {
  background: #35373c;
  outline: none;
}

.server-ctx__item--danger {
  color: #f23f42;
}

.server-ctx__item--danger:hover,
.server-ctx__item--danger:focus-visible {
  color: #ff6b6e;
}

.server-ctx__item--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.server-ctx__item--sub {
  padding-top: 6px;
  padding-bottom: 6px;
}

.server-ctx__submain {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.server-ctx__submain small {
  color: #949ba4;
  font-size: 0.72rem;
  font-weight: 500;
}

.server-ctx__chev {
  flex-shrink: 0;
  color: #949ba4;
  font-size: 1rem;
  line-height: 1;
}

.server-ctx__check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #6d6f78;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.server-ctx__check--on {
  border-color: #5865f2;
  background: #5865f2;
  color: white;
}

.server-ctx__subwrap {
  position: relative;
  margin: 0 4px;
}

.server-ctx__flyout {
  display: none;
  position: absolute;
  left: calc(100% + 4px);
  top: 0;
  min-width: 200px;
  padding: 6px 0;
  border-radius: 8px;
  background: #2b2d31;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.35);
  z-index: 10051;
}

.server-ctx__flyout.is-open {
  display: block;
}

.server-ctx__fly-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: #dbdee1;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
}

.server-ctx__fly-item:hover,
.server-ctx__fly-item:focus-visible {
  background: #35373c;
  outline: none;
}

.server-ctx__fly-item.is-active {
  color: #fff;
  font-weight: 600;
}

@media (max-width: 400px) {
  :root {
    --rail-width: 60px;
  }

  .rail-home,
  .rail-tool,
  .server-button {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .rail-tool {
    font-size: 1.25rem;
  }

  .server-button::before {
    left: -12px;
  }

  .server-rail {
    padding-left: 8px;
    padding-right: 8px;
    gap: 10px;
  }

  .rail-tools {
    gap: 6px;
  }
}

/* Discord-style expanded voice / call panel */
.voice-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, var(--safe-top)) max(20px, var(--safe-right)) max(16px, var(--safe-bottom))
    max(20px, var(--safe-left));
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px) saturate(1.1);
}

.voice-call-overlay[hidden] {
  display: none !important;
}

.voice-call-overlay--minimized {
  align-items: flex-end;
  justify-content: flex-start;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.voice-call-overlay--minimized .voice-call-panel {
  pointer-events: auto;
  max-width: min(380px, calc(100vw - 24px));
  width: 100%;
  margin: 0 0 max(10px, var(--safe-bottom)) max(10px, var(--safe-left));
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

.voice-call-panel {
  width: min(440px, 100%);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(165deg, #15161a 0%, #0f1012 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 32px 96px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
}

.voice-call-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px;
  background: #2b2d31;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

.voice-call-channel-ico {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(35, 165, 89, 0.22);
  color: #23a559;
  display: grid;
  place-items: center;
}

.voice-call-channel-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-call-channel-name {
  font-size: 1rem;
  font-weight: 700;
  color: #f2f3f5;
  letter-spacing: -0.02em;
}

.voice-call-status-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: #949ba4;
  cursor: default;
  text-align: left;
}

.voice-call-edit-ico {
  opacity: 0.75;
  font-size: 0.72rem;
}

.voice-call-timer {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: #23a559;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.voice-call-header-actions {
  display: flex;
  gap: 4px;
}

.voice-call-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: rgba(0, 0, 0, 0.2);
  color: #b5bac1;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.voice-call-icon-btn:hover {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.voice-call-body {
  background: #0d0e10;
  padding: 8px 10px 12px;
  min-height: 120px;
}

.voice-call-participants {
  list-style: none;
  margin: 0;
  padding: 0;
}

.voice-call-participant {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.voice-call-participant:hover {
  background: rgba(255, 255, 255, 0.04);
}

.voice-call-avatar-stack {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.voice-call-avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  opacity: 0;
  transition:
    opacity 0.12s ease,
    box-shadow 0.12s ease;
}

.voice-call-participant.is-speaking .voice-call-avatar-ring {
  opacity: 1;
  box-shadow:
    0 0 0 3px #23a559,
    0 0 20px rgba(35, 165, 89, 0.35);
}

.voice-call-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3f4147, #2b2d31);
  color: #dbdee1;
  font-size: 0.82rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #1e1f22;
}

.voice-call-avatar--remote {
  background: linear-gradient(145deg, #5865f2 0%, #4752c4 100%);
  color: #fff;
}

.voice-call-p-meta {
  flex: 1;
  min-width: 0;
}

.voice-call-p-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #dbdee1;
}

.voice-call-p-icons {
  flex-shrink: 0;
  color: #949ba4;
  display: flex;
  align-items: center;
}

.voice-call-mute-ico {
  display: flex;
  opacity: 0.95;
}

.voice-call-activity {
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.voice-call-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.voice-call-activity-label {
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8e97a3;
}

.voice-call-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.voice-call-activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.voice-call-activity-item--join .voice-call-activity-event {
  color: #8ce7ae;
}

.voice-call-activity-item--leave .voice-call-activity-event {
  color: #ff9b9d;
}

.voice-call-activity-event {
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.voice-call-activity-time {
  flex-shrink: 0;
  font-size: 0.74rem;
  color: #8e97a3;
}

.voice-call-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px 14px;
  background: #1e1f22;
  border-top: 1px solid rgba(0, 0, 0, 0.35);
}

.voice-call-foot-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: #4e5058;
  color: #f2f3f5;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
}

.voice-call-foot-btn:hover {
  background: #5c5e66;
}

.voice-call-foot-btn:active {
  transform: scale(0.96);
}

.voice-call-foot-btn.is-active {
  background: color-mix(in srgb, #ed4245 75%, #4e5058);
  color: #fff;
}

.voice-call-foot-btn[data-vc-foot-screen].is-active {
  background: color-mix(in srgb, #23a559 55%, #4e5058);
  color: #fff;
}

.voice-call-foot-btn--leave {
  background: #ed4245;
  margin-left: 8px;
}

.voice-call-foot-btn--leave:hover {
  background: #c03537;
}

/* —— User settings (Discord-style) —— */
body.user-settings-open {
  overflow: hidden;
}

.user-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.user-settings-overlay[hidden] {
  display: none !important;
}

.user-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.user-settings-layout {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  max-height: 100%;
  margin: auto;
  background: #313338;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.user-settings-nav {
  width: 280px;
  flex-shrink: 0;
  background: #2b2d31;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(720px, 100vh);
  border-right: 1px solid rgba(0, 0, 0, 0.35);
}

.user-settings-nav-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}

.user-settings-nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #5865f2;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-settings-nav-ident {
  min-width: 0;
  flex: 1;
}

.user-settings-nav-ident strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #f2f3f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-settings-edit-profiles {
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.72rem;
  color: #949ba4;
  cursor: not-allowed;
}

.user-settings-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 10px 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #1e1f22;
}

.user-settings-search-ico {
  color: #6d7278;
  font-size: 0.9rem;
}

.user-settings-search {
  flex: 1;
  border: 0;
  background: transparent;
  color: #dbdee1;
  font: inherit;
  font-size: 0.82rem;
  min-width: 0;
}

.user-settings-search::placeholder {
  color: #6d7278;
}

.user-settings-nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 6px 12px;
}

.user-settings-nav-h {
  margin: 14px 8px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #949ba4;
  text-transform: uppercase;
}

.user-settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 4px);
  margin: 1px 4px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b5bac1;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.user-settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #dbdee1;
}

.user-settings-nav-item.is-active {
  background: rgba(78, 80, 88, 0.65);
  color: #fff;
}

.user-settings-nav-ico {
  width: 18px;
  text-align: center;
  opacity: 0.85;
  font-size: 0.75rem;
}

.user-settings-nav-foot {
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.25);
}

.user-settings-logout {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 0;
  background: rgba(237, 66, 69, 0.18);
  color: #f87171;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.user-settings-logout:hover {
  background: rgba(237, 66, 69, 0.28);
}

.user-settings-main {
  flex: 1;
  min-width: 0;
  position: relative;
  padding: 20px 28px 32px;
  overflow-y: auto;
  max-height: min(720px, 100vh);
  background: #313338;
}

.user-settings-x {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b5bac1;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.user-settings-x:hover {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}

.user-settings-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(237, 66, 69, 0.15);
  color: #fecaca;
  font-size: 0.86rem;
  font-weight: 600;
}

.user-settings-error--ok {
  background: rgba(35, 165, 89, 0.18);
  color: #86efac;
}

.user-settings-panel[hidden] {
  display: none !important;
}

.user-settings-title {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #f2f3f5;
}

.user-settings-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

.user-settings-tab {
  padding: 8px 4px 12px;
  margin-right: 20px;
  border: 0;
  background: none;
  color: #949ba4;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 -2px transparent;
}

.user-settings-tab:hover {
  color: #dbdee1;
}

.user-settings-tab.is-active {
  color: #fff;
  box-shadow: inset 0 -2px #5865f2;
}

.user-settings-muted {
  margin: 0 0 12px;
  color: #949ba4;
  font-size: 0.86rem;
  line-height: 1.45;
}

.user-settings-hero {
  margin-bottom: 18px;
  border-radius: 10px;
  overflow: hidden;
  background: #1e1f22;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.user-settings-banner {
  height: 72px;
  background: linear-gradient(120deg, #5865f2 0%, #3c45a5 45%, #1e1f22 100%);
}

.user-settings-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding: 0 18px 16px;
  margin-top: -28px;
}

.user-settings-hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.user-settings-hero-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #5865f2;
  border: 6px solid #1e1f22;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.user-settings-status-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #23a559;
  border: 4px solid #1e1f22;
}

.user-settings-hero-names {
  flex: 1;
  min-width: 0;
  padding-bottom: 6px;
}

.user-settings-hero-names strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f2f3f5;
}

.user-settings-btn-primary {
  margin-left: auto;
  padding: 8px 16px;
  border-radius: 6px;
  border: 0;
  background: #5865f2;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.user-settings-btn-primary:hover {
  background: #4752c4;
}

.user-settings-btn-secondary {
  padding: 8px 14px;
  border-radius: 6px;
  border: 0;
  background: #4e5058;
  color: #f2f3f5;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.user-settings-btn-secondary:hover {
  background: #5c5f66;
}

.user-settings-card {
  margin: 14px 0;
  padding: 16px 18px;
  border-radius: 8px;
  background: #2b2d31;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.user-settings-card-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f2f3f5;
}

.user-settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.user-settings-field span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #949ba4;
}

.user-settings-field input {
  padding: 10px 12px;
  border-radius: 6px;
  border: 0;
  background: #1e1f22;
  color: #dbdee1;
  font: inherit;
  font-size: 0.9rem;
}

.user-settings-field textarea {
  min-height: 92px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 0;
  resize: vertical;
  background: #1e1f22;
  color: #dbdee1;
  font: inherit;
  font-size: 0.9rem;
}

.user-settings-field input:focus,
.user-settings-field textarea:focus {
  outline: 2px solid rgba(88, 101, 242, 0.85);
  outline-offset: 1px;
}

.user-settings-profile-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
}

.user-settings-profile-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: #1f2124;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-settings-profile-avatar {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #5865f2, #3d5eff);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.user-settings-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-settings-profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.user-settings-profile-fields {
  min-width: 0;
}

.user-settings-row-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.user-settings-rows {
  margin-bottom: 20px;
}

.user-settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: #2b2d31;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.user-settings-row--stack {
  align-items: flex-start;
}

.user-settings-row-copy {
  flex: 1;
  min-width: 0;
}

.user-settings-row-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #949ba4;
  margin-bottom: 4px;
}

.user-settings-row-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: #dbdee1;
}

.user-settings-row-value--wrap {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.user-settings-row-hint {
  font-size: 0.78rem;
  color: #6d7278;
}

.user-settings-link {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #00a8fc;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.user-settings-link:hover {
  text-decoration: underline;
}

.user-settings-btn-edit {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 4px;
  border: 0;
  background: #4e5058;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.user-settings-btn-edit:hover {
  background: #5c5f66;
}

.user-settings-section-h {
  margin: 22px 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #949ba4;
}

.user-settings-banner-soft {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: rgba(35, 165, 89, 0.12);
  border: 1px solid rgba(35, 165, 89, 0.28);
  color: #b5bac1;
  font-size: 0.84rem;
  line-height: 1.4;
}

.user-settings-lock {
  flex-shrink: 0;
}

.user-settings-standing-card {
  padding: 20px;
  border-radius: 8px;
  background: #2b2d31;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.user-settings-card--encryption {
  border-color: rgba(88, 101, 242, 0.25);
  background: linear-gradient(145deg, rgba(88, 101, 242, 0.08), #2b2d31);
}

.user-settings-card--sounds {
  border-color: rgba(35, 165, 90, 0.22);
  background: linear-gradient(145deg, rgba(35, 165, 90, 0.07), #2b2d31);
  margin-bottom: 14px;
}

.user-settings-card--voice-routing {
  border-color: rgba(88, 101, 242, 0.18);
  background: linear-gradient(145deg, rgba(88, 101, 242, 0.06), #2b2d31);
}

.user-settings-card--voice-sliders {
  border-color: rgba(255, 255, 255, 0.06);
}

.user-settings-card--mic-test {
  border-color: rgba(0, 168, 252, 0.16);
  background: linear-gradient(145deg, rgba(0, 168, 252, 0.06), #2b2d31);
}

.user-settings-device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-settings-device-card {
  padding: 14px;
  border-radius: 8px;
  background: #1f2124;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-settings-device-card strong {
  display: block;
  margin: 4px 0 8px;
  color: #f2f3f5;
  font-size: 1rem;
  font-weight: 800;
}

.user-settings-voice-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.user-settings-voice-row--spaced {
  margin-top: 20px;
}

.user-settings-voice-copy {
  flex: 1;
  min-width: 0;
}

.user-settings-voice-value {
  flex-shrink: 0;
  color: #f2f3f5;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.user-settings-range {
  width: 100%;
  margin-top: 12px;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #5865f2, #00a8fc);
  outline: none;
}

.user-settings-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.user-settings-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.user-settings-mic-meter {
  margin-top: 14px;
  height: 12px;
  border-radius: 999px;
  background: #1e1f22;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.user-settings-mic-meter span {
  display: block;
  width: 6%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #23a559 0%, #3ba55d 45%, #f0b232 70%, #ed4245 100%);
  transition: width 90ms linear;
}

.user-settings-encryption-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.user-settings-encryption-copy {
  flex: 1;
  min-width: 0;
}

.user-settings-hint {
  margin: 14px 0 0;
  font-size: 0.78rem !important;
}

.user-settings-switch {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.user-settings-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.user-settings-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: #4e5058;
  transition: background 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.user-settings-switch-slider::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.user-settings-switch input:checked + .user-settings-switch-slider {
  background: #5865f2;
}

.user-settings-switch input:checked + .user-settings-switch-slider::after {
  transform: translateX(20px);
}

.user-settings-switch input:focus-visible + .user-settings-switch-slider {
  outline: 2px solid #00a8fc;
  outline-offset: 2px;
}

/* Optional "high-end encryption" mode — extra compositing + scanline (on top of JS load) */
body.high-encryption-mode {
  filter: contrast(1.03) saturate(1.12);
}

body.high-encryption-mode::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 3px,
    rgba(88, 101, 242, 0.04) 3px,
    rgba(88, 101, 242, 0.04) 6px
  );
  mix-blend-mode: soft-light;
  animation: high-enc-drift 6s linear infinite;
}

@keyframes high-enc-drift {
  0% {
    transform: translateY(0);
    opacity: 0.35;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(24px);
    opacity: 0.35;
  }
}

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

  .user-settings-encryption-row {
    flex-direction: column;
  }

  .user-settings-device-grid {
    grid-template-columns: 1fr;
  }

  .user-settings-layout {
    flex-direction: column;
    max-height: 100%;
  }

  .user-settings-nav {
    width: 100%;
    max-height: 40vh;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  }

  .user-settings-main {
    max-height: none;
  }
}
