/* Goklah — componentes visuais reutilizáveis. Tudo aqui referencia
   tokens de styles/tokens.css — nenhum valor de cor/espaçamento solto. */

/* ---- Cartão / superfície ---- */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card + .card {
  margin-top: var(--space-4);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.section-header h2 {
  margin: 0;
}

.section-header .count-badge {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

/* ---- Formulários ---- */

form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-base);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

input,
select {
  background: var(--bg-sunken);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-3);
  height: var(--control-h-md);
  font-size: var(--text-md);
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:hover,
select:hover {
  border-color: var(--text-disabled);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

input::placeholder {
  color: var(--text-muted);
}

.hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 0;
}

.hint.success {
  color: var(--success);
}

.error {
  color: var(--danger);
  font-size: var(--text-base);
  margin: 0;
  min-height: 18px;
}

.switch {
  text-align: center;
  font-size: var(--text-base);
  color: var(--text-muted);
  margin: var(--space-4) 0 0;
}

.switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: var(--weight-medium);
}

.switch a:hover {
  text-decoration: underline;
}

.auth-form-links {
  display: flex;
  justify-content: flex-end;
  margin-top: calc(var(--space-2) * -1);
}

.auth-form-links a,
.auth-description a {
  color: var(--accent);
  font-size: var(--text-sm);
  text-decoration: none;
  font-weight: var(--weight-medium);
}

.auth-form-links a:hover { text-decoration: underline; }

.auth-description {
  margin: 0 0 var(--space-4);
  color: var(--text-muted);
  line-height: 1.55;
}

.reset-code-input {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.legal-acceptance {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2);
  line-height: 1.45;
  font-size: var(--text-sm);
}

.legal-acceptance input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.link-button {
  display: inline;
  height: auto;
  padding: 0;
  background: none;
  color: var(--accent);
  font-size: inherit;
  font-weight: var(--weight-semibold);
  vertical-align: baseline;
}

.link-button:hover,
.link-button:active {
  background: none;
  text-decoration: underline;
}

.legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: color-mix(in srgb, #050711 84%, transparent);
}

.legal-dialog {
  width: min(760px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
}

.legal-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.legal-dialog h2,
.legal-dialog h3 { margin: 0; }

.legal-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.legal-content {
  overflow-y: auto;
  padding: var(--space-5);
  display: grid;
  gap: var(--space-5);
}

.legal-content section {
  display: grid;
  gap: var(--space-2);
}

.legal-content p {
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ---- Botões ---- */

/* Botão primário: texto branco sobre --accent-action (variante mais
   escura do accent, ver tokens.css). --accent "puro" fica reservado pra
   seleção/ícones/foco (sidebar-item.active, border-focus, etc.), não
   pra fundo de botão com texto em cima — inversão deliberada em relação
   à fase anterior (coral com texto escuro), pedida explicitamente nesta
   fase pra não achatar a identidade azul-violeta em todo botão. */
button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
  height: var(--control-h-md);
  padding: 0 var(--space-4);
  background: var(--accent-action);
  color: #fff;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

button:hover {
  background: var(--accent-action-hover);
}

button:active {
  background: var(--accent-action-active);
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  width: 100%;
}

button.secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-disabled);
}

button.secondary:active {
  background: var(--bg-active);
}

button.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

button.ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

button.danger {
  background: var(--danger);
  color: #fff;
}

button.danger:hover {
  background: var(--danger-hover);
}

button.secondary.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

button.secondary.danger:hover {
  background: var(--danger-muted);
}

button.small {
  height: var(--control-h-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  width: auto;
  margin-top: 0;
}

/* Botão só-ícone — mesma altura dos demais, largura igual à altura pra
   ficar quadrado/circular. Sempre usado com aria-label + tooltip
   (ver .tooltip) já que não tem rótulo de texto visível. */
button.btn-icon {
  width: var(--control-h-md);
  height: var(--control-h-md);
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

button.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

button.btn-icon:active {
  background: var(--bg-active);
  transform: none;
}

button.btn-icon.small {
  width: var(--control-h-sm);
  height: var(--control-h-sm);
}

button.btn-icon.active {
  background: var(--accent-muted);
  color: var(--accent);
}

/* Estado "ligado negativo" persistente (mutado/silenciado) — distinto
   do hover vermelho de .danger-hover, que só reage a passar o mouse. */
button.btn-icon.negative {
  background: var(--danger-muted);
  color: var(--danger);
}

button.btn-icon.danger-hover:hover {
  background: var(--danger-muted);
  color: var(--danger);
}

/* ---- Sidebar ---- */








/* Item de navegação ainda sem funcionalidade real (Conversas nesta
   fase) — visualmente presente e honesto sobre o estado, não escondido
   nem parecendo quebrado. */




/* ---- Barra estreita (rail) ---- */





/* Botão de sala: some o padding/fundo padrão do rail-item pra deixar só
   o avatar circular (já vem com sua própria cor de fundo). O anel de
   seleção usa outline em vez de background pra não brigar com a cor do
   avatar. */


.status-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  overflow: hidden;
}

.status-pill span.label-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}

.current-user-row .current-user-name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Ícones ---- */

.icon {
  display: inline-flex;
  flex-shrink: 0;
}

.icon svg {
  width: 1em;
  height: 1em;
  display: block;
}

/* ---- Tooltip ---- */

/* Tooltip: renderizado num elemento fixo no <body> (ver
   components/tooltip.ts), não como ::after do próprio elemento.
   Motivo: rail e barra contextual são contêineres roláveis com
   overflow escondido — um pseudo-elemento posicionado pra fora deles
   seria recortado, e era exatamente isso que acontecia com o nome das
   salas no rail e com o "Copiar convite" dentro do painel de sala. */
.tooltip-layer {
  position: fixed;
  z-index: 60;
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-raised);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tooltip-layer.open {
  opacity: 1;
}

