.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  height: 100%;
  background: var(--bg-deep);
  position: relative;
}

.shell.with-members {
  grid-template-columns: var(--sidebar) 1fr var(--members);
}

/* Layout clássico: rail vertical à esquerda */
.shell.layout-classic {
  grid-template-columns: var(--server-rail) var(--sidebar) 1fr;
}
.shell.layout-classic.with-members {
  grid-template-columns: var(--server-rail) var(--sidebar) 1fr var(--members);
}

/* Top auto-hide: só ícones de servidores / Início */
.top-nav-hotspot {
  position: fixed;
  top: var(--titlebar-h);
  left: 0;
  right: 0;
  height: var(--top-nav-hotspot);
  z-index: 9000;
  pointer-events: auto;
}

.top-nav {
  position: fixed;
  top: var(--titlebar-h);
  left: 0;
  right: 0;
  z-index: 9001;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(-105%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  overflow: hidden;
}

.top-nav.is-open,
.shell.top-nav-open .top-nav {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.shell.layout-top .server-rail,
.top-nav .server-rail {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 14px;
  gap: 10px;
  border-right: none;
  border-bottom: none;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--bg-0);
  flex-shrink: 0;
}

.shell.layout-classic .server-rail {
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  border-right: 1px solid var(--border);
  overflow-x: hidden;
  overflow-y: auto;
}

/* Server rail */
.server-rail {
  background: var(--bg-0);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.server-pill {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-2);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  position: relative;
  transition: border-radius 0.18s, background 0.18s;
  overflow: hidden;
  flex-shrink: 0;
}
.server-pill img { width: 100%; height: 100%; object-fit: cover; }
.server-pill:hover,
.server-pill.active {
  border-radius: 16px;
  background: var(--accent);
  color: #04140c;
}
.server-pill.active::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
}
.shell.layout-classic .server-pill.active::before,
html[data-nav-layout="classic"] .shell.layout-classic .server-pill.active::before {
  left: -14px;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 36px;
  border-radius: 0 4px 4px 0;
}
/* Logo do Nexus: sem pintar de azul/accent por baixo */
.server-pill.home,
.server-pill.home:hover,
.server-pill.home.active {
  background: #000;
  padding: 0;
}
.server-pill.home img {
  border-radius: inherit;
}
.server-sep {
  width: 2px;
  height: 28px;
  background: var(--bg-3);
  border-radius: 2px;
  margin: 0 4px;
  flex-shrink: 0;
}
.shell.layout-classic .server-sep {
  width: 32px;
  height: 2px;
  margin: 4px 0;
}
.server-add {
  border: 1px dashed var(--text-dim);
  color: var(--accent);
  font-size: 22px;
}
.server-add:hover {
  background: var(--accent-soft);
  border-style: solid;
  border-color: var(--accent);
}

/* Sidebar */
.sidebar {
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--border);
}
.sidebar-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 var(--border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
.sidebar-search {
  margin: 10px 12px;
}
.sidebar-search .input {
  background: var(--bg-0);
  padding: 8px 10px;
  font-size: 13px;
}
.sidebar-nav {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: var(--bg-active);
  color: var(--text);
}
.nav-item .badge-count { margin-left: auto; }

.channel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 12px;
}
.cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 6px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.cat-head button { color: var(--text-dim); font-size: 16px; line-height: 1; }
.cat-head button:hover { color: var(--text); }
.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
}
.channel-item:hover { background: var(--bg-hover); color: var(--text); }
.channel-item.active {
  background: var(--bg-active);
  color: var(--text);
}
.channel-item .hash {
  color: var(--text-dim);
  font-weight: 700;
  width: 18px;
  text-align: center;
}
.voice-users {
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}
.voice-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.voice-user .avatar { width: 20px; height: 20px; font-size: 10px; }
.voice-user.speaking .avatar {
  box-shadow: 0 0 0 2px #3ecf8e, 0 0 10px rgba(62, 207, 142, 0.55);
}
.voice-user-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-user-flags {
  color: var(--text-dim);
  display: inline-flex;
  flex-shrink: 0;
}
.channel-item.in-voice {
  color: #3ecf8e;
}
.channel-item.in-voice .hash {
  color: #3ecf8e;
}
.channel-block {
  display: flex;
  flex-direction: column;
}

