/* ==========================================================================
   Cloudky — folha de estilos única
   Tokens (tema escuro/claro, densidade) → base → componentes → login → shell →
   dock → páginas (início, amigos, grupos) → chat → chamada → Watch Together →
   diálogos/configurações → responsivo
   ========================================================================== */

:root {
  color-scheme: dark;
  --canvas: #090d14;
  --sidebar: #0e131d;
  --channel: #111722;
  --surface: #131924;
  --surface-raised: #182130;
  --surface-soft: #1d283a;
  --surface-hover: #1b2534;
  --overlay: #111823;
  --input: #090d14;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f1f5f9;
  --text-soft: #dbe4ee;
  --muted: #94a3b8;
  --muted-dark: #64748b;
  --mint: #4ee0b5;
  --mint-strong: #38cfa4;
  --mint-ink: #07221c;
  --mint-dim: rgba(78, 224, 181, 0.12);
  --mint-glow: rgba(78, 224, 181, 0.28);
  --danger: #f87171;
  --danger-strong: #ef4444;
  --danger-soft: #fca5a5;
  --danger-dim: rgba(248, 113, 113, 0.14);
  --warn: #fbbf24;
  --warn-dim: rgba(251, 191, 36, 0.14);
  --idle: #f5b83d;
  --dnd: #f05454;
  --offline: #6b7686;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
  --scrim: rgba(3, 7, 12, 0.76);
  --player-bg: #000;
  --tile-surface: #0f1621;
  --tile-surface-top: #172131;
  --tile-border: rgba(255, 255, 255, 0.07);
  --tile-text: #f1f5f9;
  --tile-avatar-text: #ffffff;
  --tile-badge-bg: rgba(8, 12, 18, 0.66);
  --tile-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-display: Manrope, "DM Sans", system-ui, sans-serif;
  /* densidade do chat */
  --msg-avatar: 38px;
  --msg-gap: 6px;
  --msg-pad: 6px;
  --msg-font: 13.5px;
  font-family: "DM Sans", Inter, system-ui, -apple-system, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #f4f6fa;
  --sidebar: #eceff5;
  --channel: #e9edf3;
  --surface: #ffffff;
  --surface-raised: #f1f4f8;
  --surface-soft: #e4e9f0;
  --surface-hover: #eef2f7;
  --overlay: #ffffff;
  --input: #f7f9fc;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-soft: #1e293b;
  --muted: #526073;
  --muted-dark: #7a8698;
  --mint: #0e9f78;
  --mint-strong: #0b8a68;
  --mint-ink: #ffffff;
  --mint-dim: rgba(14, 159, 120, 0.11);
  --mint-glow: rgba(14, 159, 120, 0.22);
  --danger: #dc2626;
  --danger-strong: #dc2626;
  --danger-soft: #b91c1c;
  --danger-dim: rgba(220, 38, 38, 0.1);
  --warn: #b7791f;
  --warn-dim: rgba(217, 119, 6, 0.12);
  --idle: #d39213;
  --dnd: #dc2626;
  --offline: #94a3b8;
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.14);
  --scrim: rgba(15, 23, 42, 0.45);
  --tile-surface: #ffffff;
  --tile-surface-top: #f6f8fc;
  --tile-border: rgba(15, 23, 42, 0.09);
  --tile-text: #0f172a;
  --tile-avatar-text: #ffffff;
  --tile-badge-bg: rgba(255, 255, 255, 0.82);
  --tile-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

:root[data-density="compact"] {
  --msg-avatar: 28px;
  --msg-gap: 2px;
  --msg-pad: 3px;
  --msg-font: 13px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--canvas); color: var(--text); overflow: hidden; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
button:disabled { opacity: 0.42; cursor: not-allowed !important; }
a { color: inherit; text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- marca e tipografia ---- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.04em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(135deg, #74ecc9, #4ab7d8); color: #071618; font-size: 19px; font-weight: 800; box-shadow: 0 4px 14px var(--mint-glow); }
.brand-dot { color: var(--mint); }
.eyebrow, .section-label, .settings-label { color: var(--mint); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.settings-label { color: var(--muted); }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--surface-raised); color: var(--muted); font-size: 11px; font-weight: 700; vertical-align: middle; }

/* ---- botões ---- */
.button-primary, .button-secondary, .button-danger {
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ease);
}
.button-primary { background: var(--mint); color: var(--mint-ink); border: 0; }
.button-primary:hover:not(:disabled) { background: var(--mint-strong); box-shadow: 0 4px 14px var(--mint-glow); }
.button-primary:active:not(:disabled) { transform: translateY(1px); }
.button-secondary { background: transparent; border: 1px solid var(--line-strong); color: var(--text); }
.button-secondary:hover:not(:disabled) { background: var(--surface-raised); }
.button-danger { background: var(--danger-dim); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger-soft); }
.button-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 22%, transparent); }
.button-primary.small, .button-secondary.small, .button-danger.small { min-height: 30px; padding: 0 10px; font-size: 11px; }
label.button-secondary { cursor: pointer; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 6px 4px; border-radius: var(--radius-sm); text-align: left; transition: color 0.15s ease, background 0.15s ease; }
.text-button:hover:not(:disabled) { color: var(--mint); background: var(--surface-hover); }
.danger-link { color: var(--danger) !important; }
.icon-button {
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center;
  background: transparent; color: var(--muted); transition: all 0.15s ease; font-size: 14px; line-height: 1;
}
.icon-button:hover:not(:disabled) { background: var(--surface-raised); color: var(--text); border-color: var(--line-strong); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.small { width: 30px; height: 30px; border-radius: 7px; }
.icon-button.tiny { width: 26px; height: 26px; border-radius: 6px; font-size: 12px; }
.icon-button.danger { color: var(--danger); }
.icon-button.danger:hover:not(:disabled) { background: var(--danger-dim); color: var(--danger-soft); }
.icon-button.danger svg { fill: currentColor; stroke: none; }
.icon-button[aria-pressed="true"] { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 40%, transparent); }
.icon-button.off { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-dim); }

/* ---- formulários ---- */
.input-group { display: grid; gap: 5px; }
.input-group label { font-size: 11px; color: var(--muted); }
.input-group input, .wt-add input, .add-friend-form input {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--input); color: var(--text); font-size: 13px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-group input:focus, .wt-add input:focus, .add-friend-form input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.input-group input:disabled { opacity: 0.6; }
.toggle { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 34px; height: 20px; flex: 0 0 34px; border-radius: 20px; background: var(--surface-soft); border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background 0.2s ease; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 0.2s var(--ease), background 0.2s ease; }
.toggle input:checked { background: var(--mint-dim); border-color: color-mix(in srgb, var(--mint) 60%, transparent); }
.toggle input:checked::after { transform: translateX(14px); background: var(--mint); }
.toggle input:disabled { opacity: 0.4; cursor: not-allowed; }
.toggle.row { justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.toggle.row:last-child { border-bottom: 0; }
.toggle.row > span { display: grid; gap: 2px; min-width: 0; }
.toggle.row b { color: var(--text); font-size: 13px; font-weight: 600; }
.toggle.row small { color: var(--muted); font-size: 11.5px; }
.toggle.row.sub { padding-left: 30px; }
input[type="range"] {
  --progress: 50%;
  appearance: none; width: 100%; min-width: 0; height: 4px; border-radius: 4px; cursor: pointer;
  background: linear-gradient(to right, var(--mint) 0 var(--progress), var(--line-strong) var(--progress) 100%);
}
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); transition: transform 0.12s ease; }
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }
input[type="range"]:disabled { opacity: 0.4; cursor: not-allowed; }
.slider-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; align-items: center; gap: 6px 10px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.slider-row > span { grid-column: 1 / -1; }
.slider-row output { font-variant-numeric: tabular-nums; color: var(--text); text-align: right; font-size: 11px; white-space: nowrap; }
.select-row { display: grid; gap: 5px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.select-row select { width: 100%; min-width: 0; max-width: 100%; height: 34px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--input); color: var(--text); font-size: 12px; text-overflow: ellipsis; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--mint); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 var(--mint-glow); } 100% { box-shadow: 0 0 0 8px rgba(78, 224, 181, 0); } }

/* ---- status (bolinha) ---- */
.avatar-wrap { position: relative; display: inline-grid; flex-shrink: 0; }
.status-dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--sidebar); background: var(--offline); }
.status-dot[data-status="online"] { background: var(--mint); }
.status-dot[data-status="idle"] { background: var(--idle); }
.status-dot[data-status="dnd"] { background: var(--dnd); }
.status-dot[data-status="invisible"], .status-dot[data-status="offline"] { background: var(--offline); }
.status-option .status-dot, .person-status .status-dot { position: static; border-color: transparent; }

/* ---- toasts ---- */
.toast-region { position: fixed; z-index: 3000; right: 18px; bottom: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; max-width: min(420px, calc(100vw - 36px)); }
.toast { pointer-events: none; padding: 10px 14px; border-radius: 10px; font-size: 12px; line-height: 1.45; background: var(--overlay); color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--shadow-md); opacity: 0; transform: translateY(8px) scale(0.98); transition: opacity 0.22s ease, transform 0.22s var(--ease); }
.toast.visible { opacity: 1; transform: none; }
.toast-success { border-color: color-mix(in srgb, var(--mint) 45%, transparent); }
.toast-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.toast-error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger-soft); }

/* ==========================================================================
   AUTENTICAÇÃO
   ========================================================================== */
.auth-restore-view { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 13px; }
.auth-restore-view .brand-mark { width: 42px; height: 42px; border-radius: 13px; font: 800 21px var(--font-display); }
.auth-restore-view > b { font: 800 19px var(--font-display); letter-spacing: -0.04em; }
.auth-restore-view p { color: var(--muted); font-size: 12px; }
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.8fr); position: relative; overflow: hidden; background: radial-gradient(circle at 10% 20%, color-mix(in srgb, var(--mint) 14%, transparent) 0%, transparent 40%), radial-gradient(circle at 90% 80%, rgba(59, 90, 160, 0.25) 0%, transparent 45%), var(--canvas); }
.login-copy { display: flex; flex-direction: column; justify-content: space-between; padding: 48px clamp(36px, 6vw, 96px); position: relative; z-index: 1; }
.login-message { max-width: 540px; margin: 10vh 0; }
.login-message h1 { font-family: var(--font-display); font-size: clamp(48px, 5.5vw, 76px); line-height: 1.05; letter-spacing: -0.05em; margin: 16px 0 20px; font-weight: 800; }
.login-message h1 span { color: var(--mint); }
.login-message p { color: var(--muted); font-size: 16px; line-height: 1.6; }
.privacy-line { display: flex; align-items: center; gap: 14px; margin-top: 40px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.privacy-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--mint-dim); color: var(--mint); font-size: 18px; }
.privacy-line b { display: block; font-size: 13px; }
.privacy-line small { color: var(--muted-dark); font-size: 12px; }
.login-footer { color: var(--muted-dark); font-size: 12px; }
.login-panel-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; position: relative; z-index: 2; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--sidebar) 70%, transparent); backdrop-filter: blur(24px); }
.login-card { width: min(100%, 400px); padding: 36px 32px; border-radius: var(--radius-lg); border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-lg); animation: fade-up 0.4s var(--ease); }
.login-card-top { display: flex; align-items: center; justify-content: space-between; }
.secure-chip { font-size: 11px; font-weight: 600; color: var(--mint); background: var(--mint-dim); padding: 4px 10px; border-radius: 20px; display: flex; align-items: center; gap: 6px; }
.secure-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.login-card h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin: 20px 0 6px; letter-spacing: -0.03em; }
.login-subtitle { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.google-button { width: 100%; height: 48px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: #fff; color: #111827; display: flex; align-items: center; padding: 0 16px; font-size: 14px; font-weight: 600; transition: all 0.15s ease; }
.google-button:hover:not(:disabled) { background: #f1f5f9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); }
.google-button svg { width: 20px; height: 20px; }
.google-button span:first-of-type { flex: 1; text-align: center; }
.button-arrow { color: #64748b; font-size: 16px; }
.auth-message { min-height: 20px; margin: 12px 0 6px; text-align: center; color: var(--muted); font-size: 12px; }
.auth-message.error { color: var(--danger); }
.login-separator { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; }
.login-separator span { height: 1px; flex: 1; background: var(--line); }
.login-separator small { font-size: 9px; letter-spacing: 0.12em; color: var(--muted-dark); }
.login-assurance { display: flex; gap: 10px; padding: 12px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: 11px; line-height: 1.5; }
.setup-note { margin-top: 14px; padding: 10px 12px; border: 1px solid #7c2d12; background: #431407; color: #fed7aa; font-size: 11px; border-radius: var(--radius-sm); }
.legal-note { color: var(--muted-dark); font-size: 11px; margin-top: 16px; }
.login-art { position: absolute; inset: 0 auto 0 0; width: 55%; pointer-events: none; }
.art-orbit { position: absolute; border: 1px solid color-mix(in srgb, var(--mint) 12%, transparent); border-radius: 50%; }
.orbit-one { width: 600px; height: 300px; left: 5%; top: 25%; transform: rotate(-20deg); }
.orbit-two { width: 480px; height: 220px; left: 12%; top: 32%; transform: rotate(25deg); }
.art-glow { position: absolute; width: 320px; height: 320px; left: 30%; top: 30%; border-radius: 50%; background: radial-gradient(circle, var(--mint-dim) 0%, transparent 70%); filter: blur(40px); }
.art-note { position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); }
.art-note b { font-size: 12px; display: block; }
.art-note small { font-size: 10px; color: var(--muted); }
.note-one { left: 16%; top: 38%; transform: rotate(-4deg); }
.note-two { left: 26%; top: 60%; transform: rotate(3deg); }
.note-avatar { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--mint); color: var(--mint-ink); font-weight: 700; animation: pulse-ring 1.6s ease-out infinite; }
.sound-bars { display: flex; align-items: center; gap: 3px; height: 18px; margin-left: 6px; }
.sound-bars b { width: 3px; background: var(--mint); border-radius: 2px; height: 8px; animation: bars 0.9s ease-in-out infinite alternate; }
.sound-bars b:nth-child(2) { animation-delay: 0.15s; }
.sound-bars b:nth-child(3) { animation-delay: 0.3s; }
.sound-bars b:nth-child(4) { animation-delay: 0.45s; }
@keyframes bars { from { height: 5px; } to { height: 18px; } }
.play-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--mint-dim); color: var(--mint); font-size: 11px; }
.live-dot { width: 8px; height: 8px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 10px var(--mint); }

/* ==========================================================================
   SHELL — três modos:
   dm    = barra principal + lista de DMs + conteúdo (Mensagens/Amigos, conversa direta, chamada da DM)
   group = barra de canais + conteúdo         (dentro de um grupo)
   ========================================================================== */
.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 252px minmax(0, 1fr); background: var(--canvas); overflow: hidden; }
.app-shell[data-mode="dm"] { grid-template-columns: 252px 272px minmax(0, 1fr); }
.app-shell[data-mode="group"] { grid-template-columns: 252px minmax(0, 1fr); }
.app-shell[data-mode="group"] > .sidebar { display: none; }
.app-shell > .user-dock { display: none; }

.sidebar { min-height: 0; height: 100%; background: var(--sidebar); border-right: 1px solid var(--line); padding: 18px 12px 10px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.sidebar-brand-row { padding: 0 6px 4px; }
.sidebar-spacer { flex: 1; min-height: 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { height: 38px; border: 0; background: transparent; border-radius: var(--radius-sm); padding: 0 10px; color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 10px; transition: all 0.15s ease; text-align: left; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--surface-raised); color: var(--mint); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; font-size: 15px; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger-strong); color: #fff; font-size: 10px; font-weight: 700; display: inline-grid; place-items: center; }
.sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 0; font-size: 10px; font-weight: 700; color: var(--muted-dark); letter-spacing: 0.1em; }
.sidebar-add-button, .category-add { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 15px; }
.sidebar-add-button:hover, .category-add:hover { border-color: var(--line); background: var(--surface); color: var(--mint); }
.recent-list { display: flex; flex-direction: column; gap: 2px; min-height: 36px; overflow-y: auto; }
.recent-empty { padding: 8px 6px; color: var(--muted-dark); font-size: 11px; }
.recent-room { width: 100%; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; text-align: left; transition: background 0.15s ease; }
.recent-room:hover, .recent-room.active { background: var(--surface); border-color: var(--line); }
.recent-room-avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--mint-dim); color: var(--mint); font-size: 12px; font-weight: 700; }
.recent-room-copy { min-width: 0; flex: 1; }
.recent-room b, .recent-room small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-room b { font-size: 12.5px; font-weight: 600; }
.recent-room small { font-size: 10.5px; color: var(--muted); }
.recent-room.unread b { color: var(--text); font-weight: 800; }
.unread-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--text); margin-left: auto; }
.join-group-link { min-height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-size: 11.5px; }
.join-group-link:hover { border-color: var(--line); background: var(--surface); color: var(--text); }
.quick-search-button { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--input); color: var(--muted-dark); font-size: 12px; text-align: left; transition: border-color 0.15s ease, color 0.15s ease; }
.quick-search-button:hover { border-color: var(--line-strong); color: var(--text-soft); }
.quick-search-button svg { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.quick-search-button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-search-button kbd, .palette-hint kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-raised); color: var(--muted); font: 600 10px/1.6 var(--font-display); }
.dm-quick-search { margin: 0 0 4px; }
.avatar img, .user-card-avatar img, .recent-room-avatar img, .channel-server-icon img, .voice-member-avatar img,
.voice-participant-avatar img, .person-avatar img, .group-photo-preview img, .message-avatar img, .tile-avatar img, .wt-viewer-avatar img,
.bubble img, .profile-photo-preview img, .dm-row-avatar img, .chat-heading-avatar-img img, .member-avatar img, .picker-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ---- lista de DMs ---- */
.dm-sidebar { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--channel); overflow: hidden; }
.dm-sidebar-top { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.dm-nav-entry { width: 100%; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; }
.dm-nav-entry:hover { background: var(--surface-hover); color: var(--text); }
.dm-nav-entry.active { background: var(--surface-raised); color: var(--text); }
.dm-nav-icon { width: 20px; text-align: center; }
.dm-heading { padding-top: 4px; }
.dm-list, .dm-request-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.dm-list { flex: 1; min-height: 0; }
.dm-request-list { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.dm-request-list > span { padding: 4px 8px; color: var(--warn); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.dm-row { width: 100%; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; color: var(--muted); }
.dm-row:hover { background: var(--surface-hover); color: var(--text); }
.dm-row.active { background: var(--surface-raised); color: var(--text); }
.dm-row.unread { color: var(--text); }
.dm-row.unread b { font-weight: 800; }
.dm-row-avatar { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); color: var(--mint); font-weight: 700; font-size: 12px; }
.dm-row .status-dot { border-color: var(--channel); }
.dm-row-copy { min-width: 0; flex: 1; }
.dm-row-copy b, .dm-row-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-row-copy b { font-size: 13px; font-weight: 600; }
.dm-row-copy small { font-size: 10.5px; color: var(--muted-dark); }
.dm-empty { padding: 12px 8px; color: var(--muted-dark); font-size: 11.5px; line-height: 1.5; }

/* ---- barra de canais ---- */
.channel-sidebar { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; padding: 12px 8px 10px; border-right: 1px solid var(--line); background: var(--channel); overflow: hidden; }
.channel-sidebar-top { padding: 0 4px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.channel-back-button { width: 100%; min-height: 28px; display: flex; align-items: center; gap: 7px; margin-bottom: 10px; border: 0; background: transparent; color: var(--muted); text-align: left; font-size: 11px; }
.channel-back-button:hover { color: var(--text); }
.channel-back-button span { font-size: 20px; line-height: 1; }
.channel-server-title { min-width: 0; display: flex; align-items: center; gap: 9px; }
.channel-server-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: linear-gradient(135deg, #49dbb2, #3b82f6); color: #081a1c; font-size: 13px; font-weight: 800; }
.channel-server-name { min-width: 0; flex: 1; overflow: hidden; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.channel-server-name:hover { color: var(--mint); }
.channel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
.channel-category { display: flex; align-items: center; justify-content: space-between; padding: 14px 6px 4px 8px; color: var(--muted-dark); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.channel-list { display: flex; flex-direction: column; gap: 1px; }
.channel-entry-row { position: relative; display: flex; align-items: center; border-radius: 7px; }
.channel-entry { flex: 1; min-width: 0; min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 30px 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; font-size: 13.5px; transition: background 0.12s ease, color 0.12s ease; }
.channel-entry > .channel-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-entry:hover { background: var(--surface-hover); color: var(--text); }
.channel-entry.active { background: var(--surface-raised); color: var(--text); font-weight: 600; }
.channel-entry.unread { color: var(--text); font-weight: 700; }
.channel-entry.unread::before { content: ""; position: absolute; left: -8px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text); }
.channel-glyph { width: 18px; color: var(--muted-dark); font-size: 15px; text-align: center; }
.channel-entry.active .channel-glyph { color: var(--mint); }
.channel-count { padding: 1px 7px; border-radius: 10px; background: var(--mint-dim); color: var(--mint); font-size: 10px; font-weight: 700; }
.channel-edit { position: absolute; right: 4px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; opacity: 0; transition: opacity 0.12s ease; }
.channel-entry-row:hover .channel-edit, .channel-edit:focus-visible { opacity: 1; }
.channel-edit:hover { background: var(--surface-soft); color: var(--text); }
.voice-member-list { list-style: none; display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 30px; }
.voice-member { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 6px; border-radius: 6px; color: var(--muted); font-size: 12px; }
.voice-member:hover { background: var(--surface-hover); color: var(--text); }
.voice-member.reconnecting { opacity: 0.45; }
.voice-member-avatar { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface-soft); font-size: 10px; box-shadow: 0 0 0 2px transparent; transition: box-shadow 0.12s ease; }
.voice-member.speaking .voice-member-avatar { box-shadow: 0 0 0 2px var(--mint); }
.voice-member.speaking .voice-member-name { color: var(--text); }
.voice-member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-member-icons { display: flex; gap: 3px; color: var(--danger); }
.voice-member-icons svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.live-tag { padding: 1px 5px; border-radius: 4px; background: var(--danger-strong); color: #fff; font-size: 8px; font-weight: 800; letter-spacing: 0.04em; }

/* ==========================================================================
   DOCK DO USUÁRIO (sempre no canto inferior esquerdo)
   ========================================================================== */
.dock-slot { flex: 0 0 auto; }
.dock-slot > .user-dock { display: flex; }
.user-dock { flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.voice-connected { display: flex; align-items: center; gap: 4px; padding: 7px 6px 7px 10px; border: 1px solid color-mix(in srgb, var(--mint) 25%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--mint) 7%, transparent); animation: fade-up 0.25s var(--ease); }
.voice-connected-info { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.voice-connected-status { display: flex; align-items: center; gap: 6px; color: var(--mint); font-size: 12.5px; font-weight: 700; }
.voice-connected-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.voice-connected-info:hover .voice-connected-status span { text-decoration: underline; }
.voice-connected.warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-dim); }
.voice-connected.warn .voice-connected-status { color: var(--warn); }
.voice-connected.warn .voice-connected-status i { background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: pulse-ring 1.2s infinite; }
.voice-connected small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card { display: flex; align-items: center; gap: 2px; }
.user-card-identity { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 5px 6px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.user-card-identity:hover { background: var(--surface-hover); }
.user-card-avatar { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(135deg, #4ce0b5, #3b82f6); color: #0b1a20; font-weight: 700; font-size: 12px; }
.sidebar .status-dot { border-color: var(--sidebar); }
.channel-sidebar .status-dot { border-color: var(--channel); }
.user-card-copy { min-width: 0; }
.user-card-copy b, .user-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-copy b { font-size: 12.5px; }
.user-card-copy small { color: var(--muted-dark); font-size: 10.5px; }
.user-card .icon-button { border-color: transparent; }

/* ---- área principal ---- */
.main-area { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; padding: 0 22px; }
.mobile-sidebar-button { display: none; }
/* Conexão: invisível quando conectado; aviso discreto no topo quando cai ou reconecta. */
.connection-banner { position: fixed; z-index: 2600; top: 10px; left: 50%; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--glass-border, var(--line)); border-radius: 20px; background: var(--glass-strong, var(--surface)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-md); color: var(--text-soft); font-size: 11.5px; font-weight: 600; white-space: nowrap; transform: translateX(-50%); transition: opacity 0.2s ease, transform 0.2s var(--ease); }
.connection-banner[data-state="connected"] { opacity: 0; transform: translate(-50%, -12px); pointer-events: none; }
.connection-banner i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); animation: pulse-ring 1.2s infinite; }
.connection-banner i.connected { background: var(--mint); animation: none; }
.connection-banner i.error { background: var(--danger); animation: none; }
.connection-banner[data-state="error"] { color: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

/* ==========================================================================
   PÁGINAS
   ========================================================================== */
.page { flex: 1; min-height: 0; overflow-y: auto; animation: fade-up 0.25s var(--ease); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-heading h2 { font-family: var(--font-display); font-size: 16px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }

/* Início */

/* Lista de pessoas (amigos, pedidos, bloqueados) */
.person-list { display: flex; flex-direction: column; }
.person-row { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 8px 10px; border-top: 1px solid var(--line); border-radius: 10px; transition: background 0.12s ease; }
.person-row:hover { background: var(--surface-hover); border-top-color: transparent; }
.person-row:hover + .person-row { border-top-color: transparent; }
.person-avatar { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); color: var(--mint); font-weight: 800; }
.person-row .status-dot { border-color: var(--canvas); }
.person-row:hover .status-dot { border-color: var(--surface-hover); }
.person-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.person-copy b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-copy b .tag { color: var(--muted-dark); font-weight: 500; }
.person-copy small { color: var(--muted); font-size: 11.5px; }
.person-actions { display: flex; gap: 6px; }
.person-actions .icon-button { border-radius: 50%; width: 36px; height: 36px; background: var(--surface-raised); border-color: transparent; }
.person-actions .icon-button.accept:hover { color: var(--mint); }
.person-actions .icon-button.reject:hover { color: var(--danger); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: 14px; text-align: center; color: var(--muted); }
.empty-state > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: var(--mint-dim); color: var(--mint); font-size: 22px; }
.empty-state b { color: var(--text); font-size: 14px; }
.empty-state small { max-width: 340px; font-size: 12px; line-height: 1.5; }

/* Amigos */
.friends-view { display: flex; flex-direction: column; overflow: hidden; }
.friends-header { display: flex; align-items: center; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; flex-shrink: 0; }
.friends-title { display: flex; align-items: center; gap: 9px; padding-right: 16px; border-right: 1px solid var(--line); }
.friends-title h1 { font-family: var(--font-display); font-size: 16px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover { background: var(--surface-hover); color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--surface-raised); color: var(--text); }
.tabs .tab-accent { background: var(--mint); color: var(--mint-ink); }
.tabs .tab-accent:hover { background: var(--mint-strong); color: var(--mint-ink); }
.tabs .tab-accent[aria-selected="true"] { background: transparent; color: var(--mint); box-shadow: inset 0 0 0 1px var(--mint); }
.tabs .nav-badge { margin-left: 2px; }
.friends-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 0 24px; width: 100%; }
.friends-toolbar { position: sticky; top: -16px; z-index: 2; display: flex; align-items: center; gap: 14px; margin: -16px 0 10px; padding: 16px 0 10px; background: var(--canvas); }
.friends-filter { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input); color: var(--muted); }
.friends-filter:focus-within { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.friends-filter svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.friends-filter input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 13px; box-shadow: none !important; }
.friends-filter input:focus { outline: none; }
.friends-list-head { flex-shrink: 0; padding: 0 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; }
/* A lista ocupa toda a largura: cartões distribuídos em colunas que se ajustam à tela. */
.friends-body .person-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.friends-body .person-row { width: 100%; }
.friends-body .person-row { border: 1px solid var(--line); background: var(--surface); padding: 10px 12px; min-height: 66px; }
.friends-body .person-row:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.friends-body .person-row .status-dot { border-color: var(--surface); }
.friends-body .empty-state { grid-column: 1 / -1; }
.add-friend { padding: 4px 0 22px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.add-friend h2 { font-family: var(--font-display); font-size: 16px; }
.add-friend > p { margin: 6px 0 14px; color: var(--muted); font-size: 12.5px; }
.add-friend-form { display: flex; gap: 8px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--input); max-width: 640px; }
.add-friend-form:focus-within { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.add-friend-form input { border: 0; background: transparent; box-shadow: none !important; }
.my-code-card { display: inline-flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.my-code-card span { color: var(--muted); font-size: 12px; }
.my-code-card b { font-size: 14px; font-family: var(--font-display); }

/* Grupos */
.dialog-feedback.error, .wt-feedback.error { color: var(--danger); }

.server-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; }
.server-welcome-mark { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 17px; background: var(--mint-dim); color: var(--mint); font-size: 22px; }
.server-welcome h1 { margin-top: 9px; font-family: var(--font-display); font-size: clamp(22px, 2.5vw, 31px); letter-spacing: -0.04em; }
.server-welcome h1 span { color: var(--mint); }
.server-welcome > p { max-width: 420px; margin-top: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.welcome-channel-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.channel-shortcut { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 12.5px; }
.channel-shortcut span { color: var(--mint); }
.channel-shortcut:hover { border-color: color-mix(in srgb, var(--mint) 45%, transparent); }

.voice-lobby { display: flex; align-items: center; justify-content: center; padding: 28px; background: radial-gradient(ellipse at 50% 48%, rgba(54, 71, 162, 0.2), transparent 58%); text-align: center; }
.voice-lobby-card { width: min(480px, 100%); display: flex; flex-direction: column; align-items: center; }
.voice-lobby-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); font-size: 26px; }
.voice-lobby-card h1 { margin-top: 8px; font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.05em; }
.voice-lobby-card > p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.voice-lobby-participants { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.voice-lobby-participant { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); font-size: 12px; animation: fade-up 0.25s var(--ease); }
.voice-lobby-participant.reconnecting { opacity: 0.5; }
.voice-participant-avatar { width: 28px; height: 28px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); font-size: 11px; }
.voice-lobby-watching { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 10px 14px 10px 10px; border: 1px solid color-mix(in srgb, var(--mint) 25%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--mint) 6%, transparent); text-align: left; max-width: 100%; }
.voice-lobby-watching img, .lobby-watch-icon { width: 80px; height: 45px; flex: 0 0 80px; border-radius: 6px; object-fit: cover; background: #000; display: grid; place-items: center; color: var(--mint); }
.voice-lobby-watching small { display: block; color: var(--mint); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; }
.voice-lobby-watching b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.voice-lobby-options { margin-top: 22px; }
.voice-lobby-join { min-height: 44px; margin-top: 14px; padding: 0 26px; font-size: 13px; }
.voice-lobby-card > small { max-width: 360px; margin-top: 12px; color: var(--muted-dark); font-size: 11px; line-height: 1.5; }

/* ==========================================================================
   WORKSPACE (chat + chamada)
   ========================================================================== */
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); position: relative; }
.workspace[data-mode="text"] .call-panel, .workspace[data-mode="dm"] .call-panel { display: none; }
.workspace[data-mode="call"] { grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; padding: 14px 0 16px; }
.workspace[data-mode="call"].chat-hidden { grid-template-columns: minmax(0, 1fr); }
.workspace[data-mode="call"].chat-hidden .chat-panel { display: none; }

