:root {
  --accent: #7b6cf6;
  --accent-2: color-mix(in srgb, var(--accent) 80%, black);
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --bg-rail: #121316;
  --bg-side: #1a1b1f;
  --bg-main: #212226;
  --bg-elev: #2a2c31;
  --bg-input: #2c2e33;
  --bg-deep: #16171a;
  --bg-hover: rgba(255, 255, 255, 0.045);
  --bg-active: rgba(255, 255, 255, 0.085);
  --text: #e6e7ea;
  --text-2: #b7bac1;
  --muted: #8a8d95;
  --border: rgba(255, 255, 255, 0.06);
  --green: #35a95c;
  --red: #e5484d;
  --yellow: #f0a92e;
  --gray: #80848e;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  color-scheme: dark;
}
[data-theme='midnight'] {
  --bg-rail: #000;
  --bg-side: #0b0b0d;
  --bg-main: #111113;
  --bg-elev: #1a1a1d;
  --bg-input: #1c1c20;
  --bg-deep: #050506;
}
[data-theme='light'] {
  --bg-rail: #e3e5e8;
  --bg-side: #f0f1f3;
  --bg-main: #fff;
  --bg-elev: #fff;
  --bg-input: #e8e9ec;
  --bg-deep: #e3e5e8;
  --bg-hover: rgba(0, 0, 0, 0.045);
  --bg-active: rgba(0, 0, 0, 0.08);
  --text: #1f2125;
  --text-2: #3d4047;
  --muted: #6b6f78;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-rail);
  color: var(--text);
  font: 15px/1.375 'Segoe UI', 'Segoe UI Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
input,
textarea,
select,
button {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
}
.big {
  font-size: 17px;
}
.center {
  text-align: center;
}
.mono {
  font-family: Consolas, 'Cascadia Mono', monospace;
}
.upper {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.grow {
  flex: 1;
}
.ic {
  display: block;
  flex-shrink: 0;
}
.ic.red,
.red .ic {
  color: var(--red);
}
.icw {
  display: inline-flex;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 127, 0.28);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(127, 127, 127, 0.45);
}
::-webkit-scrollbar-track {
  background: transparent;
}
.side-scroll::-webkit-scrollbar,
#members::-webkit-scrollbar,
#rail::-webkit-scrollbar {
  width: 4px;
}

/* ---------- título ---------- */
#titlebar {
  height: 30px;
  -webkit-app-region: drag;
  background: var(--bg-rail);
  display: flex;
  align-items: center;
  padding-left: 14px;
}
.tb-brand {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- layout ---------- */
#app {
  display: flex;
  height: calc(100vh - 30px);
}
#rail {
  width: 72px;
  flex-shrink: 0;
  background: var(--bg-rail);
  overflow-y: auto;
  padding: 6px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
#side {
  width: 244px;
  flex-shrink: 0;
  background: var(--bg-side);
  display: flex;
  flex-direction: column;
  border-top-left-radius: 10px;
  overflow: hidden;
}
#side-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#main {
  flex: 1;
  min-width: 0;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
#members {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-side);
  overflow-y: auto;
  padding: 8px 8px 20px;
}

/* ---------- trilho ---------- */
.rail-item {
  position: relative;
  width: 72px;
  display: flex;
  justify-content: center;
  cursor: pointer;
}
.rail-pill {
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: var(--text);
  transform: translateY(-50%);
  transition: height 0.15s;
}
.rail-item:hover .rail-pill {
  height: 20px;
}
.rail-item.unread .rail-pill {
  height: 8px;
}
.rail-item.active .rail-pill {
  height: 40px;
}
.rail-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 600;
  font-size: 15px;
  transition: border-radius 0.15s, background 0.15s;
  color: var(--text);
}
.rail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rail-item:hover .rail-icon,
.rail-item.active .rail-icon {
  border-radius: 16px;
}
.rail-item.active .rail-icon:not(.add),
.rail-item:hover .rail-icon.home {
  background: var(--accent);
  color: #fff;
}
.rail-icon.home {
  color: var(--text);
}
.rail-item.active .rail-icon.home {
  background: var(--accent);
  color: #fff;
}
.rail-icon.add {
  color: var(--green);
}
.rail-item:hover .rail-icon.add {
  background: var(--green);
  color: #fff;
}
.rail-icon.net {
  color: var(--text-2);
}
.rail-icon.net.bad {
  color: var(--red);
}
.rail-item.offline .rail-icon {
  filter: grayscale(1) brightness(0.65);
}
.rail-item .avatar {
  border-radius: 50%;
}
.rail-sep {
  width: 32px;
  height: 2px;
  border-radius: 1px;
  background: var(--border);
  flex-shrink: 0;
}
.rail-voice {
  position: absolute;
  right: 10px;
  bottom: -2px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--bg-rail);
}
.badge {
  position: absolute;
  right: 10px;
  bottom: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--bg-rail);
  box-sizing: content-box;
}
.badge.inline {
  position: static;
  border: 0;
  margin-left: auto;
}

