/* GG Call — área de conversa e pop-ups flutuantes (mensagens, campo de envio, autocompletar,
   seletor de emojis, cartão de perfil, menus, dicas e avisos). Carregado depois de features.css:
   as regras daqui refinam as de styles.css/features.css para os mesmos seletores. */
:root {
  --msg-hover: rgba(4, 4, 5, 0.07);
  --float-border: rgba(255, 255, 255, 0.06);
  --float-shadow: 0 8px 16px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(0, 0, 0, 0.15);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --mention-fg: #c9cdfb;
  --mention-bg: rgba(88, 101, 242, 0.3);
  --spine: #4f545c;
}
[data-theme='light'] {
  --msg-hover: rgba(6, 6, 7, 0.03);
  --float-border: rgba(0, 0, 0, 0.08);
  --float-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --chip-bg: rgba(0, 0, 0, 0.05);
  --mention-fg: #4752c4;
  --mention-bg: rgba(88, 101, 242, 0.15);
  --spine: #c4c9ce;
}
[data-theme='amoled'] {
  --msg-hover: rgba(255, 255, 255, 0.04);
  --spine: #3a3c41;
}

/* ================================================================ lista de mensagens */
.messages { padding: 0 0 24px; overscroll-behavior: contain; }
.messages > * { flex-shrink: 0; }
.messages > .spinner-wrap { padding: 24px 16px; }
.channel-intro { margin: 16px 16px 8px; padding: 16px 0 0; }
.channel-intro > .avatar, .intro-icon { margin-bottom: 8px; }
.channel-intro h2 { font-size: 2rem; line-height: 1.25; font-weight: 700; margin: 0 0 4px; overflow-wrap: anywhere; }
.channel-intro p { font-size: 1rem; color: var(--text-muted); overflow-wrap: anywhere; }
.intro-icon { width: 68px; height: 68px; }
.messages-empty { padding: 8px 16px; color: var(--text-muted); font-size: 0.875rem; }