/* ---- Avatar ---- */

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  flex-shrink: 0;
  user-select: none;
  position: relative;
  overflow: visible;
}

.avatar-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: inherit;
}

.avatar-mascot,
.avatar-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.avatar-mascot {
  object-fit: contain;
  width: 76%;
  height: 76%;
  max-width: none;
  transform: translateY(2%);
}

.avatar-photo {
  position: absolute;
  inset: 0;
}

.avatar-presence {
  position: absolute;
  right: 1px;
  bottom: 1px;
  z-index: 3;
  width: 11px;
  height: 11px;
  border: 2px solid var(--bg-surface-raised);
  border-radius: var(--radius-full);
  background: var(--presence-online);
  pointer-events: none;
}

.avatar.sm .avatar-presence {
  width: 9px;
  height: 9px;
  border-width: 2px;
}

.avatar.profile .avatar-presence {
  right: 2px;
  bottom: 2px;
  width: 17px;
  height: 17px;
  border-width: 3px;
}

.avatar-presence[data-presence="idle"] { background: var(--presence-idle); }
.avatar-presence[data-presence="focus"] { background: var(--presence-focus); }
.avatar-presence[data-presence="busy"] { background: var(--presence-busy); }
.avatar-presence[data-presence="invisible"] { background: var(--presence-invisible); }
.avatar-presence[data-presence="offline"] { background: var(--presence-offline); }

.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
}

/* 42px no rail e 32px no menu de perfil — medidas do Avatar do Stoat
   nesses dois contextos. */
.avatar.rail {
  width: var(--rail-avatar);
  height: var(--rail-avatar);
  font-size: var(--text-base);
}

.avatar.menu {
  width: 32px;
  height: 32px;
  font-size: var(--text-sm);
}

.avatar.profile {
  width: 84px;
  height: 84px;
  border: 5px solid var(--bg-surface-raised);
  box-shadow: 0 0 0 1px var(--border);
}

.avatar.profile .avatar-mascot {
  width: 76%;
  height: 76%;
  transform: translateY(2%);
}

.register-avatar-title {
  display: block;
  font-size: var(--label-lg-size);
  font-weight: var(--weight-semibold);
  margin-bottom: 2px;
}

.register-preview-customize .hint {
  margin: 0 0 var(--space-2);
}

.register-avatar-colors {
  display: flex;
  gap: var(--space-2);
}

.username-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  color: var(--text-muted);
}

.username-input-wrap > span { padding-left: var(--space-3); }
.username-input-wrap input { border: 0; background: transparent; box-shadow: none; }

.register-profile-preview {
  overflow: hidden;
  min-height: 190px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-raised);
}

.register-preview-banner { height: 66px; }
.register-preview-body { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4) var(--space-4); }
.register-preview-body .avatar.profile { width: 68px; height: 68px; margin-top: -28px; border-width: 4px; }
.register-preview-body > div { display: flex; flex-direction: column; min-width: 0; }
.register-preview-body strong { font-size: var(--text-lg); }
.register-preview-body span { color: var(--text-muted); font-size: var(--body-sm-size); }

