/* GS Talk — visual M2M (tema escuro, claro e meia-noite) */
:root, [data-theme="dark"] {
  /* identidade da Central M2M (mesmos valores do site: css/styles.css) */
  --bg-rail: #050506; --bg-side: #0a0b0e; --bg-main: #0c0d10; --bg-panel: #08090b; --bg-input: #15171b;
  --bg-float: #101215; --bg-modal: #101215; --bg-modal-foot: #0a0b0e; --bg-card: #101215;
  --bg-hover: rgba(255, 255, 255, .05); --bg-active: rgba(255, 255, 255, .1); --bg-msg-hover: rgba(255, 255, 255, .02);
  --text: #e8e8ea; --text-strong: #ffffff; --text-muted: #9b9ba1; --text-faint: #6f6f74; --text-link: #E8C97A;
  --ch-default: #8a8a90; --interactive: #b4b4b9; --interactive-hover: #ffffff;
  --brand: #E8C97A; --brand-hover: #D4A853; --on-brand: #141310; --green: #7fe0a5; --green-hover: #5fc98a; --yellow: #FACC15;
  --red: #FF5C7A; --red-hover: #e04a68; --grey-btn: #1c1e23; --grey-btn-hover: #2a2c32;
  --border: rgba(255, 255, 255, .09); --sep: rgba(255, 255, 255, .09); --shadow: 0 8px 32px rgba(0, 0, 0, .5);
  --mention-bg: rgba(232, 201, 122, .16); --mention-fg: #E8C97A; --mentioned-bg: rgba(232, 201, 122, .06);
  --code-bg: #101215; --spoiler: #050506;
  --scroll-thumb: #24262b; --scroll-track: #0a0b0e;
  --ring: var(--bg-side);
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'IBM Plex Sans', 'Inter', sans-serif;
  --font-mono: 'Courier Prime', 'Courier New', ui-monospace, Menlo, monospace;
  --chat-font: 15px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg-rail: #e9e7e1; --bg-side: #f3f1ec; --bg-main: #fbfaf7; --bg-panel: #ecebe7; --bg-input: #ecebe7;
  --bg-float: #ffffff; --bg-modal: #ffffff; --bg-modal-foot: #f3f1ec; --bg-card: #f3f1ec;
  --bg-hover: rgba(5, 5, 6, .05); --bg-active: rgba(5, 5, 6, .1); --bg-msg-hover: rgba(5, 5, 6, .02);
  --text: #26262a; --text-strong: #050506; --text-muted: #5f5f66; --text-faint: #85858c; --text-link: #7d5e1c;
  --ch-default: #5f5f66; --interactive: #4a4a50; --interactive-hover: #050506;
  --brand: #8a6a1e; --brand-hover: #6f5416; --on-brand: #ffffff; --green: #1f9d5b; --green-hover: #178049;
  --border: rgba(0, 0, 0, .09); --sep: rgba(0, 0, 0, .09); --shadow: 0 8px 16px rgba(0, 0, 0, .12);
  --mention-bg: rgba(138, 106, 30, .15); --mention-fg: #6f5416; --mentioned-bg: rgba(138, 106, 30, .08);
  --grey-btn: #dcdad4; --grey-btn-hover: #cbc9c3;
  --code-bg: #f3f1ec; --spoiler: #c4c2bb;
  --scroll-thumb: #c4c2bb; --scroll-track: #f3f1ec;
  color-scheme: light;
}
[data-theme="midnight"] {
  --bg-rail: #000000; --bg-side: #050506; --bg-main: #08090b; --bg-panel: #020203; --bg-input: #101215;
  --bg-float: #000000; --bg-modal: #08090b; --bg-modal-foot: #050506; --bg-card: #101215;
  --code-bg: #050506; --scroll-thumb: #1c1e23; --scroll-track: #050506;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg-rail); color: var(--text); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--text-link); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { font-weight: 600; }
.ic { flex-shrink: 0; display: block; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1; }

/* rolagem */
.side-scroll, .members-scroll, .rail-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.side-scroll:hover, .members-scroll:hover { scrollbar-color: var(--scroll-thumb) transparent; }
.msg-scroll, .set-main, .set-nav, .f-main, .pk-body, .pop-body, .sp-list, .modal-body, .dm-profile, .f-active, .inv-list, .sw-list {
  scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent;
}

/* ---------- abertura ---------- */
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--bg-rail); color: var(--text-muted); font-size: 14px; }
.boot-logo { color: var(--brand); animation: bob 1.4s ease-in-out infinite; }
.boot-logo:empty { width: 56px; height: 56px; background: url(/img/logo-m2m.png) center / contain no-repeat; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.offline-bar { background: var(--red); color: #fff; text-align: center; font-size: 14px; font-weight: 500; padding: 6px; }
.update-bar { background: var(--green); color: #fff; text-align: center; font-size: 14px; font-weight: 500; padding: 6px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.update-bar button { border: 1px solid #fff; border-radius: 3px; padding: 2px 10px; font-weight: 600; }
.update-bar button.later { border-color: transparent; text-decoration: underline; font-weight: 500; }

/* ---------- estrutura ---------- */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; box-sizing: border-box;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.m-nav { display: none; color: var(--interactive); flex-shrink: 0; }
.app-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 72px 240px minmax(0, 1fr); }
.sidebar { background: var(--bg-side); border-left: 1px solid var(--border); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; --ring: var(--bg-side); }
.main { background: var(--bg-main); min-width: 0; min-height: 0; display: flex; flex-direction: column; --ring: var(--bg-main); }

/* ---------- coluna dos servidores ---------- */
.rail { background: var(--bg-rail); min-height: 0; }
.rail-scroll { height: 100%; overflow-y: auto; padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-item { position: relative; width: 72px; display: flex; justify-content: center; flex-shrink: 0; }
.rail-btn { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg-main); color: var(--text); transition: border-radius .15s, background .15s, color .15s; }
.rail-item:hover .rail-btn, .rail-item.active .rail-btn { border-color: var(--brand); }
.rail-item.home .rail-btn { color: var(--text); }
.rail-item.home .ic { border-radius: 50%; }
.rail-item.add .rail-btn { color: var(--green); }
.rail-item.add:hover .rail-btn { background: var(--green); color: #fff; }
.rail-btn .gicon { border-radius: 0; }
.rail-item:hover .gicon-text, .rail-item.active .gicon-text { background: var(--brand); color: var(--on-brand); }
.rail-btn .avatar, .rail-btn .avatar > img, .rail-btn .avatar-fallback { border-radius: 0; }
.pill { position: absolute; left: 0; top: 50%; width: 8px; height: 0; margin-left: -4px; border-radius: 0 4px 4px 0; background: var(--text-strong); transform: translateY(-50%); transition: height .15s; }
.rail-item.unread .pill { height: 8px; }
.rail-item:hover .pill { height: 20px; }
.rail-item.active .pill { height: 40px; }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--sep); flex-shrink: 0; }
.rail-badge { position: absolute; right: 10px; bottom: -2px; box-shadow: 0 0 0 4px var(--bg-rail); }
.rail-voice { position: absolute; right: 10px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--bg-rail); }