.user-panel {
  margin-top: auto;
  background: var(--bg-0);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.sidebar-footer {
  margin-top: auto;
}
.sidebar-footer .user-panel {
  margin-top: 0;
}
.user-panel .meta { flex: 1; min-width: 0; }
.user-panel .name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-panel .sub {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-panel-actions { display: flex; gap: 2px; }

/* Main */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-2);
  position: relative;
}
.main > .chat-drop-zone {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.main-header {
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 0 var(--border);
  z-index: 2;
}
.main-header .title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.main-header .topic {
  color: var(--text-dim);
  font-size: 13px;
  border-left: 1px solid var(--border);
  padding-left: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main-header .spacer { flex: 1; }
.header-search {
  width: 180px;
}
.header-search .input {
  padding: 6px 10px;
  font-size: 13px;
  background: var(--bg-0);
}

.friends-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}
.friends-tabs button {
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
}
.friends-tabs button.active {
  background: var(--bg-active);
  color: var(--text);
}
.friends-tabs .sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 0;
}
.msg {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 8px 8px;
  border-radius: 6px;
  margin-bottom: 2px;
}
.msg:hover { background: rgba(255,255,255,0.02); }
.msg .avatar { width: 40px; height: 40px; }
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.msg-author {
  font-weight: 600;
  font-size: 15px;
}
.msg-time {
  font-size: 11px;
  color: var(--text-dim);
}
.msg-body {
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-call-start,
.msg-system {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 4px 72px;
  margin: 8px 0;
  min-height: auto;
}
.msg-call-start:hover,
.msg-system:hover { background: transparent; }
.msg-call-icon,
.msg-system-icon {
  color: #23a559;
  display: inline-flex;
  flex-shrink: 0;
}
.msg-join-icon {
  color: #3ba55d;
}
.msg-call-text,
.msg-system-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.msg-call-text strong,
.msg-system-text strong {
  color: var(--text);
  font-weight: 600;
}
.msg-join-server {
  color: #3ecf8e !important;
}
.msg-call-time,
.msg-system-time {
  color: var(--text-dim);
  font-size: 12px;
  margin-left: 2px;
}

.dm-call-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(35, 165, 89, 0.15);
  color: #3ecf8e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.dm-call-banner:hover {
  background: rgba(35, 165, 89, 0.22);
}
.dm-call-banner-ringing {
  animation: dm-banner-pulse 1.6s ease-in-out infinite;
}
@keyframes dm-banner-pulse {
  0%, 100% { background: rgba(35, 165, 89, 0.15); }
  50% { background: rgba(35, 165, 89, 0.32); }
}

.composer {
  padding: 0 16px 20px;
}
.composer-lock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(237, 66, 69, 0.12);
  border: 1px solid rgba(237, 66, 69, 0.35);
  color: #f2b8b5;
  font-size: 13px;
  line-height: 1.35;
}
.composer-lock-banner .nx-slot,
.composer-lock-banner svg {
  flex-shrink: 0;
  opacity: 0.9;
}
.composer.is-locked .composer-box {
  opacity: 0.55;
  pointer-events: none;
}
.composer.is-locked textarea {
  cursor: not-allowed;
}
.role-default-badge {
  margin-left: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(88, 101, 242, 0.25);
  color: #c9cdfb;
  vertical-align: middle;
}
.attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px 8px;
}
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  max-width: 220px;
}
.attach-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-chip button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.msg-attachments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  max-width: min(420px, 100%);
}
.msg-att-img {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 360px;
}
.msg-att-img img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #0a0c10;
}
.msg-att-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  max-width: 100%;
}
.msg-att-file:hover {
  border-color: var(--accent);
}
.msg-att-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.msg-att-size {
  color: var(--text-dim);
  font-size: 11px;
  flex-shrink: 0;
}
.typing-bar {
  min-height: 0;
  padding: 0 20px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.18s ease, max-height 0.18s ease, margin 0.18s ease;
}
.typing-bar.is-on {
  opacity: 1;
  max-height: 28px;
  margin: 0 0 6px;
}
.typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}
.typing-text {
  font-weight: 500;
}
.composer-box {
  background: var(--bg-3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid transparent;
}
.composer-box:focus-within {
  border-color: rgba(62, 207, 142, 0.35);
}
.composer-box textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  max-height: 160px;
  padding: 10px 4px;
  line-height: 1.4;
}

