/* ===== Menu de contexto (clique-direito), estilo Discord ===== */
.ctx-menu {
  position: fixed;
  z-index: 200;
  min-width: 190px;
  max-width: 320px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-darkest);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  color: var(--text);
  user-select: none;
  animation: ctx-in 90ms ease-out;
}

@keyframes ctx-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 3px;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}

.ctx-item:hover,
.ctx-item.sub-open {
  background: var(--accent);
  color: #fff;
}

.ctx-item.danger {
  color: var(--danger);
}

.ctx-item.danger:hover,
.ctx-item.danger.sub-open {
  background: var(--danger);
  color: #fff;
}

.ctx-item.disabled,
.ctx-item.disabled:hover {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
  color: var(--text);
}

.ctx-item.disabled.danger,
.ctx-item.disabled.danger:hover {
  color: var(--danger);
}

.ctx-item.custom,
.ctx-item.custom:hover {
  background: transparent;
  color: var(--text);
  cursor: default;
  white-space: normal;
}

.ctx-custom {
  width: 100%;
}

.ctx-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
}

.ctx-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctx-arrow {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  margin-right: -2px;
  opacity: 0.8;
  flex-shrink: 0;
}

.ctx-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: auto;
  border-radius: 3px;
  border: 1px solid var(--text-muted);
  background: transparent;
  color: #fff;
  flex-shrink: 0;
}

.ctx-check.on {
  background: var(--accent);
  border-color: var(--accent);
}

.ctx-item:hover .ctx-check,
.ctx-item.sub-open .ctx-check {
  border-color: #fff;
}

.ctx-item:hover .ctx-check.on {
  background: #fff;
  color: var(--accent);
}

.ctx-item.danger:hover .ctx-check.on {
  color: var(--danger);
}

.ctx-separator {
  height: 1px;
  margin: 4px 4px;
  background: rgba(255, 255, 255, 0.08);
}
/* ChannelList: categorias recolhíveis, canais de voz com timer */

.channel-category {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-category-header {
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
}

.channel-category-header:hover {
  color: var(--text);
}

.channel-category-title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.channel-category-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.channel-category-chevron {
  flex-shrink: 0;
  transition: transform 120ms ease;
}

.channel-category.collapsed .channel-category-chevron {
  transform: rotate(-90deg);
}

.channel-category-header .icon-button {
  opacity: 0;
}

.channel-category-header:hover .icon-button,
.channel-category-header:focus-within .icon-button {
  opacity: 1;
}

.channel-item .channel-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.channel-item.channel-voice {
  cursor: pointer;
}

.channel-call-timer {
  flex-shrink: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--online);
}

.channel-voice-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
/* ---------- painel de cargos (RolesPanel) ---------- */

.roles-panel,
.bans-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.roles-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.roles-head .settings-group-title {
  margin-top: 0;
}

.roles-new,
.roles-delete,
.roles-perms-title,
.bans-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.roles-empty {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
}

.roles-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.roles-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
}

.roles-item:hover {
  background: var(--bg-hover);
}

.roles-item.active {
  background: var(--bg-active);
  border-color: var(--accent);
  color: var(--text-strong);
}

.roles-dot {
  width: 12px;
  height: 12px;
  min-width: 12px;
  border-radius: 50%;
}

.roles-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.roles-item-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.roles-editor {
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 12px 14px;
}

.roles-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roles-color-input {
  width: 44px;
  height: 32px;
  padding: 2px;
  border: none;
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
}

.roles-color-hex {
  font-family: monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.roles-perms {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roles-perms .settings-group-title {
  margin-top: 4px;
  margin-bottom: 2px;
}

.roles-perm {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

.roles-perm input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.roles-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* ---------- banidos (BansPanel) ---------- */

.bans-title {
  margin-top: 0;
}

.bans-row {
  gap: 12px;
  padding: 10px 14px;
}

.bans-info {
  flex: 1;
}

.bans-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
}

.bans-username {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.bans-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
}

.bans-reason {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bans-reason.none {
  font-style: italic;
  opacity: 0.7;
}

.bans-date {
  white-space: nowrap;
}
/* Paleta dark estilo Discord — vira design tokens de verdade na fase 5 */
:root {
  --bg-darkest: #1e1f22;
  --bg-dark: #2b2d31;
  --bg-mid: #313338;
  --bg-hover: #3a3c41;
  --bg-active: #404249;
  --bg-input: #1e1f22;
  --bg-composer: #383a40;
  --text: #dbdee1;
  --text-strong: #f2f3f5;
  --text-muted: #949ba4;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --danger: #f23f43;
  --online: #23a55a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-mid);
  color: var(--text);
  overflow: hidden;
  user-select: none;
}

button {
  font: inherit;
  cursor: pointer;
}

.icon-button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--text-strong);
  background: var(--bg-hover);
}

.primary-button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  font-weight: 600;
}