/* ---------- avatares ---------- */
.avatar {
  position: relative;
  flex-shrink: 0;
  border-radius: 50%;
}
.avatar > img,
.avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}
.avatar.speaking > img,
.avatar.speaking > .avatar-fallback {
  box-shadow: 0 0 0 2px var(--bg-side), 0 0 0 4px var(--green);
}
.status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 3px solid var(--bg-side);
  box-sizing: content-box;
}
.st-online {
  background: var(--green);
}
.st-idle {
  background: var(--yellow);
}
.st-dnd {
  background: var(--red);
}
.st-offline {
  background: var(--gray);
}

/* ---------- lateral ---------- */
.side-head {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.side-head.server {
  padding: 0 14px;
  cursor: pointer;
  gap: 6px;
}
.side-head.server b {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-head.server:hover {
  background: var(--bg-hover);
}
.search-fake {
  width: 100%;
  height: 30px;
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--muted);
  font-size: 13.5px;
  text-align: left;
  padding: 0 8px;
}
.side-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 16px;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin: 1px 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}
.side-item:hover {
  background: var(--bg-hover);
  color: var(--text-2);
}
.side-item.active {
  background: var(--bg-active);
  color: var(--text);
}
.side-item.unread {
  color: var(--text);
  font-weight: 600;
}
.side-item.unread::before {
  content: '';
  position: absolute;
  left: -8px;
  width: 4px;
  height: 8px;
  border-radius: 0 4px 4px 0;
  background: var(--text);
}
.side-item.big {
  padding: 9px 10px;
  font-weight: 500;
}
.side-item.dm {
  padding: 5px 8px;
}
.side-item.dim .avatar {
  opacity: 0.55;
}
.dm-text {
  min-width: 0;
  flex: 1;
}
.dm-text .name,
.up-text .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-text .sub,
.up-text .sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-item .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.side-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.side-label:hover {
  color: var(--text-2);
}
.side-empty {
  padding: 16px 10px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.ch-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-item.ch {
  padding: 6px 8px;
  gap: 6px;
}
.side-item .hover-only {
  opacity: 0;
}
.side-item:hover .hover-only {
  opacity: 1;
}
.side-item.voice.connected {
  color: var(--green);
}
.voice-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1px 0 1px 30px;
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.voice-user:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.vu-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vu-icons {
  display: flex;
  gap: 2px;
}
.live {
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.host-off {
  display: flex;
  gap: 10px;
  margin: 4px 0 8px;
  padding: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--yellow) 12%, transparent);
  color: var(--text-2);
  font-size: 13px;
}
.host-off .icw {
  color: var(--yellow);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.icon-btn.on {
  color: var(--text);
}
.icon-btn.red {
  color: var(--red);
}
.icon-btn.tiny {
  width: 20px;
  height: 20px;
}

/* ---------- painel de voz / usuário ---------- */
#voice-panel {
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
  padding: 8px 10px 10px;
}
.vp-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vp-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.vp-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
}
.vp-status.good {
  color: var(--green);
}
.vp-status.warn {
  color: var(--yellow);
}
.vp-status .ping {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
}
.vp-where {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vp-info:hover .vp-where {
  text-decoration: underline;
}
.vp-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.vp-btn {
  flex: 1;
  height: 34px;
  border-radius: 6px;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}
.vp-btn:hover {
  background: var(--bg-active);
  color: var(--text);
}
.vp-btn.on {
  background: var(--accent);
  color: #fff;
}
#user-panel {
  height: 56px;
  flex-shrink: 0;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 2px;
}
.up-me {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
}
.up-me:hover {
  background: var(--bg-hover);
}
.up-me .status-dot {
  border-color: var(--bg-deep);
}
.up-text {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- cabeçalho principal ---------- */
.main-head {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  min-width: 0;
}
.head-title b {
  color: var(--text);
  white-space: nowrap;
}
.head-title.clickable {
  cursor: pointer;
}
.head-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 4px;
}
.head-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 8px;
}
.tab {
  padding: 3px 10px;
  border-radius: 6px;
  color: var(--text-2);
  font-weight: 500;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.tab:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.tab.active {
  background: var(--bg-active);
  color: var(--text);
}
.tab.add {
  background: var(--green);
  color: #fff;
}
.tab.add.active {
  background: transparent;
  color: var(--green);
}
.main-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.main-body.col {
  flex-direction: column;
}

/* ---------- amigos ---------- */
.friends-body {
  flex: 1;
  display: flex;
  min-height: 0;
}
.friends-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px 28px;
}
.input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  outline: none;
  user-select: text;
}
.input:focus {
  border-color: var(--accent);
}
.input.big {
  padding: 12px 14px;
  font-size: 15px;
}
select.input {
  cursor: pointer;
}
textarea.input {
  resize: vertical;
}
.input.search {
  margin-bottom: 14px;
}
.list-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0 10px;
  letter-spacing: 0.02em;
}
.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-top: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.friend-row:hover {
  background: var(--bg-hover);
  border-top-color: transparent;
}
.friend-row:hover + .friend-row {
  border-top-color: transparent;
}
.f-text {
  flex: 1;
  min-width: 0;
}
.uname {
  opacity: 0;
  font-size: 13px;
}
.friend-row:hover .uname {
  opacity: 1;
}
.f-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.round {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-side);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.round:hover {
  color: var(--text);
}
.round.green:hover {
  color: var(--green);
}
.round.red:hover {
  color: var(--red);
}
.empty-friends {
  text-align: center;
  padding: 50px 20px;
}
.big-ic {
  color: var(--muted);
  opacity: 0.6;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.active-now {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}
.active-now h3 {
  margin: 4px 0 16px;
  font-size: 20px;
}
.an-card {
  background: var(--bg-side);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
}
.an-card:hover {
  background: var(--bg-elev);
}
.an-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}
.an-empty {
  text-align: center;
  padding: 20px 10px;
}
.add-friend h2 {
  font-size: 16px;
  margin: 4px 0 6px;
}
.add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--bg-deep);
  border-radius: 8px;
  padding: 6px;
  margin-top: 12px;
}
.add-row .input {
  background: transparent;
}
.add-row .btn {
  white-space: nowrap;
}
.add-status {
  min-height: 22px;
  font-size: 13.5px;
  margin-top: 8px;
  color: var(--muted);
}
.add-status.ok {
  color: var(--green);
}
.add-status.err {
  color: var(--red);
}
.my-ips {
  margin-top: 26px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.my-ips h3 {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.ip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-side);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.ip-row.vpn {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.ip-row b {
  font-size: 16px;
  user-select: text;
}
.tip {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 13.5px;
}

/* ---------- botões ---------- */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.12s, filter 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-2);
}
.btn.secondary {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover {
  background: var(--bg-active);
}
.btn.danger {
  background: var(--red);
  color: #fff;
}
.btn.danger:hover {
  filter: brightness(0.9);
}
.btn.green {
  background: var(--green);
  color: #fff;
}
.btn.green:hover {
  filter: brightness(0.92);
}
.btn.link {
  color: var(--accent);
  padding: 6px 4px;
  font-weight: 500;
}
.btn.link:hover {
  text-decoration: underline;
}
.btn.block {
  width: 100%;
  padding: 11px;
}
.btn.small {
  padding: 5px 12px;
  font-size: 13px;
}
.btn.big {
  padding: 12px 26px;
  font-size: 16px;
}

/* ---------- chat ---------- */
.chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.chat.drop::after {
  content: 'Solte para enviar';
  position: absolute;
  inset: 10px;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-main) 85%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  pointer-events: none;
}
.msgs {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.msgs-inner {
  padding: 16px 0 10px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  justify-content: flex-end;
}
.load-more {
  text-align: center;
  color: var(--muted);
  padding: 10px;
  font-size: 13px;
}
.chat-intro {
  padding: 16px 16px 8px;
  user-select: text;
}
.chat-intro h1 {
  margin: 8px 0 2px;
  font-size: 30px;
}
.intro-hash {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
}
.day-sep {
  display: flex;
  align-items: center;
  margin: 18px 16px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.day-sep::before,
.day-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.day-sep span {
  padding: 0 8px;
}
.msg {
  display: flex;
  gap: 16px;
  padding: 3px 48px 3px 16px;
  margin-top: 14px;
  position: relative;
  user-select: text;
}
.msg.cont {
  margin-top: 0;
  padding-top: 1px;
  padding-bottom: 1px;
}
body.compact .msg {
  margin-top: 4px;
}
.msg:hover {
  background: rgba(0, 0, 0, 0.07);
}
[data-theme='light'] .msg:hover {
  background: rgba(0, 0, 0, 0.03);
}
.msg.pending {
  opacity: 0.6;
}
.msg.mention {
  background: color-mix(in srgb, var(--yellow) 9%, transparent);
  box-shadow: inset 2px 0 0 var(--yellow);
}
.msg.flash {
  background: var(--accent-soft);
}
.msg.system {
  align-items: center;
  font-size: 14px;
  margin-top: 8px;
}
.sys-icon {
  width: 40px;
  display: flex;
  justify-content: center;
  color: var(--green);
}
.msg-gutter {
  width: 40px;
  flex-shrink: 0;
  cursor: pointer;
}
.ts-hover {
  display: none;
  font-size: 10.5px;
  color: var(--muted);
  text-align: right;
  width: 100%;
  padding-top: 4px;
}
.msg.cont:hover .ts-hover {
  display: block;
}
.msg-body {
  flex: 1;
  min-width: 0;
}
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.author {
  font-weight: 600;
  cursor: pointer;
}
.author:hover {
  text-decoration: underline;
}
.ts {
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
}
.pending-tag {
  font-size: 11px;
  color: var(--yellow);
}
.msg-content {
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.msg-content.jumbo {
  font-size: 44px;
  line-height: 1.2;
}
.edited {
  font-size: 11px;
  color: var(--muted);
}
.msg-content code {
  background: var(--bg-deep);
  padding: 1px 4px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 0.88em;
}
.codeblock {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 4px 0;
  font-family: Consolas, monospace;
  font-size: 13.5px;
  white-space: pre-wrap;
  max-width: 900px;
}
.quote {
  display: inline-block;
  border-left: 4px solid var(--muted);
  padding-left: 10px;
}
.spoiler {
  background: var(--bg-deep);
  color: transparent;
  border-radius: 4px;
  cursor: pointer;
}
.spoiler.shown {
  color: inherit;
  background: var(--bg-active);
}
a.link,
.link {
  color: #4aa3f0;
  text-decoration: none;
  cursor: pointer;
}
a.link:hover {
  text-decoration: underline;
}
.reply-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.reply-ref span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-ref b {
  color: var(--text-2);
}
.reply-ref:hover span {
  color: var(--text);
}
.msg-actions {
  position: absolute;
  right: 16px;
  top: -14px;
  display: none;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.msg:hover .msg-actions {
  display: flex;
}
.msg-actions button {
  width: 32px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}
.msg-actions button:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.msg-actions button.danger:hover {
  color: var(--red);
}
.att-img {
  display: block;
  max-width: min(400px, 100%);
  max-height: 320px;
  border-radius: 8px;
  margin-top: 6px;
  cursor: zoom-in;
  object-fit: contain;
  background: var(--bg-deep);
}
.att-file {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-side);
  border: 1px solid var(--border);
  color: var(--accent);
}
.af-text {
  flex: 1;
  min-width: 0;
}
.af-name {
  color: #4aa3f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.invite-card {
  margin-top: 6px;
  max-width: 420px;
  background: var(--bg-side);
  border-radius: 8px;
  padding: 14px;
  border: 1px solid var(--border);
}
.inv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.inv-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
}
.inv-icon img {
  width: 100%;
  height: 100%;
}
.inv-name {
  flex: 1;
  font-weight: 700;
  font-size: 16px;
}
.edit-wrap {
  margin: 4px 0;
}
.edit-box {
  width: 100%;
  background: var(--bg-input);
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  resize: none;
}
.composer-wrap {
  padding: 0 16px;
  flex-shrink: 0;
}
.composer {
  background: var(--bg-input);
  border-radius: 10px;
}
.comp-row {
  display: flex;
  align-items: flex-start;
  padding: 0 6px;
}
.comp-input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  resize: none;
  padding: 11px 6px;
  max-height: 300px;
  user-select: text;
  line-height: 1.375;
}
.comp-btn {
  width: 40px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}
.comp-btn:hover {
  color: var(--text);
}
.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg-elev);
  border-radius: 10px 10px 0 0;
}
.att-bar {
  display: flex;
  gap: 12px;
  padding: 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.att-prev {
  position: relative;
  width: 160px;
  flex-shrink: 0;
  background: var(--bg-side);
  border-radius: 8px;
  padding: 8px;
}
.att-prev img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  border-radius: 4px;
}
.att-prev-file {
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent);
  text-align: center;
  word-break: break-all;
}
.att-prev-name {
  font-size: 12px;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-x {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.typing {
  height: 24px;
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 4px;
}
.typing b {
  font-weight: 700;
}
.dots {
  display: inline-flex;
  gap: 3px;
  margin-right: 4px;
}
.dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-2);
  animation: blink 1.2s infinite;
}
.dots i:nth-child(2) {
  animation-delay: 0.2s;
}
.dots i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(9, 34px);
  gap: 2px;
  padding: 4px;
  max-height: 280px;
  overflow-y: auto;
}
.emoji-grid button {
  font-size: 22px;
  height: 34px;
  border-radius: 6px;
}
.emoji-grid button:hover {
  background: var(--bg-hover);
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 6px;
}
.lb-actions {
  display: flex;
  gap: 10px;
}
.empty-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
}