.register-preview-customize {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.register-preview-customize .hint {
  margin: 2px 0 0;
}

.avatar-color-swatch {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.avatar-color-swatch.selected {
  border-color: var(--bg-app);
  box-shadow: 0 0 0 2px var(--accent);
}

/* ---- Badge ---- */

.badge {
  background: var(--bg-active);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.badge.owner {
  background: var(--accent-muted);
  color: var(--accent);
}

.badge-count {
  background: var(--accent);
  color: var(--text-on-accent);
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: var(--weight-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- Listas ---- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.list-item-main {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.list-item-text {
  min-width: 0;
}

.list-item-text .name {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-text .meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.list-item.speaking {
  border-color: var(--success);
  box-shadow: 0 0 0 1px var(--success-muted);
}

/* Linhas sociais densas: ocupam a área de conteúdo sem parecer uma pilha de
   cards e revelam as ações quando o usuário passa o mouse ou usa o teclado. */
.friends-list {
  gap: 0;
}

.friends-list .list-item {
  min-height: 62px;
  padding: var(--space-2);
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.friends-list .list-item:hover,
.friends-list .list-item:focus-within {
  border-radius: var(--radius-md);
  background: var(--bg-hover);
}

.friends-list .avatar.sm {
  width: 40px;
  height: 40px;
}

.friends-list .list-item-actions {
  opacity: 0.72;
  transition: opacity var(--transition-fast);
}

.friends-list .list-item:hover .list-item-actions,
.friends-list .list-item:focus-within .list-item-actions {
  opacity: 1;
}

/* ---- Estado vazio ---- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
}

.empty-state .icon {
  color: var(--text-disabled);
  margin-bottom: var(--space-1);
}

.empty-state .icon svg {
  width: 28px;
  height: 28px;
}

.empty-state .empty-title {
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
}

.empty-state .empty-desc {
  font-size: var(--text-sm);
  max-width: 320px;
}

/* ---- Status de conexão (dot) ---- */

.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--text-disabled);
  flex-shrink: 0;
}

.dot.ok {
  background: var(--success);
}

.dot.fail {
  background: var(--danger);
}

/* ---- Convite ---- */

.invite-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
}

.invite-chip code {
  flex: 1;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.invite-chip code::-webkit-scrollbar {
  display: none;
}

/* ---- Barra de voz ---- */

.voice-bar-idle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.voice-bar-idle .voice-bar-copy .title {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.voice-bar-idle .voice-bar-copy .subtitle {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: 2px;
}

.voice-bar-connected {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-left: auto;
}

.voice-controls select {
  height: var(--control-h-sm);
  font-size: var(--text-sm);
  max-width: 180px;
}

.voice-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 var(--space-1);
}

.screen-share-area {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.screen-video {
  display: block;
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: var(--radius-md);
  object-fit: contain;
  border: 1px solid var(--border);
}

.screen-video-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.mic-indicator {
  display: inline-flex;
  color: var(--text-muted);
}

.mic-indicator.muted {
  color: var(--danger);
}

.mic-indicator.live {
  color: var(--success);
}

.screen-indicator {
  display: inline-flex;
  color: var(--accent);
}

.volume-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.volume-row input[type="range"] {
  width: 72px;
  accent-color: var(--accent);
}

/* ---- Modal ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: goklah-fade-in var(--transition-base);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-dialog {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border);
  /* padding 24px, min 280px, max 560px, raio 28px — medidas do Dialog
     do Stoat. */
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  padding: var(--space-6);
  min-width: 280px;
  width: 420px;
  max-width: min(560px, calc(100vw - var(--space-6)));
}

.modal-dialog h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-2);
}

.modal-dialog > p {
  color: var(--text-secondary);
  font-size: var(--body-md-size);
  line-height: var(--body-md-line);
  margin-bottom: var(--space-5);
}

.modal-dialog form {
  gap: var(--space-l);
}

.modal-dialog .modal-actions {
  margin-top: var(--space-2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.modal-actions button {
  width: auto;
}

.modal-check-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--bg-sunken);
  cursor: pointer;
}

.modal-check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

@keyframes goklah-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---- Placeholder não interativo (ex.: "Comunidades — em breve") ---- */




/* ---- Perfil / Conta ---- */

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-base);
}

.profile-row:last-of-type {
  border-bottom: none;
}

.profile-row .label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.profile-row .label .icon {
  font-size: 16px;
}

.profile-row .value {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.profile-header .avatar {
  width: 56px;
  height: 56px;
  font-size: var(--text-lg);
}

.profile-header .name {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

/* ============================================================
   Fase A refeita — componentes com as medidas do Stoat.
   ============================================================ */

/* ---- Barra estreita (rail) ----
   Item de 56x56 com avatar/ícone de 42px centralizado. O indicador de
   seleção é a barra vertical à esquerda (::before): 12px de largura,
   altura 0 → 16px no hover → 32px selecionado. Medidas do
   `entryContainer` do Stoat. */

.rail-item {
  width: var(--rail-item);
  height: var(--rail-item);
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
}

.rail-item::before {
  content: "";
  position: absolute;
  left: -8px;
  width: 12px;
  height: 0;
  border-radius: var(--radius-xs);
  background: var(--text-primary);
  transition: height var(--transition-fast);
}

.rail-item:hover::before {
  height: 16px;
}

.rail-item.active::before {
  height: 32px;
  background: var(--accent);
}

.rail-item .icon {
  font-size: 22px;
  width: var(--rail-avatar);
  height: var(--rail-avatar);
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.rail-item:hover {
  background: transparent;
  transform: none;
  color: var(--text-primary);
}

.rail-item:hover .icon {
  background: var(--bg-surface-raised);
}

.rail-item:active {
  background: transparent;
  transform: none;
}

.rail-item.active .icon {
  background: var(--accent-muted-strong);
  color: var(--accent);
}

/* Botão de sala e de perfil: o avatar já tem cor própria, então não
   ganha a caixa de fundo do ícone. */
.rail-item.rail-room,
.rail-item.rail-profile {
  border-radius: var(--radius-full);
}

/* Ponto da preferência de presença persistida do próprio usuário. */
.rail-profile {
  position: relative;
}

.presence-dot {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-sidebar);
  background: var(--presence-online);
  pointer-events: none;
}

.presence-dot[data-presence="idle"] { background: var(--presence-idle); }
.presence-dot[data-presence="focus"] { background: var(--presence-focus); }
.presence-dot[data-presence="busy"] { background: var(--presence-busy); }
.presence-dot[data-presence="invisible"] { background: var(--presence-invisible); }
.presence-dot[data-presence="offline"] { background: var(--presence-offline); }

/* ---- Item de menu da barra contextual ----
   O realce acompanha a linha da navegação sem formar uma pílula grande. */

.menu-button {
  height: var(--menu-item-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: 0 var(--space-md);
  padding: 0 var(--space-md);
  border: none;
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: var(--weight-medium);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.menu-button .icon {
  font-size: 20px;
  flex-shrink: 0;
}

.menu-button-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: none;
}

.menu-button:active {
  background: var(--bg-active);
  transform: none;
}

.menu-button.active {
  color: var(--text-primary);
  background: transparent;
}

.menu-button.selected {
  color: var(--accent);
  background: var(--accent-muted);
}

.menu-button.selected:hover {
  background: var(--accent-muted-strong);
}

/* Botão "+" do cabeçalho de seção. */
.context-category-action {
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.context-category-action .icon {
  font-size: 18px;
}

.context-category-action:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: none;
}

/* Rótulo "em breve" — usado em item de menu, botão de ação e modal. */
.pill-upcoming {
  flex-shrink: 0;
  font-size: var(--label-sm-size);
  line-height: var(--label-sm-line);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-active);
  border-radius: var(--radius-full);
  padding: 2px var(--space-md);
}

/* Badge de solicitações pendentes na linha de Amigos — medidas do
   `PendingBadge` do Stoat (padding 4px 8px, raio 12px, label pequeno). */
.pending-badge {
  flex-shrink: 0;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--danger);
  color: #fff;
  font-size: var(--label-sm-size);
  line-height: var(--label-sm-line);
  font-weight: var(--weight-semibold);
}

/* ---- Botão de ação da Início (CategoryButton) ----
   padding 13px, gap 16px, raio 12px, caixa do ícone 36x36 redonda,
   título 14px/500 e descrição 12px/500 com 2px de gap. */

.category-button {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: var(--space-4);
  padding: 13px;
  height: auto;
  border: none;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.category-button:hover {
  background: var(--accent-muted);
  transform: none;
}

.category-button:active {
  background: var(--accent-muted-strong);
  transform: none;
}

.category-button.tertiary {
  background: var(--bg-sunken);
  color: var(--text-secondary);
}

.category-button.tertiary:hover {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
}

.category-button-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--bg-app);
  color: var(--accent);
}

.category-button-icon .icon {
  font-size: 20px;
}

.category-button-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--space-xs);
  min-width: 0;
}

