/* Nevdin: design system em docs/DESIGN.md (tokens do Brand Kit v1.0). Use sempre os tokens abaixo. */
:root {
  color-scheme: dark;

  /* camadas (quanto mais à frente, mais claro) */
  --bg-base: #0B0A14;
  --bg-sidebar: #151321;
  --bg-chat: #1B1929;
  --bg-elevated: #242136;
  --bg-floating: #1E1B2E;
  --bg-input: #242136;
  --bg-hover: rgba(180, 176, 220, .08);
  --bg-selected: #302C45;
  --border: rgba(180, 176, 220, .10);
  --border-strong: #353149;

  /* texto e funções */
  --text: #E4E2EE;
  --text-strong: #F8FAFC;
  --text-muted: #B4B0C7;
  --text-faint: #918CA8;
  --accent: #9333EA;
  --accent-hover: #7E22CE;
  --accent-soft: rgba(147, 51, 234, .2);
  --danger: #dc2626;
  --danger-strong: #b91c1c;
  --danger-soft: rgba(220, 38, 38, .14);
  --success: #22C55E;
  --warning: #F59E0B;
  --link: #22D3EE;
  --brand-accent: #22D3EE;
  --accent-text: #C4B5FD;
  --font-heading: "Space Grotesk", Inter, system-ui, sans-serif;
  --font-brand: "Exo 2", "Space Grotesk", system-ui, sans-serif;

  /* forma, espaço, tipo */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --font: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .55);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, .35);
  --t-fast: .12s ease;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-selected); border-radius: var(--radius-pill); }
::-webkit-scrollbar-track { background: transparent; }

#app {
  display: grid;
  grid-template-columns: 72px var(--sidebar-w, 248px) 1fr var(--members-w, 248px);
  /* Uma linha do tamanho exato da tela: o conteúdo rola por dentro de cada coluna e a
     página inteira nunca rola (antes, imagens altas esticavam a linha além da tela). */
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-base);
}
#app > * { min-height: 0; min-width: 0; }
#servers { grid-row: 1; grid-column: 1; }
#sidebar { grid-row: 1; grid-column: 2; }
#user-panel { grid-row: 2; grid-column: 1 / 3; min-height: auto; }
#chat { grid-row: 1 / 3; grid-column: 3; }
#members { grid-row: 1 / 3; grid-column: 4; }
html, body { overflow: hidden; overscroll-behavior: none; }

/* ---------- botões ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--bg-selected); color: var(--text-strong); }
.btn.secondary:hover { background: #34343c; }
.btn.danger { background: var(--danger-strong); color: #fff; }
.btn.danger:hover { background: #b52b30; }
.btn.danger-outline { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn.danger-outline:hover { background: var(--danger-soft); }
.btn.ghost { background: none; color: var(--text); }
.btn.ghost:hover { text-decoration: underline; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.primary-btn {
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  background: var(--success);
  color: #fff;
  font-weight: 600;
}
.primary-btn:hover { filter: brightness(1.1); }
.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn .ic-off { display: none; }
.icon-btn.off .ic-on { display: none; }
.icon-btn.off .ic-off { display: block; color: var(--danger); }
.icon-btn.by-mod { background: var(--danger-soft); }

/* ---------- barra de servidores ---------- */
#servers {
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: var(--space-2);
  overflow-y: auto;
}
#server-list { display: flex; flex-direction: column; gap: var(--space-2); }
.divider { width: 32px; height: 2px; background: var(--bg-selected); border-radius: 1px; flex: none; }
.server-icon {
  position: relative;
  width: 48px;
  height: 48px;
  flex: none;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: border-radius var(--t-fast), background var(--t-fast);
}
.server-icon:hover, .server-icon.active { border-radius: var(--radius-xl); background: var(--accent); color: #fff; }
.server-icon.add { color: var(--success); font-size: 24px; font-weight: 400; }
.server-icon.add:hover { background: var(--success); color: #fff; }
.server-icon::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 4px;
  height: 0;
  background: var(--text-strong);
  border-radius: 0 4px 4px 0;
  transition: height var(--t-fast);
}
.server-icon:hover::before { height: 20px; }
.server-icon.active::before { height: 40px; }
.server-icon.add::before { display: none; }
.server-icon .ping {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger-strong);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 3px solid var(--bg-base);
}

/* ---------- barra lateral: canais ---------- */
#sidebar { background: var(--bg-sidebar); display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius) 0 0 0; }
#server-header {
  height: 48px;
  flex: none;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text-strong);
  font-weight: 700;
  font-size: var(--fs-md);
  text-align: left;
  transition: background var(--t-fast);
}
#server-header:hover { background: var(--bg-hover); }
#server-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caret { color: var(--text-muted); transition: transform var(--t-fast); }
#channels { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-2); }

.section-title, .category {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-2) var(--space-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text-muted);
}
.category:first-child { padding-top: var(--space-1); }
.category .cat-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  text-align: left;
}
.category .cat-toggle:hover { color: var(--text-strong); }
.category .chev { display: inline-block; font-size: 10px; transition: transform var(--t-fast); }
.category.collapsed .chev { transform: rotate(-90deg); }
.category button.cat-add, .section-title button {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}
.category button.cat-add:hover, .section-title button:hover { color: var(--text-strong); }

.channel-list { margin-bottom: var(--space-1); }
.ch-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-2);
  margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  font-size: var(--fs-md);
  transition: background var(--t-fast), color var(--t-fast);
}
.ch-row::before { line-height: 1; opacity: .75; width: 20px; text-align: center; flex: none; }
.ch-row.text::before { content: "#"; font-size: 20px; }
.channel-voice-icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.ch-row:hover { background: var(--bg-hover); color: var(--text); }
.ch-row.active { background: var(--bg-selected); color: var(--text-strong); }
.ch-row.unread { color: var(--text-strong); font-weight: 600; }
.ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ch-count {
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.ch-count span { padding: 1px 6px; background: var(--bg-elevated); color: var(--text-muted); }
.ch-count span + span { background: var(--bg-selected); color: var(--text); }
.ch-tool { display: none; border: none; background: none; color: var(--text-muted); font-size: 14px; line-height: 1; padding: 0 2px; }
.ch-row:hover .ch-tool { display: block; }
.ch-tool:hover { color: var(--text-strong); }
.ch-voice-status { font-size: var(--fs-xs); color: var(--text-muted); padding: 0 var(--space-2) 2px 36px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-voice-users { padding: 0 0 var(--space-1) 30px; }
.ch-voice-users li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
}
.ch-voice-users li:hover { background: var(--bg-hover); color: var(--text); }
.ch-voice-users li[draggable="true"] { cursor: grab; }
.ch-row.voice-drop-target { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--bg-selected); }
.ch-row.channel-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.ch-row.channel-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.vu-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vu-flag { font-size: 12px; }
/* Ações da moderação aparecem com fundo vermelho. */
.vu-flag.by-mod { background: var(--danger-strong); border-radius: 50%; padding: 1px 2px; }
.mute-indicator { display: inline-flex; align-items: center; flex: none; }
.mute-indicator .mi-icon { width: 14px; height: 14px; }

/* ---------- painel de voz e painel do usuário (cartões flutuantes) ---------- */
#voice-panel {
  margin: 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.vp-row { display: flex; align-items: center; gap: var(--space-2); }
#vp-signal {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--success);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
#voice-panel.reconnecting #vp-signal, #voice-panel.degraded #vp-signal { color: var(--warning); }
.vp-icon { width: 19px; height: 19px; flex: none; }
.vp-info { flex: 1; min-width: 0; }
.vp-status { color: var(--success); font-weight: 700; font-size: var(--fs-sm); }
.vp-where { color: var(--text-muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-buttons { gap: 6px; }
.vp-btn {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-base);
  color: var(--text);
  transition: background var(--t-fast);
}
.vp-btn:hover { background: var(--bg-selected); }
.vp-btn.active { background: var(--accent-soft); color: var(--text-strong); }
@media (pointer: coarse) { .vp-btn { min-height: 40px; } }
.vp-stats { font-size: 11px; color: var(--text-muted); }
/* Desktop: o painel de voz ocupa as colunas dos servidores e dos canais, como o painel do
   usuário logo abaixo. A lista de servidores reserva no fim a altura do painel (--vp-h). */
@media (min-width: 761px) {
  #voice-panel { position: relative; z-index: 3; margin-left: calc(var(--space-2) - 72px); }
  body:has(#voice-panel:not(.hidden)) #servers { padding-bottom: calc(12px + var(--vp-h, 0px)); }
}

#user-panel {
  margin: 0 var(--space-2) var(--space-2);
  padding: 6px var(--space-2);
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.me-info { flex: 1; min-width: 0; padding: 2px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.me-info:hover { background: var(--bg-hover); }
#me-name { font-weight: 700; color: var(--text-strong); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#me-avatar { cursor: pointer; }

/* ---------- avatares e selos ---------- */
.avatar {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-sm);
  text-transform: uppercase;
}
.avatar.big { width: 40px; height: 40px; font-size: 16px; }
.avatar.tiny { width: 24px; height: 24px; font-size: 11px; }
.avatar.huge { width: 80px; height: 80px; font-size: 32px; }
.avatar.status::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 3px solid var(--bg-sidebar);
}
#user-panel .avatar.status::after { border-color: var(--bg-elevated); }
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  background: var(--bg-selected);
  color: var(--text-muted);
  flex: none;
  text-transform: uppercase;
}
.badge.owner { background: var(--warning); color: #1b1b1f; }
.badge.mod { background: var(--accent); color: #fff; }
.badge.new { background: var(--accent); color: #fff; border-radius: var(--radius-pill); padding: 1px 7px; }
.live-badge { background: var(--danger-strong); color: #fff; font-weight: 700; font-size: 12px; border-radius: var(--radius-xs); padding: 2px 6px; letter-spacing: .03em; }
.live-badge.small { flex: none; white-space: nowrap; font-size: 9px; padding: 1px 4px; }

/* ---------- chat ---------- */
#chat { display: flex; flex-direction: column; min-width: 0; background: var(--bg-chat); }
#chat-header {
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  font-weight: 700;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border);
}
#chat-header .hash { color: var(--text-muted); font-size: 22px; font-weight: 400; }
.channel-status { font-weight: 400; font-size: 13px; color: var(--text-muted); padding-left: var(--space-3); margin-left: var(--space-1); border-left: 1px solid var(--border-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-status:empty { display: none; }
#status { background: var(--danger-strong); color: #fff; text-align: center; padding: 4px; font-size: 13px; }

#text-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-history { position: relative; display: flex; flex: 1; min-height: 0; }
#messages { flex: 1; overflow-y: auto; padding: var(--space-4) 0 var(--space-2); }
#jump-latest { position: absolute; inset-inline-end: var(--space-4); inset-block-end: var(--space-3); display: flex; align-items: center; gap: var(--space-2); box-shadow: var(--shadow-pop); }
.channel-intro { padding: var(--space-4) var(--space-4) var(--space-6); }
.channel-intro .intro-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  font-size: 36px;
  color: var(--text-strong);
  margin-bottom: var(--space-2);
}
.channel-intro h1 { margin: 0 0 4px; color: var(--text-strong); font-size: 28px; }
.channel-intro p { margin: 0; color: var(--text-muted); }
.empty { padding: var(--space-4); color: var(--text-muted); }

.date-divider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-6) var(--space-4) var(--space-2);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.date-divider::before, .date-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }

.msg {
  position: relative;
  display: flex;
  gap: var(--space-4);
  padding: 2px 48px 2px var(--space-4);
  margin-top: var(--space-4);
}
.msg.grouped { margin-top: 0; }
.msg:hover { background: rgba(0, 0, 0, .14); }
.msg-gutter { width: 40px; flex: none; }
.msg.grouped .msg-gutter { font-size: 11px; color: transparent; text-align: center; padding-top: 4px; }
.msg.grouped:hover .msg-gutter { color: var(--text-muted); }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: var(--space-2); }
.msg-author { font-weight: 700; cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-time { font-size: var(--fs-xs); color: var(--text-muted); }
.msg-content { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.375; }
.msg-content a { color: var(--link); }
.msg-actions {
  position: absolute;
  right: var(--space-4);
  top: -14px;
  display: none;
  gap: 2px;
  background: var(--bg-floating);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 2px;
  box-shadow: var(--shadow-card);
}
.msg:hover .msg-actions { display: flex; }
.msg-actions button { border: none; background: none; color: var(--text-muted); border-radius: var(--radius-sm); padding: 4px 8px; font-size: 13px; }
.msg-actions button:hover { background: var(--bg-hover); color: var(--text-strong); }
.msg-actions button.danger { color: var(--danger); }

/* ---------- compositor ---------- */
#composer { position: relative; padding: 0 var(--space-4); flex: none; }
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 4px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--t-fast);
}
.composer-box:focus-within { border-color: var(--border-strong); }
.composer-bar:not(.hidden) + .upload-chips:not(.hidden) + .composer-box,
.composer-bar:not(.hidden) ~ .composer-box,
.upload-chips:not(.hidden) + .composer-box { border-top-left-radius: 0; border-top-right-radius: 0; }
#input {
  flex: 1 1 0;
  min-width: 0;
  resize: none;
  border: none;
  outline: none;
  background: none;
  color: var(--text);
  font: inherit;
  padding: 7px 6px;
  max-height: 200px;
  line-height: 1.375;
}
#input::placeholder { color: var(--text-faint); }
.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 4px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.composer-bar strong { color: var(--text-strong); }
.composer-bar .icon-btn { width: 24px; height: 24px; font-size: 12px; }
.upload-chips {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom: 1px dashed var(--border-strong);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow-x: auto;
}
.composer-bar:not(.hidden) + .upload-chips { border-radius: 0; }
.chip {
  position: relative;
  width: 132px;
  flex: none;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chip img, .chip-ph { width: 100%; height: 88px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-selected); display: grid; place-items: center; color: var(--text-muted); }
.chip.uploading img { opacity: .5; }
.chip.error { border-color: var(--danger); }
.chip-name { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-floating);
  color: var(--danger);
  font-size: 11px;
  display: grid;
  place-items: center;
}
#text-view.dropping #messages { outline: 2px dashed var(--accent); outline-offset: -8px; border-radius: var(--radius); }

