@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

:root {
  color-scheme: dark;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Sora", "Manrope", sans-serif;
  --bg-1: #07000f;
  --bg-2: #12041f;
  --bg-3: #1d0730;
  --surface-0: rgba(9, 2, 14, 0.96);
  --surface-1: rgba(13, 3, 22, 0.94);
  --surface-2: rgba(23, 7, 37, 0.94);
  --surface-3: rgba(36, 12, 58, 0.95);
  --surface-4: rgba(66, 26, 104, 0.96);
  --line: rgba(210, 103, 246, 0.18);
  --line-strong: rgba(207, 87, 239, 0.58);
  --text: rgba(255, 255, 255, 0.88);
  --text-strong: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --subtle: rgba(224, 184, 255, 0.58);
  --brand: #7a00ff;
  --brand-strong: #cf57ef;
  --brand-cyan: #00d4ff;
  --brand-green: #00ff9d;
  --ok: #3ba55d;
  --warn: #ffd166;
  --danger: #ff003c;
  --overlay: rgba(5, 1, 8, 0.82);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.46);
  --shadow-glow:
    0 0 0 1px rgba(188, 19, 254, 0.28),
    0 0 18px rgba(188, 19, 254, 0.2),
    0 0 40px rgba(207, 87, 239, 0.12);
  --shadow-cyan:
    0 0 0 1px rgba(0, 212, 255, 0.24),
    0 0 18px rgba(0, 212, 255, 0.16);
}

body[data-theme="tactical"] {
  --bg-1: #030916;
  --bg-2: #081321;
  --bg-3: #102235;
  --surface-0: rgba(4, 9, 18, 0.96);
  --surface-1: rgba(7, 14, 25, 0.94);
  --surface-2: rgba(11, 23, 37, 0.95);
  --surface-3: rgba(18, 34, 52, 0.96);
  --surface-4: rgba(36, 74, 110, 0.96);
  --line: rgba(113, 175, 255, 0.16);
  --line-strong: rgba(108, 176, 255, 0.44);
  --text: rgba(236, 244, 255, 0.9);
  --muted: rgba(203, 220, 240, 0.74);
  --subtle: rgba(160, 190, 225, 0.65);
  --brand: #2f78d3;
  --brand-strong: #7dc7ff;
  --brand-cyan: #76f2ff;
  --brand-green: #3ce0ad;
  --shadow-glow:
    0 0 0 1px rgba(115, 188, 255, 0.22),
    0 0 18px rgba(32, 110, 178, 0.18),
    0 0 40px rgba(20, 48, 76, 0.12);
}

body[data-theme="war-room"] {
  --bg-1: #120308;
  --bg-2: #22060b;
  --bg-3: #390d11;
  --surface-0: rgba(20, 5, 8, 0.96);
  --surface-1: rgba(31, 8, 11, 0.94);
  --surface-2: rgba(46, 12, 15, 0.95);
  --surface-3: rgba(67, 18, 18, 0.96);
  --surface-4: rgba(147, 52, 28, 0.95);
  --line: rgba(255, 146, 98, 0.16);
  --line-strong: rgba(255, 142, 85, 0.48);
  --text: rgba(255, 244, 239, 0.92);
  --muted: rgba(240, 214, 208, 0.74);
  --subtle: rgba(224, 171, 160, 0.68);
  --brand: #d44b2e;
  --brand-strong: #ff8b54;
  --brand-cyan: #ffc26d;
  --brand-green: #ffcb6b;
  --shadow-glow:
    0 0 0 1px rgba(255, 142, 85, 0.24),
    0 0 18px rgba(170, 52, 33, 0.22),
    0 0 40px rgba(58, 12, 12, 0.16);
}

body[data-theme="tactical"],
body[data-theme="war-room"] {
  color: var(--text);
}

body[data-theme="tactical"] {
  background:
    radial-gradient(circle at 16% 12%, rgba(64, 143, 255, 0.16), transparent 18%),
    radial-gradient(circle at 86% 14%, rgba(118, 242, 255, 0.1), transparent 18%),
    radial-gradient(circle at 82% 88%, rgba(60, 224, 173, 0.08), transparent 16%),
    linear-gradient(135deg, #06111f 0%, #07131f 42%, #030916 100%);
}

body[data-theme="war-room"] {
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 139, 84, 0.14), transparent 18%),
    radial-gradient(circle at 86% 14%, rgba(255, 194, 109, 0.1), transparent 18%),
    radial-gradient(circle at 82% 88%, rgba(212, 75, 46, 0.08), transparent 16%),
    linear-gradient(135deg, #1c0708 0%, #120308 42%, #080103 100%);
}

body[data-theme="tactical"]::before {
  opacity: 0.16;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(2px 2px at 120px 70px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(2px 2px at 200px 160px, rgba(118, 242, 255, 0.25), transparent),
    radial-gradient(2px 2px at 260px 80px, rgba(255, 255, 255, 0.28), transparent);
}

body[data-theme="war-room"]::before {
  opacity: 0.16;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.42), transparent),
    radial-gradient(2px 2px at 120px 70px, rgba(255, 194, 109, 0.28), transparent),
    radial-gradient(2px 2px at 200px 160px, rgba(255, 107, 69, 0.22), transparent),
    radial-gradient(2px 2px at 260px 80px, rgba(255, 255, 255, 0.24), transparent);
}

body[data-theme="tactical"]::after {
  opacity: 0.18;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(58, 124, 188, 0.04)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 10px
    );
}

body[data-theme="war-room"]::after {
  opacity: 0.18;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(255, 113, 69, 0.04)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 10px
    );
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(circle at 16% 12%, rgba(188, 19, 254, 0.18), transparent 18%),
    radial-gradient(circle at 86% 14%, rgba(0, 212, 255, 0.12), transparent 18%),
    radial-gradient(circle at 82% 88%, rgba(0, 255, 157, 0.08), transparent 16%),
    linear-gradient(135deg, #1a0033 0%, #10001d 38%, #07000f 100%);
  color: var(--text);
  font-family: var(--font-body);
  letter-spacing: 0.01em;
}

body {
  position: relative;
}

button,
input,
textarea,
select {
  font-family: var(--font-body);
}

:is(
    .brand-icon,
    .brand-title,
    .auth-form h2,
    .auth-side h3,
    .server-head h1,
    .chat-head h2,
    .eyebrow,
    .sidebar-section-label,
    .status-badge,
    .theme-switcher-label,
    .profile-name,
    .mobile-nav-panel .overlay-head h3,
    .mobile-nav-panel .overlay-head .eyebrow,
    .mobile-channel-group .eyebrow,
    .mobile-server-name,
    .mobile-channel-name,
    .mobile-profile-strip-copy strong,
    .member-profile-title-row .profile-name,
    .member-profile-presence
  ) {
  font-family: var(--font-display) !important;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  opacity: 0.2;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.58), transparent),
    radial-gradient(2px 2px at 120px 70px, rgba(255, 255, 255, 0.44), transparent),
    radial-gradient(2px 2px at 200px 160px, rgba(255, 255, 255, 0.36), transparent),
    radial-gradient(2px 2px at 260px 80px, rgba(255, 255, 255, 0.5), transparent);
  background-size: 280px 220px;
}

body::after {
  opacity: 0.22;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(207, 87, 239, 0.05)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 10px
    );
}

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

button {
  border: 0;
  cursor: pointer;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(207, 87, 239, 0.16);
  background: rgba(7, 1, 13, 0.86);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(207, 87, 239, 0.68);
  box-shadow:
    0 0 0 3px rgba(122, 0, 255, 0.18),
    0 0 18px rgba(188, 19, 254, 0.18);
}

textarea {
  resize: vertical;
  min-height: 48px;
  max-height: 180px;
}

.hidden {
  display: none !important;
}

.screen {
  height: 100%;
}

.auth-screen {
  position: relative;
  overflow: hidden;
}

.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.brand-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 30px 34px 0;
}