.primary-button:hover {
  background: var(--accent-hover);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
}

.loading-screen {
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--bg-darkest);
  color: var(--text-muted);
}

/* ---------- login ---------- */

.login-screen {
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--bg-darkest);
}

.login-card {
  width: 420px;
  max-width: 90vw;
  background: var(--bg-mid);
  border-radius: 8px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.login-card h1 {
  text-align: center;
  letter-spacing: 2px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.login-card input {
  background: var(--bg-input);
  border: none;
  border-radius: 4px;
  padding: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.login-card button[type='submit'] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px;
  font-weight: 600;
}

.login-card button[type='submit']:hover {
  background: var(--accent-hover);
}

.login-card button[type='submit']:disabled {
  opacity: 0.6;
  cursor: default;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
}

.link-button {
  background: none;
  border: none;
  color: #00a8fc;
  font-size: 13px;
  padding: 0;
}

/* ---------- shell principal ---------- */

.app-shell {
  height: 100%;
  display: grid;
  grid-template-columns: 72px 240px 1fr;
  /* sem isso a linha implicita (auto) cresce junto com o historico e empurra header/composer pra fora da janela */
  grid-template-rows: minmax(0, 1fr);
}

.app-shell.with-members {
  grid-template-columns: 72px 240px 1fr 220px;
}

/* ---------- rail de servidores ---------- */

.guild-rail {
  background: var(--bg-darkest);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  overflow-y: auto;
}

.guild-bubble {
  width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--bg-mid);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  transition:
    border-radius 0.15s,
    background 0.15s;
}

.guild-bubble:hover,
.guild-bubble.active {
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
}

.guild-bubble.add {
  color: var(--online);
  font-size: 22px;
}

.guild-bubble.add:hover {
  background: var(--online);
  color: #fff;
}

.rail-divider {
  width: 32px;
  height: 2px;
  min-height: 2px;
  background: var(--bg-mid);
  border-radius: 1px;
}

/* ---------- sidebar de canais ---------- */

.channel-sidebar {
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-header {
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-strong);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  color: var(--text-muted);
  padding: 7px 8px;
  border-radius: 4px;
  font-size: 15px;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.channel-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.channel-item.active {
  background: var(--bg-active);
  color: var(--text-strong);
}

.channel-item.voice {
  opacity: 0.55;
  cursor: default;
}

.channel-hash {
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-empty {
  padding: 12px 8px;
  color: var(--text-muted);
  font-size: 13px;
  user-select: none;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 14px;
}

.user-bar-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-strong);
}

.presence-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.presence-dot.online {
  background: var(--online);
}

/* ---------- area de chat ---------- */

.chat-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-strong);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--text-muted);
}

.chat-welcome h2 {
  color: var(--text);
}

.message-list {
  flex: 1;
  min-height: 0; /* flex item nao encolhe abaixo do conteudo sem isso — o overflow nunca ativaria */
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
}

.load-older {
  align-self: center;
  background: var(--bg-dark);
  border: none;
  color: var(--text-muted);
  border-radius: 12px;
  padding: 4px 14px;
  font-size: 12px;
  margin-bottom: 12px;
}

.load-older:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.chat-empty {
  color: var(--text-muted);
  padding: 8px 0;
}

.message-row {
  padding: 1px 8px 1px 48px;
  position: relative;
  border-radius: 4px;
  margin-top: 14px;
}

.message-row.grouped {
  margin-top: 0;
}

.message-row:hover {
  background: rgba(0, 0, 0, 0.12);
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: -40px;
}