/* sugestões de menção (acima do compositor) */
.mention-suggest {
  position: absolute;
  left: var(--space-4);
  right: var(--space-4);
  bottom: calc(100% + 6px);
  z-index: 20;
  background: var(--bg-floating);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.ms-title { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 4px 8px 6px; }
.ms-item { display: flex; align-items: center; gap: var(--space-2); width: 100%; border: none; background: none; padding: 6px 8px; border-radius: var(--radius-xs); text-align: left; font-weight: 600; }
.ms-item .avatar { width: 24px; height: 24px; font-size: 11px; }
.ms-item.active, .ms-item:hover { background: var(--bg-hover); }

/* ---------- partes da mensagem ---------- */
.msg { flex-wrap: wrap; }
.msg.mentioned { background: rgba(250, 168, 26, .1); box-shadow: inset 2px 0 0 #f0b232; }
.msg.mentioned:hover { background: rgba(250, 168, 26, .14); }
.msg.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } }
.reply-preview {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 2px 20px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  min-width: 0;
}
.reply-preview .rp-line { width: 28px; height: 10px; margin-top: 8px; border-left: 2px solid var(--border-strong); border-top: 2px solid var(--border-strong); border-top-left-radius: 6px; flex: none; }
.reply-preview .rp-name { font-weight: 700; flex: none; }
.reply-preview .rp-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reply-preview:hover .rp-text { color: var(--text); }
.reply-preview .rp-deleted { font-style: italic; }
.avatar.micro { width: 16px; height: 16px; font-size: 9px; }
.mention {
  background: var(--accent-soft);
  color: #c9cdfb;
  border-radius: var(--radius-xs);
  padding: 0 3px;
  font-weight: 600;
  cursor: pointer;
}
.mention:hover { background: var(--accent); color: #fff; }
/* Como no Discord: toda menção é azulada, inclusive @todos; quem é mencionado vê a linha destacada. */
.mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; font-weight: 500; border-radius: 3px; padding: 0 2px; transition: background .1s, color .1s; }
.mention:hover { background: #5865f2; color: #fff; }
.mention.me { background: rgba(88, 101, 242, .3); color: #c9cdfb; }
.mention.me:hover { background: #5865f2; color: #fff; }
.edited { font-size: 11px; color: var(--text-faint); }
.attachments { display: flex; margin-top: 6px; }
.attachments.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 6px; }
.att-img {
  display: block;
  max-width: min(420px, 100%);
  max-height: 340px;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  cursor: zoom-in;
  background: var(--bg-elevated);
  object-fit: cover;
}
.attachments.grid .att-img { width: 100%; height: 200px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.reaction:hover { border-color: var(--border-strong); }
.reaction.mine { background: var(--accent-soft); border-color: var(--accent); }
.reaction .r-emoji { font-size: 16px; line-height: 1; }
.reaction .r-count { font-weight: 700; font-size: 13px; color: var(--text); }
.reaction.add { color: var(--text-muted); opacity: 0; }
.msg:hover .reaction.add { opacity: 1; }
.r-add-icon { width: 16px; height: 16px; }
.msg-actions .ma-icon { width: 18px; height: 18px; display: block; }
.msg-actions button { padding: 6px; }
.msg-editor { margin-top: 4px; }
.msg-editor textarea { min-height: 44px; resize: vertical; }
.editor-hint { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }
.link-btn { border: none; background: none; padding: 0; color: var(--link); font-size: inherit; }
.link-btn:hover { text-decoration: underline; }
.ch-ping {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger-strong);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------- seletor de emoji ---------- */
.emoji-picker {
  position: fixed;
  z-index: 60; /* acima de diálogos (.overlay = 40), que também abrem o seletor */
  width: 360px;
  max-width: calc(100vw - 16px);
  height: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-floating);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}
.ep-body { flex: 1; overflow-y: auto; }
.ep-title { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 8px 2px 4px; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ep-emoji { border: none; background: none; font-size: 22px; line-height: 1; padding: 6px 0; border-radius: var(--radius-sm); }
.ep-emoji:hover { background: var(--bg-hover); }
.ep-footer { font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: var(--space-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- visualizador de imagem ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, .86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
}
.lightbox img { max-width: 100%; max-height: calc(100% - 48px); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.lb-bar { display: flex; gap: var(--space-4); color: var(--text-muted); font-size: 13px; }
.lb-bar a { color: var(--text-strong); }
#typing { height: 24px; padding: 2px var(--space-4); font-size: 13px; color: var(--text-muted); flex: none; }

/* ---------- voz: palco ---------- */
[data-speaker] { transition: box-shadow .1s; }
.avatar.speaking { box-shadow: 0 0 0 3px var(--success); }
.tile.speaking::after { content: ""; position: absolute; inset: 0; border: 3px solid var(--success); border-radius: inherit; pointer-events: none; }
#voice-view { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #000; }
.vv-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); background: var(--bg-chat); border-bottom: 1px solid var(--border); }
.vv-head button { border: none; border-radius: var(--radius-sm); padding: 4px 10px; background: var(--bg-selected); color: var(--text); font-size: 13px; }
.vv-status-text { color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vv-lobby { margin: auto; text-align: center; padding: var(--space-6); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.vv-lobby h2 { margin: 0; color: var(--text-strong); font-size: var(--fs-xl); }
.vv-avatars { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; margin: var(--space-2) 0; }
.vv-stage { flex: 1; min-height: 0; min-width: 0; padding: var(--space-2); display: flex; overflow: auto; }
.vv-grid { flex: 1; min-width: 0; display: grid; gap: var(--space-2); grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-auto-rows: minmax(160px, 1fr); }
.vv-stage.has-focus { flex-direction: column; gap: var(--space-2); }
.vv-focus { flex: 1; min-height: 0; display: flex; }
.vv-focus .tile { flex: 1; }
.vv-strip { display: flex; gap: var(--space-2); height: 120px; flex: none; overflow-x: auto; }
.vv-strip .tile { width: 200px; flex: none; }
.tile { position: relative; background: var(--bg-elevated); border-radius: var(--radius-lg); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; }
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile.user video { object-fit: cover; }
#voice-view:fullscreen video { object-fit: contain; }
#voice-view:fullscreen .vv-strip, #voice-view:fullscreen .vv-head { display: none; }
#voice-view:fullscreen .vv-stage { padding: 0; }
#voice-view:fullscreen .tile { border-radius: 0; }
#voice-view:fullscreen .tile-tools { display: flex; }
.tile .avatar.tile-avatar { width: 80px; height: 80px; font-size: 32px; }
.vv-strip .tile .avatar.tile-avatar { width: 48px; height: 48px; font-size: 20px; }
.tile-bar { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .6); color: #fff; border-radius: var(--radius-sm); padding: 2px 8px; font-size: 13px; max-width: calc(100% - 16px); }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-stats { position: absolute; right: 8px; top: 8px; background: rgba(0, 0, 0, .6); color: #fff; border-radius: var(--radius-sm); padding: 2px 6px; font-size: 11px; }
.tile-stats:empty { display: none; }
#voice-view[data-watch-stats="off"] .tile-stats { display: none; }
#voice-view[data-watch-stats="activity"]:not(:fullscreen) .tile:not(:hover):not(:focus-within) .tile-stats { visibility: hidden; }
.tile-tools { position: absolute; right: 8px; bottom: 8px; display: flex; opacity: 0; pointer-events: none; gap: 4px; }
.tile:hover .tile-tools, .tile:focus-within .tile-tools, #voice-view:fullscreen .tile-tools { opacity: 1; pointer-events: auto; }
.tile-tools .tile-tool { display: grid; place-items: center; width: 38px; height: 36px; padding: 0; }
.vv-strip .tile-tools { bottom: 34px; max-width: calc(100% - 16px); flex-wrap: wrap; justify-content: flex-end; }
.vv-strip .tile-tools .tile-tool { flex: 0 0 26px; width: 26px; height: 30px; }
.vv-strip .tile-tools .vol-slider { flex: 1 0 100%; }
.vv-strip .tile-tools .vol-slider input { min-width: 0; width: auto; flex: 1 1 0; }
.tile-tools .tile-tool svg { width: 18px; height: 18px; }
@media (hover: none) {
  .tile-tools { opacity: 1; pointer-events: auto; }
  /* Toque: o volume da pessoa só aparece ao tocar no bloco (não cobre o avatar). */
  .tile.user:not(.show-tools) .tile-tools { opacity: 0; pointer-events: none; }
}
.tile-tools button { border: none; border-radius: var(--radius-sm); padding: 4px 8px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; }
.tile-tools button:hover { background: var(--accent); }
.stream-settings { position: absolute; right: 0; bottom: calc(100% + 8px); width: min(220px, 75vw); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-floating); }
.stream-settings .voice-field { margin: 0; }
#voice-view:fullscreen.watch-fullscreen { position: relative; width: 100%; height: 100%; }
#voice-view:fullscreen.watch-fullscreen .vv-stage { position: absolute; inset: 0; }
#voice-view:fullscreen.watch-fullscreen .tile.screen video { object-fit: contain; }
#voice-view:fullscreen.watch-fullscreen .vv-controls { position: absolute; z-index: 1; inset-inline: 0; bottom: 0; }
#voice-view:fullscreen.watch-fullscreen .tile-bar { top: 12px; bottom: auto; left: 12px; }
#voice-view:fullscreen.watch-fullscreen .tile-tools { right: 12px; bottom: 76px; }
#voice-view:fullscreen.watch-fullscreen .tile-stats { top: 12px; right: 12px; }
#voice-view:fullscreen.watch-fullscreen.controls-idle { cursor: none; }
#voice-view:fullscreen.watch-fullscreen.controls-idle :is(.vv-controls, .tile-bar, .tile-tools),
#voice-view:fullscreen.watch-fullscreen.controls-idle[data-watch-stats="activity"] .tile-stats { visibility: hidden; pointer-events: none; }
.tile-placeholder { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); color: var(--text-muted); text-align: center; padding: var(--space-3); }
.tile-placeholder p { margin: 0; }

/* ---------- membros ---------- */
#members { background: var(--bg-sidebar); padding: var(--space-2) var(--space-2) var(--space-4); overflow-y: auto; }
#members > .section-title { display: none; }
#member-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px var(--space-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: background var(--t-fast);
}
#member-list li:hover { background: var(--bg-hover); }
#member-list .name { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
#member-list li { gap: var(--space-2); }
#member-list li > .avatar { margin-right: var(--space-1); }
#member-list li.member-section {
  cursor: default;
  padding: var(--space-5) var(--space-2) var(--space-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text-muted);
}
#member-list li.member-section:first-child { padding-top: var(--space-3); }
#member-list li.member-section:hover { background: none; }
#member-list li.offline { opacity: .45; }

/* ---------- menu de contexto ---------- */
.menu {
  position: fixed;
  z-index: 60;
  min-width: 220px;
  max-width: 300px;
  background: var(--bg-floating);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.menu-item .mi-icon { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.menu-item .mi-label { flex: 1; }
.menu-item:hover { background: var(--bg-hover); color: var(--text-strong); }
.menu-item:hover .mi-icon { color: var(--text-strong); }
.menu-item.danger, .menu-item.danger .mi-icon { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-check {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid var(--text-muted);
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
}
.menu-check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.menu-sep { height: 1px; background: var(--border-strong); margin: 4px 6px; }

/* ---------- diálogos e campos ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  display: grid;
  place-items: center;
  padding: var(--space-4);
  z-index: 40;
  overflow-y: auto;
}
.card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-pop);
}
.card h2 { margin: 0 0 var(--space-2); color: var(--text-strong); text-align: center; font-size: var(--fs-lg); }
.card p { margin: 0 0 var(--space-4); }
.card input:not([type]), .card input[type="text"], .field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.card input:not([type]):focus, .card input[type="text"]:focus, .field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
textarea.field { resize: vertical; min-height: 70px; }
.field-label { display: block; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); margin: var(--space-3) 0 6px; }

/* Escolha do tipo de canal (texto / voz / posts) ao criar um canal */
.channel-type-options { border: 0; min-width: 0; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.channel-type-options legend { display: block; width: 100%; padding: 0; margin: 0 0 6px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); }
.channel-type-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.channel-type-choice:hover { background: var(--bg-hover); }
.channel-type-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.channel-type-choice input[type="radio"] { flex: none; margin-top: 3px; accent-color: var(--accent); }
.channel-type-choice > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.channel-type-title { display: flex; align-items: center; gap: 8px; color: var(--text-strong); }
.channel-type-title .mi-icon { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.channel-type-hash { display: inline-flex; width: 18px; flex: none; justify-content: center; color: var(--text-muted); font-weight: 700; }
.actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); }
.actions button { border: none; border-radius: var(--radius); padding: 10px 20px; background: none; color: var(--text); font-weight: 600; }
.actions button:hover { text-decoration: underline; }
.actions .primary { background: var(--accent); color: #fff; }
.actions .primary:hover { background: var(--accent-hover); text-decoration: none; }
.actions .primary:disabled { opacity: .5; cursor: not-allowed; }
.actions .primary.danger { background: var(--danger-strong); }
.actions .primary.danger:hover { background: #b52b30; }
.copy-row { display: flex; gap: var(--space-2); }
.copy-row input { flex: 1; min-width: 0; }
.copy-row button { border: none; border-radius: var(--radius); padding: 0 16px; background: var(--accent); color: #fff; font-weight: 600; }
.notice {
  margin: var(--space-4) 0;
  padding: var(--space-3) 14px;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.notice ul { list-style: disc; padding-left: 18px; margin: 6px 0 10px; }
.notice a, .policy a, .settings a { color: var(--link); }
.check { display: flex; gap: var(--space-2); align-items: flex-start; margin: var(--space-2) 0; font-size: var(--fs-sm); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }

/* listas dentro de configurações (denúncias, banidos) */
.item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) 14px;
  font-size: var(--fs-sm);
}
.item-head { display: flex; justify-content: space-between; gap: var(--space-2); color: var(--text-muted); font-size: var(--fs-xs); margin-bottom: 6px; }
.item-head strong { color: var(--text-strong); font-size: 13px; }
.item-quote { border-left: 3px solid var(--border-strong); padding: 4px 10px; margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.item-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.item-actions button { border: none; border-radius: var(--radius-sm); padding: 6px 12px; background: var(--bg-selected); color: var(--text); font-size: 13px; font-weight: 600; }
.item-actions button:hover { background: #34343c; }
.item-actions button.danger { background: var(--danger-strong); color: #fff; }
.empty-note { color: var(--text-muted); text-align: center; padding: var(--space-6) 0; }
.row-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) 14px;
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
  transition: background var(--t-fast);
}
.row-btn:hover { background: var(--bg-selected); }
.row-btn strong { display: block; color: var(--text-strong); margin-bottom: 2px; }
.row-btn span { font-size: 13px; color: var(--text-muted); }
.row-btn.danger strong { color: var(--danger); }

/* ---------- tela de configurações ---------- */
.settings {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: var(--bg-base);
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 760px) minmax(64px, 1fr);
  animation: settings-in .14s ease;
}
@keyframes settings-in { from { opacity: 0; transform: scale(1.01); } }
.settings-nav { display: flex; justify-content: flex-end; overflow-y: auto; padding: 60px var(--space-2) var(--space-6) var(--space-5); }
.settings-nav nav { width: 220px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav .nav-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); padding: 6px 10px; }
.settings-nav .nav-label:not(:first-child) { margin-top: var(--space-3); border-top: 1px solid var(--border); padding-top: var(--space-4); }
.settings-nav button {
  border: none;
  background: none;
  text-align: left;
  color: var(--text-muted);
  font-size: var(--fs-md);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.settings-nav button:hover { background: var(--bg-hover); color: var(--text); }
.settings-nav button.active { background: var(--bg-selected); color: var(--text-strong); }
.settings-nav button.danger { color: var(--danger); }
.settings-content { overflow-y: auto; padding: 60px var(--space-6) 80px; min-width: 0; }
.settings-content h1 { margin: 0 0 6px; font-size: var(--fs-lg); color: var(--text-strong); }
.settings-content .lead { margin: 0 0 var(--space-6); color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.5; }
.settings-content section { padding: var(--space-5) 0; border-top: 1px solid var(--border); }
.settings-content section:first-of-type { border-top: none; padding-top: 0; }
.settings-content h3 { margin: 0 0 6px; font-size: var(--fs-md); color: var(--text-strong); }
.settings-content .help { margin: 0 0 var(--space-3); color: var(--text-muted); font-size: var(--fs-sm); }
.settings-content .stack { display: flex; flex-direction: column; gap: var(--space-2); }
.settings-content .row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.settings-split { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-6); align-items: start; }
.settings-close { padding: 60px var(--space-4); display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; }
.settings-close button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: none;
  color: var(--text-muted);
  font-size: 18px;
  display: grid;
  place-items: center;
}
.settings-close button:hover { background: var(--bg-hover); color: var(--text-strong); border-color: var(--text-strong); }
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.toggle-row .help { margin: 4px 0 0; }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: var(--radius-pill); background: #4e5058; transition: background var(--t-fast); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--t-fast); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.swatches { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--text-strong); }

/* cartão de prévia (servidor / perfil) */
.preview-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
/* O cartão já é o modal inteiro — sem o card genérico (título + rodapé) por trás dele. */
.card:has(> .profile-detail-card) { padding: 0; background: transparent; border: 0; box-shadow: none; max-width: 420px; }
.preview-card .pc-close {
  position: absolute; inset-block-start: 8px; inset-inline-end: 8px; z-index: 2;
  background: rgba(0, 0, 0, .4); color: #fff; width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; font-size: 20px; line-height: 1;
}
.preview-card .pc-close:hover { background: rgba(0, 0, 0, .6); }
.preview-card .banner { height: 96px; background: linear-gradient(180deg, var(--accent), #3c45a5); }
.preview-card .pc-body { position: relative; padding: 0 var(--space-4) var(--space-4); }
.preview-card .pc-icon {
  position: relative;
  width: 72px;
  height: 72px;
  margin-top: -36px;
  border-radius: var(--radius-xl);
  border: 5px solid var(--bg-elevated);
  background: var(--bg-selected);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-strong);
}
.preview-card .pc-icon.round { border-radius: 50%; }
.preview-card .pc-status {
  position: absolute; inset-block-end: 2px; inset-inline-end: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text-faint); border: 3px solid var(--bg-elevated);
}
.preview-card .pc-status.on { background: var(--success); }
.preview-card h4 { margin: var(--space-2) 0 2px; font-size: var(--fs-lg); color: var(--text-strong); overflow-wrap: anywhere; }
.preview-card .pc-meta { color: var(--text-muted); font-size: 13px; display: flex; gap: var(--space-3); flex-wrap: wrap; }
.preview-card .pc-meta .dot::before { content: "●"; margin-right: 4px; font-size: 10px; }
.preview-card .pc-meta .dot.on::before { color: var(--success); }

/* ---------- página da política ---------- */
.policy-page { overflow-y: auto; height: 100vh; background: var(--bg-chat); }
.policy { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; line-height: 1.6; }
.policy h1 { color: var(--text-strong); margin-bottom: 4px; }
.policy h2 { color: var(--text-strong); font-size: 18px; margin-top: 28px; }
.policy ul { list-style: disc; padding-left: 22px; }
.policy code { background: var(--bg-elevated); padding: 1px 5px; border-radius: var(--radius-xs); }

/* ---------- página inicial (landing) ---------- */
.landing-page { overflow-y: auto; height: 100vh; background: var(--bg-chat); }
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: rgba(18, 18, 20, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.landing-brand { display: flex; align-items: center; gap: var(--space-2); color: var(--text-strong); font-size: var(--fs-lg); }
.landing-brand img { border-radius: var(--radius-sm); }
main:has(.landing-hero) { max-width: 980px; margin: 0 auto; padding: 0 var(--space-5) var(--space-6); }
.landing-hero { text-align: center; padding: 64px 0 48px; }
.landing-mark { border-radius: var(--radius-lg); margin-bottom: var(--space-4); }
.landing-hero h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.2; color: var(--text-strong); margin: 0 auto var(--space-4); max-width: 820px; }
.landing-sub { color: var(--text-muted); font-size: var(--fs-md); max-width: 560px; margin: 0 auto var(--space-5); }
.landing-cta { display: flex; justify-content: center; gap: var(--space-3); flex-wrap: wrap; }
.landing-cta .btn, .landing-nav .btn { padding: 12px 22px; font-size: var(--fs-md); }
.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  padding: var(--space-5) 0;
}
.landing-feature {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  text-align: start;
}
.landing-feature-icon { color: var(--accent-text); margin-bottom: var(--space-3); }
.landing-feature h2 { font-size: var(--fs-md); color: var(--text-strong); margin: 0 0 6px; }
.landing-feature p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.5; }
.landing-downloads { text-align: center; padding: var(--space-6) 0 48px; border-top: 1px solid var(--border); }
.landing-downloads h2 { font-size: var(--fs-xl); color: var(--text-strong); margin: 0 0 var(--space-2); }
.landing-download-cards { display: flex; justify-content: center; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-2); }
.landing-download-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 220px;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text-strong);
  text-align: start;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.landing-download-card:hover { background: var(--bg-hover); border-color: var(--accent); }
.landing-download-card span { display: flex; flex-direction: column; gap: 2px; }
.landing-download-card small { color: var(--text-muted); font-size: var(--fs-xs); }
.landing-note { margin-top: var(--space-4); font-size: var(--fs-xs); }
.landing-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5);
  color: var(--text-faint);
  font-size: var(--fs-xs);
  border-top: 1px solid var(--border);
}
.landing-footer a { color: var(--link); }

#toast {
  z-index: 70 !important;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(640px, calc(100vw - 32px));
  background: var(--danger-strong);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  z-index: 50;
}

/* ---------- Soundpad ---------- */
.soundpad {
  position: fixed;
  z-index: 30;
  width: 525px;
  max-width: calc(100vw - 16px);
  height: min(520px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: pop-in .12s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } }
.sp-head { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.sp-head .mi-icon { width: 19px; height: 19px; }
.sp-head .icon-btn.active { color: var(--text-strong); background: var(--bg-selected); }
.sp-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
}
.sp-search:focus-within { border-color: var(--accent); }
.sp-search input { flex: 1; min-width: 0; border: none; outline: none; background: none; color: var(--text); font: inherit; }
.sp-search-icon { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.sp-volume { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); font-size: 13px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.sp-volume input { flex: 1; accent-color: var(--accent); }
.sp-main { flex: 1; min-height: 0; display: flex; }
.sp-nav { width: 46px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0; border-right: 1px solid var(--border); overflow: hidden auto; scrollbar-width: none; }
.sp-nav-btn { position: relative; width: 32px; height: 32px; flex: none; border: none; border-radius: 9px; background: none; color: var(--text-muted); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.sp-nav-btn svg { width: 20px; height: 20px; }
.sp-nav-btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.sp-nav-btn.server { background: var(--bg-elevated); border-radius: var(--radius-lg); }
.sp-nav-btn.server img { border-radius: inherit; }
.sp-nav-btn[aria-current="true"] { color: var(--text-strong); box-shadow: 0 0 0 1px var(--accent); }
.sp-nav-btn[aria-current="true"]::before { content: ""; position: absolute; inset-block: 7px; inset-inline-start: -7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--text-strong); }
.sp-body { flex: 1; min-width: 0; overflow: hidden auto; padding: 0 10px 10px; }
.sp-section { padding-top: 9px; }
.sp-title { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); padding-bottom: var(--space-2); }
.sp-title-icon { width: 16px; height: 16px; }
.sp-count { margin-left: auto; font-weight: 400; font-size: var(--fs-xs); color: var(--text-faint); }
.sp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sp-tile {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  -webkit-touch-callout: none;
  user-select: none;
}
.sp-tile:hover { background: var(--bg-selected); border-color: var(--border-strong); }
.sp-tile:active { transform: scale(.97); }
.sp-tile.pressed { animation: sp-press .5s ease; }
@keyframes sp-press { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.sp-tile.fav::after { content: "★"; position: absolute; top: 2px; right: 5px; font-size: 10px; color: var(--warning); }
.sp-tile.add { border: 1px dashed var(--border-strong); background: none; color: var(--text-muted); }
.sp-tile.add:hover { color: var(--text-strong); border-color: var(--accent); }
.sp-tile:disabled { opacity: .5; cursor: not-allowed; }
.sp-emoji { font-size: 17px; line-height: 1; flex: none; }
.sp-name { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.sp-add-icon { width: 18px; height: 18px; flex: none; }
.sp-empty { grid-column: 1 / -1; font-size: 13px; color: var(--text-faint); padding: var(--space-1) 0; }
.sp-empty.big { text-align: center; padding: var(--space-6); }
.sp-foot { padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-faint); }
.sp-trim input[type="range"] { width: 100%; accent-color: var(--accent); }
/* Quem tocou um som: emoji flutuando sobre o avatar */
[data-speaker] { position: relative; }
.sp-bubble {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6));
  animation: sp-bubble 1.8s ease forwards;
}
.tile .sp-bubble { top: 10px; right: 10px; font-size: 28px; }
@keyframes sp-bubble { 0% { opacity: 0; transform: translateY(6px) scale(.6); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.avatar.sound-playing { box-shadow: 0 0 0 3px var(--accent); }
.vp-buttons .vp-btn { min-width: 0; }
#voice-panel.reconnecting .vp-status { color: var(--warning); }

/* ---------- barra de controles da chamada ---------- */
.vv-controls {
  flex: none;
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) max(var(--space-3), env(safe-area-inset-bottom));
}
.cb-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--bg-selected);
  color: var(--text-strong);
  display: grid;
  place-items: center;
  transition: background var(--t-fast), transform var(--t-fast);
}
.cb-btn:hover { background: #34343c; }
.cb-btn:active { transform: scale(.94); }
.cb-btn.on { background: var(--text-strong); color: var(--bg-base); }
.cb-btn.off { background: var(--danger-soft); color: var(--danger); }
.cb-btn.danger { background: var(--danger-strong); color: #fff; }
.cb-btn.danger:hover { background: #b52b30; }
.cb-icon { width: 22px; height: 22px; }
@media (max-width: 760px) {
  .vv-controls { gap: var(--space-2); justify-content: space-evenly; padding-left: var(--space-2); padding-right: var(--space-2); }
  .cb-btn { width: clamp(38px, 11vw, 48px); height: clamp(38px, 11vw, 48px); flex: none; }
  .vv-controls { flex-wrap: wrap; background: #000; }
}

/* ---------- barra de volume (e todos os controles deslizantes) ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent) var(--fill, 50%), var(--bg-selected) var(--fill, 50%));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: none; }
input[type="range"]:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.vol-slider { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.vol-slider input { flex: 1; min-width: 80px; }
.vol-mute { flex: none; width: 28px; height: 28px; border: none; border-radius: var(--radius-sm); background: none; color: var(--text-muted); display: grid; place-items: center; }
.vol-mute:hover { background: var(--bg-hover); color: var(--text-strong); }
.vol-icon { width: 18px; height: 18px; }
.vol-val { flex: none; width: 40px; text-align: right; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; color: var(--text-muted); }
.vol-slider.compact { background: rgba(0, 0, 0, .7); border-radius: var(--radius-sm); padding: 2px 8px 2px 2px; color: #fff; }
.vol-slider.compact input { width: 110px; flex: none; }
.vol-slider.compact .vol-mute, .vol-slider.compact .vol-val { color: #fff; }
.menu-slider { padding: 6px 8px 8px; }
.menu-slider-label { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }

/* ---------- arquivos no chat ---------- */
.att-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; align-items: flex-start; }
.att-list .attachments { margin-top: 0; }
.att-media { display: flex; flex-direction: column; gap: 6px; max-width: min(520px, 100%); }
.att-media.audio { width: min(420px, 100%); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-2); }
.att-media.audio audio { width: 100%; }
.att-media.audio .file-card { border: none; padding: 0; background: none; }
.att-video { max-width: 100%; max-height: 360px; border-radius: var(--radius); background: #000; }
.file-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: min(420px, 100%);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.file-card.compact { padding: 0; border: none; background: none; width: 100%; }
.fc-icon { width: 30px; height: 30px; flex: none; color: var(--accent-text); }
.fc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fc-name { color: var(--link); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-size { font-size: var(--fs-xs); color: var(--text-muted); }
.fc-warn { font-size: var(--fs-xs); color: var(--warning); }
.fc-dl { color: var(--text-muted); }
.chip-ph { flex-direction: column; gap: 4px; }
.chip-icon { width: 28px; height: 28px; }
.chip-ext { font-size: 11px; font-weight: 700; }

/* ---------- configurações: sons ---------- */
.range-row { display: flex; align-items: center; gap: var(--space-3); max-width: 420px; }
.range-row input { flex: 1; accent-color: var(--accent); }
.range-row span { width: 44px; text-align: right; color: var(--text-muted); font-size: var(--fs-sm); }
.sound-list { display: flex; flex-direction: column; }
.sound-row { display: flex; align-items: center; gap: var(--space-2); padding: 6px 0; border-bottom: 1px solid var(--border); }
.sound-row:last-child { border-bottom: none; }
.sound-label { flex: 1; }

/* ---------- cabeçalho: botões de gaveta ---------- */
#nav-toggle { display: none; position: relative; margin-left: -8px; }
#members-toggle { margin-left: auto; }
body.members-hidden #members-toggle { color: var(--text-muted); }
body:not(.members-hidden) #members-toggle { color: var(--text-strong); }
.nav-ping {
  position: absolute;
  right: -2px;
  bottom: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--danger-strong);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-chat);
}
#scrim { display: none; }

/* ---------- telas menores ---------- */
@media (min-width: 1001px) {
  body.members-hidden #app { grid-template-columns: 72px var(--sidebar-w, 248px) 1fr; }
  body.members-hidden #members { display: none; }
}
@media (max-width: 1000px) {
  #app { grid-template-columns: 72px 232px 1fr; }
  .settings { grid-template-columns: 200px minmax(0, 1fr) 64px; }
  .settings-nav nav { width: 180px; }
  .settings-split { grid-template-columns: 1fr; }
  /* Membros viram gaveta à direita */
  #members {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 25;
    transform: translateX(110%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-pop);
    padding-top: max(var(--space-2), env(safe-area-inset-top));
    padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
  }
  body.members-open #members { transform: none; }
  #scrim { display: block; position: fixed; inset: 0; z-index: 24; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.members-open #scrim, body.nav-open #scrim { opacity: 1; pointer-events: auto; }
}

/* ---------- celular (docs/DESIGN.md › Celular) ---------- */
@media (max-width: 760px) {
  #app { grid-template-columns: minmax(0, 1fr); padding-top: env(safe-area-inset-top); }
  /* Servidores + canais: gaveta à esquerda, como no app do Discord */
  #servers, #sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 25;
    transform: translateX(-110%);
    visibility: hidden;
    transition: transform .22s ease;
  }
  #servers { left: 0; width: 68px; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: env(safe-area-inset-bottom); }
  #sidebar {
    left: 68px;
    width: min(300px, calc(100vw - 68px - 48px));
    border-radius: var(--radius-lg) 0 0 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
  #user-panel {
    position: fixed;
    left: 68px;
    bottom: 0;
    width: min(300px, calc(100vw - 68px - 48px));
    z-index: 25;
    margin-bottom: max(var(--space-2), env(safe-area-inset-bottom));
    transform: translateX(-110%);
    visibility: hidden;
    transition: transform .22s ease;
  }
  body.nav-open #servers, body.nav-open #sidebar, body.nav-open #user-panel { transform: none; visibility: visible; }
  body.nav-open #sidebar { box-shadow: var(--shadow-pop); }
  .server-icon { width: 46px; height: 46px; }
  .server-icon::before { left: -11px; }
  #nav-toggle { display: grid; }
  #chat-header { padding: 0 var(--space-3); gap: 6px; }
  .channel-status { display: none; }
  #channel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

  /* Mensagens: ações por toque longo */
  .msg-actions { display: none !important; }
  .reaction.add { opacity: 1; }
  .msg { -webkit-touch-callout: none; }
  .attachments.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-img { max-width: 100%; max-height: 300px; }

  /* Compositor: alvos de toque de 40px e sem zoom do iOS (fonte >= 16px) */
  #composer { padding: 0 var(--space-2) max(var(--space-2), env(safe-area-inset-bottom)); }
  #input { font-size: 16px; }
  .composer-box .icon-btn { width: 36px; height: 40px; flex: none; }
  .composer-box { padding-inline: 3px; }
  #input::placeholder { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
  .mention-suggest { left: var(--space-2); right: var(--space-2); }
  input.field, textarea.field, select.field, .sp-search input { font-size: 16px; }
  #typing { height: 18px; font-size: 12px; }

  /* Painéis flutuantes viram folhas que sobem de baixo */
  .emoji-picker, .soundpad {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100%;
    max-width: none;
    height: min(70dvh, 560px);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-up .18s ease;
  }
  .ep-grid { grid-template-columns: repeat(7, 1fr); }
  .ep-emoji { font-size: 26px; padding: 8px 0; }
  .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-tile { min-height: 42px; }
  .menu:not(.chat-format-menu) {
    left: var(--space-2) !important;
    right: var(--space-2) !important;
    top: auto !important;
    bottom: max(var(--space-2), env(safe-area-inset-bottom)) !important;
    max-width: none;
    padding: var(--space-2);
    animation: sheet-up .15s ease;
  }
  .menu-item { padding: 12px 10px; font-size: var(--fs-md); }

  /* Chamada */
  .vv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(108px, auto); align-content: start; }
  .vv-grid .tile.screen { grid-column: 1 / -1; min-height: 144px; }
  .vv-grid .tile .tile-avatar { width: 44px; height: 44px; font-size: 18px; }
  .vv-grid .tile.user .tile-tools { bottom: 30px; max-width: calc(100% - 16px); }
  .vv-grid .tile-bar { font-size: 11px; }
  .vv-stage.has-focus { overflow: hidden; }
  .vv-strip { height: 96px; }
  .vv-strip .tile { width: 150px; }
  .tile-tools { display: flex; }
  .vv-head { flex-wrap: wrap; }

  /* Configurações em tela cheia: menu em cima, conteúdo embaixo */
  .settings { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; padding-top: env(safe-area-inset-top); }
  .settings-nav { justify-content: stretch; padding: var(--space-3) 56px var(--space-3) var(--space-3); max-height: 34dvh; border-bottom: 1px solid var(--border); }
  .settings-nav nav { width: 100%; }
  .settings-content { padding: var(--space-4) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom)); }
  .settings-close { position: absolute; top: env(safe-area-inset-top); right: 0; padding: var(--space-3); }
  .settings-close span { display: none; }

  /* Diálogos e visualizador */
  .overlay .card { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }
  .lightbox { padding: var(--space-3); }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Voz e vídeo ---------- */
