/* PoleiaTalk — identidade Poleia Team (PLTM): grafite, laranja e branco quente. */
@font-face {
  font-family: 'Russo One';
  src: url('/fonts/russo-one-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('/fonts/rajdhani-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('/fonts/rajdhani-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('/fonts/rajdhani-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg-0: #07090d;
  --bg-1: #0d1016;
  --bg-2: #12151c;
  --bg-3: #1a1e27;
  --bg-4: #262b36;
  --bg-hover: rgba(255, 255, 255, 0.045);
  --bg-active: rgba(255, 122, 26, 0.12);
  --text: #f4efe8;
  --text-2: #c2bdb6;
  --muted: #7f8594;
  --border: rgba(255, 255, 255, 0.07);
  --accent: #ff7a1a;
  --accent-2: #ff8f3d;
  --accent-soft: rgba(255, 122, 26, 0.15);
  --on-accent: #140a02; /* texto sobre laranja (contraste alto) */
  --success: #2fb67c;
  --danger: #ef4f5a;
  --warning: #ffb02e;
  --mention-bg: rgba(255, 122, 26, 0.09);
  --mention-bar: #ff7a1a;
  --online: #2fb67c;
  --idle: #ffb02e;
  --dnd: #ef4f5a;
  --offline: #6b7180;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  --radius: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: 'Russo One', 'Arial Black', Impact, sans-serif;
  --heading: 'Rajdhani', 'Segoe UI', sans-serif;
  --mono: Consolas, 'Cascadia Code', Menlo, monospace;
  /* Textura da marca: listras diagonais finas + brilho laranja. */
  --stripes: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 12px);
  --glow: radial-gradient(ellipse at 50% 50%, rgba(255, 122, 26, 0.22), transparent 60%);
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg-0: #e4e0da;
  --bg-1: #ece8e2;
  --bg-2: #f6f3ef;
  --bg-3: #ffffff;
  --bg-4: #e2ddd6;
  --bg-hover: rgba(0, 0, 0, 0.045);
  --bg-active: rgba(255, 122, 26, 0.16);
  --text: #16130f;
  --text-2: #3e3a34;
  --muted: #6f6a63;
  --border: rgba(0, 0, 0, 0.09);
  --accent: #e8650a;
  --accent-2: #ff7a1a;
  --accent-soft: rgba(232, 101, 10, 0.14);
  --mention-bg: rgba(232, 101, 10, 0.1);
  --mention-bar: #e8650a;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  --stripes: repeating-linear-gradient(115deg, rgba(0, 0, 0, 0.025) 0 1px, transparent 1px 12px);
  --glow: radial-gradient(ellipse at 50% 50%, rgba(232, 101, 10, 0.16), transparent 60%);
  color-scheme: light;
}

/* ---------- marca ---------- */
/* Letreiro com o corte diagonal do logo: metade de cima laranja, de baixo branca. */
.brand-split {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45));
}
/* Cada linha (<span>) recebe o próprio corte, como no logo. */
.brand-split > span {
  display: block;
  background: linear-gradient(174deg, var(--accent) 0 52%, var(--text) 52% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font: 700 13px var(--heading);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-tag::before,
.brand-tag::after {
  content: '';
  width: 40px;
  height: 2px;
  background: var(--accent);
}
.brand-tag b {
  color: var(--accent-2);
}
.brand-tag i {
  width: 1px;
  height: 14px;
  background: var(--border);
}
.brand-bg {
  background: var(--glow), var(--stripes), var(--bg-0);
}
.brand-icon {
  display: block;
  width: 100%;
  height: 100%;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--text);
  font: 15px/1.4 var(--font);
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
a {
  color: var(--accent-2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
[hidden] {
  display: none !important;
}
svg {
  flex-shrink: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn.small {
  padding: 5px 10px;
  font-size: 13px;
}
.btn.block {
  width: 100%;
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover {
  background: var(--accent-2);
}
.btn.success {
  background: var(--success);
  color: #fff;
}
.btn.danger {
  background: var(--danger);
  color: #fff;
}
.btn.ghost {
  background: var(--bg-4);
}
.btn.ghost:hover {
  background: var(--bg-active);
}
.btn.left {
  margin-right: auto;
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-2);
}
.icon-btn:hover,
.icon-btn.on {
  background: var(--bg-hover);
  color: var(--text);
}
.icon-btn.off {
  color: var(--danger);
}
.icon-btn.tiny {
  width: 20px;
  height: 20px;
}
.icon-btn.tiny svg {
  width: 14px;
  height: 14px;
}
.icon-btn.danger-hover:hover {
  color: var(--danger);
}
.input,
.field input {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  resize: vertical;
}
.input:focus,
.field input:focus {
  border-color: var(--accent);
}
.input.small {
  padding: 4px 8px;
  width: auto;
}
.input.big {
  font-size: 18px;
  padding: 14px;
}
.field {
  display: block;
  margin-bottom: 16px;
}
.field > span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-2);
  margin-bottom: 8px;
}
.req {
  color: var(--danger);
}
.form-error,
.modal-error {
  color: var(--danger);
  font-size: 14px;
  margin: 0 0 12px;
}

/* ---------- autenticação ---------- */
#auth {
  height: 100%;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(91, 108, 255, 0.35), transparent 60%),
    radial-gradient(900px 500px at 90% 90%, rgba(47, 182, 124, 0.22), transparent 60%), var(--bg-0);
  padding: 16px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-2);
  padding: 32px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-card .field {
  text-align: left;
}
.auth-card .field small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.auth-forgot {
  display: block;
  text-align: left;
  margin: -6px 0 14px;
  color: var(--accent);
  font-size: 13px;
}
.form-info {
  color: var(--text-2);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  margin: 0 0 12px;
  text-align: left;
}
.auth-card h1 {
  margin: 8px 0 4px;
  font-size: 24px;
}
.auth-card > p {
  margin: 0 0 20px;
}
.auth-card .small {
  margin-top: 14px;
  text-align: left;
}
.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
}
.auth-logo svg {
  width: 32px;
  height: 32px;
}

