/* ============================================================
   PERFIL DO USUÁRIO (modal)
   ============================================================ */
.profile-modal {
  max-width: 600px;
  text-align: center;
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
/* Fundo do modal = imagem/GIF/vídeo (só na aba Perfil; configs usam fundo normal) */
.profile-modal-bg { position: absolute; inset: 0; }
.profile-banner-media { position: absolute; inset: 0; }
.profile-banner-media img,
.profile-banner-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-banner-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-secondary);
}
/* Controle de som do vídeo de fundo (canto inferior direito): slider + botão */
.profile-banner-sound {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  z-index: 5;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 20px;
  transition: background 0.15s, border-color 0.15s;
}
.profile-banner-volume {
  align-self: center;   /* alinha a barrinha ao centro do alto-falante */
  margin: 0 !important;
  accent-color: #fff;   /* branco, não azul */
  background: transparent;
  border: none;
  cursor: pointer;
}
.profile-banner-sound-btn {
  padding: 8px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

/* Quando MUTADO (sem a barrinha), o alto-falante volta a ser um botão redondo com sombra */
.profile-banner-sound:has(.profile-banner-volume.hidden) {
  background: transparent;
  border: none;
  border-radius: 50%;
}
.profile-banner-sound:has(.profile-banner-volume.hidden) .profile-banner-sound-btn {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  padding: 8px !important;
}
.profile-banner-sound-btn:active { transform: scale(0.92); }
.profile-banner-sound-btn .mi { font-size: calc(20px * var(--ui-scale)); }
.profile-modal--config .profile-modal-inner { background: var(--bg-secondary); }
.profile-modal-inner {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 8px;
  border-radius: 10px;
}

.profile-body {
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  font-size: calc(26px * var(--font-scale));
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.profile-avatar.own { cursor: pointer; }
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-avatar .avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: calc(14px * var(--font-scale));
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.profile-avatar.own:hover .avatar-overlay { opacity: 1; }
.profile-avatar.uploading { opacity: 0.6; }

.profile-info {
  min-width: 0;
}

.profile-username {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: calc(16px * var(--font-scale));
  font-weight: 700;
  word-break: break-word;
  min-width: 0;
}
/* Nome destacado: legível em qualquer transparência do fundo */
.profile-username .profile-username-text {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.55);
  font-weight: 800;
}
/* Nome do PRÓPRIO perfil é clicável (editar nome exibido) */
.profile-username .profile-username-text.editable {
  cursor: pointer;
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: -6px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.profile-username .profile-username-text.editable::after {
  content: '✎';
  font-size: calc(12px * var(--font-scale));
  margin-left: 8px;
  opacity: 0.55;
  font-weight: 600;
}
.profile-username .profile-username-text.editable:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}
.profile-username .profile-username-text.editable:hover::after {
  opacity: 1;
}
.profile-username .profile-tag {
  color: var(--text-muted);
  font-size: calc(12px * var(--font-scale));
  font-weight: 600;
  margin-left: 0;
  opacity: 0.85;
}

.profile-status,
.profile-role {
  font-size: calc(13px * var(--font-scale));
  color: var(--text-muted);
  margin-top: 2px;
}
/* Status com bolinha colorida (online = verde em destaque) */
.profile-status { display: flex; align-items: center; gap: 6px; }
.status-text { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status-dot-mini { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.profile-status .online { color: var(--green-bright); }
.profile-status .online .status-dot-mini { background: var(--green-bright); box-shadow: 0 0 6px var(--green-bright); }
.profile-status .idle { color: var(--yellow); }
.profile-status .idle .status-dot-mini { background: var(--yellow); }
.profile-status .dnd { color: var(--red); }
.profile-status .dnd .status-dot-mini { background: var(--red); }
.profile-status .offline { color: var(--text-muted); }

/* Mensagem do status (Online, <msg>) + status clicável no próprio perfil */
.profile-status-msg { font-weight: 500; color: var(--text-muted); }
.profile-status.clickable-status { cursor: pointer; }
.profile-status.clickable-status:hover { opacity: 0.8; }

.profile-mods {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 12px;
}

.profile-mod-btn {
  width: auto;
}

/* Botão de banimento da plataforma (destacado, só admin geral) */
#profile-platform-ban.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

#profile-platform-ban.btn-danger:hover {
  background: #ff6b6b;
  border-color: #ff6b6b;
}

/* ---------- Abas do perfil próprio (Perfil | Configurações | Conta) ---------- */
/* Botão fechar (X) no canto superior direito — aparece em todas as abas */
.profile-close-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  z-index: 10;
}
.profile-close-x:hover { background: var(--bg-hover); color: #fff; }
.profile-close-x .mi { font-size: calc(20px * var(--ui-scale)); }

.profile-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  background: var(--bg-input);
  border-radius: 12px;
}
.profile-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
/* Progresso de envio de anexo do perfil (acima das abas) */
.profile-upload-progress {
  padding: 8px 12px 4px;
}
.profile-upload-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: calc(12px * var(--font-scale));
  color: var(--text-muted);
  margin-bottom: 4px;
}
.profile-upload-progress-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-upload-progress-pct { font-weight: 700; }
.profile-upload-progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
}
.profile-upload-progress-bar {
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.1s linear;
}
.profile-tab .mi { font-size: calc(18px * var(--ui-scale)); }
.profile-tab:hover { background: var(--bg-hover); color: var(--text-normal); }
.profile-tab.active { background: var(--blurple); color: #fff; }

/* ---------- Banner do perfil (capa) + nome/status sobre ele ---------- */
.profile-capa {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  background: linear-gradient(160deg, rgba(88, 101, 242, 0.28), rgba(0, 0, 0, 0.6));
}
.profile-capa .profile-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-capa .profile-body {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  background: transparent;
  border: none;
}
/* Banner (capa) com imagem: remove o gradiente de "sem banner" — a foto transparente
   mostra o fundo do perfil ATRÁS, em vez da cor/letras do estado vazio. */
.profile-capa.has-banner { background: transparent; }
/* Modal com fundo de perfil: remove o fundo sólido — um fundo transparente mostra o
   que está ATRÁS do modal (backdrop), em vez do fundo "sem foto". */
.profile-modal.has-fundo { background: transparent; }

/* Ações sempre visíveis ABAIXO do perfil (DM / amizade) + setinha de moderação no canto direito inferior */
.profile-banner-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 6px 16px 12px;
}
.profile-banner-actions .profile-opt-btn {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 4px 8px;
  font-size: calc(11px * var(--font-scale));
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
}
.profile-banner-actions .profile-opt-btn .mi { font-size: calc(15px * var(--ui-scale)); }
.profile-banner-actions .profile-opt-label { flex: 0 1 auto; }