.settings.voice-settings {
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  background: color-mix(in srgb, var(--bg-base) 76%, transparent);
  padding: clamp(16px, 6dvh, 72px) clamp(16px, 7vw, 96px);
}
.voice-settings-panel {
  width: min(1400px, 100%);
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}
.voice-settings .settings-nav {
  justify-content: stretch;
  padding: var(--space-6) var(--space-4);
  border-right: 1px solid var(--border);
}
.voice-settings .settings-nav nav { width: 100%; }
.voice-settings-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.voice-settings-header {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
}
.voice-settings-header button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}
.voice-settings-header button:hover { background: var(--bg-hover); color: var(--text-strong); }
.voice-settings-back, .voice-settings-mobile { display: none; }
.voice-settings-subnav {
  display: grid;
  margin: 0 0 var(--space-2) var(--space-3);
  border-left: 1px solid var(--border-strong);
}
.voice-settings-subnav button { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; min-height: 36px; }
.voice-settings-subnav button[aria-current] {
  box-shadow: inset 2px 0 var(--text-strong);
  color: var(--text-strong);
}
.voice-settings .settings-content {
  flex: 1;
  min-height: 0;
  padding: clamp(26px, 6dvh, 72px) clamp(16px, 5vw, 74px) 48px;
  overscroll-behavior: contain;
}
.voice-settings-stack { max-width: 700px; margin: 0 auto; }
.voice-settings-stack .voice-settings-section { padding: 40px 0; }
.voice-settings-stack .voice-settings-section:first-child { padding-top: 0; }
.voice-settings-section h2 { margin: 0 0 var(--space-6); font-size: var(--fs-xl); color: var(--text-strong); }
.voice-settings-section h3 { margin: var(--space-6) 0 var(--space-2); }
.voice-settings-section hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
.voice-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); }
.voice-device-column { display: grid; gap: var(--space-5); }
.voice-field { display: grid; gap: var(--space-2); min-width: 0; margin: 0; }
.voice-field > .field { width: 100%; text-overflow: ellipsis; }
.voice-settings-section > .voice-field, .voice-setting-group, .voice-disclosure-body .voice-field { margin-block: var(--space-4); }
.voice-settings-stack [hidden] { display: none !important; }
.voice-settings-section strong, .voice-profiles legend { font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.voice-settings-section .muted, .voice-setting-copy p { font-size: var(--fs-sm); line-height: 1.45; }
input[type="range"].voice-volume { width: 100%; height: 4px; margin: 12px 0; }
input[type="range"].voice-threshold { background: linear-gradient(90deg, var(--warning) var(--fill), var(--success) var(--fill)); }
.voice-mic-test { margin-top: var(--space-5); }
.voice-mic-controls { display: flex; align-items: center; gap: var(--space-4); }
.voice-mic-controls button { white-space: nowrap; }
.voice-mic-status { margin: var(--space-3) 0 0; }
.voice-meter {
  height: 24px;
  min-width: 0;
  flex: 1;
  background: linear-gradient(to right, var(--accent) var(--mic-level, 0%), var(--bg-selected) var(--mic-level, 0%));
  mask-image: repeating-linear-gradient(to right, currentColor 0 4px, transparent 4px 8px);
}
.voice-profiles { border: 0; padding: 0; margin: 0 0 var(--space-5); min-width: 0; }
.voice-profiles legend { margin-bottom: var(--space-2); }
.voice-radio { display: flex; align-items: start; gap: var(--space-3); min-height: 40px; padding-block: var(--space-2); cursor: pointer; }
.voice-radio input { accent-color: var(--accent); margin: 2px 0 0; width: 18px; height: 18px; }
.voice-radio span span, .voice-disclosure summary .muted { display: block; margin-top: var(--space-1); }
.voice-setting-row, .voice-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 54px;
  padding-block: var(--space-3);
}
.voice-setting-row .field { max-width: 52%; }
.voice-setting-copy p { color: var(--text-muted); margin: var(--space-1) 0 0; }
.voice-disclosure summary { cursor: pointer; list-style: none; }
.voice-disclosure summary::-webkit-details-marker { display: none; }
.voice-disclosure-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: var(--fs-lg);
}
.voice-disclosure[open] .voice-disclosure-icon { transform: rotate(180deg); }
.voice-disclosure-body { padding: 0 0 var(--space-2) var(--space-4); border-left: 1px solid var(--border); }
.voice-sound-row { border-bottom: 1px solid var(--border); }
.voice-preview { display: block; margin-top: 2px; padding: 4px 0; border: 0; background: transparent; color: var(--link); font-size: var(--fs-xs); }
.voice-preview:hover { text-decoration: underline; }
.voice-sound-warning { color: var(--warning); }
.voice-settings .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  .settings.voice-settings { padding: 0; }
  .voice-settings-panel { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; }
  .voice-settings .settings-nav { display: none; }
  .voice-settings-header { padding-top: env(safe-area-inset-top); justify-content: flex-start; }
  .voice-settings-header strong { flex: 1; }
  .voice-settings-back { display: block; font-size: var(--fs-xl); }
  .voice-settings-mobile { display: flex; gap: var(--space-1); padding: var(--space-1) var(--space-2); overflow-x: auto; border-bottom: 1px solid var(--border); }
  .voice-settings-mobile button { flex: none; min-height: 40px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); }
  .voice-settings-mobile button[aria-current] { background: var(--bg-selected); color: var(--text-strong); }
  .voice-settings .settings-content { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  .voice-settings-stack .voice-settings-section { padding-block: var(--space-6); }
  .voice-settings-grid { gap: var(--space-4) var(--space-2); }
}

@media (max-width: 430px) {
  .voice-settings-grid { grid-template-columns: minmax(0, 1fr); }
  .voice-device-column { gap: var(--space-2); }
}