/* ---------- carregando ---------- */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg-0);
  color: var(--muted);
  z-index: 50;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--bg-4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.small {
  width: 20px;
  height: 20px;
  border-width: 3px;
  margin: 12px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#reconnect-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warning);
  color: #1d1f26;
  padding: 6px 16px;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: 13px;
  z-index: 60;
}

/* ---------- barra de título (desktop) ---------- */
#titlebar {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-0);
  -webkit-app-region: drag;
  padding-left: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.titlebar-buttons {
  display: flex;
  -webkit-app-region: no-drag;
  height: 100%;
}
.titlebar-buttons button {
  width: 44px;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.titlebar-buttons svg {
  width: 14px;
  height: 14px;
}
.titlebar-buttons button:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.titlebar-buttons .close:hover {
  background: var(--danger);
  color: #fff;
}
body.desktop #app {
  height: calc(100% - 24px);
}

/* ---------- layout ---------- */
#app {
  display: flex;
  height: 100%;
}
#guild-bar {
  width: 72px;
  flex-shrink: 0;
  background: var(--bg-0);
  padding: 12px 0;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
#guild-bar::-webkit-scrollbar {
  display: none;
}
#sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
}
#right-panel {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
#right-panel.search-panel {
  width: 380px;
}

/* ---------- barra de servidores ---------- */
.guild-item {
  position: relative;
  width: 72px;
  display: flex;
  justify-content: center;
}
.guild-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-3);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-radius 0.18s, background 0.18s, color 0.18s;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.guild-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.guild-icon.home {
  color: var(--text);
}
.guild-icon.action {
  color: var(--success);
}
.guild-item:hover .guild-icon,
.guild-item.active .guild-icon {
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
}
.guild-item:hover .guild-icon.action {
  background: var(--success);
  color: #fff;
}
.guild-pill {
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 0;
  background: var(--text);
  border-radius: 0 4px 4px 0;
  transform: translateY(-50%);
  transition: height 0.18s;
}
.guild-item.unread .guild-pill {
  height: 8px;
}
.guild-item:hover .guild-pill {
  height: 20px;
}
.guild-item.active .guild-pill {
  height: 40px;
}
.guild-sep {
  width: 32px;
  height: 2px;
  background: var(--bg-3);
  border-radius: 1px;
}
.badge {
  position: absolute;
  right: 10px;
  bottom: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 3px solid var(--bg-0);
  box-sizing: content-box;
}
.badge.inline {
  position: static;
  border: 0;
  margin-left: auto;
}
.guild-voice {
  position: absolute;
  right: 10px;
  top: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: grid;
  place-items: center;
  border: 3px solid var(--bg-0);
  box-sizing: content-box;
}
.guild-voice svg {
  width: 12px;
  height: 12px;
}

