﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-app: #09090a;
  --bg-panel: #121214;
  --bg-panel-alt: #121315;
  --bg-panel-soft: #18191c;
  --bg-hover: rgba(255, 255, 255, 0.08);
  --bg-active: rgba(193, 183, 166, 0.12);
  --surface-1: #101113;
  --surface-2: #151618;
  --surface-3: #1d1f22;
  --surface-elevated: #0c0d0f;

  --text-primary: #f2eee8;
  --text-secondary: #cbc4bc;
  --text-muted: #a29b92;
  --text-subtle: #77726b;

  --brand: #6d655a;
  --brand-strong: #514c45;
  --brand-soft: rgba(178, 168, 153, 0.14);
  --success: #5a826b;
  --warning: #a7814b;
  --danger: #8f5d5d;

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 28px 60px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.24);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --titlebar-height: 44px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body,
#root {
  height: 100%;
}

body {
  overflow: hidden;
  font-family: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(178, 168, 153, 0.06), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.03), transparent 24%),
    var(--bg-app);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

.app-icon {
  display: block;
  flex-shrink: 0;
}

.app-icon-sm {
  font-size: 14px;
}

.app-icon-md {
  font-size: 16px;
}

.app-icon-lg {
  font-size: 18px;
}

.app-icon-xl {
  font-size: 20px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  outline: none;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

input::placeholder {
  color: var(--text-subtle);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.titlebar {
  height: var(--titlebar-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 10px 0 14px;
  background: rgba(10, 12, 18, 0.82);
  
  backdrop-filter: blur(14px);
  -webkit-app-region: drag;
}

.titlebar-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.titlebar-status.success {
  color: #b9f5dd;
  background: rgba(53, 193, 135, 0.16);
}

.titlebar-status.warning {
  color: #ffe0a6;
  background: rgba(241, 185, 92, 0.16);
}

.titlebar-status .status-dot {
  width: 8px;
  height: 8px;
  border: 0;
  background: currentColor;
}

.titlebar-controls {
  display: flex;
  margin-left: auto;
  gap: 4px;
  -webkit-app-region: no-drag;
}

.titlebar-btn {
  width: 40px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: background 0.18s ease, color 0.18s ease;
}

.titlebar-control-icon {
  width: 24px;
  height: 24px;
}

.titlebar-btn:hover {
  background: rgba(255, 255, 255, 0.065);
  color: var(--text-primary);
}

.titlebar-btn.close:hover {
  background: rgba(239, 107, 115, 0.18);
  color: white;
}

.main-layout {
  flex: 1;
  min-height: 0;
  display: flex;
}

.sidebar-region {
  width: 372px;
  display: flex;
  flex-direction: column;
  background: rgba(15, 19, 28, 0.86);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: visible;
}

.sidebars-container {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  z-index: 1;
}

.server-sidebar {
  width: 76px;
  padding: 16px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(10, 13, 20, 0.82);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  overflow-y: auto;
}

.server-icon {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
  transition: transform 0.18s ease, border-radius 0.18s ease, background 0.18s ease;
}

.server-icon:hover {
  transform: translateY(-1px);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.server-icon.active {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
}

.server-icon.active::before {
  content: '';
  position: absolute;
  left: -12px;
  width: 4px;
  height: 32px;
  border-radius: 999px;
  background: white;
}

.server-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.server-add {
  color: #ABACB2;
}

.server-add-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.server-home-icon {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
}

.server-separator {
  width: 36px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.server-mini-action {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.server-mini-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.channel-sidebar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: rgba(18, 22, 31, 0.72);
}

.channel-sidebar-empty {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.channel-sidebar-empty .empty-panel {
  width: 100%;
  max-width: 440px;
}

.channel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 12px;
}

.channel-header-toggle {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.18s ease;
}

.channel-header-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.channel-header-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.header-action-inline {
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
}

.server-summary-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px 14px;
}

.summary-pill {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.summary-pill span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.summary-pill strong {
  font-size: 14px;
}

.channel-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 16px;
}

.channel-list-empty {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 8px 4px;
  text-align: left;
}

.channel-list-empty .empty-actions {
  justify-content: flex-start;
}

.channel-category {
  margin-top: 14px;
}

.channel-category:first-child {
  margin-top: 0;
}

.channel-category-header {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text-secondary);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.channel-item:hover,
.channel-item:focus-visible {
  background: var(--bg-hover);
  color: var(--text-primary);
  outline: none;
}

.channel-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--brand-border);
}

.channel-item-icon-image {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.channel-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.channel-item-duration {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #5CAE76;
  font-variant-numeric: tabular-nums;
}

.voice-participants-inline {
  margin-left: 14px;
  padding-left: 10px;
}

.voice-participant-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}

.voice-participant-inline.adjustable,
.member-sidebar-item.adjustable,
.voice-tile-mini.adjustable {
  cursor: context-menu;
}

.voice-participant-inline:hover {
  background: rgba(255, 255, 255, 0.04);
}

.voice-participant-avatar,
.user-avatar,
.message-avatar,
.member-avatar {
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.voice-participant-avatar {
  width: 24px;
  height: 24px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.voice-participant-name {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-participant-icons {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}

.voice-participant-icon-badge {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.voice-participant-icon {
  width: 12px;
  height: 12px;
  display: block;
  object-fit: contain;
}

.user-panel {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
  position: relative;
}

.user-panel.with-voice-connection {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.user-panel-trigger {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  padding: 6px 8px;
  margin: -6px -2px;
  border-radius: 16px;
  text-align: left;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.user-panel-trigger:hover,
.user-panel-trigger:focus-visible,
.user-panel-trigger.open {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--border);
}

.user-panel.with-voice-connection .user-panel-trigger {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.user-panel-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar .status-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 14px;
  height: 14px;
  border-width: 3px;
  border-color: #2b2d31;
  z-index: 1;
}

.user-name-section {
  min-width: 0;
}

.user-display-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tag {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.user-panel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  overflow: visible;
}

.voice-ctrl-stack {
  position: relative;
  width: 34px;
  display: flex;
  justify-content: center;
  overflow: visible;
}

.voice-ctrl-slider-shell {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: 148px;
  display: grid;
  justify-items: stretch;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    var(--surface-elevated);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 38px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0) scale(0.96);
  transform-origin: bottom center;
  transition: opacity 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
  z-index: 20;
}

.voice-ctrl-slider-shell::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 100%;
  height: 16px;
  transform: translateX(-50%);
}

.voice-ctrl-stack.open .voice-ctrl-slider-shell {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.voice-ctrl-slider-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.voice-ctrl-slider-value {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  min-width: 48px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(24, 25, 28, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 10px 18px rgba(0, 0, 0, 0.28);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) scale(0.92);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 1;
}

.voice-ctrl-slider-value.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.voice-ctrl-slider {
  flex: 1;
  height: 14px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
  filter: saturate(0.95);
}

.avatar-image-fill,
.user-avatar-image,
.user-profile-avatar-image,
.profile-editor-avatar-image,
.server-profile-avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.user-profile-popover {
  position: fixed;
  width: 272px;
  z-index: 80;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    var(--surface-elevated);
  box-shadow: var(--shadow-lg);
}

.user-profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.user-profile-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.user-profile-avatar,
.profile-editor-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(180deg, #2d2f34, #202228);
}

.user-profile-avatar .status-dot,
.profile-editor-avatar .status-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  border-width: 2px;
  border-color: var(--surface-elevated);
}

.user-profile-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-status-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.user-profile-status-row .status-dot {
  width: 10px;
  height: 10px;
  border-width: 2px;
  border-color: var(--surface-elevated);
}

.user-profile-menu {
  display: grid;
  gap: 6px;
}

.user-profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.user-profile-menu-item:hover,
.user-profile-menu-item.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.user-profile-menu-item.secondary {
  color: var(--text-secondary);
}

.user-profile-menu-item.active {
  border-color: var(--brand-border);
  background: rgba(255, 255, 255, 0.065);
}

.user-profile-menu-label {
  min-width: 0;
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}

.user-profile-menu-tag {
  flex-shrink: 0;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.user-profile-menu-indicator,
.user-profile-menu-icon,
.user-profile-menu-icon-svg {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.user-profile-menu-indicator {
  border-radius: 999px;
  border: 3px solid transparent;
  background: currentColor;
}

.user-profile-menu-indicator.online {
  color: #47cf73;
}

.user-profile-menu-indicator.idle {
  color: #f0b232;
}

.user-profile-menu-indicator.dnd {
  color: #f23f43;
}

.user-profile-menu-indicator.offline {
  background: transparent;
  border-color: #6f7483;
}

.user-profile-menu-icon {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.user-profile-menu-icon-svg {
  color: #ABACB2;
}

.user-profile-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.user-profile-action:hover,
.user-profile-action:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--brand-border);
  color: var(--text-primary);
}

.profile-editor-modal {
  max-width: 640px;
  padding-top: 20px;
}

.profile-editor-modal .modal-title {
  margin-bottom: 16px;
}

.profile-editor-grid {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-editor-grid > * {
  min-width: 0;
}

.profile-editor-avatar-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.profile-editor-avatar-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.profile-editor-avatar-button:hover,
.profile-editor-avatar-button:focus-visible {
  background: transparent;
  box-shadow: none;
}

.profile-editor-avatar {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  flex-shrink: 0;
  font-size: 24px;
  background: linear-gradient(180deg, #2d2f34, #202228);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.profile-editor-avatar .status-dot {
  border-color: var(--surface-elevated);
}

.profile-editor-avatar-caption {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.profile-editor-reset-btn {
  align-self: flex-start;
}

.profile-editor-form-card {
  display: grid;
  gap: 10px;
}

.profile-account-block {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
}

.profile-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-account-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.profile-account-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  word-break: break-all;
}

.profile-password-grid {
  display: grid;
  gap: 10px;
}

.profile-password-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.profile-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-field-head label {
  margin-bottom: 0;
}

.profile-field-count {
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 700;
}

.profile-editor-input {
  padding: 12px 14px;
  border-radius: 14px;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.profile-editor-input:hover {
  background: rgba(255, 255, 255, 0.04);
}

.profile-editor-input:focus {
  border-color: var(--brand-border);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}

.profile-editor-actions {
  margin-top: 18px;
  padding-top: 16px;
}

.profile-editor-logout {
  margin-right: auto;
}

.avatar-crop-modal {
  width: min(760px, calc(100vw - 32px));
}

.avatar-crop-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.avatar-crop-subtitle {
  margin-top: 6px;
  max-width: 360px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.avatar-crop-zoom-badge {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.avatar-crop-stage {
  display: flex;
  justify-content: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #111216;
  background-size:
    auto,
    18px 18px,
    18px 18px,
    auto;
}

.avatar-crop-frame {
  position: relative;
  width: 232px;
  height: 232px;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    #121317;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  touch-action: none;
  cursor: grab;
}

.avatar-crop-frame.rounded {
  border-radius: 28px;
}

.avatar-crop-frame:active {
  cursor: grabbing;
}

.avatar-crop-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: inherit;
  pointer-events: none;
}

.avatar-crop-image {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  user-select: none;
  pointer-events: none;
  will-change: transform;
}

.avatar-crop-controls {
  margin-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.avatar-crop-control-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-crop-control-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.avatar-crop-slider {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.avatar-crop-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--text-primary);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.avatar-crop-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--text-primary);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.avatar-crop-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.avatar-crop-control-value {
  min-width: 44px;
  text-align: right;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.avatar-crop-reset-btn {
  flex-shrink: 0;
}

.avatar-crop-modal .modal-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.profile-avatar-input {
  display: none;
}

@media (max-width: 760px) {
  .profile-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .profile-editor-modal,
  .avatar-crop-modal {
    width: calc(100vw - 20px);
    padding: 18px;
  }

  .avatar-crop-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .avatar-crop-stage {
    padding: 10px;
  }

  .avatar-crop-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .avatar-crop-control-row {
    flex-wrap: wrap;
  }

  .avatar-crop-control-value {
    min-width: 0;
    width: 100%;
    text-align: left;
  }
}

.control-btn,
.voice-ctrl-btn,
.voice-disconnect-btn,
.member-action-btn {
  display: grid;
  place-items: center;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.control-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 0;
  color: var(--text-subtle);
}

.control-btn:hover,
.voice-ctrl-btn:hover,
.voice-disconnect-btn:hover,
.member-action-btn:hover {
  transform: none;
}

.control-btn.active {
  background: rgba(239, 107, 115, 0.16);
  color: #ffd5d8;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
}

.status-dot.online {
  background: var(--success);
}

.status-dot.idle {
  background: var(--warning);
}

.status-dot.dnd {
  background: var(--danger);
}

.status-dot.offline {
  background: var(--text-subtle);
}

.voice-connection-bar {
  margin: 0 12px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(25, 31, 44, 0.96), rgba(18, 23, 34, 0.96));
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 8;
  overflow: visible;
}

.voice-connection-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-audio-tools-anchor {
  position: relative;
  flex-shrink: 0;
  z-index: 2;
}

.voice-connection-icon-shell {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(92, 174, 118, 0.15);
}

.voice-connection-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.voice-connection-icon.connecting {
  animation: pulse 1.6s infinite;
}

.voice-connection-text {
  min-width: 0;
  flex: 1;
  position: relative;
}

.voice-connection-status-trigger {
  width: 100%;
  padding: 0;
  display: block;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.voice-connection-status-trigger:hover .voice-connection-status,
.voice-connection-status-trigger:focus-visible .voice-connection-status {
  color: var(--text-primary);
}

.voice-connection-status {
  font-size: 13px;
  font-weight: 700;
}

.voice-connection-channel {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-connection-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 20;
  min-width: 280px;
  max-width: 320px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(18, 23, 34, 0.98);
  box-shadow: var(--shadow-md);
  transform-origin: bottom left;
}

.voice-connection-popover-floating {
  position: fixed;
  left: auto;
  bottom: auto;
  z-index: 1200;
}

.voice-connection-popover-header {
  display: grid;
  gap: 4px;
}

.voice-connection-popover-latency {
  text-align: left;
}

.voice-connection-popover-latency-label {
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.voice-connection-popover-value {
  margin-top: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.voice-connection-popover-diagnostics {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 8px;
}

.voice-connection-popover-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-secondary);
}

.voice-connection-popover-item strong {
  max-width: 62%;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.voice-audio-tools-popover {
  position: fixed;
  z-index: 1200;
  width: 296px;
  display: grid;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-elevated);
  box-shadow: var(--shadow-md);
  transform-origin: bottom right;
}

.voice-audio-tools-block {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.voice-audio-tools-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.voice-audio-tools-title {
  color: var(--text-primary);
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  line-height: var(--leading-compact);
}

.voice-audio-tools-description {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: var(--type-sm);
  line-height: 1.45;
}

.voice-audio-tools-toggle {
  position: relative;
  width: 46px;
  height: 28px;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.18s ease;
}

.voice-audio-tools-toggle.active {
  background: #5d67ff;
}

.voice-audio-tools-toggle-thumb {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s ease;
}

.voice-audio-tools-toggle.active .voice-audio-tools-toggle-thumb {
  transform: translateX(18px);
}

.voice-audio-tools-btn.active {
  background: rgba(178, 168, 153, 0.16);
  border-color: rgba(178, 168, 153, 0.2);
  color: var(--text-primary);
}

.voice-audio-tools-test-btn {
  height: 34px;
  padding: 0 12px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  transition: background 0.18s ease, transform 0.18s ease;
}

.voice-audio-tools-test-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.mic-test-panel.compact {
  margin-top: 10px;
}

.mic-test-row.compact {
  gap: 10px;
}

.mic-test-panel.compact .mic-test-meter {
  height: 16px;
  border: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 6px, transparent 6px 10px),
    rgba(255, 255, 255, 0.04);
}

.mic-test-panel.compact .mic-test-fill {
  background: linear-gradient(90deg, #7c84ff, #5d67ff);
}

.mic-test-panel.compact .mic-test-meta {
  margin-top: 8px;
}

.mic-test-meta.compact {
  display: grid;
  gap: 4px;
}

.mic-test-meta.compact .mic-test-status {
  font-size: var(--type-xs);
  font-weight: var(--weight-semibold);
}

.mic-test-caption {
  color: var(--text-subtle);
  font-size: var(--type-xs);
  line-height: 1.45;
}

.voice-disconnect-btn,
.voice-ctrl-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 0;
  color: var(--text-secondary);
}

.voice-ctrl-icon {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.voice-ctrl-btn.active {
  background: rgba(242, 238, 232, 0.1);
  color: var(--text-primary);
}

.voice-ctrl-btn:hover,
.control-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}



.voice-disconnect-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(15, 19, 28, 0.7), rgba(12, 16, 24, 0.92));
}

.home-main-content .welcome-view {
  width: min(760px, 100%);
  margin: 0 auto;
  justify-content: center;
  padding: 36px 32px;
}

.home-main-content .empty-actions {
  justify-content: center;
}

.content-header {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-top: 1px solid var(--border);
  background: rgba(15, 18, 26, 0.72);
  backdrop-filter: blur(16px);
}

.content-header-icon {
  color: var(--text-secondary);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.content-header-icon-image {
  width: 18px;
  height: 18px;
  display: block;
}

.content-header-name {
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
}

.content-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.welcome-view,
.empty-panel,
.voice-empty-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.auth-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #121214;
}

.auth-shell.loading {
  color: var(--text-secondary);
}

.auth-loading-panel {
  width: min(420px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 28px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 20, 25, 0.82);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
}

.auth-loading {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-form {
  width: min(420px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 24px;
}

.auth-title {
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-segmented {
  margin-bottom: 4px;
}

.auth-form .form-group {
  margin-bottom: 0;
}

.auth-back-btn {
  flex-shrink: 0;
  align-self: flex-start;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  cursor: pointer;
}

.auth-checkbox input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-actions {
  margin-top: 2px;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 14px;
}

.auth-link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.auth-link-btn:hover,
.auth-link-btn:focus-visible {
  color: var(--text-primary);
  background: transparent;
  box-shadow: none;
}

.auth-debug-code {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.auth-submit-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
}

.welcome-view {
  gap: 16px;
  padding: 24px;
}

.welcome-title {
  font-size: 32px;
  font-weight: 800;
}

.welcome-subtitle,
.welcome-subtitle-small {
  max-width: 520px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.welcome-title-small {
  font-size: 22px;
  font-weight: 700;
}

.welcome-icon {
  font-size: 52px;
  opacity: 0.85;
}

.empty-panel {
  gap: 6px;
  padding: 16px 0;
  border: 0;
  background: transparent;
}

.empty-panel.small {
  min-height: 160px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.chat-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-1);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.messages-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  transition: background 0.18s ease;
}

.message:hover {
  background: rgba(255, 255, 255, 0.04);
}

.message-avatar,
.member-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-weight: 800;
}

.message-body {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.message-author {
  font-weight: 700;
}

.message-timestamp {
  color: var(--text-subtle);
  font-size: 12px;
}

.message-status {
  color: var(--text-subtle);
  font-size: 12px;
}

.message.message-pending {
  opacity: 0.72;
}

.message-content {
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
}

.message-content.message-content-emoji {
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.message-reply-quote {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-left: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  color: var(--text-subtle);
  font-size: 12px;
}

.message-reply-author {
  color: var(--text-primary);
  font-weight: 600;
}

.message-reply-preview {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-attachment-image {
  display: block;
  margin-top: 4px;
  max-width: min(400px, 100%);
  max-height: 360px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.03);
}

.message-input-container {
  padding: 0 16px 16px;
}

.message-composer-preview {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.message-replying {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label remove"
    "preview remove";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.message-replying-label {
  grid-area: label;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.message-replying-preview {
  grid-area: preview;
  color: var(--text-subtle);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-replying-remove {
  grid-area: remove;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-subtle);
  background: transparent;
  flex-shrink: 0;
}

.message-replying-remove:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.message-composer-preview-image {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.message-composer-preview-label {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-composer-preview-remove {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-subtle);
  background: transparent;
  flex-shrink: 0;
}

.message-composer-preview-remove:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.message-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.message-input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0;
}

.message-tool-btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.voice-workspace {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-1);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.voice-workspace.compact {
  min-height: 260px;
}

.voice-main-container {
  flex: 1;
  min-height: 0;
  display: flex;
  background: #0d1018;
}

.self-share-preview {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 14;
  width: min(320px, calc(100% - 40px));
  height: 180px;
  padding: 0;
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(27, 25, 23, 0.98), rgba(14, 14, 15, 0.98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  text-align: left;
  -webkit-app-region: no-drag;
}

.self-share-preview.dragging {
  user-select: none;
}

.self-share-preview-surface {
  position: absolute;
  inset: 0;
  padding: 0;
  background: transparent;
  touch-action: none;
  cursor: grab;
  -webkit-app-region: no-drag;
}

.self-share-preview.dragging .self-share-preview-surface {
  cursor: grabbing;
}

.self-share-preview-view {
  position: relative;
  width: 100%;
  height: 100%;
  background: #140f26;
  z-index: 1;
  pointer-events: none;
}

.self-share-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.56;
  filter: saturate(0.95);
}

.self-share-preview-topbar,
.self-share-preview-footer {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: #fff;
  pointer-events: none;
}

.self-share-preview-topbar {
  top: 0;
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.72), rgba(8, 10, 16, 0));
}

.self-share-preview-channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.self-share-preview-icon {
  width: 14px;
  height: 14px;
  display: block;
  object-fit: contain;
  opacity: 0.92;
}

.self-share-preview-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.self-share-preview-center strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.self-share-preview-center span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 600;
}

.self-share-preview-footer {
  bottom: 0;
  background: linear-gradient(0deg, rgba(8, 10, 16, 0.78), rgba(8, 10, 16, 0));
}

.self-share-preview-title,
.self-share-preview-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.self-share-preview-name {
  max-width: 100%;
}

.self-share-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.self-share-preview-action {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  background: rgba(0, 0, 0, 0.28);
  font-size: 16px;
  line-height: 1;
  pointer-events: auto;
  -webkit-app-region: no-drag;
}

.self-share-preview-action:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.self-share-preview-action.danger {
  border-color: rgba(255, 228, 234, 0.18);
  background: rgba(110, 61, 77, 0.9);
  color: #ffffff;
}

.self-share-preview-action.danger:hover {
  border-color: rgba(255, 228, 234, 0.26);
  background: rgba(120, 66, 84, 0.96);
  color: #fff;
}

.self-share-preview-action-icon {
  width: 14px;
  height: 14px;
  display: block;
  object-fit: contain;
}

.screen-share-main {
  flex: 1;
  min-width: 0;
  display: flex;
}

.screen-share-view.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 5200;
  width: 100%;
  height: 100%;
  background: #000;
}

.screen-share-view {
  position: relative;
  flex: 1;
  background: #06080d;
}

.screen-share-view.share-immersive .screen-share-label,
.screen-share-view.share-immersive .screen-share-tools,
.screen-share-view.share-immersive .screen-share-fullscreen-dock {
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.screen-share-view.share-immersive.share-chrome-hidden {
  cursor: none;
}

.screen-share-view.share-immersive.share-chrome-hidden .screen-share-label,
.screen-share-view.share-immersive.share-chrome-hidden .screen-share-tools,
.screen-share-view.share-immersive.share-chrome-hidden .screen-share-fullscreen-dock {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.screen-share-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.screen-share-label {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.58);
  color: white;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.video-stats {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.58);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  backdrop-filter: blur(8px);
}

.screen-share-tools {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: min(72vw, 760px);
}

.screen-share-fullscreen-dock {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 1;
}

.screen-share-fullscreen-btn,
.screen-share-exit-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.screen-share-tool-icon {
  font-size: 14px;
}

.screen-share-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.screen-share-fullscreen-btn:focus-visible,
.screen-share-exit-btn:focus-visible {
  outline: 2px solid rgba(212, 214, 255, 0.68);
  outline-offset: 2px;
}

.screen-share-exit-btn:hover {
  background: rgba(103, 117, 199, 0.28);
  border-color: rgba(212, 219, 255, 0.2);
}

.screen-share-exit-btn {
  background: rgba(79, 92, 171, 0.88);
  border-color: rgba(212, 219, 255, 0.16);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.voice-main-container.share-focus-mode .voice-side-ribbon {
  display: none;
}

.voice-empty-stage {
  gap: 10px;
  padding: 20px;
}

.voice-side-ribbon {
  width: 122px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 22, 31, 0.92);
  overflow-y: auto;
}

.voice-main-container.participants-only {
  display: block;
}

.voice-member-stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.voice-participant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.voice-participant-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.voice-participant-card {
  overflow: hidden;
  min-height: 0;
  padding: 0 0 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #17181c;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

button.voice-participant-card {
  text-align: left;
}

button.voice-participant-card:hover {
  transform: translateY(-2px);
  background: #1b1d21;
  box-shadow: 0 12px 28px rgba(4, 5, 8, 0.2);
}

.voice-participant-card.can-watch {
  cursor: pointer;
}

.voice-participant-card.can-watch:hover {
  border-color: rgba(191, 151, 70, 0.42);
}

button.voice-participant-card.can-watch:focus-visible {
  outline: 2px solid rgba(212, 214, 255, 0.68);
  outline-offset: 2px;
}

.voice-participant-card.speaking {
  border-color: rgba(53, 193, 135, 0.3);
  box-shadow: 0 0 0 1px rgba(53, 193, 135, 0.12);
}

.voice-participant-card.watching {
  border-color: rgba(191, 151, 70, 0.42);
  background: linear-gradient(180deg, #1a1d1c, #191816);
  box-shadow: 0 0 0 1px rgba(191, 151, 70, 0.12), 0 12px 28px rgba(4, 5, 8, 0.22);
}

.voice-participant-card-media {
  width: 100%;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0;
  background: #23252a;
}

.voice-participant-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.voice-participant-card-media::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 8, 11, 0.04), rgba(7, 8, 11, 0.42));
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.voice-participant-card.can-watch:hover .voice-participant-card-media::before,
.voice-participant-card.can-watch:focus-visible .voice-participant-card-media::before,
.voice-participant-card.watching .voice-participant-card-media::before {
  opacity: 1;
}

.voice-participant-card-media-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.voice-participant-card-watch-cta {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 15, 19, 0.84);
  backdrop-filter: blur(12px);
  color: #f8f8fb;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 8px));
  transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.voice-participant-card.can-watch:hover .voice-participant-card-watch-cta,
.voice-participant-card.can-watch:focus-visible .voice-participant-card-watch-cta {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.voice-participant-card-watch-cta.active {
  border-color: rgba(212, 219, 255, 0.2);
  background: rgba(79, 92, 171, 0.9);
  color: #ffffff;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.voice-participant-card-watch-cta-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.voice-participant-card-share-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(23, 25, 29, 0.94);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.voice-participant-card-share-badge.active {
  border-color: rgba(212, 219, 255, 0.16);
  background: rgba(51, 60, 98, 0.92);
  color: #ffffff;
}

.voice-participant-card-live-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #d46a6a;
  box-shadow: 0 0 0 2px rgba(212, 106, 106, 0.14);
}

.voice-participant-card-share-action {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 18, 22, 0.82);
  backdrop-filter: blur(10px);
  cursor: pointer;
  color: #f2f3f5;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.voice-participant-card-share-action:hover {
  background: rgba(28, 30, 36, 0.94);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
}

.voice-participant-card-share-action.active {
  background: rgba(110, 61, 77, 0.94);
  border-color: rgba(255, 228, 234, 0.22);
  color: #ffffff;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.voice-participant-card-share-action.active:hover {
  background: rgba(120, 66, 84, 0.97);
  border-color: rgba(255, 228, 234, 0.28);
}

.voice-participant-card-share-action:focus-visible {
  outline: 2px solid rgba(212, 214, 255, 0.68);
  outline-offset: 2px;
}

.voice-participant-card-share-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}

.voice-participant-card-name {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.voice-participant-card .voice-participant-name {
  display: block;
  padding: 0 12px;
}

.voice-workspace.participants-mode {
  min-height: auto;
}

.voice-tile-mini {
  position: relative;
  aspect-ratio: 1;
  border-radius: 18px;
  border: 1px solid transparent;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
}

.voice-tile-mini:hover {
  background: var(--surface-3);
}

.voice-tile-mini.speaking {
  border-color: rgba(53, 193, 135, 0.44);
  box-shadow: inset 0 0 0 1px rgba(53, 193, 135, 0.2);
}

.voice-tile-mini-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  font-size: 14px;
  font-weight: 800;
}

.voice-tile-mini-name {
  width: 100%;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-tile-mini-badge,
.mini-share-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 11px;
}

.voice-tile-mini-badge {
  width: 20px;
  min-width: 20px;
  padding: 0;
}

.mini-share-indicator {
  width: 20px;
  min-width: 20px;
  padding: 0;
}

.voice-tile-mini-badge-icon,
.mini-share-indicator-icon {
  width: 12px;
  height: 12px;
  display: block;
  object-fit: contain;
}

.mini-share-indicator.active {
  background: rgba(79, 92, 171, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.modal-overlay,
.settings-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 12, 0.7);
  backdrop-filter: blur(10px);
}

.modal {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-lg);
}

.modal-narrow {
  max-width: 520px;
}

.modal-wide {
  width: min(1100px, calc(100vw - 32px));
  max-width: 1100px;
}

.modal-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
}

.settings-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.settings-card + .settings-card {
  margin-top: 14px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.segmented-btn {
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.segmented-btn.active {
  background: var(--brand-soft);
  color: #d8e5ff;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label,
.setting-label,
.quality-label,
.settings-section-title {
  display: block;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-group input,
.setting-input,
.setting-select {
  padding: 12px 14px;
  border-radius: 14px;
}

.mic-test-panel {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mic-test-panel .setting-label {
  margin-bottom: 0;
}

.settings-row + .mic-test-panel,
.mic-test-panel + .settings-row,
.mic-test-panel + .mic-test-panel {
  margin-top: 0;
}

.inline-tip,
.setting-value,
.settings-subtitle,
.empty-state {
  color: var(--text-secondary);
  line-height: 1.6;
}

.mic-test-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mic-test-meter {
  position: relative;
  flex: 1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.mic-test-fill {
  height: 100%;
  min-width: 2%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3ddc97, #7aa2ff);
  transition: width 120ms ease;
}

.mic-test-fill.active {
  box-shadow: 0 0 18px rgba(122, 162, 255, 0.25);
}

.mic-test-meta {
  margin-top: 10px;
}

.mic-test-status {
  color: var(--text-primary);
  font-weight: 600;
}

.mic-test-status.active {
  color: #7cf2b2;
}

.mic-test-status.error {
  color: #ff9aa5;
}

.btn {
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-small {
  padding: 9px 12px;
  font-size: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: white;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 107, 115, 0.18);
  color: #ffd6da;
}

.btn:disabled,
.upload-icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-dialog-copy {
  margin-top: -4px;
  color: #c9ccd1;
  line-height: 1.6;
}

.confirm-dialog-actions {
  margin-top: 20px;
}

.confirm-dialog.danger .modal-title {
  color: #fff1f2;
}

.confirm-dialog.danger .confirm-dialog-copy {
  color: #ffd7db;
}

.screen-picker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.screen-picker-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.screen-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.screen-picker-item {
  cursor: pointer;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.screen-picker-item:hover {
  border-color: var(--brand-border);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 48px rgba(5, 7, 12, 0.22);
}

.screen-picker-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0a0d14;
}

.screen-picker-thumbnail-shell {
  position: relative;
  overflow: hidden;
}

.screen-picker-thumbnail.placeholder {
  display: grid;
  place-items: center;
  font-size: 42px;
}

.screen-picker-hover-cta {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(9, 12, 20, 0.12), rgba(9, 12, 20, 0.62));
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.screen-picker-item:hover .screen-picker-hover-cta,
.screen-picker-item:focus-visible .screen-picker-hover-cta,
.screen-picker-item:focus-within .screen-picker-hover-cta {
  opacity: 1;
}

.screen-picker-hover-cta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(18, 20, 24, 0.88);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.screen-picker-name {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-secondary);
}

.quality-section {
  display: grid;
  gap: 16px;
  align-self: start;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(122, 162, 255, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.quality-header {
  display: grid;
  gap: 8px;
}

.quality-title {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.quality-description {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.quality-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.quality-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.quality-option.active {
  border-color: rgba(122, 162, 255, 0.55);
  background: linear-gradient(180deg, rgba(122, 162, 255, 0.2), rgba(122, 162, 255, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.quality-option:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.quality-option-copy {
  min-width: 0;
}

.quality-option-label {
  color: var(--text-primary);
  font-weight: 800;
}

.quality-option-note {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}

.quality-option-bitrate {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.quality-option-indicator {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.03);
}

.quality-option.active .quality-option-indicator {
  border-color: #8ea7ff;
}

.quality-option-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #8ea7ff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.quality-option.active .quality-option-indicator-dot {
  opacity: 1;
  transform: scale(1);
}

.quality-footer {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.quality-footer-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quality-footer-summary {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.5;
}

.quality-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quality-chip {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 14, 24, 0.6);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.settings-shell {
  z-index: 950;
  align-items: stretch;
  justify-content: stretch;
  background: #1e1f22;
  backdrop-filter: none;
}

.settings-sidebar {
  width: 264px;
  padding: 40px 14px 18px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #111214;
}

.settings-sidebar-server {
  margin-bottom: 18px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.settings-nav {
  display: grid;
  gap: 6px;
}

.settings-item {
  width: 100%;
  min-height: 40px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-align: left;
  color: var(--text-secondary);
}

.settings-item:hover,
.settings-item.active {
  background: var(--surface-3);
  border-color: var(--border);
  color: #ffffff;
}


.settings-content {
  flex: 1;
  max-width: none;
  padding: 44px 32px 28px;
  overflow-y: auto;
}

.member-settings-section {
  width: min(100%, 760px);
}

.server-settings-overview {
  width: min(100%, 760px);
  display: grid;
  gap: 22px;
}

.server-settings-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.012) 100%);
}

.server-settings-hero::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  pointer-events: none;
  z-index: 0;
}

.server-settings-hero-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 20px;
  margin-top: -18px;
}

.server-settings-hero-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.server-settings-fields {
  width: 100%;
}

.server-settings-section {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.server-settings-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.settings-inline-row,
.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-row {
  max-width: 720px;
}

.copy-row .setting-input {
  flex: 1;
}

.upload-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: white;
  font-weight: 700;
  appearance: none;
}

.create-server-preview {
  margin-bottom: 2px;
}

.add-server-upload-btn {
  width: 100%;
  min-height: 42px;
}

.server-settings-savebar {
  position: sticky;
  bottom: 18px;
  z-index: 4;
  width: min(100%, 940px);
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(43, 44, 49, 0.98);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 14px;
}

.server-settings-savebar-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.server-settings-savebar-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-settings-savebar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
}

.server-settings-savebar-reset {
  border: 0;
  background: transparent;
  color: #97a7ff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
}

.server-settings-savebar-reset:hover,
.server-settings-savebar-reset:focus-visible {
  background: rgba(255, 255, 255, 0.04);
}

.server-settings-savebar-reset:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.server-settings-savebar-save {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #2da861 0%, #248f52 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: filter 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.server-settings-savebar-save:hover,
.server-settings-savebar-save:focus-visible {
  filter: brightness(1.04);
}

.server-settings-savebar-save:active {
  transform: translateY(1px);
}

.server-settings-savebar-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.members-list,
.roles-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-item,
.role-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-secondary {
  margin-top: 4px;
  color: var(--text-subtle);
  font-size: 12px;
}

.member-name,
.role-name {
  font-weight: 700;
}

.member-role,
.role-description {
  margin-top: 4px;
  font-size: 13px;
}

.member-action-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(239, 107, 115, 0.12);
  border: 1px solid rgba(239, 107, 115, 0.18);
  color: #ffd7db;
  font-size: 12px;
  font-weight: 700;
}

.member-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.member-summary-card {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.member-summary-label {
  color: #b5bac1;
  font-size: 12px;
  font-weight: 700;
}

.member-summary-value {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.member-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.member-table-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.member-search-input {
  width: min(280px, 100%);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #18191c;
  color: #ffffff;
}

.member-search-input::placeholder {
  color: var(--text-subtle);
}

.member-table {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: auto;
}

.member-table-header,
.member-table-row {
  display: grid;
  grid-template-columns: minmax(240px, 2.3fr) minmax(128px, 0.95fr) minmax(96px, 0.8fr) minmax(84px, 0.65fr);
  min-width: 640px;
  gap: 0;
  align-items: center;
}

.member-table-header {
  min-height: 42px;
  padding: 0 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.member-table-row {
  min-height: 58px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.18s ease;
}

.member-table-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.member-table-row:last-child {
  border-bottom: 0;
}

.member-table-cell {
  min-width: 0;
  padding: 8px 6px;
  color: #dbdee1;
  font-size: 13px;
}

.member-table-cell.role,
.member-table-cell.action {
  display: flex;
  align-items: center;
}

.member-table-cell.action {
  justify-content: flex-end;
}

.member-table-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.member-role-badge.role-owner {
  background: rgba(237, 66, 69, 0.14);
  border-color: rgba(237, 66, 69, 0.2);
}

.member-role-badge.role-admin {
  background: rgba(250, 166, 26, 0.14);
  border-color: rgba(250, 166, 26, 0.2);
}

.member-role-badge.role-member {
  background: var(--brand-soft);
  border-color: rgba(193, 183, 166, 0.2);
}

.member-role-control {
  display: inline-flex;
  align-items: center;
  position: relative;
  min-width: 120px;
}

.member-role-control .settings-select {
  width: 100%;
}

.member-role-control .settings-select-trigger {
  width: 100%;
  min-height: 32px;
  padding: 5px 30px 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.member-role-control .settings-select-caret {
  right: 12px;
}

.member-role-control .settings-select-menu {
  right: auto;
  min-width: 120px;
  z-index: 12;
}

.member-role-control .settings-select-option {
  min-height: 36px;
  padding: 8px 12px;
}

.member-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.member-status.online {
  color: #7be495;
}

.member-status.idle {
  color: #f0b232;
}

.member-status.dnd {
  color: #ed4245;
}

.member-status.offline {
  color: #a5abb3;
}

.member-action-placeholder {
  color: var(--text-subtle);
}

.member-table-empty {
  padding: 18px 0;
  color: var(--text-secondary);
}

.settings-close-col {
  width: 72px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  padding-top: 44px;
}

.settings-close-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.settings-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.settings-close-label {
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.server-profile-banner {
  position: relative;
  height: 76px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08) 0%, transparent 38%),
    linear-gradient(180deg, rgba(39, 40, 45, 0.94) 0%, rgba(18, 18, 20, 0.98) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.server-profile-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 18, 20, 0.08) 0%, rgba(18, 18, 20, 0.7) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.028) 0,
      rgba(255, 255, 255, 0.028) 1px,
      transparent 1px,
      transparent 48px
    );
}

.server-profile-avatar {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 68px;
  margin: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(180deg, rgba(35, 36, 42, 0.98) 0%, rgba(23, 24, 28, 0.98) 100%);
  color: #ffffff;
  overflow: hidden;
  box-shadow:
    0 0 0 6px #121214,
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.server-profile-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.server-profile-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.context-menu-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.context-menu {
  position: fixed;
  z-index: 1001;
  min-width: 168px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(18, 22, 31, 0.98);
  box-shadow: var(--shadow-lg);
}

.context-menu-item {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  text-align: left;
  color: var(--text-primary);
}

.context-menu-item.active {
  color: var(--brand-fg);
  background: var(--brand-soft);
}

.context-menu-item:disabled {
  opacity: 0.5;
  cursor: default;
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.context-menu-item:disabled:hover {
  background: transparent;
}

.context-menu-item.danger {
  color: #ffd7db;
  background: rgba(239, 107, 115, 0.06);
}

.context-menu-item.danger:hover {
  background: rgba(239, 107, 115, 0.14);
}

.context-menu-item.divided,
.context-menu-label.divided {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.context-menu-label {
  padding: 4px 10px 6px;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.voice-volume-menu {
  min-width: 260px;
}

.voice-volume-menu-body {
  padding: 2px 6px 6px;
}

.voice-volume-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 8px;
  color: var(--text-secondary);
}

.voice-volume-menu-header strong {
  color: var(--text-primary);
}

.voice-volume-slider {
  width: 100%;
  margin: 0;
  accent-color: var(--brand);
}

.toast-viewport {
  position: fixed;
  top: 58px;
  right: 20px;
  z-index: 1100;
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-card {
  --toast-accent: rgba(178, 168, 153, 0.88);
  --toast-tint: rgba(178, 168, 153, 0.12);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 14px 14px 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    var(--surface-elevated);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 16px 30px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.toast-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--toast-accent);
}

.toast-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, var(--toast-tint), transparent 42%);
  pointer-events: none;
}

.toast-card.success {
  --toast-accent: rgba(90, 130, 107, 0.92);
  --toast-tint: rgba(90, 130, 107, 0.14);
  border-color: rgba(90, 130, 107, 0.22);
}

.toast-card.error {
  --toast-accent: rgba(143, 93, 93, 0.92);
  --toast-tint: rgba(143, 93, 93, 0.14);
  border-color: rgba(143, 93, 93, 0.22);
}

.toast-card.info {
  --toast-accent: rgba(109, 101, 90, 0.92);
  --toast-tint: rgba(109, 101, 90, 0.14);
  border-color: rgba(109, 101, 90, 0.22);
}

.toast-card.warning {
  --toast-accent: rgba(167, 129, 75, 0.92);
  --toast-tint: rgba(167, 129, 75, 0.14);
  border-color: rgba(167, 129, 75, 0.22);
}

.toast-copy {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.toast-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.toast-copy span {
  color: var(--text-secondary);
  line-height: 1.45;
}

.toast-close {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  z-index: 1;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.voice-debug-audio {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 42;
  width: 280px;
  height: 36px;
  opacity: 0.92;
}

.empty-state {
  padding: 18px 0;
  text-align: center;
}

@media (max-width: 1280px) {
  .sidebar-region {
    width: 340px;
  }

  .server-settings-overview,
  .settings-grid,
  .stats-card,
  .quality-options {
    grid-template-columns: 1fr;
  }

  .server-settings-hero-body {
    align-items: flex-start;
  }

  .server-settings-savebar-actions {
    width: auto;
  }

  .voice-side-ribbon {
    width: 104px;
  }
}

@media (max-width: 960px) {
  .screen-picker-layout {
    grid-template-columns: 1fr;
  }
}

:root {
  --bg-app: #09090a;
  --bg-panel: #0d0e10;
  --bg-panel-alt: #121315;
  --bg-panel-soft: #18191c;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-active: rgba(193, 183, 166, 0.12);
  --surface-1: #101113;
  --surface-2: #151618;
  --surface-3: #1d1f22;
  --surface-elevated: #0c0d0f;
  --text-primary: #f2eee8;
  --text-secondary: #cbc4bc;
  --text-muted: #a29b92;
  --text-subtle: #77726b;
  --brand: #6d655a;
  --brand-strong: #514c45;
  --brand-soft: rgba(178, 168, 153, 0.14);
  --brand-fg: #eee7da;
  --brand-border: rgba(193, 183, 166, 0.28);
  --success: #5a826b;
  --warning: #a7814b;
  --danger: #8f5d5d;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);
  --shadow-md: none;
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5);
}

body {
  background:
    radial-gradient(circle at top, rgba(178, 168, 153, 0.05), transparent 28%),
    linear-gradient(180deg, #050506 0%, var(--bg-app) 100%);
}

.titlebar {
  height: 34px;
  padding: 0 8px 0 12px;
  background: var(--surface-elevated);
  backdrop-filter: none;
}

.titlebar-status {
  padding: 5px 10px;
  background: var(--surface-2);
}

.sidebar-region {
  width: 312px;
  background: var(--surface-2);
}

.sidebar-region.home-selected {
  width: 72px;
  backdrop-filter: none;
}

.sidebar-region.home-selected .sidebars-container {
  flex: 0 0 auto;
}

.server-sidebar {
  width: 72px;
  padding: 12px 0;
  background: var(--surface-elevated);
  border-right: 0;
}

.server-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-1);
  transition: none;
}

.server-icon:hover,
.server-icon.active {
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: none;
}

.server-mini-action {
  background: var(--surface-1);
}

.channel-sidebar {
  background: var(--surface-2);
}

.channel-header {
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.channel-header-title {
  font-size: 15px;
}

.channel-list {
  padding: 8px 8px 16px;
}

.channel-category {
  margin-top: 18px;
}

.channel-category-header {
  padding: 0 8px;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.channel-item {
  padding: 6px 8px;
  border-radius: 4px;
}

.channel-item:hover,
.channel-item:focus-visible {
  background: var(--bg-hover);
}

.channel-item.active {
  background: var(--bg-active);
  box-shadow: none;
}

.voice-participants-inline {
  margin-left: 28px;
  padding-left: 8px;
}

.voice-participant-inline {
  padding: 6px 8px;
  border-radius: 4px;
}

.voice-participant-avatar {
  border-radius: 50%;
}

.voice-connection-bar {
  margin: 0px 12px 0px 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px 8px 0px 0px;
  background: var(--bg-panel-alt);
  border-top: 1px solid var(--border);
  border-left:1px solid var(--border);
  border-right:1px solid var(--border);
}

.voice-disconnect-btn,
.voice-ctrl-btn,
.control-btn {
  border-radius: 4px;
}

.user-panel {
  margin: 0px 8px 8px 8px;
  padding: 10px 12px;
  border: 0;
  background: var(--bg-panel-alt);
}

.user-avatar {
  border-radius: 50%;
}

.main-content {
  background: var(--bg-app);
}

.content-header {
  height: 48px;
  padding: 0 16px;
  background: var(--bg-app);
  backdrop-filter: none;
}

.content-header-name {
  font-size: 15px;
}

.channel-frame {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  border-top: 1px solid var(--border);
}

.channel-main {
  min-width: 0;
  background: var(--bg-app);
}

.content-body {
  gap: 0;
  padding: 0;
}

.text-page-body,
.voice-page-body {
  min-height: 0;
}

.text-page-body {
  position: relative;
}

.voice-page-body {
  position: relative;
  padding: 16px;
}

.chat-area {
  border: 0;
  border-radius: 0;
  background: #1A1A1E;
  box-shadow: none;
}

.voice-chat-area {
  min-height: 0;
  border-top: 1px solid var(--border);
}

.voice-chat-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.voice-chat-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
}

.voice-chat-header-icon-image {
  width: 14px;
  height: 14px;
  display: block;
  object-fit: contain;
}

.voice-chat-header-name {
  font-size: 15px;
  font-weight: 700;
}

.messages-container {
  padding: 16px 0;
  gap: 0;
}

.message {
  padding: 2px 16px;
  border-radius: 0;
}

.message:hover {
  background: var(--bg-hover);
}

.message-avatar,
.member-avatar,
.member-sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.message-input-container {
  padding: 0 16px 24px;
}

.message-input-wrapper {
  gap: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #222327;
  padding: 0 8px 0 16px;
}

.message-input {
  padding: 11px 0;
}

.voice-workspace {
  border: 0;
  border-radius: 0;
  background: var(--surface-2);
  box-shadow: none;
}

.voice-workspace.compact {
  min-height: 220px;
  border-bottom: 1px solid var(--border);
}

.voice-main-container {
  background: var(--surface-elevated);
}

.voice-participant-card {
  background: #17181c;
  border-radius: 12px;
}

.voice-participant-card.can-watch:hover {
  background: #1b1d21;
}

.voice-side-ribbon {
  width: 98px;
  padding: 10px;
  background: var(--bg-panel-alt);
  border-left: 1px solid var(--border);
}

.voice-tile-mini {
  border-radius: 10px;
  background: var(--surface-2);
}

.voice-tile-mini-avatar {
  border-radius: 50%;
}

.welcome-view {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 32px;
}

.empty-panel {
  border-radius: 8px;
  border: 0;
  background: var(--surface-2);
}

.member-sidebar {
  width: 240px;
  min-width: 240px;
  padding: 16px 8px 20px;
  border-left: 1px solid var(--border);
  background: #1A1A1E;
  overflow-y: auto;
}

.member-group {
  margin-bottom: 14px;
}

.member-group-title {
  padding: 0 8px 6px;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.member-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.member-sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.member-sidebar-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

.member-sidebar-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-sidebar-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.member-sidebar-badge.role-admin {
  color: #e8ddca;
}

.member-sidebar-badge.role-owner {
  color: #f1c6cd;
}

.member-sidebar-live {
  color: var(--success);
  font-size: 11px;
}

@media (max-width: 1160px) {
  .channel-frame {
    grid-template-columns: 1fr;
  }

  .member-sidebar {
    display: none;
  }
}

.member-sidebar-avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  font-size: 14px;
  font-weight: 800;
}

.channel-main {
  display: flex;
  min-height: 0;
}

.voice-page-body .voice-workspace {
  flex: 1;
  min-height: 0;
}

.voice-page-body .voice-workspace.participants-mode {
  flex: 0 0 auto;
  min-height: auto;
}

.voice-page-body .voice-workspace.compact.participants-mode {
  background: transparent;
  border-bottom: 0;
  overflow: visible;
}

.voice-page-body .voice-workspace.participants-mode .voice-main-container {
  flex: 0 0 auto;
}

.voice-page-body .voice-workspace.compact.participants-mode .voice-main-container {
  background: transparent;
}

.voice-page-body .voice-workspace.participants-mode .voice-member-stage {
  padding-bottom: 18px;
}

.voice-page-body .voice-workspace.compact.participants-mode .voice-member-stage {
  padding: 18px 12px 18px;
}

.voice-page-body .voice-workspace.participants-mode .voice-participant-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  justify-content: flex-start;
}

.channel-header-caret {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-header-caret-icon {
  width: 12px;
  height: 12px;
  display: block;
  object-fit: contain;
}

.channel-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.channel-category-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  color: inherit;
  font: inherit;
}

.channel-category-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-category-caret {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.channel-category-caret-icon {
  width: 12px;
  height: 12px;
  display: block;
  object-fit: contain;
}

.category-add-btn {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: var(--text-subtle);
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease;
}

.category-add-icon {
  width: 12px;
  height: 12px;
  display: block;
  object-fit: contain;
}

.category-add-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.channel-category-empty {
  margin: 0 0 8px 18px;
  padding: 4px 8px 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-subtle);
  font-size: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.link-action-btn {
  padding: 0;
  color: #cfe3ff;
  font-size: 12px;
  font-weight: 700;
}

.link-action-btn:hover {
  color: #ffffff;
  text-decoration: underline;
}

.channel-category-header,
.channel-item,
.channel-category-empty,
.channel-dropzone {
  position: relative;
}

.channel-category-header[draggable='true'],
.channel-item[draggable='true'] {
  cursor: grab;
}

.channel-category-header.dragging,
.channel-item.dragging {
  opacity: 0.56;
  cursor: grabbing;
}

.channel-category-header.drop-target,
.channel-category-header.channel-drop-target {
  border-radius: 8px;
  background: rgba(178, 168, 153, 0.1);
}

.channel-category-header.drop-target::after,
.channel-item.drop-target::before,
.channel-dropzone.drop-target::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(222, 212, 196, 0.88);
}

.channel-category-header.drop-target::after {
  top: -4px;
}

.channel-item.drop-target::before {
  top: -4px;
}

.channel-category-empty.drop-target {
  border-left-color: rgba(193, 183, 166, 0.48);
  background: rgba(178, 168, 153, 0.08);
  border-radius: 8px;
}

.channel-dropzone {
  height: 10px;
  margin: 2px 0 0 28px;
  border-radius: 999px;
}

.channel-dropzone.drop-target::before {
  top: 4px;
}

.category-dropzone {
  margin: 10px 8px 0;
}

.message-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 10px;
}

.message-divider-line {
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
}

.message-divider-label {
  flex-shrink: 0;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 600;
}

.message {
  position: relative;
  padding-right: 172px;
}

.message-actions {
  position: absolute;
  top: 6px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(18, 20, 24, 0.94);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.message.actions-pinned .message-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.message-action-btn {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-subtle);
  background: transparent;
  font-size: 14px;
}

.message-action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.message-action-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.message-action-pill {
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-subtle);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.message-action-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.message-action-pill.active {
  color: var(--text-primary);
  background: rgba(178, 168, 153, 0.16);
  border-color: rgba(178, 168, 153, 0.2);
}

.message-action-emoji {
  font-size: 15px;
  line-height: 1;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.message-reaction-pill {
  min-width: 40px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.message-reaction-pill:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.message-reaction-pill.active {
  color: var(--text-primary);
  border-color: rgba(202, 138, 4, 0.28);
  background: rgba(202, 138, 4, 0.12);
}

.message-reaction-emoji {
  font-size: 14px;
  line-height: 1;
}

.message-reaction-count {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.message-more-menu {
  min-width: 188px;
}

.confirm-dialog-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.confirm-dialog-summary-copy {
  min-width: 0;
  flex: 1;
}

.confirm-dialog-summary .member-role-badge {
  margin-left: auto;
}

.confirm-dialog-summary-copy .member-secondary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-input-wrapper {
  min-height: 44px;
}

.message-input {
  flex: 1;
  min-width: 0;
  width: auto;
  appearance: none;
  -webkit-appearance: none;
}

.message-input-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  flex: 0 0 auto;
}

.message-tool-btn {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-subtle);
  background: transparent;
  font-size: 15px;
}

.message-send-btn {
  flex: 0 0 auto;
  margin-left: 6px;
}

.message-tool-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.message-tool-btn.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.emoji-picker-popover {
  position: fixed;
  z-index: 1002;
  width: 352px;
  max-width: calc(100vw - 24px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.emoji-picker-popover em-emoji-picker {
  width: 100%;
}

.member-sidebar-avatar {
  position: relative;
  overflow: visible;
}

.member-status-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border: 3px solid #2b2d31;
  border-radius: 50%;
  background: var(--text-subtle);
}

.member-status-dot.online {
  background: var(--success);
}

.member-status-dot.idle {
  background: #f0b232;
}

.member-status-dot.dnd {
  background: #ed4245;
}

.member-status-dot.offline {
  background: #80848e;
}

.member-sidebar-item.offline {
  opacity: 0.72;
}

.member-sidebar-item.offline .member-sidebar-name,
.member-sidebar-item.offline .member-sidebar-badge {
  color: var(--text-subtle);
}

:root {
  --type-2xs: 11px;
  --type-xs: 12px;
  --type-sm: 13px;
  --type-md: 14px;
  --type-lg: 16px;
  --type-xl: 18px;
  --type-2xl: 22px;
  --type-3xl: 28px;
  --type-4xl: 32px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;
  --leading-compact: 1.35;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;
  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.03em;
  --tracking-wider: 0.06em;
}

body {
  font-size: var(--type-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  text-rendering: optimizeLegibility;
}

.channel-header-title,
.content-header-name,
.voice-chat-header-name {
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-compact);
  letter-spacing: var(--tracking-tight);
}

.voice-connection-channel,
.member-sidebar-badge,
.toast-copy span,
.screen-picker-name {
  font-size: var(--type-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-normal);
}

.channel-category-header,
.member-group-title,
.context-menu-label,
.setting-label,
.quality-label,
.settings-section-title,
.message-timestamp,
.message-divider-label,
.member-summary-label,
.member-sidebar-live,
.voice-tile-mini-name,
.channel-item-duration {
  font-size: var(--type-xs);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-wide);
}

.channel-item-name,
.message-author,
.message-content,
.member-sidebar-name,
.member-table-title,
.member-table-cell,
.member-search-input,
.member-role-badge,
.server-profile-meta,
.toast-copy strong {
  font-size: var(--type-md);
}

.channel-item-name,
.member-search-input,
.server-profile-meta {
  font-weight: var(--weight-medium);
}

.message-author,
.member-sidebar-name,
.member-table-title,
.toast-copy strong {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-compact);
}

.message-content,
.welcome-subtitle,
.welcome-subtitle-small {
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
}

.voice-connection-status,
.voice-participant-card-pill,
.screen-share-exit-btn {
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-compact);
}

.voice-participant-card-name {
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-compact);
  letter-spacing: var(--tracking-tight);
}

.welcome-title {
  font-size: var(--type-4xl);
  font-weight: var(--weight-heavy);
  line-height: 1.12;
  letter-spacing: var(--tracking-tight);
}

.welcome-title-small,
.modal-title,
.voice-connection-popover-value {
  font-size: var(--type-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}

.server-profile-title {
  font-size: var(--type-3xl);
  font-weight: var(--weight-heavy);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
}

.member-table-header {
  font-size: var(--type-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
}

.message-timestamp,
.channel-item-duration,
.voice-connection-popover-value,
.member-summary-value {
  font-variant-numeric: tabular-nums;
}

.message-header,
.voice-connection-channel,
.member-sidebar-badge,
.server-profile-meta,
.toast-copy span {
  letter-spacing: 0.01em;
}

.context-menu-label,
.channel-category-header,
.member-group-title,
.member-summary-label,
.message-divider-label {
  letter-spacing: var(--tracking-wider);
}

.member-role-badge,
.voice-participant-card-pill,
.screen-share-exit-btn {
  font-weight: var(--weight-semibold);
}

.message-content {
  margin-top: 6px;
}

.voice-connection-status,
.voice-connection-popover-value,
.welcome-title,
.welcome-title-small,
.modal-title,
.member-summary-value,
.server-profile-title {
  text-wrap: balance;
}

.settings-modal {
  padding-top: 20px;
  padding-bottom: 20px;
}

.settings-modal-header {
  margin-bottom: 14px;
}

.settings-modal-header .modal-title {
  margin-bottom: 0;
}

.settings-group + .settings-group {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-group-title {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  line-height: var(--leading-compact);
}

.settings-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-group-head .settings-group-title {
  margin-bottom: 0;
}

.usage-refresh-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.usage-refresh-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.usage-refresh-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.settings-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  position: relative;
}

.settings-row + .settings-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-row .setting-label {
  margin-bottom: 0;
}

.settings-row .inline-tip {
  font-size: 12px;
  line-height: 1.45;
}

.usage-status-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.usage-status-card.good {
  border-color: rgba(90, 130, 107, 0.45);
  background: linear-gradient(180deg, rgba(90, 130, 107, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.usage-status-card.warn {
  border-color: rgba(167, 129, 75, 0.5);
  background: linear-gradient(180deg, rgba(167, 129, 75, 0.18) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.usage-status-card.bad {
  border-color: rgba(143, 93, 93, 0.5);
  background: linear-gradient(180deg, rgba(143, 93, 93, 0.18) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.usage-status-card.neutral {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(178, 168, 153, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.usage-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.usage-status-card.good .usage-status-badge {
  background: rgba(90, 130, 107, 0.24);
}

.usage-status-card.warn .usage-status-badge {
  background: rgba(167, 129, 75, 0.26);
}

.usage-status-card.bad .usage-status-badge {
  background: rgba(143, 93, 93, 0.26);
}

.usage-status-card.neutral .usage-status-badge {
  background: rgba(178, 168, 153, 0.18);
}

.usage-status-detail {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.usage-status-meta {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.usage-config-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-select {
  position: relative;
}

.settings-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding-right: 40px;
  position: relative;
}

.settings-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-select-caret {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  color: var(--text-secondary);
  pointer-events: none;
  transition: transform 0.18s ease, color 0.18s ease;
}

.settings-select-trigger.open .settings-select-caret {
  transform: translateY(-35%) rotate(-135deg);
  color: var(--text-primary);
}

.settings-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 8;
  max-height: 248px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(22, 23, 27, 0.98);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
}

.settings-select-menu-floating {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  z-index: 1200;
  max-width: calc(100vw - 24px);
}

.settings-select-option {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.settings-select-option:hover,
.settings-select-option:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.settings-select-option.active {
  background: rgba(88, 101, 242, 0.26);
  color: #ffffff;
}

.settings-select-option-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-modal .modal-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-area .empty-panel.small {
  min-height: 0;
  padding: 40px 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.chat-area .empty-panel.small .welcome-title-small {
  margin-bottom: 6px;
}

@media (max-width: 980px) {
  .message-input-wrapper {
    padding: 0 4px 0 12px;
  }

  .message-input-tools {
    gap: 2px;
    margin-left: 4px;
  }

  .self-share-preview {
    right: 12px;
    bottom: 12px;
    width: min(280px, calc(100% - 24px));
  }

  .welcome-title {
    font-size: var(--type-3xl);
  }

  .welcome-title-small,
  .modal-title,
  .voice-connection-popover-value,
  .member-summary-value,
  .server-profile-title {
    font-size: var(--type-2xl);
  }
}

:root {
  --bg-app: #1b1c20;
  --bg-panel: #121214;
  --bg-panel-alt: #17181c;
  --bg-panel-soft: #202126;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(255, 255, 255, 0.08);
  --surface-1: #202126;
  --surface-2: #1b1c20;
  --surface-3: #26282e;
  --surface-elevated: #141518;
  --text-primary: #f5f5f6;
  --text-secondary: #d0d2d7;
  --text-muted: #a4a7ae;
  --text-subtle: #737780;
  --brand: #f5f5f6;
  --brand-strong: #cbced4;
  --brand-soft: rgba(255, 255, 255, 0.07);
  --brand-fg: #f5f5f6;
  --brand-border: rgba(255, 255, 255, 0.14);
  --success: #43b581;
  --warning: #f0b232;
  --danger: #f04747;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-md: none;
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.42);
}

body {
  background: var(--bg-app);
}

.main-content,
.channel-main {
  background: #1a1a1e;
}

.main-content.home-main-content {
  background: #121214;
}


.content-header {
  background: #1A1A1E;
  
}

.titlebar {
  background: #121214;
  
}

.sidebar-region {
  background: var(--bg-panel);
}

.server-sidebar {
  background: #121214;
}

.channel-sidebar {
  background: #121214;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius:12px 0px 0px 0px;
}

.channel-header,
.voice-chat-header,
.voice-chat-area,
.member-sidebar,
.voice-side-ribbon,
.user-panel,
.voice-connection-bar {
  border-color: var(--border);
}

.user-panel,
.voice-connection-bar {
  background: #202024;
}

.content-header,
.voice-chat-header,
.message-input-container {
  border-top-color: var(--border);
}

.message-input-container {
  
  padding-top: 16px;
}

.message-input-wrapper,
.titlebar-status,
.context-menu,
.voice-participant-card,
.voice-tile-mini,
.self-share-preview,
.screen-picker-item,
.quality-option,
.voice-connection-popover,
.modal {
  border: 1px solid var(--border);
}

.context-menu,
.voice-connection-popover,
.modal {
  background: var(--surface-elevated);
}



.titlebar-status {
  background: var(--surface-2);
}

.channel-item,
.member-sidebar-item {
  border: 1px solid transparent;
}

.channel-item.active {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.channel-item:hover,
.channel-item:focus-visible,
.member-sidebar-item:hover,
.message:hover,
.server-mini-action:hover {
  background: var(--bg-hover);
}

.server-icon,
.server-mini-action,
.user-avatar,
.message-avatar,
.member-avatar,
.member-sidebar-avatar,
.voice-tile-mini-avatar,
.voice-participant-card-avatar {
  background: linear-gradient(180deg, #2d2f34, #202228);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.server-icon.active,
.server-icon:hover {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.server-icon.active::before {
  background: #ffffff;
}

.btn {
  border: 1px solid transparent;
  transform: none;
}

.btn:hover {
  transform: none;
}

.btn-primary {
  background: #2b2d31;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-primary:hover,
.btn-secondary:hover {
  background: #303238;
}

.btn-danger {
  background: rgba(240, 71, 71, 0.12);
  border-color: rgba(240, 71, 71, 0.2);
  color: #ffd9dc;
}

.voice-participant-card-pill.share,
.context-menu-item.active,
.quality-option.active {
  background: var(--surface-3);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: inset 0 0 0 1px var(--border);
}

.channel-category-header.drop-target,
.channel-category-header.channel-drop-target,
.channel-category-empty.drop-target {
  background: rgba(255, 255, 255, 0.05);
}

.channel-category-header.drop-target::after,
.channel-item.drop-target::before,
.channel-dropzone.drop-target::before {
  background: rgba(255, 255, 255, 0.78);
}

.channel-category-empty.drop-target {
  border-left-color: rgba(255, 255, 255, 0.28);
}

.message-divider-line {
  background: var(--border);
}

:root {
  --ux-control-height-md: 40px;
  --ux-control-height-sm: 36px;
  --ux-radius-control: 12px;
  --ux-radius-compact: 10px;
  --ux-focus-outline: 2px solid rgba(255, 255, 255, 0.16);
  --ux-focus-border: rgba(255, 255, 255, 0.16);
  --ux-transition-fast: 0.16s ease;
}

button,
.channel-item,
.member-sidebar-item,
.context-menu-item,
.message-action-btn,
.message-action-pill,
.message-reaction-pill,
.server-mini-action,
.control-btn,
.voice-ctrl-btn,
.voice-disconnect-btn,
.message-tool-btn,
.message-send-btn,
.segmented-btn,
.quality-option,
.screen-picker-item,
.voice-participant-card-share-action {
  transition:
    background var(--ux-transition-fast),
    border-color var(--ux-transition-fast),
    color var(--ux-transition-fast),
    transform var(--ux-transition-fast),
    opacity var(--ux-transition-fast);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.channel-item:focus-visible,
.member-sidebar-item:focus-visible,
.context-menu-item:focus-visible,
.message-action-btn:focus-visible,
.message-action-pill:focus-visible,
.message-reaction-pill:focus-visible,
.server-icon:focus-visible,
.server-mini-action:focus-visible,
.screen-picker-item:focus-visible,
.quality-option:focus-visible {
  outline: var(--ux-focus-outline);
  outline-offset: 2px;
}

.btn {
  min-height: var(--ux-control-height-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--ux-radius-control);
  line-height: 1;
}

.btn-small {
  min-height: var(--ux-control-height-sm);
  border-radius: var(--ux-radius-compact);
}

.control-btn,
.voice-ctrl-btn,
.voice-disconnect-btn,
.server-mini-action,
.message-tool-btn,
.message-send-btn {
  width: var(--ux-control-height-sm);
  height: var(--ux-control-height-sm);
  border-radius: var(--ux-radius-compact);
}

.segmented-btn,
.context-menu-item {
  min-height: var(--ux-control-height-md);
  display: flex;
  align-items: center;
}

.segmented-btn {
  justify-content: center;
}

.channel-item,
.member-sidebar-item {
  min-height: var(--ux-control-height-md);
}

.form-group input,
.setting-input,
.setting-select,
.profile-editor-input,
.member-search-input {
  min-height: var(--ux-control-height-md);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.form-group input:hover,
.setting-input:hover,
.setting-select:hover,
.profile-editor-input:hover,
.member-search-input:hover {
  border-color: var(--ux-focus-border);
  background: rgba(255, 255, 255, 0.05);
}

.form-group input:focus,
.setting-input:focus,
.setting-select:focus,
.profile-editor-input:focus,
.member-search-input:focus {
  border-color: var(--ux-focus-border);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.055);
}

.message-input-wrapper {
  min-height: 52px;
}

.message-input-wrapper:focus-within {
  border-color: var(--ux-focus-border);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.context-menu {
  padding: 4px;
  border-radius: 12px;
}

.context-menu-item {
  border-radius: 8px;
  font-weight: 600;
}

.modal-actions {
  flex-wrap: wrap-reverse;
}

.empty-panel {
  max-width: 420px;
}

:root {
  --ux-space-1: 4px;
  --ux-space-2: 8px;
  --ux-space-3: 12px;
  --ux-space-4: 16px;
  --ux-space-5: 20px;
  --ux-space-6: 24px;
  --ux-header-height: 48px;
  --ux-panel-padding: 16px;
  --ux-block-gap: 16px;
  --ux-list-radius: 8px;
}

.channel-header,
.content-header,
.voice-chat-header {
  min-height: var(--ux-header-height);
  padding-left: var(--ux-panel-padding);
  padding-right: var(--ux-panel-padding);
}

.channel-list {
  padding: var(--ux-space-2) var(--ux-space-2) var(--ux-panel-padding);
}

.channel-category {
  margin-top: var(--ux-block-gap);
}

.channel-category-header {
  padding: 0 var(--ux-space-2);
  margin-bottom: 6px;
}

.channel-item,
.member-sidebar-item {
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--ux-list-radius);
}

.voice-participants-inline {
  margin-left: 26px;
  padding-left: var(--ux-space-2);
}

.voice-participant-inline {
  padding: 6px 8px;
  border-radius: var(--ux-list-radius);
}

.voice-connection-bar,
.user-panel {
  margin-left: 8px;
  margin-right: 8px;
  padding: 10px 12px;
}

.voice-connection-bar {
  border-radius: var(--ux-list-radius) var(--ux-list-radius) 0 0;
  margin-bottom: 0;
}

.user-panel {
  border-radius: var(--ux-list-radius);
  
  border-top: 1px solid var(--border);
  border-left:1px solid var(--border);
  border-right:1px solid var(--border);
  border-bottom: 1px solid var(--border);

}

.user-panel.with-voice-connection {
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.content-body {
  gap: 0;
  padding: 0;
}

.messages-container {
  padding: var(--ux-panel-padding) 0;
}

.message {
  padding: 4px var(--ux-panel-padding);
}

.message-input-container {
  padding: 0 0 8px 0;
}

.message-input-wrapper {
  min-height: 48px;
  gap: 0;
  padding: 0 var(--ux-space-2) 0 14px;
}

.message-input {
  padding: 11px 0;
}

.message-input:focus,
.message-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.message-input-tools {
  gap: 2px;
  margin-left: 4px;
}

.member-sidebar {
  padding: var(--ux-panel-padding) var(--ux-space-2) 20px;
}

.member-group {
  margin-bottom: 14px;
}

.member-group-title {
  padding: 0 var(--ux-space-2) 6px;
}

.modal {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 20px 24px 24px;
  border-radius: 18px;
}

.modal-title {
  margin-bottom: var(--ux-panel-padding);
}

.segmented-control {
  gap: 8px;
  margin-bottom: var(--ux-panel-padding);
}

.segmented-btn {
  padding: 10px 12px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label,
.setting-label,
.quality-label,
.settings-section-title {
  margin-bottom: 8px;
}

.form-group input,
.setting-input,
.setting-select,
.profile-editor-input,
.member-search-input {
  padding: 11px 14px;
}

.modal-actions,
.empty-actions,
.auth-actions,
.profile-password-actions,
.settings-inline-row,
.copy-row,
.server-settings-savebar-actions {
  gap: 10px;
}

.auth-form,
.auth-loading-panel {
  gap: 14px;
  padding: 24px;
}

.auth-header {
  gap: var(--ux-space-3);
}

.empty-panel {
  padding: 28px 24px;
  border-radius: 12px;
}

.settings-content {
  padding: 40px 32px 24px;
}

.server-settings-overview,
.member-settings-section {
  gap: 20px;
}

.server-settings-hero-body {
  gap: 16px;
  padding: 0 20px 20px;
}

.server-settings-section {
  gap: 10px;
  padding: 14px 0;
}

.server-settings-savebar {
  margin-top: 20px;
  padding: 12px 14px;
}

.member-summary-grid {
  gap: 8px;
}

.member-summary-card {
  gap: 8px;
  padding: 8px 12px;
}

.member-table-toolbar {
  gap: 12px;
  padding: 10px 0;
}

.member-table-header,
.member-table-row {
  padding: 0 8px;
}

.member-table-cell {
  padding: 8px 6px;
}

.screen-picker-layout {
  gap: 18px;
}

.screen-picker-main,
.screen-picker-grid,
.quality-section,
.quality-header,
.quality-footer {
  gap: 14px;
}

.quality-section {
  padding: 18px;
}

.quality-option {
  gap: 14px;
  padding: 14px 16px;
}

@media (max-width: 980px) {
  .content-header,
  .voice-chat-header,
  .message-input-container {
    padding-left: 8px;
    padding-right: 8px;
  }

  .message {
    padding-left: 12px;
    padding-right: 12px;
  }

  .settings-content {
    padding: 32px 24px 20px;
  }
}

.messages-container {
  gap: 2px;
}

.messages-container-windowed {
  gap: 0;
}

.message {
  gap: 12px;
}

.message-body {
  gap: 3px;
}

.message-header {
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.message-author {
  line-height: 1.35;
}

.message-timestamp {
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.message-content {
  margin-top: 4px;
  line-height: 1.58;
}

.message-reply-quote {
  margin-top: 2px;
  min-height: 20px;
}

.message-attachment-image {
  margin-top: 6px;
}

.message-composer-preview,
.message-replying {
  margin-bottom: 8px;
}

.message-reactions {
  gap: 6px;
  margin-top: 6px;
}

.message-reaction-pill {
  min-width: 38px;
  height: 26px;
  gap: 4px;
  padding: 0 9px;
}

.member-sidebar-item {
  min-height: 38px;
}

.member-sidebar-name {
  gap: 8px;
  line-height: 1.4;
}

.member-sidebar-badge {
  min-height: 20px;
  padding: 0 7px;
  letter-spacing: 0.02em;
}

.settings-nav {
  gap: 4px;
}

.settings-item {
  min-height: 38px;
  padding: 10px 12px;
  font-weight: 600;
}

.settings-group + .settings-group {
  margin-top: 18px;
  padding-top: 14px;
}

.settings-group-title {
  margin-bottom: 8px;
}

.settings-row {
  gap: 6px;
  padding: 14px 0;
}

.server-settings-hero-copy {
  gap: 6px;
}

.server-profile-meta {
  line-height: 1.5;
}

.server-settings-savebar {
  gap: 12px;
}

.server-settings-savebar-copy {
  display: grid;
  gap: 4px;
}

.member-table-row {
  min-height: 56px;
}

.member-table-cell {
  line-height: 1.45;
}

.member-table-profile {
  gap: 12px;
}

.member-name,
.role-name {
  line-height: 1.35;
}

.member-secondary {
  line-height: 1.4;
}

:root {
  --ux-control-gap: 8px;
  --ux-control-padding-x: 14px;
  --ux-control-padding-y: 10px;
  --ux-hover-border: rgba(255, 255, 255, 0.1);
}

.btn,
.upload-icon-btn,
.server-settings-savebar-save,
.server-settings-savebar-reset,
.member-action-btn,
.auth-submit-btn {
  min-height: var(--ux-control-height-md);
  padding: 0 var(--ux-control-padding-x);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ux-control-gap);
  line-height: 1;
}

.btn:hover,
.upload-icon-btn:hover,
.server-settings-savebar-save:hover,
.server-settings-savebar-reset:hover,
.member-action-btn:hover {
  filter: none;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.upload-icon-btn:hover,
.server-settings-savebar-save:hover,
.server-settings-savebar-reset:hover,
.member-action-btn:hover {
  border-color: var(--ux-hover-border);
}

.message-tool-btn,
.message-send-btn,
.control-btn,
.voice-ctrl-btn,
.voice-disconnect-btn,
.settings-close-btn,
.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.message-tool-btn:hover,
.message-send-btn:hover,
.control-btn:hover,
.voice-ctrl-btn:hover,
.voice-disconnect-btn:hover,
.settings-close-btn:hover,
.toast-close:hover {
  transform: none;
}

.form-group input,
.setting-input,
.setting-select,
.profile-editor-input,
.member-search-input,
.settings-select-trigger {
  min-height: var(--ux-control-height-md);
  padding: var(--ux-control-padding-y) var(--ux-control-padding-x);
  line-height: 1.45;
}

.form-group,
.settings-row,
.profile-password-grid,
.profile-editor-form-card,
.server-settings-fields,
.settings-group {
  scroll-margin-top: 24px;
}

.inline-tip,
.setting-value,
.settings-subtitle,
.auth-subtitle,
.confirm-dialog-copy {
  line-height: 1.55;
}

.modal-overlay,
.settings-shell {
  padding: 16px;
}

.modal {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 22px 24px 24px;
}

.modal-actions {
  margin-top: 20px;
  padding-top: 2px;
}

.confirm-dialog-copy {
  margin-top: 0;
}

.welcome-view {
  gap: 14px;
}

.welcome-subtitle,
.welcome-subtitle-small {
  max-width: 56ch;
}

.empty-panel {
  gap: 8px;
}

.chat-area .empty-panel.small {
  padding: 32px 24px;
}

.empty-actions {
  margin-top: 4px;
}

.settings-item,
.context-menu-item,
.settings-select-option {
  line-height: 1.35;
}

@media (max-width: 980px) {
  .modal-overlay,
  .settings-shell {
    padding: 12px;
  }

  .modal {
    width: min(920px, calc(100vw - 16px));
    max-height: calc(100vh - 24px);
    padding: 18px 18px 20px;
  }
}

.message-action-btn,
.message-action-pill,
.context-menu-item,
.settings-select-option,
.server-settings-savebar-reset,
.server-settings-savebar-save,
.member-action-btn,
.upload-icon-btn {
  white-space: nowrap;
}

.context-menu-item,
.settings-select-option {
  min-height: 36px;
}

.server-settings-savebar-reset,
.server-settings-savebar-save,
.member-action-btn,
.upload-icon-btn,
.settings-close-btn,
.toast-close {
  touch-action: manipulation;
}

.server-settings-savebar-reset:disabled,
.server-settings-savebar-save:disabled,
.member-action-btn:disabled,
.upload-icon-btn:disabled,
.settings-close-btn:disabled,
.toast-close:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 1160px) {
  .settings-sidebar {
    width: 232px;
    padding: 32px 12px 16px 20px;
  }

  .settings-content {
    padding: 32px 24px 20px;
  }

  .server-settings-overview,
  .member-settings-section {
    width: min(100%, 720px);
  }
}

@media (max-width: 980px) {
  .settings-inline-row,
  .copy-row,
  .member-table-toolbar,
  .server-settings-savebar {
    flex-wrap: wrap;
  }

  .copy-row,
  .settings-inline-row {
    align-items: stretch;
  }

  .copy-row .setting-input,
  .copy-row .btn,
  .copy-row .upload-icon-btn,
  .settings-inline-row > * {
    width: 100%;
  }

  .member-table-toolbar {
    align-items: stretch;
  }

  .member-search-input {
    width: 100%;
    max-width: none;
  }

  .server-settings-savebar {
    align-items: stretch;
  }

  .server-settings-savebar-copy,
  .server-settings-savebar-actions {
    width: 100%;
  }

  .server-settings-savebar-title {
    white-space: normal;
  }

  .server-settings-savebar-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .server-settings-hero-body {
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .settings-content {
    padding: 24px 18px 18px;
  }

  .server-settings-hero-body {
    flex-direction: column;
    margin-top: -10px;
  }

  .member-table-toolbar,
  .modal-actions,
  .empty-actions {
    gap: 8px;
  }
}