/* ---- chat ---- */
.chat-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.workspace[data-mode="call"] .chat-panel { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.chat-header { display: flex; align-items: center; gap: 11px; min-height: 60px; flex-shrink: 0; border-bottom: 1px solid var(--line); padding: 10px 4px 8px; }
.workspace[data-mode="call"] .chat-header { min-height: 0; }
.chat-heading-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 21px; font-weight: 600; }
.chat-heading-avatar-img { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); color: var(--mint); font-weight: 700; }
.chat-heading-avatar .status-dot { border-color: var(--canvas); }
.chat-heading-copy { flex: 1; min-width: 0; }
/* Ícone + nome da conversa: clicar abre/fecha o painel de detalhes (arquivos e mídia). */
.chat-heading-button { display: flex; align-items: center; gap: 11px; flex: 0 1 auto; min-width: 0; margin-right: auto; padding: 4px 10px 4px 4px; border-radius: 10px; cursor: pointer; transition: background var(--motion, 0.15s) ease; }
.chat-heading-button:hover, .chat-heading-button[aria-expanded="true"] { background: var(--surface-hover); }
.chat-heading-button:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
button.channel-server-icon { padding: 0; border: 0; cursor: pointer; transition: box-shadow var(--motion, 0.15s) ease; }
button.channel-server-icon:hover, button.channel-server-icon:focus-visible { box-shadow: 0 0 0 2px var(--mint-glow); outline: none; }
.chat-heading-copy h2 { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-tools { display: flex; align-items: center; gap: 8px; }
.online-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.online-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.workspace[data-mode="call"] .online-pill, .workspace[data-mode="dm"] .online-pill { display: none; }
.dm-banner { display: flex; align-items: center; gap: 12px; margin: 10px 4px 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: 12px; background: var(--warn-dim); animation: fade-up 0.2s var(--ease); }
.dm-banner.info { border-color: var(--line-strong); background: var(--surface-raised); }
.dm-banner.danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-dim); }
.dm-banner-icon { font-size: 20px; }
.dm-banner-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dm-banner-copy b { font-size: 13px; }
.dm-banner-copy small { color: var(--muted); font-size: 12px; }
.dm-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 10px 2px 8px; }
.chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; }
.empty-chat-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-raised); display: grid; place-items: center; font-size: 19px; }
.chat-empty b { font-size: 14px; }
.chat-empty small { color: var(--muted); font-size: 12px; max-width: 260px; line-height: 1.45; }
.day-divider { display: flex; align-items: center; gap: 10px; margin: 14px 8px 6px; color: var(--muted-dark); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.message { position: relative; display: grid; grid-template-columns: var(--msg-avatar) minmax(0, 1fr); gap: 0 12px; padding: var(--msg-pad) 10px; margin-top: var(--msg-gap); border-radius: 8px; }
.message:hover, .message.menu-open { background: var(--surface-hover); }
.message.highlight { animation: highlight 1.6s ease; }
@keyframes highlight { 0%, 40% { background: var(--mint-dim); } 100% { background: transparent; } }
.message.grouped { margin-top: 0; padding-top: 1px; padding-bottom: 1px; }
.message.grouped .message-avatar, .message.grouped .message-meta { display: none; }
.message.grouped .message-content { grid-column: 2; }
.message-avatar { width: var(--msg-avatar); height: var(--msg-avatar); border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface-soft); color: var(--mint); font-size: 13px; font-weight: 700; margin-top: 2px; }
.message-content { min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.message-meta b { font-weight: 700; color: var(--text); }
.message-meta time { color: var(--muted-dark); font-size: 10.5px; }
.message-body { color: var(--text-soft); font-size: var(--msg-font); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.message-body a { color: var(--mint); text-decoration: underline; }
.message.pending .message-body, .message.pending .message-image { opacity: 0.55; }
.message.failed .message-body { color: var(--danger-soft); }
.message-reply { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0 0 3px calc(var(--msg-avatar) / 2 - 1px); padding-left: calc(var(--msg-avatar) / 2 + 10px); position: relative; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.message-reply::before { content: ""; position: absolute; left: 0; top: 8px; width: calc(var(--msg-avatar) / 2 + 4px); height: 10px; border-left: 2px solid var(--line-strong); border-top: 2px solid var(--line-strong); border-top-left-radius: 6px; }
.message-reply b { color: var(--text); font-weight: 600; flex-shrink: 0; }
.message-reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-reply:hover span { color: var(--text); }
.message-image { display: block; margin-top: 6px; max-width: min(420px, 100%); max-height: 320px; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; object-fit: contain; background: var(--surface-raised); }
.message-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reaction-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-raised); font-size: 13px; transition: border-color 0.12s ease, background 0.12s ease; }
.reaction-chip small { font-size: 11px; color: var(--muted); font-weight: 700; }
.reaction-chip.mine { border-color: color-mix(in srgb, var(--mint) 55%, transparent); background: var(--mint-dim); }
.reaction-chip.mine small { color: var(--mint); }
.reaction-chip:hover { border-color: var(--line-strong); }
.message-actions { position: absolute; top: -14px; right: 12px; display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--overlay); box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity 0.12s ease; z-index: 2; }
.message:hover .message-actions, .message.menu-open .message-actions, .message-actions:focus-within { opacity: 1; pointer-events: auto; }
.message-actions button { width: 30px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 14px; display: grid; place-items: center; }
.message-actions button:hover { background: var(--surface-raised); color: var(--text); }
.message-actions button.danger:hover { color: var(--danger); }
.history-more-button { align-self: center; margin: 4px auto 10px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-raised); color: var(--muted); font-size: 11px; }
.history-more-button:hover:not(:disabled) { color: var(--text); }
.typing-indicator { min-height: 18px; padding: 0 10px; color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.typing-indicator:empty { visibility: hidden; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-3px); opacity: 1; } }
.composer-extras { display: flex; flex-direction: column; gap: 6px; margin: 0 4px; flex-shrink: 0; }
.composer-extras:has(> :not([hidden])) { margin-bottom: 6px; }
.reply-bar, .attachment-preview { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); font-size: 12px; color: var(--muted); animation: fade-up 0.15s var(--ease); }
.reply-bar b { color: var(--text); }
.reply-bar small { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; }
.attachment-preview span { flex: 1; }
.composer { display: flex; align-items: center; gap: 8px; padding: 6px 7px; margin: 0 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; flex-shrink: 0; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.workspace[data-mode="call"] .composer { background: var(--input); margin: 0; }
.composer:focus-within { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.composer textarea { flex: 1; min-width: 0; height: 32px; max-height: 200px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; line-height: 18px; padding: 7px 0; resize: none; overflow-y: auto; }
.composer textarea:focus { outline: none; }
.composer textarea::placeholder { color: var(--muted-dark); }
.composer:has(textarea.multiline) { align-items: flex-end; }
.attach-button { width: 32px; height: 32px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-raised); color: var(--muted); font-size: 17px; }
.attach-button:hover:not(:disabled) { color: var(--text); background: var(--surface-soft); }
.send-button { width: 34px; height: 34px; border: 0; border-radius: 9px; display: grid; place-items: center; background: var(--mint); color: var(--mint-ink); font-weight: 800; font-size: 16px; transition: background 0.15s ease, transform 0.15s var(--ease); }
.send-button:hover:not(:disabled) { background: var(--mint-strong); }
.send-button:active:not(:disabled) { transform: scale(0.94); }
.chat-feedback { min-height: 16px; color: var(--danger); font-size: 11px; padding: 3px 8px 6px; }
.chat-panel.drop-target .chat-messages { outline: 2px dashed var(--mint); outline-offset: -8px; border-radius: 12px; }

/* reações rápidas */
.reaction-picker { position: fixed; z-index: 2600; display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--overlay); box-shadow: var(--shadow-lg); animation: pop-in 0.12s var(--ease); }
.reaction-picker button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 20px; transition: transform 0.1s var(--ease), background 0.1s ease; }
.reaction-picker button:hover { background: var(--surface-raised); transform: scale(1.15); }

/* imagem em tela cheia */
.lightbox { position: fixed; inset: 0; z-index: 2800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: rgba(3, 6, 10, 0.88); backdrop-filter: blur(6px); animation: fade-up 0.15s var(--ease); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: calc(100% - 60px); border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); cursor: default; }
.lightbox-actions { display: flex; gap: 8px; }
.lightbox .button-secondary { color: #fff; border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.06); }

/* ==========================================================================
   CHAMADA
   ========================================================================== */
.call-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); position: relative; }
.stage-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-shrink: 0; }
.stage-title { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.stage-title .section-label { flex-basis: 100%; }
.stage-title h2 { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-quality { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.call-quality i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-dark); }
.call-quality[data-state="good"] { color: var(--mint); }
.call-quality[data-state="good"] i { background: var(--mint); box-shadow: 0 0 6px var(--mint); }
.call-quality[data-state="warn"], .call-quality[data-state="connecting"] { color: var(--warn); }
.call-quality[data-state="warn"] i, .call-quality[data-state="connecting"] i { background: var(--warn); }
.call-quality[data-state="bad"] { color: var(--danger); }
.call-quality[data-state="bad"] i { background: var(--danger); }
.stage-tools { display: flex; align-items: center; gap: 7px; }
.call-panel[data-watch="on"] .stage-header .section-label { display: none; }
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }

/* ---- tiles: grade inteligente 16:9 (tamanho calculado em JS, nunca esticados) ---- */
.tile-grid { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px; position: relative; }
.call-panel[data-watch="on"] .tile-grid { display: none; }
.tile {
  --tile-accent: #4ee0b5;
  position: relative; flex: 0 0 auto; width: 320px; height: 180px; min-width: 0; overflow: hidden; border-radius: 14px;
  background:
    radial-gradient(120% 95% at 50% 30%, color-mix(in srgb, var(--tile-accent) 24%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, var(--tile-surface-top), var(--tile-surface));
  border: 1px solid var(--tile-border); outline: 2px solid transparent; outline-offset: -2px;
  box-shadow: var(--tile-shadow); color: var(--tile-text);
  transition: outline-color 0.12s ease, box-shadow 0.2s ease, width 0.25s var(--ease), height 0.25s var(--ease);
  animation: fade-up 0.25s var(--ease);
}
.tile::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 50% 42%, color-mix(in srgb, var(--tile-accent) 14%, transparent), transparent 70%); filter: blur(20px); pointer-events: none; }
.tile.speaking { outline-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim), 0 12px 32px color-mix(in srgb, var(--mint) 18%, transparent); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #05080d; opacity: 0; transition: opacity 0.25s ease; }
.tile.has-video video { opacity: 1; }
.tile.mirror video { transform: scaleX(-1); }
.tile.screen video { object-fit: contain; }
.tile-avatar-wrap { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transition: opacity 0.2s ease; }
.tile.has-video .tile-avatar-wrap { opacity: 0; }
.tile-avatar, .tile-ring { grid-area: 1 / 1; width: clamp(52px, 26%, 104px); aspect-ratio: 1; border-radius: 50%; }
.tile-avatar {
  position: relative; z-index: 1; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--tile-accent) 55%, var(--tile-surface)), color-mix(in srgb, var(--tile-accent) 25%, var(--tile-surface)));
  color: var(--tile-avatar-text); font-family: var(--font-display); font-size: clamp(18px, 2.6vw, 34px); font-weight: 800;
  border: 2px solid color-mix(in srgb, var(--tile-accent) 35%, transparent);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--tile-accent) 22%, transparent);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ease);
}
.tile-ring { border: 2px solid var(--mint); opacity: 0; transform: scale(1); }
.tile.speaking .tile-avatar { border-color: var(--mint); transform: scale(1.04); box-shadow: 0 0 0 4px var(--mint-dim), 0 10px 28px var(--mint-glow); }
.tile.speaking .tile-ring { animation: speak-wave 1.6s ease-out infinite; }
.tile.speaking .tile-ring.delay { animation-delay: 0.8s; }
@keyframes speak-wave { 0% { opacity: 0.55; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }
.tile-badge { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 16px; background: var(--tile-badge-bg); border: 1px solid var(--tile-border); backdrop-filter: blur(10px); font-size: 12px; font-weight: 600; color: var(--tile-text); }
.tile.has-video .tile-badge { background: rgba(8, 12, 18, 0.7); color: #f1f5f9; border-color: transparent; }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-icons { display: none; color: var(--danger); gap: 3px; }
.tile-icons svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tile.mic-off .tile-icons, .tile.deaf .tile-icons { display: inline-flex; }
.tile-whisper { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 3px 9px; border-radius: 10px; background: rgba(139, 92, 246, 0.9); color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35); }
.tile-status { position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 6px; background: var(--tile-badge-bg); color: var(--warn); font-size: 10px; font-weight: 600; }
.tile-status:empty { display: none; }
.tile.degraded .tile-avatar-wrap, .tile.degraded video { opacity: 0.55; }
.tile.focused { box-shadow: 0 0 0 2px color-mix(in srgb, var(--mint) 45%, transparent), var(--tile-shadow); }

/* Avisos do palco: pílula "Aguardando participantes" e sussurro (sem dividir a tela). */
.stage-notices { position: absolute; z-index: 12; top: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100% - 24px); pointer-events: none; }
.stage-notices > * { pointer-events: auto; }
/* No cinema os avisos ficam logo acima dos controles do player (não cobrem as bolinhas). */
.call-panel[data-watch="on"] .stage-notices { top: auto; bottom: 62px; }
.stage-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--overlay) 88%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow-md); color: var(--muted); font-size: 12px; white-space: nowrap; animation: fade-up 0.25s var(--ease); }
.pill-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 var(--mint-glow); animation: pill-pulse 1.8s infinite; }
@keyframes pill-pulse { 0% { box-shadow: 0 0 0 0 var(--mint-glow); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pill-dot { color: var(--muted-dark); }
.pill-action { border: 0; border-radius: 999px; padding: 5px 12px; background: var(--mint); color: var(--mint-ink); font-size: 11.5px; font-weight: 700; }
.pill-action:hover { background: var(--mint-strong); }
.whisper-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; padding: 7px 8px 7px 14px; border: 1px solid rgba(167, 139, 250, 0.45); border-radius: 14px; background: color-mix(in srgb, #8b5cf6 16%, var(--overlay)); color: var(--text); font-size: 12.5px; box-shadow: var(--shadow-md); animation: fade-up 0.2s var(--ease); }
.whisper-banner b { color: #a78bfa; }
:root[data-theme="light"] .whisper-banner b { color: #6d28d9; }
.whisper-banner.outgoing { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18), var(--shadow-md); }

/* ---- controles ---- */
.call-controls { position: relative; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; flex-shrink: 0; }
.control-group { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--canvas); }
.round-action { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-raised); color: var(--text); transition: background 0.15s ease, color 0.15s ease, transform 0.15s var(--ease); }
.round-action:hover:not(:disabled) { background: var(--surface-soft); transform: translateY(-1px); }
.round-action:active:not(:disabled) { transform: scale(0.95); }
.round-action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.round-action .slash { display: none; position: absolute; width: 24px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); }
.round-action.off { background: var(--danger-dim); color: var(--danger); }
.round-action.off .slash, .round-action.cam-off .slash { display: block; }
.round-action.cam-off { color: var(--muted); }
.round-action.on { background: var(--mint-dim); color: var(--mint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 40%, transparent); }
.round-action.accent { color: var(--mint); }
.round-action.hangup { width: 54px; border-radius: 22px; background: var(--danger-strong); color: #fff; }
.round-action.hangup:hover:not(:disabled) { background: #dc2626; }
.round-action.hangup svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }

/* ---- popover de áudio (contido, sem vazar) ---- */
.popover-wrap { position: relative; }
.popover {
  position: absolute; z-index: 90; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%);
  width: min(300px, calc(100vw - 24px)); max-height: min(520px, 70vh); overflow-x: hidden; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; padding: 16px; box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--overlay); color: var(--text);
  box-shadow: var(--shadow-lg); animation: pop-in 0.15s var(--ease);
}
.popover > * { min-width: 0; max-width: 100%; }
.popover h3 { font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.popover .toggle span { flex: 1; min-width: 0; line-height: 1.35; }
.popover-more { align-self: flex-start; color: var(--mint); }
.participant-menu { position: fixed; z-index: 2500; width: 248px; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--overlay); box-shadow: var(--shadow-lg); animation: pop-in 0.15s var(--ease); }
.participant-menu b { font-size: 13px; }