.message-avatar {
  position: absolute;
  left: 8px;
  top: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.message-author {
  font-weight: 600;
  color: var(--text-strong);
  margin-left: 40px;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
}

.message-content {
  user-select: text;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}

.message-edited {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 6px;
}

.message-actions {
  display: none;
  position: absolute;
  right: 8px;
  top: -10px;
  background: var(--bg-dark);
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.message-row:hover .message-actions {
  display: inline-flex;
  gap: 2px;
}

.message-edit-input {
  width: 100%;
  background: var(--bg-composer);
  border: none;
  border-radius: 6px;
  color: var(--text);
  padding: 8px;
  font: inherit;
  resize: none;
  outline: none;
}

/* ---------- composer ---------- */

.chat-composer {
  padding: 0 16px 6px;
}

.message-input-form {
  display: flex;
}

.message-input {
  flex: 1;
  background: var(--bg-composer);
  border: none;
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  resize: none;
  outline: none;
  max-height: 160px;
}

.message-input::placeholder {
  color: var(--text-muted);
}

.typing-indicator {
  height: 20px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 4px 0;
}

.typing-indicator.active {
  font-style: italic;
}

/* ---------- lista de membros ---------- */

.member-list {
  background: var(--bg-dark);
  overflow-y: auto;
  padding: 12px 8px;
}

.member-group-label {
  padding: 10px 8px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: none;
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 14px;
  text-align: left;
}

.member-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.member-avatar {
  position: relative;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.presence-dot.overlay {
  position: absolute;
  right: -2px;
  bottom: -2px;
  border: 3px solid var(--bg-dark);
  width: 12px;
  height: 12px;
}

.member-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role {
  margin-left: 6px;
  font-size: 12px;
}

/* ---------- modais ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  z-index: 100;
}

.modal-card {
  width: 440px;
  max-width: 90vw;
  background: var(--bg-mid);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  color: var(--text-strong);
}

.modal-tabs {
  display: flex;
  gap: 8px;
}

.modal-tabs button,
.channel-type-picker button {
  flex: 1;
  background: var(--bg-dark);
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  padding: 10px;
  font-weight: 600;
}

.modal-tabs button.active,
.channel-type-picker button.active {
  background: var(--accent);
  color: #fff;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.modal-form input {
  background: var(--bg-input);
  border: none;
  border-radius: 4px;
  padding: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.modal-hint {
  color: var(--text-muted);
  font-size: 13px;
}

.channel-type-picker {
  display: flex;
  gap: 8px;
}

.invite-code-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.invite-code {
  flex: 1;
  background: var(--bg-input);
  border-radius: 4px;
  padding: 12px;
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--text-strong);
  user-select: text;
}

/* ---------- avatares ---------- */

.avatar {
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
  object-fit: cover;
  user-select: none;
}

img.avatar {
  display: block;
}

.member-avatar.small .presence-dot.overlay {
  border-color: var(--bg-dark);
}

.badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
}

.danger-text {
  color: var(--danger) !important;
}

.form-success {
  color: var(--online);
  font-size: 13px;
}

/* ---------- barra de voz na sidebar ---------- */

.voice-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(0, 0, 0, 0.3);
}

.voice-panel-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.voice-panel-status {
  color: var(--online);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ping-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
}

.ping-badge.good {
  color: var(--online);
}

.ping-badge.mid {
  color: #f0b232;
}

.ping-badge.bad {
  color: var(--danger);
}

.voice-panel-channel {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-participant {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 32px;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
}

.voice-participant:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.voice-participant.speaking .avatar {
  outline: 2px solid var(--online);
}

.voice-participant.speaking {
  color: var(--text-strong);
}

.voice-participant-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- user bar ---------- */

.user-bar-names {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-bar-status {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.member-status {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- palco de voz ---------- */

.voice-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-darkest);
}

.voice-grid {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  overflow-y: auto;
}

.voice-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-dark);
  border-radius: 10px;
  border: 2px solid transparent;
  min-width: 220px;
  min-height: 140px;
}

.voice-tile.speaking {
  border-color: var(--online);
}

.voice-tile.video-tile {
  padding: 0;
  overflow: hidden;
  max-width: 640px;
}

.voice-tile video {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
}

.tile-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-strong);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-tile.avatar-tile .tile-label {
  position: static;
  background: none;
  color: var(--text-muted);
}

