:root {
  color-scheme: dark;
  --bg: #111318;
  --rail: #151922;
  --sidebar: #1d222c;
  --panel: #202632;
  --panel-strong: #293140;
  --line: #343d4e;
  --text: #eef2f6;
  --muted: #9ca8b7;
  --teal: #6bd4d0;
  --amber: #f2b84b;
  --rose: #e2777a;
  --green: #78d28a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-screen.hidden {
  display: none;
}

.auth-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.auth-panel > .workspace-kicker,
.auth-panel > h1,
.auth-panel > .detail-copy,
.auth-panel > .auth-message {
  grid-column: 1 / -1;
}

.auth-panel h1 {
  margin: 0;
  font-size: 2rem;
}

.auth-form {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.auth-form h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.auth-form input,
.invite-form input,
.account-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151a22;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

.auth-form button,
.invite-form button,
.account-form button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #062221;
  cursor: pointer;
  font-weight: 800;
}

.auth-message {
  min-height: 20px;
  color: var(--rose);
}

.app-shell {
  display: grid;
  grid-template-columns: 72px 420px minmax(0, 1fr) 300px;
  height: 100vh;
  overflow: hidden;
}

.server-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding: 16px 10px;
  background: var(--rail);
  border-right: 1px solid #0d1016;
}

.server-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.server-button.active {
  background: var(--teal);
  color: #062221;
}

.server-button.muted {
  color: var(--muted);
}

.server-button-direct {
  color: var(--text);
}

.server-button-icon {
  width: 22px;
  height: 22px;
}

.server-rail-separator {
  width: 32px;
  height: 2px;
  margin: 2px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 10px 10px 8px;
  overflow: hidden;
  min-width: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 4px;
}