/* ---------- barra lateral ---------- */
#sidebar-header {
  height: 48px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 10px;
}
.guild-name {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 4px;
}
.guild-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guild-name:hover {
  background: var(--bg-hover);
}
.search-fake {
  width: 100%;
  background: var(--bg-0);
  border-radius: 4px;
  padding: 6px 8px;
  text-align: left;
  color: var(--muted);
  font-size: 13px;
}
#sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.section-title .icon-btn {
  color: var(--muted);
}
.channel,
.nav-item,
.dm-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
  text-align: left;
}
.channel svg {
  width: 18px;
  height: 18px;
}
.channel:hover,
.nav-item:hover,
.dm-item:hover {
  background: var(--bg-hover);
  color: var(--text-2);
}
.channel.active,
.nav-item.active,
.dm-item.active {
  background: var(--bg-active);
  color: var(--text);
}
.channel.unread,
.dm-item.unread {
  color: var(--text);
  font-weight: 600;
}
.channel.unread::before {
  content: '';
  position: absolute;
  left: -8px;
  width: 4px;
  height: 8px;
  border-radius: 0 4px 4px 0;
  background: var(--text);
}
.channel.connected {
  color: var(--success);
}
.ch-name,
.dm-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-gear {
  display: none;
}
.channel:hover .ch-gear {
  display: inline-flex;
}
.nav-item {
  padding: 10px 8px;
  font-weight: 500;
}
.dm-item {
  padding: 5px 8px;
}
.call-ind {
  color: var(--success);
}
.call-ind svg {
  width: 16px;
  height: 16px;
}
.empty-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
  text-align: center;
}
.voice-users {
  padding: 2px 0 6px 28px;
}
.voice-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
}
.voice-user:hover {
  background: var(--bg-hover);
}
.vu-avatar {
  border-radius: 50%;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.1s;
  display: inline-flex;
}
.vu-avatar.speaking,
.vt-avatar.speaking {
  box-shadow: 0 0 0 2px var(--success);
}
.vu-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vu-icon {
  color: var(--muted);
}
.vu-icon.off {
  color: var(--danger);
}
.vu-icon svg {
  width: 14px;
  height: 14px;
}
.live {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

#voice-panel {
  border-top: 1px solid var(--border);
  padding: 8px 10px;
  background: var(--bg-1);
}
.vp-row {
  display: flex;
  align-items: center;
}
.vp-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.vp-status {
  color: var(--success);
  font-weight: 700;
  font-size: 14px;
}
.vp-where {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vp-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.vp-btn {
  flex: 1;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--bg-3);
  border-radius: 6px;
  color: var(--text-2);
}
.vp-btn:hover {
  background: var(--bg-4);
}
.vp-btn.on {
  background: var(--success);
  color: #fff;
}
#user-panel {
  height: 54px;
  flex-shrink: 0;
  background: var(--bg-0);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 2px;
}
.up-me {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 6px;
  text-align: left;
}
.up-me:hover {
  background: var(--bg-hover);
}
.up-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.up-names b,
.up-names small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.up-names b {
  font-size: 14px;
}
.up-names small {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- avatar e presença ---------- */
.avatar {
  width: var(--size);
  height: var(--size);
  position: relative;
  flex-shrink: 0;
}
.avatar > img,
.avatar > span {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: calc(var(--size) * 0.42);
}
.status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: calc(var(--size) * 0.32 + 2px);
  height: calc(var(--size) * 0.32 + 2px);
  min-width: 10px;
  min-height: 10px;
  border-radius: 50%;
  border: 3px solid var(--bg-1);
  box-sizing: content-box;
}
.status-dot.static {
  position: static;
  width: 10px;
  height: 10px;
  border: 0;
  display: inline-block;
}
.s-online {
  background: var(--online);
}
.s-idle {
  background: var(--idle);
}
.s-dnd {
  background: var(--dnd);
}
.s-offline {
  background: var(--offline);
}

/* ---------- cabeçalho principal ---------- */
#main-header {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}
.h-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  flex-shrink: 0;
}
.h-title b {
  color: var(--text);
}
.h-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}
.h-topic {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.h-fill {
  flex: 1;
}
.h-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.h-search {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-0);
  border-radius: 4px;
  padding: 0 6px;
  height: 26px;
  color: var(--muted);
  margin-left: 4px;
}
.h-search svg {
  width: 14px;
  height: 14px;
}
.h-search input {
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  width: 140px;
  font: 13px var(--font);
  transition: width 0.2s;
}
.h-search input:focus {
  width: 220px;
}
.tab {
  padding: 2px 10px;
  border-radius: 4px;
  color: var(--text-2);
  font-weight: 500;
}
.tab:hover {
  background: var(--bg-hover);
}
.tab.active {
  background: var(--bg-active);
  color: var(--text);
}
.tab.add {
  background: var(--success);
  color: #fff;
}
.tab.add.active {
  background: none;
  color: var(--success);
}

#main-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- amigos ---------- */
.friends {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}
.friends h3 {
  margin: 8px 0 4px;
  text-transform: uppercase;
  font-size: 15px;
}
.add-friend {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  background: var(--bg-0);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.add-friend .input {
  border: 0;
  background: none;
}
.add-result {
  margin-top: 8px;
  font-size: 14px;
}
.add-result.ok {
  color: var(--success);
}
.add-result.err {
  color: var(--danger);
}
.friend-row,
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.friend-row:hover {
  background: var(--bg-hover);
}
.fr-names {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fr-names small {
  color: var(--muted);
  font-size: 13px;
}
.fr-actions,
.mr-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.round-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-1);
  display: grid;
  place-items: center;
  color: var(--text-2);
}
.round-btn svg {
  width: 18px;
  height: 18px;
}
.round-btn:hover {
  color: var(--text);
}
.round-btn.ok:hover {
  color: var(--success);
}
.empty-state {
  margin: auto;
  text-align: center;
  color: var(--muted);
  padding: 32px;
}
.empty-state svg {
  width: 56px;
  height: 56px;
  opacity: 0.5;
}
.empty-state.small svg {
  width: 40px;
  height: 40px;
}

