/* Livenengue — página da sala, do início e dos servidores.
 *
 * Os tokens de cor e forma abaixo são a fonte de verdade do visual. As telas do Electron
 * (app/ui/index.html e picker.html) repetem os MESMOS valores: mantenha os três em sincronia.
 * Marca: teal calmo sobre fundo escuro azulado, cartões arredondados em camadas, brilho sutil
 * ao fundo. Layout: trilho de navegação à esquerda (com o cartão do usuário embaixo), coluna
 * do servidor/amigos, o conteúdo no meio e "sobre"/membros à direita. */

:root {
  /* superfícies, do fundo para a frente */
  --bg: #0b1116;
  --surface: #10171f;
  --surface-2: #16202a;
  --surface-3: #1e2a36;
  --border: #1f2b37;
  --border-strong: #2d3d4d;

  /* texto */
  --text: #e6edf3;
  --muted: #8d9cad;

  /* marca */
  --accent: #2dd4bf;         /* teal */
  --accent-strong: #14b8a6;
  --accent-weak: rgba(45, 212, 191, .14);
  --on-accent: #05201d;      /* texto sobre o teal */

  /* estados */
  --danger: #f0616d;
  --danger-strong: #d94452;
  --ok: #34d399;
  --live: #f0616d;
  --warn: #f6c453;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .4);
  --ring: 0 0 0 3px var(--accent-weak);

  /* realce sutil por cima da superfície (linha sob o mouse, canal não lido). Branco no escuro,
     preto nos temas claros: uma cor só serviria a um dos dois. */
  --hover: rgba(255, 255, 255, .06);
  --hover-soft: rgba(255, 255, 255, .035);
  --hover-strong: rgba(255, 255, 255, .1);

  /* a navegação não é mais uma coluna (D82): esta largura só vale no modo expandido, onde a
     faixa de servidores volta a ficar em pé */
  --rail: 72px;
  --col: 272px;    /* a coluna: faixa de servidores, canais e o cartão do usuário */
  --aside: 300px;  /* coluna da direita */
}

/* ---------- temas ----------
 * Cada tema troca só as cores; formas, tamanhos e componentes continuam os mesmos. A escolha
 * fica no `data-theme` do <html> (guardada em localStorage `livenengue.theme`), e a lista com
 * nome e amostra está em THEMES no app.js: para acrescentar um tema, adicione um bloco aqui e
 * uma entrada lá. `--on-accent` é o texto por cima do destaque: escuro nos destaques claros.
 * Os temas claros também invertem `--shadow`, senão a sombra preta suja o fundo. */

/* Ardósia: um azul mais frio e sóbrio que o teal padrão. */
[data-theme="ardosia"] {
  --bg: #0d1117; --surface: #141b24; --surface-2: #1a2230; --surface-3: #232d3d;
  --border: #222c3a; --border-strong: #334054;
  --text: #e6edf3; --muted: #93a1b3;
  --accent: #5b9dff; --accent-strong: #3b82f6; --accent-weak: rgba(91, 157, 255, .16); --on-accent: #06152e;
}

/* Ameixa: roxo quente sobre fundo levemente arroxeado. */
[data-theme="ameixa"] {
  --bg: #100c18; --surface: #171122; --surface-2: #1f172e; --surface-3: #2a1f3d;
  --border: #2a2038; --border-strong: #3d2f52;
  --text: #ece7f5; --muted: #a396b8;
  --accent: #b78bff; --accent-strong: #9a63ff; --accent-weak: rgba(183, 139, 255, .16); --on-accent: #1c0b33;
}

/* Bosque: verde folha, fundo esverdeado escuro. */
[data-theme="bosque"] {
  --bg: #0a1310; --surface: #0f1c17; --surface-2: #14251e; --surface-3: #1d3329;
  --border: #1c2f26; --border-strong: #2b4738;
  --text: #e4efe8; --muted: #8fa89a;
  --accent: #56d97f; --accent-strong: #2fbe5e; --accent-weak: rgba(86, 217, 127, .16); --on-accent: #04230f;
  --ok: #56d97f;
}

/* Âmbar: laranja quente, fundo amarronzado. */
[data-theme="ambar"] {
  --bg: #14100b; --surface: #1c1710; --surface-2: #251e15; --surface-3: #33291c;
  --border: #2f2618; --border-strong: #4a3c26;
  --text: #f3ebe0; --muted: #b3a390;
  --accent: #f0a63c; --accent-strong: #d98a1c; --accent-weak: rgba(240, 166, 60, .16); --on-accent: #2a1802;
  --warn: #f0a63c;
}

/* Rubro: vermelho vivo; o "ao vivo" e o perigo viram rosa para não sumirem no destaque. */
[data-theme="rubro"] {
  --bg: #140b0d; --surface: #1c1013; --surface-2: #26161a; --surface-3: #351f24;
  --border: #301b20; --border-strong: #4c2c33;
  --text: #f5e8ea; --muted: #b6959b;
  --accent: #f2555f; --accent-strong: #d93a45; --accent-weak: rgba(242, 85, 95, .16); --on-accent: #2b0206;
  --danger: #ff8fa3; --danger-strong: #f2657f; --live: #ff8fa3;
}

/* Meia-noite: quase preto, cinza neutro; para quem quer o mínimo de cor. */
[data-theme="meia-noite"] {
  --bg: #08090b; --surface: #0e1013; --surface-2: #14171b; --surface-3: #1d2126;
  --border: #1c1f24; --border-strong: #2e343c;
  --text: #e8eaed; --muted: #969ba3;
  --accent: #c9ced6; --accent-strong: #aeb4bd; --accent-weak: rgba(201, 206, 214, .14); --on-accent: #0b0c0e;
}

/* Papel: claro e quente, com o teal da marca. */
[data-theme="papel"] {
  --bg: #f4f1ea; --surface: #ffffff; --surface-2: #f7f4ee; --surface-3: #ebe6dc;
  --border: #ddd7cb; --border-strong: #c4bcab;
  --text: #23201b; --muted: #6d675c;
  --accent: #0a7d72; --accent-strong: #06655c; --accent-weak: rgba(10, 125, 114, .14); --on-accent: #ffffff;
  --danger: #c8353f; --danger-strong: #a92a33; --live: #c8353f; --ok: #17914f; --warn: #a9740c;
  --shadow: 0 8px 30px rgba(60, 50, 30, .14);
  --hover: rgba(0, 0, 0, .06); --hover-soft: rgba(0, 0, 0, .04); --hover-strong: rgba(0, 0, 0, .1);
}

/* Névoa: claro e frio, azul sereno. */
[data-theme="nevoa"] {
  --bg: #eef2f7; --surface: #ffffff; --surface-2: #f4f7fb; --surface-3: #e5ebf3;
  --border: #d7dfe9; --border-strong: #b6c2d1;
  --text: #1b2430; --muted: #61707f;
  --accent: #2f6fed; --accent-strong: #2158c9; --accent-weak: rgba(47, 111, 237, .12); --on-accent: #ffffff;
  --danger: #c8353f; --danger-strong: #a92a33; --live: #c8353f; --ok: #17914f; --warn: #a9740c;
  --shadow: 0 8px 30px rgba(30, 45, 70, .14);
  --hover: rgba(0, 0, 0, .06); --hover-soft: rgba(0, 0, 0, .04); --hover-strong: rgba(0, 0, 0, .1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Barras de rolagem no visual da aplicação: finas, arredondadas, sem setas e sem trilho
   branco. Os tokens fazem elas acompanharem os temas (inclusive os claros). O Firefox usa
   `scrollbar-*`; o Chromium (app e navegador) usa os pseudo-elementos. Quem esconde a própria
   barra de propósito (as abas, `.gtabs`) continua escondendo. */
:root {
  --sb: color-mix(in srgb, var(--text) 22%, transparent);
  --sb-hover: color-mix(in srgb, var(--text) 42%, transparent);
  color-scheme: dark; /* sem isto o Chromium desenha a barra clara do sistema */
}
/* os dois temas claros pedem barra clara do sistema, senão o Chromium desenha a escura */
[data-theme="papel"], [data-theme="nevoa"] { color-scheme: light; }
/* `scrollbar-width` é o caminho do Firefox. No Chromium ele ATIVA a barra do sistema e faz os
   pseudo-elementos abaixo (inclusive esconder as setas) serem ignorados, então fica só onde
   os pseudo-elementos não existem. */
@supports not selector(::-webkit-scrollbar) {
  html, *, *::before, *::after { scrollbar-width: thin; scrollbar-color: var(--sb) transparent; }
}
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: var(--sb); border-radius: 999px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--sb-hover); }
::-webkit-scrollbar-thumb:active { background-color: var(--accent); }
/* sem as setinhas das pontas (o Chromium no Windows as desenha por padrão) */
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

