/* =====================================================================
   ECO — estilos
   ===================================================================== */
:root {
  --bg-rail: #1e1f22;
  --bg-side: #2b2d31;
  --bg-main: #313338;
  --bg-panel: #232428;
  --bg-input: #383a40;
  --bg-hover: rgba(78, 80, 88, .3);
  --bg-active: rgba(78, 80, 88, .6);
  --bg-float: #111214;
  --line: #3f4147;
  --text: #dbdee1;
  --text-strong: #f2f3f5;
  --muted: #949ba4;
  --faint: #6d6f78;
  --accent: #17a398;
  --accent-hover: #128a80;
  --accent-soft: rgba(23, 163, 152, .18);
  --green: #23a55a;
  --red: #f23f43;
  --red-hover: #da373c;
  --live: #ed4245;
  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-main);
  color: var(--text);
  font: 15px/1.375 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
a { color: #00a8fc; text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .875em; background: var(--bg-panel); padding: .1em .3em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
svg { flex-shrink: 0; }

/* ---------- Scrollbars ---------- */
.channel-list, .messages, .members, .home, .modal-body { scrollbar-width: thin; scrollbar-color: #1a1b1e transparent; }
.messages::-webkit-scrollbar { width: 14px; }
.messages::-webkit-scrollbar-thumb { background: #1a1b1e; border: 4px solid var(--bg-main); border-radius: 8px; }
.channel-list::-webkit-scrollbar, .members::-webkit-scrollbar { width: 8px; }
.channel-list::-webkit-scrollbar-thumb, .members::-webkit-scrollbar-thumb { background: #1a1b1e; border-radius: 4px; }

/* ---------- Boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg-rail); z-index: 50; }
.boot-logo { width: 72px; height: 72px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.88); opacity: .7; } }

/* ---------- Login / setup ---------- */
.center-screen {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; overflow: auto;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(23,163,152,.35), transparent 60%),
    radial-gradient(900px 600px at 90% 90%, rgba(88,60,180,.35), transparent 60%),
    var(--bg-rail);
}
.card {
  width: 100%; max-width: 440px; background: var(--bg-main); border-radius: 12px;
  padding: 32px; box-shadow: 0 8px 40px rgba(0,0,0,.4); text-align: center;
}
.card h1 { color: var(--text-strong); font-size: 24px; margin: 8px 0 4px; }
.card-logo { width: 56px; height: 56px; }
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; text-align: left; }
.form label, .field-label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted);
}
.form input, .input {
  background: var(--bg-rail); border: 0; border-radius: 4px; padding: 10px 12px; font-size: 16px;
  text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); outline: none; width: 100%;
}
.form input:focus, .input:focus { box-shadow: 0 0 0 2px var(--accent); }
.form .link.small { align-self: flex-start; margin-top: -6px; }
.link { color: #00a8fc; }
.link:hover { text-decoration: underline; }
.auth-msg { margin-top: 16px; padding: 10px 12px; border-radius: 6px; font-size: 14px; text-align: left; }
.auth-msg.error { background: rgba(242,63,67,.15); color: #ffb3b5; }
.auth-msg.ok { background: var(--accent-soft); color: #9ff0e7; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: 4px; font-weight: 600; font-size: 14px;
  transition: background .15s, opacity .15s; white-space: nowrap;
}
.btn.block { width: 100%; min-height: 44px; font-size: 16px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: var(--red-hover); }
.btn.ghost { color: var(--text); }
.btn.ghost:hover { text-decoration: underline; }
.btn.secondary { background: #4e5058; color: #fff; }
.btn.secondary:hover { background: #6d6f78; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 4px; color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: var(--bg-hover); }
.icon-btn.on { color: var(--text-strong); }

/* ---------- Grade principal ---------- */
.app { display: grid; grid-template-columns: 72px 240px 1fr; height: 100vh; height: 100dvh; }

/* Barra de servidores */
.rail {
  background: var(--bg-rail); display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 12px 0; overflow-y: auto; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-sep { width: 32px; height: 2px; background: #35363c; border-radius: 1px; flex-shrink: 0; }
.rail-item { position: relative; width: 72px; display: flex; justify-content: center; flex-shrink: 0; }
.rail-pill {
  position: absolute; left: 0; top: 50%; width: 4px; height: 0; margin-top: 0;
  background: #fff; border-radius: 0 4px 4px 0; transition: height .15s, margin .15s;
}
.rail-item.unread .rail-pill { height: 8px; margin-top: -4px; }
.rail-item:hover .rail-pill { height: 20px; margin-top: -10px; }
.rail-item.active .rail-pill { height: 40px; margin-top: -20px; }
.rail-btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-main); color: var(--text); font-weight: 600; font-size: 15px;
  transition: border-radius .15s, background .15s, color .15s; overflow: hidden;
}
.rail-btn img { width: 48px; height: 48px; }
.rail-item:hover .rail-btn, .rail-item.active .rail-btn { border-radius: 16px; background: var(--accent); color: #fff; }
.rail-item.rail-home .rail-btn { background: var(--bg-main); }
.rail-item.rail-home.active .rail-btn, .rail-item.rail-home:hover .rail-btn { background: var(--accent); }
.rail-btn.action { color: var(--green); }
.rail-item:hover .rail-btn.action { background: var(--green); color: #fff; }
.rail-badge {
  position: absolute; bottom: -2px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--live); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg-rail);
}

/* Tooltip simples */
[data-tip] { position: relative; }
.tip {
  position: fixed; z-index: 90; pointer-events: none; background: var(--bg-float); color: var(--text-strong);
  padding: 6px 10px; border-radius: 6px; font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

/* Barra de canais */
.sidebar { background: var(--bg-side); display: flex; flex-direction: column; min-width: 0; }
.sidebar-header {
  height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; font-weight: 600; color: var(--text-strong); box-shadow: 0 1px 0 rgba(0,0,0,.25);
  position: relative; z-index: 2;
}
.sidebar-header.clickable { cursor: pointer; }
.sidebar-header.clickable:hover { background: var(--bg-hover); }
.sidebar-header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-list { flex: 1; overflow-y: auto; padding: 16px 8px; }
.cat {
  display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted);
}
.cat .icon-btn { width: 20px; height: 20px; }
.ch {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 1px 0; border-radius: 4px;
  color: var(--muted); cursor: pointer; position: relative;
}
.ch:hover { background: var(--bg-hover); color: var(--text); }
.ch.active { background: var(--bg-active); color: var(--text-strong); }
.ch.unread { color: var(--text-strong); font-weight: 600; }
.ch.unread::before {
  content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px;
  background: #fff; border-radius: 0 4px 4px 0;
}
.ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .ch-tools { display: none; }
.ch:hover .ch-tools, .ch.active .ch-tools { display: flex; }
.ch-tools .icon-btn { width: 20px; height: 20px; }
.live-pill {
  background: var(--live); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .03em;
  padding: 1px 5px; border-radius: 4px; text-transform: uppercase;
}
.ch-live-users { margin: 2px 0 6px 28px; display: flex; flex-direction: column; gap: 2px; }
.ch-live-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.ch-live-user:hover { background: var(--bg-hover); color: var(--text); }
.empty-note { color: var(--muted); font-size: 13px; padding: 8px; }

/* Painel do usuário */
.user-panel {
  height: 52px; flex-shrink: 0; background: var(--bg-panel); display: flex; align-items: center;
  gap: 8px; padding: 0 8px;
}
.user-panel .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 4px; cursor: pointer; }
.user-panel .who:hover { background: var(--bg-hover); }
.user-panel .names { min-width: 0; line-height: 1.2; }
.user-panel .names b { display: block; font-size: 14px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel .names small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Avatar */
.avatar {
  position: relative; display: inline-grid; place-items: center; border-radius: 50%; color: #fff;
  font-weight: 600; flex-shrink: 0; user-select: none;
}
.avatar .dot {
  position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--faint); box-shadow: 0 0 0 3px var(--bg-side);
}
.avatar .dot.on { background: var(--green); }
.user-panel .avatar .dot { box-shadow: 0 0 0 3px var(--bg-panel); }

/* ---------- Área principal ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-main); }
.chat-header {
  height: 48px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,.25); position: relative; z-index: 2; min-width: 0;
}
.chat-header .title { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-strong); min-width: 0; }
.chat-header .title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header .title svg { color: var(--faint); }
.chat-header .spacer { flex: 1; }
.chat-header .menu-btn { display: none; }
.header-live {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 6px;
  background: rgba(237,66,69,.12); font-size: 13px; min-width: 0;
}
.header-live span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-live .btn { min-height: 26px; padding: 0 10px; font-size: 13px; }
.share-btn.on { color: var(--live); }

.main-body { flex: 1; display: flex; min-height: 0; min-width: 0; }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* Palco (compartilhamento de tela) */
.stage {
  flex-shrink: 0; height: min(58%, 560px); background: #000; position: relative;
  display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line);
}
.stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: linear-gradient(transparent, rgba(0,0,0,.75)); opacity: 0; transition: opacity .2s;
}
.stage:hover .stage-bar, .stage.no-video .stage-bar { opacity: 1; }
.stage-bar .who { flex: 1; color: #fff; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.stage-bar .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-bar .icon-btn { color: #fff; background: rgba(0,0,0,.45); width: 36px; height: 36px; border-radius: 50%; }
.stage-bar .icon-btn:hover { background: rgba(255,255,255,.2); }
.stage-status { position: absolute; color: var(--muted); font-size: 14px; text-align: center; padding: 16px; }
.stage-status b { color: var(--text-strong); }
.stage-status { line-height: 1.6; max-width: 560px; }
.stage-bar .chip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 13px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.stage-bar button.chip:hover { background: rgba(255,255,255,.2); }
.stage-bar .chip.warn { background: rgba(240,178,50,.9); color: #1e1f22; }
.stage-bar .vol { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.45); border-radius: 18px; padding-right: 12px; }
.stage-bar .vol .icon-btn { background: none; }
.stage-bar .vol input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100px; height: 4px; border-radius: 2px; cursor: pointer;
  background: linear-gradient(to right, #fff var(--p, 100%), rgba(255,255,255,.3) var(--p, 100%));
}
.stage-bar .vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.stage-bar .vol input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
@media (hover: none) { .stage-bar { opacity: 1; } }
.q-badge {
  flex-shrink: 0; min-width: 58px; text-align: center; padding: 4px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px;
}
.check-opt { margin-top: 4px; align-items: flex-start; }
.check-opt input { margin-top: 3px; }
.check-opt svg { margin-top: 1px; color: var(--muted); }
.check-opt small b { color: var(--text); font-weight: 600; display: inline; font-size: inherit; }
.stage-status .spinner {
  width: 28px; height: 28px; border: 3px solid #333; border-top-color: var(--accent); border-radius: 50%;
  margin: 0 auto 10px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Mensagens */
.messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 0 8px; min-height: 0; }
.msg-start { padding: 16px 16px 8px; }
.msg-start .big-hash {
  width: 68px; height: 68px; border-radius: 50%; background: #41434a; display: grid; place-items: center; color: #fff;
}
.msg-start h2 { color: var(--text-strong); font-size: 30px; margin: 8px 0 4px; word-break: break-word; }
.msg-start p { margin: 0; color: var(--muted); }
.loading-older { text-align: center; color: var(--muted); font-size: 13px; padding: 8px; }
.day-div {
  display: flex; align-items: center; margin: 20px 16px 6px; color: var(--muted); font-size: 12px; font-weight: 600;
}
.day-div::before, .day-div::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-div span { padding: 0 8px; }
.msg {
  position: relative; display: grid; grid-template-columns: 56px 1fr; padding: 2px 48px 2px 16px; min-height: 22px;
}
.msg:hover { background: rgba(2,2,2,.06); background: #2e3035; }
.msg.head { margin-top: 16px; padding-top: 4px; }
.msg .gutter { display: flex; justify-content: flex-start; }
.msg .gutter .avatar { margin-top: 2px; cursor: pointer; }
.msg .hover-time {
  visibility: hidden; font-size: 11px; color: var(--muted); width: 44px; text-align: center; line-height: 22px;
}
.msg:hover .hover-time { visibility: visible; }
.msg .meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg .author { color: var(--text-strong); font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .author:hover { text-decoration: underline; }
.msg .time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg .content { white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; color: var(--text); min-width: 0; }
.msg .content pre {
  background: var(--bg-panel); border: 1px solid #1e1f22; border-radius: 4px; padding: 8px 10px;
  margin: 4px 0; overflow-x: auto; white-space: pre; max-width: 100%;
}
.msg .content pre code { background: none; padding: 0; font-size: 13px; }
.msg.pending .content { opacity: .5; }
.msg-tools {
  position: absolute; right: 16px; top: -14px; display: none; background: var(--bg-main);
  border: 1px solid #26272b; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.msg:hover .msg-tools { display: flex; }
.msg-tools .icon-btn { width: 30px; height: 30px; }
.msg-tools .icon-btn.danger:hover { color: var(--red); }
.owner-crown { color: #f0b232; display: inline-flex; }

/* Digitando */
.typing { height: 24px; flex-shrink: 0; padding: 0 16px; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.typing b { font-weight: 700; }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text); opacity: .4; animation: blink 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .2s; }
.typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 30% { opacity: 1; } }

/* Caixa de mensagem */
.composer { margin: 0 16px 20px; position: relative; flex-shrink: 0; }
.composer textarea {
  width: 100%; resize: none; border: 0; outline: none; background: var(--bg-input); border-radius: 8px;
  padding: 11px 16px; max-height: 40vh; line-height: 1.375; display: block; font-size: 15px;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-count { position: absolute; right: 10px; bottom: -17px; font-size: 11px; color: var(--muted); }
.composer-count.over { color: var(--red); }

/* Membros */
.members { width: 240px; flex-shrink: 0; background: var(--bg-side); overflow-y: auto; padding: 16px 8px 16px 8px; }
.members-group { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 16px 8px 4px; letter-spacing: .02em; }
.members-group:first-child { padding-top: 4px; }
.member { display: flex; align-items: center; gap: 12px; padding: 5px 8px; border-radius: 4px; cursor: pointer; position: relative; }
.member:hover { background: var(--bg-hover); }
.member .names { min-width: 0; flex: 1; }
.member .names b { display: flex; align-items: center; gap: 4px; font-weight: 500; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.member .names small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member.off { opacity: .4; }
.member.off:hover { opacity: 1; }
.member .live-pill { flex-shrink: 0; }

/* Início */
.home { flex: 1; overflow-y: auto; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; }
.home h1 { color: var(--text-strong); font-size: 28px; margin: 12px 0 6px; text-align: center; }
.home p { color: var(--muted); margin: 0 0 28px; text-align: center; max-width: 520px; }
.home-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; width: 100%; max-width: 560px; }
.home-card {
  background: var(--bg-side); border-radius: 10px; padding: 20px; text-align: left; display: flex; gap: 14px; align-items: center;
  border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.home-card:hover { border-color: var(--accent); background: #2f3136; }
.home-card .ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.home-card b { display: block; color: var(--text-strong); }
.home-card small { color: var(--muted); }
.home-servers { width: 100%; max-width: 560px; margin-top: 32px; }
.home-servers h3 { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .02em; margin: 0 0 8px; }
.home-server { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; cursor: pointer; }
.home-server:hover { background: var(--bg-hover); }
.home-server .rail-btn { width: 40px; height: 40px; border-radius: 14px; background: var(--bg-side); font-size: 13px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 100; display: grid; place-items: center;
  padding: 16px; animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 440px; background: var(--bg-main); border-radius: 10px; overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.5); animation: pop .15s ease-out; max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-head { padding: 24px 24px 0; text-align: center; position: relative; }
.modal-head h2 { margin: 0; color: var(--text-strong); font-size: 22px; }
.modal-head p { margin: 8px 0 0; color: var(--muted); }
.modal-head .close { position: absolute; right: 12px; top: 12px; }
.modal-body { padding: 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { background: var(--bg-side); padding: 16px 24px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-error { color: #ffb3b5; font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); text-transform: none; font-weight: 400; letter-spacing: 0; }
.invite-box { display: flex; gap: 8px; background: var(--bg-rail); padding: 6px; border-radius: 6px; align-items: center; }
.invite-box input { flex: 1; background: none; border: 0; outline: none; padding: 6px; font-size: 14px; min-width: 0; }
.invite-box .btn { min-height: 32px; }

/* Menu suspenso */
.menu {
  position: fixed; z-index: 95; background: var(--bg-float); border-radius: 8px; padding: 6px; min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: pop .1s ease-out;
}
.menu button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px;
  border-radius: 4px; font-size: 14px; color: #b5bac1; text-align: left; font-weight: 500;
}
.menu button:hover { background: var(--accent); color: #fff; }
.menu button.danger { color: var(--red); }
.menu button.danger:hover { background: var(--red); color: #fff; }
.menu hr { border: 0; height: 1px; background: #2e2f34; margin: 4px; }

/* Toasts */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--bg-float); color: var(--text-strong); padding: 10px 16px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.45); animation: pop .15s ease-out; max-width: 90vw; border-left: 4px solid var(--accent);
}
.toast.error { border-left-color: var(--red); }
.rt-banner {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 110; background: #b5862a; color: #fff;
  font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 0 0 8px 8px; max-width: 92vw; text-align: center;
}

/* ---------- Voz ---------- */
.ch.voice { margin-top: 1px; }
.voice-users { margin: 0 0 6px 30px; display: flex; flex-direction: column; gap: 1px; }
.voice-user {
  display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 4px; font-size: 14px;
  color: var(--muted); cursor: pointer; min-width: 0;
}
.voice-user:hover { background: var(--bg-hover); color: var(--text); }
.voice-user .vname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-user .vicons { display: flex; gap: 2px; color: var(--faint); }
.voice-user .avatar { transition: box-shadow .1s; }
.voice-user.speaking .avatar, .member.speaking .avatar { box-shadow: 0 0 0 2px var(--bg-side), 0 0 0 4px var(--green); }
.voice-user.speaking { color: var(--text-strong); }

.voice-panel { flex-shrink: 0; background: var(--bg-panel); border-bottom: 1px solid #1b1c1f; padding: 8px 8px 8px 10px; }
.vp-row { display: flex; align-items: center; gap: 4px; }
.vp-info { flex: 1; min-width: 0; cursor: pointer; line-height: 1.25; }
.vp-info:hover small { text-decoration: underline; }
.vp-status { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--green); }
.vp-status.wait { color: #f0b232; }
.vp-info small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-panel .icon-btn.leave:hover { color: var(--red); }
.voice-panel .icon-btn.on { color: var(--live); }

.user-panel .icon-btn.off { color: var(--red); }

.voice-view { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #1a1b1e; }
.vgrid {
  flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 12px; align-content: center;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.vtile {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; background: var(--tile, #2b2d31); overflow: hidden;
  max-height: 46vh; transition: box-shadow .1s;
}
.vtile.speaking { box-shadow: inset 0 0 0 3px var(--green); }
.vtile .vtile-name {
  position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px);
  background: rgba(0,0,0,.55); color: #fff; font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
}
.vtile .vtile-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vtile .vtile-live { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 6px; }
.vtile .vtile-live .btn { min-height: 28px; padding: 0 10px; font-size: 13px; }
.voice-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.voice-empty .big { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-side); display: grid; place-items: center; color: var(--text); }
.voice-empty h2 { margin: 6px 0 0; color: var(--text-strong); font-size: 24px; }
.voice-empty p { margin: 0 0 8px; color: var(--muted); }
.vcontrols { flex-shrink: 0; display: flex; justify-content: center; gap: 12px; padding: 14px 16px 20px; }
.vbtn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #2b2d31; color: var(--text);
  transition: background .15s;
}
.vbtn:hover { background: #3a3c42; }
.vbtn.off { background: #fff; color: #1e1f22; }
.vbtn.live { background: var(--accent); color: #fff; }
.vbtn.leave { background: var(--red); color: #fff; width: 64px; border-radius: 26px; }
.vbtn.leave:hover { background: var(--red-hover); }
.btn.join-voice { min-height: 44px; padding: 0 24px; font-size: 15px; background: var(--green); color: #fff; }
.btn.join-voice:hover { background: #1a8c4a; }

.type-pick { display: flex; flex-direction: column; gap: 8px; }
.type-opt {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; background: var(--bg-side);
  cursor: pointer; border: 1px solid transparent; text-transform: none; letter-spacing: 0;
}
.type-opt:has(input:checked) { border-color: var(--accent); background: #2f3136; }
.type-opt input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.type-opt b { display: block; color: var(--text-strong); font-size: 15px; }
.type-opt small { color: var(--muted); font-size: 13px; }

/* ---------- Fotos ---------- */
.avatar { overflow: visible; }
.avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: inherit;
}
.photo-edit { display: flex; align-items: center; gap: 18px; padding: 4px 0 6px; }
.photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.photo-actions .btn { min-height: 34px; }

/* ---------- Menções ---------- */
.mention {
  background: rgba(23,163,152,.22); color: #8ff3e8; padding: 0 3px; border-radius: 4px; font-weight: 600; cursor: pointer;
}
.mention:hover { background: var(--accent); color: #fff; }
.mention.me { background: rgba(240,178,50,.25); color: #ffd98a; }
.msg.mention-me { background: rgba(240,178,50,.07); box-shadow: inset 2px 0 0 #f0b232; }
.msg.mention-me:hover { background: rgba(240,178,50,.11); }
.msg.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: rgba(23,163,152,.3); } 100% { background: transparent; } }
.ping {
  background: var(--live); color: #fff; font-size: 11px; font-weight: 800; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; display: grid; place-items: center;
}
.rail-badge.live { font-size: 8px; }

.mention-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); background: var(--bg-side); border-radius: 8px;
  padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.45); z-index: 5; max-height: 320px; overflow-y: auto;
}
.pop-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 4px 8px 6px; }
.mention-opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.mention-opt b { color: var(--text-strong); font-weight: 600; }
.mention-opt small { color: var(--muted); margin-left: auto; }
.mention-opt.sel, .mention-opt:hover { background: var(--bg-active); }

/* ---------- Respostas ---------- */
.reply-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg-panel);
  border-radius: 8px 8px 0 0; padding: 6px 8px 6px 14px; font-size: 13px; color: var(--muted);
}
.reply-bar b { color: var(--text-strong); }
.reply-bar + textarea, .reply-bar:not([hidden]) ~ textarea { border-radius: 0 0 8px 8px; }
.reply-ref {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin: 0 0 4px 20px; padding-left: 36px;
  position: relative; font-size: 13px; color: var(--muted); cursor: pointer; min-width: 0;
}
.reply-ref::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 30px; height: 12px;
  border-left: 2px solid #4e5058; border-top: 2px solid #4e5058; border-top-left-radius: 6px;
}
.reply-ref b { color: var(--text); font-weight: 600; white-space: nowrap; }
.reply-ref .reply-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reply-ref:hover .reply-text { color: var(--text); }
.msg.has-reply { margin-top: 16px; padding-top: 4px; }

/* ---------- Reações ---------- */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 8px;
  background: var(--bg-panel); border: 1px solid transparent; font-size: 14px;
}
.react b { font-size: 12px; color: var(--muted); font-weight: 700; }
.react:hover { border-color: #4e5058; }
.react.me { background: rgba(23,163,152,.18); border-color: var(--accent); }
.react.me b { color: #8ff3e8; }
.react.add { color: var(--muted); opacity: 0; }
.msg:hover .react.add { opacity: 1; }
.emoji-picker {
  display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 8px; min-width: 0 !important;
}
.emoji-picker button { width: 36px; height: 36px; border-radius: 6px; font-size: 20px; display: grid; place-items: center; padding: 0; justify-content: center; }
.emoji-picker button:hover { background: var(--bg-active); }

/* ---------- Menu da pessoa (botão direito) ---------- */
.user-menu { width: 260px; padding: 8px; }
.um-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 6px; }
.um-head b { display: block; color: var(--text-strong); }
.um-head small { color: var(--muted); }
.user-menu hr { border: 0; height: 1px; background: #2e2f34; margin: 6px 4px; }
.user-menu button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px;
  border-radius: 4px; font-size: 14px; color: #b5bac1; font-weight: 500; text-align: left;
}
.user-menu button span { display: flex; align-items: center; gap: 6px; }
.user-menu button:hover { background: var(--accent); color: #fff; }
.user-menu button.danger { color: var(--red); }
.user-menu button.danger:hover { background: var(--red); color: #fff; }
.user-menu .box {
  width: 18px; height: 18px; border-radius: 4px; border: 2px solid #6d6f78; display: grid; place-items: center;
  font-style: normal; font-size: 12px; color: #fff;
}
.user-menu button.checked .box { background: var(--accent); border-color: var(--accent); }
.um-sub { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 4px 8px 2px; }
.um-vol { display: flex; flex-direction: column; gap: 8px; padding: 6px 8px 8px; font-size: 13px; color: #b5bac1; }
.um-vol span { display: flex; justify-content: space-between; }
.um-vol em { font-style: normal; color: var(--text-strong); font-weight: 700; }
.um-vol input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; cursor: pointer;
  background: linear-gradient(to right, var(--accent) var(--p, 50%), #4e5058 var(--p, 50%));
}
.um-vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 18px; border-radius: 3px; background: #fff; }
.um-vol input[type=range]::-moz-range-thumb { width: 14px; height: 18px; border-radius: 3px; background: #fff; border: 0; }

/* ---------- Voz: arrastar e estado ---------- */
.voice-user[draggable="true"] { cursor: grab; }
.voice-user.dragging { opacity: .4; }
.ch.voice.drop { background: rgba(23,163,152,.25); outline: 2px dashed var(--accent); outline-offset: -2px; color: var(--text-strong); }
.vp-status { cursor: pointer; }
.vp-status.bad { color: var(--red); }
.vtile-link {
  position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,.55); color: #f0b232; padding: 3px 8px; border-radius: 6px;
}
.vtile-link.bad { color: #ff8a8d; cursor: pointer; }
.vtile.failed .avatar { opacity: .45; }

/* ---------- Diagnóstico ---------- */
.diag { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.diag-wait { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); padding: 16px; }
.diag-wait .spinner {
  width: 26px; height: 26px; border: 3px solid #333; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
.diag-sec { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.diag-row { display: flex; gap: 10px; align-items: baseline; }
.diag-row > b { width: 16px; text-align: center; flex-shrink: 0; }
.diag-row em { color: var(--muted); font-style: normal; }
.diag .ok { color: var(--green); }
.diag .bad { color: var(--red); }
.diag-verdict { margin-top: 8px; padding: 10px 12px; border-radius: 6px; background: var(--accent-soft); color: #c8f7f1; line-height: 1.45; }
.diag-verdict.bad { background: rgba(242,63,67,.14); color: #ffc1c3; }
.diag-help { font-size: 13px; color: var(--text); line-height: 1.5; }
.diag-help ol { margin: 6px 0 0; padding-left: 20px; }
.diag-help code { word-break: break-all; }
.diag > .btn { align-self: flex-start; margin-top: 6px; }

/* ---------- Configurações (tela cheia) ---------- */
.settings {
  --s-main: #1a1a1e; --s-nav: #121214; --s-btn: #2b2b31; --s-btn-h: #35353c; --s-line: #2a2a30; --s-link: #949cf7;
  position: relative; display: grid; grid-template-columns: 256px 1fr; background: var(--s-main);
  width: min(1400px, calc(100vw - 64px)); height: min(900px, calc(100vh - 64px)); border-radius: 10px; overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,.6); border: 1px solid #26262b; animation: pop .15s ease-out;
}
.settings-back {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.72); display: grid; place-items: center; animation: fade .12s ease-out;
}
.set-nav { background: var(--s-nav); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.set-me { display: flex; align-items: center; gap: 12px; padding: 6px 8px 12px; text-align: left; border-radius: 8px; }
.set-me:hover { background: rgba(255,255,255,.04); }
.set-me b { display: block; color: var(--text-strong); font-size: 16px; }
.set-me small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.set-search {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--s-line); background: #18181b; border-radius: 8px;
  padding: 0 10px; height: 40px; color: var(--muted); margin-bottom: 8px;
}
.set-search input { flex: 1; background: none; border: 0; outline: none; font-size: 15px; min-width: 0; }
.set-list { display: flex; flex-direction: column; gap: 2px; }
.set-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: #b5bac1; font-size: 15px;
  font-weight: 500; text-align: left; width: 100%;
}
.set-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.set-item.active { background: var(--s-btn); color: var(--text-strong); }
.set-item.danger { color: var(--red); }
.set-item.danger:hover { background: rgba(242,63,67,.12); }
.set-subs { display: flex; flex-direction: column; margin: 2px 0 6px 18px; border-left: 2px solid var(--s-line); }
.set-subs button { text-align: left; padding: 7px 12px; color: var(--muted); font-size: 15px; margin-left: -2px; border-left: 2px solid transparent; }
.set-subs button:hover { color: var(--text); }
.set-subs button.on { color: var(--text-strong); border-left-color: var(--text-strong); }
.set-group { font-size: 13px; color: var(--muted); padding: 10px 8px 4px; }
.set-nav hr { border: 0; height: 1px; background: var(--s-line); margin: 8px 4px; width: calc(100% - 8px); }
.set-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.set-top {
  height: 50px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px;
  border-bottom: 1px solid var(--s-line); color: var(--text-strong); font-weight: 600;
}
.set-scroll { flex: 1; overflow-y: auto; }
.set-content { max-width: 740px; margin: 0 auto; padding: 56px 40px 120px; }
.set-content h2 { color: var(--text-strong); font-size: 22px; font-weight: 600; margin: 8px 0 22px; }
.set-row { display: flex; align-items: center; gap: 16px; min-height: 40px; margin-bottom: 30px; }
.set-row > b { flex: 1; color: var(--text-strong); font-weight: 600; font-size: 15px; }
.set-val { color: var(--text-strong); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.set-val .link { color: var(--s-link); }
.set-row .btn.secondary, .set-content .btn.secondary { background: var(--s-btn); min-width: 100px; min-height: 40px; border-radius: 8px; }
.set-row .btn.secondary:hover { background: var(--s-btn-h); }
.set-sep { border: 0; height: 1px; background: var(--s-line); margin: 10px 0 34px; }
.set-content .btn.primary { border-radius: 8px; }
.set-profile { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.set-form { display: flex; flex-direction: column; gap: 26px; }
.set-field { display: flex; flex-direction: column; gap: 10px; }
.set-field > span { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .02em; }
.set-field .input { background: #121214; border: 1px solid var(--s-line); border-radius: 8px; padding: 10px 12px; }
.set-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.set-btns .btn { border-radius: 8px; }
.set-preview { display: flex; flex-direction: column; gap: 10px; }
.set-savebar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 2;
  display: flex; align-items: center; gap: 14px; background: #111214; padding: 10px 10px 10px 18px; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); width: min(700px, calc(100% - 40px)); color: var(--text-strong); font-size: 14px;
}
.set-savebar span { flex: 1; }
.set-savebar .link { color: var(--text); }

/* ---------- Cartão de perfil ---------- */
.profile-card {
  width: 300px; background: #232428; border-radius: 10px; overflow: hidden; position: relative;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.profile-card.pop { position: fixed; z-index: 70; animation: pop .12s ease-out; }
.profile-card.static { box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.pc-banner { height: 106px; position: relative; overflow: hidden; }
.pc-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.pc-act {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; line-height: 1;
  display: grid; place-items: center;
}
.pc-act:hover { background: rgba(0,0,0,.75); }
.pc-avatar { position: absolute; left: 14px; top: 62px; }
.pc-avatar .avatar { box-shadow: 0 0 0 6px #232428; }
.pc-avatar .avatar .dot { width: 20px; height: 20px; right: 0; bottom: 2px; box-shadow: 0 0 0 5px #232428; }
.pc-body { padding: 56px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.pc-name { color: var(--text-strong); font-size: 20px; font-weight: 700; line-height: 1.2; word-break: break-word; }
.pc-user { color: var(--text); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -6px; }
.pc-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #f0b232; background: rgba(240,178,50,.12); padding: 1px 6px; border-radius: 4px; }
.pc-box { background: #1a1b1e; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.pc-voice { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; color: var(--text); }
.pc-voice:hover { background: #151619; }
.pc-voice span { flex: 1; }
.pc-voice svg { color: var(--green); }
.pc-live { display: flex; align-items: center; gap: 8px; }
.pc-live span:nth-child(2) { flex: 1; }
.pc-live .btn { min-height: 28px; padding: 0 10px; font-size: 13px; }
.pc-sec { font-size: 12px; font-weight: 700; color: var(--text-strong); margin-bottom: 6px; }
.pc-since { display: flex; gap: 16px; color: var(--text); font-size: 13px; flex-wrap: wrap; }
.pc-since span { display: inline-flex; align-items: center; gap: 6px; }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.pc-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-buttons:empty { display: none; }
.pc-buttons .btn { flex: 1; border-radius: 8px; min-height: 36px; }

/* ---------- Escolher / recortar imagem ---------- */
.ip-back { position: fixed; inset: 0; z-index: 130; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 16px; animation: fade .12s; }
.ip-box { width: 100%; max-width: 480px; background: #232428; border-radius: 12px; padding: 20px; box-shadow: 0 8px 40px rgba(0,0,0,.5); animation: pop .15s ease-out; }
.ip-box.crop { max-width: 500px; }
.ip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ip-head h2 { margin: 0; color: var(--text-strong); font-size: 20px; }
.ip-tiles { display: grid; gap: 12px; }
.ip-tile {
  height: 180px; border-radius: 10px; background: #2f3136; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; color: var(--text); transition: background .15s;
}
.ip-tile:hover { background: #383a40; }
.ip-tile b { color: var(--text-strong); font-size: 15px; }
.ip-tile small { color: var(--muted); }
.ip-sub { margin: 20px 0 2px; color: var(--text-strong); font-size: 16px; }
.ip-hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.ip-recents { display: flex; gap: 10px; flex-wrap: wrap; }
.ip-recents button { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: #2f3136; border: 2px solid transparent; }
.ip-recents button:hover { border-color: var(--accent); }
.ip-recents img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crop-stage { position: relative; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #000; touch-action: none; max-width: 100%; }
.crop-stage canvas { display: block; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-mask {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.6); outline: 4px solid #fff;
}
.crop-mask.circle { border-radius: 50%; }
.crop-mask.rect { border-radius: 8px; }
.crop-controls { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 18px 0 8px; color: var(--muted); }
.crop-controls input[type=range] { width: 160px; accent-color: #fff; }
.crop-controls .icon-btn { margin-left: 24px; }
.ip-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.ip-foot .link { color: var(--s-link, #949cf7); }
.ip-foot .btn { border-radius: 8px; min-width: 100px; }

@media (max-width: 760px) {
  .settings { grid-template-columns: 1fr; grid-template-rows: auto 1fr; width: 100vw; height: 100dvh; border-radius: 0; }
  .set-nav { max-height: 40vh; }
  .set-content { padding: 20px 16px 100px; }
  .set-profile { grid-template-columns: 1fr; }
  .set-savebar { left: 50%; width: calc(100vw - 24px); }
  .set-row { flex-wrap: wrap; }
}

.update-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 140; display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--accent); color: #fff; padding: 6px 12px; font-size: 14px; font-weight: 600; animation: fade .2s;
}
.update-bar span { display: inline-flex; align-items: center; gap: 8px; }
.update-bar .btn { background: #fff; color: #0d4f4a; min-height: 30px; border-radius: 6px; }
.update-bar .btn:hover { background: #e6fffb; }
.update-bar .icon-btn { color: #fff; }
.update-bar .icon-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ---------- Configurações: voz ---------- */
.vz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; }
.vz-field { display: flex; flex-direction: column; gap: 10px; }
.vz-field b { color: var(--text-strong); font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; }
.vz-field em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 13px; }
.vz-select {
  appearance: none; background: #121214 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b5bac1' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--s-line, #2a2a30); border-radius: 8px; padding: 10px 34px 10px 12px; font-size: 15px; color: var(--text-strong);
  width: 100%; cursor: pointer; text-overflow: ellipsis;
}
.vz-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.vz-select option { background: #1a1a1e; }
.vz-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; cursor: pointer; margin: 6px 0;
  background: linear-gradient(to right, var(--accent) var(--p, 50%), #3a3a42 var(--p, 50%));
}
.vz-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.vz-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }
.vz-test { display: flex; align-items: center; gap: 18px; margin-top: 30px; }
.vz-test .btn { border-radius: 8px; min-height: 40px; flex-shrink: 0; min-width: 164px; }
.btn.blurple { background: var(--accent); color: #fff; }
.btn.blurple:hover { background: var(--accent-hover); }
.vz-meter { flex: 1; display: flex; gap: 4px; height: 34px; align-items: stretch; min-width: 0; }
.vz-meter i { flex: 1; background: #3a3a42; border-radius: 2px; transition: background .05s; }
.vz-meter i.on { background: var(--green); }
.vz-help { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.vz-h3 { color: var(--text-strong); font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.vz-radios { display: flex; flex-direction: column; gap: 14px; }
.vz-radio { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.vz-radio input { accent-color: var(--accent); width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; }
.vz-radio b, .vz-toggle b { display: block; color: var(--text-strong); font-size: 15px; font-weight: 600; }
.vz-radio small, .vz-toggle small { color: var(--muted); font-size: 13px; }
.vz-toggles { display: flex; flex-direction: column; gap: 18px; margin-top: 22px; }
.vz-toggle { display: flex; align-items: center; gap: 16px; cursor: pointer; }
.vz-toggle span { flex: 1; }
.vz-toggle input { display: none; }
.vz-toggle .sw { width: 42px; height: 24px; border-radius: 12px; background: #4e5058; position: relative; flex-shrink: 0; transition: background .15s; }
.vz-toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.vz-toggle input:checked + .sw { background: var(--accent); }
.vz-toggle input:checked + .sw::after { left: 21px; }
.set-content .btn.secondary svg { margin-right: 2px; }

/* ---------- Painel "Voz conectada" e botões do usuário ---------- */
.voice-panel { padding: 10px 8px 8px 10px; }
.vp-row { gap: 6px; }
.vp-signal { color: var(--green); display: grid; place-items: center; width: 32px; height: 32px; cursor: pointer; border-radius: 6px; }
.vp-signal:hover { background: var(--bg-hover); }
.vp-signal.wait { color: #f0b232; }
.vp-signal.bad { color: var(--red); }
.vp-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.vp-btn { height: 34px; border-radius: 8px; background: #2b2d31; color: var(--text); display: grid; place-items: center; }
.vp-btn:hover { background: #35373c; }
.vp-btn.on { background: var(--accent); color: #fff; }
.up-pair { display: flex; align-items: center; border-radius: 6px; }
.up-pair:hover { background: var(--bg-hover); }
.up-pair .icon-btn { width: 30px; }
.up-pair .icon-btn:hover { background: none; }
.up-pair.off .icon-btn { color: var(--red); }
.up-caret { width: 14px; height: 32px; display: grid; place-items: center; color: var(--muted); margin-left: -4px; }
.up-caret:hover { color: var(--text); }
.user-panel { gap: 2px; }

.scrim { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .members { position: absolute; right: 0; top: 48px; bottom: 0; z-index: 20; box-shadow: -8px 0 24px rgba(0,0,0,.35); }
  .main { position: relative; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail, .sidebar { position: fixed; top: 0; bottom: 0; z-index: 40; transform: translateX(-320px); transition: transform .2s ease; }
  .rail { left: 0; width: 72px; }
  .sidebar { left: 72px; width: min(260px, calc(100vw - 72px)); }
  .app.drawer-open .rail, .app.drawer-open .sidebar { transform: none; }
  .app.drawer-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30; }
  .chat-header .menu-btn { display: inline-grid; margin-left: -8px; }
  .msg { padding-right: 16px; grid-template-columns: 52px 1fr; }
  .composer { margin: 0 10px 14px; }
  .composer textarea { font-size: 16px; }
  .header-live .label-long { display: none; }
  .stage { height: 42%; }
  .msg-tools { top: -10px; right: 8px; }
}
