:root {
  --app-font-scale: 1;
  --ink: #eaf1ff;
  --muted: #97a7c7;
  --line: rgba(148, 177, 231, 0.22);
  --surface: rgba(16, 24, 43, 0.8);
  --surface-2: rgba(23, 34, 58, 0.92);
  --accent: #5ff0cb;
  --accent-2: #8aa6ff;
  --danger: #ff8b90;
  --font-heading: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Sora', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: calc(16px * var(--app-font-scale));
  color: var(--ink);
  background: linear-gradient(160deg, #060a17 0%, #0a1633 52%, #0c1d40 100%);
}

body[data-theme='ocean-glass'] {
  --ink: #edf6ff;
  --muted: #9eb6d8;
  --surface: rgba(8, 27, 44, 0.78);
  --surface-2: rgba(16, 43, 67, 0.9);
  --accent: #6af7d9;
  --accent-2: #70b8ff;
  background: radial-gradient(circle at 18% 8%, #0f3a5f 0%, #07203d 36%, #06162f 100%);
}

body[data-theme='carbon-light'] {
  --ink: #213047;
  --muted: #5f728f;
  --line: rgba(100, 127, 167, 0.3);
  --surface: rgba(241, 247, 255, 0.93);
  --surface-2: rgba(233, 241, 252, 0.97);
  --accent: #2bc7a4;
  --accent-2: #588eff;
  background: linear-gradient(170deg, #e8f0ff 0%, #dbe8ff 55%, #d3e2ff 100%);
}

body[data-theme='carbon-light'] .settings-tab-btn,
body[data-theme='carbon-light'] .member-name,
body[data-theme='carbon-light'] .msg-author,
body[data-theme='carbon-light'] .channel-item,
body[data-theme='carbon-light'] .user-dock-name,
body[data-theme='carbon-light'] .settings-list-item-title {
  color: #1e2d44;
}

body[data-theme='carbon-light'] .settings-page-intro h3,
body[data-theme='carbon-light'] .settings-head h2,
body[data-theme='carbon-light'] .settings-account-meta h3,
body[data-theme='carbon-light'] .settings-value,
body[data-theme='carbon-light'] .msg-content,
body[data-theme='carbon-light'] .user-dock-hint,
body[data-theme='carbon-light'] .member-tag,
body[data-theme='carbon-light'] .settings-note {
  color: #334866;
}

body[data-theme='carbon-light'] .settings-card,
body[data-theme='carbon-light'] .settings-account-profile-card,
body[data-theme='carbon-light'] .settings-list-item,
body[data-theme='carbon-light'] .msg,
body[data-theme='carbon-light'] .member-item,
body[data-theme='carbon-light'] .channels-col .user-dock,
body[data-theme='carbon-light'] .audit-card,
body[data-theme='carbon-light'] .settings-shell {
  background: rgba(255, 255, 255, 0.82);
}

body[data-theme='carbon-light'] .settings-submodal-card {
  background: rgba(251, 254, 255, 0.98);
}

body[data-theme='carbon-light'] .settings-grid input,
body[data-theme='carbon-light'] .settings-grid select,
body[data-theme='carbon-light'] .settings-grid textarea,
body[data-theme='carbon-light'] .settings-inline-form input,
body[data-theme='carbon-light'] .settings-inline-form select,
body[data-theme='carbon-light'] .settings-stack-form input,
body[data-theme='carbon-light'] .settings-stack-form select,
body[data-theme='carbon-light'] .settings-stack-form textarea,
body[data-theme='carbon-light'] .composer input,
body[data-theme='carbon-light'] .settings-search-wrap input {
  background: rgba(255, 255, 255, 0.96);
  color: #1a2e45;
  border-color: rgba(85, 112, 153, 0.35);
}

body[data-theme='carbon-light'] .settings-nav,
body[data-theme='carbon-light'] .settings-content-user {
  background: rgba(244, 250, 255, 0.96);
}

body[data-theme='carbon-light'] .settings-connection-item,
body[data-theme='carbon-light'] .settings-live-preview,
body[data-theme='carbon-light'] .settings-account-profile-card,
body[data-theme='carbon-light'] .settings-account-row,
body[data-theme='carbon-light'] .settings-connection-toggle {
  background: rgba(255, 255, 255, 0.9);
}

body[data-theme='carbon-light'] .settings-connection-icon {
  border-color: rgba(34, 56, 88, 0.25);
}

body[data-theme='carbon-light'] .settings-connection-name,
body[data-theme='carbon-light'] .settings-live-preview-body,
body[data-theme='carbon-light'] .settings-live-preview-pills span,
body[data-theme='carbon-light'] .settings-account-tag,
body[data-theme='carbon-light'] .settings-submodal-head h3 {
  color: #223751;
}

body[data-theme='carbon-light'] .settings-live-preview-title,
body[data-theme='carbon-light'] .settings-connection-hint,
body[data-theme='carbon-light'] .settings-game-catalog-meta {
  color: #5e7495;
}

body[data-theme='carbon-light'] .settings-role-drag {
  color: #496385;
  border-color: rgba(73, 99, 133, 0.35);
  background: rgba(241, 248, 255, 0.95);
}

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

body.chat-compact .messages {
  gap: 4px;
}

body.chat-compact .msg {
  padding: 4px 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(148, 177, 231, 0.25);
}

body.chat-compact .msg-meta {
  margin-bottom: 1px;
  font-size: 11px;
}

body.chat-compact .msg-author {
  font-size: 12px;
}

body.chat-compact .msg-content {
  font-size: 13px;
  line-height: 1.2;
}

body:not(.chat-compact) .messages {
  gap: 8px;
}

body:not(.chat-compact) .msg {
  padding: 10px 12px;
}

body:not(.chat-compact) .msg-content {
  line-height: 1.42;
}

body.hide-presence #me-status-dot,
body.hide-presence #user-dock-status,
body.hide-presence .member-item .dot,
body.hide-presence .status-badge {
  visibility: hidden;
}

.hidden {
  display: none !important;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}

.orb-a {
  width: 380px;
  height: 380px;
  left: -120px;
  top: -110px;
  background: rgba(95, 240, 203, 0.2);
}

.orb-b {
  width: 420px;
  height: 420px;
  right: -120px;
  bottom: -120px;
  background: rgba(138, 166, 255, 0.25);
}

.auth-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(23, 34, 58, 0.92), rgba(16, 24, 43, 0.92));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  padding: 28px;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.auth-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-size: 12px;
}

.auth-back-link {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: #d4def7;
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  padding: 8px 10px;
}

.auth-back-link:hover {
  background: rgba(95, 240, 203, 0.13);
  border-color: rgba(95, 240, 203, 0.45);
}

.auth-card h1 {
  margin: 8px 0;
  font-family: var(--font-heading);
  font-size: 42px;
}

.auth-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
}

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

.auth-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.auth-form .remember-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d2ddf7;
  font-size: 13px;
}

.auth-assist {
  margin: -4px 0 0;
  text-align: right;
}

.auth-assist a {
  color: #9ec5ff;
  font-size: 12px;
  text-decoration: none;
}

.auth-assist a:hover {
  color: #c8dbff;
  text-decoration: underline;
}

