﻿/* =========================================================
   DESIGN TOKENS
========================================================= */
:root {
  --bg-primary:       #11161c;
  --bg-secondary:     #171e26;
  --bg-tertiary:      #0b0f14;
  --bg-input:         #202a34;
  --bg-hover:         rgba(255,255,255,0.075);
  --bg-active:        rgba(255,138,61,0.16);
  --bg-msg-hover:     rgba(255,255,255,0.035);
  --text-primary:     #eef3f6;
  --text-secondary:   #aebbc7;
  --text-muted:       #687684;
  --icon-muted-strong:#91a1af;
  --accent:           #ff7a3d;
  --accent-hover:     #ff9b63;
  --accent-glow:      rgba(255, 122, 61, 0.42);
  --danger:           #e0475f;
  --danger-hover:     #bc3348;
  --success:          #35b893;
  --warning:          #f0bd4a;
  --owner-color:      #ffbd4a;
  --admin-color:      #ff5f6f;
  --separator:        rgba(255,255,255,0.085);
  --white:            #ffffff;
  --bg-modifier-accent: rgba(255,138,61,0.1);
  --bg-glass:         rgba(12, 16, 21, 0.82);
  --brand-ember:      #ff7a3d;
  --brand-flame:      #e93f5c;
  --brand-gold:       #ffc857;
  --brand-teal:       #35d0ba;
  --gradient-brand:   linear-gradient(135deg, #ff7a3d 0%, #e93f5c 48%, #35d0ba 100%);
  --gradient-brand-subtle: linear-gradient(135deg, rgba(255,122,61,0.18) 0%, rgba(233,63,92,0.1) 52%, rgba(53,208,186,0.12) 100%);
  --shadow-low:       0 1px 3px rgba(0,0,0,0.42);
  --shadow-mid:       0 8px 24px rgba(0,0,0,0.44);
  --shadow-high:      0 18px 56px rgba(0,0,0,0.62);
  --shadow-glow:      0 0 22px rgba(255, 122, 61, 0.26);
  --radius-sm:        4px;
  --radius-md:        8px;
  --radius-lg:        12px;
  --transition:       0.12s ease;
  --layout-channel-sidebar-width: 240px;
  --layout-member-sidebar-width: 240px;
  --layout-voice-stream-sidebar-width: 320px;
  --layout-stream-viewer-sidebar-width: 280px;
  --firebird-native-safe-area-top: 0px;
  --firebird-native-safe-area-right: 0px;
  --firebird-native-safe-area-bottom: 0px;
  --firebird-native-safe-area-left: 0px;
  --app-safe-area-top: max(var(--firebird-native-safe-area-top), var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  --app-safe-area-right: max(var(--firebird-native-safe-area-right), var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
  --app-safe-area-bottom: max(var(--firebird-native-safe-area-bottom), var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  --app-safe-area-left: max(var(--firebird-native-safe-area-left), var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body, html {
  height: 100%;
  min-height: -webkit-fill-available;
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.375;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ui-icon {
  width: 1em;
  height: 1em;
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  line-height: 1;
  flex-shrink: 0;
}

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,122,61,0.035), transparent 18%),
    linear-gradient(180deg, #121820, #0c1016);
}

/* =========================================================
   KEYFRAMES
========================================================= */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes slideUp {
  from { transform: translateY(24px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toastIn {
  from { transform: translateX(calc(100% + 32px)); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; max-height: 80px; }
  to   { transform: translateX(calc(100% + 32px)); opacity: 0; max-height: 0; }
}

@keyframes jumpHighlight {
  0%, 100% { background: transparent; }
  25%, 75%  { background: rgba(255, 122, 61, 0.25); }
}

/* =========================================================
   SERVER BAR
========================================================= */
#server-bar {
  width: 72px; min-width: 72px;
  background:
    linear-gradient(180deg, rgba(255,122,61,0.08), transparent 22%),
    #090d12;
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  border-right: 1px solid rgba(255,255,255,0.055);
}
#server-bar::-webkit-scrollbar { display: none; }

.server-icon-wrap {
  position: relative; display: flex; align-items: center;
  margin-bottom: 8px; width: 72px; justify-content: center;
}

.server-pill {
  position: absolute; left: 0; width: 4px;
  background: var(--white);
  border-radius: 0 4px 4px 0;
  box-shadow: 2px 0 8px rgba(255,255,255,0.3);
  transition: height 0.15s ease; height: 0;
  top: 50%; transform: translateY(-50%);
}
.server-icon-wrap:hover .server-pill { height: 20px; }
.server-icon-wrap.active .server-pill { height: 40px; }

.server-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: #161f29;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-weight: 700; font-size: 17px;
  color: var(--text-primary);
  transition: border-radius 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0; user-select: none;
}
.server-icon:hover {
  border-radius: 30%;
  background: var(--gradient-brand);
  color: var(--white);
  transform: scale(1.02);
  box-shadow: 0 0 0 2px rgba(255,122,61,0.35);
}
.server-icon-wrap.active .server-icon {
  border-radius: 30%;
  background: var(--gradient-brand);
  color: var(--white);
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-glow);
}

.server-bar-sep {
  width: 32px; height: 2px; background: var(--separator);
  border-radius: 1px; margin: 4px auto 12px;
}

.server-action {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-secondary); margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 22px; color: var(--success);
  transition: border-radius 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.server-action:hover {
  border-radius: 30%;
  background: var(--gradient-brand);
  color: var(--white);
  transform: scale(1.02);
}

/* =========================================================
   CHANNEL SIDEBAR
========================================================= */
#channel-sidebar {
  width: var(--layout-channel-sidebar-width); min-width: var(--layout-channel-sidebar-width);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 18%),
    var(--bg-secondary);
  display: flex; flex-direction: column; overflow: hidden;
  min-height: 0;
  border-right: 1px solid rgba(255,255,255,0.055);
}

#server-header {
  height: 48px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.075);
  cursor: pointer; flex-shrink: 0; position: relative;
  transition: background var(--transition);
}
/* Gradient hover overlay â€” must be a sibling of the dropdown, not overflow:hidden parent */
#server-header::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-brand-subtle);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
#server-header:hover::before { opacity: 1; }
#server-header:hover { background: var(--bg-hover); }

#server-header-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-header-chevron {
  flex-shrink: 0;
  color: var(--text-secondary);
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.server-dropdown {
  position: absolute; top: 48px; left: 0; right: 0;
  background: var(--bg-tertiary);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200; padding: 6px; display: none;
}
.server-dropdown.open { display: block; }

.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 14px;
  transition: background var(--transition), color var(--transition);
}
.dropdown-item:hover { background: var(--accent); color: var(--white); }
.dropdown-item.danger:hover { background: var(--danger); }
.dropdown-sep { height: 1px; background: var(--separator); margin: 4px 0; }

#channel-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 4px;
  scrollbar-width: thin; scrollbar-color: var(--bg-tertiary) transparent;
}

.channel-section { margin-bottom: 4px; }

.channel-section-header {
  display: flex; align-items: center;
  padding: 16px 6px 4px 6px;
}
.channel-section-header:hover .channel-add-btn { opacity: 1; }

.channel-section-title {
  flex: 1; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary);
}

.channel-add-btn {
  opacity: 0; color: var(--text-secondary); font-size: 16px; line-height: 1;
  padding: 0 2px; border-radius: 3px; cursor: pointer;
  transition: opacity var(--transition), color var(--transition);
}
.channel-add-btn:hover { color: var(--text-primary); }

.channel {
  display: flex; align-items: center; padding: 5px 6px 5px 8px; border-radius: 4px;
  cursor: pointer; color: var(--text-secondary); position: relative;
  gap: 6px; margin-bottom: 1px;
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
  border-left: 2px solid transparent;
}
.channel:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.channel[draggable="true"] {
  cursor: grab;
}
.channel.dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.channel.active {
  background: var(--bg-active);
  color: var(--white);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}
.channel.voice-connected:not(.active) {
  color: #b8f7c8;
}
.channel.voice-connected .channel-icon {
  color: var(--success);
}
.channel:hover .channel-delete-btn { opacity: 1; }

.channel-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
  width: 18px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.channel-name { flex: 1; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.channel-mention-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-secondary);
  flex-shrink: 0;
}

.channel-delete-btn {
  opacity: 0; font-size: 14px; color: var(--text-secondary);
  cursor: pointer; padding: 2px 4px; border-radius: 3px;
  transition: opacity var(--transition), color var(--transition); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.channel-delete-btn:hover { color: var(--danger); }

/* Voice sub-members under channel */
.vc-members-list { padding-left: 28px; }
.voice-channel-children { margin: 1px 0 4px; }
.voice-sidechat-action {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
}
.voice-sidechat-action:hover,
.voice-sidechat-action.active {
  background: var(--bg-active);
  color: var(--white);
}
.voice-sidechat-action.unread:not(.active) {
  color: var(--text-primary);
}
.voice-sidechat-action.unread::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-primary);
  position: absolute;
  right: 3px;
  top: 3px;
}
.voice-sidechat-action.has-mentions::after { display: none; }
.voice-sidechat-mention-badge {
  position: absolute;
  right: -3px;
  top: -3px;
  min-width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-secondary);
}
.voice-drop-target.drop-enabled { transition: background var(--transition), box-shadow var(--transition), border-color var(--transition); }
.voice-drop-target.drag-over {
  background: rgba(255,122,61,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,122,61,0.45);
}

.vc-member-row {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 4px; border-radius: 3px; font-size: 13px;
  color: var(--text-secondary); margin-bottom: 2px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.vc-member-row:hover { background: rgba(255,255,255,0.05); }
.vc-member-row.server-muted { color: var(--text-primary); }
.vc-member-row.server-deafened { background: rgba(237,66,69,0.08); }
.vc-member-row.channel-deafened { background: rgba(240,177,50,0.08); }
.vc-member-row.can-drag { cursor: grab; }
.vc-member-row.dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.vc-mini-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; flex-shrink: 0;
  transition: box-shadow 0.15s, transform 0.15s, opacity 0.15s;
  border: none;
  background-size: cover;
  background-position: center;
  color: #fff;
}
.vc-member-row.speaking .vc-mini-avatar { box-shadow: 0 0 0 2px var(--success); }
.vc-profile-trigger {
  background: none;
  padding: 0;
  cursor: pointer;
}
.vc-profile-trigger:hover { transform: translateY(-1px); }
.vc-member-name {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: none; background: none; padding: 0; text-align: left;
  color: inherit; font: inherit; cursor: pointer;
}
.vc-member-name:hover { color: var(--white); }
.vc-self-sidechat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,122,61,0.24);
  background: rgba(255,122,61,0.08);
  color: #d8deff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.15s;
}
.vc-self-sidechat-btn .ui-icon {
  pointer-events: none;
}
.vc-self-sidechat-btn:hover,
.vc-self-sidechat-btn.active {
  background: rgba(255,122,61,0.2);
  border-color: rgba(255,122,61,0.46);
  color: var(--white);
  transform: translateY(-1px);
}
.vc-sidechat-tooltip {
  position: fixed;
  z-index: 1200;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(14, 15, 18, 0.96);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 26px rgba(0,0,0,0.34);
  pointer-events: none;
  white-space: nowrap;
}
.vc-state-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.vc-mute-icon { font-size: 11px; color: var(--danger); flex-shrink: 0; }
.vc-deafen-icon { color: #f0b132; }
.vc-channel-deafen-icon { color: #f0b132; }
.vc-drag-preview {
  position: fixed;
  top: -1000px;
  left: -1000px;
  pointer-events: none;
  background: rgba(30, 31, 34, 0.97);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 32px rgba(0,0,0,0.45);
}
.vc-inline-mute-btn {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; border: 1px solid rgba(255,122,61,0.3);
  background: rgba(255,122,61,0.08);
  color: var(--accent);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 0.15s;
  flex-shrink: 0;
  padding: 0;
  position: relative;
  z-index: 2;
}
.vc-inline-mute-btn .ui-icon { pointer-events: none; }
.vc-inline-mute-btn:hover {
  background: rgba(255,122,61,0.18);
  border-color: rgba(255,122,61,0.55);
  color: var(--white);
  transform: translateY(-1px);
}
.vc-inline-mute-btn.active {
  background: rgba(237,66,69,0.16);
  border-color: rgba(237,66,69,0.35);
  color: var(--danger);
}
.vc-inline-mute-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}
.vc-live-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 2px 8px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(237,66,69,0.18);
  border: 1px solid rgba(237,66,69,0.34);
  color: #ffd8d9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* User panel */
#user-panel {
  background: var(--bg-tertiary); padding: 8px;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  cursor: pointer;
  min-width: 0;
  min-height: 48px;
}

.user-panel-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  overflow: hidden; cursor: pointer;
  background-size: cover; background-position: center;
}

.user-panel-info { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.user-panel-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-panel-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: auto;
}

.user-panel-btn {
  width: 32px; height: 32px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--icon-muted-strong); font-size: 18px;
  transition: background var(--transition), color var(--transition);
  flex: 0 0 32px;
}
.user-panel-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.user-panel-btn.muted { color: var(--danger); }

/* VC status bar */
#vc-status-bar {
  background: linear-gradient(135deg, #2a2c31 0%, #313338 100%);
  padding: 6px 10px;
  flex-shrink: 0; display: none;
  border-top: 1px solid var(--bg-tertiary);
  position: relative;
  overflow: visible;
}
#vc-status-bar.visible { display: block; }
.vc-status-name { font-size: 12px; font-weight: 700; color: var(--success); }
.vc-status-room { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.vc-status-room-link {
  cursor: pointer;
  transition: color var(--transition);
}
.vc-status-room-link:hover { color: var(--white); }
.vc-status-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 4px;
  width: 100%;
}
.vc-streams-list,
.stream-viewer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vc-action-btn {
  min-width: 0;
  padding: 4px 6px; border-radius: 4px;
  background: transparent; border: none;
  color: var(--text-secondary); font-size: 17px; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.vc-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.vc-action-btn.muted  { color: var(--danger); background: rgba(237,66,69,0.15); }
.vc-action-btn.active { color: var(--danger); background: rgba(237,66,69,0.15); }
.vc-action-btn.is-open { color: var(--white); background: rgba(255,122,61,0.16); }
.vc-options-btn { padding-inline: 4px; }
.vc-options-panel {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 8px);
  z-index: 50;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(35,38,46,0.98), rgba(24,26,31,0.98));
  box-shadow: 0 18px 42px rgba(0,0,0,0.42);
  color: var(--text-primary);
}
.vc-options-header,
.vc-options-section-title,
.vc-options-slider-label,
.vc-options-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vc-options-header { margin-bottom: 10px; }
.vc-options-title { font-size: 13px; font-weight: 800; }
.vc-options-subtitle,
.vc-options-toggle-row small,
.vc-options-empty,
.vc-soundboard-meta {
  color: var(--text-muted);
  font-size: 11px;
}
.vc-options-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.vc-options-close:hover { color: var(--text-primary); }
.vc-options-toggle-row {
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.vc-options-toggle-row span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.vc-options-slider-row {
  padding: 10px 0 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.vc-options-slider-label {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.vc-options-slider-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.vc-options-section {
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.vc-options-section-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
}
.vc-options-mini-btn {
  padding: 3px 8px !important;
  font-size: 11px !important;
}
.vc-soundboard-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}
.vc-soundboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
.vc-soundboard-item:hover {
  border-color: rgba(255,122,61,0.42);
  background: rgba(255,122,61,0.14);
}
.vc-soundboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}
.vc-options-empty {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}

.screen-share-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.16);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition), transform 0.12s ease;
}
.screen-share-card:hover,
.screen-share-card.is-active {
  border-color: rgba(255,122,61,0.36);
  background: rgba(255,122,61,0.12);
  transform: translateY(-1px);
}
.screen-share-card.is-primary {
  border-color: rgba(53,208,186,0.4);
  background: linear-gradient(135deg, rgba(255,122,61,0.14), rgba(53,208,186,0.14));
  box-shadow: inset 0 0 0 1px rgba(53,208,186,0.12);
}
.screen-share-card.is-local {
  border-color: rgba(237,66,69,0.28);
  background: linear-gradient(135deg, rgba(237,66,69,0.12), rgba(0,0,0,0.18));
}
.screen-share-card-hero {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,122,61,0.14);
  color: #d7ddff;
}
.screen-share-card-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.screen-share-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-share-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.screen-share-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.screen-share-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.screen-share-card-badge.is-preview {
  background: rgba(255,122,61,0.14);
  border-color: rgba(255,122,61,0.22);
  color: #cbd2ff;
}
.screen-share-card-badge.is-muted {
  color: #f4c86a;
  border-color: rgba(240,178,50,0.24);
  background: rgba(240,178,50,0.12);
}
.screen-share-card-badge.is-premium {
  color: #ffd59b;
  border-color: rgba(250,166,26,0.24);
  background: rgba(250,166,26,0.14);
}
.screen-share-card-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.screen-share-card.is-local .screen-share-card-action {
  color: #ffb3b5;
}
.screen-share-empty {
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.screen-share-watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  width: 100%;
  min-height: 0;
}
.screen-share-watch-grid.hidden {
  display: none;
}
.screen-share-watch-tile {
  min-height: 220px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(8, 9, 12, 0.86);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.screen-share-watch-tile.is-primary {
  border-color: rgba(53,208,186,0.42);
  box-shadow: 0 0 0 1px rgba(53,208,186,0.18);
}
.screen-share-watch-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}
.screen-share-watch-tile-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.screen-share-watch-tile-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-share-watch-tile-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-share-watch-tile-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.screen-share-watch-tile-focus,
.screen-share-watch-tile-close,
.screen-share-watch-tile-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.screen-share-watch-tile-focus,
.screen-share-watch-tile-close {
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.screen-share-watch-tile-focus:hover,
.screen-share-watch-tile-close:hover {
  background: rgba(255,122,61,0.16);
  border-color: rgba(255,122,61,0.28);
  color: var(--white);
}
.screen-share-watch-tile-pill {
  color: #ffd0ef;
  border-color: rgba(53,208,186,0.28);
  background: rgba(53,208,186,0.16);
}
.screen-share-watch-tile-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
}
.screen-share-watch-tile-status {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  max-width: calc(100% - 24px);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.56);
  border: 1px solid rgba(255,255,255,0.08);
  color: #f3f4f9;
  font-size: 11px;
  font-weight: 700;
}
.screen-share-watch-tile video {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: contain;
  background: #000;
}
.screen-share-watch-tile video.visible {
  display: block;
}