/* ---------- chat ---------- */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.messages-inner {
  padding: 16px 0 8px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.intro {
  padding: 16px 16px 8px;
}
.intro h1 {
  margin: 8px 0 4px;
  font-size: 30px;
}
.intro h3 {
  margin: 0 0 8px;
  color: var(--text-2);
  font-weight: 500;
}
.intro p {
  color: var(--muted);
  margin: 0;
}
.intro-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-4);
  display: grid;
  place-items: center;
}
.intro-icon svg {
  width: 40px;
  height: 40px;
}
.loading-older {
  padding: 8px;
}
.day-divider {
  display: flex;
  align-items: center;
  margin: 16px 16px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.day-divider::before,
.day-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.day-divider span {
  padding: 0 8px;
}
.msg {
  position: relative;
  padding: 2px 48px 2px 16px;
  margin-top: 14px;
}
.msg.grouped {
  margin-top: 0;
}
.msg:hover {
  background: var(--bg-hover);
}
.msg.mentioned {
  background: var(--mention-bg);
  box-shadow: inset 2px 0 0 var(--mention-bar);
}
.msg.replying {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}
.msg.flash {
  animation: flash 1.5s;
}
@keyframes flash {
  0%,
  60% {
    background: var(--accent-soft);
  }
}
.msg-row {
  display: flex;
  gap: 16px;
}
.msg-avatar {
  margin-top: 2px;
  height: 40px;
  border-radius: 50%;
}
.msg-hover-time {
  width: 40px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  visibility: hidden;
  line-height: 22px;
}
.msg:hover .msg-hover-time {
  visibility: visible;
}
.msg-body {
  flex: 1;
  min-width: 0;
}
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.msg-author {
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.msg-author:hover {
  text-decoration: underline;
}
.msg-time {
  font-size: 12px;
  color: var(--muted);
}
.role-crown {
  color: var(--warning);
  display: inline-flex;
  margin-left: 4px;
  vertical-align: middle;
}
.role-crown svg {
  width: 14px;
  height: 14px;
}
.role-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--accent);
  color: var(--on-accent);
  margin-left: 4px;
  vertical-align: middle;
}
.pinned-tag svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}
.msg-content {
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}
.msg-content.jumbo {
  font-size: 44px;
  line-height: 1.2;
}
.edited {
  font-size: 11px;
  color: var(--muted);
}
.mention {
  background: var(--accent-soft);
  color: var(--accent-2);
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 500;
  cursor: pointer;
}
:root[data-theme='light'] .mention {
  color: var(--accent-2);
}
.mention:hover {
  background: var(--accent);
  color: var(--on-accent);
}
code.inline {
  background: var(--bg-0);
  padding: 1px 4px;
  border-radius: 4px;
  font: 0.88em var(--mono);
}
.code-block {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 4px 0;
  font: 13px/1.45 var(--mono);
  white-space: pre-wrap;
  max-width: 90%;
  overflow-x: auto;
}
blockquote {
  margin: 2px 0;
  padding-left: 12px;
  border-left: 4px solid var(--bg-4);
}
.spoiler {
  background: var(--bg-4);
  color: transparent;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}
.spoiler.revealed {
  background: var(--bg-hover);
  color: inherit;
  user-select: auto;
}
.reply-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 20px;
  padding-left: 36px;
  position: relative;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.reply-ref::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 30px;
  height: 10px;
  border-left: 2px solid var(--bg-4);
  border-top: 2px solid var(--bg-4);
  border-top-left-radius: 6px;
}
.reply-ref b {
  color: var(--text-2);
}
.reply-ref span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-ref:hover span {
  color: var(--text);
}
.attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  align-items: flex-start;
}
.att-img img {
  max-width: min(400px, 100%);
  max-height: 320px;
  border-radius: 8px;
  display: block;
}
.att-video {
  max-width: min(480px, 100%);
  max-height: 320px;
  border-radius: 8px;
}
.att-file {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  max-width: 420px;
}
.att-file svg {
  width: 30px;
  height: 30px;
  color: var(--accent);
}
.att-file div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.att-file small {
  color: var(--muted);
}
.att-file audio {
  margin-top: 6px;
  max-width: 300px;
}
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bg-1);
  border: 1px solid transparent;
  font-size: 15px;
}
.reaction span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.reaction:hover {
  border-color: var(--bg-4);
}
.reaction.mine {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.reaction.add {
  opacity: 0;
  color: var(--muted);
}
.reaction.add svg {
  width: 16px;
  height: 16px;
}
.msg:hover .reaction.add {
  opacity: 1;
}
.msg-actions {
  position: absolute;
  right: 16px;
  top: -16px;
  display: none;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.msg:hover .msg-actions {
  display: flex;
}
.msg-actions button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-2);
}
.msg-actions button svg {
  width: 18px;
  height: 18px;
}
.msg-actions button:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.msg-actions button.danger:hover {
  color: var(--danger);
}
.edit-box textarea {
  margin: 4px 0;
  resize: none;
}
.edit-box small {
  color: var(--muted);
}

/* ---------- composer ---------- */
.composer {
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
}
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  background: var(--bg-3);
  border-radius: 8px;
  padding: 6px 8px;
  position: relative;
}
.composer-extra:not(:empty) {
  background: var(--bg-1);
  border-radius: 8px 8px 0 0;
}
.composer-extra:not(:empty) + .composer-box {
  border-radius: 0 0 8px 8px;
}
#composer-input {
  flex: 1;
  resize: none;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font: 15px/1.4 var(--font);
  padding: 6px 4px;
  max-height: 300px;
}
.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
}
.reply-bar b {
  color: var(--text-2);
}
.pending-files {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
}
.pending-file {
  position: relative;
  width: 140px;
  flex-shrink: 0;
  background: var(--bg-3);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.pending-file img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}