/* ---------- tile ampliado / tela cheia ---------- */

.voice-tile.video-tile {
  cursor: pointer;
}

.tile-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  display: none;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 6px;
  color: var(--text-strong);
  padding: 6px;
}

.voice-tile:hover .tile-btn {
  display: inline-flex;
}

.tile-btn:hover {
  background: var(--accent);
}

.voice-grid.focused-layout {
  flex-direction: column;
  flex-wrap: nowrap;
  align-content: stretch;
  align-items: stretch;
  gap: 10px;
}

.voice-focused {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
}

.voice-focused .voice-tile.video-tile {
  width: 100%;
  max-width: none;
  min-height: 0;
}

.voice-focused .voice-tile video {
  max-height: none;
  height: 100%;
}

.voice-strip {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
}

.voice-strip .voice-tile.video-tile {
  min-width: 140px;
  min-height: 80px;
  max-width: 180px;
}

.voice-strip .voice-tile video {
  max-height: 100px;
}

/* tela cheia nativa */
.voice-tile:fullscreen {
  border-radius: 0;
  border: none;
  background: #000;
}

.voice-tile:fullscreen video {
  width: 100vw;
  height: 100vh;
  max-height: none;
  object-fit: contain;
}

.voice-empty {
  color: var(--text-muted);
}

.voice-error {
  text-align: center;
  padding: 4px;
}

.voice-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}

.voice-control {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--bg-mid);
  color: var(--text-strong);
  font-size: 19px;
}

.voice-control:hover {
  background: var(--bg-hover);
}

.voice-control.on {
  background: var(--online);
}

.voice-control.off {
  background: var(--danger);
}

.voice-control.danger {
  background: var(--danger);
}

/* ---------- picker de tela ---------- */

.modal-card.wide {
  width: 720px;
}

.screen-picker-scroll {
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.screen-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.picker-audio-row {
  margin-top: 4px;
}

.screen-source {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-dark);
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 8px;
  color: var(--text);
  font-size: 12px;
  text-align: left;
}

.screen-source:hover {
  border-color: var(--accent);
}

.screen-source img {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
}

.screen-source span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- amigos ---------- */

.friends-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.friends-tabs {
  display: flex;
  gap: 8px;
}

.friends-tabs button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 14px;
}

.friends-tabs button:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.friends-tabs button.active {
  background: var(--bg-active);
  color: var(--text-strong);
}

.friends-tabs button.add-friend {
  background: var(--online);
  color: #fff;
}

.friends-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.friends-empty {
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
}

.friends-group-label {
  padding: 14px 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.friend-row:hover {
  background: var(--bg-hover);
}

.friend-names {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.friend-display {
  color: var(--text-strong);
  font-weight: 600;
}

.friend-username {
  font-size: 12px;
  color: var(--text-muted);
}

.friend-actions {
  display: flex;
  gap: 8px;
}

.row-button {
  background: var(--bg-dark);
  border: none;
  border-radius: 4px;
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
}

.row-button:hover {
  background: var(--bg-active);
}

.row-button.confirm:hover {
  background: var(--online);
  color: #fff;
}

.row-button.danger:hover {
  background: var(--danger);
  color: #fff;
}

.add-friend-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}

.add-friend-row {
  display: flex;
  gap: 10px;
}

.add-friend-row input {
  flex: 1;
  background: var(--bg-input);
  border: none;
  border-radius: 4px;
  padding: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

/* ---------- perfil ---------- */

.profile-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-dark);
  border-radius: 8px;
  border-top: 24px solid var(--accent);
  padding: 12px 14px;
}

.profile-preview-name {
  font-weight: 700;
  color: var(--text-strong);
}

.avatar-edit {
  position: relative;
  background: none;
  border: none;
  padding: 0;
}

.avatar-edit-hint {
  position: absolute;
  right: -4px;
  bottom: -4px;
  background: var(--bg-mid);
  border-radius: 50%;
  padding: 2px;
  font-size: 12px;
}

.color-input {
  width: 60px;
  height: 34px;
  padding: 2px !important;
  cursor: pointer;
}

/* ---------- anexos ---------- */

.attach-button {
  background: var(--bg-composer);
  border: none;
  border-radius: 8px 0 0 8px;
  color: var(--text-muted);
  font-size: 18px;
  padding: 0 14px;
}