.voice-stream-workspace {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 76px 24px 24px;
  z-index: 780;
}
.voice-stream-workspace.visible { display: flex; }
.voice-stream-workspace-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(7,9,13,0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}
.voice-stream-workspace-shell {
  position: relative;
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 100px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(16,17,22,0.92), rgba(24,26,32,0.94));
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
  backdrop-filter: blur(14px);
  z-index: 1;
}
.voice-stream-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.voice-stream-workspace-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.voice-stream-workspace-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.voice-stream-workspace-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.01em;
}
.voice-stream-workspace-channel {
  font-size: 12px;
  color: var(--text-secondary);
}
.voice-stream-workspace-count {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  white-space: nowrap;
}
.voice-stream-workspace-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.voice-stream-workspace-close-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.16);
  color: var(--white);
}
.voice-stream-workspace-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 6px minmax(240px, var(--layout-voice-stream-sidebar-width));
  gap: 10px;
  min-height: 320px;
}
.voice-stream-stage-panel,
.voice-stream-sidebar {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  min-height: 0;
}
.voice-stream-stage-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.voice-stream-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.voice-stream-stage-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.voice-stream-stage-source {
  font-size: 15px;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-stream-stage-owner {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-stream-stage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.voice-stream-stage-btn {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.voice-stream-stage-btn:hover {
  background: rgba(255,122,61,0.14);
  border-color: rgba(255,122,61,0.28);
  color: var(--white);
}
.voice-stream-stage-body {
  position: relative;
  min-height: 280px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.22));
}
.voice-stream-stage-status {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
#voice-stream-stage-grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
#voice-stream-stage-video {
  display: none;
  width: 100%;
  flex: 1;
  min-height: 260px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #000;
  object-fit: contain;
}
#voice-stream-stage-video.visible { display: block; }
.voice-stream-sidebar {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}
.voice-stream-sidebar-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.voice-stream-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
}

/* =========================================================
   MAIN CONTENT
========================================================= */
#main-content {
  flex: 1; display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), transparent 160px),
    var(--bg-primary);
  overflow: hidden; min-width: 0;
}
body.voice-guest-mode #left-panel,
body.voice-guest-mode #member-sidebar,
body.voice-guest-mode #member-sidebar-resize {
  display: none !important;
}
body.voice-guest-mode #main-content {
  width: 100%;
}
#main-chat-host,
#text-chat-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

/* â”€â”€ Channel header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#channel-header {
  height: 48px; padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.075);
  box-shadow: 0 1px 0 rgba(0,0,0,0.32), 0 8px 24px rgba(0,0,0,0.14);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; font-weight: 700; font-size: 15px;
  z-index: 10; position: relative;
  background: rgba(17,22,28,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
/* Subtle gradient line at the very bottom */
#channel-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,122,61,0.34), rgba(53,208,186,0.24), transparent);
  pointer-events: none;
}

.voice-call-banner {
  min-height: 48px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  background: #151b21;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  position: relative;
  z-index: 9;
  animation: voice-call-banner-enter 150ms ease-out;
}
.voice-call-banner.hidden { display: none; }
.voice-call-banner-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.voice-call-banner-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(35,165,90,0.14);
}
.voice-call-banner[data-state="connecting"] .voice-call-banner-indicator,
.voice-call-banner[data-state="reconnecting"] .voice-call-banner-indicator {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(240,177,50,0.14);
  animation: voice-call-indicator-pulse 1.1s ease-in-out infinite;
}
.voice-call-banner[data-state="disconnecting"] .voice-call-banner-indicator,
.voice-call-banner[data-state="error"] .voice-call-banner-indicator {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(237,66,69,0.14);
}
.voice-call-banner-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.voice-call-banner-status {
  flex: 0 0 auto;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 750;
}
.voice-call-banner-room {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-call-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.voice-call-banner-action {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.045);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}
.voice-call-banner-action:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.voice-call-banner-action:active { transform: scale(0.95); }
.voice-call-banner-action.active {
  color: #fff;
  background: rgba(237,66,69,0.2);
  border-color: rgba(237,66,69,0.34);
}
.voice-call-banner-action:disabled { opacity: 0.42; cursor: default; transform: none; }
.voice-call-banner-leave {
  width: 42px;
  color: #fff;
  background: var(--danger);
  border-color: transparent;
}
.voice-call-banner-leave:hover { background: #f05255; color: #fff; }

.vc-member-row.disconnecting {
  opacity: 0.65;
  pointer-events: none;
}
.vc-disconnecting-icon .ui-icon {
  animation: voice-control-spin 0.8s linear infinite;
}

@keyframes voice-control-spin {
  to { transform: rotate(360deg); }
}

@keyframes voice-call-banner-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes voice-call-indicator-pulse {
  0%, 100% { transform: scale(0.82); opacity: 0.72; }
  50% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
  .voice-call-banner {
    min-height: 56px;
    padding: 7px max(8px, var(--app-safe-area-right)) 7px max(8px, var(--app-safe-area-left));
    gap: 6px;
    position: fixed;
    top: var(--app-safe-area-top);
    left: var(--app-safe-area-left);
    right: var(--app-safe-area-right);
    z-index: 1100;
  }
  body.voice-call-active #main-content { padding-top: 56px; }
  body.voice-call-active #left-panel,
  body.voice-call-active #member-sidebar {
    top: calc(var(--app-safe-area-top) + 56px);
    height: calc(100vh - var(--app-safe-area-top) - var(--app-safe-area-bottom) - 56px);
    height: calc(100dvh - var(--app-safe-area-top) - var(--app-safe-area-bottom) - 56px);
  }
  body.voice-call-active #mobile-backdrop { top: calc(var(--app-safe-area-top) + 56px); }
  body.voice-call-active .admin-panel-overlay {
    top: calc(var(--app-safe-area-top) + 56px);
  }
  .voice-call-banner-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
  .voice-call-banner-status { font-size: 12px; }
  .voice-call-banner-room { max-width: min(42vw, 180px); font-size: 11px; }
  .voice-call-banner-action { width: 40px; height: 40px; }
  .voice-call-banner-leave { width: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-call-banner,
  .voice-call-banner-indicator,
  .chat-connection-status-indicator {
    animation: none !important;
  }
  .voice-call-banner-action { transition: none; }
  .vc-disconnecting-icon .ui-icon { animation: none; }
}
#channel-header-icon {
  color: var(--icon-muted-strong); font-size: 20px; line-height: 1; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
}
#channel-header-name {
  color: var(--text-primary); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.voice-header-live-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(237,66,69,0.16);
  border: 1px solid rgba(237,66,69,0.32);
  color: #ffdfe0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.voice-room-view {
  flex: 1;
  min-height: 0;
  padding: 18px;
  background:
    radial-gradient(circle at top, rgba(255,122,61,0.14), transparent 42%),
    linear-gradient(180deg, #131418, #0c0d10);
}
.voice-room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  height: 100%;
  min-height: 0;
}
.voice-room-view.has-aside-chat .voice-room-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}
.voice-room-stage-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.voice-room-stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.voice-room-stage-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.voice-room-stage-label {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
}
.voice-room-stage-meta {
  font-size: 13px;
  color: var(--text-secondary);
}
.voice-room-stage-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.voice-room-stage-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.voice-room-stage-action-btn:hover,
.voice-room-stage-action-btn.active {
  background: rgba(255,122,61,0.18);
  border-color: rgba(255,122,61,0.3);
  color: var(--white);
}
.voice-room-stage-action-btn.is-danger {
  border-color: rgba(237,66,69,0.32);
  background: rgba(237,66,69,0.12);
  color: #ffb3b5;
}
.voice-room-stage-action-btn.is-danger:hover {
  border-color: rgba(237,66,69,0.5);
  background: rgba(237,66,69,0.2);
  color: #fff;
}
.voice-room-stage-status {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  max-width: 320px;
  white-space: normal;
}
.voice-room-stage-body {
  position: relative;
  flex: 1;
  min-height: 360px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02)),
    rgba(11,12,16,0.9);
  overflow: hidden;
}
.voice-room-stage-empty,
.voice-room-stage-grid {
  width: 100%;
  height: 100%;
}
.voice-room-stage-empty > .screen-share-watch-grid {
  height: 100%;
  padding: 18px;
  overflow: auto;
}
.voice-room-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  padding: 18px;
}
#voice-room-stage-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: none;
}
#voice-room-stage-video.visible { display: block; }
.voice-room-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 32px;
}
.voice-room-stream-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.voice-room-stream-empty {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 12px;
  background: rgba(255,255,255,0.03);
}
.voice-room-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.voice-room-member-grid.has-stage {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}
.voice-room-member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 180px;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)),
    rgba(20,21,27,0.95);
  color: var(--text-primary);
  cursor: default;
  text-align: left;
  overflow: hidden;
  transition: transform 0.14s ease, border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.voice-room-member-card.is-live,
.voice-room-member-card[data-voice-room-watch] {
  cursor: pointer;
}
.voice-room-member-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.12);
}
.voice-room-member-card.speaking {
  border-color: rgba(59,165,92,0.45);
  box-shadow: 0 0 0 1px rgba(59,165,92,0.2), 0 16px 30px rgba(0,0,0,0.22);
}
.voice-room-member-card.speaking .voice-room-member-avatar {
  box-shadow: 0 0 0 4px rgba(59,165,92,0.18), 0 18px 36px rgba(0,0,0,0.22);
}
.voice-room-member-card.is-active {
  border-color: rgba(255,122,61,0.44);
  box-shadow: 0 0 0 1px rgba(255,122,61,0.24), 0 16px 30px rgba(0,0,0,0.22);
}
.voice-room-member-card--stage {
  min-height: 244px;
}
.voice-room-member-card--strip {
  min-width: 220px;
  flex: 0 0 220px;
  min-height: 150px;
}
.voice-room-member-face {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.18), transparent 44%),
    linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.28));
}
.voice-room-member-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 18px 36px rgba(0,0,0,0.22);
}
.voice-room-member-card--strip .voice-room-member-avatar {
  width: 64px;
  height: 64px;
  font-size: 22px;
}
.voice-room-member-speaking-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(59,165,92,0.18);
  border: 1px solid rgba(59,165,92,0.3);
  color: #d8ffe2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.voice-room-member-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(11,12,16,0.05), rgba(11,12,16,0.36));
}
.voice-room-member-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.voice-room-member-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-room-member-status {
  font-size: 13px;
  color: var(--text-secondary);
}
.voice-room-member-footer-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.voice-room-live-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(237,66,69,0.16);
  border: 1px solid rgba(237,66,69,0.32);
  color: #ffd7d8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.voice-room-member-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.voice-room-sidechat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(17,18,24,0.9);
  overflow: hidden;
}
.voice-room-sidechat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.voice-room-sidechat-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--white);
}
.voice-room-sidechat-close {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  cursor: pointer;
}
.voice-room-sidechat-host {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.voice-room-sidechat-host #text-chat-shell {
  flex: 1;
  min-height: 0;
}

/* â”€â”€ Chat container â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#chat-container {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
  scroll-behavior: auto;
  background:
    linear-gradient(180deg, rgba(255,122,61,0.018), transparent 180px),
    var(--bg-primary);
}

#chat {
  flex: 1; padding: 16px 0 4px 0; display: flex; flex-direction: column;
  /* Day separator pseudo-element support */
}
.chat-connection-status {
  position: sticky;
  top: 8px;
  z-index: 3;
  align-self: center;
  min-height: 30px;
  max-width: calc(100% - 24px);
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  background: rgba(21,27,33,0.94);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  color: var(--text-secondary);
  font-size: 12px;
}
.chat-connection-status-indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--warning);
  animation: voice-call-indicator-pulse 1.1s ease-in-out infinite;
}
.chat-connection-status[data-state="warning"] .chat-connection-status-indicator {
  background: var(--danger);
  animation: none;
}

/* â”€â”€ Date dividers â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.msg-date-divider {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px 8px; pointer-events: none; user-select: none;
}
.msg-date-divider::before,
.msg-date-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--separator));
}
.msg-date-divider::after {
  background: linear-gradient(90deg, var(--separator), transparent);
}
.msg-date-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}

/* =========================================================
   MESSAGES
========================================================= */
.msg-group {
  display: flex; gap: 16px; padding: 1px 16px 1px 14px;
  position: relative;
  border-left: 2px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.msg-group:hover { background: var(--bg-msg-hover); }
.msg-group:hover .msg-actions { display: flex; }
.msg-group.first-in-block { padding-top: 16px; }
.msg-group.first-in-block:hover { border-left-color: rgba(255,122,61,0.5); }
.msg-group.continued { padding-top: 2px; }
/* Bottom spacing after each full block */
.msg-group.first-in-block + .msg-group.continued:last-child,
.msg-group:last-child { padding-bottom: 4px; }

/* â”€â”€ Avatar column â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.msg-avatar-col { width: 42px; flex-shrink: 0; padding-top: 2px; }

.msg-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; cursor: pointer; user-select: none;
  background-size: cover !important; background-position: center !important;
  transition: box-shadow var(--transition), transform var(--transition);
}
.msg-avatar:hover {
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-glow);
  transform: scale(1.06);
}

.msg-avatar-spacer { width: 42px; height: 20px; }


/* â”€â”€ Message body â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.msg-body { flex: 1; min-width: 0; }

.msg-header {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px;
  flex-wrap: wrap;
}

.msg-username {
  font-weight: 700; font-size: 15px; cursor: pointer; line-height: 1.4;
  transition: color var(--transition);
}
.msg-username:hover { text-decoration: underline; opacity: 0.9; }
.msg-username.is-superadmin { color: var(--admin-color); }
.msg-username.is-owner { color: var(--owner-color); }
.msg-username.is-admin-role { color: #00aff4; }

.msg-badge-inline {
  font-size: 13px; line-height: 1; opacity: 0.85;
  pointer-events: none; flex-shrink: 0; align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 14px; min-height: 14px;
}
.msg-badge-inline:empty { display: none; }
.bot-identity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--accent);
  opacity: 0.9;
  flex: 0 0 auto;
}
.bot-identity-badge .ui-icon {
  width: 14px;
  height: 14px;
}
.ui-badge-text,
.badge-emoji-char {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.badge-emoji-img {
  display: block;
  width: 1.1em;
  height: 1.1em;
  object-fit: contain;
  border-radius: 3px;
}
.msg-badge-inline .badge-emoji-img,
.member-badge-inline .badge-emoji-img,
.dm-badge-inline .badge-emoji-img {
  width: 14px;
  height: 14px;
}


.emoji-manage-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--bg-tertiary);
}

.msg-timestamp {
  font-size: 11px; color: var(--text-muted); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.msg-content {
  font-size: 15px; color: var(--text-primary);
  word-break: break-word; white-space: pre-wrap; line-height: 1.5;
}

.msg-link-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: min(420px, 100%);
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.035);
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.msg-link-preview:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,122,61,0.5);
  transform: translateY(-1px);
}
.msg-link-preview-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  overflow: hidden;
}
.msg-link-preview-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}
.msg-link-preview-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.msg-link-preview-title {
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-link-preview-description {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.msg-link-preview-domain {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
}

/* â”€â”€ Inline media â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.msg-content img {
  max-width: min(420px, 100%); max-height: 320px;
  border-radius: var(--radius-md); display: block; margin-top: 6px; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255,255,255,0.04);
}
.msg-content img:hover {
  transform: scale(1.015);
  box-shadow: var(--shadow-mid);
}

/* Server emoji â€” must come after .msg-content img to win specificity */
img.server-emoji {
  display: inline !important;
  width: 22px; height: 22px;
  vertical-align: -5px;
  object-fit: contain;
  border-radius: 2px;
  cursor: default;
  margin: 0 1px;
  /* Override the block-image hover */
  transform: none !important;
  box-shadow: none !important;
  border: none !important;
  max-width: unset !important;
  max-height: unset !important;
  margin-top: 0 !important;
}
/* Jumbo: emoji-only messages get bigger icons. */
img.server-emoji.jumbo {
  width: 48px !important;
  height: 48px !important;
  vertical-align: -12px;
  margin: 2px 2px;
}
.msg-content video {
  max-width: min(420px, 100%); max-height: 320px;
  border-radius: var(--radius-md); display: block; margin-top: 6px;
  border: 1px solid rgba(255,255,255,0.04);
}
.msg-video-attachment {
  position: relative;
  display: inline-block;
  max-width: min(420px, 100%);
  margin-top: 6px;
}
.msg-video-attachment-player {
  width: 100%;
  max-height: 320px;
  margin-top: 0 !important;
}
.msg-video-fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  background: rgba(20,21,25,0.86);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.92;
  transition: background var(--transition), opacity var(--transition);
}
.msg-video-fullscreen-btn:hover {
  background: rgba(20,21,25,0.96);
  opacity: 1;
}

/* â”€â”€ Edited tag â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.msg-edited-tag {
  font-size: 10px; color: var(--text-muted); margin-left: 4px;
  font-style: italic;
}

/* â”€â”€ Edit form â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.msg-edit-form { margin-top: 6px; }
.msg-edit-form.is-saving { opacity: 0.65; }
.msg-edit-textarea {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--accent); border-radius: var(--radius-md);
  padding: 10px 14px; color: var(--text-primary);
  font-size: 15px; font-family: inherit; resize: none; outline: none;
  min-height: 44px; line-height: 1.5;
  box-shadow: 0 0 0 3px rgba(255,122,61,0.15);
}
.msg-edit-hint {
  font-size: 11px; color: var(--text-muted); margin-top: 5px;
}

/* â”€â”€ Hover action toolbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.msg-actions {
  display: none; position: absolute; right: 16px; top: -18px;
  background: rgba(24, 25, 28, 0.97);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-high); z-index: 50;
  flex-direction: row;
}

.msg-action-btn {
  padding: 7px 12px; cursor: pointer; font-size: 15px; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
  transition: background var(--transition), color var(--transition);
  border-right: 1px solid rgba(255,255,255,0.05);
}
.msg-action-btn:last-child { border-right: none; }
.msg-action-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.msg-action-btn.danger:hover { background: rgba(237,66,69,0.18); color: var(--danger); }
.msg-action-btn .ui-icon { width: 16px; height: 16px; }

/* =========================================================
   TYPING INDICATOR
========================================================= */
#typing-indicator {
  min-height: 26px; height: 26px; padding: 2px 20px; font-size: 12px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  overflow: hidden; pointer-events: none;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  will-change: opacity, transform;
}

#typing-indicator.is-visible {
  opacity: 1; transform: translateY(0);
}

.typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.typing-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out;
}
#typing-indicator:not(.is-visible) .typing-dot { animation: none; }
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* =========================================================
   REPLY BAR (above chat input)