.pair-device { display: grid; gap: var(--space-3); }
.pair-qr { display: block; width: min(240px, 100%); height: auto; margin: 0 auto; border-radius: var(--radius-sm); }
.pair-device p { margin: 0; font-variant-numeric: tabular-nums; }
.pair-scanner { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.pair-scanner p { margin: 0; }
.pair-scanner p:empty { display: none; }
.pair-scanner .pair-camera { width: 100%; max-height: min(35dvh, 240px); object-fit: contain; border-radius: var(--radius-sm); background: #101014; }
.card:has(.pair-scanner) { max-height: calc(100dvh - 32px); overflow-y: auto; }

.server-roles { display: grid; margin-top: var(--space-5); }
.server-role-row { display: flex; align-items: center; gap: var(--space-2); min-height: 56px; border-bottom: 1px solid var(--border); }
.server-role-row .btn { padding-inline: var(--space-2); }
.server-role-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.server-role-label p { margin: 2px 0 0; font-size: var(--fs-xs); }
.server-role-color { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--text-muted); }
.server-role-row button:disabled { opacity: .3; cursor: default; }
.server-role-row.role-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.server-role-row.role-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.custom-role-badge { color: var(--text-strong); background: var(--bg-selected); border-left: 3px solid var(--role-color); max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.caret, .category .chev { width: 15px; height: 15px; flex: none; }
#server-header[aria-expanded="true"] .caret { transform: rotate(180deg); }
.category .chev { width: 13px; height: 13px; }
.card:has(.share-panel) { max-width: 520px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.card:has(.share-panel) h2 { margin-bottom: var(--space-5); font-size: var(--fs-xl); }
.share-panel { display: grid; gap: var(--space-3); }
.share-hero {
  order: -1; display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto;
  border-radius: var(--radius-xl); border: 1px solid var(--border-strong); color: var(--accent-text);
  background: radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 70%), var(--bg-elevated);
}
.share-hero-icon { width: 30px; height: 30px; }
.share-context { order: -1; display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin: 0; color: var(--text-muted); font-size: var(--fs-sm); text-align: center; }
.share-context svg { flex: none; width: 16px; height: 16px; }
.share-section h3, .share-segments legend { margin: 0 0 var(--space-2); }
.share-quality { padding: var(--space-3); border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg-base); }
.share-notice svg { flex: none; width: 18px; height: 18px; color: var(--text-muted); }
.channel-type-title svg { width: 18px; height: 18px; flex: none; color: var(--accent-text); }
.share-dimensions { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-3); margin-top: var(--space-3); }
.share-segments { border: 0; margin: 0; padding: 0; min-width: 0; }
.share-segment-row { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.share-segment-row label { position: relative; flex: 1; text-align: center; }
.share-segment-row label + label { border-left: 1px solid var(--border-strong); }
.share-segment-row input { position: absolute; opacity: 0; }
.share-segment-row span { display: grid; place-items: center; min-height: 36px; color: var(--text); cursor: pointer; font-size: var(--fs-sm); }
.share-segment-row input:checked + span { background: var(--accent); color: var(--text-strong); font-weight: 700; }
.share-segment-row input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.share-segment-row input:disabled + span { opacity: .4; cursor: default; }
.card .share-notice { display: flex; gap: var(--space-2); color: var(--text-muted); font-size: var(--fs-xs); margin: 0; }
@media (max-width: 420px) { .share-dimensions { grid-template-columns: 1fr; } }

.appearance-frame { position: relative; }
.has-server-image { color: transparent !important; }
.appearance-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; pointer-events: none; }
.avatar.status::after { z-index: 1; }
#server-banner { flex: none; height: 96px; background: var(--bg-elevated); overflow: hidden; }
.appearance-editable { position: relative; }
.appearance-edit {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: white;
  background: #17171cee;
  border: 1px solid #fff4;
  border-radius: 50%;
}
.appearance-edit:hover { background: #303139; }
.appearance-edit .mi-icon { width: 16px; height: 16px; }
.pc-icon .appearance-edit { inset: auto -6px -6px auto; }
.appearance-help { margin: var(--space-2) 0 0; font-size: var(--fs-sm); }
@media (max-width: 1000px) { .appearance-preview { grid-row: 1; } }
.profile-roles { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.profile-connections { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.profile-connections h3, .profile-connections p { margin: 0; }
.profile-connection { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.profile-connection div { flex: 1; display: grid; min-width: 0; overflow-wrap: anywhere; }
.profile-connection div span { color: var(--text-muted); font-size: var(--fs-sm); }
.profile-connection-icon {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: -.02em;
}
.profile-edit { width: 100%; margin-top: var(--space-4); }
.card:has(.profile-connections) { max-height: calc(100dvh - 32px); overflow-y: auto; }
.discord-import-plan { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.discord-import-plan h3, .discord-import-plan p { margin: 0; }
.discord-import-plan > button { justify-self: start; }
.discord-import-channels { display: grid; gap: var(--space-2); min-width: 0; max-height: 220px; overflow-y: auto; margin: 0; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.discord-import-channels[hidden] { display: none; }
.discord-import-channels .check { overflow-wrap: anywhere; }
.settings-content .voice-field + .voice-field { margin-top: var(--space-3); }
.settings-content .voice-field + .btn { margin-top: var(--space-4); }

.appearance-clip { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.preview-card .banner, #server-banner { height: auto; aspect-ratio: 8 / 3; }
.crop-editor { display: grid; gap: var(--space-4); }
.crop-frame { position: relative; width: min(100%, 360px); margin: auto; overflow: hidden; border-radius: var(--radius); background: var(--bg-base); touch-action: none; cursor: grab; }
.crop-frame:active { cursor: grabbing; }
.crop-avatar { aspect-ratio: 1; }
.crop-banner { aspect-ratio: 8 / 3; width: 100%; }
.crop-image { width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; user-select: none; }
.crop-frame::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--text-strong); border-radius: inherit; pointer-events: none; }
.crop-avatar::after { border-radius: 50%; box-shadow: 0 0 0 120px rgba(0, 0, 0, .65); }
.crop-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-4); }
.crop-controls input { width: 100%; }
.card:has(.crop-editor) { max-height: calc(100dvh - 32px); overflow-y: auto; }

.emoji-picker { width: 470px; height: min(450px, calc(100dvh - 24px)); }
.ep-tabs, .ep-controls { display: flex; gap: var(--space-2); align-items: center; }
.ep-tab, .ep-category, .ep-star { border: 0; background: transparent; border-radius: var(--radius-sm); color: var(--text-muted); }
.ep-tab { padding: var(--space-2) var(--space-3); font-weight: 600; }
.ep-tab[aria-pressed="true"], .ep-category[aria-current="true"], .ep-tab:hover, .ep-category:hover, .ep-star:hover { background: var(--bg-selected); color: var(--text-strong); }
.ep-controls input { flex: 1; min-width: 0; }
.ep-main { display: flex; flex: 1; min-height: 0; }
.ep-categories { display: flex; flex: 0 0 50px; flex-direction: column; align-items: center; gap: 2px; overflow: hidden auto; scrollbar-width: thin; margin-right: var(--space-2); border-right: 1px solid var(--border); }
.ep-category { width: 34px; min-height: 31px; font-size: 17px; }
.ep-body { min-width: 0; }
.ep-footer { display: flex; align-items: center; gap: var(--space-2); }
.ep-preview { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ep-star { min-width: 36px; min-height: 32px; color: var(--warning); font-size: var(--fs-lg); }
.ep-star:disabled { opacity: .4; }
.ep-media { flex: 1; overflow: auto; display: grid; align-content: start; justify-items: start; gap: var(--space-3); padding: var(--space-4) var(--space-2); }
.ep-media h3, .ep-media p { margin: 0; }
.ep-media .voice-field { width: 100%; }
.gif-library { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.gif-back { align-self: flex-start; }
.gif-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: var(--space-2); padding: 2px; }
.gif-body > .gif-back:not([hidden]) { margin-bottom: 8px; }
.gif-grid .empty-note { grid-column: 1 / -1; }
.gif-category, .gif-tile { position: relative; min-width: 0; aspect-ratio: 16 / 9; }
.gif-category, .gif-pick { padding: 0; border: 0; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg-selected); color: white; }
.gif-category img, .gif-pick img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.gif-category span { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / 72%); font-weight: 700; }
.gif-category:hover span { background: rgb(0 0 0 / 54%); }
.gif-pick { position: relative; display: block; width: 100%; height: 100%; }
.gif-favorite { position: absolute; top: 5px; right: 5px; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: var(--bg-base); color: var(--text-strong); font-size: 18px; }
.gif-favorite[aria-pressed="true"] { color: var(--warning); }
.gif-tools { flex: 0 0 auto; border-top: 1px solid var(--border); }
.gif-tools summary { padding: 8px 14px; color: var(--text-muted); cursor: pointer; font-size: var(--fs-sm); }
.gif-tools .ep-media { max-height: 155px; }
.gif-giphy-footer { display: flex; flex: none; align-items: center; flex-wrap: wrap; gap: 4px var(--space-2); padding: 6px 14px; border-top: 1px solid var(--border); font-size: var(--fs-xs); }
.gif-giphy-footer img { display: block; width: 112px; max-height: 26px; object-fit: contain; object-position: left; }
.giphy-embed { margin-block: var(--space-2); }
.giphy-embed iframe { display: block; width: min(100%, 360px); aspect-ratio: 4 / 3; border: 0; pointer-events: none; }
.emoji-picker.media-picker-popover { width: 496px; height: min(485px, calc(100dvh - 24px)); padding: 0; gap: 0; overflow: hidden; background: var(--bg-base); }
.media-picker-popover .ep-tabs { flex: none; padding: 12px 14px 8px; }
.sticker-picker { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.media-picker-popover .ep-controls { flex: none; padding: 0 14px 12px; border-bottom: 1px solid var(--border); }
.media-picker-popover > .ep-controls:first-child { padding-top: 12px; }
.sticker-picker .ep-controls .btn { min-height: 38px; padding-inline: 12px; }
.media-search { position: relative; flex: 1; min-width: 0; }
.media-search .mi-icon { position: absolute; inset: 0 auto 0 11px; margin-block: auto; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.media-search .field { width: 100%; min-height: 38px; padding-inline-start: 34px; background: transparent; }
.media-picker-popover .ep-main { display: grid; grid-template-columns: 47px minmax(0, 1fr); }
.media-picker-popover .ep-categories { margin: 0; padding: 6px 0; gap: 4px; scrollbar-width: none; }
.media-picker-popover .ep-category { position: relative; display: grid; flex: none; place-items: center; width: 34px; height: 34px; padding: 0; }
.media-picker-popover .ep-category .mi-icon { width: 18px; height: 18px; }
.media-picker-popover .ep-category[aria-current="true"]::before { content: ""; position: absolute; inset-block: 7px; inset-inline-start: -6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--text-strong); }
.media-picker-popover .ep-body { min-height: 0; padding: 6px 8px 10px 9px; overflow-x: hidden; }
.media-picker-popover .ep-title { min-height: 32px; display: flex; align-items: center; padding: 0 2px; text-transform: none; color: var(--text-strong); font-size: var(--fs-sm); }
.media-picker-popover > .ep-footer { min-height: 50px; padding: 6px 12px; }
.sticker-group + .sticker-group { margin-top: 10px; }
.sticker-group-title { display: flex; align-items: center; gap: 5px; min-height: 32px; padding-inline: 2px; color: var(--text-strong); font-size: var(--fs-sm); font-weight: 650; cursor: pointer; }
.sticker-group-title::-webkit-details-marker { display: none; }
.sticker-group-title .mi-icon { width: 15px; height: 15px; }
.sticker-chevron { width: 14px; height: 14px; transform: rotate(-90deg); }
.sticker-group[open] .sticker-chevron { transform: none; }
.sticker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(4px, 1.5vw, 9px); }
.sticker-tile { min-width: 0; aspect-ratio: 1; padding: 4px; border: 0; border-radius: var(--radius-sm); background: transparent; }
.sticker-tile:hover, .sticker-tile:focus-visible { background: var(--bg-selected); }
.sticker-tile img, .sticker-footer img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sticker-footer { flex: none; min-height: 50px; padding: 6px 12px 6px 0; }
.sticker-footer-mark { display: grid; flex: 0 0 47px; place-items: center; }
.sticker-footer-mark .mi-icon, .sticker-remove .mi-icon { width: 18px; height: 18px; }
.sticker-footer img { flex: none; width: 34px; height: 34px; }
.sticker-caption { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sticker-caption strong { overflow: hidden; text-overflow: ellipsis; color: var(--text-strong); }
.sticker-footer .ep-star { min-width: 30px; }
@media (max-width: 760px) {
  .emoji-picker.media-picker-popover { width: 100%; height: min(70dvh, 485px); padding-bottom: env(safe-area-inset-bottom); }
}
.lb-bar { align-items: center; flex-wrap: wrap; }
.release-notice {
  position: fixed;
  z-index: 20;
  inset-inline-end: var(--space-4);
  inset-block-end: 78px;
  width: min(360px, calc(100% - 32px));
  max-height: calc(100dvh - 100px);
  overflow: auto;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-floating, #1c1d22);
  box-shadow: 0 8px 28px #0006;
}
.release-notice h2 { margin: 0; font-size: var(--fs-lg); }
.release-notice ul { display: grid; gap: var(--space-2); padding-inline-start: 20px; }
.release-notice p { margin: 2px 0 0; }
.composer-gif-icon { font-size: 9px; font-weight: 800; border: 1px solid currentColor; border-radius: var(--radius-xs); padding: 1px 2px; }
@media (max-width: 420px) { .ep-grid { grid-template-columns: repeat(7, 1fr); } }

select.field {
  appearance: none;
  padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a4a5ad' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 16px;
}
.voice-disclosure-icon { width: 36px; height: 36px; }
.voice-disclosure-icon svg { width: 17px; height: 17px; }
@media (pointer: coarse) { .voice-disclosure-icon { width: 40px; height: 40px; } }
@media (max-width: 760px) { .emoji-picker { width: 100%; max-width: none; } }
@media (forced-colors: active) {
  select.field { appearance: auto; background-image: none; padding-inline-end: 12px; }
}

#direct-messages { flex-shrink: 0; }
.member-details { flex: 1; min-width: 0; }
.member-heading { display: flex; align-items: center; gap: 6px; }
.member-voice { display: flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: .75rem; }
.member-voice svg { width: 13px; height: 13px; color: var(--green); }
.profile-social, .profile-call, .private-pane { display: grid; gap: 10px; }
.profile-call { padding: 10px; border-radius: 8px; background: var(--bg-hover); }
.profile-custom-status { overflow-wrap: anywhere; }
.private-contacts { display: flex; gap: 6px; flex-wrap: wrap; max-height: 120px; overflow: auto; }
.private-history { height: min(280px, 37vh); overflow: auto; }
.private-message { padding: 6px 4px; }
.private-message time { margin-left: 8px; font-size: .75rem; color: var(--text-muted); }
.private-message p { margin: 2px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.private-open #server-header, .private-open #server-banner, .private-open #channels,
.private-open #members, .private-open #chat > :not(.private-pane) { display: none; }
.private-open #chat { grid-column: 3 / -1; }
.private-open #server-list .server-icon.active:not(:hover) { background: var(--bg-elevated); color: var(--text); }
.private-open #server-list .server-icon.active:not(:hover)::before { height: 0; }
.private-open .private-pane { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(220px, 29%); grid-template-rows: auto minmax(0, 1fr); gap: 0; }
.private-bar { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 16px; min-height: 48px; border-bottom: 1px solid var(--border); }
.private-bar > strong { margin-inline-end: 8px; }
.private-bar > .mi-icon, .profile-social-actions .mi-icon, .ms-item > .mi-icon { width: 18px; height: 18px; flex: none; }
.private-bar .btn { padding: 5px 9px; }
.private-bar .selected { background: var(--bg-selected); color: var(--text-strong); }
.private-bar .primary.selected { color: #fff; background: var(--accent); }
.friend-filters { display: flex; gap: 2px; }
.friend-filter { background: transparent; color: var(--text-muted); border: 0; border-radius: var(--radius-sm); padding: 6px 14px; }
.friend-filter:hover { background: var(--bg-hover); color: var(--text); }
.friend-filter.selected { background: var(--accent); color: #fff; font-weight: 700; }
.friend-add { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; }
.friend-add .mi-icon { width: 16px; height: 16px; }
.private-menu { display: none; }
.private-nav { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.private-nav h2, .private-friend-list h2 { font-size: .82rem; margin: 14px 0 4px; color: var(--text-muted); }
.private-nav .private-contacts { display: grid; align-content: start; gap: 3px; max-height: none; }
.private-nav-contact { display: flex; align-items: center; text-align: start; gap: 8px; padding: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text); }
.private-nav-contact:is(:hover, .active) { background: var(--bg-selected); }
.private-nav-contact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.private-main, .private-aside { min-width: 0; min-height: 0; padding: 16px; overflow: auto; }
.private-aside { border-inline-start: 1px solid var(--border); background: var(--bg-sidebar); }
.private-aside h2 { font-size: 1.05rem; margin-bottom: 10px; }
.private-aside > .btn { margin-top: 12px; width: 100%; }
.private-pane:has(.private-history) .private-main { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.private-intro { display: grid; justify-items: start; gap: 8px; padding: 10px 0 20px; border-bottom: 1px solid var(--border); }
.private-history { flex: 1; height: auto; overflow: auto; }
.private-message { display: flex; gap: 12px; padding: 10px 6px; }
.private-message:hover { background: var(--bg-hover); }
.private-message-body { min-width: 0; flex: 1; }
.private-contact-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 4px; border-top: 1px solid var(--border); }
.private-contact-row > div:not(.avatar) { flex: 1; min-width: 110px; display: grid; }
.private-aside .private-contact-row { border: 1px solid var(--border); background: var(--bg-floating); border-radius: 8px; margin-bottom: 8px; padding-inline: 8px; }
.private-add-friend { display: flex; align-items: center; gap: 10px; margin-block: 12px; }
.private-add-friend .field, .private-main > .field { min-width: 0; width: 100%; }
.private-main textarea { flex: 1; resize: vertical; }
.pc-details:not(:empty) { padding: var(--space-3) 16px 16px; }
.user-panel-popover {
  position: fixed; z-index: 60; width: 300px; overflow: hidden;
  background: var(--bg-floating); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
}
.user-panel-popover .preview-card { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.user-panel-popover-menu { position: static; width: auto; min-width: 0; max-width: none; border: 0; border-radius: 0; box-shadow: none; padding: 6px; border-top: 1px solid var(--border); }
.profile-detail-card .profile-social, .profile-detail-card .profile-role-section, .profile-detail-card .profile-connections { border-top: 1px solid var(--border); margin-block-start: 14px; padding-block-start: 12px; }
.profile-social-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.profile-social-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.preview-card .btn { padding: 7px 12px; font-size: var(--fs-xs); }
.profile-common { display: flex; flex-direction: column; gap: 8px; }
.profile-shared-row { display: flex; align-items: center; gap: 8px; }
.profile-shared-stack { display: flex; }
.profile-shared-stack > * {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--bg-elevated);
  background: var(--bg-selected); display: grid; place-items: center; font-size: .62rem; overflow: hidden;
}
.profile-shared-stack > * + * { margin-inline-start: -8px; }
.profile-shared-stack .profile-server-icon { border-radius: 7px; }
.profile-server-icon img { width: 100%; height: 100%; object-fit: cover; }
.profile-shared-more { color: var(--text-muted); font-weight: 700; }
.profile-shared-label { color: var(--text-muted); font-size: var(--fs-sm); }
.profile-connection a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.profile-quick-message { display: flex; gap: 8px; align-items: flex-end; margin-top: 2px; }
.profile-quick-message textarea { flex: 1; min-height: 38px; max-height: 120px; resize: none; }
.profile-quick-message .icon-btn { flex: none; }
.profile-role-section h3 { margin-bottom: 6px; font-size: .82rem; }
.chat-format-line { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1lh; }
.chat-format-line:is(h1,h2,h3) { margin: .35em 0 .2em; }
.chat-format-line h1, h1.chat-format-line { font-size: 1.45em; }
h2.chat-format-line { font-size: 1.25em; }
h3.chat-format-line { font-size: 1.1em; }
blockquote.chat-format-line { border-inline-start: 3px solid var(--text-muted); padding-inline-start: 10px; margin: 3px 0; }
.chat-format-list { margin-block: 4px; padding-inline-start: 24px; }
.chat-code-block, .chat-inline-code { background: var(--bg-floating); border: 1px solid var(--border); border-radius: 6px; }
.chat-code-block { max-width: min(100%, 680px); margin-block: 6px; }
.chat-code-block pre { margin: 0; overflow: auto; padding: 10px; }
.chat-code-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; border-bottom: 1px solid var(--border); font-size: .75rem; }
.chat-inline-code { display: inline-flex; max-width: 100%; align-items: baseline; gap: 5px; padding-inline: 4px; }
.chat-inline-code code { overflow-wrap: anywhere; min-width: 0; }
.chat-copy-code, .chat-spoiler { border: 0; border-radius: 4px; padding: 2px 5px; background: var(--bg-selected); color: var(--text); font-size: .75rem; }
.chat-copy-code:hover, .chat-spoiler:hover { background: var(--bg-hover); }
.chat-poll, .chat-poll-editor, .chat-record { display: grid; justify-items: stretch; gap: 8px; }
#modal-card:has(.chat-poll-editor) { width: min(100%, 480px); max-width: 480px; background: var(--bg-base); }
#modal-card:has(.chat-poll-editor) .dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
#modal-card:has(.chat-poll-editor) .dialog-heading h2 { margin: 0; text-align: start; }
#modal-card:has(.chat-poll-editor) .dialog-heading button { padding: 0; font-size: 24px; }
.chat-poll-editor { gap: 16px; }
.poll-question, .poll-answers-list { display: grid; gap: 6px; }
.poll-label { font-size: var(--fs-sm); font-weight: 650; color: var(--text-strong); }
.poll-question .field, .poll-answer-row .field { background: transparent; }
.poll-counter { justify-self: end; font-size: var(--fs-xs); }
.poll-answers { min-width: 0; margin: 0; padding: 0; border: 0; }
.poll-answers legend { margin-bottom: 8px; padding: 0; }
.poll-answer-row { display: flex; align-items: center; gap: 8px; padding-inline: 9px 4px; border: 1px solid var(--border-strong); border-radius: 8px; }
.poll-answer-row:focus-within { border-color: var(--accent); }
.poll-answer-row .field { flex: 1; min-width: 0; border: 0; padding-inline: 0; box-shadow: none; }
.poll-answer-row .field:focus { box-shadow: none; }
.poll-answer-number { flex: none; width: 20px; text-align: center; color: var(--text-muted); font-size: var(--fs-xs); }
.poll-remove-answer:disabled { opacity: .35; }
.poll-remove-answer .mi-icon, .poll-add-answer .mi-icon, .poll-card-heading .mi-icon { width: 16px; height: 16px; flex: none; }
.poll-add-answer { display: flex; align-items: center; gap: 6px; margin: 8px 0 0 auto; padding: 6px 10px; }
.poll-validation { color: var(--danger); font-size: var(--fs-sm); }
.poll-validation:empty { display: none; }
.chat-poll-editor .poll-rules { margin: 0; font-size: var(--fs-xs); }
.chat-poll { width: min(410px, 100%); padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-floating); margin-block: 8px; }
.poll-card-heading, .poll-card-footer { display: flex; gap: 8px; align-items: center; color: var(--text-muted); font-size: var(--fs-sm); }
.poll-card-footer { justify-content: space-between; flex-wrap: wrap; margin-top: 2px; }
.poll-card-footer .btn { padding: 4px 8px; }
.chat-poll-option { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--text); background: linear-gradient(90deg, var(--bg-selected) var(--vote-share), transparent var(--vote-share)); text-align: start; }
.chat-poll-option:not(:disabled):hover { border-color: var(--accent); }
.chat-record-bar { display: flex; align-items: center; gap: 8px; padding: 8px; min-height: 48px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-elevated); }
.voice-wave { display: flex; align-items: center; gap: 1px; flex: 1; min-width: 0; height: 26px; overflow: hidden; }
.voice-wave > span { min-width: 1px; flex: 1; border-radius: 2px; background: var(--text-muted); }
.voice-record-time, .voice-attachment-time { flex: none; color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: .78rem; }
.chat-record-bar.recording .voice-record-time::before { content: "●"; color: var(--danger); margin-inline-end: 3px; font-size: .68rem; }
.voice-record-send { color: var(--accent-text); font-size: 1.15rem; }
.voice-record-send:disabled { opacity: .4; }
.chat-record-bar .icon-btn .mi-icon { width: 18px; height: 18px; }
.voice-attachment-player { display: flex; align-items: center; gap: 8px; width: min(285px, 100%); min-height: 44px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 24px; background: var(--bg-elevated); }
.voice-attachment-play { width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; color: #fff; background: var(--accent); font-size: .75rem; }
.voice-attachment-timeline { position: relative; flex: 1; min-width: 20px; }
.voice-attachment-timeline .voice-wave { position: relative; height: 18px; overflow: hidden; }
.voice-attachment-timeline .voice-wave::after { position: absolute; inset: 0 auto 0 0; width: var(--played, 0%); content: ""; background: var(--accent); opacity: .36; }
.voice-seek { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.voice-attachment-timeline:focus-within { outline: 1px solid var(--accent); }
.voice-attachment-rate { border: 0; border-radius: 4px; color: var(--text-muted); background: var(--bg-selected); font-size: .7rem; font-weight: 600; }
.voice-attachment-volume { width: 24px; height: 26px; }
.voice-attachment-volume .mi-icon { width: 17px; height: 17px; }
#modal-card:has(.sound-upload-title) { background: var(--bg-base); }
.sound-upload-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sound-upload-title h2 { text-align: start; margin: 0; }
.sound-upload-title .icon-btn { font-size: 24px; }
.sound-browse { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 5px 4px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: transparent; color: var(--text); }
.sound-browse .muted { flex: 1; min-width: 0; overflow: hidden; text-align: start; text-overflow: ellipsis; white-space: nowrap; }
.sound-browse-label { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; background: var(--bg-selected); font-size: .8rem; font-weight: 600; }
.sound-browse:hover .sound-browse-label { background: var(--bg-hover); }
.sound-upload-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; margin: 12px 0 14px; }
.sound-upload-grid .sp-emoji-pick { display: flex; align-items: center; gap: 8px; text-align: start; min-width: 0; }
.sound-upload-grid .sp-emoji-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-upload-grid .mi-icon, .sound-browse .mi-icon { width: 16px; height: 16px; flex: none; }
.sound-upload-help { font-size: .75rem; margin-top: 6px; }
.sound-upload-actions { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
.sound-upload-actions .secondary { background: var(--bg-selected); border: 1px solid var(--border); }
.sound-preview { margin-bottom: 16px; }
.sound-preview h3 { font-size: .88rem; margin-bottom: 7px; }
.sound-wave-display { display: flex; gap: 10px; align-items: center; border-radius: 6px; background: #060606; padding: 9px; }
.sound-wave-tools { display: grid; justify-items: center; width: 44px; flex: none; }
.sound-wave-length { font-size: .68rem; color: var(--success); }
.sound-wave-bars { flex: 1; min-width: 0; height: 60px; display: flex; align-items: center; gap: 1px; border-inline: 2px solid var(--accent); padding-inline: 3px; }
.sound-wave-bars span { flex: 1; min-width: 0; background: var(--text-strong); opacity: .8; }
@media (max-width: 1000px) {
  .private-open #chat { grid-column: 3 / -1; }
  .private-open .private-pane { grid-template-columns: minmax(0, 1fr); }
  .private-aside { display: none; }
}
@media (max-width: 760px) {
  .private-open #chat { grid-column: 1 / -1; }
  .private-menu { display: grid; }
  .private-bar { gap: 4px; padding-inline: 8px; }
  .private-main { padding: 10px; }
}
.role-picker-list { max-height: 260px; overflow: auto; margin-top: 8px; }
.server-roles > [hidden], .role-picker-list > [hidden] { display: none; }
.audit-list > [hidden] { display: none; }
#member-search { width: calc(100% - 24px); margin: 0 12px 4px; }

/* Editor de cargos */
#modal-card:has(.role-editor) { width: min(100%, 640px); max-width: 640px; }
#modal-card:has(.role-editor) > h2 { text-align: left; }
.role-editor-tabs { display: flex; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid var(--border); }
.role-editor-tabs button {
  padding: 10px 2px;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
}
.role-editor-tabs button[aria-pressed="true"] { color: var(--text-strong); border-bottom-color: var(--accent); }
.role-editor-panel { padding-top: 20px; }
.role-editor-panel[hidden], .role-permission-list > [hidden] { display: none; }
.role-editor-panel h3 { font-size: .9rem; margin: 20px 0 8px; }
.role-editor-panel > p { margin: 0 0 12px; }
.role-palette { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-swatch, .role-color-custom { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 7px; }
.role-swatch[aria-pressed="true"] { outline: 2px solid var(--text-strong); outline-offset: 2px; }
.role-color-custom { width: 48px; background: var(--bg-elevated); padding: 3px; cursor: pointer; }
.role-preview { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 8px; background: var(--bg-hover); overflow-wrap: anywhere; }
.role-picker-list .role-preview + .role-preview { margin-top: 6px; }
.role-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.role-toggle-row > span { display: grid; gap: 4px; }
.role-toggle-row .muted { font-size: .8125rem; }
.role-toggle { appearance: none; position: relative; flex: none; width: 40px; height: 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-hover); cursor: pointer; }
.role-toggle::before { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.role-toggle:checked { background: var(--accent); }
.role-toggle:checked::before { transform: translateX(18px); }
.role-list-layout, .role-list-actions, .role-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.role-list-layout > .field { flex: 1 1 220px; }
.role-list-layout > .role-list { flex: 1 0 100%; margin-top: 6px; }
.role-row-actions { gap: 8px; }
.role-list .server-role-row { flex-wrap: wrap; padding: 8px 0; }
.role-list .server-role-label { min-width: 115px; }
.appearance-menu { min-width: min(224px, calc(100vw - 16px)); padding: 7px; }
.appearance-menu .menu-item { min-height: 40px; gap: 10px; }
.appearance-menu .menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.avatar-loading { color: transparent !important; background: var(--bg-hover) !important; }
.vp-share-audio { font-size: var(--fs-xs); color: var(--text-muted); }
.vp-share-audio.active { color: var(--success); }
.tile-share-audio { flex: none; font-size: var(--fs-xs); }
.share-audio-options { display: grid; gap: 8px; }
.share-audio-options [hidden] { display: none; }
.share-audio-options .share-audio-help { margin: 0; font-size: var(--fs-sm); }
#mini-stream { position: fixed; top: 62px; right: 16px; z-index: 19; width: min(300px, 54vw); aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #101014; box-shadow: var(--shadow-pop); }
.mini-stream-open { position: relative; width: 100%; height: 100%; display: block; padding: 0; border: 0; background: #101014; color: #fff; }
.mini-stream-open video { display: block; width: 100%; height: 100%; object-fit: contain; }
.mini-stream-label { position: absolute; inset: auto 0 0; padding: 8px; text-align: left; font-size: var(--fs-xs); background: linear-gradient(transparent, #000b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stream-close { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 6px; border: 0; color: #fff; background: #000a; font-size: 20px; line-height: 1; }
.mini-stream-restore { position: absolute; top: 5px; right: 37px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 6px; border: 0; color: #fff; background: #000a; }
.mini-stream-restore svg { width: 16px; height: 16px; }
.mini-stream-resize { position: absolute; z-index: 2; touch-action: none; }
.mini-stream-resize:is([data-edge="n"], [data-edge="s"]) { inset-inline: 12px; height: 5px; cursor: ns-resize; }
.mini-stream-resize:is([data-edge="w"], [data-edge="e"]) { inset-block: 12px; width: 5px; cursor: ew-resize; }
.mini-stream-resize:is([data-edge="nw"], [data-edge="ne"], [data-edge="sw"], [data-edge="se"]) { width: 12px; height: 12px; }
.mini-stream-resize:is([data-edge="n"], [data-edge="nw"], [data-edge="ne"]) { top: 0; }
.mini-stream-resize:is([data-edge="s"], [data-edge="sw"], [data-edge="se"]) { bottom: 0; }
.mini-stream-resize:is([data-edge="w"], [data-edge="nw"], [data-edge="sw"]) { left: 0; }
.mini-stream-resize:is([data-edge="e"], [data-edge="ne"], [data-edge="se"]) { right: 0; }
.mini-stream-resize:is([data-edge="nw"], [data-edge="se"]) { cursor: nwse-resize; }
.mini-stream-resize:is([data-edge="ne"], [data-edge="sw"]) { cursor: nesw-resize; }
.mini-stream-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#vp-signal { position: relative; }
#vp-ping { position: absolute; z-index: 20; bottom: calc(100% + 8px); left: 0; transform: translateY(4px); opacity: 0; visibility: hidden; pointer-events: none; white-space: pre-line; width: max-content; max-width: 280px; padding: 5px 8px; color: var(--text-strong); background: var(--bg-floating); border: 1px solid var(--border); border-radius: 6px; font-size: var(--fs-xs); transition: opacity 140ms ease, transform 140ms ease, visibility 140ms; }
#vp-signal:is(:hover, :focus-visible) #vp-ping { opacity: 1; visibility: visible; transform: none; }
#mini-stream:not([hidden]) { animation: mini-stream-in 180ms ease-out; }
@keyframes mini-stream-in { from { opacity: 0; scale: .97; } }
.mini-stream-open { cursor: grab; touch-action: none; user-select: none; }
.mini-stream-open video { pointer-events: none; }
#mini-stream.dragging .mini-stream-open { cursor: grabbing; }
:is(.btn, .icon-btn, .vp-btn, .menu-item, .server-icon, .mini-stream-close) { transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, scale 140ms ease; }
:is(.btn, .icon-btn, .vp-btn, .mini-stream-close):active:not(:disabled) { scale: .97; }
@media (prefers-reduced-motion: reduce) {
  :is(#mini-stream:not([hidden]), .overlay .card, .menu, .soundpad) { animation: none; }
  :is(.btn, .icon-btn, .vp-btn, .menu-item, .server-icon, .mini-stream-close, #vp-ping) { transition: none; }
  :is(.btn, .icon-btn, .vp-btn, .mini-stream-close):active:not(:disabled) { scale: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .menu, .soundpad { animation: pop-in 150ms ease-out; }
  .ep-emoji { transition: background-color 150ms ease, transform 170ms ease; }
  .ep-emoji:is(:hover, :focus-visible) { transform: translateY(-2px) scale(1.15) rotate(-5deg); }
  .ep-emoji:active { transform: scale(.93); }
  .reaction .r-emoji { display: inline-block; transition: transform 170ms ease; }
  .reaction:is(:hover, :focus-visible) .r-emoji { transform: translateY(-2px) scale(1.16); }
  .reaction:active .r-emoji { transform: scale(.92); }
}

.animated-emoji { position: relative; display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.16em; }
.animated-emoji img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; pointer-events: none; }
.ep-preview .animated-emoji { font-size: 1.2em; }
[data-emoji-motion="on"] .animated-emoji.loaded img { opacity: 1; }
[data-emoji-motion="on"] .animated-emoji.loaded .animated-emoji-text { opacity: 0; }
.ep-emoji-motion { border: 0; border-radius: var(--radius-sm); color: var(--text-muted); background: var(--bg-hover); padding: 4px 6px; font-size: var(--fs-xs); }
.ep-emoji-credits { color: var(--text-muted); font-size: var(--fs-xs); }

.vv-strip > .tile:first-child { margin-inline-start: auto; }
.vv-strip > .tile:last-child { margin-inline-end: auto; }
.tile.user .tile-tools { inset-inline: 8px; bottom: 30px; justify-content: center; align-items: center; flex-wrap: wrap; }
.tile.user .tile-tools .vol-slider.compact { width: min(188px, 100%); flex: 0 1 auto; gap: 4px; padding-inline: 4px 6px; }
.tile.user .vol-slider.compact input { width: auto; min-width: 0; flex: 1 1 0; }
.tile.user .vol-slider.compact .vol-val { width: 34px; }

.release-notice { width: min(370px, calc(100% - 24px)); padding: 14px; max-height: calc(100dvh - 92px); }
.release-notice h2 { font-size: 1rem; line-height: 1.3; }
.release-notice ul { list-style: none; margin: 10px 0; padding: 0; gap: 0; }
.release-notice li { padding: 7px 0; border-top: 1px solid var(--border); font-size: .8125rem; line-height: 1.35; }
.release-notice li p { margin-top: 3px; }
.release-notice-actions { display: flex; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border); }
.release-notice .release-dismiss { min-height: 32px; padding: 5px 11px; font-size: .75rem; }

.release-burst { position: fixed; inset: 0; overflow: hidden; z-index: 2000; pointer-events: none; }
.release-burst > span { position: absolute; top: -18px; animation: release-fall var(--fall) var(--delay) linear both; }
.release-burst i {
  display: block;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  background: #a5abff;
  animation: release-flutter var(--flutter) var(--delay) ease-in-out infinite alternate;
}
.release-burst span:nth-child(4n) i { background: var(--warning); }
.release-burst span:nth-child(4n + 1) i { background: var(--success); border-radius: 50%; }
.release-burst span:nth-child(4n + 2) i { background: var(--danger); }
@keyframes release-fall {
  0% { transform: translate3d(0, 0, 0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx), calc(100dvh + 24px), 0); }
}
@keyframes release-flutter {
  0% { transform: translateX(calc(-1 * var(--sway))) rotate3d(1, 1, 0, 0deg) rotate(-25deg); }
  50% { transform: translateX(0) rotate3d(1, 1, 0, 155deg) rotate(12deg); }
  100% { transform: translateX(var(--sway)) rotate3d(1, 1, 0, 320deg) rotate(40deg); }
}
@media (prefers-reduced-motion: reduce) {
  .release-burst i { animation-name: release-sway; animation-duration: 1200ms; }
  @keyframes release-sway {
    from { transform: translateX(calc(-1 * var(--sway))) rotate(-8deg); }
    to { transform: translateX(var(--sway)) rotate(8deg); }
  }
}

.chat-format-menu { display: flex; flex-flow: row wrap; min-width: 0; width: max-content; max-width: min(470px, calc(100vw - 16px)); gap: 2px; padding: 4px; }
.chat-format-action { display: grid; place-items: center; min-width: 28px; min-height: 32px; padding: 2px 5px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); font-weight: 600; }
.chat-format-action:is(:hover, :focus-visible) { background: var(--bg-hover); color: var(--text-strong); }
.chat-format-action:nth-child(2) { font-style: italic; }
.chat-format-action:nth-child(3) { text-decoration: underline; }
.chat-format-action:nth-child(4) { text-decoration: line-through; }

.community-text { min-height: 86px; resize: vertical; }
.community-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; margin: 16px 0; }
.community-metrics > div { display: grid; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
.community-metrics strong { font-size: 1.5rem; }
.server-tag { display: inline-block; margin-inline-start: 5px; padding: 1px 5px; border-radius: 4px; background: var(--bg-floating); font-size: .7rem; font-weight: 700; }
.chat-link-card { display: grid; gap: 6px; margin-block: 6px; max-width: min(430px, 100%); padding: 12px; border: 1px solid var(--border); border-inline-start: 3px solid var(--accent); border-radius: var(--radius-md); background: var(--bg-floating); }
.chat-link-title { font-weight: 700; overflow-wrap: anywhere; }
.chat-link-thumbnail { width: 100%; max-height: 230px; object-fit: cover; border-radius: 6px; }
.chat-video-play, .chat-link-card iframe { display: block; position: relative; padding: 0; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; overflow: hidden; background: #000; }
.chat-video-play img { width: 100%; height: 100%; object-fit: cover; }
.chat-video-play span { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); padding: 7px 14px; border-radius: 14px; background: #000b; color: #fff; }
.chat-invite-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chat-invite-icon { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; }
.chat-invite-icon img { width: 100%; height: 100%; object-fit: cover; }
.chat-invite-details { flex: 1; min-width: 100px; overflow-wrap: anywhere; }
.invite-confirmation ol { display: grid; gap: 6px; margin: 10px 0; padding-inline-start: 22px; text-align: start; }
.update-available { position: fixed; z-index: 21; inset-block-start: 58px; inset-inline-end: 12px; width: min(340px, calc(100% - 24px)); padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-floating); box-shadow: var(--shadow-pop); }
.update-available p { margin: 4px 0 10px; font-size: var(--fs-sm); }
.update-available .release-notice-actions { gap: 8px; }
.update-available .btn { min-height: 32px; padding: 5px 10px; }

/* Configurações dos canais de voz e Engajamento */
.channel-settings-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.settings-content .channel-settings-columns .voice-field { margin: 0; }
.channel-overview .voice-field { position: relative; }
.channel-overview .voice-volume { accent-color: var(--accent); }
.channel-range-value { position: absolute; inset-inline-end: 0; inset-block-start: 0; color: var(--text-strong); font-size: var(--fs-sm); }
.channel-range-scale { display: flex; justify-content: space-between; color: var(--text-muted); font-size: var(--fs-xs); }
.channel-camera-quality { border: 0; padding: 0; margin: var(--space-5) 0 0; }
.channel-camera-quality legend { color: var(--text-strong); font-weight: 600; margin-bottom: var(--space-2); }
.channel-camera-quality label { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; }
.channel-camera-quality input { accent-color: var(--accent); }
.channel-settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); border-top: 1px solid var(--border); padding-top: var(--space-4); }
.settings-content .copy-row + .btn { margin-top: var(--space-3); }
@media (max-width: 540px) {
  .channel-settings-columns { grid-template-columns: 1fr; }
}

.channel-permissions-editor { margin-top: var(--space-4); }
.channel-permission-row { display: flex; align-items: start; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.channel-permission-row p { margin: 5px 0 0; font-size: var(--fs-sm); }
.channel-permission-options { flex: none; display: flex; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.channel-permission-options button { width: 34px; height: 32px; padding: 0; border: 0; background: var(--bg-input); color: var(--text); }
.channel-permission-options .deny { color: var(--danger); }
.channel-permission-options .allow { color: var(--success); }
.channel-permission-options [aria-pressed=true] { background: var(--bg-selected); box-shadow: inset 0 0 0 1px currentColor; }
.channel-permission-options .deny[aria-pressed=true] { background: var(--danger-soft); }

.private-bar-tools { margin-inline-start: auto; display: flex; align-items: center; gap: var(--space-2); }
.private-bar-tools .private-search { width: clamp(130px, 19vw, 240px); min-height: 34px; }
.private-icon .mi-icon, .private-friends .mi-icon { width: 18px; height: 18px; }
.private-friends { min-height: 32px; font-size: var(--fs-sm); }
.private-composer { display: flex; align-items: center; flex: none; margin: 0; }
.private-composer.hidden { display: none; }
.private-composer textarea.field {
  flex: 1; width: 0; min-width: 50px; min-height: 36px; max-height: 120px; padding: 8px 4px;
  border: 0; border-radius: 0; resize: none; background: transparent; box-shadow: none;
}
.private-composer .icon-btn { flex: none; width: 30px; height: 30px; }
.private-search-results { flex: none; max-height: 35vh; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-base); }
.private-search-result { padding: 8px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.private-search-result time { margin-inline-start: 8px; font-size: var(--fs-xs); }
.private-search-result p { margin: 2px 0; white-space: pre-wrap; }
.private-profile-details { margin: 12px var(--space-4) 0; padding-top: 10px; padding-bottom: var(--space-3); border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.private-profile-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.private-profile-counts span { padding: 4px 7px; border-radius: var(--radius-sm); background: var(--bg-selected); }
.private-attachment { display: block; max-width: min(100%, 420px); max-height: 320px; margin-top: 6px; border-radius: var(--radius); }
.private-call { display: grid; justify-items: center; gap: 10px; background: var(--bg-base); }
body > .private-call { position: fixed; z-index: 90; top: 12px; right: 12px; width: min(310px, calc(100vw - 24px)); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.private-open .private-pane.has-private-call { grid-template-rows: auto auto minmax(0, 1fr); }
.private-pane.has-private-call > .private-main { grid-column: 1 / -1; }
.private-pane.has-private-call > .private-aside { display: none; }
.private-call-inline { grid-column: 1 / -1; padding: var(--space-4); border-bottom: 1px solid var(--border); }
.private-call-faces { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 6px; }
.private-call-face { position: relative; display: grid; }
.private-call-indicators:not(:empty) { position: absolute; bottom: -3px; right: -5px; display: flex; gap: 3px; padding: 3px 4px; border-radius: var(--radius-pill); background: var(--bg-base); color: var(--danger); }
.private-call-indicators .mi-icon { width: 15px; height: 15px; display: block; }
.private-call-faces.has-video { padding: 0 6px 4px; }
.private-call .private-call-faces.has-video .avatar { width: 30px; height: 30px; }
.private-call-faces .avatar { width: clamp(44px, 10dvh, 80px); height: clamp(44px, 10dvh, 80px); }
.private-call-ringing { position: relative; display: grid; }
.private-call-ringing::after { content: ""; position: absolute; inset: -5px; border: 2px solid #fff; border-radius: 50%; pointer-events: none; animation: private-ring-fade .95s ease-in-out infinite alternate; }
@keyframes private-ring-fade { from { opacity: .1; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .private-call-ringing::after { animation-duration: 1.6s; }
}
.private-call-status { color: var(--text-muted); font-size: var(--fs-sm); text-align: center; }
.private-call-actions, .private-call-media-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.private-call-media-controls { padding: 3px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-floating); }
.private-call-button { width: 42px; height: 38px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); color: var(--text-strong); background: var(--bg-elevated); cursor: pointer; }
.private-call-button:hover { background: var(--bg-selected); }
.private-call-button[aria-pressed=true] { background: var(--bg-selected); color: var(--accent-text); }
.private-call-button[hidden] { display: none; }
.private-call-button.danger { background: var(--danger); color: #fff; }
.private-call-button.answer { background: var(--green); color: #fff; }
body > .private-call .private-call-faces .avatar { width: 52px; height: 52px; }
body > .private-call .private-call-button { width: 34px; height: 34px; }
.private-call .private-call-watch:not([hidden]) { display: grid; place-items: center; }
.private-call-button .mi-icon { width: 18px; height: 18px; }
.private-call-stage:not(.hidden) { width: min(100%, 900px); display: flex; justify-content: center; align-items: center; gap: 8px; min-width: 0; }
.private-call-tile { position: relative; display: flex; flex: 1; min-width: 0; max-width: 420px; background: #000; border-radius: var(--radius); overflow: hidden; }
.private-call-tile[hidden] { display: none; }
.private-call-tile video { display: block; width: 100%; max-height: min(28dvh, 230px); object-fit: contain; }
.private-call-tile.screen { order: -1; flex: 3; max-width: 100%; }
.private-call .private-call-tile-fullscreen { position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; background: rgb(24 24 27 / .9); }
body > .private-call .private-call-stage video { max-height: 125px; }
.private-call:fullscreen { display: flex; flex-direction: column; align-items: center; box-sizing: border-box; width: 100%; height: 100%; background: #000; padding: 8px 12px 12px; }
.private-call:fullscreen .private-call-stage { flex: 1; width: 100%; min-height: 0; }
.private-call:fullscreen .private-call-tile { height: 100%; max-width: none; }
.private-call:fullscreen .private-call-tile video { height: 100%; max-height: none; }
.private-call:fullscreen .private-call-tile.focused { flex: 1; }
@media (max-width: 640px) and (orientation: portrait) {
  .private-call:fullscreen .private-call-stage { flex-direction: column; }
  .private-call:fullscreen .private-call-tile { width: 100%; height: auto; min-height: 0; }
}

.channel-permission-layout { display: grid; grid-template-columns: minmax(150px, 32%) minmax(0, 1fr); gap: var(--space-5); margin-top: var(--space-4); }
.channel-permission-sidebar { min-width: 0; }
.channel-permission-sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); color: var(--text-muted); font-size: var(--fs-sm); }
.channel-permission-picker { position: relative; }
.channel-permission-picker summary { display: grid; place-items: center; list-style: none; cursor: pointer; width: 28px; height: 28px; font-size: 20px; }
.channel-permission-picker summary::-webkit-details-marker { display: none; }
.channel-permission-choices { position: absolute; z-index: 2; top: 100%; left: 0; width: min(250px, 60vw); padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-floating); box-shadow: var(--shadow-pop); }
.channel-permission-choices .field { width: 100%; margin-bottom: var(--space-2); }
.channel-permission-choice-list, .channel-permission-subjects { max-height: min(45vh, 360px); overflow: auto; }
.channel-permission-choice-list > .muted { padding: 4px 8px; font-size: var(--fs-sm); }
.channel-permission-subject { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 34px; padding: 4px 8px; text-align: start; background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; }
.channel-permission-subject:hover, .channel-permission-subject[aria-current=true] { background: var(--bg-selected); color: var(--text-strong); }
.channel-permission-subject-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-permission-subject .avatar { width: 22px; height: 22px; font-size: var(--fs-xs); }
.channel-permission-unsaved { margin-inline-start: auto; color: var(--accent-text); }
.channel-permission-layout .channel-permissions-editor { margin-top: 0; min-width: 0; }
.channel-permission-layout .channel-permissions-editor > h3 { margin-block: 4px var(--space-3); overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .channel-permission-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .channel-permission-subjects { max-height: 145px; }
  .channel-permission-choices { left: auto; right: 0; }
}

.server-icon.has-unread:not(.active):not(:hover)::before { height: 8px; }
.notification-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-inline-start: auto; border-radius: var(--radius-pill); color: #fff; background: var(--danger-strong); font-size: 11px; font-weight: 700; }
#direct-messages .notification-count { position: absolute; right: -3px; bottom: -3px; z-index: 1; box-shadow: 0 0 0 2px var(--bg-base); }
.private-bar [data-friend-tab=pending] .notification-count { margin-inline-start: 6px; }
#social-notifications { display: grid; gap: 8px; position: fixed; z-index: 95; right: 12px; bottom: 70px; width: min(300px, calc(100vw - 24px)); pointer-events: none; }
.social-notification { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-floating); box-shadow: var(--shadow-pop); padding: 4px; pointer-events: auto; }
.social-notification-link { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 7px; background: transparent; color: var(--text); border: 0; border-radius: var(--radius-sm); cursor: pointer; text-align: start; }
.social-notification-link:hover { background: var(--bg-hover); }
.social-notification-link > span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.social-notification .icon-btn { align-self: flex-start; flex: none; }
#server-voice-card { position: fixed; z-index: 92; width: max-content; max-width: min(245px, calc(100vw - 16px)); display: grid; gap: 8px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-floating); box-shadow: var(--shadow-pop); pointer-events: none; overflow-wrap: anywhere; }
#server-voice-card[hidden] { display: none; }
.server-voice-card-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 7px; font-size: var(--fs-sm); color: var(--text-muted); }
.server-voice-card-row > .mi-icon { width: 16px; height: 16px; }
.server-voice-card-faces { grid-column: 2; display: flex; align-items: center; gap: 4px; }
.server-voice-card-faces .avatar { width: 23px; height: 23px; font-size: var(--fs-xs); }

/* Layout dos posts e indicadores da chamada */
.forum-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 16px; }
.forum-heading h2 { margin: 0; overflow-wrap: anywhere; }
.forum-heading ~ .btn { align-self: flex-start; margin: 0 16px 12px; }

/* Só uma das duas áreas fica visível por vez: a lista de posts ou a conversa (thread aberta). */
#text-view.forum-view:not(.forum-open) .chat-history { display: none; }
#text-view.forum-view.forum-open #forum-index { display: none; }

#forum-index:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) 0;
}
.forum-toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.forum-toolbar input[type="search"] { flex: 1; min-width: 160px; }
.forum-toolbar .forum-create { flex: none; white-space: nowrap; }

.forum-new-post:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.forum-new-post textarea.field { min-height: 110px; }
.forum-form-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.forum-form-actions .forum-file-status { flex: 1; min-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.forum-filters { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.forum-filters select.field { width: auto; min-width: 0; padding-block: 7px; font-size: var(--fs-sm); }

.forum-posts {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: var(--space-4);
}
.forum-posts[data-layout="grid"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-3); align-content: start; }
.forum-posts > .empty { padding: var(--space-6) 0; text-align: center; }

.forum-post {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-strong);
  text-align: start;
  overflow-wrap: anywhere;
}
.forum-post:hover, .forum-post[aria-pressed="true"] { background: var(--bg-hover); border-color: var(--border-strong); }
.forum-post-detail { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.forum-post-detail strong { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.forum-post-preview { display: block; color: var(--text-muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forum-post-preview b { color: var(--text); font-weight: 600; }
.forum-post-meta { display: flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: var(--fs-xs); }
.forum-post-meta .mi-icon { width: 13px; height: 13px; }
.forum-thumbnail { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex: none; }

.forum-posts[data-layout="grid"] .forum-post { grid-template-columns: 1fr; padding: 0 0 13px; overflow: hidden; }
.forum-posts[data-layout="grid"] .forum-thumbnail { order: -1; width: 100%; height: 120px; border-radius: 0; }
.forum-posts[data-layout="grid"] .forum-post-detail { padding: 13px 16px 0; }
.vv-departure { flex: none; padding: 6px 12px; color: var(--text-muted); background: var(--bg-elevated); font-size: var(--fs-sm); }
.stream-viewers { flex: none; }
.stream-viewers summary { display: flex; gap: 3px; align-items: center; cursor: pointer; list-style: none; }
.stream-viewers summary::-webkit-details-marker { display: none; }
.stream-viewers summary svg { width: 14px; height: 14px; }
.stream-viewers-list {
  position: absolute;
  z-index: 3;
  left: 0;
  bottom: calc(100% + 4px);
  width: max-content;
  max-width: min(250px, 75vw);
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-floating);
  overflow-wrap: anywhere;
}
#voice-view:fullscreen .stream-viewers-list { top: calc(100% + 4px); bottom: auto; }
.tile.screen .tile-bar { z-index: 1; }
.tile.screen .tile-tools { z-index: 2; }
.vv-strip .tile.screen .tile-tools { bottom: 32px; }
.vv-strip .tile-share-audio { display: none; }
.vv-focus .tile-tools { max-width: calc(100% - 16px); flex-wrap: wrap; justify-content: flex-end; }
.vv-focus .tile-tools .vol-slider { max-width: 100%; }
.vv-focus .tile-tools .vol-slider input { min-width: 0; }

@media (max-width: 760px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  #servers { width: 58px; }
  #sidebar { left: 58px; width: min(300px, calc(100% - 86px)); }
  #sidebar > #voice-panel { flex-shrink: 0; }
  #channels { min-height: 0; overflow-x: hidden; }
  #server-banner { max-height: 16dvh; }
  #text-view, #voice-view, .vv-stage { min-width: 0; min-height: 0; }
  .composer-box, .private-composer { gap: 0; align-items: center; }
  .composer-box .icon-btn, .private-composer .icon-btn { width: 34px; min-height: 40px; }
  :is(#input, .private-composer textarea.field) { flex: 1 1 0; min-width: 0; font-size: 16px; }
  #input { overflow-x: hidden; }
  .vv-stage { overflow-x: hidden; overscroll-behavior: contain; }
  .vv-controls { gap: 5px; flex-wrap: nowrap; }
  .vv-controls .cb-btn { width: clamp(34px, 10vw, 48px); height: clamp(34px, 10vw, 48px); }
  .vv-focus .tile.screen .tile-tools { bottom: 33px; }
  #voice-view:fullscreen.watch-fullscreen .tile-tools { bottom: max(62px, calc(env(safe-area-inset-bottom) + 52px)); }
  .tile-tools .tile-tool { width: 34px; height: 34px; }
  .tile-tools .vol-slider { width: auto; max-width: 100%; gap: 3px; }
  .tile-tools .vol-slider input { width: min(15vw, 62px); }
  .vv-strip .tile-tools .vol-slider { flex-basis: 100%; }
  .tile-share-audio { display: none; }
}

/* Criar canal, medidor do microfone e palco em tela cheia */
.card.create-channel-card { width: min(480px, 100%); background: var(--bg-floating); }
.create-channel-card > .center { text-align: start; margin-top: 0; }
.create-channel-card .dialog-heading { margin-bottom: 6px; }
.create-channel-card .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.create-channel-card .actions button { width: 100%; }
.voice-threshold-meter { --mic-level: 0%; width: 100%; }
.voice-threshold-meter input[type="range"].voice-threshold {
  background: linear-gradient(90deg, rgb(255 255 255 / 0.46) var(--mic-level), transparent var(--mic-level)),
    linear-gradient(90deg, var(--warning) var(--fill), var(--success) var(--fill));
}
#voice-view:fullscreen.watch-fullscreen .vv-controls { pointer-events: none; }
#voice-view:fullscreen.watch-fullscreen .vv-controls .cb-btn { pointer-events: auto; }

@media (min-width: 1100px) {
  #text-view.forum-view.forum-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 38%);
    grid-template-rows: minmax(0, 1fr) auto auto;
  }
  #text-view.forum-view.forum-open #forum-index { display: flex; grid-area: 1 / 1 / -1 / 2; }
  #text-view.forum-view.forum-open :is(.chat-history, #composer, #typing) { grid-column: 2; border-inline-start: 1px solid var(--border); }
}

@media (min-width: 1100px) {
  #voice-view:fullscreen.watch-fullscreen .tile-tools {
    bottom: calc(max(var(--space-3), env(safe-area-inset-bottom)) + 6px);
  }
}

/* ---------- favoritos, mensagens fixadas e silenciar ---------- */
#pinned-toggle { position: relative; }
#pinned-toggle.has-pins { color: var(--text-strong); }
#pinned-toggle.has-pins::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}
.pinned-dialog, .favorites-dialog {
  width: min(420px, 90vw); max-height: min(70vh, 560px); overflow-y: auto;
  padding: var(--space-4); background: var(--bg-elevated); border-radius: var(--radius);
}
.pinned-dialog h3, .favorites-dialog h3 { margin: 0 0 var(--space-3); }
.favorites-dialog h4 { margin: var(--space-4) 0 var(--space-2); font-size: var(--fs-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }
.favorites-dialog h4:first-of-type { margin-top: 0; }
.pinned-row { display: grid; gap: 6px; padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.pinned-row:first-of-type { border-top: 0; }
.pinned-row-top { display: grid; gap: 2px; overflow-wrap: anywhere; }
.pinned-row-top span { color: var(--text-muted); font-size: var(--fs-sm); }
.pinned-row-actions { display: flex; gap: 8px; }
.pinned-row-actions .btn { padding: 5px 10px; font-size: var(--fs-xs); }
.ch-row.muted { opacity: .55; }
.ch-mute-icon { width: 14px; height: 14px; flex: none; margin-inline-start: auto; color: var(--text-faint); }
.private-icon.active { color: var(--warning); }
.friend-add .private-icon.active { color: inherit; }

/* Alças para ajustar a largura dos painéis laterais (arrastar; duplo clique volta ao padrão). */
.panel-resizer { display: none; }
@media (min-width: 1001px) {
  .panel-resizer {
    display: block;
    position: relative;
    width: 8px;
    z-index: 5;
    cursor: col-resize;
    touch-action: none;
  }
  .panel-resizer[data-panel="sidebar"] { grid-column: 2; grid-row: 1; justify-self: end; margin-right: -4px; }
  .panel-resizer[data-panel="members"] { grid-column: 4; grid-row: 1 / 3; justify-self: start; margin-left: -4px; }
  body.members-hidden .panel-resizer[data-panel="members"] { display: none; }
  .panel-resizer::after { content: ""; position: absolute; inset: 0 3px; border-radius: 1px; transition: background var(--t-fast); }
  .panel-resizer:is(:hover, .dragging)::after { background: var(--accent); }
  body.resizing-panel { cursor: col-resize; user-select: none; }
}

/* Tela de entrada: resumo dos dados que abre os detalhes e linha para entrar com outro aparelho. */
.consent-details > summary { cursor: pointer; list-style: none; line-height: 1.45; }
.consent-details > summary::-webkit-details-marker { display: none; }
.consent-more { color: var(--accent-text); white-space: nowrap; }
.consent-details[open] .consent-more { display: none; }
.consent-details[open] > summary { margin-bottom: var(--space-2); }
.consent-pair-line { margin: 0; text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }
.consent-pair-line .link-btn { font-weight: 600; cursor: pointer; }

/* Coroa do dono ao lado do nome (no lugar dos selos de cargo, como no Discord). */
.owner-crown { width: 14px; height: 14px; flex: none; color: #f0b232; vertical-align: -2px; margin-left: 4px; }

/* Celular: o chat ocupa a tela toda (sem isso, a coluna 3 criava colunas implícitas e uma faixa
   vazia à esquerda aparecia quando o conteúdo era estreito, como na tela da chamada). */
@media (max-width: 760px) {
  #chat { grid-column: 1 / -1; grid-row: 1 / -1; }
}

/* ---------- notificações: balão e central ---------- */
#inbox-toggle { position: relative; }
.inbox-count {
  position: absolute; right: 0; bottom: 0; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-pill); background: #da373c; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 3px var(--bg-chat);
}
.inbox-panel {
  position: fixed; z-index: 96; width: min(420px, calc(100vw - 16px)); max-height: min(70vh, 640px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-floating); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-pop); animation: notif-in .16s ease-out;
}
.inbox-panel[hidden] { display: none; }
.inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.inbox-head h2 { margin: 0; font-size: 16px; color: var(--text-strong); }
.inbox-head .btn.small { padding: 5px 10px; font-size: var(--fs-xs); }
.inbox-body { overflow-y: auto; padding: 4px 8px 10px; }
.inbox-body h3 { margin: 10px 6px 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); }
.inbox-empty { margin: 4px 6px 8px; font-size: var(--fs-sm); }
.notif { display: flex; align-items: flex-start; gap: 2px; border-radius: var(--radius); }
.notif + .notif { margin-top: 2px; }
.notif.mention { box-shadow: inset 2px 0 0 #f0b232; }
.notif.read { opacity: .72; }
.notif-open { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; padding: 8px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text); text-align: start; cursor: pointer; }
.notif-open:hover { background: var(--bg-hover); }
.notif-copy { display: grid; gap: 1px; min-width: 0; }
.notif-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.notif-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }
.notif-time { flex: none; font-size: 11px; color: var(--text-muted); }
.notif-where { font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-text { font-size: var(--fs-sm); color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-actions { display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 0 0; }
.notif-actions .icon-btn { width: 28px; height: 28px; }
.notif-actions .icon-btn svg { width: 16px; height: 16px; }
#social-notifications { width: min(360px, calc(100vw - 24px)); }
.notif-toast { pointer-events: auto; background: var(--bg-floating); border: 1px solid var(--border); box-shadow: var(--shadow-pop); padding: 2px; animation: notif-in .22s cubic-bezier(.2, .9, .3, 1.2); }
.notif-toast.leaving { animation: notif-out .2s ease-in forwards; }
@keyframes notif-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes notif-out { to { opacity: 0; transform: translateX(24px); } }
@media (prefers-reduced-motion: reduce) { .notif-toast, .notif-toast.leaving, .inbox-panel { animation: none; } }

/* ---------- ícones dos controles de voz: animações ---------- */
.vg { width: 20px; height: 20px; flex: none; overflow: visible; }
.vg-body { transform-box: fill-box; transform-origin: center; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), opacity .15s; }
.vg-cut, .vg-slash { fill: none; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .22s cubic-bezier(.4, 0, .2, 1); }
.vg-cut { stroke: var(--vg-cut, var(--bg-elevated)); stroke-width: 5; }
.vg-slash { stroke: var(--danger, #f23f43); stroke-width: 2.2; }
.off > .vg .vg-cut, .off > .vg .vg-slash { stroke-dashoffset: 0; }
/* O próprio ícone fica vermelho quando desligado (microfone e fone), como no Discord. */
:is(#btn-mute, #btn-deafen).off > .vg, .cb-btn.off:is([data-act="mic"], [data-act="deaf"]) > .vg { color: var(--danger, #f23f43); }
#btn-mute, #btn-deafen { --vg-cut: var(--bg-elevated); }
#btn-mute:hover, #btn-deafen:hover { --vg-cut: var(--bg-hover); }
.vp-btn { --vg-cut: var(--bg-base); }
.vp-btn:hover { --vg-cut: var(--bg-selected); }
.vp-btn.active { --vg-cut: var(--accent-soft); }
.cb-btn { --vg-cut: var(--bg-elevated); }
/* Passar o mouse: o ícone "sobe" um pouco; o de desligar inclina como um telefone. */
:is(.vp-btn, #btn-mute, #btn-deafen, .cb-btn):hover:not(:disabled) .vg-body { transform: translateY(-1px) scale(1.08); }
#vp-leave:hover .vg-body, .cb-btn[data-act="leave"]:hover .vg-body { transform: rotate(-14deg) scale(1.06); }
#vp-leave:hover { color: var(--danger, #f23f43); }
/* Clique: um "pulo" rápido. */
.vg-pop .vg-body { animation: vg-pop .28s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes vg-pop { 0% { transform: scale(1); } 40% { transform: scale(.78); } 100% { transform: scale(1); } }
/* Ligado: câmera e tela ficam com destaque; a tela transmitindo pulsa de leve. */
.vp-btn.active { color: var(--text-strong); }
#vp-screen.active { color: var(--success); }
#vp-screen.active .vg-body { animation: vg-live 1.8s ease-in-out infinite; }
@keyframes vg-live { 50% { transform: scale(1.1); filter: drop-shadow(0 0 4px currentColor); } }
.vp-btn { transition: background var(--t-fast), transform .12s; }
.vp-btn:active:not(:disabled) { transform: scale(.96); }
.vp-btn .vg { width: 22px; height: 22px; }
@media (prefers-reduced-motion: reduce) {
  .vg-body, .vg-cut, .vg-slash { transition: none; }
  .vg-pop .vg-body, #vp-screen.active .vg-body { animation: none; }
}

/* ---------- perfil: conexões como links e efeitos animados ---------- */
a.profile-connection.linked { color: inherit; text-decoration: none; cursor: pointer; transition: background var(--t-fast), transform .12s; }
a.profile-connection.linked:hover { background: var(--bg-hover); }
a.profile-connection.linked:active { transform: scale(.99); }
.profile-connection-go { width: 16px; height: 16px; margin-left: auto; color: var(--text-muted); flex: none; }
a.profile-connection.linked:hover .profile-connection-go { color: var(--text-strong); }
.profile-connection-icon { color: #fff; font-weight: 800; }

.preview-card { position: relative; }
.preview-card.has-effect { overflow: hidden; }
.profile-effect { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; border-radius: inherit; }
.profile-effect i { position: absolute; left: var(--x); top: var(--y); display: block; }
.effect-preview { max-width: 300px; margin-top: var(--space-3); }

/* Estrelas que piscam */
.fx-estrelas i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 3px rgba(255, 255, 255, .8); transform: scale(var(--s)); animation: fx-twinkle var(--t) ease-in-out var(--d) infinite; opacity: 0; }
@keyframes fx-twinkle { 50% { opacity: 1; transform: scale(calc(var(--s) * 1.4)); } }
/* Neve caindo */
.fx-neve i { top: -10px; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .9); transform: scale(var(--s)); animation: fx-fall var(--t) linear var(--d) infinite; }
@keyframes fx-fall { to { transform: translate(18px, 640px) scale(var(--s)); } }
/* Confete colorido */
.fx-confete i { top: -12px; width: 6px; height: 10px; border-radius: 1px; background: hsl(var(--h) 85% 60%); animation: fx-confetti var(--t) linear var(--d) infinite; }
@keyframes fx-confetti { to { transform: translate(-24px, 640px) rotate(720deg); } }
/* Corações subindo */
.fx-coracoes i { top: auto; bottom: -16px; animation: fx-rise var(--t) ease-in var(--d) infinite; opacity: 0; }
.fx-coracoes i::before { content: "♥"; font-style: normal; font-size: calc(16px * var(--s)); color: hsl(calc(330 + var(--h) / 12) 90% 65%); text-shadow: 0 0 8px currentColor; }
@keyframes fx-rise { 15% { opacity: 1; } to { transform: translate(12px, -520px); opacity: 0; } }
/* Aurora: faixas de cor que se movem devagar */
.fx-aurora { background: linear-gradient(120deg, rgba(88, 101, 242, .35), rgba(35, 165, 89, .25), rgba(235, 69, 158, .3), rgba(88, 101, 242, .35)); background-size: 300% 300%; mix-blend-mode: screen; animation: fx-aurora 9s ease-in-out infinite; }
@keyframes fx-aurora { 50% { background-position: 100% 50%; } }
/* Brilho que atravessa o cartão */
.fx-brilho::before { content: ""; position: absolute; inset: -50% -100%; background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .22) 50%, transparent 58%); animation: fx-shine 4.5s ease-in-out infinite; }
@keyframes fx-shine { from { transform: translateX(-40%); } to { transform: translateX(40%); } }
@media (prefers-reduced-motion: reduce) { .profile-effect, .profile-effect i, .profile-effect::before { animation: none !important; } }

/* ---------- aproximação do visual do Discord ---------- */
/* Categorias: maiúsculas e minúsculas normais, seta depois do nome. */
.category { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
.category .cat-toggle { flex: 0 1 auto; min-width: 0; }
.category .cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category .chev { width: 12px; height: 12px; opacity: .8; }
.category button.cat-add { margin-left: auto; }
/* Grupos da lista de membros: "Tio Matrix — 2", sem caixa alta. */
#member-list li.member-section { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
/* Nome com a cor do cargo um pouco mais forte, já que não há mais selo ao lado. */
.msg-author, #member-list .m-name { font-weight: 600; }

/* ---------- transmitir tela (navegador): versão simples, como no Discord ---------- */
.share-simple { gap: var(--space-3); }
.share-simple .share-context { margin: 0; justify-content: center; }
.share-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-mode { display: grid; justify-items: center; gap: 4px; padding: 16px 10px; border: 2px solid var(--border); border-radius: 10px; background: var(--bg-base); color: var(--text); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), transform .12s; }
.share-mode:hover { background: var(--bg-hover); }
.share-mode:active { transform: scale(.98); }
.share-mode.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text-strong); }
.share-mode-icon { width: 26px; height: 26px; }
.share-mode strong { font-size: var(--fs-md, 15px); }
.share-mode span { font-size: var(--fs-xs); color: var(--text-muted); }
.share-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 8px; background: var(--bg-base); font-size: var(--fs-sm); color: var(--text-muted); }
.share-gear.active { color: var(--accent-text); }
.share-custom { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.share-custom[hidden] { display: none; }
.share-chips { display: grid; gap: 6px; }
.share-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.share-chip { padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: transparent; color: var(--text); font-size: var(--fs-sm); cursor: pointer; }
.share-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.share-chip:disabled { opacity: .35; cursor: not-allowed; }
.share-sound { display: grid; gap: 8px; }
.share-sound select[hidden] { display: none; }
.share-help { margin: 0; font-size: var(--fs-xs); }
.share-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: var(--text-strong); }
.share-switch input { position: absolute; opacity: 0; pointer-events: none; }
.share-switch-ui { position: relative; width: 40px; height: 24px; flex: none; border-radius: 12px; background: var(--bg-selected); transition: background .15s; }
.share-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s cubic-bezier(.3, 1.4, .5, 1); }
.share-switch input:checked + .share-switch-ui { background: var(--success); }
.share-switch input:checked + .share-switch-ui::after { transform: translateX(16px); }
.share-switch input:focus-visible + .share-switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 420px) { .share-modes { grid-template-columns: 1fr; } }

/* ---------- chamada no estilo do Discord ---------- */
.ch-timer { margin-left: auto; font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 12px; color: var(--success); }
.ch-row .ch-timer + .ch-tool, .ch-row .ch-timer ~ .ch-tool { margin-left: 4px; }
.vu-invite { display: flex; align-items: center; gap: 8px; padding: 4px 8px; margin-top: 2px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: var(--fs-sm); cursor: pointer; }
.vu-invite:hover { background: var(--bg-hover); color: var(--text-strong); }
.vu-invite .mi-icon { width: 16px; height: 16px; }

.vv-controls { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; }
.cb-group { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border); }
.cb-group .cb-btn { border-radius: 8px; background: transparent; }
.cb-group .cb-btn:hover { background: var(--bg-hover); }
.cb-group .cb-btn.on { background: var(--text-strong); color: var(--bg-base); }
.cb-group .cb-btn.off { background: var(--danger-soft); }
.cb-split { display: flex; align-items: stretch; border-radius: 8px; }
.cb-split:hover { background: var(--bg-hover); }
.cb-split .cb-btn { border-radius: 8px 0 0 8px; }
.cb-caret { display: grid; place-items: center; width: 20px; border: 0; border-radius: 0 8px 8px 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.cb-caret:hover { color: var(--text-strong); background: var(--bg-selected); }
.cb-caret-icon { width: 14px; height: 14px; }
.vv-controls > .cb-btn.danger { width: 64px; border-radius: 12px; }
.cb-side { position: absolute; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; }
.cb-side.left { left: 16px; }
.cb-side.right { right: 16px; }
.cb-ghost { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; }
.cb-ghost:hover { background: var(--bg-hover); color: var(--text-strong); }
.cb-ghost .mi-icon { width: 22px; height: 22px; }
.cb-btn.cb-mobile { display: none; }
@media (max-width: 760px) {
  .cb-btn.cb-mobile { display: grid; }
  .cb-caret, .cb-side { display: none; }
  .cb-group { padding: 2px; gap: 0; }
  .vv-controls { gap: 6px; }
}
.vv-alone { position: absolute; inset: auto 0 24px; display: grid; justify-items: center; gap: 6px; text-align: center; pointer-events: none; }
.vv-alone .btn { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.vv-alone strong { color: var(--text-strong); font-size: 16px; }
.vv-stage { position: relative; }
.menu-header { padding: 6px 10px 2px; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); pointer-events: none; }

/* Selo "em chamada" no ícone do servidor (canto inferior direito, como no Discord). */
.server-icon { position: relative; }
.server-call-badge { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--success); color: #fff; box-shadow: 0 0 0 3px var(--bg-base); pointer-events: none; animation: call-badge-in .25s cubic-bezier(.3, 1.6, .5, 1); }
.server-call-badge .mi-icon { width: 13px; height: 13px; stroke-width: 2.5; }
@keyframes call-badge-in { from { transform: scale(0); } }

/* ---------- conexões (configurações), como no Discord ---------- */
.conn-picker { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-radius: 10px; background: var(--bg-base); }
.conn-tile { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; transition: transform .12s, background var(--t-fast); }
.conn-tile:hover { background: var(--bg-hover); transform: translateY(-2px); }
.conn-tile .profile-connection-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.conn-tile .profile-connection-icon svg { width: 20px; height: 20px; }
.conn-tile.connected::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--bg-base); }
.conn-list { display: grid; gap: 8px; margin-top: 10px; }
.conn-card { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); }
.conn-card .profile-connection-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.conn-card .profile-connection-icon svg { width: 22px; height: 22px; }
.conn-info { display: grid; flex: 1; min-width: 0; }
.conn-info strong { display: flex; align-items: center; gap: 6px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-info span { font-size: var(--fs-xs); color: var(--text-muted); }
.conn-verified { display: inline-grid; place-items: center; flex: none; color: var(--accent-text); }
.conn-verified svg { width: 16px; height: 16px; display: block; }
.conn-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.conn-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.conn-remove { font-size: 20px; }
.conn-empty { margin: 4px 2px; }

/* Painel de voz + painel do usuário formam um cartão só (como no Discord): cantos de cima no
   painel de voz, cantos de baixo no do usuário e uma linha fina entre os dois. */
@media (min-width: 761px) {
  body:has(#voice-panel:not(.hidden)) #user-panel {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top-color: transparent;
    box-shadow: inset 0 1px 0 var(--border);
  }
  #voice-panel { margin-bottom: 0; }
}

/* Convite da chamada vazia: baixo e largo, ícone pequeno ao lado do texto. */
.vv-alone .btn { flex-direction: row; padding: 8px 16px; min-height: 0; white-space: nowrap; font-size: var(--fs-sm); line-height: 1.2; }
.vv-alone .btn svg { width: 18px; height: 18px; flex: none; }
.cb-ghost .mi-icon { width: 20px; height: 20px; }

/* Menus nunca passam da tela; nomes longos de dispositivos em uma linha. */
.menu { max-height: calc(100dvh - 24px); overflow-y: auto; }
.menu .mi-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.menu.menu-devices { max-width: 360px; }

/* ---------- decorações do perfil ---------- */
/* Moldura: maior que o avatar, centralizada, por cima, sem bloquear cliques. */
.has-avatar-deco { position: relative; overflow: visible; }
.avatar-deco { position: absolute; left: 50%; top: 50%; width: 122%; height: 122%; transform: translate(-50%, -50%); object-fit: contain; pointer-events: none; z-index: 2; }
.avatar.tiny .avatar-deco { display: none; }
/* Efeito: cobre o cartão de perfil inteiro, por cima de tudo. */
.preview-card.has-profile-effect-img { overflow: hidden; }
.profile-effect-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; z-index: 5; border-radius: inherit; }
/* Placa do nome: imagem à direita, sumindo para a esquerda, atrás do nome. */
.nameplate-host { position: relative; overflow: hidden; isolation: isolate; }
.nameplate-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .25) 30%, #000 75%); mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .25) 30%, #000 75%); opacity: .9; }
#user-panel.nameplate-host > *:not(.nameplate-img) { position: relative; }
/* Configurações: linhas de envio. */
.deco-row { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); }
.deco-row + .deco-row { margin-top: 8px; }
.deco-thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: 8px; background: var(--bg-base) repeating-conic-gradient(var(--bg-hover) 0 25%, transparent 0 50%) 0 0 / 12px 12px; overflow: hidden; }
.deco-thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.deco-info { display: grid; gap: 2px; flex: 1; min-width: 0; }
.deco-info strong { color: var(--text-strong); }
.deco-info span { font-size: var(--fs-xs); }
.deco-actions { display: flex; gap: 6px; flex: none; }
.danger-text { color: var(--danger) !important; }
@media (max-width: 600px) { .deco-row { flex-wrap: wrap; } .deco-actions { width: 100%; } }

#member-list li.nameplate-host .member-details { position: static; }
#member-list li.nameplate-host { position: relative; }

/* Conexões ao vivo (Twitch) e jogando (Steam) no perfil. */
.conn-live, .conn-playing { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-live { color: var(--text-strong); }
.conn-live .live-badge { margin-right: 2px; }
.conn-playing { color: var(--success); font-weight: 600; }

/* ---------- convidar (estilo Discord) ---------- */
.card:has(.invite-panel) { max-width: 480px; }
.invite-panel { display: grid; gap: 10px; }
.invite-list { max-height: min(42vh, 340px); overflow-y: auto; display: grid; gap: 2px; margin: 0 -6px; padding: 0 6px; }
.invite-section { margin: 6px 2px 2px; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.invite-row:hover { background: var(--bg-hover); }
.invite-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.invite-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.invite-row .btn { padding: 6px 14px; flex: none; }
.invite-sent { opacity: .7; }
.invite-empty { margin: 8px 4px; }
.invite-foot { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.invite-link { display: flex; gap: 6px; padding: 4px; border-radius: 8px; background: var(--bg-base); border: 1px solid var(--border); }
.invite-link .field { flex: 1; border: 0; background: transparent; min-width: 0; }
.invite-note { margin: 0; font-size: var(--fs-xs); }
.deco-template { justify-self: start; font-size: var(--fs-xs); margin-top: 2px; }
/* Contador e selo de chamada sempre na frente da imagem do servidor (que é inserida depois). */
.server-icon .ping, .server-call-badge { z-index: 3; }
.private-attachment { cursor: zoom-in; }

/* ---------- mensagens privadas no estilo do Discord ---------- */
.private-nav-contact { position: relative; min-height: 44px; }
.private-nav-contact .avatar { flex: none; }
.dm-text { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.dm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dm-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.dm-close { display: none; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 4px; color: var(--text-muted); font-size: 18px; line-height: 1; }
.private-nav-contact:hover .dm-close { display: grid; }
.dm-close:hover { color: var(--text-strong); background: var(--bg-hover); }
.private-nav-contact:hover .notification-count { display: none; }
.private-bar-avatar { width: 26px; height: 26px; font-size: 12px; }
.private-bar-avatar.status::after { width: 8px; height: 8px; border-width: 2px; border-color: var(--bg-chat); }
.private-bar .private-icon.active { color: var(--text-strong); }
.private-open .private-pane.profile-hidden { grid-template-columns: minmax(0, 1fr) 0; }
.private-open .private-pane.profile-hidden .private-aside { display: none; }
/* Painel do perfil: o cartão ocupa a altura toda, com o botão no rodapé. */
.private-aside { padding: 12px; }
.dm-profile { display: flex; flex-direction: column; min-height: 100%; }
.dm-profile .pc-details { flex: 1; }
.dm-full { margin: 12px; }
.dm-status-text { margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--bg-base); color: var(--text); }
.dm-mutual { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin: 4px 0 10px; }
.dm-mutual-faces { display: flex; }
.dm-mutual-faces .avatar { width: 18px; height: 18px; font-size: 9px; box-shadow: 0 0 0 2px var(--bg-elevated); }
.dm-mutual-faces .avatar + .avatar { margin-left: -6px; }
.dm-call { display: flex; align-items: center; gap: 6px; color: var(--success); font-size: var(--fs-sm); margin-bottom: 10px; }
.dm-call .mi-icon { width: 16px; height: 16px; }
.dm-activity h3 { margin: 10px 0 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.dm-activity-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: var(--bg-base); color: var(--text); text-decoration: none; }
.dm-activity-row .profile-connection-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.dm-connections { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dm-connection { display: grid; place-items: center; border-radius: 8px; transition: transform .12s; }
.dm-connection:hover { transform: translateY(-2px); }
.dm-connection .profile-connection-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }

/* Ferramentas da linha do canal (convidar e engrenagem), ícones do mesmo traço dos demais. */
.ch-tool { display: none; place-items: center; width: 18px; height: 18px; padding: 0; margin-left: 2px; border-radius: 4px; flex: none; }
.ch-row:hover .ch-tool, .ch-row.active .ch-tool { display: grid; }
.ch-tool .mi-icon { width: 15px; height: 15px; }
.ch-tool:hover { color: var(--text-strong); }

/* Perfil: "em comum" numa linha só, como no Discord. */
.profile-common { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.profile-shared-row { gap: 6px; cursor: default; }
.profile-shared-stack { display: flex; }
.profile-shared-stack > * { width: 18px; height: 18px; font-size: 9px; box-shadow: 0 0 0 2px var(--bg-floating); border-radius: 50%; }
.profile-shared-stack > * + * { margin-left: -6px; }
.profile-shared-dot { color: var(--text-faint, var(--text-muted)); }
/* Chamada privada: a mesma barra da chamada do servidor. */
.private-call-actions { align-items: center; gap: 10px; }
.private-call-group .private-call-button { display: grid; place-items: center; width: 48px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--text); }
.private-call-group .private-call-button:hover { background: var(--bg-hover); }
.private-call-group .private-call-button[aria-pressed="true"]:not(.off) { background: var(--text-strong); color: var(--bg-base); }
.private-call-group .private-call-button.off { background: var(--danger-soft); }
.private-call-end { width: 64px !important; height: 48px; border-radius: 12px !important; background: var(--danger-strong) !important; color: #fff !important; border: 0; }

/* ---------- menus no estilo do Discord: submenu, subtítulo, rádio e medidor ---------- */
.menu-item.has-sub .menu-sub-arrow { width: 14px; height: 14px; margin-left: auto; transform: rotate(-90deg); opacity: .8; }
.menu-item.sub-open { background: var(--bg-hover); }
.mi-two { display: grid; line-height: 1.25; }
.mi-two small { font-size: 11px; color: var(--text-muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu.submenu { max-width: 320px; }
.menu-radio { flex: none; width: 18px; height: 18px; margin-left: auto; border: 2px solid var(--text-muted); border-radius: 50%; position: relative; }
.menu-radio.on { border-color: var(--accent); }
.menu-radio.on::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.menu-meter { height: 18px; margin: 4px 2px 2px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--bg-selected) 0 4px, transparent 4px 7px); position: relative; overflow: hidden; }
.menu-meter::after { content: ""; position: absolute; inset: 0; width: var(--level, 0%);
  background: repeating-linear-gradient(90deg, var(--success) 0 4px, transparent 4px 7px); transition: width .06s linear; }

/* Bolinha de status sempre por cima da moldura do avatar. */
.avatar.status::after, .preview-card .pc-status { z-index: 4; }
/* Efeito do perfil por cima do cartão, mas texto, botões e conexões continuam legíveis. */
.preview-card :is(.pc-body, .pc-details) > *, .preview-card > .btn, .preview-card .profile-edit { position: relative; z-index: 6; }
.preview-card .btn, .preview-card .profile-connection, .preview-card .profile-role-section { background-color: color-mix(in srgb, var(--bg-elevated) 92%, transparent); }
/* Painel do usuário (clique no próprio nome), no formato do Discord. */
.user-panel-popover { width: 340px; padding: 0 0 10px; border-radius: 12px; overflow: hidden; }
.user-panel-popover .preview-card { padding-bottom: 4px; }
.upp-groups { display: grid; gap: 8px; padding: 0 10px; position: relative; z-index: 6; }
.upp-group { display: grid; padding: 4px; border-radius: 10px; background: color-mix(in srgb, var(--bg-base) 88%, transparent); }
.upp-group .menu-item { border-radius: 6px; }
.upp-group .menu-item + .menu-item { border-top: 1px solid var(--border); border-radius: 0; }
.upp-group .menu-item .menu-sub-arrow { margin-left: auto; }
.upp-group .menu-sub-arrow { transform: rotate(-90deg); width: 14px; height: 14px; opacity: .7; }
.user-panel-popover { position: fixed; }
.user-panel-popover > .profile-effect-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; z-index: 7; }

/* Registro de chamada no privado. */
.private-call-record { display: flex; align-items: center; gap: 10px; padding: 6px 16px; color: var(--text-muted); font-size: var(--fs-sm); }
.private-call-record .call-record-icon { width: 18px; height: 18px; color: var(--success); flex: none; }
.private-call-record.missed .call-record-icon { color: var(--danger); }
.private-call-record time { font-size: 11px; color: var(--text-faint, var(--text-muted)); }
.dm-since { margin: 6px 0 10px; } .dm-since h3 { margin: 0 0 2px; font-size: 12px; font-weight: 700; color: var(--text-strong); } .dm-since span { font-size: var(--fs-sm); color: var(--text); }

/* ---------- grupos no privado ---------- */
.dm-section-head { display: flex; align-items: center; justify-content: space-between; padding-right: 6px; }
.dm-new { border: 0; background: none; color: var(--text-muted); font-size: 20px; line-height: 1; cursor: pointer; width: 24px; height: 24px; border-radius: 4px; }
.dm-new:hover { color: var(--text-strong); }
.dm-groups:empty { display: none; }
.group-avatar { background: var(--success); color: #fff; }
.group-avatar .mi-icon { width: 18px; height: 18px; }
.private-intro .group-avatar { width: 80px; height: 80px; }
.private-intro .group-avatar .mi-icon { width: 40px; height: 40px; }
.card:has(.group-picker) { max-width: 440px; }
.group-picker { display: grid; gap: 8px; }
.group-count { margin: 0; font-size: var(--fs-xs); }
.group-pick-list { max-height: min(46vh, 380px); overflow-y: auto; display: grid; gap: 2px; }
.group-pick { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.group-pick:hover { background: var(--bg-hover); }
.group-pick span { flex: 1; color: var(--text-strong); }
.group-pick input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- status: bolinhas do menu ---------- */
.presence-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--success); margin-right: 2px; }
.presence-dot.idle { background: #f0b232; }
.presence-dot.dnd { background: #f23f43; }
.presence-dot.invisible { background: transparent; box-shadow: inset 0 0 0 3px #80848e; }
.menu.submenu .menu-item { gap: 10px; }

/* ---------- perfil com efeito: botões destacados, campos discretos ---------- */
.preview-card.has-profile-effect-img .btn,
.user-panel-popover.has-effect .menu-item {
  background: rgba(17, 18, 20, .88);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.preview-card.has-profile-effect-img .btn:hover,
.user-panel-popover.has-effect .menu-item:hover { background: rgba(40, 42, 48, .95); border-color: rgba(255, 255, 255, .4); }
.preview-card.has-profile-effect-img :is(.profile-connection, .profile-role-section, .profile-social, .profile-connections) {
  background: transparent;
  border-color: transparent;
}
.preview-card.has-profile-effect-img .profile-connection { background: rgba(0, 0, 0, .28); }
.preview-card.has-profile-effect-img :is(hr, .pc-details > * + *) { border-color: rgba(255, 255, 255, .06); }
.user-panel-popover.has-effect .upp-group { background: rgba(0, 0, 0, .25); }
.user-panel-popover.has-effect .upp-group .menu-item + .menu-item { border-top-color: rgba(255, 255, 255, .22); }
.user-panel-popover > .profile-effect-img { z-index: 5; }
.avatar.status::after { background: var(--presence, var(--success)); }
.preview-card .pc-status.on, .preview-card .pc-status[style*="--presence"] { background: var(--presence, var(--success)); }
.menu.submenu .menu-sub-arrow { transform: rotate(-90deg); width: 14px; height: 14px; margin-left: auto; }
@media (min-width: 1001px) { .panel-resizer[data-panel="sidebar"] { grid-row: 1 / -1; } }

/* Fechar do perfil e botões do cartão: sempre visíveis, mesmo sobre banners e efeitos. */
.pc-close { z-index: 20 !important; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .72) !important;
  color: #fff !important; border: 1px solid rgba(255, 255, 255, .45) !important; font-size: 20px; line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5); backdrop-filter: blur(4px); }
.pc-close:hover { background: rgba(0, 0, 0, .9) !important; border-color: #fff !important; transform: scale(1.06); }
.preview-card .btn, .preview-card .profile-connection .btn {
  position: relative; z-index: 6; background: rgba(20, 21, 24, .92); color: #fff;
  border: 1px solid rgba(255, 255, 255, .38); box-shadow: 0 2px 10px rgba(0, 0, 0, .45); font-weight: 600;
}
.preview-card .btn:hover { background: rgba(48, 50, 58, .96); border-color: rgba(255, 255, 255, .6); }
.preview-card .btn.primary { background: var(--accent); border-color: rgba(255, 255, 255, .45); }

/* ---------- status: cor também no texto do cartão e no ponto do painel ---------- */
.preview-card .pc-meta .presence-text.on::before { color: var(--presence, var(--success)); }

/* ---------- efeito do perfil: igual em todo lugar + animação de abrir/fechar ---------- */
/* Sem deformar: cobre o cartão mantendo a proporção, alinhado pelo topo (antes "fill" esticava em cartões altos). */
.profile-effect-img, .user-panel-popover > .profile-effect-img { object-fit: cover; object-position: center top; }
@keyframes fx-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes fx-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(1.06); } }
@keyframes card-out { to { opacity: 0; transform: scale(.97); } }
.profile-effect-img { animation: fx-in .45s cubic-bezier(.2, .8, .2, 1) both; transform-origin: center; }
#modal-card.fx-closing .profile-effect-img { animation: fx-out .22s ease-in both; }
#modal-card.fx-closing { animation: card-out .22s ease-in both; }
@media (prefers-reduced-motion: reduce) { .profile-effect-img { animation: none; } }

/* ---------- configurações no painel do Discord (todas as telas) ---------- */
.settings.voice-settings .settings-close { display: none; }
.voice-settings .settings-nav { overflow-y: auto; position: relative; }
.voice-settings .settings-nav nav { gap: 2px; }
.voice-settings .settings-nav button { display: flex; align-items: center; gap: 10px; }
.voice-settings .settings-nav button .mi-icon { width: 18px; height: 18px; flex: none; opacity: .85; }
.voice-settings .settings-nav button > span:not(.badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.voice-settings .settings-nav .nav-label { margin-top: var(--space-3); border-top: 0; padding: 6px 10px 4px; }
.voice-settings .settings-nav [hidden] { display: none !important; }
.settings-nav-title { padding: 4px 10px 10px; font-weight: 700; color: var(--text-strong); }
.settings-nav-close { display: none !important; }
.settings-user-card {
  display: flex !important; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px !important; margin-bottom: var(--space-2); border-radius: var(--radius);
}
.settings-user-card .avatar { width: 40px; height: 40px; flex: none; }
.settings-user-text { display: grid; text-align: left; min-width: 0; }
.settings-user-text strong { color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-user-text small { display: flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: var(--fs-xs); }
.settings-user-text small .mi-icon { width: 12px; height: 12px; }
.settings-search { height: 34px; margin-bottom: var(--space-2); font-size: var(--fs-sm); }
.settings-subnav { margin-top: 2px; }
.settings-subnav button { gap: 0 !important; font-size: var(--fs-sm); }

.settings-stack { max-width: 740px; margin: 0 auto; }
.settings-stack.wide { max-width: 1040px; }
.settings-stack > h1 { font-size: var(--fs-xl); margin-bottom: var(--space-2); }
.settings-stack > section[data-nav] { scroll-margin-top: 18px; }
.set-block { padding: 0 0 44px; border: 0 !important; }
.set-block h2 { margin: 0 0 var(--space-4); font-size: var(--fs-xl); color: var(--text-strong); }
.set-lead { margin: calc(-1 * var(--space-2)) 0 var(--space-4); color: var(--text-muted); font-size: var(--fs-sm); }
.set-card { padding: 4px 16px; border-radius: var(--radius); background: var(--bg-elevated); border: 1px solid var(--border); }
.set-card .set-row:last-child { border-bottom: 0; }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: 60px; padding: 14px 0; border-bottom: 1px solid var(--border);
}
.set-row-copy { min-width: 0; flex: 1; }
.set-row-copy strong { display: block; color: var(--text-strong); font-size: var(--fs-md); font-weight: 600; }
.set-row-copy p { margin: 4px 0 0; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.45; }
.set-row > .btn, .set-row > .row, .set-row > a.btn { flex: none; }
.set-row > .row { flex-wrap: nowrap; }
.set-secret { display: block; margin-top: 6px; font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--fs-sm); color: var(--text); word-break: break-all; }
.set-link {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); color: inherit; text-align: left; cursor: pointer;
}
.set-link:hover { background: var(--bg-hover); }
.set-link-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--bg-selected); }
.set-link-icon .mi-icon { width: 18px; height: 18px; }
.set-link-arrow { transform: rotate(-90deg); color: var(--text-muted); }
.keybind-list { display: grid; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.keybind-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 12px 16px; background: var(--bg-elevated); }
.keybind-row + .keybind-row { border-top: 1px solid var(--border); }
.keybind-keys { display: flex; gap: 6px; flex: none; }
.keybind-keys kbd {
  min-width: 24px; padding: 3px 8px; border-radius: 4px; text-align: center;
  background: var(--bg-base); border: 1px solid var(--border-strong); box-shadow: 0 2px 0 var(--border-strong);
  font: 600 var(--fs-xs)/1.4 inherit; color: var(--text-strong);
}

@media (max-width: 760px) {
  .voice-settings.show-nav .settings-nav { display: block; border-right: 0; padding: calc(var(--space-4) + env(safe-area-inset-top)) var(--space-3) var(--space-6); }
  .voice-settings.show-nav .voice-settings-main { display: none; }
  .voice-settings.show-nav .settings-nav-close { display: grid !important; place-items: center; position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 40px; height: 40px; }
  .voice-settings.show-nav .settings-user-card { padding-right: 52px !important; }
  .voice-settings.show-nav .settings-subnav { display: none; }
  .set-row { flex-wrap: wrap; }
  .set-row > .row { flex-wrap: wrap; }
}
.set-link svg, .set-link .mi-icon { width: 18px; height: 18px; flex: none; }
.set-link .set-row-copy { display: block; }
@media (max-width: 760px) {
  .voice-settings.show-nav .settings-nav { max-height: none; height: 100%; min-height: 0; }
  .voice-settings.show-nav .voice-settings-panel { grid-template-rows: minmax(0, 1fr); }
}

/* ---------- tema claro ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-base: #e3e5e8;
  --bg-sidebar: #f2f3f5;
  --bg-chat: #ffffff;
  --bg-elevated: #ffffff;
  --bg-floating: #ffffff;
  --bg-input: #ebedef;
  --bg-hover: rgba(6, 6, 7, .055);
  --bg-selected: #d7d9de;
  --border: rgba(6, 6, 7, .09);
  --border-strong: rgba(6, 6, 7, .17);
  --text: #313338;
  --text-strong: #060607;
  --text-muted: #5c5e66;
  --text-faint: #80848e;
  --accent-soft: rgba(147, 51, 234, .14);
  --accent: #7E22CE;
  --accent-hover: #6B21A8;
  --link: #0E7490;
  --accent-text: #6B21A8;
  --danger-soft: rgba(220, 38, 38, .1);
  --link: #006ce7;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .16);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, .1);
}
.theme-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.theme-choice {
  display: grid; gap: var(--space-2); justify-items: center; padding: var(--space-3);
  border: 2px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elevated); color: var(--text); cursor: pointer;
}
.theme-choice:hover { border-color: var(--border-strong); }
.theme-choice.on { border-color: var(--accent); }
.theme-swatch { display: grid; grid-template-columns: 22% 1fr; grid-template-rows: 1fr 30%; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-strong); }
.theme-swatch span:nth-child(1) { grid-row: 1 / 3; }
.theme-swatch span:nth-child(3) { grid-column: 2; }
.theme-dark span:nth-child(1) { background: #121216; } .theme-dark span:nth-child(2) { background: #18181c; } .theme-dark span:nth-child(3) { background: #222228; }
.theme-light span:nth-child(1) { background: #e3e5e8; } .theme-light span:nth-child(2) { background: #ffffff; } .theme-light span:nth-child(3) { background: #ebedef; }
.theme-system span:nth-child(1) { background: linear-gradient(135deg, #121216 50%, #e3e5e8 50%); }
.theme-system span:nth-child(2) { background: linear-gradient(135deg, #18181c 50%, #ffffff 50%); }
.theme-system span:nth-child(3) { background: linear-gradient(135deg, #222228 50%, #ebedef 50%); }
@media (max-width: 430px) { .theme-choices { grid-template-columns: minmax(0, 1fr); } }

/* Tema claro: cartões sem efeito usam botões claros; o painel de configurações fica branco. */
:root[data-scheme="light"] .preview-card:not(.has-profile-effect-img) .btn,
:root[data-scheme="light"] .user-panel-popover:not(:has(> .profile-effect-img:not(.hidden))) .menu-item {
  background: var(--bg-input); color: var(--text-strong); border: 1px solid var(--border-strong); box-shadow: none; backdrop-filter: none;
}
:root[data-scheme="light"] .preview-card:not(.has-profile-effect-img) .btn:hover,
:root[data-scheme="light"] .user-panel-popover:not(:has(> .profile-effect-img:not(.hidden))) .menu-item:hover { background: var(--bg-selected); }
:root[data-scheme="light"] .preview-card:not(.has-profile-effect-img) .btn.primary { background: var(--accent); color: #fff; }
:root[data-scheme="light"] .user-panel-popover:not(:has(> .profile-effect-img:not(.hidden))) .upp-group { background: transparent; }
:root[data-scheme="light"] .voice-settings-panel { background: var(--bg-chat); }
:root[data-scheme="light"] .voice-settings .settings-nav { background: var(--bg-sidebar); }
:root[data-scheme="light"] .set-card, :root[data-scheme="light"] .keybind-row, :root[data-scheme="light"] .set-link { background: var(--bg-sidebar); }
:root[data-scheme="light"] .settings.voice-settings { background: rgba(0, 0, 0, .35); }

/* ---------- atalhos personalizados ---------- */
.keybind-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.keybind-head h2 { margin: 0; }
.keybind-custom {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto auto; align-items: end; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-2);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated);
}
.keybind-field { display: grid; gap: 6px; min-width: 0; }
.keybind-field > span { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.keybind-recorder { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 40px; padding: 0 4px 0 12px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid transparent; }
.keybind-recorder.recording { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.keybind-recorder .btn { min-height: 32px; padding: 0 10px; font-size: var(--fs-xs); }
.keybind-custom .switch { margin-bottom: 8px; }
.keybind-remove { width: 36px; height: 36px; margin-bottom: 2px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); cursor: pointer; }
.keybind-remove:hover { background: var(--danger-soft); color: var(--danger); }
.keybind-remove .mi-icon { width: 18px; height: 18px; }
.keybind-reset { margin-top: var(--space-2); }
@media (max-width: 760px) {
  .keybind-custom { grid-template-columns: minmax(0, 1fr) auto auto; }
  .keybind-custom .keybind-field:first-child { grid-column: 1 / -1; }
}

/* ---------- login com Google e aviso de migração ---------- */
.google-btn { display: inline-flex; align-items: center; gap: 10px; }
.google-g { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 800; font-size: 14px; }
.migration-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  padding: 8px 16px; background: var(--warning); color: #111; font-size: var(--fs-sm); font-weight: 600; flex-wrap: wrap;
}
.migration-banner .btn { min-height: 30px; padding: 0 12px; }
.set-badge { padding: 4px 10px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; }
.set-badge.ok { background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); }
body.has-migration { --migration-h: 44px; }
body.has-migration #app { margin-top: var(--migration-h); height: calc(100dvh - var(--migration-h)); }
body.has-migration .settings { top: var(--migration-h); }
.migration-banner { min-height: 44px; }

/* ---------- Nevdin: entrada e carregamento ---------- */
.wordmark { font-family: var(--font-brand); font-style: italic; font-weight: 800; letter-spacing: -.01em; }
.card h2, .settings h2, .modal-title { font-family: var(--font-heading); }

.boot-screen {
  position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 12px;
  background: var(--bg-base); color: var(--text-muted); font-size: var(--fs-sm); transition: opacity .35s ease;
}
.boot-screen img { width: 140px; height: 140px; }
.boot-screen.done { opacity: 0; pointer-events: none; }

.auth-screen { background: radial-gradient(70% 60% at 20% 30%, rgba(147, 51, 234, .14), transparent 70%), var(--bg-base); padding: 16px; overflow-y: auto; }
.auth-shell {
  display: grid; grid-template-columns: minmax(220px, .85fr) minmax(0, 1.15fr); width: min(860px, 100%); margin: auto;
  border: 1px solid var(--border-strong); border-radius: 20px; background: var(--bg-sidebar); box-shadow: var(--shadow-pop); overflow: hidden;
}
.auth-art { display: grid; place-content: center; justify-items: center; gap: 16px; padding: 32px 24px; background: #100E1C; border-right: 1px solid var(--border); }
.auth-art img { width: min(220px, 100%); height: auto; }
.auth-slogan { margin: 0; font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; line-height: 1.2; text-align: center; color: var(--text-strong); }
.card.auth-card { display: flex; flex-direction: column; width: auto; max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: clamp(24px, 4vw, 40px); gap: 14px; }
.auth-card h2 { margin: 0; text-align: left; font-size: 1.6rem; }
.auth-card #consent-intro { margin: -6px 0 4px; text-align: left; }
.auth-brand { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; color: var(--text-strong); font-size: 1.25rem; text-decoration: none; }
.auth-card .actions { justify-content: stretch; }
.auth-card .actions .primary { flex: 1; min-height: 44px; font-size: var(--fs-md); }
.google-btn { justify-content: center; }
@media (max-width: 720px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { grid-auto-flow: column; padding: 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-art img { width: 84px; }
  .auth-slogan { font-size: 1.05rem; text-align: left; }
}
:root[data-scheme="light"] .auth-shell { background: var(--bg-chat); }
:root[data-scheme="light"] .auth-art { background: #F3EEFF; }
:root[data-scheme="light"] .auth-screen { background: radial-gradient(70% 60% at 20% 30%, rgba(147, 51, 234, .12), transparent 70%), var(--bg-base); }
.consent-login-note { margin: 0; font-size: var(--fs-sm); line-height: 1.5; }
.consent-login-note a { color: var(--link); }
#consent-card [hidden] { display: none !important; }

/* Menção de canal (<#id>): mesmo visual da menção de pessoa, com ícone de # ou alto-falante. */
.channel-mention { display: inline-flex; align-items: center; gap: 2px; vertical-align: baseline; }
.channel-mention svg { width: 14px; height: 14px; flex: none; }
.channel-mention.unknown { cursor: default; opacity: .75; }
.channel-mention.unknown:hover { background: rgba(88, 101, 242, .3); color: #c9cdfb; }
.channel-mention:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.ms-item .ms-hint { margin-left: auto; color: var(--text-faint); font-size: var(--fs-xs); }
.ms-item > svg { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.app-badge { padding: 0 5px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; letter-spacing: .02em; }
.set-nav-spacer { flex: none; pointer-events: none; }
/* Chamada privada: anel verde em quem está falando. */
.private-call-face .avatar { transition: box-shadow .12s ease; }
.private-call-face.speaking .avatar { box-shadow: 0 0 0 3px var(--bg-base), 0 0 0 5px var(--success); }

/* Áreas grandes que recebem foco só para rolar ou receber atalhos (lista de mensagens,
   histórico do privado, seções): sem contorno. Botões e campos mantêm o foco visível no Tab. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible,
#messages:focus, #messages:focus-visible,
.dm-history:focus-visible, .private-history:focus-visible, [role="log"]:focus-visible { outline: none; }
body > .private-call { cursor: grab; touch-action: none; user-select: none; }
body > .private-call.dragging { cursor: grabbing; box-shadow: 0 18px 40px rgba(0, 0, 0, .6); }
body > .private-call button { cursor: pointer; }
.private-call-inline { left: auto !important; top: auto !important; }
/* Campos de copiar (ex.: webhook criado). */
.copy-label { display: block; margin: var(--space-3) 0 4px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); }
.copy-row { display: flex; gap: var(--space-2); align-items: stretch; }
.copy-row .field { flex: 1; min-width: 0; font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 13px; }
.copy-row .btn { flex: none; min-height: 40px; padding-inline: 16px; align-self: flex-start; }
.copy-code { resize: none; white-space: pre; overflow-x: auto; line-height: 1.5; }
.copy-hint { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--text-muted); }
@media (max-width: 520px) { .copy-row { flex-direction: column; } .copy-row .btn { width: 100%; align-self: stretch; } }

/* ---------- Privado no celular ---------- */
.private-search-toggle { display: none; }
.private-menu svg { width: 20px; height: 20px; }
@media (max-width: 760px) {
  .private-bar { flex-wrap: nowrap; gap: 6px; padding: 6px 8px; min-height: 52px; }
  .private-bar > strong { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: 16px; }
  .private-bar-tools { flex: none; gap: 2px; margin-inline-start: auto; }
  .private-bar-tools .private-icon, .private-bar-tools .icon-btn { width: 38px; height: 38px; }
  /* Perfil lateral e fixar/favoritar ficam fora da barra estreita. */
  .private-bar-tools [aria-label="Mostrar perfil"], .private-bar-tools [aria-label*="favorit" i] { display: none; }
  .private-search-toggle { display: inline-grid; place-items: center; }
  .private-bar-tools .private-search { display: none; }
  .private-bar.searching { flex-wrap: wrap; }
  .private-bar.searching .private-bar-tools { display: contents; }
  .private-bar.searching .private-search { display: block; order: 10; width: 100%; flex: 1 1 100%; min-height: 40px; }
  .private-bar.searching .private-search-toggle { color: var(--text-strong); background: var(--bg-selected); }
  /* Amigos: abas roláveis numa linha e botão de adicionar só com ícone. */
  .private-bar:has([data-friend-tab]) { overflow-x: auto; scrollbar-width: none; }
  .private-bar [data-friend-tab] { flex: none; }
  .private-bar .friend-add { flex: none; margin-inline-start: auto; padding: 6px 10px; font-size: 0; gap: 0; }
  .private-bar .friend-add svg { width: 18px; height: 18px; }
  /* Conversa: mais respiro e campo de texto confortável para o dedo. */
  .private-history { padding: 12px 10px; }
  .private-intro h1 { font-size: 24px; margin: 8px 0 4px; }
  .private-composer { margin: 0 8px calc(8px + env(safe-area-inset-bottom)); }
  .private-composer textarea { font-size: 16px; }
}
@media (max-width: 760px) {
  .private-bar:has([data-friend-tab]) > strong { display: none; }
}

/* ---------- Configurações: coluna única ---------- */
/* Todas as seções usam a mesma coluna centralizada (antes cada uma tinha largura e margem próprias). */
.settings-content { padding-inline: max(var(--space-6), calc((100% - 800px) / 2)); }
.settings-content .voice-settings-stack { max-width: none; }
.settings-content h2 { font-family: var(--font-heading); }
@media (max-width: 760px) { .settings-content { padding-inline: var(--space-4); } }
/* Cargos no perfil: pílula com bolinha colorida e nome inteiro. */
.role-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px 3px 7px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-selected) 85%, transparent); color: var(--text-strong); font-size: 12px; font-weight: 500; line-height: 1.35; }
.role-pill > span { overflow-wrap: anywhere; }
.role-pill-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--role-color, var(--text-muted)); }
/* Celular: notificações e menu do perfil cabem na tela. */
@media (max-width: 760px) {
  .inbox-panel { position: fixed; left: 8px !important; right: 8px !important; top: 60px; width: auto; max-width: none; max-height: calc(100dvh - 140px); }
  .user-panel-popover { width: min(340px, calc(100vw - 16px)); max-height: calc(100dvh - 90px); overflow-y: auto; }
}
/* Celular: caixa de mensagem mais baixa (canais e privado), mantendo a letra de 16px (sem zoom no iPhone). */
@media (max-width: 760px) {
  .composer-box { padding: 2px 4px; align-items: center; }
  #input, .private-composer textarea.field { min-height: 34px; padding: 7px 4px; line-height: 20px; }
  .composer-box .icon-btn, .composer-box > button { width: 32px; height: 32px; }
  .composer-box svg { width: 20px; height: 20px; }
}