.workspace-compact {
  padding: 0 4px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.workspace-compact h1 {
  overflow: hidden;
  margin: 0;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.server-header h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.35rem;
  align-items: center;
}

.server-invite-button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.server-invite-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.server-invite-button.hidden {
  display: none;
}

.server-settings-gear {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.server-settings-gear:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.server-settings-icon {
  width: 18px;
  height: 18px;
}

.workspace-compact .current-user {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sign-out-button {
  width: 100%;
  min-height: 36px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.sign-out-button:hover {
  border-color: var(--rose);
  color: var(--text);
}

.workspace h1,
.chat-header h2,
.right-panel h2,
.server-options-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.workspace-kicker,
.overline,
.nav-section h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-section {
  margin-top: 10px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 6px;
}

.nav-section-header h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.nav-section-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.nav-section-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
}

.nav-section-create:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.server-settings-page,
.user-settings-page,
.settings-page {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
}

body.settings-page-open {
  overflow: hidden;
}

.settings-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.settings-page-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.settings-page-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.settings-page-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.settings-page-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.settings-page-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
}

.settings-page-nav-item {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
}

.settings-page-nav-item:hover,
.settings-page-nav-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.settings-page-nav-item.active {
  border-left: 3px solid var(--teal);
  padding-left: 9px;
}

.user-settings-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.settings-page-sign-out {
  margin-top: auto;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--rose);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
}

.settings-page-sign-out:hover {
  background: rgba(226, 119, 122, 0.12);
  color: #ffb4b6;
}

.settings-page-content {
  padding: 24px 28px;
  overflow-y: auto;
}

.user-settings-gear {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.user-settings-gear:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.user-settings-icon {
  width: 18px;
  height: 18px;
}

.status-presets-page {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-message-form-page {
  max-width: 420px;
}

.account-form-page {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.account-form-page input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

.account-form-page button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #062221;
  cursor: pointer;
  font-weight: 800;
}

.settings-section h2 {
  margin: 0 0 18px;
  font-size: 1.1rem;
}

.settings-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.settings-card h3 {
  margin: 0;
  font-size: 1rem;
}

.settings-note {
  margin: 0 0 16px;
}

.settings-channel-list,
.settings-role-list {
  display: grid;
  gap: 18px;
}

.settings-role-group-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-role-list-inner {
  display: grid;
  gap: 10px;
}

.settings-role-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  max-width: 420px;
  margin-bottom: 10px;
}

.settings-role-form input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

.settings-role-form button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #062221;
  cursor: pointer;
  font-weight: 800;
}

.settings-role-message {
  margin: 0 0 16px;
}

.settings-role-members li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-role-members button {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.settings-role-assign {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.settings-role-assign select {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

.settings-role-assign button,
.settings-role-delete {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-role-delete {
  margin-top: 10px;
  border-color: rgba(255, 120, 120, 0.35);
  color: #ffb4b4;
}

.settings-channel-item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.settings-channel-item strong {
  display: block;
  margin-bottom: 2px;
}

.settings-channel-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-channel-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.settings-channel-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-channel-actions button:hover {
  border-color: var(--teal);
  color: var(--text);
}

.settings-role-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.settings-role-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.settings-role-count {
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-role-members {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.84rem;
}

.voice-status-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--line);
}

.account-form-compact {
  gap: 6px;
}

.account-form-compact input {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.78rem;
}

.account-form-compact button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #062221;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.account-message {
  margin: 0;
  font-size: 0.74rem;
}

.nav-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav-section-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.nav-section-chevron {
  width: 14px;
  height: 14px;
  transition: transform 140ms ease;
}

.nav-section.collapsed .nav-section-chevron {
  transform: rotate(-90deg);
}

.nav-section.collapsed .nav-list {
  display: none;
}

.nav-section-dms {
  margin-top: 0;
  height: 100%;
  padding: 0 4px 12px;
}

#directSidebar .nav-item small {
  display: block;
}

.member-roster-section {
  display: grid;
  gap: 8px;
  align-content: start;
  margin-top: 0;
  padding: 12px 10px;
}

.member-roster {
  display: grid;
  gap: 10px;
  align-content: start;
  max-height: min(62vh, 520px);
  overflow-y: auto;
}

.member-roster-group {
  display: grid;
  gap: 4px;
}

.member-roster-group-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 2px 2px 4px;
  background: var(--sidebar);
}

.member-roster-group-header h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.member-roster-count {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.64rem;
  font-weight: 700;
}

.member-roster-group-list {
  display: grid;
  gap: 6px;
}

.member-roster-subgroup {
  display: grid;
  gap: 2px;
}

.member-roster-subgroup-label {
  margin: 0;
  padding: 0 2px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.member-roster-subgroup-list {
  display: grid;
  gap: 1px;
}

.member-roster-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 3px 6px;
  border-radius: 6px;
}

.member-roster-item:hover {
  background: var(--panel-strong);
}

.member-roster-avatar {
  position: relative;
  display: inline-flex;
}

.member-roster-avatar .avatar {
  width: 30px;
  height: 30px;
  font-size: 0.72rem;
}

.member-roster-avatar .status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border-width: 1.5px;
}

.member-roster-body {
  display: flex;
  gap: 4px;
  align-items: baseline;
  min-width: 0;
}

.member-roster-body strong {
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-roster-status {
  overflow: hidden;
  flex: 1;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-roster-status::before {
  content: "·";
  margin-right: 4px;
  color: rgba(255, 255, 255, 0.28);
}

.member-roster-message {
  min-height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
}

.member-roster-item:hover .member-roster-message,
.member-roster-message:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.member-roster-message:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--sidebar);
  border-radius: 999px;
  background: #7bd88f;
}

.status-dot-online {
  background: #7bd88f;
}

.status-dot-idle {
  background: #f9a03f;
}

.status-dot-dnd {
  background: #f07178;
}

.status-dot-invisible,
.status-dot-offline,
.status-dot-disabled {
  background: #6b7280;
}

.voice-user-info {
  display: flex;
  flex: 1;
  gap: 0.45rem;
  align-items: center;
  min-width: 0;
}