========================================================= */
/* Message highlighted as the one being replied to */
.msg-being-replied {
  background: rgba(255,122,61,0.08) !important;
  border-left: 3px solid var(--accent) !important;
  padding-left: calc(16px - 3px) !important;
  transition: background 0.15s, border-left 0.15s;
}

#reply-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px; margin: 0 16px;
  background: linear-gradient(135deg, rgba(255,122,61,0.08), rgba(53,208,186,0.04));
  border: 1px solid rgba(255,122,61,0.2);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: 13px; margin-bottom: -2px;
}
.reply-bar-icon { font-size: 15px; color: var(--accent); flex-shrink: 0; }
.reply-bar-label { color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; }
.reply-bar-author { color: var(--accent); font-weight: 700; }
.reply-bar-content {
  flex: 1; color: var(--text-muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.reply-bar-close {
  background: none; border: none; color: var(--text-muted); font-size: 16px;
  cursor: pointer; padding: 2px 4px; border-radius: 3px; flex-shrink: 0;
  transition: color var(--transition); font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.reply-bar-close:hover { color: var(--text-primary); }

/* =========================================================
   CHAT INPUT
========================================================= */
#chat-input-area {
  padding: 0 16px 20px; flex-shrink: 0;
  position: relative;
}

/* â”€â”€ Emoji autocomplete popup â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.emoji-ac-popup {
  position: absolute;
  bottom: calc(100% - 12px);
  left: 16px; right: 16px;
  background: var(--bg-floating, #18191c);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  max-height: 280px;
  overflow-y: auto;
  z-index: 200;
  padding: 4px 0;
}
.mention-ac-popup {
  max-height: 360px;
  padding: 8px;
  border-radius: 10px;
}
.mention-ac-heading {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 6px 8px;
}
.emoji-ac-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; cursor: pointer;
  transition: background 0.1s;
}
.emoji-ac-row:hover,
.emoji-ac-row.selected { background: var(--bg-hover); }
.mention-ac-row {
  min-height: 44px;
  border-radius: 5px;
  padding: 7px 8px;
}
.mention-ac-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  position: relative;
  background-size: cover;
  background-position: center;
}
.mention-ac-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--bg-floating, #18191c);
  background: var(--text-muted);
}
.mention-ac-avatar.status-online::after { background: #3ba55c; }
.mention-ac-avatar.status-idle::after { background: var(--warning); }
.mention-ac-avatar.status-dnd::after { background: var(--danger); }
.mention-ac-avatar.status-invisible::after,
.mention-ac-avatar.status-offline::after { background: var(--text-muted); }
.mention-ac-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.mention-ac-name {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mention-ac-handle,
.mention-ac-right {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}
.mention-ac-right {
  margin-left: auto;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emoji-ac-img {
  width: 24px; height: 24px; object-fit: contain;
  border-radius: 3px; flex-shrink: 0;
}
.emoji-ac-char {
  font-size: 20px; line-height: 1; flex-shrink: 0;
  width: 24px; text-align: center;
}
.emoji-ac-name {
  font-size: 13px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emoji-ac-source {
  margin-left: auto;
  max-width: 34%;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emoji-picker-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(100% - 10px);
  z-index: 220;
  height: min(430px, 68vh);
  background: rgba(12,16,21,0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  box-shadow: var(--shadow-high);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.emoji-picker-top {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.075);
}
.emoji-picker-search {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  padding: 0 12px;
  outline: none;
}
.emoji-picker-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,122,61,0.16);
}
.emoji-picker-layout {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
}
.emoji-picker-body {
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}
.emoji-picker-preview {
  border-left: 1px solid rgba(255,255,255,0.075);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: rgba(255,255,255,0.018);
}
.emoji-picker-preview-face {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.045);
  color: var(--accent);
  font-size: 38px;
}
.emoji-picker-preview-img {
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
}
.emoji-picker-preview-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.emoji-picker-preview-source {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}
.emoji-picker-section { margin-bottom: 14px; }
.emoji-picker-section-title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px 2px;
}
.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
}
.emoji-picker-tile {
  min-width: 0;
  height: 72px;
  border: 1px solid rgba(255,255,255,0.065);
  background: rgba(255,255,255,0.026);
  color: var(--text-primary);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font: inherit;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.emoji-picker-tile:hover,
.emoji-picker-tile:focus {
  background: rgba(255,122,61,0.12);
  border-color: rgba(255,122,61,0.38);
  transform: translateY(-1px);
  outline: none;
}
.emoji-picker-face {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
  font-size: 24px;
  line-height: 1;
}
.emoji-picker-tile-name,
.emoji-picker-tile-source {
  max-width: 100%;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emoji-picker-tile-name {
  font-size: 12px;
  font-weight: 700;
}
.emoji-picker-tile-source {
  color: var(--text-muted);
  font-size: 10px;
}
.emoji-picker-empty,
.emoji-picker-loading {
  color: var(--text-muted);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
}
#chat-input-area::before {
  content: ''; position: absolute;
  top: -32px; left: 0; right: 0; height: 32px;
  background: linear-gradient(to bottom, transparent, var(--bg-primary));
  pointer-events: none; z-index: 1;
}

#chat-input-box {
  background: var(--bg-input); border-radius: var(--radius-md);
  display: flex; align-items: flex-end; padding: 0 8px 0 4px;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: border-color var(--transition), box-shadow var(--transition);
}
#chat-input-box:focus-within {
  border-color: rgba(255,122,61,0.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25), 0 0 0 2px rgba(255,122,61,0.15);
}

.input-icon-btn {
  width: 40px; height: 48px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--icon-muted-strong); border-radius: 6px; font-size: 20px;
  flex-shrink: 0;
  transition: color var(--transition), transform var(--transition);
  border: 0;
  background: transparent;
  font: inherit;
}
.input-icon-btn:hover { color: var(--accent); transform: scale(1.1); }

#message {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-size: 15px; font-family: inherit;
  padding: 14px 8px; min-width: 0; line-height: 1.5;
  min-height: 48px; height: auto;
  resize: none; max-height: 200px; overflow-y: auto;
  display: block;
}
#message::placeholder { color: var(--text-muted); }
#image-upload { display: none; }
#send-btn { display: none; }

/* â”€â”€ Scroll-down button â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#scroll-down-btn {
  position: sticky; bottom: 16px; align-self: flex-end;
  margin: 0 20px 4px auto;
  background: var(--bg-secondary);
  border: 1px solid rgba(255,122,61,0.3);
  color: var(--text-primary);
  border-radius: 20px; padding: 6px 16px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,122,61,0.2);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  z-index: 10; display: flex; align-items: center; gap: 6px;
}
#scroll-down-btn:hover {
  background: var(--accent); border-color: transparent;
  box-shadow: 0 4px 20px rgba(255,122,61,0.5);
  transform: translateY(-2px);
}

/* =========================================================
   MEMBER SIDEBAR
========================================================= */
#member-sidebar {
  width: var(--layout-member-sidebar-width); min-width: var(--layout-member-sidebar-width);
  background:
    linear-gradient(180deg, rgba(53,208,186,0.045), transparent 170px),
    var(--bg-secondary);
  padding: 0 8px 16px 8px; overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--bg-tertiary) transparent;
  border-left: 1px solid rgba(255,255,255,0.055);
}

.member-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-secondary);
  padding: 16px 8px 4px 8px;
}

.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px; border-radius: 4px; cursor: pointer;
  transition: background var(--transition); margin-bottom: 1px;
  position: relative; overflow: hidden;
}
.member-row:hover { background: var(--bg-hover); }

/* Sidebar decoration â€” pseudo-element behind content */
.member-row.has-decoration::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--decoration-url);
  background-size: auto 100%;
  background-position: right center;
  background-repeat: no-repeat;
  opacity: 0.9;
  mask-image: linear-gradient(to right, transparent 15%, black 55%);
  -webkit-mask-image: linear-gradient(to right, transparent 15%, black 55%);
  pointer-events: none;
  z-index: 0;
}
.member-row.has-decoration > * { position: relative; z-index: 1; }

.member-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0; position: relative;
  transition: box-shadow 0.15s;
}
.member-avatar.speaking { box-shadow: 0 0 0 2px var(--success); }

.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.member-name.is-superadmin { color: var(--admin-color); }
.member-name.is-owner { color: var(--owner-color); }
.member-name.is-admin-role { color: #00aff4; }
.member-badge-inline,
.dm-badge-inline {
  font-size: 12px;
  opacity: 0.85;
  pointer-events: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  min-height: 14px;
}
.member-badge-inline:empty,
.dm-badge-inline:empty { display: none; }
.dm-badge-inline { margin-left: 3px; }

/* Premium name glow â€” uses currentColor so it matches role/superadmin/owner color */
.name-glow {
  text-shadow: 0 0 6px currentColor, 0 0 14px currentColor;
}
.member-subname {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2; margin-top: 1px;
}

.member-icons { display: flex; gap: 2px; flex-shrink: 0; }
.member-icon {
  font-size: 14px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}
.member-icon.muted { color: var(--danger); }

/* =========================================================
   MODALS
========================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; animation: fadeIn 0.1s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md); padding: 24px;
  width: 460px; max-width: 94vw;
  max-height: min(92vh, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: var(--shadow-high); animation: slideUp 0.18s ease;
  overflow: hidden;
  position: relative;
}
.modal::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--gradient-brand);
  position: absolute;
  top: 0; left: 0; right: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* Structured modal variant â€” used by new modals that have header/body divs */
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: -24px -24px 0; padding: 18px 24px 16px;
  border-bottom: 1px solid var(--separator);
  flex: 0 0 auto;
}
.modal-header h3 {
  font-size: 18px; font-weight: 800; color: var(--white); margin: 0;
  display: inline-flex; align-items: center; gap: 8px;
}
.modal-close {
  background: none; border: none; color: var(--icon-muted-strong);
  font-size: 22px; cursor: pointer; padding: 0 2px; line-height: 1;
  transition: color var(--transition); font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--white); }
.modal-body {
  margin: 0 -24px -24px;
  padding: 20px 24px 24px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}

.modal-title { font-size: 20px; font-weight: 800; color: var(--white); margin-bottom: 6px; }
.modal-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

.modal-label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-secondary); margin-bottom: 8px;
}

.modal-input {
  width: 100%; background: var(--bg-tertiary); border: 1px solid var(--separator);
  border-radius: 4px; padding: 10px 12px; color: var(--text-primary);
  font-size: 15px; font-family: inherit; outline: none; margin-bottom: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,122,61,0.2);
}

.modal-channel-type { display: flex; gap: 8px; margin-bottom: 20px; }

.modal-type-opt {
  flex: 1; padding: 10px 14px; border-radius: 4px;
  border: 2px solid var(--separator); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.modal-type-opt.selected { border-color: var(--accent); background: rgba(255,122,61,0.1); }

.modal-code-display {
  background: var(--bg-tertiary); border: 1px solid var(--separator);
  border-radius: 4px; padding: 12px 16px; font-size: 24px; font-weight: 700;
  letter-spacing: 0.12em; text-align: center; color: var(--white);
  margin-bottom: 8px; cursor: pointer;
}
.modal-code-hint { font-size: 12px; color: var(--text-secondary); text-align: center; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.media-lightbox-overlay {
  padding: 20px;
  background: rgba(0,0,0,0.82);
}
.media-lightbox {
  width: min(96vw, 1100px);
  max-height: 92vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.media-lightbox img {
  max-width: 100%;
  max-height: calc(92vh - 68px);
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.media-lightbox video {
  width: 100%;
  max-height: calc(92vh - 68px);
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  background: #000;
}
.media-lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(20,21,25,0.94);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.media-lightbox-actions {
  min-height: 28px;
}
.media-lightbox-link {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.media-lightbox-link:hover {
  color: var(--white);
  text-decoration: underline;
}

.btn {
  padding: 9px 20px; border-radius: 6px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 500; font-family: inherit;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:active { transform: scale(0.98); }
.btn-ghost { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { text-decoration: underline; }
.btn-primary {
  background: var(--gradient-brand);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(255,122,61,0.4);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255,122,61,0.55);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.98) translateY(0); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 14px rgba(237,66,69,0.45);
}

/* =========================================================
   LANDING PAGE
========================================================= */
#landing {
  position: fixed; inset: 0;
  background:
    linear-gradient(135deg, rgba(255,122,61,0.13) 0%, transparent 32%),
    linear-gradient(315deg, rgba(53,208,186,0.12) 0%, transparent 34%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 24px),
    #0b0f14;
  display: none; align-items: center; justify-content: center; z-index: 10;
  box-sizing: border-box;
  overflow-y: auto;
  padding: max(16px, var(--app-safe-area-top)) max(12px, var(--app-safe-area-right)) max(16px, var(--app-safe-area-bottom)) max(12px, var(--app-safe-area-left));
}

.landing-box {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 32px 40px;
  width: 480px; max-width: 95vw;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
}

.landing-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: block;
  object-fit: cover;
  background: #090d12;
  box-shadow: 0 14px 34px rgba(255,122,61,0.22), inset 0 0 0 1px rgba(255,255,255,0.18);
  flex-shrink: 0;
}

.landing-logo {
  text-align: left; font-size: 34px; font-weight: 900;
  margin-bottom: 4px; letter-spacing: 0.02em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-tagline { text-align: left; color: var(--text-secondary); font-size: 14px; margin-bottom: 0; }

.landing-tabs { display: flex; border-bottom: 2px solid var(--separator); margin-bottom: 24px; }

.landing-tab {
  flex: 1; text-align: center; padding: 10px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.landing-tab.active { color: var(--white); border-bottom-color: var(--accent); }

.landing-form { display: flex; flex-direction: column; gap: 16px; }
.landing-field { display: flex; flex-direction: column; gap: 6px; }
.landing-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.landing-input {
  background: var(--bg-tertiary); border: 1px solid var(--separator);
  border-radius: 4px; padding: 10px 12px; color: var(--text-primary);
  font-size: 15px; font-family: inherit; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.landing-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 12px rgba(255,122,61,0.2);
}

.landing-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.landing-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.landing-btn {
  padding: 11px; border-radius: 4px; border: none; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.landing-btn-primary {
  background: var(--gradient-brand);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(255,122,61,0.4);
}
.landing-btn-primary:hover {
  box-shadow: 0 6px 24px rgba(255,122,61,0.6);
  transform: scale(1.02);
}
.landing-btn-primary:active { transform: scale(0.98); }
.landing-btn-ghost { background: transparent; color: var(--text-secondary); font-size: 13px; padding: 8px; text-align: center; }
.landing-btn-ghost:hover { color: var(--text-primary); text-decoration: underline; }
.landing-btn-secondary {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-primary);
}
.landing-btn-secondary:hover {
  background: rgba(255,122,61,0.14);
  border-color: rgba(255,122,61,0.38);
}
.landing-link-btn {
  align-self: flex-start;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 0;
}
.landing-link-btn:hover { color: var(--text-primary); text-decoration: underline; }

.landing-panel-title {
  color: var(--white);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}
.landing-panel-copy {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}
.recovery-code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.recovery-code-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(0,0,0,0.22);
}
.recovery-code-number {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  background: rgba(255,122,61,0.18);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.recovery-code-item code {
  color: var(--white);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  font-weight: 800;
}
.recovery-code-input {
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.recovery-confirm-check {
  align-items: flex-start;
}

.landing-divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; }
.landing-divider::before, .landing-divider::after { content: ''; flex: 1; height: 1px; background: var(--separator); }

/* =========================================================
   TOASTS
========================================================= */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9000;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}

.toast {
  background: rgba(30, 31, 34, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg); padding: 12px 16px;
  font-size: 14px; box-shadow: var(--shadow-high);
  border-left: 4px solid var(--accent); max-width: 340px;
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-primary); line-height: 1.4;
}
.toast .ui-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 8px;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }

.toast.notification-toast {
  padding: 0;
  overflow: hidden;
  border-left: 1px solid rgba(255,122,61,0.45);
  background:
    linear-gradient(135deg, rgba(255,122,61,0.18), rgba(53,208,186,0.08)),
    rgba(30,31,34,0.96);
  box-shadow: 0 18px 45px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.05);
}
.notification-toast-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  padding: 12px 14px;
}
.notification-toast-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.notification-toast-avatar--icon {
  background: rgba(255,122,61,0.25);
  color: var(--white);
}
.notification-toast-copy {
  min-width: 0;
  flex: 1;
}
.notification-toast-title {
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notification-toast-preview {
  color: var(--text-primary);
  font-size: 13px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notification-toast-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =========================================================
   SCROLLBARS
========================================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* =========================================================
   CONTEXT MENU
========================================================= */
.ctx-menu {
  position: fixed;
  background: rgba(30, 31, 34, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.6);
  z-index: 5000;
  padding: 6px;
  min-width: 200px;
  animation: fadeIn 0.08s ease;
  user-select: none;
}

.ctx-header {
  padding: 4px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.ctx-sep { height: 1px; background: var(--separator); margin: 4px 0; }

.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: background var(--transition), color var(--transition);
}
.ctx-item:hover {
  background: linear-gradient(135deg, var(--accent), var(--brand-flame));
  color: var(--white);
}
.ctx-item.checkbox { padding-right: 12px; }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: var(--danger); color: var(--white); }
.ctx-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ctx-item.disabled:hover {
  background: transparent;
  color: inherit;
}

.ctx-item-icon { font-size: 15px; flex-shrink: 0; width: 20px; text-align: center; }
.ctx-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-muted-strong);
}
.ctx-item:hover .ctx-item-icon { color: var(--white); }
.ctx-item-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}
.ctx-item:hover .ctx-item-meta,
.ctx-item.danger:hover .ctx-item-meta { color: rgba(255,255,255,0.8); }
.ctx-item-check {
  width: 14px;
  text-align: center;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-mod-modal {
  width: min(460px, calc(100vw - 24px));
}
.server-settings-modal {
  width: min(680px, calc(100vw - 24px));
}
.server-settings-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.server-settings-section {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  padding: 14px;
}
.server-settings-section-header {
  margin-bottom: 12px;
}
.server-settings-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.server-settings-section-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
.server-settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.server-settings-action {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px;
  font: inherit;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.16);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.server-settings-action:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
}
.server-settings-action.danger {
  border-color: rgba(237,66,69,0.16);
}
.server-settings-action.danger:hover {
  background: rgba(237,66,69,0.14);
  border-color: rgba(237,66,69,0.3);
}
.server-settings-action-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.server-settings-action.danger .server-settings-action-icon {
  color: var(--danger);
}
.server-settings-action-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.server-settings-action-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.server-settings-action-description {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
.server-settings-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,122,61,0.16);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.permission-settings-modal {
  width: min(100vw - 32px, 1120px);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
}

