/* ==========================================================================
   OTAMASHIS — visual inspirado em pablotasuyuki.online
   Monocromático · DM Sans + DM Mono · linhas finas · cantos retos · grade
   ========================================================================== */

:root {
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 3px;
  --r-lg: 6px;
  --ok: #22c55e;
  --idle: #eab308;
  --dnd: #ef4444;
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, .12);
  --link: #60a5fa;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --rail: 72px;
  --side: 272px;
  --members: 248px;
  --head: 52px;
}

:root[data-theme="dark"] {
  --bg0: #050506;
  --bg1: #0b0b0d;
  --bg2: #111114;
  --bg3: #18181c;
  --bg4: #212126;
  --bg5: #2b2b31;
  --line: rgba(255, 255, 255, .07);
  --lineh: rgba(255, 255, 255, .16);
  --linex: rgba(255, 255, 255, .28);
  --txt: #f4f4f5;
  --txtm: #a1a1aa;
  --txtd: #6b6b76;
  --acc: #f4f4f5;
  --acc-ink: #0a0a0c;
  --acc-soft: rgba(255, 255, 255, .06);
  --hover: rgba(255, 255, 255, .045);
  --active: rgba(255, 255, 255, .085);
  --mention: rgba(234, 179, 8, .07);
  --mention-bar: #eab308;
  --grid: rgba(255, 255, 255, .035);
  --shadow: 0 16px 48px rgba(0, 0, 0, .55), 0 0 0 1px var(--line);
  --dragon: url("/img/logo-white.png");
  --code: #0a0a0c;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg0: #ececee;
  --bg1: #f5f5f6;
  --bg2: #ffffff;
  --bg3: #f3f3f5;
  --bg4: #e8e8eb;
  --bg5: #dcdce0;
  --line: rgba(10, 10, 15, .10);
  --lineh: rgba(10, 10, 15, .24);
  --linex: rgba(10, 10, 15, .40);
  --txt: #0a0a0c;
  --txtm: #5a5a64;
  --txtd: #9a9aa4;
  --acc: #0a0a0c;
  --acc-ink: #ffffff;
  --acc-soft: rgba(10, 10, 15, .05);
  --hover: rgba(10, 10, 15, .04);
  --active: rgba(10, 10, 15, .08);
  --mention: rgba(234, 179, 8, .10);
  --mention-bar: #ca8a04;
  --grid: rgba(10, 10, 15, .045);
  --shadow: 0 16px 48px rgba(10, 10, 15, .16), 0 0 0 1px var(--line);
  --dragon: url("/img/logo.png");
  --code: #f5f5f6;
  --link: #2563eb;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.375;
  color: var(--txt);
  background: var(--bg2);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
.mono { font-family: var(--mono); }
::selection { background: var(--acc); color: var(--acc-ink); }

.scroll { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--bg5) transparent; }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
.scroll::-webkit-scrollbar-track { background: transparent; }

.dragon {
  display: inline-block;
  background: var(--dragon) center / contain no-repeat;
  aspect-ratio: 520 / 480;
  width: 28px;
}

/* ---------- Boot ---------- */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--bg1);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 100;
}
.boot-dragon { width: 96px; animation: breathe 2.2s var(--ease) infinite; }
.boot-bar { width: 160px; height: 2px; background: var(--line); overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: var(--acc); animation: slide 1.1s var(--ease) infinite; }
.boot-txt { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--txtd); }
@keyframes breathe { 50% { transform: translateY(-4px); opacity: .85; } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Primitivos ---------- */
.label {
  display: block; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--txtm); margin-bottom: 8px;
}
.label .req { color: var(--bad); }
.hint { font-size: 13px; color: var(--txtd); margin-top: 6px; }
.err-txt { color: var(--bad); font-size: 13px; }

.input, .textarea, .select {
  width: 100%; background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; outline: none; transition: border-color .15s;
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--lineh); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--linex); }
.textarea { resize: vertical; min-height: 80px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--txtm) 50%), linear-gradient(135deg, var(--txtm) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input-wrap { position: relative; }
.input-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--txtd); pointer-events: none; }
.input-wrap .input { padding-left: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px;
  border-radius: var(--r); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--acc); color: var(--acc-ink); border: 1px solid var(--acc); transition: opacity .15s, background .15s, transform .08s;
  white-space: nowrap; user-select: none;
}
.btn:hover { opacity: .88; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--txt); border-color: var(--lineh); }
.btn.ghost:hover { background: var(--hover); opacity: 1; border-color: var(--linex); }
.btn.plain { background: transparent; color: var(--txt); border-color: transparent; }
.btn.plain:hover { text-decoration: underline; opacity: 1; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { min-height: 30px; padding: 0 12px; font-size: 11.5px; }
.btn.block { width: 100%; }

.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--r);
  color: var(--txtm); transition: background .12s, color .12s; font-size: 15px; flex: none; position: relative;
}
.icon-btn:hover { background: var(--hover); color: var(--txt); }
.icon-btn.on { color: var(--txt); }
.icon-btn.danger-on { color: var(--bad); }
.icon-btn.danger-on::after { content: ""; position: absolute; width: 2px; height: 22px; background: var(--bad); transform: rotate(-45deg); border-radius: 1px; }
.icon-btn.slashed::after { content: ""; position: absolute; width: 2px; height: 22px; background: currentColor; transform: rotate(-45deg); border-radius: 1px; }

.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch span { position: absolute; inset: 0; background: var(--bg5); border-radius: 11px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }

.range { width: 100%; accent-color: var(--acc); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--txtm); background: var(--bg1);
}
.badge {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1;
}
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--lineh); border-radius: 3px; color: var(--txtm); }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.muted { color: var(--txtm); }
.dim { color: var(--txtd); }