/* Editar fundo do perfil (canto superior esquerdo, no topo do fundo — como o X, mas à esquerda) -> prévia -> aplicar/cancelar */
.profile-fundo-edit {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Editar banner do perfil (canto superior DIREITO do banner) -> prévia -> aplicar/cancelar.
   O FUNDO (`#profile-fundo-edit`) continua no canto superior ESQUERDO. */
.profile-banner-edit {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-banner-edit-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.profile-banner-edit-btn:hover { background: rgba(0, 0, 0, 0.55); }
.profile-banner-edit-btn .mi { font-size: calc(18px * var(--ui-scale)); }
.profile-banner-edit-act:hover { border-color: var(--green); color: var(--green-bright); }
/* Linha própria da setinha de moderação, abaixo dos botões.
   position:relative + z-index:2 p/ ficar ACIMA do #profile-thumbnail (que é position:absolute
   inset:0 e, por ser posicionado, pintava por cima do conteúdo não-posicionado desta linha —
   com banner a setinha ficava coberta e não abria a moderação). */
.profile-banner-toggle-row {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 2px 0 6px;
}
.profile-opt-toggle {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: color 0.15s;
}
.profile-opt-toggle:hover { color: var(--blurple); }
.profile-opt-toggle .mi {
  font-size: calc(22px * var(--ui-scale));
  transition: transform 0.25s ease;
}
.profile-opt-toggle.open .mi { transform: rotate(180deg); }

/* Opções de moderação expandidas dentro do banner (aumentam o banner) */
.profile-opt-expand {
  position: relative;
  z-index: 1;
  margin: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
}
.profile-opt-expand .profile-opt-grid { height: auto; }
.profile-opt-expand .profile-opt-row { height: auto; }
.profile-opt-expand .profile-opt-btn { height: auto; min-height: 34px; }

/* Botão de "adicionar biografia" quando ainda não há bio (perfil próprio) */
.profile-bio-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: calc(13px * var(--font-scale));
  cursor: pointer;
  margin-bottom: 10px;
}
.profile-bio-empty:hover { border-color: var(--blurple); color: var(--text-normal); }

/* Cabeçalho do editor de bio no perfil (salvar/cancelar em check/X) */
.profile-bio-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.profile-bio-edit-actions { display: flex; gap: 6px; }

/* ---------- Biografia (markdown) sobre o fundo, bem transparente e letra cinza ---------- */
.profile-bio-wrap {
  text-align: left;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.22); /* mais transparente: mídia bem visível por trás */
  border-radius: 10px;
  border: none;
  margin-bottom: 10px;
}
.profile-bio {
  font-size: calc(14px * var(--font-scale));
  color: #9aa0a6; /* letra mais cinza */
  word-break: break-word;
  white-space: pre-wrap;
  text-align: left;
}

/* ---------- Painéis de edição (Configurações / Conta) ---------- */
.profile-pane { text-align: left; }
.profile-pane-main {
  width: 100%;
  padding: 4px 6px 10px;
}

.profile-opt-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(5, auto);
  gap: 8px;
  width: 100%;
  height: 100%;
}
.profile-opt-row {
  display: flex;
  gap: 8px;
  width: 100%;
  height: 100%;
}
.profile-opt-btn {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 5px 8px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  font-size: calc(12px * var(--font-scale));
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.profile-opt-btn .mi { flex: 0 0 auto; font-size: calc(16px * var(--ui-scale)); }
/* Rótulo: texto centralizado no espaço entre o ícone e o fim; quebra sem crescer/abreviar */
.profile-opt-btn .profile-opt-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Cor fosca por padrão (fundo); no hover a cor "acende" */
#profile-dm.profile-opt-btn { background: rgba(88, 101, 242, 0.22); border-color: rgba(88, 101, 242, 0.55); }
#profile-dm.profile-opt-btn:hover { background: var(--blurple); color: #fff; border-color: var(--blurple); }

#profile-unfriend.profile-opt-btn { background: rgba(255, 107, 107, 0.22); border-color: rgba(255, 107, 107, 0.55); }
#profile-unfriend.profile-opt-btn:hover { background: #ff6b6b; color: #fff; border-color: #ff6b6b; }

#profile-rename-member.profile-opt-btn { background: rgba(35, 165, 90, 0.22); border-color: rgba(35, 165, 90, 0.55); }
#profile-rename-member.profile-opt-btn:hover { background: var(--green); color: #fff; border-color: var(--green); }

#profile-disable-messages.profile-opt-btn { background: rgba(250, 166, 26, 0.22); border-color: rgba(250, 166, 26, 0.55); }
#profile-disable-messages.profile-opt-btn:hover { background: var(--yellow); color: #000; border-color: var(--yellow); }

#profile-mute.profile-opt-btn,
#profile-deafen.profile-opt-btn { background: rgba(237, 66, 69, 0.22); border-color: rgba(237, 66, 69, 0.55); }
#profile-mute.profile-opt-btn:hover,
#profile-deafen.profile-opt-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

#profile-kick.profile-opt-btn,
#profile-ban.profile-opt-btn { background: rgba(237, 66, 69, 0.22); border-color: rgba(237, 66, 69, 0.55); }
#profile-kick.profile-opt-btn:hover,
#profile-ban.profile-opt-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

#profile-platform-ban.profile-opt-btn { background: rgba(224, 49, 49, 0.22); border-color: rgba(224, 49, 49, 0.55); }
#profile-platform-ban.profile-opt-btn:hover { background: #e03131; color: #fff; border-color: #e03131; }

#profile-delete-account.profile-opt-btn { background: rgba(161, 45, 45, 0.22); border-color: rgba(161, 45, 45, 0.55); }
#profile-delete-account.profile-opt-btn:hover { background: #a12d2d; color: #fff; border-color: #a12d2d; }

/* Estado ACESO (persistente): cor plena, como no hover — mutado/silenciado/desativado/amigo */
.profile-opt-btn.on,
.profile-opt-btn.on:hover { color: #fff; }
#profile-dm.profile-opt-btn.on,
#profile-dm.profile-opt-btn.on:hover { background: var(--blurple); border-color: var(--blurple); }
#profile-unfriend.profile-opt-btn.on,
#profile-unfriend.profile-opt-btn.on:hover { background: var(--green); border-color: var(--green); }
#profile-disable-messages.profile-opt-btn.on,
#profile-disable-messages.profile-opt-btn.on:hover { background: var(--yellow); color: #000; border-color: var(--yellow); }
#profile-mute.profile-opt-btn.on,
#profile-mute.profile-opt-btn.on:hover { background: var(--red); border-color: var(--red); }
#profile-deafen.profile-opt-btn.on,
#profile-deafen.profile-opt-btn.on:hover { background: var(--red); border-color: var(--red); }

.profile-edit-section {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-edit-label {
  font-size: calc(13px * var(--font-scale));
  font-weight: 700;
  color: var(--text-normal);
}
.profile-edit-label em {
  color: var(--text-muted);
  font-weight: 500;
  font-style: normal;
  font-size: calc(12px * var(--font-scale));
  display: block;
  margin-top: 2px;
}
.profile-bio-input {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-normal);
  padding: 8px 10px;
  font-size: calc(14px * var(--font-scale));
  font-family: inherit;
}
.profile-bio-input:focus { outline: none; border-color: var(--blurple); }
.profile-char-count { font-size: calc(11px * var(--font-scale)); color: var(--text-muted); align-self: flex-end; }

/* Editor de biografia (WYSIWYG — mostra as cores sem o código) */
.profile-bio-editor {
  min-height: 92px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-normal);
  padding: 8px 10px;
  font-size: calc(14px * var(--font-scale));
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
}
.profile-bio-editor:focus { border-color: var(--blurple); }
.profile-bio-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
  white-space: normal;
}