.pending-file > svg {
  width: 40px;
  height: 80px;
  margin: 0 auto;
  color: var(--accent);
}
.pending-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pending-file small {
  color: var(--muted);
}
.pending-file .icon-btn {
  position: absolute;
  right: 4px;
  top: 4px;
  background: var(--bg-1);
}
.typing {
  height: 24px;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dots {
  display: inline-flex;
  gap: 3px;
}
.dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-2);
  animation: bounce 1.2s infinite;
}
.dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes bounce {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: none;
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: var(--bg-1);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 5;
}
.ac-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 8px 6px;
}
.ac-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
}
.ac-item small {
  color: var(--muted);
}
.ac-item.sel,
.ac-item:hover {
  background: var(--bg-active);
}
.drop-hint {
  position: absolute;
  inset: 12px;
  border: 3px dashed var(--accent);
  border-radius: 12px;
  background: rgba(26, 27, 32, 0.85);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  z-index: 10;
  pointer-events: none;
}

/* ---------- voz ---------- */
.voice-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--glow), var(--stripes), #050608;
  min-height: 0;
}
.voice-grid {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}
.voice-tile {
  position: relative;
  width: 320px;
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.voice-tile.has-video {
  width: min(640px, 100%);
  background: #000;
}
.voice-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.voice-tile.waiting::after {
  content: 'Conectando vídeo…';
  position: absolute;
  color: var(--muted);
}
.vt-avatar {
  border-radius: 50%;
  display: inline-flex;
  box-shadow: 0 0 0 3px transparent;
  transition: box-shadow 0.1s;
}
.vt-avatar.speaking {
  box-shadow: 0 0 0 3px var(--success);
}
.vt-name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.vt-name svg {
  width: 14px;
  height: 14px;
  color: var(--danger);
}
.call-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}
.cc-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text);
  display: grid;
  place-items: center;
}
.cc-btn:hover {
  background: var(--bg-4);
}
.cc-btn.on {
  background: var(--success);
  color: #fff;
}
.cc-btn.off {
  background: #fff;
  color: var(--danger);
}
.cc-btn.hang {
  background: var(--danger);
  color: #fff;
}
.call-area {
  background: var(--stripes), #050608;
  border-bottom: 1px solid var(--border);
}
.voice-grid.compact {
  padding: 16px 16px 0;
}
.voice-grid.compact .voice-tile {
  width: 220px;
}
.voice-grid.compact .voice-tile.has-video {
  width: 400px;
}

/* ---------- painel direito ---------- */
.rp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.rp-body {
  padding: 8px;
}
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  text-align: left;
}
.member:hover {
  background: var(--bg-hover);
}
.member.offline {
  opacity: 0.45;
}
.member.offline:hover {
  opacity: 1;
}
.m-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.m-names b {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.m-names small {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-msg {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-2);
  margin-bottom: 8px;
  cursor: pointer;
}
.mini-msg:hover {
  background: var(--bg-3);
}
.mini-msg .msg-content {
  font-size: 14px;
}

/* ---------- perfil ---------- */
.profile-card {
  width: 300px;
  background: var(--bg-1);
  border-radius: 10px;
  overflow: hidden;
}
.profile-card.panel {
  width: 100%;
  border-radius: 0;
  min-height: 100%;
}
.pc-banner {
  height: 60px;
  background: var(--accent);
}
.pc-avatar {
  margin: -40px 0 0 16px;
  width: max-content;
  border-radius: 50%;
  border: 6px solid var(--bg-1);
}
.pc-avatar .status-dot {
  border-color: var(--bg-1);
}
.pc-main {
  padding: 8px 16px 16px;
}
.pc-main h3 {
  margin: 0;
  font-size: 20px;
}
.pc-main > p {
  margin: 0;
}
.pc-status {
  margin-top: 8px !important;
  font-size: 14px;
}
.pc-section {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 10px;
}
.pc-section h4 {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
}
.pc-section p {
  margin: 0;
  font-size: 14px;
  white-space: pre-wrap;
}
.pc-extra {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.pc-mod {
  display: flex;
  gap: 8px;
}

/* ---------- popouts, menus, modais, toasts ---------- */
.popout {
  position: fixed;
  z-index: 40;
  background: var(--bg-1);
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}
.popout.profile-pop {
  padding: 0;
}
.menu,
.status-picker {
  min-width: 220px;
  padding: 6px;
}
.status-picker {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sp-profile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
}
.sp-profile div {
  display: flex;
  flex-direction: column;
}
.sp-profile small {
  color: var(--muted);
}
.status-picker .input {
  margin: 4px 0 6px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
}
.menu-item span {
  flex: 1;
}
.menu-item svg {
  width: 16px;
  height: 16px;
}
.menu-item:hover {
  background: var(--accent);
  color: var(--on-accent);
}
.menu-item.danger {
  color: var(--danger);
}
.menu-item.danger:hover {
  background: var(--danger);
  color: #fff;
}
.menu-item.checked {
  background: var(--bg-active);
  color: var(--text);
}
.menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.emoji-picker {
  width: 340px;
  padding: 8px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}
.emoji-btn {
  font-size: 22px;
  padding: 4px;
  border-radius: 6px;
}
.emoji-btn:hover {
  background: var(--bg-active);
}
.pins {
  width: 420px;
  padding: 12px;
}
.pins h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 16px;
}
.pins-list {
  max-height: 60vh;
  overflow-y: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 16px;
  animation: fade 0.12s;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--bg-2);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: pop 0.15s;
}
@keyframes pop {
  from {
    transform: scale(0.96);
  }
}
.modal.wide {
  max-width: 920px;
}
.modal h2 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 22px;
}
.modal-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 18px;
}
.modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 20px -24px -24px;
  padding: 14px 24px;
  background: var(--bg-1);
}
.lightbox {
  max-width: 100%;
  max-height: 75vh;
  display: block;
  margin: 0 auto 8px;
  border-radius: 6px;
}
.copy-row {
  display: flex;
  gap: 8px;
}
.invite-preview {
  text-align: center;
}
.invite-preview h2 {
  margin: 4px 0;
}
.guild-icon.big {
  width: 80px;
  height: 80px;
  font-size: 26px;
  margin: 0 auto 8px;
  border-radius: 24px;
}
.guild-icon.editable,
.editable-avatar {
  cursor: pointer;
  border-radius: 50%;
}
.radio-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.radio-cards label {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-1);
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
}
.radio-cards label:has(input:checked) {
  background: var(--bg-active);
}
.radio-cards label div {
  display: flex;
  flex-direction: column;
}
.radio-cards small {
  color: var(--muted);
}
.row-gap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.settings {
  display: flex;
  min-height: 460px;
  margin: -24px;
}
.settings-nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-1);
  padding: 24px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 10px 0 0 10px;
}
.settings-nav h5 {
  margin: 0 10px 8px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-nav button {
  text-align: left;
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--text-2);
}
.settings-nav button:hover {
  background: var(--bg-hover);
}
.settings-nav button.active {
  background: var(--bg-active);
  color: var(--text);
}
.settings-nav button.danger {
  color: var(--danger);
}
.settings-content {
  flex: 1;
  padding: 24px 32px;
  min-width: 0;
}
.settings-content h3 {
  margin-top: 0;
}
.settings-content h4 {
  margin: 24px 0 12px;
}
.account-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--bg-1);
  padding: 16px;
  border-radius: 8px;
}
.account-card h3 {
  margin: 0;
}
.account-card p {
  margin: 0;
}
.member-row {
  cursor: default;
}
.meter {
  height: 10px;
  background: var(--bg-0);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}