.permission-settings-modal .modal-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.permission-settings-warning-banner {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(237, 66, 69, 0.12);
  border: 1px solid rgba(237, 66, 69, 0.24);
  color: #ffb3b5;
  font-size: 13px;
}

.permission-settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.permission-settings-tab {
  border: 1px solid var(--separator);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.permission-settings-tab:hover,
.permission-settings-tab.is-active {
  background: rgba(255, 122, 61, 0.16);
  border-color: rgba(255, 122, 61, 0.35);
  color: var(--white);
}

.permission-settings-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.permission-settings-sidebar,
.permission-settings-detail {
  background: rgba(30, 31, 34, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  min-height: 0;
}

.permission-settings-sidebar {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.permission-settings-detail {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.permission-settings-sidebar-search {
  flex-shrink: 0;
}

.permission-settings-sidebar-list,
.permission-settings-target-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}

.permission-settings-sidebar-list {
  flex: 1;
}

.permission-settings-target-list {
  flex-shrink: 0;
  max-height: min(220px, 28vh);
}

.permission-settings-sidebar-item,
.permission-settings-target-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), border-color var(--transition), transform 0.12s ease;
}

.permission-settings-sidebar-item:hover:not(:disabled),
.permission-settings-sidebar-item.is-selected,
.permission-settings-target-item:hover:not(:disabled),
.permission-settings-target-item.is-selected {
  background: rgba(255, 122, 61, 0.14);
  border-color: rgba(255, 122, 61, 0.38);
  transform: translateY(-1px);
}

.permission-settings-sidebar-item.is-disabled,
.permission-settings-target-item.is-disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.permission-settings-sidebar-item-copy,
.permission-settings-target-item-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.permission-settings-sidebar-item-title,
.permission-settings-target-item-title,
.permission-settings-detail-title,
.permission-settings-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.permission-settings-sidebar-item-meta,
.permission-settings-target-item-meta,
.permission-settings-detail-subtitle,
.permission-settings-checkbox-meta,
.permission-settings-override-meta,
.permission-settings-muted {
  font-size: 12px;
  color: var(--text-muted);
}

.permission-settings-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.permission-settings-inline-badges,
.permission-settings-role-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.permission-settings-badge,
.permission-settings-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.permission-settings-badge {
  background: rgba(255, 122, 61, 0.12);
  color: #c4cafc;
  border: 1px solid rgba(255, 122, 61, 0.25);
}

.permission-settings-chip {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.permission-settings-callout {
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(240, 178, 50, 0.1);
  border: 1px solid rgba(240, 178, 50, 0.18);
  color: #f4c86a;
  font-size: 12px;
  line-height: 1.5;
}

.permission-settings-group {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.permission-settings-group-title {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.permission-settings-group-body {
  padding: 4px 10px 10px;
}

.permission-settings-checkbox-row,
.permission-settings-override-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
}

.permission-settings-checkbox-row:hover,
.permission-settings-override-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.permission-settings-checkbox-row.is-disabled {
  opacity: 0.58;
}

.permission-settings-checkbox-copy,
.permission-settings-override-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.permission-settings-checkbox-title,
.permission-settings-override-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.permission-settings-role-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.permission-settings-override-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.permission-settings-override-btn,
.permission-settings-segment {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.permission-settings-override-btn:hover:not(:disabled),
.permission-settings-segment:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.22);
}

.permission-settings-override-btn.is-allow.is-active {
  background: rgba(59, 165, 92, 0.18);
  border-color: rgba(59, 165, 92, 0.34);
  color: #8ce0a5;
}

.permission-settings-override-btn.is-deny.is-active {
  background: rgba(237, 66, 69, 0.18);
  border-color: rgba(237, 66, 69, 0.34);
  color: #ff9c9d;
}

.permission-settings-override-btn.is-clear.is-active,
.permission-settings-segment.is-active {
  background: rgba(255, 122, 61, 0.16);
  border-color: rgba(255, 122, 61, 0.34);
  color: var(--white);
}

.permission-settings-override-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.permission-settings-target-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.permission-settings-segmented {
  display: inline-flex;
  gap: 8px;
}

.permission-settings-empty,
.permission-settings-warning {
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  font-size: 13px;
}

.permission-settings-empty {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.permission-settings-warning {
  color: #ffb3b5;
  background: rgba(237, 66, 69, 0.1);
  border: 1px solid rgba(237, 66, 69, 0.24);
}

.empty-chat-state {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 32px;
}

.app-home {
  min-height: 100%;
  padding: 28px 32px 48px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.app-home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.app-home-title-block {
  min-width: 0;
}
.app-home-kicker,
.app-home-section-title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.app-home-title-block h2 {
  margin: 4px 0 6px;
  color: var(--white);
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.app-home-meta,
.app-home-note {
  color: var(--text-secondary);
  font-size: 13px;
}
.app-home-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.app-home-action {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 7px;
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.app-home-action:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,122,61,0.45);
  transform: translateY(-1px);
}
.app-home-action-attention {
  border-color: rgba(255,122,61,0.45);
  background: rgba(255,122,61,0.12);
}
.app-home-action-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.app-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 28px;
}
.app-home-section {
  min-width: 0;
}
.app-home-downloads {
  grid-column: 1 / -1;
}
.app-home-section-title {
  margin-bottom: 10px;
}
.app-home-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-home-download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.app-home-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.065);
  background: rgba(255,255,255,0.025);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.app-home-download-card {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.065);
  background: rgba(255,255,255,0.025);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 9px 10px;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.app-home-row:hover,
.app-home-row.active,
.app-home-download-card:hover {
  background: rgba(255,122,61,0.1);
  border-color: rgba(255,122,61,0.32);
  transform: translateY(-1px);
}
.app-home-download-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-ember);
  background: rgba(255,122,61,0.12);
}
.app-home-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 15px;
  font-weight: 900;
  background-size: cover;
  background-position: center;
  position: relative;
  flex-shrink: 0;
}
.app-home-friend-avatar {
  border-radius: 50%;
}
.app-home-friend-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  background: var(--text-muted);
}
.app-home-friend-avatar.status-online::after { background: #3ba55c; }
.app-home-friend-avatar.status-idle::after { background: var(--warning); }
.app-home-friend-avatar.status-dnd::after { background: var(--danger); }
.app-home-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-home-row-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-home-row-sub {
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-home-row-action {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-home-empty {
  color: var(--text-muted);
  border: 1px dashed rgba(255,255,255,0.11);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
}

/* =========================================================
   ACCOUNT MAIL
========================================================= */
.mailbox-header-btn {
  position: relative;
}
.mailbox-header-btn.active {
  color: var(--brand-ember);
  background: rgba(255,122,61,0.12);
}
.mailbox-unread-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}
#app.mailbox-open #member-sidebar,
#app.mailbox-open #member-sidebar-resize {
  display: none !important;
}
#app.mailbox-open #chat-container {
  overflow: hidden;
}
#app.mailbox-open #chat {
  min-height: 100%;
  padding: 0;
}
.mail-workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  color: var(--text-primary);
  background: var(--bg-primary);
}
.mail-sidebar {
  min-width: 0;
  padding: 14px 10px;
  border-right: 1px solid rgba(255,255,255,0.075);
  background: rgba(255,255,255,0.018);
  overflow-y: auto;
}
.mail-compose-btn,
.mail-reply-btn,
.mail-send-btn {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #17120f;
  background: var(--brand-ember);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}
.mail-compose-btn {
  width: 100%;
  margin-bottom: 7px;
}
.mail-account-address {
  margin: 0 8px 14px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-compose-btn:hover,
.mail-reply-btn:hover,
.mail-send-btn:hover {
  filter: brightness(1.08);
}
.mail-compose-btn:disabled,
.mail-send-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.mail-folder-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mail-folder-btn {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: var(--text-secondary);
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.mail-folder-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.055);
}
.mail-folder-btn.active {
  color: var(--white);
  background: rgba(255,122,61,0.14);
}
.mail-folder-count {
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: var(--danger);
  font-size: 10px;
  font-weight: 900;
}
.mail-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mail-toolbar {
  height: 54px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid rgba(255,255,255,0.075);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.mail-toolbar h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 850;
}
.mail-toolbar-actions,
.mail-reader-action-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mail-secure-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #35d0ba;
}
.mail-icon-btn,
.mail-row-icon {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}
.mail-icon-btn:hover,
.mail-row-icon:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.065);
}
.mail-icon-btn.active,
.mail-row-icon.active {
  color: #f0b132;
}
.mail-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.mail-loading,
.mail-empty {
  min-height: 180px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.mail-list {
  display: flex;
  flex-direction: column;
}
.mail-row {
  min-height: 56px;
  padding: 6px 10px 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  display: grid;
  grid-template-columns: 34px minmax(105px, 0.34fr) minmax(180px, 1fr) 74px 34px;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.012);
  cursor: pointer;
}
.mail-row:hover,
.mail-row:focus-visible {
  outline: 0;
  background: rgba(255,255,255,0.052);
}
.mail-row.unread {
  color: var(--text-primary);
  background: rgba(255,122,61,0.055);
}
.mail-row.unread .mail-row-party,
.mail-row.unread .mail-row-subject,
.mail-row.unread .mail-row-date {
  font-weight: 850;
}
.mail-row-party,
.mail-row-subject,
.mail-row-preview,
.mail-row-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-row-party {
  color: inherit;
  font-size: 13px;
  font-weight: 700;
}
.mail-row-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.mail-row-subject {
  max-width: 48%;
  flex-shrink: 0;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
}
.mail-row-preview {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}
.mail-row-date {
  text-align: right;
  color: var(--text-muted);
  font-size: 11px;
}
.mail-reader {
  max-width: 900px;
  min-height: 100%;
  margin: 0 auto;
  padding: 14px 30px 42px;
}
.mail-reader-actions {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#mail-reader-back .ui-icon {
  transform: rotate(180deg);
}
.mail-reader-header {
  padding: 24px 0 18px;
  border-bottom: 1px solid rgba(255,255,255,0.075);
}
.mail-reader-header h3 {
  margin: 0 0 14px;
  color: var(--white);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 850;
  overflow-wrap: anywhere;
}
.mail-reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--text-muted);
  font-size: 12px;
}
.mail-reader-meta strong {
  color: var(--text-secondary);
}
.mail-reader-body {
  min-height: 160px;
  padding: 26px 0 32px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mail-reader-attachments {
  margin: -12px 0 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.mail-attachment-link {
  max-width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.035);
  font-size: 12px;
  text-decoration: none;
}
.mail-attachment-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.065);
}
.mail-attachment-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-attachment-link small {
  color: var(--text-muted);
  white-space: nowrap;
}
.mail-reply-btn {
  min-width: 96px;
  padding: 0 16px;
}
.mail-compose {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: min(520px, calc(100% - 36px));
  height: min(610px, calc(100% - 36px));
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #171c23;
  box-shadow: 0 20px 60px rgba(0,0,0,0.48);
}
.mail-compose-header {
  min-height: 46px;
  padding: 0 8px 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.055);
}
.mail-compose-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
}
.mail-compose-form {
  flex: 1;
  min-height: 0;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mail-compose-from {
  min-width: 0;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}
.mail-compose-from strong {
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-compose-form label {
  min-width: 0;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}
.mail-compose-form input,
.mail-compose-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  outline: 0;
  color: var(--text-primary);
  background: rgba(0,0,0,0.18);
  font: inherit;
  font-size: 13px;
}
.mail-compose-form input {
  height: 38px;
  padding: 0 10px;
}
.mail-compose-form textarea {
  height: 100%;
  padding: 10px;
  resize: none;
  line-height: 1.5;
}
.mail-compose-form input:focus,
.mail-compose-form textarea:focus {
  border-color: rgba(255,122,61,0.65);
}
.mail-compose-form .mail-compose-body-field {
  flex: 1;
  min-height: 120px;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 6px;
}
.mail-captcha-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 88px 34px;
  align-items: center;
  gap: 8px;
}
.mail-captcha-question {
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(53,208,186,0.22);
  border-radius: 6px;
  display: flex;
  align-items: center;
  color: #a9e8df;
  background: rgba(53,208,186,0.065);
  font-size: 13px;
  font-weight: 850;
}
.mail-compose-footer {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  justify-content: space-between;
}
.mail-compose-attachment-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mail-compose-attachments {
  min-width: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
}
.mail-compose-attachment {
  max-width: 150px;
  height: 30px;
  padding-left: 8px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.035);
  font-size: 11px;
}
.mail-compose-attachment > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-compose-attachment button {
  width: 28px;
  height: 28px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}
.mail-send-btn {
  min-width: 96px;
  padding: 0 16px;
}

@media (max-width: 720px) {
  .mail-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .mail-sidebar {
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.075);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
  }
  .mail-compose-btn {
    width: auto;
    min-width: 104px;
    margin: 0;
    padding: 0 12px;
  }
  .mail-account-address {
    display: none;
  }
  .mail-folder-nav {
    flex-direction: row;
  }
  .mail-folder-btn {
    width: auto;
    min-width: 92px;
    grid-template-columns: 18px auto auto;
    padding: 0 9px;
  }
  .mail-row {
    grid-template-columns: 30px minmax(86px, 0.42fr) minmax(120px, 1fr) 52px;
    gap: 5px;
  }
  .mail-row-preview,
  .mail-trash-btn {
    display: none;
  }
  .mail-row-copy {
    display: block;
  }
  .mail-row-subject {
    display: block;
    max-width: none;
  }
  .mail-reader {
    padding: 12px 18px 32px;
  }
  .mail-reader-header h3 {
    font-size: 19px;
  }
  .mail-compose {
    inset: 8px;
    width: auto;
    height: auto;
  }
}

@media (max-width: 480px) {
  .mail-folder-btn {
    min-width: 40px;
    grid-template-columns: 20px;
    justify-content: center;
  }
  .mail-folder-btn > span:not(.mail-folder-count) {
    display: none;
  }
  .mail-folder-count {
    position: absolute;
    margin: -22px 0 0 26px;
  }
  .mail-row {
    grid-template-columns: 30px minmax(70px, 0.38fr) minmax(90px, 1fr) 48px;
  }
  .mail-compose-form label {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .mail-captcha-row {
    grid-template-columns: minmax(110px, 1fr) 74px 34px;
  }
}

.channel-settings-modal {
  width: min(92vw, 680px);
}

.channel-settings-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.channel-settings-card {
  padding: 14px 16px;
  margin-bottom: 14px;
}

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

.channel-settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.hidden-channel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hidden-channel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--separator);
  border-radius: 10px;
  background: var(--bg-secondary);
}

.hidden-channel-copy {
  flex: 1;
  min-width: 0;
}

.hidden-channel-name {
  color: var(--text-primary);
  font-weight: 800;
}

.hidden-channel-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.voice-scope-note {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(240,177,50,0.12);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}
.voice-scope-list,
.voice-batch-list,
.voice-action-list,
.voice-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  max-height: 320px;
  overflow-y: auto;
}
.voice-scope-row,
.voice-batch-row,
.voice-action-row,
.voice-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}
.voice-scope-row:hover,
.voice-batch-row:hover,
.voice-action-row:hover {
  background: rgba(255,255,255,0.06);
}
.voice-batch-row.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.voice-scope-name,
.voice-batch-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}
.voice-batch-subtle {
  font-size: 12px;
  color: var(--text-muted);
}
.voice-scope-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}
.voice-batch-footer {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.voice-action-extra,
.voice-result-section {
  margin-top: 14px;
}
.voice-result-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.voice-result-row {
  justify-content: space-between;
  font-size: 13px;
}
.voice-result-row.success {
  border-color: rgba(35, 165, 90, 0.3);
}
.voice-result-row.error {
  border-color: rgba(237, 66, 69, 0.28);
}
.voice-scope-empty,
.voice-batch-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.user-channel-settings-modal {
  width: min(760px, calc(100vw - 24px));
  max-height: min(88vh, 840px);
  display: flex;
  flex-direction: column;
}

.user-channel-settings-handle {
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 500;
}

.user-channel-settings-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.user-channel-settings-filter {
  flex: 1;
  margin-bottom: 0 !important;
}

.user-channel-settings-version {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.user-channel-settings-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  padding-right: 4px;
}

.user-channel-settings-section,
.user-channel-settings-card {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.user-channel-settings-section {
  padding: 14px;
}

.user-channel-settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.user-channel-settings-section-title,
.user-channel-settings-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-channel-settings-section-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.user-channel-settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.user-channel-settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.05);
}

.user-channel-settings-row:hover {
  background: rgba(255,255,255,0.06);
}

.user-channel-settings-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

.user-channel-settings-meta,
.user-channel-settings-tag {
  font-size: 11px;
  font-weight: 700;
}

.user-channel-settings-meta {
  color: var(--text-muted);
}

.user-channel-settings-tag {
  color: var(--accent);
}

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

.user-channel-settings-card {
  padding: 12px;
}

.user-channel-settings-card-title {
  margin-bottom: 10px;
}

.user-channel-settings-warning {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(240,177,50,0.12);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.user-channel-settings-readiness {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.user-channel-settings-readiness.is-ready {
  background: rgba(35, 165, 90, 0.16);
  color: var(--success);
}

.user-channel-settings-readiness.is-blocked {
  background: rgba(240, 177, 50, 0.16);
  color: var(--warning);
}

.user-channel-settings-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.priority-speaker-settings-modal {
  width: min(920px, calc(100vw - 24px));
}

.priority-speaker-settings-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  max-height: min(62vh, 600px);
}

.priority-speaker-settings-sidebar,
.priority-speaker-settings-detail {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.priority-speaker-settings-sidebar {
  display: flex;
  flex-direction: column;
  padding: 14px;
  min-height: 0;
  overflow: hidden;
}

.priority-speaker-settings-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.priority-speaker-member-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.16);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.priority-speaker-member-row:hover:not(:disabled),
.priority-speaker-member-row.is-selected {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

.priority-speaker-member-row:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.priority-speaker-member-name {
  font-size: 13px;
  font-weight: 700;
}

.priority-speaker-member-handle {
  font-size: 12px;
  color: var(--text-muted);
}

.priority-speaker-member-badge {
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.priority-speaker-member-badge.is-ready {
  background: rgba(35, 165, 90, 0.16);
  color: var(--success);
}

.priority-speaker-member-badge.is-blocked {
  background: rgba(240, 177, 50, 0.16);
  color: var(--warning);
}

.priority-speaker-settings-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  min-height: 0;
  overflow-y: auto;
}

.priority-speaker-settings-user-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.priority-speaker-settings-user-handle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.priority-speaker-settings-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.priority-speaker-settings-keybinds {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.priority-speaker-settings-keybind-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.05);
}

.priority-speaker-settings-keybind-chip code {
  font-size: 12px;
}

.priority-speaker-settings-keybind-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.soundboard-settings-modal {
  max-width: 720px;
}
.soundboard-settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}
.soundboard-settings-members-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  margin-top: 12px;
}
.soundboard-settings-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
}
.soundboard-settings-member-row.is-server-disabled {
  opacity: 0.72;
}
.soundboard-settings-member-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.soundboard-settings-member-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}
.soundboard-settings-member-handle {
  color: var(--text-muted);
  font-size: 11px;
}