.brand-icon,
.brand-hero {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(207, 87, 239, 0.92), rgba(122, 0, 255, 0.92));
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}

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

.brand-title {
  font-size: 30px;
  font-weight: 800;
  color: white;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(207, 87, 239, 0.42);
}

.brand-subtitle {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.62);
}

.auth-center {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: calc(100% - 92px);
  padding: 28px;
}

.auth-panel {
  width: min(980px, 100%);
  background:
    linear-gradient(180deg, rgba(20, 5, 29, 0.98), rgba(10, 2, 16, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  box-shadow: var(--shadow), var(--shadow-glow);
}

.auth-form {
  padding: 38px 40px;
}

.auth-form h2,
.auth-side h3 {
  margin: 0;
  color: var(--text-strong);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-form p,
.auth-side p,
.helper-text {
  color: var(--muted);
  line-height: 1.45;
}

.auth-side {
  padding: 34px 28px;
  border-left: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(207, 87, 239, 0.12), transparent 42%),
    rgba(7, 2, 13, 0.36);
}

.auth-side-box {
  max-width: 340px;
  display: grid;
  gap: 18px;
}

.auth-banner {
  width: 100%;
  aspect-ratio: 1672 / 941;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-glow);
  object-fit: cover;
  display: block;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stack {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.feedback {
  min-height: 24px;
  margin-top: 14px;
  color: var(--muted);
}

.feedback.error {
  color: #ffb4b5;
}

.feedback.success {
  color: #aef3c1;
}

#serverAccessOverlay .overlay-head .eyebrow,
#serverAccessSubtitle {
  display: none;
}

#serverAccessOverlay .overlay-head h3 {
  margin-top: 0;
}

#serverAccessFeedback:empty {
  display: none;
}

.auth-actions,
.panel-actions,
.footer-actions,
.sidebar-note-actions,
.empty-state-actions,
.invite-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.primary-btn,
.ghost-btn,
.rail-action,
.sidebar-mini-btn,
.attach-btn,
.ghost-icon-btn {
  border-radius: 14px;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.rail-action:hover,
.sidebar-mini-btn:hover,
.attach-btn:hover,
.ghost-icon-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: white;
  font-weight: 800;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-glow);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.primary-btn.danger {
  background: linear-gradient(135deg, #85001e, var(--danger));
}

.ghost-btn,
.sidebar-mini-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 16px;
  border: 1px solid rgba(207, 87, 239, 0.14);
}

.ghost-btn.small,
.sidebar-mini-btn {
  padding: 9px 12px;
  font-size: 13px;
}

.sidebar-note-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sidebar-mini-btn {
  width: 100%;
  min-height: 38px;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.ghost-icon-btn {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(207, 87, 239, 0.16);
}

.chat-screen {
  display: grid;
  grid-template-columns: 82px 252px minmax(0, 1fr);
  min-height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: rgba(7, 2, 13, 0.72);
  backdrop-filter: blur(10px);
}

body[data-theme="tactical"] .chat-screen {
  background: rgba(4, 10, 18, 0.78);
}

body[data-theme="war-room"] .chat-screen {
  background: rgba(18, 4, 6, 0.8);
}

.workspace-rail {
  background:
    radial-gradient(circle at top, rgba(188, 19, 254, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(8, 1, 14, 0.98), rgba(17, 0, 30, 0.94));
  border-right: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px;
  gap: 14px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.rail-top {
  display: grid;
  gap: 10px;
}

.rail-action,
.rail-profile,
.server-avatar-button {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: white;
}

.rail-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(207, 87, 239, 0.18);
  box-shadow: var(--shadow-glow);
}

.rail-action[data-rail-kind="create"] {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(207, 87, 239, 0.22), rgba(122, 0, 255, 0.28));
  color: #ffffff;
  font-size: 22px;
}

.rail-action[data-rail-kind="join"] {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.1), transparent 34%),
    linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(122, 0, 255, 0.24));
  color: #f2fdff;
  font-size: 20px;
}

.workspace-home-button[data-rail-kind="direct"],
.mobile-server-home-button[data-rail-kind="direct"] {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(188, 19, 254, 0.26));
  color: #ffffff;
}

.rail-button-icon {
  width: 22px;
  height: 22px;
  display: block;
  overflow: visible;
  stroke: currentColor;
}

.rail-action .rail-button-icon,
.workspace-home-button .rail-button-icon,
.mobile-server-home-button .rail-button-icon {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.16));
}

.rail-action:hover .rail-button-icon,
.workspace-home-button:hover .rail-button-icon,
.mobile-server-home-button:hover .rail-button-icon {
  transform: scale(1.05);
}

.workspace-servers {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow-y: auto;
  width: 100%;
  padding-right: 0;
}

.rail-divider {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(207, 87, 239, 0.4), transparent);
}

.workspace-home-button {
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.workspace-servers::-webkit-scrollbar,
.mobile-server-list::-webkit-scrollbar,
.mobile-channel-list::-webkit-scrollbar,
.direct-message-section.workspace-mode::-webkit-scrollbar,
.channel-sections::-webkit-scrollbar,
.chat-member-list::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.member-list::-webkit-scrollbar,
.audit-list::-webkit-scrollbar,
.ban-list::-webkit-scrollbar,
.structure-list::-webkit-scrollbar {
  width: 8px;
}

.workspace-servers::-webkit-scrollbar-thumb,
.mobile-server-list::-webkit-scrollbar-thumb,
.mobile-channel-list::-webkit-scrollbar-thumb,
.direct-message-section.workspace-mode::-webkit-scrollbar-thumb,
.channel-sections::-webkit-scrollbar-thumb,
.chat-member-list::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb,
.member-list::-webkit-scrollbar-thumb,
.audit-list::-webkit-scrollbar-thumb,
.ban-list::-webkit-scrollbar-thumb,
.structure-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(122, 0, 255, 0.84), rgba(207, 87, 239, 0.84));
  border-radius: 999px;
}

.server-avatar-button,
.rail-profile {
  border-radius: 0;
  background: rgba(122, 0, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow-glow);
}

.server-avatar-button.active {
  background: linear-gradient(135deg, rgba(207, 87, 239, 0.98), rgba(122, 0, 255, 0.96));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 0 22px rgba(188, 19, 254, 0.32);
}

.server-avatar-button img,
.rail-profile img,
.avatar-chip img,
.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-icon-fit {
  box-sizing: border-box;
}

.server-icon-fit img {
  object-fit: cover;
  padding: 0;
  box-sizing: border-box;
}

.server-icon-frame-layer {
  position: absolute;
  inset: -6px;
  content: "";
  background: center / 100% 100% no-repeat;
  pointer-events: none;
  z-index: 2;
}

.server-icon-framed img {
  position: relative;
  z-index: 1;
  object-fit: cover;
  padding: 0;
  box-sizing: border-box;
}

.server-avatar-button.server-icon-framed .count-pill,
.mobile-server-item.mobile-server-avatar.server-icon-framed .mobile-server-badge {
  z-index: 3;
}

.mobile-server-item.mobile-server-avatar.server-icon-fit img {
  padding: 0;
}

.server-hero-block .server-avatar.server-icon-fit img {
  padding: 0;
}

.channel-sections {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 16px;
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(15, 4, 23, 0.98), rgba(9, 2, 14, 0.98));
  border-right: 1px solid var(--line);
}

.server-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px 10px;
  min-height: 62px;
  border-bottom: 1px solid rgba(207, 87, 239, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    radial-gradient(circle at top right, rgba(207, 87, 239, 0.08), transparent 42%);
}

.server-head > div {
  min-width: 0;
  flex: 1;
}

.theme-switcher {
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(207, 87, 239, 0.12);
  display: grid;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
}

.chat-sidebar .theme-switcher {
  display: none;
}

.theme-switcher-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "Orbitron", sans-serif;
}