.category-button-title {
  font-size: var(--label-lg-size);
  line-height: var(--label-lg-line);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-button-description {
  font-size: var(--label-md-size);
  line-height: var(--label-md-line);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
  text-wrap: wrap;
}

/* ---- Popover (menu de perfil, menu do "+") ---- */

.popover {
  position: fixed;
  z-index: 40;
  min-width: 232px;
  max-width: 300px;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-popover);
  display: flex;
  flex-direction: column;
  gap: var(--space-xxs);
  /* Animação de entrada espelhada do UserMenu do Stoat: opacidade e um
     deslize horizontal curto. */
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.2s cubic-bezier(0.87, 0, 0.13, 1),
    transform 0.2s cubic-bezier(0.87, 0, 0.13, 1);
}

.popover.open {
  opacity: 1;
  transform: translateX(0);
}

.popover-item {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  width: 100%;
  height: 34px;
  padding: 0 var(--space-md);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--body-md-size);
  font-weight: var(--weight-medium);
  text-align: left;
  cursor: pointer;
}

.popover-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: none;
}

.popover-item:active {
  background: var(--bg-active);
  transform: none;
}

.popover-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popover-item .icon {
  font-size: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.popover-item.danger-hover:hover {
  color: var(--danger);
}

.popover-item.danger-hover:hover .icon {
  color: var(--danger);
}

/* Caixa de 16px em volta do ponto de status de 10px — mesma proporção
   do `Status` do UserMenu do Stoat. */
.popover-status {
  width: 16px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.popover-status i {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--presence-online);
  display: block;
}

.popover-status i[data-presence="idle"] { background: var(--presence-idle); }
.popover-status i[data-presence="focus"] { background: var(--presence-focus); }
.popover-status i[data-presence="busy"] { background: var(--presence-busy); }
.popover-status i[data-presence="invisible"] { background: var(--presence-invisible); }
.popover-status i[data-presence="offline"] { background: var(--presence-offline); }

.popover-divider {
  height: 1px;
  margin: var(--space-sm) var(--space-md);
  background: var(--border);
}

/* Cabeçalho do menu de perfil: avatar 32px + nome + identificador. */
.popover-profile {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  width: 100%;
  padding: var(--space-md);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  height: auto;
}

.popover-profile:hover {
  background: var(--bg-hover);
  transform: none;
}

.popover-profile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.popover-profile-name {
  font-size: var(--body-md-size);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popover-profile-id {
  font-size: var(--label-md-size);
  line-height: var(--label-md-line);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Modal: cabeçalho com ícone, descrição e lista ---- */

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.modal-header h3 {
  margin: 0;
  font-size: var(--title-md-size);
  line-height: var(--title-md-line);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.modal-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent);
}

.modal-icon .icon {
  font-size: 20px;
}

.modal-description {
  font-size: var(--body-md-size);
  line-height: var(--body-md-line);
  color: var(--text-secondary);
  margin: var(--space-xs) 0 0;
}

.modal-bullets {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-bullets li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-l);
  font-size: var(--body-md-size);
  line-height: var(--body-md-line);
  color: var(--text-secondary);
}

.modal-bullets .icon {
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* "Em breve" dentro da descrição do botão de ação (ver
   components/categoryButton.ts — como pílula ao lado do título ele
   truncava o título numa coluna de 260px). */
.category-button-flag {
  color: var(--accent);
  font-weight: var(--weight-semibold);
}

/* ============================================================
   Fase C — Perfil real, Sessões, Voz e vídeo expandido, Aparência.
   ============================================================ */

textarea {
  background: var(--bg-sunken);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-md);
  font-family: var(--font-sans);
  resize: vertical;
  min-height: 72px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea:hover {
  border-color: var(--text-disabled);
}

textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.char-counter {
  align-self: flex-end;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.char-counter.limit {
  color: var(--danger);
}

/* Redefinir/Salvar (Perfil) — par de botões lado a lado, mesma ordem do
   Stoat real (secundário primeiro, ação primária por último). */
.settings-profile-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* ---- Perfil — banner + avatar editáveis ---- */

.settings-banner-edit {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 128px;
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
}

.settings-banner-edit .settings-image-edit-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: rgba(10, 11, 18, 0.35);
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition-fast);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.settings-banner-edit:hover .settings-image-edit-overlay {
  opacity: 1;
}

/* Avatar e Banner (Perfil) — seções empilhadas, cada uma com rótulo +
   controle + botão "x" de remover ao lado (correção pedida pelo usuário
   depois de comparar com o Stoat real: a versão anterior sobrepunha o
   avatar ao banner, escondendo espaço pra uma ação de remover). */
.settings-image-section-label {
  font-size: var(--label-lg-size);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-top: var(--space-3);
}

.settings-image-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ---- Perfil social público ----
   Card rápido para contexto e superfície completa para leitura/ações.
   Não compartilha a aparência de formulário da central de configurações:
   é uma apresentação de identidade, não uma "janela dentro da janela". */

.public-profile-trigger {
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: inherit;
  text-align: inherit;
  display: inline-flex;
  align-items: center;
}

.public-profile-trigger:hover {
  transform: none;
  filter: brightness(1.08);
}

.public-profile-name-trigger {
  border-radius: var(--radius-xs);
  font: inherit;
}

.public-profile-name-trigger:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.public-profile-header-trigger {
  cursor: pointer;
  -webkit-app-region: no-drag;
}

.public-profile-header-trigger:hover {
  color: var(--accent);
}

.public-profile-popover {
  width: 340px;
  min-width: 340px;
  max-width: min(340px, calc(100vw - var(--space-4)));
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.public-profile-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.public-profile-banner {
  height: 120px;
  flex-shrink: 0;
  background-position: center;
  background-size: cover;
}

.public-profile-banner.compact {
  height: 92px;
}

.public-profile-identity {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  min-width: 0;
  margin: -42px var(--space-6) 0;
}

.public-profile-identity.compact {
  gap: var(--space-3);
  margin: -32px var(--space-4) 0;
}

.public-profile-identity.compact .avatar.profile {
  width: 64px;
  height: 64px;
  border-width: 4px;
}

.public-profile-name-block {
  min-width: 0;
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.public-profile-identity.compact .public-profile-name-block {
  padding-top: 34px;
}

.public-profile-display-name {
  max-width: 100%;
  margin: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  font-size: var(--text-2xl);
  line-height: 1.15;
  font-weight: var(--weight-bold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-profile-identity.compact .public-profile-display-name {
  font-size: var(--text-lg);
  line-height: var(--title-md-line);
}

.public-profile-display-name:hover { transform: none; filter: brightness(1.12); }
.name-font-rounded { font-family: ui-rounded, "Trebuchet MS", Inter, sans-serif; }
.name-font-mono { font-family: "Cascadia Mono", Consolas, monospace; }
.name-effect-solid { color: var(--profile-name-color); }
.name-effect-gradient { color: transparent; background: linear-gradient(90deg, var(--profile-name-color), var(--accent)); background-clip: text; }
.name-effect-neon { color: var(--profile-name-color); text-shadow: 0 0 8px color-mix(in srgb, var(--profile-name-color) 78%, transparent), 0 0 18px color-mix(in srgb, var(--profile-name-color) 42%, transparent); }

.public-profile-identifier {
  min-height: 0;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--body-sm-size);
  font-weight: var(--weight-regular);
}

.public-profile-identifier .icon {
  font-size: 12px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.public-profile-identifier:hover {
  color: var(--text-primary);
  transform: none;
}

.public-profile-identifier:hover .icon,
.public-profile-identifier:focus-visible .icon {
  opacity: 1;
}

.public-profile-pronouns {
  color: var(--text-muted);
  font-size: var(--body-sm-size);
}

.public-profile-presence {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--body-sm-size);
  line-height: var(--body-sm-line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-profile-presence i {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--presence-online);
}

.public-profile-presence i[data-presence="idle"] { background: var(--presence-idle); }
.public-profile-presence i[data-presence="focus"] { background: var(--presence-focus); }
.public-profile-presence i[data-presence="busy"] { background: var(--presence-busy); }
.public-profile-presence i[data-presence="invisible"] { background: var(--presence-invisible); }
.public-profile-presence i[data-presence="offline"] { background: var(--presence-offline); }

.public-profile-bio {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--body-md-size);
  line-height: var(--body-md-line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.public-profile-bio.compact {
  margin: var(--space-4) var(--space-4) 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.public-profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4);
  flex-wrap: wrap;
}

.banner-preset-aurora { background: linear-gradient(135deg, #5b6cff, #a96dff 52%, #ff88c8); }
.banner-preset-sunset { background: linear-gradient(135deg, #ff775f, #ffae5d 48%, #7c4dff); }
.banner-preset-ocean { background: linear-gradient(135deg, #0a7798, #39bfc1 52%, #3756d8); }
.banner-preset-nebula { background: linear-gradient(135deg, #171b46, #7635a8 50%, #d24889); }
.banner-preset-ember { background: linear-gradient(135deg, #35151c, #b63c2f 52%, #f49d37); }

.banner-preset-picker { display: grid; grid-template-columns: repeat(5, minmax(48px, 1fr)); gap: var(--space-2); }
.banner-preset-option { min-height: 52px; padding: 0; border: 2px solid transparent; border-radius: var(--radius-md); }
.banner-preset-option.selected { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--accent); }
.name-style-controls { display: grid; grid-template-columns: 1fr 1fr 52px; gap: var(--space-2); }
.name-style-controls input[type="color"] { width: 52px; height: 42px; padding: 4px; }
.account-password-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.account-password-panel summary {
  list-style: none;
}

.account-password-panel summary::-webkit-details-marker {
  display: none;
}

.account-panel-summary {
  width: 100%;
  min-height: 68px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

button.account-panel-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.account-panel-summary:hover,
button.account-panel-summary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.account-panel-summary:active,
button.account-panel-summary:active {
  background: var(--bg-active);
  transform: none;
}

.account-panel-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--bg-sunken);
  color: var(--text-secondary);
}

.account-panel-icon .icon {
  font-size: 19px;
}

.account-panel-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-panel-copy strong {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.account-panel-copy span {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  line-height: 1.35;
}

.account-panel-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.account-password-panel[open] .account-panel-chevron {
  transform: rotate(90deg);
}

.account-password-panel[open] .account-panel-summary {
  border-bottom: 1px solid var(--border);
}

.account-password-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4) var(--space-3);
}

.account-password-fields label {
  min-width: 0;
  display: grid;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.account-password-fields input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.account-password-actions {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-4);
}

.account-password-actions .hint {
  margin: 0;
}

@media (max-width: 760px) {
  .account-password-fields {
    grid-template-columns: 1fr;
  }
}

.public-profile-actions button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding-inline: var(--space-3);
  line-height: var(--label-md-line);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.public-profile-actions button .icon {
  font-size: 16px;
  flex: 0 0 auto;
}

.public-profile-open-full {
  min-height: 38px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
}

.public-profile-open-full:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: none;
}

.public-profile-open-full .icon {
  font-size: 16px;
}

.public-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--titlebar-h) + var(--space-5)) var(--space-5) var(--space-5);
  background: var(--overlay-scrim);
  animation: goklah-fade-in var(--transition-base);
}

.public-profile-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface-raised);
  box-shadow: var(--shadow-modal);
}

.public-profile-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-surface-raised) 78%, transparent);
  backdrop-filter: blur(8px);
}

.public-profile-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6);
}

.public-profile-content section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.public-profile-content h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--label-lg-size);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

.public-profile-content .public-profile-actions {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding-top: var(--space-2);
}

.public-profile-content .public-profile-actions button {
  width: auto;
  flex: 1 1 148px;
}

.public-profile-date {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.public-profile-date .icon {
  font-size: 16px;
}

.public-profile-friends-since {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--accent-muted);
  color: var(--text-secondary);
  font-size: var(--body-sm-size);
}

.public-profile-loading {
  min-height: 120px;
  padding: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--text-muted);
}