.attach-button:hover {
  color: var(--text-strong);
}

.message-input-form .message-input {
  border-radius: 0;
}

.composer-emoji {
  background: var(--bg-composer);
  border: none;
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-size: 18px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
}

.composer-emoji:hover {
  color: #f0b232;
}

.attachment-image {
  display: block;
  max-width: 400px;
  max-height: 300px;
  border-radius: 6px;
  margin-top: 6px;
  cursor: pointer;
}

.attachment-image:hover {
  filter: brightness(1.08);
}

/* ---------- lightbox de imagem ---------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 82vh;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 16px;
  color: var(--text-strong);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 88vw;
}

.lightbox-name {
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-open {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.lightbox-open:hover {
  color: var(--text-strong);
}

/* ---------- qualidade da transmissao (picker de tela) ---------- */

.share-quality {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quality-chip {
  background: var(--bg-dark);
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
}

.quality-chip:hover {
  color: var(--text);
}

.quality-chip.on {
  background: var(--accent);
  color: #fff;
}

.quality-sep {
  width: 1px;
  height: 18px;
  background: var(--bg-hover);
  margin: 0 4px;
}

.web-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.attachment-file {
  display: inline-block;
  margin-top: 6px;
  background: var(--bg-dark);
  border-radius: 6px;
  padding: 8px 12px;
  color: #00a8fc;
  text-decoration: none;
  font-size: 14px;
}

.attachment-size {
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- reacoes / reply / mencoes / markdown ---------- */

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.reaction-chip {
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  padding: 2px 8px;
  font-size: 13px;
}

.reaction-chip:hover {
  border-color: var(--text-muted);
}

.reaction-chip.mine {
  background: rgba(88, 101, 242, 0.25);
  border-color: var(--accent);
}

.reply-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 40px;
  margin-bottom: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.reply-ref-author {
  color: var(--text-strong);
  font-weight: 600;
}

.reply-ref-content {
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-row.mentions-me {
  background: rgba(250, 168, 26, 0.08);
  border-left: 2px solid #faa81a;
}

.mention {
  background: rgba(88, 101, 242, 0.3);
  color: #c9cdfb;
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 600;
}

.mention.self {
  background: rgba(250, 168, 26, 0.3);
  color: #f5c97b;
}

.md-codeblock {
  background: var(--bg-darkest);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 4px 0;
  overflow-x: auto;
  font-size: 13px;
  white-space: pre-wrap;
}

.message-content code {
  background: var(--bg-darkest);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 13px;
}

.message-content a {
  color: #00a8fc;
}

.composer-wrap {
  position: relative;
}

.reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-dark);
  border-radius: 8px 8px 0 0;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.reply-bar .icon-button {
  margin-left: auto;
}

.mention-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-dark);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  padding: 6px;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text);
  padding: 6px 8px;
  text-align: left;
}

.mention-option.active {
  background: var(--bg-active);
}

.emoji-picker {
  position: absolute;
  right: 8px;
  top: -8px;
  transform: translateY(-100%);
  background: var(--bg-dark);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(8, 30px);
  gap: 2px;
  z-index: 30;
}

.emoji-option {
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  padding: 2px;
}

.emoji-option:hover {
  background: var(--bg-active);
}

/* ---------- nao lidos ---------- */

.channel-item.unread {
  color: var(--text-strong);
  font-weight: 600;
}

.unread-dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-strong);
}

.channel-item .badge {
  margin-left: auto;
}

.rail-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  padding: 1px 4px;
  border: 2px solid var(--bg-darkest);
}

.rail-unread {
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 0 4px 4px 0;
  background: var(--text-strong);
}

.guild-bubble {
  position: relative;
}

.guild-bubble-icon {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.channel-delete {
  display: none;
  margin-left: auto;
}

.channel-item:hover .channel-delete {
  display: inline-flex;
}

.channel-item.unread:hover .unread-dot,
.channel-item:hover .unread-dot {
  display: none;
}

/* ---------- status ---------- */

.presence-dot.online {
  background: var(--online);
}

.presence-dot.idle {
  background: #f0b232;
}

.presence-dot.dnd {
  background: var(--danger);
}

.avatar-status-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.status-picker {
  position: absolute;
  bottom: 54px;
  left: 8px;
  width: 220px;
  background: var(--bg-darkest);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 8px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-picker-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 8px;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text);
  padding: 7px 8px;
  text-align: left;
}