.theme-switcher-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.theme-switcher-btn {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(207, 87, 239, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.theme-switcher-btn:hover {
  transform: translateY(-1px);
  color: var(--text-strong);
  border-color: rgba(207, 87, 239, 0.24);
}

.theme-switcher-btn.active {
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(207, 87, 239, 0.88), rgba(122, 0, 255, 0.82));
  box-shadow: var(--shadow-glow);
}

.server-head h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--text-strong);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--subtle);
  font-weight: 700;
  font-family: "Orbitron", sans-serif;
  text-shadow: 0 0 10px rgba(207, 87, 239, 0.28);
}

.direct-message-section {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.direct-message-section.workspace-mode {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 16px;
  margin: 0;
  align-content: start;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "Orbitron", sans-serif;
}

.direct-message-list {
  display: grid;
  gap: 6px;
  align-content: start;
  grid-auto-rows: max-content;
}

.direct-message-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.direct-message-item:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(207, 87, 239, 0.14);
  box-shadow: none;
}

.direct-message-item.active {
  background: rgba(122, 0, 255, 0.14);
  border-color: rgba(122, 0, 255, 0.18);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(207, 87, 239, 0.08);
}

.direct-message-item .avatar-chip {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(207, 87, 239, 0.12);
}

.direct-message-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}

.direct-message-copy strong {
  display: block;
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.05;
}

.direct-message-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.82;
}

.direct-message-item.active .direct-message-copy span {
  color: rgba(255, 255, 255, 0.82);
}

.direct-message-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.direct-message-online {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #52f5b2;
  box-shadow: 0 0 10px rgba(82, 245, 178, 0.66);
}

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

.channel-group-title {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "Orbitron", sans-serif;
}

.channel-item {
  width: 100%;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  color: var(--muted);
  text-align: left;
  margin-bottom: 4px;
}

.channel-item:hover {
  background: rgba(207, 87, 239, 0.08);
  border-color: rgba(207, 87, 239, 0.16);
  color: var(--text-strong);
}

.channel-item.active {
  background: linear-gradient(135deg, rgba(122, 0, 255, 0.28), rgba(207, 87, 239, 0.18));
  border-color: rgba(207, 87, 239, 0.32);
  color: white;
  box-shadow: inset 0 0 24px rgba(188, 19, 254, 0.12);
}

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

.channel-main strong {
  font-size: 13px;
}

.channel-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.count-pill {
  min-width: 20px;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  color: white;
  background: rgba(122, 0, 255, 0.28);
  border: 1px solid rgba(207, 87, 239, 0.24);
}

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

.sidebar-note {
  margin-top: auto;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(207, 87, 239, 0.14);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 10px;
}

.sidebar-note .eyebrow {
  font-size: 10px;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 8%, rgba(0, 212, 255, 0.08), transparent 18%),
    radial-gradient(circle at 88% 84%, rgba(0, 255, 157, 0.06), transparent 18%),
    linear-gradient(180deg, rgba(20, 5, 29, 0.98), rgba(8, 2, 13, 0.99));
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(207, 87, 239, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 12px
    );
}

.chat-head h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.02;
  color: var(--text-strong);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(207, 87, 239, 0.24);
}

.head-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-head-btn {
  display: none;
}

.mobile-nav-trigger {
  display: none;
}

.status-badge {
  display: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(207, 87, 239, 0.16);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge.connected {
  background: rgba(0, 255, 157, 0.1);
  color: #c3ffe6;
  border-color: rgba(0, 255, 157, 0.34);
  box-shadow: var(--shadow-cyan);
}

.status-badge.connecting {
  background: rgba(255, 209, 102, 0.12);
  color: #ffd787;
  border-color: rgba(255, 209, 102, 0.28);
}

.status-badge.error {
  background: rgba(255, 0, 60, 0.14);
  color: #ffb4b5;
  border-color: rgba(255, 0, 60, 0.3);
}

body[data-theme="tactical"] .workspace-rail,
body[data-theme="tactical"] .chat-sidebar,
body[data-theme="tactical"] .chat-main,
body[data-theme="tactical"] .server-head,
body[data-theme="tactical"] .chat-head,
body[data-theme="tactical"] .composer-shell,
body[data-theme="tactical"] .empty-state,
body[data-theme="tactical"] .message-card,
body[data-theme="tactical"] .message-translation,
body[data-theme="tactical"] .reply-bar {
  border-color: rgba(113, 175, 255, 0.14);
}

body[data-theme="war-room"] .workspace-rail,
body[data-theme="war-room"] .chat-sidebar,
body[data-theme="war-room"] .chat-main,
body[data-theme="war-room"] .server-head,
body[data-theme="war-room"] .chat-head,
body[data-theme="war-room"] .composer-shell,
body[data-theme="war-room"] .empty-state,
body[data-theme="war-room"] .message-card,
body[data-theme="war-room"] .message-translation,
body[data-theme="war-room"] .reply-bar {
  border-color: rgba(255, 146, 98, 0.14);
}

body[data-theme="tactical"] .workspace-rail {
  background:
    radial-gradient(circle at top, rgba(88, 150, 255, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(6, 14, 26, 0.98), rgba(8, 17, 31, 0.96));
}

body[data-theme="war-room"] .workspace-rail {
  background:
    radial-gradient(circle at top, rgba(255, 129, 76, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(20, 4, 7, 0.98), rgba(27, 7, 9, 0.96));
}

body[data-theme="tactical"] .chat-sidebar {
  background:
    linear-gradient(180deg, rgba(9, 18, 31, 0.98), rgba(6, 12, 21, 0.98));
}

body[data-theme="war-room"] .chat-sidebar {
  background:
    linear-gradient(180deg, rgba(23, 7, 9, 0.98), rgba(12, 3, 5, 0.98));
}

body[data-theme="tactical"] .chat-main {
  background:
    radial-gradient(circle at 82% 8%, rgba(118, 242, 255, 0.08), transparent 18%),
    radial-gradient(circle at 88% 84%, rgba(83, 170, 255, 0.08), transparent 18%),
    linear-gradient(180deg, rgba(7, 14, 26, 0.99), rgba(5, 10, 18, 0.99));
}

body[data-theme="war-room"] .chat-main {
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 132, 84, 0.09), transparent 18%),
    radial-gradient(circle at 88% 84%, rgba(255, 194, 109, 0.08), transparent 18%),
    linear-gradient(180deg, rgba(18, 4, 6, 0.99), rgba(8, 2, 3, 0.99));
}

body[data-theme="tactical"] .server-head,
body[data-theme="tactical"] .chat-head {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    radial-gradient(circle at top right, rgba(92, 160, 255, 0.08), transparent 42%);
}

body[data-theme="war-room"] .server-head,
body[data-theme="war-room"] .chat-head {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    radial-gradient(circle at top right, rgba(255, 132, 84, 0.08), transparent 42%);
}

body[data-theme="tactical"] .message-card:hover {
  border-color: rgba(113, 175, 255, 0.18);
  background: rgba(15, 30, 51, 0.46);
  box-shadow: inset 0 0 16px rgba(60, 128, 210, 0.05);
}

body[data-theme="war-room"] .message-card:hover {
  border-color: rgba(255, 146, 98, 0.18);
  background: rgba(45, 11, 14, 0.48);
  box-shadow: inset 0 0 16px rgba(170, 52, 33, 0.06);
}

body[data-theme="tactical"] .message-card.mention {
  border-color: rgba(118, 242, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(118, 242, 255, 0.08), rgba(83, 170, 255, 0.06)),
    rgba(10, 18, 31, 0.82);
}

body[data-theme="war-room"] .message-card.mention {
  border-color: rgba(255, 194, 109, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 194, 109, 0.08), rgba(255, 113, 69, 0.06)),
    rgba(28, 8, 10, 0.82);
}

body[data-theme="tactical"] .message-translation {
  background: rgba(118, 242, 255, 0.07);
  border-color: rgba(118, 242, 255, 0.16);
}

body[data-theme="war-room"] .message-translation {
  background: rgba(255, 194, 109, 0.07);
  border-color: rgba(255, 194, 109, 0.16);
}