/* ---------- Avatares ---------- */
.av {
  position: relative; flex: none; width: var(--s, 40px); height: var(--s, 40px); border-radius: 50%;
  background: var(--bg4); display: grid; place-items: center; color: #fff; font-weight: 600;
  font-size: calc(var(--s, 40px) * .4); user-select: none;
}
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av .dragon { width: 62%; filter: brightness(0) invert(1); opacity: .95; }
.av .st {
  position: absolute; right: -2px; bottom: -2px; width: calc(var(--s, 40px) * .34); height: calc(var(--s, 40px) * .34);
  min-width: 10px; min-height: 10px; border-radius: 50%; border: 3px solid var(--st-bg, var(--bg1)); background: var(--txtd);
}
.av .st.online { background: var(--ok); }
.av .st.idle { background: var(--idle); }
.av .st.dnd { background: var(--dnd); }
.av .st.offline, .av .st.invisible { background: var(--bg1); box-shadow: inset 0 0 0 2px var(--txtd); }
.av.speaking { box-shadow: 0 0 0 2px var(--bg1), 0 0 0 4px var(--ok); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.status-dot.online { background: var(--ok); } .status-dot.idle { background: var(--idle); } .status-dot.dnd { background: var(--dnd); }
.status-dot.offline, .status-dot.invisible { box-shadow: inset 0 0 0 2px var(--txtd); }

/* ==========================================================================
   AUTH
   ========================================================================== */
#auth {
  position: fixed; inset: 0; overflow-y: auto; background: var(--bg2);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
}
.auth-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 80%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .dragon { width: 38px; }
.brand-name { font-family: var(--mono); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; line-height: 1.15; }
.brand-name small { display: block; font-size: 10px; letter-spacing: .16em; color: var(--txtd); }
.auth-grid { max-width: 1340px; margin: 0 auto; padding: 56px 32px 64px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 64px; align-items: center; min-height: calc(100vh - 76px); }
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--txtm); display: flex; align-items: center; gap: 14px; }
.eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--txtm); }
.hero-title { font-size: clamp(40px, 5.6vw, 76px); line-height: 1.02; font-weight: 300; letter-spacing: -.035em; margin: 22px 0 22px; }
.hero-title .hl { background: linear-gradient(transparent 12%, var(--acc-soft) 12%, var(--acc-soft) 92%, transparent 92%); padding-right: 8px; box-shadow: inset 0 -1px 0 transparent; }
:root[data-theme="dark"] .hero-title .hl { background: linear-gradient(transparent 12%, rgba(255,255,255,.08) 12%, rgba(255,255,255,.08) 92%, transparent 92%); }
.hero-sub { color: var(--txtm); max-width: 520px; font-size: 16px; line-height: 1.6; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.terminal { margin-top: 36px; background: #0a0a0c; color: #e8e8ea; border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-lg); box-shadow: var(--shadow); font-family: var(--mono); font-size: 12.5px; max-width: 520px; overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); color: #6b6b76; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2b2b31; }
.terminal-bar span { margin-left: 8px; }
.terminal-body { padding: 14px 16px 16px; min-height: 176px; line-height: 1.75; white-space: pre-wrap; }
.terminal-body .c { color: #6b6b76; }
.terminal-body .k { color: #22c55e; }
.terminal-body .cursor { display: inline-block; width: 8px; height: 14px; background: #e8e8ea; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.auth-card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 36px; box-shadow: var(--shadow); max-width: 440px; width: 100%; justify-self: end; }
.auth-card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.auth-card p.sub { margin: 0 0 26px; color: var(--txtm); }
.auth-card .field { margin-bottom: 18px; }
.auth-switch { margin-top: 18px; font-size: 14px; color: var(--txtm); }
.auth-switch button { color: var(--txt); text-decoration: underline; text-underline-offset: 3px; }
.auth-err { background: var(--bad-soft); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); padding: 10px 12px; border-radius: var(--r); font-size: 14px; margin-bottom: 18px; }
.auth-foot { text-align: center; padding: 24px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--txtd); text-transform: uppercase; }

/* ==========================================================================
   LAYOUT
   ========================================================================== */
#app { position: fixed; inset: 0; display: flex; }
#rail {
  width: var(--rail); flex: none; background: var(--bg0); display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 8px; overflow-y: auto; scrollbar-width: none; border-right: 1px solid var(--line);
}
#rail::-webkit-scrollbar { display: none; }
#sidebar { width: var(--side); flex: none; background: var(--bg1); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg2); position: relative; }
#nav-scrim { display: none; }

/* ---------- Rail ---------- */
.rail-item { position: relative; width: 48px; height: 48px; flex: none; }
.rail-btn {
  width: 48px; height: 48px; border-radius: 14px; background: var(--bg3); display: grid; place-items: center;
  overflow: hidden; transition: border-radius .18s var(--ease), background .15s, color .15s; color: var(--txt);
  font-weight: 600; font-size: 15px; border: 1px solid var(--line);
}
.rail-btn img { width: 100%; height: 100%; object-fit: cover; }
.rail-btn .dragon { width: 30px; }
.rail-item:hover .rail-btn, .rail-item.active .rail-btn { border-radius: 4px; }
.rail-item.active .rail-btn { border-color: var(--linex); }
.rail-home.active .rail-btn, .rail-home:hover .rail-btn { background: var(--acc); }
.rail-home.active .rail-btn .dragon, .rail-home:hover .rail-btn .dragon { filter: invert(1); }
:root[data-theme="light"] .rail-home.active .rail-btn .dragon, :root[data-theme="light"] .rail-home:hover .rail-btn .dragon { filter: invert(1); }
.rail-action .rail-btn { color: var(--ok); background: var(--bg2); font-size: 18px; }
.rail-action:hover .rail-btn { background: var(--ok); color: #fff; }
.rail-pill { position: absolute; left: -12px; top: 50%; width: 4px; height: 0; background: var(--txt); border-radius: 0 4px 4px 0; transform: translateY(-50%); transition: height .18s var(--ease); }
.rail-item.unread .rail-pill { height: 8px; }
.rail-item:hover .rail-pill { height: 20px; }
.rail-item.active .rail-pill { height: 40px; }
.rail-item .badge { position: absolute; right: -4px; bottom: -4px; border: 3px solid var(--bg0); height: 22px; min-width: 22px; border-radius: 11px; }
.rail-sep { width: 32px; height: 1px; background: var(--lineh); flex: none; margin: 2px 0; }
.rail-item.voice-live::after { content: "\f028"; font-family: "Font Awesome 7 Free", "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; font-size: 9px; border: 3px solid var(--bg0); }
.rail-item.dragging { opacity: .4; }
.rail-item.drop-before::before { content: ""; position: absolute; top: -6px; left: 0; right: 0; height: 2px; background: var(--ok); }

/* ---------- Sidebar ---------- */
#side-head {
  height: var(--head); flex: none; display: flex; align-items: center; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line);
  font-weight: 600; gap: 8px; min-width: 0;
}
.server-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 100%; text-align: left; }
.server-head:hover { color: var(--txt); }
.server-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-fake { width: 100%; height: 30px; border-radius: var(--r); background: var(--bg0); color: var(--txtd); font-size: 13px; text-align: left; padding: 0 10px; border: 1px solid var(--line); }
#side-body { flex: 1; padding: 8px 8px 16px; }
.side-link {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; border-radius: var(--r); color: var(--txtm);
  width: 100%; font-weight: 500; position: relative;
}
.side-link:hover { background: var(--hover); color: var(--txt); }
.side-link.active { background: var(--active); color: var(--txt); }
.side-link .fa-solid { width: 20px; text-align: center; font-size: 16px; }
.side-link .badge { margin-left: auto; }
.side-section { display: flex; align-items: center; justify-content: space-between; margin: 18px 8px 6px 10px; }
.side-section .label { margin: 0; font-size: 10.5px; }
.side-section button { color: var(--txtm); font-size: 13px; }
.side-section button:hover { color: var(--txt); }
.dm-tabs { justify-content: flex-start; gap: 6px; }
.dm-tabs > button[data-act] { margin-left: auto; }
.dm-tab { position: relative; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--txtm); padding: 2px 0; border-bottom: 1px solid transparent; }
.side-section .dm-tab { font-size: 10.5px; }
.dm-tab.active { color: var(--txt); border-bottom-color: var(--txt); }
.dm-tab-sep { color: var(--txtm); font-size: 10.5px; opacity: .6; }
.dm-tab-dot { position: absolute; top: 0; right: -6px; width: 5px; height: 5px; border-radius: 50%; background: var(--bad); }