.meter-bar {
  height: 100%;
  width: 0;
  background: var(--success);
  transition: width 0.05s;
}
.quick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-list {
  max-height: 50vh;
  overflow-y: auto;
}
.quick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  color: var(--text-2);
}
.quick-item small {
  margin-left: auto;
  color: var(--muted);
}
.quick-item.sel,
.quick-item:hover {
  background: var(--bg-active);
  color: var(--text);
}

#toast-root {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 70;
  align-items: center;
}
.toast {
  background: var(--bg-4);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  animation: pop 0.15s;
}
.toast-actions {
  display: flex;
  gap: 6px;
}

/* ---------- telas menores ---------- */
@media (max-width: 1000px) {
  #right-panel:not(.search-panel) {
    display: none;
  }
}
@media (max-width: 700px) {
  #sidebar {
    width: 200px;
  }
  #guild-bar {
    width: 60px;
  }
  .guild-item {
    width: 60px;
  }
  .guild-icon {
    width: 42px;
    height: 42px;
  }
  .h-search,
  .h-topic {
    display: none;
  }
  #right-panel.search-panel {
    position: fixed;
    inset: 0;
    width: auto;
    z-index: 20;
  }
}

/* ================= Identidade Poleia Team (PLTM) ================= */
::selection {
  background: rgba(255, 122, 26, 0.35);
}
:root[data-theme='light'] .mention {
  color: #a8480a;
}

/* Tipografia: Rajdhani nos títulos e rótulos, Russo One nos letreiros. */
h1,
h2,
h3,
h4,
.modal h2 {
  font-family: var(--heading);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.section-title,
.settings-nav h5,
.field > span,
.ac-title,
.pc-section h4 {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
}
.btn {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.btn.small {
  font-size: 13px;
}
.tab {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
}
.h-title b {
  font-family: var(--heading);
  font-size: 18px;
  letter-spacing: 0.02em;
}
.guild-name {
  font-family: var(--heading);
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.intro h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  text-transform: uppercase;
}
.intro-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
.guild-icon > span {
  font-family: var(--display);
  font-size: 15px;
}

/* Login */
#auth {
  background: var(--glow), var(--stripes), var(--bg-0);
}
.auth-card {
  background: rgba(13, 16, 22, 0.9);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  backdrop-filter: blur(6px);
}
:root[data-theme='light'] .auth-card {
  background: rgba(255, 255, 255, 0.92);
}
.auth-brand {
  margin: 4px 0 22px;
}
.auth-brand .brand-split {
  font-size: 48px;
}
.auth-brand .brand-tag {
  margin-top: 14px;
}
.auth-card h1 {
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Carregamento */
#loading {
  background: var(--glow), var(--stripes), var(--bg-0);
}
.loading-brand {
  font-size: 44px;
  text-align: center;
  animation: brand-pulse 1.6s ease-in-out infinite;
}
@keyframes brand-pulse {
  50% {
    opacity: 0.55;
  }
}
#loading .spinner {
  border-top-color: var(--accent);
}