/* Ferramenta de cor da biografia */
.profile-bio-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-bio-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 100%;
}
.bio-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s;
}
.bio-color:hover { transform: scale(1.18); }
.bio-color-current {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: #ff5f56;
  display: inline-block;
  flex-shrink: 0;
}
#profile-bio-color-custom {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.bio-color-tone-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: calc(12px * var(--font-scale));
  color: var(--text-muted);
}
.bio-color-tone-row .profile-opacity { flex: 1; max-width: none; }
.profile-bio-plain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: calc(12px * var(--font-scale));
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
  user-select: none;
}
.profile-bio-plain input { cursor: pointer; }

.profile-edit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.profile-thumb-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}
.profile-opacity-row { justify-content: space-between; }
.profile-opacity { flex: 1; max-width: 200px; }
.profile-save-row { justify-content: flex-end; margin-top: 4px; }

/* Gerenciador de foto de perfil (2 linhas de 8: favoritos + histórico, sem quebra) */
.avatar-manager { width: min(600px, 94vw); }
.avatar-mgr-section { margin-bottom: 12px; }
.avatar-mgr-label {
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.avatar-mgr-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  width: 100%;
}
.avatar-mgr-add,
.avatar-mgr-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--bg-input);
  color: var(--text-normal);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.15s, transform 0.15s;
}
.avatar-mgr-add .mi { font-size: calc(20px * var(--ui-scale)); }
.avatar-mgr-add:hover { border-color: var(--blurple); color: var(--blurple); }
.avatar-mgr-item:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); border-color: transparent; }
.avatar-mgr-item.empty:hover { box-shadow: none; }
.avatar-mgr-item.empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  cursor: default;
}
.avatar-mgr-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-mgr-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.15s;
}
.avatar-mgr-item:hover .avatar-mgr-overlay { opacity: 1; }
.avatar-mgr-act {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-mgr-act:hover { background: var(--blurple); }
.avatar-mgr-act .mi { font-size: calc(17px * var(--ui-scale)); }
/* Divisão vertical (|) entre as ações dentro da foto */
.avatar-mgr-divider {
  width: 1px;
  height: 55%;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

/* Visualização do avatar antes de usar */
.avatar-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}
.avatar-preview-wrap img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.15);
}
.profile-account-list { gap: 4px; }
.profile-account-list .profile-mod-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

/* Botões do perfil próprio mais bonitos (ícone + texto, cantos arredondados) */
.profile-mod-btn,
.profile-pane .btn-primary,
.profile-pane .btn-secondary,
.profile-pane .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  font-weight: 600;
  padding: 9px 14px;
  transition: transform 0.12s, filter 0.12s, background 0.15s, border-color 0.15s;
}
.profile-mod-btn:hover,
.profile-pane .btn-primary:hover,
.profile-pane .btn-secondary:hover,
.profile-pane .btn-danger:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* Servidores de um usuário (lateral de membros, numa DM) */
.dm-servers {
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: calc(13px * var(--font-scale));
  color: var(--text-muted);
}