.dm-item { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; border-radius: var(--r); color: var(--txtm); width: 100%; position: relative; }
.dm-item:hover { background: var(--hover); color: var(--txt); }
.dm-item.active { background: var(--active); color: var(--txt); }
.dm-item.unread { color: var(--txt); font-weight: 600; }
.dm-item .av { --s: 32px; --st-bg: var(--bg1); }
.dm-item:hover .av, .dm-item.active .av { --st-bg: var(--bg3); }
.dm-meta { min-width: 0; flex: 1; text-align: left; }
.dm-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-sub { font-size: 12px; color: var(--txtd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.dm-close { opacity: 0; color: var(--txtd); padding: 4px; }
.dm-item:hover .dm-close { opacity: 1; }
.dm-close:hover { color: var(--txt); }

.cat { display: flex; align-items: center; gap: 4px; padding: 16px 8px 4px 4px; color: var(--txtd); cursor: pointer; user-select: none; }
.cat:hover { color: var(--txt); }
.cat .label { margin: 0; font-size: 10.5px; color: inherit; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat .fa-chevron-down { font-size: 9px; width: 12px; transition: transform .15s; }
.cat.collapsed .fa-chevron-down { transform: rotate(-90deg); }
.cat-add { opacity: 0; font-size: 13px; padding: 2px 4px; color: var(--txtm); }
.cat:hover .cat-add { opacity: 1; }
.cat.drop-into { background: var(--acc-soft); outline: 1px dashed var(--lineh); }

.ch {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; margin: 1px 0; border-radius: var(--r);
  color: var(--txtd); cursor: pointer; position: relative; user-select: none;
}
.ch:hover { background: var(--hover); color: var(--txtm); }
.ch.active { background: var(--active); color: var(--txt); }
.ch.unread { color: var(--txt); font-weight: 600; }
.ch.unread::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px; background: var(--txt); border-radius: 0 4px 4px 0; }
.ch-icon { width: 20px; text-align: center; font-size: 15px; flex: none; opacity: .85; }
.ch-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-emoji { display: inline-block; text-align: center; font-style: normal; line-height: 1; }
.ch .ch-emoji { width: 20px; font-size: 15px; flex: none; }
.chan-intro .big-icon .ch-emoji { font-size: 34px; }
.ico-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; margin-top: 8px; }
.ico-grid button { height: 38px; border-radius: var(--r); background: var(--bg3); border: 1px solid var(--line); color: var(--txt); font-size: 15px; }
.ico-grid button:hover { background: var(--bg4); }
.ico-grid button.sel { border-color: var(--txt); background: var(--bg4); }
.ico-grid .ico-none { font-size: 11px; color: var(--txtm); }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 8px; }
.font-grid button { padding: 10px 8px; border-radius: var(--r); background: var(--bg3); border: 1px solid var(--line); color: var(--txt); text-align: center; overflow: hidden; }
.font-grid button b { display: block; font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-grid button small { display: block; margin-top: 4px; font-size: 11px; color: var(--txtm); font-family: var(--sans, inherit); }
.font-grid button.sel { border-color: var(--txt); background: var(--bg4); }
.ch-preview { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--bg1); border: 1px solid var(--line); color: var(--txt); max-width: 272px; }
.ch-preview .ch-icon, .ch-preview .ch-emoji { width: 20px; text-align: center; opacity: .85; flex: none; }
.ch-preview .ch-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-actions { display: none; gap: 2px; }
.ch:hover .ch-actions, .ch.active .ch-actions { display: flex; }
.ch-actions button { color: var(--txtm); font-size: 12px; padding: 4px; }
.ch-actions button:hover { color: var(--txt); }
.ch .badge { margin-left: auto; }
.ch.muted-ch { opacity: .5; }
.ch.drop-before::after { content: ""; position: absolute; top: -2px; left: 4px; right: 4px; height: 2px; background: var(--ok); }
.ch.dragging { opacity: .4; }
.ch-limit { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line); padding: 1px 4px; border-radius: 3px; color: var(--txtd); }

.vc-users { padding: 0 0 4px 30px; }
.vc-user { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: var(--r); color: var(--txtm); font-size: 14px; cursor: pointer; }
.vc-user:hover { background: var(--hover); color: var(--txt); }
.vc-user .av { --s: 22px; }
.vc-user .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-user .ic { display: flex; gap: 6px; font-size: 11px; color: var(--txtd); align-items: center; }
.vc-user .ic .red { color: var(--bad); }
.live-tag { background: var(--bad); color: #fff; font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: .1em; padding: 1px 5px; border-radius: 3px; }

/* ---------- Voice panel & user panel ---------- */
#voice-panel:empty { display: none; }
.voice-panel { border-top: 1px solid var(--line); padding: 10px 10px 8px; background: var(--bg0); }
.vp-row { display: flex; align-items: center; gap: 8px; }
.vp-status { flex: 1; min-width: 0; }
.vp-conn { color: var(--ok); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.vp-conn.warn { color: var(--idle); }
.vp-where { font-size: 12px; color: var(--txtm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.vp-where:hover { text-decoration: underline; }
.vp-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.vp-actions button { height: 32px; border-radius: var(--r); background: var(--bg3); border: 1px solid var(--line); color: var(--txt); font-size: 14px; }
.vp-actions button:hover { background: var(--bg4); }
.vp-actions button.on { background: var(--acc); color: var(--acc-ink); }

#user-panel { height: 56px; flex: none; background: var(--bg0); display: flex; align-items: center; padding: 0 8px; gap: 2px; border-top: 1px solid var(--line); }
.up-me { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 4px; border-radius: var(--r); text-align: left; }
.up-me:hover { background: var(--hover); }
.up-me .av { --s: 34px; --st-bg: var(--bg0); }
.up-names { min-width: 0; line-height: 1.2; }
.up-names b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-names small { display: block; font-size: 12px; color: var(--txtm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Main header ---------- */
.main-head {
  height: var(--head); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--line); min-width: 0; background: var(--bg2); z-index: 2;
}
.main-head .h-icon { color: var(--txtd); font-size: 18px; }
.main-head .h-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 40%; }
.main-head .h-topic { color: var(--txtm); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line); cursor: pointer; }
.main-head .h-spacer { flex: 1; }
.main-head .h-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.main-head .h-search { width: 180px; height: 28px; font-size: 13px; padding: 0 10px; background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r); outline: none; transition: width .2s; }
.main-head .h-search:focus { width: 260px; border-color: var(--lineh); }
.nav-toggle { display: none; }
.main-body { flex: 1; display: flex; min-height: 0; }
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.side-panel { width: var(--members); flex: none; background: var(--bg1); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }

/* ---------- Friends ---------- */
.tabs { display: flex; align-items: center; gap: 4px; margin-left: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 4px 10px; border-radius: var(--r); color: var(--txtm); font-weight: 500; white-space: nowrap; font-size: 14px; }
.tab:hover { background: var(--hover); color: var(--txt); }
.tab.active { background: var(--active); color: var(--txt); }
.tab.add { background: var(--ok); color: #fff; }
.tab.add.active { background: transparent; color: var(--ok); }
.tab .badge { margin-left: 4px; }
.friends { flex: 1; padding: 20px 28px; }
.friends-count { margin: 8px 0 12px; }
.friend-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-top: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
}
.friend-row:hover { background: var(--hover); border-top-color: transparent; }
.friend-row:hover + .friend-row { border-top-color: transparent; }
.friend-row .av { --s: 36px; --st-bg: var(--bg2); }
.friend-row:hover .av { --st-bg: var(--bg3); }
.friend-row .meta { flex: 1; min-width: 0; }
.friend-row .meta b { font-weight: 600; }
.friend-row .meta b small { font-weight: 400; color: var(--txtm); margin-left: 6px; font-size: 13px; opacity: 0; }
.friend-row:hover .meta b small { opacity: 1; }
.friend-row .meta div { font-size: 13px; color: var(--txtm); }
.friend-actions { display: flex; gap: 8px; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg1); color: var(--txtm); display: grid; place-items: center; border: 1px solid var(--line); }
.round-btn:hover { color: var(--txt); border-color: var(--lineh); }
.round-btn.ok:hover { color: var(--ok); }
.round-btn.bad:hover { color: var(--bad); }
.add-friend { border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 20px; }
.add-friend h3 { margin: 0 0 6px; font-size: 16px; text-transform: uppercase; font-family: var(--mono); letter-spacing: .12em; font-weight: 500; }
.add-friend-box { display: flex; align-items: center; gap: 8px; background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 6px 6px 14px; margin-top: 14px; }
.add-friend-box:focus-within { border-color: var(--linex); }
.add-friend-box input { flex: 1; border: 0; background: none; outline: none; font-size: 15px; padding: 8px 0; }
.add-friend-msg { margin-top: 8px; font-size: 14px; }
.add-friend-msg.ok { color: var(--ok); }
.add-friend-msg.err { color: var(--bad); }
.empty-state { display: grid; place-items: center; text-align: center; padding: 60px 20px; color: var(--txtm); gap: 16px; }
.empty-state .dragon { width: 140px; opacity: .22; }
.activity { padding: 16px; }
.activity h3 { margin: 4px 0 16px; font-size: 18px; }
.activity-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px; background: var(--bg2); }