body[data-theme="tactical"] .reply-bar,
body[data-theme="tactical"] .composer-shell,
body[data-theme="tactical"] .empty-state {
  background: rgba(7, 14, 26, 0.9);
}

body[data-theme="war-room"] .reply-bar,
body[data-theme="war-room"] .composer-shell,
body[data-theme="war-room"] .empty-state {
  background: rgba(20, 6, 8, 0.9);
}

body[data-theme="tactical"] .brand-icon,
body[data-theme="tactical"] .primary-btn,
body[data-theme="tactical"] .rail-action,
body[data-theme="tactical"] .server-avatar-button.active,
body[data-theme="tactical"] .theme-switcher-btn.active {
  background: linear-gradient(135deg, rgba(51, 121, 194, 0.98), rgba(118, 202, 255, 0.96));
  box-shadow:
    0 0 0 1px rgba(115, 188, 255, 0.24),
    0 0 18px rgba(32, 110, 178, 0.2),
    0 0 40px rgba(20, 48, 76, 0.14);
}

body[data-theme="war-room"] .brand-icon,
body[data-theme="war-room"] .primary-btn,
body[data-theme="war-room"] .rail-action,
body[data-theme="war-room"] .server-avatar-button.active,
body[data-theme="war-room"] .theme-switcher-btn.active {
  background: linear-gradient(135deg, rgba(176, 54, 38, 0.98), rgba(255, 139, 84, 0.96));
  box-shadow:
    0 0 0 1px rgba(255, 146, 98, 0.24),
    0 0 18px rgba(170, 52, 33, 0.2),
    0 0 40px rgba(58, 12, 12, 0.14);
}

.filter-bar {
  display: none;
}

.chat-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
}

.chat-center {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-members-sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(207, 87, 239, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    rgba(10, 2, 17, 0.74);
  overflow: hidden;
}

.members-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(207, 87, 239, 0.14);
}

.members-sidebar-head h3 {
  margin: 4px 0 0;
  color: var(--text-strong);
  font-size: 13px;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.members-count {
  min-width: 28px;
  border-radius: 999px;
  padding: 4px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(207, 87, 239, 0.12);
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 800;
  font-family: "Orbitron", sans-serif;
}

.chat-member-list {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 2px;
  align-content: start;
  grid-auto-rows: max-content;
  padding: 8px 8px 12px;
}

.members-empty {
  padding: 6px 2px 0;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.toggle-chip input {
  width: auto;
}

.conversation-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages-tools {
  padding: 8px 20px 0;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 8px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

.empty-state {
  margin: auto;
  width: min(520px, 100%);
  padding: 28px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 10px;
  color: var(--text-strong);
  font-size: 26px;
}

.message-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  overflow: visible;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.message-card:hover {
  border-color: rgba(207, 87, 239, 0.14);
  background: rgba(24, 6, 39, 0.44);
  box-shadow: inset 0 0 16px rgba(188, 19, 254, 0.05);
}

.message-card.mention {
  border-color: rgba(0, 212, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(0, 212, 255, 0.08), rgba(188, 19, 254, 0.06)),
    rgba(14, 3, 23, 0.82);
  box-shadow: inset 0 0 24px rgba(0, 212, 255, 0.08);
}

.avatar-chip,
.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, rgba(207, 87, 239, 0.96), rgba(122, 0, 255, 0.96));
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.member-profile-trigger,
.member-inline-trigger,
.member-preview-trigger,
.chat-member-row {
  cursor: pointer;
}

.profile-avatar,
.server-avatar {
  width: 66px;
  height: 66px;
  border: 0;
  border-radius: 0;
  position: relative;
}

.message-body {
  min-width: 0;
  padding-right: 188px;
}

.message-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.message-head strong {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.05;
}

.member-inline-trigger {
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.05;
  font-weight: 800;
  text-align: left;
}

.member-inline-trigger:hover,
.member-inline-trigger:focus-visible {
  color: #ffdfff;
}

.role-pill,
.time-pill {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
}

.role-pill {
  background: rgba(122, 0, 255, 0.24);
  color: #f1d6ff;
  border: 1px solid rgba(207, 87, 239, 0.18);
}

.time-pill {
  background: rgba(255, 255, 255, 0.04);
  color: var(--subtle);
  border: 1px solid rgba(207, 87, 239, 0.1);
}

.message-reply,
.reply-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(207, 87, 239, 0.06);
  border: 1px solid rgba(207, 87, 239, 0.14);
  margin-top: 8px;
}

.reply-preview-text {
  color: var(--text);
}

.message-text {
  margin-top: 4px;
  line-height: 1.32;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
}

.message-text.deleted {
  color: var(--subtle);
  font-style: italic;
}

.message-translation {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.14);
}

.message-translation-meta {
  color: #8feaff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-translation-text {
  margin-top: 6px;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.attachment-list,
.reaction-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.attachment-chip {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(207, 87, 239, 0.16);
  min-width: 160px;
  max-width: min(320px, 100%);
}

.attachment-chip img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.attachment-chip audio {
  width: 100%;
}

.attachment-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
}

.attachment-caption a {
  color: #8feaff;
  text-decoration: none;
}

.reaction-btn,
.message-action-btn {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 5px 9px;
  font-size: 11px;
  border: 1px solid rgba(207, 87, 239, 0.12);
}

.reaction-btn.active {
  background: rgba(122, 0, 255, 0.24);
  border-color: rgba(207, 87, 239, 0.22);
}

.message-action-btn.is-busy {
  opacity: 0.72;
  cursor: wait;
}