/* ==========================================================================
   WATCH TOGETHER (sempre em modo cinema)
   ========================================================================== */
.watch-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; animation: fade-up 0.25s var(--ease); position: relative; }
.watch-stage:has(.watch-side.collapsed) { grid-template-columns: minmax(0, 1fr); }
.player-shell { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }
.player-frame { flex: 1; min-height: 160px; position: relative; overflow: hidden; border-radius: 12px; background: var(--player-bg); border: 1px solid var(--line); isolation: isolate; }
.youtube-container { position: absolute; inset: 0; z-index: 0; visibility: hidden; }
.youtube-container.visible { visibility: visible; }
.youtube-container iframe, .youtube-container > div { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
#localPlayer { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-shield { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.player-empty { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; background: radial-gradient(circle, #141b27 0%, #090d13 75%); color: #f1f5f9; text-align: center; pointer-events: none; }
.player-empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: rgba(78, 224, 181, 0.14); color: #4ee0b5; font-size: 20px; margin-bottom: 4px; }
.player-empty b { font-size: 14px; }
.player-empty small { max-width: 320px; color: #94a3b8; font-size: 12px; line-height: 1.5; }
.player-overlay { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: rgba(5, 8, 13, 0.82); backdrop-filter: blur(4px); color: #f1f5f9; text-align: center; animation: fade-up 0.2s var(--ease); }
.player-overlay p { max-width: 420px; font-size: 13px; line-height: 1.5; }
.player-overlay.banner { inset: auto 12px 12px auto; flex-direction: row; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; background: rgba(8, 12, 18, 0.9); }
.player-overlay.banner p { font-size: 12px; }
.player-badges { position: absolute; z-index: 5; top: 12px; left: 12px; display: flex; gap: 6px; pointer-events: none; }
.sync-chip, .dj-chip { display: flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 20px; background: rgba(8, 12, 18, 0.78); backdrop-filter: blur(8px); color: #cbd5e1; font-size: 11px; font-weight: 600; transition: color 0.2s ease, opacity 0.2s ease; }
.dj-chip { color: #c4b5fd; }
.sync-chip i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.sync-chip[data-state="synced"] { color: #4ee0b5; }
.sync-chip[data-state="synced"] i { background: #4ee0b5; box-shadow: 0 0 6px #4ee0b5; }
.sync-chip[data-state="loading"], .sync-chip[data-state="buffering"], .sync-chip[data-state="drift"] { color: #fbbf24; }
.sync-chip[data-state="loading"] i, .sync-chip[data-state="buffering"] i, .sync-chip[data-state="drift"] i { background: #fbbf24; animation: pulse-ring 1.2s infinite; }
.sync-chip[data-state="blocked"], .sync-chip[data-state="error"], .sync-chip[data-state="missing-file"] { color: #f87171; }
.sync-chip[data-state="blocked"] i, .sync-chip[data-state="error"] i, .sync-chip[data-state="missing-file"] i { background: #f87171; }
.player-frame:not(:hover) .sync-chip[data-state="synced"] { opacity: 0.55; }
/* Bolinhas dos participantes: canto superior direito, nunca sobre a legenda. */
.bubble-strip { position: absolute; z-index: 5; top: 12px; right: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 46%; pointer-events: auto; transition: opacity 0.2s ease; }
.player-frame.bubbles-hidden .bubble-strip { display: none; }
.bubble { --tile-accent: #4ee0b5; position: relative; width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, color-mix(in srgb, var(--tile-accent) 70%, #0f1621), color-mix(in srgb, var(--tile-accent) 35%, #0f1621)); color: #fff; font-size: 14px; font-weight: 800; border: 2px solid rgba(255, 255, 255, 0.22); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.15s var(--ease), opacity 0.2s ease; animation: pop-in 0.2s var(--ease); }
.bubble video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.bubble.mirror video { transform: scaleX(-1); }
.bubble.speaking { border-color: #4ee0b5; box-shadow: 0 0 0 3px rgba(78, 224, 181, 0.35), 0 0 16px rgba(78, 224, 181, 0.55); transform: scale(1.07); }
.bubble.muted::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; border-radius: 50%; background: #ef4444 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E") center / 9px no-repeat; border: 2px solid rgba(8, 12, 18, 0.9); }
.bubble.reconnecting { opacity: 0.45; }
.player-frame:not(:hover) .bubble:not(.speaking) { opacity: 0.78; }
button.bubble { padding: 0; cursor: pointer; font-family: inherit; }
button.bubble.self { cursor: default; }
.bubble-avatar { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; overflow: hidden; }
.bubble-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.bubble video[hidden] { display: none; }
.player-button.wide { padding: 0 10px; grid-auto-flow: column; gap: 5px; }
.player-button.wide.on { background: var(--surface-raised); color: var(--mint); }
.player-button.wide span { min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--surface-soft); font-size: 10px; line-height: 16px; }
.player-action { position: absolute; z-index: 5; left: 50%; top: 56px; transform: translate(-50%, -8px); max-width: calc(100% - 32px); padding: 7px 14px; border-radius: 20px; background: rgba(8, 12, 18, 0.85); backdrop-filter: blur(8px); color: #f1f5f9; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s var(--ease); }
.player-action.visible { opacity: 1; transform: translate(-50%, 0); }
.player-controls { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); flex-shrink: 0; }
.player-controls.disabled .seek-bar { opacity: 0.4; }
.player-button { min-width: 34px; height: 32px; padding: 0 7px; border: 0; border-radius: 7px; display: grid; place-items: center; background: transparent; color: var(--text); font-size: 11px; font-weight: 700; transition: background 0.12s ease, color 0.12s ease; }
.player-button:hover:not(:disabled) { background: var(--surface-raised); color: var(--mint); }
.player-button svg { width: 17px; height: 17px; fill: currentColor; }
.player-button#wtBubblesToggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.player-button[aria-pressed="false"] { color: var(--muted-dark); }
.player-button .icon-pause { display: none; }
.player-button.playing .icon-pause { display: block; }
.player-button.playing .icon-play { display: none; }
.player-button.wide { display: inline-flex; gap: 6px; padding: 0 10px; border: 1px solid var(--line); }
.player-button.wide span { padding: 0 6px; border-radius: 8px; background: var(--mint-dim); color: var(--mint); font-size: 10px; }
.player-button.wide[aria-expanded="true"] { border-color: color-mix(in srgb, var(--mint) 40%, transparent); }
.player-controls.locked .player-button:not(#wtBubblesToggle):not(#wtQueueToggle), .player-controls.locked .seek-bar { opacity: 0.4; cursor: not-allowed; }
.player-time { min-width: 38px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.seek-bar { flex: 1; min-width: 40px; }
.player-volume { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.player-volume svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.player-volume input { width: 72px; }
@container (max-width: 620px) {
  .player-volume input { width: 52px; }
  #wtBackButton, #wtForwardButton { display: none; }
}
@container (max-width: 480px) {
  .player-volume, #wtDuration { display: none; }
  .player-controls { gap: 3px; padding: 5px 6px; }
}
.watch-side { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.watch-side.collapsed { display: none; }
.dj-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.dj-row.active { border-color: rgba(167, 139, 250, 0.45); background: rgba(139, 92, 246, 0.1); }
.dj-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dj-copy b { font-size: 12.5px; }
.dj-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.toggle.switch-only { gap: 0; }
.wt-add { display: flex; gap: 6px; }
.wt-add input { height: 36px; font-size: 12px; }
.wt-add .button-primary { min-height: 36px; padding: 0 12px; }
.watch-side.locked .wt-add, .watch-side.locked .wt-tools, .watch-side.locked .wt-queue-actions, .watch-side.locked #wtClearQueue, .watch-side.locked .wt-result-actions { opacity: 0.45; pointer-events: none; }
.wt-tools { margin-top: -4px; }
.wt-feedback { color: var(--mint); font-size: 11px; }
.wt-feedback:empty { display: none; }
.wt-results { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); animation: fade-up 0.18s var(--ease); }
.wt-results-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; color: var(--muted-dark); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; }
.wt-results-status { padding: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.wt-results-status.error { color: var(--danger); }
.wt-result, .wt-queue-item { display: flex; align-items: center; gap: 9px; padding: 5px; border-radius: 8px; }
.wt-result:hover, .wt-queue-item:hover { background: var(--surface-raised); }
.wt-result-thumb, .wt-queue-thumb, .wt-now-thumb { width: 64px; height: 36px; flex: 0 0 64px; border-radius: 5px; object-fit: cover; background: #000; }
.wt-result-thumb.placeholder, .wt-queue-thumb.placeholder, .wt-now-thumb.placeholder { display: grid; place-items: center; color: var(--mint); font-size: 14px; }
.wt-result-copy, .wt-queue-copy, .wt-now-copy { flex: 1; min-width: 0; }
.wt-result-copy b, .wt-queue-copy b, .wt-now-copy b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.wt-result-copy small, .wt-queue-copy small, .wt-now-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-result-actions, .wt-queue-actions { display: flex; gap: 3px; }
.wt-queue-actions { opacity: 0; transition: opacity 0.12s ease; }
.wt-queue-item:hover .wt-queue-actions, .wt-queue-item:focus-within .wt-queue-actions { opacity: 1; }
.wt-section-title { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; color: var(--muted-dark); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; }
.wt-now { display: flex; align-items: center; gap: 9px; padding: 7px; border: 1px solid color-mix(in srgb, var(--mint) 22%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--mint) 5%, transparent); }
.wt-now > small { color: var(--muted); font-size: 11px; }
.wt-now-thumb { width: 80px; height: 45px; flex-basis: 80px; }
.wt-queue { list-style: none; display: grid; gap: 2px; }
.wt-queue-index { width: 14px; color: var(--muted-dark); font-size: 10px; text-align: center; }
.wt-queue-empty { padding: 10px 6px; color: var(--muted-dark); font-size: 11px; line-height: 1.45; }
.wt-viewers { list-style: none; display: grid; gap: 4px; }
.wt-viewer { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.wt-viewer-avatar { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); font-size: 10px; box-shadow: 0 0 0 2px transparent; transition: box-shadow 0.12s ease; }
.wt-viewer-avatar.speaking { box-shadow: 0 0 0 2px var(--mint); }
.wt-viewer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-viewer-role { color: #a78bfa; font-size: 10px; }
.wt-viewer-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.wt-viewer-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-dark); }
.wt-viewer[data-sync="synced"] .wt-viewer-status { color: var(--mint); }
.wt-viewer[data-sync="synced"] .wt-viewer-status i { background: var(--mint); }
.wt-viewer[data-sync="buffering"] .wt-viewer-status i, .wt-viewer[data-sync="loading"] .wt-viewer-status i, .wt-viewer[data-sync="drift"] .wt-viewer-status i { background: var(--warn); }
.wt-viewer[data-sync="blocked"] .wt-viewer-status i, .wt-viewer[data-sync="error"] .wt-viewer-status i, .wt-viewer[data-sync="missing-file"] .wt-viewer-status i { background: var(--danger); }
.wt-viewer[data-sync="streaming"] .wt-viewer-status { color: #60a5fa; }
.wt-viewer[data-sync="streaming"] .wt-viewer-status i { background: #60a5fa; }

/* Tela cheia */
.call-panel.is-fullscreen { padding: 12px; border: 0; border-radius: 0; background: #000; }
.call-panel.is-fullscreen .player-frame { border: 0; }

/* ==========================================================================
   DIÁLOGOS
   ========================================================================== */
.room-dialog { width: min(460px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 26px 90px rgba(0, 0, 0, 0.5); }
.room-dialog[open], .settings-modal[open] { animation: pop-in 0.2s var(--ease); }
.room-dialog::backdrop, .settings-modal::backdrop { background: var(--scrim); backdrop-filter: blur(5px); }
.dialog-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.dialog-card h2 { padding-right: 25px; font-family: var(--font-display); font-size: 21px; letter-spacing: -0.03em; }
.dialog-description { margin-top: -8px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.dialog-close { position: absolute; top: 15px; right: 15px; width: 32px; height: 32px; font-size: 19px; z-index: 2; }
.dialog-feedback { min-height: 16px; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.dialog-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 8px; }
.dialog-actions button { min-height: 38px; }
.danger-zone { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.danger-zone small { color: var(--muted); font-size: 11px; }
.channel-type-picker { display: grid; gap: 8px; border: 0; }
.type-option { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); cursor: pointer; }
.type-option:has(input:checked) { border-color: var(--mint); background: var(--mint-dim); }
.type-option input { accent-color: var(--mint); }
.type-icon { width: 30px; text-align: center; font-size: 20px; color: var(--muted); }
.type-option b { display: block; font-size: 13px; }
.type-option small { color: var(--muted); font-size: 11.5px; }
.person-picker { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.picker-row:hover { background: var(--surface-raised); }
.picker-avatar { width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); color: var(--mint); font-weight: 700; font-size: 12px; }
.picker-row b { font-size: 13px; }
.picker-row small { color: var(--muted-dark); font-size: 11px; margin-left: 4px; }

/* ---- modal de configurações ---- */
.settings-modal { width: min(980px, calc(100vw - 28px)); height: min(720px, calc(100vh - 28px)); max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5); }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); height: 100%; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 26px 12px; background: var(--sidebar); border-right: 1px solid var(--line); overflow-y: auto; }
.settings-nav-title { padding: 0 10px 10px; color: var(--muted-dark); font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; }
.settings-nav button { min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; }
.settings-nav button:hover { background: var(--surface-hover); color: var(--text); }
.settings-nav button.active { background: var(--surface-raised); color: var(--text); }
.settings-nav-separator { height: 1px; margin: 8px 10px; background: var(--line); }
.settings-content { position: relative; min-width: 0; overflow-y: auto; padding: 30px 34px 40px; }
.settings-section { display: flex; flex-direction: column; gap: 14px; max-width: 660px; animation: fade-up 0.18s var(--ease); }
.settings-section h2 { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.03em; display: flex; align-items: center; gap: 8px; }
.settings-subtitle { margin-top: 10px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.settings-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-raised); }
.settings-list { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); overflow: hidden; }
.settings-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.settings-slider { max-width: 460px; }
.avatar-wrap.large .status-dot { width: 18px; height: 18px; border-width: 4px; border-color: var(--surface-raised); right: 2px; bottom: 2px; }
.profile-photo-preview { width: 80px; height: 80px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; border: 5px solid var(--surface-raised); background: linear-gradient(135deg, #4ce0b5, #3b82f6); color: #0b1a20; font-size: 28px; font-weight: 800; }
.photo-row { display: flex; align-items: center; gap: 14px; }
.photo-actions { display: flex; align-items: center; gap: 6px; padding-bottom: 6px; }
/* ---- Configurações › Meu perfil (100% da largura, em seções) ---- */
.profile-editor { display: flex; flex-direction: column; width: 100%; overflow: hidden; border: 1px solid var(--glass-border, var(--line)); border-radius: 14px; background: var(--surface-raised); }
.profile-editor-hero { position: relative; }
.profile-editor-banner { height: 96px; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--mint) 70%, transparent), transparent 60%), linear-gradient(120deg, #1f7a68, #3b5bdb 70%, #6d4bd8); }
.profile-editor-identity { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding: 0 20px; margin-top: -40px; }
.profile-editor-identity .avatar-wrap.large { flex: 0 0 auto; }
.profile-editor-names { flex: 1; min-width: 140px; display: grid; gap: 2px; padding-bottom: 8px; }
.profile-editor-names b { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-editor-names small { color: var(--muted); font-size: 12px; }
.profile-editor-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 20px 20px; }
.profile-editor-fields textarea { width: 100%; min-height: 76px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input); color: var(--text); font: inherit; font-size: 13px; line-height: 1.5; }
.profile-editor-fields textarea:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.profile-editor-fields label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.profile-bio-count { color: var(--muted-dark); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.profile-editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.profile-editor-actions .dialog-feedback { flex: 1; margin: 0; }
.settings-block { margin-top: 22px; }
.settings-block .settings-subtitle { margin-top: 0; }
.profile-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.profile-info-grid .friend-code-row b { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .profile-editor-identity { padding: 0 14px; }
  .profile-editor-fields { padding: 14px; }
  .profile-editor-actions { flex-direction: column; align-items: stretch; }
}
.friend-code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.friend-code-row b { display: block; margin-top: 4px; font-family: var(--font-display); font-size: 16px; }
.status-options, .density-options { display: grid; gap: 6px; }
.status-option { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); cursor: pointer; }
.status-option:has(input:checked) { border-color: var(--mint); background: var(--mint-dim); }
.status-option input { accent-color: var(--mint); }
.status-option .status-dot { width: 12px; height: 12px; border: 0; }
.status-option b { display: block; font-size: 13px; }
.status-option small { color: var(--muted); font-size: 11.5px; }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); gap: 12px; }
.theme-option { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.theme-option:has(input:checked) { border-color: var(--mint); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option b { font-size: 13px; }
.theme-preview { display: grid; grid-template-columns: 30% 1fr; grid-template-rows: 1fr 1fr; gap: 5px; height: 84px; padding: 7px; border-radius: 8px; }
.theme-preview i { border-radius: 4px; }
.theme-preview i:first-child { grid-row: span 2; }
.theme-preview.dark { background: #090d14; }
.theme-preview.dark i { background: #1d283a; }
.theme-preview.dark i:last-child { background: #4ee0b5; opacity: 0.6; }
.theme-preview.light { background: #f4f6fa; border: 1px solid #e2e8f0; }
.theme-preview.light i { background: #dfe6ef; }
.theme-preview.light i:last-child { background: #0e9f78; opacity: 0.6; }
.mic-test { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.meter { position: relative; flex: 1; min-width: 160px; height: 12px; border-radius: 6px; background: var(--surface-soft); overflow: hidden; }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--mint), #a3e635 70%, var(--warn)); transition: width 60ms linear; }
.meter.gated .meter-fill { background: var(--muted-dark); }
.meter-threshold { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: 0.8; }
.meter-value { min-width: 64px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sound-tests { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- cargos e membros ---- */
.roles-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: start; }
.role-list-column { display: flex; flex-direction: column; gap: 8px; }
.role-list { display: flex; flex-direction: column; gap: 2px; }
.role-item { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; }
.role-item:hover { background: var(--surface-hover); color: var(--text); }
.role-item.active { background: var(--surface-raised); color: var(--text); }
.role-dot { width: 11px; height: 11px; flex: 0 0 11px; border-radius: 50%; background: var(--muted-dark); }
.role-color-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; }
.color-swatch.selected { border-color: var(--text); }
.color-swatch.none { background: var(--surface-soft) !important; position: relative; }
.color-swatch.none::after { content: ""; position: absolute; inset: 11px 3px; background: var(--danger); transform: rotate(-45deg); border-radius: 2px; }
#roleColorInput { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; cursor: pointer; }
.role-editor .toggle.row { background: transparent; }
.member-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.member-row:last-child { border-bottom: 0; }
.member-avatar { width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); color: var(--mint); font-weight: 700; }
.member-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
.member-copy b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-copy b .owner-badge { margin-left: 6px; color: var(--warn); font-size: 11px; }
.member-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); font-size: 11px; }
.role-chip .role-dot { width: 8px; height: 8px; flex-basis: 8px; }
.role-chip button { border: 0; background: transparent; color: var(--muted); font-size: 12px; line-height: 1; padding: 0; }
.member-actions { display: flex; gap: 6px; align-items: center; }
.member-actions select { height: 30px; max-width: 150px; padding: 0 6px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--input); color: var(--text); font-size: 11.5px; }
.danger-confirm > p:first-child { color: var(--muted); font-size: 12px; line-height: 1.5; }
.danger-confirm b { color: var(--danger-soft); }
.group-photo-editor { position: relative; width: 72px; height: 72px; flex: 0 0 72px; border-radius: 20px; }
.group-photo-preview { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: inherit; background: linear-gradient(135deg, #49dbb2, #3b82f6); color: #081a1c; font-size: 22px; font-weight: 800; }
.group-photo-pencil { position: absolute; right: 4px; bottom: 4px; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.26); border-radius: 9px; background: rgba(7, 13, 19, 0.88); color: #fff; font-size: 13px; opacity: 0; transition: opacity 0.16s ease; cursor: pointer; }
.group-photo-editor:hover .group-photo-pencil, .group-photo-editor:focus-within .group-photo-pencil { opacity: 1; }
.group-photo-editor.readonly .group-photo-pencil { display: none; }

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */
@media (max-width: 1280px) {
  .workspace[data-mode="call"] { grid-template-columns: minmax(0, 1fr) 300px; }
  .watch-stage { grid-template-columns: minmax(0, 1fr) 270px; }
  .app-shell[data-mode="dm"] { grid-template-columns: 232px 248px minmax(0, 1fr); }
}

@media (max-width: 1050px) {
  /* Na chamada, chat e fila viram gavetas por cima do palco. */
  .workspace[data-mode="call"] { grid-template-columns: minmax(0, 1fr); }
  .workspace[data-mode="call"] .chat-panel { position: absolute; z-index: 40; top: 74px; right: 10px; bottom: 92px; width: min(340px, calc(100% - 20px)); box-shadow: var(--shadow-lg); animation: fade-up 0.2s var(--ease); }
  .watch-stage, .watch-stage:has(.watch-side.collapsed) { grid-template-columns: minmax(0, 1fr); }
  .watch-side { position: absolute; z-index: 8; top: 8px; right: 8px; bottom: 56px; width: min(330px, calc(100% - 16px)); box-shadow: var(--shadow-lg); animation: fade-up 0.18s var(--ease); }
  .settings-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .roles-layout { grid-template-columns: minmax(0, 1fr); }
  .app-shell[data-mode="dm"] { grid-template-columns: 220px 236px minmax(0, 1fr); }
}

@media (max-width: 950px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art, .login-copy { display: none; }
}

@media (max-width: 860px) {
  /* Em telas estreitas as barras laterais viram gaveta. */
  .app-shell, .app-shell[data-mode="dm"], .app-shell[data-mode="group"] { grid-template-columns: minmax(0, 1fr); }
  .app-shell > .sidebar, .app-shell > .dm-sidebar, .app-shell > .channel-sidebar { display: none !important; }
  .app-shell.sidebar-open[data-mode="main"] > .sidebar,
  .app-shell.sidebar-open[data-mode="group"] > .channel-sidebar { position: fixed; z-index: 1101; inset: 0 auto 0 0; display: flex !important; width: min(290px, calc(100vw - 48px)); height: 100dvh; box-shadow: 16px 0 48px rgba(0, 0, 0, 0.4); animation: drawer-in 0.22s var(--ease); }
  .app-shell.sidebar-open[data-mode="dm"] > .sidebar { position: fixed; z-index: 1101; inset: 0 auto 0 0; display: flex !important; width: 210px; height: 100dvh; animation: drawer-in 0.22s var(--ease); }
  .app-shell.sidebar-open[data-mode="dm"] > .dm-sidebar { position: fixed; z-index: 1101; inset: 0 auto 0 210px; display: flex !important; width: min(250px, calc(100vw - 258px)); height: 100dvh; box-shadow: 16px 0 48px rgba(0, 0, 0, 0.4); animation: drawer-in 0.22s var(--ease); }
  .app-shell.sidebar-open > .sidebar-backdrop:not([hidden]) { position: fixed; z-index: 1100; inset: 0; display: block; border: 0; background: var(--scrim); cursor: default; }
  .sidebar-backdrop { display: none; }
  .mobile-sidebar-button { display: grid; position: fixed; z-index: 1050; top: 10px; left: 10px; width: 36px; height: 36px; border-color: var(--glass-border, var(--line)); background: var(--glass-strong, var(--surface)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .main-area { padding: 0 12px; }
  .chat-header, .friends-header, .stage-header { padding-left: 46px; }
  .voice-lobby, .server-welcome { padding-top: 56px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .settings-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-nav-title, .settings-nav-separator { display: none; }
  .settings-nav button { flex: 0 0 auto; }
  .settings-content { padding: 22px 18px 30px; }
  .settings-grid.two { grid-template-columns: minmax(0, 1fr); }
  .friends-title { border-right: 0; }
}

@media (max-width: 760px) {
  .call-panel { padding: 10px; }
  .stage-title .section-label { display: none; }
  .control-group { gap: 4px; padding: 4px; }
  .round-action { width: 40px; height: 40px; }
  #screenShareButton { display: none; }
  .bubble { width: 32px; height: 32px; font-size: 12px; }
  .toast-region { top: 60px; bottom: auto; left: 12px; right: 12px; align-items: center; max-width: none; }
  .workspace[data-mode="call"] { padding: 8px 0 10px; }
  .workspace[data-mode="call"] .chat-panel { top: 60px; bottom: 76px; }
  .person-actions .icon-button { width: 32px; height: 32px; }
  .dm-banner { flex-wrap: wrap; }
}

@keyframes drawer-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---- estados extras (canais, amigos, configurações) ---- */
.channel-entry.in-call .channel-glyph { color: var(--mint); }
.dm-request-heading { padding: 10px 8px 4px; color: var(--warn); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.dm-request-list { display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dm-row.request .dm-row-copy small { color: var(--warn); }
.dm-row .unread-dot { margin-left: 4px; }
.person-row.clickable { cursor: pointer; }
.member-copy b .tag { color: var(--muted-dark); font-weight: 500; }
.muted-note { color: var(--muted-dark); font-size: 11px; }
.toggle.disabled { opacity: 0.5; }
.slider-row.disabled { opacity: 0.45; }
#micTestButton.active { border-color: color-mix(in srgb, var(--mint) 55%, transparent); color: var(--mint); }
.meter-threshold[hidden] { display: none; }
.role-item small { color: var(--muted-dark); font-size: 11px; font-weight: 500; }
.role-editor[hidden] { display: none; }

/* ==========================================================================
   FERRAMENTAS DA CALL: anotação, quadro branco, roleta, arquivos, sussurro
   ========================================================================== */
.control-group.tools .round-action.has-news::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--canvas); }
.more-tools { display: none; }
.tools-popover { width: min(240px, calc(100vw - 24px)); gap: 4px; padding: 10px; }
.tools-popover button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font-size: 13px; text-align: left; }
.tools-popover button:hover:not(:disabled), .tools-popover button.on { background: var(--surface-raised); }
.tools-popover button.on { color: var(--mint); }

/* camadas de desenho (quadro, vídeo, tela) */
.annotation-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.draw-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.draw-live.interactive { pointer-events: auto; cursor: crosshair; }
.player-frame.annotating .player-shield { pointer-events: none; }
.player-frame.annotating { box-shadow: 0 0 0 2px #ff3b6b; }
.screen-annotation { inset: auto; }
.tile.annotating { outline-color: #ff3b6b; }
.annotate-bar { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin: 0 auto; padding: 4px 6px; border: 1px solid color-mix(in srgb, #ff3b6b 45%, transparent); border-radius: 14px; background: var(--canvas); font-size: 12px; animation: fade-up 0.2s var(--ease); }
.annotate-title { font-weight: 700; white-space: nowrap; padding-left: 4px; }
.annotate-title small { color: var(--muted); font-weight: 500; }
.annotate-tools { display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--surface-raised); }
.annotate-tools button, .annotate-action { min-height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.annotate-tools button.active { background: var(--overlay); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); color: var(--mint); }
.annotate-action:hover:not(:disabled), .annotate-tools button:hover:not(:disabled) { background: var(--surface-soft); }
.annotate-lock, .board-lock { color: var(--warn); font-size: 11.5px; font-weight: 600; }
.swatch-row { display: flex; gap: 4px; align-items: center; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); padding: 0; }
.swatch.selected { box-shadow: 0 0 0 2px var(--overlay), 0 0 0 4px var(--mint); }

/* quadro branco */
.board-stage { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; gap: 10px; padding: 4px; border-radius: 12px; background: var(--surface); animation: fade-up 0.2s var(--ease); }
.board-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.tool-group { display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--surface-raised); }
.tool-group button { width: 34px; height: 32px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--text); }
.tool-group button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool-group button:hover:not(:disabled) { background: var(--surface-soft); }
.tool-group button.active { background: var(--mint-dim); color: var(--mint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 45%, transparent); }
#boardClear.armed { background: var(--danger-dim); color: var(--danger); }
#boardColorInput { width: 30px; height: 28px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; cursor: pointer; }
.board-size { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; }
.board-size input { width: 90px; }
.board-size output { min-width: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.board-close { margin-left: auto; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent; color: var(--text); font-size: 18px; }
.board-area { flex: 1; min-height: 0; display: grid; place-items: center; container-type: size; }
.board-canvas { position: relative; width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; border-radius: 12px; background: #ffffff; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12), 0 18px 40px rgba(0, 0, 0, 0.25); overflow: hidden; background-image: radial-gradient(rgba(15, 23, 42, 0.12) 1px, transparent 1px); background-size: 24px 24px; }
.board-stage.readonly .board-canvas { cursor: not-allowed; }
.board-canvas[data-tool="text"] .draw-live.interactive { cursor: text; }
.board-text-input { position: absolute; z-index: 3; min-width: 160px; padding: 2px 6px; border: 1.5px dashed #6366f1; border-radius: 6px; background: rgba(255, 255, 255, 0.92); font-weight: 600; outline: none; }

/* roleta */
.roulette-panel { position: absolute; z-index: 11; top: 8px; right: 8px; bottom: 8px; width: min(380px, calc(100% - 16px)); display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--overlay); box-shadow: var(--shadow-lg); overflow: hidden; animation: fade-up 0.22s var(--ease); }
.roulette-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.roulette-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 16px 16px; }
.roulette-wheel { position: relative; width: min(100%, 280px); aspect-ratio: 1; flex-shrink: 0; }
.roulette-wheel canvas { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3); }
.roulette-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid var(--text); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35)); }
.roulette-hub { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--overlay); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); font-size: 20px; }
.roulette-panel.spinning .roulette-hub { animation: hub-spin 0.9s linear infinite; }
@keyframes hub-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.roulette-result { min-height: 30px; text-align: center; font-size: 15px; }
.roulette-result small { color: var(--muted); font-size: 12px; }
.roulette-panel.done .roulette-result b { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--mint-dim); color: var(--mint); font-size: 17px; animation: pop-in 0.3s var(--ease); }
.roulette-form { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.roulette-form input, .roulette-form textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input); font-size: 13px; resize: vertical; }
.roulette-actions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.roulette-hint { color: var(--muted); font-size: 11px; line-height: 1.4; }

/* arquivos no chat (transferência direta P2P) */
.chat-file { position: relative; max-width: 460px; margin-top: 6px; display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "icon copy" "actions actions"; column-gap: 12px; row-gap: 10px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-raised); animation: fade-up 0.2s var(--ease); }
.chat-file-icon { grid-area: icon; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-soft); font-size: 23px; }
.chat-file-copy { grid-area: copy; min-width: 0; display: grid; gap: 3px; align-content: center; }
.chat-file-badge { width: fit-content; max-width: 100%; padding: 1px 7px; border-radius: 999px; background: var(--mint-dim); color: var(--mint); font-size: 10px; font-weight: 700; letter-spacing: 0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-name { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-meta { color: var(--muted-dark); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-status { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.chat-file-status:empty { display: none; }
.chat-file-progress { height: 6px; margin-top: 3px; border-radius: 3px; background: var(--surface-soft); overflow: hidden; }
.chat-file-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), #38bdf8); transition: width 0.25s ease; }
.chat-file-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 8px; }
.chat-file-actions:empty { display: none; }
.chat-file-actions .button-primary.small, .chat-file-actions .button-secondary.small { min-height: 32px; padding: 0 14px; font-size: 12px; font-weight: 700; border-radius: 8px; }
.chat-file-actions .text-button { font-size: 11.5px; }
.chat-file.active { border-color: color-mix(in srgb, var(--mint) 40%, var(--line-strong)); }
.chat-file.active .chat-file-status { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.chat-file.success .chat-file-status { color: var(--mint); }
.chat-file.error .chat-file-status { color: var(--danger); }
.chat-file.warn .chat-file-status { color: var(--warn); }
.chat-file.warn .chat-file-icon, .chat-file.muted .chat-file-icon { filter: grayscale(0.6); opacity: 0.75; }
.message.failed .chat-file { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.message-content .chat-file + .message-reactions { margin-top: 6px; }
.chat-messages[data-density="compact"] .chat-file { padding: 9px 10px; grid-template-columns: 36px minmax(0, 1fr); }
.chat-messages[data-density="compact"] .chat-file-icon { width: 36px; height: 36px; font-size: 19px; }

/* soltar arquivos no chat */
.chat-panel { position: relative; }
.chat-panel.drop-target::after { content: attr(data-drop-hint); position: absolute; inset: 8px; z-index: 30; display: grid; place-items: center; border: 2px dashed var(--mint); border-radius: 14px; background: color-mix(in srgb, var(--overlay) 84%, transparent); color: var(--mint); font-weight: 800; font-size: 15px; pointer-events: none; animation: fade-up 0.15s var(--ease); }

/* menu "＋" do compositor (estilo Discord) */
.composer-menu-wrap { position: relative; flex-shrink: 0; }
.composer-menu-wrap .attach-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; transition: transform 0.18s var(--ease); }
.composer-menu-wrap .attach-button.open { background: var(--mint); color: var(--mint-ink); }
.composer-menu-wrap .attach-button.open svg { transform: rotate(45deg); }
.composer-menu { position: absolute; z-index: 40; left: -4px; bottom: calc(100% + 14px); width: 290px; padding: 6px; display: grid; gap: 2px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--overlay); box-shadow: var(--shadow-lg); transform-origin: bottom left; animation: menu-rise 0.16s var(--ease); }
.composer-menu::after { content: ""; position: absolute; left: 16px; bottom: -6px; width: 10px; height: 10px; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: var(--overlay); transform: rotate(45deg); }
.composer-menu-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; transition: background 0.12s ease; }
.composer-menu-item:hover, .composer-menu-item:focus-visible { background: var(--surface-hover); outline: none; }
.composer-menu-item:hover .composer-menu-icon, .composer-menu-item:focus-visible .composer-menu-icon { transform: scale(1.06); }
.composer-menu-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px; transition: transform 0.15s var(--ease); }
.composer-menu-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.composer-menu-icon.file { background: rgba(56, 189, 248, 0.14); color: #38bdf8; }
.composer-menu-icon.poll { background: rgba(167, 139, 250, 0.16); color: #a78bfa; }
.composer-menu-copy { min-width: 0; display: grid; gap: 1px; }
.composer-menu-copy b { font-size: 13px; }
.composer-menu-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; }
@keyframes menu-rise { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }

/* reações rápidas: "Mais emojis" */
.reaction-picker { align-items: center; }
.reaction-picker .reaction-divider { width: 1px; height: 22px; margin: 0 3px; background: var(--line-strong); }
.reaction-picker .reaction-more { width: auto; height: 36px; padding: 0 9px 0 7px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.reaction-picker .reaction-more:hover { transform: none; color: var(--text); }
.reaction-picker .reaction-more svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* seletor completo de emojis */
.emoji-picker { position: fixed; z-index: 2700; width: 372px; height: 440px; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--overlay); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop-in 0.14s var(--ease); }
.emoji-picker-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; }
.emoji-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 0 10px; height: 34px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--input); color: var(--muted); }
.emoji-search:focus-within { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.emoji-search svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.emoji-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 13px; }
.emoji-search input:focus { outline: none; }
.emoji-skin-button { width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-raised); font-size: 18px; line-height: 1; }
.emoji-skin-button:hover { background: var(--surface-soft); }
.emoji-skin-menu { position: absolute; z-index: 2; right: 10px; top: 48px; display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--overlay); box-shadow: var(--shadow-md); animation: pop-in 0.12s var(--ease); }
.emoji-skin-option { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; font-size: 19px; }
.emoji-skin-option:hover { background: var(--surface-raised); }
.emoji-skin-option.active { background: var(--mint-dim); box-shadow: inset 0 0 0 1px var(--mint); }
.emoji-tabs { display: flex; gap: 1px; padding: 0 8px 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.emoji-tabs::-webkit-scrollbar { display: none; }
.emoji-tab { flex: 1 0 auto; min-width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; font-size: 17px; filter: grayscale(0.9); opacity: 0.7; transition: filter 0.12s ease, opacity 0.12s ease, background 0.12s ease; }
.emoji-tab:hover { filter: none; opacity: 1; background: var(--surface-raised); }
.emoji-tab.active { filter: none; opacity: 1; background: var(--mint-dim); box-shadow: inset 0 -2px 0 var(--mint); }
.emoji-tabs.searching .emoji-tab { filter: grayscale(1); opacity: 0.45; box-shadow: none; background: transparent; }
.emoji-body { position: relative; overflow-y: auto; padding: 4px 8px 10px; overscroll-behavior: contain; }
.emoji-section { padding-top: 6px; }
.emoji-section-title { position: sticky; top: -4px; z-index: 1; margin: 0; padding: 6px 4px; background: var(--overlay); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.emoji-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 2px; }
.emoji-cell { aspect-ratio: 1; min-width: 0; border: 0; border-radius: 8px; background: transparent; font-size: 23px; line-height: 1; display: grid; place-items: center; transition: background 0.08s ease, transform 0.08s var(--ease); }
.emoji-cell:hover, .emoji-cell:focus-visible { background: var(--surface-raised); transform: scale(1.12); outline: none; }
.emoji-empty { margin: 20px 0; color: var(--muted); text-align: center; font-size: 13px; }
.emoji-preview { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface-raised); }
.emoji-preview-glyph { font-size: 28px; line-height: 1; }
.emoji-preview-name { min-width: 0; color: var(--text-soft); font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emoji-picker.loading .emoji-body::before { content: "Carregando emojis…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) {
  .emoji-picker { left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; height: min(70vh, 460px); }
  .emoji-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .composer-menu { width: min(290px, calc(100vw - 32px)); }
}

/* menu do participante: sussurro e desenho */
.whisper-button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid rgba(167, 139, 250, 0.4); border-radius: 10px; background: rgba(139, 92, 246, 0.1); color: var(--text); text-align: left; touch-action: none; user-select: none; }
.whisper-button b { grid-row: span 2; font-size: 20px; }
.whisper-button span { font-size: 12.5px; font-weight: 700; }
.whisper-button small { color: var(--muted); font-size: 10.5px; }
.whisper-button:hover { background: rgba(139, 92, 246, 0.18); }
.whisper-button.active { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.28); }
.participant-draw { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.participant-draw small { color: var(--muted); font-size: 10.5px; padding-left: 43px; }
.voice-connected.whispering { border-color: #8b5cf6; }

/* ==========================================================================
   CHAT: edição, enquetes, reações e densidade compacta
   ========================================================================== */
.message-body .edited { color: var(--muted-dark); font-size: 10.5px; white-space: nowrap; }
.edit-box { display: grid; gap: 4px; margin-top: 2px; }
.edit-field { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid var(--mint); border-radius: 9px; background: var(--input); font-size: var(--msg-font); line-height: 1.45; resize: none; box-shadow: 0 0 0 3px var(--mint-dim); }
.edit-field:focus { outline: none; }
.edit-hint { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.edit-hint .text-button { padding: 2px 6px; font-size: 11px; color: var(--mint); }
.message.editing { background: var(--surface-hover); }
.message.editing .message-actions { display: none; }
.reaction-chip.add { color: var(--muted); font-size: 13px; opacity: 0; transition: opacity 0.12s ease; }
.message:hover .reaction-chip.add, .reaction-chip.add:focus-visible { opacity: 1; }
.poll-card { max-width: 440px; margin-top: 6px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-raised); display: grid; gap: 10px; }
.poll-head { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.poll-icon { font-size: 16px; line-height: 1.2; }
.poll-options { display: grid; gap: 6px; }
.poll-option { position: relative; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); text-align: left; overflow: hidden; isolation: isolate; transition: border-color 0.15s ease; }
.poll-option:hover:not(:disabled) { border-color: color-mix(in srgb, var(--mint) 50%, transparent); }
.poll-fill { position: absolute; inset: 0 auto 0 0; z-index: -1; width: 0; background: color-mix(in srgb, var(--mint) 18%, transparent); transition: width 0.6s var(--ease); }
.poll-option.mine { border-color: color-mix(in srgb, var(--mint) 70%, transparent); }
.poll-option.mine .poll-fill { background: color-mix(in srgb, var(--mint) 30%, transparent); }
.poll-check { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; border: 1.5px solid var(--line-strong); border-radius: 50%; font-size: 11px; font-weight: 800; color: var(--mint-ink); }
.poll-option.mine .poll-check { background: var(--mint); border-color: var(--mint); }
.poll-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-count { color: var(--muted); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.poll-foot { color: var(--muted); font-size: 11px; }
.poll-option-list { display: grid; gap: 6px; }
.poll-option-row { display: flex; gap: 6px; align-items: center; }
.poll-option-row input { flex: 1; min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--input); }

/* Compacto: horário à esquerda, nome na mesma linha do texto, sem avatar, quase sem espaço. */
.chat-messages[data-density="compact"] { padding-top: 6px; }
.chat-messages[data-density="compact"] .message { display: block; padding: 1px 10px 1px 64px; margin-top: 0; border-radius: 4px; line-height: 1.38; }
.chat-messages[data-density="compact"] .message-avatar { display: none; }
.chat-messages[data-density="compact"] .message-content { display: block; }
.chat-messages[data-density="compact"] .message-meta,
.chat-messages[data-density="compact"] .message.grouped .message-meta { display: inline; margin-right: 6px; }
.chat-messages[data-density="compact"] .message-meta b { font-size: 13px; }
.chat-messages[data-density="compact"] .message-meta b::after { content: ""; }
.chat-messages[data-density="compact"] .message-meta time { position: absolute; left: 8px; top: 3px; width: 46px; text-align: right; font-size: 10px; }
.chat-messages[data-density="compact"] .message.grouped .message-meta time { opacity: 0; }
.chat-messages[data-density="compact"] .message:hover .message-meta time { opacity: 1; }
.chat-messages[data-density="compact"] .message-body { display: inline; font-size: 13px; line-height: 1.38; }
.chat-messages[data-density="compact"] .message-reply { margin: 2px 0 0; padding-left: 14px; }
.chat-messages[data-density="compact"] .message-reply::before { left: 2px; width: 8px; }
.chat-messages[data-density="compact"] .message-image { max-height: 200px; margin-top: 3px; }
.chat-messages[data-density="compact"] .message-reactions { margin-top: 2px; }
.chat-messages[data-density="compact"] .reaction-chip { height: 22px; font-size: 12px; }
.chat-messages[data-density="compact"] .day-divider { margin: 8px 8px 2px; }
.chat-messages[data-density="compact"] .message-actions { top: -12px; }

/* barra lateral: etiqueta do Watch abaixo dos membros (nunca parece uma pessoa) */
.voice-watch-tag { display: flex; align-items: center; gap: 6px; margin: 0 6px 8px 36px; padding: 3px 9px 3px 6px; width: fit-content; max-width: calc(100% - 42px); border-radius: 999px; border: 1px solid color-mix(in srgb, var(--mint) 30%, transparent); background: var(--mint-dim); color: var(--mint); font-size: 10.5px; font-weight: 700; }
.voice-watch-icon { font-size: 11px; }
.voice-watch-state { font-size: 8px; }
.voice-watch-tag:not(.playing) { color: var(--muted); border-color: var(--line-strong); background: var(--surface-raised); }
.voice-watch-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.voice-watch-dj { font-size: 10px; }

@media (max-width: 760px) {
  .control-group.tools { display: none; }
  .more-tools { display: block; }
  .roulette-panel { inset: 6px; width: auto; }
  .board-toolbar { gap: 6px; }
  .board-size span { display: none; }
  .board-size input { width: 64px; }
  .annotate-title { display: none; }
  .stage-header:has(.annotate-bar:not([hidden])) { flex-wrap: wrap; }
  .stage-header .annotate-bar { order: 3; flex-basis: 100%; }
  .stage-pill { font-size: 11px; }
  .stage-pill > span:nth-child(2), .pill-dot { display: none; }
}


/* ==========================================================================
   Rodada 5: ferramentas do chat, chamadas na DM, código, prévias, paleta,
   janela flutuante e Modo Streamer
   ========================================================================== */

:root {
  --code-bg: #0b111b;
  --code-head: #111a27;
  --code-text: #dbe4ee;
  --code-keyword: #c792ea;
  --code-string: #a5e075;
  --code-number: #f78c6c;
  --code-comment: #6b7a90;
  --code-function: #82aaff;
  --code-type: #ffcb6b;
  --mark-bg: rgba(251, 191, 36, 0.32);
}
:root[data-theme="light"] {
  --code-bg: #f6f8fb;
  --code-head: #eaeef4;
  --code-text: #1e293b;
  --code-keyword: #8b3fc7;
  --code-string: #2f7d32;
  --code-number: #c2410c;
  --code-comment: #7c8798;
  --code-function: #2457c5;
  --code-type: #a16207;
  --mark-bg: rgba(250, 204, 21, 0.45);
}

/* cabeçalho do chat: ligar, fixadas, busca */
.chat-header-tools .header-tool { position: relative; width: 34px; height: 34px; border-radius: 9px; }
.chat-header-tools .header-tool svg { width: 18px; height: 18px; }
.chat-header-tools .header-tool.on { color: var(--mint); background: var(--mint-dim); border-color: color-mix(in srgb, var(--mint) 35%, transparent); }
.chat-header-tools .header-tool:disabled { opacity: 0.4; cursor: not-allowed; }
#dmVoiceCallButton:not(:disabled):hover, #dmVideoCallButton:not(:disabled):hover { color: var(--mint); }
.header-count { position: absolute; top: -5px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger-strong); color: #fff; font: 800 10px/17px var(--font-display); text-align: center; box-shadow: 0 0 0 2px var(--canvas); }
#pinsButton.has-items { color: var(--text); }
.header-popover-wrap { position: relative; }
.pins-popover { position: absolute; z-index: 60; top: calc(100% + 8px); right: -6px; width: min(420px, calc(100vw - 24px)); max-height: min(520px, 70vh); display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--overlay); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop-in 0.14s var(--ease); }
.pins-popover header { display: grid; gap: 2px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.pins-popover header b { font-size: 13.5px; }
.pins-popover header small { color: var(--muted); font-size: 11px; }
.pins-popover header small:empty { display: none; }
.pins-list { overflow-y: auto; padding: 6px; display: grid; gap: 4px; }
.pin-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 10px; border: 1px solid transparent; }
.pin-item:hover { background: var(--surface-hover); border-color: var(--line); }
.pin-item-copy { min-width: 0; display: grid; gap: 4px; }
.pin-item-meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pin-item-meta b { font-size: 12.5px; }
.pin-item-meta time, .pin-item-by { color: var(--muted-dark); font-size: 10.5px; }
.pin-item-text { margin: 0; color: var(--text-soft); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pin-item-actions { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.pin-item-actions .text-button { font-size: 11px; padding: 4px 6px; }
.pin-item-actions .pin-remove:hover { color: var(--danger); }
.tool-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface-soft); color: var(--text); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.tool-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tool-empty { display: grid; justify-items: center; gap: 4px; padding: 26px 16px; color: var(--muted); text-align: center; }
.tool-empty-icon { font-size: 26px; }
.tool-empty b { color: var(--text); font-size: 13px; }
.tool-empty small { font-size: 11.5px; line-height: 1.45; max-width: 280px; }
.message.pinned { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--warn) 70%, transparent); }
.pinned-badge { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 6px; background: var(--warn-dim); color: var(--warn); font-size: 10px; font-weight: 700; }
.message-actions button.pin.on { color: var(--warn); }

/* busca no chat */
.chat-search { display: flex; flex-direction: column; gap: 6px; margin: 8px 4px 0; flex-shrink: 0; animation: fade-up 0.15s var(--ease); }
.chat-search-bar { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; border: 1px solid var(--mint); border-radius: 10px; background: var(--input); box-shadow: 0 0 0 3px var(--mint-dim); color: var(--muted); }
.chat-search-bar svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.chat-search-bar input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 13px; }
.chat-search-bar input:focus { outline: none; }
.chat-search-status { color: var(--muted); font-size: 11px; white-space: nowrap; }
.chat-search-results { max-height: min(320px, 40vh); overflow-y: auto; display: grid; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.chat-search:not(.has-results) .chat-search-results { display: none; }
.search-result { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; }
.search-result .tool-avatar { width: 30px; height: 30px; font-size: 12px; }
.search-result:hover, .search-result:focus-visible, .search-result.active { background: var(--surface-hover); outline: none; }
.search-result.active { box-shadow: inset 2px 0 0 var(--mint); }
.search-result-copy { min-width: 0; display: grid; gap: 2px; }
.search-result-meta { display: flex; align-items: baseline; gap: 8px; }
.search-result-meta b { font-size: 12px; }
.search-result-meta time { color: var(--muted-dark); font-size: 10.5px; }
.search-result-text { color: var(--text-soft); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.search-more { width: 100%; padding: 9px; border: 1px dashed var(--line-strong); border-radius: 8px; background: transparent; color: var(--muted); font-size: 11.5px; }
.search-more:hover { color: var(--mint); border-color: var(--mint); }
mark.search-hit { padding: 0 1px; border-radius: 3px; background: var(--mark-bg); color: inherit; box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent); }

/* chamada na DM: aviso de chamada em andamento e card de chamada recebida */
.dm-call-banner { display: flex; align-items: center; gap: 10px; margin: 8px 4px 0; padding: 9px 10px 9px 12px; border: 1px solid color-mix(in srgb, var(--mint) 35%, transparent); border-radius: 10px; background: var(--mint-dim); color: var(--text); font-size: 12.5px; font-weight: 600; flex-shrink: 0; }
.dm-call-banner span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-call-pulse { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 var(--mint-glow); animation: call-pulse 1.4s infinite; }
@keyframes call-pulse { 0% { box-shadow: 0 0 0 0 var(--mint-glow); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.incoming-call { position: fixed; z-index: 3000; top: 20px; left: 50%; width: min(420px, calc(100vw - 24px)); display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "avatar copy" "actions actions"; gap: 12px 14px; padding: 16px; border: 1px solid color-mix(in srgb, var(--mint) 35%, var(--line-strong)); border-radius: 16px; background: var(--overlay); box-shadow: var(--shadow-lg), 0 0 0 6px color-mix(in srgb, var(--mint) 8%, transparent); transform: translate(-50%, -14px) scale(0.98); opacity: 0; transition: transform 0.25s var(--ease), opacity 0.2s ease; }
.incoming-call.show { transform: translate(-50%, 0); opacity: 1; }
.incoming-call-avatar { grid-area: avatar; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface-soft); font-size: 22px; font-weight: 800; animation: ring-glow 1.2s ease-in-out infinite; }
.incoming-call-avatar img { width: 100%; height: 100%; object-fit: cover; }
@keyframes ring-glow { 0%, 100% { box-shadow: 0 0 0 0 var(--mint-glow); } 50% { box-shadow: 0 0 0 8px transparent; } }
.incoming-call-copy { grid-area: copy; min-width: 0; display: grid; align-content: center; gap: 3px; }
.incoming-call-copy b { font-family: var(--font-display); font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incoming-call-copy small { color: var(--muted); font-size: 12px; }
.incoming-call-actions { grid-area: actions; display: flex; gap: 8px; }
.incoming-call-actions button { flex: 1; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; font-size: 13px; font-weight: 800; transition: transform 0.12s var(--ease), filter 0.12s ease; }
.incoming-call-actions button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.incoming-call-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.call-answer { background: #22c55e; color: #052e14; }
.call-answer.video { background: #38bdf8; color: #062234; }
.call-decline { background: var(--danger-strong); color: #fff; }
.call-decline svg { fill: currentColor; stroke: none; }
@media (prefers-reduced-motion: reduce) { .incoming-call-avatar, .dm-call-pulse { animation: none; } }

/* blocos de código e código inline */
.inline-code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--code-bg); color: var(--code-text); font: 0.9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.code-block { max-width: min(760px, 100%); margin: 6px 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--code-bg); overflow: hidden; white-space: normal; }
.code-head { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); background: var(--code-head); }
.code-lang { color: var(--text); font: 700 11px/1 var(--font-display); letter-spacing: 0.02em; }
.code-lines { flex: 1; color: var(--muted-dark); font-size: 10.5px; }
.code-copy { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface-raised); color: var(--muted); font-size: 11px; font-weight: 700; transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease; }
.code-copy:hover { color: var(--text); border-color: var(--muted-dark); }
.code-copy.copied { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 45%, transparent); background: var(--mint-dim); }
.code-pre { margin: 0; padding: 12px 14px; max-height: 420px; overflow: auto; color: var(--code-text); font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; white-space: pre; }
.code-pre code { font: inherit; }
.tok-keyword { color: var(--code-keyword); font-weight: 600; }
.tok-string { color: var(--code-string); }
.tok-number { color: var(--code-number); }
.tok-comment { color: var(--code-comment); font-style: italic; }
.tok-function { color: var(--code-function); }
.tok-type { color: var(--code-type); }

/* prévias de links (rich embeds) */
.link-previews { display: grid; gap: 6px; margin-top: 6px; }
.link-preview-slot { display: none; }
.link-card { --link-accent: var(--mint); max-width: 460px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 12px 10px 14px; border: 1px solid var(--line-strong); border-left: 3px solid var(--link-accent); border-radius: 10px; background: var(--surface-raised); color: var(--text); text-decoration: none; transition: border-color 0.15s ease, background 0.15s ease; }
.link-card:hover { background: var(--surface-hover); border-color: color-mix(in srgb, var(--link-accent) 45%, var(--line-strong)); }
.link-card-copy { min-width: 0; display: grid; align-content: start; gap: 3px; }
.link-card-site { color: var(--muted); font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-card-title { color: var(--text); font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-card:hover .link-card-title { text-decoration: underline; }
.link-card-description { color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link-card-media { position: relative; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--surface-soft); align-self: center; }
.link-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-card-media.video { width: 128px; height: 72px; }
.link-card-play { position: absolute; inset: 0; margin: auto; width: 34px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: rgba(220, 38, 38, 0.92); color: #fff; font-size: 11px; }
.link-card.kind-video, .link-card.kind-image { grid-template-columns: 1fr; }
.link-card.kind-video .link-card-media, .link-card.kind-image .link-card-media { order: 2; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: 240px; }
.link-card.kind-image .link-card-media { aspect-ratio: auto; }
.link-card.kind-image .link-card-media img { height: auto; max-height: 300px; object-fit: contain; }
.link-card.kind-video .link-card-play { width: 52px; height: 36px; font-size: 15px; }
.chat-messages[data-density="compact"] .link-card { padding: 8px 10px; }

/* busca rápida (Ctrl+K) */
.command-palette { position: fixed; inset: 0; z-index: 2900; display: flex; align-items: flex-start; justify-content: center; padding: min(14vh, 120px) 16px 16px; background: var(--scrim); backdrop-filter: blur(3px); animation: fade-in 0.12s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.palette-card { width: min(620px, 100%); max-height: min(560px, 76vh); display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--overlay); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop-in 0.14s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 54px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.palette-input input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 15px; }
.palette-input input:focus { outline: none; }
.palette-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.palette-section { padding: 10px 10px 4px; color: var(--muted-dark); font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 9px; cursor: pointer; }
.palette-item.active { background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--line-strong); }
.palette-icon { position: relative; width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; }
.palette-icon.glyph { border-radius: 8px; background: var(--surface-raised); color: var(--muted); font-size: 15px; font-weight: 800; }
.palette-icon.glyph.kind-text { font-size: 18px; }
.palette-icon .status-dot { position: absolute; right: -2px; bottom: -2px; }
.palette-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface-soft); color: var(--text); font-size: 13px; font-weight: 700; }
.palette-avatar.square { border-radius: 9px; }
.palette-avatar img { width: 100%; height: 100%; object-fit: cover; }
.palette-copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.palette-copy b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-copy small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-enter { color: var(--muted-dark); font-size: 13px; opacity: 0; }
.palette-item.active .palette-enter { opacity: 1; }
.palette-empty { padding: 28px 16px; color: var(--muted); text-align: center; font-size: 13px; }
.palette-hint { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--muted-dark); font-size: 11px; }
.palette-hint span { display: inline-flex; align-items: center; gap: 4px; }

/* janela flutuante (Picture-in-Picture) */
.player-button svg .fill, .round-action svg .fill { fill: currentColor; stroke: none; }
#wtPipButton svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
#wtPipButton.on, #pipButton.on { color: var(--mint); }
#pipButton.on { background: var(--mint-dim); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 40%, transparent); }
.pip-placeholder { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #05080d; color: #e2e8f0; }
.pip-placeholder-icon { font-size: 34px; color: var(--mint); }
.player-frame.in-pip .youtube-container { visibility: hidden; }

/* Modo Streamer / Privacidade: SÓ visual. Nada aqui toca em captura de tela ou WebRTC. */
.streamer-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 12px; }
.streamer-demo b, .streamer-demo code { color: var(--text); }
body.streamer-mode .sensitive,
body.streamer-mode .streamer-demo .sensitive {
  filter: blur(6px);
  transition: filter 0.18s ease;
}
body.streamer-mode .sensitive:hover { filter: none; }
body.streamer-mode .user-card-identity:hover #userSubtitle { filter: none; }
.account-row b { font-size: 12.5px; word-break: break-all; }

@media (max-width: 760px) {
  .chat-header-tools { gap: 4px; }
  .chat-header-tools .header-tool { width: 30px; height: 30px; }
  .pins-popover { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; }
  .incoming-call-actions button span { display: none; }
  .link-card-media.video { width: 96px; height: 54px; }
  .palette-hint { display: none; }
}

/* ==========================================================================
   v6 — cutucar, volume 200%, salas temporárias, categorias, regras de canal,
   auditoria, mensagens autodestrutivas, spoilers, reações ao vivo, legendas,
   transmissão do arquivo local, teclas de atalho e app instalável
   ========================================================================== */

/* ---- barra lateral: categorias recolhíveis e arrastar/soltar ---- */
.channel-group { margin-top: 2px; }
.category-header { padding: 12px 4px 4px 2px; gap: 2px; border-radius: 6px; }
.category-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 2px 2px; border: 0; background: transparent; color: var(--muted-dark); font: inherit; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-align: left; }
.category-toggle span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-toggle:hover { color: var(--text-soft); }
.category-chevron { display: inline-block; width: 12px; font-size: 10px; transition: transform 0.18s var(--ease); }
.category-header.collapsed .category-chevron { transform: rotate(-90deg); }
.category-add { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted-dark); font-size: 13px; line-height: 1; }
.category-add:hover { background: var(--surface-hover); color: var(--text); }
.category-header .category-add { opacity: 0; transition: opacity 0.12s ease; }
.category-header:hover .category-add, .category-header .category-add:focus-visible { opacity: 1; }
.category-empty { display: block; margin: 2px 6px 6px 26px; padding: 6px 8px; border: 1px dashed var(--line-strong); border-radius: 7px; color: var(--muted-dark); font-size: 11px; }
.add-category-button { margin: 10px 6px 0; }
.channel-rule { flex: 0 0 auto; font-size: 11px; opacity: 0.85; }
.channel-count.empty { background: var(--surface-soft); color: var(--muted); }

.can-drag .channel-entry-row[draggable="true"] { cursor: grab; }
.can-drag .category-header[draggable="true"] { cursor: grab; }
.channel-entry-row.dragging, .category-header.dragging { opacity: 0.4; }
.drag-active .channel-entry-row, .drag-active .category-header, .drag-active [data-drop-section] { transition: box-shadow 0.08s ease, background 0.08s ease; }
.drop-before { box-shadow: inset 0 2px 0 0 var(--mint); }
.drop-after { box-shadow: inset 0 -2px 0 0 var(--mint); }
.drop-into { background: var(--mint-dim); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 55%, transparent); }

/* ---- salas de voz temporárias ---- */
.temp-room-list:empty { display: none; }
.temp-room-list { margin-top: 2px; }
.channel-entry.temp-room .channel-glyph { color: var(--warn); }
.temp-room-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.temp-room-badge { padding: 4px 10px; border-radius: 20px; background: var(--warn-dim); color: var(--warn); font-size: 11px; font-weight: 700; white-space: nowrap; }
.temp-room-limit { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.temp-room-limit select { min-height: 28px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--input); color: var(--text); font: inherit; font-size: 12px; }
.temp-room-lock { min-height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface-raised); color: var(--text); font-size: 12px; font-weight: 600; }
.temp-room-lock.on { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: var(--warn-dim); color: var(--warn); }
.temp-room-lock:disabled, .temp-room-limit select:disabled { opacity: 0.6; cursor: not-allowed; }
.voice-lobby-temp { max-width: 420px; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--warn-dim); color: var(--warn); font-size: 12px; line-height: 1.45; }
.voice-lobby-join[data-mode="knock"] { background: var(--warn); color: #241a02; }
.voice-lobby-join[data-mode="pending"], .voice-lobby-join[data-mode="full"] { opacity: 0.75; cursor: not-allowed; }
.knock-stack { position: fixed; z-index: 2800; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 10px; width: min(340px, calc(100vw - 32px)); pointer-events: none; }
.knock-card { pointer-events: auto; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px 12px; align-items: center; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 12px; background: var(--overlay); box-shadow: var(--shadow-lg); animation: pop-in 0.18s var(--ease); }
.knock-card.answered { opacity: 0.6; pointer-events: none; }
.knock-avatar { width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); font-weight: 700; }
.knock-avatar img { width: 100%; height: 100%; object-fit: cover; }
.knock-copy { min-width: 0; display: grid; gap: 2px; }
.knock-copy b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knock-copy small { color: var(--muted); font-size: 11.5px; }
.knock-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }

/* ---- cutucar (poke) ---- */
.poke-composer { position: fixed; z-index: 2900; width: min(320px, calc(100vw - 16px)); display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--overlay); color: var(--text); box-shadow: var(--shadow-lg); animation: pop-in 0.15s var(--ease); }
.poke-composer b { font-size: 13px; }
.poke-composer input { min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--input); color: var(--text); font: inherit; font-size: 13px; }
.poke-composer input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.poke-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.poke-suggestions button { padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface-raised); color: var(--text-soft); font-size: 11.5px; }
.poke-suggestions button:hover { border-color: color-mix(in srgb, var(--mint) 50%, transparent); color: var(--mint); }
.poke-composer-actions { display: flex; justify-content: flex-end; gap: 8px; }
.poke-button { font-size: 14px; }
.poke-link { align-self: flex-start; color: var(--warn); font-weight: 600; }
.poke-alert { position: fixed; z-index: 3100; top: 18px; left: 50%; width: min(440px, calc(100vw - 24px)); display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border: 2px solid var(--warn); border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--warn) 18%, var(--overlay)), var(--overlay) 70%); color: var(--text); box-shadow: 0 0 0 6px var(--warn-dim), var(--shadow-lg); transform: translate(-50%, -140%); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.25s ease; }
.poke-alert.show { transform: translate(-50%, 0); opacity: 1; }
.poke-alert.shake { animation: poke-shake 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97) 2; }
.poke-alert.quiet { border-color: var(--line-strong); box-shadow: var(--shadow-lg); background: var(--overlay); }
.poke-alert-avatar { width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--warn); color: #241a02; font-size: 20px; font-weight: 800; }
.poke-alert-avatar img { width: 100%; height: 100%; object-fit: cover; }
.poke-alert-copy { min-width: 0; display: grid; gap: 3px; }
.poke-alert-copy b { font-size: 15px; font-family: var(--font-display); }
.poke-alert-copy q { color: var(--text-soft); font-size: 13px; overflow-wrap: anywhere; }
.poke-alert-copy q:empty { display: none; }
.poke-alert-copy small { color: var(--muted); font-size: 11px; }
#appShell.poked { animation: shell-nudge 0.5s ease 1; }
@keyframes poke-shake {
  0%, 100% { transform: translate(-50%, 0) rotate(0); }
  10%, 50%, 90% { transform: translate(calc(-50% - 9px), 0) rotate(-2deg); }
  30%, 70% { transform: translate(calc(-50% + 9px), 0) rotate(2deg); }
}
@keyframes shell-nudge {
  0%, 100% { transform: none; }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* ---- volume por pessoa (0–200%) e "Limpar voz" ---- */
.participant-volume-row input { accent-color: var(--mint); }
.participant-volume-marks { display: flex; justify-content: space-between; margin: -6px 52px 0 0; color: var(--muted-dark); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.participant-volume-marks span:nth-child(2) { transform: translateX(4px); }
.participant-clean { padding: 8px 10px; border-radius: 8px; background: var(--surface-raised); line-height: 1.35; }
.participant-clean span { flex: 1; }

/* ---- regras do canal (diálogo) ---- */
.channel-rules { display: grid; margin-top: 14px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); overflow: hidden; }
.channel-rules legend { padding: 0 6px; margin-left: 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.channel-rules .toggle.row { align-items: center; }
.slowmode-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 12px; }
.slowmode-row > span { display: grid; gap: 2px; min-width: 0; }
.slowmode-row b { color: var(--text); font-size: 13px; font-weight: 600; }
.slowmode-row small { color: var(--muted); font-size: 11.5px; }
.slowmode-row select { min-height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--input); color: var(--text); font: inherit; font-size: 12px; }