.status-option:hover,
.status-option.active {
  background: var(--bg-active);
}

.status-option-texts {
  display: flex;
  flex-direction: column;
}

.status-option-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- voz & video (config) ---------- */

.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.device-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.device-select select {
  background: var(--bg-darkest);
  border: none;
  border-radius: 4px;
  color: var(--text);
  padding: 10px;
  font-size: 14px;
  outline: none;
}

.device-select input[type='range'] {
  accent-color: var(--accent);
}

.mic-test {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}

.mic-meter {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 22px;
}

.mic-bar {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: var(--bg-dark);
  transition: background 0.05s;
}

.mic-bar.lit {
  background: var(--online);
}

.mic-hint {
  text-transform: none;
  letter-spacing: 0;
}

.mic-gain-grid {
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 12px;
}

.tile-volume {
  position: absolute;
  right: 8px;
  top: 8px;
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text);
}

.voice-tile:hover .tile-volume {
  display: flex;
}

.tile-volume input {
  width: 90px;
  accent-color: var(--accent);
}

.tile-flag.muted {
  color: var(--danger);
  margin-left: 5px;
}

/* ---------- grupo dm / guild settings / confirmacao ---------- */

.group-pick-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 40vh;
  overflow-y: auto;
}

.group-pick-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 14px !important;
  text-transform: none !important;
  color: var(--text) !important;
}

.group-pick-item:hover {
  background: var(--bg-hover);
}

.guild-settings-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.guild-settings-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
}

.guild-settings-icon.placeholder {
  display: grid;
}

.guild-danger-zone {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.danger-bg {
  background: var(--danger) !important;
}

.member-kick {
  display: none;
  margin-left: auto;
  color: var(--danger);
}

.member-item:hover .member-kick {
  display: inline-flex;
}

.chat-area.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
}

/* ---------- B7: menus, cargos, moderacao ---------- */

.server-menu-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-strong);
  font: inherit;
  font-weight: 600;
  padding: 0;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.server-menu-btn:hover {
  color: #fff;
}

.menu-volume {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 200px;
}

.menu-volume span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.menu-volume input {
  width: 100%;
  accent-color: var(--accent);
}

.profile-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--text);
}

.role-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.profile-bio {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  user-select: text;
  white-space: pre-wrap;
}

.timeout-banner {
  background: rgba(240, 178, 50, 0.12);
  border: 1px solid rgba(240, 178, 50, 0.4);
  color: #f0b232;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
}

.modal-select {
  background: var(--bg-input);
  border: none;
  border-radius: 4px;
  padding: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.message-avatar-hit {
  display: contents;
}

.voice-tile-wrap {
  display: contents;
}

/* ---------- overlay de configuracoes ---------- */

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 3fr;
  background: var(--bg-mid);
  animation: settings-in 0.15s ease-out;
}