.voice-user-status-dot-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.voice-user-status-dot-button:hover .status-dot {
  transform: scale(1.08);
}

.voice-user-status-dot-button:focus-visible {
  outline: 2px solid rgba(107, 212, 208, 0.85);
  outline-offset: 2px;
}

.voice-user-status-dot-button .status-dot {
  transition: transform 120ms ease;
}

.voice-user-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
}

.voice-user-avatar.speaking {
  box-shadow: 0 0 0 2px rgba(240, 178, 50, 0.85);
}

.voice-user-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-user-status {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-status-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 14;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.98);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
}

.status-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.status-preset {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
}

.status-preset:hover,
.status-preset.active {
  border-color: var(--teal);
  color: var(--text);
}

.status-message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.status-message-form input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

.status-message-form button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #062221;
  cursor: pointer;
  font-weight: 800;
}

.voice-user-bar {
  position: relative;
}

.right-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
  border-right: 0;
  border-left: 1px solid var(--line);
  background: var(--sidebar);
}

.right-panel .nav-section {
  display: grid;
  align-content: start;
  min-height: 0;
  margin-top: 0;
}

.right-panel .nav-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.right-panel .nav-item {
  min-height: 42px;
  padding: 8px 10px;
}

.sidebar-scroll .nav-item {
  min-height: 30px;
  padding: 5px 8px;
  gap: 0;
}

.sidebar-scroll .nav-item small {
  display: none;
}

.nav-list {
  display: grid;
  gap: 3px;
}

.nav-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px;
  border-radius: 6px;
}

.nav-item-row-draggable {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.nav-item-drag-handle {
  cursor: grab;
  padding: 0 2px 0 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  letter-spacing: -0.08em;
  user-select: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.nav-item-row-draggable:hover .nav-item-drag-handle,
.nav-item-row-draggable:focus-within .nav-item-drag-handle,
.nav-item-row.dragging .nav-item-drag-handle {
  opacity: 0.65;
}

.nav-item-drag-handle:active {
  cursor: grabbing;
}

.nav-item-row.dragging {
  opacity: 0.55;
}

.nav-item-row:hover,
.nav-item-row:focus-within {
  background: var(--panel-strong);
}

.nav-item-row .nav-item {
  min-width: 0;
}

.nav-item-row .nav-item:hover,
.nav-item-row .nav-item.active {
  background: transparent;
}

.nav-item-actions {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  padding-right: 4px;
  opacity: 0;
  pointer-events: none;
}

.nav-item-row:hover .nav-item-actions,
.nav-item-row:focus-within .nav-item-actions {
  opacity: 1;
  pointer-events: auto;
}

.nav-item-row-voice {
  align-items: start;
}

.voice-channel-occupants {
  display: grid;
  gap: 2px;
  grid-column: 1 / -1;
  padding: 0 6px 6px 28px;
}

.voice-channel-occupant {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  text-align: left;
}

.voice-channel-occupant:disabled {
  cursor: default;
  opacity: 0.92;
}

.voice-channel-occupant:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.06);
}

.voice-channel-occupant-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.58rem;
  font-weight: 700;
}