.vc-priority-speaker-icon {
  color: var(--accent);
}

.vc-priority-speaker-icon--inactive {
  color: var(--warning);
}

.hidden { display: none !important; }

/* =========================================================
   TIER 1-4 ADDITIONS
========================================================= */

/* SERVER ICON IMAGE */
.server-icon-img {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; display: block;
  transition: border-radius 0.15s ease;
}
.server-icon-wrap:hover .server-icon-img,
.server-icon-wrap.active .server-icon-img { border-radius: 30%; }

/* UNREAD CHANNEL INDICATOR */
.channel.unread .channel-name { font-weight: 700; color: var(--text-primary); }
.channel-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-primary); flex-shrink: 0;
}

/* CHANNEL CATEGORIES */
.channel-category { margin-bottom: 4px; }

.channel-category-header {
  display: flex; align-items: center;
  padding: 16px 6px 4px 6px; cursor: pointer;
  border-radius: 4px;
}
.channel-category-header:hover { background: var(--bg-hover); }
.channel-category-header:hover .channel-category-add { opacity: 1; }

.channel-category-chevron {
  font-size: 9px; color: var(--text-secondary); margin-right: 4px;
  transition: transform 0.15s; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.channel-category.collapsed .channel-category-chevron { transform: rotate(-90deg); }

.channel-category-title {
  flex: 1; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary);
}

.channel-category-add {
  opacity: 0; color: var(--text-secondary); font-size: 16px; line-height: 1;
  padding: 0 2px; border-radius: 3px; cursor: pointer;
  transition: opacity var(--transition), color var(--transition);
  display: inline-flex; align-items: center; justify-content: center;
}
.channel-category-add:hover { color: var(--text-primary); }
.channel-category.collapsed .channel-category-content { display: none; }
.channel-drop-active {
  outline: 1px dashed rgba(255,122,61,0.72);
  outline-offset: 2px;
  border-radius: 6px;
}

/* REACTION PILLS */
.msg-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.reaction-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.06); border: 1px solid transparent;
  border-radius: 8px; padding: 2px 8px; cursor: pointer; font-size: 13px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  user-select: none;
}
.reaction-pill:hover { background: rgba(255,255,255,0.12); }
.reaction-pill.me {
  background: rgba(255,122,61,0.2);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(255,122,61,0.35), inset 0 0 4px rgba(255,122,61,0.15);
}
.reaction-pill.me:hover { background: rgba(255,122,61,0.3); }

.reaction-count { font-size: 12px; color: var(--text-secondary); }
.reaction-pill.me .reaction-count { color: var(--accent); }

.reaction-add-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 24px;
  background: rgba(255,255,255,0.04); border: 1px solid transparent;
  border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: 600;
  color: var(--text-secondary); transition: background var(--transition), color var(--transition);
  line-height: 1;
}
.reaction-add-btn:hover { background: rgba(255,255,255,0.12); border-color: var(--separator); color: var(--text-primary); }

/* EMOJI PICKER */
.emoji-picker { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; width: 168px; }

.emoji-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; cursor: pointer; font-size: 18px;
  transition: background var(--transition);
}
.emoji-btn:hover { background: var(--bg-hover); }

/* REPLY REFERENCE (inline above message body) */
.msg-reply-ref {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 2px; padding-left: 4px;
  border-left: 2px solid var(--separator);
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  transition: border-color var(--transition);
}
.msg-reply-ref:hover { color: var(--text-secondary); border-left-color: var(--accent); }
.reply-icon { font-size: 14px; flex-shrink: 0; }
.reply-author { font-weight: 700; color: var(--text-secondary); margin-right: 2px; }
.msg-reply-ref:hover .reply-author { color: var(--text-primary); }
.reply-content {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px;
}

/* @MENTION HIGHLIGHTS */
.mention {
  display: inline-block;
  max-width: 100%;
  background: rgba(255,122,61,0.18);
  color: #ffb17f;
  border: 1px solid rgba(255,122,61,0.26);
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 700;
  line-height: 1.25;
  vertical-align: baseline;
  overflow-wrap: anywhere;
}
.mention-me {
  background: rgba(240,178,50,0.24);
  color: #ffd36a;
  border-color: rgba(240,178,50,0.38);
  box-shadow: 0 0 0 1px rgba(240,178,50,0.14), 0 0 18px rgba(240,178,50,0.08);
}

/* SCREEN SHARE */
.screen-share-modal {
  width: min(100vw - 24px, 840px);
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
}
.screen-share-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: min(68vh, 620px);
  overflow-y: auto;
}
.screen-share-section {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  padding: 14px;
}
.screen-share-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 10px;
}
.screen-share-source-grid,
.screen-share-active-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.screen-share-source-grid--tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.screen-share-source-option,
.screen-share-toggle-row,
.screen-share-active-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.12);
}
.screen-share-source-option {
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 0.12s ease;
}
.screen-share-source-option:hover,
.screen-share-source-option.is-selected {
  border-color: rgba(255,122,61,0.36);
  background: rgba(255,122,61,0.12);
  transform: translateY(-1px);
}
.screen-share-source-state {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}
.screen-share-source-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.screen-share-source-copy,
.screen-share-toggle-copy,
.screen-share-active-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.screen-share-source-title,
.screen-share-toggle-title,
.screen-share-active-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.screen-share-source-meta,
.screen-share-toggle-meta,
.screen-share-active-meta,
.screen-share-review-label {
  font-size: 12px;
  color: var(--text-muted);
}
.screen-share-toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.screen-share-toggle-row.is-disabled {
  opacity: 0.62;
}
.screen-share-nested-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.screen-share-callout {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(240,178,50,0.1);
  border: 1px solid rgba(240,178,50,0.18);
  color: #f4c86a;
  font-size: 12px;
  line-height: 1.5;
}
.screen-share-review {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.screen-share-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,0.12);
  border: 1px solid rgba(255,255,255,0.06);
}
.screen-share-review-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.screen-share-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.screen-share-toolbar-copy,
.screen-share-selected-note {
  font-size: 12px;
  color: var(--text-muted);
}
.screen-share-selected-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.screen-share-selection-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.14);
}
.screen-share-selection-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.screen-share-selection-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.screen-share-selection-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.screen-share-selection-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
}
.screen-share-selection-meta,
.screen-share-selection-warning {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.screen-share-selection-warning {
  color: #f4c86a;
}

.screen-share-runtime-modal {
  width: min(100vw - 24px, 680px);
}
.screen-share-runtime-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.screen-share-runtime-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  line-height: 1.55;
}
.screen-share-runtime-step strong {
  color: var(--white);
  font-size: 14px;
}
.screen-share-runtime-step code {
  background: rgba(0,0,0,0.24);
  border-radius: 6px;
  padding: 2px 6px;
  color: #dfe6ff;
}
.screen-share-runtime-callout {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(240,178,50,0.18);
  background: rgba(240,178,50,0.08);
  color: #f4c86a;
  font-size: 12px;
  line-height: 1.5;
}

.screen-share-native-modal {
  width: min(100vw - 24px, 1040px);
  max-height: min(92vh, 840px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
}
.screen-share-native-modal .modal-header {
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 14px;
}
.screen-share-native-modal .modal-header h3 {
  min-width: 0;
}
.screen-share-native-header-start {
  flex: 0 0 auto;
  min-width: 190px;
  margin-left: auto;
  padding-inline: 18px;
  white-space: nowrap;
}
.screen-share-native-header-start:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}
.screen-share-native-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(78vh, 760px);
  overflow-y: auto;
  padding: 14px;
  background: linear-gradient(180deg, rgba(13,14,18,0.98), rgba(17,19,24,0.99));
}
.screen-share-native-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(255,122,61,0.18), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
}
.screen-share-native-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.screen-share-native-overline {
  font-size: 11px;
  font-weight: 800;
  color: #c9d1ff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.screen-share-native-hero-copy h4 {
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.25;
}
.screen-share-native-hero-copy p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.screen-share-native-hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.screen-share-native-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
}
.screen-share-native-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.screen-share-native-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.screen-share-native-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
}
.screen-share-native-section-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.screen-share-native-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(0,0,0,0.26);
  border: 1px solid rgba(255,255,255,0.06);
}
.screen-share-native-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.12s ease;
}
.screen-share-native-tab:hover {
  color: var(--white);
  background: rgba(255,255,255,0.04);
}
.screen-share-native-tab.is-active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.08);
  color: var(--white);
}
.screen-share-native-grid-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.screen-share-native-grid-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.screen-share-native-grid-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.screen-share-native-grid-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
}
.screen-share-native-grid-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}
.screen-share-native-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.screen-share-native-refresh-btn:hover {
  background: rgba(255,122,61,0.14);
  border-color: rgba(255,122,61,0.24);
}
.screen-share-native-refresh-btn:disabled {
  cursor: default;
  opacity: 0.7;
}
.screen-share-native-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.screen-share-native-grid--screen {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.screen-share-native-grid--applications {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.screen-share-native-grid--screen .screen-share-native-card {
  aspect-ratio: 16 / 10;
}
.screen-share-native-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 0;
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #17191e;
  color: var(--text-primary);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: transform 0.14s ease, border-color var(--transition), box-shadow var(--transition);
}
.screen-share-native-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}
.screen-share-native-card.is-selected {
  border-color: rgba(255,122,61,0.42);
  box-shadow: 0 0 0 1px rgba(255,122,61,0.22), 0 14px 28px rgba(0,0,0,0.24);
}
.screen-share-native-card.is-disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}
.screen-share-native-card-preview {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #050607;
  overflow: hidden;
}
.screen-share-native-card-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.screen-share-native-card-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}
.screen-share-native-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(18,20,25,0.96), rgba(10,11,14,0.98));
}
.screen-share-native-card-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.screen-share-native-card-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-share-native-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 0;
}
.screen-share-native-card-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-share-native-card-app-icon {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.screen-share-native-card-checkbox {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8,9,12,0.72);
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
}
.screen-share-native-card-checkbox.is-checked {
  background: linear-gradient(135deg, #ff9b63, #35d0ba);
  border-color: transparent;
  color: #fff;
}
.screen-share-native-selected-list,
.screen-share-native-active-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.screen-share-native-active-card,
.screen-share-native-selected-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.14);
}
.screen-share-native-selected-card {
  position: relative;
}
.screen-share-native-selected-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.screen-share-native-selected-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.screen-share-native-selected-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.screen-share-native-active-copy,
.screen-share-native-selected-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.screen-share-native-active-title,
.screen-share-native-selected-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-share-native-active-meta,
.screen-share-native-selected-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.screen-share-native-selected-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.screen-share-native-settings-btn,
.screen-share-native-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.screen-share-native-settings-btn:hover,
.screen-share-native-remove-btn:hover,
.screen-share-native-settings-btn.is-active {
  background: rgba(255,122,61,0.14);
  border-color: rgba(255,122,61,0.24);
  color: var(--white);
}
.screen-share-native-settings-menu {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(12,13,18,0.9);
}
.screen-share-native-settings-row,
.screen-share-native-settings-column {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.screen-share-native-settings-column {
  align-items: flex-start;
  flex-direction: column;
}
.screen-share-native-settings-row span,
.screen-share-native-settings-column span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.screen-share-native-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.screen-share-native-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.screen-share-native-chip.is-active,
.screen-share-native-chip:hover {
  background: linear-gradient(135deg, rgba(107,124,255,0.22), rgba(53,208,186,0.22));
  border-color: rgba(107,124,255,0.3);
  color: #fff;
}
.screen-share-native-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.screen-share-native-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

#stream-viewer-overlay {
  position: fixed;
  display: none;
  inset: 0;
  z-index: 820;
  pointer-events: none;
}
#stream-viewer-overlay.visible { display: block; }
.stream-viewer-shell {
  position: fixed;
  min-width: 520px;
  min-height: 360px;
  background: rgba(24,25,28,0.94);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow: 0 18px 64px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
.stream-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.2);
  cursor: move;
  user-select: none;
}
.stream-viewer-header-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.stream-viewer-source {
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stream-viewer-owner,
.stream-viewer-status,
.stream-viewer-sidebar-title {
  font-size: 12px;
  color: var(--text-muted);
}
.stream-viewer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stream-viewer-close-btn,
.stream-viewer-stop-btn {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.stream-viewer-stop-btn {
  background: rgba(237,66,69,0.12);
  border-color: rgba(237,66,69,0.2);
  color: #ffb3b5;
}
.stream-viewer-close-btn:hover,
.stream-viewer-stop-btn:hover {
  border-color: rgba(255,255,255,0.18);
  color: var(--white);
}
.stream-viewer-body {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6px minmax(220px, var(--layout-stream-viewer-sidebar-width));
}
.stream-viewer-stage {
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0.14), rgba(0,0,0,0.34));
}
.stream-viewer-stage video {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 320px;
  flex: 1;
  object-fit: contain;
  background: #000;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
}
.stream-viewer-stage video.visible { display: block; }
.stream-viewer-sidebar {
  min-height: 0;
  padding: 16px;
  border-left: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  overflow-y: auto;
}
.stream-viewer-resize-handle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 18px;
  height: 18px;
  border-right: 2px solid rgba(255,255,255,0.22);
  border-bottom: 2px solid rgba(255,255,255,0.22);
  cursor: nwse-resize;
  opacity: 0.8;
}

/* =========================================================
   VIDEO CALL GRID
========================================================= */
#video-grid-overlay {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 332px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  display: none;
  z-index: 800;
  border: 1px solid var(--separator);
}
#video-grid-overlay.visible { display: block; }
#video-grid-overlay.minimized #video-tiles { display: none; }

.video-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0,0,0,0.35);
  cursor: default;
}
#video-grid-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
}
.video-grid-title-label { display: inline-flex; align-items: center; gap: 6px; }
.video-grid-btn {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 18px; padding: 0 4px; line-height: 1;
  transition: color var(--transition);
  display: inline-flex; align-items: center; justify-content: center;
}
.video-grid-btn:hover { color: var(--white); }

#video-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 2px;
  background: rgba(0,0,0,0.25);
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
}
#video-tiles.single-tile { grid-template-columns: 1fr; }

.video-tile {
  position: relative;
  background: #000;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
}
.video-tile video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Mirror local (front cam selfie view) */
.video-tile.local video { transform: scaleX(-1); }

.video-tile-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 6px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-size: 11px; font-weight: 600; color: #fff;
  pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.video-tile-flip {
  position: absolute;
  top: 5px; right: 5px;
  background: rgba(0,0,0,0.55);
  border: none; color: #fff;
  font-size: 13px; padding: 4px 7px;
  border-radius: 4px; cursor: pointer;
  transition: background var(--transition);
  line-height: 1;
}
.video-tile-flip:hover { background: rgba(0,0,0,0.85); }

@media (max-width: 768px) {
  #video-grid-overlay {
    top: 8px; right: 8px; left: 8px; width: auto;
  }
  /* On small screens keep 2-col for landscape, 1-col for portrait */
  @media (orientation: portrait) {
    #video-tiles { grid-template-columns: 1fr; }
  }
}

/* MODAL WIDE VARIANT (audit log / reports) */
.modal.wide {
  width: 600px; max-height: 80vh;
  display: flex; flex-direction: column;
}
.modal.wide .modal-scroll { flex: 1; overflow-y: auto; margin-top: 12px; }

/* AUDIT LOG ENTRIES */
.audit-entry {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--separator); font-size: 13px;
}
.audit-entry:last-child { border-bottom: none; }
.audit-actor { font-weight: 700; color: var(--text-primary); flex-shrink: 0; min-width: 80px; }
.audit-action { color: var(--text-secondary); flex: 1; }
.audit-target { color: var(--accent); font-weight: 600; }
.audit-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.audit-details { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* REPORT ENTRIES */
.report-entry { padding: 10px 0; border-bottom: 1px solid var(--separator); }
.report-entry:last-child { border-bottom: none; }
.report-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.report-content {
  background: var(--bg-tertiary); border-radius: 4px;
  padding: 8px 10px; font-size: 13px; margin-bottom: 4px;
  color: var(--text-primary); white-space: pre-wrap; word-break: break-word;
}
.report-reason { font-size: 12px; color: var(--warning); margin-bottom: 6px; }
.report-resolve-btn {
  padding: 5px 14px; background: var(--success); border: none; border-radius: 4px;
  color: var(--white); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--transition); font-family: inherit;
}
.report-resolve-btn:hover { background: #1a7d42; }

/* BAN LIST ENTRIES */
.ban-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--separator);
}
.ban-entry:last-child { border-bottom: none; }
.ban-username { flex: 1; font-weight: 700; color: var(--text-primary); font-size: 14px; }
.ban-meta { font-size: 12px; color: var(--text-muted); }
.ban-unban-btn {
  padding: 4px 12px; background: transparent; border: 1px solid var(--danger);
  border-radius: 4px; color: var(--danger); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background var(--transition), color var(--transition); font-family: inherit;
}
.ban-unban-btn:hover { background: var(--danger); color: var(--white); }

/* =========================================================
   LAYOUT WRAPPERS
========================================================= */

/* Left panel â€” transparent flex wrapper on desktop */
#left-panel { display: flex; flex-shrink: 0; min-height: 0; }