@keyframes settings-in {
  from {
    opacity: 0;
    transform: scale(1.03);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.settings-nav {
  background: var(--bg-dark);
  display: flex;
  justify-content: flex-end;
  overflow-y: auto;
  padding: 48px 8px 24px 12px;
}

.settings-nav-inner {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 14px;
}

.settings-user-mini-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.settings-user-mini-names span:first-child {
  color: var(--text-strong);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  padding: 8px 10px;
  font-size: 15px;
  text-align: left;
}

.settings-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.settings-nav-item.active {
  background: var(--bg-active);
  color: var(--text-strong);
}

.settings-nav-item.danger {
  color: var(--danger);
}

.settings-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 10px;
}

.settings-content {
  overflow-y: auto;
  padding: 48px 40px 60px;
}

.settings-content-inner {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.settings-content-header h2 {
  color: var(--text-strong);
}

.settings-close {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  color: var(--text-muted);
  justify-content: center;
}

.settings-close span {
  display: none;
}

.settings-close:hover {
  border-color: var(--text-strong);
  color: var(--text-strong);
}

.settings-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

.settings-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 12px 16px;
}

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settings-row-info.device {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.device-icon {
  color: var(--text-muted);
}

.settings-row-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.settings-row-info.device .settings-row-label {
  text-transform: none;
  letter-spacing: 0;
}

.settings-row-value {
  color: var(--text-strong);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-current {
  margin-left: 8px;
  background: var(--online);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  text-transform: uppercase;
}

.settings-form {
  max-width: 480px;
}

.language-picker.large button {
  padding: 14px;
  font-size: 15px;
}

/* ---------- toggle switch ---------- */

.toggle {
  width: 42px;
  height: 24px;
  min-width: 42px;
  border-radius: 12px;
  border: none;
  background: var(--text-muted);
  position: relative;
  transition: background 0.15s;
  padding: 0;
}

.toggle.on {
  background: var(--online);
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}

.toggle.on .toggle-knob {
  left: 21px;
}

/* ---------- versao / idioma / changelog ---------- */

.login-version {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  user-select: text;
}

.language-picker {
  display: flex;
  gap: 8px;
}

.language-picker button {
  flex: 1;
  background: var(--bg-dark);
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  padding: 9px;
  font-weight: 600;
}

.language-picker button.active {
  background: var(--accent);
  color: #fff;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.settings-footer .link-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.changelog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 50vh;
  overflow-y: auto;
}

.changelog-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.45;
}

.changelog-spark {
  color: var(--accent);
  margin-top: 3px;
  flex-shrink: 0;
}

/* ---------- icones (lucide) ---------- */

button svg,
.channel-hash svg,
.tile-label svg,
.voice-panel-channel svg,
.chat-header svg,
.friends-title svg,
.attachment-file svg,
.member-role svg {
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.icon-button,
.row-button,
.voice-control,
.primary-button,
.attach-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.channel-item,
.chat-header,
.friends-title,
.voice-panel-channel {
  display: flex;
  align-items: center;
  gap: 6px;
}

.channel-hash {
  display: inline-flex;
  align-items: center;
}

.participant-flag {
  color: var(--text-muted);
}

.tile-flag {
  margin-left: 5px;
}

.spin {
  animation: accord-spin 1s linear infinite;
}

@keyframes accord-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- cartao de perfil (modal) ---------- */

.profile-card {
  position: relative;
  background: var(--bg-dark);
  border-radius: 8px;
  overflow: hidden;
}

.profile-card-banner {
  height: 64px;
}

.profile-card-avatar {
  position: absolute;
  top: 24px;
  left: 14px;
  /* 72px de avatar + 5px de borda de cada lado (box-sizing: border-box) */
  width: 82px;
  height: 82px;
  min-width: 82px;
  border: 5px solid var(--bg-dark);
  border-radius: 50%;
  background: var(--bg-dark);
}

.profile-card-avatar .presence-dot.overlay {
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
}

.profile-card-body {
  padding: 44px 16px 14px;
}

/* ---------- recorte de avatar ---------- */

.crop-area-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 10px;
}

.crop-area {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-darkest);
  cursor: grab;
  touch-action: none;
}

.crop-area:active {
  cursor: grabbing;
}

.crop-area img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.crop-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* escurece tudo fora do circulo do avatar */
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.crop-hint {
  text-align: center;
}

/* ---------- badge AO VIVO + atalhos do painel de voz ---------- */

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.voice-panel-wrap {
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(0, 0, 0, 0.3);
}

.voice-panel-wrap .voice-panel {
  background: none;
  border-top: none;
}

.voice-panel-actions {
  display: flex;
  gap: 6px;
  padding: 0 10px 8px;
}

.voice-quick {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-mid);
  border: none;
  border-radius: 6px;
  color: var(--text);
  padding: 7px 0;
}

.voice-quick:hover {
  background: var(--bg-hover);
  color: var(--text-strong);
}

.voice-quick.on {
  background: var(--accent);
  color: #fff;
}

.voice-quick:disabled {
  opacity: 0.45;
}

.voice-quick.danger {
  color: var(--danger);
}

.voice-panel-wrap .voice-panel-status {
  white-space: nowrap;
  overflow: hidden;
}

.voice-panel-wrap .voice-panel-channel .ping-badge {
  margin-left: auto;
}

/* ---------- scrollbars ---------- */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-darkest);
  border-radius: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}
