/* SLIMER Professional UI
   This layer intentionally sits above the legacy stylesheet while the product
   keeps its existing behavior and DOM contracts. */

:root {
  --font-body: "Manrope", "Aptos", "Segoe UI Variable", sans-serif;
  --font-display: "Sora", "Manrope", "Aptos Display", sans-serif;
  --sl-bg: #08070d;
  --sl-bg-raised: #0d0b14;
  --sl-surface: rgba(18, 15, 27, 0.94);
  --sl-surface-raised: rgba(26, 21, 38, 0.96);
  --sl-surface-hover: rgba(38, 29, 55, 0.76);
  --sl-line: rgba(255, 255, 255, 0.075);
  --sl-line-bright: rgba(175, 105, 255, 0.32);
  --sl-text: #f7f4fb;
  --sl-text-soft: #c6c0cf;
  --sl-text-muted: #8f889b;
  --sl-violet: #8b3dff;
  --sl-violet-light: #b875ff;
  --sl-green: #98f33d;
  --sl-cyan: #52dfff;
  --sl-danger: #ff5d76;
  --sl-warning: #ffcc66;
  --sl-radius-xs: 8px;
  --sl-radius-sm: 12px;
  --sl-radius-md: 16px;
  --sl-radius-lg: 22px;
  --sl-radius-xl: 30px;
  --sl-shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
  --sl-shadow-md: 0 18px 54px rgba(0, 0, 0, 0.34);
  --sl-shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.52);
  --sl-focus: 0 0 0 3px rgba(139, 61, 255, 0.24);
  --bg-1: var(--sl-bg);
  --bg-2: #0e0b16;
  --bg-3: #171021;
  --surface-0: rgba(8, 7, 13, 0.98);
  --surface-1: var(--sl-surface);
  --surface-2: var(--sl-surface-raised);
  --surface-3: rgba(39, 29, 55, 0.96);
  --surface-4: rgba(71, 43, 108, 0.96);
  --line: var(--sl-line);
  --line-strong: var(--sl-line-bright);
  --text: var(--sl-text);
  --text-strong: #ffffff;
  --muted: var(--sl-text-soft);
  --subtle: var(--sl-text-muted);
  --brand: var(--sl-violet);
  --brand-strong: var(--sl-violet-light);
  --brand-cyan: var(--sl-cyan);
  --brand-green: var(--sl-green);
  --overlay: rgba(3, 2, 6, 0.78);
  --shadow: var(--sl-shadow-md);
  --shadow-glow: 0 0 0 1px rgba(139, 61, 255, 0.2), 0 14px 38px rgba(44, 10, 83, 0.26);
}

body[data-theme="tactical"] {
  --sl-violet: #2d83d8;
  --sl-violet-light: #70c5ff;
  --sl-green: #4ce0b3;
  --sl-cyan: #77e7ff;
  --sl-bg: #071018;
  --sl-bg-raised: #0b1722;
  --sl-surface: rgba(12, 25, 36, 0.94);
  --sl-surface-raised: rgba(18, 36, 52, 0.96);
  --sl-surface-hover: rgba(29, 54, 75, 0.78);
  --sl-line-bright: rgba(112, 197, 255, 0.3);
}

body[data-theme="war-room"] {
  --sl-violet: #e75834;
  --sl-violet-light: #ff9363;
  --sl-green: #ffc85f;
  --sl-cyan: #ffb36f;
  --sl-bg: #100708;
  --sl-bg-raised: #1a0c0e;
  --sl-surface: rgba(29, 13, 16, 0.95);
  --sl-surface-raised: rgba(43, 18, 21, 0.96);
  --sl-surface-hover: rgba(68, 28, 29, 0.78);
  --sl-line-bright: rgba(255, 147, 99, 0.3);
}

html,
body {
  background: var(--sl-bg);
  color: var(--sl-text);
  font-family: var(--font-body);
  letter-spacing: -0.012em;
}

body::before {
  opacity: 0.34;
  background:
    radial-gradient(circle at 8% 8%, rgba(139, 61, 255, 0.18), transparent 24%),
    radial-gradient(circle at 93% 8%, rgba(82, 223, 255, 0.09), transparent 22%),
    radial-gradient(circle at 78% 95%, rgba(152, 243, 61, 0.055), transparent 22%);
}

body::after {
  opacity: 0.16;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

::selection {
  color: #fff;
  background: rgba(139, 61, 255, 0.54);
}

button,
input,
textarea,
select {
  letter-spacing: -0.01em;
}

button {
  -webkit-tap-highlight-color: transparent;
}

:is(button, input, textarea, select, summary):focus-visible {
  outline: none;
  box-shadow: var(--sl-focus) !important;
}

.ui-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.ui-icon.is-solid {
  fill: currentColor;
  stroke: none;
}

.button-icon-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.slimer-reaction-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, rgba(184, 117, 255, 0.95), rgba(94, 31, 208, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 5px 14px rgba(80, 24, 157, 0.28);
}

.slimer-reaction-icon .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  stroke-width: 2;
}

