:root {
  --bg-app: #1e1f22;
  --bg-sidebar: #2b2d31;
  --bg-main: #313338;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-strong: rgba(255, 255, 255, 0.1);
  --bg-hover: rgba(255, 255, 255, 0.08);
  --bg-active: rgba(88, 101, 242, 0.22);
  --line-soft: rgba(255, 255, 255, 0.08);
  --text-main: #f2f3f5;
  --text-soft: #b5bac1;
  --text-dim: #949ba4;
  --primary: #5865f2;
  --primary-strong: #4752c4;
  --success: #3ba55d;
  --danger: #da373c;
  --warning: #faa61a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --font-ui: "gg sans", "Noto Sans", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(88, 101, 242, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(59, 165, 93, 0.18), transparent 22%),
    var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-ui);
}

body {
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

#app {
  min-height: 100vh;
}

.loading-screen,
.auth-shell,
.app-shell {
  min-height: 100vh;
}

.loading-screen {
  display: grid;
  place-items: center;
}

.loading-card {
  width: min(420px, calc(100vw - 48px));
  padding: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: rgba(17, 18, 20, 0.78);
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.4rem;
}

.loading-card span {
  color: var(--text-soft);
}

.loading-card .button {
  margin-top: 18px;
}

.loading-orb {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), #8ea1ff);
  box-shadow: 0 0 0 10px rgba(88, 101, 242, 0.16);
  animation: pulse 1.4s ease-in-out infinite;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  padding: 24px;
}