.auth-form .remember-line input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.auth-form input,
.composer input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 13, 24, 0.65);
  color: var(--ink);
  padding: 12px;
  font: inherit;
}

.auth-form button,
.composer button {
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #071222;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
}

.captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.captcha-question {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.captcha-refresh {
  white-space: nowrap;
  font-size: 11px;
  padding: 7px 9px;
}

.auth-hint,
.auth-error {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.auth-error {
  color: var(--danger);
}

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-areas:
    'servers servers servers'
    'channels chat members';
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.app.members-hidden {
  grid-template-areas:
    'servers servers'
    'channels chat';
  grid-template-columns: 300px minmax(0, 1fr);
}

.app.members-hidden .members-col {
  display: none;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.servers-top {
  grid-area: servers;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.brand-pill {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--accent);
  white-space: nowrap;
}

.servers-list {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: auto;
  padding: 2px;
}

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

.server-item {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  padding: 8px 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.server-badge {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: rgba(95, 240, 203, 0.14);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.server-name {
  font-size: 12px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-item.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(95, 240, 203, 0.35);
}

.icon-btn {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  min-height: 38px;
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  padding: 8px 10px;
  white-space: nowrap;
}

.channels-col,
.chat-col,
.members-col {
  min-height: 0;
}

.channels-col {
  grid-area: channels;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-family: var(--font-heading);
}

.channels-head {
  position: relative;
  align-items: stretch;
}

.server-menu-wrap {
  position: relative;
  width: 100%;
}

.server-menu-trigger {
  width: 100%;
  border: 1px solid rgba(148, 177, 231, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #e6f0ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
}

.server-menu-trigger:hover,
.server-menu-trigger[aria-expanded='true'] {
  border-color: rgba(95, 240, 203, 0.52);
  box-shadow: 0 0 0 1px rgba(95, 240, 203, 0.2);
  background: rgba(95, 240, 203, 0.08);
}

.server-menu-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.server-menu-title {
  display: block;
  font-size: 15px;
  line-height: 1.2;
  font-family: var(--font-heading);
  color: #eaf3ff;
}

.server-menu-slug {
  font-size: 11px;
}

.server-menu-chevron {
  color: #a8c2eb;
  font-size: 12px;
}

.server-context-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 8;
  border: 1px solid rgba(148, 177, 231, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(13, 22, 42, 0.98), rgba(10, 18, 35, 0.98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.server-context-item {
  border: 0;
  background: transparent;
  color: #dbe9ff;
  border-radius: 8px;
  text-align: left;
  padding: 9px 10px;
  font-size: 13px;
  cursor: pointer;
}

.server-context-item:hover {
  background: rgba(95, 240, 203, 0.14);
  color: #f3fbff;
}

.server-context-separator {
  height: 1px;
  background: rgba(148, 177, 231, 0.2);
  margin: 3px 0;
}

.muted {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ghost-btn,
.outline-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.channels-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.channel-category {
  border: 0;
  background: transparent;
  padding: 4px 6px;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 8px;
  cursor: pointer;
}

.channel-category-caret {
  font-size: 10px;
  color: #98b6e6;
  width: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.channel-category-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-category-add {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d8ebff;
  font-size: 14px;
  line-height: 1;
}

.channel-category-add:hover,
.channel-category-add:focus {
  outline: none;
  border-color: rgba(95, 240, 203, 0.48);
  background: rgba(95, 240, 203, 0.12);
}

.channel-category.collapsed .channel-category-caret {
  color: #8fb2dc;
}

.channel-category.channel-category-draggable {
  cursor: grab;
}

.channel-category.dragging {
  cursor: grabbing;
  opacity: 0.9;
  border-color: rgba(95, 240, 203, 0.82);
  background: rgba(95, 240, 203, 0.14);
  box-shadow: 0 0 0 2px rgba(95, 240, 203, 0.28), 0 10px 20px rgba(4, 10, 20, 0.42);
}

.channel-category.drag-origin {
  border-color: rgba(95, 240, 203, 0.9);
  background: rgba(95, 240, 203, 0.2);
  box-shadow: 0 0 0 2px rgba(95, 240, 203, 0.36), 0 14px 24px rgba(4, 10, 20, 0.5);
  color: #dff7ff;
}

.channel-item {
  border: 1px solid transparent;
  border-radius: 10px;
  color: #ccdaff;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 10px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.channel-item.channel-item-draggable {
  cursor: grab;
}

.channel-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.channel-item-main > .channel-item-title {
  min-width: 0;
}

.channel-invite-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #b7d3ff;
  font-size: 13px;
  width: 24px;
  height: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-invite-btn:hover {
  border-color: rgba(95, 240, 203, 0.5);
  background: rgba(95, 240, 203, 0.14);
  color: #e9fffb;
}

.channel-item-title {
  margin: 0;
  font-size: 13px;
  color: #d7e7ff;
  font-weight: 600;
}

.channel-item-meta {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.channel-voice-members {
  display: grid;
  gap: 6px;
}

.channel-voice-member {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #c5dbff;
}

.channel-voice-member .user-avatar {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.channel-voice-member-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-voice-member-mute {
  color: #ff8b90;
  font-size: 11px;
  margin-left: auto;
}

.channel-item.dragging {
  opacity: 0.88;
  cursor: grabbing;
  transform: scale(1.01);
  border-color: rgba(95, 240, 203, 0.65);
  box-shadow: 0 10px 22px rgba(5, 12, 24, 0.42), 0 0 0 1px rgba(95, 240, 203, 0.3);
}

.channel-item.drag-origin {
  border-color: rgba(95, 240, 203, 0.9);
  background: rgba(95, 240, 203, 0.2);
  box-shadow: 0 0 0 2px rgba(95, 240, 203, 0.35), 0 14px 24px rgba(4, 10, 20, 0.5);
  z-index: 3;
}

.channel-item.drop-target {
  border-color: rgba(135, 162, 255, 0.5);
  background: rgba(135, 162, 255, 0.12);
}

.channel-item.drop-target.drop-before {
  box-shadow: inset 0 3px 0 rgba(95, 240, 203, 0.92), 0 0 0 1px rgba(135, 162, 255, 0.34);
}

.channel-item.drop-target.drop-after {
  box-shadow: inset 0 -3px 0 rgba(95, 240, 203, 0.92), 0 0 0 1px rgba(135, 162, 255, 0.34);
}

.channel-item.active {
  border-color: rgba(95, 240, 203, 0.62);
  box-shadow: 0 0 0 1px rgba(95, 240, 203, 0.28), inset 0 0 0 999px rgba(95, 240, 203, 0.08);
  background: rgba(95, 240, 203, 0.2);
  color: var(--ink);
}

.channel-item.channel-item-disabled {
  opacity: 0.52;
  cursor: not-allowed;
  border-color: rgba(120, 138, 173, 0.35);
  box-shadow: none;
  background: rgba(22, 33, 54, 0.28);
}

.channel-item.channel-item-disabled:hover {
  transform: none;
}

.channel-lock {
  color: var(--muted);
  font-size: 11px;
}

.channel-category.channel-category-drop {
  border: 1px dashed transparent;
  border-radius: 8px;
  padding: 6px 7px;
}

.channel-category.channel-category-drop.drop-target {
  border-color: rgba(95, 240, 203, 0.4);
  background: rgba(95, 240, 203, 0.08);
  color: #cce7ff;
}

.channel-category.channel-category-drop.drop-target.drop-before {
  box-shadow: inset 0 3px 0 rgba(95, 240, 203, 0.92), 0 0 0 1px rgba(135, 162, 255, 0.34);
}

.channel-category.channel-category-drop.drop-target.drop-after {
  box-shadow: inset 0 -3px 0 rgba(95, 240, 203, 0.92), 0 0 0 1px rgba(135, 162, 255, 0.34);
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.logout-btn {
  color: #ffb9c2;
  border-color: rgba(255, 139, 144, 0.35);
}

.user-dock {
  border-top: 1px solid var(--line);
  background: rgba(8, 13, 24, 0.55);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  position: relative;
}

.user-dock-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-call-dock {
  grid-column: 1 / -1;
  border: 1px solid rgba(95, 240, 203, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(12, 28, 45, 0.9), rgba(10, 20, 38, 0.95));
  padding: 9px 10px;
  display: grid;
  gap: 7px;
}

.voice-call-dock-title,
.voice-call-dock-subtitle {
  margin: 0;
  line-height: 1.2;
}

.voice-call-dock-title {
  font-size: 12px;
  color: #ccf8ee;
  font-weight: 700;
}

.voice-call-dock-subtitle {
  font-size: 11px;
  color: #9ec8ff;
}

.voice-call-dock-actions {
  display: flex;
  gap: 6px;
}

.voice-call-dock-actions .outline-btn {
  min-height: 28px;
  padding: 6px 10px;
  font-size: 11px;
}

.user-dock-meta {
  min-width: 0;
}

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

.user-dock-name,
.user-dock-hint {
  margin: 0;
  line-height: 1.25;
}

.user-dock-name {
  font-size: 13px;
  font-weight: 700;
  color: #dce8ff;
  font-family: var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dock-hint {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dock-voice {
  margin: 2px 0 0;
  font-size: 10px;
  color: #9fc7ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: #dce8ff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.dock-icon-btn:hover {
  border-color: rgba(95, 240, 203, 0.45);
  background: rgba(95, 240, 203, 0.12);
}

.dock-icon-btn.active {
  border-color: rgba(95, 240, 203, 0.6);
  box-shadow: 0 0 0 1px rgba(95, 240, 203, 0.25);
  background: rgba(95, 240, 203, 0.16);
}

.dock-icon-btn.muted {
  border-color: rgba(255, 139, 144, 0.58);
  background: rgba(255, 139, 144, 0.16);
  color: #ffd3d7;
}

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

.quick-modal-card {
  width: min(560px, 96vw);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 20, 40, 0.98), rgba(8, 16, 32, 0.98));
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.quick-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.quick-modal-head h3 {
  margin: 2px 0 0;
  font-family: var(--font-heading);
  font-size: 19px;
}

.quick-modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.settings-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.settings-stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
}

.settings-stat-card h4 {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-stat-card p {
  margin: 8px 0 0;
  font-size: 26px;
  font-family: var(--font-heading);
  color: #eef6ff;
}

.channel-create-type-wrap {
  display: grid;
  gap: 8px;
}

.channel-create-type-title {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.channel-create-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.channel-create-type-btn {
  border: 1px solid rgba(148, 177, 231, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #d8e9ff;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 10px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.channel-create-type-btn:hover {
  border-color: rgba(95, 240, 203, 0.5);
  background: rgba(95, 240, 203, 0.08);
}

.channel-create-type-btn.active {
  border-color: rgba(95, 240, 203, 0.75);
  background: linear-gradient(135deg, rgba(95, 240, 203, 0.2), rgba(138, 166, 255, 0.16));
  box-shadow: inset 0 0 0 1px rgba(95, 240, 203, 0.35);
}

.channel-create-type-btn:active {
  transform: translateY(1px);
}

.channel-create-type-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(148, 177, 231, 0.32);
  display: grid;
  place-items: center;
  font-size: 16px;
  background: rgba(11, 19, 37, 0.75);
}

.channel-create-type-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.channel-create-type-meta strong {
  font-size: 14px;
  color: #eef5ff;
  font-family: var(--font-heading);
}

.channel-create-type-meta small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

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

.settings-shell {
  width: min(1200px, 96vw);
  height: min(860px, 94vh);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #0b1328;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
}

.settings-shell-user {
  grid-template-columns: 280px minmax(0, 1fr);
}

.settings-shell-server {
  grid-template-columns: 280px minmax(0, 1fr);
}

.settings-nav {
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: grid;
  align-content: start;
  gap: 6px;
  background: linear-gradient(180deg, rgba(11, 20, 40, 0.98), rgba(9, 17, 34, 0.98));
}

.settings-nav-user {
  padding: 0;
  gap: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.settings-nav-server {
  padding: 0;
  gap: 0;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.settings-server-card {
  border-bottom: 1px solid var(--line);
  padding: 16px 14px;
}

.settings-server-scroll {
  padding-top: 10px;
}

.settings-user-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--line);
}

.settings-user-meta {
  min-width: 0;
}

.settings-user-display,
.settings-user-hint {
  margin: 0;
  line-height: 1.25;
}

.settings-user-display {
  font-size: 14px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #e9f3ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-user-hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-search-wrap {
  position: relative;
  display: block;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.settings-search-icon {
  position: absolute;
  left: 21px;
  top: 50%;
  transform: translateY(-50%);
  color: #8ca2c7;
  font-size: 13px;
  pointer-events: none;
}

.settings-search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(9, 14, 28, 0.86);
  color: #dce8ff;
  font: inherit;
  font-size: 13px;
  padding: 9px 10px 9px 28px;
}

.settings-nav-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px 14px;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  height: 100%;
}

.settings-nav-scroll .settings-tab-btn {
  display: block;
  width: 100%;
  margin: 0 0 2px;
}

.settings-nav-group {
  margin: 12px 8px 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 177, 231, 0.24);
  color: #93a8cc;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-nav-group:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.settings-nav-group[data-hidden='true'] {
  display: none;
}

.settings-nav h3 {
  margin: 0 0 8px;
  padding: 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.settings-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #c8d7f7;
  border-radius: 9px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  padding: 9px 10px;
  cursor: pointer;
}

.settings-tab-btn[data-nav-hidden='true'] {
  display: none;
}

.settings-tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.settings-tab-btn.active {
  border-color: rgba(95, 240, 203, 0.28);
  background: rgba(95, 240, 203, 0.14);
  color: #ecf6ff;
}

.settings-nav-logout {
  margin: 10px 12px 12px;
  border: 1px solid rgba(255, 139, 144, 0.38);
  border-radius: 9px;
  background: rgba(255, 139, 144, 0.12);
  color: #ffc2c9;
  font: inherit;
  font-size: 12px;
  padding: 9px 10px;
  cursor: pointer;
}

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

.settings-content-user {
  background: #121a2d;
}

.settings-content-server {
  background: #121a2d;
}

#user-settings-modal .settings-content-user {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#user-settings-modal .settings-head,
#user-settings-modal .settings-error,
#user-settings-modal .settings-feedback {
  flex: 0 0 auto;
}

.settings-content-user .settings-tab {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  align-self: stretch;
  justify-content: flex-start;
}

#user-settings-modal .settings-tab {
  display: none;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 20px 28px;
}

#user-settings-modal .settings-tab.active {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.settings-head h2 {
  margin: 0;
  font-size: 18px;
  font-family: var(--font-heading);
}

.settings-close-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #dce7ff;
  font: inherit;
  font-size: 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.settings-close-btn-icon {
  border-radius: 999px;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 14px;
  display: inline-grid;
  place-items: center;
}

.settings-error {
  min-height: 20px;
  padding: 8px 18px 0;
  color: var(--danger);
  font-size: 12px;
}

.settings-feedback {
  min-height: 18px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.settings-feedback[data-kind='success'] {
  color: var(--accent);
}

.settings-tab {
  display: none;
  overflow: auto;
  padding: 16px 20px 24px;
  align-content: start;
  gap: 12px;
}

.settings-tab.active {
  display: grid;
}

.settings-page-intro {
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 177, 231, 0.22);
}

.settings-page-intro h3 {
  margin: 0;
  font-size: 20px;
  font-family: var(--font-heading);
  color: #eff5ff;
}

.settings-page-intro p {
  margin: 6px 0 0;
  color: #98abcf;
  font-size: 13px;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 177, 231, 0.16);
  padding-bottom: 10px;
}

.settings-card-head .settings-label,
.settings-card-head .settings-note {
  margin: 0;
}

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

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

.settings-kpi-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.settings-kpi-value {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 24px;
  color: #f0f6ff;
}

.settings-role-layout,
.settings-channel-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.settings-roles-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settings-role-list-card,
.settings-role-editor-card {
  align-content: start;
}

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

.settings-role-create-row {
  margin-top: 4px;
}

.settings-permissions-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(6, 10, 20, 0.45);
}

.settings-permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid rgba(148, 177, 231, 0.15);
  border-radius: 8px;
}

.settings-permission-item label {
  margin: 0;
  color: #dce8ff;
  font-size: 12px;
}

.settings-overrides-grid {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.settings-override-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 8px;
  align-items: center;
}

.settings-member-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.settings-member-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-member-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-member-role {
  border: 1px solid rgba(148, 177, 231, 0.24);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: #dbe8ff;
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-member-role .ghost-btn {
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 999px;
}

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

.settings-timeline-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 4px;
}

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

.settings-label {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.settings-value {
  margin: 0;
  color: #e6f0ff;
  font-size: 14px;
}

.settings-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.settings-content-user .settings-grid,
.settings-content-user .settings-inline-grid {
  grid-template-columns: 1fr;
}

.settings-content-user .settings-inline-form {
  grid-template-columns: 1fr;
}

.settings-account-subtabs {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 177, 231, 0.2);
}

.settings-account-subtab {
  border: 0;
  background: transparent;
  color: #9fb3d6;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 0 9px;
  cursor: default;
}

.settings-account-subtab.active {
  color: #c6d6ff;
  border-bottom: 2px solid #87a2ff;
}

.settings-account-profile-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.settings-account-banner {
  height: 96px;
  background:
    linear-gradient(90deg, rgba(255, 199, 155, 0.55), rgba(231, 145, 214, 0.45), rgba(115, 164, 255, 0.45)),
    linear-gradient(120deg, #1a2440 0%, #111a32 45%, #111f39 100%);
}

.settings-account-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 0 16px 12px;
  margin-top: -28px;
}

.settings-account-avatar-wrap {
  position: relative;
}

.settings-account-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 6px solid #121a2d;
  font-size: 22px;
}

.settings-account-avatar-wrap .dot {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 14px;
  height: 14px;
  border: 3px solid #121a2d;
}

.settings-account-meta {
  min-width: 0;
}

.settings-account-meta h3 {
  margin: 0;
  color: #edf3ff;
  font-size: 33px;
  line-height: 1;
}

.settings-account-tag {
  margin: 6px 0 0;
  color: #9eb2d6;
  font-size: 15px;
}

.settings-account-rows {
  padding: 0 14px 14px;
  display: grid;
  gap: 8px;
}

.settings-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(148, 177, 231, 0.18);
  border-radius: 10px;
  background: rgba(8, 13, 24, 0.35);
  padding: 11px 12px;
}

.settings-account-row .settings-value {
  margin-top: 3px;
}

.settings-grid-full {
  grid-column: 1 / -1;
}

.settings-grid label,
.settings-stack-form label {
  display: grid;
  gap: 6px;
  color: #d5e2ff;
  font-size: 12px;
}

.settings-grid input,
.settings-grid select,
.settings-grid textarea,
.settings-inline-form input,
.settings-inline-form select,
.settings-stack-form input,
.settings-stack-form select,
.settings-stack-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 10, 20, 0.82);
  color: #ecf4ff;
  padding: 10px;
  font: inherit;
  min-width: 0;
}

.settings-grid textarea,
.settings-stack-form textarea {
  resize: vertical;
}

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

.settings-actions-left {
  justify-content: flex-start;
}

.settings-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-inline-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.solid-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #041225;
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  padding: 9px 12px;
  cursor: pointer;
}

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

.settings-inline-form-games {
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-stack-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.settings-inline-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.settings-inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d5e2ff;
  font-size: 12px;
}

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

.settings-list-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  display: grid;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.settings-list-item.active {
  border-color: rgba(95, 240, 203, 0.64);
  background: rgba(95, 240, 203, 0.14);
  box-shadow: 0 0 0 1px rgba(95, 240, 203, 0.24);
}

.settings-list-item.active .settings-list-item-title {
  color: #f2fbff;
}

.settings-list-item[data-role-id],
.settings-list-item[data-channel-id] {
  cursor: pointer;
}

.settings-list-item.dragging {
  opacity: 0.9;
  cursor: grabbing;
  transform: scale(1.01);
  border-color: rgba(95, 240, 203, 0.65);
  box-shadow: 0 10px 20px rgba(5, 12, 24, 0.4), 0 0 0 1px rgba(95, 240, 203, 0.28);
}

.settings-list-item.drag-origin {
  border-color: rgba(95, 240, 203, 0.9);
  background: rgba(95, 240, 203, 0.16);
  box-shadow: 0 0 0 2px rgba(95, 240, 203, 0.36), 0 14px 24px rgba(5, 12, 24, 0.48);
  z-index: 3;
}

.settings-list-item.drop-target {
  border-color: rgba(135, 162, 255, 0.46);
  background: rgba(135, 162, 255, 0.1);
  box-shadow: inset 0 3px 0 rgba(95, 240, 203, 0.86), 0 0 0 1px rgba(135, 162, 255, 0.22);
}

body.is-dragging-role .settings-list-item[data-role-id],
body.is-dragging-channel .channel-item {
  transition: none;
}

.settings-list-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-list-item-title {
  margin: 0;
  color: #e8f2ff;
  font-size: 14px;
}

.settings-list-item-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  padding: 3px 7px;
  color: #d8e7ff;
  background: rgba(255, 255, 255, 0.03);
}

.settings-role-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.settings-role-drag {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border: 1px dashed rgba(148, 177, 231, 0.35);
  border-radius: 7px;
  color: #9bb1d6;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.settings-gear-btn {
  min-width: 34px;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1;
}

.settings-danger-btn {
  border: 1px solid rgba(255, 139, 144, 0.45);
  border-radius: 8px;
  background: rgba(255, 139, 144, 0.12);
  color: #ffc7cc;
  font-size: 11px;
  padding: 6px 8px;
  cursor: pointer;
}

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

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

.settings-moderation-card {
  align-content: start;
}

.settings-moderation-textarea {
  min-height: 170px;
  max-height: 320px;
  resize: none;
  line-height: 1.45;
}

.settings-moderation-preview {
  border-style: dashed;
}

.switch {
  position: relative;
  display: inline-flex;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  transition: all 0.2s ease;
}

.switch-ui::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dbe9ff;
  top: 2px;
  left: 2px;
  transition: all 0.2s ease;
}