/* ---------- membros ---------- */
.m-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 8px 6px;
}
.member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.member:hover {
  background: var(--bg-hover);
}
.member.dim {
  opacity: 0.4;
}
.member.dim:hover {
  opacity: 1;
}
.m-text {
  min-width: 0;
  flex: 1;
}
.m-text .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.m-text .sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crown {
  color: #f0b232;
  display: inline-flex;
}

/* ---------- chamadas ---------- */
.voice-body {
  background: #0c0d0f;
}
[data-theme='light'] .voice-body {
  background: #1a1b1e;
  color: #eee;
}
.voice-lobby {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ddd;
}
.voice-lobby h1 {
  margin: 0;
}
.lobby-avatars {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
}
.call-area {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #0c0d0f;
  color: #eee;
}
.call-area.full {
  flex: 1;
  min-height: 0;
}
.call-area.dm {
  height: 46%;
  min-height: 260px;
  max-height: 70vh;
  flex-shrink: 0;
  resize: vertical;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.call-area:fullscreen {
  height: 100%;
  max-height: none;
}
.call-timer {
  position: absolute;
  top: 10px;
  left: 14px;
  font-size: 12px;
  color: #aaa;
  z-index: 3;
  font-variant-numeric: tabular-nums;
}
.tiles {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
  padding: 34px 16px 8px;
  align-content: center;
}
.tiles.focused {
  display: flex;
  flex-direction: column;
}
.focus-main {
  flex: 1;
  min-height: 0;
  display: flex;
}
.focus-strip {
  display: flex;
  gap: 8px;
  height: 110px;
  flex-shrink: 0;
  justify-content: center;
}
.focus-strip .tile {
  width: 180px;
  flex-shrink: 0;
  aspect-ratio: auto;
}
.focus-strip .tile .avatar {
  width: 48px !important;
  height: 48px !important;
}
.tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--tile-bg, #333) 55%, #111);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  aspect-ratio: 16/9;
  max-height: 100%;
  max-width: 100%;
  justify-self: center;
  width: 100%;
  outline: 2px solid transparent;
  transition: outline-color 0.1s;
}
.tile.big {
  flex: 1;
  aspect-ratio: auto;
  height: 100%;
}
.tile.speaking {
  outline-color: var(--green);
  outline-offset: -2px;
}
.tile-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile-center.col {
  flex-direction: column;
  gap: 10px;
  text-align: center;
  padding: 10px;
}
.tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.tile-name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 16px);
  white-space: nowrap;
  overflow: hidden;
}
.tile-live {
  position: absolute;
  top: 8px;
  right: 8px;
}
.tile-ring {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: #ddd;
  animation: blink 1.4s infinite;
}
.tile.ringing .avatar {
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  }
  100% {
    box-shadow: 0 0 0 22px rgba(255, 255, 255, 0);
  }
}
.stream-tile {
  background: #000;
}
.stream-tile.preview,
.stream-tile.waiting {
  background: #1c1d21;
}
.stream-who {
  font-weight: 600;
}
.stream-stats {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  color: #ccc;
  opacity: 0;
  transition: opacity 0.15s;
  font-variant-numeric: tabular-nums;
}
.stream-stats.warn {
  color: var(--yellow);
}
.tile:hover .stream-stats {
  opacity: 1;
}
.stream-ctrls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.tile:hover .stream-ctrls,
.tile:fullscreen .stream-ctrls {
  opacity: 1;
}
.tile:fullscreen .stream-ctrls {
  opacity: 0;
}
.tile:fullscreen:hover .stream-ctrls {
  opacity: 1;
}
.sc-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}
.sc-btn.red {
  color: var(--red);
}
.sc-vol {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  padding: 0 8px;
  height: 34px;
}
.sc-vol input {
  width: 90px;
}
.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.call-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px 0 16px;
  flex-shrink: 0;
}
.cc-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #26272b;
  color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.cc-btn:hover {
  background: #33353a;
}
.cc-btn.red {
  background: #3a2326;
  color: var(--red);
}
.cc-btn.on {
  background: var(--accent);
  color: #fff;
}
.cc-btn.hang {
  background: var(--red);
  width: 64px;
  border-radius: 26px;
  color: #fff;
}
.cc-btn.hang:hover {
  filter: brightness(0.9);
}
.cc-btn.ghost {
  background: transparent;
}
.cc-sep {
  width: 12px;
}