.voice-channel-occupant-name {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-user-volume-popover {
  position: fixed;
  z-index: 46;
  display: grid;
  gap: 8px;
  width: min(240px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.98);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
}

.voice-user-volume-popover.hidden {
  display: none;
}

.voice-user-volume-name {
  margin: 0;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-participant-interactive {
  cursor: pointer;
}

.voice-participant-interactive:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item-action {
  min-width: 24px;
  min-height: 22px;
  padding: 0 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.nav-item-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.nav-item-action-danger:hover {
  color: var(--rose);
}

.nav-item-voice-toggle {
  min-width: 22px;
  padding: 0;
  font-size: 0.92rem;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  background: var(--panel-strong);
  color: var(--text);
}

.nav-item-voice-live .nav-item-title::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(120, 210, 138, 0.22);
  flex-shrink: 0;
}

.nav-item {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.nav-item small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.unread-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.channel-panel.hidden {
  display: none;
}

.channel-panel {
  display: grid;
  gap: 10px;
}

.channel-form,
.channel-manage-list {
  display: grid;
  gap: 8px;
}

.checkbox-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.channel-manage-item {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 6px;
  background: var(--panel-strong);
}

.channel-manage-item small {
  display: block;
  color: var(--muted);
}

.channel-manage-actions,
.member-actions {
  display: flex;
  gap: 6px;
}

.typing-indicator {
  margin: 0;
  padding: 0 22px 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.typing-indicator.hidden {
  display: none;
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.message-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0 8px;
}

.message-actions button:hover {
  border-color: var(--teal);
  color: var(--text);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
}

.chat-header {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 76px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.header-action-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  padding: 0 12px;
  white-space: nowrap;
}

.header-action-button:hover {
  border-color: var(--teal);
}

.header-action-button.hidden {
  display: none;
}

.topic {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 22px;
}

.message {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--amber);
  color: #1e1603;
  font-weight: 800;
}

.message-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
}

.author {
  font-weight: 750;
}

.time {
  color: var(--muted);
  font-size: 0.82rem;
}

.content {
  margin: 0;
  color: #dce4ed;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.composer.hidden {
  display: none;
}

.voice-screen-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 0.55rem;
  padding: 0.75rem 22px 0;
}

.voice-screen-stage.hidden {
  display: none;
}

.voice-screen-tile {
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.voice-screen-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.voice-screen-video {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: #0b0f14;
  object-fit: contain;
  transform: translateZ(0);
}

.voice-panel {
  display: grid;
  flex-shrink: 0;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.voice-panel.hidden {
  display: none;
}

.voice-panel-drawer {
  display: grid;
  gap: 0.35rem;
  max-height: 140px;
  padding: 0.45rem 0.5rem;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.96);
}

.voice-panel-drawer.hidden {
  display: none;
}

.voice-panel-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.3rem 0.35rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.88);
}

.voice-panel-header {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.voice-panel-info {
  display: flex;
  flex: 1;
  gap: 0.35rem;
  align-items: center;
  min-width: 0;
}

.voice-panel-title-wrap {
  display: grid;
  gap: 0;
  min-width: 0;
}

.voice-panel-info strong {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-panel-status-text {
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.58rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-connection-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.voice-connection-dot.ready {
  background: #43b581;
  box-shadow: 0 0 0 2px rgba(67, 181, 129, 0.25);
}

.voice-connection-dot.live {
  background: #f0b232;
  box-shadow: 0 0 0 2px rgba(240, 178, 50, 0.28);
  animation: voice-dot-pulse 1.4s ease-in-out infinite;
}

.voice-connection-dot.muted {
  background: #ed4245;
  box-shadow: 0 0 0 2px rgba(237, 66, 69, 0.28);
}

.voice-connection-dot.sharing {
  background: #5865f2;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.32);
}

.voice-connection-dot.deafened {
  background: #ed4245;
  box-shadow: 0 0 0 2px rgba(237, 66, 69, 0.28);
}

@keyframes voice-dot-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

.voice-toolbar {
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 0.18rem;
  align-items: center;
  justify-content: flex-end;
}

.voice-btn {
  border: 0;
  border-radius: 50%;
  min-height: 34px;
  padding: 0;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition:
    background 120ms ease,
    color 120ms ease,
    transform 90ms ease,
    box-shadow 120ms ease;
}

.voice-btn.hidden {
  display: none;
}

.voice-btn-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
}

.voice-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.voice-icon.hidden {
  display: none;
}

.voice-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.voice-btn:active {
  transform: scale(0.9);
}

.voice-btn:focus-visible {
  outline: 2px solid rgba(107, 212, 208, 0.85);
  outline-offset: 2px;
}

.voice-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.voice-btn-join {
  background: rgba(67, 181, 129, 0.28);
  color: #d7ffe8;
}

.voice-btn-join:hover {
  background: rgba(67, 181, 129, 0.42);
}

.voice-btn-join:not(:disabled) {
  animation: voice-join-glow 2.4s ease-in-out infinite;
}

@keyframes voice-join-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(67, 181, 129, 0);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(67, 181, 129, 0.18);
  }
}