.day-divider { position: relative; margin: 24px 16px 8px 16px; height: 0; border-top: 1px solid var(--bg-active); display: flex; justify-content: center; align-items: center; }
.day-divider span { padding: 2px 4px; font-size: 0.75rem; line-height: 13px; font-weight: 600; color: var(--text-muted); background: var(--bg-chat); }
.day-divider.new { border-top-color: var(--red); justify-content: flex-end; margin-top: 16px; }
.day-divider.new span { position: relative; right: -16px; padding: 0 6px 0 4px; height: 14px; line-height: 14px; font-size: 0.625rem; font-weight: 700; color: #fff; background: var(--red); border-radius: 8px 0 0 8px; text-transform: uppercase; letter-spacing: 0.02em; }
.day-divider + .msg { margin-top: 8px; }

/* Mensagem: coluna de 72px para o avatar (40px) e conteúdo. A barra de ações flutua no canto. */
.msg {
  --gutter: 72px;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  padding: 2px 48px 2px 0; margin-top: 17px;
  font-size: 1rem; line-height: 1.375rem;
}
.msg.grouped { margin-top: 0; padding-top: 1px; padding-bottom: 1px; }
.msg:hover, .msg:focus-within, .msg.force-hover, .msg.holding { background: var(--msg-hover); }
.msg.pinned { box-shadow: none; }
.msg.mentioned { background: rgba(250, 168, 26, 0.1); box-shadow: inset 2px 0 0 #faa81a; }
.msg.mentioned:hover, .msg.mentioned:focus-within { background: rgba(250, 168, 26, 0.08); }
[data-theme='light'] .msg.mentioned { background: rgba(250, 168, 26, 0.12); }
.msg-gutter { grid-column: 1; justify-content: center; align-items: flex-start; min-width: 0; }
.msg:not(.grouped) .msg-gutter { padding-top: 2px; }
.avatar-btn { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; }
.avatar-btn:active { transform: translateY(1px); }
.avatar-btn:focus-visible { outline-offset: 2px; border-radius: 50%; }
.msg-time-hover { display: block; width: 100%; padding-right: 4px; text-align: center; font-size: 0.6875rem; line-height: 1.375rem; color: var(--text-muted); white-space: nowrap; user-select: none; }
.msg.force-hover .msg-time-hover, .msg.holding .msg-time-hover { visibility: visible; }
.msg-main { grid-column: 2; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 0; min-width: 0; line-height: 1.375rem; }
.msg-author { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 600; line-height: 1.375rem; color: var(--text-strong); }
.msg-head time { flex: none; margin-left: 0.5rem; font-size: 0.75rem; line-height: 1.375rem; color: var(--text-muted); white-space: nowrap; }
.pin-tag { flex: none; align-self: center; margin-left: 6px; color: var(--text-muted); }
.msg-content { font-size: 1rem; line-height: 1.375rem; color: var(--text); }
.edited { margin-left: 2px; font-size: 0.625rem; line-height: 1; color: var(--text-muted); user-select: none; }

/* Resposta acima da mensagem, ligada ao avatar por uma linha curva. */
.msg-reply {
  position: relative; grid-column: 2; display: flex; align-items: center; gap: 4px;
  min-width: 0; max-width: 100%; height: 18px; margin: 0 0 4px; padding: 0;
  font-size: 0.875rem; line-height: 1.125rem; color: var(--text-muted); text-align: left; white-space: nowrap; overflow: visible;
}
.msg-reply::before {
  content: ''; position: absolute; top: 50%; right: calc(100% + 4px);
  width: calc(var(--gutter) / 2 - 3px); height: 22px;
  border-left: 2px solid var(--spine); border-top: 2px solid var(--spine); border-top-left-radius: 6px;
  pointer-events: none;
}
.msg-reply .avatar { width: 16px !important; height: 16px !important; font-size: 7px !important; }
.msg-reply-author { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; font-weight: 600; opacity: 0.85; }
.msg-reply-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; }
.msg-reply-text .icon { vertical-align: -2px; }
.msg-reply em { font-style: italic; }
.msg-reply:hover .msg-reply-text, .msg-reply:hover .msg-reply-author { color: var(--text-strong); opacity: 1; }
.msg-reply-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-input); color: var(--text-muted); }
.msg-reply.missing { cursor: default; }

/* Menções, links de canal e código. */
.mention { padding: 0 2px; border-radius: 3px; background: var(--mention-bg); color: var(--mention-fg); font-weight: 500; transition: background-color 0.1s ease, color 0.1s ease; }
.mention:hover { background: var(--brand); color: var(--on-brand); }
[data-theme='light'] .mention { background: var(--mention-bg); color: var(--mention-fg); }
[data-theme='light'] .mention:hover { background: var(--brand); color: var(--on-brand); }
.channel-link { display: inline; line-height: inherit; vertical-align: baseline; }
.channel-link:hover { text-decoration: none; }
.code-inline { padding: 0 3px; border-radius: 3px; font-size: 0.85em; line-height: 1.125rem; background: var(--bg-sidebar); border: 1px solid var(--border); }
.code-block { max-width: 90%; margin: 6px 0 2px; padding: 8px 10px; border-radius: 4px; font-size: 0.875rem; line-height: 1.125rem; background: var(--bg-sidebar); border: 1px solid var(--border); }