.layout-panel-toggle {
  flex-shrink: 0;
}
.layout-resize-handle,
.layout-grid-resize-handle {
  flex-shrink: 0;
  width: 6px;
  min-width: 6px;
  cursor: col-resize;
  position: relative;
  z-index: 12;
  touch-action: none;
}
.layout-grid-resize-handle {
  align-self: stretch;
  min-height: 0;
}
.layout-resize-handle::before,
.layout-grid-resize-handle::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 2px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
}
.layout-resize-handle:hover::before,
.layout-grid-resize-handle:hover::before,
body.ui-resizing .layout-resize-handle::before,
body.ui-resizing .layout-grid-resize-handle::before {
  background: rgba(255,122,61,0.75);
  box-shadow: 0 0 10px rgba(255,122,61,0.35);
}
body.ui-resizing {
  cursor: col-resize;
  user-select: none;
}
#app.channel-sidebar-collapsed #channel-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  pointer-events: none;
}
#app.channel-sidebar-collapsed #channel-sidebar-resize,
#app.member-sidebar-collapsed #member-sidebar-resize {
  display: none;
}
#app.member-sidebar-collapsed #member-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.channel-section-header,
#dm-panel > .dm-section-label {
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
}
.channel-section-header:hover,
#dm-panel > .dm-section-label:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.ui-section-chevron {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  transition: transform 0.15s ease;
}
.channel-section.is-collapsed .ui-section-chevron,
#dm-panel.dm-list-collapsed > .dm-section-label .ui-section-chevron {
  transform: rotate(-90deg);
}
.channel-section.is-collapsed > #text-channels,
.channel-section.is-collapsed > #voice-channels,
#dm-panel.dm-list-collapsed > #dm-list {
  display: none !important;
}
.voice-stream-workspace.voice-stream-sidebar-collapsed .voice-stream-workspace-body {
  grid-template-columns: minmax(0, 1fr) 0 0;
}
.voice-stream-workspace.voice-stream-sidebar-collapsed .voice-stream-sidebar,
.voice-stream-workspace.voice-stream-sidebar-collapsed #voice-stream-sidebar-resize {
  display: none;
}
.stream-viewer-shell.stream-viewer-sidebar-collapsed .stream-viewer-body {
  grid-template-columns: minmax(0, 1fr) 0 0;
}
.stream-viewer-shell.stream-viewer-sidebar-collapsed .stream-viewer-sidebar,
.stream-viewer-shell.stream-viewer-sidebar-collapsed #stream-viewer-sidebar-resize {
  display: none;
}
.settings-field-group-collapsible {
  position: relative;
}
.settings-field-group-collapsible .settings-collapse-btn {
  margin-left: 8px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--separator);
  border-radius: 7px;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.settings-field-group-collapsible .settings-collapse-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.settings-field-group-collapsible .settings-collapse-btn.active {
  transform: rotate(-90deg);
}
.settings-field-group-collapsible.is-collapsed > :not(.settings-field-group-summary):not(.settings-collapse-btn) {
  display: none !important;
}

/* Mobile navigation buttons â€” hidden on desktop */
.mobile-nav-btn {
  width: 40px; height: 40px; display: none;
  align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--text-secondary); font-size: 20px; cursor: pointer;
  border-radius: 4px; flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.mobile-nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Mobile backdrop */
#mobile-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 499;
}
#mobile-backdrop.visible { display: block; }

/* =========================================================
   TABLET  (â‰¤ 1024 px) â€” hide member sidebar behind a button
========================================================= */
@media (max-width: 1024px) {
  #member-sidebar {
    position: fixed;
    top: var(--app-safe-area-top);
    right: var(--app-safe-area-right);
    bottom: var(--app-safe-area-bottom);
    height: calc(100vh - var(--app-safe-area-top) - var(--app-safe-area-bottom));
    height: calc(100dvh - var(--app-safe-area-top) - var(--app-safe-area-bottom));
    width: 240px; min-width: 240px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 500;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
  }
  #member-sidebar.open { transform: translateX(0); }
  #app.member-sidebar-collapsed #member-sidebar {
    width: 240px !important;
    min-width: 240px !important;
    padding: 0 8px 16px 8px !important;
    opacity: 1;
    pointer-events: auto;
  }

  #mobile-members-btn { display: flex; }
  #layout-member-toggle,
  #member-sidebar-resize,
  #voice-stream-sidebar-resize {
    display: none !important;
  }

  /* Make header-name truncate when member button appears */
  #channel-header-name {
    flex: 1; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }

  .voice-stream-workspace-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .voice-stream-workspace-shell {
    width: min(1040px, calc(100vw - 40px));
    max-height: calc(100vh - 96px);
  }

  .voice-stream-sidebar {
    min-height: 220px;
  }
}

/* =========================================================
   MOBILE  (â‰¤ 768 px) â€” both panels become drawers
========================================================= */
@media (max-width: 768px) {

  /* Left panel slides in from the left */
  #left-panel {
    position: fixed;
    top: var(--app-safe-area-top);
    left: var(--app-safe-area-left);
    bottom: var(--app-safe-area-bottom);
    height: calc(100vh - var(--app-safe-area-top) - var(--app-safe-area-bottom));
    height: calc(100dvh - var(--app-safe-area-top) - var(--app-safe-area-bottom));
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 500;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  #left-panel.open { transform: translateX(0); }

  /* Keep server-bar and channel-sidebar their natural sizes inside the drawer */
  #channel-sidebar { width: 248px; min-width: 248px; }
  #app.channel-sidebar-collapsed #channel-sidebar {
    width: 248px !important;
    min-width: 248px !important;
    opacity: 1;
    pointer-events: auto;
  }

  /* Show hamburger button */
  #mobile-menu-btn { display: flex; }
  #layout-channel-toggle,
  #channel-sidebar-resize,
  #stream-viewer-sidebar-resize {
    display: none !important;
  }

  /* Main content fills full width */
  #main-content { width: 100%; }
  #server-bar,
  #channel-sidebar {
    max-height: calc(100vh - var(--app-safe-area-top) - var(--app-safe-area-bottom));
    max-height: calc(100dvh - var(--app-safe-area-top) - var(--app-safe-area-bottom));
  }
  #user-panel {
    padding-bottom: max(8px, var(--app-safe-area-bottom));
  }
  .voice-room-view { padding: 12px; }
  .voice-room-layout { grid-template-columns: 1fr; }
  .voice-room-stage-header {
    flex-direction: column;
    align-items: stretch;
  }
  .voice-room-stage-actions {
    justify-content: flex-start;
  }
  .voice-room-stage-status {
    max-width: none;
  }
  .voice-room-sidechat { min-height: 280px; }
  .voice-room-stream-strip,
  .voice-room-stage-grid { grid-template-columns: 1fr; }
  .voice-room-member-grid.has-stage {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .voice-room-member-card--strip {
    min-width: 0;
  }

  /* Channel header â€” tighter, show hamburger */
  #channel-header {
    height: calc(48px + var(--app-safe-area-top));
    padding: var(--app-safe-area-top) max(6px, var(--app-safe-area-right)) 0 max(6px, var(--app-safe-area-left));
    gap: 6px;
  }
  #channel-header-name {
    flex: 1; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
    font-size: 14px;
  }
  .voice-header-live-pill { display: none !important; }
  /* Hide gradient line on mobile â€” clutters the small header */
  #channel-header::after { display: none; }

  /* Messages â€” tighter horizontal padding on small screens */
  .msg-group { padding-left: 10px; padding-right: 10px; }
  .msg-group.first-in-block { padding-top: 14px; }

  /* Smaller avatars on mobile */
  .msg-avatar-col { width: 36px; }
  .msg-avatar, .msg-avatar-spacer { width: 36px; height: 36px; }
  .msg-avatar { font-size: 14px; }

  /* Slightly smaller message text */
  .msg-content { font-size: 14px; }
  .msg-username { font-size: 14px; }

  /* Action toolbar â€” bigger touch targets */
  .msg-action-btn { padding: 10px 14px; font-size: 16px; }
  /* Keep toolbar visible on long-press / tap hold (touch doesn't hover) */
  .msg-actions { top: -22px; right: 8px; }

  /* Images and videos fill message width */
  .msg-content img  { max-width: 100% !important; border-radius: var(--radius-sm); }
  .msg-content video { max-width: 100% !important; border-radius: var(--radius-sm); }
  .msg-video-attachment { width: 100%; }

  /* Chat input â€” full-width, safe area support */
  #chat-input-area {
    padding: 0 max(8px, var(--app-safe-area-right)) max(12px, var(--app-safe-area-bottom)) max(8px, var(--app-safe-area-left));
  }
  #chat-input-box { min-height: 44px; border-radius: var(--radius-md); }
  #message { font-size: 16px; /* Prevent iOS zoom on focus */ padding: 12px 6px; }

  /* Reply bar */
  #reply-bar { margin: 0 8px; padding: 6px 10px; }

  /* Scroll-down button */
  #scroll-down-btn { margin: 0 10px 4px auto; padding: 7px 14px; }

  /* Typing indicator tighter */
  #typing-indicator { padding: 2px 12px; font-size: 11px; }

  /* Toasts stack at bottom with safe area */
  #toast-container {
    bottom: max(80px, calc(60px + var(--app-safe-area-bottom)));
    right: 8px; left: 8px;
    align-items: stretch;
  }
  .toast { max-width: none; font-size: 13px; padding: 10px 14px; }

  /* Landing page tighter padding */
  .landing-box { padding: 24px 20px; }

  /* Stream viewer and share composer adapt to mobile */
  .voice-stream-workspace { padding: 56px 8px 8px; }
  .voice-stream-workspace-shell {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 64px);
    padding: 14px;
    border-radius: 16px;
  }
  .voice-stream-workspace-header,
  .voice-stream-stage-header,
  .screen-share-native-grid-status,
  .screen-share-native-section-header,
  .screen-share-native-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .voice-stream-stage-actions,
  .screen-share-native-hero-badges {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .voice-stream-workspace-header-actions {
    align-self: stretch;
    justify-content: space-between;
  }
  .screen-share-native-selected-card,
  .screen-share-native-active-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .screen-share-native-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .screen-share-native-selected-actions {
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .screen-share-native-tabs { flex-direction: column; }
  #stream-viewer-overlay { inset: 0; }
  .stream-viewer-shell {
    left: 8px !important;
    top: 60px !important;
    width: calc(100vw - 16px) !important;
    height: calc(100vh - 72px) !important;
    min-width: 0;
  }
  .stream-viewer-body { grid-template-columns: minmax(0, 1fr); }
  .stream-viewer-sidebar { border-left: none; border-top: 1px solid rgba(255,255,255,0.06); }
  .screen-share-native-modal,
  .screen-share-native-body { max-height: none; }
  .screen-share-native-modal .modal-header {
    flex-wrap: wrap;
  }
  .screen-share-native-modal .modal-header h3 {
    flex: 1 1 calc(100% - 44px);
  }
  .screen-share-native-header-start {
    order: 3;
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }
  .screen-share-native-modal .modal-close {
    order: 2;
    margin-left: auto;
  }

  /* Modals full-width */
  .modal { width: calc(100vw - 16px) !important; max-width: none !important; padding: 20px 16px; }

  /* Context menus limited to viewport */
  .ctx-menu { max-width: calc(100vw - 16px); }

  /* Emoji picker fits small screens */
  .emoji-picker { width: 148px; }
  .emoji-btn { width: 28px; height: 28px; font-size: 16px; }
  .emoji-picker-panel {
    left: 8px;
    right: 8px;
    height: min(390px, 70vh);
  }
  .emoji-picker-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .emoji-picker-preview {
    display: none;
  }
  .emoji-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  }
  .emoji-picker-tile {
    height: 64px;
  }
}

/* =========================================================
   ADMIN PANEL
   ========================================================= */

/* â”€â”€ Admin Panel Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-panel-modal {
  width: min(940px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-stat {
  background: var(--bg-tertiary, var(--bg-primary));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 80px;
}

.admin-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
}

.admin-payment-pane {
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.admin-payment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.admin-payment-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 10px;
  flex-shrink: 0;
}

.admin-payment-stat {
  min-width: 0;
  padding: 10px 12px;
}

.admin-payment-section-title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 4px;
}

.admin-payment-table-wrap {
  flex: 0 0 auto;
  max-height: 220px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
}

.admin-quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: -6px 0 12px;
  flex-shrink: 0;
}

.admin-docs-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* â”€â”€ Tabs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 14px;
  flex-shrink: 0;
}

.admin-tab {
  padding: 7px 18px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}

.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--text-primary); border-bottom-color: var(--brand-color, #ff7a3d); }

.admin-tab-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.admin-tab-pane.admin-payment-pane { overflow-y: auto; }

/* â”€â”€ Search / table wrap â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.apm-search {
  margin-bottom: 10px;
  flex-shrink: 0;
}

.admin-table-wrap {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.admin-user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-user-table th {
  text-align: left;
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.admin-user-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-user-table tr:last-child td { border-bottom: none; }
.admin-username { font-weight: 500; }
.apm-muted { color: var(--text-secondary); }

/* â”€â”€ Avatars â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.apm-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.apm-avatar-ph {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

/* â”€â”€ Badges â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}
.admin-badge .ui-icon { width: 12px; height: 12px; }

.admin-badge.admin {
  background: #ff7a3d22;
  color: var(--brand-flame);
}

.admin-badge.premium {
  background: #faa61a22;
  color: #faa61a;
}

.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  font-size: 12px;
  cursor: pointer;
  background: var(--bg-hover);
  color: var(--text-primary);
  transition: background .15s;
  white-space: nowrap;
}
.admin-btn .ui-icon { width: 14px; height: 14px; }

.admin-btn:hover { background: rgba(255,255,255,0.15); }
.admin-btn.danger { color: var(--danger); }
.admin-btn.danger:hover { background: #ed4245; color: #fff; }

/* â”€â”€ Expanded actions row â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.apm-act-cell {
  padding: 0 !important;
  background: rgba(0,0,0,0.18);
  border-bottom: 1px solid var(--divider) !important;
}

.apm-act-panel {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.apm-act-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.apm-act-btns { gap: 6px; }

.apm-act-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
  min-width: 90px;
  flex-shrink: 0;
}

.apm-in {
  padding: 4px 8px !important;
  font-size: 12px !important;
  margin: 0 !important;
  height: auto !important;
}

/* â”€â”€ Server channel list â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.apm-srv-ch-row .apm-act-cell { background: rgba(0,0,0,0.12); }

.apm-ch-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
}

.apm-ch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.apm-ch-row:hover { background: rgba(255,255,255,0.04); }

.apm-ch-icon {
  color: var(--text-secondary);
  font-size: 13px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
}
.apm-ch-name { flex: 1; font-weight: 500; }
.apm-ch-name-input { flex: 1; min-width: 0; }

.apm-srv-ch-wrap { padding: 0 4px 8px; }

/* â”€â”€ Audit log â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.apm-action-code {
  font-size: 11px;
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: monospace;
  white-space: nowrap;
}

.apm-load-more-wrap {
  text-align: center;
  padding: 10px 0 4px;
  flex-shrink: 0;
}

.apm-loading {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

body.admin-panel-open { overflow: hidden; }

@media (max-width: 700px) {
  .admin-panel-overlay {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .admin-panel-modal {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  body.voice-call-active .admin-panel-modal { height: 100%; }

  .admin-panel-modal::before { display: none; }

  .admin-panel-modal .modal-header {
    min-height: 52px;
    margin: calc(-1 * max(12px, env(safe-area-inset-top))) -12px 0;
    padding: max(8px, env(safe-area-inset-top)) 8px 8px 16px;
  }

  .admin-panel-modal .modal-header h2 {
    margin: 0;
    font-size: 18px;
  }

  .admin-panel-modal .modal-close {
    width: 44px;
    height: 44px;
    padding: 0;
    flex: 0 0 44px;
  }

  .admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(58px, 1fr));
    gap: 6px;
    margin: 10px 0 8px;
  }

  .admin-stat {
    min-width: 0;
    padding: 7px 4px;
  }

  .admin-stat-value { font-size: 17px; }
  .admin-stat-label { font-size: 9px; }
  .admin-quick-actions { margin: 0 0 6px; }

  .admin-tabs {
    gap: 0;
    margin: 0 0 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .admin-tabs::-webkit-scrollbar { display: none; }

  .admin-tab {
    min-width: max-content;
    min-height: 44px;
    padding: 10px 14px;
  }

  .admin-table-wrap {
    overflow: auto;
    overscroll-behavior: contain;
  }

  .admin-user-table { min-width: 720px; }
  .admin-payment-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-payment-actions { justify-content: stretch; }
  .admin-payment-actions .admin-btn { flex: 1; min-height: 40px; }
}

/* =========================================================
   NOTIFICATION BADGES
   ========================================================= */

/* Server icon wraps need relative positioning for badge overlay */
.server-icon-wrap { position: relative; }

.server-mention-badge {
  position: absolute;
  bottom: -2px; right: -4px;
  background: #ed4245;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  line-height: 1;
}

/* DM inbox icon in server bar */
.dm-inbox-icon {
  position: relative;
  font-size: 18px;
}

.dm-inbox-icon.active {
  background: var(--accent);
  color: #fff;
  border-radius: 30%;
}

.dm-inbox-badge {
  position: absolute;
  bottom: 2px; right: 2px;
  background: #ed4245;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
}

/* =========================================================
   MENTIONED MESSAGE HIGHLIGHT
   ========================================================= */

.msg-group.msg-mentioned {
  background: linear-gradient(90deg, rgba(240,178,50,0.16), rgba(240,178,50,0.045) 72%, transparent);
  border-left: 3px solid #ffd36a;
  box-shadow: inset 3px 0 0 rgba(240,178,50,0.5);
  padding-left: 13px;
  margin-left: -16px;
}

/* =========================================================
   DM PANEL
   ========================================================= */

#dm-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* When DM mode is active, hide server channel UI */
#channel-sidebar.dm-open #channel-list  { display: none !important; }
#channel-sidebar.dm-open #server-header { display: none !important; }
#channel-sidebar.dm-open #vc-status-bar { display: none !important; }
#channel-sidebar.dm-open #dm-panel      { display: flex !important; }

/* Hide the member sidebar entirely while in DM mode */
#app:has(#channel-sidebar.dm-open) #member-sidebar { display: none !important; }
#app.group-dm-open:has(#channel-sidebar.dm-open) #member-sidebar { display: flex !important; }
#app:has(#channel-sidebar.dm-open):not(.group-dm-open) #layout-member-toggle,
#app:has(#channel-sidebar.dm-open):not(.group-dm-open) #member-sidebar-resize {
  display: none !important;
}

/* Search / start conversation bar */
.dm-search-bar {
  padding: 8px 10px 6px;
  flex-shrink: 0;
}

#dm-search {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-primary);
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

#dm-search::placeholder { color: var(--text-muted, var(--text-secondary)); }

/* "DIRECT MESSAGES" section label */
.dm-section-label {
  padding: 12px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  flex-shrink: 0;
}

#dm-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 0 8px;
  min-height: 0;
}

/* DM conversation row */
.dm-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 6px;
  margin: 1px 6px;
  transition: background var(--transition), border-color var(--transition);
  border-left: 2px solid transparent;
  overflow: hidden;
}