html, body { height: 100%; margin: 0; }
body {
  --tb: 0px; /* altura da barra de título própria (só no app) */
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body.tb-on { --tb: 40px; }

/* ---------- controles ---------- */

button {
  font: inherit;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease, color .12s ease;
}
/* clareia (ou escurece, nos temas claros) a própria superfície, em vez de uma cor fixa */
button:hover { background: color-mix(in srgb, var(--surface-3) 88%, var(--text)); border-color: var(--border-strong); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--accent);
}

button.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); font-weight: 600; }
button.primary:hover { background: var(--accent-strong); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.danger:hover { background: rgba(240, 97, 109, .12); }
button.link {
  background: none; border: none; padding: 0;
  color: var(--accent); text-decoration: none; font-size: inherit;
}
button.link:hover { background: none; text-decoration: underline; }
button.link.small { font-size: 12px; }

input, select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  width: 100%;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder { color: #5b6a79; }
label { display: flex; flex-direction: column; gap: 5px; }
.row { display: flex; gap: 8px; align-items: stretch; }
.row input, .row select { flex: 1; min-width: 0; }
.row button { white-space: nowrap; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 4px 8px; }
.live {
  background: var(--live); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  padding: 2px 7px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .5px; color: var(--text); }

/* ícones de traço (os <use> herdam daqui) */
.nav-btn svg, .ghost-btn svg, .search svg, .facts svg, .new-server svg, .head-icon svg,
.quick svg, .crown svg, .chev svg, .avatar-hint svg, .icon-btn svg, .rail-btn svg {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.icon-btn {
  width: 36px; height: 36px; padding: 0; flex: none;
  display: grid; place-items: center; border-radius: 10px;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.icon-btn.on:hover { background: var(--accent-strong); }
.icon-btn.live { background: var(--live); border-color: transparent; color: #fff; }
.icon-btn.live:hover { background: var(--danger-strong); }
.icon-btn.off { color: var(--muted); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: transparent; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.icon-btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn.ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.icon-btn.ghost.on { background: var(--accent-weak); color: var(--accent); }
.icon-btn.round { border-radius: 50%; }
.icon-btn.send { background: var(--accent); border-color: transparent; color: var(--on-accent); width: 40px; height: 40px; border-radius: 12px; }
.icon-btn.send:hover { background: var(--accent-strong); }
/* alto-falante: sem a barra quando ligado, sem as ondas quando mudo */
.icon-btn .slash { display: none; }
.icon-btn.muted .slash { display: block; }
.icon-btn.muted .wave { display: none; }
.icon-btn.off .slash { display: block; }
.icon-btn.off .wave { display: none; }

.badge {
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.badge.teal { background: var(--accent); color: var(--on-accent); }
/* menções (D72): badge com "@", chip na mensagem, mensagem que fala comigo, caixa do "@" */
.badge.mention { background: var(--warn); color: #1f1400; }
.mention {
  display: inline-block; padding: 0 5px; border-radius: 5px; font-weight: 600; line-height: 1.3;
  background: var(--accent-weak); color: var(--accent); cursor: default;
}
.mention.user { cursor: pointer; }
.mention.me, .mention.all { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.msg.mention-me { background: color-mix(in srgb, var(--warn) 9%, transparent); box-shadow: inset 3px 0 0 var(--warn); }
.msg.mention-me:hover { background: color-mix(in srgb, var(--warn) 13%, transparent); }
.mention-box {
  position: fixed; z-index: 60; min-width: 240px; max-width: 320px; display: flex; flex-direction: column; gap: 1px; padding: 5px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.mention-box[hidden] { display: none; }
.mention-item {
  display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: 8px; text-align: left;
  background: transparent; border: 1px solid transparent; color: var(--text); font-size: 13px;
}
.mention-item:hover, .mention-item.on { background: var(--hover); border-color: transparent; }
.mention-item .avatar { width: 22px; height: 22px; font-size: 9px; flex: none; }
.mention-item .mention-ico { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--accent); font-weight: 700; flex: none; }
.mention-item .nm { font-weight: 600; }
.mention-item .hint { margin-left: auto; font-size: 11px; color: var(--muted); }

/* ---------- barra de título própria (só no app) ---------- */

.titlebar {
  position: fixed; top: 0; left: 0; right: 0; height: 40px; z-index: 6;
  display: flex; align-items: center; gap: 9px; padding: 0 16px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  -webkit-app-region: drag; user-select: none;
}
.tb-mark { width: 20px; height: 20px; border-radius: 6px; display: block; box-shadow: 0 0 0 1px var(--border); }
.tb-name { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .2px; }

/* ---------- entrada ---------- */

.join { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 30px;
  border-radius: 16px;
  width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow);
}
.card h1 { margin: 0; font-size: 26px; letter-spacing: -.5px; }
.card p { margin: 0; }

/* ---------- faixa de servidores (topo da coluna única, D82) ----------
 * Antes isto era uma segunda coluna de 188px. Agora é uma fileira de ícones dentro da mesma
 * coluna dos canais: some o cromo duplicado (dois cartões de usuário, dois cabeçalhos) e o
 * conteúdo ganha a largura de volta. Rola na horizontal quando há servidores demais. */
.rail {
  position: static; width: auto; flex: none;
  background: transparent; border-right: none;
  display: flex; align-items: center; gap: 6px;
  padding: 0 0 12px; margin-bottom: 2px; border-bottom: 1px solid var(--border);
}

/* cada item da faixa: quadrado arredondado de 38px, o mesmo tamanho para Amigos, servidores e
   o "+", para a fileira ficar num ritmo só */
.srv-tab {
  width: 38px; height: 38px; flex: none; padding: 0; border-radius: 11px;
  display: grid; place-items: center; position: relative;
  background: var(--surface-2); border: 1px solid transparent; color: var(--muted);
}
.srv-tab svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.srv-tab:hover { background: var(--hover-strong); color: var(--text); border-color: transparent; }
.srv-tab.on { background: var(--accent-weak); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
/* o "+" é a ação, não um destino: fica discreto até o mouse chegar */
.srv-tab.add { background: transparent; border: 1px dashed var(--border-strong); }
.srv-tab.add:hover { background: var(--surface-2); border-style: solid; }
/* risquinho entre "Amigos" e os servidores: separa destino de destino sem pesar */
.srv-sep { width: 1px; height: 22px; flex: none; background: var(--border); }

/* onde a faixa de servidores entra em cada coluna (Início, servidor, sala): o `#rail` é um só
   e o JS o move para a tela à vista, como já faz com o cartão do usuário */
.rail-slot { flex: none; }
.rail-slot:empty { display: none; }

/* servidores: um ícone ao lado do outro na faixa; só o aberto fica aceso. Com servidores demais
   é só esta lista que rola, sem barra: Amigos e o "+" ficam parados nas pontas. A folga de 4px
   é para o badge do canto não ser cortado pelo recorte da rolagem. */
#rail-guilds {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
  padding: 4px; margin: -4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
#rail-guilds::-webkit-scrollbar { height: 0; }
#rail-guilds:empty { display: none; }
.rail-btn {
  width: 38px; height: 38px; flex: none; padding: 0; position: relative;
  display: grid; place-items: center; border-radius: 11px;
  background: transparent; border: none; color: var(--muted);
}
.rail-btn:hover { background: var(--hover-strong); border-color: transparent; }
.srv-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface-3); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .3px;
}
.srv-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* o servidor aberto ganha o anel do destaque: é a única marca de "você está aqui" na faixa */
.rail-btn.on { background: transparent; }
.rail-btn.on .srv-ico { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--bg); }
/* o nome não cabe na faixa (e já está na capa, logo abaixo): fica no `title` */
.srv-name { display: none; }
/* contagem no canto do ícone, como num app de mensagens */
.rail-btn .badge {
  position: absolute; right: -3px; top: -3px; z-index: 1;
  font-size: 9.5px; height: 16px; min-width: 16px; padding: 0 4px;
  box-shadow: 0 0 0 2px var(--surface);
}
/* sem nenhum servidor ainda: a faixa dá lugar ao convite, em linha inteira */
.rail-btn.empty {
  width: auto; height: auto; flex: 1; min-width: 0;
  justify-content: center; padding: 8px; font-size: 12.5px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: 10px;
}
.rail-btn.empty:hover { border-color: var(--border-strong); color: var(--text); }

/* "em breve": presente, mas visivelmente fora do ar: sem realce no mouse, com a etiqueta */
/* A navegação virou uma faixa dentro da própria coluna (D82): as telas não reservam mais uma
   segunda coluna à esquerda. `rail-on` continua dizendo só se há navegação a mostrar. */
body:not(.rail-on) .rail-slot { display: none; }

/* ---------- cartão do usuário (rodapé do trilho, ou embaixo da coluna da sala) ---------- */

.user-panel {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px; display: flex; flex-direction: column; gap: 10px;
}
.user-panel:has(#room-controls:not([hidden])) { border-color: var(--border-strong); }
.user-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-name { font-weight: 600; font-size: 14px; display: flex; align-items: baseline; gap: 6px; }
.user-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.dot.on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.user-panel .avatar.lg { width: 34px; height: 34px; font-size: 13px; }
/* no rodapé da coluna (canais, amigos ou sala): sempre embaixo, sem crescer */
#panel-slot-guild, #panel-slot-lobby, #panel-slot-room { margin-top: auto; flex: none; }
.side .user-panel { background: var(--surface-2); }
.chev { background: transparent; border: none; padding: 2px; color: var(--muted); display: grid; place-items: center; flex: none; }
.chev svg { width: 16px; height: 16px; }
.chev:hover { background: transparent; color: var(--text); }

/* em chamada: faixa "onde estou" + uma fileira de botões do mesmo peso (fundo discreto, sem
   borda); os estados (transmitindo, mudo, ligado) é que dão cor */
.call-strip { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); position: relative; }
.call-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.call-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none;
  animation: call-pulse 2.2s ease-out infinite;
}
@keyframes call-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}
.call-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.call-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-text span { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-strip.streaming .call-dot { background: var(--live); animation-name: call-pulse-live; }
@keyframes call-pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(240, 97, 109, .55); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(240, 97, 109, 0); }
}
.call-btns { display: flex; gap: 5px; }
/* os botões dividem a largura que houver (até cinco, transmitindo), em vez da largura fixa */
.call-btns .icon-btn {
  flex: 1 1 0; width: auto; min-width: 0; height: 32px; border-radius: 9px;
  background: var(--surface-3); border-color: transparent; color: var(--text);
}
.call-btns .icon-btn svg { width: 16px; height: 16px; }
.call-btns .icon-btn:hover { background: var(--hover-strong); border-color: transparent; }
.call-btns .icon-btn.on { background: var(--accent); color: var(--on-accent); }
.call-btns .icon-btn.on:hover { background: var(--accent-strong); }
.call-btns .icon-btn.live { background: var(--live); color: #fff; }
.call-btns .icon-btn.off { color: var(--muted); }
.call-btns .icon-btn.off svg .wave { display: none; }
.call-btns .icon-btn.off svg .slash { display: block; }

.lobby .lobby-only, .room .lobby-only { display: revert; }
body.simple .lobby-only { display: none !important; }
body:not(.simple) .simple-only { display: none !important; }

/* ---------- avatares ---------- */

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-3); color: #fff;
  font-weight: 700; font-size: 13px; letter-spacing: .3px;
  overflow: hidden; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }

.avatar-btn { position: relative; padding: 0; border: none; background: none; border-radius: 50%; cursor: pointer; flex: none; }
.avatar-hint {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .12s ease;
}
.avatar-hint svg { width: 18px; height: 18px; color: #fff; }
.avatar-btn:hover .avatar-hint, .avatar-btn:focus-visible .avatar-hint { opacity: 1; }
.avatar.speaking { box-shadow: 0 0 0 2px var(--ok), 0 0 12px rgba(52, 211, 153, .7); }

/* ---------- colunas ---------- */

.lobby, .guild {
  display: grid; grid-template-columns: var(--col) 1fr var(--aside);
  height: calc(100% - var(--tb)); margin-top: var(--tb);
}
.guild.no-members { grid-template-columns: var(--col) 1fr; }
.guild.no-members .members { display: none; }
/* sala: coluna | palco | chat (a coluna do chat some quando recolhido: track "auto" vira 0) */
.room { display: grid; grid-template-columns: var(--col) 1fr auto; height: calc(100% - var(--tb)); margin-top: var(--tb); }

.side {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  overflow: auto; min-height: 0;
}
.side header .brand { font-weight: 700; font-size: 18px; letter-spacing: -.3px; }
.side header .brand::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: middle;
}
.side-spacer { flex: 1; }
.side footer { padding-top: 8px; border-top: 1px solid var(--border); }

.sec-head {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 2px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600;
}
.sec-head .acts, .cat-head .acts { margin-left: auto; }

/* cartão com capa (servidor ou Início) */
.cover-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; flex: none; }
.cover img { width: 100%; aspect-ratio: 480 / 220; object-fit: cover; display: block; }
.cover-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; position: relative; }
.cover-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cover-text b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-text span { font-size: 12px; }