/* Friends view */
.friends-view {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 32px;
}
.info-banner {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 12px 0 8px;
}
.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border-top: 1px solid var(--border);
}
.friend-row:hover { background: var(--bg-hover); }
.friend-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.friend-row .meta { flex: 1; min-width: 0; }
.friend-row .name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.friend-row .status-text {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}
.friend-row .status-text.is-activity {
  color: var(--accent);
}
.presence-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--online) 22%, transparent);
  color: var(--online);
  border: 1px solid color-mix(in srgb, var(--online) 40%, transparent);
}
.presence-pill.idle {
  background: color-mix(in srgb, var(--idle) 22%, transparent);
  color: var(--idle);
  border-color: color-mix(in srgb, var(--idle) 40%, transparent);
}
.presence-pill.dnd {
  background: color-mix(in srgb, var(--dnd) 22%, transparent);
  color: var(--dnd);
  border-color: color-mix(in srgb, var(--dnd) 40%, transparent);
}
.presence-pill.offline,
.presence-pill.invisible {
  background: color-mix(in srgb, var(--text-dim) 18%, transparent);
  color: var(--text-dim);
  border-color: color-mix(in srgb, var(--text-dim) 35%, transparent);
}
.friend-row.presence-online {
  box-shadow: inset 3px 0 0 var(--online);
}
.friend-row.presence-idle {
  box-shadow: inset 3px 0 0 var(--idle);
}
.friend-row.presence-dnd {
  box-shadow: inset 3px 0 0 var(--dnd);
}
.friend-actions { display: flex; gap: 4px; opacity: 0.7; }
.friend-row:hover .friend-actions { opacity: 1; }

.dm-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.dm-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.dm-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.dm-activity {
  font-size: 11px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

/* Chat drop + reply */
.chat-drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  flex: 1;
}
.chat-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  background: color-mix(in srgb, var(--bg-0) 72%, transparent);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  pointer-events: none;
}
.chat-drop-overlay:not([hidden]) {
  display: grid;
}
.chat-drop-overlay[hidden] {
  display: none !important;
}
.chat-drop-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}
.chat-drop-zone.is-dragging .messages {
  filter: brightness(0.7);
}
.reply-bar {
  padding: 0 12px 6px;
}
.reply-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-3);
  border-left: 3px solid var(--accent);
  font-size: 13px;
}
.reply-bar-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reply-bar-text strong { font-size: 12px; color: var(--accent); }
.reply-bar-text span {
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg {
  position: relative;
}
.msg-content { flex: 1; min-width: 0; position: relative; }
.msg-actions {
  position: absolute;
  top: -6px;
  right: 0;
  display: none;
  gap: 2px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  z-index: 2;
}
.msg:hover .msg-actions { display: flex; }
.msg-del-btn { color: var(--danger); }
.msg-del-btn:hover { background: var(--danger-soft); color: var(--danger); }
.msg-ctx {
  position: fixed;
  z-index: 5000;
  min-width: 180px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.msg-ctx button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  color: var(--text);
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
}
.msg-ctx button:hover { background: var(--bg-hover); }
.msg-ctx button.danger { color: var(--danger); }
.msg-ctx button.danger:hover { background: var(--danger-soft); }
.msg-reply-ref {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  font: inherit;
}
.msg-reply-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}
.msg-reply-meta {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-reply-meta strong { color: var(--accent); margin-right: 4px; }
.msg-flash {
  animation: msg-flash 1.1s ease;
}
@keyframes msg-flash {
  0%, 100% { background: transparent; }
  30% { background: color-mix(in srgb, var(--accent) 18%, transparent); }
}

.status-pill.activity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}