/* ---------- Chat ---------- */
.messages { flex: 1; min-height: 0; padding: 0 0 12px; position: relative; }
.msgs-inner { display: flex; flex-direction: column; min-height: 100%; justify-content: flex-end; }
.chan-intro { padding: 32px 18px 12px; }
.chan-intro .big-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--bg4); display: grid; place-items: center; font-size: 30px; margin-bottom: 14px; }
.chan-intro h1 { margin: 0 0 6px; font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.chan-intro p { margin: 0; color: var(--txtm); }
.chan-intro .av { --s: 80px; margin-bottom: 14px; }
.chan-intro .intro-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.day-div { display: flex; align-items: center; gap: 10px; margin: 18px 16px 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--txtd); }
.day-div::before, .day-div::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.new-div { display: flex; align-items: center; margin: 8px 16px 4px; gap: 0; }
.new-div::before { content: ""; flex: 1; height: 1px; background: var(--bad); }
.new-div span { background: var(--bad); color: #fff; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .1em; padding: 1px 6px; border-radius: 0 3px 3px 0; text-transform: uppercase; }
.load-more { text-align: center; padding: 16px; color: var(--txtd); font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }

.msg { position: relative; padding: 3px 56px 3px 72px; min-height: 26px; }
.msg.head { margin-top: 14px; padding-top: 4px; }
.msg:hover { background: var(--hover); }
.msg.mentioned { background: var(--mention); }
.msg.mentioned::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--mention-bar); }
.msg.highlight { animation: flash 2s var(--ease); }
@keyframes flash { 0%, 30% { background: var(--acc-soft); box-shadow: inset 2px 0 0 var(--txt); } }
.msg .m-av { position: absolute; left: 16px; top: 6px; cursor: pointer; }
.msg .m-av .av { --s: 40px; }
.msg .m-time-side { position: absolute; left: 0; width: 64px; text-align: right; top: 6px; font-family: var(--mono); font-size: 10px; color: var(--txtd); opacity: 0; }
.msg:hover .m-time-side { opacity: 1; }
.m-head { display: flex; align-items: baseline; gap: 8px; line-height: 1.3; }
.m-name { font-weight: 600; cursor: pointer; }
.m-name:hover { text-decoration: underline; }
.m-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; background: var(--acc); color: var(--acc-ink); padding: 1px 5px; border-radius: 3px; text-transform: uppercase; align-self: center; }
.m-time { font-family: var(--mono); font-size: 11px; color: var(--txtd); }
.m-body { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; color: var(--txt); }
.m-body.jumbo { font-size: 44px; line-height: 1.2; }
.m-edited { font-size: 10.5px; color: var(--txtd); font-family: var(--mono); margin-left: 4px; }
.m-body.pending { opacity: .5; }
.m-body.failed { color: var(--bad); }
.m-reply { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--txtm); margin-bottom: 4px; position: relative; cursor: pointer; min-width: 0; }
.m-reply::before { content: ""; position: absolute; left: -38px; top: 50%; width: 30px; height: 12px; border-left: 2px solid var(--lineh); border-top: 2px solid var(--lineh); border-top-left-radius: 6px; }
.m-reply .av { --s: 16px; font-size: 8px; }
.m-reply b { font-weight: 600; color: var(--txt); flex: none; }
.m-reply span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-reply:hover span { color: var(--txt); }
.msg.system { display: flex; gap: 12px; align-items: flex-start; color: var(--txtm); padding-left: 32px; }
.msg.system .sys-ic { width: 28px; text-align: center; color: var(--txtd); flex: none; padding-top: 2px; }
.msg.system .sys-ic.join { color: var(--ok); }
.msg.system .sys-ic.leave { color: var(--bad); }
.msg.system .sys-ic.call { color: var(--ok); }
.msg.system .m-time { margin-left: 6px; }

.m-toolbar {
  position: absolute; right: 14px; top: -16px; display: none; background: var(--bg2); border: 1px solid var(--lineh);
  border-radius: var(--r); box-shadow: var(--shadow); z-index: 3;
}
.msg:hover .m-toolbar, .m-toolbar.open { display: flex; }
.m-toolbar button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--txtm); font-size: 14px; }
.m-toolbar button:hover { background: var(--hover); color: var(--txt); }
.m-toolbar button.bad:hover { color: var(--bad); }