.ghost-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; flex: none;
  padding: 8px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 13.5px;
}
.ghost-btn svg { width: 16px; height: 16px; color: var(--accent); }
.ghost-btn:hover { border-color: var(--border-strong); background: var(--surface-3); }

/* ---------- amigos e pedidos ---------- */

.requests { display: flex; flex-direction: column; gap: 6px; }
.requests:empty { display: none; }
.request {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--accent-weak); border: 1px solid var(--accent);
}
.request .who { flex: 1; min-width: 0; }
.request button { padding: 4px 10px; font-size: 12px; }

.peers, .friends { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.peers li, .friends li {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 10px;
  background: transparent; border: 1px solid transparent;
  min-height: 44px;
}
.peers li:hover, .friends li:hover { background: var(--surface-2); }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.who .where { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peers li button, .friends li button { padding: 4px 10px; font-size: 12px; }
.peers li .live { font-size: 9px; padding: 2px 6px; }
.peers li.watching { border-color: var(--accent); background: var(--accent-weak); }
.peers li.streaming .avatar { box-shadow: 0 0 0 2px var(--live); }
.peers .pvol { width: 100%; height: 4px; margin-top: 5px; accent-color: var(--accent); cursor: pointer; }

.friends .avatar { position: relative; overflow: visible; }
.friends .avatar img, .friends .avatar .initials { border-radius: 50%; overflow: hidden; width: 100%; height: 100%; display: grid; place-items: center; }
.friends .dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #4b5563; border: 2px solid var(--surface);
}
.friends li.online .dot { background: var(--ok); }
.friends li:not(.online) .who .name { color: var(--muted); }
.friends li:not(.online) .avatar { filter: grayscale(1); opacity: .7; }
.friends li button.link { padding: 0; font-size: 14px; color: var(--muted); opacity: 0; }
.friends li:hover button.link { opacity: 1; }
.friends li button.link:hover { color: var(--danger); }

/* ---------- cabeçalho da página (canal, salas) ---------- */

.page-head {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 12px 20px; min-height: 66px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.head-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--accent);
}
.head-icon svg { width: 18px; height: 18px; }
.head-icon.hash { font-size: 20px; font-weight: 700; }
.head-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.head-title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-desc { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-form { width: min(380px, 40%); }
.head-acts { display: flex; gap: 4px; flex: none; }

.search {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search svg { width: 15px; height: 15px; flex: none; }
.search input { border: none; background: transparent; padding: 0; height: 100%; flex: 1; min-width: 0; box-shadow: none !important; }
.search kbd {
  font: 11px ui-monospace, Consolas, monospace; color: var(--muted);
  padding: 1px 6px; border: 1px solid var(--border); border-radius: 6px; white-space: nowrap;
}
.head-search { width: 280px; flex: none; }

/* ---------- Início: salas ---------- */

.rooms { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--bg); }
.rooms-grid {
  padding: 20px; overflow: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; align-content: start;
}
.rooms-grid:empty { display: none; }
.room-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .12s ease, transform .08s ease;
}
.room-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.room-card.busy { border-color: var(--accent); }
.room-card .title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.room-card .title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card .owner { font-size: 12px; color: var(--muted); white-space: nowrap; }
.room-card .people { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.chip {
  font-size: 12px; padding: 2px 9px 2px 3px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--accent-weak); border-color: var(--accent); }
.room-card .empty { font-size: 12px; color: var(--muted); }
.room-card .actions { display: flex; gap: 8px; margin-top: 2px; }
.room-card .actions .primary { flex: 1; }

.invite { display: flex; flex-direction: column; gap: 8px; }
.invite select { flex: 1; min-width: 0; }
.invite button { white-space: nowrap; }