.public-profile-loading.full {
  min-height: 360px;
}

.public-profile-loading .icon {
  animation: public-profile-spin 0.9s linear infinite;
}

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

@media (max-width: 620px), (max-height: 620px) {
  .public-profile-overlay {
    align-items: center;
    padding: calc(var(--titlebar-h) + var(--space-2)) var(--space-2) var(--space-2);
  }

  .public-profile-dialog {
    width: 100%;
    border-radius: var(--radius-xl);
  }

  .public-profile-banner {
    height: 104px;
  }

  .public-profile-content {
    padding: var(--space-5);
  }
}

.account-hero-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-muted-strong), var(--bg-surface) 58%);
}

.account-hero-card .avatar {
  width: 64px;
  height: 64px;
}

.account-hero-identity {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.account-hero-identity .name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-hero-identifier {
  color: var(--text-muted);
  font-size: var(--body-sm-size);
}

.account-edit-profile {
  flex-shrink: 0;
}

.profile-summary-card .avatar {
  width: 56px;
  height: 56px;
}

.profile-summary-card {
  background: var(--accent-muted-strong);
}

.settings-section-title {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xl);
  line-height: var(--title-lg-line);
}

.profile-page {
  gap: var(--space-2);
}

.profile-page .profile-summary-card {
  margin-bottom: var(--space-3);
}