.message-hover-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: auto;
  max-width: calc(100% - 62px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.message-hover-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.message-hover-actions::-webkit-scrollbar {
  display: none;
}

.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 {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.message-reaction-trigger {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(207, 87, 239, 0.14);
  font-size: 16px;
  line-height: 1;
  box-shadow: inset 0 0 14px rgba(188, 19, 254, 0.06);
}

.message-reaction-trigger:hover {
  background: rgba(207, 87, 239, 0.12);
  border-color: rgba(207, 87, 239, 0.26);
}

.message-hover-actions .message-action-btn {
  padding: 6px 10px;
  font-size: 11px;
  white-space: nowrap;
}

.message-reaction-menu {
  position: fixed;
  z-index: 2400;
  min-width: 210px;
  max-width: min(300px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(17, 4, 27, 0.96);
  border: 1px solid rgba(207, 87, 239, 0.2);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.48), inset 0 0 20px rgba(188, 19, 254, 0.06);
  backdrop-filter: blur(18px);
}

.message-reaction-menu.hidden {
  display: none;
}

.message-reaction-menu-title {
  color: #8feaff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.message-reaction-menu-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.message-reaction-menu-btn {
  min-width: 44px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(207, 87, 239, 0.14);
  font-size: 18px;
  line-height: 1;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.message-reaction-menu-btn:hover {
  transform: translateY(-1px);
  background: rgba(207, 87, 239, 0.12);
  border-color: rgba(207, 87, 239, 0.26);
}

.message-reaction-menu-btn.active {
  background: rgba(122, 0, 255, 0.28);
  border-color: rgba(207, 87, 239, 0.3);
  color: #ffffff;
  box-shadow: inset 0 0 16px rgba(188, 19, 254, 0.12);
}

.member-preview-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.member-preview-trigger .member-main {
  min-width: 0;
}

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

.member-role-pill {
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.14);
  color: #baf5ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-member-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.chat-member-row .avatar-chip {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(207, 87, 239, 0.12);
}

.chat-member-row .member-main {
  min-width: 0;
}

.chat-member-row .member-main strong,
.member-preview-trigger .member-main strong {
  display: block;
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.05;
}

.chat-member-row .audit-meta {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.82;
}

.chat-member-row:hover,
.chat-member-row:focus-visible {
  transform: none;
  border-color: rgba(207, 87, 239, 0.14);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.chat-member-row.is-open {
  border-color: rgba(122, 0, 255, 0.18);
  background: rgba(122, 0, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(207, 87, 239, 0.08);
}

.chat-member-row.self {
  background: rgba(255, 255, 255, 0.02);
}

.typing-bar {
  min-height: 24px;
  padding: 2px 20px 0;
  color: var(--muted);
  font-size: 12px;
}

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px;
}

.profile-account-actions {
  justify-content: flex-end;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(207, 87, 239, 0.12);
}

.profile-security-block .feedback {
  margin-top: 0;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(207, 87, 239, 0.1);
}

.draft-attachment {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(207, 87, 239, 0.14);
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.composer-shell {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  margin: 0 20px calc(12px + env(safe-area-inset-bottom, 0px));
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    rgba(10, 2, 16, 0.92);
  border: 1px solid rgba(207, 87, 239, 0.24);
  box-shadow: var(--shadow-glow);
}

.attachment-quick-menu-shell {
  position: relative;
  width: 40px;
}

.attachment-quick-menu-shell[open] .attachment-quick-menu {
  display: grid;
}

.attachment-quick-menu-shell.is-disabled {
  pointer-events: none;
}

.attach-btn {
  width: 40px;
  height: 40px;
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(122, 0, 255, 0.18);
  color: white;
  font-size: 18px;
  border: 1px solid rgba(207, 87, 239, 0.22);
  box-shadow: inset 0 0 18px rgba(188, 19, 254, 0.08);
}

.attach-btn::-webkit-details-marker {
  display: none;
}

.attachment-quick-menu-shell.is-disabled .attach-btn {
  opacity: 0.46;
}

.attachment-quick-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(220px, calc(100vw - 40px));
  display: none;
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(27, 9, 42, 0.98), rgba(9, 2, 16, 0.98));
  border: 1px solid rgba(207, 87, 239, 0.24);
  box-shadow: var(--shadow), var(--shadow-glow);
  backdrop-filter: blur(18px);
  z-index: 6;
}

.attachment-quick-menu-item {
  width: 100%;
  border-radius: 14px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.attachment-quick-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.attachment-quick-menu-icon {
  width: 40px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-strong);
  flex: 0 0 40px;
}

.attachment-quick-menu-icon-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.composer-shell textarea {
  min-height: 22px;
  max-height: 96px;
  padding: 0 12px 0 6px;
  border: 0;
  background: transparent;
  resize: none;
  line-height: 1.25;
  font-size: 14px;
  min-width: 0;
  box-sizing: border-box;
}

.composer-shell .primary-btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.composer-shell textarea:focus {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.chat-footer {
  display: none;
}

#footerInfo {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 20;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.overlay-panel {
  position: relative;
  z-index: 1;
  width: min(660px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(207, 87, 239, 0.12), transparent 26%),
    radial-gradient(circle at bottom left, rgba(0, 212, 255, 0.06), transparent 24%),
    linear-gradient(180deg, rgba(20, 5, 29, 0.99), rgba(8, 2, 13, 0.99));
  border: 1px solid var(--line-strong);
  box-shadow:
    0 22px 80px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 255, 255, 0.03),
    var(--shadow-glow);
  padding: 20px;
}

.overlay-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

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

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

.server-icon-crop-panel {
  width: min(620px, calc(100% - 24px));
  gap: 14px;
}

.overlay-head,
.overlay-footer,
.block-head,
.panel-split,
.profile-card,
.member-row,
.audit-row,
.ban-row,
.structure-card-head,
.structure-channel-row {
  display: flex;
  gap: 12px;
}

.overlay-head,
.block-head {
  justify-content: space-between;
  align-items: start;
}

.overlay-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(207, 87, 239, 0.14);
}

