/* GG Call — tema. A paleta escura parte das variáveis observadas no splash do instalador analisado
   (docs/analise-discord.md, seção "Paleta"); o restante das medidas é decisão de projeto. */
:root {
  --brand: #5865f2;
  --brand-dark: #4e59e0;
  --brand-hint: #bbc0fb;
  --red: #ed4245;
  --green: #3ba55c;
  --yellow: #fee75c;
  --grey: #747f8d;
  --link: #00b0f4;

  --bg-rail: #1e2124;
  --bg-sidebar: #2e3136;
  --bg-account: #282b30;
  --bg-chat: #36393e;
  --bg-input: #40444b;
  --bg-float: #18191c;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(255, 255, 255, 0.1);
  --bg-mention: rgba(254, 231, 92, 0.1);
  --border: rgba(0, 0, 0, 0.28);
  --text: #dcddde;
  --text-strong: #fff;
  --text-muted: #8a8e94;
  --text-channel: #99aab5;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --font: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
  --mono: Consolas, Menlo, Monaco, monospace;
  color-scheme: dark;
}
[data-theme='light'] {
  --bg-rail: #dbdde1;
  --bg-sidebar: #f3f3f3;
  --bg-account: #e9e7e7;
  --bg-chat: #fff;
  --bg-input: #ebebeb;
  --bg-float: #fff;
  --bg-hover: rgba(0, 0, 0, 0.06);
  --bg-active: rgba(0, 0, 0, 0.1);
  --bg-mention: rgba(254, 201, 0, 0.16);
  --border: rgba(0, 0, 0, 0.12);
  --text: #2e3136;
  --text-strong: #000;
  --text-muted: #5c6470;
  --text-channel: #4f5660;
  --link: #0068e0;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.375;
  color: var(--text);
  background: var(--bg-chat);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.35); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- botões e campos (.btn, .link-btn, .input, .field, .check, .radio-*: ui-forms.css) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 4px; color: var(--text-channel); flex: none;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.icon-btn.off { color: var(--red); }
.icon-btn.on { color: var(--text-strong); background: var(--bg-active); }
.icon-btn.danger-hover:hover { color: var(--red); }
.tabs { display: flex; gap: 4px; align-items: center; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.tabs .link-btn { margin-left: auto; }
.tab { padding: 8px 12px; font-weight: 600; font-size: 0.875rem; color: var(--text-channel); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text-strong); }
.tab.active { color: var(--text-strong); border-bottom-color: var(--brand); }