.profile-page .settings-section-title {
  margin-bottom: var(--space-2);
}

.profile-page .settings-image-section-label {
  margin-top: var(--space-2);
}

.profile-page .settings-banner-edit {
  height: 96px;
}

.profile-page .char-counter {
  margin-top: calc(var(--space-2) * -1);
}

.account-details-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.account-details-card .profile-row {
  margin: 0;
  padding: var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.account-details-card .profile-row:last-child {
  border-bottom: 0;
}

.avatar-color-picker {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.avatar-color-picker .avatar-color-swatch {
  width: 30px;
  height: 30px;
}

/* ---- Anotações pessoais ---- */

.notes-view {
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.notes-view[hidden] {
  display: none;
}

.notes-channel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-4) var(--space-2);
  border-radius: 0;
  background: var(--bg-surface);
  overflow: hidden;
}

.notes-stream {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-4) var(--space-3);
}

.notes-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--space-2);
  color: var(--text-muted);
  padding: var(--space-3) 0;
}

.notes-empty strong {
  color: var(--text-primary);
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.note-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

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

.note-item.pinned {
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent-muted) 55%, transparent);
}

.note-body {
  min-width: 0;
}

.note-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.note-meta time {
  color: var(--text-muted);
  font-size: var(--label-sm-size);
}

.note-pinned-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  font-size: var(--label-sm-size);
}
.note-pinned-label .icon { font-size: 12px; }

.note-content {
  margin: 3px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  line-height: var(--body-lg-line);
}

.note-actions {
  display: flex;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.note-item:hover .note-actions,
.note-actions:focus-within {
  opacity: 1;
}

.note-editor textarea {
  width: 100%;
  margin-top: var(--space-2);
}

.note-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.notes-composer {
  min-height: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.notes-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }

.notes-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 120px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
}

.notes-counter {
  align-self: center;
  flex-shrink: 0;
  font-size: 10px;
}

.notes-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  color: var(--text-on-accent);
  background: var(--accent);
}

.notes-send:hover {
  background: var(--accent-hover);
}

.notes-channel > .error {
  min-height: 16px;
  margin: var(--space-1) var(--space-3) 0;
}

@media (max-width: 900px) {
  .note-actions { opacity: 1; }
}

/* ---- Mensagens diretas ---- */

.dm-conversations-empty {
  padding: var(--space-3) var(--space-2);
  color: var(--text-muted);
  font-size: var(--label-md-size);
  line-height: var(--label-md-line);
}

.dm-conversation-item {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.dm-conversation-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  transform: none;
}

.dm-conversation-item.selected {
  color: var(--text-primary);
  background: var(--accent-soft);
}

.dm-conversation-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm-conversation-copy strong,
.dm-conversation-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-conversation-copy strong {
  font-size: var(--body-md-size);
}

.dm-conversation-copy span {
  color: var(--text-muted);
  font-size: var(--label-sm-size);
}

.dm-unread-badge {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding-inline: 5px;
  border-radius: var(--radius-full);
  color: var(--text-on-accent);
  background: var(--accent);
  font-size: 10px;
  font-weight: var(--weight-bold);
}

.dm-view {
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.dm-view[hidden] {
  display: none;
}

.dm-channel {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-4);
  border-radius: 0;
  background: var(--bg-surface);
  overflow: hidden;
}

.dm-call-start {
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
}

.dm-call-panel {
  flex-shrink: 0;
  margin: 0 var(--space-1) var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--accent-muted);
  overflow: hidden;
}

.dm-call-panel.expanded {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 0;
  background: var(--bg-surface);
}

.dm-call-panel[hidden] {
  display: none;
}

.dm-call-stage {
  position: relative;
  height: clamp(260px, 40vh, 520px);
  min-height: 260px;
  display: grid;
  place-items: center;
  margin: var(--space-2);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-surface-raised) 78%, var(--accent) 22%);
  overflow: hidden;
}

.dm-call-panel.expanded .dm-call-stage {
  flex: 1;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  border-radius: 0;
}