.overlay-head h3,
.block-head h4 {
  margin: 4px 0 0;
  color: var(--text-strong);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overlay-head h3 {
  font-size: 17px;
}

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

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

.overlay-footer {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(207, 87, 239, 0.14);
  justify-content: space-between;
  align-items: center;
}

.overlay-footer.split {
  align-items: start;
}

.server-icon-crop-stage {
  display: grid;
  place-items: center;
  padding: 6px 0 2px;
}

.server-icon-crop-viewport {
  position: relative;
  width: min(440px, 100%);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(207, 87, 239, 0.18);
  background:
    radial-gradient(circle at top right, rgba(207, 87, 239, 0.18), transparent 26%),
    radial-gradient(circle at bottom left, rgba(0, 212, 255, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(14, 4, 24, 0.98), rgba(7, 2, 13, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 0 36px rgba(0, 0, 0, 0.24);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.server-icon-crop-viewport:active {
  cursor: grabbing;
}

.server-icon-crop-viewport img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
  pointer-events: none;
  user-select: none;
  will-change: transform, width, height;
  transform-origin: center center;
}

.server-icon-crop-mask {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 0 0 999px rgba(7, 2, 13, 0.1),
    inset 0 0 24px rgba(188, 19, 254, 0.08);
  pointer-events: none;
}

.server-icon-crop-controls {
  display: grid;
  gap: 8px;
}

.server-icon-crop-zoom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--subtle);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.server-icon-crop-zoom-row span {
  color: var(--text-strong);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.server-icon-crop-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.server-icon-crop-footer {
  align-items: center;
}

.panel-split {
  gap: 18px;
  align-items: start;
}

.panel-column {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 18px;
}

.panel-block {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(13, 3, 22, 0.9);
  border: 1px solid rgba(207, 87, 239, 0.16);
  padding: 20px;
  box-shadow:
    inset 0 0 18px rgba(188, 19, 254, 0.04),
    0 10px 32px rgba(0, 0, 0, 0.14);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.panel-block:hover {
  transform: translateY(-1px);
  border-color: rgba(207, 87, 239, 0.24);
  box-shadow:
    inset 0 0 22px rgba(188, 19, 254, 0.06),
    0 14px 38px rgba(0, 0, 0, 0.18);
}

.guild-panel {
  display: grid;
  gap: 18px;
}

.action-panel {
  display: grid;
  gap: 14px;
}

.action-dialog-body {
  margin-top: 0;
}

.action-dialog-copy {
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(207, 87, 239, 0.16);
  color: var(--text);
  line-height: 1.5;
}

.action-dialog-copy strong {
  color: var(--text-strong);
}

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

.field-note {
  color: var(--subtle);
  font-size: 12px;
  margin-top: 8px;
}

.quick-emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-emoji-btn {
  min-width: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px 12px;
  border: 1px solid rgba(207, 87, 239, 0.16);
}

.context-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(280px, calc(100vw - 20px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(21, 5, 31, 0.99), rgba(8, 2, 13, 0.99));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow), var(--shadow-glow);
  backdrop-filter: blur(16px);
  z-index: 90;
}

.context-menu[data-variant="attachment"] {
  width: min(248px, calc(100vw - 24px));
  gap: 6px;
}

.context-menu-title {
  padding: 2px 6px 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
}

.context-menu-items {
  display: grid;
  gap: 4px;
}

.context-menu-item {
  width: 100%;
  border-radius: 12px;
  padding: 11px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.14s ease, color 0.14s ease;
}

.context-menu-item-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.context-menu-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex: 0 0 28px;
}

.context-menu-item:hover {
  background: rgba(122, 0, 255, 0.18);
  color: var(--text-strong);
}

.context-menu-item.danger {
  color: #ffb3b5;
}

.context-menu-item.danger:hover {
  background: rgba(255, 0, 60, 0.18);
  color: #ffd2d3;
}

.context-menu-item.disabled {
  opacity: 0.42;
  cursor: default;
  pointer-events: none;
}

.context-menu-item-hint {
  font-size: 12px;
  color: var(--subtle);
}

.context-menu-divider {
  height: 1px;
  margin: 4px 2px;
  background: rgba(207, 87, 239, 0.18);
}

.server-avatar-button.context-active,
.rail-profile.context-active,
.attach-btn.context-active,
.channel-item.context-active,
.server-head.context-active {
  background: rgba(122, 0, 255, 0.28);
  color: var(--text-strong);
}

.message-card.context-active {
  border-color: rgba(207, 87, 239, 0.34);
  background: rgba(122, 0, 255, 0.12);
}

.server-panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-tab-btn {
  border-radius: 999px;
  padding: 9px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  border: 1px solid rgba(207, 87, 239, 0.16);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.server-tab-btn:hover {
  transform: translateY(-1px);
  color: var(--text-strong);
  border-color: rgba(207, 87, 239, 0.28);
}

.server-tab-btn.active {
  background: linear-gradient(135deg, rgba(122, 0, 255, 0.34), rgba(207, 87, 239, 0.2));
  border-color: rgba(207, 87, 239, 0.34);
  color: var(--text-strong);
  box-shadow: 0 0 24px rgba(188, 19, 254, 0.16);
}

.server-panel-pages {
  display: grid;
  gap: 12px;
}

.server-panel-page {
  display: grid;
  gap: 12px;
}

.hero-block {
  gap: 12px;
}

.profile-card-wide {
  justify-content: space-between;
}

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

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

.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 12px;
  min-height: 84px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(207, 87, 239, 0.16);
  box-shadow: inset 0 0 16px rgba(188, 19, 254, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(207, 87, 239, 0.9), rgba(0, 212, 255, 0.7));
  opacity: 0.9;
}

.stat-card:hover {
  transform: translateY(-1px);
  border-color: rgba(207, 87, 239, 0.26);
  box-shadow:
    inset 0 0 20px rgba(188, 19, 254, 0.06),
    0 14px 34px rgba(0, 0, 0, 0.16);
}

.stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

.stat-value {
  margin-top: 10px;
  color: var(--text-strong);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.compact-stack {
  margin-top: 14px;
}

.helper-text.compact {
  margin-top: 0;
}

.server-hero-block .profile-name {
  font-size: 20px;
}

.overview-card {
  min-height: 0;
}

.overview-card .panel-actions,
.profile-security-block .panel-actions {
  margin-top: 4px;
}

.server-overview-grid .overview-card {
  min-height: 0;
}

.server-overview-grid .panel-column {
  gap: 12px;
}

.server-hero-block {
  padding: 16px 18px 18px;
}

.server-hero-summary {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.server-hero-block .profile-main {
  display: grid;
  gap: 4px;
}

.server-hero-block .profile-note {
  margin-top: 0;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.server-hero-block .server-avatar {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  overflow: hidden;
}

.server-hero-block .meta-chip-row {
  margin-top: 10px;
  gap: 8px;
}

.server-hero-block .meta-chip {
  padding: 7px 10px;
  font-size: 11px;
}

.server-overview-grid,
.server-members-grid,
.mobile-nav-layout {
  align-items: start;
}

.mobile-nav-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(26, 28, 35, 0.98), rgba(18, 20, 27, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 18px 0 52px rgba(0, 0, 0, 0.44);
}

.mobile-nav-panel::before {
  inset: 8px;
  border-radius: 22px;
  border-color: rgba(255, 255, 255, 0.03);
}

.mobile-nav-layout {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(17, 19, 24, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.mobile-nav-panel .overlay-head {
  padding-bottom: 10px;
  align-items: center;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.mobile-nav-panel .overlay-head .eyebrow {
  display: none;
}

.mobile-nav-panel .overlay-head h3 {
  margin-top: 0;
  font-size: 18px;
  color: var(--text-strong);
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
}

.mobile-nav-panel .ghost-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.07);
}

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

.mobile-nav-rail-block:hover,
.mobile-nav-content-block:hover {
  transform: none;
  box-shadow: none;
}

.mobile-nav-rail-block {
  border-radius: 16px 0 0 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 8px;
  background: linear-gradient(180deg, rgba(12, 14, 19, 0.98), rgba(14, 16, 22, 0.98));
}

.mobile-nav-content-block {
  border-radius: 0 16px 16px 0;
  padding: 12px 10px 12px 12px;
  background:
    linear-gradient(180deg, rgba(26, 29, 36, 0.98), rgba(22, 24, 31, 0.98)),
    rgba(24, 27, 34, 0.96);
}

.mobile-nav-rail-block .block-head,
.mobile-nav-content-block .block-head {
  display: none;
}

.mobile-server-list,
.mobile-channel-list {
  margin-top: 0;
  min-height: 0;
}

.mobile-server-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow-y: auto;
}

.mobile-channel-list {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.mobile-server-item,
.mobile-channel-item {
  width: 100%;
  text-align: left;
  position: relative;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  transition:
    border-color 0.16s ease,
    background 0.16s ease;
}

.mobile-server-item:hover,
.mobile-channel-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.mobile-channel-item.active {
  background: rgba(88, 101, 242, 0.18);
  border-color: rgba(88, 101, 242, 0.36);
}

.mobile-server-item.mobile-server-avatar {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: white;
  font-size: 12px;
  font-weight: 800;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.08em;
  overflow: visible;
  background: rgba(43, 48, 60, 0.95);
  box-shadow: none;
}

.mobile-server-item.mobile-server-avatar::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: transparent;
  transform: translateY(-50%);
  transition: height 0.16s ease, background 0.16s ease;
}

.mobile-server-item.mobile-server-avatar.active {
  background: linear-gradient(135deg, rgba(97, 109, 255, 0.96), rgba(122, 0, 255, 0.84));
  border-color: rgba(255, 255, 255, 0.12);
}

.mobile-server-item.mobile-server-avatar.active::after {
  height: 26px;
  background: rgba(255, 255, 255, 0.92);
}

.mobile-server-home-button {
  background: linear-gradient(135deg, rgba(71, 108, 255, 0.98), rgba(122, 0, 255, 0.92));
  color: white;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.mobile-server-item.mobile-server-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.mobile-server-badge {
  position: absolute;
  right: -6px;
  bottom: -4px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 800;
  border: 2px solid rgba(9, 2, 14, 0.94);
  box-shadow: 0 0 18px rgba(255, 77, 98, 0.28);
}

.mobile-server-list-empty {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-channel-toolbar {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-channel-toolbar .eyebrow {
  color: rgba(194, 199, 208, 0.68);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.mobile-channel-toolbar-main {
  display: grid;
  gap: 3px;
}

.mobile-channel-toolbar-main strong {
  color: var(--text-strong);
  font-size: 15px;
  font-family: inherit;
  letter-spacing: 0.01em;
  text-transform: none;
}

.mobile-channel-toolbar-main span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-server-name,
.mobile-channel-name {
  display: block;
  color: var(--text-strong);
  font-weight: 800;
}

.mobile-server-meta,
.mobile-channel-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-channel-group {
  display: grid;
  gap: 10px;
}

.mobile-channel-group-title {
  padding: 6px 8px 0;
  color: rgba(194, 199, 208, 0.68);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mobile-thread-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.mobile-thread-card .avatar-chip {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 13px;
}

.mobile-thread-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mobile-thread-copy strong,
.mobile-channel-name {
  color: var(--text-strong);
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-thread-copy span {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-thread-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.mobile-channel-row {
  padding-top: 9px;
  padding-bottom: 9px;
}

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

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

.mobile-channel-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mobile-channel-selected-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.28);
}

.mobile-channel-hash {
  color: var(--subtle);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
}

.mobile-nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-nav-actions .primary-btn,
.mobile-nav-actions .ghost-btn {
  min-height: 38px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  box-shadow: none;
}

.mobile-nav-actions .ghost-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  font-size: 0;
}

#mobileCreateServerBtn::before,
#mobileJoinServerBtn::before,
#mobileManageServerBtn::before {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

#mobileCreateServerBtn::before {
  content: "+";
}

#mobileJoinServerBtn::before {
  content: "↗";
}

#mobileManageServerBtn::before {
  content: "⋯";
}

#mobileProfileBtn {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  text-align: left;
  min-height: 50px;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    rgba(255, 255, 255, 0.04);
  color: var(--text-strong);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.mobile-profile-strip-avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  overflow: hidden;
}

.mobile-profile-strip-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mobile-profile-strip-copy strong {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-profile-strip-copy span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-profile-strip-arrow {
  color: rgba(194, 199, 208, 0.68);
  font-size: 16px;
  line-height: 1;
}

.profile-card {
  align-items: center;
  margin-top: 14px;
}

.profile-preferences-block {
  background:
    radial-gradient(circle at top right, rgba(0, 212, 255, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(207, 87, 239, 0.1), rgba(122, 0, 255, 0.06)),
    rgba(13, 3, 22, 0.9);
}

.profile-panel {
  display: grid;
  gap: 18px;
}

.profile-hero-block {
  background:
    radial-gradient(circle at top right, rgba(0, 212, 255, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(207, 87, 239, 0.12), rgba(122, 0, 255, 0.06)),
    rgba(13, 3, 22, 0.92);
}

.profile-card-large,
.server-hero-summary {
  align-items: center;
  gap: 14px;
  margin-top: 0;
}

.profile-card-large .profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 22px;
}

.server-hero-block .server-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
}

.server-hero-block .server-avatar.server-icon-framed {
  border-radius: 16px;
}

.profile-panel-grid {
  align-items: stretch;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 2px 0 6px;
}

.profile-tab-btn {
  border-radius: 999px;
  padding: 10px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(207, 87, 239, 0.16);
  transition:
    transform 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.profile-tab-btn:hover {
  transform: translateY(-1px);
  color: var(--text-strong);
  border-color: rgba(207, 87, 239, 0.28);
}

.profile-tab-btn.active {
  color: var(--text-strong);
  border-color: rgba(207, 87, 239, 0.34);
  background: linear-gradient(135deg, rgba(122, 0, 255, 0.34), rgba(207, 87, 239, 0.2));
  box-shadow: 0 0 24px rgba(188, 19, 254, 0.16);
}

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

.profile-page-card {
  position: relative;
  overflow: hidden;
}

.profile-page-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(207, 87, 239, 0.92), rgba(0, 212, 255, 0.72));
  opacity: 0.9;
}

.profile-page-note {
  color: var(--muted);
  line-height: 1.55;
  max-width: 720px;
  margin-top: 6px;
}

.profile-preferences-block {
  display: grid;
  gap: 14px;
}

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

.profile-form-block .stack {
  margin-top: 14px;
}

.profile-security-block {
  display: grid;
  align-content: start;
  gap: 16px;
}

.profile-security-meta-card {
  align-content: start;
}

.profile-security-hero {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.profile-security-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.profile-security-hero-head h4 {
  margin-top: 2px;
  color: var(--text-strong);
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.security-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.security-lead {
  max-width: 760px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(207, 87, 239, 0.14);
  background:
    linear-gradient(135deg, rgba(122, 0, 255, 0.14), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  color: rgba(236, 230, 244, 0.92);
}

.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.security-stack {
  display: grid;
  gap: 16px;
}

.security-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 100%;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(207, 87, 239, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    radial-gradient(circle at top right, rgba(0, 212, 255, 0.06), transparent 45%),
    rgba(7, 1, 13, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 44px rgba(0, 0, 0, 0.2);
}

.security-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, rgba(207, 87, 239, 0.94), rgba(0, 212, 255, 0.72));
  opacity: 0.92;
}

.security-card-head {
  display: grid;
  gap: 4px;
}

.security-card-head h5 {
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.1;
}

.security-card-copy {
  color: var(--muted);
  line-height: 1.55;
  max-width: 620px;
}

.security-password-grid {
  margin-top: 4px;
}

.security-password-grid label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(194, 184, 205, 0.88);
}

.security-password-grid input {
  margin-top: 8px;
}

.security-card-session {
  min-height: 0;
}

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

.security-status-copy {
  margin-top: 2px;
  max-width: 100%;
}

.security-card-status .feedback {
  margin-top: 2px;
  min-height: 76px;
}

.profile-media-actions {
  margin-top: 2px;
}

.meta-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.meta-chip {
  border-radius: 999px;
  padding: 8px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(207, 87, 239, 0.18);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-name {
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 800;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.profile-note {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 720px;
}

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

.profile-language-grid {
  align-items: start;
}

.profile-toggle-card {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(207, 87, 239, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(7, 1, 13, 0.82);
  cursor: pointer;
}

.profile-toggle-card strong {
  display: block;
  color: var(--text-strong);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.profile-toggle-copy {
  display: grid;
  gap: 4px;
}

.profile-toggle-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.profile-toggle-switch {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 30px;
}

.profile-toggle-switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.profile-toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(207, 87, 239, 0.18);
  background: rgba(255, 255, 255, 0.05);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.profile-toggle-slider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, rgba(207, 87, 239, 0.98), rgba(122, 0, 255, 0.92));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s ease;
}

.profile-toggle-switch input:checked + .profile-toggle-slider {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.12);
}

.profile-toggle-switch input:checked + .profile-toggle-slider::before {
  transform: translate(24px, -50%);
  background: linear-gradient(135deg, rgba(84, 230, 255, 0.98), rgba(0, 212, 255, 0.9));
}

.profile-panel .overlay-footer {
  justify-content: flex-start;
}

.profile-panel .overlay-footer .primary-btn {
  min-width: 240px;
}

.member-profile-panel {
  display: grid;
  gap: 16px;
}

.member-profile-panel .overlay-head {
  align-items: center;
}

.member-profile-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  background:
    radial-gradient(circle at top right, rgba(0, 212, 255, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(207, 87, 239, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(207, 87, 239, 0.14), rgba(122, 0, 255, 0.08)),
    rgba(13, 3, 22, 0.92);
}

.member-profile-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(207, 87, 239, 0.92), rgba(0, 212, 255, 0.72));
  opacity: 0.9;
}

.member-profile-hero .profile-card-large {
  align-items: flex-start;
  gap: 18px;
}

.member-profile-hero .profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(207, 87, 239, 0.2),
    0 10px 28px rgba(0, 0, 0, 0.28),
    var(--shadow-glow);
}

.member-profile-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.member-profile-presence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(207, 87, 239, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-strong);
}

.member-profile-presence::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #52f5b2;
  box-shadow: 0 0 10px rgba(82, 245, 178, 0.58);
}

.member-profile-presence.is-muted {
  border-color: rgba(255, 209, 102, 0.2);
  background: rgba(255, 209, 102, 0.08);
  color: #ffe3a1;
}

.member-profile-presence.is-muted::before {
  background: #ffd166;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.56);
}

.member-profile-context {
  margin-top: 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.member-profile-note {
  margin-top: 10px;
  max-width: 460px;
  line-height: 1.45;
}

.member-profile-meta-wrap {
  padding-top: 2px;
  border-top: 1px solid rgba(207, 87, 239, 0.1);
}

.member-profile-meta-wrap .meta-chip-row {
  margin-top: 0;
}

.member-profile-details {
  padding-top: 18px;
  display: grid;
  gap: 14px;
}

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

.member-profile-field {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  min-height: 112px;
  padding: 16px 18px 18px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.04), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(207, 87, 239, 0.14);
  box-shadow: inset 0 0 18px rgba(188, 19, 254, 0.05);
}

.member-profile-field::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(207, 87, 239, 0.76), rgba(0, 212, 255, 0.4));
  opacity: 0.85;
}

.member-profile-field .eyebrow {
  display: block;
}

.member-profile-field strong {
  display: block;
  margin-top: 12px;
  color: var(--text-strong);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.member-profile-footer {
  justify-content: space-between;
  gap: 12px;
}

.member-profile-footer .ghost-btn,
.member-profile-footer .primary-btn {
  min-width: 168px;
}

.profile-panel input,
.profile-panel textarea,
.profile-panel select,
.member-profile-panel input,
.member-profile-panel textarea,
.member-profile-panel select,
.guild-panel input,
.guild-panel textarea,
.guild-panel select {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    rgba(7, 1, 13, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.invite-pill {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(122, 0, 255, 0.26), rgba(207, 87, 239, 0.14)),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(207, 87, 239, 0.22);
  color: var(--text-strong);
  font-weight: 800;
  display: flex;
  align-items: center;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 18px rgba(188, 19, 254, 0.08);
}

.invite-overview-card .stack {
  margin-top: 12px;
}

.structure-list,
.member-list,
.audit-list,
.ban-list {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.structure-card,
.member-row,
.audit-row,
.ban-row {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(207, 87, 239, 0.14);
  padding: 12px;
}

.structure-card {
  display: grid;
  gap: 12px;
}

.structure-card[draggable="true"],
.structure-channel-row[draggable="true"] {
  cursor: grab;
}

.structure-card.dragging,
.structure-channel-row.dragging {
  opacity: 0.4;
}

.structure-card.drop-target,
.structure-channel-row.drop-target {
  outline: 1px dashed rgba(207, 87, 239, 0.88);
}

.structure-card-head,
.structure-channel-row {
  align-items: center;
  justify-content: space-between;
}

.structure-card-title,
.structure-channel-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

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

.member-row,
.ban-row,
.audit-row {
  align-items: center;
}

.member-row {
  justify-content: space-between;
  gap: 14px;
}

.member-main,
.ban-main,
.audit-main {
  flex: 1;
  min-width: 0;
}

.member-main strong,
.ban-main strong,
.audit-main strong {
  display: block;
  color: var(--text-strong);
}

.member-actions,
.ban-actions,
.structure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.member-actions select {
  width: auto;
  min-width: 120px;
}

.member-preview-trigger:hover .member-main strong,
.member-preview-trigger:focus-visible .member-main strong {
  color: #ffdfff;
}

.audit-row {
  align-items: start;
}

.audit-meta,
.ban-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .chat-screen {
    grid-template-columns: 72px 246px minmax(0, 1fr);
  }

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

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

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

@media (max-width: 920px) {
  .auth-panel,
  .panel-split {
    grid-template-columns: 1fr;
    display: grid;
  }

  .auth-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .chat-screen {
    grid-template-columns: minmax(0, 1fr);
    height: 100dvh;
  }

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

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

  .chat-members-sidebar {
    display: none;
  }

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

  .chat-head,
  .messages-tools,
  .messages,
  .typing-bar,
  .attachment-tray,
  .chat-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .composer-shell {
    margin: 0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
  }

  .filter-bar {
    display: none !important;
  }

  .mobile-head-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
  }

  .mobile-nav-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-strong);
    font-size: 18px;
    font-weight: 800;
  }

  .chat-head > div:first-child {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .head-status {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .head-status::-webkit-scrollbar {
    display: none;
  }

  .head-status .mobile-head-btn {
    flex: 0 0 auto;
  }

  .chat-main {
    position: relative;
    min-height: 0;
  }

  .composer-shell {
    position: sticky;
    bottom: 0;
    z-index: 3;
    grid-template-columns: 38px minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: center;
    background:
      linear-gradient(180deg, rgba(18, 20, 27, 0.96), rgba(16, 18, 24, 0.98));
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.22);
  }

  .composer-shell .primary-btn {
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
    font-size: 0;
    letter-spacing: 0;
  }

  .composer-shell .primary-btn::before {
    content: ">";
    font-size: 18px;
    font-weight: 800;
  }

  .attach-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }

  .composer-shell textarea {
    min-height: 38px;
    max-height: 110px;
    padding: 9px 12px 9px 10px;
    font-size: 15px;
    line-height: 1.35;
  }

  .overlay-panel,
  .overlay-panel.wide,
  .overlay-panel.compact {
    width: min(100%, calc(100% - 16px));
    max-height: calc(100% - 16px);
    border-radius: 24px;
    padding: 18px;
  }

  #mobileNavOverlay {
    place-items: stretch;
    justify-items: start;
  }

  #mobileNavOverlay .overlay-backdrop {
    background: rgba(4, 1, 8, 0.76);
    backdrop-filter: blur(6px);
  }

  .mobile-nav-panel {
    width: min(94vw, 430px);
    max-height: 100dvh;
    height: 100dvh;
    margin: 0 auto 0 0;
    border-radius: 0 28px 28px 0;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow:
      18px 0 56px rgba(0, 0, 0, 0.44),
      0 0 0 1px rgba(255, 255, 255, 0.03),
      var(--shadow-glow);
    overscroll-behavior: contain;
  }

  .mobile-nav-panel::before {
    inset: 8px 8px 8px 0;
    border-radius: 0 22px 22px 0;
  }

  .mobile-nav-layout {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .mobile-nav-rail-block {
    padding: 14px 10px;
  }

  .mobile-nav-content-block {
    padding: 14px;
  }

  .profile-card-large,
  .server-hero-summary {
    align-items: flex-start;
  }

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

  .security-badges {
    justify-content: flex-start;
  }

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

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

  .auth-center {
    padding: 18px;
  }

  .auth-form,
  .auth-side {
    padding: 28px 22px;
  }

  .chat-screen {
    grid-template-columns: 1fr;
    height: 100dvh;
  }

  .chat-head h2 {
    font-size: 23px;
    line-height: 1.05;
  }

  .messages {
    gap: 8px;
  }

  .message-card {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 10px;
    border-radius: 14px;
  }

  .message-body {
    padding-right: 140px;
  }

  .message-hover-tools {
    top: 10px;
    right: 10px;
    width: auto;
    max-width: calc(100% - 48px);
    gap: 6px;
  }

  .message-reaction-trigger {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .composer-shell {
    grid-template-columns: 38px minmax(0, 1fr) 44px;
  }

  .chat-footer,
  .overlay-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .head-status .ghost-btn.small,
  .head-status .status-badge {
    font-size: 12px;
  }

  .message-action-btn,
  .reaction-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .message-hover-actions .message-action-btn {
    padding: 5px 8px;
    font-size: 10px;
  }

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

  .message-reaction-menu-btn {
    min-width: 40px;
    height: 36px;
    font-size: 16px;
  }

  .profile-security-hero,
  .security-card {
    padding: 18px;
    border-radius: 18px;
  }

  .profile-security-hero-head h4 {
    font-size: 20px;
  }

  .security-card-head h5 {
    font-size: 17px;
  }

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

  .security-badges .meta-chip {
    padding: 7px 10px;
    font-size: 11px;
  }

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

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

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

  .mobile-nav-panel {
    width: min(100vw, 410px);
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 0 24px 24px 0;
  }

  .mobile-nav-panel::before {
    border-radius: 0 18px 18px 0;
  }

  .mobile-nav-layout {
    grid-template-columns: 1fr;
    gap: 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

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

  .mobile-nav-rail-block {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 0 10px;
  }

  .mobile-nav-content-block {
    padding: 0;
  }

  .mobile-server-list {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 4px;
  }

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

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

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

  .mobile-channel-list {
    padding-right: 0;
  }

  .mobile-nav-actions {
    gap: 8px;
  }

  #mobileProfileBtn {
    grid-column: 1 / -1;
  }

  .profile-card-large {
    flex-direction: column;
    align-items: flex-start;
  }

  .member-profile-title-row {
    align-items: flex-start;
    gap: 10px;
  }

  .profile-card-large .profile-avatar,
  .server-hero-block .server-avatar {
    width: 60px;
    height: 60px;
  }

  .server-hero-block {
    padding: 14px 14px 16px;
  }

  .server-hero-summary {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 10px;
  }

  .server-hero-block .profile-name {
    font-size: 18px;
  }

  .server-hero-block .profile-note {
    font-size: 13px;
  }

  .server-panel-tabs {
    gap: 6px;
  }

  .server-tab-btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .meta-chip-row {
    gap: 8px;
  }

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

  .member-profile-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .member-profile-footer .ghost-btn,
  .member-profile-footer .primary-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (pointer: coarse) {
  .message-hover-tools {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