/* ---- composer: autodestruição, modo lento, somente leitura ---- */
.ephemeral-wrap { position: relative; flex: 0 0 auto; }
.ephemeral-button { height: 32px; min-width: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 7px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); transition: background 0.15s ease, color 0.15s ease; }
.ephemeral-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ephemeral-button:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.ephemeral-button.on { background: var(--warn-dim); color: var(--warn); }
.ephemeral-button:disabled { opacity: 0.4; cursor: not-allowed; }
.ephemeral-label { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ephemeral-label:empty { display: none; }
.ephemeral-menu { position: absolute; z-index: 95; right: 0; bottom: calc(100% + 10px); width: 230px; display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--overlay); box-shadow: var(--shadow-lg); animation: pop-in 0.15s var(--ease); }
.ephemeral-menu b { padding: 2px 6px; font-size: 12.5px; }
.ephemeral-menu small { padding: 0 6px 6px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.ephemeral-menu button { min-height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text-soft); font-size: 12.5px; text-align: left; }
.ephemeral-menu button:hover, .ephemeral-menu button:focus-visible { background: var(--surface-hover); outline: none; }
.ephemeral-menu button.active { background: var(--warn-dim); color: var(--warn); font-weight: 700; }
.composer-status { display: flex; align-items: center; gap: 10px; min-height: 22px; padding: 0 4px; }
.composer-status .chat-feedback { flex: 1; min-width: 0; }
.slowmode-note { flex: 0 0 auto; margin-top: 3px; padding: 2px 9px; border-radius: 20px; background: var(--warn-dim); color: var(--warn); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
#chatForm.read-only { border-style: dashed; background: var(--surface-raised); }
#chatForm.read-only textarea::placeholder { color: var(--warn); opacity: 1; }
.expiry-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 7px; border-radius: 20px; background: var(--warn-dim); color: var(--warn); font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.expiry-badge.soon { background: var(--danger-dim); color: var(--danger); animation: pulse-ring 1s infinite; }
.message.expiring { animation: message-vanish 0.45s ease forwards; pointer-events: none; }
@keyframes message-vanish { to { opacity: 0; transform: scale(0.98); filter: blur(3px); } }

/* ---- spoilers ---- */
.spoiler { position: relative; padding: 0 3px; border-radius: 4px; background: var(--surface-soft); box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background 0.18s ease; }
.spoiler:not(.revealed) { display: inline-block; min-width: 68px; max-width: 100%; vertical-align: bottom; background: #161c27; cursor: pointer; user-select: none; }
.spoiler:not(.revealed) .spoiler-content { opacity: 0; }
.spoiler:not(.revealed)::after { content: "SPOILER"; position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; color: #8b97a8; font-size: 9.5px; font-weight: 800; letter-spacing: 0.16em; }
.spoiler:not(.revealed):hover { background: #222a38; }
.spoiler:not(.revealed):hover::after { color: #cbd5e1; }
.spoiler.revealed .spoiler-content { animation: fade-up 0.18s var(--ease); }
.spoiler:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.spoiler-image { position: relative; display: inline-block; max-width: min(420px, 100%); margin-top: 6px; overflow: hidden; border-radius: 10px; cursor: pointer; }
.spoiler-image .message-image { margin-top: 0; filter: blur(24px) saturate(0.6); transform: scale(1.08); transition: filter 0.3s ease, transform 0.3s ease; pointer-events: none; }
.spoiler-image-badge { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(6, 9, 14, 0.45); color: #fff; text-align: center; transition: opacity 0.2s ease; }
.spoiler-image-badge b { padding: 5px 12px; border-radius: 20px; background: rgba(6, 9, 14, 0.82); font-size: 12px; letter-spacing: 0.14em; }
.spoiler-image-badge small { font-size: 11px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.spoiler-image:hover .spoiler-image-badge b { background: rgba(6, 9, 14, 0.95); }
.spoiler-image.revealed { cursor: default; }
.spoiler-image.revealed .message-image { filter: none; transform: none; pointer-events: auto; }
.spoiler-image.revealed .spoiler-image-badge { opacity: 0; pointer-events: none; }
.spoiler-image:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.attachment-spoiler { margin-left: auto; font-size: 11.5px; }

/* ---- registro de auditoria ---- */
.audit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.audit-filter { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 10px; color: var(--muted); font-size: 12px; }
.audit-filter select { min-height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--input); color: var(--text); font: inherit; font-size: 12px; }
.audit-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); overflow: hidden; }
.audit-entry { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.audit-entry:last-child { border-bottom: 0; }
.audit-entry.fresh { animation: highlight 2.4s ease; }
.audit-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-soft); font-size: 14px; }
.audit-entry[data-action^="message"] .audit-icon, .audit-entry[data-action$="delete"] .audit-icon, .audit-entry[data-action="member.kick"] .audit-icon { background: var(--danger-dim); }
.audit-entry[data-action^="channel.rules"] .audit-icon { background: var(--warn-dim); }
.audit-copy { min-width: 0; display: grid; gap: 3px; }
.audit-copy p { font-size: 12.5px; line-height: 1.45; color: var(--text-soft); overflow-wrap: anywhere; }
.audit-copy b { color: var(--text); }
.audit-detail { color: var(--muted); font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
.audit-entry time { color: var(--muted-dark); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-empty { display: flex; align-items: center; gap: 8px; padding: 18px 16px; color: var(--muted); font-size: 12.5px; }
#auditMoreButton { margin-top: 10px; }
.role-permissions-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.role-permissions-head .settings-label { margin: 0; }
#moderatorPresetButton { color: var(--mint); font-weight: 600; }

/* ---- teclas de atalho ---- */
.keybind-list { display: flex; flex-direction: column; margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); overflow: hidden; }
.keybind-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, auto) auto; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.keybind-row:last-child { border-bottom: 0; }
.keybind-row.recording { background: var(--mint-dim); }
.keybind-copy { min-width: 0; display: grid; gap: 2px; }
.keybind-copy b { font-size: 13px; font-weight: 600; }
.keybind-copy small { color: var(--muted); font-size: 11.5px; }
.keybind-value { color: var(--text); font-size: 12px; text-align: right; }
.keybind-value.empty { color: var(--muted-dark); font-style: italic; }
.keybind-row.recording .keybind-value { color: var(--mint); font-style: normal; font-weight: 600; animation: pulse-text 1.1s ease-in-out infinite; }
.keybind-value kbd { display: inline-block; padding: 3px 9px; border: 1px solid var(--line-strong); border-bottom-width: 3px; border-radius: 7px; background: var(--surface); color: var(--text); font: 600 12px/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace; }
.keybind-actions { display: flex; align-items: center; gap: 4px; }
.keybind-clear:disabled { opacity: 0.35; cursor: not-allowed; }
.settings-note.small { margin-top: 12px; font-size: 11px; }
@keyframes pulse-text { 50% { opacity: 0.45; } }

/* ---- app instalável ---- */
.install-card { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); }
.install-card-head { display: flex; align-items: center; gap: 14px; }
.install-card-head img { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--shadow-md); }
.install-card-head b { display: block; font-size: 14px; }
.install-card-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* ---- Watch Together: transmissão, legenda e reações ---- */
#streamPlayer { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.sync-chip[data-state="streaming"] { color: #93c5fd; }
.sync-chip[data-state="streaming"] i { background: #60a5fa; box-shadow: 0 0 6px #60a5fa; }
.subtitle-layer { position: absolute; z-index: 4; left: 50%; bottom: 6%; transform: translateX(-50%); width: min(88%, 900px); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; text-align: center; }
.subtitle-line { display: inline-block; max-width: 100%; padding: 3px 12px 4px; border-radius: 6px; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: clamp(14px, 2.6cqw, 26px); font-weight: 600; line-height: 1.32; text-shadow: 0 1px 2px #000; overflow-wrap: anywhere; }
.player-frame:fullscreen .subtitle-line, .call-panel.is-fullscreen .subtitle-line { font-size: clamp(18px, 2.4vw, 34px); }
.wt-subtitle-row { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: -4px; }
.wt-subtitle-loaded { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 4px 6px 10px; border-radius: 8px; background: var(--mint-dim); color: var(--text-soft); font-size: 12px; }
.wt-subtitle-loaded > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button.danger { color: var(--danger); }
.text-button.danger:hover:not(:disabled) { color: var(--danger-soft); background: var(--danger-dim); }
#wtSubtitleToggle { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
#wtSubtitleToggle.on { color: var(--mint); }
.reaction-wrap { flex: 0 0 auto; }
#wtReactButton, #callReactButton { font-size: 17px; line-height: 1; }
#wtReactButton.on, #callReactButton.on { background: var(--mint-dim); }
.reaction-popover { width: auto; flex-direction: row; flex-wrap: nowrap; gap: 2px; padding: 6px; border-radius: 30px; }
.reaction-choice { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; font-size: 21px; line-height: 1; transition: transform 0.12s var(--ease), background 0.12s ease; }
.reaction-choice:hover, .reaction-choice:focus-visible { background: var(--surface-hover); transform: translateY(-3px) scale(1.18); outline: none; }
.reaction-choice:active { transform: scale(0.92); }
.reaction-layer { position: absolute; z-index: 7; right: 0; bottom: 0; width: 160px; height: 70%; overflow: hidden; pointer-events: none; }
.reaction-layer.stage { z-index: 13; }
.live-reaction { position: absolute; bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: var(--size, 2rem); line-height: 1; animation: reaction-float var(--duration, 2.8s) cubic-bezier(0.25, 0.6, 0.35, 1) forwards; will-change: transform, opacity; }
.live-reaction-emoji { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45)); }
.live-reaction small { max-width: 110px; padding: 1px 7px; border-radius: 10px; background: rgba(6, 9, 14, 0.72); color: #fff; font-size: 10px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes reaction-float {
  0% { transform: translate(0, 12px) scale(0.4); opacity: 0; }
  12% { transform: translate(calc(var(--drift) * 0.2), -10px) scale(1.1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--drift), calc(var(--rise) * -1)) scale(0.9); opacity: 0; }
}
.reaction-popover.up { left: 50%; }