/* Barra de servidores */
#guild-bar {
  background: var(--stripes), var(--bg-0);
  border-right: 1px solid var(--border);
}
.guild-pill {
  background: var(--accent);
}
.guild-icon.home {
  background: transparent;
  overflow: visible;
}
.guild-item:hover .guild-icon.home,
.guild-item.active .guild-icon.home {
  background: transparent;
  box-shadow: 0 0 0 2px var(--accent);
}
.guild-icon.home .brand-icon {
  border-radius: inherit;
}
.guild-sep {
  background: var(--accent);
  opacity: 0.5;
}

/* Detalhes */
.channel.active {
  box-shadow: inset 2px 0 0 var(--accent);
}
.pc-banner {
  background: var(--glow), var(--stripes), #1c0e04;
  border-bottom: 2px solid var(--accent);
}
.modal {
  border-top: 3px solid var(--accent);
}
.toast {
  border-left: 3px solid var(--accent);
}
.empty-state svg {
  color: var(--accent);
}
#user-panel {
  border-top: 1px solid var(--border);
}
.titlebar-name {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.titlebar-name {
  display: flex;
  align-items: center;
}
.titlebar-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  margin-right: 8px;
}
.titlebar-name b {
  font-weight: 400;
  color: var(--text);
}

/* Tela cheia de lives e câmeras */
.vt-full {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.vt-full svg {
  width: 18px;
  height: 18px;
}
.voice-tile:hover .vt-full,
.vt-full:focus-visible {
  opacity: 1;
}
.vt-full:hover {
  background: var(--accent);
  color: var(--on-accent);
}
.voice-tile.has-video {
  cursor: pointer;
}
.voice-tile:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
  cursor: default;
}
.voice-tile:fullscreen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.voice-tile:fullscreen .vt-name {
  left: 16px;
  bottom: 16px;
  font-size: 15px;
}
.voice-tile:fullscreen .vt-full {
  top: 16px;
  right: 16px;
}
/* Em tela cheia os controles somem até o mouse se mexer sobre o vídeo. */
.voice-tile:fullscreen:not(:hover) .vt-name {
  opacity: 0;
  transition: opacity 0.4s 1.5s;
}

/* Supressão de ruído */
.vp-btn.noise.on {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--bg-1);
  cursor: pointer;
}
.switch-row.small {
  padding: 8px 12px;
  font-size: 13px;
  background: none;
}
.switch-row input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.switch-row span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.switch-row.small span {
  display: inline;
}
.switch-row small {
  color: var(--muted);
}

/* ================= Layout da tela inicial (amigos, Ativo agora, painéis) ================= */
/* Subtítulo de atividade: "Em voz", "Transmitindo ao vivo", status */
.activity {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.activity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.activity.act-voice {
  color: var(--success);
}
.activity.act-live {
  color: var(--accent);
}
.dm-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.dm-item {
  padding: 6px 8px;
}

/* Painel de voz */
.vp-row {
  gap: 6px;
}
.vp-signal {
  color: var(--success);
  display: grid;
}
.vp-signal svg {
  width: 18px;
  height: 18px;
}
.vp-where {
  display: flex;
  align-items: center;
  gap: 4px;
}
.vp-where svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.icon-btn.noise.on {
  color: var(--accent);
}
.vp-buttons .vp-btn {
  height: 34px;
}

/* Painel do usuário: microfone/fone com setinha de dispositivo */
.up-group {
  display: flex;
  align-items: center;
  border-radius: 6px;
}
.up-group:hover {
  background: var(--bg-hover);
}
.up-group .icon-btn:hover {
  background: none;
}
.icon-btn.chevron {
  width: 16px;
  margin-left: -4px;
}
.icon-btn.chevron svg {
  width: 13px;
  height: 13px;
}
.device-menu {
  max-width: 300px;
}
.menu-title {
  padding: 6px 10px 4px;
  font: 700 12px var(--heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Cabeçalho da tela de amigos */
.h-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
  margin: 0 6px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 6px;
}
.tab .badge.inline {
  margin-left: 0;
}
.tab.add {
  background: var(--accent);
  color: var(--on-accent);
}
.tab.add:hover {
  background: var(--accent-2);
}
.tab.add.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Lista de amigos */
.friends {
  padding: 16px 20px 16px 30px;
}
.friends-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--muted);
  margin-bottom: 18px;
}
.friends-search:focus-within {
  border-color: var(--accent);
}
.friends-search svg {
  width: 18px;
  height: 18px;
}
.friends-search input {
  flex: 1;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font: inherit;
}
.friends-count {
  font: 700 13px var(--heading);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px 8px;
}
.friend-row {
  margin: 0 -10px;
  padding: 10px;
  border-top: 1px solid var(--border);
  border-radius: 8px;
}
.friend-row:hover {
  border-top-color: transparent;
}
.friend-row:hover + .friend-row {
  border-top-color: transparent;
}
.fr-names b {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.fr-username {
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.1s;
}
.friend-row:hover .fr-username {
  opacity: 1;
}
.round-btn {
  background: var(--bg-1);
}
.friend-row:hover .round-btn {
  background: var(--bg-0);
}
.round-btn:hover {
  color: var(--accent);
}
.round-btn.ok:hover {
  color: var(--success);
}
.round-btn.danger:hover {
  color: var(--danger);
}

/* Ativo agora */
#right-panel.active-now {
  width: 340px;
  border-left: 1px solid var(--border);
}
.an-body {
  padding: 16px;
}
.an-title {
  font-family: var(--heading);
  font-size: 20px;
  margin: 4px 0 14px;
}
.an-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.an-card:hover {
  border-color: var(--accent);
  background: var(--bg-3);
}
.an-card.is-live {
  box-shadow: inset 3px 0 0 var(--accent);
}
.an-head,
.an-where {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}
.an-where {
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}
.an-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.an-text b,
.an-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.an-text small {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}
.an-text small svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.an-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--display);
  font-size: 12px;
}
.an-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.an-stack {
  display: flex;
  align-items: center;
}
.an-av {
  margin-left: -8px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg-1);
  display: inline-flex;
}
.an-av:first-child {
  margin-left: 0;
}
.an-more {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.an-here {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  border-top: 1px solid var(--border);
}
.an-empty {
  text-align: center;
  padding: 24px 8px;
}
.an-empty b {
  font-family: var(--heading);
  font-size: 17px;
}
.an-empty p {
  color: var(--muted);
  font-size: 13px;
}

/* App desktop: título da tela no centro da barra */
#titlebar {
  position: relative;
}
.titlebar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 50%;
  font: 600 12px var(--font);
  color: var(--text-2);
  pointer-events: none;
}
.titlebar-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.titlebar-title svg {
  width: 14px;
  height: 14px;
}
@media (max-width: 1000px) {
  #right-panel.active-now {
    display: none;
  }
}