.slimer-reaction-icon[data-reaction="heart"] {
  color: #fff;
  background: linear-gradient(145deg, #ff7090, #e63869);
}

.slimer-reaction-icon[data-reaction="joy"] {
  color: #2b1600;
  background: linear-gradient(145deg, #ffe17a, #ffad2f);
}

.slimer-reaction-icon[data-reaction="fire"] {
  color: #2b1000;
  background: linear-gradient(145deg, #ffcf5c, #ff713d);
}

.slimer-reaction-icon[data-reaction="clap"] {
  color: #1c2c04;
  background: linear-gradient(145deg, #caff70, #69c938);
}

.slimer-reaction-icon[data-reaction="rocket"] {
  color: #05252b;
  background: linear-gradient(145deg, #8ef3ff, #43bedd);
}

.slimer-reaction-fallback {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-family: "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 15px;
  line-height: 1;
}

.quick-emoji-btn {
  min-width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 5px;
  border: 1px solid var(--sl-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.quick-emoji-btn:hover {
  border-color: rgba(184, 117, 255, 0.22);
  background: rgba(139, 61, 255, 0.1);
}

.quick-emoji-btn .slimer-reaction-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.reaction-count {
  min-width: 9px;
  text-align: center;
}

.profile-tab-btn .ui-icon,
.server-tab-btn .ui-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.primary-btn .ui-icon,
.ghost-btn .ui-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.composer-send-btn .ui-icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

input,
textarea,
select {
  border: 1px solid var(--sl-line);
  border-radius: var(--sl-radius-sm);
  background: rgba(5, 4, 9, 0.66);
  color: var(--sl-text);
  min-height: 46px;
  padding: 11px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(139, 61, 255, 0.72);
  background: rgba(9, 7, 14, 0.92);
  box-shadow: var(--sl-focus);
}

label,
.theme-switcher-label {
  color: var(--sl-text-muted);
  font-family: var(--font-body) !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.primary-btn,
.ghost-btn,
.sidebar-mini-btn {
  min-height: 42px;
  border-radius: var(--sl-radius-sm);
  padding: 0 16px;
  font-weight: 800;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.primary-btn {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, var(--sl-violet-light), var(--sl-violet) 58%, #6718d5);
  box-shadow: 0 10px 24px rgba(104, 34, 207, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(104, 34, 207, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.primary-btn:active,
.ghost-btn:active {
  transform: translateY(0) scale(0.98);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  transform: none;
  opacity: 0.46;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-btn,
.sidebar-mini-btn {
  color: var(--sl-text-soft);
  border: 1px solid var(--sl-line);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.ghost-btn:hover,
.sidebar-mini-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
}

.ghost-btn.dangerish {
  color: #ff9bad;
}

.ghost-btn.dangerish:hover {
  color: #fff;
  border-color: rgba(255, 93, 118, 0.3);
  background: rgba(255, 93, 118, 0.14);
}

.ghost-icon-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: var(--sl-text-soft);
  border: 1px solid var(--sl-line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0;
  box-shadow: none;
}

.ghost-icon-btn:hover {
  color: #fff;
  border-color: rgba(184, 117, 255, 0.3);
  background: rgba(139, 61, 255, 0.12);
  transform: none;
}

.eyebrow,
.sidebar-section-label,
.channel-group-title,
.server-head-eyebrow {
  color: var(--sl-text-muted);
  font-family: var(--font-body) !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.115em;
  line-height: 1.2;
  text-shadow: none;
  text-transform: uppercase;
}

/* Authentication */
.auth-screen {
  isolation: isolate;
  background:
    radial-gradient(circle at 16% 18%, rgba(139, 61, 255, 0.2), transparent 30%),
    radial-gradient(circle at 88% 76%, rgba(82, 223, 255, 0.08), transparent 28%),
    linear-gradient(145deg, #08070d 0%, #0b0712 52%, #070910 100%);
}

.stars {
  opacity: 0.5;
}

.brand-bar {
  padding: 30px 36px 0;
  gap: 14px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(184, 117, 255, 0.22);
  box-shadow: var(--sl-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-title {
  font-family: var(--font-display) !important;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--sl-text-muted);
  font-size: 13px;
}

.auth-center {
  padding: 42px 28px;
}

.auth-panel {
  width: min(1040px, 100%);
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, 0.92fr);
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(184, 117, 255, 0.2);
  background: rgba(13, 10, 20, 0.9);
  box-shadow: var(--sl-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(26px);
}

.auth-form {
  padding: 54px 56px;
}

.auth-form h2,
.auth-side h3 {
  font-family: var(--font-display) !important;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.04em;
  text-transform: none;
}

.auth-form p {
  max-width: 540px;
  margin: 12px 0 30px;
  color: var(--sl-text-muted);
  line-height: 1.65;
}

.auth-form .stack {
  gap: 18px;
}

.auth-actions {
  margin-top: 24px;
}

.auth-side {
  position: relative;
  display: grid;
  place-items: center;
  padding: 34px;
  border-left: 1px solid var(--sl-line);
  background:
    radial-gradient(circle at 50% 14%, rgba(139, 61, 255, 0.18), transparent 48%),
    rgba(255, 255, 255, 0.012);
}

.auth-side-box {
  max-width: 390px;
  gap: 16px;
}

.auth-banner {
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 18px;
  background: #090611;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(184, 117, 255, 0.14);
}

.auth-side-kicker {
  color: var(--sl-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-side h3 {
  font-size: 24px;
}

.auth-side p {
  margin: 0;
  color: var(--sl-text-muted);
  line-height: 1.6;
}

.auth-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-feature-row span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--sl-line);
  font-size: 10px;
  font-weight: 700;
}

/* Application shell */
.chat-screen {
  grid-template-columns: 76px 270px minmax(0, 1fr);
  min-height: 100dvh;
  height: 100dvh;
  background: var(--sl-bg);
}

.workspace-rail {
  position: relative;
  z-index: 5;
  gap: 10px;
  padding: 12px 10px;
  background: linear-gradient(180deg, rgba(13, 10, 20, 0.99), rgba(7, 6, 11, 0.99));
  border-right: 1px solid var(--sl-line);
  box-shadow: 10px 0 34px rgba(0, 0, 0, 0.18);
}

.rail-brand {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  overflow: hidden;
  border-radius: 15px;
  border: 1px solid rgba(184, 117, 255, 0.26);
  box-shadow: 0 10px 28px rgba(75, 20, 155, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

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

.rail-top {
  gap: 8px;
}

.rail-action,
.rail-profile,
.server-avatar-button {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  flex-basis: 46px;
  border-radius: 14px;
  color: var(--sl-text-soft);
  border: 1px solid var(--sl-line);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
  transition: transform 160ms ease, border-radius 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.rail-action:hover,
.server-avatar-button:hover,
.rail-profile:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: rgba(184, 117, 255, 0.3);
  background: rgba(139, 61, 255, 0.12);
}

.rail-action[data-rail-kind="create"],
.rail-action[data-rail-kind="join"],
.workspace-home-button[data-rail-kind="direct"] {
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0;
}

.rail-action .ui-icon,
.workspace-home-button .ui-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}

.server-avatar-button.active,
.workspace-home-button.active {
  color: #fff;
  border-color: rgba(184, 117, 255, 0.48);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(139, 61, 255, 0.34), rgba(88, 30, 171, 0.2));
  box-shadow: 0 10px 28px rgba(80, 23, 157, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.server-avatar-button.active::before,
.workspace-home-button.active::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--sl-green);
  box-shadow: 0 0 14px rgba(152, 243, 61, 0.44);
}

.rail-divider {
  width: 30px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
}

.workspace-servers {
  gap: 8px;
  scrollbar-width: none;
}

.workspace-servers::-webkit-scrollbar {
  display: none;
}

.rail-profile {
  margin-top: auto;
  box-shadow: 0 0 0 2px rgba(152, 243, 61, 0.08);
}

.server-icon-frame-layer {
  inset: -3px;
  opacity: 0.84;
}

.chat-sidebar {
  background: linear-gradient(180deg, rgba(17, 14, 24, 0.99), rgba(11, 9, 16, 0.99));
  border-right: 1px solid var(--sl-line);
}

.server-head {
  min-height: 74px;
  padding: 14px 14px 13px 18px;
  border-bottom: 1px solid var(--sl-line);
  background: rgba(255, 255, 255, 0.012);
}

.server-head-copy {
  display: grid;
  gap: 5px;
}

.server-head h1 {
  font-family: var(--font-display) !important;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.025em;
  text-transform: none;
}

.channel-sections,
.direct-message-section.workspace-mode {
  padding: 16px 12px 20px;
  scrollbar-gutter: stable;
}

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

.channel-group-title,
.sidebar-section-label {
  margin: 0 8px 8px;
}

.channel-item {
  min-height: 42px;
  margin-bottom: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--sl-text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.channel-item:hover {
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.042);
  border-color: transparent;
}

.channel-item.active {
  color: #fff;
  border-color: rgba(184, 117, 255, 0.13);
  background: linear-gradient(90deg, rgba(139, 61, 255, 0.22), rgba(139, 61, 255, 0.075));
  box-shadow: inset 3px 0 0 var(--sl-violet-light);
}

.channel-main {
  gap: 9px;
}

.channel-main > span {
  color: var(--sl-text-muted);
  font-size: 18px;
  font-weight: 500;
}

.channel-main strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-voice-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  flex: 0 0 18px;
  place-items: center;
}

.channel-voice-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.voice-channel-item.active {
  box-shadow: inset 3px 0 0 var(--sl-green);
}

.voice-sidebar-member {
  width: calc(100% - 20px);
  min-height: 34px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 2px 10px 3px;
  padding: 4px 7px 4px 15px;
  border: 0;
  border-radius: 9px;
  color: var(--sl-text-muted);
  background: transparent;
  text-align: left;
  font: 600 11px/1.2 var(--font-body);
}

.voice-sidebar-member:hover {
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.035);
}

.voice-sidebar-member.speaking {
  color: #fff;
  background: rgba(152, 243, 61, 0.07);
}

.voice-sidebar-avatar {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #7138ef, #3b27a8);
  font-size: 10px;
  font-weight: 800;
}

.voice-sidebar-member.speaking .voice-sidebar-avatar {
  border-color: var(--sl-green);
  box-shadow: 0 0 0 2px rgba(152, 243, 61, 0.13), 0 0 14px rgba(152, 243, 61, 0.16);
}

.voice-sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.voice-sidebar-muted {
  color: var(--sl-danger);
  font-size: 16px;
}

.voice-dock {
  position: relative;
  z-index: 3;
  margin-top: auto;
  padding: 13px 12px 12px;
  border-top: 1px solid rgba(152, 243, 61, 0.16);
  background:
    radial-gradient(circle at 15% 0%, rgba(152, 243, 61, 0.1), transparent 48%),
    rgba(13, 11, 18, 0.98);
  box-shadow: 0 -16px 30px rgba(0, 0, 0, 0.22);
}

.voice-dock-status {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.voice-dock-status div {
  min-width: 0;
}

.voice-dock-status strong,
.voice-dock-status span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-dock-status strong {
  color: var(--sl-green);
  font-size: 11px;
  font-weight: 750;
}

.voice-dock-status span {
  margin-top: 2px;
  color: var(--sl-text-muted);
  font-size: 10px;
}

.voice-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sl-green);
  box-shadow: 0 0 12px rgba(152, 243, 61, 0.6);
}

.voice-dock-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 11px;
}

.voice-control-btn {
  height: 35px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.045);
}

.voice-control-btn:hover,
.voice-control-btn.active {
  color: #fff;
  border-color: rgba(184, 117, 255, 0.24);
  background: rgba(139, 61, 255, 0.16);
}

.voice-control-btn.danger:hover {
  border-color: rgba(255, 93, 118, 0.28);
  background: rgba(255, 93, 118, 0.16);
}

.voice-control-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-stage {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 20px;
  overflow: hidden auto;
  padding: clamp(22px, 4vw, 48px);
  background:
    radial-gradient(circle at 50% 34%, rgba(139, 61, 255, 0.13), transparent 35%),
    radial-gradient(circle at 88% 18%, rgba(34, 211, 238, 0.05), transparent 24%),
    linear-gradient(180deg, rgba(15, 12, 21, 0.92), rgba(8, 7, 12, 0.98));
}

.voice-stage-orbit {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(46vw, 580px);
  aspect-ratio: 1;
  border: 1px solid rgba(184, 117, 255, 0.08);
  border-radius: 50%;
  box-shadow: inset 0 0 90px rgba(139, 61, 255, 0.025);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.voice-stage-orbit::before,
.voice-stage-orbit::after {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px dashed rgba(152, 243, 61, 0.065);
  border-radius: inherit;
}

.voice-stage-orbit::after {
  inset: 30%;
  border-color: rgba(34, 211, 238, 0.07);
}

.voice-stage-head,
.voice-stage-cta,
.voice-participant-grid,
.voice-stage-empty {
  position: relative;
  z-index: 1;
}

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

.voice-stage-head h3 {
  margin: 4px 0 6px;
  color: #fff;
  font: 760 clamp(23px, 3vw, 34px)/1 var(--font-display);
  letter-spacing: -0.04em;
}

.voice-stage-head p {
  margin: 0;
  color: var(--sl-text-muted);
  font-size: 13px;
}

.voice-stage-count {
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  font-weight: 700;
}

.voice-participant-grid {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  justify-content: center;
  gap: 14px;
}

.voice-participant-card {
  min-height: 188px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 13px;
  padding: 22px 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  background: linear-gradient(155deg, rgba(36, 28, 48, 0.88), rgba(18, 15, 25, 0.88));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  text-align: center;
}

.voice-participant-card.speaking {
  border-color: rgba(152, 243, 61, 0.38);
  box-shadow: 0 0 0 1px rgba(152, 243, 61, 0.12), 0 18px 50px rgba(0, 0, 0, 0.24), 0 0 36px rgba(152, 243, 61, 0.08);
}

.voice-participant-avatar {
  position: relative;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  color: #fff;
  background: linear-gradient(145deg, #8b3dff, #4924c7);
  font-size: 26px;
  font-weight: 850;
}

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

.voice-speaking-ring {
  position: absolute;
  inset: -6px;
  border: 2px solid transparent;
  border-radius: 27px;
}

.voice-participant-card.speaking .voice-speaking-ring {
  border-color: var(--sl-green);
  box-shadow: 0 0 18px rgba(152, 243, 61, 0.34);
}

.voice-participant-copy strong,
.voice-participant-copy span {
  display: block;
}

.voice-participant-copy strong {
  color: #fff;
  font-size: 13px;
  font-weight: 750;
}

.voice-participant-copy span {
  margin-top: 4px;
  color: var(--sl-text-muted);
  font-size: 10px;
}

.voice-participant-card.speaking .voice-participant-copy span {
  color: var(--sl-green);
}

.voice-participant-state {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--sl-green);
  background: rgba(152, 243, 61, 0.08);
}

.voice-participant-state.muted {
  color: var(--sl-danger);
  background: rgba(255, 93, 118, 0.09);
}

.voice-stage-empty {
  align-self: center;
  justify-self: center;
  max-width: 390px;
  text-align: center;
}

.voice-stage-icon {
  width: 70px;
  height: 70px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(184, 117, 255, 0.2);
  border-radius: 22px;
  color: var(--sl-violet-light);
  background: rgba(139, 61, 255, 0.11);
  box-shadow: 0 0 40px rgba(139, 61, 255, 0.09);
}

.voice-stage-icon svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.voice-stage-empty h4 {
  margin: 16px 0 6px;
  color: #fff;
  font: 750 19px/1.15 var(--font-display);
}

.voice-stage-empty p {
  margin: 0;
  color: var(--sl-text-muted);
  font-size: 12px;
}

.voice-stage-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.voice-join-btn {
  min-width: 166px;
}

.voice-stage-controls {
  display: flex;
  gap: 8px;
}

.voice-stage-controls .voice-control-btn {
  min-width: 92px;
  height: 42px;
  display: inline-flex;
  gap: 7px;
  padding: 0 12px;
  font: 700 10px/1 var(--font-body);
}

.voice-stage-cta span {
  color: var(--sl-text-muted);
  font-size: 10px;
}

.voice-hidden {
  display: none !important;
}

.count-pill {
  min-width: 19px;
  padding: 2px 6px;
  color: #fff;
  border: 0;
  background: rgba(139, 61, 255, 0.58);
  font-size: 10px;
}

.count-pill.mention {
  background: var(--sl-danger);
}

.direct-message-item {
  min-height: 48px;
  padding: 6px 8px;
  border-radius: 11px;
}

.direct-message-item:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.045);
}

.direct-message-item.active {
  border-color: rgba(184, 117, 255, 0.12);
  background: rgba(139, 61, 255, 0.14);
  box-shadow: inset 3px 0 0 var(--sl-violet-light);
}

.direct-message-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.direct-message-copy span {
  color: var(--sl-text-muted);
  font-size: 11px;
}

.chat-main {
  background:
    radial-gradient(circle at 75% 0%, rgba(139, 61, 255, 0.065), transparent 26%),
    linear-gradient(180deg, rgba(12, 10, 17, 0.99), rgba(8, 7, 12, 0.995));
}

.chat-head {
  min-height: 74px;
  padding: 12px 18px 11px 22px;
  border-bottom: 1px solid var(--sl-line);
  background: rgba(12, 10, 17, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px);
}

.chat-head h2 {
  margin-top: 3px;
  font-family: var(--font-display) !important;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.04em;
  text-transform: none;
}

.status-badge {
  position: relative;
  min-height: 28px;
  padding: 6px 10px 6px 25px;
  border: 1px solid var(--sl-line);
  border-radius: 999px;
  color: var(--sl-text-muted);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-body) !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.status-badge::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sl-green);
  box-shadow: 0 0 10px rgba(152, 243, 61, 0.52);
  transform: translateY(-50%);
}

.chat-stage {
  grid-template-columns: minmax(0, 1fr) 272px;
}

.chat-members-sidebar {
  border-left: 1px solid var(--sl-line);
  background: rgba(14, 11, 20, 0.82);
}

.members-sidebar-head {
  min-height: 62px;
  padding: 14px 14px 11px;
  border-bottom: 1px solid var(--sl-line);
}

.members-sidebar-head h3 {
  margin-top: 4px;
  font-family: var(--font-display) !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-transform: none;
}

.members-count {
  min-width: 26px;
  padding: 4px 8px;
  border: 1px solid var(--sl-line);
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--font-body) !important;
}

.chat-member-list {
  gap: 3px;
  padding: 8px 8px 14px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.chat-member-row {
  min-height: 48px;
  gap: 9px;
  padding: 6px 7px;
  border-radius: 10px;
}

.chat-member-row:hover,
.chat-member-row:focus-visible {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.045);
}

.chat-member-row.is-open {
  border-color: rgba(184, 117, 255, 0.12);
  background: rgba(139, 61, 255, 0.12);
  box-shadow: inset 3px 0 0 var(--sl-violet-light);
}

.chat-member-row .avatar-chip,
.direct-message-item .avatar-chip {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.chat-member-row .member-main strong {
  font-size: 13px;
  font-weight: 700;
}

.chat-member-row .audit-meta {
  color: var(--sl-text-muted);
  font-size: 10px;
  line-height: 1.25;
}

.member-role-pill {
  padding: 2px 6px;
  color: var(--member-role-color, var(--sl-green));
  border-color: color-mix(in srgb, var(--member-role-color, var(--sl-green)) 28%, transparent);
  background: color-mix(in srgb, var(--member-role-color, var(--sl-green)) 10%, transparent);
  font-size: 8px;
}

/* Server roles */
.role-management-layout {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.role-browser-panel,
.role-editor-panel {
  min-height: 620px;
}

.role-browser-panel {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(139, 61, 255, 0.055), transparent 26%),
    rgba(255, 255, 255, 0.018);
}

.role-browser-head {
  margin-bottom: 2px;
}

.role-order-helper {
  margin: 0 0 12px;
  font-size: 11px;
  line-height: 1.45;
}

.role-list {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}

.role-list-item {
  position: relative;
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 14px 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--sl-text-soft);
  background: transparent;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.role-list-item[draggable="true"] {
  cursor: grab;
}

.role-list-item[draggable="true"]:active {
  cursor: grabbing;
}

.role-list-item.dragging {
  opacity: 0.38;
  transform: scale(0.985);
}

.role-list-item.drop-before::before,
.role-list-item.drop-after::after {
  content: '';
  position: absolute;
  z-index: 2;
  right: 8px;
  left: 8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sl-violet-light), var(--sl-cyan));
  box-shadow: 0 0 12px rgba(82, 223, 255, 0.42);
}

.role-list-item.drop-before::before {
  top: -4px;
}

.role-list-item.drop-after::after {
  bottom: -4px;
}

.role-list.is-saving {
  pointer-events: none;
  opacity: 0.62;
}

.role-list-item:hover {
  border-color: var(--sl-line);
  background: rgba(255, 255, 255, 0.035);
}

.role-list-item.active {
  border-color: rgba(184, 117, 255, 0.18);
  background: linear-gradient(90deg, rgba(139, 61, 255, 0.16), rgba(139, 61, 255, 0.055));
  box-shadow: inset 3px 0 0 var(--sl-violet-light);
}

.role-list-grip {
  width: 12px;
  display: grid;
  grid-template-columns: repeat(2, 3px);
  gap: 2px;
  justify-content: center;
  color: var(--sl-text-muted);
  opacity: 0.55;
}

.role-list-grip i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.role-list-item:not([draggable="true"]) .role-list-grip {
  opacity: 0.16;
}

.role-list-color,
.member-role-option-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--role-color, var(--member-role-color, #8e8796));
  box-shadow: 0 0 12px color-mix(in srgb, var(--role-color, var(--member-role-color, #8e8796)) 55%, transparent);
}

.role-list-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.role-list-copy strong {
  overflow: hidden;
  color: var(--sl-text);
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-list-copy span {
  color: var(--sl-text-muted);
  font-size: 9px;
}

.role-managed-badge {
  padding: 3px 6px;
  border: 1px solid var(--sl-line);
  border-radius: 999px;
  color: var(--sl-text-muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-editor-panel {
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 0%, rgba(82, 223, 255, 0.055), transparent 28%),
    rgba(255, 255, 255, 0.018);
}

.role-editor-empty {
  min-height: 620px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 32px;
  color: var(--sl-text-muted);
  text-align: center;
}

.role-editor-empty strong {
  color: var(--sl-text);
  font-family: var(--font-display);
  font-size: 18px;
}

.role-editor-empty span:last-child {
  max-width: 340px;
  font-size: 12px;
  line-height: 1.5;
}

.role-editor-empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border: 1px solid rgba(184, 117, 255, 0.18);
  border-radius: 17px;
  color: var(--sl-violet-light);
  background: rgba(139, 61, 255, 0.1);
  font-size: 25px;
}

.role-editor-form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.role-editor-head,
.role-editor-identity,
.role-order-actions,
.role-permission-intro,
.role-editor-actions {
  display: flex;
  align-items: center;
}

.role-editor-head,
.role-permission-intro,
.role-editor-actions {
  justify-content: space-between;
}

.role-editor-identity {
  gap: 12px;
}

.role-editor-identity h4,
.role-permission-intro h4 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.025em;
}

.role-editor-dot {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 5px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.role-order-actions {
  gap: 6px;
}

.ghost-icon-btn.compact {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  font-size: 15px;
}

.role-identity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.42fr);
  gap: 12px;
}

.role-color-control {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--sl-line);
  border-radius: var(--sl-radius-sm);
  background: rgba(5, 4, 9, 0.66);
}

.role-color-control input[type="color"] {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.role-color-control span {
  color: var(--sl-text-soft);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.05em;
}

.role-color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: -7px;
}

.role-color-swatch {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 9px;
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.role-color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--sl-violet), 0 5px 16px color-mix(in srgb, var(--swatch-color) 40%, transparent);
}

.role-permission-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.role-permission-group {
  padding: 12px;
  border: 1px solid var(--sl-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.role-permission-group:first-child {
  grid-row: span 2;
}

.role-permission-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--sl-text-soft);
  font-size: 11px;
}

.role-permission-group-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--sl-violet-light);
  background: rgba(139, 61, 255, 0.11);
  font-size: 10px;
  font-weight: 800;
}

.role-permission-items {
  display: grid;
}

.role-permission-item {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.role-permission-item.critical .role-permission-copy strong {
  color: #ffd4dc;
}

.role-permission-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.role-permission-copy strong {
  color: var(--sl-text-soft);
  font-size: 11px;
}

.role-permission-copy > span {
  color: var(--sl-text-muted);
  font-size: 9px;
  line-height: 1.4;
}

.role-permission-toggle {
  position: relative;
  width: 36px;
  height: 21px;
  flex: 0 0 36px;
}

.role-permission-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-permission-toggle span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--sl-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 150ms ease, border-color 150ms ease;
}

.role-permission-toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #aaa4b3;
  transition: transform 150ms ease, background 150ms ease;
}

.role-permission-toggle input:checked + span {
  border-color: rgba(152, 243, 61, 0.3);
  background: rgba(152, 243, 61, 0.17);
}

.role-permission-toggle input:checked + span::after {
  background: var(--sl-green);
  transform: translateX(15px);
  box-shadow: 0 0 11px rgba(152, 243, 61, 0.48);
}

.role-permission-toggle input:disabled + span {
  opacity: 0.48;
}

.role-editor-actions {
  padding-top: 14px;
  border-top: 1px solid var(--sl-line);
}

.role-editor-actions .primary-btn {
  min-width: 170px;
}

.ghost-btn.danger {
  color: #ff91a3;
  border-color: rgba(255, 93, 118, 0.16);
  background: rgba(255, 93, 118, 0.055);
}

.ghost-btn.danger:hover {
  border-color: rgba(255, 93, 118, 0.3);
  background: rgba(255, 93, 118, 0.11);
}

/* Role assignment */
.member-row-enhanced {
  align-items: flex-start;
  padding: 11px;
  border-color: var(--sl-line);
  background: rgba(255, 255, 255, 0.022);
}

.member-role-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.member-role-chip {
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--member-role-color, #8e8796) 24%, transparent);
  border-radius: 999px;
  color: var(--member-role-color, var(--sl-text-muted));
  background: color-mix(in srgb, var(--member-role-color, #8e8796) 8%, transparent);
  font-size: 8px;
  font-weight: 720;
}

.member-role-chip.default {
  border-color: var(--sl-line);
  color: var(--sl-text-muted);
  background: rgba(255, 255, 255, 0.025);
}

.member-muted-state {
  margin-top: 5px;
  color: #ffadbb !important;
}

.member-actions-enhanced {
  align-items: flex-end;
  flex-direction: column;
}

.member-role-manage-btn {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.member-role-manage-btn strong {
  min-width: 19px;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--sl-violet-light);
  background: rgba(139, 61, 255, 0.13);
  text-align: center;
  font-size: 9px;
}

.member-role-manage-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.member-role-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.member-role-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 2, 6, 0.76);
  backdrop-filter: blur(10px) saturate(0.76);
  cursor: default;
}

.member-role-modal-card {
  position: relative;
  width: min(600px, calc(100vw - 40px));
  max-height: min(720px, calc(100dvh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(184, 117, 255, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 0%, rgba(139, 61, 255, 0.15), transparent 34%),
    rgba(14, 11, 20, 0.995);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 54px rgba(139, 61, 255, 0.12);
  animation: slimer-modal-enter 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.member-role-modal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sl-violet-light), var(--sl-cyan), transparent);
  pointer-events: none;
}

.member-role-modal-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--sl-line);
  background: rgba(255, 255, 255, 0.018);
}