/* ---- tema claro ---- */
:root[data-theme="light"] .spoiler:not(.revealed) { background: #2b3342; }
:root[data-theme="light"] .spoiler:not(.revealed):hover { background: #3a4456; }
:root[data-theme="light"] .spoiler.revealed { background: #e4e9f0; }
:root[data-theme="light"] .poke-alert-avatar { color: #241a02; }
:root[data-theme="light"] .temp-room-badge, :root[data-theme="light"] .voice-lobby-temp, :root[data-theme="light"] .slowmode-note, :root[data-theme="light"] .expiry-badge, :root[data-theme="light"] .ephemeral-button.on, :root[data-theme="light"] .ephemeral-menu button.active, :root[data-theme="light"] .temp-room-lock.on { color: #92400e; }
:root[data-theme="light"] #chatForm.read-only textarea::placeholder { color: #92400e; }
:root[data-theme="light"] .channel-entry.temp-room .channel-glyph { color: #b45309; }

/* ---- movimento reduzido ---- */
@media (prefers-reduced-motion: reduce) {
  .poke-alert.shake, #appShell.poked, .expiry-badge.soon, .keybind-row.recording .keybind-value { animation: none; }
  .poke-alert { transition: opacity 0.2s ease; }
  .live-reaction { animation-duration: 1.6s; animation-name: reaction-fade; }
  @keyframes reaction-fade { 0% { opacity: 0; } 20%, 70% { opacity: 1; } 100% { opacity: 0; } }
}

/* ---- telas estreitas ---- */
@media (max-width: 760px) {
  .keybind-row { grid-template-columns: minmax(0, 1fr) auto; }
  .keybind-value { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .keybind-actions { grid-row: 1; grid-column: 2; }
  .audit-entry { grid-template-columns: 26px minmax(0, 1fr); }
  .audit-entry time { grid-column: 2; }
  .audit-head { flex-direction: column; }
  .temp-room-badge { display: none; }
  .poke-alert { top: 10px; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; }
  .poke-alert-avatar { width: 42px; height: 42px; }
  .knock-stack { top: auto; bottom: 86px; right: 8px; left: 8px; width: auto; }
  .ephemeral-menu { right: -40px; }
  .reaction-popover { left: auto; right: -8px; transform: none; }
  .reaction-layer { width: 110px; }
  .attachment-spoiler span { font-size: 11px; }
}

/* ==========================================================================
   v7 — foco no palco, controles de vidro, menu de contexto e acabamento "dark glass"
   ========================================================================== */

:root {
  --glass-bg: rgba(14, 19, 28, 0.72);
  --glass-strong: rgba(10, 14, 21, 0.94);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-highlight: rgba(255, 255, 255, 0.04);
  --glass-blur: blur(12px) saturate(140%);
  --motion: 150ms;
}
:root[data-theme="light"] {
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(15, 23, 42, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.6);
}

/* ---- ações do card (aparecem ao passar o mouse) ---- */
.tile-actions { position: absolute; z-index: 6; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transform: translateY(-4px); transition: opacity var(--motion) ease, transform var(--motion) ease; pointer-events: none; }
.tile:hover .tile-actions, .tile:focus-within .tile-actions { opacity: 1; transform: none; pointer-events: auto; }
.tile-action { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 9px; background: rgba(8, 12, 18, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #f1f5f9; font-size: 16px; line-height: 1; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); transition: background var(--motion) ease, transform var(--motion) ease, border-color var(--motion) ease; }
.tile-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tile-action:hover { background: rgba(8, 12, 18, 0.82); border-color: rgba(255, 255, 255, 0.24); transform: translateY(-1px); }
.tile-action:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
/* Focar e tela cheia só fazem sentido com vídeo/tela; "pessoas" só no foco. */
.tile:not(.has-video) .tile-focus, .tile:not(.has-video) .tile-fullscreen { display: none; }
.tile:not(.focused) .tile-people { display: none; }
.tile-people[aria-pressed="true"] { color: var(--mint); }

/* ---- foco no palco: o card ocupa 100% da área útil ---- */
.tile-grid.stage-focus { align-content: stretch; justify-content: stretch; gap: 0; }
.tile-grid.stage-focus .tile:not(.focused) { display: none; }
.tile-grid.stage-focus .tile.focused { border-radius: 12px; outline: 0; box-shadow: none; background: #000; }
.tile-grid.stage-focus .tile.focused::before { display: none; }
.tile-grid.stage-focus .tile.focused video { object-fit: contain; }
.tile.focused { animation: focus-in var(--motion) var(--ease); }
@keyframes focus-in { from { opacity: 0.6; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.stage-bubbles { display: none; z-index: 14; top: 14px; right: 14px; }
.call-panel[data-focus="on"] .stage-bubbles { display: flex; }
.stage.bubbles-hidden .stage-bubbles { display: none !important; }
.call-panel[data-focus="on"] .tile-grid.stage-focus .tile.focused .tile-actions { top: 14px; right: auto; left: 14px; }

/* ---- modo imersivo (foco ou tela cheia): controles de vidro que somem sozinhos ---- */
.call-panel.immersive { position: relative; }
.call-panel.immersive .call-controls {
  position: absolute; z-index: 40; left: 50%; bottom: 18px; margin: 0; padding: 8px 10px;
  transform: translateX(-50%);
  border: 1px solid var(--glass-border); border-radius: 999px;
  background: rgba(10, 14, 21, 0.55); backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 var(--glass-highlight);
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}
.call-panel.immersive .control-group { background: transparent; border-color: transparent; }
.call-panel.immersive .stage-header { transition: opacity 0.25s ease, transform 0.25s var(--ease); }
.call-panel.immersive.controls-idle .call-controls { opacity: 0; transform: translate(-50%, 18px); pointer-events: none; }
.call-panel.immersive.controls-idle .stage-header,
.call-panel.immersive.controls-idle .stage-bubbles { opacity: 0; pointer-events: none; }
.call-panel.immersive.controls-idle .tile-actions { opacity: 0 !important; pointer-events: none !important; }
.call-panel.immersive.controls-idle, .call-panel.immersive.controls-idle * { cursor: none !important; }
.call-panel.immersive.is-fullscreen .stage-header { position: absolute; z-index: 35; top: 12px; left: 12px; right: 12px; margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(10, 14, 21, 0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.call-panel.immersive.is-fullscreen .stage { padding-top: 0; }
:root[data-theme="light"] .call-panel.immersive .call-controls { background: rgba(255, 255, 255, 0.62); }

/* ---- menu de contexto do Cloudky (botão direito) ---- */
.context-menu {
  position: fixed; z-index: 4000; min-width: 220px; max-width: min(300px, calc(100vw - 16px)); padding: 6px;
  border: 1px solid var(--glass-border); border-radius: 12px;
  background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 var(--glass-highlight);
  color: var(--text); transform-origin: var(--origin, top left);
  animation: context-in var(--motion) var(--ease);
}
.context-menu[hidden] { display: none; }
@keyframes context-in { from { opacity: 0; transform: scale(0.96) translateY(-2px); } to { opacity: 1; transform: none; } }
.context-menu-title { display: flex; align-items: center; gap: 8px; padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--glass-border); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.context-menu-title .context-avatar { width: 22px; height: 22px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); color: var(--text); font-size: 10px; letter-spacing: 0; }
.context-menu-title .context-avatar img { width: 100%; height: 100%; object-fit: cover; }
.context-item { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); font: inherit; font-size: 13px; text-align: left; transition: background var(--motion) ease, color var(--motion) ease; }
.context-item .context-icon { width: 18px; flex: 0 0 18px; text-align: center; font-size: 14px; }
.context-item .context-hint { margin-left: auto; color: var(--muted-dark); font-size: 11px; }
.context-item:hover:not(:disabled), .context-item:focus-visible { background: var(--mint-dim); color: var(--text); outline: none; }
.context-item.danger { color: var(--danger); }
.context-item.danger:hover:not(:disabled), .context-item.danger:focus-visible { background: var(--danger-dim); color: var(--danger-soft); }
.context-item:disabled { opacity: 0.45; cursor: not-allowed; }
.context-separator { height: 1px; margin: 5px 6px; background: var(--glass-border); }
.context-volume { display: grid; grid-template-columns: 18px minmax(0, 1fr) 42px; align-items: center; gap: 10px; padding: 6px 10px; font-size: 12px; color: var(--muted); }
.context-volume input { width: 100%; accent-color: var(--mint); }
.context-volume output { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }

/* ---- acabamento "dark glass": bordas sutis, popovers de vidro, transições curtas ---- */
.popover, .participant-menu, .ephemeral-menu, .poke-composer, .knock-card, .reaction-popover, .pins-popover, .emoji-picker, .composer-menu {
  border-color: var(--glass-border);
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 var(--glass-highlight);
}
.toast { background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-color: var(--glass-border); }
.call-panel, .chat-panel, .friends-panel { border-color: var(--glass-border); }
.call-panel { box-shadow: 0 1px 0 var(--glass-highlight) inset, 0 20px 50px rgba(0, 0, 0, 0.22); }
.tile { border-color: var(--glass-border); transition: box-shadow var(--motion) ease, outline-color var(--motion) ease, width 0.2s var(--ease), height 0.2s var(--ease); }
.channel-entry, .dm-row, .person-row, .icon-button, .round-action, .text-button, .button-primary, .button-secondary { transition-duration: var(--motion); }
.workspace, .friends-view, .voice-lobby, .server-welcome { animation: view-in var(--motion) var(--ease); }
@keyframes view-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .workspace, .friends-view, .voice-lobby, .server-welcome, .tile.focused, .context-menu { animation: none; }
  .call-panel.immersive .call-controls { transition: opacity 0.2s ease; }
}
@media (max-width: 760px) {
  .tile-actions { opacity: 1; transform: none; pointer-events: auto; }
  .tile-action { width: 30px; height: 30px; }
  .call-panel.immersive .call-controls { bottom: 10px; max-width: calc(100% - 16px); overflow-x: auto; }
}

/* ---- cartão de perfil ("Ver Perfil" no menu de contexto) ---- */
.user-popover { position: fixed; z-index: 3900; width: min(300px, calc(100vw - 16px)); overflow: hidden; border: 1px solid var(--glass-border); border-radius: 16px; background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), inset 0 1px 0 var(--glass-highlight); animation: context-in var(--motion) var(--ease); }
.user-popover-banner { height: 64px; background: linear-gradient(135deg, var(--banner, #3b82f6), color-mix(in srgb, var(--banner, #3b82f6) 45%, #0b1018)); }
.user-popover-avatar-wrap { position: absolute; top: 28px; left: 18px; }
.user-popover-avatar { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border: 4px solid var(--overlay); border-radius: 50%; background: var(--surface-soft); color: var(--text); font-size: 26px; font-weight: 800; }
.user-popover-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-popover-avatar-wrap .status-dot { right: 2px; bottom: 2px; width: 16px; height: 16px; border-width: 3px; border-color: var(--overlay); }
.user-popover-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 44px 18px 18px; }
.user-popover-name { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.02em; }
.user-popover-code { padding: 2px 8px; border: 1px solid var(--glass-border); border-radius: 8px; background: var(--surface-raised); color: var(--muted); font: 600 11.5px/1.5 ui-monospace, Menlo, monospace; }
.user-popover-code:hover { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 40%, transparent); }
.user-popover-status { color: var(--muted); font-size: 12px; }
.user-popover-bio { width: 100%; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--glass-border); color: var(--text-soft); font-size: 12.5px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.user-popover-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.user-popover-close { position: absolute; top: 8px; right: 8px; background: rgba(8, 12, 18, 0.45); border-color: transparent; color: #fff; }
.context-target { outline: 1px solid color-mix(in srgb, var(--mint) 45%, transparent); outline-offset: -1px; border-radius: 8px; }
/* Nome do card focado sobe enquanto a barra de controles está visível (não fica por baixo dela). */
.tile-grid.stage-focus .tile.focused .tile-badge { transition: bottom 0.25s var(--ease); }
.call-panel.immersive:not(.controls-idle) .tile-grid.stage-focus .tile.focused .tile-badge { bottom: 86px; }

/* ==========================================================================
   v8 — ícones vetoriais (substituem emojis de interface), sidebar no app instalado
   ========================================================================== */
.ui-icon { display: inline-block; flex: 0 0 auto; width: 1.15em; height: 1.15em; vertical-align: -0.2em; stroke: currentColor; fill: none; }
[data-icon]:not(.icon-only):not(:empty) > .ui-icon:first-child { margin-right: 0.45em; }
/* Botão/selo só com ícone: o SVG fica exatamente no centro da caixa (sem margem de rótulo). */
[data-icon].icon-only > .ui-icon, .icon-only > .ui-icon:only-child { margin: 0; }
/* Só ícone (sem texto): centralizado. Com texto, o ícone fica na mesma linha, à esquerda. */
[data-icon].icon-only { display: inline-grid; place-items: center; }
.text-button[data-icon]:not(.icon-only) { display: inline-flex; align-items: center; gap: 0.45em; }
.text-button[data-icon]:not(.icon-only) > .ui-icon:first-child { margin-right: 0; }
.icon-button > .ui-icon, .round-action > .ui-icon, .tile-action > .ui-icon, .category-add > .ui-icon { width: 17px; height: 17px; margin: 0; vertical-align: 0; }
.context-icon .ui-icon { width: 16px; height: 16px; vertical-align: -3px; }
.person-actions .icon-button .ui-icon { width: 16px; height: 16px; }
.send-button .ui-icon { width: 18px; height: 18px; }
.nav-icon .ui-icon, .dm-nav-icon .ui-icon { width: 17px; height: 17px; }
.empty-state > span .ui-icon, .empty-chat-icon .ui-icon, .tool-empty-icon .ui-icon { width: 26px; height: 26px; }
.channel-rule .ui-icon { width: 13px; height: 13px; vertical-align: -2px; color: var(--muted); }
.channel-glyph .ui-icon { width: 16px; height: 16px; vertical-align: -3px; }
.voice-watch-icon .ui-icon, .voice-watch-dj .ui-icon { width: 13px; height: 13px; }
.audit-icon .ui-icon { width: 15px; height: 15px; }
.file-card-icon .ui-icon, .chat-file-icon .ui-icon { width: 24px; height: 24px; }
.owner-badge .ui-icon { width: 14px; height: 14px; color: #fbbf24; vertical-align: -2px; }
.palette-icon .ui-icon { width: 16px; height: 16px; }
.dm-banner-icon .ui-icon { width: 22px; height: 22px; }
.whisper-button b .ui-icon { width: 20px; height: 20px; }
.type-icon .ui-icon { width: 18px; height: 18px; }

/* ---- App instalado (PWA): a janela já mostra "Cloudky"; a barra lateral fica compacta ---- */
@media (display-mode: standalone), (display-mode: window-controls-overlay) {
  .sidebar-brand-row { display: none; }
  .sidebar { padding-top: 12px; gap: 10px; }
}
:root.app-installed .sidebar-brand-row { display: none; }
:root.app-installed .sidebar { padding-top: 12px; gap: 10px; }
:root.app-installed .quick-search-button { height: 36px; border-color: var(--glass-border, var(--line)); }
/* "Play" de vídeo: triângulo cheio (como o botão do player), não só o contorno. */
.link-card-play .ui-icon, .player-empty-icon .ui-icon, .play-mark .ui-icon, .lobby-watch-icon .ui-icon { fill: currentColor; stroke-width: 1.2; }
.player-empty-icon .ui-icon { width: 22px; height: 22px; margin: 0 0 0 3px; }
.play-mark .ui-icon { width: 12px; height: 12px; margin: 0; }

/* ---- Trava de acesso do servidor (SERVER_ACCESS_CODE) ---- */
.access-card { display: flex; flex-direction: column; gap: 12px; }
.access-card h2 { margin: 6px 0 0; }
.access-card .login-subtitle { margin-bottom: 4px; }
.access-form { display: flex; flex-direction: column; gap: 8px; }
.access-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.access-input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input); color: var(--text); font-size: 15px; letter-spacing: 0.08em; }
.access-input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 22%, transparent); }
.access-submit, .access-invite { width: 100%; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.access-submit > .ui-icon:first-child, .access-invite > .ui-icon:first-child { margin-right: 0; }
.access-signout { align-self: center; display: inline-flex; align-items: center; gap: 6px; }
.access-card .auth-message:empty { display: none; }

/* ---- Configurações › Servidor (administrador) ---- */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.admin-stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); }
.admin-stat small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.admin-stat b { display: block; margin-top: 4px; font-size: 20px; }
.admin-ban-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; margin-top: 8px; }
.admin-ban-form input { height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--input); color: var(--text); }
.admin-ban-form .button-danger { display: inline-flex; align-items: center; gap: 6px; }
.admin-ban-form .button-danger > .ui-icon:first-child { margin-right: 0; }
.admin-ban-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.admin-ban-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); }
.admin-ban-row span { min-width: 0; }
.admin-ban-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-ban-row small { color: var(--muted); }
.admin-empty { color: var(--muted); font-size: 13px; }
@media (max-width: 720px) { .admin-ban-form { grid-template-columns: 1fr; } }
.admin-stat em { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-style: normal; }

/* ==========================================================================================
   v10 — Casca estilo Microsoft Teams: barra superior, barra de apps (coluna 1), painel de
   lista (coluna 2), conversa (coluna 3) e painel de detalhes. Dois estilos:
   body[data-ui-layout="compact"] (padrão, só ícones) e [data-ui-layout="detailed"].
   ========================================================================================== */
:root {
  --topbar-h: 48px;
  --rail-w: 64px;
  --rail-w-detailed: 212px;
  --list-w: 300px;
  --details-w: 288px;
  --surface-2: #1a2333;
  --bubble-mine: color-mix(in srgb, var(--mint) 24%, #0f1a26);
  --bubble-mine-text: #f4fbf8;
  --bubble-mine-meta: color-mix(in srgb, var(--mint) 60%, #cbd5e1);
}
:root[data-theme="light"] {
  --surface-2: #edf1f7;
  --bubble-mine: color-mix(in srgb, var(--mint) 26%, #ffffff);
  --bubble-mine-text: #0b2a22;
  --bubble-mine-meta: #3f6f62;
}

.app-shell,
.app-shell[data-mode="dm"],
.app-shell[data-mode="group"],
.app-shell[data-mode="main"] {
  display: grid;
  grid-template-columns: var(--rail-w) var(--list-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas: "top top top" "rail list main";
}
[data-ui-layout="detailed"] .app-shell { grid-template-columns: var(--rail-w-detailed) var(--list-w) minmax(0, 1fr); }
.app-shell > .main-area { grid-area: main; padding: 0 18px; }
.sidebar-backdrop { display: none; }

/* ---- barra superior ---- */
.top-bar { grid-area: top; position: relative; z-index: 30; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 620px) minmax(0, 1fr); align-items: center; gap: 12px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--sidebar); }
.top-bar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-menu-button { display: none; }
.top-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; text-decoration: none; }
.top-brand .brand-mark { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
.top-search { width: 100%; height: 32px; justify-self: center; border-radius: 9px; background: var(--input); border-color: var(--line-strong); color: var(--muted); }
.top-search:hover { border-color: color-mix(in srgb, var(--mint) 40%, var(--line-strong)); color: var(--text-soft); }
.top-search > [data-icon] { display: inline-grid; place-items: center; }
.top-search .top-search-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.top-call { gap: 2px; padding: 3px 4px 3px 12px; border-radius: 999px; animation: fade-up 0.2s var(--ease); }
.top-call .voice-connected-info { display: flex; align-items: center; gap: 8px; padding-right: 6px; }
.top-call .voice-connected-info small { margin: 0; max-width: 170px; }
.top-call .icon-button { width: 30px; height: 30px; border-color: transparent; }
.top-call .icon-button.off { color: var(--danger); }
.top-call .icon-button > .ui-icon, .top-call .icon-button > svg { width: 16px; height: 16px; }
.account-wrap { position: relative; }
.rail-account { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.account-button.rail-item { width: 100%; height: 50px; padding: 0; justify-content: center; }
.account-button.rail-item:hover, .account-button.rail-item[aria-expanded="true"] { background: var(--surface-hover); }
.account-button:hover .user-card-avatar, .account-button[aria-expanded="true"] .user-card-avatar { box-shadow: 0 0 0 2px var(--mint-glow); }
.account-button .user-card-avatar { width: 34px; height: 34px; }
.account-button .status-dot { border-color: var(--sidebar); }
.rail-account-copy { line-height: 1.2; }
.rail-account-copy b, .rail-account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-account-copy b { color: var(--text); font-size: 13px; }
.rail-account-copy small { color: var(--muted); font-size: 11.5px; font-weight: 500; }
[data-ui-layout="detailed"] .account-button.rail-item { height: 52px; padding: 0 8px; gap: 10px; }
.top-bar .status-dot { border-color: var(--sidebar); }
.account-menu { position: fixed; z-index: 2400; left: 72px; bottom: 12px; width: 280px; max-height: calc(100dvh - 16px); overflow-y: auto; padding: 8px; border: 1px solid var(--glass-border, var(--line-strong)); border-radius: 14px; background: var(--glass-strong, var(--overlay)); backdrop-filter: var(--glass-blur, none); -webkit-backdrop-filter: var(--glass-blur, none); box-shadow: var(--shadow-lg); animation: pop-in 0.14s var(--ease); }
.account-menu-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); }
.account-menu-avatar { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(135deg, #4ce0b5, #3b82f6); color: #0b1a20; font-weight: 800; }
.account-menu-avatar img, .user-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu-copy { min-width: 0; }
.account-menu-copy b, .account-menu-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-copy b { font-size: 14px; }
.account-menu-copy small { color: var(--muted); font-size: 12px; }
.account-menu .status-dot { border-color: var(--overlay); }
.account-menu-status, .account-menu-items { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.account-menu-status { border-bottom: 1px solid var(--line); }
.account-menu button[role] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); font-size: 13px; text-align: left; }
.account-menu button[role]:hover, .account-menu button[role]:focus-visible { background: var(--surface-hover); color: var(--text); outline: none; }
.account-menu button[aria-checked="true"] { color: var(--text); font-weight: 700; }
.account-menu button[aria-checked="true"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.account-menu-status .status-dot { position: static; width: 10px; height: 10px; border-width: 0; }
.account-menu button.danger { color: var(--danger-soft); }
.account-menu button[data-icon] > .ui-icon:first-child { margin-right: 0; width: 16px; height: 16px; }

/* ---- coluna 1: barra de apps ---- */
.app-rail { grid-area: rail; min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px 7px 12px; border-right: 1px solid var(--line); background: var(--sidebar); overflow-y: auto; overflow-x: hidden; }
.rail-heading { display: none; padding: 10px 12px 4px; color: var(--muted-dark); font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; }
.rail-spacer { flex: 1; }
.rail-item { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; height: 46px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; transition: background var(--motion, 0.15s) ease, color var(--motion, 0.15s) ease; }
.rail-item:hover { background: var(--surface-hover); color: var(--text); }
.rail-item.active { color: var(--mint); background: color-mix(in srgb, var(--mint) 9%, transparent); }
.rail-item.active::before { content: ""; position: absolute; left: -7px; top: 11px; bottom: 11px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mint); box-shadow: 0 0 10px var(--mint-glow); }
.rail-icon { display: inline-grid; place-items: center; }
.rail-icon .ui-icon { width: 22px; height: 22px; margin: 0; }
.rail-label { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-badge { position: absolute; top: 6px; right: 9px; min-width: 17px; height: 17px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: var(--danger-strong); color: #fff; font-size: 10px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px var(--sidebar); }
.rail-badge[hidden] { display: none; }
[data-ui-layout="detailed"] .rail-heading { display: block; }
[data-ui-layout="detailed"] .app-rail { padding: 8px 10px 12px; }
[data-ui-layout="detailed"] .rail-item { justify-content: flex-start; height: 40px; padding: 0 12px; }
[data-ui-layout="detailed"] .rail-item.active::before { left: -10px; }
[data-ui-layout="detailed"] .rail-icon .ui-icon { width: 19px; height: 19px; }
[data-ui-layout="detailed"] .rail-label { display: block; flex: 1; text-align: left; }
[data-ui-layout="detailed"] .rail-badge { position: static; box-shadow: none; }

/* ---- coluna 2: painel de lista ---- */
.list-panel { grid-area: list; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--channel); overflow: hidden; }
.list-panel > .panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.list-panel > [hidden] { display: none !important; }
.list-panel > .channel-sidebar { flex: 1; height: auto; border-right: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 8px; }
.panel-header h2 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 800; }
.panel-actions { display: flex; gap: 4px; }
.panel-actions .icon-button { border-color: transparent; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 14px; }
.chat-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 14px 10px; }
.chat-filters[hidden] { display: none; }
.chat-filters button { height: 26px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text-soft); font-size: 12px; font-weight: 600; }
.chat-filters button:hover { border-color: color-mix(in srgb, var(--mint) 45%, var(--line-strong)); }
.chat-filters button.active { border-color: transparent; background: var(--mint-dim); color: var(--mint); }
.list-section { margin-top: 4px; }
.list-section[hidden] { display: none; }
.list-section-toggle { display: flex; align-items: center; gap: 4px; width: 100%; padding: 6px 6px; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: left; }
.list-section-toggle:hover { color: var(--text); }
.list-section-toggle > [data-icon] { display: inline-grid; place-items: center; transition: transform var(--motion, 0.15s) ease; }
.list-section-toggle > [data-icon] .ui-icon { margin: 0; }
.list-section.collapsed .list-section-toggle > [data-icon] { transform: rotate(-90deg); }
.list-section.collapsed .chat-list { display: none; }
.chat-list { display: flex; flex-direction: column; gap: 1px; }
.chat-list-empty { padding: 10px 10px 4px; color: var(--muted-dark); font-size: 12.5px; line-height: 1.45; }
.chat-row { position: relative; display: flex; align-items: center; border-radius: 9px; }
.chat-row:hover { background: var(--surface-hover); }
.chat-row.active { background: var(--surface-raised); }
.chat-row.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mint); }
.chat-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: inherit; text-align: left; }
.chat-row-avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-soft); color: var(--mint); font-size: 13px; font-weight: 800; }
.chat-row-avatar.group { border-radius: 11px; }
.chat-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-row .status-dot { border-color: var(--channel); }
.chat-row:hover .status-dot { border-color: var(--surface-hover); }
.chat-row.active .status-dot { border-color: var(--surface-raised); }
.chat-row-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-row-top, .chat-row-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); font-size: 13.5px; font-weight: 600; }
.chat-row-time { flex-shrink: 0; color: var(--muted-dark); font-size: 11px; }
.chat-row-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.chat-row-badge { flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--mint); color: var(--mint-ink); font-size: 10.5px; font-weight: 800; }
.chat-row.unread .chat-row-name { color: var(--text); font-weight: 800; }
.chat-row.unread .chat-row-preview { color: var(--text-soft); font-weight: 600; }
.chat-row.unread .chat-row-time { color: var(--mint); font-weight: 700; }
.chat-row.request .chat-row-preview { color: var(--warn); }
.chat-row-fav { position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: var(--surface-raised); color: var(--muted); opacity: 0; transition: opacity var(--motion, 0.15s) ease; }
.chat-row:hover .chat-row-fav, .chat-row-fav:focus-visible { opacity: 1; }
.chat-row:hover .chat-row-time { visibility: hidden; }
.chat-row-fav.on { color: var(--warn); }
.chat-row-fav.on .ui-icon { fill: currentColor; }
.chat-row-fav:hover { color: var(--warn); }
.recent-list { display: flex; flex-direction: column; gap: 4px; }
.join-group-link { display: inline-flex; align-items: center; gap: 6px; margin: 10px 6px 0; }
.join-group-link > .ui-icon:first-child { margin-right: 0; }
.friends-nav { display: flex; flex-direction: column; gap: 2px; }
.friends-nav button { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-soft); font-size: 13.5px; font-weight: 600; text-align: left; }
.friends-nav button:hover { background: var(--surface-hover); color: var(--text); }
.friends-nav button.active { background: var(--surface-raised); color: var(--text); }
.friends-nav button > .ui-icon:first-child { margin-right: 0; width: 17px; height: 17px; color: var(--muted); }
.friends-nav .nav-badge { margin-left: auto; }
.friends-panel-code { margin: 14px 4px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.friends-panel-code b { display: block; margin-top: 4px; font-size: 14px; }
.activity-section { margin: 4px 0 14px; }
.activity-section h3 { margin: 6px 6px 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.activity-card { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: inherit; text-align: left; }
.activity-card:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.activity-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-soft); color: var(--mint); }
.activity-card.live .activity-icon { background: var(--mint-dim); }
.activity-copy { flex: 1; min-width: 0; }
.activity-copy b, .activity-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy b { font-size: 13px; }
.activity-copy small { color: var(--muted); font-size: 11.5px; }
.activity-action { flex-shrink: 0; padding: 3px 9px; border-radius: 999px; background: var(--mint-dim); color: var(--mint); font-size: 11px; font-weight: 800; }
.channel-back-button { display: inline-flex; align-items: center; gap: 4px; }
.channel-back-button > .ui-icon:first-child { margin-right: 0; }