.voice-btn-active {
  background: rgba(237, 66, 69, 0.34);
  color: #ffe3e4;
  box-shadow: inset 0 0 0 1px rgba(237, 66, 69, 0.45);
}

.voice-btn-active:hover {
  background: rgba(237, 66, 69, 0.46);
}

.voice-btn-sharing {
  background: rgba(88, 101, 242, 0.34);
  color: #e4e7ff;
  box-shadow: inset 0 0 0 1px rgba(88, 101, 242, 0.45);
}

.voice-btn-sharing:hover {
  background: rgba(88, 101, 242, 0.48);
}

.voice-btn-camera-active {
  background: rgba(59, 165, 93, 0.34);
  color: #d7ffe3;
  box-shadow: inset 0 0 0 1px rgba(59, 165, 93, 0.55);
}

.voice-btn-camera-active:hover {
  background: rgba(59, 165, 93, 0.48);
}

.voice-camera-preview {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  width: min(240px, 32vw);
  overflow: hidden;
  border: 1px solid rgba(59, 165, 93, 0.35);
  border-radius: 10px;
  background: rgba(12, 16, 22, 0.94);
  box-shadow: 0 10px 32px rgb(0 0 0 / 0.45);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.voice-camera-preview.is-expanded {
  z-index: 45;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  cursor: default;
}

.voice-camera-preview.hidden {
  display: none;
}

.voice-camera-preview.is-dragging {
  cursor: grabbing;
}

.voice-camera-preview-handle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  background: rgba(59, 165, 93, 0.18);
}

.voice-camera-preview-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.voice-camera-preview-control:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.voice-camera-preview-control-icon {
  width: 14px;
  height: 14px;
}

.voice-camera-preview-control-icon.hidden {
  display: none;
}

.voice-camera-preview-label {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-camera-preview-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0f14;
  object-fit: cover;
  pointer-events: none;
}

.voice-camera-preview.is-expanded .voice-camera-preview-video {
  flex: 1;
  width: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

.voice-camera-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.55rem;
  padding: 0.75rem 22px 0;
}

.voice-camera-stage.hidden {
  display: none;
}

.voice-camera-tile {
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(59, 165, 93, 0.18);
}

.voice-camera-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.voice-camera-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: #0b0f14;
  object-fit: cover;
  transform: translateZ(0);
}

.voice-btn-danger:hover {
  background: rgba(237, 66, 69, 0.34);
  color: #ffe3e4;
}

.voice-panel-card.hidden {
  display: none;
}

.voice-user-bar {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.88);
}

.voice-user-info {
  flex: 1;
  min-width: 0;
}

.voice-user-bar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.25rem;
  align-items: center;
}

.voice-audio-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 0.25rem;
  align-items: center;
}

.voice-audio-control {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  overflow: visible;
}

.voice-audio-icon-button,
.voice-audio-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.voice-audio-icon-button {
  width: 28px;
  height: 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.voice-audio-menu-button {
  width: 18px;
  height: 28px;
}

.voice-audio-icon-button:hover,
.voice-audio-menu-button:hover,
.voice-audio-menu-button[aria-expanded="true"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.voice-audio-icon-button.is-active,
.voice-audio-icon-button.is-active:hover {
  color: #ed4245;
}

.voice-audio-icon-button.is-active .voice-audio-icon-off {
  color: #ed4245;
}

.voice-audio-icon {
  width: 14px;
  height: 14px;
}

.voice-audio-chevron {
  width: 12px;
  height: 12px;
  transition: transform 140ms ease;
}

.voice-audio-menu-button[aria-expanded="true"] .voice-audio-chevron {
  transform: rotate(180deg);
}

.voice-audio-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 15;
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.98);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
}