.switch input:checked + .switch-ui {
  background: rgba(95, 240, 203, 0.35);
  border-color: rgba(95, 240, 203, 0.55);
}

.switch input:checked + .switch-ui::after {
  transform: translateX(18px);
  background: #f3fffc;
}

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

.settings-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(148, 177, 231, 0.2);
  border-radius: 9px;
  padding: 8px 10px;
  color: #dbe8ff;
  font-size: 12px;
}

.settings-shortcut-row kbd {
  border: 1px solid rgba(148, 177, 231, 0.3);
  border-radius: 6px;
  background: rgba(8, 13, 24, 0.7);
  color: #eff6ff;
  padding: 3px 7px;
  font: inherit;
  font-size: 11px;
}

.settings-connections-catalog {
  display: grid;
  gap: 10px;
}

.settings-connection-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  display: grid;
  gap: 9px;
}

.settings-connection-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.settings-connection-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: var(--provider-color, #3d4f77);
}

.settings-connection-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

.settings-connection-provider-mark {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.settings-connection-meta {
  min-width: 0;
}

.settings-connection-name,
.settings-connection-hint {
  margin: 0;
}

.settings-connection-name {
  color: #e8f2ff;
  font-size: 14px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.settings-connection-hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.settings-connection-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(148, 177, 231, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
  color: #dbe8ff;
  font-size: 12px;
}

.settings-connection-toggle input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.settings-live-preview {
  border: 1px solid rgba(148, 177, 231, 0.24);
  border-radius: 10px;
  background: linear-gradient(140deg, rgba(17, 33, 62, 0.82), rgba(24, 41, 76, 0.76));
  padding: 10px;
  display: grid;
  gap: 8px;
  font-size: calc(13px * var(--preview-font-scale, 1));
}

.settings-live-preview-title,
.settings-live-preview-body {
  margin: 0;
}

.settings-live-preview-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9cb2d7;
}

.settings-live-preview-body {
  color: #e2eeff;
  line-height: 1.3;
}

.settings-live-preview-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-live-preview-pills span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 177, 231, 0.26);
  border-radius: 999px;
  padding: 5px 8px;
  color: #eaf3ff;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
}