/* ---- cabeçalho da conversa: abas Chat | Arquivos + ações agrupadas ---- */
.chat-tabs { display: flex; align-self: stretch; align-items: stretch; gap: 2px; margin-left: 6px; }
.chat-tabs button { position: relative; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.chat-tabs button:hover { color: var(--text); }
.chat-tabs button.active { color: var(--text); }
.chat-tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -9px; height: 3px; border-radius: 3px 3px 0 0; background: var(--mint); }
.chat-header-tools { gap: 8px; }
.header-tool-group { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.header-tool-group .header-tool { width: 32px; height: 30px; border: 0; border-radius: 8px; }
.header-tool-group .header-tool:hover { background: var(--surface-hover); }
.header-tool-group .header-tool[aria-pressed="true"], .header-tool-group .header-tool[aria-expanded="true"] { background: var(--mint-dim); color: var(--mint); }
.header-tool-group:not(:has(> :not([hidden]))) { display: none; }
.workspace[data-mode="call"] .chat-tabs, .workspace[data-mode="call"] #detailsToggleButton { display: none; }
.workspace[data-personal="self"] .dm-only, .workspace[data-personal="self"] #onlinePill, .workspace[data-personal="self"] #copyInviteButton, .workspace[data-personal="self"] #dmBanner { display: none !important; }
.chat-panel[data-tab="files"] .composer-extras, .chat-panel[data-tab="files"] #chatForm, .chat-panel[data-tab="files"] .composer-status, .chat-panel[data-tab="files"] .typing-indicator, .chat-panel[data-tab="files"] .chat-search { display: none; }
.chat-files-view { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 6px 24px; }
.chat-files-view[hidden], .chat-messages[hidden] { display: none; }
.files-view-section { margin-bottom: 22px; }
.files-view-section h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; }
.files-view-section h3 .ui-icon { margin: 0; color: var(--mint); }
.files-view-note { color: var(--muted-dark); font-size: 12px; }

/* ---- painel direito: detalhes, arquivos e mídia ---- */
.workspace.details-open:not([data-mode="call"]) { grid-template-columns: minmax(0, 1fr) var(--details-w); }
.details-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; margin: 12px 0 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; animation: fade-up 0.18s var(--ease); }
.details-panel[hidden], .workspace[data-mode="call"] .details-panel { display: none; }
.details-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.details-avatar-wrap { margin-bottom: 8px; }
.details-avatar { width: 84px; height: 84px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(135deg, #4ce0b5, #3b82f6); color: #0b1a20; font-size: 30px; font-weight: 800; }
.details-avatar.group { border-radius: 22px; }
.details-avatar img { width: 100%; height: 100%; object-fit: cover; }
.details-avatar-wrap .status-dot { width: 16px; height: 16px; right: 4px; bottom: 4px; border-width: 3px; border-color: var(--surface); }
.details-name { font-family: var(--font-display); font-size: 16px; font-weight: 800; }
.details-meta { color: var(--muted); font-size: 12px; }
.details-tabs { display: flex; gap: 4px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.details-tabs button { position: relative; flex: 1; height: 42px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.details-tabs button.active { color: var(--mint); }
.details-tabs button.active::after { content: ""; position: absolute; left: 16%; right: 16%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--mint); }
.details-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.shared-files { display: flex; flex-direction: column; gap: 4px; }
.shared-files.wide { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.shared-file { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); color: inherit; text-align: left; }
.shared-file:hover { border-color: color-mix(in srgb, var(--mint) 35%, var(--line-strong)); }
.shared-file-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px; background: var(--mint-dim); color: var(--mint); }
.shared-file-icon .ui-icon { margin: 0; }
.shared-file-copy { min-width: 0; }
.shared-file-copy b, .shared-file-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-file-copy b { font-size: 12.5px; }
.shared-file-copy small { color: var(--muted); font-size: 11px; }
.shared-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.shared-media-grid.wide { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.shared-media { aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); cursor: zoom-in; }
.shared-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s var(--ease); }
.shared-media:hover img { transform: scale(1.05); }
.shared-empty { margin: 6px 4px; color: var(--muted-dark); font-size: 12.5px; line-height: 1.45; }

/* ---- mensagens em balões (densidade "Confortável"; a "Compacta" segue em linhas) ---- */
.chat-messages:not([data-density="compact"]) .message { margin-top: 10px; padding: 2px 10px; }
.chat-messages:not([data-density="compact"]) .message.grouped { margin-top: 2px; }
.chat-messages:not([data-density="compact"]) .message:hover, .chat-messages:not([data-density="compact"]) .message.menu-open { background: transparent; }
.chat-messages:not([data-density="compact"]) .message-content { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 720px); }
.chat-messages:not([data-density="compact"]) .message-meta { margin: 0 4px 3px; font-size: 12px; }
.chat-messages:not([data-density="compact"]) .message-body { max-width: 100%; padding: 8px 12px; border-radius: 4px 16px 16px 16px; background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12); }
.chat-messages:not([data-density="compact"]) .message.grouped .message-body { border-radius: 16px; }
.chat-messages:not([data-density="compact"]) .message-body.expiry-only { padding: 4px 8px; }
.chat-messages:not([data-density="compact"]) .message.mine { grid-template-columns: minmax(0, 1fr); }
.chat-messages:not([data-density="compact"]) .message.mine .message-avatar { display: none; }
.chat-messages:not([data-density="compact"]) .message.mine .message-content,
.chat-messages:not([data-density="compact"]) .message.mine.grouped .message-content { grid-column: 1; justify-self: end; align-items: flex-end; max-width: min(72%, 680px); }
.chat-messages:not([data-density="compact"]) .message.mine .message-meta b { display: none; }
.chat-messages:not([data-density="compact"]) .message.mine .message-body { border-radius: 16px 4px 16px 16px; background: var(--bubble-mine); color: var(--bubble-mine-text); }
.chat-messages:not([data-density="compact"]) .message.mine.grouped .message-body { border-radius: 16px; }
.chat-messages:not([data-density="compact"]) .message.mine .message-body a { color: inherit; }
.chat-messages:not([data-density="compact"]) .message.mine .message-body .edited { color: var(--bubble-mine-meta); }
.chat-messages:not([data-density="compact"]) .message.mine .message-reactions { justify-content: flex-end; }
.chat-messages:not([data-density="compact"]) .message.mine .message-reply { grid-column: 1; justify-self: end; margin: 0 6px 3px 0; padding-left: 0; }
.chat-messages:not([data-density="compact"]) .message.mine .message-reply::before { display: none; }
.chat-messages:not([data-density="compact"]) .message.failed .message-body { background: var(--danger-dim); color: var(--danger-soft); }
.chat-messages:not([data-density="compact"]) .message.pinned { box-shadow: none; }
.chat-messages:not([data-density="compact"]) .message.pinned .message-body { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 55%, transparent); }
.chat-messages:not([data-density="compact"]) .message .code-block { max-width: 100%; }
/* Barra de ações (Reagir, Responder…) colada na bolha, do lado de fora: à direita das
   mensagens dos outros e à esquerda das suas — perto de onde o mouse está. Curta, ela fica
   no meio da bolha; em mensagens altas (imagem, arquivo, enquete), no alto. */
.chat-messages:not([data-density="compact"]) { container-type: inline-size; container-name: chat; }
.chat-messages:not([data-density="compact"]) .message-content { position: relative; justify-self: start; }
.chat-messages:not([data-density="compact"]) .message-actions { top: clamp(0px, calc(50% - 17px), 26px); right: auto; left: calc(100% + 6px); }
.chat-messages:not([data-density="compact"]) .message.mine .message-actions { left: auto; right: calc(100% + 6px); }
.chat-messages:not([data-density="compact"]) .message-actions button { width: 28px; height: 28px; }
/* Chat estreito (painel ao lado da call, celular): sem espaço ao lado — a barra fica em
   cima da mensagem (logo acima do nome/hora, sem cobri-los), alinhada à bolha. */
@container chat (max-width: 880px) {
  .chat-messages:not([data-density="compact"]) .message-actions { top: auto; bottom: calc(100% + 2px); left: 0; right: auto; }
  .chat-messages:not([data-density="compact"]) .message.mine .message-actions { left: auto; right: 0; }
}
.self-empty { gap: 8px; }
.self-empty-avatar { width: 96px; height: 96px; display: grid; place-items: center; overflow: hidden; margin-bottom: 8px; border-radius: 50%; background: color-mix(in srgb, var(--mint) 18%, var(--surface-raised)); color: var(--mint); font-size: 34px; font-weight: 800; }
.self-empty-avatar img { width: 100%; height: 100%; object-fit: cover; }
.self-empty small { max-width: 420px; }

/* ---- Configurações › Aparência › Estilo da Interface ---- */
.layout-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.layout-option { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); cursor: pointer; }
.layout-option:has(input:checked) { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.layout-option input { position: absolute; opacity: 0; pointer-events: none; }
.layout-option b { display: block; font-size: 13.5px; }
.layout-option small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.layout-preview { flex: 0 0 74px; height: 50px; display: grid; gap: 3px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--canvas); }
.layout-preview i { border-radius: 3px; background: var(--surface-soft); }
.layout-preview.compact { grid-template-columns: 8px 22px 1fr; }
.layout-preview.compact i:first-child { background: var(--mint-dim); }
.layout-preview.detailed { grid-template-columns: 18px 18px 1fr 14px; }
.layout-preview.detailed i:first-child { background: var(--mint-dim); }

/* ---- conexão e app instalado ---- */
.connection-banner { top: calc(var(--topbar-h) + 8px); }
:root.app-installed .top-brand .brand-word { display: none; }

/* ---- telas médias e pequenas ---- */
@media (max-width: 1280px) {
  :root { --list-w: 276px; --details-w: 270px; }
  [data-ui-layout="detailed"] .workspace.details-open:not([data-mode="call"]) { grid-template-columns: minmax(0, 1fr); }
  [data-ui-layout="detailed"] .workspace.details-open:not([data-mode="call"]) .details-panel { position: absolute; z-index: 30; top: 70px; right: 0; bottom: 12px; width: var(--details-w); margin: 0; box-shadow: var(--shadow-lg); }
}
@media (max-width: 1050px) {
  [data-ui-layout="detailed"] .app-shell { grid-template-columns: var(--rail-w) var(--list-w) minmax(0, 1fr); }
  [data-ui-layout="detailed"] .rail-heading, [data-ui-layout="detailed"] .rail-label { display: none; }
  [data-ui-layout="detailed"] .rail-item { justify-content: center; height: 46px; padding: 0; }
  [data-ui-layout="detailed"] .rail-badge { position: absolute; }
  .workspace.details-open:not([data-mode="call"]) { grid-template-columns: minmax(0, 1fr); }
  .workspace.details-open:not([data-mode="call"]) .details-panel { position: absolute; z-index: 30; top: 70px; right: 0; bottom: 12px; width: min(var(--details-w), calc(100% - 24px)); margin: 0; box-shadow: var(--shadow-lg); }
}
@media (max-width: 860px) {
  .app-shell, .app-shell[data-mode="dm"], .app-shell[data-mode="group"], .app-shell[data-mode="main"],
  [data-ui-layout="detailed"] .app-shell { grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-areas: "top top" "rail main"; }
  :root { --rail-w: 56px; }
  .app-shell > .list-panel { display: none; }
  .app-shell.sidebar-open > .list-panel { position: fixed; z-index: 1101; top: var(--topbar-h); bottom: 0; left: var(--rail-w); display: flex; width: min(300px, calc(100vw - var(--rail-w) - 24px)); box-shadow: 16px 0 48px rgba(0, 0, 0, 0.4); animation: drawer-in 0.22s var(--ease); }
  .app-shell.sidebar-open > .sidebar-backdrop:not([hidden]) { position: fixed; z-index: 1100; inset: var(--topbar-h) 0 0 0; display: block; }
  .top-menu-button, .mobile-sidebar-button { display: grid; position: static; width: 34px; height: 34px; }
  .top-bar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 0 8px; }
  .top-brand .brand-word { display: none; }
  .top-search kbd { display: none; }
  .top-call .voice-connected-info small { display: none; }
  .chat-header, .friends-header, .stage-header { padding-left: 4px; }
  .voice-lobby, .server-welcome { padding-top: 24px; }
  .app-shell > .main-area { padding: 0 10px; }
  .chat-tabs { display: none; }
}
@media (max-width: 560px) {
  /* Celular: a barra de apps entra na gaveta (botão ☰) para a conversa e a call usarem a largura toda. */
  .app-shell, .app-shell[data-mode="dm"], .app-shell[data-mode="group"], .app-shell[data-mode="main"],
  [data-ui-layout="detailed"] .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .app-shell > .app-rail { display: none; }
  .app-shell.sidebar-open > .app-rail { position: fixed; z-index: 1102; top: var(--topbar-h); bottom: 0; left: 0; display: flex; width: var(--rail-w); animation: drawer-in 0.22s var(--ease); }
  .app-shell.sidebar-open > .list-panel { width: min(300px, calc(100vw - var(--rail-w) - 16px)); }
  .top-search .top-search-text { font-size: 12px; }
  .top-call .voice-connected-info { display: none; }
  .account-menu { width: min(280px, calc(100vw - 16px)); }
  .chat-messages:not([data-density="compact"]) .message-content,
  .chat-messages:not([data-density="compact"]) .message.mine .message-content { max-width: 88%; }
  .layout-options { grid-template-columns: minmax(0, 1fr); }
}
/* Ajustes de especificidade da barra superior (vencem as regras genéricas de ícone/busca). */
.top-bar .top-menu-button { display: none; }
.top-bar .top-search > [data-icon] { flex: 0 0 auto; }
.top-bar .top-search .top-search-text { flex: 1 1 auto; text-align: left; }
@media (max-width: 860px) {
  .top-bar .top-menu-button { display: grid; }
}