/* Barra lateral mais larga: cabe o nome com os controles de microfone/fone. */
#sidebar {
  width: 272px;
}


/* Sensibilidade de entrada */
.sens-meter {
  --t: 50%;
  position: relative;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0 6px;
  /* abaixo do limite (laranja): não transmite; acima (verde): transmite */
  background: linear-gradient(to right, rgba(255, 122, 26, 0.28) 0 var(--t), rgba(47, 182, 124, 0.3) var(--t) 100%);
}
.sens-level {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 255, 255, 0.22);
  transition: width 0.05s linear;
}
.sens-meter.open .sens-level {
  background: rgba(47, 182, 124, 0.75);
}
.sens-meter input[type='range'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: ew-resize;
}
.sens-meter input[type='range']:disabled {
  cursor: default;
}
.sens-meter input[type='range']::-webkit-slider-runnable-track {
  height: 100%;
  background: transparent;
}
.sens-meter input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 6px;
  height: 30px;
  border-radius: 3px;
  background: var(--text);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}
.sens-meter input[type='range']::-moz-range-thumb {
  width: 6px;
  height: 30px;
  border: 0;
  border-radius: 3px;
  background: var(--text);
}
.sens-meter.auto input[type='range']::-webkit-slider-thumb {
  background: var(--muted);
}
.sens-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.sens-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--offline);
}
.sens-info.open .sens-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(47, 182, 124, 0.25);
}
.sens-info.open [data-sens-status] {
  color: var(--success);
}
.sens-value {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Configurações de voz: dispositivos, volumes, teste e perfil de entrada */
.voice-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}
.voice-grid2 .field > span {
  display: flex;
  justify-content: space-between;
}
.voice-grid2 output {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
input[type='range'].vol {
  width: 100%;
  accent-color: var(--accent);
  height: 22px;
}
.mic-test {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 8px;
}
.mic-test .btn {
  flex-shrink: 0;
  min-width: 170px;
}
.mic-test .btn.danger {
  background: var(--danger);
  color: #fff;
}
.mic-bars {
  flex: 1;
  height: 26px;
  display: flex;
  gap: 4px;
  align-items: stretch;
}
.mic-bars i {
  flex: 1;
  border-radius: 2px;
  background: var(--bg-4);
  transition: background 0.05s;
}
.mic-bars i.on {
  background: var(--text-2);
}
.mic-bars i.on.open {
  background: var(--success);
}
.settings-sep {
  height: 1px;
  background: var(--border);
  margin: 22px 0 6px;
}
.profile-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.profile-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.profile-opt:hover {
  background: var(--bg-hover);
}
.profile-opt input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.profile-opt span,
.toggle-row > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-opt small,
.toggle-row small {
  color: var(--muted);
  font-size: 13px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.custom-audio > .toggle-row:first-child {
  border-top: 0;
}
.toggle-row select.input {
  width: 210px;
  flex-shrink: 0;
}
/* Chave liga/desliga */
input.switch {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--bg-4);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
input.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
input.switch:checked {
  background: var(--accent);
}
input.switch:checked::after {
  transform: translateX(18px);
}
@media (max-width: 760px) {
  .voice-grid2 {
    grid-template-columns: 1fr;
  }
}