.dm-servers-title {
  font-size: calc(11px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.dm-server-chip {
  padding: 4px 8px;
  background: var(--bg-hover);
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dm-server-chip:hover {
  background: var(--bg-input);
  color: var(--text-normal);
}

.msg-temp {
  font-size: calc(10px * var(--font-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--yellow);
  background: rgba(250, 166, 26, 0.15);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
}

/* Divisor entre grupos de itens de menu */
.channel-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 6px;
}

/* Cabeçalho do menu do membro (nome exibido + usuário) */
.channel-menu-head {
  padding: 8px 10px 6px;
  font-size: calc(13px * var(--font-scale));
  color: var(--text-muted, #8e9297);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-menu-head strong { color: var(--text-normal); font-weight: 700; }
.channel-menu-head .menu-head-user { margin-left: 6px; font-size: calc(12px * var(--font-scale)); }

/* Item com SUBMENU (ex.: Cargos) — abre ao lado, alinhado ao item (estilo Discord) */
.channel-menu-item.has-submenu .submenu-arrow { margin-left: auto; font-size: calc(18px * var(--font-scale)); opacity: 0.75; }
.channel-menu-item.has-submenu.open,
.channel-menu-item.has-submenu.open:hover { background: var(--blurple); color: #fff; }
.channel-menu.submenu {
  position: absolute;
  top: 0;
  min-width: 170px;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 260;
}

/* Cargo atual do membro no menu */
.channel-menu-item.role-current {
  color: var(--green-bright);
  font-weight: 700;
}

/* Modal de cargos do servidor (server-roles, estilo Discord) */
.modal.role-perms-modal {
  position: relative;
  width: min(960px, 92vw);
  max-width: 960px;
  height: min(660px, 88vh);
  display: flex;
  flex-direction: column;
  text-align: left;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: calc(24px * var(--font-scale));
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding: 0;
}
.modal-close:hover { background: var(--bg-hover); color: #fff; }

.role-perms-modal h2 {
  text-align: center;
}

.role-perms-modal > p {
  text-align: center;
  color: var(--text-muted);
  font-size: calc(13px * var(--font-scale));
  margin-bottom: 12px;
}

.role-perms-layout {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

/* Lateral com a lista de cargos */
.role-perms-sidebar {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  padding-right: 10px;
  min-height: 0;
}

.role-perms-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: calc(11px * var(--font-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0 4px 8px;
}

.role-perms-add {
  background: var(--bg-input);
  border: none;
  color: var(--text-normal);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: calc(15px * var(--font-scale));
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.role-perms-add:hover { background: var(--green); color: #fff; }

.role-perms-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.role-perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
  color: var(--text-normal);
  border: 1px solid transparent;
}
.role-perm-item:hover { background: var(--bg-hover); }
.role-perm-item.selected {
  background: var(--bg-input);
  border-color: var(--blurple, #5865F2);
}
.role-perm-item.draggable { cursor: grab; }
.role-perm-item.draggable:active { cursor: grabbing; }
.role-perm-item.dragging { opacity: 0.4; }
.role-perm-item.drag-over { border-color: var(--blurple, #5865F2); }
.role-perm-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-perm-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.25);
}

.role-perm-flag {
  font-size: calc(9px * var(--font-scale));
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: var(--bg-hover);
  border-radius: 4px;
  padding: 1px 5px;
}

/* Editor: mostra UM cargo por vez */
.role-perms-editor {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.role-perms-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.role-perms-fields input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 8px 10px;
  border: none;
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-normal);
  font-size: calc(14px * var(--font-scale));
  font-weight: 700;
  margin-bottom: 0;
}
.role-perms-fields input[type="color"] {
  width: 48px;
  height: 32px;
  padding: 1px;
  border: none;
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  margin-bottom: 0;
}

/* Opção por cargo: exibir membros deste cargo separadamente */
.role-perm-separate {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
  cursor: pointer;
  padding: 7px 10px;
  border-radius: 4px;
  background: var(--bg-input);
  width: fit-content;
  margin-bottom: 0;
}
.role-perm-separate input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

/* Permissões do cargo: uma por linha, sem espaço entre elas */
.role-perms-opts {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.perm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: calc(13px * var(--font-scale));
  cursor: pointer;
  line-height: 1.4;
}
.perm-row:hover { background: var(--bg-input); }
.perm-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}
.perm-row-label { min-width: 0; }

.role-perms-footer {
  padding-top: 12px;
}

.role-perms-footer .role-perms-spacer {
  flex: 1;
}

.role-menu-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.25);
}

/* ============================================================
   REGISTRO DE AUDITORIA (modal)
   ============================================================ */
.audit-modal {
  width: min(80vw, 1200px);
  max-width: 100%;
}

.audit-list {
  max-height: min(70vh, 640px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 12px;
}

.audit-empty {
  color: var(--text-muted);
  font-size: calc(13px * var(--font-scale));
  text-align: center;
  padding: 24px 8px;
}

.audit-row {
  display: grid;
  grid-template-columns: 110px 160px 180px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
  background: var(--bg-input);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: calc(12px * var(--font-scale));
}

.audit-row > * {
  min-width: 0;
  overflow-wrap: anywhere; /* quebra palavras longas p/ nunca sobrar rolagem lateral */
}

.audit-time {
  color: var(--text-muted);
  font-size: calc(11px * var(--font-scale));
}

.audit-actor {
  font-weight: 600;
  color: var(--text-normal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-action {
  color: var(--blurple);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-details {
  color: var(--text-normal);
  white-space: normal; /* quebra linhas — nada é cortado nem gera rolagem lateral */
}

@media (max-width: 700px) {
  .audit-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ---------- Linha de banido (modal Banidos) ---------- */
.bans-section-title {
  font-size: calc(13px * var(--font-scale));
  margin: 12px 0 4px;
  color: var(--text-normal);
}
.bans-row {
  grid-template-columns: 32px minmax(0, 1fr) 120px auto;
  align-items: center;
}
.bans-avatar {
  width: 28px;
  height: 28px;
}
.bans-avatar .avatar {
  width: 28px;
  height: 28px;
  font-size: calc(12px * var(--font-scale));
}
.bans-unban {
  padding: 4px 10px;
  font-size: calc(12px * var(--font-scale));
  white-space: nowrap;
}
@media (max-width: 700px) {
  .bans-row {
    grid-template-columns: 28px 1fr;
    gap: 4px 8px;
  }
  .bans-row .bans-unban {
    grid-column: 2;
    justify-self: start;
  }
}


/* ---------- Temas (Configurações → Temas) ---------- */
.theme-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.theme-toolbar .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
.theme-toolbar .mi { font-size: calc(16px * var(--ui-scale)); }
.theme-css-config { margin: 4px 0 14px; padding: 10px 12px; background: rgba(127,127,127,.08); border-radius: 8px; }
.theme-css-config h4 { margin: 0 0 8px; font-size: calc(13px * var(--font-scale)); color: var(--text-muted, #aaa); }
.theme-css-config .settings-toggle.small { margin: 4px 12px 4px 0; }
/* Blocos CSS (esq.) + Scripts JS (dir.) lado a lado no tema ativo */
.theme-blocks { display: flex; gap: 12px; align-items: stretch; }
.theme-blocks > div { flex: 1 1 0; min-width: 0; }
.theme-js-config { margin: 4px 0 14px; padding: 10px 12px; background: rgba(127,127,127,.08); border-radius: 8px; }
.theme-js-config h4 { margin: 0 0 8px; font-size: calc(13px * var(--font-scale)); color: var(--text-muted, #aaa); }
.theme-js-config .settings-toggle.small { margin: 4px 12px 4px 0; }
@media (max-width: 700px) {
  .theme-blocks { flex-direction: column; }
}
.theme-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.theme-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: rgba(127,127,127,.08); border: 1px solid transparent; border-radius: 8px; }
.theme-card.active { border-color: #5865F2; background: rgba(88,101,242,.12); }
.theme-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.theme-card-name { font-weight: 600; font-size: calc(14px * var(--font-scale)); display: flex; align-items: center; gap: 8px; }
.theme-active-badge { font-size: calc(11px * var(--font-scale)); color: #fff; background: #5865F2; border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.theme-card-meta { font-size: calc(12px * var(--font-scale)); color: var(--text-muted, #aaa); }
.theme-card-desc { font-size: calc(12px * var(--font-scale)); color: var(--text-muted, #aaa); opacity: .8; }
.theme-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.theme-card-actions .btn-secondary.small, .theme-card-actions .btn-danger.small { padding: 4px 10px; font-size: calc(12px * var(--font-scale)); }
.theme-chatbg-own { margin: 0 0 14px; }
.theme-chatbg-own .settings-label { display: block; margin-bottom: 6px; }
.theme-chatbg-own-row { display: flex; align-items: center; gap: 10px; }
.theme-chatbg-preview { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(127,127,127,.25); background: rgba(127,127,127,.12); flex-shrink: 0; }
.theme-chatbg-own-actions { display: flex; flex-direction: column; gap: 6px; }
.theme-chatbg-own-actions .btn-secondary.small, .theme-chatbg-own-actions .btn-danger.small { padding: 6px 12px; font-size: calc(12px * var(--font-scale)); display: inline-flex; align-items: center; gap: 6px; }
.theme-chatbg-own-actions .mi { font-size: calc(16px * var(--ui-scale)); }

/* ---------- Gerenciador genérico de mídia (fotos/banners/fundos) ---------- */
.asset-mgr-grid2 { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 8px; }
/* FUNDOS: coluna com altura fixa — as 4 linhas dividem essa altura */
.asset-mgr-col { display: flex !important; flex-direction: column; gap: 8px; height: min(380px, 42vh); }
.asset-mgr-item2 {
  position: relative;
  aspect-ratio: 1 / 1; /* quadrado */
  border-radius: 10px;
  overflow: hidden;
  background: rgba(127,127,127,.15);
  border: none; /* sem borda quando tem imagem */
}
.asset-mgr-item2.empty {
  border: 2px dashed rgba(255,255,255,.35);
  background: rgba(255,255,255,.04);
  cursor: default;
}
.asset-mgr-item2.active, .asset-mgr-col-item.active { box-shadow: 0 0 0 2px #5865F2; }
.avatar-mgr-item.active { box-shadow: 0 0 0 2px #5865F2; }
.asset-mgr-item2 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-mgr-item2 .avatar-mgr-overlay,
.asset-mgr-col-item .avatar-mgr-overlay {
  display: flex; gap: 4px; align-items: center; justify-content: center;
  border-radius: 10px; background: rgba(0,0,0,.55); opacity: 0;
}
.asset-mgr-item2:hover .avatar-mgr-overlay,
.asset-mgr-col-item:hover .avatar-mgr-overlay { opacity: 1; }
/* Clique abre a prévia (logos) */
.am-clickable { cursor: pointer; }
/* Botão "+" do BANNER: ocupa as DUAS colunas na primeira linha */
.asset-mgr-item2.add {
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted, #aaa);
  border: 1px dashed rgba(255,255,255,.25);
  border-radius: 10px;
  grid-column: 1 / -1;
  height: 72px;
  aspect-ratio: auto;
}
.asset-mgr-item2.add:hover { color: #fff; border-color: #5865F2; }
.asset-mgr-col-item {
  position: relative;
  width: 132px;
  aspect-ratio: 1 / 1; /* quadrado */
  border-radius: 10px;
  overflow: hidden;
  background: rgba(127,127,127,.15);
  border: none; /* sem borda quando tem imagem */
}
.asset-mgr-col-item.empty {
  border: 2px dashed rgba(255,255,255,.35);
  background: rgba(255,255,255,.04);
  cursor: default;
}
.asset-mgr-col-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Botão "+" do FUNDO: quadrado, mesmo tamanho dos itens */
.asset-mgr-col-item.add {
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted, #aaa);
  border: 1px dashed rgba(255,255,255,.25);
  border-radius: 10px;
  width: 132px;
  aspect-ratio: 1 / 1;
}
.asset-mgr-col-item.add:hover { color: #fff; border-color: #5865F2; }
.asset-mgr-col-item.empty { background: transparent; border-color: transparent; }
/* Fundos: linha em LARGURA TOTAL do modal (4 linhas: + e 3 do histórico) */
.asset-mgr-bg-row {
  position: relative;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(127,127,127,.15);
  border: none; /* sem borda quando tem imagem */
}
.asset-mgr-bg-row.empty {
  border: 2px dashed rgba(255,255,255,.35);
  background: rgba(255,255,255,.04);
  cursor: default;
}
.asset-mgr-bg-row.active { box-shadow: 0 0 0 2px #5865F2; }
.asset-mgr-bg-row img,
.asset-mgr-bg-row video { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-mgr-bg-row .avatar-mgr-overlay {
  display: flex; gap: 4px; align-items: center; justify-content: center;
  border-radius: 10px; background: rgba(0,0,0,.55); opacity: 0;
}
.asset-mgr-bg-row:hover .avatar-mgr-overlay { opacity: 1; }

/* ============================================================
   DENÚNCIAS (modal + card de prova na conversa do Sistema)
   ============================================================ */
.profile-report-x {
  position: absolute;
  top: 10px;
  right: 46px;
  z-index: 6;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.profile-report-x:hover { background: var(--red, #ed4245); border-color: var(--red, #ed4245); }
.profile-report-x .mi { font-size: calc(18px * var(--ui-scale)); }
.report-modal { max-width: 460px; }
.report-target { font-weight: 600; margin: 0 0 4px; }
.report-hint { font-size: calc(12px * var(--font-scale)); color: var(--text-muted, #aaa); margin: 0 0 10px; }
/* Aviso "analisando o conteúdo…" enquanto a IA sugere a flag/resumo da denúncia */
.report-ai-hint {
  font-size: calc(12px * var(--font-scale));
  color: var(--text-link, #00aff4);
  margin: -4px 0 10px;
}
.report-ai-hint.hidden { display: none; }
.report-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.report-reason {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 9px;
  background: rgba(127, 127, 127, 0.1);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: calc(12px * var(--font-scale));
  color: var(--text-normal, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.report-reason:hover { background: rgba(127, 127, 127, 0.18); }
.report-reason.selected {
  background: rgba(237, 66, 69, 0.16);
  border-color: var(--red, #ed4245);
  box-shadow: inset 0 0 0 1px var(--red, #ed4245); /* círculo vermelho na opção marcada */
  color: #ffd7d9;
}
.report-details {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  box-sizing: border-box;
  background: var(--bg-input, #1e1f22);
  color: var(--text-normal, #fff);
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: calc(13px * var(--font-scale));
}
.report-error { color: var(--red, #ed4245); font-size: calc(12px * var(--font-scale)); margin: 6px 0 0; }
/* Botão de denúncia em mensagens/tiles */
.report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
}
.report-btn:hover { background: var(--red, #ed4245); }
.report-btn .mi { font-size: calc(15px * var(--ui-scale)); }
.video-tile-report { position: absolute; top: 8px; left: 8px; z-index: 5; }

/* Botão de copiar link OBS no tile (câmera/tela/avatar) + mini-menu */
.video-tile-obs {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
}
.video-tile-obs:hover { background: #5865f2; }
.video-tile-obs .mi { font-size: calc(15px * var(--ui-scale)); }
.obs-tile-menu {
  position: absolute;
  top: 40px;
  right: 8px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: #232428;
  border: 1px solid #3f4147;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  min-width: 170px;
}
.obs-tile-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #e4e6eb;
  font-size: calc(13px * var(--font-scale));
  cursor: pointer;
  text-align: left;
}
.obs-tile-menu button:hover { background: #34363c; }
.obs-tile-menu button .mi { font-size: calc(17px * var(--ui-scale)); color: #9da1a8; }

/* Card de denúncia na conversa do Sistema */
.report-msg { display: block; }
.report-card {
  margin: 6px 0;
  padding: 10px 12px;
  background: rgba(237, 66, 69, 0.1);
  border: 1px solid rgba(237, 66, 69, 0.35);
  border-radius: 10px;
  text-align: left;
}
.report-card.handled { background: rgba(87, 242, 135, 0.08); border-color: rgba(87, 242, 135, 0.3); }
.report-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: calc(13px * var(--font-scale));
  color: var(--red, #ed4245);
  margin-bottom: 6px;
}
.report-card.handled .report-card-head { color: var(--green-bright, #57f287); }
.report-card-text { white-space: pre-wrap; font-size: calc(13px * var(--font-scale)); margin-bottom: 8px; }
.report-card-evidence { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
/* Provas ficam como LINKS (não exibem imagem inline no chat) */
.report-evidence-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 8px;
  font-size: calc(12px * var(--font-scale));
  color: var(--blurple, #5865f2);
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: 6px;
  text-decoration: none;
  word-break: break-all;
}
.report-evidence-link:hover { background: rgba(88, 101, 242, 0.22); text-decoration: underline; }
.report-card-meta { font-size: calc(12px * var(--font-scale)); color: var(--text-muted, #aaa); display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.report-card-meta b { color: var(--text-normal, #fff); }
.report-card-actions { display: flex; gap: 6px; }
.report-card-actions-col { flex-direction: column; align-items: stretch; gap: 8px; }
.report-response-input {
  width: 100%;
  padding: 6px 8px;
  font-size: calc(12px * var(--font-scale));
  border-radius: 6px;
  border: 1px solid var(--bg-input, #3f4147);
  background: var(--bg-input, #202225);
  color: var(--text-normal, #fff);
}
.report-card-status { font-size: calc(12px * var(--font-scale)); font-weight: 700; padding: 4px 8px; border-radius: 6px; }
.report-card-status.accepted { color: var(--green-bright, #57f287); background: rgba(87, 242, 135, 0.12); }
.report-card-status.rejected { color: #ffd7d9; background: rgba(237, 66, 69, 0.15); }
.report-card-response { font-size: calc(12px * var(--font-scale)); color: var(--text-muted, #aaa); font-style: italic; word-break: break-word; }
.report-feed-title { margin: 8px 0 4px; font-size: calc(12px * var(--font-scale)); font-weight: 700; letter-spacing: 0.05em; color: var(--text-muted, #aaa); }
/* Modal "Minhas denúncias" */
.my-reports-modal { max-width: 460px; }
.my-reports-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.my-reports-list .report-card { margin: 0; }

/* Modal de IMPERSONAÇÃO (admin) — leitura das mensagens do denunciado */
.impersonate-modal { max-width: 520px; }
.impersonate-list { max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.impersonate-conv {
  border: 1px solid var(--bg-input, #2b2d31);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.18);
}
.impersonate-conv-head {
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  color: var(--blurple, #5865f2);
  margin-bottom: 6px;
  border-bottom: 1px solid var(--bg-input, #2b2d31);
  padding-bottom: 4px;
}
.impersonate-msg { padding: 2px 0; }
.impersonate-msg-meta { font-size: calc(11px * var(--font-scale)); color: var(--text-muted, #aaa); }
.impersonate-msg-text { font-size: calc(13px * var(--font-scale)); color: var(--text-normal, #fff); word-break: break-word; white-space: pre-wrap; }
.impersonate-msg .report-evidence-link { font-size: calc(12px * var(--font-scale)); }
.asset-mgr-bg-row.add {
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted, #aaa);
  border: 1px dashed rgba(255,255,255,.25);
  border-radius: 10px;
  width: 100%;
  flex: 1 1 0;
}
.asset-mgr-bg-row.add:hover { color: #fff; border-color: #5865F2; }
.asset-mgr-default { margin: 4px 0 12px; }
.asset-mgr-default .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }

/* Layout em colunas (só banner do perfil): enviar no topo + favoritos (esq) / histórico (dir) */
.asset-mgr-upload { display: flex; justify-content: center; margin: 2px 0 10px; }
.asset-mgr-upload .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
/* Por padrão (servidor/fundos): layout ANTIGO empilhado */
.asset-mgr-columns { display: block; }
/* Banner do PERFIL (usuário): colunas lado a lado */
.asset-mgr-columns.columns-layout { display: flex; gap: 18px; align-items: flex-start; min-height: 0; }
.asset-mgr-columns.columns-layout .asset-mgr-col-favs,
.asset-mgr-columns.columns-layout .asset-mgr-col-hist {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-height: 44vh;
  overflow-y: auto;
  padding: 2px;
}
.asset-mgr-col-list { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.asset-mgr-columns.columns-layout .asset-mgr-col-favs .avatar-mgr-label,
.asset-mgr-columns.columns-layout .asset-mgr-col-hist .avatar-mgr-label { margin-bottom: 0; }
/* Layout antigo (empilhado): espaçamento entre Fixados e Histórico */
.asset-mgr-columns:not(.columns-layout) .asset-mgr-col-hist { margin-top: 12px; }

/* ---------- Prévia de mídia em tamanho maior ---------- */
.asset-preview-wrap { display: flex; justify-content: center; padding: 8px 0 4px; }
.asset-preview-wrap img,
.asset-preview-wrap video {
  max-width: 100%;
  max-height: 58vh;
  border-radius: 12px;
  object-fit: contain;
  border: 3px solid rgba(255,255,255,.15);
  background: #000;
}
.asset-preview-actions { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: nowrap; padding-top: 8px; }
.asset-pr-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border: none; border-radius: 6px;
  font-weight: 600; font-size: calc(12px * var(--font-scale)); line-height: 1; white-space: nowrap;
  cursor: pointer; color: #fff;
  transition: filter .15s;
}
.asset-pr-btn:hover { filter: brightness(1.12); }
.asset-pr-btn .mi { font-size: calc(15px * var(--ui-scale)); }
.asset-pr-btn.green { background: #23a55a; }
.asset-pr-btn.yellow { background: #b47a00; }
.asset-pr-btn.red { background: #da373c; }
.asset-pr-btn.gray { background: var(--btn-secondary-bg); }

/* ----- Modal de atualização do app ----- */
.update-current { color: var(--text-muted); margin: 0 0 12px; font-size: calc(13px * var(--font-scale)); }
.update-notes-title { font-weight: 600; margin-bottom: 6px; }
.update-notes-list { margin: 0 0 8px; padding-left: 18px; line-height: 1.5; max-height: 240px; overflow: auto; }
.update-notes-list ul { list-style-type: none; list-style: none; }
.update-notes-list li { list-style-type: none; list-style: none; margin-bottom: 5px; }
.update-toggle {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: calc(13px * var(--font-scale));
  padding: 0;
  text-decoration: underline;
}
.update-toggle.hidden { display: none; }

/* ============================================================
   2FA — autenticação em duas etapas (perfil)
   ============================================================ */
#profile-2fa.btn-secondary.twofa-on {
  border-color: var(--green, #57f287);
  color: var(--green, #57f287);
}

.twofa-modal .modal-body { text-align: center; }

.twofa-qr-wrap {
  display: inline-block;
  padding: 10px;
  background: #fff;
  border-radius: var(--radius);
  margin: 4px 0 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}
.twofa-qr-wrap img { display: block; width: 200px; height: 200px; image-rendering: pixelated; }

.twofa-secret-label { font-size: calc(12px * var(--font-scale)); color: var(--text-muted, #aaa); margin: 10px 0 6px; }

.twofa-secret-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}
.twofa-secret-row code {
  font-size: calc(13px * var(--font-scale));
  letter-spacing: 1px;
  background: var(--bg-input);
  padding: 6px 10px;
  border-radius: 6px;
  user-select: all;
  word-break: break-all;
}

.twofa-modal input[type='text'] {
  width: 100%;
  text-align: center;
  font-size: calc(22px * var(--font-scale));
  letter-spacing: 8px;
  padding: 10px;
  border: 1px solid var(--bg-input);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  outline: none;
}
.twofa-modal input[type='text']:focus { border-color: var(--blurple); }

/* Botões "Receber por WhatsApp/e-mail/SMS" do DESATIVAR a 2FA */
.twofa-code-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}
.twofa-code-actions button { width: auto; margin: 0; font-size: calc(12px * var(--font-scale)); }

.twofa-recovery-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
.twofa-recovery-code {
  font-family: monospace;
  font-size: calc(14px * var(--font-scale));
  letter-spacing: 1px;
  background: var(--bg-input);
  padding: 8px 10px;
  border-radius: 6px;
  text-align: center;
  user-select: all;
}
.twofa-warn {
  font-size: calc(12px * var(--font-scale));
  color: var(--yellow, #faa61a);
  margin: 8px 0;
  text-align: center;
}

/* ============================================================
   RICH PRESENCE (RPC) — atividade no perfil / membros / config
   ============================================================ */
.rpc-icon { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.rpc-icon.rpc-emoji { display: inline-flex; align-items: center; justify-content: center; font-size: calc(16px * var(--font-scale)); }
.rpc-icon.rpc-img { display: inline-block; border-radius: 6px; border: none; }

/* Linha na lista de membros */
.member-rpc {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: calc(11px * var(--font-scale));
  color: var(--text-muted, #aaa);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.member-rpc .rpc-icon { width: 14px; height: 14px; flex-shrink: 0; }
.member-rpc-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Cards no perfil (abaixo da bio) */
.profile-rpc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 12px;
  margin-top: 10px;
  /* Muitas atividades → mostra ~5 e permite rolar as demais no container */
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.profile-rpc::-webkit-scrollbar { width: 6px; }
.profile-rpc::-webkit-scrollbar-thumb { background: var(--bg-elevated, rgba(255,255,255,.15)); border-radius: 999px; }
.profile-rpc-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-input);
  position: relative;
}
.profile-rpc-card .rpc-icon { width: 22px; height: 22px; margin-top: 2px; }
.profile-rpc-body { min-width: 0; flex: 1; }
/* Capa (header 16:9) de jogo/app — quando disponível, ocupa o topo do card */
.profile-rpc-card.has-cover { flex-direction: column; }
.profile-rpc-cover {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
}
.profile-rpc-verb { font-size: calc(11px * var(--font-scale)); font-weight: 600; text-transform: lowercase; color: var(--green, #57f287); }
.profile-rpc-name { font-size: calc(14px * var(--font-scale)); font-weight: 600; color: var(--text); word-break: break-word; }
/* Botão de ocultar atividade (estilo Discord) no card do próprio perfil */
.profile-rpc-hide {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-muted, #aaa);
  font-size: calc(11px * var(--font-scale));
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.profile-rpc-card:hover .profile-rpc-hide, .profile-rpc-hide:focus-visible { opacity: 1; }
.profile-rpc-hide:hover { color: #fff; background: rgba(240, 71, 71, 0.85); }
.profile-rpc-detail { font-size: calc(12px * var(--font-scale)); color: var(--text-muted, #aaa); word-break: break-word; }
.profile-rpc-time { font-size: calc(11px * var(--font-scale)); color: var(--text-muted, #aaa); opacity: 0.8; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ============================================================
   DATAS DO PERFIL (estilo Discord): "Membro desde" + "Entrou em"
   Ficam na BASE do banner como uma FAIXA (fundo cinza), puxando um "pedaço" da capa —
   não ficam soltas por cima da imagem.
   ============================================================ */
.profile-dates {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 34px;
  padding: 9px 16px 11px;
  margin-top: 8px;
  background: var(--bg-input, #40444b);
  border-top: 1px solid rgba(0, 0, 0, 0.25);
  /* o modal do perfil é centralizado (text-align: center): a faixa alinha à esquerda */
  text-align: left;
}
.profile-date-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
/* "ENTROU EM" (só em perfil de servidor) fica no lado DIREITO da faixa */
.profile-date-col--joined { margin-left: auto; }
.profile-date-label {
  font-size: calc(11px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  /* sobre a faixa cinza: usa a cor de texto do tema (legível no tema claro/escuro) */
  color: var(--text-normal, #dcddde);
  opacity: 0.75;
}
.profile-date-value {
  font-size: calc(14px * var(--font-scale));
  color: var(--text-normal, #f2f3f5);
  white-space: nowrap;
}
/* "Online agora" / "Online há X": linha de LARGURA TOTAL abaixo das datas, CENTRALIZADA */
.profile-online-col { flex: 0 0 100%; min-width: 0; text-align: center; }
.profile-online-text {
  font-size: calc(13px * var(--font-scale));
  color: var(--text-normal, #f2f3f5);
  opacity: 0.9;
}
/* Status customizado (mensagem): abaixo do "online" e alinhado à ESQUERDA (não centralizado) */
.profile-status-line { flex: 0 0 100%; min-width: 0; text-align: left; }
.profile-status-line-text {
  font-size: calc(13px * var(--font-scale));
  color: var(--text-normal, #f2f3f5);
  opacity: 0.85;
  /* Texto longo QUEBRA LINHA (inclusive palavras gigantes sem espaço, ex.: links) */
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Barrinha de reprodução de música/vídeo (tempo atual / duração) */
.profile-rpc-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}
.profile-rpc-progress .profile-rpc-time { margin-top: 0; opacity: 1; flex: 0 0 auto; }
.profile-rpc-bar {
  flex: 1;
  min-width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.08));
  overflow: hidden;
}
.profile-rpc-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blurple, #5865f2), #8b93ff);
  transition: width 0.25s linear;
}
.profile-rpc-total { font-size: calc(11px * var(--font-scale)); color: var(--text-muted, #aaa); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* Configurações — painel de Atividade */
.rpc-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.rpc-add-form select,
.rpc-add-form input {
  flex: 1 1 160px;
  padding: 8px 10px;
  border: 1px solid var(--bg-input);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: calc(13px * var(--font-scale));
  outline: none;
}
.rpc-add-form input:focus, .rpc-add-form select:focus { border-color: var(--blurple); }
.rpc-add-form .btn-secondary { width: auto; }

.rpc-activities-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
#rpc-detected-list { max-height: 320px; overflow-y: auto; }
.rpc-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg-input);
}
.rpc-custom-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.rpc-custom-name { font-size: calc(13px * var(--font-scale)); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpc-custom-sub { font-size: calc(11px * var(--font-scale)); color: var(--text-muted, #aaa); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpc-custom-del {
  background: none; border: none; color: var(--text-muted, #aaa); cursor: pointer;
  padding: 4px; font-size: calc(18px * var(--font-scale)); line-height: 1; flex-shrink: 0;
}
.rpc-custom-del:hover { color: var(--red, #ed4245); }
.rpc-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.rpc-toolbar .btn-secondary { width: auto; }

/* Modal de seleção de programas abertos (RPC desktop) */
.rpc-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.rpc-pick-row { cursor: default; }
.rpc-pick-add { width: auto; flex-shrink: 0; font-size: calc(12px * var(--font-scale)); padding: 6px 10px; }

/* O modal de edição abre POR CIMA das Configurações. Como usa .modal-backdrop
   (z-index 200) e o #modal-settings-backdrop vem depois no DOM, subimos o
   z-index aqui p/ o modal RPC ficar na frente. */
#modal-rpc-edit-backdrop {
  z-index: 260;
}

/* Formulário de personalizar/editar atividade de programa */
#modal-rpc-edit-backdrop .modal-body label {
  display: block;
  font-size: calc(12px * var(--font-scale));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 12px 0 4px;
}
#modal-rpc-edit-backdrop .modal-body input,
#modal-rpc-edit-backdrop .modal-body select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--bg-input);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: calc(14px * var(--font-scale));
  outline: none;
}
#modal-rpc-edit-backdrop .modal-body input:focus,
#modal-rpc-edit-backdrop .modal-body select:focus { border-color: var(--blurple); }