/* estado vazio com ilustração e atalhos (canal sem mensagens, sem salas) */
.welcome {
  margin: auto; padding: 30px 20px; max-width: 640px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.welcome .illu { width: 360px; max-width: 100%; aspect-ratio: 720 / 400; border-radius: 18px; display: block; object-fit: cover; }
.welcome h2 { margin: 14px 0 0; font-size: 22px; letter-spacing: -.3px; }
.welcome p { margin: 0; max-width: 460px; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(140px, 190px)); gap: 12px; margin-top: 16px; }
.quick button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
}
.quick button:hover { border-color: var(--accent); background: var(--surface-2); }
.quick svg { width: 18px; height: 18px; color: var(--accent); }
.quick b { font-size: 13.5px; }
.quick span { font-size: 12px; color: var(--muted); }

/* ---------- coluna da direita: sobre + membros ---------- */

.members {
  background: var(--surface); border-left: 1px solid var(--border);
  padding: 14px; overflow: auto; min-height: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.about-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: none; }
.about-card h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.about-card p { margin: 0; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.facts li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.facts svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.facts .hash { width: 15px; text-align: center; color: var(--muted); font-weight: 700; flex: none; }
.facts .code { overflow: hidden; text-overflow: ellipsis; }
.members ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.members li { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 10px; }
.members li:hover { background: var(--surface-2); }
.members li.off { opacity: .5; }
.members .mtext { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.members .who { flex: none; max-width: 100%; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.members .mstatus { font-size: 11.5px; color: var(--muted); }
.crown { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--warn); flex: none; }
.crown svg { width: 13px; height: 13px; }
.members .acts { margin-left: auto; }
.side-quote {
  margin-top: auto; padding: 14px; border-radius: 14px; flex: none;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  font-size: 12.5px; color: var(--muted); font-style: italic; text-align: center; line-height: 1.45;
}

/* ---------- servidor: canais ---------- */

.guild-head { display: flex; align-items: center; gap: 8px; position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 6;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow);
}
.cover-head .menu { left: 8px; right: 8px; }
.menu button { text-align: left; background: transparent; border: none; padding: 8px 10px; border-radius: 8px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.menu button .badge { margin-left: auto; }
.menu button:hover { background: var(--surface-3); }
.menu button.danger { color: var(--danger); }
.guild:not(.owner) .owner-only { display: none !important; }
.guild.owner .member-only { display: none !important; }
/* "Cargos e permissões" só para quem pode gerenciá-los */
.guild:not(.can-roles) .roles-only { display: none !important; }

/* a lista de canais ocupa a coluna inteira: o botão direito no vazio embaixo também abre o menu */
.channels { display: flex; flex-direction: column; gap: 2px; overflow: auto; flex: 1 1 auto; min-height: 120px; }
.guild .side-spacer { flex: 0 0 0; }
.cat-head {
  display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 0 8px; height: 28px; flex: none;
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600;
}
.cat-head:first-child { margin-top: 0; }

/* seções e categorias recolhíveis: a seta gira, e recolhida mostra quantos canais sumiram */
.cat-head, .channels .sec-head { cursor: pointer; user-select: none; border-radius: 8px; }
.channels .sec-head { padding: 0 8px; height: 28px; flex: none; }
.cat-head:hover, .channels .sec-head:hover { color: var(--text); background: var(--surface-2); }
/* o nome não quebra quando os botões de ação aparecem */
.cat-head > span:not(.caret):not(.acts),
.channels .sec-head > span:not(.caret):not(.acts) {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.caret { display: grid; place-items: center; width: 14px; height: 14px; flex: none; transition: transform .15s ease; }
.caret svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.folded .caret { transform: rotate(-90deg); }
/* o "+" e os outros vão para a direita */
.cat-head .acts, .channels .sec-head .acts { margin-left: auto; }
/* Os botões de ação ficam sempre no layout, só invisíveis: com `display: none` a linha mudava
   de altura ao passar o mouse e a lista inteira "pulava". */
.acts { margin-left: auto; display: flex; gap: 2px; opacity: 0; }
.cat-head:hover .acts, .chan:hover .acts, .members li:hover .acts, .sec-head:hover .acts, .msg:hover .acts,
.cat-head:focus-within .acts, .chan:focus-within .acts, .members li:focus-within .acts, .sec-head:focus-within .acts, .msg:focus-within .acts {
  opacity: 1;
}
/* altura fixa: o botão nunca é mais alto que a linha que o contém */
.acts button { padding: 0 5px; font-size: 12px; line-height: 1; height: 20px; display: grid; place-items: center; background: transparent; border: none; color: var(--muted); }
.acts button:hover { color: var(--text); background: var(--hover); }
.chan {
  display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px; flex: none;
  border-radius: 10px;
  cursor: pointer; color: var(--muted); user-select: none; position: relative;
}
.chan:hover { background: var(--surface-2); color: var(--text); }
.chan.on { background: var(--accent-weak); color: var(--text); }
.chan.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
/* canal com mensagem nova: nome forte, fundo leve e um traço branco à esquerda (o número de
   não lidas fica no próprio canal; a categoria não mostra contagem) */
.chan.unread { color: var(--text); font-weight: 600; background: var(--hover-soft); }
.chan.unread::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 3px; background: var(--text);
}
.chan.unread.on::before { background: var(--accent); }
.chan.unread .hash { opacity: 1; }
.chan .hash { opacity: .6; width: 14px; text-align: center; flex: none; }
.chan.on .hash { opacity: 1; color: var(--accent); }
.chan .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* arrastar para reorganizar: a linha some de leve e a posição de destino ganha uma guia */
.chan[draggable="true"], .cat-head[draggable="true"] { cursor: grab; }
.dragging { opacity: .4; cursor: grabbing; }
.drop-before, .drop-after { position: relative; }
.drop-before::after, .drop-after::after {
  content: ""; position: absolute; left: 4px; right: 4px; height: 2px;
  background: var(--accent); border-radius: 2px; pointer-events: none;
}
.drop-before::after { top: -2px; }
.drop-after::after { bottom: -2px; }
.drop-into { background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--accent); }

/* canais de voz: ícone de alto-falante e quem está na chamada listado embaixo */
.chan.voice .hash { font-size: 0; }
.chan.voice .hash::before { content: ""; display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M11 5 6 9H2v6h4l5 4z'/><path d='M15.5 8.5a5 5 0 0 1 0 7'/><path d='M18.5 5.5a9 9 0 0 1 0 13'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M11 5 6 9H2v6h4l5 4z'/><path d='M15.5 8.5a5 5 0 0 1 0 7'/><path d='M18.5 5.5a9 9 0 0 1 0 13'/></svg>") center / contain no-repeat; }
.chan.voice.incall { color: var(--accent); }
.chan .count { font-size: 11px; color: var(--muted); }
.chan-people { display: flex; flex-direction: column; gap: 1px; padding: 0 0 4px 24px; }
.chan-person { display: flex; align-items: center; gap: 7px; padding: 3px 6px; border-radius: 8px; font-size: 13px; color: var(--muted); }
/* o ícone de quadro no cabeçalho da categoria: porta de entrada dos projetos dela.
   Diferente das outras ações, fica sempre visível (não só ao passar o mouse). Vem por último
   no cabeçalho, e o `auto` à esquerda o empurra para a direita quando não há outras ações. */
.boards-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 5px; border-radius: 6px;
  flex: none; margin-left: auto; height: 20px; line-height: 1;
  background: transparent; border: none; color: var(--muted); cursor: pointer;
}
.acts ~ .boards-btn { margin-left: 0; }
.boards-btn svg {
  width: 14px; height: 14px; display: block; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.boards-btn:hover { background: var(--hover-strong); color: var(--text); }
.boards-btn[data-boards="0"] { opacity: .45; }
.cat-head:hover .boards-btn[data-boards="0"], .sec-head:hover .boards-btn[data-boards="0"] { opacity: 1; }
.boards-btn .badge { font-size: 10px; flex: none; }
/* o ícone de mural vai colado ao de quadro (o primeiro do par é quem empurra para a direita) */
.boards-btn ~ .murals-btn { margin-left: 2px; }
.boards-btn[data-murals="0"] { opacity: .45; }
.cat-head:hover .boards-btn[data-murals="0"], .sec-head:hover .boards-btn[data-murals="0"] { opacity: 1; }
.chan-person .avatar { width: 20px; height: 20px; font-size: 9px; }
.chan-person .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-person.me .pname { color: var(--text); }
.chan-person .live { font-size: 9px; padding: 1px 5px; }
/* mudo: fica à direita do nome, junto com o "AO VIVO" quando os dois aparecem */
.chan-person .muted-tag { font-size: 11px; }
.chan-person.watchable { cursor: pointer; }
.chan-person.watchable:hover { background: var(--surface-2); color: var(--text); }
.chan-person.watching { background: var(--accent-weak); color: var(--text); }


/* ---------- servidor: chat do canal ---------- */

/* área principal: abas em cima (estilo navegador), o conteúdo da aba ativa embaixo */
.guild-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.gbody { flex: 1; display: flex; min-width: 0; min-height: 0; }
.gbody > .gchat, .gbody > .stage, .gbody > .board, .gbody > .card-view, .gbody > .mural-view { flex: 1; min-width: 0; min-height: 0; }
.gbody > .stage .chat-open { display: none; }
/* quadro e card ocupam a largura toda: a coluna de membros sai */
.guild.wide { grid-template-columns: var(--col) 1fr; }
.guild.wide .members { display: none; }

.workspace-bar { display: flex; align-items: center; min-width: 0; flex: none; background: var(--surface); border-bottom: 1px solid var(--border); }
.workspace-bar .gtabs { flex: 1; min-width: 0; border-bottom: 0; }
#workspace-fullscreen { flex: none; margin: 4px 10px 4px 6px; }
#workspace-fullscreen .ico-compress, #workspace-fullscreen.on .ico-expand { display: none; }
#workspace-fullscreen.on .ico-compress { display: block; }

.gtabs {
  display: flex; align-items: flex-end; gap: 4px; flex: none;
  padding: 8px 10px 0; background: var(--surface); border-bottom: 1px solid var(--border);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.gtabs::-webkit-scrollbar { display: none; }
.gtab {
  display: flex; align-items: center; gap: 7px; flex: none; max-width: 220px;
  padding: 7px 10px 7px 12px; border-radius: 10px 10px 0 0;
  background: transparent; border: 1px solid transparent; border-bottom: none;
  color: var(--muted); font-size: 13px; cursor: pointer; user-select: none;
  position: relative; top: 1px;
}
.gtab:hover { background: var(--hover); color: var(--text); border-color: transparent; }
.gtab.on { background: var(--bg); border-color: var(--border); color: var(--text); }
.gtab svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gtab .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtab .badge { flex: none; }
.gtab .tclose {
  flex: none; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px;
  background: transparent; border: none; padding: 0; color: var(--muted); font-size: 13px; line-height: 1;
}
.gtab .tclose:hover { background: var(--hover-strong); color: var(--text); }
.gtab.call { color: var(--accent); }
.gtab.call.on { color: var(--text); }
/* "+" de novo projeto: só o ícone, como o "nova aba" do navegador */
.gtab.plus { padding: 7px 9px; margin-left: 2px; }
.gtab.plus svg { width: 15px; height: 15px; }

/* ---------- quadro ---------- */
.board { display: flex; flex-direction: column; background: var(--bg); }
.board .page-head label.chk { flex: none; }
.board-cols {
  flex: 1; display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 20px; overflow-x: auto; overflow-y: hidden; min-height: 0;
}
.bcol {
  width: 272px; flex: none; max-height: 100%; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.bcol.drop-into { box-shadow: inset 0 0 0 2px var(--accent); }
/* arrastando uma coluna: a barra diz de que lado dela a coluna arrastada vai cair (D86) */
.bcol.drop-left { box-shadow: inset 3px 0 0 var(--accent); }
.bcol.drop-right { box-shadow: inset -3px 0 0 var(--accent); }
.bcol-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: grab;
  font-weight: 600; font-size: 13.5px; border-bottom: 1px solid var(--border);
}
.bcol-head .cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcol-head .ccount { font-size: 11px; color: var(--muted); padding: 1px 7px; border-radius: 999px; background: var(--surface-3); }
.bcol-list { display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow-y: auto; min-height: 40px; flex: 1; }
.bcard {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; position: relative;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.bcard:hover { border-color: var(--border-strong); background: var(--surface-3); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }
.bcard:active { transform: scale(.985); transition-duration: .06s; }
/* juice (D87): quem se move desliza (FLIP no renderBoard), quem chega pula para dentro, quem sai
   encolhe num fantasma por cima da posição antiga; quem é arrastado inclina de leve */
.bcard.moving { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.bcard.enter { animation: card-in .24s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes card-out { to { opacity: 0; transform: scale(.88) translateY(4px); } }
.bcard-ghost { position: fixed; margin: 0; pointer-events: none; z-index: 8; animation: card-out .26s ease-in forwards; box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }
/* card que trocou de coluna: um clone fixo voa por cima das colunas (a lista cortaria o card de
   verdade), e o de verdade fica invisível até o clone pousar */
.bcard-fly { position: fixed; margin: 0; pointer-events: none; z-index: 8; transition: transform .3s cubic-bezier(.2, .8, .2, 1), width .3s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 8px 20px rgba(0, 0, 0, .28); }
.bcard.flying { visibility: hidden; }
.bcard.dragging { opacity: .4; transform: rotate(2deg) scale(.98); }
@keyframes mark-pulse { from { opacity: .55; } to { opacity: 1; } }
.drop-before::after, .drop-after::after, .bcol.drop-left, .bcol.drop-right { animation: mark-pulse .5s ease-in-out infinite alternate; }
.bcol { transition: box-shadow .16s ease, transform .3s cubic-bezier(.2, .8, .2, 1); }
/* capa "card inteiro" (D87): o card todo na cor; o texto vai de escuro (.on-light, capa clara —
   toda a paleta atual) ou branco, o que contrastar mais */
.bcard.cover-full { background: var(--cover); border-color: color-mix(in srgb, var(--cover) 70%, #000); color: #fff; }
.bcard.cover-full:hover { background: color-mix(in srgb, var(--cover) 88%, #fff); }
.bcard.cover-full .cmeta, .bcard.cover-full .ctitle { color: inherit; }
.bcard.cover-full .cmeta { opacity: .85; }
.bcard.cover-full .ccover { display: none; }
.bcard.cover-full.on-light { color: #14181c; border-color: color-mix(in srgb, var(--cover) 75%, #000); }
.bcard .ctitle { font-size: 13.5px; line-height: 1.35; word-break: break-word; }
.bcard .cmeta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.bcard .cmeta .avatar { width: 18px; height: 18px; font-size: 8px; }
.bcard .cmeta .fill { flex: 1; }
.bcard.archived { opacity: .55; }
.bcard.archived .ctitle { text-decoration: line-through; }
.bcard.dragging { opacity: .4; }
.bcol-add {
  margin: 0 10px 10px; padding: 8px 10px; border-radius: 9px; text-align: left;
  background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 13px;
}
.bcol-add:hover { color: var(--text); background: var(--hover); border-color: var(--border-strong); }
.bcol-new {
  width: 272px; flex: none; padding: 12px; border-radius: 14px; text-align: left;
  background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 13.5px;
}
.bcol-new:hover { color: var(--text); background: var(--hover); border-color: var(--border-strong); }
.binline { display: flex; gap: 6px; padding: 0 10px 10px; }
.binline input { flex: 1; min-width: 0; padding: 7px 9px; font-size: 13px; }
.board-empty { margin: auto; text-align: center; color: var(--muted); padding: 40px; max-width: 420px; }

/* ---------- card aberto ---------- */
.card-view { display: flex; flex-direction: column; background: var(--bg); }
.card-title { width: 100%; font-size: 16px; font-weight: 600; padding: 4px 6px; background: transparent; border: 1px solid transparent; border-radius: 8px; }
.card-title:hover { border-color: var(--border); }
.card-title:focus { background: var(--surface); }
.card-view select { width: auto; padding: 6px 9px; font-size: 12.5px; flex: none; }
.card-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 14px 20px 0; gap: 10px; }
.card-desc { width: 100%; min-height: 84px; resize: vertical; font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.card-desc:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.card-body .chat-list { flex: 1; padding: 6px 0; }

/* ---------- propriedades do card: capa, etiquetas, prazo, membros ---------- */
.bcard .ccover { height: 8px; margin: -9px -11px 2px; border-radius: 9px 9px 0 0; }
.bcard .clabels { display: flex; flex-wrap: wrap; gap: 4px; }
.clabel {
  font-size: 11px; font-weight: 600; line-height: 16px; padding: 0 8px; border-radius: 999px;
  color: #0b1218; min-width: 32px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.clabel:empty { height: 8px; line-height: 8px; padding: 0; min-width: 36px; }
.due {
  font-size: 11px; padding: 1px 7px 1px 5px; border-radius: 6px; background: var(--surface-3); color: var(--muted);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.due svg { width: 12px; height: 12px; }
.due.late { background: var(--danger); color: #fff; }
.due.soon { background: var(--warn); color: #1a1400; }
.due.done { background: var(--ok); color: #05261a; text-decoration: line-through; }
.cmembers { display: inline-flex; }
.cmembers .avatar { width: 20px !important; height: 20px !important; font-size: 8px !important; margin-left: -6px; box-shadow: 0 0 0 2px var(--surface-2); }
.cmembers .avatar:first-child { margin-left: 0; }
.cmembers .avatar.more { background: var(--surface-3); color: var(--muted); }
.bcard .cmeta .desc-ico { font-size: 12px; }
/* no card aberto */
.card-cover { height: 10px; flex: none; }
.card-props { display: flex; flex-wrap: wrap; gap: 18px 24px; }
.cprop { display: flex; flex-direction: column; gap: 4px; }
.cprop .k { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.cprop .v { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-height: 28px; }
.cprop .v .icon-btn { width: 28px; height: 28px; }
.cprop .v .due { font-size: 12px; padding: 3px 9px 3px 7px; cursor: pointer; }
.cover-dot { width: 28px; height: 18px; border-radius: 5px; }
/* atalho para um card colado numa conversa */
.card-link {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px 1px 6px; border-radius: 999px; vertical-align: middle;
  background: var(--accent-weak); border: 1px solid var(--accent); color: var(--text); font-size: 12.5px; line-height: 18px;
}
.card-link svg { width: 13px; height: 13px; }
.card-link:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); }
.card-link:disabled { opacity: .55; text-decoration: line-through; }
.external-link { color: var(--accent); text-decoration: underline; overflow-wrap: anywhere; }
.external-link:hover { text-decoration-thickness: 2px; }
.mural-reference { display: inline-flex; align-items: center; max-width: 100%; }
.mural-reference .card-link { white-space: normal; text-align: left; }

/* ---------- painel flutuante (ações do card) ---------- */
.pop {
  position: fixed; top: 0; left: 0; z-index: 21; width: 290px; max-height: 72vh;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.pop-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 4px 14px; font-size: 13px; }
.pop-head b { flex: 1; }
.pop-body { padding: 4px 12px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.pop-body p { margin: 0; }
.pop-list { display: flex; flex-direction: column; gap: 2px; }
.lrow-wrap { display: flex; align-items: center; gap: 2px; }
.lrow-wrap .lrow { flex: 1; min-width: 0; }
.lrow {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; width: 100%;
  background: transparent; border: none; text-align: left; font-size: 13px;
}
.lrow:hover { background: var(--surface-3); }
.lswatch {
  width: 36px; height: 22px; border-radius: 5px; flex: none; padding: 0;
  border: 1px solid transparent; cursor: pointer;
}
.lswatch:hover { border-color: #fff; }
.lrow .lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .lcheck { color: var(--accent); font-weight: 700; width: 14px; text-align: center; flex: none; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.swatch { height: 28px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch:hover { border-color: rgba(255, 255, 255, .6); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.pop .fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.pop .fld input, .pop .fld select, .pop .fld textarea { width: 100%; font-size: 13px; }
/* descrição do card editado no painel: cresce um pouco, mas não vira uma parede */
.pop-desc { resize: vertical; min-height: 62px; max-height: 220px; font-family: inherit; line-height: 1.4; }
.pop-actions { display: flex; gap: 8px; margin-top: 2px; }
.pop-actions .primary { flex: 1; }
.pop button.wide { width: 100%; }

.gchat {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: radial-gradient(900px 500px at 70% 110%, rgba(45, 212, 191, .07), transparent 60%), var(--bg);
}
.gchat .chat-list { flex: 1; display: flex; flex-direction: column; }
#golder { align-self: center; margin: 6px 0 10px; flex: none; }

.chat-list { overflow: auto; padding: 12px 20px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 9px; padding: 3px 6px; margin: 0 -6px; border-radius: 8px; position: relative; }
.msg:hover { background: var(--hover-soft); }
/* o botão de apagar fica no canto, e o corpo da mensagem abre espaço para ele (sem sobrepor,
   senão o clique cai no texto) */
.msg .acts { flex: none; align-self: flex-start; margin: 2px 0 0 auto; }
.msg .acts button { background: var(--surface-3); border-radius: 6px; font-size: 15px; line-height: 20px; padding: 0 7px; }
.msg .acts button:hover { color: var(--text); background: var(--hover-strong); }
/* marca discreta de mensagem editada, ao lado da hora */
.msg .edited { font-size: 10.5px; color: var(--muted); font-style: italic; }
/* reações embaixo da mensagem: pílula por emoji, com a contagem; a minha fica acesa */
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react {
  display: flex; align-items: center; gap: 4px; padding: 1px 7px; height: 22px;
  border-radius: 11px; background: var(--surface-3); border: 1px solid transparent;
  font-size: 12px; color: var(--muted); line-height: 1;
}
.react:hover { border-color: var(--border-strong); color: var(--text); }
.react.on { background: var(--accent-weak); border-color: var(--accent); color: var(--text); }
.react .emoji { font-size: 13px; }
.react .n { font-weight: 600; font-variant-numeric: tabular-nums; }
/* editar no lugar: a caixa ocupa a linha do texto, sem empurrar a conversa */
.edit-box {
  width: 100%; margin-top: 2px; padding: 7px 9px; border-radius: 8px; resize: none; overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--accent); color: var(--text);
  font: inherit; font-size: 14px; line-height: 1.4;
}
.edit-hint { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.msg .avatar { margin-top: 2px; }
.msg .body { min-width: 0; flex: 1; }
.msg .head { display: flex; gap: 8px; align-items: baseline; }
.msg .head .name { font-weight: 600; font-size: 13.5px; }
.msg .head .time { font-size: 11px; color: var(--muted); }
.msg .text { font-size: 14px; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; }
.msg.cont { padding-top: 0; }
.msg.cont .avatar, .msg.cont .head { display: none; }
.msg.cont .body { padding-left: 33px; }
.msg.mine .head .name { color: var(--accent); }
.msg.dim { display: none; }
.chat-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 8px; }

.composer {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface);
}
.composer input { flex: 1; min-width: 0; height: 40px; border-radius: 12px; }
.composer .icon-btn.round { background: var(--surface-3); border-color: transparent; color: var(--text); }

/* ---------- sala: palco, vídeo e pílula ---------- */

#preview {
  width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000; object-fit: contain;
}

.stage { display: flex; flex-direction: row; min-width: 0; background: var(--bg); position: relative; }
.stage-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.stage-empty {
  flex: 1; display: grid; place-items: center;
  color: var(--muted); text-align: center; padding: 24px;
}
.stage-empty .live { vertical-align: middle; }
/* a própria tela no palco (D88): mesmo enquadramento do vídeo de quem se assiste, com uma
   etiqueta discreta no canto para deixar claro que é o que se está mandando */
.stage-self { flex: 1; min-height: 0; position: relative; background: #000; }
.stage-self video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage-self .self-tag {
  position: absolute; left: 14px; top: 12px; display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 6px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12.5px; font-weight: 600; pointer-events: none;
}
#stage-video { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
#stage-video:fullscreen { background: #000; }
#stage-video:fullscreen .video-wrap { position: absolute; inset: 0; }

/* vídeo e, por cima dele, o canvas dos traços */
.video-wrap { position: relative; flex: 1; min-height: 0; background: #000; }
#remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
#ink { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; pointer-events: none; cursor: default; }
#ink.active { pointer-events: auto; cursor: crosshair; }
#ink.disabled { pointer-events: none; cursor: default; }
#draw-toggle.on { background: var(--accent); border-color: transparent; color: var(--on-accent); }

/* ferramentas de desenho */
.ink-tools { gap: 6px; flex-wrap: wrap; }
.ink-tools.disabled .tool, .ink-tools.disabled .colors, .ink-tools.disabled #color-custom { display: none; }
.ink-tools .tool.on { background: var(--accent); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.colors { display: flex; gap: 5px; }
.colors button { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.colors button:hover { border-color: var(--border-strong); }
.colors button.on { border-color: #fff; }
#color-custom { width: 30px; height: 28px; padding: 1px 2px; cursor: pointer; }

/* volume de quem eu assisto */
.vol { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.vol input[type=range] { width: 90px; padding: 0; margin: 0; accent-color: var(--accent); background: transparent; border: none; }
.vol.muted input[type=range] { opacity: .4; }
.vol.ducked #volume { accent-color: var(--muted); }

/* pílula flutuante de controles: uma linha, só ícones, dentro e fora da tela cheia */
.float-bar {
  position: absolute; left: 50%; bottom: 20px; z-index: 3;
  transform: translate(-50%, 0); opacity: 1;
  transition: transform .2s ease, opacity .2s ease;
  display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(16, 23, 31, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  max-width: calc(100% - 32px);
}
.float-bar > span { display: flex; gap: 6px; align-items: center; flex: none; }
.float-bar > span + span, .float-bar > span + button { border-left: 1px solid rgba(255, 255, 255, .1); padding-left: 10px; }
.float-bar .icon-btn { background: rgba(255, 255, 255, .06); border-color: transparent; }
.float-bar .icon-btn:hover { background: rgba(255, 255, 255, .13); }
.float-bar .icon-btn.on { background: var(--accent); color: var(--on-accent); }
.float-bar .icon-btn.danger:hover { background: rgba(240, 97, 109, .25); color: var(--danger); }
.float-bar .icon-btn.ghost { background: transparent; color: var(--muted); }
.float-bar .icon-btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.bar-info { max-width: 260px; overflow: hidden; white-space: nowrap; gap: 5px !important; }
.bar-info b { overflow: hidden; text-overflow: ellipsis; }
.badge-off {
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: rgba(240, 97, 109, .16); color: var(--danger); white-space: nowrap;
}
#ink-kit { display: inline-flex; gap: 6px; align-items: center; }

/* cor do traço: um ponto com a cor atual; clique abre a paleta acima */
.color-pick { position: relative; display: inline-flex; }
.color-dot {
  width: 28px; height: 28px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .7); background: var(--accent);
}
.color-dot:hover { border-color: #fff; }
.color-pop {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; align-items: center;
  padding: 8px 10px; border-radius: 999px;
  background: rgba(16, 23, 31, .95); border: 1px solid var(--border); box-shadow: var(--shadow);
}

/* tela cheia: some quando o mouse para; volta ao mexer */
#stage-video:fullscreen .float-bar, #stage-video:fullscreen .bar-handle { transform: translate(-50%, 16px); opacity: 0; pointer-events: none; }
#stage-video:fullscreen.bar-visible .float-bar, #stage-video:fullscreen.bar-visible .bar-handle { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#stage-video:fullscreen:not(.bar-visible) #ink:not(.active) { cursor: none; }

/* recolhida: só uma alça para trazer de volta */
.bar-handle {
  position: absolute; left: 50%; bottom: 12px; z-index: 3; transform: translate(-50%, 0);
  width: 44px; height: 26px; padding: 0; border-radius: 999px;
  background: rgba(16, 23, 31, .75); border: 1px solid rgba(255, 255, 255, .08); color: var(--muted);
  display: grid; place-items: center; transition: transform .2s ease, opacity .2s ease;
}
.bar-handle:hover { color: var(--text); background: rgba(16, 23, 31, .95); }
.bar-handle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ícone do botão de tela cheia troca conforme o estado */
#fullscreen .ico-compress { display: none; }
#fullscreen.on .ico-expand { display: none; }
#fullscreen.on .ico-compress { display: block; }

/* ---------- chat da sala ---------- */

.chat {
  width: var(--aside); flex: none; display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--surface); border-left: 1px solid var(--border);
}
.chat header {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.chat header span:first-child { flex: 1; }
.chat header .link { color: var(--muted); font-size: 18px; line-height: 1; }
.chat .chat-list { flex: 1; padding: 10px 14px; }
.chat .composer { padding: 10px; }
.chat-open {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px;
}

/* ---------- voz ---------- */

#mic-btn.muted { background: rgba(240, 97, 109, .18); color: var(--danger); border-color: transparent; }
/* silenciado por um moderador: mudo e travado (não abre no clique) */
#mic-btn.locked { background: rgba(240, 97, 109, .3); cursor: not-allowed; box-shadow: inset 0 0 0 1px var(--danger); }
.muted-tag { font-size: 12px; flex: none; opacity: .85; }
#mic-btn.muted svg .slash { display: block; }
/* abre ao lado do botão de ajustes, fora do trilho (que corta o que passa da borda); a
   posição vem por JS (placeVoicePop) */
.voice-pop {
  position: fixed; z-index: 30; width: 280px;
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.voice-pop #voice-status { white-space: normal; }
label.chk { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
label.chk input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; flex: none; }
label.chk.profile-fact { justify-content: flex-start; }
.voice-pop select { padding: 6px 8px; font-size: 12.5px; }

/* ---------- atualização: seta no cartão do usuário ---------- */

.icon-btn.update { flex: none; width: 32px; height: 32px; }
.icon-btn.update.busy { opacity: .55; cursor: progress; }
.icon-btn.update.ready {
  background: var(--accent); border-color: transparent; color: var(--on-accent);
  animation: update-pulse 1.6s ease-in-out infinite;
}
@keyframes update-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, .45); }
  50% { box-shadow: 0 0 0 6px rgba(45, 212, 191, 0); }
}

/* ---------- diálogos, menus, avisos ---------- */

.overlay {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(6, 9, 12, .72); padding: 24px; z-index: 10;
}
#ask-select { width: 100%; }

.card.profile { width: min(480px, 100%); }

/* ---------- perfil do servidor (foto, capa, descrição) e cartão de pessoa ---------- */
.srv-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.cover-head .srv-avatar { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.gdesc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  white-space: normal; font-size: 12px; line-height: 1.35; margin-top: 2px;
}
.guild:not(.can-edit) .edit-only { display: none !important; }
.guild.can-edit .cover { cursor: pointer; }
.guild.can-edit .cover:hover img { filter: brightness(1.08); }
.card.gedit { width: min(520px, 100%); gap: 14px; }
.gedit-banner { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.gedit-banner img { width: 100%; aspect-ratio: 480 / 220; object-fit: cover; display: block; }
.gedit-banner-acts { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.gedit-banner-acts button { background: rgba(0, 0, 0, .6); border-color: transparent; color: #fff; font-size: 12px; padding: 5px 9px; }
.gedit-banner-acts button:hover { background: rgba(0, 0, 0, .8); border-color: transparent; }
.card.gedit .avatar.xl, .card.gedit .avatar-btn, .card.gedit .avatar-hint { border-radius: 18px; }
.card.gedit .avatar.xl img { border-radius: inherit; }
.card.gedit textarea {
  width: 100%; min-height: 70px; resize: vertical; font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
}
.card.gedit textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.card.mcard { width: min(400px, 100%); padding: 0; overflow: hidden; gap: 0; }
.mcard-top { height: 84px; position: relative; }
.mcard-top .avatar.xl { position: absolute; left: 22px; bottom: -28px; width: 72px; height: 72px; font-size: 24px; box-shadow: 0 0 0 4px var(--surface); }
.mcard-body { padding: 38px 22px 16px; display: flex; flex-direction: column; gap: 10px; }
.mcard-name { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.mcard-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.role-chip { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text); }
.mcard-voice input[type="range"] { width: 100%; accent-color: var(--accent); }
.mcard-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.mcard-actions button { font-size: 12.5px; padding: 6px 10px; }
.card.mcard > .link { align-self: flex-end; margin: 0 16px 12px; }
.chan-person { cursor: pointer; }
.chan-person .live { cursor: pointer; }
.members li { cursor: pointer; }

/* O diálogo de perguntar (nome do cargo, confirmações) abre POR CIMA das configurações:
   com o mesmo z-index, o overlay de baixo interceptava os cliques. */
#ask-dialog { z-index: 12; }

/* configurações do servidor: cargos à esquerda, o cargo escolhido e os membros à direita */
.card.settings { width: min(760px, 100%); max-height: 86vh; overflow: auto; }
.settings-cols { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.settings-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.roles-list, .settings-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.roles-list li, .settings-members li {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-size: 13.5px;
}
.roles-list li:hover, .settings-members li:hover { border-color: var(--border-strong); }
.roles-list li.on { border-color: var(--accent); background: var(--accent-weak); }
.roles-list .dot-color { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.roles-list .rname, .settings-members .mname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-members li { cursor: default; }
.settings-members .tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.role-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--muted);
}
.role-tag:hover { border-color: var(--border-strong); color: var(--text); }
.role-tag.on { border-color: currentColor; }
.role-editor { display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
.role-editor input[type="color"] { width: 46px; height: 34px; padding: 2px; flex: none; }
.guild:not(.owner) .owner-only-role { display: none; }
/* a lista de permissões: um grupo por área, cada permissão com a sua caixa */
.role-perms { display: flex; flex-direction: column; gap: 4px; }
.role-perms .perm-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; margin-top: 6px; }
.role-perms label.chk { padding: 3px 0; }
.role-perms label.chk.off { opacity: .55; }
/* "Todo mundo" na lista de cargos: a base, sempre em primeiro */
.roles-list li.everyone .dot-color { background: transparent; border: 1.5px dashed var(--muted); }
.roles-list li.everyone .rname { font-style: italic; }
/* o que cada permissão libera na tela */
.guild:not(.can-cats) .cats-only { display: none !important; }
.guild:not(.can-invite) .invite-only { display: none !important; }
.guild:not(.can-boards) .boards-only { display: none !important; }

@media (max-width: 640px) {
  .settings-cols { grid-template-columns: 1fr; }
}
.profile-row { display: flex; align-items: center; gap: 14px; }
.profile-fact {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
}

/* escolha do tema: uma amostra por tema, com as cores dele */
.profile-theme { display: flex; flex-direction: column; gap: 8px; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; color: var(--muted);
}
.theme-btn:hover { border-color: var(--border-strong); color: var(--text); }
.theme-btn.on { border-color: var(--accent); color: var(--text); background: var(--accent-weak); }
.theme-swatch {
  width: 100%; height: 26px; border-radius: 7px; overflow: hidden;
  display: flex; border: 1px solid var(--border);
}
.theme-swatch i { flex: 1; }
.theme-swatch i:last-child { flex: 0 0 34%; }

/* menu de contexto (botão direito) */
.menu.ctx { position: fixed; top: 0; left: 0; right: auto; min-width: 200px; z-index: 20; }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.ctx-head { padding: 6px 10px 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
/* fileira de reações no topo do menu da mensagem */
.ctx-emojis { display: flex; gap: 2px; padding: 2px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.ctx-emojis button {
  flex: 1; padding: 5px 0; font-size: 17px; line-height: 1; border-radius: 8px;
  background: transparent; border: none; display: grid; place-items: center;
}
.ctx-emojis button:hover { background: var(--hover); transform: scale(1.15); }
/* item marcável (cargos): caixa à esquerda, marcada quando a pessoa tem o cargo */
.menu button.check::before {
  content: ""; width: 14px; height: 14px; border-radius: 4px; flex: none;
  border: 1.5px solid var(--border-strong); display: inline-grid; place-items: center;
}
.menu button.check.on::before { content: "✓"; font-size: 10px; line-height: 1; color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

.toast {
  /* acima da pílula de controles do vídeo, para não se sobreporem */
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 15;
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border);
  padding: 11px 17px; border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: min(90vw, 560px);
  display: flex; align-items: center; gap: 14px;
}
.toast button { padding: 6px 12px; font-size: 13px; white-space: nowrap; }

/* tela de atualização (nossa, no lugar da janela cinza do instalador) */
.updating { background: var(--bg); z-index: 20; }
.updating .card.center { text-align: center; align-items: center; }
.updating .card h1 { font-size: 24px; }
.updating .mark {
  width: 64px; height: 64px; border-radius: 16px; background: var(--bg);
  display: grid; place-items: center; position: relative; margin-bottom: 4px;
}
.updating .mark::before {
  content: ""; width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #5eead4, #14b8a6);
}
.updating .mark::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 4px solid #fff;
}
.updating .progress { width: 100%; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.updating .progress span {
  display: block; height: 100%; width: 40%; border-radius: 999px; background: var(--accent);
  animation: updating-slide 1.2s ease-in-out infinite;
}
@keyframes updating-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}

/* ---------- miniatura da transmissão (D83) ----------
 * Janela flutuante fixa, por cima de tudo menos dos diálogos. Nasce no canto inferior direito,
 * acima da barra de zoom do mural (que fica a 14px do canto); depois vai para onde a pessoa
 * arrastar (`left/top` gravados). Largura fixa; a altura vem do vídeo, em 16:9. */
.mini-player {
  /* 640 px: dá para ler o que está na tela sem voltar ao palco; em janela estreita, 60% dela.
     z 9: acima do conteúdo, abaixo de tudo que é passageiro — diálogos (10/12), toast (15),
     menus (20), popups (21/30). Com 640 px ela cobria o botão de diálogos no canto. */
  position: fixed; right: 24px; bottom: 84px; width: min(640px, 60vw); z-index: 9;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.mini-player[hidden] { display: none; }
.mini-player.dragging { opacity: .92; }
.mini-head {
  display: flex; align-items: center; gap: 7px; padding: 5px 6px 5px 10px;
  font-size: 12px; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
}
.mini-player.dragging .mini-head { cursor: grabbing; }
.mini-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none; animation: call-pulse-live 2.2s ease-out infinite; }
.mini-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-head .icon-btn { flex: none; width: 26px; height: 26px; }
.mini-head .icon-btn svg { width: 14px; height: 14px; }
.mini-player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; object-fit: contain; cursor: pointer; }
/* a própria tela (D85): "transmitindo · sua tela", sem nome em destaque */

/* ---------- telas menores ---------- */

@media (max-width: 1180px) {
  :root { --aside: 250px; --col: 240px; }
  .head-search { width: 200px; }
}
@media (max-width: 960px) {
  /* a faixa não muda: já é de ícones. O que sai é a coluna da direita. */
  .lobby, .guild { grid-template-columns: var(--col) 1fr; }
  .members { display: none; }
  .head-search { display: none; }
  :root { --aside: 240px; }
}
@media (max-width: 720px) {
  .lobby, .guild, .room { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { max-height: 45vh; border-right: none; border-bottom: 1px solid var(--border); }
  .chat { display: none; }
  .quick { grid-template-columns: 1fr; }
}

/* Board e mural expandidos: só a faixa (agora em pé, como coluna estreita), as abas e a área de
   trabalho. O cartão é o mesmo do modo normal, com os controles empilhados e o perfil sobre o
   avatar. Aqui o `#rail` sai da coluna e volta a ser a coluna: é o único lugar onde ele é
   vertical, e por isso as regras da faixa horizontal são desfeitas uma a uma. */
body.workspace-full { --rail: 72px; }
body.workspace-full #guild-view { grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
body.workspace-full #guild-view > .side, body.workspace-full #guild-view > .members { display: none; }
body.workspace-full .rail {
  flex-direction: column; align-items: stretch; gap: 6px;
  width: var(--rail); padding: 10px 8px; margin: 0;
  background: var(--bg); border-right: 1px solid var(--border); border-bottom: none;
  overflow-x: hidden; overflow-y: auto;
}
body.workspace-full .srv-sep { width: auto; height: 1px; margin: 2px 6px; }
body.workspace-full .srv-tab, body.workspace-full .rail-btn { width: 100%; height: 40px; flex: none; }
body.workspace-full #rail-guilds { flex-direction: column; align-items: stretch; flex: 1; min-height: 40px; overflow-y: auto; overflow-x: hidden; gap: 6px; }
body.workspace-full .rail-btn .badge { right: 2px; top: 2px; font-size: 9px; padding: 1px 3px; }
body.workspace-full #panel-slot-rail { flex: none; }
/* na coluna estreita não cabe texto nenhum no cartão: fica o avatar, o ponto e os botões.
   Sem isto o nome empurra o cartão para fora dos 72px e ele aparece cortado. */
body.workspace-full .rail .user-text, body.workspace-full .rail .chev { display: none; }
body.workspace-full .rail .user-panel { padding: 8px; gap: 8px; border-radius: 12px; min-width: 0; overflow: hidden; }
body.workspace-full .rail .user-row { position: relative; justify-content: center; flex-direction: column; gap: 6px; }
body.workspace-full .rail .call-text { display: none; }
body.workspace-full .rail .call-head { position: relative; justify-content: center; }
body.workspace-full .rail .call-dot { position: absolute; left: -3px; top: 0; width: 6px; height: 6px; }
body.workspace-full .rail .call-btns { flex-direction: column; gap: 5px; }
body.workspace-full .rail .call-btns .icon-btn { flex: none; width: 100%; height: 32px; }
body.workspace-full #user-menu-btn { display: block; position: absolute; inset: 0 0 auto; height: 34px; width: 100%; border-radius: 50%; }
body.workspace-full #user-menu-btn svg { display: none; }
body.workspace-full #user-menu-btn:hover { background: var(--hover-strong); }
body.workspace-full .board .page-head { padding-top: 10px; padding-bottom: 10px; }
body.workspace-full .board .head-desc { display: none; }