/* ---------- Responder no privado ---------- */
.private-message { position: relative; }
.private-msg-actions { position: absolute; top: -14px; right: 12px; display: none; background: var(--bg-floating); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.private-message:hover .private-msg-actions { display: flex; }
@media (hover: none) { .private-message:hover .private-msg-actions { display: none; } }
.private-reply-quote { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 2px 0 4px; padding: 2px 8px; border: 0; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--bg-hover); color: var(--text-muted); font-size: var(--fs-sm); text-align: left; cursor: pointer; }
.private-reply-quote strong { color: var(--text-strong); flex: none; }
.private-reply-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.private-reply-quote .ma-icon { width: 14px; height: 14px; flex: none; }
.private-reply-bar { display: flex; align-items: center; gap: 4px; margin: 0 8px; padding: 6px 10px; border-radius: var(--radius) var(--radius) 0 0; background: var(--bg-elevated); color: var(--text-muted); font-size: var(--fs-sm); }
.private-reply-bar strong { color: var(--text-strong); }
.private-reply-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.private-reply-bar .icon-btn { margin-left: auto; width: 26px; height: 26px; }
.private-message.flash { animation: reply-flash 1.2s ease; }
@keyframes reply-flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }

/* ---------- Ajustes de 01/12 ---------- */
/* Painel do usuário: microfone, fone e engrenagem sempre brancos (destacados sobre efeitos de perfil). */
#user-panel .icon-btn { color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
#user-panel .icon-btn .vg-body, #user-panel .icon-btn svg { color: #fff; }
#user-panel .icon-btn:hover { background: rgba(0, 0, 0, .35); }
:is(#btn-mute, #btn-deafen).off .vg { color: var(--danger, #f23f43) !important; }
/* Moldura do avatar por cima da foto; o indicador de status por cima de tudo. */
.has-avatar-deco > img:not(.avatar-deco) { position: absolute; z-index: 1; }
.avatar-deco { z-index: 4 !important; }
.has-avatar-deco.status::after { z-index: 5; }
/* Tela cheia da chamada privada: ocupa a tela inteira (ignora tamanho e posição do painel flutuante). */
.private-call:fullscreen { position: fixed; inset: 0 !important; left: 0 !important; top: 0 !important; width: 100vw !important; max-width: none !important; height: 100vh;
  border-radius: 0; padding: 16px; display: grid; grid-template-rows: 1fr auto auto auto; align-content: stretch; cursor: default; }
.private-call:fullscreen .private-call-stage { min-height: 0; height: 100%; }
.private-call:fullscreen video { width: 100%; height: 100%; object-fit: contain; }
.pc-handle { margin: -2px 0 6px; color: var(--text-muted); font-size: var(--fs-sm); }
.menu-hint { display: block; margin-top: 1px; font-size: 11px; font-weight: 400; color: var(--text-faint); }
.ignored-msg { color: var(--text-faint); font-style: italic; }

/* Chat dos canais de voz: balão na linha do canal (aparece ao passar o mouse ou no canal atual). */
.ch-voice-chat { display: none; margin-left: auto; place-items: center; width: 22px; height: 22px; border-radius: 4px; color: var(--text-muted); }
.ch-voice-chat svg { width: 16px; height: 16px; }
.ch-row:hover .ch-voice-chat, .ch-row.active .ch-voice-chat, .ch-voice-chat:focus-visible { display: inline-grid; }
.ch-voice-chat:hover { color: var(--text-strong); background: var(--bg-hover); }
@media (hover: none) { .ch-row.voice .ch-voice-chat { display: inline-grid; } }
#voice-chat-toggle.active { color: var(--text-strong); background: var(--bg-selected); }

/* App de Windows: barra de título própria (30px) com os botões do Windows à direita. */
.desktop-titlebar { position: fixed; z-index: 300; inset: 0 0 auto 0; height: 30px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 150px 0 12px; background: var(--bg-base); color: var(--text-muted); font-size: 13px; font-weight: 600; -webkit-app-region: drag; user-select: none; }
.desktop-titlebar img { position: absolute; left: 12px; width: 16px; height: 16px; }
.desktop-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.has-desktop-titlebar { --titlebar: 30px; }
body.has-desktop-titlebar #app, body.has-desktop-titlebar .settings, body.has-desktop-titlebar .overlay, body.has-desktop-titlebar .boot-screen { top: var(--titlebar); }
body.has-desktop-titlebar #app { height: calc(100dvh - var(--titlebar)); margin-top: var(--titlebar); }
/* Painel do canto durante a chamada privada: sem Soundpad (só nos canais de voz). */
#voice-panel.private-mode #vp-soundpad, #voice-panel.private-mode #vp-stats { display: none; }
/* Editar foto/banner: esconde efeito animado, moldura e indicador de status (atrapalhavam os botões). */
.appearance-editing .profile-effect-img, .appearance-editing .avatar-deco { display: none !important; }
.appearance-editing .status::after, .appearance-editing .avatar::after { display: none !important; }
/* Prévia do efeito do perfil: proporção vertical, como o cartão de perfil aberto. */
.effect-preview { width: min(320px, 100%); max-width: none; aspect-ratio: 3 / 4; display: flex; flex-direction: column; }
.effect-preview .pc-body { flex: 1; }
.effect-preview .banner { flex: none; }
/* Chat do canal de voz em painel lateral à direita (a chamada continua na área principal). */
#chat.voice-side-chat { display: grid; grid-template-columns: minmax(0, 1fr) min(380px, 42%); grid-template-rows: auto auto minmax(0, 1fr); }
#chat.voice-side-chat > #chat-header, #chat.voice-side-chat > #status { grid-column: 1 / -1; }
#chat.voice-side-chat > #voice-view { grid-column: 1; grid-row: 3; min-width: 0; }
#chat.voice-side-chat > #text-view { grid-column: 2; grid-row: 3; min-width: 0; border-left: 1px solid var(--border); background: var(--bg-chat); }
#chat.voice-side-chat #text-view .channel-intro h1 { font-size: 20px; }
/* Chat da sala ocupando a coluna da direita (a lista de membros some enquanto ele está aberto). */
body.voice-side-chat-open #app { --members-w: 0px; }
body.voice-side-chat-open #members { display: none; }
#chat.voice-side-chat { grid-template-columns: minmax(0, 1fr) min(420px, 40%); }
#chat.voice-side-chat > #text-view { grid-row: 1 / -1; grid-column: 2; }
#chat.voice-side-chat > #chat-header, #chat.voice-side-chat > #status { grid-column: 1; }
.voice-chat-head { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--border); color: var(--text-strong); }
.voice-chat-head svg { width: 18px; height: 18px; color: var(--text-muted); }
.voice-chat-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#voice-chat-toggle:not([hidden]) { margin-left: auto; }
#voice-chat-toggle:not([hidden]) + #members-toggle { margin-left: 0; }
/* Controles da chamada: somem com o mouse fora ou parado (voltam ao mexer). */
#voice-view .vv-controls { transition: opacity .2s ease; }
#voice-view.controls-away .vv-controls { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #voice-view .vv-controls { transition: none; } }
/* Status da sala editável na lista de canais e convite que some sozinho. */
.ch-voice-status.editable { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 2px 36px; padding: 0; border: 0; background: none; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.ch-voice-status.editable:hover { color: var(--text-strong); }
.ch-voice-status.editable .mi-icon { width: 12px; height: 12px; }
.vu-invite { position: relative; }
.vu-invite-close { margin-left: auto; display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 4px; background: none; color: var(--text-muted); }
.vu-invite-close svg { width: 14px; height: 14px; }
.vu-invite-close:hover { color: var(--text-strong); background: var(--bg-hover); }
/* Campo de mensagem igual em todos os chats (canal, privado, chat da sala de voz). */
#composer .composer-box, .private-composer { min-height: 44px; padding: 2px 6px; align-items: center; border-radius: var(--radius); background: var(--bg-elevated); border: 1px solid var(--border); }
#input, .private-composer textarea.field { min-height: 38px; padding: 9px 6px; line-height: 20px; font-size: var(--fs-md); }
#input::placeholder, .private-composer textarea.field::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#composer .composer-box .icon-btn, #composer .composer-box > button, .private-composer .icon-btn { width: 32px; height: 32px; flex: none; }
#composer .composer-box svg, .private-composer svg { width: 20px; height: 20px; }
@media (max-width: 760px) { #input, .private-composer textarea.field { font-size: 16px; } }
/* Lista de membros: sem anel verde ao falar (fica só nas salas de voz e na chamada). */
#member-list .speaking, #member-list .avatar.speaking { box-shadow: none !important; animation: none !important; }
/* Soundpad: sem anel ao tocar um som (o emoji do som continua aparecendo rapidinho). */
.avatar.sound-playing, .sound-playing .avatar { box-shadow: none !important; }
/* Lista de membros: sem o emoji do Soundpad em cima do avatar (fica só na sala de voz e na chamada). */
#member-list .sp-bubble { display: none !important; }
/* Botões do quadro no canto de cima (não cobrem o texto "Ninguém por aqui ainda"). */
.tile-tools { top: 8px; bottom: auto; }
.tile-stats { top: 52px; }
/* Chamada ocupando a janela inteira (alternativa à tela cheia do sistema). */
body.voice-maximized #voice-view { position: fixed; inset: 0; z-index: 250; }
body.has-desktop-titlebar.voice-maximized #voice-view { top: 30px; }
/* Câmera ligada: ícone com luz de gravação piscando. */
.vu-camera { position: relative; display: inline-grid; place-items: center; width: 20px; height: 18px; color: var(--text-muted); }
.vu-camera svg { width: 16px; height: 16px; }
.vu-camera .rec-dot { position: absolute; top: 1px; right: 0; width: 6px; height: 6px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px var(--bg-sidebar); animation: rec-blink 1.4s ease-in-out infinite; }
@keyframes rec-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
/* AO VIVO: ponto pulsando antes do texto. */
.live-badge { display: inline-flex; align-items: center; gap: 5px; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: live-pulse 1.6s ease-out infinite; }
.live-badge.small::before { width: 5px; height: 5px; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 70% { box-shadow: 0 0 0 6px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
@media (prefers-reduced-motion: reduce) { .vu-camera .rec-dot, .live-badge::before { animation: none; } }

/* Edição de foto/banner: sem indicador de status por cima do lápis. */
.appearance-editing .pc-status { display: none !important; }
/* Perfis: prévia do efeito na coluna da direita, abaixo da prévia da foto. */
.profile-preview-col { display: flex; flex-direction: column; min-width: 0; }
.effect-preview-slot .effect-preview { width: 100%; margin-top: 6px; }
.effect-preview-label { margin: 0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); }
@media (max-width: 1000px) { .effect-preview-slot { margin-top: 16px !important; } }

/* ---------- Listas suspensas no estilo dos menus da Nevdin ---------- */
/* Chromium recente (app de Windows, Chrome e Edge atuais) permite estilizar a lista aberta;
   nos outros navegadores fica a lista nativa (nada quebra). */
@supports (appearance: base-select) {
  select, select.field, .field select, ::picker(select) { appearance: base-select !important; }
  select { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
  ::picker(select) { margin-top: 6px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-floating);
    color: var(--text); box-shadow: var(--shadow-pop); max-height: min(360px, 60vh); }
  select option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: var(--fs-sm); color: var(--text); }
  select option:hover, select option:focus-visible { background: var(--bg-hover); color: var(--text-strong); outline: none; }
  select option:checked { background: var(--accent-soft); color: var(--text-strong); font-weight: 600; }
  select option::checkmark { content: "✓"; order: 1; margin-left: auto; color: var(--accent-text); }
  select optgroup { padding: 4px 0; font-size: var(--fs-xs); color: var(--text-muted); }
  @media (prefers-reduced-motion: no-preference) { ::picker(select) { transition: opacity .12s ease, translate .12s ease; } }
}
/* Faixa de atualização do app de Windows. */
.update-banner { position: fixed; z-index: 400; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); padding: 12px 16px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-floating); box-shadow: var(--shadow-pop); color: var(--text-strong); font-size: var(--fs-sm); }
.update-track { height: 6px; margin-top: 8px; border-radius: 999px; background: var(--bg-hover); overflow: hidden; }
.update-fill { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .2s ease; }