/* Sidebar decoration â€” same technique as member-row */
.dm-row.has-decoration::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--decoration-url);
  background-size: auto 100%;
  background-position: right center;
  background-repeat: no-repeat;
  opacity: 0.85;
  mask-image: linear-gradient(to right, transparent 20%, black 60%);
  -webkit-mask-image: linear-gradient(to right, transparent 20%, black 60%);
  pointer-events: none;
  z-index: 0;
}
.dm-row.has-decoration > * { position: relative; z-index: 1; }

.dm-row:hover  { background: var(--bg-hover); }
.dm-row.active {
  background: var(--gradient-brand-subtle);
  border-left: 2px solid var(--accent);
}
.dm-row.active .dm-row-name { color: #fff; font-weight: 600; }

/* Aliases used by the JS renderDmList rewrite */
.dm-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
  background-size: cover; background-position: center;
  overflow: hidden;
}
.dm-info { flex: 1; overflow: hidden; min-width: 0; }
.dm-name {
  font-size: 14px; font-weight: 500; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.dm-row.active .dm-name { color: #fff; font-weight: 600; }
.dm-preview {
  font-size: 12px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px; line-height: 1.3;
}
.dm-right {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; position: relative;
}
.dm-badge {
  background: #ed4245; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  transition: opacity .1s;
}
.dm-row:hover .dm-badge  { opacity: 0; }

/* Avatar */
.dm-row-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* Text column */
.dm-row-info {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.dm-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.dm-row-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
  line-height: 1.3;
}

/* Right-side controls: badge always visible, close on hover */
.dm-row-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  position: relative;
}

.dm-row-badge {
  background: #ed4245;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity .1s;
}

.dm-close-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  border-radius: 4px;
  opacity: 0;
  transition: opacity .1s, color .1s, background .1s;
}

.dm-row:hover .dm-close-btn  { opacity: 1; background: var(--bg-tertiary); }
.dm-row:hover .dm-row-badge  { opacity: 0; }
.dm-close-btn:hover           { color: var(--text-primary); }

.dm-empty {
  padding: 16px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

/* =========================================================
   UPLOAD PROGRESS BAR
========================================================= */
#upload-progress {
  height: 3px;
  background: var(--bg-tertiary);
  margin-bottom: 2px;
  border-radius: 2px;
  overflow: hidden;
}
#upload-progress-fill {
  height: 100%;
  background: var(--gradient-brand);
  width: 0%;
  transition: width 0.1s linear;
}

/* =========================================================
   MARKDOWN STYLES
========================================================= */
.inline-code {
  background: var(--bg-tertiary);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 0.875em;
  color: var(--text-primary);
}
.msg-code-block {
  background: #1a1b1e;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 10px 14px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 13.5px;
  margin: 4px 0;
  white-space: pre;
  color: var(--text-primary);
}
.msg-blockquote {
  border-left: 3px solid var(--text-secondary);
  margin: 2px 0;
  padding-left: 10px;
  color: var(--text-secondary);
}

/* =========================================================
   REPLY JUMP HIGHLIGHT
========================================================= */
.msg-jump-highlight { animation: jumpHighlight 1.5s ease; border-radius: 4px; }

/* =========================================================
   USER PROFILE MODAL
========================================================= */
.profile-modal-banner {
  height: 80px;
  background: linear-gradient(-45deg, #ff7a3d, #e93f5c, #35d0ba, #ff7a3d);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  margin: 0;
}
.profile-modal-avatar-wrap {
  position: relative;
  width: 64px; height: 64px; border-radius: 50%;
  margin-top: -32px; margin-bottom: 8px;
}
.profile-modal-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: var(--white);
  font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid var(--bg-secondary);
  overflow: hidden; flex-shrink: 0;
  background-size: cover; background-position: center;
  transition: box-shadow 0.2s ease;
  box-sizing: border-box;
}
.profile-modal-avatar-wrap:hover .profile-modal-avatar {
  box-shadow: 0 0 0 3px var(--accent), var(--shadow-glow);
}
.profile-modal-avatar-wrap .status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  border: 3px solid var(--bg-secondary);
  box-sizing: border-box;
}
.profile-modal-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.profile-modal-name {
  font-size: 18px; font-weight: 800; color: var(--white);
  min-width: 0;
  overflow-wrap: anywhere;
}
.profile-modal-username {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 13px; color: var(--text-secondary); margin-top: 2px;
}
.profile-modal-userid {
  font-size: 10px; color: var(--text-muted); margin-top: 3px;
  font-family: monospace; letter-spacing: 0.03em;
  user-select: all; cursor: text;
}
.profile-modal-bio {
  font-size: 13px; color: var(--text-secondary);
  margin: 8px 0; white-space: pre-wrap; line-height: 1.4;
}
.profile-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); margin: 12px 0 4px;
  letter-spacing: 0.05em;
}
.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 4px;
}
.profile-section-header .profile-section-label {
  margin: 0;
}
.profile-mini-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 0;
}
.profile-mini-action:hover,
.profile-mini-action:focus-visible {
  color: var(--white);
  text-decoration: underline;
  outline: none;
}
.profile-admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.profile-empty-note {
  color: var(--text-muted);
  font-size: 12px;
}

.profile-roles-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px;
}
.profile-role-badge {
  font-size: 12px; font-weight: 600; padding: 2px 8px;
  border-radius: 12px; border: 1px solid;
}

/* Profile badges (flair chips) */
.profile-badges-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px;
}
.profile-badge-chip {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  padding: 0; border-radius: 50%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--badge-color, #ff7a3d);
  color: var(--badge-color, #ff7a3d);
  cursor: default;
  transition: opacity 0.15s, transform 0.1s;
}
.profile-badge-chip:hover { opacity: 0.85; transform: translateY(-1px); }
.profile-badge-chip .ui-icon { width: 15px; height: 15px; }
.profile-badge-chip .badge-emoji-img {
  width: 18px;
  height: 18px;
}
.profile-badge-chip .badge-emoji-char {
  font-size: 16px;
}

.badge-symbol-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.badge-emoji-picker-btn {
  flex: 0 0 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.badge-emoji-picker-panel {
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  background: rgba(12,16,21,0.96);
  padding: 10px;
  box-shadow: var(--shadow-mid);
}
.badge-emoji-picker-search {
  margin: 0 0 8px;
}
.badge-emoji-picker-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}
.badge-emoji-option {
  min-width: 0;
  height: 68px;
  border: 1px solid rgba(255,255,255,0.065);
  background: rgba(255,255,255,0.026);
  color: var(--text-primary);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font: inherit;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.badge-emoji-option:hover,
.badge-emoji-option:focus {
  background: rgba(255,122,61,0.12);
  border-color: rgba(255,122,61,0.38);
  transform: translateY(-1px);
  outline: none;
}
.badge-emoji-option .badge-emoji-img {
  width: 24px;
  height: 24px;
}
.badge-emoji-option .badge-emoji-char {
  font-size: 23px;
}
.badge-emoji-option-name,
.badge-emoji-option-source {
  max-width: 100%;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-emoji-option-name {
  font-size: 11px;
  font-weight: 700;
}
.badge-emoji-option-source {
  color: var(--text-muted);
  font-size: 10px;
}
.badge-emoji-picker-empty {
  color: var(--text-muted);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  grid-column: 1 / -1;
}

/* Divider inside profile modal */
.profile-modal-divider {
  height: 1px;
  background: var(--separator);
  margin: 10px 0;
}

/* =========================================================
   PREMIUM STYLES
   ========================================================= */

/* Premium sparkle next to username in profile modal */
.premium-profile-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #f5c51866;
  background: #f5c51818;
  color: #f5c518; font-size: 12px; vertical-align: middle;
  text-shadow: 0 0 6px #f5c51860;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Premium sparkle label in settings section header */
.premium-crown {
  color: #f5c518; font-size: 14px;
  text-shadow: 0 0 6px #f5c51860;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.premium-badge-label {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 10px;
  background: linear-gradient(90deg, #f5c518, #e5a800);
  color: #1a1a1a;
}

/* Lock notice shown for non-premium users */
.premium-lock-notice {
  font-size: 12px; color: var(--text-muted);
  padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--bg-tertiary);
  background: var(--bg-tertiary);
  margin-bottom: 4px;
}
.premium-lock-notice strong { color: #f5c518; }

/* Premium features teaser box */
.premium-teaser {
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid #f5c51840;
  background: linear-gradient(135deg, #f5c51808, #e5a80004);
}

.premium-settings-root {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.premium-billing-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: var(--bg-tertiary);
}

.premium-billing-status.is-active {
  border-color: #faa61a66;
  background: linear-gradient(135deg, rgba(250,166,26,0.10), rgba(255,255,255,0.03));
}

.premium-billing-eyebrow {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.premium-billing-title {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 800;
  margin-top: 2px;
}

.premium-billing-detail {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.premium-billing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #1d1603;
  background: #faa61a;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}

.premium-billing-status:not(.is-active) .premium-billing-badge {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.08);
}

.premium-section {
  padding: 16px;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: var(--bg-tertiary);
  overflow: visible;
}

.premium-section-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.premium-wallet-notice,
.admin-payment-warning,
.mod-payment-warning {
  padding: 10px 12px;
  border: 1px solid rgba(250,166,26,0.35);
  border-radius: 8px;
  background: rgba(250,166,26,0.10);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.premium-wallet-notice {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.premium-wallet-notice strong {
  color: var(--text-primary);
  font-size: 13px;
}

.admin-payment-warning {
  grid-column: 1 / -1;
}

.mod-payment-warning {
  margin-top: 10px;
}

.premium-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 0;
}

.premium-product-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: var(--bg-tertiary);
  min-width: 0;
}

.premium-product-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.premium-product-price {
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.premium-product-term,
.premium-product-xmr {
  color: var(--text-secondary);
  font-size: 12px;
}

.premium-product-button {
  margin-top: auto;
  width: 100%;
  min-height: 42px;
}

.premium-invoice {
  padding: 14px;
  margin-top: 0;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: var(--bg-tertiary);
}

.premium-invoice.is-paid {
  border-color: #43b58166;
}

.premium-invoice-head,
.premium-invoice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.premium-invoice-actions {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.premium-invoice-id {
  color: var(--text-primary);
  font-family: monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.premium-invoice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.premium-invoice-grid > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  background: rgba(0,0,0,0.12);
}

.premium-invoice-grid span,
.premium-invoice-grid small {
  color: var(--text-muted);
  font-size: 11px;
}

.premium-invoice-grid strong {
  color: var(--text-primary);
  font-size: 14px;
}

.premium-address-cell code {
  display: block;
  max-width: 100%;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.premium-copy-btn {
  align-self: flex-start;
  font-size: 12px;
}

.premium-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.premium-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--separator);
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.premium-history-row:hover {
  background: var(--bg-hover);
}

.premium-history-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.premium-history-row strong {
  color: var(--text-primary);
  font-size: 12px;
  text-transform: capitalize;
}

.premium-history-row small {
  color: var(--text-muted);
  font-size: 11px;
}

.premium-empty-state {
  padding: 16px;
  border: 1px dashed var(--separator);
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(0,0,0,0.10);
}

.premium-empty-state.is-error {
  color: var(--danger);
}

/* Decoration picker grid */
.decoration-option {
  aspect-ratio: 4/1;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  transition: border-color 0.15s, opacity 0.15s;
  overflow: hidden;
}
.decoration-option:hover { border-color: var(--text-muted); }
.decoration-option.selected { border-color: var(--accent); }
.decoration-none-thumb {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-tertiary); border-radius: 4px;
}

/* Profile theme picker */
.theme-option {
  aspect-ratio: 2/1;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.1s;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px;
}
.theme-option:hover { border-color: var(--text-muted); transform: scale(1.03); }
.theme-option.selected { border-color: var(--accent); }
.theme-option span {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
  pointer-events: none;
}

/* Accent ring â€” JS sets --user-accent on .avatar-wrap; CSS applies it to the inner avatar */
.avatar-wrap .member-avatar,
.avatar-wrap .dm-avatar {
  transition: box-shadow 0.2s;
}
/* When --user-accent is set, the avatar picks up the ring */
.has-accent .member-avatar,
.has-accent .dm-avatar {
  box-shadow: 0 0 0 2px var(--user-accent), 0 0 8px var(--user-accent);
}

/* =========================================================
   USER SETTINGS PANEL
========================================================= */
.settings-panel {
  display: flex;
  width: 900px;
  max-width: 96vw;
  height: 88vh;
  max-height: 88vh;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-high);
  animation: slideUp 0.18s ease;
  border: 1px solid rgba(255,255,255,0.06);
}

/* LEFT NAV */
.settings-nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  padding: 16px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.settings-nav-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 14px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.settings-nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.settings-nav-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.settings-nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 10px;
  margin: 10px 0 4px;
}

.settings-nav-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.settings-nav-item:hover  { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav-item.active { background: var(--bg-active); color: var(--white); font-weight: 500; }

.settings-nav-spacer  { flex: 1; }
.settings-nav-divider { height: 1px; background: var(--separator); margin: 8px 0; flex-shrink: 0; }

.settings-nav-close-btn { color: var(--text-muted) !important; display: flex; align-items: center; gap: 8px; }
.settings-nav-close-btn:hover {
  color: var(--danger) !important;
  background: rgba(237,66,69,0.1) !important;
  text-decoration: none !important;
}
.settings-nav-esc {
  margin-left: auto;
  font-size: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--separator);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text-muted);
  font-family: monospace;
}

/* RIGHT CONTENT */
.settings-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  background: var(--bg-secondary);
}

.settings-pane { padding: 32px 40px 48px; max-width: 660px; }
.settings-pane.hidden { display: none; }

.settings-pane-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--separator);
}

/* PROFILE CARD (My Account preview) */
.settings-profile-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--separator);
  background: var(--bg-tertiary);
  margin-bottom: 20px;
}
.settings-profile-card-banner { height: 64px; background-size: cover; background-position: center; }
.settings-profile-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 16px;
}
.settings-profile-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  border: 3px solid var(--bg-tertiary);
  margin-top: -22px;
}
.settings-profile-card-info  { flex: 1; }
.settings-profile-card-name  { font-size: 15px; font-weight: 700; color: var(--white); }
.settings-profile-card-tag   { font-size: 12px; color: var(--text-muted); }

/* FIELD GROUPS */
.settings-field-group {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--separator);
  overflow: hidden;
  margin-bottom: 20px;
}

.settings-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--separator);
  gap: 16px;
}
.settings-field-row--last { border-bottom: none; }

.settings-field-info { flex: 1; }
.settings-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.settings-field-value { font-size: 15px; color: var(--text-primary); }

.settings-edit-btn {
  font-size: 13px !important;
  padding: 6px 14px !important;
  flex-shrink: 0;
  border: 1px solid var(--separator) !important;
}

/* INLINE EDITOR */
.settings-inline-editor {
  background: var(--bg-tertiary);
  border: 1px solid var(--separator);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 16px;
  margin-top: -21px;
  margin-bottom: 20px;
  animation: fadeIn 0.1s ease;
}

/* SECTION DIVIDERS */
.settings-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.settings-divider::before,
.settings-divider::after { content: ''; flex: 1; height: 1px; background: var(--separator); }
.settings-divider--danger { color: var(--danger); }
.settings-divider--danger::before,
.settings-divider--danger::after { background: rgba(237,66,69,0.25); }

/* DANGER ZONE */
.settings-danger-zone {
  border: 1px solid rgba(237,66,69,0.25);
  border-radius: var(--radius-md);
  background: rgba(237,66,69,0.04);
  overflow: hidden;
}
.settings-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(237,66,69,0.15);
}
.settings-danger-row--last { border-bottom: none; }
.settings-danger-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.settings-danger-desc  { font-size: 12px; color: var(--text-muted); }

/* TOGGLE ROWS (Notifications) */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--separator);
  gap: 16px;
}
.settings-toggle-row--last { border-bottom: none; }
.settings-toggle-label { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }

/* MISC */
.settings-char-count { font-size: 11px; color: var(--text-muted); text-align: right; }
.settings-hint       { font-size: 12px; color: var(--text-muted); }

.settings-avatar-preview {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); color: var(--white);
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  background-size: cover; background-position: center;
  border: 3px solid var(--separator);
}

.avatar-position-controls {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-width: 360px;
}
.avatar-position-controls label {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.avatar-position-controls input[type="range"] {
  width: 100%;
}

.settings-voice-keybind-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.settings-soundboard-list {
  display: grid;
  gap: 8px;
}
.settings-soundboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
}
.settings-soundboard-info {
  min-width: 0;
}
.settings-soundboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}
.settings-soundboard-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}
.settings-soundboard-delete {
  color: var(--danger) !important;
}
.settings-soundboard-empty {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 13px;
}

.settings-voice-status {
  padding-top: 14px;
}

.settings-voice-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.settings-voice-status-badge.is-ready {
  background: rgba(35, 165, 90, 0.16);
  color: var(--success);
}

.settings-voice-status-badge.is-blocked {
  background: rgba(240, 177, 50, 0.16);
  color: var(--warning);
}

/* Responsive */
@media (max-width: 640px) {
  .settings-panel { flex-direction: column; height: 100vh; max-height: 100vh; border-radius: 0; max-width: 100vw; }
  .settings-nav { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 8px; height: auto; overflow-x: auto; border-bottom: 1px solid var(--separator); }
  .settings-nav-header, .settings-nav-section-label, .settings-nav-spacer, .settings-nav-divider { display: none; }
  .settings-nav-item { padding: 6px 10px; font-size: 12px; }
  .settings-nav-esc { display: none; }
  .settings-pane { padding: 20px 16px 32px; }
  .server-settings-modal { width: min(100vw - 12px, 680px); }
  .permission-settings-modal { width: min(100vw - 12px, 1000px); }
  .permission-settings-layout { grid-template-columns: 1fr; min-height: 0; }
  .permission-settings-target-toolbar { flex-direction: column; align-items: stretch; }
  .permission-settings-override-row,
  .permission-settings-checkbox-row { flex-direction: column; align-items: stretch; }
  .permission-settings-override-actions { justify-content: flex-start; }
  .user-channel-settings-grid { grid-template-columns: 1fr; }
  .user-channel-settings-toolbar { flex-direction: column; align-items: stretch; }
  .priority-speaker-settings-layout { grid-template-columns: 1fr; max-height: none; }
  .settings-voice-keybind-row { flex-direction: column; align-items: stretch; }
}

/* Toggle switch */
.toggle-switch {
  position: relative; width: 40px; height: 22px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-tertiary);
  border-radius: 11px; cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider:before {
  content: "";
  position: absolute; width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: var(--white); border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

/* =========================================================
   STATUS DOTS
========================================================= */
.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.avatar-wrap::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
  box-sizing: border-box;
}
/* In the user panel the border should match the tertiary bg */
#user-panel .avatar-wrap::after { border-color: var(--bg-tertiary); }
/* In DM list match the sidebar bg */
.dm-row .avatar-wrap::after     { border-color: var(--bg-secondary); }