.dm-call-expand {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 4;
  color: #fff;
  background: color-mix(in srgb, #080a12 74%, transparent);
  box-shadow: var(--shadow-popover);
}

.dm-call-expand:hover {
  background: color-mix(in srgb, #080a12 90%, transparent);
}

.dm-call-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  font-size: var(--title-md-size);
  font-weight: var(--weight-semibold);
}

.dm-call-identity .avatar {
  width: 88px;
  height: 88px;
}

.dm-call-remote-screen,
.dm-call-remote-camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-sunken);
}

.dm-call-remote-camera {
  object-fit: cover;
}

.dm-call-local-screen,
.dm-call-local-camera {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  width: min(220px, 26%);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
}


.dm-call-local-screen {
  object-fit: contain;
}

.dm-call-footer {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-3);
}

.dm-call-status {
  color: var(--text-secondary);
  font-size: var(--body-md-size);
}

.dm-call-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dm-call-controls .btn-icon {
  border-radius: var(--radius-full);
}

.dm-call-controls .btn-icon.active {
  color: var(--text-on-accent);
  background: var(--accent);
}

.dm-call-controls .dm-call-end {
  color: #fff;
  background: var(--danger);
}

.incoming-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--overlay-scrim);
}

.incoming-call-card {
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  background: var(--bg-surface-raised);
  box-shadow: var(--shadow-modal);
}

.incoming-call-card .avatar {
  width: 88px;
  height: 88px;
}

.incoming-call-card h2,
.incoming-call-card p {
  margin: 0;
  text-align: center;
}

.incoming-call-card p {
  color: var(--text-muted);
}

.incoming-call-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.incoming-call-actions button {
  min-width: 112px;
}

.dm-call-event {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-2) 58px;
  color: var(--text-muted);
  font-size: var(--body-sm-size);
}

.dm-call-event .icon {
  color: var(--accent);
}

.dm-stream {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-3);
}

.dm-stream-content {
  margin-top: auto;
}

.dm-load-older {
  align-self: center;
  margin-bottom: var(--space-3);
}

.dm-start {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-3) var(--space-4);
}

.dm-start .avatar {
  width: 72px;
  height: 72px;
  margin-bottom: var(--space-2);
}

.dm-start h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.dm-start > span {
  color: var(--text-muted);
  font-size: var(--body-sm-size);
}

.dm-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.dm-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.dm-message:hover {
  background: var(--bg-hover);
}

.dm-message-body {
  min-width: 0;
}

.dm-message:hover .note-actions,
.dm-message .note-actions:focus-within {
  opacity: 1;
}

.dm-edited {
  color: var(--text-muted);
  font-size: 10px;
}

.dm-deleted {
  color: var(--text-muted);
  font-style: italic;
}

.dm-search-state {
  flex-shrink: 0;
  margin: 0 var(--space-3) var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--accent-soft);
  font-size: var(--label-md-size);
}

.dm-composer {
  margin: var(--space-1) var(--space-1) 0;
}

.dm-attach {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
}

.dm-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.dm-image-button {
  display: inline-flex;
  width: fit-content;
  max-width: min(520px, 76vw);
  height: auto;
  max-height: 420px;
  aspect-ratio: auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-sunken);
  box-shadow: none;
}

.dm-image-button:hover {
  transform: none;
}

.dm-attachment-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
}

.dm-video-attachment {
  display: inline-block;
  width: fit-content;
  max-width: min(520px, 76vw);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--bg-sunken);
}

.dm-attachment-video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  aspect-ratio: auto;
  object-fit: contain;
  background: #000;
}

.dm-attachment-draft {
  min-height: 72px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 36px;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-1) var(--space-1) 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-sunken);
}

.dm-attachment-draft[hidden] { display: none; }

.dm-attachment-draft:not([hidden]) + .dm-composer {
  margin-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.dm-draft-preview {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.dm-draft-preview img,
.dm-draft-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dm-attachment-draft > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm-attachment-draft strong,
.dm-attachment-draft small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-attachment-draft small { color: var(--text-muted); }

.dm-video-caption {
  display: block;
  overflow: hidden;
  padding: var(--space-2) var(--space-3);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--body-sm-size);
}

.dm-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  background: color-mix(in srgb, #05060c 92%, transparent);
}

.dm-image-lightbox img {
  display: block;
  max-width: min(92vw, 1440px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
}

.dm-image-lightbox-bar {
  width: min(92vw, 1440px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.dm-image-lightbox-name {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-image-lightbox-actions {
  display: flex;
  gap: var(--space-2);
}

.dm-image-lightbox-actions button {
  width: auto;
}

.dm-file-card {
  min-width: min(320px, 65vw);
  max-width: 440px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--bg-sunken);
  text-align: left;
  box-shadow: none;
}

.dm-file-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-active);
  transform: none;
}

.dm-file-card > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dm-file-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-file-card small {
  color: var(--text-muted);
}

.dm-channel > .error {
  min-height: 16px;
  margin: var(--space-1) var(--space-3) 0;
}

.dm-friend-picker {
  min-width: 250px;
  max-height: min(420px, 70vh);
  overflow-y: auto;
}

.dm-picker-message {
  max-width: 250px;
  margin: 0;
  padding: var(--space-3);
  color: var(--text-muted);
  line-height: var(--body-md-line);
}

.app-header-icon .avatar {
  width: 28px;
  height: 28px;
}

@media (max-width: 900px) {
  .dm-message .note-actions { opacity: 1; }
}

.settings-avatar-edit {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-app);
  cursor: pointer;
  flex-shrink: 0;
  background: var(--bg-surface);
}

/* Avatar como seção própria (não mais sobreposto ao banner) — um pouco
   maior, sem a borda pensada pra recortar sobre o banner. */
.settings-avatar-edit-standalone {
  width: 96px;
  height: 96px;
  border: 1px solid var(--border);
}

.settings-image-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.settings-image-remove-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.settings-image-remove-btn .icon {
  width: 14px;
  height: 14px;
}

.settings-avatar-edit img,
.settings-avatar-edit .avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.settings-avatar-edit .settings-image-edit-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 11, 18, 0.45);
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.settings-avatar-edit:hover .settings-image-edit-overlay {
  opacity: 1;
}