.settings-live-preview-pills .accent {
  background: rgba(95, 240, 203, 0.18);
  color: #9af8e2;
}

.settings-live-preview-pills .accent-2 {
  background: rgba(138, 166, 255, 0.22);
  color: #d6e0ff;
}

.settings-live-preview-pills .neutral {
  color: #c7d6f3;
}

.settings-mic-meter {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.settings-mic-meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4be0b8, #6ac9ff, #8aa6ff);
  transition: width 120ms linear;
}

#settings-mic-monitor {
  width: 100%;
  height: 32px;
}

.settings-camera-preview-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 13, 24, 0.58);
  padding: 8px;
}

.settings-camera-preview {
  width: 100%;
  max-height: 260px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(5, 8, 16, 0.9);
  border: 1px solid rgba(148, 177, 231, 0.22);
}

.settings-games-catalog {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.settings-game-catalog-item {
  border: 1px solid rgba(148, 177, 231, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.settings-game-catalog-meta {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.settings-submodal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: rgba(5, 9, 18, 0.78);
  backdrop-filter: blur(6px);
  padding: 16px;
}

.settings-submodal-card {
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 27, 47, 0.96), rgba(13, 21, 39, 0.96));
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.settings-submodal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-submodal-head h3 {
  margin: 0;
  font-size: 17px;
  font-family: var(--font-heading);
}

.settings-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #d8e9ff;
  font-size: 12px;
  padding: 6px 10px;
}

.settings-chip button {
  border: 0;
  background: transparent;
  color: #ffb5bc;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.settings-accessibility-icons-off .switch-ui::after {
  box-shadow: inset 0 0 0 2px rgba(9, 14, 28, 0.6);
}

.settings-legacy-composer .composer input {
  border-radius: 4px;
  padding: 10px;
}

body.high-contrast {
  --line: rgba(202, 219, 255, 0.55);
}

body.high-contrast .msg,
body.high-contrast .settings-card,
body.high-contrast .settings-account-row,
body.high-contrast .settings-connection-item,
body.high-contrast .member-item,
body.high-contrast .channels-col .user-dock,
body.high-contrast .audit-card {
  border-color: rgba(220, 236, 255, 0.65);
  background: rgba(9, 16, 31, 0.88);
}

body.high-contrast .msg-content,
body.high-contrast .settings-value,
body.high-contrast .settings-connection-name,
body.high-contrast .member-name,
body.high-contrast .user-dock-name {
  color: #f3f8ff;
}

body[data-theme='carbon-light'].high-contrast .msg,
body[data-theme='carbon-light'].high-contrast .settings-card,
body[data-theme='carbon-light'].high-contrast .settings-account-row,
body[data-theme='carbon-light'].high-contrast .settings-connection-item,
body[data-theme='carbon-light'].high-contrast .member-item,
body[data-theme='carbon-light'].high-contrast .channels-col .user-dock,
body[data-theme='carbon-light'].high-contrast .audit-card {
  border-color: rgba(60, 90, 137, 0.62);
  background: rgba(255, 255, 255, 0.98);
}

body[data-theme='carbon-light'].high-contrast .msg-content,
body[data-theme='carbon-light'].high-contrast .settings-value,
body[data-theme='carbon-light'].high-contrast .settings-connection-name,
body[data-theme='carbon-light'].high-contrast .member-name,
body[data-theme='carbon-light'].high-contrast .user-dock-name {
  color: #13243a;
}

body.streamer-hide-personal .settings-value-private,
body.streamer-hide-personal .member-tag,
body.streamer-hide-personal .user-dock-hint,
body.streamer-hide-personal .settings-user-hint,
body.streamer-hide-personal .settings-account-tag {
  filter: blur(4px);
  user-select: none;
}

body.streamer-hide-invites [data-sensitive='invite'],
body.streamer-hide-invites .settings-invite-code {
  filter: blur(4px);
  user-select: none;
}

.chat-col {
  grid-area: chat;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
}

.chat-head {
  background: linear-gradient(90deg, rgba(95, 240, 203, 0.08), rgba(138, 166, 255, 0.12));
}

.presence-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6f7f9c;
}