.voice-audio-menu .voice-select {
  width: 100%;
}

.voice-audio-menu .voice-pill {
  justify-self: start;
}

.voice-volume-control {
  display: grid;
  gap: 4px;
}

.voice-volume-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.voice-volume-slider {
  width: 100%;
  accent-color: var(--teal);
}

.voice-audio-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.voice-audio-toggle input {
  accent-color: var(--teal);
}

.voice-keybind-setting {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.voice-keybind-label {
  font-size: 0.92rem;
  font-weight: 600;
}

.voice-keybind-button {
  min-width: 72px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.voice-keybind-button:hover,
.voice-keybind-button.is-capturing {
  border-color: var(--teal);
  color: var(--teal);
}

.voice-audio-test-button {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.voice-audio-test-button:hover:not(:disabled) {
  background: rgba(107, 212, 208, 0.12);
  border-color: rgba(107, 212, 208, 0.28);
}

.voice-audio-test-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.voice-user-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.voice-user-meta strong {
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-user-role {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-btn-settings[aria-expanded="true"] {
  background: rgba(107, 212, 208, 0.22);
  color: #d7fffd;
  box-shadow: inset 0 0 0 1px rgba(107, 212, 208, 0.35);
}

.voice-btn-flash {
  animation: voice-btn-flash 320ms ease;
}

@keyframes voice-btn-flash {
  0% {
    transform: scale(0.9);
  }

  45% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

.voice-device-panel {
  display: grid;
  gap: 0.45rem;
}

.voice-device {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  align-items: center;
}

.voice-device-label {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.voice-select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.25rem 0.35rem;
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  font-size: 0.76rem;
}

.voice-meter-compact {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.voice-meter-inline {
  width: 100%;
  height: 3px;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.voice-meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #43b581;
  transition: width 80ms linear;
}

.voice-meter-fill.active {
  background: #f0b232;
}

.voice-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.2rem;
  padding: 0 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  white-space: nowrap;
}

.voice-pill-ready {
  background: rgba(67, 181, 129, 0.18);
  color: #9be7c4;
}

.voice-pill-live {
  background: rgba(240, 178, 50, 0.2);
  color: #ffe2a1;
}

.voice-pill-muted {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.62);
}

.voice-pill-alert {
  background: rgba(237, 66, 69, 0.2);
  color: #ffb4b6;
}

.voice-participants-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-height: 0;
}

.voice-participant {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 180px;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.74rem;
}

.voice-participant .avatar {
  width: 22px;
  height: 22px;
  font-size: 0.62rem;
}

.voice-participant .avatar.speaking {
  box-shadow: 0 0 0 2px rgba(240, 178, 50, 0.85);
}

.voice-participant-body {
  min-width: 0;
}

.voice-participant-body strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 600;
}

.voice-participant-status {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.64rem;
}

.voice-placeholder {
  display: grid;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.composer {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--line);
}

.composer-main {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  --composer-control-height: 44px;
}

.composer-send-button {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: calc(var(--composer-control-height) * 1.5);
  min-width: calc(var(--composer-control-height) * 1.5);
  min-height: var(--composer-control-height);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #062221;
  cursor: pointer;
}

.composer-send-button:hover {
  filter: brightness(1.06);
}

.composer-send-button:focus-visible {
  outline: 2px solid rgba(107, 212, 208, 0.85);
  outline-offset: 2px;
}

.composer-send-icon {
  width: 20px;
  height: 20px;
}

.composer-toolbar {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
  align-items: center;
}

.composer-tool-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.composer-tool-button-gif {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.composer-tool-button:hover,
.composer-tool-button[aria-expanded="true"] {
  border-color: var(--teal);
}

.composer-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}

.composer input {
  width: 100%;
  height: var(--composer-control-height);
  min-height: var(--composer-control-height);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151a22;
  color: var(--text);
  outline: none;
  padding: 0 14px;
  line-height: 1.2;
}

.composer-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 12;
  display: grid;
  gap: 8px;
  max-height: min(320px, 42vh);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.98);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
  overflow: hidden;
}

.composer-picker-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.composer-picker-tab {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.composer-picker-tab.active,
.composer-picker-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.composer-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  overflow-y: auto;
}

.composer-emoji-button {
  min-height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 1.15rem;
}

.composer-emoji-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.composer-picker-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.composer-picker-search input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

.composer-picker-search button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #062221;
  cursor: pointer;
  font-weight: 800;
}