.gicon { display: block; border-radius: 30%; object-fit: cover; flex-shrink: 0; }
.gicon-text { display: flex; align-items: center; justify-content: center; background: var(--bg-main); color: var(--text); font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.badge { display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; line-height: 16px; text-align: center; flex-shrink: 0; }

/* ---------- avatar e status ---------- */
.avatar { position: relative; flex-shrink: 0; border-radius: 50%; }
.avatar > img, .avatar-fallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar-fallback { background: var(--av); color: #fff; display: flex; align-items: center; justify-content: center; }
.avatar.speaking::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px var(--ring); }
.status { position: absolute; right: -2px; bottom: -2px; width: var(--sz); height: var(--sz); border-radius: 50%; box-shadow: 0 0 0 3px var(--ring); }
.s-online { background: var(--green); }
.s-idle { background: var(--yellow); }
.s-dnd { background: var(--red); }
.s-offline, .s-invisible { background: #80848e; }
.s-idle::after, .s-dnd::after, .s-offline::after, .s-invisible::after { content: ''; position: absolute; background: var(--ring); border-radius: 50%; }
.s-idle::after { width: 62%; height: 62%; top: -8%; left: -8%; }
.s-dnd::after { left: 20%; right: 20%; top: 40%; height: 20%; border-radius: 4px; }
.s-offline::after, .s-invisible::after { inset: 27%; }
.status-ic { position: relative; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; --ring: var(--bg-card); }

/* ---------- barra lateral ---------- */
.side-col { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.side-head { height: 48px; flex-shrink: 0; display: flex; align-items: center; padding: 0 10px; box-shadow: 0 1px 0 rgba(4, 4, 5, .2), 0 1.5px 0 rgba(6, 6, 7, .05), 0 2px 0 rgba(4, 4, 5, .05); z-index: 2; }
.guild-head { padding: 0 16px; justify-content: space-between; gap: 8px; font-weight: 600; color: var(--text-strong); cursor: pointer; transition: background .1s; }
.guild-head:hover, .guild-head.open { background: var(--bg-hover); }
.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 8px; }
.side-pad { height: 8px; }
.guild-drop { position: absolute; top: 56px; left: 10px; right: 10px; z-index: 20; background: var(--bg-float); border-radius: 4px; padding: 6px 8px; box-shadow: var(--shadow); animation: pop .12s; }
.gd-item { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 8px; margin: 2px 0; border-radius: 2px; font-size: 14px; font-weight: 500; color: var(--interactive); }
.gd-item:hover { background: var(--brand); color: var(--on-brand); }
.gd-item.brand { color: var(--brand); }
.gd-item.brand:hover { color: #fff; }
.gd-item.danger { color: var(--red); }
.gd-item.danger:hover { background: var(--red); color: #fff; }
.gd-sep { height: 1px; background: var(--border); margin: 4px; }

.cat { margin-top: 16px; }
.cat-head { display: flex; align-items: center; height: 24px; padding: 0 8px 0 0; cursor: pointer; color: var(--ch-default); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.cat-head:hover { color: var(--interactive-hover); }
.cat-arrow { width: 16px; display: flex; justify-content: center; transition: transform .15s; }
.cat-arrow.collapsed { transform: rotate(-90deg); }
.cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-add { display: flex; color: var(--ch-default); }
.cat-add:hover { color: var(--interactive-hover); }
.ch-wrap { padding: 1px 0; }
.ch { position: relative; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: 4px; color: var(--ch-default); cursor: pointer; font-weight: 500; }
.ch:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.ch.active { background: var(--bg-active); color: var(--text-strong); }
.ch.unread { color: var(--text-strong); font-weight: 600; }
.ch-pill { position: absolute; left: -8px; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 0 4px 4px 0; background: var(--text-strong); }
.ch-icon { display: flex; flex-shrink: 0; color: var(--ch-default); }
.ch.active .ch-icon, .ch:hover .ch-icon { color: inherit; opacity: .8; }
.ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-tools { display: none; gap: 4px; }
.ch:hover .ch-tools, .ch.active .ch-tools { display: flex; }
.ch-tools button { display: flex; color: var(--interactive); }
.ch-tools button:hover { color: var(--interactive-hover); }
.ch-limit { display: flex; font-size: 12px; border-radius: 4px; overflow: hidden; background: var(--bg-input); line-height: 18px; }
.ch-limit b { font-weight: 400; background: var(--bg-panel); padding: 0 4px; }
.ch-limit { padding-right: 4px; gap: 4px; }
.vc-users { padding: 0 0 4px 30px; }
.vc-user { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; margin: 1px 0; border-radius: 4px; color: var(--ch-default); cursor: pointer; font-size: 14px; font-weight: 500; }
.vc-user:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.vc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-icons { display: flex; gap: 4px; align-items: center; color: var(--interactive); }
.live { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 8px; line-height: 16px; letter-spacing: .02em; }

.find-btn { width: 100%; height: 28px; border-radius: 4px; background: var(--bg-rail); color: var(--text-muted); font-size: 14px; font-weight: 500; text-align: left; padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dm-nav { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 8px; margin: 1px 0; border-radius: 4px; color: var(--ch-default); cursor: pointer; font-weight: 500; }
.dm-nav:hover, .dm-item:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.dm-nav.active, .dm-item.active { background: var(--bg-active); color: var(--text-strong); }
.dm-nav .badge { margin-left: auto; }
.dm-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 8px 4px 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--ch-default); letter-spacing: .02em; }
.dm-head button { display: flex; }
.dm-head button:hover { color: var(--interactive-hover); }
.dm-item { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 8px; margin: 1px 0; border-radius: 4px; color: var(--ch-default); cursor: pointer; }
.dm-item.unread .dm-name { color: var(--text-strong); font-weight: 600; }
.dm-text { flex: 1; min-width: 0; }
.dm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dm-sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-sub.green { color: var(--green); display: flex; align-items: center; gap: 4px; }
.dm-close { display: none; color: var(--interactive); }
.dm-close:hover { color: var(--interactive-hover); }
.dm-item:hover .dm-close { display: flex; }
.dm-empty { padding: 12px 10px; font-size: 13px; color: var(--text-muted); }

.voice-panel { background: var(--bg-panel); padding: 8px; border-bottom: 1px solid var(--border); }
.vp-row { display: flex; align-items: center; gap: 2px; }
.vp-status { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 6px; }
.vp-status > div { min-width: 0; }
.vp-status.ok { color: var(--green); }
.vp-status.warn { color: var(--yellow); }
.vp-title { font-weight: 600; font-size: 14px; line-height: 18px; }
.vp-where { color: var(--text-muted); font-size: 12px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-where:hover { text-decoration: underline; color: var(--text); }
.vp-btn { width: 32px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--interactive); flex-shrink: 0; }
.vp-btn:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.vp-btn.on { color: var(--green); }
.vp-actions { display: flex; gap: 8px; margin-top: 8px; }
.vp-act { flex: 1; height: 32px; border-radius: 4px; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; color: var(--interactive); }
.vp-act:hover { background: var(--bg-active); color: var(--interactive-hover); }
.vp-act.on { background: var(--text-strong); color: var(--bg-main); }
.user-panel { height: 52px; flex-shrink: 0; background: var(--bg-panel); display: flex; align-items: center; padding: 0 8px; gap: 2px; --ring: var(--bg-panel); }
.up-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 2px; margin-left: -2px; border-radius: 4px; cursor: pointer; }
.up-me:hover { background: var(--bg-hover); }
.up-text { min-width: 0; line-height: 1.25; }
.up-name { font-size: 14px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-sub { font-size: 12px; color: var(--text-muted); height: 15px; overflow: hidden; }
.up-a, .up-b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform .2s; }
.up-me:hover .up-a, .up-me:hover .up-b { transform: translateY(-100%); }
.up-btn { width: 32px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--interactive); flex-shrink: 0; }
.up-btn:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.up-btn.danger { color: var(--red); }

/* ---------- cabeçalho e conversa ---------- */
.chat, .friends, .call-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-head { height: 48px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; box-shadow: 0 1px 0 rgba(4, 4, 5, .2), 0 1.5px 0 rgba(6, 6, 7, .05), 0 2px 0 rgba(4, 4, 5, .05); position: relative; z-index: 3; }
.head-icon { display: flex; color: var(--text-faint); }
.chat-title { font-size: 16px; font-weight: 600; color: var(--text-strong); margin: 0; white-space: nowrap; cursor: default; }
.chat-head .avatar + .chat-title { cursor: pointer; }
.head-sep { width: 1px; height: 24px; background: var(--sep); margin: 0 8px; flex-shrink: 0; }
.chat-topic { flex: 1; min-width: 0; font-size: 14px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 16px; padding-left: 8px; flex-shrink: 0; }
.head-tools > button { display: flex; color: var(--interactive); }
.head-tools > button:hover, .head-tools > button.on { color: var(--text-strong); }
.search-box { width: 144px; height: 24px; border-radius: 4px; background: var(--bg-rail); display: flex; align-items: center; padding: 0 6px; transition: width .2s; }
.search-box:focus-within, .search-box.filled { width: 240px; }
.search-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 14px; color: var(--text); }
.search-box input::placeholder { color: var(--text-muted); }
.search-box > span, .search-box > button { display: flex; color: var(--text-muted); }
.chat-body { flex: 1; min-height: 0; display: flex; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

/* mensagens */
.msg-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; overflow-anchor: none; }
.msg-inner { display: flex; flex-direction: column; justify-content: flex-end; min-height: 100%; }
.msg-loading { min-height: 64px; display: flex; justify-content: center; align-items: center; }
.msg-end { height: 24px; flex-shrink: 0; }
.welcome { margin: 16px 16px 8px; }
.welcome h1 { font-size: 32px; font-weight: 700; color: var(--text-strong); margin: 8px 0; line-height: 1.2; }
.welcome p { color: var(--text-muted); margin: 0 0 8px; }
.welcome p b { color: var(--text-strong); }
.welcome-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--grey-btn); display: flex; align-items: center; justify-content: center; color: #fff; }
.welcome-user { font-size: 20px; color: var(--text-strong); margin: -4px 0 16px; }
.welcome-actions { display: flex; gap: 8px; }
.day-sep { display: flex; align-items: center; justify-content: center; margin: 24px 16px 8px; height: 0; border-top: 1px solid var(--sep); }
.day-sep span { background: var(--bg-main); padding: 2px 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); line-height: 13px; }
.new-sep { position: relative; margin: 8px 16px; height: 0; border-top: 1px solid var(--red); }
.new-sep span { position: absolute; right: 0; top: -8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 6px 0 4px; border-radius: 0 8px 8px 0; text-transform: uppercase; }
.new-sep span::before { content: ''; position: absolute; left: -6px; top: 0; border: 8px solid transparent; border-right: 6px solid var(--red); border-left: 0; }
.msg { position: relative; padding: 2px 48px 2px 72px; min-height: 22px; font-size: var(--chat-font); line-height: 1.375; overflow-wrap: anywhere; }
.msg.head { margin-top: 17px; min-height: 44px; }
.msg:hover { background: var(--bg-msg-hover); }
.msg-avatar { position: absolute; left: 16px; top: 4px; cursor: pointer; }
.msg .reply-line + .msg-avatar { top: 26px; }
.msg-head { display: flex; align-items: baseline; gap: 8px; line-height: 1.375; min-width: 0; }
.msg-name { font-weight: 500; color: var(--text-strong); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-name:hover { text-decoration: underline; }
.msg-time { font-size: 12px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.msg-side-time { position: absolute; left: 0; top: 2px; width: 72px; text-align: center; font-size: 11px; color: var(--text-muted); line-height: 22px; display: none; }
.msg:hover .msg-side-time { display: block; }
.msg-content { color: var(--text); white-space: pre-wrap; }
.edited { font-size: 10px; color: var(--text-muted); margin-left: 4px; }
.msg.pending .msg-content { color: var(--text-muted); }
.msg.failed .msg-content { color: var(--red); }
.failed-note { font-size: 12px; color: var(--red); }
.msg.mentioned, .msg.replying { background: var(--mentioned-bg); }
.msg.replying { background: rgba(232, 201, 122, .08); }
.msg.mentioned::before, .msg.replying::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--yellow); }
.msg.replying::before { background: var(--brand); }
.msg.flash { animation: flash 2s ease-out; }
@keyframes flash { 0%, 30% { background: rgba(232, 201, 122, .25); } }
.msg.editing { background: var(--bg-msg-hover); }
.msg.sys { display: flex; align-items: center; min-height: 32px; margin-top: 8px; color: var(--text-muted); }
.sys-ic { position: absolute; left: 30px; display: flex; color: var(--text-muted); }
.sys-ic.green { color: var(--green); }
.sys-name { color: var(--text-strong); font-weight: 500; cursor: pointer; }
.sys-name:hover { text-decoration: underline; }
.sys-text { font-size: .95em; }
.sys-text .msg-time { margin-left: 4px; }
.msg-tools { position: absolute; right: 14px; top: -16px; display: none; align-items: center; background: var(--bg-main); border-radius: 6px; box-shadow: 0 0 0 1px var(--border), 0 4px 8px rgba(0, 0, 0, .15); padding: 2px; z-index: 2; }
.msg:hover .msg-tools { display: flex; }
.msg-tools button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--interactive); }
.msg-tools button:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.msg-tools .qr { font-size: 18px; }
.msg-tools .mt-del { display: none; color: var(--red); }
html.shift .msg-tools .mt-del { display: flex; }
html.shift .msg-tools .mt-more { display: none; }
.mt-sep { width: 1px; height: 20px; background: var(--sep); margin: 0 4px; }
html.compact .msg { padding-left: 16px; }
html.compact .msg-avatar { display: none; }
html.compact .msg.head { margin-top: 6px; min-height: 0; }
html.compact .msg-side-time { display: none !important; }
html.compact .reply-line::before { display: none; }