.auth-panel {
  border: 1px solid var(--line-soft);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.auth-panel--hero {
  padding: 48px;
  background:
    radial-gradient(circle at top left, rgba(88, 101, 242, 0.28), transparent 35%),
    linear-gradient(155deg, rgba(21, 24, 33, 0.94), rgba(29, 31, 43, 0.88));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-panel--hero h1 {
  margin: 18px 0 18px;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1.02;
  max-width: 12ch;
}

.auth-panel--hero p {
  margin: 0;
  color: var(--text-soft);
  max-width: 54ch;
  font-size: 1.02rem;
  line-height: 1.6;
}

.auth-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.auth-stats div {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-stats strong,
.brand-badge {
  display: inline-block;
}

.auth-stats strong {
  display: block;
  margin-bottom: 8px;
}

.auth-stats span {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.brand-badge {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.18);
  color: #dde1ff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-badge--dark {
  background: rgba(88, 101, 242, 0.12);
  color: var(--primary);
}

.auth-panel--form {
  padding: 34px;
  background: rgba(14, 15, 17, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-header h2 {
  margin: 18px 0 8px;
  font-size: 2rem;
}

.auth-header p {
  margin: 0 0 26px;
  color: var(--text-soft);
}

.auth-feedback {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  line-height: 1.45;
}

.auth-feedback--error {
  border-color: rgba(218, 55, 60, 0.4);
  background: rgba(218, 55, 60, 0.14);
  color: #ffd7d8;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label,
.composer__field {
  display: grid;
  gap: 8px;
}

.stack-form span,
.composer__reply span {
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.form-help {
  margin-top: -2px;
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.45;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(88, 101, 242, 0.7);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}

.button,
.link-btn,
.nav-pill,
.icon-btn,
.channel-row,
.dm-row,
.rail__btn,
.rail__circle {
  border: 0;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.button {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.button:hover,
.nav-pill:hover,
.channel-row:hover,
.dm-row:hover,
.icon-btn:hover,
.rail__btn:hover,
.rail__circle:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: var(--primary);
}

.button--primary:hover {
  background: var(--primary-strong);
}

.button--full {
  width: 100%;
}

.button--tiny {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.link-btn {
  margin-top: 14px;
  padding: 0;
  background: transparent;
  color: #c7ccff;
  text-align: left;
}

.hint-box {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.hint-box strong {
  display: block;
  color: var(--text-main);
  margin-bottom: 6px;
}

.app-shell {
  display: grid;
  grid-template-columns: 84px 312px minmax(0, 1fr) 280px;
  gap: 0;
}

.rail {
  background: #111214;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rail__btn,
.rail__circle {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #2b2d31;
  color: var(--text-main);
  font-weight: 800;
}

.rail__btn.is-active,
.rail__circle--success,
.rail__circle--success:hover {
  background: var(--primary);
}

.rail__separator {
  width: 34px;
  height: 2px;
  border-radius: 999px;
  background: var(--line-soft);
  margin: 4px 0;
}

.rail__footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.rail__circle--neutral {
  background: #1f2227;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(0, 0, 0, 0.24);
}

.sidebar__header,
.content__header {
  min-height: 64px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.24);
}

.sidebar__header strong,
.content__title strong {
  display: block;
  font-size: 1rem;
}

.sidebar__header span,
.content__title span {
  display: block;
  color: var(--text-soft);
  font-size: 0.86rem;
  margin-top: 3px;
}

.sidebar__nav,
.sidebar__section,
.channel-groups {
  padding: 16px 12px;
}

.sidebar__nav {
  display: grid;
  gap: 10px;
}

.sidebar__section {
  flex: 1;
  overflow: auto;
}

.sidebar__section-title,
.channel-group__title,
.members-panel__title {
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.nav-pill,
.channel-row,
.dm-row {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
}

.nav-pill.is-active,
.channel-row.is-active,
.dm-row.is-active,
.channel-row.is-voice-active {
  background: var(--bg-active);
  color: var(--text-main);
}

.channel-row,
.dm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.channel-row--voice {
  align-items: flex-start;
}

.channel-row__main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.channel-row small,
.dm-row span {
  color: var(--text-dim);
}

.voice-presence {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.voice-presence__avatars {
  display: flex;
  align-items: center;
}

.voice-presence__avatars .avatar {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--bg-sidebar);
}

.voice-presence__avatars .avatar:first-child {
  margin-left: 0;
}

.voice-presence__names,
.voice-presence__more {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.voice-presence__names {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-presence__more {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  margin-left: -8px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.dm-list,
.friend-list,
.channel-group__items {
  display: grid;
  gap: 8px;
}

.main-panel {
  min-width: 0;
  background: var(--bg-main);
}

.app-shell--call {
  grid-template-columns: 84px 312px minmax(0, 1fr);
}

.content-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.content-shell--call {
  grid-template-rows: auto 1fr auto;
}

.call-stage {
  min-height: 300px;
  padding: 22px 24px 18px;
  display: grid;
  gap: 18px;
  background:
    radial-gradient(circle at top center, rgba(88, 101, 242, 0.08), transparent 34%),
    #18191d;
  border-bottom: 1px solid rgba(0, 0, 0, 0.24);
}

.call-stage__topbar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
}

.call-stage__topbar strong,
.call-stage__status strong,
.call-stage__tile strong {
  display: block;
}

.call-stage__topbar span,
.call-stage__status span,
.call-stage__tile span {
  color: var(--text-dim);
}

.call-stage__arena {
  align-content: center;
  justify-items: center;
  display: grid;
  gap: 18px;
}

.call-stage__tiles {
  width: min(100%, 600px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.call-stage__tiles--solo {
  max-width: 260px;
}

.call-stage__tile {
  position: relative;
  min-height: 132px;
  padding: 20px 18px 18px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  background: linear-gradient(145deg, var(--call-accent-soft), rgba(47, 49, 54, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.call-stage__tile-gif,
.call-stage__tile-gif-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.call-stage__tile-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  z-index: 0;
}

.call-stage__tile-gif-overlay {
  background:
    linear-gradient(180deg, rgba(7, 8, 11, 0.08), rgba(7, 8, 11, 0.58)),
    linear-gradient(145deg, rgba(8, 9, 12, 0.12), rgba(8, 9, 12, 0.52));
  z-index: 1;
}

.call-stage__tile.has-gif {
  background: rgba(13, 14, 18, 0.92);
  box-shadow: none;
}

.call-stage__tile.has-gif .call-stage__tile-gif {
  opacity: 0.92;
}

.call-stage__tile.has-gif .call-stage__tile-gif-overlay,
.call-stage__tile.has-gif .call-stage__tile-glow {
  display: none;
}

.call-stage__tile--self {
  border-color: rgba(255, 255, 255, 0.14);
}

.call-stage__tile.is-speaking {
  border-color: rgba(84, 214, 122, 0.92);
  box-shadow:
    0 0 0 1px rgba(84, 214, 122, 0.18),
    0 0 24px rgba(84, 214, 122, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.call-stage__tile-glow {
  position: absolute;
  inset: auto auto -24px -24px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: var(--call-accent-strong);
  filter: blur(10px);
  opacity: 0.42;
  z-index: 1;
}

.call-stage__tile.is-speaking .call-stage__tile-glow {
  background: rgba(84, 214, 122, 0.92);
  filter: blur(18px);
  opacity: 0.78;
}

.call-stage__tile-avatar,
.call-stage__tile-body {
  position: relative;
  z-index: 2;
}

.call-stage__tile-body {
  text-align: center;
}

.call-stage__tile-body strong {
  font-size: 1.05rem;
}

.call-stage__tile-body span {
  font-size: 0.82rem;
}

.call-stage__status {
  text-align: center;
}

.call-stage__status strong {
  margin-bottom: 4px;
}

.call-stage__controls {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.call-stage__control {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.call-stage__control-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
}

.call-stage__control-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.call-stage__control.is-active,
.call-stage__control:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.call-stage__control--muted,
.call-stage__control:disabled {
  color: var(--text-dim);
  opacity: 0.66;
}

.call-stage__control--danger {
  background: #ed4245;
  color: white;
}

.call-stage__control--danger:hover:not(:disabled) {
  background: #d83c3f;
}

.call-stage__control:disabled {
  cursor: not-allowed;
  transform: none;
}

.message-pane {
  overflow: auto;
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.message {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.message:hover {
  background: rgba(255, 255, 255, 0.04);
}

.message__header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

.message__header span,
.message__reply,
.message__edited {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.message__content {
  color: var(--text-main);
  line-height: 1.6;
}

.message__reply {
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.message__actions {
  display: flex;
  gap: 8px;
  opacity: 0;
}

.message:hover .message__actions {
  opacity: 1;
}

.composer {
  padding: 16px 18px 24px;
  display: grid;
  gap: 12px;
}

.composer__reply {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.composer textarea {
  min-height: 52px;
  max-height: 160px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.members-panel {
  background: #232428;
  border-left: 1px solid rgba(0, 0, 0, 0.24);
  padding: 18px 14px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.members-panel__section {
  display: grid;
  gap: 10px;
}

.member-row,
.friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.member-row > div:last-child,
.friend-row__identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-row strong,
.friend-row strong {
  display: block;
}

.member-row span,
.friend-row span {
  color: var(--text-dim);
  font-size: 0.83rem;
}

.friends-grid {
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
}

.panel-card {
  border: 1px solid var(--line-soft);
  border-radius: 26px;
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.panel-card__header {
  padding: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-card__header strong {
  display: block;
}

.panel-card__header span {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.friend-list {
  padding: 14px;
}

.friend-row__identity,
.friend-row__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-card {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.24);
  background: rgba(17, 18, 20, 0.3);
}

.user-card__identity,
.user-card__actions,
.voice-dock__actions,
.modal__actions,
.stat-stack {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-card__identity {
  margin-bottom: 12px;
}

.user-card__actions {
  margin-bottom: 12px;
}

.voice-dock {
  padding: 12px;
  border-radius: 18px;
  background: rgba(59, 165, 93, 0.12);
  border: 1px solid rgba(59, 165, 93, 0.18);
}

.voice-dock__meta strong {
  display: block;
  margin-bottom: 4px;
}

.voice-dock__meta span {
  color: #d7f5df;
  font-size: 0.82rem;
}

.icon-btn {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.icon-btn--danger {
  background: rgba(218, 55, 60, 0.16);
  color: #ffb8bc;
}

.icon-btn.is-active {
  background: var(--primary);
}

.avatar {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: var(--avatar-color, var(--primary));
  color: white;
  font-weight: 800;
}

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

.avatar--xs {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 0.78rem;
}

.avatar--xxs {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  font-size: 0.64rem;
}

.avatar--call {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  font-size: 1.2rem;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.call-stage__tile.has-gif .avatar--call {
  box-shadow: none;
}

.avatar--sm {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 0.85rem;
}

.badge,
.invite-pill {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-soft);
  font-size: 0.8rem;
}

.badge--warning {
  background: rgba(250, 166, 26, 0.16);
  color: #ffd58e;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.modal {
  width: min(520px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 28px;
  background: #1f2125;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.empty-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  color: var(--text-soft);
}

.empty-state--small {
  min-height: auto;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(17, 18, 20, 0.92);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}

.toast--success {
  border-color: rgba(59, 165, 93, 0.32);
}

.toast--error {
  border-color: rgba(218, 55, 60, 0.32);
}

.stat-stack {
  display: grid;
  gap: 10px;
}

.stat-stack div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.stat-stack strong {
  display: block;
  font-size: 1.1rem;
}

.stat-stack span {
  color: var(--text-dim);
  font-size: 0.83rem;
}

:root {
  --bg-app: #1e1f22;
  --bg-rail: #111214;
  --bg-sidebar: #1e1f22;
  --bg-sidebar-alt: #2b2d31;
  --bg-main: #313338;
  --bg-panel: #2b2d31;
  --bg-elevated: #232428;
  --bg-input: #383a40;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(88, 101, 242, 0.22);
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-hard: rgba(17, 18, 20, 0.9);
  --text-main: #f2f3f5;
  --text-soft: #b5bac1;
  --text-dim: #949ba4;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.24);
}

html,
body {
  background: var(--bg-app);
}

body {
  overflow: hidden;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  background-clip: content-box;
}

.app-shell {
  grid-template-columns: 72px 360px minmax(0, 1fr) 300px;
  background: var(--bg-app);
}

.app-shell--call {
  grid-template-columns: 72px 360px minmax(0, 1fr);
}

.rail {
  background: var(--bg-rail);
  padding: 12px 0 14px;
  gap: 8px;
}

.rail__separator {
  width: 32px;
  margin: 2px 0 4px;
}

.rail__btn {
  position: relative;
  width: 72px;
  height: 56px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  display: grid;
  place-items: center;
}

.rail__badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #313338;
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: border-radius 0.2s ease, background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.rail__btn:hover .rail__badge,
.rail__btn.is-active .rail__badge {
  border-radius: 16px;
  background: var(--primary);
  transform: translateY(-1px);
}

.rail__marker {
  position: absolute;
  left: 0;
  width: 4px;
  height: 8px;
  border-radius: 0 999px 999px 0;
  background: #f2f3f5;
  opacity: 0;
  transform: scaleY(0.35);
  transition: opacity 0.2s ease, transform 0.2s ease, height 0.2s ease;
}

.rail__btn:hover .rail__marker {
  opacity: 1;
  height: 20px;
  transform: scaleY(1);
}

.rail__btn.is-active .rail__marker {
  opacity: 1;
  height: 40px;
  transform: scaleY(1);
}

.rail__footer {
  gap: 8px;
}

.rail__circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #313338;
  color: #3ba55d;
  display: grid;
  place-items: center;
  font-size: 0;
}

.rail__circle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail__circle:hover {
  border-radius: 16px;
}

.rail__circle--success {
  background: rgba(59, 165, 93, 0.14);
  color: #3ba55d;
}

.rail__circle--success:hover {
  background: #3ba55d;
  color: white;
}

.rail__circle--neutral {
  color: var(--text-soft);
}

.sidebar {
  background: var(--bg-sidebar);
  min-height: 100vh;
}

.sidebar__header {
  min-height: 48px;
  padding: 12px 16px;
  background: #1e1f22;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

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

.sidebar__server-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.sidebar__back-btn {
  flex: 0 0 auto;
}

.sidebar__server-meta strong {
  font-size: 1rem;
  font-weight: 700;
}

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

.sidebar__server-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-insight {
  margin: 14px 12px 10px;
  padding: 12px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: linear-gradient(180deg, rgba(88, 101, 242, 0.2), rgba(88, 101, 242, 0.08));
  border: 1px solid rgba(88, 101, 242, 0.18);
}

.server-insight__icon,
.server-insight__meta {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(17, 18, 20, 0.32);
}

.server-insight__icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.server-insight__body strong,
.server-insight__body span {
  display: block;
}

.server-insight__body strong {
  font-size: 0.9rem;
}

.server-insight__body span {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.server-insight__meta {
  width: auto;
  min-width: 40px;
  padding: 0 10px;
  font-size: 0.72rem;
  color: var(--text-main);
}

.channel-groups {
  padding: 4px 8px 8px;
  overflow: auto;
}

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

.channel-group__title {
  margin-bottom: 4px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.channel-group__chevron {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
}

.channel-group__chevron svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.channel-group__items,
.dm-list {
  gap: 2px;
}

.channel-row,
.dm-row {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-dim);
}

.channel-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.channel-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(181, 186, 193, 0.8);
  font-size: 0.72rem;
}

.channel-row__icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: inherit;
}

.channel-row__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.channel-row__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.channel-row--text small {
  opacity: 0.72;
}

.channel-row:hover,
.dm-row:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  transform: none;
}

.channel-row.is-active,
.channel-row.is-voice-active,
.dm-row.is-active {
  background: rgba(88, 101, 242, 0.22);
  color: var(--text-main);
}

.voice-room {
  display: grid;
  gap: 3px;
}

.voice-room-members {
  display: grid;
  gap: 2px;
  margin-left: 26px;
  margin-bottom: 4px;
}

.voice-room-member {
  width: 100%;
  min-height: 28px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
}

.voice-room-member:hover {
  background: rgba(255, 255, 255, 0.06);
}

.voice-room-member span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
}

.nav-pill .label-with-icon,
.sidebar__section-title .label-with-icon,
.members-panel__title .label-with-icon,
.panel-card__header strong .label-with-icon,
.content__title strong .label-with-icon {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.nav-pill .label-with-icon {
  width: 100%;
}

.content-shell {
  min-height: 100vh;
  height: 100vh;
  background: var(--bg-main);
}

.content__header {
  min-height: 48px;
  padding: 8px 16px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--line-hard);
}

.content__header--server {
  gap: 14px;
}

.content__title--server {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.content__title--server > div {
  min-width: 0;
}

.content__channel-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  color: var(--text-dim);
}

.content__channel-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.channel-toolbar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-pill {
  min-width: 220px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e1f22;
  border: 1px solid transparent;
}

.search-pill:focus-within {
  border-color: rgba(88, 101, 242, 0.48);
}

.search-pill__icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: var(--text-dim);
}

.search-pill__icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-pill input {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-soft);
  box-shadow: none;
}

.search-pill input:focus {
  box-shadow: none;
}

.message-pane {
  padding: 0 0 18px;
  gap: 0;
  background: var(--bg-main);
}

.message-divider {
  margin: 18px 16px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.74rem;
  text-transform: capitalize;
}

.message-divider::before,
.message-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
}

.message {
  position: relative;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  padding: 2px 16px 4px;
  border-radius: 0;
  background: transparent;
}

.message:hover {
  background: rgba(4, 4, 5, 0.07);
}

.message__avatar {
  padding-top: 2px;
}

.message__body {
  min-width: 0;
  padding: 2px 0 10px;
}

.message__header {
  gap: 8px;
  margin-bottom: 3px;
}

.message__header strong {
  font-size: 0.98rem;
}

.message__header span,
.message__edited {
  font-size: 0.73rem;
}

.message__content {
  color: #dbdee1;
  line-height: 1.42;
  word-break: break-word;
}

.message__reply {
  margin-bottom: 4px;
  padding-left: 0;
  border-left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}

.message__reply-line {
  width: 22px;
  height: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.18);
  border-top: 2px solid rgba(255, 255, 255, 0.18);
  border-top-left-radius: 8px;
  flex: 0 0 auto;
}

.message__reply-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.79rem;
}

.message__actions {
  position: absolute;
  top: -16px;
  right: 16px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(6px);
  padding: 4px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  background: #111214;
  box-shadow: var(--shadow-soft);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.message:hover .message__actions {
  opacity: 1;
  transform: translateY(0);
}

.composer {
  padding: 0 16px 24px;
}

.composer__reply {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.composer__shell {
  min-height: 44px;
  padding: 0 10px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border-radius: 8px;
  background: var(--bg-input);
}

.composer__field {
  flex: 1;
  min-width: 0;
  gap: 0;
}

.composer textarea {
  min-height: 44px;
  max-height: 160px;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  box-shadow: none;
}

.composer textarea:focus {
  box-shadow: none;
}

.composer__tools {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-bottom: 6px;
}

.composer__send {
  width: 34px;
  height: 34px;
  margin: 0 0 5px;
  border: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--primary);
  color: white;
  transition: background 0.2s ease, transform 0.18s ease;
}

.composer__send:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.composer__send .icon-btn__glyph,
.composer__send svg {
  width: 18px;
  height: 18px;
}

.main-panel {
  background: var(--bg-main);
  min-width: 0;
}

.members-panel {
  min-height: 100vh;
  padding: 10px 8px 16px;
  background: var(--bg-panel);
}

.members-panel__toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

.members-panel__toolbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.search-pill--panel {
  min-width: 0;
  width: 100%;
}

.members-panel__section {
  gap: 4px;
}

.members-panel__title {
  margin: 8px 8px 4px;
}

.member-row,
.friend-row {
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
}

.member-row {
  justify-content: flex-start;
}

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

.member-row > div:last-child {
  display: grid;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.member-row span {
  line-height: 1.3;
}

.dm-row {
  justify-content: flex-start;
}

.dm-row > div:last-child,
.friend-row__identity > div:last-child,
.member-row > div:last-child {
  flex: 1;
  min-width: 0;
}

.dm-row > div:last-child,
.friend-row__identity > div:last-child {
  display: grid;
  gap: 2px;
}

.dm-row strong,
.dm-row span,
.friend-row__identity strong,
.friend-row__identity span,
.member-row strong,
.member-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button,
.icon-btn,
.channel-row,
.dm-row,
.rail__btn,
.rail__circle,
.voice-room-member {
  transition: background-color 0.18s ease, color 0.18s ease, border-radius 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.button {
  border-radius: 10px;
  padding: 10px 14px;
}

.button--tiny {
  padding: 8px 12px;
  border-radius: 10px;
}

.button--ghost {
  background: #41434a;
  color: white;
}

.button--ghost:hover {
  background: #4a4c53;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--text-dim);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  transform: none;
}

.nav-pill:hover,
.nav-pill:active,
.channel-row:hover,
.channel-row:active,
.dm-row:hover,
.dm-row:active,
.rail__btn:hover,
.rail__btn:active,
.rail__circle:hover,
.rail__circle:active,
.button:hover,
.button:active {
  transform: none;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn__glyph {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.label-with-icon__icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: var(--text-dim);
  flex: 0 0 auto;
}

.label-with-icon__icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-label__icon {
  color: var(--text-soft);
}

.label-with-icon,
.nav-pill .label-with-icon,
.sidebar__section-title .label-with-icon,
.members-panel__title .label-with-icon,
.panel-card__header strong .label-with-icon,
.content__title strong .label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.label-with-icon__icon {
  display: inline-grid;
  align-items: center;
  justify-items: center;
  flex: 0 0 auto;
}

.sidebar__header .label-with-icon > .label-with-icon__icon,
.content__title .label-with-icon > .label-with-icon__icon,
.panel-card__header strong .label-with-icon > .label-with-icon__icon,
.members-panel__title .label-with-icon > .label-with-icon__icon,
.sidebar__section-title .label-with-icon > .label-with-icon__icon,
.nav-pill .label-with-icon > .label-with-icon__icon {
  display: inline-grid;
  margin-top: 0;
  font-size: 1em;
  line-height: 1;
}

.label-with-icon > span:last-child,
.sidebar__header .label-with-icon > span:last-child,
.content__title .label-with-icon > span:last-child,
.nav-pill .label-with-icon > span:last-child,
.sidebar__section-title .label-with-icon > span:last-child,
.members-panel__title .label-with-icon > span:last-child,
.panel-card__header strong .label-with-icon > span:last-child,
.content__title strong .label-with-icon > span:last-child {
  display: inline;
  margin-top: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.ui-icon,
.ui-icon svg {
  width: 1em;
  height: 1em;
  display: block;
}

.icon-btn.is-active {
  background: rgba(88, 101, 242, 0.18);
  color: #c8ccff;
}

.icon-btn--toolbar {
  background: rgba(255, 255, 255, 0.04);
}

.icon-btn--danger {
  background: rgba(237, 66, 69, 0.16);
  color: #ffb4b8;
}

.icon-btn--danger:hover {
  background: rgba(237, 66, 69, 0.24);
  color: white;
}

.voice-dock {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(59, 165, 93, 0.12);
  border: 1px solid rgba(59, 165, 93, 0.2);
}

.voice-dock__meta strong {
  font-size: 0.84rem;
}

.voice-dock__actions {
  margin-top: 10px;
}

.user-card {
  margin: auto 12px 12px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: var(--bg-elevated);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.user-card__identity {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.user-card__meta {
  min-width: 0;
}

.user-card__meta strong,
.user-card__meta span {
  display: block;
}

.user-card__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
}

.user-card__actions {
  margin-bottom: 0;
  margin-left: auto;
  flex-wrap: nowrap;
}

.user-card .voice-dock {
  width: 100%;
}

.avatar {
  border-radius: 50%;
  box-shadow: inset 0 -8px 14px rgba(0, 0, 0, 0.15);
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

.avatar--xs {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.avatar--xxs {
  width: 20px;
  height: 20px;
  font-size: 0.56rem;
}

.avatar-wrap {
  position: relative;
  width: fit-content;
  flex: 0 0 auto;
}

.status-dot {
  position: absolute;
  display: inline-block;
  border-radius: 999px;
  background: #3ba55d;
  box-shadow: 0 0 0 3px var(--bg-sidebar);
}

.status-dot--online {
  background: #3ba55d;
}

.status-dot--idle {
  background: #faa61a;
}

.status-dot--dnd {
  background: #ed4245;
}

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

.status-dot--avatar {
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
}

.status-dot--mini {
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 2px var(--bg-sidebar);
}

.content-shell--call .message-pane {
  border-top: 1px solid rgba(0, 0, 0, 0.24);
}

:root {
  --bg-app: #050507;
  --bg-rail: #07070a;
  --bg-sidebar: #0b0b10;
  --bg-sidebar-alt: #11111a;
  --bg-main: #0f0f16;
  --bg-panel: #12121b;
  --bg-elevated: #141420;
  --bg-input: #181824;
  --bg-card: rgba(155, 89, 255, 0.08);
  --bg-card-strong: rgba(155, 89, 255, 0.14);
  --bg-hover: rgba(155, 89, 255, 0.09);
  --bg-active: rgba(139, 92, 246, 0.22);
  --line-soft: rgba(164, 112, 255, 0.16);
  --line-hard: rgba(40, 16, 68, 0.84);
  --text-main: #f6f0ff;
  --text-soft: #c2afd9;
  --text-dim: #8872a8;
  --primary: #8b5cf6;
  --primary-strong: #7c3aed;
  --success: #8b5cf6;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
}

html,
body {
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.18), transparent 26%),
    radial-gradient(circle at bottom right, rgba(91, 33, 182, 0.2), transparent 28%),
    var(--bg-app);
}

.rail,
.sidebar,
.sidebar__header,
.main-panel,
.members-panel,
.content-shell,
.content__header,
.search-pill,
.message-pane,
.composer__shell,
.panel-card,
.user-card,
.members-panel,
.modal,
.loading-card,
.auth-panel--form {
  background-color: var(--bg-main);
}

.rail {
  background: var(--bg-rail);
}

.sidebar,
.sidebar__header,
.search-pill,
.message__actions,
.modal,
.auth-panel--form {
  background-color: var(--bg-sidebar);
}

.members-panel,
.user-card,
.panel-card,
.voice-dock,
.composer__reply,
.stat-stack div,
.friend-row,
.member-row,
.empty-state--small {
  background-color: var(--bg-panel);
}

.content__header,
.main-panel,
.message-pane,
.content-shell {
  background: var(--bg-main);
}

.auth-panel--hero {
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.32), transparent 34%),
    linear-gradient(155deg, rgba(6, 6, 10, 0.96), rgba(18, 12, 28, 0.92));
}

.loading-orb,
.button--primary,
.rail__btn:hover .rail__badge,
.rail__btn.is-active .rail__badge,
.composer__send {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.brand-badge,
.brand-badge--dark,
.server-insight,
.channel-row.is-active,
.channel-row.is-voice-active,
.dm-row.is-active,
.nav-pill.is-active,
.icon-btn.is-active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.28);
}

.rail__circle,
.rail__badge,
.button--ghost,
.search-pill,
.message__actions {
  background-color: #101019;
}

.rail__circle--success,
.rail__circle--success:hover {
  background: rgba(139, 92, 246, 0.18);
  color: #d4c2ff;
}

.rail__circle--neutral {
  color: #b9a5e6;
}

.server-insight {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.server-insight__icon,
.server-insight__meta {
  background: rgba(18, 10, 32, 0.54);
}

.voice-dock {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.24);
}

.voice-dock__meta span {
  color: #d5c4ff;
}

.button--ghost {
  color: #ece4ff;
}

.button--ghost:hover {
  background: #1a1427;
}

.channel-row:hover,
.dm-row:hover,
.voice-room-member:hover,
.member-row:hover,
.friend-row:hover,
.icon-btn:hover {
  background: rgba(139, 92, 246, 0.08);
}

.message:hover {
  background: rgba(139, 92, 246, 0.05);
}

.message-divider::before,
.message-divider::after {
  background: rgba(139, 92, 246, 0.14);
}

.content-shell--call .message-pane {
  border-top-color: rgba(139, 92, 246, 0.14);
}

.status-dot--online,
.status-dot--idle,
.status-dot--dnd {
  background: #8b5cf6;
}

.status-dot--offline {
  background: #63547e;
}

/* Final monochrome override */
:root {
  --bg-app: #000000;
  --bg-rail: #000000;
  --bg-sidebar: #050505;
  --bg-sidebar-alt: #080808;
  --bg-main: #0a0a0a;
  --bg-panel: #0e0e0e;
  --bg-elevated: #111111;
  --bg-input: #141414;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-strong: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-hard: rgba(255, 255, 255, 0.06);
  --text-main: #ffffff;
  --text-soft: #dddddd;
  --text-dim: #a8a8a8;
  --primary: #1a1a1a;
  --primary-strong: #232323;
  --success: #ffffff;
  --danger: #ffffff;
  --warning: #d0d0d0;
}

html,
body {
  background: #000000;
}

body,
input,
textarea,
select,
button {
  color: var(--text-main);
}

#app,
.loading-screen,
.auth-shell,
.app-shell,
.main-panel,
.content-shell,
.message-pane,
.members-panel,
.sidebar,
.rail,
.call-stage {
  background: #000000;
}

.rail,
.sidebar,
.members-panel,
.main-panel,
.content-shell,
.message-pane {
  background: var(--bg-main);
}

.sidebar,
.members-panel,
.user-card,
.panel-card,
.friend-row,
.member-row,
.empty-state--small,
.voice-dock,
.composer__reply,
.stat-stack div,
.dm-row.is-active,
.channel-row.is-active,
.channel-row.is-voice-active,
.nav-pill.is-active,
.icon-btn.is-active {
  background: var(--bg-panel);
}

.sidebar__header,
.content__header,
.message__actions,
.modal,
.search-pill,
.composer__shell,
.auth-panel--form,
.loading-card {
  background: var(--bg-sidebar);
}

.auth-panel--hero {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(155deg, rgba(0, 0, 0, 0.98), rgba(10, 10, 10, 0.96));
}

.loading-orb {
  background: linear-gradient(135deg, #ffffff, #cfcfcf);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.06);
}

.brand-badge,
.brand-badge--dark,
.invite-pill,
.badge {
  background: #101010;
  color: var(--text-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.button,
.button--ghost,
.button--primary,
.composer__send {
  background: #111111;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.button--primary:hover,
.button--ghost:hover,
.composer__send:hover {
  background: #1b1b1b;
  color: #ffffff;
}

.rail__badge,
.rail__circle,
.icon-btn--toolbar,
.search-pill,
.server-insight__icon,
.server-insight__meta {
  background: #101010;
}

.rail__btn:hover .rail__badge,
.rail__btn.is-active .rail__badge {
  background: #1b1b1b;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.rail__circle--success,
.rail__circle--success:hover,
.rail__circle--neutral {
  color: #ffffff;
}

.rail__marker,
.label-with-icon__icon,
.content__channel-icon,
.channel-row__icon,
.search-pill__icon,
.channel-group__chevron,
.icon-btn,
.ui-icon {
  color: #ffffff;
}

.icon-btn:hover,
.channel-row:hover,
.dm-row:hover,
.voice-room-member:hover,
.member-row:hover,
.friend-row:hover,
.nav-pill:hover {
  background: #171717;
  color: #ffffff;
}

.server-insight {
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.message:hover {
  background: rgba(255, 255, 255, 0.03);
}

.message-divider::before,
.message-divider::after {
  background: rgba(255, 255, 255, 0.08);
}

.content-shell--call .message-pane {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.composer textarea,
.search-pill input,
input,
textarea,
select {
  background: transparent;
  color: #ffffff;
}

input,
textarea,
select {
  border-color: rgba(255, 255, 255, 0.08);
}

input:focus,
textarea:focus,
select:focus,
.search-pill:focus-within {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.voice-dock {
  border-color: rgba(255, 255, 255, 0.08);
}

.voice-dock__meta span,
.message__content,
.message__header strong,
.panel-card__header strong,
.member-row strong,
.friend-row strong,
.user-card__meta strong {
  color: #ffffff;
}

.message__header span,
.message__edited,
.message__reply,
.sidebar__header span,
.content__title span,
.panel-card__header span,
.member-row span,
.friend-row span,
.voice-dock__meta span,
.user-card__meta span,
.channel-row small,
.dm-row span,
.server-insight__body span,
.message-divider,
.sidebar__section-title,
.members-panel__title,
.channel-group__title {
  color: #b8b8b8;
}

.label-with-icon,
.label-with-icon > span,
.label-with-icon__icon,
.header-label,
.header-label__icon {
  color: inherit;
}

.label-with-icon > span {
  display: inline-flex;
  align-items: center;
}

.status-dot--online {
  background: #ffffff;
}

.status-dot--idle {
  background: #d0d0d0;
}

.status-dot--dnd {
  background: #a8a8a8;
}

.status-dot--offline {
  background: #5e5e5e;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 84px 300px minmax(0, 1fr);
  }

  .members-panel {
    display: none;
  }

  .friends-grid {
    grid-template-columns: 1fr;
  }

  .call-stage__tiles {
    width: min(100%, 520px);
  }
}

@media (max-width: 940px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .app-shell--call {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 74px;
    width: 280px;
    z-index: 8;
  }

  .app-shell:not(.app-shell--home) .main-panel {
    width: calc(100% - 280px);
    margin-left: 280px;
  }
}

@media (max-width: 760px) {
  .auth-panel--hero {
    padding: 30px;
  }

  .auth-stats {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .app-shell:not(.app-shell--home) .main-panel {
    width: auto;
    margin-left: 0;
  }

  .app-shell {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .call-stage {
    min-height: 0;
    padding: 18px 14px 16px;
  }

  .call-stage__topbar,
  .call-stage__controls {
    flex-wrap: wrap;
  }

  .call-stage__tiles {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .call-stage__control {
    width: 56px;
    height: 56px;
  }

  .message-pane,
  .composer,
  .friends-grid {
    padding-left: 14px;
    padding-right: 14px;
  }
}

:root {
  --bg-app: #000000;
  --bg-rail: #000000;
  --bg-sidebar: #030308;
  --bg-sidebar-alt: #060610;
  --bg-main: #000000;
  --bg-panel: #07070f;
  --bg-elevated: #0b0b15;
  --bg-input: #0e0e18;
  --bg-card: rgba(139, 92, 246, 0.08);
  --bg-card-strong: rgba(139, 92, 246, 0.14);
  --bg-hover: rgba(139, 92, 246, 0.1);
  --bg-active: rgba(139, 92, 246, 0.16);
  --line-soft: rgba(139, 92, 246, 0.16);
  --line-hard: rgba(255, 255, 255, 0.06);
  --text-main: #ffffff;
  --text-soft: #ddd6fe;
  --text-dim: #a79fc8;
  --primary: #8b5cf6;
  --primary-strong: #6d28d9;
  --success: #8b5cf6;
  --danger: #ef4444;
  --warning: #a78bfa;
}

html,
body,
#app {
  background:
    radial-gradient(circle at top center, var(--bg-card-strong), transparent 24%),
    radial-gradient(circle at left center, var(--bg-card), transparent 28%),
    var(--bg-app);
}

body,
input,
textarea,
select,
button {
  color: var(--text-main);
}

.app-shell,
.main-panel,
.content-shell,
.message-pane,
.call-stage {
  background: var(--bg-app);
}

.sidebar,
.members-panel,
.user-card,
.panel-card,
.friend-row,
.member-row,
.voice-dock,
.composer__reply,
.stat-stack div,
.empty-state--small {
  background: var(--bg-panel);
}

.sidebar,
.members-panel,
.sidebar__header,
.content__header,
.message__actions,
.search-pill,
.composer__shell,
.modal,
.auth-panel--form,
.loading-card {
  background: var(--bg-sidebar);
}

.main-panel,
.content-shell,
.message-pane {
  background: var(--bg-app);
}

.app-shell--server {
  grid-template-columns: 360px minmax(0, 1fr) 300px;
  background: var(--bg-app);
}

.app-shell--server.app-shell--call {
  grid-template-columns: 360px minmax(0, 1fr);
}

.app-shell--home {
  grid-template-columns: 360px minmax(0, 1fr) 292px;
  width: min(1680px, calc(100% - 32px));
  margin: 0 auto;
  background: var(--bg-app);
}

.app-shell--home.app-shell--call {
  grid-template-columns: 360px minmax(0, 1fr);
}

.app-shell--home .sidebar {
  background: linear-gradient(180deg, var(--bg-sidebar) 0%, var(--bg-panel) 100%);
  border-right: 1px solid var(--line-soft);
}

.app-shell--home .sidebar__header,
.app-shell--home .user-card,
.app-shell--home .members-panel {
  background: var(--bg-panel);
}

.app-shell--home .user-card {
  border-color: var(--line-soft);
}

.app-shell--home .members-panel {
  border-left: 1px solid var(--line-soft);
}

.app-shell--home .content__header {
  background: var(--bg-app);
  border-bottom: 1px solid var(--line-soft);
}

.app-shell--home .main-panel {
  background: var(--bg-app);
}

.content-shell--home {
  min-height: 100vh;
  height: auto;
}

.home-stack {
  width: min(1060px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 20px 36px;
  display: grid;
  gap: 22px;
}

.content-shell--home .friends-grid {
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.panel-card {
  border: 1px solid rgba(139, 92, 246, 0.14);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.panel-card__header {
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.12);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.06), rgba(139, 92, 246, 0));
}

.panel-card__header--split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.server-directory {
  background: linear-gradient(180deg, rgba(18, 11, 32, 0.92), rgba(6, 6, 10, 0.96));
  border-color: rgba(139, 92, 246, 0.24);
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.06),
    0 20px 42px rgba(0, 0, 0, 0.42);
}

.server-directory__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.server-directory__list {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.server-directory__card {
  position: relative;
  width: 100%;
  padding: 18px 22px;
  border: 1px solid rgba(139, 92, 246, 0.16);
  border-radius: 22px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(13, 13, 21, 0.98), rgba(5, 5, 8, 0.98));
  color: #ffffff;
  text-align: left;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.server-directory__card:hover {
  transform: translateY(-1px);
  border-color: rgba(168, 85, 247, 0.44);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(139, 92, 246, 0.12);
  background: linear-gradient(135deg, rgba(20, 14, 34, 0.98), rgba(6, 6, 10, 0.98));
}

.server-directory__card.is-selected {
  border-color: rgba(168, 85, 247, 0.52);
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.22),
    0 22px 42px rgba(0, 0, 0, 0.44);
}

.server-directory__card-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, #a855f7 0%, #6d28d9 100%);
}

.server-directory__badge {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(221, 214, 254, 0.34), rgba(139, 92, 246, 0.22) 45%, rgba(139, 92, 246, 0.08) 75%),
    #0b0814;
  border: 1px solid rgba(168, 85, 247, 0.24);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.18);
}

.server-directory__body {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.server-directory__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.server-directory__title-wrap {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.server-directory__title-wrap strong {
  display: block;
  font-size: 1.05rem;
  color: #ffffff;
}

.server-directory__title-wrap span {
  color: #c3bbdf;
  line-height: 1.45;
}

.server-directory__invite {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.24);
  color: #ece3ff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.server-directory__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

.server-directory__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: #cfc7ec;
  font-size: 0.82rem;
}

.server-directory__meta span,
.server-directory__open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.server-directory__meta .ui-icon,
.server-directory__open .ui-icon {
  font-size: 1rem;
  color: #c4b5fd;
}

.server-directory__open {
  padding: 11px 15px;
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #f3e8ff;
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.server-directory__card:hover .server-directory__open {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(168, 85, 247, 0.34);
}

.button,
.button--ghost {
  background: #08080d;
  border: 1px solid rgba(139, 92, 246, 0.18);
  color: #ffffff;
}

.button:hover,
.button--ghost:hover {
  background: #12121b;
  border-color: rgba(168, 85, 247, 0.32);
}

.button--primary,
.composer__send {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border: 1px solid rgba(167, 139, 250, 0.34);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(91, 33, 182, 0.28);
}

.button--primary:hover,
.composer__send:hover {
  background: linear-gradient(135deg, #9f67ff, #7c3aed);
  border-color: rgba(221, 214, 254, 0.34);
}

.nav-pill,
.dm-row,
.channel-row,
.member-row,
.friend-row,
.search-pill,
.composer__shell,
.message__actions,
.icon-btn--toolbar,
.button--ghost,
.stat-stack div,
.server-insight,
.server-insight__icon,
.server-insight__meta {
  background: #09090f;
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.12);
}

.nav-pill.is-active,
.dm-row.is-active,
.channel-row.is-active,
.channel-row.is-voice-active,
.icon-btn.is-active {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.28);
  color: #ffffff;
}

.nav-pill:hover,
.dm-row:hover,
.channel-row:hover,
.friend-row:hover,
.member-row:hover,
.voice-room-member:hover,
.icon-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  color: #ffffff;
}

.label-with-icon__icon,
.content__channel-icon,
.channel-row__icon,
.search-pill__icon,
.channel-group__chevron,
.icon-btn,
.ui-icon,
.rail__marker {
  color: #f5f3ff;
}

.sidebar__header strong,
.content__title strong,
.panel-card__header strong,
.member-row strong,
.friend-row strong,
.user-card__meta strong,
.voice-dock__meta strong {
  color: #ffffff;
}

.sidebar__header span,
.content__title span,
.panel-card__header span,
.member-row span,
.friend-row span,
.voice-dock__meta span,
.user-card__meta span,
.channel-row small,
.dm-row span,
.server-insight__body span,
.message-divider,
.sidebar__section-title,
.members-panel__title,
.channel-group__title,
.server-directory__title-wrap span {
  color: #b4accf;
}

.empty-state--small {
  border: 1px dashed rgba(139, 92, 246, 0.18);
  color: #cbc5e1;
}

.search-pill:focus-within,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(168, 85, 247, 0.42);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.message:hover {
  background: rgba(139, 92, 246, 0.05);
}

.message-divider::before,
.message-divider::after {
  background: rgba(139, 92, 246, 0.16);
}

@media (max-width: 1280px) {
  .app-shell--home {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .app-shell--home .members-panel {
    display: none;
  }

  .content-shell--home .friends-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 940px) {
  .app-shell--home,
  .app-shell--home.app-shell--call {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, calc(100% - 24px));
  }

  .app-shell--home .sidebar {
    display: none;
    position: static;
    inset: auto;
    width: auto;
  }

  .app-shell--home .main-panel {
    margin-left: 0;
  }

  .home-stack {
    width: min(100%, calc(100% - 24px));
    padding: 18px 12px 28px;
  }

  .server-directory__card {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
  }

  .server-directory__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .server-directory__cta {
    grid-column: 2;
    justify-self: start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .app-shell--home,
  .app-shell--home.app-shell--call {
    width: min(100%, calc(100% - 16px));
  }

  .content-shell--home .content__header {
    padding: 16px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .panel-card__header--split {
    flex-direction: column;
  }

  .server-directory__actions {
    width: 100%;
  }

  .server-directory__actions .button {
    flex: 1 1 160px;
  }

  .server-directory__card {
    padding: 16px;
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .server-directory__badge {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }
}

@media (max-width: 1180px) {
  .app-shell--server,
  .app-shell--server.app-shell--call {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 940px) {
  .app-shell--server,
  .app-shell--server.app-shell--call {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell--server .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    z-index: 8;
  }

  .app-shell--server .main-panel {
    width: calc(100% - 280px);
    margin-left: 280px;
  }
}

@media (max-width: 760px) {
  .app-shell--server,
  .app-shell--server.app-shell--call {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell--server .sidebar {
    display: none;
  }

  .app-shell--server .main-panel {
    width: auto;
    margin-left: 0;
  }
}

.modal-backdrop--settings {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
}

.modal--settings {
  width: min(1380px, calc(100vw - 24px));
  height: min(860px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  min-height: 0;
  padding: 0;
  border-radius: 30px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: #1d1f24;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

.settings-sidebar {
  min-width: 0;
  min-height: 0;
  padding: 24px 18px;
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: linear-gradient(180deg, #191a1f 0%, #15161a 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-sidebar__profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 8px 10px;
}

.settings-sidebar__avatar .avatar {
  width: 48px;
  height: 48px;
  font-size: 0.92rem;
}

.settings-sidebar__profile-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-sidebar__profile-copy strong {
  font-size: 1rem;
  color: #ffffff;
}

.settings-sidebar__profile-copy span,
.settings-sidebar__profile-copy small {
  color: var(--text-soft);
}

.settings-sidebar__profile-copy small {
  font-size: 0.8rem;
}

.settings-sidebar__search {
  position: relative;
}

.settings-sidebar__search input {
  padding-left: 40px;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.07);
}

.settings-sidebar__search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--text-soft);
  display: inline-flex;
}

.settings-sidebar__group {
  display: grid;
  gap: 8px;
}

.settings-sidebar__label {
  padding: 0 10px;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-sidebar__items {
  display: grid;
  gap: 4px;
}

.settings-sidebar__item {
  width: 100%;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  color: var(--text-soft);
}

.settings-sidebar__item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: none;
}

.settings-sidebar__item.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.settings-sidebar__item-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex: 0 0 auto;
  margin-top: 2px;
}

.settings-sidebar__item-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-sidebar__item-copy strong {
  color: inherit;
  font-size: 0.95rem;
}

.settings-sidebar__item-copy span {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.45;
}

.settings-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: linear-gradient(180deg, #1f2025 0%, #1b1c20 100%);
}

.settings-content__header {
  padding: 22px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.settings-content__eyebrow {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-content__header h2 {
  margin: 0;
  font-size: 1.28rem;
  color: #ffffff;
}

.settings-content__header p {
  margin: 8px 0 0;
  color: var(--text-soft);
  max-width: 56ch;
}

.settings-content__close {
  flex: 0 0 auto;
}

.settings-content__body {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 28px 32px 36px;
}

.settings-form {
  display: grid;
  gap: 22px;
  min-height: min-content;
}

.settings-tabs {
  display: flex;
  gap: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-tab {
  position: relative;
  padding: 0 0 10px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
}

.settings-tab:hover {
  transform: none;
  color: #ffffff;
}

.settings-tab.is-active {
  color: #ffffff;
}

.settings-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -15px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6d6ef9, #9d7dff);
}

.settings-hero {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(13, 13, 17, 0.98), rgba(15, 15, 18, 0.98));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
}

.settings-hero__banner {
  position: relative;
  min-height: 176px;
  background:
    linear-gradient(135deg, rgba(221, 165, 109, 0.92), rgba(188, 138, 90, 0.94) 46%, rgba(103, 71, 255, 0.8) 100%),
    #c78f63;
}

.settings-hero__banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(12, 12, 16, 0.68) 100%);
  z-index: 1;
}

.settings-hero.has-banner .settings-hero__banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
  z-index: 0;
}

.settings-hero__body {
  position: relative;
  margin-top: -52px;
  padding: 0 26px 24px;
}

.settings-hero__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.settings-hero__identity {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.settings-hero__avatar {
  flex: 0 0 auto;
}

.settings-hero__avatar .avatar--call {
  width: 92px;
  height: 92px;
  font-size: 1.45rem;
  border: 6px solid #15161a;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}

.settings-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.settings-hero__upload {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 14, 0.72);
  color: #ffffff;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  z-index: 2;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.settings-hero__upload:hover {
  transform: translateY(-1px);
  background: rgba(18, 18, 24, 0.86);
  border-color: rgba(255, 255, 255, 0.24);
}

.settings-hero__upload-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-hero__upload--banner {
  right: 18px;
  bottom: 18px;
  padding: 11px 16px;
}

.settings-hero__upload--banner .settings-hero__upload-text {
  font-size: 0.82rem;
  font-weight: 600;
}

.settings-hero__upload--avatar {
  right: -2px;
  bottom: 6px;
  width: 34px;
  height: 34px;
  padding: 0;
}

.settings-hero__upload--avatar .settings-hero__upload-text {
  display: none;
}

.settings-hero__meta {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding-bottom: 6px;
}

.settings-hero__meta strong {
  font-size: 1.9rem;
  color: #ffffff;
  line-height: 1;
}

.settings-hero__meta > span {
  color: var(--text-soft);
}

.settings-hero__save {
  align-self: center;
  white-space: nowrap;
}

.settings-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  font-size: 0.82rem;
}

.settings-pill--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.settings-tab-panel {
  display: none;
}

.settings-tab-panel.is-active {
  display: grid;
  gap: 22px;
}

.settings-panel-card {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(12, 12, 16, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.settings-panel-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.settings-panel-card__header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.02rem;
}

.settings-panel-card__header p {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.settings-field-list {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.settings-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  align-items: start;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.02);
}

.settings-field-row + .settings-field-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-field-row__label {
  display: grid;
  gap: 6px;
}

.settings-field-row__label strong {
  color: #ffffff;
}

.settings-field-row__label span {
  color: var(--text-soft);
  line-height: 1.55;
}

.settings-field-row__control {
  display: grid;
  gap: 10px;
  align-content: start;
}

.settings-readonly {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.settings-note {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  line-height: 1.6;
}

.settings-upload-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-upload-summary__item {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 8px;
}

.settings-upload-summary__item strong {
  color: #ffffff;
}

.settings-upload-summary__item span,
.settings-upload-summary__item small {
  color: var(--text-soft);
  line-height: 1.55;
}

.settings-status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 22px;
}

.settings-preview-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 14px;
}

.settings-preview-card__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.settings-preview-card__status .status-dot {
  position: static;
  box-shadow: none;
}

.settings-preview-card__bio {
  color: var(--text-soft);
  line-height: 1.65;
  min-height: 64px;
}

.settings-preview-card__line {
  color: var(--text-soft);
}

.settings-gif-preview {
  margin-top: 18px;
  min-height: 240px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

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

.settings-gif-preview--empty {
  padding: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  color: var(--text-soft);
}

.settings-gif-preview--empty strong {
  color: #ffffff;
}

.settings-placeholder {
  min-height: 420px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(12, 12, 16, 0.6);
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
}

.settings-placeholder__icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(109, 110, 249, 0.14);
  color: #ffffff;
}

.settings-placeholder h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.2rem;
}

.settings-placeholder p {
  margin: 0;
  color: var(--text-soft);
  max-width: 42ch;
  line-height: 1.6;
}

.settings-empty-search {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  text-align: center;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-actions .button {
  min-width: 180px;
}

.settings-toggle-list {
  display: grid;
  gap: 14px;
}

.settings-toggle {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.settings-toggle__copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.settings-toggle__copy strong {
  color: #ffffff;
}

.settings-toggle__copy span {
  color: var(--text-soft);
  line-height: 1.55;
}

.settings-toggle__control {
  position: relative;
  flex: 0 0 auto;
}

.settings-toggle__control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle__track {
  width: 52px;
  height: 30px;
  display: inline-block;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  transition: background 0.18s ease;
}

.settings-toggle__track::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.18s ease;
}

.settings-toggle__control input:checked + .settings-toggle__track {
  background: var(--primary);
}

.settings-toggle__control input:checked + .settings-toggle__track::after {
  transform: translateX(22px);
}

.settings-range {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-range input[type='range'] {
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.settings-range strong {
  min-width: 42px;
  text-align: right;
  color: #ffffff;
}

.settings-range-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 14px;
}

.settings-range-card strong {
  color: #ffffff;
}

.settings-range-card span {
  color: var(--text-soft);
}

.settings-social-preview {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 10px;
}

.settings-social-preview strong {
  color: #ffffff;
  font-size: 1.05rem;
}

.settings-social-preview span {
  color: var(--text-soft);
}

.settings-social-preview__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-social-preview__links a,
.settings-social-preview__links span {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  text-decoration: none;
}

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

.settings-mini-grid div,
.settings-device-grid div {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 6px;
}

.settings-mini-grid strong,
.settings-device-grid strong {
  color: #ffffff;
}

.settings-mini-grid span,
.settings-device-grid span {
  color: var(--text-soft);
}

.settings-color-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.settings-color-preview span {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  flex: 0 0 auto;
}

.settings-color-preview strong {
  color: #ffffff;
}

.settings-color-preview small {
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

body.app-compact .panel-card__header,
body.app-compact .settings-panel-card,
body.app-compact .settings-field-row,
body.app-compact .friend-row,
body.app-compact .member-row,
body.app-compact .message {
  padding-top: 12px;
  padding-bottom: 12px;
}

body.app-reduce-motion *,
body.app-reduce-motion *::before,
body.app-reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

@media (max-width: 1160px) {
  .modal--settings {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .settings-field-row {
    grid-template-columns: 1fr;
  }

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

  .settings-mini-grid,
  .settings-device-grid,
  .settings-upload-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .modal--settings {
    width: min(100vw - 18px, 100%);
    height: min(100vh - 18px, 100%);
    max-height: calc(100vh - 18px);
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    max-height: 300px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .settings-content__body {
    padding: 22px 18px 28px;
  }

  .settings-actions .button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .modal-backdrop--settings {
    padding: 8px;
  }

  .settings-sidebar {
    padding: 18px 14px;
  }

  .settings-content__header {
    padding: 18px 16px;
  }

  .settings-hero__top,
  .settings-hero__identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-hero__meta strong {
    font-size: 1.5rem;
  }

  .settings-hero__save {
    width: 100%;
  }

  .settings-hero__upload--banner {
    left: 16px;
    right: 16px;
    justify-content: center;
  }

  .settings-tabs {
    gap: 16px;
    overflow: auto;
  }

  .settings-toggle {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-range,
  .settings-color-preview,
  .settings-social-preview__links {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-mini-grid,
  .settings-device-grid,
  .settings-upload-summary {
    grid-template-columns: 1fr;
  }
}

.nav-pill__badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.2);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.server-badge {
  border-radius: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.04em;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08) 34%, transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--server-accent) 80%, #ffffff 20%), rgba(7, 7, 12, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.22);
}

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

.server-badge--rail {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  font-size: 0.84rem;
}

.server-badge--directory {
  width: 64px;
  height: 64px;
  font-size: 1rem;
}

.server-badge--preview {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  font-size: 1.08rem;
}

.rail__btn:hover .server-badge--rail,
.rail__btn.is-active .server-badge--rail {
  transform: scale(1.02);
  border-color: rgba(255, 255, 255, 0.18);
}

.settings-field-row--upload .settings-field-row__control {
  align-items: start;
}

.settings-upload-trigger {
  position: relative;
  width: fit-content;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-upload-field__meta {
  display: grid;
  gap: 4px;
}

.settings-upload-field__meta strong {
  color: #ffffff;
}

.settings-upload-field__meta span {
  color: var(--text-soft);
  line-height: 1.5;
}

.settings-upload-field__preview {
  max-width: 240px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.settings-upload-field__preview img {
  width: 100%;
  height: 132px;
  display: block;
  object-fit: cover;
}

.home-stack--friends {
  width: min(1160px, calc(100% - 40px));
}

.home-stack--servers {
  width: min(1180px, calc(100% - 40px));
}

.friends-page {
  display: grid;
  gap: 18px;
}

.friends-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(139, 92, 246, 0.12);
  background: linear-gradient(180deg, rgba(17, 17, 24, 0.96), rgba(9, 9, 14, 0.98));
}

.friends-toolbar__nav {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.friends-toolbar__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
}

.friends-toolbar__label-icon,
.friends-toolbar__label-icon .ui-icon {
  display: inline-flex;
  color: var(--text-soft);
}

.friends-toolbar__divider {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.friends-toolbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.friends-toolbar__search {
  width: min(320px, 32vw);
  min-width: 220px;
}

.friends-tab {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}

.friends-tab small {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.22);
  color: #efe7ff;
  font-size: 0.68rem;
  font-weight: 700;
}

.friends-tab.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.friends-tab--primary {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border-color: rgba(221, 214, 254, 0.28);
  box-shadow: 0 12px 26px rgba(109, 40, 217, 0.26);
}

.friends-tab--primary.is-active,
.friends-tab--primary:hover {
  background: linear-gradient(135deg, #9a67ff, #7c3aed);
  border-color: rgba(238, 229, 255, 0.36);
}

.friends-tab:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.05);
}

.friends-tab--primary small {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.friends-layout,
.friends-layout__main {
  display: grid;
  gap: 18px;
}

.friends-layout__section {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(9, 9, 14, 0.96);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.24);
}

.friends-section-header {
  margin-bottom: 16px;
  color: #ffffff;
}

.friends-entry-list {
  display: grid;
  gap: 10px;
}

.friend-entry {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(139, 92, 246, 0.12);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.friend-entry__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.friend-entry__copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.friend-entry__copy strong,
.friend-entry__copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-entry__copy strong {
  color: #ffffff;
}

.friend-entry__copy span {
  color: var(--text-soft);
}

.friend-entry__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.friends-page__banner {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(139, 92, 246, 0.14);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(7, 7, 12, 0.96));
  display: grid;
  gap: 6px;
}

.friends-page__banner strong {
  color: #ffffff;
}

.friends-page__banner span {
  color: var(--text-soft);
}

.friends-add-card {
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.members-panel--activity {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.activity-feed {
  display: grid;
  gap: 14px;
}

.activity-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(14, 14, 20, 0.96), rgba(8, 8, 12, 0.96));
  display: grid;
  gap: 12px;
}

.activity-card--feature {
  background: linear-gradient(180deg, rgba(24, 17, 38, 0.96), rgba(9, 9, 14, 0.98));
  border-color: rgba(139, 92, 246, 0.18);
}

.activity-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-card__copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.activity-card__copy strong {
  color: #ffffff;
}

.activity-card__copy span,
.activity-card__body span {
  color: var(--text-soft);
  line-height: 1.5;
}

.server-directory__list-wrap {
  min-height: 0;
  max-height: calc(100vh - 280px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.server-directory__list {
  padding: 18px;
}

.server-directory__card {
  min-height: 230px;
  padding: 92px 22px 22px;
  align-items: end;
}

.server-directory__card-accent {
  background: linear-gradient(180deg, var(--server-card-accent), rgba(255, 255, 255, 0.1));
}

.server-directory__cover {
  position: absolute;
  inset: 0 0 auto 0;
  height: 108px;
  border-radius: 22px 22px 0 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--server-card-accent) 72%, #ffffff 28%), rgba(7, 7, 12, 0.98)),
    #141420;
}

.server-directory__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(7, 7, 12, 0.82) 100%);
}

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

.server-directory__badge-wrap,
.server-directory__body,
.server-directory__cta {
  position: relative;
  z-index: 1;
}

.server-directory__badge-wrap {
  margin-top: -44px;
}

.server-directory__pagination {
  padding: 0 18px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-soft);
}

.modal--server-settings {
  width: min(1440px, calc(100vw - 24px));
  height: min(920px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  min-height: 0;
  padding: 0;
  border-radius: 30px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: #1d1f24;
  border-color: rgba(255, 255, 255, 0.06);
}

.server-settings__nav {
  min-height: 0;
  padding: 28px 16px;
  display: grid;
  align-content: start;
  gap: 18px;
  background: linear-gradient(180deg, #16181d 0%, #121318 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.server-settings__nav-label {
  padding: 0 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.server-settings__nav-group {
  display: grid;
  gap: 6px;
}

.server-settings__nav-item {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
}

.server-settings__nav-item.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.server-settings__content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.server-settings__header {
  padding: 22px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.server-settings__header h2 {
  margin: 0;
  color: #ffffff;
}

.server-settings__header p {
  margin: 8px 0 0;
  color: var(--text-soft);
}

.server-settings__body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 26px 30px 34px;
}

.server-settings__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 300px;
  gap: 22px;
  align-items: start;
}

.server-settings__main {
  display: grid;
  gap: 22px;
}

.server-settings__upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.server-upload-card {
  position: relative;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(139, 92, 246, 0.24);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.server-upload-card__title {
  color: #ffffff;
  font-weight: 700;
}

.server-upload-card__meta {
  color: var(--text-soft);
  line-height: 1.5;
}

.server-settings__color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.server-swatch {
  height: 68px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.28), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--server-swatch) 72%, #ffffff 28%), var(--server-swatch));
}

.server-swatch.is-active {
  box-shadow: 0 0 0 2px rgba(221, 214, 254, 0.5);
}

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

.server-settings__preview {
  position: sticky;
  top: 0;
}

.server-preview-card {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 9, 14, 0.98);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.3);
}

.server-preview-card__banner {
  height: 130px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--server-card-accent) 72%, #ffffff 28%), rgba(7, 7, 12, 0.98)),
    #111111;
}

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

.server-preview-card__body {
  padding: 20px 18px 18px;
  display: grid;
  gap: 10px;
}

.server-preview-card__icon {
  margin-top: -56px;
}

.server-preview-card__body strong {
  color: #ffffff;
  font-size: 1.05rem;
}

.server-preview-card__body span {
  color: var(--text-soft);
  line-height: 1.5;
}

.server-preview-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 1280px) {
  .server-settings__layout {
    grid-template-columns: 1fr;
  }

  .server-settings__preview {
    position: static;
  }
}

@media (max-width: 920px) {
  .friends-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .friends-toolbar__actions {
    margin-left: 0;
  }

  .friends-toolbar__search {
    width: 100%;
    min-width: 0;
  }

  .modal--server-settings {
    grid-template-columns: 1fr;
    height: min(100vh - 18px, 100%);
  }

  .server-settings__nav {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .server-settings__upload-grid,
  .server-settings__tags-grid {
    grid-template-columns: 1fr;
  }

  .server-settings__color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .home-stack--friends,
  .home-stack--servers {
    width: min(100%, calc(100% - 20px));
  }

  .friends-toolbar__nav,
  .friends-toolbar__actions,
  .server-directory__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .friends-toolbar__divider {
    display: none;
  }

  .friends-tab,
  .friends-tab--primary {
    width: 100%;
    justify-content: space-between;
  }

  .friend-entry,
  .server-directory__pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .server-directory__card {
    padding: 82px 16px 16px;
    grid-template-columns: 1fr;
  }

  .server-directory__badge-wrap {
    margin-top: -10px;
  }

  .server-directory__cta {
    justify-self: stretch;
    flex-wrap: wrap;
  }
}