/* Listas suspensas padronizadas: mesma seta em todas, direção conforme o espaço e abertura suave. */
@supports (appearance: base-select) {
  select, select.field, .field select { background-image: none !important; padding-right: 12px; }
  select::picker-icon { content: ""; flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
    transform: translateY(-2px) rotate(45deg); transition: transform .18s ease; }
  /* A seta aponta para o lado em que a lista abre. */
  select[data-up]:open::picker-icon { transform: translateY(2px) rotate(225deg); }
  select:not([data-up]):open::picker-icon { transform: translateY(-2px) rotate(45deg); border-color: var(--text-strong); }
  select[data-up]::picker-icon { transform: translateY(2px) rotate(225deg); }
  ::picker(select) { position-area: block-end span-inline-end; position-try-fallbacks: none; margin: 6px 0 0; }
  select[data-up]::picker(select) { position-area: block-start span-inline-end; margin: 0 0 6px; }
  ::picker(select) { opacity: 1; translate: 0 0; transition: opacity .16s ease, translate .16s ease, display .16s allow-discrete, overlay .16s allow-discrete; }
  @starting-style { ::picker(select):popover-open { opacity: 0; translate: 0 -6px; } }
  select[data-up]::picker(select) { transition: opacity .16s ease, translate .16s ease, display .16s allow-discrete, overlay .16s allow-discrete; }
  @starting-style { select[data-up]::picker(select):popover-open { opacity: 0; translate: 0 6px; } }
  @media (prefers-reduced-motion: reduce) { ::picker(select), select::picker-icon { transition: none; } }
}
/* Botões de cada quadro no canto de cima, à direita (não no meio da tela). */
.tile .tile-tools, .tile.user .tile-tools { top: 12px; right: 12px; bottom: auto; left: auto; inset-inline: auto 12px; justify-content: flex-end; }
/* Chamada maximizada: ocupa a janela do app, com o nome da sala em cima (como no Discord). */
body.voice-maximized #voice-view { position: fixed; inset: 0; z-index: 250; background: #000; }
body.has-desktop-titlebar.voice-maximized #voice-view { top: 30px; }
.vv-max-head { display: flex; align-items: center; gap: 8px; flex: none; padding: 12px 16px; color: var(--text-strong); font-weight: 600; }
.vv-max-head svg { width: 20px; height: 20px; color: var(--text-muted); }