.avatar-wrap.status-online::after    { background: #3ba55c; box-shadow: 0 0 6px rgba(59,165,92,0.6); }
.avatar-wrap.status-idle::after      { background: var(--warning); }
.avatar-wrap.status-dnd::after       { background: var(--danger); box-shadow: 0 0 6px rgba(237,66,69,0.5); }
.avatar-wrap.status-invisible::after { background: var(--text-muted); }
.avatar-wrap.status-offline::after   { background: var(--text-muted); }

/* Standalone status dot (used in profile modal, friends list) */
.status-dot {
  display: inline-block;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.status-online    { background: #3ba55c; box-shadow: 0 0 6px rgba(59,165,92,0.6); }
.status-dot.status-idle      { background: var(--warning); }
.status-dot.status-dnd       { background: var(--danger); box-shadow: 0 0 6px rgba(237,66,69,0.5); }
.status-dot.status-invisible { background: var(--text-muted); }
.status-dot.status-offline   { background: var(--text-muted); }

/* Profile modal status message */
.profile-modal-status-msg {
  font-size: 12px; color: var(--text-muted);
  margin-top: 3px; font-style: italic;
}

/* =========================================================
   FRIENDS & BLOCKED USERS (settings modal)
========================================================= */
.settings-subsection-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: 0.04em;
  margin: 10px 0 6px;
}
.settings-social-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--separator);
}
.settings-social-row:last-child { border-bottom: none; }
.settings-social-name { font-size: 13px; font-weight: 600; flex: 1; }
.settings-social-sub  { font-size: 11px; color: var(--text-muted); }
.settings-social-row .btn { margin-left: auto; padding: 3px 10px; flex-shrink: 0; }

/* =========================================================
   MODERATION PANEL
========================================================= */
#mod-panel {
  position: fixed;
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  font-size: 14px;
}

#mod-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--separator);
  flex-shrink: 0;
}

#mod-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
}

#mod-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
#mod-close:hover { color: var(--white); }

#mod-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#mod-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--separator);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mod-tab-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 18px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.mod-tab-btn:hover { background: var(--bg-hover); color: var(--white); }
.mod-tab-btn.active {
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
}

#mod-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.moderation-panel-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  #mod-panel {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding-bottom: var(--app-safe-area-bottom);
    box-sizing: border-box;
  }

  #mod-header {
    height: calc(52px + var(--app-safe-area-top));
    padding-top: var(--app-safe-area-top);
    padding-right: max(4px, var(--app-safe-area-right));
    padding-left: max(14px, var(--app-safe-area-left));
    box-sizing: border-box;
  }

  #mod-body {
    min-height: 0;
    flex-direction: column;
  }

  #mod-sidebar {
    width: auto;
    padding: 4px max(6px, var(--app-safe-area-right)) 4px max(6px, var(--app-safe-area-left));
    flex-direction: row;
    gap: 2px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--separator);
    scrollbar-width: none;
  }

  #mod-sidebar::-webkit-scrollbar {
    display: none;
  }

  .mod-tab-btn {
    width: auto;
    min-height: 44px;
    padding: 9px 12px;
    flex: 0 0 auto;
    text-align: center;
    white-space: nowrap;
  }

  #mod-content {
    min-width: 0;
    min-height: 0;
    padding: 14px max(12px, var(--app-safe-area-right)) 20px max(12px, var(--app-safe-area-left));
  }
}

.mod-loading, .mod-error {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}
.mod-error { color: var(--danger); }

/* Stats bar */
.mod-stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.mod-stat-chip {
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: 6px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 13px;
}
.mod-stat-chip strong {
  color: var(--white);
  font-size: 18px;
  display: block;
}

/* Search */
.mod-search-row {
  display: flex;
  gap: 8px;
}
.mod-search-input {
  flex: 1;
  max-width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.mod-search-input:focus { border-color: var(--accent); }

/* Table */
.mod-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--separator);
  border-radius: 8px;
}
.mod-payment-table-wrap {
  max-height: 240px;
  overflow: auto;
}
.mod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mod-table thead {
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
}
.mod-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-bottom: 1px solid var(--separator);
  white-space: nowrap;
}
.mod-table td {
  padding: 10px 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--separator);
  vertical-align: middle;
}
.mod-table tr:last-child td { border-bottom: none; }
.mod-table tbody tr:hover { background: var(--bg-hover); }

.mod-cell-id { color: var(--text-muted); font-size: 12px; }
.mod-cell-muted { color: var(--text-muted); }
.mod-cell-mono { font-family: monospace; font-size: 12px; }

.mod-username { font-weight: 600; color: var(--white); }

.mod-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}
.mod-badge .ui-icon { width: 12px; height: 12px; }
.mod-badge-admin {
  background: rgba(255, 122, 61, 0.25);
  color: var(--accent);
}
.mod-badge-premium {
  background: rgba(250, 166, 26, 0.2);
  color: #faa61a;
}

/* Avatars */
.mod-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.mod-avatar-ph {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

/* Expandable action rows */
.mod-act-row td,
.mod-srv-act-row td { padding: 0 !important; border-bottom: 1px solid var(--separator) !important; }

.mod-act-cell {
  background: rgba(0,0,0,0.22);
}

.mod-act-panel {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mod-act-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mod-act-btn-row { gap: 8px; }

.mod-act-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  min-width: 100px;
  flex-shrink: 0;
}

.mod-act-input {
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.mod-act-input:focus { border-color: var(--accent); }

/* Channel list inside server manage panel */
.mod-srv-ch-wrap {
  border-top: 1px solid var(--separator);
}

.mod-ch-list {
  display: flex;
  flex-direction: column;
  padding: 8px 20px 12px;
  gap: 4px;
}

.mod-ch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.mod-ch-row:hover { background: rgba(255,255,255,0.04); }
.mod-ch-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
}

/* Action buttons */
.mod-actions-cell {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.mod-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.mod-btn .ui-icon { width: 14px; height: 14px; }
.mod-btn:hover { background: var(--bg-hover); color: var(--white); }
.mod-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mod-btn-warn { background: rgba(250, 166, 26, 0.15); color: #faa61a; }
.mod-btn-warn:hover { background: rgba(250, 166, 26, 0.3); }
.mod-btn-danger { background: rgba(237, 66, 69, 0.15); color: var(--danger); }
.mod-btn-danger:hover { background: rgba(237, 66, 69, 0.3); }

/* Messages tab sections */
.mod-msg-section {
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: 8px;
  padding: 16px 20px;
}
.mod-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.mod-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mod-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--separator);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  min-width: 200px;
  outline: none;
  cursor: pointer;
}
.mod-select:focus { border-color: var(--accent); }
.mod-count-hint {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}

/* Audit log footer */
.mod-audit-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.mod-audit-action {
  color: var(--accent);
  font-weight: 500;
  text-transform: capitalize;
}

/* ROLE MANAGEMENT */
.role-assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
}
.role-assign-row:hover { background: var(--bg-tertiary); }
.role-assign-row input[type="checkbox"] { cursor: pointer; accent-color: var(--accent); }

/* =========================================================
   VOICE: DEAFEN BUTTON
========================================================= */
#vc-deafen-btn.active {
    background: var(--danger);
    color: #fff;
}

/* =========================================================
   VOICE: PER-USER CONTEXT MENU VOLUME SLIDER
========================================================= */
.ctx-volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    min-width: 200px;
}
.ctx-volume-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.ctx-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--bg-modifier-accent);
    outline: none;
    cursor: pointer;
}
.ctx-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}
.ctx-volume-val {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 36px;
    text-align: right;
}

/* =========================================================
   VC MEMBER ROWS: LOCALLY MUTED INDICATOR
========================================================= */
.vc-member-row.locally-muted .vc-member-name {
    opacity: 0.5;
    text-decoration: line-through;
}

/* =========================================================
   PROFILE: INLINE ID
========================================================= */
.profile-modal-idnum {
    font-size: 0.8em;
    color: var(--text-muted);
    font-family: monospace;
    user-select: all;
}

/* =========================================================
   GROUP DM: DM LIST
========================================================= */
.dm-avatar-group {
    border-radius: 8px !important;
}

.dm-new-group-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: calc(100% - 16px);
    margin: 4px 8px 8px;
    padding: 6px 10px;
    background: var(--bg-modifier-accent);
    color: var(--text-muted);
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    font-weight: 700;
}
.dm-new-group-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* =========================================================
   GROUP DM: MEMBERS MODAL
========================================================= */
.gdm-member-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gdm-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}
.gdm-member-row > span {
    flex: 1;
    font-size: 14px;
}
.gdm-kick-btn {
    flex-shrink: 0;
}
.gdm-manage-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    margin-bottom: 12px;
}
.gdm-manage-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    color: var(--white);
    font-size: 18px;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.gdm-manage-title {
    color: var(--text-primary);
    font-weight: 900;
    font-size: 15px;
}
.gdm-manage-hint,
.gdm-manage-note {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 4px;
}
.gdm-manage-note {
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
.gdm-manage-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.gdm-manage-edit-card {
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
    padding: 12px;
    margin-bottom: 12px;
}
.gdm-manage-name-row,
.gdm-manage-picture-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.gdm-manage-name-row {
    margin-bottom: 10px;
}
.gdm-manage-name-row .landing-input {
    flex: 1;
    min-width: 0;
}
.gdm-manage-picture-row {
    flex-wrap: wrap;
}
.gdm-manage-actions .landing-btn,
.gdm-manage-picture-row .landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.landing-btn-danger {
    background: rgba(237,66,69,0.14);
    color: #ffb5b8;
    border-color: rgba(237,66,69,0.28);
}
.landing-btn-danger:hover:not(:disabled) {
    background: rgba(237,66,69,0.24);
    color: var(--white);
}
.gdm-manage-section-title {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 900;
    margin: 0 0 8px;
}
.gdm-manage-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.gdm-manage-section-title-row span:last-child {
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: none;
}
.gdm-manage-member-list {
    gap: 8px;
}
.gdm-manage-member-row {
    align-items: flex-start;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
}
.gdm-member-main {
    flex: 1;
    min-width: 0;
}
.gdm-member-name-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
}
.gdm-member-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 900;
}
.gdm-member-username {
    color: var(--text-muted);
    font-size: 12px;
}
.gdm-role-badge,
.gdm-permission-badges span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 900;
}
.gdm-role-badge {
    color: #ffd58a;
    background: rgba(250,166,26,0.12);
    border: 1px solid rgba(250,166,26,0.24);
}
.gdm-permission-badges {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.gdm-permission-badges span {
    color: #bfc8ff;
    background: rgba(255,122,61,0.16);
    border: 1px solid rgba(255,122,61,0.25);
}
.gdm-permission-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.gdm-permission-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}
.gdm-permission-toggle input {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
}
.gdm-manage-member-row.is-saving {
    opacity: 0.65;
}
.gdm-picker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.gdm-picker-hint {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 3px;
}
.gdm-picker-hint.is-warning {
    color: #ffc7c8;
}
.gdm-picker-count {
    flex-shrink: 0;
    border: 1px solid rgba(255,122,61,0.35);
    background: rgba(255,122,61,0.14);
    color: var(--white);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
}
.gdm-picker-search {
    margin-bottom: 10px;
}
.gdm-picker-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.gdm-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.gdm-picker-row:hover {
    background: rgba(255,122,61,0.12);
    border-color: rgba(255,122,61,0.32);
    transform: translateY(-1px);
}
.gdm-picker-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}
.gdm-picker-user {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gdm-picker-name {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gdm-picker-username {
    color: var(--text-muted);
    font-size: 11px;
}
.gdm-picker-empty {
    color: var(--text-muted);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.4;
}
.landing-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}
.role-mgmt-row { font-size: 14px; color: var(--text-primary); }

/* Channel header search button */
.channel-header-btn {
    background: none;
    border: none;
    color: var(--icon-muted-strong);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 18px;
    transition: color var(--transition), background var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#channel-header-icon .ui-icon,
.channel-header-btn .ui-icon,
.input-icon-btn .ui-icon,
.user-panel-btn .ui-icon,
.modal-close .ui-icon,
.ctx-item-icon .ui-icon {
    stroke-width: 2.15;
}
.channel-header-btn:hover {
    color: var(--text-primary);
    background: var(--bg-modifier-accent);
}
.channel-header-btn.active {
    color: var(--white);
    background: rgba(255,122,61,0.18);
}
.channel-header-btn-danger {
    color: #ffb3b5;
}
.channel-header-btn-danger:hover {
    color: #fff;
    background: rgba(237,66,69,0.18);
}

/* Search modal results */
.search-result {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    margin-bottom: 6px;
    cursor: pointer;
    transition: background var(--transition);
    border: 1px solid transparent;
}
.search-result:hover {
    background: var(--bg-modifier-accent);
    border-color: var(--interactive-muted);
}
.search-result-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.search-result-meta strong {
    color: var(--text-secondary);
}
.search-result-content {
    font-size: 14px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}
.search-result-content mark {
    background: rgba(255, 122, 61, 0.3);
    color: var(--text-primary);
    border-radius: 2px;
    padding: 0 2px;
}
#search-results-list {
    max-height: 420px;
    overflow-y: auto;
    margin-top: 12px;
}

/* =========================================================
   PINNED MESSAGES MODAL
========================================================= */
.pin-entry {
  padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--bg-tertiary); margin-bottom: 8px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.pin-entry:hover { background: var(--bg-modifier-accent); }
.pin-meta {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.pin-author { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.pin-time   { font-size: 11px; color: var(--text-muted); }
.pin-content {
  font-size: 13px; color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-word; line-height: 1.4;
}
.pin-unpin-btn {
  position: absolute; top: 10px; right: 10px;
  background: transparent; border: 1px solid var(--separator);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 11px; font-weight: 600; cursor: pointer; padding: 3px 8px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.pin-unpin-btn:hover { border-color: var(--danger); color: var(--danger); background: rgba(237,66,69,0.1); }

/* =========================================================
   CHANNEL HEADER â€” topic strip
========================================================= */
#channel-header {
  height: 48px;
  min-height: 48px;
  padding-top: 0;
  padding-bottom: 0;
  align-items: center;
}
#channel-header-center { gap: 1px; }

@media (max-width: 768px) {
  #channel-header {
    height: calc(48px + var(--app-safe-area-top)) !important;
    min-height: calc(48px + var(--app-safe-area-top));
    padding-top: var(--app-safe-area-top) !important;
    padding-right: max(6px, var(--app-safe-area-right));
    padding-bottom: 0 !important;
    padding-left: max(6px, var(--app-safe-area-left));
  }
}

/* =========================================================
   INVITE MODAL â€” options
========================================================= */
.invite-options { margin-bottom: 4px; }
.invite-option-row { margin-bottom: 0; }
.invite-code-meta {
  font-size: 12px; color: var(--text-muted); text-align: center;
  margin: 6px 0 4px; line-height: 1.4;
}

/* =========================================================
   MODERATION TIMEOUTS
========================================================= */
.timeout-duration-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 650;
  line-height: 1.35;
}
.timeout-duration-hint strong {
  color: var(--text-primary);
  font-weight: 800;
}
.timeout-duration-boxes {
  display: grid;
  grid-template-columns: repeat(6, minmax(48px, 1fr));
  align-items: end;
  gap: 6px;
}
.timeout-duration-box {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}
.timeout-duration-box span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.timeout-duration-box input {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--input-border, var(--separator));
  border-radius: var(--radius-sm);
  background: var(--input-bg, var(--bg-tertiary));
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  outline: none;
}
.timeout-duration-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,122,61,0.18);
}
.timeout-duration-separator {
  display: none;
}
.timeout-validation-error {
  margin-top: 8px;
  color: #ffb3b5;
  background: rgba(237,66,69,0.1);
  border: 1px solid rgba(237,66,69,0.26);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}
.timeout-channel-picker {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.12);
  padding: 8px;
}
.timeout-channel-group + .timeout-channel-group {
  margin-top: 10px;
}
.timeout-channel-group-title {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 4px 4px 6px;
}
.timeout-channel-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}
.timeout-channel-row:hover {
  background: var(--bg-modifier-accent);
  color: var(--text-primary);
}
.timeout-channel-row input {
  accent-color: var(--accent);
}
.timeout-channel-kind {
  min-width: 42px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}
.timeout-channel-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeout-channel-empty,
.timeout-channel-note {
  color: var(--text-secondary);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}
.server-timeout-active #chat-container {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.035), transparent 30%),
    var(--bg-primary);
}
.timeout-view {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.timeout-illustration {
  width: 150px;
  height: 132px;
  position: relative;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(0,0,0,0.08));
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}
.timeout-corner-lines::before,
.timeout-corner-lines::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.timeout-corner-lines::before { top: 34px; }
.timeout-corner-lines::after { bottom: 28px; }
.timeout-child {
  position: absolute;
  left: 56px;
  bottom: 22px;
  width: 42px;
  height: 72px;
}
.timeout-hat {
  position: absolute;
  top: -16px;
  left: 9px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 36px solid #d7d9df;
  transform: rotate(0deg);
  transform-origin: 50% 100%;
}
.timeout-hat::after {
  content: "D";
  position: absolute;
  top: 14px;
  left: -4px;
  color: #313338;
  font-size: 10px;
  font-weight: 900;
}
.timeout-head {
  position: absolute;
  top: 18px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f0c7a8;
  box-shadow: inset -5px -5px 0 rgba(0,0,0,0.08);
}
.timeout-body {
  position: absolute;
  top: 42px;
  left: 5px;
  width: 32px;
  height: 24px;
  border-radius: 12px 12px 8px 8px;
  background: var(--accent);
  opacity: 0.85;
}
.timeout-feet {
  position: absolute;
  left: 3px;
  bottom: 0;
  width: 36px;
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
}
.timeout-view-title {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 900;
}
.timeout-view-copy,
.timeout-view-reason {
  max-width: 420px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}
.timeout-countdown {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

@media (max-width: 760px) {
  .app-home {
    padding: 20px 14px 32px;
    gap: 20px;
  }
  .app-home-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .app-home-actions {
    justify-content: flex-start;
  }
  .app-home-action {
    flex: 1 1 auto;
    justify-content: center;
  }
  .app-home-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .app-home-download-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .media-lightbox-overlay {
    padding: 12px;
  }
  .media-lightbox-close {
    top: 8px;
    right: 8px;
  }
  .media-lightbox img {
    max-height: calc(100vh - 92px);
  }
  .media-lightbox video {
    max-height: calc(100vh - 92px);
  }
}