.m-atts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; align-items: flex-start; }
.m-img { max-width: min(420px, 100%); max-height: 340px; border-radius: var(--r-lg); cursor: zoom-in; background: var(--bg3); border: 1px solid var(--line); object-fit: contain; }
.m-video { max-width: min(480px, 100%); max-height: 340px; border-radius: var(--r-lg); background: #000; }
.m-audio { width: min(420px, 100%); }
.m-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); background: var(--bg1); border-radius: var(--r-lg); width: min(420px, 100%); }
.m-file > i { font-size: 28px; color: var(--txtm); }
.m-file .fmeta { flex: 1; min-width: 0; }
.m-file .fmeta a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-file .fmeta small { color: var(--txtd); font-family: var(--mono); font-size: 11px; }
.m-embed { margin-top: 6px; border-left: 3px solid var(--lineh); background: var(--bg1); padding: 10px 12px; border-radius: 0 var(--r) var(--r) 0; max-width: 460px; }
.m-embed iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--r); margin-top: 6px; display: block; }
.m-embed .e-prov { font-size: 12px; color: var(--txtd); font-family: var(--mono); }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.react {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 8px;
  background: var(--bg3); border: 1px solid transparent; font-size: 14px; user-select: none;
}
.react:hover { border-color: var(--lineh); }
.react.me { background: var(--acc-soft); border-color: var(--linex); }
.react b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--txtm); }
.react.me b { color: var(--txt); }
.react.add { opacity: 0; color: var(--txtm); }
.msg:hover .react.add { opacity: 1; }

/* markdown */
.m-body code, .md code { font-family: var(--mono); font-size: .86em; background: var(--code); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; }
.m-body pre, .md pre { background: var(--code); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin: 6px 0 0; overflow-x: auto; max-width: 100%; white-space: pre; }
.m-body pre code, .md pre code { background: none; border: 0; padding: 0; font-size: 13px; }
.m-body blockquote { margin: 2px 0; padding-left: 12px; border-left: 3px solid var(--lineh); color: var(--txtm); }
.mention { background: color-mix(in srgb, var(--link) 18%, transparent); color: var(--txt); padding: 0 3px; border-radius: 3px; font-weight: 500; cursor: pointer; }
.mention:hover { background: color-mix(in srgb, var(--link) 35%, transparent); }
.spoiler { background: var(--txtd); color: transparent; border-radius: 3px; cursor: pointer; transition: all .15s; }
.spoiler.shown { background: var(--bg4); color: inherit; }