.dot.online {
  background: #5ff0cb;
}

.dot.idle {
  background: #f7d47a;
}

.dot.dnd {
  background: #ff8b90;
}

.dot.offline {
  background: #7a879f;
}

.messages {
  padding: 12px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.typing-indicator {
  min-height: 22px;
  padding: 0 14px 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9eb9df;
  font-size: 12px;
  line-height: 1;
  user-select: none;
}

.typing-indicator-text {
  color: #aac4e8;
}

.typing-indicator-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-indicator-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(172, 198, 234, 0.88);
  animation: typing-dot-bounce 1s ease-in-out infinite;
}

.typing-indicator-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-indicator-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typing-dot-bounce {
  0%, 60%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

body.reduced-motion .typing-indicator-dots span {
  animation: none;
  opacity: 0.82;
}

@media (prefers-reduced-motion: reduce) {
  .typing-indicator-dots span {
    animation: none;
    opacity: 0.82;
  }
}

.voice-stage {
  padding: 12px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
}

.voice-stage-head {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voice-stage-head h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
}

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

.voice-participants {
  display: grid;
  align-content: start;
  gap: 8px;
}

.voice-participant {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-participant-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.voice-participant-name {
  margin: 0;
  color: #e8f2ff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-participant-sub {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.voice-participant-mute {
  margin-left: auto;
  color: #ff8b90;
  font-size: 12px;
}

.msg {
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  position: relative;
}

.msg:hover {
  background: rgba(255, 255, 255, 0.045);
}

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

.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.msg-author {
  color: #e9f2ff;
  font-weight: 700;
  font-size: 13px;
}

.msg-author-clickable {
  cursor: pointer;
  border-radius: 6px;
  padding: 1px 4px;
  margin-left: -4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.msg-author-clickable:hover,
.msg-author-clickable:focus-visible {
  outline: none;
  background: rgba(95, 240, 203, 0.16);
  color: #f2fbff;
}

.msg-time {
  font-size: 11px;
}

.msg-content {
  color: #d9e6ff;
  word-break: break-word;
  display: grid;
  gap: 8px;
}

.msg-reply-preview {
  border: 0;
  background: transparent;
  color: #acc4e8;
  text-align: left;
  padding: 0;
  margin: 0 0 6px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.msg-reply-preview:hover .msg-reply-preview-author,
.msg-reply-preview:hover .msg-reply-preview-text {
  color: #d8ebff;
}

.msg-reply-preview-line {
  width: 12px;
  height: 12px;
  border-left: 2px solid rgba(148, 177, 231, 0.45);
  border-top: 2px solid rgba(148, 177, 231, 0.45);
  border-top-left-radius: 8px;
  margin-left: 4px;
}

.msg-reply-preview-content {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-reply-preview-author {
  font-size: 11px;
  font-weight: 700;
  color: #bdd4f7;
  white-space: nowrap;
}

.msg-reply-preview-text {
  min-width: 0;
  font-size: 11px;
  color: #9fb6d7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.msg-reaction-pill {
  border: 1px solid rgba(148, 177, 231, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #dce9ff;
  font: inherit;
  font-size: 12px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.msg-reaction-pill:hover {
  border-color: rgba(95, 240, 203, 0.45);
  background: rgba(95, 240, 203, 0.12);
}

.msg-reaction-pill.active {
  border-color: rgba(95, 240, 203, 0.62);
  background: rgba(95, 240, 203, 0.18);
}

.msg-reaction-emoji {
  font-size: 14px;
  line-height: 1;
}

.msg-reaction-count {
  font-weight: 700;
  color: #cde4ff;
}

.msg-quick-actions {
  position: absolute;
  right: 8px;
  top: -14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(148, 177, 231, 0.32);
  background: rgba(10, 16, 30, 0.98);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}

.msg:hover .msg-quick-actions,
.msg:focus-within .msg-quick-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.msg-quick-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #cde2ff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.msg-quick-btn:hover {
  border-color: rgba(95, 240, 203, 0.45);
  background: rgba(95, 240, 203, 0.12);
  color: #ebfffb;
}

.msg-quick-btn-react {
  color: #a7b8d2;
}

.msg-highlight {
  border-color: rgba(95, 240, 203, 0.72) !important;
  box-shadow: 0 0 0 1px rgba(95, 240, 203, 0.35), 0 0 0 5px rgba(95, 240, 203, 0.12);
}

.composer {
  display: grid;
  gap: 10px;
  padding: 10px 10px 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 18, 34, 0.75), rgba(8, 14, 26, 0.95));
}

.composer-reply {
  border: 1px solid rgba(148, 177, 231, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 7px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.composer-reply-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.composer-reply-mention {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(122, 184, 255, 0.32);
  background: rgba(122, 184, 255, 0.12);
  color: #9ecbff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.composer-reply-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.composer-reply-label,
.composer-reply-preview {
  margin: 0;
  line-height: 1.28;
}

.composer-reply-label {
  font-size: 11px;
  color: #9fc0eb;
}

.composer-reply-label span {
  color: #d6e8ff;
  font-weight: 700;
}

.composer-reply-preview {
  font-size: 12px;
  color: #c7d9f7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-reply-cancel {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(148, 177, 231, 0.3);
  background: rgba(255, 255, 255, 0.02);
  color: #d2e4ff;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.composer-reply-cancel:hover {
  border-color: rgba(255, 139, 144, 0.45);
  color: #ffd4d9;
  background: rgba(255, 139, 144, 0.12);
}

.composer-toolbar {
  display: none;
}

.composer-plus-wrap {
  position: relative;
}

.composer-plus-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #dcf0ff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
}

.composer-plus-btn:hover {
  border: 0;
  background: rgba(95, 240, 203, 0.14);
  color: #e8fffb;
}

.composer-add-menu {
  position: absolute;
  left: 0;
  top: auto !important;
  bottom: calc(100% + 8px);
  z-index: 14;
  min-width: 280px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.97);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.38);
  display: grid;
  gap: 6px;
}

.composer-menu-item {
  width: 100%;
  border: 1px solid rgba(148, 177, 231, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: #dbe9ff;
  text-align: left;
  font-size: 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.composer-menu-item:hover {
  border-color: rgba(95, 240, 203, 0.48);
  background: rgba(95, 240, 203, 0.13);
}

.composer-row {
  display: flex;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  align-items: center;
  border: 1px solid rgba(148, 177, 231, 0.34);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(6, 12, 24, 0.96), rgba(5, 9, 20, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(2, 6, 14, 0.42);
  padding: 8px;
}

.composer-row:focus-within {
  border-color: rgba(95, 240, 203, 0.56);
  box-shadow: 0 0 0 1px rgba(95, 240, 203, 0.24);
}

.composer-row input {
  border: none;
  background: transparent;
  min-height: 36px;
  width: 100%;
  flex: 1;
  padding: 0 2px;
  box-shadow: none;
}

.composer-row input:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

.composer-row button[type='submit'] {
  min-height: 36px;
  border-radius: 10px;
  min-width: 84px;
  flex-shrink: 0;
}

.composer-row .composer-plus-wrap {
  flex-shrink: 0;
}

.composer-inline-btn {
  min-height: 34px;
  min-width: 34px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #dcf0ff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 8px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.composer-inline-btn:hover {
  border: 0;
  background: rgba(95, 240, 203, 0.14);
  color: #e8fffb;
}

.composer-inline-btn-emoji {
  min-width: 34px;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.composer-attachments {
  display: grid;
  gap: 6px;
}

.composer-attachment {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-attachment-name {
  margin: 0;
  font-size: 12px;
  color: #dce8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-attachment-meta {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.composer-attachment-remove {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #ffb9c2;
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
  cursor: pointer;
}

.emoji-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 12, 24, 0.98);
  padding: 10px 10px 8px;
  display: grid;
  gap: 10px;
}

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

.emoji-picker-head input {
  min-height: 34px;
}

.emoji-picker-count {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: #9fc0eb;
  background: rgba(255, 255, 255, 0.03);
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 7px;
  max-height: 290px;
  overflow: auto;
  padding-right: 2px;
}

.emoji-picker-grid button {
  border: 1px solid rgba(148, 177, 231, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #e8f2ff;
  font-size: 20px;
  line-height: 1;
  padding: 8px 0;
  cursor: pointer;
}

.emoji-picker-grid button:hover {
  border-color: rgba(95, 240, 203, 0.48);
  background: rgba(95, 240, 203, 0.12);
}

.gif-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 12, 24, 0.98);
  padding: 10px 10px 8px;
  display: grid;
  gap: 10px;
}

.gif-picker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.gif-picker-head input {
  min-height: 34px;
}

.gif-picker-grid {
  max-height: 320px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  padding-right: 2px;
}

.gif-picker-status {
  margin: 0;
  font-size: 11px;
  color: #9fc0eb;
}

.gif-picker-item {
  border: 1px solid rgba(148, 177, 231, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  color: #dce8ff;
  text-align: left;
}

.gif-picker-item:hover {
  border-color: rgba(95, 240, 203, 0.58);
  box-shadow: 0 0 0 1px rgba(95, 240, 203, 0.22);
}

.gif-picker-item img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  display: block;
  background: rgba(0, 0, 0, 0.16);
}

.gif-picker-label {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gif-picker-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
}

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

.message-context-menu {
  position: fixed;
  z-index: 60;
  min-width: 246px;
  border: 1px solid rgba(148, 177, 231, 0.34);
  border-radius: 10px;
  background: rgba(15, 20, 34, 0.98);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.5);
  padding: 6px 6px 7px;
  display: grid;
  gap: 6px;
}

.message-context-group {
  display: grid;
  gap: 3px;
}

.message-context-separator {
  height: 1px;
  background: rgba(148, 177, 231, 0.18);
  margin: 0 2px;
}

.message-context-item {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #dde8ff;
  text-align: left;
  font: inherit;
  font-size: 13px;
  padding: 8px 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.message-context-item:hover {
  border-color: rgba(95, 240, 203, 0.58);
  background: rgba(95, 240, 203, 0.16);
}

.message-context-item.danger {
  color: #ffb8bf;
}

.message-context-item.danger:hover {
  border-color: rgba(255, 139, 144, 0.5);
  background: rgba(255, 139, 144, 0.14);
}

.message-context-hint {
  color: #90a9ce;
  font-size: 11px;
}

.message-reaction-picker {
  position: fixed;
  z-index: 62;
  min-width: 220px;
  border: 1px solid rgba(148, 177, 231, 0.34);
  border-radius: 12px;
  background: rgba(11, 16, 28, 0.98);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.5);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.message-reaction-picker-head {
  padding: 2px 2px 0;
}

.message-reaction-picker-title {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9db5d7;
  font-weight: 700;
}

.message-reaction-picker-search-wrap {
  padding: 0 2px;
}

.message-reaction-picker-search-wrap input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(148, 177, 231, 0.32);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: #dce8ff;
  padding: 0 10px;
}

.message-reaction-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.message-reaction-option {
  border: 1px solid rgba(148, 177, 231, 0.24);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: #dce8ff;
  font-size: 18px;
  line-height: 1;
  min-width: 38px;
  min-height: 34px;
  padding: 6px 8px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.message-reaction-option:hover {
  border-color: rgba(95, 240, 203, 0.5);
  background: rgba(95, 240, 203, 0.13);
}

.message-reaction-option img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

@media (hover: none), (pointer: coarse) {
  .msg-quick-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
}

.member-profile-card {
  width: min(460px, 96vw);
}

.settings-actions-inline {
  justify-content: flex-start;
}

.settings-custom-asset-item {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.settings-custom-asset-preview {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(148, 177, 231, 0.35);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.settings-custom-asset-meta {
  min-width: 0;
}

.settings-custom-asset-meta p {
  margin: 0;
}

.settings-custom-asset-meta .settings-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dock-popover {
  background: transparent;
  backdrop-filter: none;
  padding: 0;
  z-index: 44;
}

.user-dock-profile-card {
  position: fixed;
  left: 14px;
  bottom: 84px;
  width: min(360px, calc(100vw - 20px));
  border-radius: 14px;
  border: 1px solid rgba(138, 166, 255, 0.35);
  background: linear-gradient(180deg, rgba(16, 24, 44, 0.98), rgba(12, 18, 34, 0.98));
  box-shadow: 0 26px 48px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.user-dock-profile-banner-wrap {
  position: relative;
  min-height: 140px;
}

.user-dock-profile-banner {
  min-height: 114px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(95, 240, 203, 0.22), rgba(138, 166, 255, 0.25));
  background-size: cover;
  background-position: center;
}

.user-dock-popover-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(9, 14, 26, 0.7);
}

.user-dock-profile-avatar-wrap {
  position: absolute;
  left: 12px;
  bottom: 0;
}

.user-avatar-xl {
  width: 76px;
  height: 76px;
  border-width: 3px;
}

.user-dock-profile-status-dot {
  position: absolute;
  right: -1px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  border-width: 3px;
}

.user-dock-profile-main {
  margin-top: 6px;
  display: grid;
  gap: 6px;
}

.user-dock-profile-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #edf6ff;
}

.user-dock-profile-display {
  margin: 0;
  color: #eef6ff;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 900;
  font-family: var(--font-heading);
}

.user-dock-profile-username,
.user-dock-profile-member-id,
.user-dock-profile-role {
  margin: 0;
  color: #b6cceb;
  font-size: 13px;
}

.user-dock-profile-role {
  font-weight: 700;
  color: #d7e8ff;
}

.user-dock-profile-bio {
  margin: 0;
  font-size: 13px;
  line-height: 1.34;
  color: #d5e6ff;
}

.user-dock-profile-voice-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.user-dock-profile-voice-label,
.user-dock-profile-voice-name,
.user-dock-profile-voice-meta {
  margin: 0;
}

.user-dock-profile-voice-label {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9cb4d7;
}

.user-dock-profile-voice-name {
  font-size: 15px;
  color: #eef7ff;
  font-weight: 700;
}

.user-dock-profile-voice-meta {
  font-size: 12px;
  color: #adc4e3;
}

.user-dock-profile-actions {
  display: grid;
  gap: 10px;
}

.user-dock-profile-actions .solid-btn {
  justify-self: start;
}

.user-dock-profile-row {
  display: grid;
  gap: 6px;
}

.user-dock-profile-row label {
  font-size: 12px;
  color: #dbe9ff;
  font-weight: 700;
}

.user-dock-profile-row select {
  width: 100%;
  max-width: 100%;
}

body[data-theme='carbon-light'] .user-dock-profile-card {
  border-color: rgba(75, 104, 148, 0.4);
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.99), rgba(235, 244, 255, 0.99));
  box-shadow: 0 20px 44px rgba(48, 76, 118, 0.28);
}

body[data-theme='carbon-light'] .user-dock-profile-title,
body[data-theme='carbon-light'] .user-dock-profile-display {
  color: #1e2f46;
}

body[data-theme='carbon-light'] .user-dock-profile-username,
body[data-theme='carbon-light'] .user-dock-profile-member-id,
body[data-theme='carbon-light'] .user-dock-profile-bio,
body[data-theme='carbon-light'] .user-dock-profile-role,
body[data-theme='carbon-light'] .user-dock-profile-voice-meta {
  color: #435d80;
}

.member-profile-content {
  display: grid;
  gap: 14px;
}

.member-profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.member-profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(148, 177, 231, 0.4);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #e8f4ff;
  overflow: hidden;
}

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

.member-profile-name,
.member-profile-tag {
  margin: 0;
  line-height: 1.24;
}

.member-profile-name {
  font-size: 18px;
  font-family: var(--font-heading);
  color: #ecf6ff;
}

.member-profile-tag {
  font-size: 12px;
  color: #9eb7da;
}

.member-profile-status {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(95, 240, 203, 0.42);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  color: #baf8ea;
  background: rgba(95, 240, 203, 0.1);
}

.member-profile-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-profile-field {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.member-profile-field-full {
  grid-column: 1 / -1;
}

.member-profile-label {
  font-size: 11px;
  color: #96accc;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.member-profile-value {
  font-size: 13px;
  color: #e5f0ff;
  word-break: break-word;
}

.msg-link {
  color: #88d4ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(136, 212, 255, 0.4);
}

.msg-link:hover {
  color: #b3e4ff;
}

.msg-attachments {
  display: grid;
  gap: 8px;
}

.msg-attachment-file {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.msg-attachment-file p {
  margin: 0;
  font-size: 12px;
  color: #d8e9ff;
}

.msg-attachment-file a {
  color: #8cd5ff;
  font-size: 12px;
  text-decoration: none;
}

.msg-attachment-image,
.msg-attachment-video {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.msg-attachment-caption {
  margin: 4px 0 0;
  font-size: 11px;
  color: #a9c0e3;
}

.msg-gif-placeholder {
  width: min(100%, 420px);
  border: 1px dashed rgba(148, 177, 231, 0.4);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #d9ebff;
  text-align: left;
  padding: 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.msg-gif-placeholder:hover {
  border-color: rgba(95, 240, 203, 0.58);
  background: rgba(95, 240, 203, 0.12);
}

.msg-gif-placeholder-title {
  font-size: 13px;
  font-weight: 700;
}

.msg-gif-placeholder-meta {
  font-size: 11px;
  color: #9fc3ec;
}

.custom-emoji-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

.custom-emoji-inline img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.msg-reaction-emoji.custom-emoji {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.msg-reaction-emoji.custom-emoji img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

.members-col {
  grid-area: members;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.members-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.member-section {
  display: grid;
  gap: 8px;
}

.member-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.member-section-title {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #9fc3f8;
}

.member-section-count {
  font-size: 11px;
  color: var(--muted);
}

.member-section-list {
  display: grid;
  gap: 8px;
}

.member-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.member-name,
.member-tag {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-name {
  font-size: 14px;
  color: #e7f1ff;
}

.member-tag {
  font-size: 11px;
  color: var(--muted);
}

.member-item .dot {
  margin-left: auto;
}

.members-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(148, 177, 231, 0.45);
  background: linear-gradient(145deg, rgba(95, 240, 203, 0.2), rgba(138, 166, 255, 0.2));
  color: #d7e8ff;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-heading);
  position: relative;
  transition: box-shadow 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.status-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(11, 18, 33, 0.95);
  background: #8892a9;
  box-shadow: 0 0 0 1px rgba(7, 12, 24, 0.35);
  pointer-events: none;
}

body[data-theme='carbon-light'] .status-badge {
  border-color: rgba(245, 250, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(84, 118, 168, 0.28);
}

.user-avatar-lg .status-badge {
  width: 13px;
  height: 13px;
}

.user-avatar-xl .status-badge {
  width: 16px;
  height: 16px;
}

.status-badge.online {
  background: #3ddc84;
}

.status-badge.idle {
  background: #f6b73c;
}

.status-badge.offline {
  background: #8892a9;
}

.status-badge.dnd {
  background: #f0525f;
}

.status-badge.dnd::before {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: #fff4f5;
}

.user-avatar.speaking {
  border-color: rgba(88, 255, 140, 0.95);
  box-shadow:
    0 0 0 2px rgba(88, 255, 140, 0.65),
    0 0 0 6px rgba(88, 255, 140, 0.22),
    0 0 18px rgba(88, 255, 140, 0.36);
  animation: voice-speaking-pulse 900ms ease-in-out infinite;
}

@keyframes voice-speaking-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

body.reduced-motion .user-avatar.speaking {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .user-avatar.speaking {
    animation: none;
  }
}

.user-avatar-lg {
  width: 38px;
  height: 38px;
}

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

.audit-card {
  border-top: 1px solid var(--line);
  padding: 10px;
}

.audit-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 13px;
}

.audit-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1220px) {
  .app {
    grid-template-columns: 270px minmax(0, 1fr) 280px;
  }

  .app.members-hidden {
    grid-template-columns: 270px minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .app {
    grid-template-areas:
      'servers servers'
      'chat chat';
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .channels-col,
  .members-col {
    display: none;
  }

  .app.members-hidden {
    grid-template-areas:
      'servers'
      'chat';
    grid-template-columns: minmax(0, 1fr);
  }

  .servers-top {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .servers-top-actions {
    justify-content: flex-start;
  }

  .presence-wrap {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .user-dock-profile-card {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: 74px;
  }

  .settings-shell {
    width: 100%;
    height: 100%;
    border-radius: 0;
    grid-template-columns: 1fr;
  }

  .settings-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow: auto;
  }

  .settings-nav h3 {
    display: none;
  }

  .settings-nav-user {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-auto-flow: row;
  }

  .settings-nav-user .settings-nav-scroll {
    display: block;
    overflow: auto;
    padding: 10px 8px 12px;
  }

  .settings-nav-server {
    grid-template-rows: auto minmax(0, 1fr);
    grid-auto-flow: row;
  }

  .settings-server-scroll {
    display: block;
    overflow: auto;
    padding: 10px 8px 12px;
  }

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

  .settings-role-layout,
  .settings-channel-layout {
    grid-template-columns: 1fr;
  }

  .settings-roles-overview,
  .settings-moderation-layout {
    grid-template-columns: 1fr;
  }

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

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

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

.voice-audio-host {
  position: fixed;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