/* ---------- splash e acesso */
.splash { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--bg-account); color: var(--text-strong); }
.splash-logo { color: var(--brand); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: 0.75; } }
.auth-screen { height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: auto; background: radial-gradient(1200px 600px at 20% 0%, #4752c4, transparent), radial-gradient(900px 500px at 100% 100%, #3c45a5, transparent), var(--brand); }
.auth-card { width: min(480px, 100%); background: var(--bg-chat); border-radius: 8px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.5rem; color: var(--text-strong); text-align: center; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.25rem; font-weight: 800; color: var(--brand); margin-bottom: 16px; }
[data-theme='dark'] .auth-brand { color: var(--brand-hint); }
.auth-sub { text-align: center; color: var(--text-channel); margin: 8px 0 20px; }
.auth-server { margin-bottom: 16px; }
.auth-server summary { cursor: pointer; font-size: 0.8125rem; color: var(--text-channel); margin-bottom: 8px; }
.auth-switch { margin-top: 12px; font-size: 0.875rem; color: var(--text-muted); }

/* ---------- casca */
.shell { height: 100%; display: flex; }
.rail { width: 72px; flex: none; background: var(--bg-rail); padding: 12px 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-item { position: relative; width: 72px; display: flex; justify-content: center; }
.rail-pill { position: absolute; left: 0; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--text-strong); transform: translateY(-50%); transition: height 0.15s; }
.rail-item.unread .rail-pill { height: 8px; }
.rail-item:hover .rail-pill { height: 20px; }
.rail-item.active .rail-pill { height: 40px; }
.rail-btn {
  width: 48px; height: 48px; border-radius: 50%; background: var(--bg-chat); color: var(--text-strong);
  font-weight: 600; font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: border-radius 0.15s, background 0.15s, color 0.15s; overflow: hidden;
}
.rail-btn:hover, .rail-item.active .rail-btn { border-radius: 16px; background: var(--brand); color: var(--on-brand); }
.rail-btn.add { color: var(--green); }
.rail-btn.add:hover { background: var(--green); color: #fff; }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--bg-active); flex: none; }
.badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 0.6875rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.rail-item .badge { position: absolute; right: 8px; bottom: -2px; box-shadow: 0 0 0 3px var(--bg-rail); }
.rail-item .badge.live { background: var(--green); }
.badge.inline { flex: none; }

.sidebar { width: 240px; flex: none; background: var(--bg-sidebar); display: flex; flex-direction: column; min-height: 0; }
.sidebar-header { height: 48px; flex: none; display: flex; align-items: center; padding: 0 10px; box-shadow: 0 1px 0 var(--border); z-index: 1; }
.guild-header-btn { width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; font-weight: 600; color: var(--text-strong); }
.guild-header-btn:hover { background: var(--bg-hover); }
.guild-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-btn { width: 100%; height: 28px; padding: 0 8px; border-radius: 4px; background: var(--bg-rail); color: var(--text-muted); font-size: 0.8125rem; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 16px; min-height: 0; }
.sidebar-empty { padding: 12px 8px; color: var(--text-muted); font-size: 0.875rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 8px 4px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-muted); }
.section-head .icon-btn { width: 20px; height: 20px; }
.nav-row { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px; margin-top: 2px; border-radius: 4px; color: var(--text-channel); text-align: left; }
.nav-row.dm, .nav-row:not(.channel) { min-height: 42px; }
.nav-row:hover { background: var(--bg-hover); color: var(--text); }
.nav-row.active { background: var(--bg-active); color: var(--text-strong); }
.nav-row.unread { color: var(--text-strong); font-weight: 600; }
.nav-row.connected .nav-name { color: var(--green); }
.nav-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; min-height: 34px; color: inherit; font-weight: inherit; text-align: left; }
.nav-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-name small { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.row-action { width: 24px; height: 24px; opacity: 0; }
.nav-row:hover .row-action, .row-action:focus-visible, .nav-row.active .row-action { opacity: 1; }
.voice-user { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 36px; color: var(--text-channel); font-size: 0.875rem; }
.voice-user.speaking .avatar { box-shadow: 0 0 0 2px var(--green); }
.voice-user.speaking .nav-name { color: var(--text-strong); }
.live-tag { flex: none; padding: 0 6px; border-radius: 8px; background: var(--red); color: #fff; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; line-height: 16px; }
.voice-panel { flex: none; background: var(--bg-account); padding: 8px; border-bottom: 1px solid var(--border); }
.voice-status { display: flex; align-items: center; gap: 4px; }
.voice-where { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; }
.voice-where strong { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--green); }
.voice-where.connecting strong { color: var(--yellow); }
.voice-where small { color: var(--text-muted); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-where:hover small { text-decoration: underline; }
.voice-actions { display: flex; gap: 8px; margin-top: 8px; }
.voice-actions .btn { flex: 1; }
.user-panel { flex: none; height: 52px; background: var(--bg-account); display: flex; align-items: center; gap: 2px; padding: 0 8px; }
.user-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 4px; text-align: left; }
.user-btn:hover { background: var(--bg-hover); }
.user-names { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.user-names strong { font-size: 0.875rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-names small { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; user-select: none; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grey); flex: none; display: inline-block; }
.avatar .status-dot { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border: 3px solid var(--bg-sidebar); box-sizing: border-box; }
.status-dot.online { background: var(--green); }
.status-dot.idle { background: var(--yellow); }
.status-dot.dnd { background: var(--red); }
.status-dot.offline, .status-dot.invisible { background: var(--grey); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-chat); }
.banner { flex: none; padding: 6px 16px; background: var(--red); color: #fff; font-size: 0.875rem; font-weight: 600; text-align: center; }
.topbar { height: 48px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; box-shadow: 0 1px 0 var(--border); z-index: 1; }
.topbar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--text-channel); }
.topbar-title h1 { font-size: 1rem; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic { font-size: 0.875rem; color: var(--text-muted); padding-left: 12px; border-left: 1px solid var(--bg-active); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.search-box { position: relative; display: flex; align-items: center; color: var(--text-muted); }
.search-box .icon { position: absolute; right: 6px; pointer-events: none; }
.search-input { width: 160px; height: 26px; padding: 0 26px 0 8px; border-radius: 4px; border: 0; background: var(--bg-rail); font-size: 0.8125rem; transition: width 0.2s; }
.search-input:focus { width: 240px; outline: 2px solid var(--brand); }
.search-input::-webkit-search-cancel-button { display: none; }
.content { flex: 1; min-height: 0; display: flex; }
/* Área principal do layout. Escopo em .content para não pegar os botões .btn.primary. */
.content > .primary { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.content > .primary.call { background: #000; }

/* ---------- chat */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 0 8px; display: flex; flex-direction: column; }
.messages > :first-child { margin-top: auto; }
.messages:focus-visible { outline-offset: -2px; }
.channel-intro { padding: 16px; }
.channel-intro h2 { font-size: 1.75rem; color: var(--text-strong); margin: 8px 0 4px; }
.channel-intro p { color: var(--text-channel); }
.intro-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--bg-input); display: inline-flex; align-items: center; justify-content: center; color: var(--text-strong); }
.messages-empty { padding: 0 16px 8px; color: var(--text-muted); }
.day-divider { display: flex; align-items: center; margin: 16px 16px 4px; height: 0; border-top: 1px solid var(--bg-active); justify-content: center; }
.day-divider span { background: var(--bg-chat); padding: 0 8px; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.day-divider.new { border-color: var(--red); justify-content: flex-end; }
.day-divider.new span { color: var(--red); text-transform: uppercase; }
.msg { position: relative; display: grid; grid-template-columns: 72px 1fr; padding: 2px 48px 2px 0; margin-top: 16px; }
.msg.grouped { margin-top: 0; }
.msg:hover, .msg:focus-within { background: rgba(0, 0, 0, 0.07); }
.msg.mentioned { background: var(--bg-mention); box-shadow: inset 2px 0 0 var(--yellow); }
.msg.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 60% { background: rgba(88, 101, 242, 0.3); } }
.msg-reply { grid-column: 2; display: flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--text-channel); margin-bottom: 2px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.msg-reply:hover { color: var(--text-strong); }
.msg-gutter { grid-column: 1; display: flex; justify-content: center; }
.msg-time-hover { font-size: 0.6875rem; color: var(--text-muted); visibility: hidden; line-height: 1.375rem; }
.msg:hover .msg-time-hover { visibility: visible; }
.msg-main { grid-column: 2; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-head strong { font-weight: 600; }
.msg-head time { font-size: 0.75rem; color: var(--text-muted); }
.msg-content { white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; color: var(--text); }
.edited { font-size: 0.625rem; color: var(--text-muted); }
.mention { background: rgba(88, 101, 242, 0.3); color: var(--brand-hint); border-radius: 3px; padding: 0 2px; font-weight: 500; }
[data-theme='light'] .mention { color: var(--brand-dark); background: rgba(88, 101, 242, 0.15); }
.code-inline, .code-block { font-family: var(--mono); font-size: 0.875em; background: var(--bg-sidebar); border-radius: 4px; }
.code-inline { padding: 1px 4px; }
.code-block { display: block; padding: 8px; margin: 4px 0; border: 1px solid var(--border); overflow-x: auto; white-space: pre; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 8px; background: var(--bg-sidebar); border: 1px solid transparent; font-size: 0.875rem; }
.reaction span { font-weight: 600; color: var(--text-channel); }
.reaction:hover { border-color: var(--grey); }
.reaction.mine { background: rgba(88, 101, 242, 0.2); border-color: var(--brand); }
.msg-tools { position: absolute; right: 16px; top: -16px; display: none; background: var(--bg-chat); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); padding: 2px; z-index: 2; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { display: flex; }
.edit-box small { font-size: 0.75rem; color: var(--text-muted); }
.edit-input { width: 100%; min-height: 44px; padding: 10px; border-radius: 8px; border: 0; background: var(--bg-input); resize: vertical; }
.compact .msg { grid-template-columns: 56px 1fr; margin-top: 4px; }
.compact .msg .msg-gutter .avatar { width: 24px !important; height: 24px !important; font-size: 10px !important; }
.composer { flex: none; margin: 0 16px; }
.reply-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; background: var(--bg-sidebar); border-radius: 8px 8px 0 0; font-size: 0.875rem; color: var(--text-channel); }
.reply-bar:not([hidden]) + .composer-row { border-radius: 0 0 8px 8px; }
.composer-row { display: flex; align-items: flex-end; gap: 4px; background: var(--bg-input); border-radius: 8px; padding: 6px 8px 6px 16px; }
.composer-row textarea { flex: 1; min-height: 32px; max-height: 240px; padding: 5px 0; border: 0; background: none; resize: none; outline: none; line-height: 1.375; color: var(--text-strong); }
.composer-row textarea::placeholder { color: var(--text-muted); }
.composer-row:focus-within { box-shadow: 0 0 0 1px var(--brand); }
.composer-row .send { color: var(--brand-hint); }
.char-counter { align-self: center; font-size: 0.75rem; color: var(--red); font-variant-numeric: tabular-nums; }
.typing { flex: none; height: 24px; padding: 0 16px; font-size: 0.8125rem; color: var(--text-channel); display: flex; align-items: center; gap: 6px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.typing-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* ---------- painel lateral */
.side-panel { width: 240px; flex: none; background: var(--bg-sidebar); overflow-y: auto; padding: 8px; }
.side-panel.search { width: 360px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 8px; }
.side-head h2 { font-size: 0.875rem; color: var(--text-strong); }
.member { width: 100%; display: flex; align-items: center; gap: 12px; padding: 4px 8px; min-height: 42px; border-radius: 4px; text-align: left; }
.member:hover { background: var(--bg-hover); }
.member.offline { opacity: 0.45; }
.owner-tag { color: var(--yellow); }
.search-result { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 10px; margin-bottom: 8px; border-radius: 6px; background: var(--bg-chat); text-align: left; border: 1px solid transparent; }
.search-result:hover { border-color: var(--brand); }
.result-meta { font-size: 0.75rem; color: var(--text-muted); }
.result-author { font-weight: 600; font-size: 0.875rem; }
.result-text { font-size: 0.875rem; overflow-wrap: anywhere; }

/* ---------- pessoas */
.people { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 24px; }
.people-search { flex: none; margin-bottom: 8px; }
.people-list { flex: 1; overflow-y: auto; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-top: 1px solid var(--bg-active); }
.person:hover { background: var(--bg-hover); border-radius: 8px; }
.person-names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-names strong { color: var(--text-strong); }
.person-names small { color: var(--text-muted); font-size: 0.8125rem; }

/* ---------- chamada */
.callview { flex: 1; min-height: 0; display: flex; flex-direction: column; color: #fff; }
.call-stage { flex: 1; min-height: 0; padding: 16px; display: flex; }
.call-stage > .empty-state { margin: auto; color: #dcddde; }
.call-grid { flex: 1; display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 8px; align-content: center; }
.call-focus { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.call-focus > .tile { flex: 1; min-height: 0; aspect-ratio: auto; }
.call-strip { flex: none; height: 110px; display: flex; gap: 8px; justify-content: center; }
.call-strip .tile { height: 100%; width: auto; }
.tile { position: relative; aspect-ratio: 16 / 9; max-height: 100%; background: #202225; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid transparent; }
.tile.speaking { border-color: var(--green); }
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile.user video { object-fit: cover; }
.tile video.mirror { transform: scaleX(-1); }
.tile-label { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.6); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; }
.tile-full, .tile-stop { position: absolute; top: 8px; right: 8px; opacity: 0; }
.tile-full { background: rgba(0, 0, 0, 0.6); color: #fff; }
.tile-stop { right: 48px; }
.tile:hover .tile-full, .tile:hover .tile-stop, .tile:focus-within .tile-full, .tile:focus-within .tile-stop { opacity: 1; }
.tile-wait { color: #b9bbbe; font-size: 0.875rem; }
.call-controls { flex: none; display: flex; justify-content: center; gap: 12px; padding: 12px 16px 20px; }
.round-btn { width: 56px; height: 56px; border-radius: 50%; background: #36393e; color: #fff; display: flex; align-items: center; justify-content: center; }
.round-btn:hover { background: #4f545c; }
.round-btn.off { background: #fff; color: var(--red); }
.round-btn.on { background: var(--green); }
.round-btn.hangup { background: var(--red); }
.round-btn.hangup:hover { background: #c93b3e; }

/* ---------- flutuantes */
/* .modal*, .source*, .switcher*, .settings*, .profile-card, .meter: ui-forms.css */
.menu { position: fixed; z-index: 200; min-width: 200px; padding: 6px 8px; border-radius: 4px; background: var(--bg-float); box-shadow: var(--shadow); border: 1px solid var(--border); }
.menu-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; padding: 0 8px; border-radius: 2px; font-size: 0.875rem; color: var(--text); text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--brand); color: var(--on-brand); outline: none; }
.menu-item.active { font-weight: 700; }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover, .menu-item.danger:focus-visible { background: var(--red); color: #fff; }
.menu-sep { height: 1px; margin: 4px; background: var(--bg-active); }
.menu.emoji-grid { display: grid; grid-template-columns: repeat(6, 36px); gap: 2px; min-width: 0; }
.menu.emoji-grid button { width: 36px; height: 36px; font-size: 1.25rem; border-radius: 4px; }
.menu.emoji-grid button:hover, .menu.emoji-grid button:focus-visible { background: var(--bg-active); }
#toast-root { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 6px; background: var(--bg-float); color: var(--text-strong); box-shadow: var(--shadow); font-size: 0.875rem; max-width: 80vw; border-left: 4px solid var(--brand); }
.toast.error { border-left-color: var(--red); }
.empty-state { margin: auto; padding: 32px 16px; text-align: center; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state h3 { font-size: 1.0625rem; color: var(--text-strong); }
.empty-state p { color: var(--text-muted); font-size: 0.875rem; }
.spinner-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; color: var(--text-muted); font-size: 0.875rem; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bg-active); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1000px) { .side-panel.members { display: none; } }
/* Reduzir movimento: segue o sistema, a menos que a pessoa tenha escolhido "Nunca reduzir" (.allow-motion);
   .reduce-motion (Configurações → Acessibilidade) força o mesmo efeito com o sistema desligado. */
@media (prefers-reduced-motion: reduce) { :root:not(.allow-motion) *, :root:not(.allow-motion) *::before, :root:not(.allow-motion) *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
:root.reduce-motion *, :root.reduce-motion *::before, :root.reduce-motion *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