/* ---------- menus / popouts ---------- */
.ctxmenu {
  position: fixed;
  z-index: 400;
  min-width: 200px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  box-shadow: var(--shadow);
  animation: pop 0.08s ease-out;
}
[data-theme='light'] .ctxmenu {
  background: #fff;
}
@keyframes pop {
  from {
    transform: scale(0.97);
    opacity: 0;
  }
}
.ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 8px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}
.ctx-item:hover {
  background: var(--accent);
  color: #fff;
}
.ctx-item.danger {
  color: var(--red);
}
.ctx-item.danger:hover {
  background: var(--red);
  color: #fff;
}
.ctx-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.ctx-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.ctx-slider {
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ctxmenu.popout-wrap {
  padding: 0;
  overflow: hidden;
  min-width: 0;
}
.popout,
.profile-preview {
  width: 320px;
  background: var(--bg-side);
  border-radius: 8px;
  overflow: hidden;
  user-select: text;
}
.po-banner {
  height: 70px;
}
.po-av {
  margin: -44px 0 0 16px;
  width: fit-content;
  border: 6px solid var(--bg-side);
  border-radius: 50%;
}
.po-av .status-dot {
  border-color: var(--bg-side);
}
.po-body {
  padding: 8px 16px 16px;
}
.po-name {
  font-size: 20px;
  font-weight: 700;
}
.po-status {
  margin-top: 6px;
  font-size: 14px;
}
.po-sep {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}
.po-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 8px 0 4px;
  color: var(--text-2);
}
.po-bio {
  font-size: 14px;
}
.po-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.po-actions .btn {
  flex: 1;
}