.whats-new-modal .whats-new-list {
  max-height: min(50vh, 420px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 12px 0 4px;
  text-align: left;
}
.whats-new-block header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.whats-new-block header span {
  font-size: 12px;
  color: var(--text-dim);
}
.whats-new-block ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
.whats-new-block li { margin: 3px 0; }

/* Members */
.members-pane {
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px 8px;
}
.role-group {
  margin-bottom: 12px;
}
.role-group h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 8px 6px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  width: 100%;
  text-align: left;
}
.member-row:hover { background: var(--bg-hover); color: var(--text); }
.member-row .name { font-weight: 500; font-size: 14px; }
.member-row .custom {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.member-row .custom.is-activity {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msg-mention {
  background: rgba(88, 101, 242, 0.12);
}
.mention {
  background: rgba(88, 101, 242, 0.35);
  color: #dee0fc;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 600;
}
.msg-author {
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.msg-author:hover { text-decoration: underline; }

/* Settings modal wide */
.modal.wide { width: min(720px, 94vw); }
.settings-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  min-height: 360px;
}
.settings-nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.settings-nav button.active,
.settings-nav button:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.settings-panel h3 {
  font-family: var(--font-display);
  margin-bottom: 12px;
}
.role-list, .channel-admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}
.role-chip, .admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-1);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.profile-preview {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-1);
  margin-bottom: 16px;
}
.profile-banner {
  height: 100px;
  background: linear-gradient(120deg, #1a3a2a, #16304a);
  overflow: hidden;
  position: relative;
}
.profile-banner .banner-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-banner .banner-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, #1a3a2a, #16304a);
}
.profile-body { padding: 0 16px 16px; }
.profile-body .avatar-lg {
  margin-top: -40px;
  border: 6px solid var(--bg-1);
}
.profile-body h3 { margin-top: 8px; font-family: var(--font-display); }
.profile-body .tag { color: var(--text-dim); font-size: 13px; }

.empty-state {
  display: grid;
  place-items: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}
.empty-state h2 {
  font-family: var(--font-display);
  color: var(--text);
  margin-bottom: 8px;
}

.icon-btn.off { color: var(--danger); }
.user-panel-meta, .user-panel-avatar { cursor: pointer; }
.user-panel .meta:hover .name { text-decoration: underline; }

@media (max-width: 960px) {
  .shell.layout-top,
  .shell.layout-top.with-members {
    grid-template-columns: 1fr;
  }
  .shell.layout-classic,
  .shell.layout-classic.with-members {
    grid-template-columns: var(--server-rail) 1fr;
  }
  .sidebar { display: none; }
  .shell.show-sidebar .sidebar {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    width: var(--sidebar);
  }
  .shell.layout-classic.show-sidebar .sidebar {
    left: var(--server-rail);
  }
  .shell.with-members .members-pane {
    display: flex;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 25;
    width: min(240px, 70vw);
    box-shadow: -8px 0 24px rgba(0,0,0,0.35);
  }
}
.members-empty {
  padding: 8px 12px;
  color: var(--text-dim);
  font-size: 13px;
}