.settings-avatar-edit .settings-image-edit-overlay .icon {
  font-size: 20px;
}

/* ---- Linha de campo genérica (rótulo + controle, usada em Voz e
   vídeo/Aparência/Perfil) — mais espaçada que .profile-row (que é
   valor-só-leitura), pensada pra caber um <select>/toggle ao lado. ---- */

.settings-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.settings-field-row:last-of-type {
  border-bottom: none;
}

.settings-field-row .settings-field-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-field-row .settings-field-label .title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.settings-field-row .settings-field-label .desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.settings-field-row select {
  min-width: 220px;
}

.settings-preference-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.settings-preference-list .settings-field-row {
  min-height: 58px;
  padding-inline: var(--space-3);
}

.settings-preference-list .settings-field-row:last-child {
  border-bottom: 0;
}

.settings-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.settings-preview-actions button .icon {
  width: 17px;
  height: 17px;
}

.settings-volume-range {
  width: min(240px, 36vw);
  accent-color: var(--accent);
}

.settings-static-value {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.settings-workspace-status:empty {
  display: none;
}

.settings-feedback-form {
  display: grid;
  gap: 16px;
  max-width: 680px;
  margin-top: 24px;
}

.settings-feedback-form label {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.settings-feedback-form input,
.settings-feedback-form select,
.settings-feedback-form textarea {
  width: 100%;
}

.settings-feedback-form textarea {
  min-height: 150px;
  resize: vertical;
}

.settings-feedback-form button {
  justify-self: start;
}

.report-dialog label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.report-dialog select,
.report-dialog textarea {
  width: 100%;
}

.report-dialog textarea {
  min-height: 110px;
  resize: vertical;
}

/* ---- Toggle (interruptor) — Voz e vídeo (supressão de ruído/eco/AGC). ---- */

button.switch-toggle {
  width: 40px;
  height: 22px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--bg-active);
  position: relative;
  flex-shrink: 0;
}

button.switch-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--text-secondary);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

button.switch-toggle[aria-pressed="true"] {
  background: var(--accent-muted-strong);
}

button.switch-toggle[aria-pressed="true"]::after {
  transform: translateX(18px);
  background: var(--accent);
}

/* ---- Entrada do aplicativo e notificações ---- */

.app-launch-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background: var(--bg-app);
  color: var(--text-primary);
}

.app-launch-splash[hidden] {
  display: none;
}

.app-launch-mark {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
}

.app-launch-mark img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  animation: goklah-launch-pulse 900ms ease-in-out infinite alternate;
}

.app-launch-ring {
  position: absolute;
  inset: 0;
  border: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-right-color: color-mix(in srgb, var(--accent) 68%, #d77bf0 32%);
  border-radius: 50%;
  animation: goklah-launch-spin 900ms linear infinite;
}

.app-launch-splash > strong {
  font-size: 24px;
}

.app-launch-splash > span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

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

@keyframes goklah-launch-pulse {
  from { transform: scale(0.94); }
  to { transform: scale(1); }
}

.notification-toast-region {
  position: fixed;
  top: calc(var(--titlebar-h) + var(--space-4));
  right: var(--space-4);
  z-index: 900;
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

button.notification-toast {
  width: 100%;
  height: auto;
  min-height: 72px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-surface-raised) 96%, transparent);
  box-shadow: var(--shadow-popover);
  color: var(--text-primary);
  text-align: left;
  pointer-events: auto;
  animation: goklah-toast-in 180ms ease-out both;
}

button.notification-toast:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  border-left-color: var(--accent);
}

button.notification-toast.leaving {
  animation: goklah-toast-out 160ms ease-in both;
}

.notification-toast > .icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
}

.notification-toast-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notification-toast-copy strong,
.notification-toast-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-toast-copy span {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.notification-toast-close {
  color: var(--text-muted);
}

.notification-toast-close .icon {
  width: 16px;
  height: 16px;
}

@keyframes goklah-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes goklah-toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

@media (prefers-reduced-motion: reduce) {
  .app-launch-ring,
  .app-launch-mark img,
  button.notification-toast,
  button.notification-toast.leaving {
    animation: none;
  }
}

/* ---- Aparência — cartões de tema ---- */

.theme-options {
  display: flex;
  gap: var(--space-3);
}

button.theme-option {
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  height: auto;
  padding: var(--space-2);
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
}

button.theme-option:hover {
  border-color: var(--text-disabled);
  background: var(--bg-surface);
}

button.theme-option[aria-pressed="true"] {
  border-color: var(--accent);
}

.theme-option-swatch {
  height: 56px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.theme-option-swatch.dark {
  background: linear-gradient(135deg, #0a0b12 0%, #171b28 60%, #6678f4 100%);
}

.theme-option-swatch.light {
  background: linear-gradient(135deg, #f4f5fa 0%, #ffffff 60%, #6678f4 100%);
}

.theme-option-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  text-align: center;
}

/* ---- Sessões ---- */

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.session-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.session-row .session-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-active);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.session-row.current .session-icon {
  background: var(--accent-muted);
  color: var(--accent);
}

.session-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-row-info .title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.session-row-info .meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.session-current-tag {
  font-size: var(--label-sm-size);
  font-weight: var(--weight-semibold);
  color: var(--success);
  background: var(--success-muted);
  border-radius: var(--radius-full);
  padding: 2px var(--space-md);
}
/* Selo oficial: usa o asset fornecido pelo projeto e acompanha o tamanho do
   texto sem dominar nomes pequenos em listas. */
.verified-name {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  min-width: 0;
}

.verified-badge {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  object-fit: contain;
  user-select: none;
}