.member-role-modal-head .ghost-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.member-role-modal-avatar {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

.member-role-modal-title {
  min-width: 0;
}

.member-role-modal-title h3 {
  margin: 2px 0 1px;
  color: var(--sl-text);
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.035em;
}

.member-role-modal-title strong {
  display: block;
  overflow: hidden;
  color: var(--sl-text-muted);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role-modal-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px 20px;
  overflow: hidden;
}

.member-role-modal-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.member-role-modal-intro p {
  max-width: 440px;
  margin: 5px 0 0;
  color: var(--sl-text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.member-role-modal-intro .meta-chip {
  flex: 0 0 auto;
}

.member-role-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--sl-line);
  background: rgba(255, 255, 255, 0.018);
}

.member-role-options {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.member-role-option {
  min-height: 58px;
  display: grid;
  grid-template-columns: 19px 11px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--sl-line);
  border-radius: 13px;
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.member-role-option:hover {
  border-color: rgba(184, 117, 255, 0.2);
  background: rgba(139, 61, 255, 0.075);
  transform: translateY(-1px);
}

.member-role-option.selected {
  border-color: rgba(184, 117, 255, 0.28);
  background: rgba(139, 61, 255, 0.11);
}

.member-role-option.locked {
  opacity: 0.56;
  cursor: not-allowed;
}

.member-role-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.member-role-option-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.24);
}