/* ---------- Composer ---------- */
.composer-wrap { padding: 0 16px 20px; flex: none; position: relative; }
.typing { height: 20px; font-size: 12.5px; color: var(--txtm); padding: 0 4px; display: flex; align-items: center; gap: 6px; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.typing b { color: var(--txt); font-weight: 600; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--txtm); animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.composer { background: var(--bg3); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s; }
.composer:focus-within { border-color: var(--lineh); }
.composer.drag { border-color: var(--ok); border-style: dashed; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 13px; color: var(--txtm); border-bottom: 1px solid var(--line); background: var(--bg1); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.composer-bar b { color: var(--txt); }
.composer-row { display: flex; align-items: flex-end; gap: 4px; padding: 6px 8px; }
.composer textarea {
  flex: 1; resize: none; background: none; border: 0; outline: none; padding: 7px 4px; max-height: 50vh; min-height: 36px;
  line-height: 1.4; font-size: 15px; overflow-y: auto; scrollbar-width: thin;
}
.composer textarea::placeholder { color: var(--txtd); }
.composer .icon-btn { height: 36px; width: 36px; font-size: 18px; }
.composer.disabled { opacity: .6; }
.pending-files { display: flex; gap: 10px; padding: 12px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.pfile { position: relative; width: 150px; flex: none; background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
.pfile .thumb { height: 90px; display: grid; place-items: center; background: var(--bg2); border-radius: 3px; overflow: hidden; color: var(--txtd); font-size: 32px; }
.pfile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pfile .pname { font-size: 12px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfile .prog { height: 2px; background: var(--line); margin-top: 6px; }
.pfile .prog i { display: block; height: 100%; background: var(--ok); width: 0; transition: width .2s; }
.pfile .prm { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 11px; }
.slowmode-tag { font-family: var(--mono); font-size: 11px; color: var(--txtd); padding: 0 6px; align-self: center; white-space: nowrap; }
.jump-bar { position: absolute; left: 16px; right: 16px; top: -34px; background: var(--bg1); border: 1px solid var(--lineh); border-radius: var(--r) var(--r) 0 0; display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font-size: 13px; color: var(--txtm); }
.jump-bar button { color: var(--txt); font-weight: 600; font-size: 13px; }

.autocomplete { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 16px); background: var(--bg2); border: 1px solid var(--lineh); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 8px; max-height: 320px; overflow-y: auto; z-index: 5; }
.autocomplete .label { padding: 4px 8px; }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r); cursor: pointer; }
.ac-item.sel, .ac-item:hover { background: var(--active); }
.ac-item .av { --s: 24px; }
.ac-item small { color: var(--txtm); margin-left: auto; }

/* ---------- Members list ---------- */
.members { flex: 1; padding: 8px 8px 24px; }
.m-group { margin: 16px 8px 4px; }
.mem { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; border-radius: var(--r); cursor: pointer; }
.mem:hover { background: var(--hover); }
.mem .av { --s: 32px; --st-bg: var(--bg1); }
.mem:hover .av { --st-bg: var(--bg3); }
.mem.off { opacity: .4; }
.mem.off:hover { opacity: 1; }
.mem .mm { min-width: 0; flex: 1; line-height: 1.2; }
.mem .mm b { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem .mm small { display: block; font-size: 12px; color: var(--txtm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crown { color: #eab308; font-size: 11px; }

.panel-head { height: var(--head); display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.panel-head b { font-weight: 600; }
.panel-list { flex: 1; padding: 8px; }
.result { border: 1px solid var(--line); background: var(--bg2); border-radius: var(--r); padding: 8px 10px; margin-bottom: 8px; cursor: pointer; position: relative; }
.result:hover { border-color: var(--lineh); }
.result .r-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.result .r-head .av { --s: 20px; font-size: 9px; }
.result .r-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow: hidden; }

/* ---------- Voice view ---------- */
.voice-view { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg0); position: relative; }
.voice-view.in-dm { flex: none; height: 46vh; min-height: 260px; border-bottom: 1px solid var(--line); }
.voice-view.in-dm.small { height: 170px; min-height: 0; }
.vv-stage { flex: 1; min-height: 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.vv-grid { flex: 1; min-height: 0; display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); align-content: center; }
.vv-focus { flex: 1; min-height: 0; display: flex; }
.vv-strip { display: flex; gap: 10px; height: 116px; flex: none; overflow-x: auto; justify-content: center; }
.vv-strip .tile { width: 190px; flex: none; aspect-ratio: auto; }
.tile {
  position: relative; background: var(--bg3); border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center;
  min-height: 0; min-width: 0; border: 1px solid var(--line); cursor: pointer; aspect-ratio: 16 / 9; max-height: 100%; width: 100%;
}
.vv-grid .tile { aspect-ratio: auto; height: 100%; }
.vv-focus .tile { aspect-ratio: auto; height: 100%; cursor: zoom-out; }
.tile.speaking { box-shadow: inset 0 0 0 2px var(--ok); border-color: var(--ok); }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #000; position: absolute; inset: 0; }
.tile.screen video, .vv-focus .tile video { object-fit: contain; }
.tile .av { --s: 84px; font-size: 32px; }
.tile-bg { position: absolute; inset: 0; opacity: .25; }
.tile-label { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .6); color: #fff; padding: 3px 8px; border-radius: var(--r); font-size: 13px; max-width: calc(100% - 16px); backdrop-filter: blur(6px); }
.tile-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-label .fa-microphone-slash, .tile-label .fa-volume-xmark { color: #f87171; }
.tile-tools { position: absolute; right: 8px; top: 8px; display: none; gap: 4px; }
.tile:hover .tile-tools { display: flex; }
.tile-tools button { width: 30px; height: 30px; border-radius: var(--r); background: rgba(0, 0, 0, .6); color: #fff; }
.tile-conn { position: absolute; top: 8px; left: 8px; font-family: var(--mono); font-size: 10px; background: rgba(0,0,0,.6); color: #fbbf24; padding: 2px 6px; border-radius: 3px; letter-spacing: .08em; text-transform: uppercase; }
.vv-controls { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 14px; flex: none; }
.vv-controls .ctl { width: 52px; height: 52px; border-radius: 50%; background: var(--bg3); color: var(--txt); font-size: 18px; border: 1px solid var(--line); display: grid; place-items: center; position: relative; transition: background .15s; }
.vv-controls .ctl:hover { background: var(--bg4); }
.vv-controls .ctl.on { background: var(--acc); color: var(--acc-ink); }
.vv-controls .ctl.red { background: var(--bad); color: #fff; border-color: var(--bad); }
.vv-controls .ctl.muted { color: var(--bad); }
.vv-empty { flex: 1; display: grid; place-items: center; text-align: center; gap: 12px; color: var(--txtm); }
.vv-empty .av-row { display: flex; justify-content: center; gap: -8px; }
.vv-empty h2 { margin: 6px 0; color: var(--txt); font-weight: 500; }
.vv-head { position: absolute; top: 12px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; z-index: 2; }
.vv-head > * { pointer-events: auto; }

/* ---------- Layer: modais, popouts, menus ---------- */
#layer > * { z-index: 50; }
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
.modal { background: var(--bg2); border: 1px solid var(--lineh); border-radius: var(--r-lg); width: min(460px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.modal.wide { width: min(640px, 100%); }
.modal-head { padding: 22px 24px 8px; position: relative; }
.modal-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.modal-head p { margin: 8px 0 0; color: var(--txtm); font-size: 14.5px; }
.modal-head .x { position: absolute; top: 14px; right: 14px; }
.modal-body { padding: 16px 24px; overflow-y: auto; }
.modal-body .field { margin-bottom: 18px; }
.modal-foot { padding: 14px 24px; background: var(--bg1); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal-foot .left { margin-right: auto; }
.center { text-align: center; }

.choice { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 10px; text-align: left; background: var(--bg1); }
.choice:hover { border-color: var(--linex); background: var(--hover); }
.choice > i:first-child { width: 42px; height: 42px; display: grid; place-items: center; background: var(--bg3); border-radius: var(--r); font-size: 18px; flex: none; }
.choice b { display: block; }
.choice small { color: var(--txtm); }
.choice .fa-chevron-right { margin-left: auto; color: var(--txtd); }
.radio-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; cursor: pointer; background: var(--bg1); }
.radio-card:hover { border-color: var(--lineh); }
.radio-card.sel { border-color: var(--linex); background: var(--active); }
.radio-card > i { font-size: 20px; width: 24px; text-align: center; color: var(--txtm); }
.radio-card b { display: block; }
.radio-card small { color: var(--txtm); }
.radio-card .dot { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--txtm); flex: none; }
.radio-card.sel .dot { border: 5px solid var(--txt); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.toggle-row b { display: block; font-weight: 500; }
.toggle-row small { color: var(--txtm); font-size: 13px; }
.upload-circle { width: 84px; height: 84px; border-radius: 50%; border: 2px dashed var(--lineh); display: grid; place-items: center; color: var(--txtm); position: relative; overflow: hidden; flex: none; background: var(--bg1); cursor: pointer; }
.upload-circle.square { border-radius: 14px; }
.upload-circle img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.upload-circle:hover { border-color: var(--linex); color: var(--txt); }
.upload-circle .ov { position: absolute; inset: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 10px; font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: 0; transition: opacity .15s; }
.upload-circle:hover .ov { opacity: 1; }
.invite-box { display: flex; gap: 8px; background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 4px 4px 12px; align-items: center; }
.invite-box input { flex: 1; border: 0; background: none; outline: none; font-family: var(--mono); font-size: 13px; }
.pick-list { max-height: 260px; overflow-y: auto; margin: 0 -8px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r); cursor: pointer; }
.pick-row:hover { background: var(--hover); }
.pick-row .av { --s: 32px; }
.pick-row .grow { flex: 1; min-width: 0; }
.pick-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--acc); }

.call-modal { width: 260px; text-align: center; padding: 28px 20px 22px; }
.call-modal .av { --s: 88px; margin: 0 auto 14px; animation: ring 1.4s var(--ease) infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 100% { box-shadow: 0 0 0 22px rgba(34, 197, 94, 0); } }
.call-modal h3 { margin: 0; font-size: 20px; }
.call-modal p { margin: 4px 0 20px; color: var(--txtm); }
.call-modal .row { display: flex; justify-content: center; gap: 22px; }
.call-modal .row button { width: 52px; height: 52px; border-radius: 50%; color: #fff; font-size: 20px; }

/* Settings (tela cheia) */
.settings { position: fixed; inset: 0; display: flex; background: var(--bg2); animation: pop .2s var(--ease); }
.settings-nav { flex: 1 0 218px; background: var(--bg1); display: flex; justify-content: flex-end; border-right: 1px solid var(--line); overflow-y: auto; }
.settings-nav nav { width: 232px; padding: 60px 8px 24px 20px; }
.settings-nav .label { padding: 0 10px; margin-top: 18px; font-size: 10.5px; }
.settings-nav .label:first-child { margin-top: 0; }
.s-link { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border-radius: var(--r); color: var(--txtm); margin-bottom: 2px; font-weight: 500; }
.s-link:hover { background: var(--hover); color: var(--txt); }
.s-link.active { background: var(--active); color: var(--txt); }
.s-link.bad { color: var(--bad); }
.settings-content { flex: 1 1 800px; overflow-y: auto; display: flex; }
.settings-content .inner { width: 100%; max-width: 740px; padding: 60px 40px 80px; }
.settings-close { padding: 60px 20px 0 0; flex: none; }
.settings-close button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--txtm); color: var(--txtm); display: grid; place-items: center; }
.settings-close button:hover { border-color: var(--txt); color: var(--txt); }
.settings-close small { display: block; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--txtd); margin-top: 6px; }
.settings h1 { font-size: 22px; font-weight: 600; margin: 0 0 22px; letter-spacing: -.01em; }
.settings h3 { font-family: var(--mono); text-transform: uppercase; font-size: 12px; letter-spacing: .14em; color: var(--txtm); margin: 30px 0 12px; font-weight: 500; }
.s-card { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 16px; }
.s-row { display: flex; gap: 16px; align-items: center; }
.s-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.save-bar { position: sticky; bottom: 20px; margin-top: 24px; background: var(--bg0); border: 1px solid var(--lineh); border-radius: var(--r-lg); padding: 10px 10px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: var(--shadow); animation: pop .2s var(--ease); }
.profile-preview { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg1); }
.meter { height: 8px; background: var(--bg4); border-radius: 4px; position: relative; overflow: hidden; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); width: 0; transition: width .05s linear; }
.meter .thr { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--txt); }
.cam-preview { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--r-lg); object-fit: cover; transform: scaleX(-1); }

.roles-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
.role-list { border-right: 1px solid var(--line); padding-right: 12px; }
.role-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r); cursor: pointer; color: var(--txtm); font-weight: 500; }
.role-item:hover { background: var(--hover); color: var(--txt); }
.role-item.active { background: var(--active); color: var(--txt); }
.role-item .rdot { width: 12px; height: 12px; border-radius: 50%; background: var(--txtd); flex: none; }
.role-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-item .mv { opacity: 0; font-size: 11px; color: var(--txtd); }
.role-item:hover .mv { opacity: 1; }
.role-item .mv:hover { color: var(--txt); }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.perm-row b { display: block; font-weight: 500; }
.perm-row small { display: block; color: var(--txtm); font-size: 13px; margin-top: 2px; }
.tri { display: flex; border: 1px solid var(--lineh); border-radius: var(--r); overflow: hidden; flex: none; }
.tri button { width: 34px; height: 28px; color: var(--txtd); display: grid; place-items: center; font-size: 13px; }
.tri button + button { border-left: 1px solid var(--lineh); }
.tri button.sel.deny { background: var(--bad); color: #fff; }
.tri button.sel.neutral { background: var(--bg5); color: var(--txt); }
.tri button.sel.allow { background: var(--ok); color: #fff; }
.colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.color-sw { width: 30px; height: 30px; border-radius: var(--r); border: 2px solid transparent; }
.color-sw.sel { border-color: var(--txt); box-shadow: inset 0 0 0 2px var(--bg2); }
.color-sw.none { background: var(--bg4); display: grid; place-items: center; color: var(--txtm); font-size: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--txtd); font-weight: 500; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.table tr:hover td { background: var(--hover); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .av { --s: 32px; }
.role-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.role-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px 2px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); cursor: default; }
.role-pill .rdot { width: 10px; height: 10px; border-radius: 50%; background: var(--txtd); position: relative; }
.role-pill button.rdot:hover::after { content: "×"; position: absolute; inset: -2px; display: grid; place-items: center; font-size: 11px; color: #fff; }
.role-pill.add { cursor: pointer; color: var(--txtm); }

/* Popout de perfil */
.popout { position: fixed; background: var(--bg1); border: 1px solid var(--lineh); border-radius: var(--r-lg); box-shadow: var(--shadow); width: 320px; overflow: hidden; animation: pop .14s var(--ease); max-height: calc(100vh - 20px); overflow-y: auto; }
.pp-banner { height: 72px; background: var(--bg4); position: relative; }
.pp-av { position: absolute; left: 16px; top: 28px; }
.pp-av .av { --s: 84px; --st-bg: var(--bg1); border: 6px solid var(--bg1); box-sizing: content-box; }
.pp-av .av .st { right: 2px; bottom: 2px; border-width: 4px; }
.pp-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 12px 0; min-height: 44px; }
.pp-body { padding: 18px 16px 16px; }
.pp-body h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.pp-body .uname { color: var(--txtm); font-size: 14px; }
.pp-custom { margin-top: 8px; font-size: 14px; }
.pp-sec { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.pp-sec .label { margin-bottom: 6px; font-size: 10.5px; }
.pp-sec p { margin: 0; font-size: 14px; white-space: pre-wrap; }
.pp-note { margin-top: 14px; }
.status-menu { padding: 6px; }

.menu { position: fixed; min-width: 200px; max-width: 280px; background: var(--bg1); border: 1px solid var(--lineh); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 6px; animation: pop .1s var(--ease); max-height: calc(100vh - 16px); overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: var(--r); font-size: 14px; color: var(--txtm); text-align: left; }
.menu-item:hover, .menu-item.hl { background: var(--acc); color: var(--acc-ink); }
.menu-item.bad { color: var(--bad); }
.menu-item.bad:hover { background: var(--bad); color: #fff; }
.menu-item .mi-right { margin-left: auto; font-size: 12px; opacity: .8; }
.menu-item i.fa-solid, .menu-item i.fa-regular { width: 16px; text-align: center; }
.menu-item.check { justify-content: space-between; }
.menu-item.check .box { width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 3px; display: grid; place-items: center; font-size: 10px; flex: none; }
.menu-item.check.on .box { background: var(--txt); border-color: var(--txt); color: var(--bg1); }
.menu-item.check:hover .box { border-color: var(--acc-ink); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--txtd); padding: 6px 10px 4px; }
.menu-range { padding: 6px 10px 10px; }
.menu-range .label { margin-bottom: 4px; font-size: 10px; }

.emoji-picker { position: fixed; width: 352px; height: 400px; background: var(--bg1); border: 1px solid var(--lineh); border-radius: var(--r-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: pop .12s var(--ease); overflow: hidden; }
.ep-head { padding: 10px; border-bottom: 1px solid var(--line); }
.ep-head input { width: 100%; background: var(--bg0); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 10px; outline: none; }
.ep-body { flex: 1; padding: 6px 10px 10px; }
.ep-cat { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--txtd); margin: 10px 2px 6px; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ep-grid button { font-size: 22px; height: 38px; border-radius: var(--r); }
.ep-grid button:hover { background: var(--active); }
.ep-tabs { display: flex; border-top: 1px solid var(--line); }
.ep-tabs button { flex: 1; height: 36px; color: var(--txtd); font-size: 16px; }
.ep-tabs button:hover { color: var(--txt); background: var(--hover); }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); display: grid; place-items: center; padding: 40px; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; border-radius: var(--r); }
.lightbox a { color: #ddd; font-size: 13px; display: block; margin-top: 10px; }

#tip { position: fixed; z-index: 90; background: var(--bg0); color: var(--txt); border: 1px solid var(--lineh); padding: 6px 10px; border-radius: var(--r); font-size: 13.5px; font-weight: 500; pointer-events: none; opacity: 0; transition: opacity .1s; max-width: 280px; box-shadow: var(--shadow); white-space: nowrap; }
#tip.show { opacity: 1; }

#toasts { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 95; align-items: center; pointer-events: none; }
.toast { background: var(--acc); color: var(--acc-ink); padding: 10px 16px; border-radius: var(--r); box-shadow: var(--shadow); font-size: 14px; font-weight: 500; animation: pop .2s var(--ease); display: flex; align-items: center; gap: 10px; max-width: 90vw; }
.toast.err { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

.invite-card { border: 1px solid var(--line); background: var(--bg1); border-radius: var(--r-lg); padding: 14px; display: flex; gap: 12px; align-items: center; margin-top: 6px; max-width: 420px; }
.invite-card .ic { width: 50px; height: 50px; border-radius: 12px; background: var(--bg4); display: grid; place-items: center; overflow: hidden; font-weight: 600; flex: none; }
.invite-card .ic img { width: 100%; height: 100%; object-fit: cover; }
.invite-card .grow { flex: 1; min-width: 0; }
.invite-card .label { margin-bottom: 2px; font-size: 10px; }
.invite-card small { color: var(--txtm); font-size: 12.5px; display: flex; gap: 10px; align-items: center; }

/* ---------- Compacto ---------- */
.compact .msg { padding-left: 16px; padding-top: 1px; padding-bottom: 1px; }
.compact .msg.head { margin-top: 6px; }
.compact .msg .m-av { display: none; }
.compact .msg .m-time-side { display: none; }
.compact .msg.system { padding-left: 16px; }
.compact .m-reply::before { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .side-panel.members-panel { display: none; }
  .show-members .side-panel.members-panel { display: flex; position: absolute; right: 0; top: var(--head); bottom: 0; z-index: 6; box-shadow: var(--shadow); }
  .main-head .h-search { width: 130px; }
}
@media (max-width: 820px) {
  #rail, #sidebar { position: fixed; top: 0; bottom: 0; z-index: 20; transition: transform .22s var(--ease); }
  #rail { left: 0; }
  #sidebar { left: var(--rail); width: min(var(--side), calc(100vw - var(--rail) - 40px)); }
  body:not(.nav-open) #rail, body:not(.nav-open) #sidebar { transform: translateX(calc(-1 * (var(--rail) + var(--side)))); }
  body.nav-open #nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 15; }
  .nav-toggle { display: grid; }
  .auth-grid { grid-template-columns: 1fr; gap: 36px; padding: 32px 16px; }
  .auth-card { justify-self: stretch; max-width: none; padding: 24px; }
  .auth-side { justify-self: stretch; }
  .auth-top { padding: 14px 16px; }
  .hero-left .terminal { display: none; }
  .msg { padding-left: 64px; padding-right: 12px; }
  .msg .m-av { left: 12px; }
  .main-head .h-topic, .main-head .h-search { display: none; }
  .settings { flex-direction: column; }
  .settings-nav { flex: none; justify-content: flex-start; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-nav nav { width: 100%; padding: 16px; }
  .settings-content .inner { padding: 24px 16px 60px; }
  .settings-close { position: fixed; top: 10px; right: 10px; padding: 0; z-index: 2; }
  .settings-close small { display: none; }
  .roles-layout { grid-template-columns: 1fr; }
  .role-list { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .s-grid2 { grid-template-columns: 1fr; }
  .friends { padding: 16px; }
  .vv-controls .ctl { width: 46px; height: 46px; }
  .composer-wrap { padding: 0 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Indicador de fala (wrappers) ---------- */
[data-speak].speaking > .av { box-shadow: 0 0 0 2px var(--bg1), 0 0 0 4px var(--ok); }
.vc-user [data-speak] { display: inline-flex; border-radius: 50%; }
.call-area[hidden] { display: none; }
.m-edit { margin: 4px 0; }
.m-edit .hint a { color: var(--link); }
fieldset:disabled { opacity: .55; }
.rail-item > button[data-dm] { display: block; width: 48px; height: 48px; }

/* ---------- Conta compartilhada com o App Tasu ---------- */
.auth-side { justify-self: end; display: flex; align-items: flex-start; gap: 16px; }
.auth-side .auth-card { justify-self: auto; width: 440px; flex: 0 1 440px; }
.apps-card { width: 172px; flex: none; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 11px; box-shadow: var(--shadow); animation: apps-float 5s ease-in-out infinite; }
.apps-card:hover { animation-play-state: paused; }
@keyframes apps-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .apps-card { animation: none; } }
.apps-card .label { margin: 0 0 6px; font-size: 9.5px; }
.app-item { display: flex; align-items: center; gap: 8px; padding: 6px; margin: 0 -5px; border-radius: var(--r); color: var(--txt); text-decoration: none; }
.app-item:hover { background: var(--hover); }
.app-item b { display: block; font-size: 13px; font-weight: 600; }
.app-item small { display: block; font-size: 11px; color: var(--txtm); }
.app-ico { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--bg4); color: var(--txt); font-size: 12px; }
.app-go { margin-left: auto; font-size: 10px; color: var(--txtm); }
.apps-sync { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--lineh); font-size: 10.5px; line-height: 1.4; color: var(--txtm); }
.apps-sync i { margin-right: 4px; font-size: 9.5px; }
@media (max-width: 1200px) {
  .auth-side { flex-direction: column; align-items: stretch; }
  .apps-card { width: auto; }
  .auth-side .auth-card { width: 100%; flex: none; }
}
.auth-link { display: flex; align-items: center; gap: 8px; margin: -12px 0 20px; padding: 9px 12px; border: 1px dashed var(--lineh); border-radius: var(--r); font-size: 13px; color: var(--txtm); }
.auth-link b { color: var(--txt); font-weight: 600; }
.auth-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); padding: 10px 12px; border-radius: var(--r); font-size: 14px; margin-bottom: 18px; }
.auth-forgot { margin: -8px 0 16px; text-align: right; }
.guest-tag { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--bg4); color: var(--txtm); vertical-align: middle; }
.guest-note { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--lineh); border-radius: var(--r); font-size: 13.5px; color: var(--txtm); }
.guest-note i { margin-right: 6px; }
.guest-note b { color: var(--txt); }
.server-head .badge { margin-left: auto; margin-right: 8px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--txtm); font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-alt { display: grid; gap: 8px; }
.auth-alt .btn { height: 42px; gap: 10px; }
.auth-alt .g-logo { width: 18px; height: 18px; flex: none; }
.auth-forgot button { font-size: 13px; color: var(--txtm); text-decoration: underline; text-underline-offset: 3px; }
.auth-forgot button:hover { color: var(--txt); }

/* ---------- Seletores de qualidade (tela / voz) ---------- */
.opt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.opt-grid.two { grid-template-columns: 1fr 1fr; }
.opt-grid.three { grid-template-columns: repeat(3, 1fr); }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg1); text-align: left; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--lineh); }
.opt.sel { border-color: var(--txt); background: var(--active); box-shadow: inset 0 0 0 1px var(--txt); }
.opt b { font-weight: 600; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.opt small { color: var(--txtm); font-size: 12px; line-height: 1.3; }
.q-summary { margin-top: 18px; padding: 10px 12px; border: 1px dashed var(--lineh); border-radius: var(--r); font-size: 13px; color: var(--txtm); }
.q-summary b { color: var(--txt); }
@media (max-width: 600px) { .opt-grid { grid-template-columns: 1fr 1fr; } .opt-grid.two, .opt-grid.three { grid-template-columns: 1fr; } }
.search-hit { cursor: pointer; }
.search-none { padding: 8px 0; font-size: 14px; }