/* ── Slash commands ── */
.slash-menu {
  position: fixed;
  z-index: 1200;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow);
  overflow-y: auto;
  padding: 6px;
}
.slash-menu-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.slash-menu-item:hover,
.slash-menu-item.is-active {
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
}
.slash-menu-icon {
  grid-row: 1 / span 2;
  color: var(--accent, #5865f2);
}
.slash-menu-label {
  font-weight: 600;
  color: var(--text);
}
.slash-menu-meta {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  grid-column: 2 / span 2;
}

.slash-feedback {
  display: flex;
  justify-content: center;
  padding: 8px 16px;
  transition: opacity 0.6s ease;
}
.slash-feedback.is-fade {
  opacity: 0;
}
.slash-feedback-card {
  width: min(520px, 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent, #5865f2);
  background: var(--bg-1);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}
.slash-feedback--error .slash-feedback-card {
  border-left-color: var(--danger, #ed4245);
}
.slash-feedback--success .slash-feedback-card {
  border-left-color: var(--success, #3ba55d);
}
.slash-feedback-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.slash-feedback-body {
  color: var(--text-muted);
}
.slash-feedback-fields {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  color: var(--text-muted);
}
.slash-feedback-fields span {
  font-weight: 600;
  color: var(--text);
  margin-right: 6px;
}
.slash-poll-modal .field,
.slash-confirm-modal code {
  display: block;
  margin: 8px 0;
}
.slash-poll-modal input {
  width: 100%;
  margin-top: 4px;
}

/* ——— Layout OneMeet ——— */
.shell.layout-onemeet {
  grid-template-columns: var(--sidebar) 1fr;
}
.shell.layout-onemeet.with-members {
  grid-template-columns: var(--sidebar) 1fr var(--members);
}
.shell.layout-onemeet.om-in-server {
  grid-template-columns: 240px var(--sidebar) 1fr;
}
.shell.layout-onemeet.om-in-server.with-members {
  grid-template-columns: 240px var(--sidebar) 1fr var(--members);
}

.shell.layout-onemeet .sidebar-onemeet {
  background: var(--bg-0);
  border-right: 1px solid var(--border);
}
.shell.layout-onemeet .om-spaces-col {
  width: 240px;
  min-width: 240px;
}
.shell.layout-onemeet .om-spaces-col .sidebar-body {
  padding: 0;
}

.om-side {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 14px 12px 8px;
}
.om-side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px;
}
.om-side-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}
.om-side-brand strong {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.om-side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}
.om-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.om-nav:hover { background: var(--bg-hover); color: var(--text); }
.om-nav.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.om-nav .badge-count { margin-left: auto; }

.om-spaces-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 4px 12px 8px;
}
.om-spaces-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 8px;
}
.om-space {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.om-space:hover { background: var(--bg-hover); color: var(--text); }
.om-space.active {
  background: var(--bg-2);
  color: var(--text);
}
.om-space.is-opening {
  opacity: 0.65;
  pointer-events: none;
}
.om-space-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.om-space-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.om-space-icon.plus {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
}
.om-space-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.om-space-meta { min-width: 0; flex: 1; }
.om-empty-hint {
  color: var(--text-dim);
  font-size: 13px;
  padding: 8px 12px;
  margin: 0;
}

.om-home {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(62, 207, 142, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(80, 120, 255, 0.08), transparent 50%),
    var(--bg-deep);
}
.om-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.om-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--text-muted);
}
.om-search .input {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 10px 0;
}
.om-search .input:focus { box-shadow: none; }
.om-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.om-home-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 340px);
  gap: 20px;
  padding: 24px;
  overflow: hidden;
}
.om-home-main {
  min-width: 0;
  overflow-y: auto;
}
.om-hello h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.om-hello p {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
}
.om-home-hint {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text-muted);
  max-width: 480px;
}
.om-home-hint p { margin: 0; font-size: 14px; line-height: 1.45; }

.om-home-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
}
.om-panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.om-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.om-panel-head strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: uppercase;
}

.om-friend-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.om-friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.om-friend-row:hover { background: var(--bg-hover); }
.om-friend-av {
  position: relative;
  flex-shrink: 0;
}
.om-friend-av .avatar { width: 36px; height: 36px; font-size: 14px; }
.om-friend-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.om-friend-meta .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.om-friend-meta .sub {
  font-size: 11px;
  color: var(--text-dim);
}

.om-live-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.om-live-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.om-live-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.om-live-top strong {
  font-size: 14px;
  color: var(--text);
}
.om-live-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #0b0d10;
  background: var(--accent);
  padding: 3px 7px;
  border-radius: 6px;
}
.om-live-avs {
  display: flex;
  align-items: center;
}
.om-live-av {
  width: 28px;
  height: 28px;
  margin-right: -8px;
  border-radius: 50%;
  border: 2px solid var(--bg-2);
  overflow: hidden;
}
.om-live-av .avatar {
  width: 100%;
  height: 100%;
  font-size: 11px;
  border-radius: 50%;
}
.om-live-more {
  margin-left: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.om-live-join {
  align-self: stretch;
}

@media (max-width: 960px) {
  .shell.layout-onemeet,
  .shell.layout-onemeet.with-members,
  .shell.layout-onemeet.om-in-server,
  .shell.layout-onemeet.om-in-server.with-members {
    grid-template-columns: 1fr;
  }
  .shell.layout-onemeet .om-spaces-col { display: none; }
  .om-home-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .om-home-right { overflow: visible; }
}