.member-role-option-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.7);
  transition: opacity 120ms ease, transform 120ms ease;
}

.member-role-option input:checked + .member-role-option-check {
  border-color: var(--sl-violet-light);
  background: linear-gradient(135deg, var(--sl-violet), #b63cff);
  box-shadow: 0 0 14px rgba(139, 61, 255, 0.28);
}

.member-role-option input:checked + .member-role-option-check::after {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.member-role-option-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.member-role-option-copy strong {
  overflow: hidden;
  color: var(--sl-text);
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role-option-copy span {
  overflow: hidden;
  color: var(--sl-text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role-option-status,
.member-role-option-lock {
  color: var(--sl-text-muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.member-role-option.selected .member-role-option-status {
  color: var(--sl-violet-light);
}

.member-role-empty {
  min-height: 150px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  border: 1px dashed var(--sl-line);
  border-radius: 15px;
  color: var(--sl-text-muted);
  text-align: center;
}

.member-role-empty strong {
  color: var(--sl-text);
  font-size: 13px;
}

.member-role-empty span {
  font-size: 10px;
}

@keyframes slimer-modal-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.primary-btn.compact {
  min-height: 36px;
  padding: 0 13px;
  font-size: 10px;
}

.member-moderation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

/* Conversation */
.messages-tools {
  padding: 10px 24px 0;
}

.messages {
  gap: 2px;
  padding: 12px clamp(16px, 2.4vw, 34px) 24px;
  scroll-behavior: auto;
  scrollbar-gutter: stable;
}

.messages > .helper-text {
  margin: auto;
  padding: 24px;
  color: var(--sl-text-muted);
  text-align: center;
}

.message-card {
  flex: 0 0 auto;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  min-height: 52px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  transition: background 130ms ease, border-color 130ms ease;
}

.message-card:hover,
.message-card.context-active,
.message-card.reaction-menu-open {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.032);
  box-shadow: none;
}

.message-card.mention {
  border-color: rgba(82, 223, 255, 0.15);
  background: linear-gradient(90deg, rgba(82, 223, 255, 0.09), rgba(82, 223, 255, 0.025));
  box-shadow: inset 3px 0 0 var(--sl-cyan);
}

.avatar-chip {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 20px rgba(0, 0, 0, 0.2);
}

.message-body {
  padding-right: 0;
}

.message-head {
  min-height: 20px;
  gap: 7px;
}

.member-inline-trigger,
.message-head strong {
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.018em;
}

.member-inline-trigger:hover,
.member-inline-trigger:focus-visible {
  color: var(--sl-violet-light);
}

.time-pill,
.role-pill {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 9px;
}

.time-pill {
  color: var(--sl-text-muted);
  font-weight: 600;
}

.role-pill {
  padding: 2px 6px;
  color: var(--sl-violet-light);
  background: rgba(139, 61, 255, 0.1);
}

.message-text {
  margin-top: 2px;
  color: #e3dee8;
  font-size: 14px;
  line-height: 1.48;
  letter-spacing: -0.008em;
}

.message-reply,
.reply-bar {
  border-radius: 10px;
  border: 1px solid rgba(184, 117, 255, 0.12);
  border-left: 3px solid var(--sl-violet-light);
  background: rgba(139, 61, 255, 0.06);
  box-shadow: none;
}

.message-reply {
  margin-top: 6px;
  padding: 7px 10px;
  color: var(--sl-text-soft);
  font-size: 12px;
}

.message-translation {
  position: relative;
  margin-top: 9px;
  padding: 11px 13px 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(82, 223, 255, 0.13);
  background: linear-gradient(90deg, rgba(82, 223, 255, 0.085), rgba(82, 223, 255, 0.025));
  box-shadow: none;
}

.message-translation::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 2px;
  border-radius: 2px;
  background: var(--sl-cyan);
}

.message-translation-meta {
  color: var(--sl-cyan);
  font-size: 9px;
  letter-spacing: 0.09em;
}

.message-translation-text {
  margin-top: 5px;
  color: #e5f9fd;
  font-size: 13px;
  line-height: 1.5;
}

.reaction-list {
  gap: 5px;
  margin-top: 7px;
}

.reaction-btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  border-radius: 10px;
  color: var(--sl-text-soft);
  border: 1px solid var(--sl-line);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
}

.reaction-btn .slimer-reaction-icon {
  width: 22px;
  height: 22px;
}

.reaction-btn.active {
  color: #fff;
  border-color: rgba(184, 117, 255, 0.32);
  background: rgba(139, 61, 255, 0.13);
}

.message-hover-tools {
  top: -13px;
  right: 10px;
  max-width: calc(100% - 58px);
  transform: translateY(4px);
}

.message-card:hover .message-hover-tools,
.message-card:focus-within .message-hover-tools,
.message-card.context-active .message-hover-tools,
.message-card.reaction-menu-open .message-hover-tools {
  transform: translateY(0);
}

.message-card.touch-actions-open .message-hover-tools {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.message-hover-actions {
  gap: 2px;
  padding: 3px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: rgba(23, 18, 32, 0.96);
  box-shadow: var(--sl-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.message-reaction-trigger,
.message-hover-actions .message-action-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--sl-text-soft);
  background: transparent;
  font-size: 0;
  box-shadow: none;
}

.message-reaction-trigger:hover,
.message-hover-actions .message-action-btn:hover {
  color: #fff;
  border: 0;
  background: rgba(139, 61, 255, 0.16);
}

.message-hover-actions .message-action-btn[data-action="delete-message"]:hover {
  color: #fff;
  background: rgba(255, 93, 118, 0.16);
}

.message-hover-actions .ui-icon,
.message-reaction-trigger .ui-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.message-reaction-menu {
  min-width: 254px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(20, 16, 28, 0.98);
  box-shadow: var(--sl-shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.message-reaction-menu-title {
  color: var(--sl-text-muted);
  font-size: 9px;
}

.message-reaction-menu-items {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  margin-top: 9px;
}

.message-reaction-menu-btn {
  min-width: 34px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
}

.message-reaction-menu-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.message-reaction-menu-btn.active {
  border-color: rgba(184, 117, 255, 0.28);
  background: rgba(139, 61, 255, 0.14);
  box-shadow: none;
}

.typing-bar {
  min-height: 22px;
  padding: 2px clamp(18px, 2.4vw, 34px) 0;
  color: var(--sl-text-muted);
  font-size: 11px;
}

.reply-bar,
.attachment-tray {
  margin-left: clamp(16px, 2.4vw, 34px);
  margin-right: clamp(16px, 2.4vw, 34px);
}

.reply-bar {
  margin-top: 4px;
  margin-bottom: 8px;
}

.attachment-tray {
  padding: 0;
}

.composer-shell {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 58px;
  margin: 0 clamp(16px, 2.4vw, 34px) calc(14px + env(safe-area-inset-bottom, 0px));
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 17px;
  background: rgba(21, 17, 29, 0.94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
}

.attachment-quick-menu-shell,
.attach-btn {
  width: 40px;
}

.attach-btn {
  height: 40px;
  border: 0;
  border-radius: 11px;
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  font-size: 0;
}

.attach-btn:hover {
  color: #fff;
  background: rgba(139, 61, 255, 0.15);
  transform: none;
}

.composer-shell textarea {
  min-height: 40px;
  max-height: 120px;
  padding: 9px 8px;
  color: var(--sl-text);
  font-size: 14px;
  line-height: 1.5;
}

.composer-shell textarea::placeholder {
  color: #706979;
}

.composer-shell .primary-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 12px;
}

.attachment-quick-menu {
  width: 224px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(20, 16, 28, 0.98);
  box-shadow: var(--sl-shadow-md);
}

.attachment-quick-menu-item {
  border-radius: 10px;
  color: var(--sl-text-soft);
}

.attachment-quick-menu-item:hover {
  color: #fff;
  background: rgba(139, 61, 255, 0.12);
}

.attachment-quick-menu-icon {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 10px;
  background: rgba(139, 61, 255, 0.12);
}

.empty-state {
  width: min(540px, calc(100% - 32px));
  padding: 40px;
  border: 1px solid var(--sl-line);
  border-radius: var(--sl-radius-lg);
  background: rgba(255, 255, 255, 0.018);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.04em;
}

/* Overlays and cards */
.overlay {
  z-index: 100;
  padding: 18px;
}

.overlay-backdrop {
  background: rgba(3, 2, 6, 0.78);
  backdrop-filter: blur(12px) saturate(0.82);
}

.overlay-panel,
.overlay-panel.wide,
.overlay-panel.compact {
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 0%, rgba(139, 61, 255, 0.11), transparent 28%),
    rgba(12, 10, 17, 0.985);
  box-shadow: var(--sl-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.overlay-panel {
  width: min(680px, calc(100% - 24px));
}

.overlay-panel.wide {
  width: min(1180px, calc(100% - 24px));
}

.overlay-panel.compact {
  width: min(570px, calc(100% - 24px));
}

.profile-panel {
  width: min(820px, calc(100% - 24px));
}

.overlay-panel::before {
  display: none;
}

.overlay-head {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 72px;
  padding: 16px 20px;
  align-items: center;
  border-bottom: 1px solid var(--sl-line);
  background: rgba(14, 11, 20, 0.94);
  backdrop-filter: blur(18px);
}

.overlay-head h3,
.block-head h4 {
  font-family: var(--font-display) !important;
  letter-spacing: -0.025em;
  text-transform: none;
}

.overlay-head h3 {
  margin-top: 3px;
  font-size: 18px;
}

.block-head h4 {
  font-size: 17px;
}

.overlay-footer {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--sl-line);
  background: rgba(14, 11, 20, 0.94);
  backdrop-filter: blur(18px);
}

.panel-block {
  padding: 20px;
  border: 1px solid var(--sl-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.018);
  box-shadow: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.panel-block:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.024);
  box-shadow: none;
}

.profile-panel,
.guild-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
}

#serverOverlay {
  padding: 24px;
}

#serverOverlay > .guild-panel {
  width: min(1180px, calc(100vw - 48px));
  height: calc(100dvh - 48px);
  max-height: none;
}

.profile-tabs,
.server-panel-tabs {
  position: sticky;
  top: 72px;
  z-index: 7;
  margin: 0;
  padding: 12px 20px;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--sl-line);
  background: rgba(14, 11, 20, 0.94);
  scrollbar-width: none;
  backdrop-filter: blur(18px);
}

.profile-tabs::-webkit-scrollbar,
.server-panel-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tab-btn,
.server-tab-btn {
  min-height: 36px;
  padding: 0 13px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--sl-text-muted);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.profile-tab-btn:hover,
.server-tab-btn:hover {
  color: var(--sl-text-soft);
  border-color: transparent;
  background: rgba(255, 255, 255, 0.04);
}

.profile-tab-btn.active,
.server-tab-btn.active {
  color: #fff;
  border-color: rgba(184, 117, 255, 0.18);
  background: rgba(139, 61, 255, 0.16);
  box-shadow: inset 0 -2px 0 var(--sl-violet-light);
}

.profile-page,
.server-panel-pages {
  min-height: 0;
}

.profile-page {
  min-height: 0;
  padding: 18px 20px 22px;
  overflow-y: auto;
  align-content: start;
}

.server-panel-page {
  align-self: start;
  align-content: start;
}

.server-panel-pages {
  padding: 18px 20px 22px;
  overflow-y: auto;
  align-content: start;
  grid-auto-rows: max-content;
}

.server-panel-page[data-panel-tab="members"] {
  min-height: 100%;
  align-self: stretch;
}

.server-members-grid {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  align-items: stretch;
}

.server-members-grid > .panel-column,
.server-members-grid > .panel-column > .panel-block {
  min-height: 100%;
}

.server-members-grid > .panel-column > .panel-block {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.server-members-grid .member-list,
.server-members-grid .ban-list {
  max-height: none;
  min-height: 0;
  overflow-y: auto;
}

.profile-hero-block,
.server-hero-block {
  border-color: rgba(184, 117, 255, 0.13);
  background:
    radial-gradient(circle at 92% 0%, rgba(139, 61, 255, 0.13), transparent 36%),
    rgba(255, 255, 255, 0.02);
}

.profile-card-large,
.server-hero-summary {
  gap: 16px;
}

.profile-avatar,
.server-avatar {
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.profile-name {
  font-family: var(--font-display) !important;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.045em;
  text-transform: none;
}

.profile-note,
.profile-page-note,
.security-card-copy,
.helper-text {
  color: var(--sl-text-muted);
}

.meta-chip {
  padding: 6px 9px;
  border: 1px solid var(--sl-line);
  border-radius: 999px;
  color: var(--sl-text-soft);
  background: rgba(255, 255, 255, 0.035);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.profile-page-card,
.profile-security-hero {
  padding: 22px;
}

.profile-form-block,
.profile-security-block {
  height: auto;
}

.profile-page-card::before,
.security-card::before {
  display: none;
}

.profile-language-grid {
  gap: 14px;
}

.profile-toggle-card {
  min-height: 92px;
  border: 1px solid var(--sl-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.profile-toggle-slider {
  background: rgba(255, 255, 255, 0.12);
}

.profile-toggle-switch input:checked + .profile-toggle-slider {
  background: var(--sl-violet);
  box-shadow: 0 0 0 3px rgba(139, 61, 255, 0.12);
}

.profile-security-hero {
  border: 0;
  background: transparent;
  overflow: visible;
}

.profile-security-hero-head h4 {
  margin: 2px 0 0;
}

.security-grid {
  gap: 14px;
  align-items: start;
}

.security-card {
  min-height: 0;
  border: 1px solid var(--sl-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: none;
}

.security-card-head h5 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

.security-card-status .feedback {
  border-color: var(--sl-line);
  background: rgba(255, 255, 255, 0.025);
}

.security-card-status .feedback:empty {
  display: none;
}

.overview-stats {
  gap: 10px;
}

.overview-stat {
  min-height: 84px;
  border: 1px solid var(--sl-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
}

.overview-stat::before {
  height: 2px;
  background: linear-gradient(90deg, var(--sl-violet), var(--sl-cyan));
}

.invite-pill {
  color: #fff;
  border-color: rgba(184, 117, 255, 0.24);
  background: rgba(139, 61, 255, 0.18);
}

.guild-panel > #serverFeedback {
  display: none;
}

.context-menu,
.message-reaction-menu {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(20, 16, 28, 0.98);
  box-shadow: var(--sl-shadow-md);
}

.context-menu-item {
  border-radius: 10px;
}

.context-menu-item:hover {
  color: #fff;
  background: rgba(139, 61, 255, 0.13);
}

.context-menu-item-icon {
  color: var(--sl-violet-light);
  background: rgba(139, 61, 255, 0.1);
}

/* Scrollbars */
:is(.channel-sections, .chat-member-list, .messages, .member-list, .audit-list, .ban-list, .structure-list, .server-panel-pages, .overlay-panel) {
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 117, 255, 0.36) transparent;
}

:is(.channel-sections, .chat-member-list, .messages, .member-list, .audit-list, .ban-list, .structure-list, .server-panel-pages, .overlay-panel)::-webkit-scrollbar {
  width: 7px;
}

:is(.channel-sections, .chat-member-list, .messages, .member-list, .audit-list, .ban-list, .structure-list, .server-panel-pages, .overlay-panel)::-webkit-scrollbar-track {
  background: transparent;
}

:is(.channel-sections, .chat-member-list, .messages, .member-list, .audit-list, .ban-list, .structure-list, .server-panel-pages, .overlay-panel)::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(184, 117, 255, 0.32);
  background-clip: padding-box;
}

/* Motion */
.chat-screen:not(.hidden) .workspace-rail,
.chat-screen:not(.hidden) .chat-sidebar,
.chat-screen:not(.hidden) .chat-main {
  animation: slimer-enter 420ms cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

.chat-screen:not(.hidden) .chat-sidebar {
  animation-delay: 45ms;
}

.chat-screen:not(.hidden) .chat-main {
  animation-delay: 80ms;
}

.overlay:not(.hidden) .overlay-panel {
  animation: slimer-modal-in 220ms cubic-bezier(0.2, 0.78, 0.28, 1) both;
}

@keyframes slimer-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slimer-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1180px) {
  .chat-screen {
    grid-template-columns: 70px 250px minmax(0, 1fr);
  }

  .chat-stage {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .rail-brand {
    width: 44px;
    height: 44px;
  }

  .rail-action,
  .rail-profile,
  .server-avatar-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-basis: 44px;
  }
}

@media (max-width: 920px) {
  .chat-screen {
    grid-template-columns: minmax(0, 1fr);
    height: 100dvh;
  }

  .workspace-rail,
  .chat-sidebar,
  .chat-members-sidebar {
    display: none;
  }

  .chat-head {
    min-height: 70px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .chat-head > div:first-of-type {
    grid-column: 2;
    grid-row: 1;
  }

  .head-status {
    grid-column: 3;
    grid-row: 1;
    width: auto;
    justify-content: flex-end;
    overflow: visible;
    flex-wrap: nowrap;
  }

  .head-status .status-badge,
  .head-status #mobileManageBtn {
    display: none;
  }

  .mobile-nav-trigger {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--sl-line);
    border-radius: 12px;
    color: var(--sl-text-soft);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0;
  }

  .mobile-head-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
  }

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

  .voice-stage {
    padding: 22px 14px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .voice-stage-head {
    align-items: center;
  }

  .voice-stage-head h3 {
    font-size: 24px;
  }

  .voice-participant-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voice-participant-card {
    min-height: 158px;
    padding: 17px 10px;
  }

  .voice-participant-avatar {
    width: 62px;
    height: 62px;
    border-radius: 19px;
  }

  .voice-stage-cta {
    position: sticky;
    bottom: 0;
    flex-direction: column;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    background: rgba(14, 11, 20, 0.94);
    backdrop-filter: blur(16px);
  }

  .voice-join-btn {
    width: 100%;
  }

  .voice-stage-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .voice-stage-controls .voice-control-btn {
    min-width: 0;
    width: 100%;
    height: 46px;
    flex-direction: column;
    gap: 3px;
    padding: 5px;
    font-size: 9px;
  }

  .voice-stage-controls .voice-control-btn svg {
    width: 16px;
    height: 16px;
  }

  .messages {
    padding: 12px 10px 18px;
  }

  .messages-tools,
  .typing-bar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .composer-shell {
    position: sticky;
    bottom: 0;
    z-index: 5;
    min-height: 62px;
    grid-template-columns: 40px minmax(0, 1fr) 42px;
    margin: 0;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: 0;
    background: rgba(14, 11, 20, 0.98);
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.28);
  }

  .composer-shell .primary-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    font-size: 0;
  }

  .composer-shell .primary-btn .button-label {
    display: none;
  }

  .composer-shell .primary-btn::before {
    content: none;
  }

  .composer-shell textarea {
    min-height: 42px;
    padding: 10px 6px;
    font-size: 15px;
  }

  .reply-bar,
  .attachment-tray {
    margin-left: 10px;
    margin-right: 10px;
  }

  .overlay {
    padding: 8px;
  }

  .overlay-panel,
  .overlay-panel.wide,
  .overlay-panel.compact {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .profile-panel,
  .guild-panel {
    height: calc(100dvh - 16px);
  }

  #serverOverlay {
    padding: 8px;
  }

  #serverOverlay > .guild-panel {
    width: 100%;
    height: calc(100dvh - 16px);
  }

  .overlay-head {
    min-height: 66px;
    padding: 13px 14px;
  }

  .profile-tabs,
  .server-panel-tabs {
    top: 66px;
    padding: 9px 12px;
  }

  .profile-page,
  .server-panel-pages {
    padding: 14px;
  }

  .panel-split,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .server-members-grid {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .server-members-grid > .panel-column,
  .server-members-grid > .panel-column > .panel-block {
    min-height: auto;
  }

  .role-management-layout {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .role-browser-panel,
  .role-editor-panel {
    min-height: 0;
  }

  .role-list {
    max-height: 230px;
  }

  .role-editor-empty {
    min-height: 280px;
  }

  .profile-security-hero-head {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .brand-bar {
    padding: 18px 18px 0;
  }

  .brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .brand-title {
    font-size: 21px;
  }

  .brand-subtitle {
    max-width: 240px;
    font-size: 11px;
  }

  .auth-center {
    display: block;
    padding: 18px;
    overflow-y: auto;
  }

  .auth-panel {
    display: block;
    border-radius: 22px;
  }

  .auth-form {
    padding: 30px 22px;
  }

  .auth-form h2 {
    font-size: 25px;
  }

  .auth-side {
    display: none;
  }

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

  .auth-actions .primary-btn,
  .auth-actions .ghost-btn {
    width: 100%;
  }

  .chat-head h2 {
    max-width: 100%;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-head .eyebrow {
    font-size: 8px;
  }

  .message-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    padding: 8px 7px;
  }

  .message-card .avatar-chip {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .message-hover-tools {
    top: -10px;
    right: 6px;
  }

  .message-hover-actions {
    max-width: min(250px, calc(100vw - 70px));
    overflow-x: auto;
  }

  .message-reaction-menu-items {
    grid-template-columns: repeat(6, 34px);
  }

  .message-reaction-menu {
    min-width: 248px;
  }

  .profile-card-large {
    flex-direction: row;
  }

  .profile-card-large .profile-avatar,
  .server-hero-block .server-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .profile-name {
    font-size: 19px;
  }

  .server-hero-block {
    gap: 12px;
  }

  .server-hero-summary {
    gap: 12px;
  }

  .server-hero-block .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .server-hero-block .overview-stat {
    min-height: 76px;
    padding: 11px;
  }

  .profile-page-card,
  .profile-security-hero,
  .panel-block {
    padding: 16px;
  }

  .profile-language-grid,
  .security-password-grid,
  .role-identity-grid,
  .role-permission-list {
    grid-template-columns: 1fr;
  }

  .role-permission-group:first-child {
    grid-row: auto;
  }

  .role-editor-form {
    gap: 14px;
    padding: 14px;
  }

  .role-editor-head,
  .role-permission-intro {
    align-items: flex-start;
  }

  .role-editor-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .role-editor-actions .primary-btn,
  .role-editor-actions .ghost-btn {
    width: 100%;
  }

  .member-row-enhanced {
    align-items: stretch;
    flex-direction: column;
  }

  .member-actions-enhanced {
    width: 100%;
    align-items: stretch;
  }

  .member-role-manage-btn {
    width: 100%;
    justify-content: center;
  }

  .member-role-modal {
    place-items: end center;
    padding: 8px;
  }

  .member-role-modal-card {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 22px 22px 16px 16px;
  }

  .member-role-modal-head {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 15px;
  }

  .member-role-modal-avatar {
    width: 44px;
    height: 44px;
  }

  .member-role-modal-title h3 {
    font-size: 17px;
  }

  .member-role-modal-body {
    padding: 15px;
  }

  .member-role-modal-intro {
    display: grid;
    gap: 9px;
  }

  .member-role-modal-intro .meta-chip {
    justify-self: start;
  }

  .member-role-option {
    grid-template-columns: 19px 10px minmax(0, 1fr);
  }

  .member-role-option-status,
  .member-role-option-lock {
    display: none;
  }

  .member-role-modal-footer {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    padding: 12px 15px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .member-role-modal-footer .ghost-btn,
  .member-role-modal-footer .primary-btn {
    width: 100%;
  }

  .member-moderation-actions {
    justify-content: stretch;
  }

  .member-moderation-actions .ghost-btn {
    flex: 1;
  }

  .profile-security-hero {
    gap: 12px;
    padding: 14px;
  }

  .profile-security-hero-head {
    gap: 10px;
  }

  .profile-security-hero-head h4 {
    font-size: 18px;
    line-height: 1.14;
  }

  .security-badges {
    gap: 6px;
  }

  .security-lead {
    margin-top: 0;
    padding: 11px 12px;
    border-radius: 13px;
    font-size: 13px;
    line-height: 1.45;
  }

  .security-grid,
  .security-stack {
    gap: 10px;
  }

  .security-card {
    gap: 10px;
    padding: 14px;
  }

  .security-card-head {
    gap: 2px;
  }

  .security-card-head h5 {
    font-size: 16px;
    line-height: 1.18;
  }

  .security-card-copy {
    font-size: 13px;
    line-height: 1.45;
  }

  .security-password-grid {
    gap: 10px;
  }

  .security-card-status .feedback {
    min-height: 0;
  }

  .overlay-footer {
    padding: 12px 14px;
  }

  .profile-panel .overlay-footer .primary-btn {
    width: 100%;
  }

  .mobile-nav-panel {
    width: min(92vw, 410px) !important;
    height: 100dvh;
    max-height: 100dvh;
    margin: -8px 0 -8px -8px;
    border-radius: 0 20px 20px 0 !important;
  }

  .mobile-nav-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
  }

  .mobile-nav-panel .overlay-head {
    min-height: 66px;
  }

  .mobile-nav-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-nav-rail-block,
  .mobile-nav-content-block {
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-nav-rail-block {
    padding: 12px 14px;
    border-bottom: 1px solid var(--sl-line);
  }

  .mobile-nav-content-block {
    padding: 12px 10px 16px;
    overflow: hidden;
  }

  .mobile-server-list {
    min-height: 48px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 4px;
    scrollbar-width: none;
  }

  .mobile-server-list::-webkit-scrollbar {
    display: none;
  }

  .mobile-server-item.mobile-server-avatar {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 13px;
  }

  .mobile-server-item.mobile-server-avatar::after {
    left: 50%;
    top: auto;
    bottom: -6px;
    width: 16px;
    height: 3px;
    transform: translateX(-50%);
  }

  .mobile-server-item.mobile-server-avatar.active::after {
    width: 24px;
    height: 3px;
  }

  .mobile-channel-list {
    height: 100%;
    overflow-y: auto;
    padding: 0 4px 8px;
  }

  .mobile-nav-actions {
    gap: 7px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--sl-line);
    background: rgba(14, 11, 20, 0.96);
  }

  .mobile-nav-actions .ghost-btn {
    color: var(--sl-text-soft);
    border-color: var(--sl-line);
    background: rgba(255, 255, 255, 0.04);
  }

  #mobileProfileBtn {
    min-height: 50px;
    border-radius: 14px;
  }
}

@media (pointer: coarse) {
  .message-hover-tools {
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
  }

  .message-hover-actions .message-action-btn,
  .message-reaction-trigger {
    width: 29px;
    min-width: 29px;
    height: 29px;
    min-height: 29px;
  }
}