.composer-picker-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.composer-picker-gifs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  overflow-y: auto;
}

.composer-gif-button {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--panel);
}

.composer-gif-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message .content img.message-gif {
  display: block;
  max-width: min(320px, 100%);
  margin-top: 6px;
  border-radius: 8px;
}

.composer input:focus {
  border-color: var(--teal);
}

.detail-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.member-list {
  display: grid;
  gap: 10px;
}

.member {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.member-status,
.member-email {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.member-email {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 8px;
}

.member button:hover {
  border-color: var(--rose);
  color: var(--text);
}

.invite-panel.hidden,
.audit-panel.hidden,
.channel-panel.hidden {
  display: none;
}

.invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.account-form {
  display: grid;
  gap: 8px;
}

.invite-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.invite-help {
  margin: 0 0 10px;
}

.auth-invite-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(107, 212, 208, 0.35);
  border-radius: 8px;
  background: rgba(107, 212, 208, 0.08);
  color: var(--text);
}

.invite-code {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-strong);
}

.invite-code-body {
  display: grid;
  flex: 1;
  gap: 6px;
  min-width: 0;
}

.invite-link-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.78rem;
}

.invite-code-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
}

.invite-code-actions button,
.invite-code button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.settings-danger-card {
  border: 1px solid rgba(226, 119, 122, 0.35);
}

.settings-danger-button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: rgba(226, 119, 122, 0.18);
  color: #ffb4b6;
  cursor: pointer;
  font-weight: 700;
}

.settings-danger-button:hover {
  background: rgba(226, 119, 122, 0.28);
}

.permission-group {
  margin-top: 10px;
}

.permission-group-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.permission-list {
  display: grid;
  gap: 4px;
}

.permission-item {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  color: var(--text);
  font-size: 0.82rem;
}

.permission-save-button {
  margin-top: 10px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(107, 212, 208, 0.12);
  color: var(--teal);
  cursor: pointer;
  font-weight: 700;
}

.settings-role-card-everyone {
  margin-bottom: 14px;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-event {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: var(--panel-strong);
}

.audit-event strong {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.35;
}

.audit-event span,
.empty-detail {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.empty-detail {
  margin: 0;
}

.empty-state {
  margin: auto;
  color: var(--muted);
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 64px 240px minmax(0, 1fr);
  }

  .right-panel {
    display: none;
  }

  .app-shell.workspace-direct .right-panel {
    display: none;
  }

  .app-shell.workspace-direct #serverSidebar {
    display: none;
  }

  .app-shell.workspace-direct #directSidebar {
    display: block;
  }

  .app-shell:not(.workspace-direct) #directSidebar {
    display: none;
  }

  .right-panel.open {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    width: min(360px, calc(100vw - 64px));
    box-shadow: -24px 0 48px rgb(0 0 0 / 0.28);
  }

  .settings-page-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .settings-page-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-page-nav-item {
    white-space: nowrap;
    font-size: 0.78rem;
  }
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .auth-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .chat-header {
    align-items: flex-start;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .topic {
    text-align: left;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-action-button {
    flex: 1;
  }

  .right-panel.open {
    width: calc(100vw - 56px);
  }
}