/* Anexos e prévias de link. */
.attachments, .embeds { gap: 4px; margin-top: 4px; max-width: 100%; }
.attach-image { max-width: min(400px, 100%); border-radius: 8px; }
.attach-image[style*='aspect-ratio'] { max-width: min(100%, 400px); height: auto; }
.attach-video { display: block; border-radius: 8px; }
.attach-file { width: min(432px, 100%); max-width: 100%; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg-sidebar); border: 1px solid var(--border); }
.attach-file.audio { align-items: flex-start; }
.attach-icon { flex: none; display: inline-flex; color: var(--brand-hint); }
[data-theme='light'] .attach-icon { color: var(--brand); }
.attach-info { gap: 0; }
.attach-info a, .attach-info strong { display: block; font-size: 1rem; line-height: 1.375rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-info strong { color: var(--text-strong); }
.attach-info small { font-size: 0.75rem; line-height: 1rem; color: var(--text-muted); }
.attach-info audio { width: 100%; margin-top: 6px; }
.attach-file > .icon-btn { flex: none; color: var(--text-muted); }
.attach-file > .icon-btn:hover { color: var(--text-strong); }

.embed { width: fit-content; max-width: min(432px, 100%); padding: 8px 16px 12px 12px; border-radius: 4px; background: var(--bg-sidebar); border-left: 4px solid var(--bg-active); gap: 16px; }
.embed.has-video { width: min(432px, 100%); gap: 12px; }
.embed-text { gap: 4px; padding-top: 2px; }
.embed-site { font-size: 0.75rem; line-height: 1rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-text .embed-title { display: block; font-size: 1rem; line-height: 1.375rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.embed-text p { font-size: 0.875rem; line-height: 1.125rem; color: var(--text); }
.embed-thumb { width: 80px; height: 80px; margin-top: 4px; border-radius: 4px; }
.embed-video, .embed-frame { border-radius: 4px; }
.play-badge { width: 48px; height: 48px; font-size: 0; background: rgba(0, 0, 0, 0.6); transition: background-color 0.15s ease, transform 0.15s ease; }
.embed-video:hover .play-badge { transform: scale(1.06); }

/* Tópico e reações. */
.thread-link { max-width: min(432px, 100%); min-width: 0; gap: 8px; margin-top: 6px; padding: 6px 12px; border-radius: 4px; font-size: 0.875rem; line-height: 1.125rem; }
.thread-link .icon { flex: none; color: var(--text-muted); }
.thread-link strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.thread-link span { flex: none; color: var(--link); font-weight: 600; white-space: nowrap; }
.thread-link:hover { background: var(--bg-active); }
.reactions { gap: 4px; margin-top: 4px; }
.reaction { height: 24px; gap: 6px; padding: 0 6px; border-radius: 8px; background: var(--chip-bg); border: 1px solid transparent; font-size: 1rem; line-height: 1; }
.reaction .emoji-custom { width: 16px; height: 16px; vertical-align: 0; }
.reaction span { min-width: 9px; font-size: 0.875rem; font-weight: 600; color: var(--text-channel); font-variant-numeric: tabular-nums; }
.reaction:hover { background: var(--bg-active); border-color: var(--grey); }
.reaction.mine { background: rgba(88, 101, 242, 0.15); border-color: var(--brand); }
.reaction.mine span { color: var(--brand-hint); }
[data-theme='light'] .reaction.mine span { color: var(--brand); }
.emoji-custom { width: 1.375em; height: 1.375em; vertical-align: -0.3em; object-fit: contain; }

/* Barra de ações flutuante (aparece ao passar o mouse). */
.msg-tools {
  right: 14px; top: -18px; padding: 0; gap: 0; height: 34px;
  background: var(--bg-chat); border: 1px solid var(--float-border); border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.16); overflow: hidden;
}
[data-theme='light'] .msg-tools { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.1); }
.msg-tools .icon-btn { width: 32px; height: 32px; border-radius: 0; color: var(--text-channel); }
.msg-tools .icon-btn:hover, .msg-tools .icon-btn:focus-visible { background: var(--bg-hover); color: var(--text-strong); }
.msg-tools .icon-btn:focus-visible { outline-offset: -2px; }
.msg.force-hover .msg-tools, .msg.holding .msg-tools { display: flex; animation: none; }
.messages > .msg:first-of-type .msg-tools { top: 0; }

/* Edição no lugar. */
.edit-box { margin: 2px 0; }
.edit-input { display: block; min-height: 44px; max-height: 50vh; padding: 11px 16px; border-radius: 8px; font-size: 1rem; line-height: 1.375rem; color: var(--text-strong); background: var(--bg-input); outline: none; resize: none; }
.edit-box small { display: block; padding: 4px 0 2px; font-size: 0.75rem; color: var(--text-muted); }

/* Modo compacto: avatar 24px e a linha da resposta acompanha. */
.compact .msg { --gutter: 56px; }
.compact .avatar-btn { width: 24px; height: 24px; }

/* ================================================================ campo de envio */
.composer { margin: 0 16px; }
.composer-host { position: relative; height: 0; }
.composer-row {
  position: relative; align-items: flex-start; gap: 0; min-height: 44px;
  padding: 0 6px 0 0; border-radius: 8px; background: var(--bg-input);
}
.composer-row:focus-within { box-shadow: none; }
.composer-row textarea { align-self: stretch; min-height: 44px; max-height: 50vh; padding: 11px 0 11px 16px; font-size: 1rem; line-height: 1.375rem; overflow-y: auto; }
.composer-row .attach + textarea { padding-left: 0; }
.composer-row .icon-btn { width: 40px; height: 44px; border-radius: 4px; margin: 0; background: none; color: var(--text-channel); }
.composer-row .icon-btn:hover { background: none; color: var(--text-strong); }
.composer-row .icon-btn:focus-visible { outline-offset: -6px; }
.composer-row .attach { align-self: flex-start; width: 52px; margin-left: 0; padding-left: 4px; }
.composer-row .send { color: var(--text-channel); }
.composer-row .send:hover { color: var(--brand-hint); }
[data-theme='light'] .composer-row .send:hover { color: var(--brand); }
.composer-row.locked { opacity: 1; }
.composer-row.locked textarea { cursor: not-allowed; }
.composer-row.locked textarea::placeholder { color: var(--text-muted); }
.char-counter { align-self: center; padding: 0 6px; font-size: 0.75rem; font-weight: 600; }

/* "Respondendo a" e anexos pendentes formam um bloco único com o campo. */
.reply-bar {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 16px;
  border-radius: 8px 8px 0 0; background: var(--bg-sidebar); font-size: 0.875rem; color: var(--text-muted);
}
[data-theme='light'] .reply-bar { background: #e3e5e8; }
.reply-bar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar-text strong { color: var(--text-channel); font-weight: 600; }
.reply-bar .icon-btn { width: 24px; height: 24px; border-radius: 50%; color: var(--text-muted); }
.reply-bar .icon-btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.reply-bar:not([hidden]) + .composer-row, .reply-bar:not([hidden]) + .pending-files[hidden] + .composer-row { border-top-left-radius: 0; border-top-right-radius: 0; }
.pending-files { gap: 16px; padding: 16px 16px 12px; background: var(--bg-input); border-radius: 8px 8px 0 0; border-bottom: 1px solid var(--bg-active); }
.reply-bar:not([hidden]) + .pending-files { border-radius: 0; }
.pending-files:not([hidden]) + .composer-row { border-radius: 0 0 8px 8px; }
.pending-file { width: 176px; padding: 8px; gap: 2px; border-radius: 4px; background: var(--bg-sidebar); }
[data-theme='light'] .pending-file { background: #fff; box-shadow: 0 0 0 1px var(--border); }
.pending-thumb { display: flex; align-items: center; justify-content: center; height: 96px; margin-bottom: 6px; border-radius: 3px; overflow: hidden; background: var(--bg-rail); color: var(--brand-hint); }
[data-theme='light'] .pending-thumb { background: var(--bg-input); color: var(--brand); }
.pending-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; background: none; }
.pending-name { font-size: 0.875rem; line-height: 1.125rem; font-weight: 500; color: var(--text-strong); }
.pending-file small { font-size: 0.75rem; line-height: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-bar { margin-top: 4px; }
.pending-remove {
  top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 4px;
  background: var(--bg-float); color: var(--text-channel); box-shadow: var(--float-shadow);
}
.pending-remove:hover { background: var(--bg-float); color: var(--red); }

.typing { height: 24px; padding: 0 16px 0 16px; gap: 6px; font-size: 0.875rem; line-height: 24px; color: var(--text-channel); overflow: hidden; }
.typing-dots { flex: none; }
.typing-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typing-text strong { font-weight: 600; }

.drop-hint { inset: 16px; border-radius: 12px; font-weight: 600; background: rgba(88, 101, 242, 0.85); border: 2px dashed rgba(255, 255, 255, 0.7); }

/* Autocompletar: lista acima do campo, título da seção e item ativo destacado. */
.autocomplete {
  left: 0; right: 0; bottom: 8px; max-height: min(360px, 50vh); padding: 0 0 8px;
  border-radius: 8px; background: var(--bg-float); border: 1px solid var(--float-border); box-shadow: var(--float-shadow);
  overscroll-behavior: contain;
}
.autocomplete-head {
  position: sticky; top: 0; z-index: 1; padding: 12px 16px 4px; margin-bottom: 4px;
  background: var(--bg-float); font-size: 0.75rem; line-height: 1rem; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-muted);
}
.autocomplete-item { gap: 12px; min-height: 36px; margin: 0 8px; padding: 6px 8px; border-radius: 4px; color: var(--text-channel); font-size: 1rem; line-height: 1.25rem; }
.autocomplete-item:hover { background: var(--bg-hover); }
.autocomplete-item.active { background: var(--bg-active); color: var(--text-strong); }
.ac-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: var(--text-muted); }
.ac-icon .emoji-custom { width: 22px; height: 22px; vertical-align: 0; }
.ac-emoji { width: 24px; font-size: 1.25rem; line-height: 24px; text-align: center; }
.ac-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.autocomplete-item .ac-sub { flex: 1 1 auto; min-width: 0; margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; color: var(--text-muted); }

/* ================================================================ seletor de emojis e GIFs */
.picker {
  width: 408px; height: 444px; max-height: calc(100vh - 16px); padding: 0; gap: 0; overflow: hidden;
  border-radius: 8px; background: var(--bg-float); border: 1px solid var(--float-border); box-shadow: var(--float-shadow);
}
.picker-header { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 10px; box-shadow: 0 1px 0 var(--bg-active); z-index: 1; }
.picker-tabs { display: flex; gap: 8px; }
.picker-tab { height: 26px; padding: 0 10px; border-radius: 4px; font-size: 0.875rem; font-weight: 600; color: var(--text-channel); }
.picker-tab:hover { background: var(--bg-hover); color: var(--text-strong); }
.picker-tab.active { background: var(--bg-active); color: var(--text-strong); }
.picker-tabs:has(.picker-tab:only-child) { display: none; }
.picker-search { position: relative; display: flex; align-items: center; color: var(--text-muted); }
.picker-input {
  width: 100%; height: 32px; padding: 0 32px 0 8px; border: 0; border-radius: 4px;
  background: var(--bg-rail); color: var(--text-strong); font-size: 0.9375rem; outline: none;
}
[data-theme='light'] .picker-input { background: var(--bg-input); }
.picker-input:focus-visible { outline: none; }
.picker-input::-webkit-search-cancel-button { display: none; }
.picker-search .icon { position: absolute; right: 8px; pointer-events: none; }
.picker-main { flex: 1; min-height: 0; display: flex; }
.picker-nav { flex: none; width: 48px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; overflow-y: auto; background: var(--bg-sidebar); scrollbar-width: none; }
[data-theme='light'] .picker-nav { background: var(--bg-input); }
.picker-nav::-webkit-scrollbar { display: none; }
.picker-nav-btn { flex: none; width: 32px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); filter: grayscale(1); opacity: 0.7; transition: opacity 0.12s ease, filter 0.12s ease, background-color 0.12s ease; }
.picker-nav-btn:hover, .picker-nav-btn.active { background: var(--bg-hover); color: var(--text-strong); filter: none; opacity: 1; }
.picker-nav-btn img { width: 22px; height: 22px; border-radius: 4px; object-fit: contain; }
.picker-nav-glyph { font-size: 1.25rem; line-height: 1; }
.picker-body { position: relative; flex: 1; min-width: 0; overflow-y: auto; padding: 0 4px 8px 8px; overscroll-behavior: contain; }
.picker-section { padding-bottom: 4px; }
.picker-head {
  position: sticky; top: 0; z-index: 1; margin: 0 -4px 0 -8px; padding: 10px 8px 6px;
  background: var(--bg-float); font-size: 0.75rem; line-height: 1rem; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.emoji-grid-full { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; }
.emoji-btn { width: 100%; aspect-ratio: 1; font-size: 1.75rem; line-height: 1; border-radius: 4px; }
.emoji-btn img { width: 30px; height: 30px; }
.emoji-btn:hover, .emoji-btn:focus-visible { background: var(--bg-active); outline: none; }
.emoji-btn:focus-visible { box-shadow: inset 0 0 0 2px var(--link); }
.picker-body > .empty-state { padding-top: 48px; }
.picker-foot { flex: none; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; background: var(--bg-sidebar); box-shadow: 0 -1px 0 var(--bg-active); min-width: 0; }
[data-theme='light'] .picker-foot { background: var(--bg-input); }
.picker-preview-glyph { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 1.625rem; line-height: 1; }
.picker-preview-glyph img { width: 28px; height: 28px; object-fit: contain; }
.picker-preview-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; font-weight: 600; color: var(--text-strong); }
.picker-foot.idle .picker-preview-glyph { display: none; }
.picker-foot.idle .picker-preview-name { font-weight: 500; color: var(--text-muted); }
.picker.gifs .picker-foot { display: none; }
.picker.gifs .picker-body { padding: 8px 4px 8px 8px; }
.gif-grid { columns: 2; column-gap: 6px; }
.gif-btn { margin-bottom: 6px; border-radius: 6px; break-inside: avoid; }
.gif-btn:hover, .gif-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ================================================================ cartão de perfil */
.user-card {
  width: 300px; overflow-x: hidden; overflow-y: auto; border-radius: 8px;
  background: var(--bg-float); border: 1px solid var(--float-border); box-shadow: var(--float-shadow);
}
.card-banner { height: 60px; opacity: 1; }
.card-avatar { position: relative; margin: -46px 0 0 16px; padding: 6px; border-radius: 50%; background: var(--bg-float); }
.card-avatar .avatar { font-size: 28px !important; }
.card-avatar .status-dot { right: 0; bottom: 0; width: 24px; height: 24px; border: 5px solid var(--bg-float); }
.card-body { padding: 8px 16px 16px; }
.card-name { font-size: 1.25rem; line-height: 1.5rem; font-weight: 700; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-username { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; font-size: 0.875rem; line-height: 1.125rem; color: var(--text-channel); }
.card-handle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-presence { flex: none; color: var(--text-muted); }
.card-presence::before { content: '·'; margin-right: 6px; }
.card-status { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--chip-bg); font-size: 0.875rem; line-height: 1.125rem; color: var(--text); overflow-wrap: anywhere; }
.card-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bg-active); }
.card-section h4 { margin: 0 0 8px; font-size: 0.75rem; line-height: 1rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-strong); }
.card-bio { font-size: 0.875rem; line-height: 1.125rem; color: var(--text); }
.card-activity { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; background: none; min-width: 0; }
.card-activity-icon { flex: none; width: 40px; height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--chip-bg); color: var(--text-strong); }
.card-activity strong { min-width: 0; font-size: 0.875rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-warn { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 8px 10px; border-radius: 4px; background: rgba(250, 168, 26, 0.12); color: #faa81a; font-size: 0.8125rem; font-weight: 600; }
[data-theme='light'] .card-warn { color: #8a6100; }
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.role-chip { max-width: 100%; min-width: 0; height: 22px; gap: 4px; padding: 0 6px; border-radius: 4px; background: var(--chip-bg); font-size: 0.75rem; font-weight: 500; color: var(--text); }
.role-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip i { width: 12px; height: 12px; margin: 0; }
.volume-row { margin-bottom: 4px; gap: 10px; font-size: 0.8125rem; color: var(--text-channel); }
.volume-row span { flex: none; width: 40px; text-align: right; }
.user-card .check { margin: 4px 0 0; font-size: 0.875rem; align-items: center; }
.card-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.card-actions .btn { flex-direction: row; flex: 1 1 auto; min-width: 0; min-height: 32px; height: 32px; padding: 0 12px; white-space: nowrap; }
.card-actions .btn .icon { flex: none; }
.card-actions .icon-btn { flex: none; margin-left: 0; width: 32px; height: 32px; background: var(--chip-bg); }
.card-actions .icon-btn:hover { background: var(--bg-active); }

/* ================================================================ menus */
.menu {
  z-index: 230; min-width: 188px; max-width: 320px; max-height: calc(100vh - 16px); overflow-y: auto;
  padding: 6px 8px; border-radius: 4px; background: var(--bg-float);
  border: 1px solid var(--float-border); box-shadow: var(--float-shadow); outline: none;
  overscroll-behavior: contain;
}
.menu:focus { outline: none; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 32px; margin: 2px 0; padding: 6px 8px; border-radius: 2px;
  font-size: 0.875rem; line-height: 1.125rem; font-weight: 500; color: var(--text-channel); text-align: left;
}
.menu-item .icon { flex: none; width: 18px; height: 18px; }
.menu-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover, .menu-item:focus-visible { background: var(--brand); color: var(--on-brand); outline: none; }
.menu-item.active { color: var(--text-strong); font-weight: 600; }
.menu-item.active:hover, .menu-item.active:focus-visible { color: #fff; }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover, .menu-item.danger:focus-visible { background: var(--red); color: #fff; }
.menu-item .status-dot { width: 10px; height: 10px; margin: 0 4px; }
.menu-item:hover .status-dot, .menu-item:focus-visible .status-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.menu-sep { height: 1px; margin: 4px 4px; background: var(--bg-active); }
.menu.emoji-grid { padding: 6px; }

/* ================================================================ dicas */
.tooltip {
  max-width: 280px; padding: 8px 12px; border-radius: 6px;
  background: var(--bg-float); color: var(--text-strong); border: 1px solid var(--float-border);
  box-shadow: var(--float-shadow); font-size: 0.875rem; line-height: 1.125rem; font-weight: 500;
  overflow-wrap: anywhere;
}
.tooltip::after {
  content: ''; position: absolute; width: 8px; height: 8px; background: inherit;
  border: 1px solid var(--float-border); border-top-color: transparent; border-left-color: transparent;
}
.tooltip[data-side='top']::after { top: 100%; left: var(--arrow, 50%); transform: translate(-50%, -4px) rotate(45deg); }
.tooltip[data-side='bottom']::after { bottom: 100%; left: var(--arrow, 50%); transform: translate(-50%, 4px) rotate(225deg); }
.tooltip[data-side='right']::after { right: 100%; top: var(--arrow, 50%); transform: translate(4px, -50%) rotate(135deg); }

/* ================================================================ avisos */
#toast-root { top: auto; bottom: 92px; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: min(440px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: 8px; border: 1px solid var(--float-border); border-left: 1px solid var(--float-border);
  background: var(--bg-float); color: var(--text-strong); box-shadow: var(--float-shadow);
  font-size: 0.875rem; line-height: 1.125rem; font-weight: 500; pointer-events: auto;
}
.toast .icon { flex: none; color: var(--brand-hint); }
[data-theme='light'] .toast .icon { color: var(--brand); }
.toast.success .icon { color: var(--green); }
.toast.error .icon { color: var(--red); }
.toast-text { min-width: 0; overflow-wrap: anywhere; }

/* ================================================================ avatar e status */
.avatar { line-height: 1; letter-spacing: 0; }
.avatar .status-dot { right: -2px; bottom: -2px; }

/* ================================================================ imagem ampliada */
.modal.lightbox img { max-height: min(72vh, 100%); border-radius: 4px; object-fit: contain; background: repeating-conic-gradient(rgba(127, 127, 127, 0.12) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }

/* ================================================================ janela pequena */
@media (max-width: 1000px) {
  .msg { padding-right: 16px; }
  .msg-tools { right: 8px; }
}
@media (max-height: 600px) {
  .picker { height: min(444px, calc(100vh - 16px)); }
}
.composer-row textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