/* ==========================================================================================
   v11 — Conta no pé da barra de apps, formatação de texto no compositor e checklists.
   ========================================================================================== */

/* ---- cores do texto (paleta fixa; cada tema tem o tom legível) ---- */
:root {
  --tc-red: #ff6b6b; --tc-orange: #ffa94d; --tc-yellow: #ffd43b; --tc-green: #69db7c; --tc-teal: #38d9c0;
  --tc-blue: #74b0ff; --tc-purple: #b197fc; --tc-pink: #f783ac; --tc-gray: #a8b3c4;
}
:root[data-theme="light"] {
  --tc-red: #c92a2a; --tc-orange: #d9480f; --tc-yellow: #a07800; --tc-green: #2b8a3e; --tc-teal: #0c8577;
  --tc-blue: #1c64d9; --tc-purple: #6741d9; --tc-pink: #c2255c; --tc-gray: #5c6b7f;
}
.tc-red { color: var(--tc-red); } .tc-orange { color: var(--tc-orange); } .tc-yellow { color: var(--tc-yellow); }
.tc-green { color: var(--tc-green); } .tc-teal { color: var(--tc-teal); } .tc-blue { color: var(--tc-blue); }
.tc-purple { color: var(--tc-purple); } .tc-pink { color: var(--tc-pink); } .tc-gray { color: var(--tc-gray); }
.fmt-bold { font-weight: 750; }
.fmt-italic { font-style: italic; }
.fmt-underline { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.fmt-strike { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: 0.85; }
.fmt-underline .fmt-strike, .fmt-strike .fmt-underline { text-decoration: underline line-through; }
.fmt-color { font-weight: inherit; }

/* ---- botão de lápis e barra de formatação ---- */
.attach-button.format-toggle .ui-icon { width: 17px; height: 17px; margin: 0; }
.attach-button.format-toggle.open, .attach-button.format-toggle[aria-pressed="true"] { background: color-mix(in srgb, var(--mint) 18%, var(--surface-raised)); color: var(--mint); }
.attach-button:disabled { opacity: 0.45; cursor: not-allowed; }
.format-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); animation: fade-up 0.14s var(--ease); }
.format-tool { position: relative; width: 32px; height: 30px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); }
.format-tool:hover:not(:disabled), .format-tool[aria-expanded="true"] { background: var(--surface-hover); color: var(--text); }
.format-tool:focus-visible { outline: 2px solid var(--mint); outline-offset: 0; }
.format-tool:disabled { opacity: 0.4; cursor: not-allowed; }
.format-tool > .ui-icon, .format-tool > [data-icon] > .ui-icon { width: 17px; height: 17px; margin: 0; }
.format-tool > [data-icon] { display: inline-grid; place-items: center; }
.format-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line-strong); }
.format-hint { margin-left: auto; padding: 0 8px; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.format-color-wrap { position: relative; }
.format-color-button { grid-template-rows: 1fr auto; }
.format-color-swatch { position: absolute; left: 9px; right: 9px; bottom: 4px; height: 3px; border-radius: 2px; background: currentColor; }
.format-color-menu { position: absolute; z-index: 45; left: 0; bottom: calc(100% + 8px); width: 236px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--overlay); box-shadow: var(--shadow-lg); animation: menu-rise 0.14s var(--ease); }
.format-color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.format-color-option { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; font-size: 12.5px; font-weight: 650; text-align: left; }
.format-color-option:hover, .format-color-option:focus-visible { background: var(--surface-hover); outline: none; }
.format-color-dot { width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%; background: currentColor; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.format-color-option.none { grid-column: 1 / -1; color: var(--text-soft); }
.format-color-option.none .format-color-dot { background: transparent; border: 2px solid var(--line-strong); box-shadow: none; position: relative; }
.format-color-option.none .format-color-dot::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--danger-soft); transform: translateX(-50%) rotate(45deg); }
.format-preview { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 11px; background: color-mix(in srgb, var(--surface) 70%, transparent); max-height: 140px; overflow-y: auto; }
.format-preview-label { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; background: var(--mint-dim); color: var(--mint); font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.format-preview-body { flex: 1; min-width: 0; color: var(--text); }
.chat-messages:not([data-density="compact"]) .format-preview-body, .format-preview-body.message-body { padding: 0; background: transparent; box-shadow: none; border-radius: 0; }

/* ---- checklist ---- */
.composer-menu-icon.checklist { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.composer-menu-icon.checklist .ui-icon { width: 18px; height: 18px; margin: 0; }
.checklist-card { width: min(440px, 100%); margin-top: 6px; padding: 12px; display: grid; gap: 10px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-raised); color: var(--text); }
.checklist-card.complete { border-color: color-mix(in srgb, var(--mint) 45%, var(--line-strong)); }
.checklist-head { display: flex; align-items: center; gap: 10px; }
.checklist-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 9px; background: rgba(52, 211, 153, 0.15); color: #34d399; }
.checklist-icon .ui-icon { margin: 0; }
.checklist-title-wrap { flex: 1; min-width: 0; display: grid; }
.checklist-title { font-size: 14px; overflow-wrap: anywhere; }
.checklist-progress-text { color: var(--muted); font-size: 11.5px; }
.checklist-card.complete .checklist-progress-text { color: var(--mint); font-weight: 700; }
.checklist-edit { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text-soft); font-size: 12px; font-weight: 650; }
.checklist-edit:hover:not(:disabled) { color: var(--text); border-color: var(--mint); }
.checklist-edit .ui-icon { margin: 0; }
.checklist-bar { height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.checklist-bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), #34d399); transition: width 0.25s var(--ease); }
.checklist-items { display: grid; gap: 4px; }
.checklist-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: var(--surface); color: var(--text); text-align: left; white-space: normal; transition: background 0.12s ease, border-color 0.12s ease; }
.checklist-item:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-hover); }
.checklist-item:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.checklist-item:disabled { cursor: default; opacity: 0.85; }
.checklist-box { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; color: var(--muted); }
.checklist-box .ui-icon { margin: 0; }
.checklist-item.done .checklist-box { color: var(--mint); }
.checklist-text { flex: 1; min-width: 0; font-size: 13.5px; line-height: 20px; overflow-wrap: anywhere; white-space: pre-wrap; }
.checklist-item.done .checklist-text { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent); }
.checklist-by { flex: 0 0 auto; align-self: center; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 7px; border-radius: 999px; background: var(--mint-dim); color: var(--mint); font-size: 10.5px; font-weight: 700; }
.checklist-foot { color: var(--muted); font-size: 11px; }
.message.mine .checklist-card { margin-left: auto; }
.chat-messages:not([data-density="compact"]) .message.mine .checklist-card { justify-self: end; }
.checklist-edit-list { display: grid; gap: 6px; max-height: min(46vh, 360px); overflow-y: auto; padding-right: 2px; }
.checklist-edit-row { display: flex; align-items: center; gap: 6px; }
.checklist-edit-number { width: 20px; flex: 0 0 20px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: right; }
.checklist-edit-input { flex: 1; min-width: 0; min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--input); color: var(--text); }
.checklist-edit-input:focus { border-color: var(--mint); outline: none; }
.checklist-edit-row .icon-button.tiny { width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0; }
.checklist-edit-row .icon-button.tiny .ui-icon { margin: 0; }
.checklist-edit-row .icon-button.tiny:disabled { opacity: 0.35; }

@media (max-width: 560px) {
  .format-hint { display: none; }
  .format-color-menu { width: 210px; }
  .checklist-by { display: none; }
}

/* Os antigos cabeçalhos fixos "CANAIS DE TEXTO/VOZ" viraram categorias de verdade: canais
   sem categoria ficam no topo sem cabeçalho, e a área "sem categoria" só aparece ao arrastar. */
.channel-scroll .loose-header { display: none; }
.channel-scroll .loose-drop { display: none; }
/* Por cima da lista (sticky, margem negativa): aparecer não empurra nada durante o arraste. */
.channel-scroll.drag-active .loose-drop { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: center; box-sizing: border-box; height: 34px; margin: 0 4px -34px; padding: 0 6px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--muted); }
#textChannelList:not(:empty) { margin-top: 6px; }

/* ---- menções (@pessoa, @todos) ---- */
.mention { display: inline; padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, var(--mint) 18%, transparent); color: var(--mint); font-weight: 600; white-space: nowrap; }
.mention.mention-me, .mention.mention-everyone { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.message.mine .mention { background: color-mix(in srgb, #fff 20%, transparent); color: inherit; }
/* Mensagem que menciona você: faixa lateral e fundo âmbar (como no Discord). */
.message.mentions-me { background: color-mix(in srgb, var(--warn) 9%, transparent); box-shadow: inset 3px 0 0 var(--warn); }
.chat-messages:not([data-density="compact"]) .message.mentions-me { background: color-mix(in srgb, var(--warn) 9%, transparent); }
.chat-messages:not([data-density="compact"]) .message.mentions-me .message-body { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
/* Selo "@N" (canal, grupo, lista Chat). */
.mention-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; flex-shrink: 0; }
.chat-row-bottom .mention-badge { margin-left: 4px; }
.recent-room .mention-badge { margin-left: auto; }
/* Lista de sugestões do "@" (em cima do campo). */
.composer, .edit-box { position: relative; }
.mention-popup { position: absolute; z-index: 30; left: 0; right: 0; bottom: calc(100% + 6px); max-height: 300px; overflow-y: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--overlay); box-shadow: var(--shadow-md); }
.mention-popup-title { padding: 4px 8px 6px; color: var(--muted-dark); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.mention-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.mention-option.active, .mention-option:hover { background: var(--surface-raised); }
.mention-option small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.mention-avatar { width: 26px; height: 26px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-2); color: var(--mint); font-size: 12px; font-weight: 800; flex-shrink: 0; }
.mention-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Linha "Novas mensagens" (não lido sincronizado). */
.unread-divider { display: flex; align-items: center; gap: 8px; margin: 12px 10px 4px; color: var(--danger); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.unread-divider::before { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--danger) 70%, transparent); }
.unread-divider span { order: 2; }
.unread-divider::after { content: ""; width: 24px; height: 1px; order: 3; background: color-mix(in srgb, var(--danger) 70%, transparent); }

/* ==========================================================================================
   Painel lateral de mensagens diretas (estilo Discord): call + chat do grupo + DM juntos.
   Telas largas: 4ª coluna da grade. Telas menores: gaveta por cima do conteúdo.
   ========================================================================================== */
:root { --dock-w: 340px; }
.top-dock-button { position: relative; width: 34px; height: 34px; margin-right: 6px; }
.top-dock-button[aria-pressed="true"] { background: var(--mint-dim); color: var(--mint); }
.dock-toggle-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--sidebar); }
.dock-toggle-dot[hidden] { display: none; }
.top-bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

.dm-dock { grid-area: dock; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--sidebar); }
.dm-dock[hidden] { display: none; }
@media (min-width: 1181px) {
  .app-shell.dock-open, .app-shell.dock-open[data-mode] {
    grid-template-columns: var(--rail-w) var(--list-w) minmax(0, 1fr) var(--dock-w);
    grid-template-areas: "top top top top" "rail list main dock";
  }
  [data-ui-layout="detailed"] .app-shell.dock-open { grid-template-columns: var(--rail-w-detailed) var(--list-w) minmax(0, 1fr) var(--dock-w); }
}
@media (min-width: 1181px) and (max-width: 1400px) { :root { --dock-w: 300px; } }
@media (max-width: 1180px) {
  .dm-dock { position: fixed; z-index: 1050; top: var(--topbar-h); right: 0; bottom: 0; width: min(360px, 100vw); box-shadow: -16px 0 48px rgba(0, 0, 0, 0.45); animation: dock-in 0.2s var(--ease); }
}
@keyframes dock-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.dock-head { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--line); }
.dm-dock[data-mode="list"] .dock-back, .dm-dock[data-mode="list"] .dock-expand { display: none; }
.dock-identity { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.dock-avatar { width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-2); color: var(--mint); font-size: 13px; font-weight: 800; }
.dock-avatar.icon { border-radius: 10px; background: var(--mint-dim); }
.dock-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dock-identity .status-dot[hidden] { display: none; }
.dock-names { min-width: 0; display: flex; flex-direction: column; }
.dock-title { overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.dock-subtitle { color: var(--muted); font-size: 11.5px; }

.dock-list-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.dm-dock[data-mode="conversation"] .dock-list-view, .dm-dock[data-mode="list"] .dock-conversation { display: none; }
.dock-search { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--input); color: var(--text); font: inherit; font-size: 13px; }
.dock-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.dock-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--text-soft); font: inherit; text-align: left; cursor: pointer; }
.dock-row:hover, .dock-row.active { background: var(--surface-raised); color: var(--text); }
.dock-row.unread b { color: var(--text); font-weight: 800; }
.dock-row-avatar { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-2); color: var(--mint); font-size: 12px; font-weight: 800; }
.dock-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dock-row-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dock-row-copy b { overflow: hidden; font-size: 13.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dock-row-copy small { color: var(--muted); font-size: 11.5px; }
.dock-row .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text); flex-shrink: 0; }
.dock-empty { margin: 18px 8px; color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.5; }

.dock-conversation { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dock-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 6px; display: flex; flex-direction: column; }
.dock-day { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; color: var(--muted-dark); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.dock-day::before, .dock-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dock-new { margin: 10px 0 4px; }
.dock-msg { display: flex; flex-direction: column; align-items: flex-start; margin-top: 10px; max-width: 100%; }
.dock-msg.grouped { margin-top: 3px; }
.dock-msg.mine { align-items: flex-end; }
.dock-msg.pending { opacity: 0.6; }
.dock-meta { display: flex; align-items: baseline; gap: 6px; margin: 0 4px 3px; font-size: 11px; color: var(--muted); }
.dock-meta b { color: var(--text-soft); font-size: 12px; }
.dock-bubble { max-width: 92%; padding: 7px 11px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); color: var(--text); font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.dock-msg.grouped .dock-bubble { border-radius: 14px; }
.dock-msg.mine .dock-bubble { border-radius: 14px 4px 14px 14px; background: var(--bubble-mine); color: var(--bubble-mine-text); }
.dock-msg.mine.grouped .dock-bubble { border-radius: 14px; }
.dock-bubble.failed { background: var(--danger-dim); color: var(--danger-soft); }
.dock-bubble a { color: inherit; text-decoration: underline; }
.dock-bubble .code-block { max-width: 100%; white-space: normal; }
.dock-reply { display: block; margin-bottom: 4px; padding-left: 8px; border-left: 2px solid currentColor; opacity: 0.7; font-size: 12px; }
.dock-image { display: block; max-width: 100%; max-height: 220px; margin-top: 6px; border-radius: 10px; cursor: zoom-in; }
.dock-image.spoiler-blur { filter: blur(18px); }
.dock-open-full { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-raised); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.dock-edited { color: var(--muted-dark); font-size: 10.5px; }
.dock-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dock-reaction { padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-raised); font-size: 12px; }
.dock-reaction.mine { border-color: var(--mint); background: var(--mint-dim); }
.dock-typing { min-height: 18px; padding: 0 14px; color: var(--muted); font-size: 11.5px; font-style: italic; }
.dock-notice { padding: 0 14px 6px; color: var(--warn); font-size: 11.5px; }
.dock-notice[hidden] { display: none; }
.dock-composer { display: flex; align-items: flex-end; gap: 8px; margin: 0 10px 10px; padding: 6px 7px 6px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.dock-composer:focus-within { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.dock-input { flex: 1; min-width: 0; height: 32px; max-height: 140px; padding: 7px 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; line-height: 18px; resize: none; }
.dock-input:focus { outline: none; }
.dock-composer .send-button { flex-shrink: 0; }

/* Call + chat do grupo + DM ao lado em telas até ~1700 px: a coluna da lista dá lugar à call
   (a barra de apps continua; fechar o painel traz a lista de volta). */
@media (min-width: 1181px) and (max-width: 1700px) {
  .app-shell.dock-open[data-view="voice"] { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) var(--dock-w); }
  [data-ui-layout="detailed"] .app-shell.dock-open[data-view="voice"] { grid-template-columns: var(--rail-w-detailed) 0 minmax(0, 1fr) var(--dock-w); }
  .app-shell.dock-open[data-view="voice"] > .list-panel { display: none; }
}
/* Barra superior mais apertada: o atalho e o nome da call encolhem antes de sobrepor. */
@media (max-width: 1180px) {
  .top-bar .top-search kbd { display: none; }
  .top-call .voice-connected-info small { display: none; }
}
.top-call .voice-connected-status { white-space: nowrap; }
.top-bar-right { min-width: 0; }

/* ==========================================================================================
   Tela da call no estilo do Discord: plana, colunas coladas (palco | chat da call | DM),
   sem cartões com borda e espaço entre eles. Mensagens no formato do Discord (avatar, nome
   e hora; sem bolhas) no chat da call e no painel de DM.
   ========================================================================================== */
.main-area:has(> .workspace[data-mode="call"]:not([hidden])) { padding: 0; }
.workspace[data-mode="call"] { gap: 0; padding: 0; grid-template-columns: minmax(0, 1fr) 360px; }
.workspace[data-mode="call"].chat-hidden { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1280px) { .workspace[data-mode="call"] { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1050px) { .workspace[data-mode="call"] { grid-template-columns: minmax(0, 1fr); } }

/* Palco */
.workspace[data-mode="call"] .call-panel { padding: 0 0 12px; border: 0; border-radius: 0; background: var(--canvas); }
.workspace[data-mode="call"] .stage-header { min-height: 52px; margin: 0; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--line); }
.workspace[data-mode="call"] .stage-title .section-label { display: none; }
.workspace[data-mode="call"] .stage-title h2::before { content: "#"; margin-right: 6px; color: var(--muted); font-weight: 600; }
.workspace[data-mode="call"] .stage { padding: 12px 12px 0; }

/* Chat da call: coluna colada ao palco, sem cabeçalho próprio (o do palco já diz o canal) */
.workspace[data-mode="call"] .chat-panel { padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: var(--canvas); }
.workspace[data-mode="call"] .chat-header { display: none; }
.workspace[data-mode="call"] .chat-messages { padding: 8px 0 6px; }
.workspace[data-mode="call"] .composer-extras { margin: 0 10px; }
.workspace[data-mode="call"] .composer { margin: 0 10px 4px; }
.workspace[data-mode="call"] .composer-status { margin: 0 12px 6px; }
@media (max-width: 1050px) {
  .workspace[data-mode="call"] .chat-panel { top: 52px; right: 0; bottom: 0; width: min(360px, 100%); border-left: 1px solid var(--line-strong); }
}

/* Mensagens no formato do Discord (chat da call): todas à esquerda, avatar + nome + hora */
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message,
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine { grid-template-columns: 36px minmax(0, 1fr); gap: 0 10px; margin-top: 12px; padding: 2px 12px; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.grouped { margin-top: 0; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message:hover { background: var(--surface-hover); }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message .message-avatar { display: grid; width: 36px; height: 36px; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.grouped .message-avatar { visibility: hidden; height: 0; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message .message-content,
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine .message-content,
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine.grouped .message-content { grid-column: 2; justify-self: stretch; align-items: stretch; max-width: none; position: static; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message-meta { margin: 0 0 2px; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine .message-meta b { display: inline; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message-body,
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine .message-body,
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.grouped .message-body { padding: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine .message-body a { color: var(--mint); }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine .mention { background: color-mix(in srgb, var(--mint) 18%, transparent); color: var(--mint); }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine .message-reactions { justify-content: flex-start; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine .message-reply { grid-column: 2; justify-self: start; margin: 0 0 3px; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mentions-me .message-body { box-shadow: none; }
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.pinned .message-body { box-shadow: none; }
/* Ações da mensagem: canto superior direito da linha (como no Discord) */
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message-actions,
.workspace[data-mode="call"] .chat-messages:not([data-density="compact"]) .message.mine .message-actions { top: -14px; bottom: auto; right: 10px; left: auto; }

/* Pessoas na call, na lista de canais (como no print: avatar, nome, ícones vermelhos, AO VIVO) */
.voice-member-list { padding: 2px 0 6px 26px; gap: 0; }
.voice-member { min-height: 32px; gap: 9px; padding: 0 8px; font-size: 14px; color: var(--text-soft); }
.voice-member-avatar { width: 24px; height: 24px; flex: 0 0 24px; font-size: 11px; }
.voice-member-name { font-weight: 500; }
.voice-member-icons { gap: 6px; }
.voice-member-icons svg { width: 16px; height: 16px; }
.voice-member .live-tag { padding: 1px 6px; border-radius: 4px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; }

/* Painel de DM no formato do Discord */
.dock-msg, .dock-msg.mine { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; align-items: start; margin-top: 12px; padding: 2px 4px; border-radius: 6px; }
.dock-msg.grouped { margin-top: 0; }
.dock-msg:hover { background: var(--surface-hover); }
.dock-msg-avatar { grid-row: span 3; width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-2); color: var(--mint); font-size: 13px; font-weight: 800; }
.dock-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dock-msg.grouped .dock-msg-avatar { visibility: hidden; height: 0; }
.dock-msg > :not(.dock-msg-avatar) { grid-column: 2; }
.dock-meta { margin: 0 0 2px; }
.dock-meta b { color: var(--text); font-size: 13.5px; }
.dock-bubble, .dock-msg.mine .dock-bubble, .dock-msg.grouped .dock-bubble, .dock-msg.mine.grouped .dock-bubble { max-width: 100%; padding: 0; border-radius: 0; background: transparent; color: var(--text); font-size: 13.5px; }
.dock-msg.mine .dock-bubble a { color: var(--mint); }
.dock-messages { padding: 8px 8px 6px; }

/* Chat da call com mensagem nova: ícone discreto no canal de voz (a menção usa o selo "@"). */
.channel-chat-new { display: inline-grid; place-items: center; margin-left: auto; color: var(--text); opacity: 0.85; }
.channel-entry.unread .channel-label { color: var(--text); font-weight: 700; }
/* Controles da call: em palco estreito quebram em duas linhas em vez de sair da tela. */
.call-controls { flex-wrap: wrap; row-gap: 8px; max-width: 100%; }
.control-group { flex-wrap: wrap; justify-content: center; }
/* Chat estreito (ao lado da call): o texto de exemplo do campo fica numa linha só. */
.composer textarea:placeholder-shown { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Avatares do painel de DM visíveis nos dois temas (no claro o fundo sumia). */
.dock-msg-avatar, .dock-avatar:not(.icon), .dock-row-avatar { background: color-mix(in srgb, var(--mint) 16%, var(--surface-raised)); }