/* ---------- modais ---------- */
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade 0.12s;
}
.modal-back.out {
  opacity: 0;
  transition: opacity 0.15s;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  width: 460px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  border-radius: 10px;
  box-shadow: var(--shadow);
  animation: pop 0.12s ease-out;
}
.modal.wide {
  width: 760px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 4px 20px;
}
.modal-head h2 {
  margin: 0;
  font-size: 20px;
}
.modal-body {
  padding: 12px 20px 16px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-side);
  border-radius: 0 0 10px 10px;
}
.modal-foot.inline {
  background: none;
  padding: 16px 0 0;
  justify-content: space-between;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}
.field > span,
.field-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.field .val {
  color: var(--accent);
  text-transform: none;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 10px 0;
  cursor: pointer;
  color: var(--text-2);
}
.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.form-error {
  color: var(--red);
  font-size: 13.5px;
  min-height: 18px;
  margin-bottom: 8px;
}
.radio-card,
.radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 6px 0;
  border-radius: 8px;
  background: var(--bg-side);
  cursor: pointer;
}
.radio-card input,
.radio-row input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
input[type='range'] {
  accent-color: var(--accent);
  width: 100%;
}
.choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
  background: var(--bg-side);
}
.choice > div {
  flex: 1;
}
.choice:hover {
  background: var(--bg-elev);
}
.icon-upload {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px dashed var(--muted);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.icon-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.srv-set {
  display: flex;
  gap: 16px;
  align-items: center;
}
.code-box {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.inv-friends {
  max-height: 240px;
  overflow-y: auto;
}
.inv-friends .friend-row {
  cursor: default;
}

/* ---------- toasts ---------- */
#toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--bg-deep);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 14px;
  border-left: 4px solid var(--accent);
  max-width: 560px;
  animation: pop 0.15s ease-out;
  transition: opacity 0.35s, transform 0.35s;
}
.toast-error {
  border-left-color: var(--red);
}
.toast-warn {
  border-left-color: var(--yellow);
}
.toast-success {
  border-left-color: var(--green);
}
.toast.out {
  opacity: 0;
  transform: translateY(10px);
}

/* ---------- login ---------- */
#auth {
  position: fixed;
  inset: 30px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.auth-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(1200px 600px at 20% 10%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 60%), radial-gradient(900px 600px at 90% 90%, color-mix(in srgb, var(--accent) 30%, #0a6) 0%, transparent 55%), var(--bg-rail);
}
.auth-card {
  position: relative;
  width: 480px;
  max-width: calc(100vw - 40px);
  background: var(--bg-main);
  border-radius: 12px;
  padding: 30px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-card .field,
.auth-card .check {
  text-align: left;
}
.auth-card h1 {
  margin: 8px 0 4px;
  font-size: 24px;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.acc-list {
  margin: 18px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-side);
  text-align: left;
}
.acc-item > div {
  flex: 1;
}
/* a foto da conta não estica junto com o nome */
.acc-item > .avatar,
.acc-item > .av-frame {
  flex: none;
}
.acc-item:hover {
  background: var(--bg-elev);
}
.login-who {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 14px 0 6px;
}
.login-who h1 {
  margin-bottom: 0;
}

/* ---------- busca rápida ---------- */
.modal.qs {
  width: 560px;
}
.qs .modal-body {
  padding: 18px;
}
.qs-list {
  margin-top: 10px;
  max-height: 360px;
  overflow-y: auto;
}
.qs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.qs-item span:nth-child(2) {
  flex: 1;
}
.qs-item.sel,
.qs-item:hover {
  background: var(--bg-active);
}
.qs-dot {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--bg-elev);
}

/* ---------- chamada recebida ---------- */
.call-modal {
  width: 300px;
  background: var(--bg-deep);
}
.incoming {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 6px;
  text-align: center;
}
.incoming h2 {
  margin: 16px 0 2px;
}
.ring-avatar .avatar {
  animation: pulse 1.3s infinite;
}
.incoming-btns {
  display: flex;
  gap: 40px;
  margin-top: 26px;
}
.round-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.round-btn.red {
  background: var(--red);
}
.round-btn.green {
  background: var(--green);
}
.round-btn:hover {
  filter: brightness(1.1);
}

/* ---------- configurações ---------- */
.settings {
  position: fixed;
  inset: 30px 0 0;
  z-index: 150;
  display: flex;
  background: var(--bg-main);
  animation: fade 0.15s;
}
.set-side {
  flex: 1 0 220px;
  background: var(--bg-side);
  display: flex;
  justify-content: flex-end;
  overflow-y: auto;
}
.set-nav {
  width: 230px;
  padding: 50px 8px 30px 20px;
}
.set-nav-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 10px 6px;
}
.set-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin: 2px 0;
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 500;
}
.set-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.set-nav-item.active {
  background: var(--bg-active);
  color: var(--text);
}
.set-nav-item.danger {
  color: var(--red);
}
.set-nav-sep {
  height: 1px;
  background: var(--border);
  margin: 10px;
}
.set-version {
  font-size: 11.5px;
  color: var(--muted);
  padding: 6px 10px;
}
.set-main {
  flex: 1 1 800px;
  position: relative;
  overflow: hidden;
  display: flex;
}
.set-content {
  flex: 1;
  max-width: 760px;
  padding: 50px 40px 80px;
  overflow-y: auto;
}
.set-content h2 {
  margin: 0 0 20px;
  font-size: 22px;
}
.set-close {
  position: absolute;
  top: 46px;
  right: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.set-close .ic {
  width: 36px;
  height: 36px;
  padding: 6px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}
.set-close:hover {
  color: var(--text);
}
.set-section {
  padding: 4px 0 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.set-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 6px 0 12px;
  letter-spacing: 0.02em;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
}
.set-row + .set-row {
  border-top: 1px solid var(--border);
}
.set-title {
  font-weight: 600;
}
.set-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0;
}
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--gray);
  transition: background 0.15s;
}
.switch .slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.switch input:checked + .slider {
  background: var(--green);
}
.switch input:checked + .slider::before {
  transform: translateX(18px);
}
.acc-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 26px;
  margin-bottom: 18px;
}
.profile-preview {
  border: 1px solid var(--border);
  margin-top: 8px;
}
.av-edit {
  display: flex;
  gap: 10px;
  align-items: center;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
  user-select: text;
}
.test-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}
.sens {
  position: relative;
  margin: 12px 0 4px;
}
.meter {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: var(--bg-deep);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0;
  background: var(--yellow);
  transition: width 0.05s linear;
}
.meter-fill.open {
  background: var(--green);
}
.meter-th {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
}
.th-slider {
  margin-top: 6px;
}
.th-slider:disabled {
  opacity: 0.4;
}
.ptt-box {
  margin: 6px 0 12px;
}
.keycap {
  min-width: 140px;
}
.keycap.capturing {
  border-color: var(--red);
  color: var(--red);
}
.key-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.key-actions .input {
  width: 110px;
}
.keys-help {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  align-items: center;
  font-size: 14px;
}
kbd {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 5px;
  padding: 1px 7px;
  font-family: inherit;
  font-size: 12.5px;
  margin: 0 2px;
}
.stream-opts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stream-opts .field {
  margin: 6px 0;
}
.sq-pop {
  width: 520px;
  padding: 8px 10px;
}
.sq-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.picker .modal-body {
  padding-top: 4px;
}
.src-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.src-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 2px;
}
.src {
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  background: var(--bg-side);
  border: 2px solid transparent;
}
.src:hover {
  background: var(--bg-elev);
}
.src.sel {
  border-color: var(--accent);
}
.src img:not(.src-icon),
.src-ph {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: #000;
  border-radius: 4px;
  display: block;
}
.src-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
}
.src-name span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.src-icon {
  width: 16px;
  height: 16px;
}
.picker-opts {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.theme-row,
.accent-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.tc-prev {
  width: 110px;
  height: 66px;
  border-radius: 8px;
  border: 2px solid var(--border);
}
.theme-card.active .tc-prev {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.t-dark .tc-prev {
  background: linear-gradient(90deg, #121316 18%, #1a1b1f 18% 45%, #212226 45%);
}
.t-midnight .tc-prev {
  background: linear-gradient(90deg, #000 18%, #0b0b0d 18% 45%, #111113 45%);
}
.t-light .tc-prev {
  background: linear-gradient(90deg, #e3e5e8 18%, #f0f1f3 18% 45%, #fff 45%);
}
.accent {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
}
.accent.active {
  border-color: var(--text);
}
.accent-row input[type='color'] {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
}
.net-status {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
}
.net-status.ok {
  color: var(--green);
}
.net-status.bad {
  color: var(--red);
}
.howto {
  padding-left: 20px;
  color: var(--text-2);
  line-height: 1.6;
}
.howto li {
  margin-bottom: 6px;
}

/* ---------- câmera / transferências (v1.1) ---------- */
.tile.has-cam video {
  object-fit: cover;
  background: #000;
}
video.mirror {
  transform: scaleX(-1);
}
.tile.has-cam:fullscreen video {
  object-fit: contain;
}
.cam-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: start;
}
.cam-prev {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 8px;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 12px;
}
.cam-prev video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cam-info {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #ddd;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
}
.xfer {
  margin-top: 6px;
}
.xfer-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-deep);
  overflow: hidden;
}
.xfer-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}
.xfer-info {
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* ---------- conexão pela internet (v1.2) ---------- */
.rail-icon.net.online {
  color: var(--green);
}
.my-code {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.my-code h3 {
  font-size: 13px;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--text-2);
}
.code-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.code-text {
  flex: 1;
  min-width: 0;
  background: var(--bg-deep);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13.5px;
  user-select: all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diag {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-side);
  border: 1px solid var(--border);
}
.diag-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 14px;
}
.diag-row + .diag-row {
  border-top: 1px solid var(--border);
}
.diag-note {
  font-size: 12.5px;
  color: var(--muted);
  padding: 2px 0 6px;
}
.diag .ok {
  color: var(--green);
}
.diag .warn {
  color: var(--yellow);
}
.diag .bad {
  color: var(--red);
}
.diag .btn {
  margin-top: 8px;
}

/* ---------- banners, eventos e painel do criador (v1.3) ---------- */
#center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#center #main {
  min-height: 0;
}
#banners:empty {
  display: none;
}
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 16px;
  color: #fff;
  font-size: 14px;
  background: var(--accent);
}
.banner > span {
  flex: 1;
  min-width: 0;
}
.banner.upd {
  background: var(--green);
}
.banner-btn {
  background: rgba(255, 255, 255, 0.92);
  color: #111;
}
.banner-btn:hover {
  background: #fff;
}
.banner-x {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.85;
}
.banner-x:hover {
  background: rgba(0, 0, 0, 0.15);
  opacity: 1;
}
.live-events:empty {
  display: none;
}
.live-events {
  margin-bottom: 18px;
}
.le-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.le-card {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: color-mix(in srgb, var(--ev) 14%, var(--bg-side));
  border: 1px solid color-mix(in srgb, var(--ev) 45%, transparent);
}
.le-card.live {
  box-shadow: 0 0 0 1px var(--ev), 0 0 18px color-mix(in srgb, var(--ev) 35%, transparent);
}
.le-top {
  display: flex;
  gap: 10px;
  align-items: center;
}
.le-emoji {
  font-size: 26px;
  line-height: 1;
}
.le-now {
  color: var(--green);
  font-weight: 700;
}
.le-desc {
  margin-top: 6px;
  color: var(--text-2);
}
.notice-badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}
.notice-body p {
  white-space: pre-wrap;
  line-height: 1.5;
}
.about p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.set-nav-item.creator {
  color: #f0b232;
}
.cr-events {
  margin-bottom: 12px;
}
.cr-ev {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-side);
  margin-bottom: 6px;
}
.cr-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  border: 1px dashed var(--border);
}
.cr-row {
  display: flex;
  gap: 8px;
}
.cr-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}