/* Bots: cartão formatado e botões */
.bot-embed { display: flex; gap: 12px; max-width: 520px; margin-top: 4px; padding: 10px 12px; border-left: 4px solid var(--accent); border-radius: 6px; background: rgba(127,127,127,.12); }
.bot-embed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bot-embed-author { font-size: 12px; font-weight: 600; }
.bot-embed-title { font-weight: 700; color: inherit; }
a.bot-embed-title { color: var(--accent); }
.bot-embed-desc { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.bot-embed-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.bot-embed-field { flex: 1 1 100%; min-width: 0; }
.bot-embed-field.inline { flex: 1 1 140px; }
.bot-embed-field-name { font-size: 13px; font-weight: 700; }
.bot-embed-field-value { font-size: 13px; white-space: pre-wrap; }
.bot-embed-image { max-width: 100%; max-height: 300px; border-radius: 4px; object-fit: contain; align-self: flex-start; }
.bot-embed-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex: none; }
.bot-embed-footer { font-size: 12px; opacity: .7; }
.bot-components { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.bot-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-btn { padding: 6px 14px; border: 0; border-radius: 4px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; color: #fff; text-decoration: none; }
.bot-btn.primary { background: var(--accent); }
.bot-btn.secondary, .bot-btn.link { background: #4e5058; }
.bot-btn.success { background: #248046; }
.bot-btn.danger { background: #da373c; }
.bot-btn:disabled { opacity: .5; cursor: default; }
.bot-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(127,127,127,.2); }
.bot-row-name { flex: 1; font-weight: 600; }

/* Chamada em tela cheia real: sem a barra de título desenhada pela página. */
body.has-desktop-titlebar.voice-maximized.voice-screen-full #voice-view { top: 0; }
