/* ============================================================
   CONECTA (#/conecta e #/conecta/<canal>)
   Canais de voz e de texto dos times (docs/meet/PLANO-CONECTA-SERVIDOR.md §5). O trilho + painel
   vem de admin.css e painel.css (body.is-admin, .admin-shell, .admin-nav). Aqui ficam só as peças
   do Conecta, todas com prefixo cn-. Tokens de tokens.css.
   ============================================================ */

/* ---------- Lista de canais (painel do computador e tela do celular) ---------- */
.cn-categoria { margin-bottom: 6px; }
.cn-categoria.is-palco-ativo .painel-grupo { color: var(--vermelho); }
/* Título do grupo com o "+" de Criar canal à direita (só para quem cria) */
.cn-grupo-cab { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cn-grupo-cab .painel-grupo { flex: 1; min-width: 0; }
.cn-criar-mais { display: grid; place-items: center; width: 24px; height: 24px; margin: var(--sp-4) 4px 6px 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.cn-criar-mais:hover, .cn-criar-mais:focus-visible { background: var(--surface-2); color: var(--text); }
.cn-criar-mais .icon { width: 16px; height: 16px; }
.cn-canal {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.cn-canal:hover { background: var(--surface); color: var(--text); }
[data-theme="light"] .cn-canal:hover { background: var(--surface-2); }
.cn-canal.is-ativo { background: var(--surface); color: var(--text); font-weight: 600; }
[data-theme="light"] .cn-canal.is-ativo { background: var(--surface-2); }
.cn-canal.tem-novas { color: var(--text); font-weight: 600; }
.cn-canal:disabled { opacity: .6; cursor: progress; }
.cn-canal .cn-ic { display: grid; place-items: center; width: 20px; flex: none; color: var(--text-muted); }
.cn-canal .icon, .cn-conv-topo .icon, .cn-btn-ic .icon, .cn-acoes .icon { width: 18px; height: 18px; }
.cn-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Canal de voz com gente: o tempo de conversa e o "12/30" descem para a linha de baixo, alinhados
   com o nome, para o nome não ficar cortado no menu estreito. */
.cn-voz.is-conversa { flex-wrap: wrap; row-gap: 0; }
.cn-voz-meta { display: flex; flex-basis: 100%; align-items: center; gap: 8px; padding-left: 28px; font-size: 12px; line-height: 1.3; }
.cn-voz-meta .cn-tempo { margin-left: 0; }
.cn-voz-meta .cn-tempo + .cn-lotacao { margin-left: 0; }
.cn-privado .icon { width: 14px; height: 14px; color: var(--text-muted); }
.cn-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.cn-ao-vivo {
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--vermelho);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cn-lotacao { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cn-lotacao.is-cheio { color: var(--error); font-weight: 700; }
.cn-voz.is-cheio { opacity: .75; }
.cn-pessoas { list-style: none; margin: 0 0 6px; padding: 0 0 0 36px; display: grid; gap: 2px; }
.cn-pessoas li { display: flex; align-items: center; gap: 8px; min-height: 26px; font-size: 13px; color: var(--text-2); }
.cn-pessoas li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-pessoas .cn-mais { padding-left: 2px; color: var(--text-muted); font-size: 12px; }
.cn-vazio { margin: 8px; font-size: 13px; color: var(--text-muted); }

/* Avatar com inicial; a foto cobre a inicial quando carrega */
.cn-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}
.cn-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cn-avatar-mini { width: 22px; height: 22px; font-size: 9.5px; }

/* ---------- Conteúdo ---------- */
.admin-content.cn-conteudo { padding: 0; gap: 0; }
.cn-boas-vindas { display: grid; justify-items: center; gap: 10px; padding: 64px 24px; text-align: center; color: var(--text-2); }
.cn-boas-vindas h1 { margin: 0; font-family: var(--font-display); font-size: 26px; color: var(--text); }
.cn-boas-vindas p { margin: 0; max-width: 420px; }
.cn-ic-grande { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--grad-brand); color: #fff; }
.cn-ic-grande .icon { width: 30px; height: 30px; }
.cn-lista-celular { display: none; }

/* ---------- Conversa ---------- */
.cn-conversa {
  display: flex;
  flex-direction: column;
  /* --cn-topo é a altura real do cabeçalho, medida em views-conecta.mjs. O --painel-topo (57px)
     fica abaixo dela e empurrava o rodapé da conversa para fora da tela. */
  height: calc(100dvh - var(--cn-topo, var(--painel-topo)));
  min-height: 0;
  background: var(--bg);
}
.cn-conv-topo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.cn-conv-topo .cn-ic { color: var(--text-muted); }
.cn-conv-tit { min-width: 0; }
.cn-conv-tit h1 { margin: 0; font-family: var(--font-display); font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-conv-tit small { font-size: 12px; color: var(--text-muted); }
.cn-voltar { display: none; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--text); }
.cn-voltar .icon { width: 22px; height: 22px; }
.cn-regras { margin: 0; padding: 8px 20px; border-bottom: 1px solid var(--border); background: var(--surface); font-size: 13px; }
.cn-regras summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.cn-regras p { margin: 6px 0 2px; white-space: pre-line; color: var(--text-2); }

.cn-mensagens {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.cn-mensagens .painel-esqueleto { padding: 0 20px; }
.cn-inicio-canal, .cn-carregando-antes { margin: 12px 20px; font-size: 13px; color: var(--text-muted); text-align: center; }
.cn-dia { display: flex; align-items: center; gap: 12px; margin: 14px 20px 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.cn-dia::before, .cn-dia::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.cn-msg {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 2px 12px;
  padding: 6px 20px;
  transition: background var(--t-fast) var(--ease);
}
.cn-msg:not(.is-emendada) { margin-top: 6px; }
.cn-msg:hover, .cn-msg:focus-within { background: var(--surface); }
.cn-msg.is-mencionado { background: color-mix(in srgb, var(--warning) 12%, transparent); box-shadow: inset 3px 0 0 var(--warning); }
.cn-msg.is-destaque { background: color-mix(in srgb, var(--violeta) 18%, transparent); }
.cn-msg.is-emendada { padding-top: 1px; padding-bottom: 1px; }
.cn-hora-lado { align-self: start; padding-top: 3px; font-size: 10.5px; color: transparent; text-align: right; font-variant-numeric: tabular-nums; }
.cn-msg.is-emendada:hover .cn-hora-lado { color: var(--text-muted); }
.cn-msg-corpo { min-width: 0; }
.cn-msg-cab { display: flex; align-items: baseline; gap: 8px; margin: 0 0 2px; }
.cn-msg-cab b { font-size: 14px; }
.cn-msg-cab time { font-size: 11.5px; color: var(--text-muted); }
.cn-texto { margin: 0; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cn-texto a { color: var(--ink-brand); text-decoration: underline; }
.cn-mencao { padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, var(--violeta) 22%, transparent); color: var(--ink-brand); font-weight: 600; }
.cn-editada { font-size: 11px; color: var(--text-muted); }
.cn-apagada { margin: 0; font-size: 13.5px; font-style: italic; color: var(--text-muted); }
.cn-citacao {
  display: flex;
  gap: 6px;
  max-width: 100%;
  margin: 2px 0 4px;
  padding: 4px 10px;
  border: 0;
  border-left: 3px solid var(--violeta);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.cn-citacao span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cn-anexos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.cn-anexo-img { padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; cursor: zoom-in; }
.cn-anexo-img img { display: block; max-width: min(320px, 70vw); max-height: 240px; min-width: 80px; min-height: 60px; object-fit: cover; }
.cn-anexo-arq {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cn-anexo-arq .icon { width: 22px; height: 22px; flex: none; color: var(--ink-brand); }
.cn-anexo-arq b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-anexo-arq small { font-size: 11.5px; color: var(--text-muted); }

/* Prévia de documento: cartão com o selo do tipo, Abrir e Baixar, e o começo do texto */
.cn-anexo-doc { display: flex; flex-direction: column; width: min(420px, 100%); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.cn-anexo-doc:hover { border-color: var(--border-strong); box-shadow: 0 4px 14px -8px rgb(0 0 0 / .35); }
.cn-anexo-cab { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; }
.cn-anexo-selo { display: grid; place-items: center; flex: none; width: 40px; height: 48px; border-radius: 6px; background: #6b7280; color: #fff; font: 800 11px/1 var(--font-display); letter-spacing: .03em; clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%); }
.cn-anexo-selo.is-pdf { background: #e5484d; }
.cn-anexo-selo.is-doc { background: #2f6fed; }
.cn-anexo-selo.is-planilha { background: #1f9d55; }
.cn-anexo-selo.is-apresentacao { background: #e8743b; }
.cn-anexo-selo.is-texto { background: var(--roxo); }
.cn-anexo-nome { flex: 1; min-width: 0; }
.cn-anexo-nome b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-anexo-nome small { font-size: 12px; color: var(--text-muted); }
.cn-anexo-acoes { display: flex; gap: 2px; flex: none; }
:is(.admin-content, .painel-camada) .cn-anexo-acao { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; transition: background var(--t-fast), color var(--t-fast), transform .12s; }
:is(.admin-content, .painel-camada) .cn-anexo-acao:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
:is(.admin-content, .painel-camada) .cn-anexo-acao:active { transform: scale(.92); }
.cn-anexo-acao .icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cn-anexo-trecho { margin: 0; max-height: 168px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; overflow: hidden; }
.cn-anexo-trecho.is-aberto { max-height: 420px; overflow: auto; }
:is(.admin-content, .painel-camada) .cn-anexo-mais { padding: 8px 12px; border: 0; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--ink-brand); font: 600 13px var(--font-body); text-align: left; cursor: pointer; }
:is(.admin-content, .painel-camada) .cn-anexo-mais:hover { text-decoration: underline; }

/* Cartão do link (o embed do Discord): barra na cor do site, nome do site, título, descrição e capa */
.cn-cartao { --cn-cartao-cor: var(--roxo); width: min(432px, 100%); margin-top: 6px; border-left: 4px solid var(--cn-cartao-cor); border-radius: 4px var(--r-md) var(--r-md) 4px; background: var(--surface-2); animation: cn-cartao-entra .2s var(--ease-out, ease-out); }
.cn-cartao[hidden] { display: none; }
.cn-cartao-corpo { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 14px 12px; }
.cn-cartao-site { font-size: 12px; color: var(--text-muted); }
.cn-cartao-titulo { font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--ink-brand); text-decoration: none; }
.cn-cartao-titulo:hover { text-decoration: underline; }
.cn-cartao-desc { margin: 0; font-size: 14px; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cn-cartao-capa { display: block; margin-top: 6px; border-radius: var(--r-md); overflow: hidden; }
.cn-cartao-img { display: block; width: 100%; max-height: 300px; object-fit: cover; transition: transform .25s var(--ease-out, ease-out); }
.cn-cartao-capa:hover .cn-cartao-img { transform: scale(1.02); }
@keyframes cn-cartao-entra { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .cn-cartao { animation: none; } .cn-cartao-img { transition: none; } }

.cn-reacoes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cn-reacao {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.cn-reacao small { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cn-reacao.is-minha { border-color: var(--violeta); background: color-mix(in srgb, var(--violeta) 16%, transparent); }

/* Barra de ações da mensagem: aparece no hover e no foco */
.cn-acoes {
  position: absolute;
  top: -14px;
  right: 16px;
  display: none;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-alt);
  box-shadow: var(--shadow-pop);
}
.cn-msg:hover .cn-acoes, .cn-msg:focus-within .cn-acoes { display: flex; }
.cn-acoes button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.cn-acoes button:hover { background: var(--surface-2); color: var(--text); }
.cn-acoes button.perigo:hover, .cn-acoes button.is-confirmando { color: var(--error); }
.cn-seletor-reacao {
  position: absolute;
  z-index: 5;
  top: 20px;
  right: 16px;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--bg-alt);
  box-shadow: var(--shadow-pop);
}
.cn-seletor-reacao[hidden] { display: none; }
.cn-seletor-reacao button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; font-size: 18px; cursor: pointer; }
.cn-seletor-reacao button:hover { background: var(--surface-2); }

.cn-editar { display: grid; gap: 6px; margin-top: 2px; }
.cn-editar textarea { width: 100%; min-height: 60px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--bg-alt); color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
.cn-editar div { display: flex; justify-content: flex-end; gap: 6px; }

.cn-novas {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -44px 0 8px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  z-index: 2;
}
.cn-novas[hidden] { display: none; }
.cn-novas .icon { width: 16px; height: 16px; }

/* ---------- Composer ---------- */
.cn-composer { position: relative; padding: 8px 20px 16px; border-top: 1px solid var(--border); background: var(--bg); }
.cn-linha {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-alt);
}
.cn-linha:focus-within { border-color: var(--ink-brand); }
.cn-linha textarea {
  flex: 1;
  min-height: 36px;
  max-height: 160px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.4;
  resize: none;
  outline: none;
}
.cn-btn-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.cn-btn-ic:hover { background: var(--surface-2); color: var(--text); }
.cn-enviar { background: var(--grad-brand); color: #fff; }
.cn-enviar:hover { background: var(--grad-brand); color: #fff; filter: brightness(1.08); }
.cn-composer[hidden] { display: none; }
.cn-so-leitura { margin: 0; padding: 14px 20px 16px; border-top: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font-size: 13px; text-align: center; }
.cn-composer.is-enviando .cn-enviar { opacity: .6; cursor: progress; }
.cn-respondendo, .cn-previas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12.5px; color: var(--text-2); }
.cn-respondendo[hidden], .cn-previas[hidden] { display: none; }
.cn-respondendo span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-respondendo button, .cn-previa button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.cn-respondendo .icon, .cn-previa .icon { width: 14px; height: 14px; }
.cn-previa { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); }
.cn-previa small { color: var(--text-muted); }
.cn-erro { margin: 6px 0 0; font-size: 12.5px; color: var(--error); }
.cn-erro[hidden] { display: none; }
.cn-mencoes-lista {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(100% - 4px);
  max-height: 260px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-alt);
  box-shadow: var(--shadow-pop);
}
.cn-mencoes-lista[hidden] { display: none; }
.cn-mencoes-lista button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.cn-mencoes-lista button.is-ativo, .cn-mencoes-lista button:hover { background: var(--surface-2); }

/* ---------- Celular e tablet: lista em tela inteira, conversa por cima ---------- */
@media (max-width: 1023px) {
  .cn-boas-vindas { display: none; }
  .cn-lista-celular { display: block; padding: 4px 4px 24px; }
  .cn-lista-celular .painel-grupo { margin-top: 18px; }
  .cn-canal { min-height: 46px; font-size: 15px; }
  /* O .admin-content tem animação com transform e container-type (admin.css). Os dois prendem o
     position: fixed dentro dele, e a conversa ficava com altura zero. Com conversa aberta, solta. */
  .cn-shell.tem-conversa .cn-conteudo { animation: none; transform: none; container-type: normal; }
  .cn-conversa {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-nav) + 2);
    height: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: cn-entra .22s var(--ease-out);
  }
  .cn-conv-topo { padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; }
  .cn-voltar { display: grid; }
  .cn-msg { padding-left: 12px; padding-right: 12px; }
  .cn-composer { padding: 8px 10px 10px; }
  .cn-so-leitura { padding: 14px 16px; }
  .cn-acoes { right: 8px; }
  .cn-seletor-reacao { right: 8px; }
}
@keyframes cn-entra { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Criar canal (modal na camada do painel, fora do .admin-content) ---------- */
.painel-camada .modal.cn-criar { width: min(480px, calc(100vw - 32px)); }
.cn-criar .modal-cab { align-items: flex-start; }
.cn-criar-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.cn-criar-corpo { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.cn-tipos { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.cn-tipos legend, .cn-campo, .cn-passo-titulo { margin: 0 0 6px; padding: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.cn-campo { display: block; margin-top: 6px; }
.cn-tipo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.cn-tipo:hover { background: var(--surface-2); }
.cn-tipo:has(input:checked) { border-color: color-mix(in srgb, var(--ink-brand) 60%, transparent); background: var(--surface-2); }
.cn-tipo input { position: absolute; opacity: 0; pointer-events: none; }
.cn-tipo-ic { display: grid; place-items: center; width: 32px; height: 32px; flex: none; color: var(--text-2); }
.cn-tipo-ic .icon { width: 22px; height: 22px; }
.cn-tipo-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cn-tipo-txt b { font-size: 14px; color: var(--text); }
.cn-tipo-txt small { font-size: 12.5px; color: var(--text-muted); }
.cn-radio { width: 20px; height: 20px; flex: none; border: 2px solid var(--border-strong); border-radius: 50%; }
.cn-tipo:has(input:checked) .cn-radio { border: 6px solid var(--ink-brand); }
.cn-tipo:has(input:focus-visible) { outline: 2px solid var(--ink-brand); outline-offset: 2px; }
.cn-campo-nome { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.cn-campo-nome:focus-within { border-color: var(--ink-brand); }
.cn-campo-ic { display: grid; place-items: center; color: var(--text-muted); }
.cn-campo-ic .icon { width: 18px; height: 18px; }
.cn-campo-nome input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; outline: none; }
.cn-campo-erro, .cn-criar-msg { margin: 0; font-size: 12.5px; color: var(--vermelho); }
.cn-campo-erro[hidden], .cn-criar-msg[hidden], .cn-link[hidden] { display: none; }
.cn-select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); color: var(--text); font: inherit; }
.cn-privado-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.cn-privado-rotulo { display: flex; align-items: center; gap: 8px; font-size: 14px; }
/* O painel.css pinta todo input da camada (foco com contorno, checkbox quadrado): aqui o campo
   e a busca já têm a borda deles, então o contorno interno sai. */
.cn-criar .cn-campo-nome input:focus, .cn-criar .cn-busca-alvo input:focus { outline: none; }
.cn-privado-ic .icon { width: 18px; height: 18px; color: var(--text-2); }
.cn-ajuda { margin: 0; font-size: 12.5px; color: var(--text-muted); }
/* Interruptor (liga e desliga) */
.cn-criar .cn-chave { position: relative; width: 40px; height: 24px; flex: none; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background var(--t-fast); }
.cn-criar .cn-chave::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--t-fast); }
.cn-criar .cn-chave[aria-checked="true"] { background: var(--grad-brand); }
.cn-criar .cn-chave[aria-checked="true"]::after { transform: translateX(16px); }
.cn-criar .cn-link { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--ink-brand); font-size: 13px; font-weight: 600; cursor: pointer; }
.cn-criar .cn-link:hover { text-decoration: underline; }
.cn-criar-rodape { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
/* Passo 2: quem pode entrar e quem fica de fora */
.cn-abas { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface); }
.cn-abas button { flex: 1; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cn-abas button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.cn-abas small { font-weight: 500; color: var(--ink-brand); }
.cn-busca-alvo { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.cn-busca-alvo:focus-within { border-color: var(--ink-brand); }
.cn-busca-alvo .icon { width: 16px; height: 16px; color: var(--text-muted); }
.cn-busca-alvo input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; }
.cn-alvos { max-height: min(46vh, 340px); overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; }
.cn-alvos-grupo { margin: 10px 4px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.cn-alvo { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; border-radius: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.cn-alvo:hover { background: var(--surface-2); }
.cn-avatar-time { color: var(--text-2); }
.cn-avatar-time .icon { width: 13px; height: 13px; }
@media (max-width: 1023px) {
  .cn-criar-mais { width: 32px; height: 32px; }
  .painel-camada .modal.cn-criar { width: 100%; }
  .cn-criar-rodape .btn { flex: 1; }
  .cn-alvos { max-height: none; }
}
@media (prefers-reduced-motion: reduce) { .cn-conversa { animation: none; } }