.reply-line { position: relative; display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-muted); margin-bottom: 4px; cursor: pointer; min-width: 0; height: 18px; }
.reply-line::before { content: ''; position: absolute; left: -38px; top: 9px; width: 33px; height: 14px; border-left: 2px solid #4e5058; border-top: 2px solid #4e5058; border-top-left-radius: 6px; }
.reply-name { font-weight: 500; color: var(--text-strong); white-space: nowrap; opacity: .85; }
.reply-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-line:hover .reply-text { color: var(--text); }
.reply-del { font-style: italic; display: flex; align-items: center; gap: 4px; }

.atts { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; align-items: flex-start; }
.att-img { border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--bg-panel); max-width: 100%; }
.att-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.att-video video { max-width: min(400px, 100%); max-height: 320px; border-radius: 8px; display: block; background: #000; }
.att-file { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: var(--bg-panel); border: 1px solid var(--border); width: min(432px, 100%); color: var(--text-muted); }
.att-meta { flex: 1; min-width: 0; }
.att-meta a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta audio { width: 100%; margin-top: 6px; height: 32px; }
.att-size { font-size: 12px; color: var(--text-muted); }
.att-dl { color: var(--interactive); display: flex; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 7px; border-radius: 8px; background: var(--bg-side); border: 1px solid transparent; font-size: 15px; }
.reaction:hover { border-color: var(--grey-btn); }
.reaction.mine { background: var(--mention-bg); border-color: var(--brand); }
.r-count { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.reaction.mine .r-count { color: var(--mention-fg); }
.add-r { opacity: 0; color: var(--interactive); }
.msg:hover .add-r { opacity: 1; }
.edit-box textarea { width: 100%; background: var(--bg-input); border: 0; border-radius: 8px; padding: 11px 16px; resize: none; outline: 0; color: var(--text); line-height: 1.375; max-height: 50vh; display: block; }
.edit-hint { font-size: 12px; color: var(--text-muted); margin: 4px 0; }
.jump-bar { position: sticky; bottom: 8px; margin: 0 16px; display: flex; justify-content: space-between; align-items: center; background: var(--brand); color: var(--on-brand); border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 500; z-index: 2; }
.jump-bar button { display: flex; align-items: center; gap: 4px; font-weight: 600; }

/* formatação */
.md-code { background: var(--code-bg); border-radius: 4px; padding: .1em .25em; font-family: Consolas, "Cascadia Mono", monospace; font-size: 85%; }
.md-pre { background: var(--code-bg); border: 1px solid var(--bg-panel); border-radius: 4px; padding: 8px; margin: 6px 0 2px; overflow-x: auto; font-family: Consolas, "Cascadia Mono", monospace; font-size: 14px; line-height: 1.25; white-space: pre-wrap; max-width: 90%; }
.msg-content blockquote, .pf-about blockquote, .topic-full blockquote { margin: 2px 0; padding: 0 8px 0 12px; border-left: 4px solid var(--grey-btn); border-radius: 4px 0 0 4px; }
.msg-content ul { margin: 2px 0 2px 16px; padding: 0; }
.md-h1 { font-size: 1.5em; font-weight: 700; margin: 8px 0 4px; line-height: 1.3; }
.md-h2 { font-size: 1.25em; font-weight: 700; margin: 8px 0 4px; }
.md-h3 { font-size: 1em; font-weight: 700; margin: 6px 0 2px; }
.md-sub { font-size: .8em; color: var(--text-muted); }
.mention { background: var(--mention-bg); color: var(--mention-fg); border-radius: 3px; padding: 0 2px; font-weight: 500; cursor: pointer; }
.mention:hover { background: var(--brand); color: var(--on-brand); }
.spoiler { background: var(--spoiler); color: transparent; border-radius: 3px; cursor: pointer; padding: 0 2px; }
.spoiler * { visibility: hidden; }
.spoiler.revealed { background: rgba(127, 127, 127, .15); color: inherit; cursor: auto; }
.spoiler.revealed * { visibility: visible; }
.jumbo { font-size: 2.75em; line-height: 1.2; }

/* caixa de escrever */
.composer-wrap { padding: 0 16px; flex-shrink: 0; position: relative; }
.composer { display: flex; align-items: flex-start; background: var(--bg-input); border-radius: 8px; min-height: 44px; padding-right: 4px; }
.composer.attached { border-top-left-radius: 0; border-top-right-radius: 0; }
.composer textarea { flex: 1; min-width: 0; background: none; border: 0; outline: 0; resize: none; padding: 11px 0; line-height: 1.375; font-size: var(--chat-font); max-height: 50vh; color: var(--text); display: block; }
.composer textarea::placeholder { color: var(--text-faint); }
.composer.locked { align-items: center; padding: 0 16px; color: var(--text-muted); font-size: 14px; }
.comp-btn { height: 44px; padding: 0 12px 0 16px; display: flex; align-items: center; color: var(--interactive); flex-shrink: 0; }
.comp-btn:hover { color: var(--interactive-hover); }
.emoji-btn { padding: 0 8px; }
.emoji-btn:hover { transform: scale(1.1); }
.typing { height: 24px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); padding: 0 4px; overflow: hidden; white-space: nowrap; }
.typing b { font-weight: 700; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text); animation: blink 1.4s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.reply-bar { display: flex; justify-content: space-between; align-items: center; background: var(--bg-side); border-radius: 8px 8px 0 0; padding: 0 16px; height: 34px; font-size: 14px; color: var(--text-muted); }
.reply-bar b { color: var(--text-strong); }
.reply-bar button { display: flex; color: var(--interactive); }
.upload-tray { display: flex; gap: 24px; overflow-x: auto; padding: 20px 16px 10px; background: var(--bg-input); border-radius: 8px 8px 0 0; border-bottom: 1px solid var(--sep); }
.reply-bar + .upload-tray { border-radius: 0; }
.up-card { position: relative; width: 200px; flex-shrink: 0; background: var(--bg-side); border-radius: 4px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.up-thumb { height: 140px; display: flex; align-items: center; justify-content: center; border-radius: 3px; overflow: hidden; color: var(--text-muted); }
.up-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.up-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { height: 4px; background: var(--bg-rail); border-radius: 2px; overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.up-err { color: var(--red); font-size: 12px; }
.up-x { position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; border-radius: 4px; background: var(--bg-main); box-shadow: var(--shadow); color: var(--red); display: flex; align-items: center; justify-content: center; }
.autocomplete { position: absolute; left: 16px; right: 16px; bottom: 100%; margin-bottom: 8px; background: var(--bg-side); border-radius: 8px; padding: 8px 0; box-shadow: var(--shadow); z-index: 5; }
.ac-title { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); padding: 0 16px 6px; }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 8px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.ac-item.sel { background: var(--bg-hover); }
.ac-item b { font-weight: 500; color: var(--text-strong); }
.ac-sub { color: var(--text-muted); margin-left: auto; }
.ac-emoji { font-size: 20px; }
.drop-over { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); z-index: 20; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.drop-card { background: var(--brand); color: var(--on-brand); border-radius: 10px; padding: 32px; width: 320px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; outline: 2px dashed rgba(255, 255, 255, .6); outline-offset: -10px; }
.drop-card b { font-size: 20px; }

/* ---------- membros e perfis ---------- */
.members { width: 240px; flex-shrink: 0; background: var(--bg-side); --ring: var(--bg-side); display: flex; flex-direction: column; min-height: 0; }
.members-scroll { overflow-y: auto; flex: 1; padding: 0 8px 20px; }
.mem-head { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin: 24px 8px 4px; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 8px; margin: 1px 0; border-radius: 4px; cursor: pointer; }
.mem:hover { background: var(--bg-hover); }
.mem.off { opacity: .35; }
.mem.off:hover { opacity: 1; }
.mem-text { min-width: 0; flex: 1; }
.mem-name { display: flex; align-items: center; gap: 4px; font-weight: 500; color: var(--interactive); }
.mem:hover .mem-name { color: var(--interactive-hover); }
.mem-sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crown { color: #f0b232; display: inline-flex; vertical-align: middle; }

.popout { position: fixed; z-index: 60; background: var(--bg-float); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 0 1px var(--border); overflow: hidden; --ring: var(--bg-float); animation: pop .12s; }
.popout.static { position: relative; z-index: 0; animation: none; }
.profile { width: 300px; }
.pf-banner { height: 60px; }
.pf-banner.small { height: 52px; }
.pf-avatar { position: absolute; top: 14px; left: 16px; padding: 6px; background: var(--bg-float); border-radius: 50%; }
.pf-badges { height: 46px; display: flex; justify-content: flex-end; align-items: flex-start; padding: 8px 12px; gap: 4px; }
.pf-tag { font-size: 12px; display: flex; gap: 4px; align-items: center; background: var(--bg-card); padding: 2px 6px; border-radius: 4px; }
.pf-body { padding: 0 16px 16px; }
.pf-name { font-size: 20px; font-weight: 700; color: var(--text-strong); line-height: 24px; word-break: break-word; }
.pf-user { font-size: 14px; color: var(--text); margin-bottom: 8px; }
.pf-custom { font-size: 14px; padding: 8px 10px; background: var(--bg-card); border-radius: 8px; margin-bottom: 8px; }
.pf-actions { display: flex; gap: 8px; margin: 8px 0; align-items: center; }
.pf-actions .btn { flex: 1; }
.pf-card { background: var(--bg-card); padding: 12px; border-radius: 8px; margin-top: 12px; }
.pf-card h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-strong); margin: 14px 0 6px; }
.pf-card h4:first-child { margin-top: 0; }
.pf-about { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-since { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.pf-since span { display: flex; align-items: center; gap: 6px; }
.pf-since .gicon { border-radius: 4px; }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); }
.pf-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.role-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px 0 4px; border-radius: 4px; background: var(--bg-side); font-size: 12px; font-weight: 500; color: var(--text); }
.role-chip i { width: 12px; height: 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: transparent; }
.role-chip i.rm { cursor: pointer; }
.role-chip i.rm:hover { color: #000; }
.role-chip.add { padding: 0 4px; color: var(--interactive); }
.pf-msg { width: 100%; margin-top: 12px; background: transparent; border: 1px solid var(--sep); border-radius: 4px; padding: 8px 10px; outline: 0; color: var(--text); font-size: 14px; }
.pf-msg:focus { border-color: var(--brand); }
.dm-profile { width: 340px; flex-shrink: 0; background: var(--bg-side); overflow-y: auto; position: relative; --ring: var(--bg-side); }
.dm-profile .pf-banner { height: 120px; }
.dm-profile .pf-avatar { top: 74px; background: var(--bg-side); }
.dm-profile .pf-body { padding-top: 58px; }
.dm-profile .pf-card { background: var(--bg-main); }
.pf-shared { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.pf-shared .gicon { border-radius: 10px; }

.status-pop { width: 300px; }
.status-pop .pf-avatar { top: 10px; padding: 5px; }
.st-body { padding: 44px 12px 12px; }
.st-list { margin-top: 12px; background: var(--bg-card); border-radius: 8px; padding: 6px; }
.st-opt { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 4px; cursor: pointer; font-size: 14px; color: var(--interactive); }
.st-opt:hover { background: var(--brand); color: var(--on-brand); --ring: var(--brand); }
.st-txt { flex: 1; display: flex; flex-direction: column; }
.st-txt b { font-weight: 500; }
.st-txt span { font-size: 12px; opacity: .8; }
.st-sep { height: 1px; background: var(--sep); margin: 4px 8px; }

/* ---------- amigos ---------- */
.f-tabs { display: flex; gap: 16px; align-items: center; min-width: 0; overflow: hidden; }
.f-tab { padding: 2px 8px; border-radius: 4px; font-size: 16px; font-weight: 500; color: var(--interactive); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.f-tab:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.f-tab.active { background: var(--bg-active); color: var(--text-strong); }
.f-tab.add { background: var(--green); color: #fff; }
.f-tab.add.active { background: transparent; color: var(--green); }
.f-body { flex: 1; display: flex; min-height: 0; }
.f-main { flex: 1; min-width: 0; overflow-y: auto; padding: 16px 20px 16px 30px; }
.f-active { width: 360px; flex-shrink: 0; border-left: 1px solid var(--sep); padding: 16px; overflow-y: auto; }
.f-active h2 { font-size: 20px; font-weight: 800; color: var(--text-strong); margin: 8px 0 16px; }
.f-search { display: flex; align-items: center; background: var(--bg-rail); border-radius: 4px; padding: 0 8px; height: 34px; color: var(--text-muted); }
.f-search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); }
.f-count { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 8px; }
.f-row { display: flex; align-items: center; gap: 12px; height: 62px; border-top: 1px solid var(--sep); padding: 0 10px; margin: 0 -10px; border-radius: 8px; cursor: pointer; }
.f-row:hover { background: var(--bg-hover); border-color: transparent; }
.f-row:hover + .f-row { border-color: transparent; }
.f-text { flex: 1; min-width: 0; }
.f-name { font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-user { display: none; font-weight: 400; color: var(--text-muted); font-size: 14px; }
.f-row:hover .f-user { display: inline; }
.f-sub { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-actions { display: flex; gap: 10px; }
.f-actions button { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-side); display: flex; align-items: center; justify-content: center; color: var(--interactive); }
.f-row:hover .f-actions button { background: var(--bg-rail); }
.f-actions button:hover { color: var(--interactive-hover); }
.f-actions .ok:hover { color: var(--green); }
.f-actions .no:hover { color: var(--red); }
.f-empty { display: flex; flex-direction: column; align-items: center; margin-top: 60px; color: var(--text-muted); text-align: center; }
.f-empty-art { width: 160px; height: 160px; border-radius: 50%; background: var(--bg-side); display: flex; align-items: center; justify-content: center; margin-bottom: 24px; color: var(--text-faint); }
.f-add h2 { font-size: 16px; font-weight: 600; text-transform: uppercase; color: var(--text-strong); margin: 8px 0; }
.f-add p { color: var(--text-muted); font-size: 14px; margin: 0; }
.f-add-box { display: flex; align-items: center; gap: 8px; background: var(--bg-rail); border: 1px solid var(--bg-rail); border-radius: 8px; padding: 0 12px; height: 52px; margin-top: 16px; }
.f-add-box:focus-within { border-color: var(--brand); }
.f-add-box.ok { border-color: var(--green); }
.f-add-box.bad { border-color: var(--red); }
.f-add-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 16px; color: var(--text); }
.f-add-msg { font-size: 14px; margin-top: 8px; }
.f-add-msg.ok { color: var(--green); }
.f-add-msg.bad { color: var(--red); }
.act-card { background: var(--bg-side); border-radius: 8px; padding: 16px; margin-bottom: 8px; --ring: var(--bg-side); }
.act-top { display: flex; gap: 10px; align-items: center; }
.act-top b { color: var(--text-strong); }
.act-sub { font-size: 12px; color: var(--text-muted); }
.act-where { margin-top: 10px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); }
.act-count { margin-left: auto; background: var(--bg-rail); padding: 0 6px; border-radius: 8px; font-size: 12px; }
.act-empty { text-align: center; padding: 16px; }
.act-empty b { color: var(--text-strong); }
.act-empty p { font-size: 14px; color: var(--text-muted); }

/* ---------- chamada ---------- */
.call-view { background: #000; color: #fff; --ring: #000; }
.call-head { height: 48px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 16px; color: #fff; }
.call-head h1 { font-size: 16px; margin: 0; }
.call-stage { flex: 1; min-height: 0; padding: 8px 16px; display: flex; }
.tiles { flex: 1; min-height: 0; min-width: 0; display: flex; }
.tiles.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; align-content: center; overflow-y: auto; }
.tile { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--tile); display: flex; align-items: center; justify-content: center; cursor: pointer; min-width: 0; }
.tile::after { content: ''; position: absolute; inset: 0; border-radius: 8px; pointer-events: none; transition: box-shadow .1s; }
.tile.speaking::after { box-shadow: inset 0 0 0 3px var(--green); }
.tile.has-video, .tile.screen { background: #050506; }
.vid { width: 100%; height: 100%; display: block; background: #000; }
.vid.mirror { transform: scaleX(-1); }
.tile-label { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .6); border-radius: 4px; padding: 2px 8px; font-size: 14px; font-weight: 500; max-width: calc(100% - 16px); overflow: hidden; white-space: nowrap; }
.tl-ic { color: var(--red); display: flex; }
.tile-full { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 4px; background: rgba(0, 0, 0, .6); display: none; align-items: center; justify-content: center; color: #fff; }
.tile:hover .tile-full { display: flex; }
.tile:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; background: #000; }
.tile:fullscreen::after { border-radius: 0; }
.tile:fullscreen .vid { object-fit: contain !important; }
.tile.screen .tile-full { display: flex; }
.tile-wait { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #aaa; font-size: 14px; }
.tiles.focus { flex-direction: column; gap: 8px; }
.tile-main { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.tile-main .tile { height: 100%; max-width: 100%; }
.tile-strip { display: flex; gap: 8px; justify-content: center; height: 110px; flex-shrink: 0; }
.tile-strip .tile { height: 100%; }
.call-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; padding: 16px; }
.cc-btn { width: 56px; height: 56px; border-radius: 50%; background: #15171b; color: #fff; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.cc-note { flex: 0 0 100%; margin: 0; text-align: center; font-size: 12px; color: #9b9ba1; }
.cc-btn:hover { background: #24262b; }
.cc-btn.on { background: #fff; color: #000; }
.cc-btn.off { background: #fff; color: var(--red); }
.cc-btn.hang { background: var(--red); }
.cc-btn.hang:hover { background: var(--red-hover); }
.cc-btn.join { background: var(--green); }
.cc-btn.join:hover { background: var(--green-hover); }
.call-empty { margin: auto; text-align: center; }
.call-empty h2 { font-size: 28px; margin: 0 0 8px; }
.call-empty p { color: #b4b4b9; }
.call-peek { display: flex; gap: 8px; justify-content: center; margin: 16px 0 24px; --ring: #000; }
.dm-call { background: #000; color: #fff; display: flex; flex-direction: column; height: 45%; min-height: 260px; flex-shrink: 0; padding: 16px 16px 0; --ring: #000; }
.dm-call-peek { flex: 1; display: flex; gap: 16px; align-items: center; justify-content: center; }
.dm-call-bar .call-controls { padding: 12px; }
.incoming { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); width: 240px; background: var(--bg-float); border-radius: 12px; padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--shadow); z-index: 70; --ring: var(--bg-float); }
.inc-av { border-radius: 50%; animation: ringing 1.5s infinite; }
@keyframes ringing { 0% { box-shadow: 0 0 0 0 rgba(35, 165, 90, .6); } 70% { box-shadow: 0 0 0 16px rgba(35, 165, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(35, 165, 90, 0); } }
.inc-name { font-size: 20px; font-weight: 700; color: var(--text-strong); margin-top: 12px; text-align: center; }
.inc-sub { color: var(--text-muted); font-size: 14px; }
.inc-btns { display: flex; gap: 24px; margin-top: 20px; }

/* ---------- janelas ---------- */
.layer { position: fixed; inset: 0; z-index: 50; }
.modal-layer { background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; animation: fade .15s; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.modal { position: relative; background: var(--bg-modal); border-radius: 8px; width: 100%; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: pop .15s; box-shadow: var(--shadow); color: var(--text); --ring: var(--bg-modal); }
.m-sm { max-width: 440px; }
.m-md { max-width: 560px; }
.m-lg { max-width: 760px; }
.modal-x { position: absolute; top: 12px; right: 12px; color: var(--interactive); display: flex; padding: 4px; border-radius: 4px; z-index: 1; }
.modal-x:hover { color: var(--interactive-hover); }
.modal-head { padding: 24px 40px 0; text-align: center; }
.modal-head h2 { margin: 0; font-size: 24px; font-weight: 700; color: var(--text-strong); }
.modal-head p { margin: 8px 0 0; color: var(--text-muted); font-size: 15px; line-height: 1.35; }
.modal-body { padding: 16px 24px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px; background: var(--bg-modal-foot); border-radius: 0 0 8px 8px; }
.label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 8px; letter-spacing: .02em; }
.label.err { color: var(--red); }
.label i { font-style: italic; text-transform: none; font-weight: 500; }
.req { color: var(--red); }
.input { width: 100%; background: var(--bg-rail); border: 0; border-radius: 3px; padding: 10px; font-size: 16px; color: var(--text); outline: 0; }
.input:focus { box-shadow: 0 0 0 1px var(--brand) inset; }
textarea.input { resize: vertical; line-height: 1.4; }
select.input { cursor: pointer; }
.hint { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.hint.pad { padding: 16px; }
.btn { height: 38px; padding: 0 16px; border-radius: 3px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s; white-space: nowrap; }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn.green { background: var(--green); color: #fff; }
.btn.green:hover:not(:disabled) { background: var(--green-hover); }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover:not(:disabled) { background: var(--red-hover); }
.btn.grey { background: var(--grey-btn); color: #fff; }
.btn.grey:hover:not(:disabled) { background: var(--grey-btn-hover); }
.btn.link { color: var(--text-strong); padding: 0 8px; }
.btn.link:hover { text-decoration: underline; }
.btn.danger-link { color: var(--red); padding: 0 8px; }
.btn.danger-link:hover { text-decoration: underline; }
.btn.ghost { background: var(--bg-side); }
.btn.outline-green { border: 1px solid var(--green); color: var(--text-strong); }
.btn.outline-green:hover:not(:disabled) { background: var(--green); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; }
.btn.full { width: 100%; }
.btn.big { height: 44px; font-size: 16px; margin-top: 20px; }
.icon-btn { width: 32px; height: 32px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--interactive); flex-shrink: 0; }
.icon-btn:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.icon-btn.danger:hover { color: var(--red); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--text-link); font-size: 14px; margin-top: 8px; }
.link-btn:hover { text-decoration: underline; }
.choice { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border: 1px solid var(--sep); border-radius: 8px; font-weight: 700; font-size: 16px; color: var(--text-strong); margin-top: 8px; }
.choice:hover { background: var(--bg-hover); }
.choice b { flex: 1; text-align: left; }
.choice-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.choice-sep { text-align: center; font-size: 20px; font-weight: 700; color: var(--text-strong); margin: 24px 0 8px; }
.icon-up { position: relative; width: 80px; height: 80px; margin: 8px auto 0; border-radius: 50%; cursor: pointer; }
.icon-up img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.icon-up-empty { width: 100%; height: 100%; border-radius: 50%; border: 2px dashed var(--interactive); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--interactive); gap: 2px; }
.icon-up-plus { position: absolute; top: 0; right: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; }
.icon-up.big { width: 100px; height: 100px; margin: 0; }
.icon-up.big .gicon { border-radius: 50%; }
.type-opt { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-side); border-radius: 4px; margin-bottom: 8px; text-align: left; }
.type-opt:hover, .type-opt.on { background: var(--bg-active); }
.type-ic { color: var(--interactive); display: flex; }
.type-txt { flex: 1; display: flex; flex-direction: column; }
.type-txt b { color: var(--text-strong); font-weight: 500; }
.type-txt span { font-size: 13px; color: var(--text-muted); }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--interactive); flex-shrink: 0; }
.type-opt.on .radio { border: 6px solid var(--text-strong); }
.input-ic { display: flex; align-items: center; gap: 4px; background: var(--bg-rail); border-radius: 3px; padding-left: 8px; color: var(--interactive); }
.input-ic .input { background: none; box-shadow: none; }
.copy-box { display: flex; align-items: center; gap: 8px; background: var(--bg-rail); border: 1px solid var(--bg-rail); border-radius: 3px; padding: 4px; }
.copy-box.ok { border-color: var(--green); }
.copy-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 6px; color: var(--text); }
.search-input { display: flex; align-items: center; background: var(--bg-rail); border-radius: 4px; padding: 0 8px; height: 34px; color: var(--text-muted); }
.search-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); }
.inv-list { max-height: 260px; overflow-y: auto; margin: 8px -8px 0; }
.inv-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; }
.inv-row:hover { background: var(--bg-hover); }
.inv-row > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-row.click { cursor: pointer; }
.confirm-text { margin: 0; font-size: 16px; line-height: 1.4; }
.confirm-preview { margin-top: 16px; border-radius: 4px; box-shadow: 0 0 0 1px var(--sep), var(--shadow); padding: 10px; }
.topic-full { font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.picks { display: flex; gap: 8px; }
.pick { flex: 1; height: 40px; border-radius: 4px; background: var(--bg-side); border: 1px solid var(--sep); font-weight: 600; }
.pick:hover { border-color: var(--interactive); }
.pick.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.ji { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 8px; }
.ji h2 { margin: 0; font-size: 24px; color: var(--text-strong); }
.ji .gicon { border-radius: 24px; }
.ji-counts { display: flex; gap: 16px; font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }
.ji-counts span { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #80848e; display: inline-block; }
.dot.on { background: var(--green); }
.center-pad { display: flex; justify-content: center; padding: 24px; }
.empty-note { text-align: center; color: var(--text-muted); padding: 24px 16px; font-size: 14px; }
.empty-note.big { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-main { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-muted); }
.empty-main h2 { color: var(--text-strong); }
.spinner { border-radius: 50%; border: 3px solid var(--bg-hover); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* fixadas, busca e emojis */
.popover { position: absolute; z-index: 40; background: var(--bg-side); border-radius: 8px; box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .2); }
.pins { top: 44px; right: 16px; width: 420px; max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; animation: pop .12s; }
.pop-head { display: flex; align-items: center; gap: 8px; padding: 16px; background: var(--bg-panel); font-weight: 600; color: var(--text-strong); }
.pop-body { overflow-y: auto; padding: 8px; }
.pin-item { position: relative; background: var(--bg-main); border-radius: 4px; padding: 10px; margin-bottom: 8px; box-shadow: 0 0 0 1px var(--border); }
.pin-actions { position: absolute; top: 6px; right: 6px; display: none; gap: 4px; align-items: center; }
.pin-item:hover .pin-actions { display: flex; }
.mini-msg { display: flex; gap: 12px; text-align: left; }
.mini-body { min-width: 0; flex: 1; }
.mini-head { display: flex; gap: 8px; align-items: baseline; }
.mini-head b { font-weight: 500; color: var(--text-strong); }
.mini-msg .msg-content { font-size: 15px; }
.mini-atts { font-size: 13px; color: var(--text-muted); display: flex; gap: 4px; align-items: center; }
.search-panel { width: 420px; flex-shrink: 0; background: var(--bg-side); display: flex; flex-direction: column; min-height: 0; }
.sp-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-weight: 600; background: var(--bg-panel); color: var(--text-strong); }
.sp-head button { display: flex; color: var(--interactive); }
.sp-list { overflow-y: auto; padding: 8px 16px; flex: 1; }
.sp-item { background: var(--bg-main); border-radius: 6px; padding: 10px; margin-bottom: 10px; cursor: pointer; border: 1px solid transparent; }
.sp-item:hover { border-color: var(--sep); }
.sp-ch { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.picker { position: fixed; z-index: 65; display: flex; flex-direction: column; overflow: hidden; animation: pop .12s; }
.pk-top { padding: 12px; box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.pk-main { flex: 1; display: flex; min-height: 0; }
.pk-nav { width: 48px; background: var(--bg-panel); overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 6px; scrollbar-width: none; }
.pk-nav button { width: 32px; height: 32px; border-radius: 4px; font-size: 18px; filter: grayscale(1); opacity: .7; flex-shrink: 0; }
.pk-nav button:hover { filter: none; opacity: 1; background: var(--bg-hover); }
.pk-body { flex: 1; overflow-y: auto; padding: 0 8px 8px; position: relative; }
.pk-cat { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin: 0; padding: 12px 4px 6px; position: sticky; top: 0; background: var(--bg-side); z-index: 1; }
.pk-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.em { aspect-ratio: 1; font-size: 26px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.em:hover { background: var(--bg-hover); }
.pk-foot { height: 48px; flex-shrink: 0; background: var(--bg-panel); display: flex; align-items: center; gap: 8px; padding: 0 16px; font-weight: 600; font-size: 14px; }
.pk-big { font-size: 28px; }

/* menu do botão direito */
.ctx { position: fixed; z-index: 80; min-width: 188px; max-width: 320px; background: var(--bg-float); border-radius: 4px; padding: 6px 8px; box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .15); }
.ctx.sub { position: absolute; left: calc(100% + 8px); top: -6px; }
.ctx.sub.flip { left: auto; right: calc(100% + 8px); }
/* ponte invisível sobre o vão: passar por ele não conta como sair do item */
.ctx.sub::before { content: ''; position: absolute; top: 0; bottom: 0; left: -12px; width: 12px; }
.ctx.sub.flip::before { left: auto; right: -12px; }
.ctx-item { position: relative; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 8px; margin: 2px 0; border-radius: 2px; font-size: 14px; font-weight: 500; color: var(--interactive); cursor: pointer; }
.ctx-item:hover { background: var(--brand); color: var(--on-brand); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: var(--red); color: #fff; }
.ctx-item.brand { color: var(--brand); }
.ctx-item.brand:hover { color: var(--on-brand); }
.ctx-item.disabled { opacity: .5; cursor: default; }
.ctx-item.disabled:hover { background: none; color: var(--interactive); }
.ctx-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-sep { height: 1px; background: var(--border); margin: 4px; }
.ctx-check { width: 18px; height: 18px; border-radius: 3px; border: 1px solid var(--interactive); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ctx-check.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ctx-item:hover .ctx-check { border-color: #fff; }
.ctx-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.ctx-slider { padding: 6px 8px; }
.ctx-slider .ctx-label { display: block; font-size: 14px; color: var(--interactive); font-weight: 500; margin-bottom: 8px; }

/* controles */
.range { width: 100%; accent-color: var(--brand); cursor: pointer; }
.switch { width: 40px; height: 24px; border-radius: 12px; background: #80848e; position: relative; flex-shrink: 0; transition: background .15s; }
.switch.on { background: var(--green); }
.knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; color: #80848e; transition: left .15s; }
.switch.on .knob { left: 19px; color: var(--green); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.switch-row > div { display: flex; flex-direction: column; }
.switch-row b { font-weight: 500; color: var(--text-strong); }
.switch-row span { font-size: 14px; color: var(--text-muted); }
.switch-row + .switch-row { border-top: 1px solid var(--sep); }
.radio-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--bg-side); border-radius: 4px; margin-bottom: 8px; cursor: pointer; }
.radio-row input { accent-color: var(--brand); width: 18px; height: 18px; flex-shrink: 0; }
.radio-row div { display: flex; flex-direction: column; }
.radio-row b { font-weight: 500; color: var(--text-strong); }
.radio-row span { font-size: 13px; color: var(--text-muted); }

/* ---------- configurações ---------- */
.settings { display: flex; background: var(--bg-main); animation: fade .15s; }
.set-nav { flex: 1 0 218px; background: var(--bg-side); display: flex; justify-content: flex-end; overflow-y: auto; }
.set-nav-inner { width: 218px; padding: 60px 6px 60px 20px; }
.set-nav h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 6px 10px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-tab { width: 100%; text-align: left; padding: 6px 10px; margin-bottom: 2px; border-radius: 4px; font-size: 16px; font-weight: 500; color: var(--interactive); display: flex; align-items: center; justify-content: space-between; }
.set-tab:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.set-tab.active { background: var(--bg-active); color: var(--text-strong); }
.set-tab.danger { color: var(--red); }
.set-sep { height: 1px; background: var(--sep); margin: 8px 10px; }
.set-ver { font-size: 12px; color: var(--text-muted); padding: 8px 10px; }
.set-main { flex: 1 1 800px; display: flex; overflow-y: auto; position: relative; }
.set-content { width: 100%; max-width: 740px; padding: 60px 40px 100px; min-width: 0; }
.set-close { position: sticky; top: 60px; display: flex; flex-direction: column; align-items: center; gap: 8px; height: fit-content; padding-right: 20px; flex-shrink: 0; color: var(--interactive); font-size: 13px; font-weight: 600; }
.set-close button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--interactive); color: var(--interactive); display: flex; align-items: center; justify-content: center; }
.set-close button:hover { background: var(--bg-hover); }
.set-title { font-size: 20px; font-weight: 600; color: var(--text-strong); margin: 0 0 20px; }
.set-sub { font-size: 16px; font-weight: 600; color: var(--text-strong); margin: 0 0 8px; }
.set-divider { height: 1px; background: var(--sep); margin: 24px 0; }
.acc-card { background: var(--bg-rail); border-radius: 8px; overflow: hidden; --ring: var(--bg-rail); }
.acc-banner { height: 100px; }
.acc-top { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 0 124px; min-height: 56px; }
.acc-av { position: absolute; left: 16px; top: -46px; padding: 6px; background: var(--bg-rail); border-radius: 50%; }
.acc-top b { flex: 1; font-size: 20px; color: var(--text-strong); }
.acc-fields { margin: 16px; padding: 16px; background: var(--bg-side); border-radius: 8px; display: flex; flex-direction: column; gap: 24px; }
.acc-field { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.acc-field h5 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; color: var(--text-muted); }
.acc-field span { color: var(--text-strong); }
.pw-form { max-width: 400px; }
.row-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.row-btns.left { justify-content: flex-start; margin-top: 0; }
.prof-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
.prof-form > .label:first-child { margin-top: 0; }
.prof-preview .label { margin-top: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 32px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; overflow: hidden; }
.sw.on { box-shadow: 0 0 0 2px var(--bg-main), 0 0 0 4px var(--text-strong); }
.sw.big { width: 48px; height: 48px; }
.sw.custom { background: var(--bg-input); color: var(--interactive); cursor: pointer; }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.about-box { position: relative; }
.counter { position: absolute; right: 10px; bottom: 10px; font-size: 12px; color: var(--text-muted); }
.save-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(700px, calc(100% - 40px)); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; background: var(--bg-float); border-radius: 8px; box-shadow: var(--shadow); z-index: 55; animation: pop .2s; }
.save-bar span { flex: 1; font-weight: 500; }
.themes { display: flex; gap: 16px; }
.theme-opt { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--sep); position: relative; }
.theme-opt.on { border-color: var(--brand); }
.t-dark { background: #313338; }
.t-light { background: #fff; }
.t-mid { background: #000; }
.theme-check { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; }
.appear-preview { border: 1px solid var(--sep); border-radius: 8px; padding: 16px; margin-bottom: 8px; }
.ap-msg { display: flex; gap: 16px; font-size: var(--chat-font); }
.ap-msg b { color: var(--text-strong); font-weight: 500; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col .label:first-child { margin-top: 0; }
.mic-test { display: flex; align-items: center; gap: 16px; }
.meter { position: relative; flex: 1; height: 10px; border-radius: 5px; background: var(--bg-rail); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--yellow); transition: width .05s linear; }
.meter-fill.open { background: var(--green); }
.meter-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text-strong); left: 50%; }
.thr-wrap { position: relative; margin: 14px 0; }
.thr-wrap .meter { height: 12px; }
.thr-wrap .range.thr { position: absolute; left: 0; right: 0; top: -5px; margin: 0; background: transparent; height: 22px; }
.key-rec { display: flex; align-items: center; gap: 12px; }
.key-cap { display: inline-block; padding: 4px 10px; border-radius: 4px; background: var(--bg-rail); font-family: Consolas, monospace; font-size: 14px; color: var(--text-strong); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .3); white-space: nowrap; }
.cam-box { width: 100%; max-width: 480px; aspect-ratio: 16 / 9; background: var(--bg-rail); border-radius: 8px; overflow: hidden; margin-bottom: 8px; display: flex; }
.cam-box .vid { object-fit: cover; }
.cam-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-muted); }
.keys { display: flex; flex-direction: column; }
.key-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--sep); gap: 12px; }
.ov-grid { display: flex; gap: 24px; }
.ov-icon { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ov-fields { flex: 1; }
.roles-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.roles-list { display: flex; flex-direction: column; gap: 2px; }
.roles-list .btn { margin-bottom: 8px; }
.role-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; color: var(--interactive); font-weight: 500; }
.role-item:hover { background: var(--bg-hover); }
.role-item.on { background: var(--bg-active); color: var(--text-strong); }
.role-item i { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.role-item .ellip { flex: 1; }
.role-move { display: none; }
.role-item:hover .role-move { display: flex; }
.role-move button { display: flex; color: var(--interactive); }
.role-move button:hover { color: var(--interactive-hover); }
.role-edit-head { display: flex; align-items: center; justify-content: space-between; color: var(--text-strong); }
.subtabs { display: flex; gap: 24px; border-bottom: 1px solid var(--sep); margin: 12px 0 8px; }
.subtabs button { padding: 8px 0; color: var(--interactive); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs button.on { color: var(--text-strong); border-color: var(--brand); }
.mem-table { display: flex; flex-direction: column; margin-top: 12px; }
.mt-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--sep); }
.mt-name { display: flex; flex-direction: column; width: 180px; min-width: 0; }
.mt-name b { color: var(--text-strong); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-roles { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.mt-date { width: 140px; }

/* dica, avisos, foto, troca rápida */
.tooltip { position: fixed; z-index: 100; pointer-events: none; background: #050506; color: #dbdee1; font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 5px; box-shadow: 0 8px 16px rgba(0, 0, 0, .24); max-width: 260px; opacity: 0; transform: scale(.96); transition: opacity .08s, transform .08s; line-height: 1.3; left: -999px; top: -999px; }
.tooltip.show { opacity: 1; transform: none; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--bg-float); color: var(--text-strong); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow), 0 0 0 1px var(--border); font-size: 14px; font-weight: 500; animation: pop .15s; max-width: 480px; }
.toast.error { background: var(--red); color: #fff; }
.lightbox { background: rgba(0, 0, 0, .85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; animation: fade .15s; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 4px; }
.lb-link { color: #fff; opacity: .7; font-size: 14px; }
.lb-link:hover { opacity: 1; }
.switcher { padding: 20px; background: var(--bg-side); }
.sw-input { width: 100%; height: 70px; font-size: 24px; padding: 0 16px; border-radius: 5px; background: var(--bg-rail); border: 0; outline: 0; color: var(--text); }
.sw-list { margin-top: 12px; max-height: 50vh; overflow-y: auto; }
.sw-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 4px; cursor: pointer; color: var(--interactive); }
.sw-item.sel { background: var(--bg-active); color: var(--text-strong); }
.sw-item b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-sub { font-size: 12px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.sw-tip { font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.sw-tip b { color: var(--text); }

/* ---------- entrar ---------- */
.auth { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg-rail); padding: 16px; }
.auth-bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 18%, rgba(232, 201, 122, .14) 0, transparent 46%), var(--bg-rail); }
.auth-card { position: relative; width: 480px; max-width: 100%; background: var(--bg-modal); border: 1px solid var(--border); border-radius: 8px; padding: 32px; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); color: #dbdee1; animation: pop .2s; }
.auth-card .input { background: var(--bg-input); color: var(--text); }
.auth-card .label { color: #b4b4b9; }
.auth-card .hint { color: #9b9ba1; }
.auth-card h1 { text-align: center; margin: 12px 0 4px; font-size: 24px; color: var(--text-strong); }
.auth-sub { text-align: center; color: #b4b4b9; margin: 0 0 8px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; font-weight: 800; font-size: 20px; }
.auth-logo .ic { color: var(--brand); }
.auth-switch { font-size: 14px; color: #9b9ba1; margin: 12px 0 0; }

/* ---------- telas menores ---------- */
@media (max-width: 1100px) {
  .f-active { display: none; }
  .search-panel, .dm-profile { width: 300px; }
}
@media (max-width: 900px) {
  .members, .dm-profile { display: none; }
  .app[data-members] .members, .app[data-members] .dm-profile {
    display: flex; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(280px, 86vw);
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); box-shadow: -8px 0 24px rgba(0, 0, 0, .5);
  }
  .search-box { width: 100px; }
  .prof-grid, .two-col, .roles-grid { grid-template-columns: 1fr; }
  .set-nav { flex: 0 0 200px; }
  .set-nav-inner { width: 200px; padding-left: 8px; }
}
@media (max-width: 640px) {
  .m-nav { display: flex; align-items: center; }
  .empty-main { flex-direction: column; align-items: flex-start; padding: 12px 16px; }
  .empty-main > div { margin: auto; }
  /* duas telas: lista de canais ou conversa, nunca as duas */
  .app-grid { grid-template-columns: 72px minmax(0, 1fr); }
  .app[data-nav] .main { display: none; }
  .app:not([data-nav]) .app-grid { grid-template-columns: minmax(0, 1fr); }
  .app:not([data-nav]) .rail, .app:not([data-nav]) .sidebar { display: none; }
  .search-box, .chat-topic, .head-sep { display: none; }
  .msg { padding-right: 16px; }
  .chat-head { padding-left: 12px; }
  .head-tools { gap: 12px; }
  .f-tabs { overflow-x: auto; scrollbar-width: none; gap: 8px; }
  .f-tab { white-space: nowrap; }
  .pins { left: 8px; right: 8px; width: auto; }
  .search-panel { position: fixed; inset: 0; width: auto; z-index: 40; }
  /* configurações: abas em faixa no alto */
  .settings { flex-direction: column; }
  .set-nav { flex: 0 0 auto; display: block; overflow-x: auto; scrollbar-width: none; margin-right: 52px; }
  .set-nav-inner { display: flex; gap: 4px; width: max-content; padding: 8px; }
  .set-nav h3, .set-sep, .set-ver { display: none; }
  .set-tab { width: auto; white-space: nowrap; margin: 0; font-size: 14px; }
  .set-main { flex: 1; min-height: 0; }
  .set-content { padding: 24px 16px 100px; }
  .set-close { position: fixed; top: 6px; right: 8px; padding: 0; z-index: 3; }
  .set-close span { display: none; }
  /* chamada */
  .call-stage { padding: 8px; }
  .call-controls { gap: 10px; padding: 10px 8px; flex-wrap: wrap; }
  .cc-btn { width: 48px; height: 48px; }
  .tiles.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles.grid .tile:only-child { grid-column: 1 / -1; }
  .tile-strip { height: 72px; overflow-x: auto; justify-content: flex-start; }
}
/* tela de toque: sem dica de mouse, alvos maiores, seleção não briga com "segurar" e sem zoom ao digitar */
@media (hover: none) {
  .tooltip { display: none; }
  .ctx { max-height: calc(100dvh - 16px); overflow-y: auto; }
  .ctx:has(.ctx.sub) { overflow: visible; } /* senão o submenu fica cortado no toque */
  .ctx-item { min-height: 44px; }
  .tile-full { display: flex; }
  .msg, .rail, .sidebar, .mem, .f-row, .tile { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea, select { font-size: 16px !important; }
}

/* ---------- acabamento M2M ---------- */
.side-head, .chat-title, .call-head h1 { font-family: var(--font-display); }
.modal-head h2, .set-title, .call-empty h2, .auth-card h1, .auth-card h2 { font-family: var(--font-display); font-weight: 300; }
.btn { border-radius: 10px; }
.btn.primary { background: linear-gradient(135deg, #E8C97A, #D4A853); font-weight: 700; }
[data-theme="light"] .btn.primary { background: var(--brand); }
.avatar-fallback { font-family: var(--font-mono); font-weight: 700; color: var(--on-brand); }
.cat-head, .mem-head, .set-nav h3, .f-count, .label, .ac-title, .pk-cat, .pf-card h4 { font-family: var(--font-mono); letter-spacing: .12em; }

/* ---------- palco ---------- */
.stage-view { flex: 1; min-height: 0; height: 100%; display: flex; flex-direction: row; overflow: hidden; }
.stage-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.stage-area { flex: 1 1 0; min-height: 0; display: flex; padding: 8px 16px; overflow: hidden; }
.stage-speakers { flex: 1; min-width: 0; min-height: 0; display: flex; }
.stage-speakers .tiles.grid { grid-auto-rows: minmax(0, 1fr); align-content: stretch; overflow: hidden; }
.stage-speakers .tile { aspect-ratio: auto; width: 100%; height: 100%; min-height: 0; }
.stage-speakers .tile:not(.has-video):not(.screen) { background: #0c0d10; border: 1px solid var(--border); }
.stage-speakers .vid { object-fit: contain !important; } /* o quadro do palco não é 16:9: recortar cortaria a pessoa */
.stage-topic { color: #E8C97A; font-size: 14px; min-width: 0; }
.stage-topic-input { max-width: 320px; height: 32px; }
.stage-new { margin: 0 auto 16px; display: block; width: min(420px, 100%); text-align: center; }
.stage-count { margin-left: auto; flex-shrink: 0; font: 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #9b9ba1; }
.stage-head-btn { color: #9b9ba1; display: flex; margin-left: 8px; }
.stage-head-btn.on, .stage-head-btn:hover { color: #fff; }
.stage-seats { flex: 0 0 auto; max-height: 34%; min-height: 0; overflow-y: auto; padding: 8px 16px 12px; border-top: 1px solid var(--border); scrollbar-width: thin; }
.stage-seats h5 { margin: 0 0 8px; font: 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: #9b9ba1; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 8px; --ring: #000; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 8px 2px 4px; border-radius: 10px; color: #fff; }
.seat:hover { background: rgba(255, 255, 255, .06); }
.seat-av { position: relative; }
.seat-av i { position: absolute; right: -6px; bottom: -4px; font-style: normal; font-size: 18px; z-index: 2; }
.seat-name { max-width: 100%; font-size: 12px; }
.stage-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 10px 8px 4px; border-top: 1px solid var(--border); }
.stage-bar:last-child { padding-bottom: 12px; }
.stage-side { flex: 0 0 340px; min-width: 0; display: flex; flex-direction: column; background: var(--bg-main); color: var(--text); border-left: 1px solid var(--border); --ring: var(--bg-main); }
.stage-tabs { flex-shrink: 0; display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); }
.stage-tabs button { padding: 6px 12px; border-radius: 8px; color: var(--interactive); font-size: 14px; }
.stage-tabs button.on { background: var(--bg-active); color: var(--text-strong); }
.stage-tabs .stage-close { margin-left: auto; padding: 6px; display: flex; }
.stage-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage-hands { flex: 1; overflow-y: auto; padding: 8px 12px; }
.stage-hands .stage-p { margin-top: 8px; }
.stage-p { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--bg-input); font-size: 14px; }
.stage-p .ellip { flex: 1; }
.live-stage { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin-bottom: 8px; padding: 8px 10px; text-align: left; border-radius: 10px; border: 1px solid var(--brand); color: var(--text-muted); font-size: 12px; }
.live-stage b { max-width: 100%; color: var(--text-strong); font-size: 14px; }
.stage-alert { background: var(--brand); color: var(--on-brand); }
.stage-alert button { border-color: var(--on-brand); }
@media (max-width: 900px) {
  .stage-side { position: fixed; inset: 0; z-index: 45; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .stage-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}

/* volume da transmissão, em cima da própria tela */
.tile-vol { position: absolute; right: 8px; bottom: 8px; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; cursor: default; }
.tile-vol input { width: 96px; accent-color: #E8C97A; }
.tile-vol span { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

